Musings
A blog by Aris Spathis
You don't need to take my proposal seriously because it is so ridiculous that I am obviously completely out of touch with the real world. But that kite won't fly, for I know the real world only too well: the problems of the real world are primarily those you are left with when you refuse to apply their effective solutions. So, let us try again.
— Edsger W. Dijkstra, On the cruelty of really teaching computing science
- Scams Linguistic interfaces to computing platforms are usually built upon abstractions of varying levels of opacity and completeness. Scams are transcribed languages that forsake quixotic, procrustean abstraction in favor of exposing the platform's native language. They are metaprogrammable and trivially implementable, as programs consist of S-expressions with syntax and semantics isomorphic to those of the platform language.
- Attractor plots Based on Paul Bourke's work, we plot attractors in state space after tracing system orbits over a number of state transitions. Our plots not only indicate system properties, but also turn out to be fairly beautiful.
- ANSI control sequences A case study on data-directed metaprogramming of procedures as well as macros for constructing ANSI control sequences, which we then use to implement a progress bar and a color-coded gauge.
- Porting Common Lisp's with-slots to Scheme records Common Lisp offers
with-slots
, a macro for convenient access to object slots. We implement it in Scheme for record fields, where we gradually move from a dynamic version, accepting any record and looking up fields by name, towards a static one, accessing fields by index for an explicitly specified record type. - Syntactic monads in Clojure A Clojure implementation of syntactic monads as described in SRFI 247.
- Anasyntactic parsers We explore parsers which translate input into a language for which a parser is already available. Our driving example translates JSON to S-expressions while providing incidental context for demonstrating syntactic monads, interface-driven design, and environment manipulation. Due to simplicity and leverage of existing functionality, this technique is suitable for implementing highly flexible ad-hoc parsers.
- Walking with regular expressions We develop a generic, NFA-based regular expression engine which lets us inspect a matcher's state and choose its next piece of input. We then take advantage of these features to lazily traverse directed graphs, only visiting parts that match arbitrary patterns.