snekky Actions
Disclaimer!
Please do not take this project too seriously. I'm in no way a professional. To be honest, I'm surprised myself that Snekky is even somewhat usable.
About
Snekky is a simple object-based, imperative programming language compiling to a custom bytecode. Checkout the specification for more information.
Features
- Built-in REPL.
- Familiar syntax.
- Compiles to a custom bytecode.
- Arrays and hashes.
- Lambdas and closures are supported.
- Almost everything is an expression (including
if
s,when
s and blocks). - Final (
let
) and mutable (mut
) variables. - Destructuring of arrays and hashes.
for ... in
loops with iterators.- As flexible and dynamic as a snek.
Installation
Compile it yourself
- Download and install Haxe.
- Clone this repository.
- Compile the project by executing
haxe scripts/build-cpp.hxml
. - Binaries will be located in
cpp/
.
Download release binaries
Builds can be found in the releases tab or the actions tab (login required).
Usage
- Create a file called
input.snek
in a text editor (e.g. Visual Studio Code). - (optional) Install the Snekky VSCode extension for syntax highlighting.
- Enter some code (check out the examples).
- Run it using
snekky input.snek
.
Run snekky --help
for more information.
Example
For more examples, checkout the examples folder.
// An implementation of the classic FizzBuzz programming test
for let i in 0..100 {
Sys.println(when {
i % 3 == 0 && i % 5 == 0 => "FizzBuzz"
i % 3 == 0 => "Fizz"
i % 5 == 0 => "Buzz"
else => i
});
}
REPL
The REPL allows you to quickly test a few lines of code by entering them one after the other. Syntax highlighting and automatic block indentation are supported.
Additional tools
- snekkyd - Decompiler for Snekky bytecode files.
- snekkyd-gui - GUI frontend for snekkyd.
- snekkyp - Disassembler for Snekky bytecode files.
- Snekky VSCode - Extension for VSCode providing syntax highlighting.
Contributing
- Fork it (https://github.com/snekkylang/snekky/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Senk Ju - creator and maintainer
Repository
snekky
Owner
Statistic
- 44
- 5
- 9
- 0
- 0
- over 2 years ago
- September 19, 2019
License
MIT License
Links
Synced at
Thu, 07 Nov 2024 15:54:38 GMT
Languages