About

Tag cloud

(all)

Archives

01 Jul - 31 Jul 2006
01 Aug - 31 Aug 2006
01 Sep - 30 Sep 2006
01 Oct - 31 Oct 2006
01 Nov - 30 Nov 2006
01 Dec - 31 Dec 2006
01 Jan - 31 Jan 2007
01 Feb - 28 Feb 2007
01 Mar - 31 Mar 2007
01 Apr - 30 Apr 2007
01 May - 31 May 2007
01 Jun - 30 Jun 2007
01 Jul - 31 Jul 2007
01 Aug - 31 Aug 2007
01 Oct - 31 Oct 2007
01 Nov - 30 Nov 2007
01 Dec - 31 Dec 2007
01 Jan - 31 Jan 2008
01 Feb - 28 Feb 2008
01 Mar - 31 Mar 2008
01 Aug - 31 Aug 2009
01 Sep - 30 Sep 2009
01 Jan - 31 Jan 2010
01 May - 31 May 2010
01 Jun - 30 Jun 2010

Links

Search!

Last Comments

Alvaro Oliver (StackBook Part 4 …): Hey! nice post. I just bo…
Tiago Gomes (Let's start again…): ok, now feel happy, you a…
Tiago Gomes (Let's start again…): ok, now feel happy, you a…
ir0nhide (StackBook Part 4.…): Very cool, nice work
Toby (Gigabyte, LCDs, a…): Good stuff, although now …
luke (StackBook part 3 …): what are you planing to u…
Toby (A quick rant...): Bastards
Hugh (StackBook Part 2 …): Nicely done, but you now …
gm (StackBook Part 2 …): Hmm, I plan to go a littl…
luke (StackBook Part 2 …): i cant help but wonder if…

Stuff

Powered by Pivot - 1.40.4: 'Dreadwind' 
XML: RSS Feed 
XML: Atom Feed 

BF+++ code release and spec.

Wednesday 12 May 2010 at 10:33 pm It's up in SVN now: bfint.py

Known bugs:
Only one TCP socket can be open, and they are all treated the same
Parsing will return uncaught errors if invalid code is used
Memory space is still fixed...
File handles are not implemented well yet
... and many others.

I'll post example code soon with comments.




This file is accessible as spec.rtf.
-------------------------------

+ add to current cell
+(n) add n to current cell
+(*n) add value of cell n
+(&n) add value of cell relative n
+(s) add value of cell named s

- subtract from current cell
-(n) subtract n from current cell
-(*n) subtract value of cell n
-(&n) subtract value of cell relative n
-(s) subtract value of cell named s

< go left one cell
<(n) go left n cells
<(*n) go left value of cell n
<(s) go left value of cell named s

> go right one cell
>(n) go right n cells
>(*n) go right value of cell n
>(s) go right value of cell named s


^ go to cell of current address
^(n) go to cell n
^(*n) go to value of cell n
^(s) go to cell named s

v(*n) copy current mem address into cell
v(s) name current cell

c set current cell to 0
c(n) set current cell to n
c(*n) set cell n to 0
c(s) write string to cell (not cell name!)

[ jump past ] if the value under the current cell is 0
] jump back to ] if the current cell value is nonzero

. output current cell under pointer
.(*n) output current cell to file handle in cell n
! output current cell as number
!(n) output current cell as number
, read in current cell to pointer
,(*n) read in from file handle in cell n


'(*n) open file handle at string starting at s
"(*n) open file handle to hostname and port in string at n

{ define procedure numbered with current cell value
} return to program

: jump to procedure numbered in current cell
:(s) jump to procedure numbered in named cell

j jump to pointer in current cell
j(n) jump n instructions

@ exit with current cell as exit value

BrainF**k+++ reasons for existance

Wednesday 12 May 2010 at 9:07 pm Goals of BF++:
1. Language must still be innately recognisable as BrainF**k. It must feel like coding BrainF**k.

2. Remove all the tedious bits. Yes, we know you can put 81 +es in a row. Yes, we know you can factorize the number and use ++++++++[>+++++<-]. You couldd also look the number up on http://esolangs.org/wiki/Brainfuck_constants. Yes, it is tedious - but tediousness at such a low level is not what this is about - there are better things to get stuck on how to implement. Hello World is now simpler to implement, but you could have generated all the +-[]ing with a program.

3. There are plenty of BrainF**k derivatives that make it harder to code, like BoolF**k like where you only operate on bits. This is not the goal here.

4. Add things that make it almost but not quite usable. If you just can't implement something reasonably, nobody will try. But it's more fun to just have it sitting right on the edge such that it's almost easy... but just that little bit harder than you want to go. Tempt people in with strings and sockets... but trap them in the rest. Programming is like a challenge now. So this means adding string support.

5. Also add stuff that makes it possible to write serious apps in it. Console IO is just not enough. So there's file I/O and network sockets.

6. Finally, make the expense of 3 + signs worth it, as someone has already made BrainF*ck++, and this adds more. And annoys people when what looks like line noise spits out the HTML source to their homepage.

Linkdump