Commit Graph

4 Commits (35fa13a8a0d45cca420a83b252de9f983277629d)

Author SHA1 Message Date
Mike Gerwitz 35fa13a8a0
birth: Prebirth self-hosting
This completes bootstrapping for Prebirth Lisp.  The next step will be
Rebirth, which will replace libprebirth.js, removing hand-written JavaScript
entirely.
2017-10-09 21:22:59 -04:00
Mike Gerwitz 3310241a94
birth: AST generation
Just about ready for that sloppy code generation!

* build-aux/bootstrap/birth.scm: Update file header documentation.
  Add some whitespace between existing procedures.
  Invoke `parse-lisp' as the program in place of `lex', producing an AST as
    output to the console.
  (cadddr): Add procedure.
  (token-{type,lexeme,value,pos}): Add procedures.
  (parse-lisp): Add procedure (contains other procedures).
* build-aux/bootstrap/libprebirth.js
  ($$append): Add function (append).
  ($$$_$): Correct implementation (-).
  ($$zero$7$): Add predicate (zero?).
  ($$fold): Add function (fold).
* build-aux/bootstrap/prebirth.js (parseLisp): Lowercase some errors.
  (Compiler): Update class docblock.
  (fnmap)[labmda]: Add `lambda' form.
2017-09-02 01:30:13 -04:00
Mike Gerwitz 5fca236834
birth: Include pos and window in lexing error
Analog to prelude.js's `Parser#_error'.

* build-aux/bootstrap/birth.scm (parse-error): Add procedure.
  (lex): Use it for string error.
2017-08-31 12:44:41 -04:00
Mike Gerwitz b5f70fd8a6
birth: Add birth.scm, which can parse itself and output a CST
Exciting first step!  Though it required a much more complicated Prebirth
Lisp than I was hoping to create.  And I never intended to go into a full
Scheme implementation, but that's the route this is headed in.  I just can't
stomach creating this full system in a block language.

With that said, the block language will still be able to work with all Lisp
code; you'll see.

* build-aux/bootstrap/birth.scm: Add beginning of Birth, capable of parsing
    itself!  Baby steps!
2017-08-31 01:01:06 -04:00