3 ms·
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
by paulddraper 7y ago
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.
- edejong 7y agoLISP is a notable exception. Btw, I do believe a compiler should be one of the examples of a new language.
- garmaine 7y agoFWIW, concatinative languages are even simpler than Lisp.
- bogdanoff_2 7y agoAre 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?
- edejong 7y agoIn LISP-like languages a compiler/interpeter is a simple example.
- kazinator 7y agohttps://github.com/sbcl/sbcl/tree/master/src/compiler 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.lisp 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-lisp/bytecomp.el http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/emacs-l...