Jenl
A language for people who do not want to write an expression parser. Every value is one word.
2020 · Turing complete: unknown · ●○○ easy · esolangs.org
Tested with 2 known programs · Test method
Run it
The idea
Jenl is from 2020. Its wiki page says it is for those too lazy to write complicated parsers, expression parsers above all. A Jenl parser reads the tokens once, never goes back and never recurses. So there are no expressions. Every value is a single atom, a number, a raw string or a variable name, and the only arithmetic is +=.
Read the story
The specification also asks for one general way of doing each thing, however slow or hacky. There is no if. The only control is a counted loop, and a condition becomes a loop that runs 0 times or more.
The machine
| Statement | Does |
|---|---|
def name = value; | Define a variable |
name = value; | Change a defined variable |
name += value; | Add two numbers, or join anything else as text |
print(value); | Print the value and end the line |
printn(value); | Print the value and stay on the line |
~repeat n ... ~quit | Run the lines between n times |
~repeat n as i ... ~quit | The same, with i counting from 0 |
A value is a whole number such as -17, a string between backticks with no escapes, or a variable. A directive starts with ~ and ends with its line. The specification gives no output for its programs. This implementation lets print end its line, as the nested loops need print(``) to end each row, and counts from 0, which makes the square 10 characters wide.
Example
The Fibonacci keeps two numbers and moves them on 40 times.
The Fibonacci keeps two numbers and moves them on 40 times. With only = and +=, the sum needs a third variable.
The adult test from the specification. adult is the age minus 17, and the loop that sets is_adult to 1 runs that many times, so for an age of 17 or less it never runs.
Further
See also
Also in Turing tarpits
Write your own in Run Convert a program from Jenl
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: jenl.
Command line
shib run jenl -e 'print(`Hello world`);'shib manual jenlSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/jenl.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org