https://github.com/ForthHub/forth
:four_leaf_clover: Forth engine in JavaScript
https://github.com/ForthHub/forth
forth
Last synced: about 1 month ago
JSON representation
:four_leaf_clover: Forth engine in JavaScript
- Host: GitHub
- URL: https://github.com/ForthHub/forth
- Owner: ForthHub
- License: mit
- Created: 2014-11-12T03:57:46.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2022-04-22T04:50:57.000Z (almost 4 years ago)
- Last Synced: 2025-01-23T09:37:56.734Z (about 1 year ago)
- Topics: forth
- Language: JavaScript
- Homepage:
- Size: 96.7 KB
- Stars: 63
- Watchers: 12
- Forks: 9
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ccamel - ForthHub/forth - :four_leaf_clover: Forth engine in JavaScript (JavaScript)
README
# Forth
[](https://www.npmjs.org/package/forth)
[](https://travis-ci.org/drom/forth)
[](https://ci.appveyor.com/project/drom/forth)
[](https://drone.io/github.com/drom/forth/latest)
Forth programming environment implemented in JavaScript.
## Use
### Node.js
```
npm i forth -g
```
### REPL
```
forth
```
### Streaming CLI
```
forth < core.frt
```
### Library
```js
var forth = require('forth');
var f = forth(); // new instance of Forth machine
// f.s -- is the duplex stream
process.stdin.pipe(f.s).pipe(process.stdout);
```
### Browser
use Browserify!
### APIs
#### f.interpret(input, cb)
Run Forth interpreter.
`input` can be String or Stream
#### f.DS()
Data stack Array
#### f.RS()
Return stack Array
## Testing
`npm test`
## License
MIT [LICENSE](https://github.com/drom/forth/blob/master/LICENSE).