Forsp LLVM-based compiler
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Clyne feb8d30610
add basic character literals
3 weeks ago
examples fix fibonacci example 3 weeks ago
.gitignore break code into separate files 1 month ago
LICENSE add license to files 1 month ago
Makefile switch target to x86-64 3 weeks ago
README.md readme update; use CC in Makefile 1 month ago
ast.cpp shortcut push-pops; don't env-copy functions 3 weeks ago
ast.hpp cache sp, minor refactors 3 weeks ago
llvm.cpp cache sp, minor refactors 3 weeks ago
llvm.hpp cache sp, minor refactors 3 weeks ago
main.cpp shortcut push-pops; don't env-copy functions 3 weeks ago
parser.cpp add basic character literals 3 weeks ago
parser.hpp add license to files 1 month ago
support.c switch target to x86-64 3 weeks ago
test.fp switch target to x86-64 3 weeks ago
var.cpp shortcut push-pops; don't env-copy functions 3 weeks ago
var.hpp shortcut push-pops; don't env-copy functions 3 weeks ago

README.md

forspll

forspll is an implementation of Forsp as an LLVM-based compiler. Forsp is a tiny yet very versatile programming language that mixes features of Forth and Lisp. Through LLVM, Forsp can be compiled into efficient machine code for a wide array of platforms.

forspll features:

  • Lisp-style S-expression syntax
  • Forth-style data stack for parameters/values
  • Linking with C functions (see support.c)
  • Recursion: $self gets pointer to current function

Missing features:

  • Captured variables: Functions/lambdas are not dynamic and do not capture the state of previously declared variables
  • Quote operator: quote/'
  • Built-in dynamic allocations (implement them via platform-specific support.c)

Building

Requires Clang and LLVM development files.

Run make to build the compiler.

Run make prog to compile test.fp and support.c.