How to start? - Download and prepare a Forth system

SP-FORTH
SP-Forth is a very fast ANS Forth by Rufig, Rusian Forth Interest Group. For Windows only 32 bit Forth is availible by now, but since it's possible to compile machine code it's faster than Forth coded 64 bit systems. The big drawback is the lost of 64 bit single integers. There is a preliminar 64 bit version for Unix.

To download 32 bit Windows system:

http://sourceforge.net/projects/spf/files/latest/download

Then open Notebook and paste the code below:

\ Preparation for ForthMath words
\ -------------------------------------------

REQUIRE case-ins lib/ext/caseins.f
REQUIRE LOCALS| ~af/lib/locals-ans.f
REQUIRE { lib/ext/locals.f
REQUIRE M*/ lib/include/double.f
REQUIRE F. lib/include/float2.f
REQUIRE /STRING lib/include/string.f

CASE-INS ON
WINAPI: GetTickCount    KERNEL32.DLL

: utime GetTickCount 1000 um* ;
: under+ ( a b c -- a+c b )  rot + swap ;

: .r \ n i --
  >r dup 0< swap abs
  0 <# #S rot sign #>
  R> OVER - SPACES TYPE ;

\ CASE-OF STRUCTURE
: CASE  \ -- 0
  0 ; IMMEDIATE    \ initial count of ofs


: OF \ c: #of -- orig #of+1
     \ x -- 
  1+ >R
  POSTPONE OVER
  POSTPONE =
  [COMPILE] IF
  POSTPONE DROP
  R> ; IMMEDIATE


: ENDOF \ c: orig1 #of -- orig2 #of 
  >R [COMPILE] ELSE R> ; IMMEDIATE


: ENDCASE \ c: orig1..orign #of -- 
  POSTPONE drop                      \ discard case value
  0 ?DO [COMPILE] THEN LOOP ; IMMEDIATE \ generate targets


: f>s f>d drop ;
: s>f 0 d>f ;

: OK2 ( -- ) STATE @ IF EXIT THEN ."  ok" CR ;
' OK2 TO OK



\ -------------------------------------------

Name the file SPForthmath.f and save it in an optional map. When double clicking on the filename the system is started.

GFORTH

GForth (GNU) is a somewhat optimized ANS Forth for a lot of operating systems as Unix, Windows and Android. GForth for Androids is loaded through Google Play and is ready to be used for ForthMath code.

To load 64 bit GForth for Windows systems:

64 bit GForth executable file

and to load 32 bit GForth for Windows:

32 bit GForth executable file

No preparation needed.

No comments:

Post a Comment