frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Don't Use ISO/IEC 14977:1996 Extended Backus-Naur Form (EBNF) (2023)

https://dwheeler.com/essays/dont-use-iso-14977-ebnf.html
31•gslin•2d ago

Comments

dwheeler•5h ago
I'm the author. Ask me anything!
teddyh•5h ago
Is there any documented version of EBNF suitable for general use?
ggm•4h ago
IETF uses ABNF https://datatracker.ietf.org/doc/html/rfc5234

Commentaries say its different, but the differences might not matter?

ucarion•4h ago
Is the main objection to RFC5234 its weird syntax for repetition (*THING, [THING], 5THING)?
90s_dev•2h ago
What's your favorite programming language and why is it C?
arh68•2h ago
Great article. Informative, qualified. I had not realized how splintered the [E]BNF syntax is, like in the way I already knew timestamps are (3339 vs 8601 vs mm/dd/yyyy &c &c).

Q: what's your ideal way to write Unicode characters clearly? In the W3C/XML spec they'll have stuff like [#x200C-#x200D] but I have no idea what those are, without like a dictionary on hand. Points for specificity, but it doesn't scream "readable".

Your point about standards-not-publicly-available is unfortunately similar to, well, laws. In some areas, "the laws" themselves are not public (!) though perhaps it's a digression better to not get into

pedantically, s/unabiguously/unambiguously/g

alfiedotwtf•1h ago
So if not EBNF for defining grammars, what should people be using ie what would be your preferred that would be powerfully enough and general purpose?

I’ve never seen PCRE used for grammars and not sure if it would be powerfully enough for all cases, but personally I think it would be pretty cool since I find it easier to read than EBNF and it’s so widely used people can slot a specification right into code and it should just work

HarHarVeryFunny•4h ago
> One of the most common operations in a grammar, by far, is concatenation (aka sequencing). ISO/IEC 14977:1996 requires that a comma be used for every concatenation, so any sequence of N symbols will have N-1 commas.

It seems they were trying really hard to make EBNF NOT look like the grammar it is representing.

> ISO/IEC 14977:1996 represents “one or more” as { symbol }- which means “0 or more symbols, and then subtract the empty set

It's almost as if they were looking for a special syntax to express "1 or more".

Bizarre ... just bizarre.

mannyv•4h ago
(4) -> I would say that the lack of regex use is a plus. Yes I use them all the time. For anything complicated I'll just ask ChatGPT to make it. And of course, are regexs all the same across everything?

(5) -> Once you get it you get it.

Every language specification is odd in its own special way. In any case I haven't really seen BNF/EBNF used in the last few years, so this is probably a moot discussion.

alfiedotwtf•1h ago
How are the grammars you see on a regular basis specified if not by BNF?
mdaniel•48m ago
I'm not the person you asked but I believe there are two broad classes of answers: hand rolled parsers and PEG grammars

e.g. https://github.com/llvm/llvm-project/blob/llvmorg-20.1.5/cla... and https://github.com/python/cpython/blob/v3.13.3/Grammar/pytho...

Mofpofjis•4h ago
The complaints about ISO Prolog, and about ISO standards generally not being available publicly / at no cost, resonate a lot with me. If you compare eg. the POSIX and the ISO C development workflows, and their respective end results, there's a world of difference.

"ISO" (International Standards Organization), where you have "national member bodies", should absolutely be a thing of the past for programming languages (or for anything related to computing). My country's national body's own homepage has a huge tirade, aiming to "dispel myths", such as the "myth" that "standards should be available free of charge". Meanwhile, lots of std orgs have published computing standards with various degrees of openness already.

ISO is a relic when it comes to computing. (So are other standards bodies that choose to remain proprietary; like those behind PCI, SCSI, ... Computing is ubiquitous and these bodies should be forced open by law, for the public interest.)

convolvatron•3h ago
doesn’t have to be a legal enforcement if vendors just don’t work with bodies that insist on this counterproductive notion of standards as a profit center.

unfortunately i think there us some degree of collusion here. it’s easier to get your existing proprietary standards ratified if there are fewer players in the room and the palms that need to be greased are clearly marked

OneDeuxTriSeiGo•51m ago
It's not exactly clear cut. Standards are unfortunately in general quite expensive to produce and maintain.

Software oriented standards are certainly cheaper than metallurgy, machining, manufacturing, building construction, environmental, health & safety, and the other big classes of standards however they still have quite a cost.

Historically the ISO standards development process for software standards (like the C or C++ standards) happened only in small part asynchronously and historically required large, extended-duration committee meetings where all the details were hashed out in person. This process only really started to change during COVID but even then it's still a very in-person synch-heavy process and that's not exactly cheap to run.

And with most standards, the FDIS (final draft international standard) revisions are made public. They can be found online even if they can be annoying to dig up. For 99% of cases the FDIS revision is more than sufficient and is identical to the published standard minus a typo or grammar mistake here and there.

As the average SW dev or engineer of course you don't need to fork over the cost for the published standard but any large company will probably purchase a catalog of standards rather than deal with the overhead of dealing with FDIS (and any legal risk from not following the "true" standard).

It is also worth noting that pretty much every university library (and many public non-university libraries) has some contract or service that provides access to copies of the standard to members free of cost.

fanf2•2h ago
Yeah

For the horrible tedious details, see the “Policy for the distribution of ISO publications and the protection of ISO’s copyright” aka ISO POCOSA 2012.

https://archive.org/details/iso-pocosa

userbinator•3h ago
IMHO ABNF is just as annoying to read, especially its insistence on '/' instead of '|' for alternation (when | has universally become the "OR" symbol in other languages) and "%x" for hex prefixes. My preference for syntax descriptions is [ ] for "optional", ",,," or "+" for "1 or more", "*" for "0 or more", and "{min,max}" or "{n}" for repetition ranges, which closely mirrors regex syntax; I'm not sure if this has been standardised or even has a name, but I've seen it far more often than ABNF/EBNF.
kstenerud•2h ago
These are some of the many reasons why I developed the Dogma metalanguage.

https://dogma-lang.org/

https://github.com/kstenerud/dogma/blob/master/v1/dogma_v1.0...

That, and also I needed a language that could describe binary data.

mdaniel•57m ago
Do I correctly understand that you don't currently have a parser generator for .dogma files? I tried clicking around in a few of the adjacent repos without much luck

Anyway, my go-to tire kicking for any such binary file description format is parsing .pdf files, since they are ferociously hard, and include backreferences

PJBaker•1h ago
> every single language document uses its own notation, which is more often than not, a dialect of the (Extended) Backus-Naur Form

I came across this recently while writing an article that references Lua, Go and Python (3.8) syntax. Each of them uses a slightly different form of EBNF.

To make them more easily comparable, I wanted to convert all three to the same format. Looking for something fairly standard (not entirely ad-hoc but also not as formal as ISO/IEC EBNF or RFC 5234 ABNF), I came across Wirth Syntax Notation [0] [1]:

    syntax = { production } .
    production = identifier "=" expression "." .
    expression = term { "|" term } .
    term = factor { factor } .
    factor = identifier | literal | "(" expression ")" | "[" expression "]" | "{" expression "}" .
    literal = "\"" character {character} "\"" .
It turns out that the Go specification already uses WSN [2]. I converted Lua and Python, and then could work with all three language grammars in a consistent, machine-readable notation.

[0] https://en.wikipedia.org/wiki/Wirth_syntax_notation

[1] https://dl.acm.org/doi/10.1145/359863.359883

[2] https://go.dev/ref/spec#Notation

egberts1•46m ago
Here is a list of all variants of EBNFs:

https://github.com/egberts/vim-syntax-ebnf

And a EBNF format detector:

https://github.com/egberts/filetype-ebnf-grammars

And a master list of all variants of EBNF:

http://www.cs.man.ac.uk/~pjj/bnf/ebnf.html

egberts1•44m ago
Still use EBNF, so some of my tools, citations, and sources are:

Here is a list of all variants of EBNFs as well as Vim syntax highlighter for EBNF variants:

https://github.com/egberts/vim-syntax-ebnf

And a EBNF format detector:

https://github.com/egberts/filetype-ebnf-grammars

And a master list of all variants of EBNF:

http://www.cs.man.ac.uk/~pjj/bnf/ebnf.html

DDoSecrets publishes 410 GB of heap dumps, hacked from TeleMessage

https://micahflee.com/ddosecrets-publishes-410-gb-of-heap-dumps-hacked-from-telemessages-archive-server/
199•micahflee•2h ago•45 comments

The Windows Subsystem for Linux is now open source

https://blogs.windows.com/windowsdeveloper/2025/05/19/the-windows-subsystem-for-linux-is-now-open-source/
1138•pentagrama•11h ago•734 comments

Have I Been Pwned 2.0

https://www.troyhunt.com/have-i-been-pwned-2-0-is-now-live/
373•LorenDB•6h ago•125 comments

A shower thought turned into a Collatz visualization

https://abstractnonsense.com/collatz/
53•abstractbill•2h ago•4 comments

Jules: An Asynchronous Coding Agent

https://jules.google/
229•travisennis•6h ago•101 comments

What are people doing? Live-ish estimates based on global population dynamics

https://humans.maxcomperatore.com/
32•willbc•2h ago•12 comments

Zod 4

https://zod.dev/v4
606•bpierre•12h ago•187 comments

GitHub Copilot Coding Agent

https://github.blog/changelog/2025-05-19-github-copilot-coding-agent-in-public-preview/
360•net01•11h ago•213 comments

Claude Code SDK

https://docs.anthropic.com/en/docs/claude-code/sdk
287•sync•9h ago•126 comments

Launch HN: Better Auth (YC X25) – Authentication Framework for TypeScript

185•bekacru•12h ago•67 comments

Kilo: A text editor in less than 1000 LOC with syntax highlight and search

https://github.com/antirez/kilo
80•klaussilveira•7h ago•11 comments

Terraform MCP Server

https://github.com/hashicorp/terraform-mcp-server
42•kesor•4h ago•6 comments

Is-even-ai – Check if a number is even using the power of AI

https://www.npmjs.com/package/is-even-ai
179•modinfo•3h ago•76 comments

Run GitHub Actions locally

https://github.com/nektos/act
179•flashblaze•3d ago•71 comments

Game theory illustrated by an animated cartoon game

https://ncase.me/trust/
226•felineflock•11h ago•40 comments

Show HN: A free, privacy preserving, archive of public Discord servers

https://searchcord.io
4•searchcord•49m ago•0 comments

The forbidden railway: Vienna-Pyongyang (2008)

http://vienna-pyongyang.blogspot.com/2008/04/how-everything-began.html
148•1317•8h ago•39 comments

Remarks on AI from NZ

https://nealstephenson.substack.com/p/remarks-on-ai-from-nz
133•zdw•3d ago•71 comments

xAI's Grok 3 comes to Microsoft Azure

https://techcrunch.com/2025/05/19/xais-grok-3-comes-to-microsoft-azure/
97•mfiguiere•11h ago•88 comments

Too Much Go Misdirection

https://flak.tedunangst.com/post/too-much-go-misdirection
154•todsacerdoti•12h ago•74 comments

Memory Consistency Models: A Tutorial

https://jamesbornholt.com/blog/memory-models/
9•tanelpoder•2h ago•1 comments

WireGuard vanity keygen

https://github.com/axllent/wireguard-vanity-keygen
55•simonpure•7h ago•7 comments

Patience too cheap to meter

https://www.seangoedecke.com/patience-too-cheap-to-meter/
17•swah•2d ago•6 comments

Ask HN: When will managers be replaced by AI?

14•GianFabien•1h ago•7 comments

Self-Hosting Moose with Docker Compose, Redis, Temporal, Redpanda and ClickHouse

https://docs.fiveonefour.com/moose/deploying/self-hosting/deploying-with-docker-compose
26•Callicles•4h ago•8 comments

ClawPDF – Open-Source Virtual/Network PDF Printer with OCR and Image Support

https://github.com/clawsoftware/clawPDF
179•miles•15h ago•23 comments

Glasskube (YC S24) is hiring in Vienna to build Open Source deployment tools

https://www.ycombinator.com/companies/glasskube/jobs/wjB77iZ-founding-engineer-go-typescript-kubernetes-docker
1•pmig•10h ago

Microbes in Gowanus teach lessons on fighting industrial pollution

https://engineering.nyu.edu/news/microbes-brooklyn-superfund-site-teach-lessons-fighting-industrial-pollution
13•eatonphil•3d ago•2 comments

Dilbert creator Scott Adams says he will die soon from same cancer as Joe Biden

https://www.thewrap.com/dilbert-scott-adams-prostate-cancer-biden/
289•dale_huevo•10h ago•334 comments

The truth behind the accuracy of weather forecasts

https://www.abc.net.au/news/2025-05-16/weather-forecast-accuracy-bom/105297540
45•Brajeshwar•3d ago•32 comments