c.s. {

Home

articles

linguo-projects

misc projects

abortive attempts

english->spanish

brief articles

Top

Obfuscated programming languages.

Relative clauses in constructed languages and lambda calculus.

Top

linguo-projects

Top

For language implementations in C, I've used Hans Boehms' Conservative Garbage Collector.

Unlambda interpreter

An Unlambda Interpreter in C. It was one of my first interpreters. I keep it here mostly for (personal) historical reasons. It sucks hard.

Funes

Funes is a dialect of Lisp I'm creating. The sources (C + bison + flex) come in a gzipped tarball (for direct compilation in Linux) or a somewhat older zip, which includes a precompiled Windows binary and the sources.

I've compiled it successfully under Linux and Windows. However, some problems may arise due to an ugly hack on flex. There are lots of things to do; many nonworking and undocumented features.

Funes compiles to object code for an ad hoc virtual machine and then interprets it. Currently it features: single namespace, tail call elimination, non-first-class non-hygienic macros (à la Common Lisp), Python-like introspection on environments, a very Pythonic (yet incomplete) module system, a bigger-than-Scheme smaller-than-Common-Lisp standard library. Continuations are not first class: though powerful, that's an implementation headache.

I'm not working on Funes anymore. I plan to make a whole rewrite of it, somewhere in the future.

The name Funes comes from Ireneo Funes, the name of the main character in one of Jorge Luis Borges tales in Ficciones: Funes, el memorioso (Funes, the memorious). The language ows its name in part to the lack of a garbage collector (thus, very "memorious") and also to the operator fun, equivalent to lambda in most Lisps.

There is also a Funes Reference (sorry, in Spanish).

The Sorcho Kang Programming Language

While coursing Algoritmos y Estructuras de Datos I (Algorithms and Data Structures I), I wrote this dirty interpreter for a bizarre mixture of [a tiny subset of] Haskell and Befunge: Sorcho Kang.

Just like in Funes, the zip includes a precompiled Windows binary and portable sources (C + bison + flex).

Sorcho Kang was an attempt to implement a language with pattern matching and lazy evaluation, and avoid having built-in functions and types (Haskelly, everything should be defined in the prelude). The only built-in functions and types are in the Befungical part of the language, and all relate to integer arithmetic.

The name Sorcho Kang is a composition of "Sorcho" (which means nothing really but in Spanish sounds like a bad quality thing) and "Kang" (the name of one of the two aliens in The Simpsons, Kodos' partner).

Hume

Hume is a very tiny language based on a cool idea: rewriting systems. (Actually, only after reinventing this I was told it was called "rewriting"...).

The zip includes the sources in Scheme (originally written for Guile, but easily portable) and a Windows binary (compiled with Gambit).

Hume is more a mathematical computing model than a useful language. An expression in Hume may be: a constant, a variable or an application (one or more ordered expressions surrounded by parentheses, each of one is referred to as ``the n-th component'' of the expression). Hume is Turing complete, which is quite easy to show using the SKI combinators.

I named it Hume for the English empirist philosopher David Hume, whose ideas are very clear and neat, IMHO.

Given expressions e1, e2; e1 matches with e2 iff: (1) e1 and e2 are the same constant, or (2) e1 is a variable, or (3) e1 and e2 are applications with the same number of components, and each component of e1 matches the corresponding component of e2.

A variable e1 appears in the expression e2 iff e2 is the same variable, or e2 is an application and there exists a component of e2 such that e1 appears in e2.

A substitution is a set of pairs (variable, expresion) such that there is no more than one pair with certain variable as its first component.

Given a substitution S and the expression e1, substituting e1 with S is replacing, for all variable V, every appearance of V in e1 with the expression which is the second component of the pair whose first component is V in the substitution. Phew...

If e1 matches e2, the unification of the expressions e1, e2 is the substitution S such that substituting e1 with S yields e2.

An equation is a pair of expressions, the second of which satisfies that every variable that appears in it, also appears in the first expression of the equation.

Given a list of equations L, the matching equation of an expression e is the first equation such that it first component matches e.

Given a list of equations L and an expression e, e is in normal form iff there is no matching equation.

Given a list of equations L, the one-step reduction of an expression e, if e is not in normal form, is the result of substituting the second component of the matching equation with the unification of the first component of the matching equation and e.

Given a list of equations L and an expression e, the reduction of an expression in normal form is the expression itself; the reduction of an expression not in normal form is the reduction of the one-step reduction of e.

Top

misc projects

Top

Magic square generator

This is a [very very] dirty script in C which prints all the 4x4 magic squares with the numbers from 1 to 16 to the standard output. Reflection and rotation distinguishes squares. Magicality is determined by the sum of rows, columns, diagonals and the four quadrants of the square.

WARNING - WARNING: it's written in a more than poor style, maybe I should submit it to the Obfuscated C Contest?

Top

abortive attempts

Top

Xul

A Pythonic Perlic Rubyc sketch of a programming glossa. Yet another scripting language.

Top

spanish translations

Top

Página Anti Micro$oft, traducción de un artículo de David Madore.

Top

}


Pablo Barenbaum
Tell me what you think of this site.