http://felix.plesoianu.ro/scratch-lang/
This is a 5-part tutorial on how to implement a programming language. It is intended for people with some programming experience, who want to know how their compiler, interpreter or virtual machine works. Hint: it's not magic.
There are many articles (even books!) on this topic. I'm writing mine with two purposes in mind:
- to keep it short and easy to follow by (hopefully) any programmer;
- to have an useful interpreter at the end of each installment.
The reader is expected to have basic-to-average programming knowledge, especially about objects, data structures and variable scope. Knowing some Javascript is necessary in order to understand the sample code.
Table of contents
- Part 0: motivations — DRAFT 1 — 2008-10-09
- Part 1: numbers and words — DRAFT 2 — 2008-09-06 (source code for part 1)
- Part 2: variables, string, comments — DRAFT — 2008-09-07 (source code for part 2)
- Part 3: user-defined words — DRAFT — 2009-05-17 (source code for part 3)
- Part 4: control structures — DRAFT — 2009-06-07 (source code for part 4)
- Part 5: conclusions — DRAFT — 2009-06-07
- Appendix A: a practical implementation — WORK IN PROGRESS — 2010-06-14
Each part comes with a working Javascript implementation of the interpreter described until that point. The code is tested and believed to work in Opera 9.5+, Firefox 3, WebKit and Konqueror.
Acknowledgements
Alex Bolboacă has been kind enough to review parts of the tutorial.
Syntax highlighting of the code samples is powered by JUSH.
Make Your Own Programming Language by Felix Pleşoianu is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.
'Programming' 카테고리의 다른 글
What's new in Java 1.7? (0) | 2013.02.24 |
---|---|
A micro-manual for LISP Implemented in C (0) | 2013.02.19 |
윈도우7 에서 추억의 QBasic 프로그래밍을....QB64 (0) | 2013.02.11 |
EOF 문자의 아스키 코드, ASCII Code; 파일의 끝 End of File 을 의미하는 특수문자 (0) | 2013.02.11 |
(Java) How to read/write a serial port with Java on Windows? [closed] (0) | 2013.02.09 |