Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/2bt/minilang
Bootstrapped compiler of a C-like but Python-looking language
https://github.com/2bt/minilang
compiler x86-64
Last synced: about 2 months ago
JSON representation
Bootstrapped compiler of a C-like but Python-looking language
- Host: GitHub
- URL: https://github.com/2bt/minilang
- Owner: 2bt
- Created: 2012-03-16T01:06:09.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2017-12-21T11:24:39.000Z (about 7 years ago)
- Last Synced: 2023-03-11T11:32:41.037Z (almost 2 years ago)
- Topics: compiler, x86-64
- Language: C
- Homepage:
- Size: 28.3 KB
- Stars: 43
- Watchers: 5
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- AwesomeCompiler - minilang
README
# minilang
Inspired by [BASICO](http://www.andreadrian.de/tbng/index.html), 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