archives

Forth in Lisp

Hi,

Recently on my blog I wrote about how I implemented Forth in Lisp. I did it because I needed a user accessible scripting language and I decided Forth had the simplist syntax of anything ever. Its also pretty easy to do.

In the blog entry in about 128 loc I produce a working Forth implementation and demonstrate it by having it compile a recursive factorial function and then evaluate 10 factorial. I hope this is interesting to some of you because it's Lisp, and it implements a programming language.

Denotational semantics with other notions of convergence

In a typical domain-theoretic denotational semantics, a primitive value converges when it is non-_|_, and functions converge in the limit, pointwise. Are there similar denotational semantics out there in which convergence is defined differently?

I've found myself thinking "Why just non-_|_ for values?" I can answer the question, partially: it makes semantic approximation order easy to define, and monotonicity with respect to the order is easy to ensure (anything finitely computable, I think). To do it otherwise would require every value to belong to a metric space with a metric that convergence happens with respect to, a way to specify what a function returns at any finite approximation level, and monotonicity would be hard to ensure. Monotonicity might be too restrictive to be useful anyway...

But it might be cool. In languages defined with non-_|_ convergence, you can't, say, define a value that depends on all the values of an infinite list, even when it's well-defined. Infinite sum, for example. You can make a list of prefix sums and carry out the limit yourself, but I'd like the language to do it for me. If it doesn't converge, that's like writing an infinite loop: my fault.

Logic programming based GUI framework

I'm struggling with an idea of Logic Programming applied to GUI framework design. How does one program GUI with logic programming toolkit?

First, there are two aspects of GUI design -- structure, and dynamics. The structure seems simple: its a hierarchy of widgets. Therefore all we need is the binary relation "Widget A is parent of B". Now, it seems that I need to name each and every widget being instantiated -- an awkward proposition which is unnecessary in traditional OOP approach. So, what is widget identity and why do we need one?

Now the dynamics is more tricky. Each widget has a way to react onto events, is this kind of automaton? This is very different to what logic programming person is accustomed to: given a world one queries it.

I would appreciate any references to existing research. In the absence of thereof, please share your thoughts.