Onions in the Varnish

Work on Arcueid right now as I prepare for a 0.1.0 release comes down to three things:

  1. Minor cleanup of small loose ends
  2. Miscellaneous features, such as load paths, command line switches, and other minor controls
  3. A clean port to 32-bit x86

The last is what is consuming a large part of my development work these days, and my plans for doing it involve writing an exhaustive set of unit tests that verify the behavior of Arcueid’s compiler and built-in functions against that of Paul Graham’s Arc 3.1. Conan Dalton has directed me towards a set of unit tests that he devised for his Rainbow implementation of Arc, and running the tests against Arcueid has made me see just how much accidental behavior, which feel a lot like what Paul Graham has called onions in the varnish, but unlike most such onions, these ones are unintentional and artifacts of the implementation of Arc 3.1 under Racket.

For instance, Mr. Dalton has included a lot of tests that involve the use of vertical bars (|) inside of symbols, which behavior is, as far as I am aware, not provided by anything in ac.scm, which does absolutely nothing special with symbols, except to provide ssyntax. I suppose this is also why ssyntax doesn’t use the vertical bar either. So the vertical bar behavior is actually a property of the underlying Scheme core, and this behavior is not actually mandated by any of the R^nRS Scheme specifications, which actually don’t give a mandate on what characters are legal in symbols as far as I can tell. As a result, different Scheme implementations do different things when faced with bars in symbols: e.g. Scheme48 will declare the symbol as containing invalid characters, and Guile, like Arcueid today, will actually create a symbol with vertical bars. Racket makes use of | as an escape character from the looks of things, and well, if we are striving for maximum compatibility, I do suppose I’ll have to implement this behavior in Arcueid eventually. This does, however, smell a lot like an onion sizzling in the varnish to me. I feel that Arc really should develop its own rules for what characters inside symbols ought to be special, and how characters are supposed to be escaped, especially since Arc’s special syntax depends on it. Perhaps Arc 4 will address this issue.

Anyhow, Arcueid’s Git Head now passes 295 out of 313 of Rainbow’s tests, minus the vertical bar tests which Arcueid’s parser still will not accept as valid. There are a lot of subtleties involving numerics. Arcueid uses many naive algorithms for conversions of strings and floating point, especially floating point string constants in bases other than 10. These will need to be improved. The last 18 failed tests involve a lot of subtleties I hadn’t thought of before, and making these tests pass will probably be a lot of work.

~ by stormwyrm on 2012-03-03.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: