Hacker News

Top stories

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

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!