It stinks! ;)

stack oriented calculus kernel in Z

© 1999-2009 by Alain Brobecker (aka baah/Arm's Tech)

Here's the alpha release of SockZ 2.0 (written in C)

Download the newest version: SockZ v1.3 (77Kb) or SockZdo$ v1.3 (137Kb).
(Please note do$ version is emulated, so >100 times slower, with only 80Kb memory and no input)

Old versions: [ v0.0a | v0.1b | v0.2b | v0.4b | v0.5b | v0.6b | v0.7b | v1.0 | v1.1 | v1.2 ]
You can also download some mails & texts (50Kb) dealing with big numbers.

sqrt(2) = 1.41421356237309504880168872420969807856967187537694807317667973799073247846210703885038753432764...

SockZ is a small programming language for RiscOS computers, using a stack (smells like Forth, huh? ;) and able to work with big relative integers. It features only a minimalist set of instructions but allows easy definition of functions (eg to handle fractions or polynomials). Enough babble, here is an example program:

  ;Comments start with a semicolon (as in assembly)
   INPUT             ;ask for a number n
   COPY PRINT "!="   ;print it followed by "!="
   ! PRINT           ;compute n! then print it
  ;Recursive factorial function, input=... n, output=... n!
  #! ;Functions start with a sharp and return with END
    COPY             ;... n n
    SKIP>0 !end      ;go to !end if n<=0
    COPY             ;... n n
    1                ;... n n 1
    -                ;... n n-1
    !                ;... n (n-1)!
    *                ;... n!=n*(n-1)!
  END                ;quit function
  .!end ;Labels start with a dot
    DROP 1 END       ;return 1 when n<=0

70! = 11978571669969891796072783721689098736458938142546425857555362864628009582789845319680000000000000000

If you want to know more about SockZ download the whole archive, it contains some example programs, benchmarks, sourcecode & more documentation. For the time being here is a small list of features:

e = 2.71828182845904523536028747135266249775724709369995957496696762772407663035354759457138217852516642742...

This Esoteric Programming Languages site belongs to Alain Brobecker.
[ Site -1 | Sites List | Site +1 | Random Site ]

Also look at the homepage of Nick Craig-Wood