Skip to content

stanleymw/clac-lang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

112 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clac++

This is the reference implementation/vm for Clac++, which is a simple stack-based postfix (reverse polish notation) calculator/programming language. It supports programmer-defined functions, control flow and unrestricted recursion.

$ cat print2.clac
: dup 1 pick ;
: print2 dup print dup print ;

25 10 * 5 / print2

quit
$ ./clac++ print2.clac
50
50

It is inspired by and (aims to be) backward compatible with the "Clac" language from Carnegie Mellon University's 15-122 programming class.

Additionally, Clac++ allows for arbitrary syscalls, and reads/writes to arbitrary memory addresses.

Clac++26 Standard

The current (draft) Clac++26 standard requires that implementations define the size of integer values on the Clac Stack.

Implementations must provide a builtin function width_native, which must push the size of a Clac Value (in bits) to the stack. The native width on this implementation is 64 bits, to allow for representing pointers on a 64-bit system.

About

JIT Compiler for Clac++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages