Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #42376 > unrolled thread

I just read the MoonForth article ... questions

Started byChris Curl <ccurl609@gmail.com>
First post2015-10-05 09:46 -0700
Last post2015-10-24 21:56 -0700
Articles 7 — 4 participants

Back to article view | Back to comp.lang.forth


Contents

  I just read the MoonForth article ... questions Chris Curl <ccurl609@gmail.com> - 2015-10-05 09:46 -0700
    Re: I just read the MoonForth article ... questions Paul Rubin <no.email@nospam.invalid> - 2015-10-05 15:38 -0700
      _Inside F83_ and _Systems guide to figFORTH_ in modern format Marcos Cruz <use_the_contact_page@programandala.net> - 2015-10-25 00:02 +0000
        Re: _Inside F83_ and _Systems guide to figFORTH_ in modern format dylan.mcnamee@gmail.com - 2015-10-24 17:35 -0700
          Re: _Inside F83_ and _Systems guide to figFORTH_ in modern format Marcos Cruz <use_the_contact_page@programandala.net> - 2015-10-26 11:37 +0000
        Re: _Inside F83_ and _Systems guide to figFORTH_ in modern format Paul Rubin <no.email@nospam.invalid> - 2015-10-24 20:42 -0700
          Re: _Inside F83_ and _Systems guide to figFORTH_ in modern format dylan.mcnamee@gmail.com - 2015-10-24 21:56 -0700

#42376 — I just read the MoonForth article ... questions

FromChris Curl <ccurl609@gmail.com>
Date2015-10-05 09:46 -0700
SubjectI just read the MoonForth article ... questions
Message-ID<0534279b-d327-450e-8a87-86f702ddd8d3@googlegroups.com>
So I just read that MoonForth article posted inder the "Could Forth be getting a bit of traction?" thread, and I am curious about the implementation described in there.

It talks about -XTOs and -TAILs and WORD-FROM-CODE ... yes I understand the logic there, but seems like there is an awful lot of redundancy there. If I understand the design, every "normal" word has its own -XTO and -TAIL, which do the same thing -XTO saves the current IP on the return stack, and -TAIL restores the IP from the return stack. And every primitive has an -XTO as well, but it is not referred to directly by the word.

In my implementation, the word "XT" lists are much simpler, with each "XT" being either a primitive (with a value between PRIM_START and PRIM_END) or the address of the start of another word's XT list, which has a value between CODE_START and HERE. So my inner interpreter can automatically handle pushing and popping the IP. I have an array of function pointers that implement the primitives. When I encounter a primitive, I simply pull the address for that primitive from the array, and call it behind the scenes.

I guess what I am saying is that, since my implementation can automatically tell if a word is primitive (its value in a known range), it doesn't need that extra level of thrashing to get down to the primitives.

At the end of the day. the MoonForth implementation for DOUBLE needs 10 "instructions" to execute, mine only needs 3.

There must be a reason for all the entry and exit duplication and extra level of indirection for primitives in MoonForth, but I don't understand it. 

What am I missing?

[toc] | [next] | [standalone]


#42380

FromPaul Rubin <no.email@nospam.invalid>
Date2015-10-05 15:38 -0700
Message-ID<87r3l96iw1.fsf@jester.gateway.sonic.net>
In reply to#42376
Chris Curl <ccurl609@gmail.com> writes:
> There must be a reason for all the entry and exit duplication and
> extra level of indirection for primitives in MoonForth, but I don't
> understand it.

Moonforth is the one for the Minecraft cpu right?  I doubt if it
seriously tried to optimize anything.  You might look at a careful but
traditional implementation like F83.  I've been wanting to do that for a
while.  There's a book by C. H. Ting about how it works, called "Inside
F83", which is online in forth.org though it's in an ancient word
processor format (Macwrite 1 IIRC).  There was some discussion here a
few years ago about understanding the format, but I don't remember how
it came out.

[toc] | [prev] | [next] | [standalone]


#42779 — _Inside F83_ and _Systems guide to figFORTH_ in modern format

FromMarcos Cruz <use_the_contact_page@programandala.net>
Date2015-10-25 00:02 +0000
Subject_Inside F83_ and _Systems guide to figFORTH_ in modern format
Message-ID<n0h66t$qre$1@speranza.aioe.org>
In reply to#42380
En/Je/On 2015-10-05, Paul Rubin <no.email@nospam.invalid>
escribió/skribis/wrote:

> You might look at a careful but traditional implementation like F83.
> I've been wanting to do that for a while.  There's a book by C. H.
> Ting about how it works, called "Inside F83", which is online in
> forth.org though it's in an ancient word processor format (Macwrite 1
> IIRC).  There was some discussion here a few years ago about
> understanding the format, but I don't remember how it came out.

I have an original copy of _Inside F83_ I bougth from FIG in the 90's.
It's not in the best condition because I've read and consulted it a lot
since then.

Last summer, in order to make it easier to consult and search the book,
I started working on the original Macwrite documents.

