Category:Arturo: Difference between revisions
Content added Content deleted
Drkameleon (talk | contribs) |
Drkameleon (talk | contribs) m (minor edit) |
||
(11 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
|exec=interpreted |
|exec=interpreted |
||
|strength=strong |
|strength=strong |
||
|safety=safe |
|||
|checking=dynamic |
|checking=dynamic |
||
|express=implicit |
|||
|parampass=value |
|||
|site= |
|site=https://arturo-lang.io |
||
|tags=arturo |
|tags=arturo |
||
|gc=yes}} |
|gc=yes}} |
||
Arturo is an independently-developed, modern programming language, vaguely related to various other ones - including but not limited to [[Logo]], [[Rebol]], [[Forth]], [[Ruby]], [[Haskell]], [[D]], [[SmallTalk]], [[Tcl]] and [[Lisp]]. |
|||
⚫ | |||
===Principles=== |
|||
* Code is just a list of words and symbols |
|||
⚫ | |||
* Words and symbols within a block are interpreted - when needed - according to the context |
|||
* No reserved words or keywords - look for them as hard as you can; there are absolutely none |
|||
<syntaxhighlight lang="arturo"> |
|||
====Everything is a simple statement==== |
|||
factorial: function [n][ |
|||
if? n > 0 -> n * factorial n-1 |
|||
else -> 1 |
|||
] |
|||
loop 1..19 [x]-> |
|||
There are no "special" language constructs (''even <code>if</code> is nothing but a simple statement''). Everything you see is a statement in the form <code>ID <expression> <expression> <expression> ...</code> |
|||
print ["Factorial of" x "=" factorial x] |
|||
<br> |
|||
</syntaxhighlight> |
|||
====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. |
|||
The main compiler is implemented in [[Nim]]/[[C]] as a Bytecode interpreter / Stack-based VM and should run in most architectures. |
|||
<br> |
|||
====Each statement returns a value==== |
|||
The main goals are: expressiveness, brevity, performance and portability. (With that exact order) |
|||
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. |
|||
<br> |
|||
====Functions are first-class citizens==== |
|||
Functions - or blocks of statements enclosed in <code>{}</code> - 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. |
|||
<br> |
|||
====Uniform syntax==== |
|||
As already mentioned, everything is a statement of the form `ID <expressions>`. So, how does this work? |
|||
* Is it the first time you are declaring this symbol? Then, the right-hand value will be assigned. |
|||
* Is it not the first time? Then again, the right-hand value will be assigned. |
|||
* Do you want to call a function you have declared, by name? Just prefix it with an exclamation mark. E.g.: <code>!myFunc "some arg" "another arg"</code> |
|||
* Do you want to use the result of a function call as part of an expression? Just enclose the function call in <code>$(...)</code> E.g.: <code>print $(reverse #(1 2 3))</code> |
|||
⚫ | |||
The main Arturo interpreter is written in the [[D]] language. |
|||
===License=== |
===License=== |
||
Line 46: | Line 34: | ||
===Todo=== |
===Todo=== |
||
[[Tasks not implemented in Arturo]] |
|||
[[Reports:Tasks_not_implemented_in_Arturo]] |
|||
⚫ | |||
⚫ | |||
{{language programming paradigm|Dynamic}} |
|||
{{language programming paradigm|Functional}} |
|||
{{language programming paradigm|Imperative}} |
{{language programming paradigm|Imperative}} |
||
⚫ | |||
⚫ | |||
{{language programming paradigm|Reflective}} |
{{language programming paradigm|Reflective}} |
Latest revision as of 16:00, 7 March 2023
Arturo
This programming language may be used to instruct a computer to perform a task.
Listed below are all of the tasks on Rosetta Code which have been solved using Arturo.
This programming language may be used to instruct a computer to perform a task.
Official website |
---|
Execution method: | Interpreted |
---|---|
Garbage collected: | Yes |
Type strength: | Strong |
Type expression: | Implicit |
Type checking: | Dynamic |
Lang tag(s): | arturo |
See Also: |
|
Arturo is an independently-developed, modern programming language, vaguely related to various other ones - including but not limited to Logo, Rebol, Forth, Ruby, Haskell, D, SmallTalk, Tcl and Lisp.
The language has been designed following some very simple and straightforward principles:
- Code is just a list of words and symbols
- Words and symbols within a block are interpreted - when needed - according to the context
- No reserved words or keywords - look for them as hard as you can; there are absolutely none
factorial: function [n][
if? n > 0 -> n * factorial n-1
else -> 1
]
loop 1..19 [x]->
print ["Factorial of" x "=" factorial x]
Implementation
The main compiler is implemented in Nim/C as a Bytecode interpreter / Stack-based VM and should run in most architectures.
The main goals are: expressiveness, brevity, performance and portability. (With that exact order)
License
Arturo is released under the MIT/X11 License.
Todo
Pages in category "Arturo"
The following 200 pages are in this category, out of 779 total.
(previous page) (next page)F
- Factors of a Mersenne number
- Factors of an integer
- Fairshare between two and more
- Farey sequence
- FASTA format
- Fermat numbers
- Fibonacci n-step number sequences
- Fibonacci sequence
- Fibonacci word
- File extension is in extensions list
- File input/output
- File size
- Filter
- Find adjacent primes which differ by a square integer
- Find common directory path
- Find first and last set bit of a long integer
- Find first missing positive
- Find limit of recursion
- Find minimum number of coins that make a given value
- Find palindromic numbers in both binary and ternary bases
- Find prime n such that reversed n is also prime
- Find prime numbers of the form n*n*n+2
- Find square difference
- Find squares n where n+1 is prime
- Find the intersection of a line with a plane
- Find the intersection of two lines
- Find the last Sunday of each month
- Find the missing permutation
- Find words which contain the most consonants
- Find words which contains all the vowels
- Find words which contains more than 3 e vowels
- Find words whose first and last three letters are equal
- Find words with alternating vowels and consonants
- First 9 prime Fibonacci number
- First-class functions
- First-class functions/Use numbers analogously
- Five weekends
- Fivenum
- FizzBuzz
- Flatten a list
- Flow-control structures
- Floyd's triangle
- Forbidden numbers
- Formatted numeric output
- Fortunate numbers
- Forward difference
- Four bit adder
- Four sides of square
- Fractal tree
- Frobenius numbers
- Function composition
- Function definition
- Function frequency
- Fusc sequence
G
- Gamma function
- Gapful numbers
- General FizzBuzz
- Generate Chess960 starting position
- Generate lower case ASCII alphabet
- Generate random numbers without repeating a value
- Generic swap
- Get system command output
- Getting the number of decimal places
- Giuga numbers
- Globally replace text in several files
- Goldbach's comet
- Gray code
- Greatest common divisor
- Greatest element of a list
- Greatest subsequential sum
- Guess the number
- Guess the number/With feedback
- Guess the number/With feedback (player)
H
- Hailstone sequence
- Halt and catch fire
- Hamming numbers
- Happy numbers
- Harmonic series
- Harshad or Niven series
- Hash from two arrays
- Hash join
- Haversine formula
- Hello world/Graphical
- Hello world/Line printer
- Hello world/Newbie
- Hello world/Newline omission
- Hello world/Standard error
- Hello world/Text
- Hello world/Web server
- Here document
- Heronian triangles
- Hex words
- Higher-order functions
- History variables
- Hofstadter Q sequence
- Holidays related to Easter
- Honaker primes
- Horizontal sundial calculations
- Horner's rule for polynomial evaluation
- Hostname
- HTTP
- HTTPS
- HTTPS/Authenticated
- HTTPS/Client-authenticated
I
- I before E except after C
- IBAN
- Iccanobif primes
- Identity matrix
- Idiomatically determine all the lowercase and uppercase letters
- Idoneal numbers
- Include a file
- Increment a numerical string
- Index finite lists of positive integers
- Infinity
- Input loop
- Input/Output for lines of text
- Input/Output for pairs of numbers
- Integer comparison
- Integer overflow
- Integer roots
- Integer sequence
- Interactive programming (repl)
- Introspection
- Inverted syntax
- ISBN13 check digit
- Isqrt (integer square root) of X
- Iterated digits squaring
J
K
L
- Lah numbers
- Largest difference between adjacent primes
- Largest five adjacent number
- Largest int from concatenated ints
- Largest number divisible by its digits
- Largest palindrome product
- Largest prime factor
- Largest product in a grid
- Largest proper divisor of n
- Last Friday of each month
- Last list item
- Leap year
- Least common multiple
- Left factorials
- Length of an arc between two angles
- Leonardo numbers
- Letter frequency
- Levenshtein distance
- Levenshtein distance/Alignment
- List comprehensions
- Literals/Floating point
- Literals/Integer
- Literals/String
- Logical operations
- Logistic curve fitting in epidemiology
- Long literals, with continuations
- Long multiplication
- Long year
- Longest common prefix
- Longest common subsequence
- Longest common substring
- Longest common suffix
- Longest increasing subsequence
- Longest palindromic substrings
- Longest substrings without repeating characters
- Look-and-say sequence
- Loop over multiple arrays simultaneously
- Loops/Break
- Loops/Continue
- Loops/Do-while
- 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/Nested
- Loops/While
- Loops/With multiple ranges
- Loops/Wrong ranges
- Lucas-Lehmer test
- Ludic numbers
- Luhn test of credit card numbers
- LZW compression
Categories:
- Execution method/Interpreted
- Garbage collection/Yes
- Typing/Strong
- Typing/Expression/Implicit
- Typing/Checking/Dynamic
- Programming Languages
- Programming paradigm/Concatenative
- Programming paradigm/Declarative
- Programming paradigm/Dynamic
- Programming paradigm/Functional
- Programming paradigm/Imperative
- Programming paradigm/Reflective