Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is there any common spec where you can mechanically go from spec to parser? HTTP, SMTP, DNS, HTML, CSS, Javascript, Ruby, Python, C, ... I basically know of nothing in widespread use with a spec that can actually be converted directly into working code.


Does implementing TCP/IP stack using the RFC (as in parsing diagrams straight from RFC) counts?

Then it was done in OMeta [1].

Previous discussion: A full TCP/IP stack in under 200 LoC (and the power of DSLs) [2].

There's also a PNG parser (but it is not parsing any documentation) in 20 lines of OMeta [3].

[1] http://www.moserware.com/2008/04/towards-moores-law-software...

[2] https://news.ycombinator.com/item?id=846028

[3] http://joshondesign.com/2013/03/18/ConciseComputing


For the parser itself, yes. There are parser generators that take a spec(BNF, PEG) and output a parser that can parse the language.

What you do with the parsed tree is up you though.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: