Skip to content
/ minilang Public

Bootstrapped compiler of a C-like but Python-looking language

Notifications You must be signed in to change notification settings

2bt/minilang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

minilang

Inspired by BASICO, minilang is a little programming language. My intention was to keep the implementation brief, yet readable. It is bootstrapped, thus proving to be reasonably expressive. The compiler outputs x86-64 ASM code. Similar to Python, code blocks are formed via indentation. There is no type checking whatsoever, so be careful. Please, look into minilang.mini and you will quickly get the idea. Obligatorily, here is your first programme:

main():puts("Hello, world!")

Compile the throwaway compiler:

$ c99 minilang.c -o minilang

Bootstrap thus:

$ ./minilang minilang.mini minilang.s       # compile with throwaway compiler
$ gcc minilang.s -o minilang_jr             # GCC assembles the executable
$ ./minilang_jr minilang.mini minilang_jr.s # compile with bootstrapped compiler
$ diff minilang.s minilang_jr.s             # compare output -> equal

About

Bootstrapped compiler of a C-like but Python-looking language

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published