LtU Forum

Learning language design

I have been very curious about how language design is done.So,I decided to read up on it.I have started with "Programming Language Pragmatics".And I would say,just reading the first 2 chapters have given me lot of insight into scanners,parsers(LL\LR),context-free grammars,production etc.I wanted to know,how should I proceed? There are topics which I would like to explore in detail.Or,should I just first read the book completely?
I also have book by Wirth on compiler construction.And,it seems its a nice practical book.So,I am bit confused which path to take now.?
My initial goal is to build interpreters in different languages.Then,create a small domain specific language,just for fun.

Please help find a paper/tutorial

Hi,

I wanted to reread a paper that discusses how to extend data types in Haskell in a flexible way.
The paper was motivated by an evaluator example that can evaluate additions.
Suppose now multiplication expressions also need to be supported, then every function that looks into the data type that represents expressions must be changed.
The idea of this paper was to introduce an extra indirection layer and define recursive types in a roundabout way. For example natural numbers can be defined as:

newtype Mu f = In (f (Mu f))
data NatF b = Zero | Succ b
type Nat = Mu NatF

Now 0 is encoded as In Zero, 1 as In $ Succ (In Zero), etc.

The paper then goes on talking about building higher-order functions in this more flexible framework.

I'm not looking for the original papers on catamorphisms and catamorphisms.
This paper is rather a tutorial that builds on top of those ideas.
I couldn't recall the title or the author.
I thought it was in functional pearls but couldn't find it.

Thanks for your help.

XMF 2.0 Open Source

XMF 2.0 has been released as open-source under the EPL. XMF is an engine for writing languages. It was initially designed to run models-as-code and came out of work on the UML 2.0 standard. Therefore there is some linkage with UML/OCL. In addition many of the ideas came from work done on Lisp Engines (particularly CMU-lisp in the 80's) and work done (under the direction of Peter Landin in the early 90's) on language engineering as a design tool.

XMF has a VM written in Java and can be used as dynamic HLL embedded or externally to Java. We think that the combination of features offered by XMF is novel: reflexive OO; embedded extensible syntax; closures; OCL support; Java integration; first class types; daemons; etc.

We hope that people will take a look at XMF here join the forum and help us take XMF forward.

TinyML - Lexer, Parser, Interpreter, and Polymorphic Type Checker in Under 700 Lines of SML

Here is the source code and some documentation for my tiny implementation of a toy ML like language. Of interest is the fact that it does polymorphic type checking by first converting expressions in the full abstract syntax to combinator expressions. One of my goals with this program was to make it totally self contained, so it does not use lex or yacc. Check it out:

Visit the TinyML page

Can we start an LtU group on CiteULike?

I recently came to use CiteUlike through LtU, and it has become an invaluable resource for me in keeping my readings organized. For those of you who haven't heard of it yet, CiteULike is a bibliography tracking tool that allows you to organize your material using tags and automatically creates BibTex entries from web pages.

When it was first brought up on LtU four years ago, the poster mentioned the idea of starting a CiteULike group for LtU. I don't know why this idea didn't get any traction, but I think it would be great to start that group now. This would make it much easier for LtU'ers to catalog and reference all the great papers that have been referenced here over the years. CiteULike groups can even be moderated (somewhat), if that's preferable.

So, is anyone interested?

A modular toolchain for parsing and compiling code?

What do you say to Ted Neward's blog about Modular Toolchains? Is it feasible to have modular toolchains for the whole way from the source code to the executable or is it just utopia? Is it possible to convert every language to a standardized AST? Which language-features are difficult to represent in that AST? Where are the problems?

Gilad Bracha: Cutting out Static

Nothing terribly exciting or newsworthy, but I suspect that many readers will find something to love in this blog post from Gilad Bracha. He starts by asking, "Why is static state so bad, you ask?" and goes from there...

Given all these downsides, surely there must be some significant upside, something to trade off against the host of evils mentioned above? Well, not really. It’s just a mistake, hallowed by long tradition... Static state will disappear from modern programming languages, and should be eliminated from modern programming practice.

Uniform naming

Via research!rsc, I came across The Hideous Name. Although it's mainly about file and email names, this paragraph was interesting.

Although this syntax may seem unnecessarily cumbersome, it has a precedent: it is analogous to expressions in programming languages. Consider a C expression such as *structure[index].field->ptr. If * were postfix and / the only dereferencing operator, the expression might be written structure/index/field/ptr/. Functionally-minded programmers might use the notation contents(ptr(field(index(structure)))). (A single character cannot be used in C because it could not distinguish X[Y] and X->Y, with X a structure pointer and Y an integer or structure element respectively, but this ambiguity could be eliminated in a different language.) C and VMS use syntax to distinguish the types of the components of a name. Instead, the UNIX file system deliberately hides the distinctions. Aside from the obvious advantages such as simplicity of syntax and the usurping of only a single character, the uniformity also makes the name space easier to manipulate: the mount system call aliases a disk and a directory.

Do any languages use a uniform naming system for all entities?

[Edit: fixed the links]

succinctness

What are your thoughts on the idea that "succinctness is power"?*

I've been thinking about it a lot lately, especially with regards to stack-based languages, but I can't quite solidify my thoughts on the subject.



* Presumably 'power' means 'better' in this context. While this isn't always true, it seems valid enough for general purpose languages.

1667 State Machine John Milton

Chapter 8 of Paradise Lost

Thus have I told thee all my state, and brought
My story to the sum of earthly bliss,
Which I enjoy; and must confess to find
In all things else delight indeed, but such
As, used or not, works in the mind no change,

XML feed