knowledge-database (beta)

Current group: comp.lang.forth

Forth interpreter, written in JavaScript

Forth interpreter, written in JavaScript  
CaffeineJunkie
 Re: Forth interpreter, written in JavaScript  
Julian V. Noble
 Re: Forth interpreter, written in JavaScript  
Guy Macon
 Re: Forth interpreter, written in JavaScript  
CaffeineJunkie
 Re: Forth interpreter, written in JavaScript  
Jerry Avins
 Re: Forth interpreter, written in JavaScript  
Guy Macon
 Re: Forth interpreter, written in JavaScript  
Jim Lawless
 Re: Forth interpreter, written in JavaScript  
Guy Macon
 Re: Forth interpreter, written in JavaScript  
CaffeineJunkie
From:CaffeineJunkie
Subject:Forth interpreter, written in JavaScript
Date:Wed, 19 Jan 2005 13:12:40 +0100
Hi,
I've been doing a bit of work towards implementing a Forth interpreter in Javascript. While this is surely not the ideal choice of language for a Forth interpreter, it is still useful for linking to online Forth primers and tutorials, allowing to start the interpreter with a mouse click, causing the web browser to download and execute it on users' machine, providing an immediate opportunity to try out and toy around with Forth. No need to install a Forth interpreter locally.

This interpreter is in very early state, incomplete and buggy, but showing signs of life. Work on it started 4 days ago; this was also the first authors's exposure to Javascript.

More information, including links to source and launcher can be found here: http://forthfreak.net/wiki/index.cgi?ForthInJavaScript. A list of what works, and what doesn't, can be found there too.

Currently, the interpreter requires Firefox, Mozilla or Netscape to run. Opera and Internet Explorer don't - the key event handler doesn't see entered keystrokes. Konqueror works somewhat: cursor- and output position do not match. Other browsers haven't been tested.

The interpreter is distributed under the Gnu Public License, and most kinds of input would be welcome. The best place to comment on the interpreter would probably be the Forthfreak wiki link to ForthInJavaScriptComments, or, with full url, http://forthfreak.net/wiki/index.cgi?ForthInJavaScriptComments.
Thank you for your attention.
From:Julian V. Noble
Subject:Re: Forth interpreter, written in JavaScript
Date:Fri, 21 Jan 2005 12:56:34 -0500
"CaffeineJunkie <(account will expire)" wrote:
>
> Hi,
> I've been doing a bit of work towards implementing a Forth interpreter in Javascript. While this is surely not the ideal choice of language for a Forth interpreter, it is still useful for linking to online Forth primers and tutorials, allowing to start the interpreter with a mouse click, causing the web browser to download and execute it on users' machine, providing an immediate opportunity to try out and toy around with Forth. No need to install a Forth interpreter locally.
>
> This interpreter is in very early state, incomplete and buggy, but showing signs of life. Work on it started 4 days ago; this was also the first authors's exposure to Javascript.
>
> More information, including links to source and launcher can be found here: http://forthfreak.net/wiki/index.cgi?ForthInJavaScript. A list of what works, and what doesn't, can be found there too.
>
> Currently, the interpreter requires Firefox, Mozilla or Netscape to run. Opera and Internet Explorer don't - the key event handler doesn't see entered keystrokes. Konqueror works somewhat: cursor- and output position do not match. Other browsers haven't been tested.
>
> The interpreter is distributed under the Gnu Public License, and most kinds of input would be welcome. The best place to comment on the interpreter would probably be the Forthfreak wiki link to ForthInJavaScriptComments, or, with full url, http://forthfreak.net/wiki/index.cgi?ForthInJavaScriptComments.
> Thank you for your attention.

IIRC, there have been several Forths-in-Java. Here is a link I have Googled:

http://www.geocities.com/dolphinconsultant/forth.html

--
Julian V. Noble
Professor Emeritus of Physics
jvn@lessspamformother.virginia.edu
^^^^^^^^^^^^^^^^^^
http://galileo.phys.virginia.edu/~jvn/

"As democracy is perfected, the office of president represents, more and
more closely, the inner soul of the people. On some great and glorious
day the plain folks of the land will reach their heart's desire at last
and the White House will be adorned by a downright moron."

--- H. L. Mencken (1880 - 1956)
From:Guy Macon
Subject:Re: Forth interpreter, written in JavaScript
Date:Fri, 21 Jan 2005 19:08:14 +0000

Julian V. Noble wrote:

>http://www.geocities.com/dolphinconsultant/forth.html

Well, there goes MY weekend! :P
From:CaffeineJunkie
Subject:Re: Forth interpreter, written in JavaScript
Date:Sun, 23 Jan 2005 07:46:41 +0100
I'd like to extend a sincere und huge "thank you" to
everybody involved in that very productive debugging
session of jsforth. Thanks to your efforts, jsforth
has improved quite a lot, and is at the point of
getting quite fun and usable.
From:Jerry Avins
Subject:Re: Forth interpreter, written in JavaScript
Date:Wed, 19 Jan 2005 14:46:55 -0500
OK, Guy, here it is reformatted.

