2014-06-25 17:38 GMT+02:00, Jim Hall <jh...@freedos.org>:

> Of the three Forth compilers you mentioned, I appreciate that 4th is free
> software (GNU GPL v3) and appears to be updated. DX Forth seems to have a
> vague license disclaimer; the intent seems to be public domain, but the
> author acknowledges other contributions in the package "may be subject to
> copyright by their respective owners." [..]

No, nothing vague about that; just the DX Forth package may contain
also a few libraries or programming examples done by the others, not
just by Ed (DX Forth creator), and he added it for user's convenience
while keeping original licence (if there was any). It's enough to take
a look onto a Forth source code of selected program, whether there is
any licence mentioned. But if I'm correct, presently there's just one
tool there in dxfth397.zip distribution archive, which isn't "from
ground up" Ed's creation: the screen editor (Forth code), which
probably is "public domain".

What makes DX Forth particularly interesting, may be:
- it's written completely in assembler
- it has "turnkey" facility (it can generate binaries, to run them
just like other DOS program)
- it interfaces to two different graphics systems: BGI driver (which
has been released as freeware years ago by its autor Ullrich von
Bassewitz), and to commercial Fastgraph (Ted Gruber Software - they
allow to download Fastgraph/Light which is licensed as shareware)

> I couldn't find a license statement in CH Forth, although it might be included
> post-installation (I didn't install it).

Indeed, I can't find any explicit licence either. Well, I didn't grep
all its files for "licensing" term neither similar.

CHForth also has "turnkey" facility, and - if I'm correct - in its
larger part it's written in assembler too.

> So I'll add an LSM entry for 4th in DEVEL.

Very interesting capability of this one is ease of porting created
applications among all platforms 4th supports. 4th also has very nice,
detailed manual. But it's not quite "traditional" Forth:

Like Forth, 4tH is a compiler and a interpreter. Unlike Forth you
cannot switch between the two. Like Forth, 4tH runs Forth-programs.
Not all of them but some. But in a quite different way.

> Adding a Forth compiler in the DEVEL list doesn't mean programmers should
> expect programs written in Forth to be accepted into the FreeDOS BASE. The
> BASE software is core to FreeDOS, so these programs should be widely
> maintainable, using a programming language that most other FreeDOS BASE
> contributors are likely to use. We prefer BASE programs to be written in
> either C or ASM. The preferred compiler for C is OpenWatcom, and the
> preferred assembler is NASM. (See
> http://www.freedos.org/wiki/index.php/FreeDOS_Spec)

4th interfaces to C easily (although I didn't try to do it yet by
myself) - from the docs:

The allocation of variables is totally transparent to the
C-programmer. He can also transfer C-variables to the user-program
(application variables). These variables can be used like any other

Combining return- and data-stack means the C-programmer only has to
worry about the size of the stack and not the sizes of both stacks,
thus allowing a wider range of user-applications with different
A minimal compiler would take only a few lines of C-code. The
C-programmer can send C-variables to the interpreter, just like

E.g. a compile takes a string-pointer as argument and returns a
pointer to H-code:

object = comp_4th (source);

Executing H-code is easy too:

ReturnVal = exec_4th (object, argc, argv, 3, Var1, Var2, Var3);

Which would preload variables Var1, Var2 and Var3. You must specify
how many variables are preloaded. Also argc and **argv are available
from the 4tH program.

The value returned by exec_4th() and stored into ReturnVal is the
value of the 4tH variable 'OUT', which initially contains CELL_MIN. If
an error occurs exec_4th() will always return

CELL_MIN, regardless the value stored in 'OUT'.


Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
Freedos-user mailing list

Reply via email to