With the help of the Vim editor and some regular expressions I converted
the original files to plain text, then started adding Asciidoctor
markups (http://asciidoctor.org), the best markup language I know for
this kind of documents. The Asciidoctor source is easy to  read "as is",
and can be converted directly to HTML 5 or DocBook. There are good
converters (say Pandoc) that can translate DocBook to almost any modern
format (EPUB, PDF, ODT and many more).

The work is quite advanced. Most markups are done, but the comments of
the Forth code blocks still need manual adjustments.  So far I didn't
investigate how to convert the pictures, but anyway I could scan them
from my original book.

By the way, I did the same with _Systems guide to figFORTH_...
Unfortunately chapter 7 was missing from the original files, and I don't
have the original book.

If there is any interest from the Forth community, I'd be glad to share
the final result of the work, provided there's no copyright problem.

-- 
Marcos Cruz
http://programandala.net

[toc] | [prev] | [next] | [standalone]


#42780 — Re: _Inside F83_ and _Systems guide to figFORTH_ in modern format

Fromdylan.mcnamee@gmail.com
Date2015-10-24 17:35 -0700
SubjectRe: _Inside F83_ and _Systems guide to figFORTH_ in modern format
Message-ID<0aef21e5-c1a9-4932-ad96-a67cac38131d@googlegroups.com>
In reply to#42779
On Saturday, October 24, 2015 at 5:02:40 PM UTC-7, Marcos Cruz wrote:
> En/Je/On 2015-10-05, Paul Rubin <no.email@nospam.invalid>
> escribió/skribis/wrote:
> 
> > You might look at a careful but traditional implementation like F83.
> > I've been wanting to do that for a while.  There's a book by C. H.
> > Ting about how it works, called "Inside F83", which is online in
> > forth.org though it's in an ancient word processor format (Macwrite 1
> > IIRC).  There was some discussion here a few years ago about
> > understanding the format, but I don't remember how it came out.
> 
> I have an original copy of _Inside F83_ I bougth from FIG in the 90's.
> It's not in the best condition because I've read and consulted it a lot
> since then.
> 
> Last summer, in order to make it easier to consult and search the book,
> I started working on the original Macwrite documents.
> 
> With the help of the Vim editor and some regular expressions I converted
> the original files to plain text, then started adding Asciidoctor
> markups (http://asciidoctor.org), the best markup language I know for
> this kind of documents. The Asciidoctor source is easy to  read "as is",
> and can be converted directly to HTML 5 or DocBook. There are good
> converters (say Pandoc) that can translate DocBook to almost any modern
> format (EPUB, PDF, ODT and many more).
> 
> The work is quite advanced. Most markups are done, but the comments of
> the Forth code blocks still need manual adjustments.  So far I didn't
> investigate how to convert the pictures, but anyway I could scan them
> from my original book.
> 
> By the way, I did the same with _Systems guide to figFORTH_...
> Unfortunately chapter 7 was missing from the original files, and I don't
> have the original book.
> 
> If there is any interest from the Forth community, I'd be glad to share
> the final result of the work, provided there's no copyright problem.

I'm always interested in hearing about new angles of Forth implementations, 
especially if they're well-explained. I'm sure many others here feel the same way.
Put it on GitHub (or similar) and we can contribute to the formatting / copy-editing.

dylan

[toc] | [prev] | [next] | [standalone]


#42837 — Re: _Inside F83_ and _Systems guide to figFORTH_ in modern format

FromMarcos Cruz <use_the_contact_page@programandala.net>
Date2015-10-26 11:37 +0000
SubjectRe: _Inside F83_ and _Systems guide to figFORTH_ in modern format
Message-ID<n0l3ac$flb$1@speranza.aioe.org>
In reply to#42780
En/Je/On 2015-10-25, dylan.mcnamee@gmail.com <dylan.mcnamee@gmail.com>
escribió/skribis/wrote:

> I'm always interested in hearing about new angles of Forth
> implementations, especially if they're well-explained. I'm sure many
> others here feel the same way.

Me too. I think those books are still interesting and useful, but anyway
its preservation is important.

> Put it on GitHub (or similar) and we can contribute to the formatting
> / copy-editing.

Good idea, thank you. But first I will try to contact Dr. Ting or Kevin Appert.

-- 
Marcos Cruz
http://programandala.net

[toc] | [prev] | [next] | [standalone]


#42781 — Re: _Inside F83_ and _Systems guide to figFORTH_ in modern format

FromPaul Rubin <no.email@nospam.invalid>
Date2015-10-24 20:42 -0700
SubjectRe: _Inside F83_ and _Systems guide to figFORTH_ in modern format
Message-ID<87d1w3y5pr.fsf@jester.gateway.sonic.net>
In reply to#42779
Marcos Cruz <use_the_contact_page@programandala.net> writes:
> If there is any interest from the Forth community, I'd be glad to share
> the final result of the work, provided there's no copyright problem.

Better check with Ting.  Is he reading this?  Is anyone here in contact
with him?

I've seen a paper copy of the book and it looked great.  I've definitely
been wanting to read it someday.

[toc] | [prev] | [next] | [standalone]


#42782 — Re: _Inside F83_ and _Systems guide to figFORTH_ in modern format

Fromdylan.mcnamee@gmail.com
Date2015-10-24 21:56 -0700
SubjectRe: _Inside F83_ and _Systems guide to figFORTH_ in modern format
Message-ID<09c22a1e-72d6-4eac-a70d-d8259929a1ca@googlegroups.com>
In reply to#42781
On Saturday, October 24, 2015 at 8:42:10 PM UTC-7, Paul Rubin wrote:
> Marcos Cruz <use_the_contact_page@programandala.net> writes:
> > If there is any interest from the Forth community, I'd be glad to share
> > the final result of the work, provided there's no copyright problem.
> 
> Better check with Ting.  Is he reading this?  Is anyone here in contact
> with him?
> 
> I've seen a paper copy of the book and it looked great.  I've definitely
> been wanting to read it someday.

A couple months ago, Dr. Ting said he was retiring (and in ill health), and that 
he'd be giving Kevin Appert both the materials and permissions to distribute 
his books and software. I haven't heard the status of this, but am eager to hear it.

Here's the thread where this was discussed back in September:
https://groups.google.com/forum/#!topic/comp.lang.forth/qOL6h_GKvmM

best,
dylan

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.forth


csiph-web