Arturo
'''Arturo''' is a general-purpose, multi-paradigm language that aims to be simple, modern and powerful, vaguely inspired by various other ones - including but not limited to Ruby, Haskell, D, SDL (Simple Declarative Language), Tcl and Lisp.
Principles
It is built on some very simple and straightforward principles:
=Everything is a simple statement=
There are no "special" language constructs (''even if is nothing but a simple statement''). Everything you see is a statement in the form ID
Code is data - and data is code
Arturo can be used both as a data-interchange format and a programming language. Basically all data structures are valid code and all code can be represented as a data structure. Think of it as SDL/Json/YAML/XML combined with the power of Lisp - but without the... sea of opening and closing parentheses.
=Each statement returns a value=
Whether what you would consider a "function" or any other statement, it will return a value. If it's a block of code (see: ''function''), the last statement's result will be return - unless specified otherwise.
Functions are first-class citizens
Functions - or blocks of statements enclosed in {} - can be anything. Assign them to a symbol/variable, pass them around as arguments to function calls, include them as a dictionary key value, or return them from a function. And of course they can be either named or anonymous/lambda.
=Uniform syntax=
As already mentioned, everything is a statement of the form ID <expressions>. So, how does this work?
- Is the ID a new or non-function existing symbol? Then, the right-hand value will be assigned to it
- Is it a function? Then it will be called, with the right-hand values as arguments
- Do you want to use the result of a function call as part of an expression? Just enclose the function call in
$(...)E.g.:print $(reverse #(1 2 3))
Implementation
The main Arturo interpreter is written in the D language.
License
Arturo is released under the MIT/X11 License.
Todo
Tasks
- Apply a callback to an array
- Arithmetic/Integer
- Array concatenation
- Array length
- Arrays
- Associative array/Creation
- Associative array/Iteration
- Averages/Arithmetic mean
- Balanced brackets
- Base64 decode data
- Bitwise operations
- Boolean values
- Call a function
- Call an object method
- Catalan numbers
- Check that file exists
- Classes
- Collections
- Comma quibbling
- Command-line arguments
- Comments
- Compound data type
- Conditional structures
- Count the coins
- Create an HTML table
- Day of the week
- Documentation
- Even or odd
- Execute Brainfuck
- Execute a system command
- Extend your language
- Extract file extension
- Factorial
- Factors of an integer
- Fibonacci sequence
- Filter
- FizzBuzz
- Function definition
- Generate lower case ASCII alphabet
- Greatest common divisor
- Greatest element of a list
- Guess the number
- HTTP
- Hello world!
- Hello world/Graphical
- Hello world/Newline omission
- Hello world/Standard error
- Hello world/Text
- Higher-order functions
- IBAN
- Increment a numerical string
- Inheritance/Single
- Integer comparison
- Integer roots
- Literals/Floating point
- Literals/Integer
- Literals/String
- Logical operations
- Longest common prefix
- Loops/Downward for
- Loops/For
- Loops/For with a specified step
- Loops/Foreach
- Loops/Increment loop index within loop body
- Loops/Infinite
- Loops/N plus one half
- Loops/While
- Permutations
- Prime decomposition
- Queue/Definition
- Queue/Usage
- Read entire file
- Repeat
- Reverse a string
- Reverse the gender of a string
- Sorting algorithms/Bubble sort
- Sorting algorithms/Quicksort
- String case
- String concatenation
- String length
- String matching
- Sum and product of an array
- Sum multiples of 3 and 5
- Sum of squares
- Terminal control/Coloured text
- Time a function
- Tokenize a string
- Tokenize a string with escaping
- Trigonometric functions
- Truncatable primes
- URL decoding
- URL encoding
- URL parser
- Undefined values
- Unix/ls
- Variables
- Variadic function
- Web scraping
- Window creation
- Write entire file