33 lines
No EOL
989 B
Text
33 lines
No EOL
989 B
Text
{{language|EMal
|
|
|exec=interpreted
|
|
|strength=weak
|
|
|checking=dynamic
|
|
|express=explicit
|
|
|site=https://emal-lang.sourceforge.io
|
|
|tags=emal
|
|
|gc=yes}}
|
|
EMal is a prototyping programming language that supports English and Italian syntax.
|
|
|
|
EMal wants to be expressive and readable. It supports closures, classes, records; it's influenced by Java, Perl, Javascript.
|
|
|
|
The programming environment consists of an interpreter that directly navigates the AST produced by the parser.
|
|
|
|
This is an example that, inside the same script, calculates <i>F<sub>10</sub></i> = 55 in English and in Italian:
|
|
<syntaxhighlight lang="emal">
|
|
type FibonacciInEnglish
|
|
fun fibonacci ← int by int n
|
|
if n < 2 do return n
|
|
else do return fibonacci(n - 1) + fibonacci(n - 2)
|
|
end
|
|
end
|
|
writeLine(fibonacci(10))
|
|
tipo FibonacciInItaliano
|
|
funzione fibonacci ← intero da intero n
|
|
se n < 2
|
|
ritorna n
|
|
altrimenti
|
|
ritorna fibonacci(n - 1) + fibonacci(n - 2)
|
|
fine
|
|
fine
|
|
scriviLinea(fibonacci(10))
|
|
</syntaxhighlight> |