All Projects → vic → Typhon

vic / Typhon

Licence: bsd-3-clause
Snakes on rbx-head. A Python implementation for the Rubinius VM

Programming Languages

python
139335 projects - #7 most used programming language
ruby
36898 projects - #4 most used programming language
language
365 projects

Labels

Projects that are alternatives of or similar to Typhon

Seriouscode
This header file enforces Clang warnings to bu turned-on for specific flags (almost everyone, at least each one I was able to find).
Stars: ✭ 68 (-17.07%)
Mutual labels:  compiler
Ts Transform Css Modules
Extract css class names from required css module files for TypeScript
Stars: ✭ 75 (-8.54%)
Mutual labels:  compiler
Tiger
Tiger Compiler from "Modern Compiler Implementation in ML" by Andrew W. Appel
Stars: ✭ 77 (-6.1%)
Mutual labels:  compiler
Seeless
C IDE for iOS
Stars: ✭ 71 (-13.41%)
Mutual labels:  compiler
Lens
Language for Embeddable .NET Scripting
Stars: ✭ 71 (-13.41%)
Mutual labels:  compiler
Delta
Programming language focused on performance and productivity
Stars: ✭ 77 (-6.1%)
Mutual labels:  compiler
Gatsby Starter Default
The default Gatsby starter
Stars: ✭ 1,154 (+1307.32%)
Mutual labels:  compiler
Jsdoctest
Run jsdoc examples as doctests.
Stars: ✭ 80 (-2.44%)
Mutual labels:  compiler
Mini Interpreter
A Simple Scripting Language
Stars: ✭ 72 (-12.2%)
Mutual labels:  compiler
Rubyx
RubyX compiles ruby to binary (in ruby), hoping to be that X times faster
Stars: ✭ 78 (-4.88%)
Mutual labels:  compiler
Jit Compiler
JIT compiler in Go
Stars: ✭ 70 (-14.63%)
Mutual labels:  compiler
Online Compiler
This is an online compiler that can compile and run C\C++ And Java Program. This online compiler is a part of my 5th semester project "RUET Online Judge" . Developed By Ashadullah Shawon
Stars: ✭ 71 (-13.41%)
Mutual labels:  compiler
Yapypy
Yet another Python Python
Stars: ✭ 77 (-6.1%)
Mutual labels:  compiler
Jsweet
A Java to JavaScript transpiler.
Stars: ✭ 1,167 (+1323.17%)
Mutual labels:  compiler
Fennel
Lua Lisp Language
Stars: ✭ 1,225 (+1393.9%)
Mutual labels:  compiler
Kai
An expressive low level programming language
Stars: ✭ 68 (-17.07%)
Mutual labels:  compiler
Vab
V Android Bootstrapper
Stars: ✭ 77 (-6.1%)
Mutual labels:  compiler
Spvgentwo
SpvGenTwo is a SPIR-V building and parsing library written in plain C++17 without any dependencies. No STL or other 3rd-Party library needed.
Stars: ✭ 74 (-9.76%)
Mutual labels:  compiler
Typenovel
A simple markup language to write novel with types.
Stars: ✭ 80 (-2.44%)
Mutual labels:  compiler
Idiolisp
A statically typed functional programming language
Stars: ✭ 78 (-4.88%)
Mutual labels:  compiler

Typhon is twisted Python.

A Python implementation for the Rubinius VM.

Why?

Just For Fun!.

Python is one of the most popular dynamic languagues out there, it has many projects made on it and has an outstanding number of libraries available. So I guess having an implementation for it on Rubinius would make Rubinius an strong player on VM field.

Also, the Rubinius VM is a very neat piece of software, and all the cool kids are using it to implement other languages besides ruby.

Maybe Rubinius VM does what Parrot was originally intended to. ( Running many dynamic languages )

Requirements

  • python 2
  • rubinius head
  • rake

Try it

 # Set rubinius as your current ruby.
 $ rvm use rbx

 # Get usage help
 $ ./bin/typhon --help

 # Run the hello world example
 $ ./bin/typhon examples/hello.py

 # If you want to run all the specs
 $ rake spec

 # Try -C --print-all on your python script.
 # This will most likely blow up and show you
 # a hint of what is needed to be implemented.
 $ ./bin/typhon -C --print-all your_script.py

 # You can use the --print-all switches with
 # the REPL like this:
 $ ./bin/typhon --print-all

Status

We have many simple python programs in the examples/ directory that run successfully. Of course there might be a lot of things missing, but that's were we need your help. Add an example, report an issue, or even better, submit a patch or pull request.

Roadmap

Here's the plan as its currently in my head:

  • Have a script to use Python compiler module and let it produce a sexp made of Ruby literals.

    DONE.

    bin/pyparse.py takes a Python script and outputs the AST as an array of ruby literals. The table of nodes and its attributes are read from bin/node.py. The output is just a sexp.

  • Read this sexp from Ruby and build an AST in Ruby land.

    DONE.

    rbx/ast/node.rb Typhon::AST.from_sexp takes the sexp and just creates a tree of Python AST nodes in Ruby land. The table of nodes is the same pyparse.py uses, bin/node.py

  • Write the Typhon compiler in Ruby, taking advantage of Rubinius' compiler infrastructure.

    DONE.

    We have Rubinius compiler stages at rbx/compiler/stages.rb Currently the parsing stage simply uses pyparse.py and evals the resulting sexp to later convert it to actual AST node instances.

  • Have the Typhon compiler produce Rubinius bytecode.

    IN PROGRESS.

    We add bytecode methods to AST nodes as they are being used.

  • Lots of tests.

    IN PROGRESS.

    Currently we use the scripts from examples/ directory to test that typhon and python programs produce the same output.

    Try running the example specs with

    $ mspec spec/examples_spec.rb

    Of course we need more specs without having to rely on stdout output. We're into it. Anyways ensuring all the files under examples/ work is always a good-thing(tm).

  • Investigate if the pypy project has a Python parser in Python, if so, we could use that once we compile python programs to replace the bin/pyparse.py script.

  • Bootstrap. write the Typhon compiler in Python.

Contributing

Main repository is located at http://github.com/vic/typhon report any issues you find there.

The Typhon developers hang out in the #typhon-rbx IRC channel on freenode network. If more people gets interested we might start a mailing-list.

Typhon is on its early days, if you want to help, you're more than welcome. We follow the same commit bit policy than Rubinius and Pugs, if you get your first patch accepted you get commit bit.

Coding conventions.

Set your editor to use soft-tabs at two spaces for ruby code, no hard-tabs for python code. Configure your editor to automatically remove trailing whitespace and be sure to leave an empty new-line at the end of file.

Try keep source code as readable as possible, that is, use proper indentation, an empty new-line between method definitions, skip parens in ruby where it makes sense (most if expressions), add source comments with links to python design/algorithm documents if applicable, add TODO/FIXME tags if needed.

Logo

The Typhon logo has been kindly contributed by Christoph Grabo. The logo is a derived work of the original Python logo and is distributed under a creative common license CC BY-NC-SA 3.0.

About Typhon

The name was chosen as an anagram of Python.

In greek mithology, Typhon is one of the largest and most fearsome of all creatures.

Theres a cool t-shirt showing what Typhon is all about: snakes on rbx-head

License

Modified BSD License. See LICENSE file.

Contributors

  • Christoph Grabo
  • Graham Batty
  • Joe Eli McIlvain
  • Thiago Avelino
  • Victor Hugo Borja [email protected]
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].