Language Design Tips

I am a programmer, and have recently been toying with the idea of creating a language. In this case, a language with mathematical syntax; however, what I really want to get is a grasp of the ideas. Does anyone know of useful websites/books/resources on designing a language? I really have no idea where to start. Thanks.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Types and Programming Languages

I was in your same position not so very long ago, and the best book I came across was Benjamin Pierce's "Types and Programming Languages".

The book is essentially a textbook suitable for an advanced undergraduate or graduate student, and covers programming languages and type theory as they build upon the lambda calculus.

The book begins with the untyped lambda calculus and a simple arithmetic language -- outlining both syntax and operational semantics -- and eventually builds up to ml-like languages with higher-order System F-omega style type systems. The coverage is pretty comprehensive, and if you read the book all the way through, you should have a pretty solid grasp of not only how to implement a programming language, but also how to make it mathematically rigorous and how to understand the importance of results from areas like mathematical logic, proof theory, etc., as they relate to programming languages.

The nice thing about the book is that if you find the content worthwhile and interesting, there is a nice follow up to it in "Advanced Topics in Types and Programming Languages"

Getting started

Well, you might start by perusing LtU's very own Getting Started thread, which contains all sorts of useful pointers to the sort of information you're looking for.

Look at functional languages.

If your previous experience is with C++/Java/Pascal-style languages, learn Lisp/Scheme and either Haskell or ML.

Language design tips

Take a look at this message:

Some random comments on language design

hints

if you're interested in writing a compiler interpreter, find the 'let's build a compiler' series. translating the code from pascal to whatever you're using is pretty easy, and you'll find that it's a lot easier than reading gnu code might make you think.

if you're interested in language design, that's a whole other ball park. as suggested look into functional languages like ML and Haskell (check out gofer, the parent of the hugs interpreter, for an older but much smaller and easier to understand implementation of haskell) , somewhat archaic but extremely effective lisp systems and any other of the hundreds you might find all over the net.

--
kruhft