Hacker News

New stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. How did AMD Ryzen get 50% faster in two years?(lemire.me ↗)
    discuss
  2. The Implications of Linguistic Illegibility for LLM Security(arxiv.org ↗)
    discuss
  3. I (Re)Created the Best Discovery Playlist on Spotify(spotify.com ↗)
    discuss
  4. Xcode 27.1 Beta Release – Support for iPhone Duo(idmsa.apple.com ↗)
    1comments
  5. Meta's Copyright System Is Being Weaponized Against Albanian Protesters(wired.com ↗)
    discuss
  6. Virginia governor creates an AI task force and moves to restrain data centers(theverge.com ↗)
    discuss
  7. Add Eye Disease to the Growing List of Air Pollution's Dangers(studyfinds.com ↗)
    discuss
  8. DigitalOcean has $3M for DHH and nothing for CSS-Tricks(keith.is ↗)
    discuss
  9. Show HN: A model index from the AI Gateways(computesdk.com ↗)
    discuss
  10. Cache-to-Cache: Direct Semantic Communication Between Large Language Models(arxiv.org ↗)
    discuss
  11. Gov. Newsom signs executive order targeting AI safety 'before it's too late'(ktla.com ↗)
    discuss
  12. We're worrying about the wrong AI apocalypse(vox.com ↗)
    discuss
  13. Marvell pushes GlobalFoundries to light up wafer production(theregister.com ↗)
    discuss
  14. Saving another 100TB of RAM with math (and Rust)(cloudflare.com ↗)
    discuss
  15. North Korea's fake job interviews infected 30k devices(theregister.com ↗)
    discuss
  16. An update to how we count public views across YouTube(support.google.com ↗)
    discuss
  17. 25 years of contributing to Postgres with Peter Eisentraut(talkingpostgres.com ↗)
    discuss
  18. A Third of Americans Still Can't Name the Three Branches of Government(studyfinds.com ↗)
    discuss
  19. Fathom: All in one Jellyfin client with Seer and YouTube(github.com/fathom-media ↗)
    discuss
  20. Anthropic's CEO says that safety hinges on understanding how AI "thinks."(wired.com ↗)
    discuss
  21. Who's a Better Writer: A.I. Or Humans? NYTimes Quiz(nytimes.com ↗)
    1comments
  22. Show HN: In Meeting – A native macOS Mic/Cam observer for home automation(github.com/fellowgeek ↗)
    discuss
  23. Show HN: Repairo – Auto fixing breaking changes in your codebase(github.com/adityacs50-lab ↗)
    discuss
  24. Incrementally Computing 7B Permission Checks(feldera.com ↗)
    discuss
  25. Apple releases iPhone Duo simulator and Xcode 27.1 beta(developer.apple.com ↗)
    1comments
  26. The new AgentCore runtime: Elastic, optimized, and consistently fast starts(amazon.com ↗)
    discuss
  27. Love vs. Wiley Book Writers: A Publishing Scam Gets a Rare Comeuppance(writerbeware.blog ↗)
    1comments
  28. Record 38% of new vehicle sales to be EVs in 2030, study finds(news.harvard.edu ↗)
    discuss
  29. Putin Uses Unlicensed Windows(twitter.com/christogrozev ↗)
    1comments
  30. PC ports of old console games are the new AI vibe coding battleground(pcgamer.com ↗)
    discuss

Show HN: pg_raw_parse - parse PgSQL in Rust

1 pointsby 3h agogithub.com
0 comments
Hey HN!

We built a wrapper on top of the Postgres native SQL parser to allow us to parse and manipulate SQL in Rust.

Our library forks libpg_query [1] and its original Rust bindings, pg_query.rs [2]. By not using Protobuf and mapping our structs directly on top of the Postgres arena allocator, we are able to achieve a pretty massive speedup:

- 20-60x parse/deparse, depending on query size

- 90% memory utilization decrease vs pg_query.rs

This library is used in production in PgDog [3], but has no dependencies to it, so you can use it in your Rust apps without issues.

It also provides access to Postgres internals used to walk and transform query ASTs. Those are actually really cool. Check out the README for details, but we basically use a bunch of Rust macros to generate 100% compatible Rust structs directly from C headers.

This makes it really easy to upgrade major versions, i.e., we just bump the submodules and re-compile.

Let us know what you think!

- PgDog team

[1]: https://github.com/pganalyze/libpg_query

[2]: https://github.com/pganalyze/pg_query.rs

[3]: https://github.com/pgdogdev/pgdog

A quiet thread, for now.Start the conversation on HN ↗