Page namespace (page_namespace) | 0 |
Page title (without namespace) (page_title) | 'Barely' |
Full page title (page_prefixedtitle) | 'Barely' |
Old content model (old_content_model) | 'wikitext' |
New content model (new_content_model) | 'wikitext' |
Old page wikitext, before the edit (old_wikitext) | ''''Barely''' is an [[esoteric programming language]] created by [[Jeffry Johnston]] in 2006, with the goal of having as small a turing complete interpreter as possible. The interpreter is in MS-DOS COM binary format and is 59 bytes in size. It was written using DEBUG, so the source listing is made from disassemblies at different points in the program.
The language was originally based on BF, but only somewhat resembles it in its current form. There is a tape of uninitialized memory cells, a memory pointer (mp) initially 0, instruction pointer (ip) initially the last input, jump offset (jmp) initially 0, and 8-bit accumulator (acc) initially 126. Commands consist of a single character. Programs are read from stdin, should be written from right to left (rather than the customary left to right), and must not contain any non-command characters (newlines, etc). The program is separated from its input by a tilde (~).
Commands (letters in parenthesis are commands that are also executed as a side effect):
<pre>
] exit program
^ if acc == 0 then (b)
b ip += jmp
f no-op
g acc = contents of cell at mp (i)
h acc += 71 (k)
i mp++ (j)
j acc++ (k)
k jmp--
l no-op
m contents of cell at mp = acc (o)
n mp-- (o)
o acc-- (p)
p jmp += 10
q no-op
s no-op
t stdin -> acc
x acc -> stdout
~ mandatory no-op, marks end of program input
</pre>
BF Conversions (read right to left):
<pre>
< kkkkkkkkkjn
> kkkkkkkkkoi
+ kkkkkkkkkkkkkkkkkjmjng
- kkkkkkkkkkkkkkkkkkkkkkkkkkkkjmong
. kkkkkkkkkxg
, kkkkkkkkkjmt
</pre>
The `[' and `]' commands do not have a 1:1 mapping. The following algorithm can be used to find the number of l's, k's, and p's for a BF-like loop:
<pre>
Initial values:
i = number of characters inside the loop (not counting the wrapping `^' or `b' characters)
k = 0
p = 0
Perform the following two calculations until the `k' and `p' values no longer change.
k = i + p + 2
p = ceil((i + p + k + 1) / 10)
l = 9p - i - k - 1
Example (read right to left):
b?????^, so i = 5, k = 0, p = 0
k = 5 + 0 + 2 = 7, p = ceil((5 + 0 + 7 + 1) / 10) = ceil(13 / 10) = 2
k = 5 + 2 + 2 = 9, p = ceil((5 + 2 + 9 + 1) / 10) = ceil(17 / 10) = 2
k = 5 + 2 + 2 = 9, p = ceil((5 + 2 + 9 + 1) / 10) = ceil(17 / 10) = 2 (no change)
l = 9x2 - 5 - 9 - 1 = 3
The loop becomes: bpp?????^kkkkkkkkklll
</pre>
==Example==
This prints "Hello, World!" and exits.
<pre>]xhhhhooooooooohhhhhhxooooooooxooooooxjjjxhoooohhhxhohhhhhhhxhhhhjjjhhhxhhhhooooooooohhhhhhxjjjxxjjjjjjjxjhhhhxjhhhhhhhhjjjhh~</pre>
==See also==
* [[MinISCule]]
==External resources==
* [http://kidsquid.com/files/barely/barely.com Barely interpreter binary (MS-DOS)]
* [http://kidsquid.com/files/barely/barely.asm Barely interpreter source listing]
* [http://kidsquid.com/files/miniscule/tinyintr.zip Bootable FreeDOS disk image, with MinISCule, Barely, FreeDOS Debug]
[[Category: Languages]]
[[Category: Implemented]]
[[Category: Turing complete]]
[[Category: 2006]]
[[Category:Cell-based]]
[[Category:Turing tarpits]]
[[Category:Low-level]]' |
New page wikitext, after the edit (new_wikitext) | ''''Barely''' is an [[esoteric programming language]] created by [[Jeffry Johnston]] in 2006, with the goal of having as small a turing complete interpreter as possible. The interpreter is in MS-DOS COM binary format and is 59 bytes in size. It was written using DEBUG, so the source listing is made from disassemblies at different points in the program.
The language was originally based on BF, but only somewhat resembles it in its current form. There is a tape of uninitialized memory cells, a memory pointer (mp) initially 0, instruction pointer (ip) initially the last input, jump offset (jmp) initially 0, and 8-bit accumulator (acc) initially 126. Commands consist of a single character. Programs are read from stdin, should be written from right to left (rather than the customary left to right), and must not contain any non-command characters (newlines, etc). The program is separated from its input by a tilde (~).
Commands (letters in parenthesis are commands that are also executed as a side effect):
<pre>
] exit program
^ if acc == 0 then (b)
b ip += jmp
f no-op
g acc = contents of cell at mp (i)
h acc += 71 (k)
i mp++ (j)
j acc++ (k)
k jmp--
l no-op
m contents of cell at mp = acc (o)
n mp-- (o)
o acc-- (p)
p jmp += 10
q no-op
s no-op
t stdin -> acc
x acc -> stdout
~ mandatory no-op, marks end of program input
</pre>
BF Conversions (read right to left):
<pre>
< kkkkkkkkkjn
> kkkkkkkkkoi
+ kkkkkkkkkkkkkkkkkjmjng
- kkkkkkkkkkkkkkkkkkkkkkkkkkkkjmong
. kkkkkkkkkxg
, kkkkkkkkkjmt
</pre>
The `[' and `]' commands do not have a 1:1 mapping. The following algorithm can be used to find the number of l's, k's, and p's for a BF-like loop:
<pre>
Initial values:
i = number of characters inside the loop (not counting the wrapping `^' or `b' characters)
k = 0
p = 0
Perform the following two calculations until the `k' and `p' values no longer change.
k = i + p + 2
p = ceil((i + p + k + 1) / 10)
l = 9p - i - k - 1
Example (read right to left):
b?????^, so i = 5, k = 0, p = 0
k = 5 + 0 + 2 = 7, p = ceil((5 + 0 + 7 + 1) / 10) = ceil(13 / 10) = 2
k = 5 + 2 + 2 = 9, p = ceil((5 + 2 + 9 + 1) / 10) = ceil(17 / 10) = 2
k = 5 + 2 + 2 = 9, p = ceil((5 + 2 + 9 + 1) / 10) = ceil(17 / 10) = 2 (no change)
l = 9x2 - 5 - 9 - 1 = 3
The loop becomes: bpp?????^kkkkkkkkklll
</pre>
==Example==
This prints "Hello, World!" and exits.
<pre>]xhhhhooooooooohhhhhhxooooooooxooooooxjjjxhoooohhhxhohhhhhhhxhhhhjjjhhhxhhhhooooooooohhhhhhxjjjxxjjjjjjjxjhhhhxjhhhhhhhhjjjhh~</pre>
==See also==
* [[MinISCule]]
==External resources==
* [http://kidsquid.com:443/files/barely/barely.com Barely interpreter binary (MS-DOS)]
* [http://kidsquid.com:443/files/barely/barely.asm Barely interpreter source listing]
* [http://kidsquid.com:443/files/miniscule/tinyintr.zip Bootable FreeDOS disk image, with MinISCule, Barely, FreeDOS Debug]
[[Category: Languages]]
[[Category: Implemented]]
[[Category: Turing complete]]
[[Category: 2006]]
[[Category:Cell-based]]
[[Category:Turing tarpits]]
[[Category:Low-level]]' |
Unified diff of changes made by edit (edit_diff) | '@@ -69,7 +69,7 @@
==External resources==
-* [http://kidsquid.com/files/barely/barely.com Barely interpreter binary (MS-DOS)]
-* [http://kidsquid.com/files/barely/barely.asm Barely interpreter source listing]
-* [http://kidsquid.com/files/miniscule/tinyintr.zip Bootable FreeDOS disk image, with MinISCule, Barely, FreeDOS Debug]
+* [http://kidsquid.com:443/files/barely/barely.com Barely interpreter binary (MS-DOS)]
+* [http://kidsquid.com:443/files/barely/barely.asm Barely interpreter source listing]
+* [http://kidsquid.com:443/files/miniscule/tinyintr.zip Bootable FreeDOS disk image, with MinISCule, Barely, FreeDOS Debug]
[[Category: Languages]]
' |
Lines added in edit (added_lines) | [
0 => '* [http://kidsquid.com:443/files/barely/barely.com Barely interpreter binary (MS-DOS)]',
1 => '* [http://kidsquid.com:443/files/barely/barely.asm Barely interpreter source listing]',
2 => '* [http://kidsquid.com:443/files/miniscule/tinyintr.zip Bootable FreeDOS disk image, with MinISCule, Barely, FreeDOS Debug]'
] |