2019-11-21 20:35:41 +01:00
|
|
|
# Building Alternative Systems
|
|
|
|
|
|
|
|
In addition to the C implementation, there are a few other
|
|
|
|
interfaces that can be built.
|
|
|
|
|
|
|
|
## Requirements
|
|
|
|
|
|
|
|
- c compiler (tested: clang, tcc, gcc)
|
|
|
|
- make
|
|
|
|
- standard unix shell
|
|
|
|
|
|
|
|
## retro-repl
|
|
|
|
|
|
|
|
A basic interactive system can be built by using:
|
|
|
|
|
|
|
|
make bin/retro-repl
|
|
|
|
|
|
|
|
This requires a copy of `ngaImage` to be in the current
|
|
|
|
directory.
|
|
|
|
|
|
|
|
## Barebones
|
|
|
|
|
|
|
|
This is a minimal version of the `retro-repl`. It keeps the C
|
|
|
|
portion as short as possible, making it a useful starting point
|
|
|
|
for new interfaces.
|
|
|
|
|
|
|
|
To build:
|
|
|
|
|
|
|
|
make bin/retro-barebones
|
|
|
|
|
|
|
|
## retro-compiler
|
|
|
|
|
|
|
|
This is a turnkey compiler. It can compile a new executable
|
|
|
|
bundling a Retro VM and image.
|
|
|
|
|
|
|
|
Requirements:
|
|
|
|
|
|
|
|
- BSD or Linux
|
|
|
|
- objcopy in $PATH
|
|
|
|
|
|
|
|
To build:
|
|
|
|
|
|
|
|
make bin/retro-compiler
|
|
|
|
|
|
|
|
Example use:
|
|
|
|
|
|
|
|
1. Given a source file like "Hello.forth":
|
|
|
|
|
|
|
|
~~~
|
|
|
|
:hello 'hello_world! s:put nl ;
|
|
|
|
~~~
|
|
|
|
|
|
|
|
2. Use:
|
|
|
|
|
|
|
|
./bin/retro-compiler Hello.forth hello
|
|
|
|
|
|
|
|
The first argument is the source file, the second is the
|
|
|
|
word to run on startup.
|
|
|
|
|
|
|
|
3. Run the generated `a.out`
|
|
|
|
|
|
|
|
Limits:
|
|
|
|
|
|
|
|
This only supports the core words ('all' interface) and the
|
|
|
|
file i/o words. Support for other I/O extensions will be
|
|
|
|
added in the future.
|
|
|
|
|
|
|
|
## Pascal
|
|
|
|
|
|
|
|
There is a Pascal version of `retro-repl`.
|
|
|
|
|
|
|
|
Dependencies:
|
|
|
|
|
|
|
|
- freepascal
|
|
|
|
|
|
|
|
Building:
|
|
|
|
|
2019-11-22 19:45:37 +01:00
|
|
|
cd vm/nga-pascal
|
2019-11-21 20:35:41 +01:00
|
|
|
fpc listener.lpr
|
|
|
|
|
|
|
|
This will require a copy of the `ngaImage` in the
|
|
|
|
current directory.
|
|
|
|
|
|
|
|
## Python: retro.py
|
|
|
|
|
|
|
|
This is an implementation of `retro-repl` in Python. As
|
|
|
|
with `retro-repl` it requires the `ngaImage` in the current
|
|
|
|
directory when starting.
|
|
|
|
|
|
|
|
## C#: retro.cs
|
|
|
|
|
|
|
|
This is an implementation of `retro-repl` in C#. As with
|
|
|
|
`retro-repl` it requires the `ngaImage` in the current
|
|
|
|
directory when starting.
|
|
|
|
|
|
|
|
Building:
|
|
|
|
|
2019-11-22 19:45:37 +01:00
|
|
|
cd vm\nga-csharp
|
2019-11-21 20:35:41 +01:00
|
|
|
csc retro.cs
|
|
|
|
|
|
|
|
You'll need to make sure your path has the CSC.EXE in it,
|
|
|
|
or provide a full path to it. Something like this should
|
|
|
|
reveal the path to use:
|
|
|
|
|
|
|
|
dir /s %WINDIR%\CSC.EXE
|
|
|
|
|
|
|
|
I've only tested building this using Microsoft's .NET tools.
|
|
|
|
It should also build and run under Mono.
|