Building Dictionary From Scratch

56 views
Skip to first unread message

Craig Lindley

unread,
Sep 7, 2018, 2:52:04 PM9/7/18
to pforthdev
How does one go about building a dictionary from scratch. I would like to do this to get rid of history and possibly other words I won't use. I tried

pForth -i system.fth but my dictionary was untouched that is history and other words were still there.

I see the order in which words were added to the dictionary so I have to assume if I start with an empty directory, load system.fth then I would be able to add other files of pForth words as long as I do it in the correct order.

Thanks

Phil Burk

unread,
Sep 8, 2018, 6:41:24 PM9/8/18
to pforthdev
system.fth includes loadp4th.fth, which include history and other optional stuff.

Edit loadp4th.fth and try again.

Take a look at the bottom of system.fth

Phil Burk


--
You received this message because you are subscribed to the Google Groups "pforthdev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pforthdev+...@googlegroups.com.
To post to this group, send email to pfor...@googlegroups.com.
Visit this group at https://groups.google.com/group/pforthdev.
For more options, visit https://groups.google.com/d/optout.

Craig Lindley

unread,
Sep 11, 2018, 3:12:10 PM9/11/18
to pforthdev
OK so I edited loadp4th.fth to exclude history and other stuff. On my Mac I executed

pforth_standalone -i system.fth and

pforth.dic was created. If I then execute

pforth_standalone -d pforth.dic

I in fact have pforth running with my scaled down dictionary. My next questions are:

1. How do I get pforth to always use pforth.dic without having to specify it on the command line since there isn't a command line on the esp32 embedded system I am trying to build.

2. Can I take pforth.dic built on the MAC and move it to my embedded system (they are both little-endian) ?

Thanks

Phil Burk

unread,
Sep 12, 2018, 10:02:10 AM9/12/18
to pforthdev
Hello Craig,

There are two ways to build pForth. The first way involves creating a pforth executable that loads the dictionary from a pforth.dic file.
But some embedded system do not support files. So, for the second way, you can create a version of pForth that has the dictionary built in at compile time.

You use SDAD to save the dictionary as 'C' code. Then you recompile with the dictionary in 'C' and create pforth_standalone. It does not need the pforth.dic file.

On Tue, Sep 11, 2018 at 12:12 PM Craig Lindley <cal...@gmail.com> wrote:
OK so I edited loadp4th.fth to exclude history and other stuff. On my Mac I executed

pforth_standalone -i system.fth and

This seems odd. The pforth_standalone normally has the dictionary compiled in. 

1. How do I get pforth to always use pforth.dic without having to specify it on the command line since there isn't a command line on the esp32 embedded system I am trying to build.

I recommended build an embedded version using SDAD. Then you do not need to read any files.


2. Can I take pforth.dic built on the MAC and move it to my embedded system (they are both little-endian) ?

It might work if your embedded systems uses files. If it is a Raspberry Pi then no problem.
 
Phil Burk

craig and heather

unread,
Sep 12, 2018, 10:26:12 AM9/12/18
to pfor...@googlegroups.com
Thanks Phil

I'm learning more and more about pForth all of the time. It will be great to have an embedded esp32 version that I can use for various projects.


--
You received this message because you are subscribed to the Google Groups "pforthdev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pforthdev+...@googlegroups.com.
To post to this group, send email to pfor...@googlegroups.com.
Visit this group at https://groups.google.com/group/pforthdev.
For more options, visit https://groups.google.com/d/optout.


--
Craig Lindley / Heather Hubbard

New Recordings are here
Previous Recording are here
Personal Website is here

Home Phone: (719) 495-1873 (call us here first)
Craig's Cell: (719) 502-7925
Heather's Cell: (719) 571-0944

If you’re one in a million, there are now seven thousand people exactly like you.
Reply all
Reply to author
Forward
0 new messages