Project board
retroforth & nga
Retro is a modern, pragmatic Forth. Nga is the virtual machine at its heart.
Open project link ↗Log in to add, edit, move, or delete cards.
Suggestions
0Bugs / Issues
9scripting_arg() indexes sys_argv[a + 2] with no bounds check
read_line() mixes byte-oriented getc with UTF-8-character reads, so a multibyte character at the start of a line is mishandled
Socket descriptors can validly be 0, but 0 is used as the “unused” sentinel
socket creation/accept can fail to push a result when all slots are full
Terminal setup ignores tcgetattr, tcsetattr, and ioctl failures
The fast path reads an opcode through (uint8_t *)&opcode, which depends on host byte order, unlike the normal shift/mask implementation
i_fe and i_st index VM memory directly with unvalidated guest addresses, and jump/call targets can drive ip negative; the execution loop only checks ip < IMAGE_SIZE.
Division checks b == 0 instead of divisor a == 0, and does not actually dispatch error 6
nga-c
17Bugfixes: i/o device operations: validate operations
The current implementation doesn't validate operations in the i/o device dispatch tables.
Bugfixes: FFI
The FFI doesn't do any validation on returned function handles or on the actual operation dispatch.
Bugfixes: Sockets
The socket device does not validate handles. This should be fixed.
Bugfixes: Unix Pipes
Unix pipes do not validate the handles before use.
Bugfixes: multicore device indices
The multicore device does not ensure that the core in use is valid.
Bugfixes: validate error handler IDs
Bugfix: file_read_bytes and partial/failed reads.
file_read_bytes does not verify the number of read bytes is what was actually returned.
Add MAX_SCRIPTING_SOURCES
Instead of hard coding the value in several places.
Command line flags like -f don't actually check for a paramenter
Bugfixes: register_devices() function prototype does not match actual use
Make scripting handling of line lengths more robust
Improve handling of block files
In various error conditions.
Consolidate repeated UTF-8 decoding
read_character, fread_character, and string_inject each implement overlapping UTF-8 decoding.
Add a single device manifest
Each optional device is currently represented in several places: e.g., build flags, module includes, prototypes, runtime registrations, and the interfaces built into the image. A macro-based devices.def could generate the C-side declarations/includes/registration.
Merge the two scripting include loops
include_file and include_plain_file duplicate most of their file, line, return-stack, abort, and source bookkeeping.
Remove stale code
There are some functions that aren't actually used now. These should be removed.
Add build time profiles for i/o devices
RetroForth Image
7Document changes to the image format
Fix invalid instruction bundles
The instruction validation in muri identified a place where we had extra nops in a bundle.
Some words are missing d:source information
Expose names for d:HashFunction and d:RehashFunction
Replacing the higher-level d:Hash-Function with the one reserved in the kernel, and removing use of magic numbers in the higher level sources.
reduce use of magic numbers
add konilo's n: math words
As default, alias to old symbolic names.
add shift-left and shift-right
iOS
9UI Replacement
The current application uses a mix of views generated in code and a complex set of Storyboards. This is fragile, and recent Xcode releases have broken it in my testing. I'm rewriting the UI using SwiftUI, with a goal of a more maintainable codebase going forward.
Replace network code
The current network support is very complex, and uses a variety of deprecated resources. For the next release, this should be replaced with a more modern approach. Much of the work on this is shared with my Gopher client for iOS, and most of the needed changes have been completed there, so this shouldn't take long to update once I have time to merge it in.
Update the examples
Many of the examples are out of date for the current ngaImage. For the next release, I should curate the examples, providing a focused set, and ensuring all are up to date.
Update Nga for current RetroForth image format
The version of Nga in the iOS port no longer works with the current ngaImage. This needs to be updated. Finishing this is blocked by current work on the dictionary format.
Remove non-open resources
The current codebase has some resources that I don't have licensing to distribute in a source format. I'm replacing these with clean implementations so the next release can be fully open source.
Terminal Emulation
It'd be nice to have a terminal emulation for proper interactive use of RetroForth on iOS.
Support for updating the ngaImage & examples
I'd like to be able to allow updates to the RetroForth system without requiring going through app review since most changes going forward won't actually need a rebuilt iOS app. I'm looking into seeing if I can provide functionality for this within the application without running afoul of Apple's restrictions.
Documentation Browser
The current documentation browser doesn't remember any state, so you have to start over each time you use it. I want to fix this so it'll be friendlier to use.
Setup Fossil repository for this project
build toolchain
6toolchain improvements
Building retro requires a variety of tools, all of which need to be updated as the image format & dictionary structure evolve. I'd like to make these all easier to keep in sync.
make muri more robust
The muri assembler works, but we can bring over improvements from ilo's pali including instruction bundle validation
add node version of muri
fix python implementation of muri
The python muri fell out of sync with the C and no longer builds the ngaImage.
modular compilation of C sources
tools/generate-amalgamation.c
To replace the one written in RetroForth.
takawiri
1improve text output handling
Takawiri provides a very limited terminal emulation. This should be extended to handle several things: - colors (separate from the physical display) - cursor positioning - newline handling - limited scrollback support
Cleanups
2Remove retro-compiler
I'm not aware of anyone actually using retro-compiler, so it might make sense to remove this in the next release to reduce my maintenance load.
Move nga-x11 to a separate directory under vm/
Documentation
3Update examples listing
Review words.tsv to ensure it's fully up to date with the current state
Update Manual
library
2TOB
- support for Termina subset of VT100 - faster rendering
Dialog
For creating informative dialogs