L# ("L Sharp") is a programming language initially written in C. It has a few goals in mind:
- L# is intended to be easy-to-write, easy-to-read, immutable by default, general-purpose, extensible, platform-agnostic programming language
- The language is intended to interoperate with other systems and languages
- The language does not allow code that would violate any memory safety; memory should not be a concern of the programmer
- The language does not enforce any specific architecture or structure (with spaces, folders, groupings of files, or brackets), rather, the programmer decides and implements how they see fit
- L# applications are intended to be economical with regard to memory and processing, the language is intended to compete directly on performance and size with C or assembly language
If you're curious, you can read more about it in the L# language spec included in this repo.
Here is a sample of some simple L# source code:
number temperature = 98.5 + 1
/* the info, debug, warning, and error functions are built-in to L# */
info('temperature variable set!')
debug('temperature is 99.5.')
warning('temperature cannot be changed.')
error('done running.')
When compiling and running this file, the output will look like this:
- Clone or fork the repo
- Navigate to project root
- Use the makefile to compile or clean the project
makecompiles both the compiler and the runtimemake compilercompiles the compilermake runtimecompiles the runtimemake testscompiles the unit tests for the programmake cleanremoves all build artifacts, docs, and the compiled programmake docsgenerates and launches the documentationmake rebuildrunsmake cleanthenmake
- Run
bin/lsc examples/simple.lsto compile the simple L# source code into a bytecode program file - Run
bin/lsr program.lbcto run the bytecode file
The compiler will read the L# file, tokenize the source code, then break the tokens into an abstract syntax tree.
The abstract syntax tree is then translated to bytecode instructions through code generation, which will create an .lbc (L# bytecode) file.
The .lbc file is then run by the LVM (L# virtual machine) which produces the output of the program.
- Finish L# language spec
- Finish L# VSCode extension
- Create a release of the L# compiler in this repository
- Create an L# compiler in L#