https://github.com/dwayne/whitespace-ruby
A Whitespace interpreter written in Ruby.
https://github.com/dwayne/whitespace-ruby
Last synced: 9 months ago
JSON representation
A Whitespace interpreter written in Ruby.
- Host: GitHub
- URL: https://github.com/dwayne/whitespace-ruby
- Owner: dwayne
- License: mit
- Created: 2016-07-11T19:44:34.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-07-20T09:40:35.000Z (almost 10 years ago)
- Last Synced: 2025-08-15T16:07:38.253Z (10 months ago)
- Language: Ruby
- Homepage: http://www.whoishostingthis.com/resources/whitespace-programming/
- Size: 30.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
## About
An interpreter written in [Ruby](https://www.ruby-lang.org) for the imperative, stack based language called [Whitespace][1].
## Installation
Install it yourself using:
```bash
$ gem install whitespace-ruby
```
You would now have access to an executable called `whitespace`. Type
```bash
$ whitespace --help
```
to learn more.
## Usage
Let's say you've written a [Whitespace][1] program and stored it in the file `program.ws`. Then, to execute that program, type:
```bash
$ whitespace program.ws
```
This gem comes with example [Whitespace][1] programs that you can check out at [examples](/examples). Be sure to run them to see what they do.
For example, here's the [factorial program](/examples/fact.ws) and a sample execution (assuming you're in the examples directory):
```bash
$ whitespace fact.ws
Enter a number: 40
40! = 20397882081197443358640281739902897356800000000
```
## References
- [Whitespace tutorial](http://compsoc.dur.ac.uk/whitespace/tutorial.html)
## Credits
Thanks to Edwin Brady and Chris Morris for developing this programming language (also developers of the [Idris][2] programming language). I've had lots of fun playing with it and writing interpreters (in [Racket](https://github.com/dwayne/whitespace-racket), [Haskell](https://github.com/dwayne/whitespace-haskell) and now [Ruby](https://www.ruby-lang.org)) for it.
## Copyright
Copyright (c) 2016 Dwayne Crooks. See [LICENSE](/LICENSE.md) for further details.
[1]: https://en.wikipedia.org/wiki/Whitespace_\(programming_language\)
[2]: https://en.wikipedia.org/wiki/Idris_(programming_language)