| ID | ba81ebf5-d895-4e7c-b075-b2f505060f5e |
|---|---|
| DeertopiaVisibility | public |
SydML
SydML was a compiler project attempting to implement a typed and functional programming language.
The name "SydML" is a bit of a misnomer. I was originally going to implement a subset of OCaml, before tending towards Haskell with purity and alternative syntax.
Syntax
Journal
Who to imitate?
Currently, I believe an S-expression–based syntax is the best choice for the following reasons:
Ease of parsing. I don't want to waste my time writing and maintaining a complex parser for a volatile grammar.
Ease of printing. I already had plans to use S-expressions as a textual representation of ILs. Free or low-cost parsing and printing of ILs is a luxury notably offered by GNU Guile. Like the respectable Scheme hackers the Guile developers are, each IL used is easy to interact with, inspect, evaluate, transform, etc. Obviously, such features would be of invaluable aid in debugging, communicating, and testing.
The most important point of all, is that I do not give a fuck, and I cannot continue to allow myself to give a fuck. This is a toy compiler! I am not a victim of backwards compatibility requirements! If I so choose, I can tear everything down to start anew on a dime. Fuck syntax, and fuck parsing! They are completely irrelevant to this project's goals. This is an important revelation for me; I made this mistake last year, and I do not wish to make it again. Let's get to programming, already.
ML
Whitespace-insensitive.
Easier to implement.
Generally popular.
My least favourite, aesthetically.
Scheme
Aesthetically and technically beautiful.
The simplest to implement.
Generally unpopular (amongst cowards).
Potentially awkward in the context of a curried-by-default culture — cons-lists are right-associative, whilst applications are left-associative. Are we okay with a snoccy Lisp?
Haskell
Syntactically (and semantically!) beautiful.
My native tongue.
The most difficult to implement.
Layouts are intuitive.
Generally popular.
Non-trivial features
IDEA Dependent types
Dependent types. I really want this, but I've never implemented it before.
IDEA First-class modules à la Agda
Modules as records à la Agda. Combined with dependent types, this allows for parameterised modules.