{"id":16318577,"url":"https://github.com/vic/typhon","last_synced_at":"2025-03-20T22:30:55.394Z","repository":{"id":1225384,"uuid":"1153453","full_name":"vic/typhon","owner":"vic","description":"Snakes on rbx-head. A Python implementation for the Rubinius VM","archived":false,"fork":false,"pushed_at":"2014-09-01T05:15:13.000Z","size":322,"stargazers_count":83,"open_issues_count":1,"forks_count":8,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-11T22:24:09.736Z","etag":null,"topics":["compiler","language","python","rubinius-vm","typhon"],"latest_commit_sha":null,"homepage":"http://vic.github.com/typhon","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-12-09T15:23:26.000Z","updated_at":"2024-01-13T23:50:10.000Z","dependencies_parsed_at":"2022-08-16T12:40:08.529Z","dependency_job_id":null,"html_url":"https://github.com/vic/typhon","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vic%2Ftyphon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vic%2Ftyphon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vic%2Ftyphon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vic%2Ftyphon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vic","download_url":"https://codeload.github.com/vic/typhon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244703681,"owners_count":20496163,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compiler","language","python","rubinius-vm","typhon"],"created_at":"2024-10-10T22:23:58.823Z","updated_at":"2025-03-20T22:30:55.016Z","avatar_url":"https://github.com/vic.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Typhon is twisted Python.  \n======\n\n\n  \u003cimg src=\"https://raw.github.com/vic/typhon/master/etc/typhon-logo.png\" title=\"Typhon is twisted Python\" /\u003e\n\n\n  A Python implementation for the Rubinius VM.\n\nWhy?\n----\n\nJust For Fun!.\n\nPython is one of the most popular dynamic languagues out there,\nit has many projects made on it and has an outstanding number of\nlibraries available.\nSo I guess having an implementation for it on Rubinius would make\nRubinius an strong player on VM field.\n\nAlso, the Rubinius VM is a very neat piece of software, and all\nthe cool kids are using it to implement other languages besides\nruby.\n\nMaybe Rubinius VM does what Parrot was originally intended to.\n( Running many dynamic languages )\n\n## Requirements\n\n  - python 2\n  - rubinius head\n  - rake\n\n## Try it\n\n     # Set rubinius as your current ruby.\n     $ rvm use rbx\n\n     # Get usage help\n     $ ./bin/typhon --help\n\n     # Run the hello world example\n     $ ./bin/typhon examples/hello.py\n\n     # If you want to run all the specs\n     $ rake spec\n\n     # Try -C --print-all on your python script.\n     # This will most likely blow up and show you\n     # a hint of what is needed to be implemented.\n     $ ./bin/typhon -C --print-all your_script.py\n\n     # You can use the --print-all switches with\n     # the REPL like this:\n     $ ./bin/typhon --print-all\n\n\n## Status\n\n  We have many simple python programs in the examples/ directory\n  that run successfully. Of course there might be a lot of things\n  missing, but that's were we need your help. Add an example, report\n  an issue, or even better, submit a patch or pull request.\n\n## Roadmap\n\nHere's the plan as its currently in my head:\n\n- Have a script to use Python compiler module and let it\n produce a sexp made of Ruby literals.\n\n  DONE.\n\n  bin/pyparse.py takes a Python script and outputs the AST as\n  an array of ruby literals. The table of nodes and its attributes\n  are read from bin/node.py. The output is just a sexp.\n\n- Read this sexp from Ruby and build an AST in Ruby land.\n\n  DONE.\n\n  rbx/ast/node.rb Typhon::AST.from_sexp takes the sexp and just\n  creates a tree of Python AST nodes in Ruby land. The table of\n  nodes is the same pyparse.py uses, bin/node.py\n\n\n- Write the Typhon compiler in Ruby, taking advantage of\n Rubinius' compiler infrastructure.\n\n  DONE.\n\n  We have Rubinius compiler stages at rbx/compiler/stages.rb\n  Currently the parsing stage simply uses pyparse.py and\n  evals the resulting sexp to later convert it to actual AST\n  node instances.\n\n- Have the Typhon compiler produce Rubinius bytecode.\n\n  IN PROGRESS.\n\n  We add bytecode methods to AST nodes as they are being used.\n\n- Lots of tests.\n\n  IN PROGRESS.\n\n  Currently we use the scripts from examples/ directory to test\n  that `typhon` and `python` programs produce the same output.\n\n  Try running the example specs with\n\n    $ mspec spec/examples_spec.rb\n\n  Of course we need more specs without having to rely on stdout\n  output. We're into it. Anyways ensuring all the files under\n  examples/ work is always a good-thing(tm).\n\n- Investigate if the pypy project has a Python parser in Python,\n  if so, we could use that once we compile python programs\n  to replace the bin/pyparse.py script.\n\n- Bootstrap. write the Typhon compiler in Python.\n\n## Contributing\n\nMain repository is located at [http://github.com/vic/typhon](http://github.com/vic/typhon)\nreport any issues you find there.\n\nThe Typhon developers hang out in the\n[#typhon-rbx](irc://irc.freenode.net/typhon-rbx) IRC channel on\n[freenode](http://webchat.freenode.net?nick=snake%23%23%23%23\u0026channels=typhon-rbx)\nnetwork.\nIf more people gets interested we might start a mailing-list.\n\nTyphon is on its early days, if you want to help, you're more than welcome.\nWe follow the same commit bit policy than Rubinius and Pugs, if you get your first patch\naccepted you get commit bit.\n\n## Coding conventions.\n\nSet your editor to use soft-tabs at two spaces for ruby code, no\nhard-tabs for python code.\nConfigure your editor to automatically remove trailing whitespace and\nbe sure to leave an empty new-line at the end of file.\n\nTry keep source code as readable as possible, that is, use proper\nindentation, an empty new-line between method definitions, skip parens in ruby\nwhere it makes sense (most if expressions), add source comments with\nlinks to python design/algorithm documents if applicable, add\nTODO/FIXME tags if needed.\n\n## Logo\n\nThe Typhon logo has been kindly contributed by Christoph Grabo.\nThe logo is a derived work of the original Python logo and is \ndistributed under a creative common license CC BY-NC-SA 3.0.\n\n## About Typhon\n\n  The name was chosen as an anagram of Python.\n\n  In greek mithology, [Typhon](http://felc.gdufs.edu.cn/jth/myth/Greek%20Online/Typhon.htm) is one of the largest and most fearsome of all creatures.\n\n  Theres a cool t-shirt showing what Typhon is all about:\n  [snakes on rbx-head](http://twinsrpnt.com/blog/?p=180)\n\n## License\n\n  Modified BSD License. See LICENSE file.\n\n## Contributors\n\n  - Christoph Grabo\n  - Graham Batty\n  - Joe Eli McIlvain\n  - Thiago Avelino\n  - Victor Hugo Borja \u003cvic.borja@gmail.com\u003e  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvic%2Ftyphon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvic%2Ftyphon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvic%2Ftyphon/lists"}