Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattknox/8ball
a ruby-to-javascript source-to-source transformer.
https://github.com/mattknox/8ball
Last synced: 4 months ago
JSON representation
a ruby-to-javascript source-to-source transformer.
- Host: GitHub
- URL: https://github.com/mattknox/8ball
- Owner: mattknox
- License: apache-2.0
- Created: 2010-04-03T23:40:17.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2010-05-27T02:07:30.000Z (over 14 years ago)
- Last Synced: 2023-04-11T13:48:01.195Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 1.17 MB
- Stars: 54
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
- awesome-polyglot - 8ball - a ruby-to-javascript source-to-source transformer. (Table of Contents / Languages)
README
8ball is a source-to-source compiler from (a subset of) ruby to javascript. The only javascript engine that it explicitly targets is V8.
The main interface for end users should be bin/8ball.
currently, you can run ./bin/8ball target/hello.rb
and get it to print out hello world. Very little of ruby is supported yet, but the supported subset is growing fast. Note that ./bin/8ball
is terribly slow, because it has to start jruby, compile the files, and then feed them to v8. Most of the time tends to be spent in jruby startup.Goals:
to support enough of ruby to run at least some parts of twitter's infrostructure.
to be substantially faster (2x+ faster) than the equivalent ruby code running in REE 1.8.7 (this version is chosen because it's what twitter runs on now.ag).
to be in production as fast as possible (hopefully within a year)NonGoals:
8ball does not intend to support the whole of ruby-example features that probably won't be supported include method_missing, callcc, and *_eval(string).
ruby c extensions are almost certainly never going to be supported.Approach: I intend to have a minimal core, mostly implemented in ruby, that compiles down to runnable js.
scenario: I have a big ruby project that depends on a vendor'd rails and a bunch of gems. How do I compile and run that?
-feed the entry point file to 8ball, let it load, compile and run everything as it needs to
-compile all the ruby files into individual js files, have node load the entry point file and then the others, as needed.
-make the whole thing one big js file (this seems problematic, but gets rid of require)need to consider a port to ruby_parser, so that we can run without jruby