Skip to content

C= (C minus minus): minimalist rust flavored language that compiles itself

License

Notifications You must be signed in to change notification settings

unrenormalizable/cmin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C= (C minus minus): minimal subset of C that compiles itself.

ci License: CC BY-NC-SA 4.0

what?

C= is a minimal subset of C that can compile itself.

PS: affectionately known as C min / C minus minus

why?

to build a compiler that is sufficiently powerful compiles itself.

  • single pass, LL(1)
  • bootstrap in js:
    • start with the minimal grammar
    • compile to text LLVM IR
  • using bootstrap to get working C= compiler
  • add further features & language enhancements
    • built in smart pointer
    • remove null: built in option
    • built in unit testing
    • multiple source files

development principles

  • incremental, iterative, vertical sliced development
  • clean room implementation
    • not allowed: referring to any existing code.
    • allowed: tutorials / discussions on the web that is not code.
    • exceptions:
      • lexer & parser tables from blog posts online
  • lots of sessions with grok & chatgpt, but no code.
  • test driven development.

build llvm ir with

clang.exe  -Wno-override-module -o example.exe example.ll -fuse-ld=lld "-Wl,/SUBSYSTEM:CONSOLE,/DEFAULTLIB:libcmt,/DEBUG:FULL"

progress

  • bootstrap
  • self-dogfood
  • enhancements
    • unit tests
    • smart pointers

specs

References

About

C= (C minus minus): minimalist rust flavored language that compiles itself

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project