Daily Archives: July 24, 2014

DylanSharp Implementing Dylan in C# (1) The Project

A few months ago I started to implement an interpreter of Dylan language, to practice TDD in C #, and learn some functional programming. I read:

http://opendylan.org/

Dylan is a multi-paradigm functional and object-oriented programming language. It is dynamic while providing a programming model designed to support efficient machine code generation, including fine-grained control over dynamic and static behaviors.

The interesting thing about Dylan is that it incorporates types and objects. For now I do not intend to generate machine code, but, following "baby steps" to implement the main concepts of language as an interpreter. I would like to add access to the libraries. NET, which I find interesting to extend the reach of language. You can learn more of the language in:

http://opendylan.org/documentation/intro-dylan/index.html

The project I am writing in C # is:

https://github.com/ajlopez/DylanSharp

Its current structure:

It consists of a class library, and a draft tests. So far there are some simple expressions implemented a Parser a Lexer and implemented as a concept of class C # language: List, which lists as implemented in Lisp. As in other projects, I Context to maintain the values ​​of variables, and recall by name. Notably, in Dylan variables have type, but I’m not controlling the types, just evaluating any expressions. I’ll have to decide at some point to control the types at the time of compiling / processing program. According:

http://opendylan.org/documentation/intro-dylan/expressions-variables.html#type-declarations

Type mismatch errors should be caught at compile time.

But the time will come. Advancing TDD, I am confident that if necessary I can make a “surgical” refactor / redesign, without a lot of pain. I could do this in the next iteration or later. I did something similar during the coding of ScalaSharp.

Next steps: continue implemented expressions, definitions of classes, modules, commands, anonymous functions. And control the types.

Stay tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez