Bootstrapping Forth on JVM, .NET CLR, etc.


    Sponsored Links


  • 1. Stack way linear interpolation
    hi, on 12 Ian 2005 01:53, alberto pasquale posted: --------------------------------------------------------------- Hi, I have never used locals until now, and would prefer not to. I can't se a clean way to deal with this word using stack only. The word have to interpolate x into two pairs of X,Y points. There are 5 parameters on the stack. .... Can anybody sugest a stack way of doing it, or a different aproach? --------------------------------------------------------------- Better than directly applying interpolation formula, is trying to factor concepts first. we have points P0(x0,y0) and P1(x1,y1). we can do linear transformation of [x0,x1] x [y0,y1] space to [0,1] x [0,1] space, do necessary operations (interpolate) and then go back to [x0,x1] x [y0,y1] space. a solution could be: : >space ( x1 x0 x -- T) OVER - -ROT - 1024 SWAP */ ; : space> ( T y0 y1 -- y) OVER - ROT * 512 + 1024 / + ; : interpl ( y0 y1 x1 x0 x -- y) >space -ROT space> ; of course, we have to chose units of [0,1] range (1024 in this case) to cover the [x0,x1] range and check for [y0,y1] range to not overflow. best regards, humptydumpty P.S. - excuse my poor english.
  • 2. gforth prevent logout on error
    gforth 0.6.2 MacOS 10.4.7 PPC \ ============================================================== When an error occurs loading a file I would like to prevent: logout [Process completed] I would like to prevent the logout because I would still like to run some of my debug code after an error. The following is my solution that works great, is there a better way? 1) from TextWrangler's "Run in Terminal" load the file which has: #!/bin/sh cd ~/documents/forth/20070417-e4th/e18/ /opt/local/bin/gforth-fast ./gload.fs 2) gload.fs redefines "included", defines some words not in gforth, sets a marker and then loads the main file gload.e4 as follows: ' noop is dobacktrace : included ( ca u -- ) \ prevent error logout ['] included catch if DoError quit then ; : gload.e4 ( -- ) s" ./gload.e4" included ; MARKER M.EMPTY gload.e4 \ load the main file 3) If I simply mistyped a word that caused the error, I can edit the file, then from within gforth type gload.e4 to erase and reload the main file. It works great. Is there a better method? \ ============================================================== -- Bill Santa Cruz, California
  • 3. Vista Wonders
    well well well.... what isn't programmed in Forth.... Vista for sure. It is supposed to be the latest and greatest OS around. But I have to restart the computer 3 times a day or more just to do my work, and then I have to restart some of the programs that I use a few times. These are mainstream applications. Well it sure looks fancy and slick, but workwise it's the same crap all over again. Explorer doesn't have a menu bar. Oh brother. They tuck the windows task manager inside of another menu. Whatever. I refuse to be wowed.

Bootstrapping Forth on JVM, .NET CLR, etc.

Postby joel reymont » Tue, 07 Aug 2007 14:38:01 GMT


Suppose I wanted to bootstrap a Forth on a JVM, .NET CLR or another
existing VM.

Where would I start?

I'm learning Forth on a Mac (gForth) and don't want to use Windows.

My goal is to create a network link from my Mac to the target VM for
interactive development with cross-compilation and debugging happening

    Thanks, Joel

Re: Bootstrapping Forth on JVM, .NET CLR, etc.

Postby joel reymont » Tue, 07 Aug 2007 15:53:42 GMT

To be more precise... Suppose I started up gforth and I'm at the
interpreter prompt.

I want EXECUTE to generate the appropriate bytecode and run it on the
linked VM.

How do I make sure that EXECUTE is not the one that gforth supplies?

Do I hack at the gforth source code to build the cross-compiled Forth
and if so then is gforth the right Forth to start with?

I see no reason to re-implement the "outer interpreter" (right
expression?) and would like to let gforth parse my Forth code. I can't
envision how I would replace the code generation part, though.

    Thanks, Joel

Re: Bootstrapping Forth on JVM, .NET CLR, etc.

Postby Dmitry Ponyatov » Fri, 10 Aug 2007 03:01:27 GMT

You can use your own byte-code interpreter (a.k.a. inner interpreter =
engine = virtual machine) written in Java/C#, and cross-compiler
written in FORTH which generates byte-code from Forth-like language

Re: Bootstrapping Forth on JVM, .NET CLR, etc.

Postby Dmitry Ponyatov » Fri, 10 Aug 2007 03:04:52 GMT

at  http://www.**--****.com/ 
build upon this principle -- simple virtual forth machine in C with
some C++ elements and cross-compiler for SP-FORTH (I still now
understand vocabularies and use lower-cased words for FVM commands and
some non-standard language elements like { } var const buffer)

Similar Threads:

1.JVM vs CLR

2.Micro Focus COBOL runtime, /clr:pure, etc.

Pete raised this issue in another thread, and coincidentally I ran
smack up against it yesterday.

A .NET application compiled using the Micro Focus Net Express add-in
for Visual Studio will not run on a system which lacks the Micro Focus
COBOL runtime DLLs. I infer from the reference to accountants, that
the cost per seat to license the runtime is high. This rules out
redistribution on my part.

Interested developers could just download and install the same free
tools as I've already used to create my non-commercial project. I've
posted instructions on the Barbarian's CodePlex page, which explain
how to acquire and install these tools: Net Express 5.1 Personal
Edition, and the Visual Studio Shell which is its minimal requirement
for installation.

Granted, nobody should do this while on the clock. My application is a

Tell me, though, does the Micro Focus COBOL compiler have any command
line option similar to /crl:pure? This compiler option for Visual C++
2008 generates assemblies which run with nothing more than the .NET

One last technical question. When working with other languages, the
command line arguments for the compiler are displayed in Visual
Studio's project properties. Does the Micro Focus add-in provide this
feature somewhere?

If I've violated the Net Express Personal Edition license agreement by
releasing a Micro Focus-dependent EXE to CodePlex, somebody please
tell me, so I can kill that project now.


 - Matt Fisher

3.a tutorial on bootstrapping forth?

For a while now I've been trying to find a good tutorial on implementing a
forth system from scratch.  I haven't found one yet so I decided to ask here
and see if anybody knows of one.

From my research I've learned about the inner/outer interpreters.  I've even
heard that some people have written extremely basic forth compilers in
assembly that support only a handful of words (e.g. get/set a byte, colon,
semicolon and a few others) and then they "cross-compile" forth code for
the two interpreters into full featured Forth system.

Does anybody know what the minimal set of words would be for the
"cross-compile" bootstrapping method?  Does anybody know of forth source for
an inner and outer interpeter combo?


4.Forth bootstrapping framework - Bootforth

5.Bootstrapping a Forth in 40 lines of Lua code

6. Cleaning up ANS Forth variables, values etc

7. Fw: Using Forth to send a windows message to a MS application (spell checking etc)

8. FORTH v GO plan9 etc

Return to forth


Who is online

Users browsing this forum: No registered users and 66 guest