farolisto
Read-only Log in

Project board

sinilo

sinilo is an extended version of ilo, with 64-bit cells, deeper stacks, more RAM, and additional i/o devices. It's not a pure replacement: ilo is intentionally self-contained and isolated from the host; the additional i/o devices in sinilo require tighter bonds to the host system. This VM sits in between nga and ilo in complexity, though leaning closer to the latter.

Log in to add, edit, move, or delete cards.

Suggestions

0

Documentation

3

Write spec document

working on it

Write spec document

Detailed notes

No detailed notes have been added.

Document changes from ilo

working on it

Document changes from ilo

Detailed notes

No detailed notes have been added.

Document Error Handling

ilo allows for implementation-specific error handling models. sinilo will require specific behavior to ensure consistency.

Document Error Handling

Detailed notes

No detailed notes have been added.

Implementations

6

C

working on it

C

Detailed notes

No detailed notes have been added.

Python

deferred

Python

Detailed notes

No detailed notes have been added.

Node JS

deferred

Node JS

Detailed notes

No detailed notes have been added.

Nim

deferred

Nim

Detailed notes

No detailed notes have been added.

Rust

deferred

Rust

Detailed notes

No detailed notes have been added.

Go

deferred

Go

Detailed notes

No detailed notes have been added.

New I/O Devices

6

Host FS

Access files on the host

working on it

Host FS

Detailed notes

+----+-----------+------------------+---------------------------+ | Sc | Name | Stack | Description | +====+===========+==================+===========================+ | 0 | open | addr mode -- h | Open a file. mode: | | | | | 0=read, 1=write, 2=append | | 1 | close | h -- | Close a file | | 2 | getc | h -- c | Read one char; -1 at EOF | | 3 | putc | c h -- | Write one char | | 4 | size | h -- n | File size in cells; | | | | | -1 for pipes | | 5 | tell | h -- pos | Current position in cells | | 6 | seek | pos h -- | Seek to cell pos from start| | 7 | exists? | addr -- f | -1 if file exists, 0 if not| | 8 | delete | addr -- | Delete a file | | 9 | rename | from to -- | Rename a file | | 10 | open-pipe | addr mode -- h | Open a pipe via popen. | | | | | mode: 0=read, 1=write | +----+-----------+------------------+---------------------------+

Sockets

TCP/IP with Unix sockets

working on it

Sockets

Detailed notes

This device is optional. It provides TCP socket access. Sockets, like files, use handles from the same handle table as the file I/O device. Handles obtained from socket operations can be read and written using the file I/O device's getc and putc sub-commands (2 and 3). Sub-commands: +----+-------------+------------------+---------------------------+ | Sc | Name | Stack | Description | +====+=============+==================+===========================+ | 0 | connect | host port -- h | Connect to host:port | | 1 | close | h -- | Close socket (reuses hfs | | | | | close, sub-command 1) | +----+-------------+------------------+---------------------------+

Clock

Access host time & date functions

working on it

Clock

Detailed notes

+----+---------+------------------+--------------------------------+ | Sc | Name | Stack | Description | +====+=========+==================+================================+ | 0 | time | -- n | Unix timestamp in seconds | | 1 | time-ms | -- n | Milliseconds since epoch | +----+---------+------------------+--------------------------------+

Floating Point

Provide a floating point stack and data type

working on it

Floating Point

Detailed notes

+----+---------+-------------------+------------------------------+ | Sc | Name | Stack | Description | +====+=========+===================+==============================+ | 0 | push | n -- ( -- f) | Cell bits → float stack | | 1 | pop | -- n (f -- ) | Float stack → cell bits | | 2 | add | (ab -- c) | Float add | | 3 | sub | (ab -- c) | Float subtract | | 4 | mul | (ab -- c) | Float multiply | | 5 | div | (ab -- c) | Float divide | | 6 | floor | (f -- f) | Round toward negative inf | | 7 | ceil | (f -- f) | Round toward positive inf | | 8 | sqrt | (f -- f) | Square root | | 9 | to-int | n -- m (f -- ) | Convert float to integer | | 10 | from-int| m -- ( -- f) | Convert integer to float | | 11 | sin | (f -- f) | Sine | | 12 | cos | (f -- f) | Cosine | | 13 | tan | (f -- f) | Tangent | | 14 | asin | (f -- f) | Arcsine | | 15 | acos | (f -- f) | Arccosine | | 16 | atan | (f -- f) | Arctangent | | 17 | atan2 | (ab -- c) | Two-argument arctangent | | 18 | log | (f -- f) | Natural logarithm | | 19 | pow | (ab -- c) | a raised to the power b | | 20 | depth | -- n | Depth of float stack | +----+---------+-------------------+------------------------------+

Scripting Support

Provide access to the host command line

working on it

Scripting Support

Detailed notes

The reference host accepts an optional script file and any number of arguments after it on the command line: r13 [--rom romfile] [--blocks blockfile] [scriptname [args...]] When a script is given, its contents are filtered through the unu literate format (only lines inside ~~~ fenced blocks are kept) and fed into io 1 ahead of standard input. After the script buffer is exhausted, io 1 falls through to stdin as normal. The args device exposes the script name and any trailing arguments to the running image. script_argv[0] is always the script name; script_argv[1..n-1] are the extra arguments. Sub-commands: +----+---------+------------------+--------------------------------+ | Sc | Name | Stack | Description | +====+=========+==================+================================+ | 0 | count | -- n | Total arg count including name | | 1 | fetch | n addr -- | Copy arg n as null-term cells | | | | | to image address addr. | | | | | n=0 is the script name. | +----+---------+------------------+--------------------------------+ If no script was given, count returns 0 and fetch copies an empty string for any index.

Random Number Generator

working on it

Random Number Generator

Detailed notes

+----+---------+------------------+--------------------------------+ | Sc | Name | Stack | Description | +====+=========+==================+================================+ | 0 | next | -- n | Next random 64-bit value | | 1 | seed | n -- | Reseed the generator | +----+---------+------------------+--------------------------------+

Assembler

1

Extended pali to cover additional instructions and architectural changes

working on it

Extended pali to cover additional instructions and architectural changes

Detailed notes

No detailed notes have been added.

A Konilo for sinilo

3

Overview

This is a port of Konilo to sinilo. It adapts the cell size and memory layout, and adds additional words for using the new i/o devices. It's intended to be compatible with Konilo at a source level, for anything that doesn't need to be aware of the fundamental ilo vm design.

Overview

Detailed notes

No detailed notes have been added.

Update memory layout

working on it

Update memory layout

Detailed notes

No detailed notes have been added.

Ensure all instructions padded out to 8 sub instructions per bundle

Initially just add .. to fill out the unused parts.

Ensure all instructions padded out to 8 sub instructions per bundle

Detailed notes

No detailed notes have been added.

RetroForth for sinilo

1

Overview

It'd be interesting to see what a RetroForth would be on sinilo. This wouldn't be a direct port of RetroForth 12, or of Konilo, but would blend aspects of both. I have not made any decisions on pursuing this, and sinilo remains a research vessel.

deferred

Overview

Detailed notes

No detailed notes have been added.