Benutzer-Werkzeuge

Webseiten-Werkzeuge


projects:forth-namespaces:start

Dies ist eine alte Version des Dokuments!


Forth - Namespaces and Context Switching

In Forth namespaces and context switching are based on wordlists, search orders and vocabularies.

Using namespaces is encouraging concerning factoring of code into well structured source code modules and context switching could be used to define data types or simple objects. Both can make programing much more fun and can help to write readable and well structured code.

Since I discovered Forth and became familiar with the vocabulary concepts of Fig-Forth and F83, I was missing a way to bind a vocabulary (a namespace, a wordlist) to a word representing data, to create a data type or a simple object (implicit context switching).

Over the years I found a way to do it without using state-smart words, first for PC Forth Systems and during the last years also for Flash based MCU Forth Systems. VOCs and ITEMs are the core elements of the final concept.

With this Wiki page I will try to beam your attention towards context switching with VOCS and ITEMs by presenting Forth Systems that support it, examples and HOWTOs.

2019-12-18 Manfred Mahlow

430eForth43n6vis

430eForth43n6vis [2] for the MSP430G2553 MCU is a tiny Forth System with full support for namespaces and context switching based on VOCs and ITEMs. It is an extended version of C.H. Tings 430eForth for the MSP430G2553 MCU, based on the naken_ASM version published by M. Kalus on GitHub.

430eForth43n6vis was created as part of a feasibility study how to extend the support for namespaces in Forth by implementing vocabulary prefixes (VOC) instead of F83 vocabularies (VOCABULARY). Wordlists, vocabulary prefixes (VOCs), <voc> ITEMs, STICKY words and related TOOLS have been added and two search orders are used, a permanent and a temporary one. For further details please read the README file that comes with the tar archive.

Image and Tools : 430eforth43n6vis-g2553.tar.gz (191217)

Examples and HOWTOs : 430eforth43n6vis-g2553-examples.tar.gz :-( Coming soon

[1] VOCs ITEMS und STICKY Words, Forth Tagung 2019

[2] Namespaces and Context Switching for a Tiny Forth, VD 4/2019

projects/forth-namespaces/start.1576670829.txt.gz · Zuletzt geändert: 2019-12-18 13:07 von mm