Page namespace (page_namespace) | 0 |
Page title (without namespace) (page_title) | 'Luminol' |
Full page title (page_prefixedtitle) | 'Luminol' |
Old content model (old_content_model) | 'wikitext' |
New content model (new_content_model) | 'wikitext' |
Old page wikitext, before the edit (old_wikitext) | ''''Luminol'''<ref>The name comes from the Steven Wilson song of the same name.</ref> is an [[esoteric programming language]] created by [[User:Zaikawo]].
==Concept==
Luminol handles values in a special way; there are no types such as strings or ints. They're all represented using vectors ''(i.e lists)'' of bytes. Strings are represented as every character being a byte in the list. For example, <code>Hi</code> would be <code>72, 105</code>. Integers use BigInt notation with base 256 for each node, and Booleans are <code>1</code> for true, <code>0</code> for false. Truthyness checks if the value is not <code>0</code>.
==Operations==
{| class="wikitable"
|-
! Statement !! Behavior
|-
| <code>var : val;</code> || Sets <code>var</code>'s value to <code>val</code>. This also functions as an expression<ref>Expressions such as <code>? x : 5 {...}</code> are possible, as they declare <code>x</code> in the scope of the if statement.</ref>, returning <code>val</code>.
|-
| <code>? cond {block}</code> || If <code>cond</code> is truthy, execute the code inside <code>block</code>. This can also take an optional else clause, as seen below.
|-
| <code>? cond {block} % {else}</code> || Same as above, but if the condition fails, the code inside <code>else</code> will execute instead.
|-
| <code>& cond {block}</code> || While <code>cond</code> is truthy, executes the code inside <code>block</code>.
|}
{| class="wikitable"
|-
! Operation !! Result
|-
| <code>op + op</code> || Adds the two operands together numerically.
|-
| <code>op - op</code> || Subtracts the two operands together numerically.
|-
| <code>op * op</code> || Multiplies the two operands together numerically.
|-
| <code>op / op</code> || Divides the two operands together numerically.
|-
| <code>op .. op</code> || Adds the right operand's byte list to the end of the left operand's. (Not mutable, consider this concatenation.)
|-
| <code>!op</code> || Sets every byte in the value to its inverse (!byte). (Not mutable.)
|-
| <code>-op</code> || Inverts the sign of the operand. (Not mutable.)
|}
==Builtins==
Luminol contains 4 builtin functions. These serve as a means of displaying information to the user, and gathering input from them, aswell.
The distinction is due to how values are stored. As they take the same form, one could print a value in both numerical and string form, and get different outputs. These functions allow for reading/writing inputs in both formats.
{| class="wikitable"
|-
! Function !! Use
|-
| <code>prints(text)</code> || Prints the value <code>text</code> as a string to the terminal.
|-
| <code>printn(num)</code> || Prints the value <code>num</code> as a number to the terminal.
|-
| <code>inputs(prompt)</code> || Prompts the user for <code>prompt</code>, then accepts string input from stdin.
|-
| <code>inputn(block)}</code> || Prompts the user for <code>prompt</code>, then accepts numerical input from stdin.
|}
More may be added in the future.
==Example Programs==
===Hello World===
prints("Hello, World!");
===Cat Program===
result : inputs("");
prints(result);
Alternatively, this one goes on forever:
& true {
result : inputs("");
prints(result);
}
===Truth Machine===
input : inputn("");
& input {
printn(input);
}
printn(input);
==Implementations==
The official interpreter can be found over on codeberg[https://codeberg.org/zaikawo/luminol]. It is stable, but not fully functional (division is not yet added, etc.)
Instructions on how to build it are on the codeberg page.' |
New page wikitext, after the edit (new_wikitext) | '{{infobox proglang
|name=Luminol
|paradigms=Functional
|author=[[User:Zaikawo|Zaikawo]]
|year=[[:Category:2024|2024]]
|refimpl=[[:Category:Implemented|Implemented]]
|files=<code>.lum</code>
}}
'''Luminol'''<ref>The name comes from the Steven Wilson song of the same name.</ref> is an [[esoteric programming language]].
==Values==
Luminol data is stored in '''values'''; lists of bytes that are automatically handled by the interpreter.
Values lack a type, as they can be treated as any type formed of bytes. This gives them a lot of flexibility and usability, as they can be used to directly convert from one datatype to another.
Values also hold a sign, which is akin to the sign of a signed integer.
===Transformations===
Data in Luminol doesn't natively come as values, but as either Strings, Ints or Booleans. (yes, this language doesn't support decimals. cry about it.)<ref>If this language gets popular enough, or some kind soul makes a pull request thats adds them, i'll gladly add support for them.</ref>
* Strings are converted into values such as that every byte contains the ascii code of the letter at that spot. For example, <code>Hi</code> would turn into a value containing <code>72, 105</code>.
* Integers are converted into BigInts, utilizing base 256 at each node (each byte) of the list.
* Booleans are converted into a single byte containing <code>1</code> if true, or <code>0</code> if false.
===Signs===
All values start out as positive, although they can be changed via operations such as the <code>-</code> negation operation, or by subtracting a bigger value, etc.
Negative values printed as strings are printed in reverse.
Signs do not affect truthyness.
===Truthyness===
Speaking of truthyness, the truthyness of a value is simply determined by if it equals the <code>false</code> boolean representation. If it does, it's false. If it doesn't, it's true. This means that any text that is not empty, and any number below or above zero is true.
==Syntax==
Syntax for Luminol follows normal syntactic conventions for most modern, high-level programming languages, such as Python, being formed from statements and expressions.
Statements are as follows:
* <code>x : y;</code> - Sets variable <code>x</code> to the transformation of the value <code>y</code>.<ref>This doubles as an expression (without the semicolon) that allows for values to be set while the expression is being evaluated. When evaluated, it simply returns the value of the transformation.</ref>
* <code>? x {y}</code> - If <code>x</code> is truthy, runs the code inside of <code>y</code>. Can optionally contain an else clause by appending <code>% {else}</code> to the end. If <code>x</code> isn't truthy, the code inside <code>else</code> will run.
* <code>& x {y}</code> - While <code>x</code> is truthy, runs the code inside of <code>y</code>.
Expressions work in a similar manner to most programming languages, their special behavior specified below:
* Arithmetic (<code>+ - * and /</code>) interprets both operands as BigInts.
* Concatenation (<code>..</code>) appends the bytes from the right operand to the left operand.
* Unary NOT (<code>!</code>) sets all the bytes in the value to their inverse (!byte).
All expressions are non-mutable, and return a brand new value when used.
==Functions==
Function declarations are treated as expressions, similar to variable assignment. They follow the syntax <code><args..> -> {block}</code>.
Functions may be called by doing `name(args)`. If calling them as a statement, a semicolon is required at the end. Same with variable assignment.
You may return from a function call by calling a return statement, depicted as <code><-</code>. You may not return a value.
===Builtins===
Luminol contains 4 builtin functions. These serve as a means of displaying information to the user, and gathering input from them, aswell.
The distinction is due to how values are stored. As they take the same form, one could print a value in both numerical and string form, and get different outputs. These functions allow for reading/writing inputs in both formats.
{| class="wikitable"
|-
! Function !! Use
|-
| <code>prints(text)</code> || Prints the value <code>text</code> as a string to the terminal.
|-
| <code>printn(num)</code> || Prints the value <code>num</code> as a number to the terminal.
|-
| <code>inputs(prompt)</code> || Prompts the user for <code>prompt</code>, then accepts string input from stdin.
|-
| <code>inputn(block)}</code> || Prompts the user for <code>prompt</code>, then accepts numerical input from stdin.
|}
More may be added in the future.
==Example Programs==
===Hello World===
prints("Hello, World!");
===Cat Program===
result : inputs("");
prints(result);
Alternatively, this one goes on forever:
& true {
result : inputs("");
prints(result);
}
===Truth Machine===
input : inputn("");
& input {
printn(input);
}
printn(input);
==Implementations==
The official interpreter can be found over on codeberg[https://codeberg.org/zaikawo/luminol]. It is stable, but not fully functional (division is not yet added, etc.)
Instructions on how to build it are on the codeberg page.' |
Unified diff of changes made by edit (edit_diff) | '@@ -1,41 +1,59 @@
-'''Luminol'''<ref>The name comes from the Steven Wilson song of the same name.</ref> is an [[esoteric programming language]] created by [[User:Zaikawo]].
+{{infobox proglang
+|name=Luminol
+|paradigms=Functional
+|author=[[User:Zaikawo|Zaikawo]]
+|year=[[:Category:2024|2024]]
+|refimpl=[[:Category:Implemented|Implemented]]
+|files=<code>.lum</code>
+}}
+'''Luminol'''<ref>The name comes from the Steven Wilson song of the same name.</ref> is an [[esoteric programming language]].
-==Concept==
-Luminol handles values in a special way; there are no types such as strings or ints. They're all represented using vectors ''(i.e lists)'' of bytes. Strings are represented as every character being a byte in the list. For example, <code>Hi</code> would be <code>72, 105</code>. Integers use BigInt notation with base 256 for each node, and Booleans are <code>1</code> for true, <code>0</code> for false. Truthyness checks if the value is not <code>0</code>.
+==Values==
+Luminol data is stored in '''values'''; lists of bytes that are automatically handled by the interpreter.
-==Operations==
-{| class="wikitable"
-|-
-! Statement !! Behavior
-|-
-| <code>var : val;</code> || Sets <code>var</code>'s value to <code>val</code>. This also functions as an expression<ref>Expressions such as <code>? x : 5 {...}</code> are possible, as they declare <code>x</code> in the scope of the if statement.</ref>, returning <code>val</code>.
-|-
-| <code>? cond {block}</code> || If <code>cond</code> is truthy, execute the code inside <code>block</code>. This can also take an optional else clause, as seen below.
-|-
-| <code>? cond {block} % {else}</code> || Same as above, but if the condition fails, the code inside <code>else</code> will execute instead.
-|-
-| <code>& cond {block}</code> || While <code>cond</code> is truthy, executes the code inside <code>block</code>.
-|}
+Values lack a type, as they can be treated as any type formed of bytes. This gives them a lot of flexibility and usability, as they can be used to directly convert from one datatype to another.
-{| class="wikitable"
-|-
-! Operation !! Result
-|-
-| <code>op + op</code> || Adds the two operands together numerically.
-|-
-| <code>op - op</code> || Subtracts the two operands together numerically.
-|-
-| <code>op * op</code> || Multiplies the two operands together numerically.
-|-
-| <code>op / op</code> || Divides the two operands together numerically.
-|-
-| <code>op .. op</code> || Adds the right operand's byte list to the end of the left operand's. (Not mutable, consider this concatenation.)
-|-
-| <code>!op</code> || Sets every byte in the value to its inverse (!byte). (Not mutable.)
-|-
-| <code>-op</code> || Inverts the sign of the operand. (Not mutable.)
-|}
+Values also hold a sign, which is akin to the sign of a signed integer.
-==Builtins==
+===Transformations===
+Data in Luminol doesn't natively come as values, but as either Strings, Ints or Booleans. (yes, this language doesn't support decimals. cry about it.)<ref>If this language gets popular enough, or some kind soul makes a pull request thats adds them, i'll gladly add support for them.</ref>
+
+* Strings are converted into values such as that every byte contains the ascii code of the letter at that spot. For example, <code>Hi</code> would turn into a value containing <code>72, 105</code>.
+* Integers are converted into BigInts, utilizing base 256 at each node (each byte) of the list.
+* Booleans are converted into a single byte containing <code>1</code> if true, or <code>0</code> if false.
+
+===Signs===
+All values start out as positive, although they can be changed via operations such as the <code>-</code> negation operation, or by subtracting a bigger value, etc.
+
+Negative values printed as strings are printed in reverse.
+
+Signs do not affect truthyness.
+
+===Truthyness===
+Speaking of truthyness, the truthyness of a value is simply determined by if it equals the <code>false</code> boolean representation. If it does, it's false. If it doesn't, it's true. This means that any text that is not empty, and any number below or above zero is true.
+
+==Syntax==
+Syntax for Luminol follows normal syntactic conventions for most modern, high-level programming languages, such as Python, being formed from statements and expressions.
+
+Statements are as follows:
+* <code>x : y;</code> - Sets variable <code>x</code> to the transformation of the value <code>y</code>.<ref>This doubles as an expression (without the semicolon) that allows for values to be set while the expression is being evaluated. When evaluated, it simply returns the value of the transformation.</ref>
+* <code>? x {y}</code> - If <code>x</code> is truthy, runs the code inside of <code>y</code>. Can optionally contain an else clause by appending <code>% {else}</code> to the end. If <code>x</code> isn't truthy, the code inside <code>else</code> will run.
+* <code>& x {y}</code> - While <code>x</code> is truthy, runs the code inside of <code>y</code>.
+
+Expressions work in a similar manner to most programming languages, their special behavior specified below:
+* Arithmetic (<code>+ - * and /</code>) interprets both operands as BigInts.
+* Concatenation (<code>..</code>) appends the bytes from the right operand to the left operand.
+* Unary NOT (<code>!</code>) sets all the bytes in the value to their inverse (!byte).
+
+All expressions are non-mutable, and return a brand new value when used.
+
+==Functions==
+Function declarations are treated as expressions, similar to variable assignment. They follow the syntax <code><args..> -> {block}</code>.
+
+Functions may be called by doing `name(args)`. If calling them as a statement, a semicolon is required at the end. Same with variable assignment.
+
+You may return from a function call by calling a return statement, depicted as <code><-</code>. You may not return a value.
+
+===Builtins===
Luminol contains 4 builtin functions. These serve as a means of displaying information to the user, and gathering input from them, aswell.
' |
Lines added in edit (added_lines) | [
0 => '{{infobox proglang',
1 => '|name=Luminol',
2 => '|paradigms=Functional',
3 => '|author=[[User:Zaikawo|Zaikawo]]',
4 => '|year=[[:Category:2024|2024]]',
5 => '|refimpl=[[:Category:Implemented|Implemented]]',
6 => '|files=<code>.lum</code>',
7 => '}}',
8 => ''''Luminol'''<ref>The name comes from the Steven Wilson song of the same name.</ref> is an [[esoteric programming language]].',
9 => '==Values==',
10 => 'Luminol data is stored in '''values'''; lists of bytes that are automatically handled by the interpreter.',
11 => 'Values lack a type, as they can be treated as any type formed of bytes. This gives them a lot of flexibility and usability, as they can be used to directly convert from one datatype to another.',
12 => 'Values also hold a sign, which is akin to the sign of a signed integer.',
13 => '===Transformations===',
14 => 'Data in Luminol doesn't natively come as values, but as either Strings, Ints or Booleans. (yes, this language doesn't support decimals. cry about it.)<ref>If this language gets popular enough, or some kind soul makes a pull request thats adds them, i'll gladly add support for them.</ref>',
15 => '',
16 => '* Strings are converted into values such as that every byte contains the ascii code of the letter at that spot. For example, <code>Hi</code> would turn into a value containing <code>72, 105</code>.',
17 => '* Integers are converted into BigInts, utilizing base 256 at each node (each byte) of the list.',
18 => '* Booleans are converted into a single byte containing <code>1</code> if true, or <code>0</code> if false.',
19 => '',
20 => '===Signs===',
21 => 'All values start out as positive, although they can be changed via operations such as the <code>-</code> negation operation, or by subtracting a bigger value, etc.',
22 => '',
23 => 'Negative values printed as strings are printed in reverse.',
24 => '',
25 => 'Signs do not affect truthyness.',
26 => '',
27 => '===Truthyness===',
28 => 'Speaking of truthyness, the truthyness of a value is simply determined by if it equals the <code>false</code> boolean representation. If it does, it's false. If it doesn't, it's true. This means that any text that is not empty, and any number below or above zero is true.',
29 => '',
30 => '==Syntax==',
31 => 'Syntax for Luminol follows normal syntactic conventions for most modern, high-level programming languages, such as Python, being formed from statements and expressions.',
32 => '',
33 => 'Statements are as follows:',
34 => '* <code>x : y;</code> - Sets variable <code>x</code> to the transformation of the value <code>y</code>.<ref>This doubles as an expression (without the semicolon) that allows for values to be set while the expression is being evaluated. When evaluated, it simply returns the value of the transformation.</ref>',
35 => '* <code>? x {y}</code> - If <code>x</code> is truthy, runs the code inside of <code>y</code>. Can optionally contain an else clause by appending <code>% {else}</code> to the end. If <code>x</code> isn't truthy, the code inside <code>else</code> will run.',
36 => '* <code>& x {y}</code> - While <code>x</code> is truthy, runs the code inside of <code>y</code>.',
37 => '',
38 => 'Expressions work in a similar manner to most programming languages, their special behavior specified below:',
39 => '* Arithmetic (<code>+ - * and /</code>) interprets both operands as BigInts.',
40 => '* Concatenation (<code>..</code>) appends the bytes from the right operand to the left operand.',
41 => '* Unary NOT (<code>!</code>) sets all the bytes in the value to their inverse (!byte).',
42 => '',
43 => 'All expressions are non-mutable, and return a brand new value when used.',
44 => '',
45 => '==Functions==',
46 => 'Function declarations are treated as expressions, similar to variable assignment. They follow the syntax <code><args..> -> {block}</code>.',
47 => '',
48 => 'Functions may be called by doing `name(args)`. If calling them as a statement, a semicolon is required at the end. Same with variable assignment.',
49 => '',
50 => 'You may return from a function call by calling a return statement, depicted as <code><-</code>. You may not return a value.',
51 => '',
52 => '===Builtins==='
] |