A functional 🤑 first programming language with limited types and basic features.
Go to Github releases
Download violence_win_64.exe
Rename it and use it in command line
curl -sSL https://raw.githubusercontent.com/0xleft/violence/master/install.sh | sudo sh
sudo apt install -y build-essential cmake
git clone https://github.com/0xleft/violence.git
cd violence
# if you are not on linux you can use wsl or docker
cat build.sh
chmod +x build.sh
./build.sh <platform> # currently supported: linux
# move the binary to /usr/local/bin or to your PATH
# Enjoy :)
You can run the program in two modes: file and interactive.
- File
violence <file>
- Interactive
violence
Visit docs here 😱
In Violence variables are declared using a type before them.
Types are:
lemon
for numbersword
for stringsmood
for booleans
Note
In the future I plan to change lemon to char and have arrays as new type
lemon a : 5
word b : "Hello World"
mood c : "good"
You can easely change between types for example when you want to print a number as a string you can do:
lemon a : 5
word b : a
~ here b is now "5"
You can also change a string to a number:
word a : "5"
lemon b : a
~ here b is now 5
This works for all types.
Print to stdout
( say -> "Hello World" )
Read from stdin until newline
( ask -> "What is your name?" )
Read from a file
( read -> "file.txt" )
Write to a file
( write -> "file.txt" -> "Hello World" )
Which stands for execute shell command
( sheesh -> "ls" )
( exit )
( say -> "Hello World" )
f-> mod -> number -> mod_number -> lemon
lemon output : number % mod_number
<-f
f-> fizzbuzz -> count -> max_count -> void
lemon count = count + 1
word output = ""
if ( mod -> count -> 3 ) == 0
word output = output + "fizz"
if ( mod -> count -> 5 ) == 0
word output = output + "buzz"
word temp : count
if output == ""
( say -> temp )
if output != ""
( say -> output )
if count <= max_count
( fizzbuzz -> count -> max_count )
<-f
( fizzbuzz -> 0 -> 10 )
( get -> "example/simple.vio" )
( function_from_simple_vio )
You can find more examples in examples folder
Contributions are welcome!! 😎 If you want to contribute please create a pull request or if it is a big change create an issue first to discuss it.
GPLv3