JIT-compiled programming language.
- Copy and paste the following command in a shell:
sudo sh -c 'curl -L https://github.com/jarkonik/rocklang/releases/latest/download/rocklang-ubuntu-latest -o /usr/local/bin/rocklang && chmod +x /usr/local/bin/rocklang'
- Create a file named
main.rck
in a directory of your choice, with following content:
print("Hello from rocklang")
- While being in the same directory, that you've created the source file in, run
rocklang main.rck
from a shell. - You should see text
Hello from rocklang
printed in your terminal.
- Download and run the installer.
- Create a file named
main.rck
in a directory of your choice, with the following content:
print("Hello from rocklang")
- While being in the same directory, that you've created the source file in, run
rocklang main.rck
from PowerShell or Command Prompt. - You should see text
Hello from rocklang
printed in your terminal.
- Copy and paste the following command in a shell:
sudo sh -c 'curl -L https://github.com/jarkonik/rocklang/releases/latest/download/rocklang-macos-latest -o /usr/local/bin/rocklang && chmod +x /usr/local/bin/rocklang'
- Create a file named
main.rck
in a directory of your choice, with the following content:
print("Hello from rocklang")
- While being in the same directory, that you've created the source file in, run
rocklang main.rck
from a shell. - You should see text
Hello from rocklang
printed in your terminal.
Sample implementation of Sieve of Eratosthenes written in Rock
mem_set = (vec: vec, val: number, n: number): vec => {
i = 0
while i < n {
vec_set(vec, i, val)
i = i + 1
}
vec
}
sieve = (n: number): void => {
v = vec_new()
prime = mem_set(v, 1, n + 1)
p = 2
while p * p <= n {
if vec_get(prime, p) == 1 {
i = p * p
while i <= n {
vec_set(prime, i, 0)
i = i + p
}
}
p = p + 1
}
p = 2
while p <= n {
if vec_get(prime, p) == 1 {
print(string(p))
print("\n")
}
p = p + 1
}
}
sieve(10)
- Install Rust compiler that supports Rust Edition 2021, along with
cargo
tool, in your favorite fashion. - Install llvm 13
- Run
cargo build
to build binaries orcargo run examples/sieve.rck
to run a sample program.
This project is licensed under the terms of the MIT license.