Commit Graph

3 Commits (cf73eb4a31c8bb4da9ec93447421ceb7b2aa1dc0)

Author SHA1 Message Date
Mike Gerwitz cf73eb4a31
rebirth: Add viability test suite
This is an initial test suite that is by no means comprehensive, but is a
pretty good starting point.  At this point, it's important that we be
confident in certain aspects of the system to preempt difficulty in
debugging problems when using 3rd-party code (we'll be using psyntax at some
point, for example).

We also need to be able to have confidence in refactoring.  We do gain
limited confidence when Rebirth is able to successfully compile itself, but
finer details are missed, as has been demonstrated by recent commits (which
fix bugs found by this test suite).

This is also the first test of writing another program in Rebirth that isn't
Rebirth itself.  It's exciting, and helps make obvious certain pain points,
like the need to include core packages.  Further, we can't include important
definitions in `rebith.scm' itself.  Consequently, I think it may be in my
best interest to just add support to Birth for `include' so that the first
pass of Rebirth can benefit from it.  I didn't want to do so because I
wanted Birth to be a faithful re-implementation of Prebirth, but it's not
worth it.  This would be a minor addition and would save so much trouble.

I saw a couple mentions of JS Lisps today on HN (one a tiny Lisp that
compiles to JS, one an interpreter)---neither of them come close to what
Ulambda will be (and in many ways with Rebirth already is), so I'm excited
to keep development going.  There is a niche to be filled.  And I intend to
keep this project secret until it can actually be called "Scheme" (and maybe
beyond that too, since I have Gibble to work on as well).

Anyway, enjoy the first non-Rebirth Rebirth program!  Hello, world!

* bootstrap/Bootstrap.js (bootstrap): Include `#_testViable' call after
    Rebirth compilation.
  (_birth): Throw any error received during Birth compilation.
  (_makeCompiler): Accumulate output for each `console.log' in compiler,
    rather than overwriting with each call (that latter behavior was never
    intended in the first place).
  (_compileRebirth): Throw error on compilation failure.
  (_testViable): New method.
  (_strmap)[rebirthTestCompiling, rebirthTestCompiled, rebirthTestFailed]
    [rebirthTestDone]: New functions.
* bootstrap/rebirth.scm: Add comment clarifying that Rebirth should _not_ be
    used as a general-purpose little Lisp.
* bootstrap/rebirth/.dir-locals.el: New file.
* bootstrap/rebirth/es.scm: Add comment comparing environment implementation
    to a spaghetti stack (a term which I was unfamiliar with until recently
    while researching some Lisp history).
  (es:json-stringify): New procedure.
  (es:try): New macro.
* bootstrap/rebirth/relibprebirth.scm (es:null): New procedure for use by
    test suite.
  (fold): Fix argument naming order.
  (zero?): Correctly use `=' instead of `eq?'.
* bootstrap/rebirth/test.scm: New viability test suite.
2018-09-11 22:51:26 -04:00
Mike Gerwitz 84345fab58
rebirth: Recognize numbers without digit before decimal point
* bootstrap/rebirth.scm (tname-verbatim?): Match numbers that have no digit
    preceding the decimal point, so long as digits follow it.
2018-09-10 23:24:45 -04:00
Mike Gerwitz aae726b7a6
bootstrap: Move from build-aux/bootstrap
NOTE: To see history for files in this directory, run:

  $ git log --follow PATH

The previous home for the bootstrapping process was build-aux, but this has
evolved into quite the project in its own that such a directory strucutre is
no longer honest.  Further, I want the bootstrap process to get the
visibility in the source tree that it deserves, considering how vitally
important it is.

I preserved the original history rather than rewriting the commits because I
did not want the hashes to change---I have recorded some hashes elsewhere
as proof that early Ulambda existed when it did, since it is yet unpublished.

* bootstrap/Bootstrap.js: Renamed from build-aux/bootstrap/Bootstrap.js.
* bootstrap/birth.scm: Renamed from build-aux/bootstrap/birth.scm.
* bootstrap/bootstrap.html: Renamed from build-aux/bootstrap.html.
* bootstrap/bootstrap.js: Renamed from build-aux/bootstrap.js.
* bootstrap/libprebirth.js: Renamed from build-aux/bootstrap/libprebirth.js.
* bootstrap/prebirth.js: Renamed from build-aux/bootstrap/prebirth.js.
* bootstrap/rebirth.scm: Renamed from build-aux/bootstrap/rebirth.scm.
* bootstrap/rebirth/es.scm: Renamed from build-aux/bootstrap/rebirth/es.scm.
* bootstrap/rebirth/macro.scm: Renamed from build-aux/bootstrap/rebirth/macro.scm.
* bootstrap/rebirth/relibprebirth.scm: Renamed from
    build-aux/bootstrap/rebirth/relibprebirth.scm.
2018-09-10 21:14:25 -04:00