{"id":13467335,"url":"https://github.com/koehlma/jaspy","last_synced_at":"2025-04-04T19:08:27.576Z","repository":{"id":57279460,"uuid":"52130863","full_name":"koehlma/jaspy","owner":"koehlma","description":"A Python byte code VM written entirely from scratch in JavaScript with some unique features.","archived":false,"fork":false,"pushed_at":"2020-10-16T13:16:34.000Z","size":1466,"stargazers_count":581,"open_issues_count":2,"forks_count":52,"subscribers_count":26,"default_branch":"master","last_synced_at":"2024-05-14T06:44:29.130Z","etag":null,"topics":["experimental","interpreter","javascript","python","web"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/koehlma.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-20T01:41:03.000Z","updated_at":"2024-05-14T06:44:29.130Z","dependencies_parsed_at":"2022-09-18T16:33:02.554Z","dependency_job_id":null,"html_url":"https://github.com/koehlma/jaspy","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koehlma%2Fjaspy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koehlma%2Fjaspy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koehlma%2Fjaspy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koehlma%2Fjaspy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koehlma","download_url":"https://codeload.github.com/koehlma/jaspy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247234921,"owners_count":20905854,"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":["experimental","interpreter","javascript","python","web"],"created_at":"2024-07-31T15:00:55.176Z","updated_at":"2025-04-04T19:08:27.553Z","avatar_url":"https://github.com/koehlma.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"Jaspy\n=====\n\n|pypi| |build| |coverage| |docs| |gitter|\n\nJaspy is a Python VM written entirely from scratch in JavaScript with some unique\nfeatures. Jaspy supports multiple threads, comes with an integrated debugger which\noffers remote debugging and provides a flexible preprocessor based architecture.\nSpeed is explicitly not a main goal of this project. Jaspy aims to illustrate how\nweb programming on the client side could be done by exploring new ways.\n\n\nFeatures\n--------\n- **suspendable** interpreter with support for **threading** and greenlets\n- integrated **debugger** and interactive remote debugging (CLI, PyCharm, …)\n- **flexible** preprocessor based architecture to optimize Jaspy for your needs\n- easily **extensible** with native JavaScript modules (time_, dom_, …)\n- full support for meta-classes, builtin subclassing and operator overloading\n- asynchronous imports and arbitrary-length integers based on BigInteger.js_\n\n.. _BigInteger.js: https://github.com/peterolson/BigInteger.js\n.. _time: https://github.com/koehlma/jaspy/blob/master/modules/time.js\n.. _dom: https://github.com/koehlma/jaspy/blob/master/modules/dom.js\n\nQuickstart\n----------\nJaspy comes with an integrated development server and interactive debugger!\n\nFirst install the dependencies, if they are not installed already:\n\n.. code:: sh\n\n    pip3 install --user -r requirements.txt\n    pip3 install --user ptpython pygments\n\nClone the repository and build the interpreter:\n\n.. code:: sh\n\n    git clone --recursive https://github.com/koehlma/jaspy.git; cd jaspy\n    python3 build.py  # build the interpreter\n\nSwitch to the example directory and start the server in interactive mode:\n\n.. code:: sh\n\n    cd example\n    PYTHONPATH=../ python3 -m jaspy.cli --interactive\n\nVisit http://localhost:8080/hello.html in your browser and click run:\n\n.. image:: https://raw.githubusercontent.com/koehlma/jaspy/master/example/debugger.gif\n    :alt: Jaspy Screencast\n    :align: center\n\n\nAlternatives\n------------\nThere are already many other Python-to-JavaScript approaches out there:\n\n- `Brython \u003chttp://www.brython.info/\u003e`_\n- `PyPy.js \u003chttp://pypyjs.org/\u003e`_\n- `Skulpt \u003chttp://www.skulpt.org/\u003e`_\n- `Batavia \u003chttps://github.com/pybee/batavia\u003e`_\n- `Pyjs \u003chttp://pyjs.org/\u003e`_\n- …\n\nMost of them are faster than Jaspy but none of them offers the unique features of\nJaspy, which are the fully suspendable interpreter with threading support, the\nintegrated debugger and the flexible, preprocessor based architecture.\n\n\nSpeed\n-----\nJust to get an impression how slow Jaspy really is!\n\n+-----------------------------------------------+------------------+\n|                                               | pystones/second  |\n+===============================================+==================+\n| Jaspy (enabled Debugger, enabled Threading)   | 195              |\n+-----------------------------------------------+------------------+\n| Jaspy (disabled Debugger, enabled Threading)  | 199              |\n+-----------------------------------------------+------------------+\n| Jaspy (disabled Debugger, disabled Threading) | 206              |\n+-----------------------------------------------+------------------+\n| Brython                                       | 4184             |\n+-----------------------------------------------+------------------+\n| PyPy.js (cold)                                | 41425            |\n+-----------------------------------------------+------------------+\n| PyPy.js (warm)                                | 847457           |\n+-----------------------------------------------+------------------+\n\nHowever this is a somewhat unfair benchmark because no dom manipulation or anything\nelse browser specific is going on. Surprisingly threading and debugging introduces nearly\nno overhead.\n\n\nState\n-----\nThis project is still in an alpha state. The APIs are unstable, it is untested and not\nready for productive use. Some of the features listed above are not yet implemented.\n\nI started this project in my semester break and now, as the new semester started, I have\nmuch less spare time. Therefore it might take a while until I will be able to invest much\nmore time into it. However I very welcome all sorts of contributions.\n\n\nContributions\n-------------\nIf you like the ideas of Jaspy feel free to join, there are many things to do:\n\n- implement all the batteries-included-builtin stuff of Python\n- implement native JS modules for the DOM, JS objects and some Web APIs\n- improve the debugger and make it fully compatible to the PyDev protocol\n- implement a parser and bytecode compiler in JavaScript\n- complete and adjust the implementation of the Python bytecode VM\n- support for Apache Cordova (Jaspy for cross platform mobile applications)\n- implement a neat UI library on top of Jaspy (using a flexbox based grid)\n- implement a just-in-time compiler to speed things up\n- add a virtual file system (consider using: `BrowserFS \u003chttps://github.com/jvilk/BrowserFS\u003e`_)\n- … and, of course, your own great ideas and cool features\n\nDo not hesitate to contribute or ask if there is anything unclear about the code or the\nprocess of contributing in general.\n\n\nStructure\n---------\n\n:libs: third-party dependencies\n:modules: bundled native JavaScript modules\n:src: JavaScript source files (need to be preprocessed)\n:jaspy: Python server, converter and remote debugger\n\n\nCredits\n-------\nMany thanks to the `Brython \u003chttp://www.brython.info/\u003e`_ project for the inspiration for\nmany parts of code of the builtin-classes. Many thanks also to the book `“500 Lines or\nLess”`_ which is a good starting point if you want to know how the interpreter works.\n\n.. _`“500 Lines or Less”`: http://aosabook.org/en/500L/a-python-interpreter-written-in-python.html\n\n\n.. |pypi| image:: https://img.shields.io/pypi/v/jaspy.svg?style=flat-square\u0026label=latest%20version\n    :target: https://pypi.python.org/pypi/jaspy\n\n.. |build| image:: https://img.shields.io/travis/koehlma/jaspy/master.svg?style=flat-square\u0026label=build\n    :target: https://travis-ci.org/koehlma/jaspy\n\n.. |docs| image:: https://readthedocs.org/projects/jaspy/badge/?version=latest\u0026style=flat-square\n    :target: https://jaspy.readthedocs.org/en/latest/\n\n.. |coverage| image:: https://img.shields.io/coveralls/koehlma/jaspy/master.svg?style=flat-square\n    :target: https://coveralls.io/github/koehlma/jaspy?branch=master\n\n.. |gitter| image:: https://img.shields.io/badge/gitter-join%20chat-1dce73.svg?style=flat-square\n    :target: https://gitter.im/koehlma/jaspy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoehlma%2Fjaspy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoehlma%2Fjaspy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoehlma%2Fjaspy/lists"}