Commit Graph

5 Commits (d881345fe6ba401e77bd82b104049a9e69d0c327)

Author SHA1 Message Date
Mike Gerwitz 4585203a22
rebirth: Remove libprebirth.js dependency
This re-implements libprebirth in Rebirth Lisp, finally cutting the
cord.  (Are these birth puns getting out of control?)  We are finally purely
in Lisp land!

* build-aux/bootstrap/rebirth.scm: Define libprebith primitives when
    `string->es' is available (using `cond-expand').
  (prebirth->ecmascript): Do not include `libprebirth.js' in output.
2017-12-05 00:50:29 -05:00
Mike Gerwitz 7f7a9704e5
prebirth,birth,rebirth: Permit newlines in strings
This modifies each of the three lexers just to avoid confusion, even
though prebirth has no need for it.  Birth does have a need, however, since
rebirth will contain newlines---despite the relevant rebirth code (next
commit) not being expanded, it still has to go through the lexer, which
otherwise errors out.

* build-aux/bootstrap/birth.scm (lex): Permit newlines in string regex.
* build-aux/bootstrap/prebirth.js (lex): Permit newlines in string regex.
* build-aux/bootstrap/rebirth.scm (lex): Permit newlines in string regex.
2017-12-05 00:47:26 -05:00
Mike Gerwitz 639948da02
birth,rebirth: Add cond-expand, string->es
`cond-expand' allows moving forward with implementing features based on the
current bootstrapped state of the system---rebirth will be able to
recursively compile itself and introduce new features along the way.

`string->es' allows outputting raw ECMAScript, which gives us more control
over the code that is generated without having to hard-code it in the
compiler itself.

* build-aux/bootstrap/birth.scm
  (fnmap)[cond-expand]: Always yield the empty string (do nothing).
* build-aux/bootstrap/rebirth.scm
  (fnmap)[cond-expand]: Expand `string->es' only.
  (fnmap)[string->es]: Add macro.
2017-12-05 00:38:39 -05:00
Mike Gerwitz 53ea5c5f4d
rebirth: Add variable definitions (define)
`define' can now be used to define values in addition to the procedure
short-hand.

* build-aux/bootstrap/rebirth.scm
  (cdfn): New procedure.  Renamed original `cdfn' to `cdfn-proc'.
  (cdfn-var): New procedure.
  (cdfn-proc): Renamed from `cdfn'.
2017-12-05 00:32:40 -05:00
Mike Gerwitz 1810fb7c38
rebirth: Copy from birth.scm
See diff for comments as to why this fork exists.

build-aux/bootstrap/rebirth.scm: New file, copied from `birth.scm'.
2017-11-12 00:53:32 -05:00