![Overcoming mental limitations](https://private-user-images.githubusercontent.com/64385550/311774048-28cdc310-faec-4a36-97f2-fd98bd292ee0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwMDY1MzcsIm5iZiI6MTcyNDAwNjIzNywicGF0aCI6Ii82NDM4NTU1MC8zMTE3NzQwNDgtMjhjZGMzMTAtZmFlYy00YTM2LTk3ZjItZmQ5OGJkMjkyZWUwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE4VDE4MzcxN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWVlNDFmYmVkNzM5NzBiYWYzMDJjMTIzOGU2YTI3OWFkMzQ1MDc1NWIwMDg4ZDliOTFiYjI2MGNlN2ViZTgzNjcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.R8ZblqN61PllOCOXieuTySUh1tEVzxW51RT7ff8VtJQ)
A programming language inspired by different things that aims to attract all kinds of developers. Ah, obviously that's impossible, but at least we have a good idea!
In our programming language, the well-known Fizzbuzz program is as follows:
/**
* A small challenge to label numbers into three categories...
*/
let rng_start = (
readln!("Enter the starting point of the range: ")
.toint()
);
let rng_end = (
readln!("And also the end: ")
.toint()
);
if rng_start >= rng_end = {
println("The start value must be smaller than the end value!");
exit!(1);
}
for let i in [rng_start..rng_end] = {
if ((% i 15) == 0) = {
println("...Fizzbuzz");
} else if ((% i 3) == 0) = {
println("...Fizz");
} else if ((% i 5) == 0) = {
println("...Buzz");
} else = {
println("${i}"); // Or just pass `i` as an argument!
}
}
Yes, we use prefix notation for mathematical operations that clearly indicate priorities. You should also put an equal sign behind the open brace before starting a block...
Would you like to see more code samples from the Farr programming language? Go to the examples folder...
Clone it first:
git clone https://github.com/sheikhartin/farr.git \
&& cd farr
For both cool developers and adventurous users:
pip install -e . \
&& export FARRPATH=$PWD \
&& farr -h
However, virtualization is usually a better option:
docker build -t farr . \
&& docker run -it farr -h
Once Farr is installed, you can use it in several ways:
To run a .farr
file, use the run
command:
farr run examples/linear_search/sol02.farr
Remember to replace the example code with your own Farr code.
To start an interactive Farr shell (REPL), use the shell
command:
farr shell
To swiftly execute Farr code snippets right from your command line, use the cmd
command:
farr cmd 'println("Hello, world!");'
Join the Farr community here to discuss, ask questions, and share what you've built with Farr.
This project is licensed under the MIT license found in the LICENSE file in the root directory of this repository.
As you know, you shouldn't use this language for a serious product [at least not yet]!