Objectmix
Tags Register Mark Forums Read

Re: Build your own Forth for Microchip PIC: the nature of metacompilation : Forth

This is a discussion on Re: Build your own Forth for Microchip PIC: the nature of metacompilation within the Forth forums in Programming Languages category; Date: Sat, 14 Jul 2007 08:47:51 -1000 Organization: FORTH, Inc. Message-ID: <139i6iu1mg5c384 @ news.supernews.com> Reply-To: Elizabeth D Rather <eratherXXX @ forth.com> User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 References: <trCdnc6k-9gEy-DbnZ2dnUVZ_ragnZ2d @ comcast.com> <tN2dnR24SP-4OwXbnZ2dnUVZ_o2vnZ2d @ comcast.com> In-Reply-To: <tN2dnR24SP-4OwXbnZ2dnUVZ_o2vnZ2d @ comcast.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@supernews.com Lines: 62 Bytes: 3441 Xref: number1.nntp.dca.giganews.com comp.lang.forth:119340 none Byron Jeff wrote: .... > After some further reading of Brad's, Stephen's, and especially > Elizabeth's material, I believe I'm starting to grasp the nature of > metacompilation in Forth. The summary is that words are structured to > compile themselves and are organized into vocabularies ...


Object Mix > Programming Languages > Forth > Re: Build your own Forth for Microchip PIC: the nature of metacompilation

Forth Forth programming language

Reply

 

LinkBack Thread Tools
  #1  
Old 01-01-1970, 12:00 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Build your own Forth for Microchip PIC: the nature of metacompilation

Date: Sat, 14 Jul 2007 08:47:51 -1000
Organization: FORTH, Inc.
Message-ID: <139i6iu1mg5c384@news.supernews.com>
Reply-To: Elizabeth D Rather <eratherXXX@forth.com>
User-Agent: Thunderbird 2.0.0.4 (Windows/20070604)
MIME-Version: 1.0
References: <trCdnc6k-9gEy-DbnZ2dnUVZ_ragnZ2d@comcast.com> <tN2dnR24SP-4OwXbnZ2dnUVZ_o2vnZ2d@comcast.com>
In-Reply-To: <tN2dnR24SP-4OwXbnZ2dnUVZ_o2vnZ2d@comcast.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@supernews.com
Lines: 62
Bytes: 3441
Xref: number1.nntp.dca.giganews.com comp.lang.forth:119340

none Byron Jeff wrote:
....
> After some further reading of Brad's, Stephen's, and especially
> Elizabeth's material, I believe I'm starting to grasp the nature of
> metacompilation in Forth. The summary is that words are structured to
> compile themselves and are organized into vocabularies that changes the
> function of words depending on vocabulary search order.
>
> Each word in the TARGET vocabulary needs 4 data elements in its definition:
>
> 1) target address of the word
> 2) possibly the length of the code


Haven't found this necessary, really. If you're downloading a newly
compiled definition, you have its starting address and the address of
the next unused location, and the difference is the size of your new
code. If you're building an image for later download, you track the
image's size.

> 3) flags (such as INLINE and NOT TRANSFERRED (to target))


Well, some definitions may be inline-able, but that's a property of the
INTERPRETER part, not the target version. And we keep a global switch
that governs whether we're transferring definitions as they're compiled
vs. building an image for download, so no need to track individual
definitions.

> 4) the actual code definition
>
> this set would represent the parameter field(s) of the definition.
>
> The code field would simply pull the target address of the word, create
> a CALL instruction out of it (presuming not inline) and stick that
> instruction at the end of the code definition currently being compiled.
>
> It's starting to make more sense.


Good.

> A question: is there a standard way to get an image of a vocabulary to
> and from a file?


No. In the first place, a vocabulary is a logical entity whose
components are not in any particular physical location. Traditionally,
Forth is compiled from source to executable form. You may wish to save
an image of your kernel or app for flashing at the start of a
development session, but not individual vocabularies.

Cheers,
Elizabeth

--
==================================================
Elizabeth D. Rather (US & Canada) 800-55-FORTH
FORTH Inc. +1 310-491-3356
5155 W. Rosecrans Ave. #1018 Fax: +1 310-978-9454
Hawthorne, CA 90250
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
==================================================
Reply With Quote
Reply

Thread Tools


Similar Threads

Thread Thread Starter Forum Replies Last Post
More nature, wilderness and Photoshop usenet Adobe Photoshop 0 09-06-2007 07:31 PM
Build your own Forth for Microchip PIC (Episode 837) usenet Forth 95 07-21-2007 10:06 AM
Build your own Forth for Microchip PIC (Episode 838): Threading usenet Forth 12 06-24-2007 06:56 PM
Build your own Forth for microchip PIC (Episode 839) usenet Forth 8 06-24-2007 12:45 PM
nature effect algorithms usenet Graphics 1 07-02-2006 05:10 PM


All times are GMT -5. The time now is 01:45 PM.