Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. When did Google get so weird? (sancho.bearblog.dev)
    277comments
  2. Ember-1 (fireworks.ai)
    160comments
  3. Lunar Terminator Paradox (secretsauce.net)
    17comments
  4. Alan Kay's answer to “Did the ENIAC have a BIOS”? (quora.com)
    19comments
  5. The state of SIMD in Rust in 2026 (shnatsel.github.io)
    19comments
  6. Show HN: Lofi Cities – Pixel-art city nights with browser-generated lofi (loficities.com)
    59comments
  7. There is more to code review than (automatable) detection (adaptivecapacitylabs.com)
    14comments
  8. Don't couple your Go code to GitHub (iain.rocks)
    51comments
  9. Imp is a full port of DSPy to the BEAM (github.com/deepfates)
    5comments
  10. S3 Is the Future, S3 Is the Past (btrblocks.com)
    13comments
  11. What I did at Recurse Center (thill.me)
    14comments
  12. In an $80 motel room, a discovery to shed light on the origins of life (nytimes.com)
    78comments
  13. Oral history of John Chowning, inventor of FM synthesis [video] (youtube.com)
    6comments
  14. Replacing the old battery on rechargeable bike lights (jvns.ca)
    67comments
  15. My Recent Woodworking Projects (notoriousbfg.com)
    2comments
  16. Writing Efficient C++ Code (2013) (asawicki.info)
    77comments
  17. Previously unheard recordings of John Coltrane, captured by Frank Tiberi (jazzwise.com)
    15comments
  18. A New Experiment Meta-Strategy (chillphysicsenjoyer.substack.com)
    —discuss
  19. The Cartesian Hand: In-Hand Manipulation with All-Linear Fingers (generalroboticslab.com)
    8comments
  20. Flip Fluid on Flip Dots (mitxela.com)
    24comments
  21. Fragment of oldest known peace treaty found in Turkey (livescience.com)
    8comments
  22. Fakecloud: Local AWS cloud emulator for integration tests (fakecloud.dev)
    49comments
  23. The Normalization of Inexplicable Failures (ihatethefuture.com)
    94comments
  24. EV Sales Are Booming in Europe with Gasoline at $10 a Gallon (bloomberg.com)
    23comments
  25. Faster prompt lookup drafting in llama.cpp (jadidbourbaki.github.io)
    9comments
  26. KICKI: a DECsystem1060 (icm.museum)
    2comments
  27. Show HN: TinyAIArena watch AI agents battle it out (tinyaiarena.com)
    40comments
  28. Video CDs Break Windows Explorer (clydesnotes.blogspot.com)
    32comments
  29. On caring for user data: NeoVim caused Vim undo files to be deleted (aresluna.org)
    303comments
  30. Show HN: Cartopolis, interactive globe-sized 3D world (garage44.eu)
    —discuss

Calculate the Digits of Pi with DuckDB and PRQL

6 pointsby 3y agoprql-lang.org
1 comments
3y agoHN ↗

TL;DR: PRQL recently added a `loop` construct which makes it Turing Complete and allows doing cool things like calculating Pi right in your database.

Last week saw the 0.6 release of PRQL which brought with it the capability to express Recursive CTEs in PRQL. "Recursive" CTEs aren't actually truly recursive in the sense that that term is usually used, rather they use a "recursive" (i.e. self-referential) syntax to provide a looping construct in SQL.

PRQL is a modern, functional query language for transforming data. One of its goals is to simplify working with data wherever you can currently use SQL. As such it compiles to SQL while making available modern ergonomics such as f-strings, as well as not so modern features such as functions.

Given that the underlying semantics of Recursive CTEs are really about iteration or "looping", we have called this feature loop in PRQL.

This post introduces the new `loop` feature in PRQL and shows how this can be used to calculate Pi right in your database!

Happy Pi Day everyone!