gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

OffTopic > Probably easiest program language to write a interpreter for

#105304 - zzo38computer - Sat Oct 07, 2006 3:58 pm

Probably easiest program language to write a interpreter for is Brainfuck. (Sorry for the swearing, but this is not my fault, it is a correct part of the title! I didn't invent that title!) It has only 8 commands and uses only standard I/O (no file I/O, device I/O, timers, etc.) I just think this makes it very portable.
_________________
Important: Please send messages about FWNITRO to the public forum, not privately to me.

#105320 - poslundc - Sat Oct 07, 2006 6:07 pm

What useful thing would you do with an interpreter for such a language, though?

Dan.

#105337 - tepples - Sat Oct 07, 2006 10:45 pm

The simplest useful esoteric language is probably FALSE, a language similar to Forth.

And yes, there is a non-swearing name for brainfuck: P'' (pronounced pee prime prime).

But I agree with poslundc: why? Is it that you want to put scripting support in your programs? Is Lua too heavy?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#105343 - zzo38computer - Sat Oct 07, 2006 11:27 pm

tepples wrote:
The simplest useful esoteric language is probably FALSE, a language similar to Forth.

And yes, there is a non-swearing name for brainfuck: P'' (pronounced pee prime prime).

But I agree with poslundc: why? Is it that you want to put scripting support in your programs? Is Lua too heavy?


P'' is the same, the only difference is P'' has no I/O which makes it even more useless. And no, I have no desire to put scripting support in my programs or anything else (in this case). I am only saying that it is easy to write a interpreter for almost any type of system. It makes your program very portable (even if it may be a bit slow). There is a Basic -> BF compiler, and a text adventure game has been written in BFBASIC. If you want to run that game but you don't have the interpreter for the system you wish to run it on, you can write your own interpreter pretty easily.
_________________
Important: Please send messages about FWNITRO to the public forum, not privately to me.

#108184 - felix123 - Mon Nov 06, 2006 11:11 am

HQ9+ is easier! ;)

#108264 - Jeremysr - Tue Nov 07, 2006 5:44 am

Wow I was bored today so I decided to write an interpreter for the DS after looking at this topic. It was the easiest programming language (other than HQ9+ (lol)) I could find, and is apparently ver close to brainf*ck. So close that there are translators that convert brainf*ck code to it.

It's called Ook!. It's described as the programming language that orangutangs can use. It has three keywords: Ook!, Ook., and Ook?.

More info: http://www.dangermouse.net/esoteric/ook.html

Well here it is! :P (BTW I wrote it in DSLua so it's pretty slow. An interpretted interpreter...)

http://www.bio-gaming.com/jeremy/dslua/downloads/ookDS.zip

Hint: It doesn't pay attention to anything except the ?/./!'s so you can just write the program like "?.!!!.??.!" or whatever instead of putting "Ook! Ook?" etc. every time


Last edited by Jeremysr on Tue Nov 07, 2006 6:44 am; edited 1 time in total

#108265 - tepples - Tue Nov 07, 2006 5:47 am

Jeremysr wrote:
Well here it is! :P (BTW I wrote it in DSLua so it's pretty slow. An interpretted interpreter...)

http://www.bio-gaming.com/jeremy/dslua/downloads/ookDS.zip

Does it run in Dualis? If so, then it's an interpreted interpreted interpreter ;-)
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#108266 - Jeremysr - Tue Nov 07, 2006 5:55 am

Hah, yeah it does and maybe that's why it took 2 seconds to print out Hello world... (Or maybe because the hello world program is 14 KB long)

Oh, one thing I forgot to mention that's different between the DS and computer Ook (just in case someone actually wants to make something with this..): With the "Ook. Ook!" command which reads in a character from the keyboard and puts the ASCII value of it in the current memory location...it instead returns these values for each DS button:

A = 1
B = 2
X = 3
Y = 4
L = 5
R = 6
Up = 7
Down = 8
Left = 9
Right = 10
Select = 11
Start = 12

Edit: Lol I just realized that Ook! is actually exactly the same as brainf*ck, it just renames the commands to combinations of "Ook"s....so I guess I actually made a brainf*ck interpreter >.<

Edit2: Since I'm sure there are more brainf*ck programs around here's an interpreter for it too (just had to change a couple of lines)

http://www.bio-gaming.com/jeremy/dslua/downloads/brainfuck.lua

brainf*ck programs: http://esoteric.sange.fi/brainfuck/bf-source/prog/ (Programs that require input from the keyboard won't work on the DS)

If you haven't figured it out by now, to run a program you just edit the value of the string on line 10 in the brainf*ck/ook interpreters

#108362 - Jeremysr - Wed Nov 08, 2006 1:03 am

Well I decided I might as well finish it with an on-screen keyboard (which only has capital letters, numbers, enter key and space). Most brainf*ck programs work with it now.

Screenshot (screenshot of numwarp.bf which takes in a number (which can have spaces) and prints it to the top screen in ASCII art)

http://www.bio-gaming.com/jeremy/dslua/downloads/brainf---DS.zip

Comes with 8 working programs and another one (hanoi.bf) which my DS is currently loading into memory and not being able to test yet. It's taking a long time.