Hacker GitHub

← All repos

kragen/peg-bootstrap

View on GitHub ↗ ★ 76 JavaScript

A PEG that compiles itself.

18 mentions on Hacker News by 3 people: 2 stories, 16 comments · first 2008-12-21 · latest 2025-07-10

Mentions per year 18 mentions · busiest year 2011 (4)
20082026
  1. …more. This is not trivial to understand but I think it's not that hard either; it's a page of code: https://github.com/kragen/peg-bootstrap/blob/master/peg.md That version doesn't memoize and so doesn't enjoy Packrat parsing's linear-time…
    comment by kragen · 2025-07-10 · in QRS: Epsilon Wrangling
  2. …(from a forth-like language to an i386 linux elf executable, 132 lines of code) - https://github.com/kragen/peg-bootstrap/blob/master/peg.md (from a peg grammar with semantic actions to javascript, 66 lines of code) - https://github.com/kra
  3. ▲ 2
    PEGs in a PEG (2008)
    story by akkartik · 2023-06-28 · 0 comments
  4. ▲ 2
    Pegs in a Peg
    story by bmacho · 2023-05-05 · 0 comments
  5. …- letter: :between "az", :between "AZ", :between "__" Meta5ix, like my earlier peg-bootstrap https://github.com/kragen/peg-bootstrap/blob/master/peg.md (66 lines of code, compiles to JavaScript, supports backtracking), is not really…
  6. …you'd take the extra trouble to write a compiler rather than an interpreter. In 66 lines of code in https://github.com/kragen/peg-bootstrap/blob/master/peg.md I wrote an example compiler which compiles a PEG grammar into a JavaScript…
  7. Oh goodness, I never thought about using LuaLaTeX for that! I wrote handaxeweb.lua originally for https://github.com/kragen/peg-bootstrap/blob/master/peg.md but have used it for various things since then.
  8. I did pretty much the same thing with https://github.com/kragen/peg-bootstrap/blob/master/peg.md , although admittedly hand-compiling to JS was noticeably less work than hand-compiling to assembly language would have taken. My friend Dave…
    comment by kragen · 2021-04-07 · in First C compiler ported to GCC
  9. …I've been interested in literate programming for a long time; for my self-bootstrapping PEG parser https://github.com/kragen/peg-bootstrap/blob/master/peg.md I wrote my own noweb-like system called HandAxeWeb in Lua (5.x)…
  10. …in a way that LALR and LL grammars aren't. I wrote a one-page PEG parser generator targeting JS at https://github.com/kragen/peg-bootstrap/blob/master/peg.md a few years back. But I think an excessive focus on the syntax of a programming…
    comment by kragen · 2020-06-07 · in Let's make a Teeny Tiny compiler
  11. …it, though. It's very simple indeed (my self-compiling PEG parser generator is 66 lines of code: https://github.com/kragen/peg-bootstrap/blob/master/peg.md ) and very expressive.
  12. …remove the comments. I also wrote a PEG compiler-compiler in JavaScript which is one page of code: https://github.com/kragen/peg-bootstrap/blob/master/peg.md --- ultimately I want to make a version that generates StoneKnifeForth code…
  13. …it's not vulgar to post yet another link to my minimal PEG parser generator in one page of code: https://github.com/kragen/peg-bootstrap/blob/master/peg.md In particular, the example here of embedding SQL in C would be pretty trivial to do…
    comment by kragen · 2011-03-16 · in Parsing ought to be easier
  14. …written a one-page PEG compiler-compiler (interspersed with many pages of text explaining it) at https://github.com/kragen/peg-bootstrap/blob/master/peg.md .
    comment by kragen · 2011-03-13 · in Yacc is not dead
  15. I wrote a metacircular compiler-compiler that generates parsers in PostScript: http://github.com/kragen/peg-bootstrap and a bootstrapping compiler for a very simple Forth-like language: http://github.com/kragen/stoneknifeforth (although I…
    comment by kragen · 2010-09-26 · in Let’s Build a Compiler (1995)
  16. …Compiler construction: http://canonical.org/~kragen/sw/urscheme/ http://github.com/kragen/peg-bootstrap http://github.com/kragen/stoneknifeforth Machine learning: http://angstro.com/ (this isn't solely my project; I'm only
  17. …for expressiveness. I did a simple PEG parser generator (66 lines, generates code in JavaScript, http://github.com/kragen/peg-bootstrap/blob/15acbdd6f7108117... ) and since then I've been thinking about computing one-character follow-sets…
  18. …'p' / 'u' / 's'. name <- namechar name / namechar _. methodname <- '+'_ / name. I have tested it (in http://github.com/kragen/peg-bootstrap/tree/master/peg.md ) and it seems to work for that fragment, although I haven't examined the parse…