CaffeineJunkie <(account will expire) wrote:

> Hi,
> I've been doing a bit of work towards implementing a Forth interpreter
> in Javascript. While this is surely not the ideal choice of language for
> a Forth interpreter, it is still useful for linking to online Forth
> primers and tutorials, allowing to start the interpreter with a mouse
> click, causing the web browser to download and execute it on users'
> machine, providing an immediate opportunity to try out and toy around
> with Forth. No need to install a Forth interpreter locally.
>
> This interpreter is in very early state, incomplete and buggy, but
> showing signs of life. Work on it started 4 days ago; this was also
> the authors's first exposure to Javascript.
>
> More information, including links to source and launcher can be found
> here: http://forthfreak.net/wiki/index.cgi?ForthInJavaScript. A list
> of what works, and what doesn't, can be found there too.
>
> Currently, the interpreter requires Firefox, Mozilla or Netscape to
> run. Opera and Internet Explorer don't - the key event handler
> doesn't see entered keystrokes. Konqueror works somewhat: cursor-
> and output position do not match. Other browsers haven't been tested.
>
> The interpreter is distributed under the Gnu Public License, and most
> kinds of input would be welcome. The best place to comment on the
> interpreter would probably be the Forthfreak wiki link to
> ForthInJavaScriptComments, or, with full url,
> http://forthfreak.net/wiki/index.cgi?ForthInJavaScriptComments.
> Thank you for your attention.
From:Guy Macon
Subject:Re: Forth interpreter, written in JavaScript
Date:Fri, 21 Jan 2005 19:05:57 +0000

CaffeineJunkie> wrote:

>i am worried that getting this thing executable on a good selection
>of web browsers is not going to be trivial.

I can think of two ways to address this:

[1] Write for Mozilla FireFox and let the other browsers catch up.
They are going to have to become more compatible with Mozilla
anyway, so why not save effort and give them a push?

[2] Switch from JavaScript to Java (yes, I know the downside;
this is a "last resort" idea).
From:Jim Lawless
Subject:Re: Forth interpreter, written in JavaScript
Date:Thu, 20 Jan 2005 00:52:00 GMT
On Wed, 19 Jan 2005 13:12:40 +0100, CaffeineJunkie <(account will
expire) > wrote:

>Hi,
> I've been doing a bit of work towards implementing
> a Forth interpreter in Javascript.

This is very interesting.

I had tried something similar as a mechanism to embed *in* web pages
similar to JavaScript but with a stack-oriented syntax.

See here:

http://www.mailsend-online.com/bl.htm

I presented this to a group during one of the FIG UK chats and saw
many mixed results. ( The JS interpreters varied in execution speed
and compatibility amongst the chatters ... )

Jim Lawless | CMD2EXE Convert batch files to single EXE
jimbo@radiks.net | MailSend Command-line Internet Mailer (SMTP)
http://www.mailsend-online.com - http://www.radiks.net/~jimbo
From:Guy Macon
Subject:Re: Forth interpreter, written in JavaScript
Date:Wed, 19 Jan 2005 13:59:01 +0000

CaffeineJunkie> wrote:

>interpreter, it is still useful for linking to online Forth prim

....and that's it. Nothing after "prim".

Would you be so kind as to repost with line lengths of 70-75
characters?
From:CaffeineJunkie
Subject:Re: Forth interpreter, written in JavaScript
Date:Fri, 21 Jan 2005 15:46:12 +0100

> I presented this to a group during one of the FIG UK chats and saw
> many mixed results. ( The JS interpreters varied in execution speed
> and compatibility amongst the chatters ... )

I can believe that easily, as i am worried that getting this thing
executable on a good selection of web browsers is not going to be
trivial. After a major session, most of the interpreter is working now.
catch/throw hasn't been implemented yet, key and key? aren't present yet
(but has been prepared for). There are no vocabularies - which i would
like to stash the headers of the implementation specific words away -,
a number of words are still missing, but all the essentials are in
place, functional. Execution speed under Firefox is much better than i
hoped for (about 130000 empty loops on an 1.7 MHz Athlon). A help
facility has been integrated (but not for all words has the help text
been written). The starting URL allows chosing between several terminal
sizes, and, all in all, i would call it quite presentable, considering
that it is still on version 0.00. It looks very much like it could hit
the public pretty soon. If there's any javascript cracks out there, i
really would appreciate some advice on how to polish the user interface
by using more adequate i/o- and terminal code which is currently quite
hackish. Oh right, with Firefox, Mozilla, Netscape, JS-Forth is quite
usable, with Konqueror the cursor position is messed up, Opera and
Internet Explorer don't work at all right now (The keyboard event
handler doesn't get executed for these).
Thanks for your attention.
   

Copyright © 2006 knowledge-database   -   All rights reserved