Skip to content

An ultra-simplified example of all the major pieces of a modern compiler written in JavaScript..

Notifications You must be signed in to change notification settings

youssef-imlyhen/dummy_compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dummy_compiler

A super tiny compiler that helped me to get an idea on many of the major pieces of a modern compiler Parsing, Transformation, and Code Generation works. It compiles some lisp-like function calls into some C-like function calls. If we had two functions add and subtract like this: LISP:

 (add 2 2)
(subtract 4 2)
(add 2 (subtract 4 2))

the compiler will turn it into C code like this:

add(2, 2) 
subtract(4, 2)
add(2, subtract(4, 2))

You can create your own by checking this amazing repo.

About

An ultra-simplified example of all the major pieces of a modern compiler written in JavaScript..

Resources

Stars

Watchers

Forks