WARNING!! THIS LANGUAGE IS IN DEVELOPMENT (AND FOR LEARNING PURPOSES). ANYTHING CAN CHANGE AT ANY MOMENT.
π SLAP stands for "SLow And Powerless." And I hope to make it "Powerful" someday.
SLAP is a dynamically- and strongly-typed, object-oriented programming language. Its syntax is a member of the C family with a bit of difference.
As of March 2022, you can write pretty decent, small programs in SLAP.
Note: The SLAP-to-JS transpiler is in progress (see compiler branch).
SLAP-to-JS Compiler Example
Screen.Recording.2022-04-07.at.11.41.19.PM.mov
On Linux/macOS, you may be able to run the following commands to install SLAP.
$ git clone https://github.com/bichanna/slap.git
$ cd slap
$ chmod +x ./build.sh
$ ./build.sh # The SLAP Vim highlighter automatically gets installed
For Windows, I haven't written bat version of build.sh
, so you have to manually compile the source code.
$ nimble build --multimethods:on -d:release
Then, mark it as an executable file if necessary, and try running slap --version
.
$ slap --version
SLAP 0.0.3
You may want to test current SLAP you just built before running your programs.
$ nimble test
Note: If you have a feature request, please open an issue.
- Basic Data Types
- Integer
- Float
- String
- Boolean
- Null
- List
- Map
- Basic Arithmetics
- Variables
- If Statements
- elif
- else
- While Loops
- For Loops
- Break
- Continue
- "Enhanced" for loop (in the form of
forEach
)
- Try-except Blocks
- Functions
- Lambdas (anonymous functions)
- Default Arguments
- Rest Parameters
- Standard Library
- Std
- String
- OS
- I/O interfaces
- Math
- Networking
- Classes
- Class Methods
- Inheritance
- Abstract Class (Interface)
- Import
- Concurrency
- Virtual Machine Compiler
- Assignment Shorthands (e.g,
+=
,*=
) - String Interpolation
- Optional Type Annotations
- Multi-line Comments
- Vim Highlighter
- VSCode Highlighter
- Transpiler (to JavaScript)
- Newline As Statement Separator
Bug reports and contributions are always welcome :)
Please be sure to add test files if you want to add new features (see tests directory for more info).
I learned a lot from
- Oak programming language by thesephist
- Bob Nystrom (munificent)'s great book, Crafting Interpreters.