User:IanO

From Esolang
Jump to navigation Jump to search

I contributed a lot of techniques for programming SNUSP on the C2 wiki.

I contributed the PATH and SNUSP examples on Hello world.

I've also written JavaScript interpreters/debuggers for SNUSP, FALSE, DUP, Biota, Befunge, Befalse, and Brainfuck. Let me know if they work for you.

Interpreter updates:

  • Better cross-browser display of code and output (tested in Safari and IE6).
  • The 2D language pages now force a monospace font in the edit area. This was mostly a problem for Safari.
  • All but the Biota page now include a sample program to print my email address. I doubt any spammer will be able to interpret Befunge!
  • Added a mandelbrot example to the False page.
  • Added a tool to search for short constants to the SNUSP page.
  • Uploaded a more object-oriented version of the Biota interpreter

--IanO 22:07, 29 Sep 2005 (GMT)

I finally started using Firefox, and fixed up the interpreters to work with it. Basically, to copy unformatted source from either a TEXTAREA or a PRE block, I use the construct text = el.value || el.textContent || el.innerText; "Value" works for controls like TEXTAREA, "textContent" accesses PRE blocks in W3 standard browsers like Firefox and Mozilla, and "innerText" accesses PRE blocks in Explorer and Safari. Also, only use el.innerHTML = htmlText; to set PRE block text.

--IanO 20:26, 31 March 2007 (UTC)

Befalse

I am creating an unholy union of FALSE and SNUSP tentatively named Befalse. No letters were harmed in the making of this language. You can play with my interpreter. Feedback is welcome.

--IanO 20:11, 11 Oct 2005 (GMT)

Befalse now has a call stack which behaves like SNUSP (:call ;ret, which comes out nice and Forth-like), and it is an open stack; you can muck with it using {push and }pop. This opens the door to recursion, coroutines, continuations... Since I gave up numeric I/O for the call/ret characters, here is recursive code for printing an integer (!skip ?skip-if-zero `divmod $dup #drop .emit).

(1234!/55+`$?\\
      \   /!://
    ;.+*68/!#/

--IanO 01:54, 13 Oct 2005 (GMT)

Added lots of examples to the Befalse interpreter page (Fibonacci, GCD, Ackerman's function, rot13, 99 bottles of beer, and the eight queens problem). The language seems to have legs.

--IanO 00:17, 15 Oct 2005 (GMT)

It occurs to me that I can use one character (single quote ') for both numeric input and numeric output by switching on the parameter.

  • zero: replace top-of-stack with numeric input
  • non-zero: output the top of stack as a number

So numeric input becomes 0' and numeric non-zero output is just '. If you need completely general purpose output, do this:

$?\68*.\ 0: output ASCII zero.
  \'  !\ done;

I don't know whether numeric output would be used enough to warrant this mechanism. I've run out of ASCII punctuation otherwise. Any opinions? --IanO 04:51, 3 December 2007 (UTC)

After reading about colorForth, I changed '|' to XOR. Inclusive OR is defined as "^~&|", which is much shorter than the other way round defining XOR from AND and OR. --IanO 00:57, 8 July 2009 (UTC)

DUP

At the request of a gentleman who is writing a formal specification for FALSE and its variants, I gave the variant supported by my interpreter a name, DUP. In the spirit of FALSE, I named it after my favorite Forth stack operator. --IanO 17:54, 2 September 2009 (UTC)

I decided to make the JavaScript side-effect official, and modified the string syntax to use the new memory model.

  • You can store and retrieve to a cell array as well as the 26 letter variables.
  • The string syntax now stores the strings to this array: 0{base}$"string"{str end}^-{str len}
    • A string can be printed with this snippet: {str len}[$][\$;, 1+\1-]#%%
  • As with Befalse, I changed vertical bar (|) from inclusive- to exclusive-OR. For inclusive-OR, use: ^~&|
  • I removed the capital letter shortcut for variable access. The JavaScript side-effect is to allow any unused Unicode character to be a variable!
  • DUP now has its own page and interpreter.

--IanO 00:43, 30 September 2009 (UTC)

HeartForth

How could I not love this language? --IanO (talk) 00:28, 5 May 2015 (UTC)