|
|
|
|
|
by ryanmccullagh
2706 days ago
|
|
@stephen82 has great references. In particular wren, and luna are references I used when I created my language como-lang-ng: https://github.com/rmccullagh/como-lang-ng You do not need Dicrete Math, or Automata Theory to learn how to write a compiler and interpreter. I would recommened first, figuring out what you want your language to look like (the syntax). Then, you can define a grammar for your language, and research parsers. From parsing, you will be leade to Abstract Syntax Trees (the most modern way to get from text file to bytecode). After that you'll need to compile the abstract syntax tree (which you would have built from the parser). Compiling the AST is typically done targetting your own simplified instruction set. For an example instruction set, check out Python's header file at https://github.com/python/cpython/blob/master/Include/opcode... |
|