Talk:Basic Input/Output Commands

From Esolang
Jump to navigation Jump to search

I would just appreciate an opinion on this new low-level esoteric programming language I made up... --202.156.14.10 08:00, 29 February 2012 (UTC)

How do you do conditionals and loops? —ehird 15:41, 29 February 2012 (UTC)
It's probably esoteric... because you can't do conditional code, loops, or functions --202.156.14.10 13:57, 2 March 2012 (UTC)
Well, unusable for programming isn't the same thing as esoteric :) But it seems you've added conditionals and some jumps, so it looks like a loop should be possible. (By the way, there's no need to archive the page when there's only one short discussion (which isn't even over yet) — but when there is, the {{archive}} template simplifies things.) —ehird 07:41, 5 March 2012 (UTC)

The point of Basic Input/Output Commander?

The point of Basic Input/Output Commander that I thought up is to be an almost-esoteric low-level programming language which is meant for writing esoteric programming language interpreters. If you try a thousand times to write a working interpreter using this programming language and you sill find it impossible to, then try to improve this programming language until you can write a working interpreter using it but don't try to destroy the almost-esoteric nature of it. It also shows how everything in computers are numbers.

Possible FAQs

  • How did you convert text to character numbers?
This is an advanced algorithm, but you can find an easy converter here (Convert ASCII text into Decimal/Unicode, not Padded, use "" as a delimeter left and " " as a delimeter right)
  • How do you process a full line of code at a time?
An example clone of the Brainfuck interpreter, but which interprets a line of code instead of a symbol at once (but with one bug: pointer always gets reset to 0 after a line of code is run), is shown below:
// check if brainfuck program tries to use virtual memory below 0
@32769 @32773 // clone code-running boolean
if @32769 qio LT @32771 @32772 #@32769
if @32769 write con:0 69 114 114 111 114 58 32 86 105 114 116 117 97 108 32 109 101 109 111 114 121 32 115 101 116 32 98 101 108 111 119 32 48 32 98 121 32 66 114 97 105 110 102 117 99 107 32 112 114 111 103 114 97 109 44 32 114 101 108 111 97 100 105 110 103 46 46 46 10 // Error: Virtual memory set below 0 by Brainfuck program, reloading...
if @32769 frl
// initialize interpreter if not already initialized
@32769 @32768
if @32769 @32768 1
if @32769 @32770 32774
// check if the symbol is <
if @32773 qio EQ @32770 60 #@32769
if @32769 qio ADD @32771 1 #@32771
if @32769 @@32770 0
if @32769 qio ADD @32770 1 #@32770
if @32769 qrl
// check if the symbol is >
if @32773 qio EQ @32770 62 #@32769
if @32769 qio SBTRCT @32771 1 #@32771
if @32769 @@32770 0
if @32769 qio ADD @32770 1 #@32770
if @32769 qrl
// check if the symbol is +
if @32773 qio EQ @32770 43 #@32769
if @32769 qio ADD @@32771 1 #@@32771
if @32769 @@32770 0
if @32769 qio ADD @32770 1 #@32770
if @32769 qrl
// check if the symbol is -
if @32773 qio EQ @3277p 45 #@32769
if @32769 qio SBTRCT @@32771 1 #@@32771
if @32769 @@32770 0
if @32769 qio ADD @32770 1 #@32770
if @32769 qrl
// check if the symbol is .
qio EQ @32770 46 #@32769
if @32769 write con:0 @@32771
if @32769 @@32770 0
if @32769 qio ADD @32770 1 #@32770
if @32769 qrl
// check if the symbol is ,
qio EQ @32770 44 #@32769
if @32769 read con:0 @@32771
if @32769 @@32770 0
if @32769 qio ADD @32770 1 #@32770
if @32769 qrl
// TODO: add support for [ and ]
// check for newlines
if @32773 qio EQ @@32770 10 #@32769
if @32769 @32773 0
if @32769 @32770 32774
if @32769 write con:0 10
if @32769 qrl
// otherwise "Invalid syntax: "
if @32773 write con:0 73 110 118 97 108 105 100 32 115 121 110 116 97 120 58 32
if @32773 write con:0 @@32770 10 // display the symbol
if @32773 qrl
// when code is not running, ...
read con:0 @@32770 // read an instruction symbol
// check for newlines
qio EQ @@32770 10 #@32769
if @32769 @32773 1
if @32769 @32772 @32770
if @32769 qio ADD @32772 1 #@32772
if @32769 @32770 32774
if @32769 @32771 @32772
if @32769 qrl
// otherwise increment the internal pointer
qio ADD @32770 1 #@32770
qrl
  • What about commands of more than one character?
Nobody knows yet. Figure it out yourself, but you may need to use lots of sets of switches in memory to check through lots of characters as probably one command.

Any opinions on this? Add them here

External devices?

Since this is based purely on I/O, could you not use external devices (say a 4017 or something) for logic operations? Or is that against the point of the language? --(this comment by 130.160.145.214 at 23:32, 10 December 2012‎ UTC; please sign your comments with ~~~~)