frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Show HN: Yantra – an LALR(1) parser generator for C++

https://github.com/TantrixAuto/yantra
4•renjipanicker•34m ago
Yantra is a C++ parser generator: lexer, parser, and AST walker all generated from one tool. It builds the whole AST first, then walks it.

Most LALR parser generators (Yacc, Bison, Lemon) run your semantic actions during parsing, as each rule reduces, bottom-up.

That means at the time a rule's action runs, you don't yet know what its parent looks like. This pushes a lot of grammars toward hand-built AST classes and a separate walking pass whenever you need to look ahead into siblings or defer a decision until more context is available.

On the other hand, Yantra always builds the whole AST first, then walks it top-down in a separate pass, calling your semantic actions as it goes. A parent rule's action can run before its children are visited.

A single grammar can define more than one walker. For example, one that emits C++, another that emits Java, from the same parse. The AST and the walker classes are both generated for you.

A small example (full version, with compile commands, in the README):

  start := expr;

  expr := expr(a) PLUS expr(b)
  %{
      std::cout << "Adding" << std::endl;
  %}

  expr := NUMBER(N)
  %{
      std::cout << "Number: " << N.text << std::endl;
  %}

  NUMBER := "\d+";
  PLUS := "\+";
  WS := "\s+"!;
Running this on "1 + 2 + 3" prints:

  Adding
  Number: 1
  Adding
  Number: 2
  Number: 3
The outer "Adding", the root of the tree, prints first, before either of its children. That's only possible because the whole tree exists before any action runs.

Some other things about it: integrated lexer with mode support (for things like nested comments), an optional amalgamated single-file output mode with a generated main(), C++23, MIT licensed.

It's young (0.5.1, pre-1.0) and single-maintainer, so treat it as early. I'd rather know what breaks than have it look more finished than it is.

Known gaps are listed at https://github.com/TantrixAuto/yantra/blob/main/docs/known_l...

Repo: https://github.com/TantrixAuto/yantra

Feedback and questions are all welcome. I'll be around.

Can Your Identity Platform Pass the Black Friday Test?

https://fusionauth.io/blog/black-friday-identity-test
1•mooreds•2m ago•0 comments

Agents are choosing the software infrastructure now, and we're not ready

https://redmonk.com/jgovernor/agents-are-choosing-the-software-infrastructure-now-and-were-not-re...
1•mooreds•2m ago•0 comments

Polytoken is a local-first AI coding agent daemon

https://docs.polytoken.dev/introduction/
1•mooreds•3m ago•0 comments

The Invention of Islamic Invention

https://www.cremieux.xyz/p/the-invention-of-islamic-invention
1•nailer•12m ago•0 comments

Show HN: BlindFlag – Double-blind dealbreaker test via client-side PSI

https://blindflag.com
1•blindflag•15m ago•0 comments

Universal Modder: Let Any AI Coding Agent Mod Almost Any PC Game

https://github.com/rehan-remade/universal-modder
1•wertyk•16m ago•0 comments

Old Games Weren't More Optimized – You Just Forgot the Pain

https://www.sapphirenation.net/old-games-were-not-more-optimized-you-just-forgot-the-pain
2•davikr•17m ago•0 comments

AI and TCS: The Next Six Months Working Group Report

https://simons.berkeley.edu/AITCSreport?inline=
1•num42•17m ago•0 comments

Steelers ex-coach Mike Tomlin has been building a Minecraft city for 12 years

https://www.youtube.com/playlist?list=PLS-_IoE-EKXU
3•Vaslo•19m ago•0 comments

Howard Stern corrects a caller about OS/2 Warp vs. Windows 95 (1995)

https://archive.org/details/howard-stern-os2
1•sippingabonedry•20m ago•1 comments

California bans child marriage, a practice still legal in 32 US states

https://www.bbc.com/news/articles/c6rm9mnn0w3eo
9•dabinat•22m ago•2 comments

Show HN: War365 - Satire

https://war365.yatesframe.com/
1•beernutz•22m ago•0 comments

NOOP – Offline Whoop Companion App

https://github.com/ryanbr/noop
1•jgx0•23m ago•0 comments

Drawing electricity from this sodium-water reactor prevents explosion, in theory

https://www.youtube.com/watch?v=l0qqUE1pgXU
1•fallinditch•28m ago•0 comments

Religious Scholars Met with Anthropic. What They Heard Stunned Them

https://www.nytimes.com/2026/09/29/us/anthropic-claude-morals-ai.html
3•kanamekun•28m ago•2 comments

Did Iran Just Use Russia's "Kalinka" System on Starlink? (January 20, 2026)

https://nationalinterest.org/blog/buzz/did-iran-just-use-russias-kalinka-jamming-system-starlink-...
2•rexbee•29m ago•0 comments

Show HN: Yantra – an LALR(1) parser generator for C++

https://github.com/TantrixAuto/yantra
4•renjipanicker•34m ago•0 comments

XTechHumanoid winners advance military exploration of humanoid capabilities

https://www.war.gov/News/News-Stories/Article/Article/4613847/robotics-competition-winners-advanc...
1•lelandfe•34m ago•0 comments

Side Injection Test – Longshot Space [video]

https://www.youtube.com/watch?v=tbj0yfNz4_I
1•pinnola•35m ago•0 comments

Cities Are Forced to Funnel License Plate Data to a Federal Surveillance Program

https://www.404media.co/how-cities-are-forced-to-funnel-license-plate-data-to-a-massive-federal-s...
14•ripe•38m ago•0 comments

Gold beetles to Darwin's finds: The 70M museum artefacts going online

https://www.bbc.com/news/articles/cv5yjgrj4ello
1•1659447091•43m ago•0 comments

The main purpose of Z-Library is to enhance the level of education of everyone

https://z-lib.gd/fundraising
2•Cider9986•44m ago•0 comments

Follower counts don't equal search visibility – vetting creators before ad buys

https://hikerapi.com/
1•yumrbeats•47m ago•0 comments

8 Questions about Minds and AI

https://www.echohive.ai/eight-questions-about-minds-and-ai
1•echohive42•48m ago•1 comments

Aw1-breaker: Sub-0.02ms AST circuit breaker for Python AI agent tools

https://github.com/MvikManners/aw1-circuit-breaker
1•MvikVela•50m ago•0 comments

Show HN: I built a directory to set up ChatGPT's always-on agents in one paste

https://dotbotdirectory.com
1•iamdemetrius•51m ago•0 comments

Claude's new auto eval tool

https://hamel.dev/blog/posts/claude-auto-evals/index.html
3•hamelsmu•52m ago•0 comments

Google's AI Push into Schools: 'It Slowed My Thinking Down'

https://www.wsj.com/tech/ai/google-ai-gemini-education-schools-1ec0972a
1•alexpetralia•52m ago•0 comments

Jevotron: Multiple Jev integrations from the command line

https://cmungall.github.io/jevotron/
3•chrismungall•52m ago•0 comments

Show HN: I built Goodreads for startup founders (with Grok)

https://founderread.com/
1•westche2222•54m ago•0 comments