Examine individual changes
This page allows you to examine the variables generated by the Abuse Filter for an individual change.
Variables generated for this change
Variable | Value |
---|---|
Edit count of the user (user_editcount) | 161 |
Name of the user account (user_name) | 'Ashli Katt' |
Age of the user account (user_age) | 82926009 |
Page ID (page_id) | 0 |
Page namespace (page_namespace) | 0 |
Page title (without namespace) (page_title) | 'Smoothbrain' |
Full page title (page_prefixedtitle) | 'Smoothbrain' |
Action (action) | 'edit' |
Edit summary/reason (summary) | 'Create page' |
Old content model (old_content_model) | '' |
New content model (new_content_model) | 'wikitext' |
Old page wikitext, before the edit (old_wikitext) | '' |
New page wikitext, after the edit (new_wikitext) | '{{infobox proglang
|name=Smoothbrain
|author=[[User:Ashli Katt|Ashli Katt]]
|year=[[:Category:2025|2025]]
|class=Turing Complete
}}
Smoothbrain is a [[brainfuck]] derivative that restricts what is considered a compliant interpreter/compiler. It was made to
dictate an exact brainfuck-like specification for a personal project of mine, as well as stamp out possible portability concerns.
== Memory Model ==
Smoothbrain's memory, much like brainfuck, consists of a ''tape'' and a ''tape head''. The ''tape'' is a right-unbounded array
of "cells" containing integers in the range 0 to 255 inclusive. The ''tape head'' is a value that can represent any single cell
in the tape, and is initialized to the leftmost ''tape'' cell ("index 0").
== Program ==
A Smoothbrain program is defined as a sequence of 0 or more of the following bytes: <code>43 44 45 46 60 62 91 93</code>, these
are called "instructions". Other bytes may be prepended, appended, or interspersed between these, but MUST NOT affect program
execution or semantics. This essentially means that Smoothbrain programs are written in ASCII, or a backwards-compatible format
like UTF-8, but compilers and interpreters MUST NOT validate or otherwise check their programs for a specific string encoding.
Just handle those 8 bytes and ignore everything else.
The bytes <code>91</code> and <code>93</code> (literally <code>[</code> and <code>]</code> in ASCII) MUST form "pairs" in the
source code. If one of these bytes cannot be assigned a pair, the program is invalid and MUST be rejected. Each pair starts
with <code>91</code> and ends with <code>93</code>. A given <code>91</code> is considered to pair with a <code>93</code> if
all <code>91</code>s and <code>93</code>s between them already have pairs, OR if there exist no <code>91</code>s or
<code>93</code>s between them. In other words, ASCII brackets pair up exactly as you'd expect, and it's invalid to
have mismatched brackets.
Smoothbrain instruction bytes should be executed in-order starting from the first instruction. The program terminates if an error
occurs, or after the final instruction has been executed. (Unless the final instruction was a <code>93</code> and caused the program to
jump backwards; see below.) The following table lists the eight recognized instructions and what they do when executed.
{| class="wikitable"
|+ Recognized Instructions
|-
! Byte !! Byte in ASCII !! Effect on Program State
|-
| 43 || <code>+</code> || Increment the integer in the ''tape'' cell currently pointed to by the ''tape head''. If the cell's value was <code>255</code>, then incrementing it results in <code>0</code>.
|-
| 44 || <code>,</code> || Read a byte from STDIN and set the integer in the ''tape'' cell currently pointed to by the ''tape head'' to it. If no byte can be read (i.e. EOF) then a compliant interpreter/compiler MUST NOT update any ''tape'' cell.
|-
| 45 || <code>-</code> || Decrement the integer in the ''tape'' cell currently pointed to by the ''tape head''. If the cell's value was <code>0</code>, then decrementing it results in <code>255</code>.
|-
| 46 || <code>.</code> || Take the integer in the ''tape'' cell currently pointed to by the ''tape head'' and write it to STDOUT.
|-
| 60 || <code><</code> || Point the ''tape head'' one cell towards the ''tape'' edge relative to the cell it currently points to. If this instruction is executed when the ''tape head'' is already at the leftmost cell ("index 0"), then the program should immediately halt with exit code 1.
|-
| 62 || <code>></code> || Point the ''tape head'' one cell away from the ''tape'' edge relative to the cell it currently points to.
|-
| 91 || <code>[</code> || If the integer in the ''tape'' cell currently pointed to by the ''tape head'' is 0, then jump program execution to this instruction's paired <code>93</code>.
|-
| 93 || <code>]</code> || If the integer in the ''tape'' cell currently pointed to by the ''tape head'' is NOT 0, then jump program execution to this instruction's paired <code>91</code>.
|}
== IO ==
Smoothbrain Input & Output (using instruction bytes <code>44</code> and <code>46</code>) inherently relies on STDIN and STDOUT.
It is impossible to write a compliant interpreter or compiler for a target that does not support or otherwise cannot emulate
standard streams. Additionally, preprocessing must be done on the streams themselves to ensure code portability:
Bytes from STDIN must be converted ''from'' the OS's native encoding to UTF-8. If any unrecognized or broken characters exist,
they MUST be replaced with a "�" (U+FFFD) character.
Bytes written to STDOUT must be treated as UTF-8 and converted ''into'' the OS's native text encoding. This could entail holding a
4-byte buffer to "collect" character data before converting and truly writing it to STDOUT. If an invalid UTF-8 character is written,
or the program ends while in the middle of a multi-byte UTF-8 character, then the interpreter/compiler MUST write a "�" (U+FFFD)
character to STDOUT.
Finally, any OS-specific newlines read from STDIN MUST be converted into a single Line Feed (U+000A) character before the Smoothbrain
program receives it. Conversely, any Line Feed characters written to STDOUT by the program MUST be converted into an OS-specific newline.
(Smoothbrain programs that write Carriage Returns or other newline forms to STDOUT are legal but discouraged. Compilers and interpreters
MUST NOT have special cases for Carriage Returns, or combination Carriage Return + Line Feed, or similar.)
== Error States ==
The following are cases where a Smoothbrain program MUST halt with an error code.
1. Instruction <code>60</code> (<code><</code>) is executed while the ''tape head'' is at the leftmost cell ("index 0"). Exit code 1.
2. Memory cannot be (re)allocated for the ''tape'' because the OS denies the request or otherwise no memory is available. Exit code 2.
== Implementation Concerns ==
Smoothbrain is extremely similar to brainfuck, and thus retains similar optimizations as it, such as <code>[-]</code> becoming a
"SET CELL TO 0" instruction. However, it should be noted that it is well-defined in Smoothbrain that going past the left edge of the ''tape''
is an error state, and MUST crash the program. Thus, while the command sequence <code>><</code> can be optimized out of a program, the sequence
<code><></code> will halt if the ''tape head'' was at the leftmost cell when executed, thus optimizing it away results in an invalid implementation
if the compiler/interpreter can't prove that a crash cannot happen.
== Turing Completeness ==
Smoothbrain is trivially Turing Complete by way of being equivalent to Brainfuck aside from IO, program form, and error-state specifics. (All of which
are outside of the scope of brainfuck's turing-completeness)
[[Category:Languages]] [[Category:Cell-based]] [[Category:Turing_tarpits]] [[Category:Brainfuck_equivalents]] [[Category:Low-level]]' |
Unified diff of changes made by edit (edit_diff) | '@@ -1,0 +1,92 @@
+{{infobox proglang
+|name=Smoothbrain
+|author=[[User:Ashli Katt|Ashli Katt]]
+|year=[[:Category:2025|2025]]
+|class=Turing Complete
+}}
+
+Smoothbrain is a [[brainfuck]] derivative that restricts what is considered a compliant interpreter/compiler. It was made to
+dictate an exact brainfuck-like specification for a personal project of mine, as well as stamp out possible portability concerns.
+
+== Memory Model ==
+Smoothbrain's memory, much like brainfuck, consists of a ''tape'' and a ''tape head''. The ''tape'' is a right-unbounded array
+of "cells" containing integers in the range 0 to 255 inclusive. The ''tape head'' is a value that can represent any single cell
+in the tape, and is initialized to the leftmost ''tape'' cell ("index 0").
+
+== Program ==
+A Smoothbrain program is defined as a sequence of 0 or more of the following bytes: <code>43 44 45 46 60 62 91 93</code>, these
+are called "instructions". Other bytes may be prepended, appended, or interspersed between these, but MUST NOT affect program
+execution or semantics. This essentially means that Smoothbrain programs are written in ASCII, or a backwards-compatible format
+like UTF-8, but compilers and interpreters MUST NOT validate or otherwise check their programs for a specific string encoding.
+Just handle those 8 bytes and ignore everything else.
+
+The bytes <code>91</code> and <code>93</code> (literally <code>[</code> and <code>]</code> in ASCII) MUST form "pairs" in the
+source code. If one of these bytes cannot be assigned a pair, the program is invalid and MUST be rejected. Each pair starts
+with <code>91</code> and ends with <code>93</code>. A given <code>91</code> is considered to pair with a <code>93</code> if
+all <code>91</code>s and <code>93</code>s between them already have pairs, OR if there exist no <code>91</code>s or
+<code>93</code>s between them. In other words, ASCII brackets pair up exactly as you'd expect, and it's invalid to
+have mismatched brackets.
+
+Smoothbrain instruction bytes should be executed in-order starting from the first instruction. The program terminates if an error
+occurs, or after the final instruction has been executed. (Unless the final instruction was a <code>93</code> and caused the program to
+jump backwards; see below.) The following table lists the eight recognized instructions and what they do when executed.
+
+{| class="wikitable"
+|+ Recognized Instructions
+|-
+! Byte !! Byte in ASCII !! Effect on Program State
+|-
+| 43 || <code>+</code> || Increment the integer in the ''tape'' cell currently pointed to by the ''tape head''. If the cell's value was <code>255</code>, then incrementing it results in <code>0</code>.
+|-
+| 44 || <code>,</code> || Read a byte from STDIN and set the integer in the ''tape'' cell currently pointed to by the ''tape head'' to it. If no byte can be read (i.e. EOF) then a compliant interpreter/compiler MUST NOT update any ''tape'' cell.
+|-
+| 45 || <code>-</code> || Decrement the integer in the ''tape'' cell currently pointed to by the ''tape head''. If the cell's value was <code>0</code>, then decrementing it results in <code>255</code>.
+|-
+| 46 || <code>.</code> || Take the integer in the ''tape'' cell currently pointed to by the ''tape head'' and write it to STDOUT.
+|-
+| 60 || <code><</code> || Point the ''tape head'' one cell towards the ''tape'' edge relative to the cell it currently points to. If this instruction is executed when the ''tape head'' is already at the leftmost cell ("index 0"), then the program should immediately halt with exit code 1.
+|-
+| 62 || <code>></code> || Point the ''tape head'' one cell away from the ''tape'' edge relative to the cell it currently points to.
+|-
+| 91 || <code>[</code> || If the integer in the ''tape'' cell currently pointed to by the ''tape head'' is 0, then jump program execution to this instruction's paired <code>93</code>.
+|-
+| 93 || <code>]</code> || If the integer in the ''tape'' cell currently pointed to by the ''tape head'' is NOT 0, then jump program execution to this instruction's paired <code>91</code>.
+
+|}
+
+== IO ==
+Smoothbrain Input & Output (using instruction bytes <code>44</code> and <code>46</code>) inherently relies on STDIN and STDOUT.
+It is impossible to write a compliant interpreter or compiler for a target that does not support or otherwise cannot emulate
+standard streams. Additionally, preprocessing must be done on the streams themselves to ensure code portability:
+
+Bytes from STDIN must be converted ''from'' the OS's native encoding to UTF-8. If any unrecognized or broken characters exist,
+they MUST be replaced with a "�" (U+FFFD) character.
+
+Bytes written to STDOUT must be treated as UTF-8 and converted ''into'' the OS's native text encoding. This could entail holding a
+4-byte buffer to "collect" character data before converting and truly writing it to STDOUT. If an invalid UTF-8 character is written,
+or the program ends while in the middle of a multi-byte UTF-8 character, then the interpreter/compiler MUST write a "�" (U+FFFD)
+character to STDOUT.
+
+Finally, any OS-specific newlines read from STDIN MUST be converted into a single Line Feed (U+000A) character before the Smoothbrain
+program receives it. Conversely, any Line Feed characters written to STDOUT by the program MUST be converted into an OS-specific newline.
+(Smoothbrain programs that write Carriage Returns or other newline forms to STDOUT are legal but discouraged. Compilers and interpreters
+MUST NOT have special cases for Carriage Returns, or combination Carriage Return + Line Feed, or similar.)
+
+== Error States ==
+The following are cases where a Smoothbrain program MUST halt with an error code.
+
+1. Instruction <code>60</code> (<code><</code>) is executed while the ''tape head'' is at the leftmost cell ("index 0"). Exit code 1.
+2. Memory cannot be (re)allocated for the ''tape'' because the OS denies the request or otherwise no memory is available. Exit code 2.
+
+== Implementation Concerns ==
+Smoothbrain is extremely similar to brainfuck, and thus retains similar optimizations as it, such as <code>[-]</code> becoming a
+"SET CELL TO 0" instruction. However, it should be noted that it is well-defined in Smoothbrain that going past the left edge of the ''tape''
+is an error state, and MUST crash the program. Thus, while the command sequence <code>><</code> can be optimized out of a program, the sequence
+<code><></code> will halt if the ''tape head'' was at the leftmost cell when executed, thus optimizing it away results in an invalid implementation
+if the compiler/interpreter can't prove that a crash cannot happen.
+
+== Turing Completeness ==
+Smoothbrain is trivially Turing Complete by way of being equivalent to Brainfuck aside from IO, program form, and error-state specifics. (All of which
+are outside of the scope of brainfuck's turing-completeness)
+
+[[Category:Languages]] [[Category:Cell-based]] [[Category:Turing_tarpits]] [[Category:Brainfuck_equivalents]] [[Category:Low-level]]
' |
New page size (new_size) | 6961 |
Old page size (old_size) | 0 |
Lines added in edit (added_lines) | [
0 => '{{infobox proglang',
1 => '|name=Smoothbrain',
2 => '|author=[[User:Ashli Katt|Ashli Katt]]',
3 => '|year=[[:Category:2025|2025]]',
4 => '|class=Turing Complete',
5 => '}}',
6 => '',
7 => 'Smoothbrain is a [[brainfuck]] derivative that restricts what is considered a compliant interpreter/compiler. It was made to ',
8 => 'dictate an exact brainfuck-like specification for a personal project of mine, as well as stamp out possible portability concerns.',
9 => '',
10 => '== Memory Model ==',
11 => 'Smoothbrain's memory, much like brainfuck, consists of a ''tape'' and a ''tape head''. The ''tape'' is a right-unbounded array ',
12 => 'of "cells" containing integers in the range 0 to 255 inclusive. The ''tape head'' is a value that can represent any single cell ',
13 => 'in the tape, and is initialized to the leftmost ''tape'' cell ("index 0").',
14 => '',
15 => '== Program ==',
16 => 'A Smoothbrain program is defined as a sequence of 0 or more of the following bytes: <code>43 44 45 46 60 62 91 93</code>, these',
17 => 'are called "instructions". Other bytes may be prepended, appended, or interspersed between these, but MUST NOT affect program ',
18 => 'execution or semantics. This essentially means that Smoothbrain programs are written in ASCII, or a backwards-compatible format ',
19 => 'like UTF-8, but compilers and interpreters MUST NOT validate or otherwise check their programs for a specific string encoding. ',
20 => 'Just handle those 8 bytes and ignore everything else.',
21 => '',
22 => 'The bytes <code>91</code> and <code>93</code> (literally <code>[</code> and <code>]</code> in ASCII) MUST form "pairs" in the ',
23 => 'source code. If one of these bytes cannot be assigned a pair, the program is invalid and MUST be rejected. Each pair starts ',
24 => 'with <code>91</code> and ends with <code>93</code>. A given <code>91</code> is considered to pair with a <code>93</code> if ',
25 => 'all <code>91</code>s and <code>93</code>s between them already have pairs, OR if there exist no <code>91</code>s or ',
26 => '<code>93</code>s between them. In other words, ASCII brackets pair up exactly as you'd expect, and it's invalid to',
27 => 'have mismatched brackets. ',
28 => '',
29 => 'Smoothbrain instruction bytes should be executed in-order starting from the first instruction. The program terminates if an error',
30 => 'occurs, or after the final instruction has been executed. (Unless the final instruction was a <code>93</code> and caused the program to',
31 => 'jump backwards; see below.) The following table lists the eight recognized instructions and what they do when executed.',
32 => '',
33 => '{| class="wikitable"',
34 => '|+ Recognized Instructions',
35 => '|-',
36 => '! Byte !! Byte in ASCII !! Effect on Program State',
37 => '|-',
38 => '| 43 || <code>+</code> || Increment the integer in the ''tape'' cell currently pointed to by the ''tape head''. If the cell's value was <code>255</code>, then incrementing it results in <code>0</code>.',
39 => '|-',
40 => '| 44 || <code>,</code> || Read a byte from STDIN and set the integer in the ''tape'' cell currently pointed to by the ''tape head'' to it. If no byte can be read (i.e. EOF) then a compliant interpreter/compiler MUST NOT update any ''tape'' cell.',
41 => '|-',
42 => '| 45 || <code>-</code> || Decrement the integer in the ''tape'' cell currently pointed to by the ''tape head''. If the cell's value was <code>0</code>, then decrementing it results in <code>255</code>.',
43 => '|-',
44 => '| 46 || <code>.</code> || Take the integer in the ''tape'' cell currently pointed to by the ''tape head'' and write it to STDOUT.',
45 => '|-',
46 => '| 60 || <code><</code> || Point the ''tape head'' one cell towards the ''tape'' edge relative to the cell it currently points to. If this instruction is executed when the ''tape head'' is already at the leftmost cell ("index 0"), then the program should immediately halt with exit code 1.',
47 => '|-',
48 => '| 62 || <code>></code> || Point the ''tape head'' one cell away from the ''tape'' edge relative to the cell it currently points to.',
49 => '|-',
50 => '| 91 || <code>[</code> || If the integer in the ''tape'' cell currently pointed to by the ''tape head'' is 0, then jump program execution to this instruction's paired <code>93</code>.',
51 => '|-',
52 => '| 93 || <code>]</code> || If the integer in the ''tape'' cell currently pointed to by the ''tape head'' is NOT 0, then jump program execution to this instruction's paired <code>91</code>.',
53 => '',
54 => '|}',
55 => '',
56 => '== IO ==',
57 => 'Smoothbrain Input & Output (using instruction bytes <code>44</code> and <code>46</code>) inherently relies on STDIN and STDOUT. ',
58 => 'It is impossible to write a compliant interpreter or compiler for a target that does not support or otherwise cannot emulate ',
59 => 'standard streams. Additionally, preprocessing must be done on the streams themselves to ensure code portability:',
60 => '',
61 => 'Bytes from STDIN must be converted ''from'' the OS's native encoding to UTF-8. If any unrecognized or broken characters exist,',
62 => 'they MUST be replaced with a "�" (U+FFFD) character.',
63 => '',
64 => 'Bytes written to STDOUT must be treated as UTF-8 and converted ''into'' the OS's native text encoding. This could entail holding a ',
65 => '4-byte buffer to "collect" character data before converting and truly writing it to STDOUT. If an invalid UTF-8 character is written,',
66 => 'or the program ends while in the middle of a multi-byte UTF-8 character, then the interpreter/compiler MUST write a "�" (U+FFFD) ',
67 => 'character to STDOUT. ',
68 => '',
69 => 'Finally, any OS-specific newlines read from STDIN MUST be converted into a single Line Feed (U+000A) character before the Smoothbrain ',
70 => 'program receives it. Conversely, any Line Feed characters written to STDOUT by the program MUST be converted into an OS-specific newline.',
71 => '(Smoothbrain programs that write Carriage Returns or other newline forms to STDOUT are legal but discouraged. Compilers and interpreters ',
72 => 'MUST NOT have special cases for Carriage Returns, or combination Carriage Return + Line Feed, or similar.)',
73 => '',
74 => '== Error States ==',
75 => 'The following are cases where a Smoothbrain program MUST halt with an error code.',
76 => '',
77 => '1. Instruction <code>60</code> (<code><</code>) is executed while the ''tape head'' is at the leftmost cell ("index 0"). Exit code 1.',
78 => '2. Memory cannot be (re)allocated for the ''tape'' because the OS denies the request or otherwise no memory is available. Exit code 2.',
79 => '',
80 => '== Implementation Concerns ==',
81 => 'Smoothbrain is extremely similar to brainfuck, and thus retains similar optimizations as it, such as <code>[-]</code> becoming a ',
82 => '"SET CELL TO 0" instruction. However, it should be noted that it is well-defined in Smoothbrain that going past the left edge of the ''tape'' ',
83 => 'is an error state, and MUST crash the program. Thus, while the command sequence <code>><</code> can be optimized out of a program, the sequence ',
84 => '<code><></code> will halt if the ''tape head'' was at the leftmost cell when executed, thus optimizing it away results in an invalid implementation',
85 => 'if the compiler/interpreter can't prove that a crash cannot happen.',
86 => '',
87 => '== Turing Completeness ==',
88 => 'Smoothbrain is trivially Turing Complete by way of being equivalent to Brainfuck aside from IO, program form, and error-state specifics. (All of which ',
89 => 'are outside of the scope of brainfuck's turing-completeness)',
90 => '',
91 => '[[Category:Languages]] [[Category:Cell-based]] [[Category:Turing_tarpits]] [[Category:Brainfuck_equivalents]] [[Category:Low-level]]'
] |
Unix timestamp of change (timestamp) | '1759111179' |