Skip to content
/ ngaro Public

An embeddable implementation of the Ngaro Virtual Machine for Go programs

License

Apache-2.0, Unknown licenses found

Licenses found

Apache-2.0
LICENSE
Unknown
LICENSE-RETRO
Notifications You must be signed in to change notification settings

db47h/ngaro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Go Report Card GoDoc

Ngaro Go

This is another Go implementation of the Ngaro Virtual Machine.

Please visit http://forthworks.com/retro/ to get you started about the Retro language and the Ngaro Virtual Machine.

The main purpose of this implementation is to allow communication between Retro programs and Go programs via custom I/O handlers (i.e. scripting Go programs in Retro). The package examples demonstrate various use cases. For more details on I/O handling in the Ngaro VM, please refer to http://retroforth.org/docs/The_Ngaro_Virtual_Machine.html.

This implementation passes all tests from the retro-language test suite and its performance when running tests/core.rx is slightly better than with the reference implementations:

1.20s for this implementation, compiled with Go 1.7rc6.
1.30s for the reference Go implementation, compiled with Go 1.7rc6
2.22s for the reference C implementation, compiled with gcc-5.4 -O3 -fomit-frame-pointer

For all intents and purposes, the VM behaves according to the specification. With one exception: if you venture into hacking the VM code itself, be aware that for performance reasons, the PC (aka. Instruction Pointer) is not incremented in a single place, rather each opcode deals with the PC as needed. This should be of no concern to any other users, even with custom I/O handlers. Should you find that the VM does not behave according to the spec, please file a bug report.

About

An embeddable implementation of the Ngaro Virtual Machine for Go programs

Resources

License

Apache-2.0, Unknown licenses found

Licenses found

Apache-2.0
LICENSE
Unknown
LICENSE-RETRO

Stars

Watchers

Forks

Packages

No packages published