Skip to content

a programming language with channels and coroutines/threads

License

Notifications You must be signed in to change notification settings

ammarbinfaisal/sahl

Repository files navigation

sahl

badge badge badge

a programming language with channels and coroutines

meaning

sahl means easy. This is the easiest statically typed language I could come up with. It could be called easy before but it has become bloated now as I am adding or planning to add all sort of stuff.

usage

  • install rust, llvm, clang
  • make to compile the compiler and the virtual machine
  • then use ./sahlc -o exe code.sahl to compile a sahl file to native code
  • or use ./run_byte.sh code.sahl to run a sahl file on the virtual machine

features

  • c interop
  • type inference
  • garbage collected
  • haskellesque type constructors
  • green threads (only in vm)
  • channels

docs

DOCS.md

vscode extension

install

cp -r ext ~/.vscode/extensions/sahl

only supports syntax highlighting for now

history

Initially I made the virtual machine in rust. It was slow so I rewrote the codegen in rust to emit bytes instead of rust enums/structs and then run the bytecode on a virtual machine I wrote in c. Since, the language is statically typed I thought compiling it to native code would be a nice idea so I started writing that using llvm but paused. I also wrote sahl_aot.go to convert the bytecode to assembly but stopped. I wrote x86 codegen which operated on the ast. Abandoned that soon after. Then reorganized the source to use three-addr-code and a register based vm. After that picked up native codegen using llvm from the three-addr-code.
Right now there is a virtual machine, native code generation with llvm and transpilation to go.

About

a programming language with channels and coroutines/threads

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published