Maybe a much simpler syntax

From: ulis (maurice.ulis_at_wanadoo.fr)
Date: 04/04/04


Date: 4 Apr 2004 04:19:37 -0700

Hi,

I found the Whitespace language have a very simple syntax: 3 logical
tokens, 5 commands.
The Whitespace tutorial is here:
http://compsoc.dur.ac.uk/whitespace/tutorial.php

The beginning:
Whitespace tutorial

The only lexical tokens in the whitespace language are Space (ASCII
32), Tab (ASCII 9) and Line Feed (ASCII 10). By only allowing line
feed as a token, CR/LF problems are avoided across DOS/Unix file
conversions. (Um, not sure. Maybe we'll sort this in a later
version.).

The language itself is an imperative, stack based language. Each
command consists of a series of tokens, beginning with the Instruction
Modification Parameter (IMP). These are listed in the table below.

IMP Meaning
[Space] Stack Manipulation
[Tab][Space] Arithmetic
[Tab][Tab] Heap access
[LF] Flow Control
[Tab][LF] I/O

The virtual machine on which programs run has a stack and a heap. The
programmer is free to push arbitrary width integers onto the stack
(only integers, currently there is no implementation of floating point
or real numbers). The heap can also be accessed by the user as a
permanent store of variables and data structures.

Many commands require numbers or labels as parameters. Numbers can be
any number of bits wide, and are simply represented as a series of
[Space] and [Tab], terminated by a [LF]. [Space] represents the binary
digit 0, [Tab] represents 1. The sign of a number is given by its
first character, [Space] for positive and [Tab] for negative. Note
that this is not twos complement, it just indicates a sign.

Labels are simply [LF] terminated lists of spaces and tabs. There is
only one global namespace so all labels must be unique.

Have fun!

ulis



Relevant Pages

  • Re: Benchmarks question
    ... if token = 37 then jump to command 1 ... More commands, yes, but the only penalty that implies is that tokenizing might take a little longer because of more keywords to look through. ... Keyword tokens are always used as indices into jump tables on all machines. ... All this is necessary because the BASIC ROM space, BASIC program text space, and BASIC variable memory space, while all physically separate, overlay each other in the 8502's address space. ...
    (comp.sys.cbm)
  • Re: What is wrong here?
    ... > movement commands n and s don't work. ... Should a location contain a character or a character ... If you convert the directions to tokens, ... location has N possible routes to other locations. ...
    (comp.lang.cpp)
  • Re: Extracting last Folder Name from complete path
    ... "Michael Bednarek" wrote ... But I have to use the standard Windows xp ... commands, which do not have such function. ... tokens value. ...
    (microsoft.public.win2000.cmdprompt.admin)
  • USB undocumented & illegal packets
    ... I'm doing some research on usb tokens and i don't know much about usb ... commands and need some information urgently. ... the internet and have come up with extremely limited info. ...
    (comp.security.misc)