Hacker News new | past | comments | ask | show | jobs | submit login

To be frank, the src/ folder is the compiler for Mirth written in Mirth, so there's your example code. However, I do agree that a quick introduction would not be out of place.



But the first thing I want to about C is not a compiler written in C. That's an unfriendly intro to almost any language.

I want to see a procedure call, "Hello world" I/O, some math or string manipulation, and how to run that myself.

After that I can look at compiler sources.


LISP is a notable exception. Btw, I do believe a compiler should be one of the examples of a new language.


Are you saying that lisps are an exception to needing to see some small examples at first when looking at a new language? Why do you think they're an exception?


In LISP-like languages a compiler/interpeter is a simple example.


https://github.com/sbcl/sbcl/tree/master/src/compiler

Doesn't look simple to me.

This one is in one file, but more than half a megabyte of code spanning close to 12000 lines:

https://github.com/clisp-lang/clisp/blob/master/src/compiler...

The Emacs Lisp byte compiler also doesn't look like a good small example for neophytes:

http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/emacs-l...


FWIW, concatinative languages are even simpler than Lisp.


True, and that would be a good thing for the README to emphasize. It's mentioned, but in passing.

But even so, I know I'd like a good reference of what primitive operations are, the type system, and what's provided by the Prelude.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: