npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jaspy

v0.0.4

Published

a Python VM written entirely from scratch in JavaScript with some unique features

Downloads

9

Readme

Jaspy

Jaspy is a Python VM written entirely from scratch in JavaScript with some unique features. Jaspy supports multiple threads, comes with an integrated debugger which offers remote debugging and provides a flexible preprocessor based architecture. Speed is explicitly not a main goal of this project. Jaspy aims to illustrate how web programming on the client side could be done by exploring new ways.

Features

  • suspendable interpreter with support for threading and greenlets
  • integrated debugger and interactive remote debugging (CLI, PyCharm, …)
  • flexible preprocessor based architecture to optimize Jaspy for your needs
  • easily extensible with native JavaScript modules (time_, dom_, …)
  • full support for meta-classes, builtin subclassing and operator overloading
  • asynchronous imports and arbitrary-length integers based on BigInteger.js_

.. _BigInteger.js: https://github.com/peterolson/BigInteger.js .. _time: https://github.com/koehlma/jaspy/blob/master/modules/time.js .. _dom: https://github.com/koehlma/jaspy/blob/master/modules/dom.js

Quickstart

Jaspy comes with an integrated development server and interactive debugger!

First clone the repository and build the interpreter:

.. code:: sh

git clone --recursive https://github.com/koehlma/jaspy.git; cd jaspy
python build.py  # compile the interpreter

Install dependencies for the interactive console, if they are not installed already:

.. code:: sh

pip install --user ptpython pygments

Switch to the example directory and start the server in interactive mode:

.. code:: sh

cd example
PYTHONPATH=../ python -m jaspy.cli --interactive

Visit http://localhost:8080/hello.html in your browser and click run:

.. image:: https://raw.githubusercontent.com/koehlma/jaspy/master/example/debugger.gif :alt: Jaspy Screencast :align: center

Alternatives

There are already many other Python-to-JavaScript approaches out there:

  • Brython <http://www.brython.info/>_
  • PyPy.js <http://pypyjs.org/>_
  • Skulpt <http://www.skulpt.org/>_
  • Batavia <https://github.com/pybee/batavia>_
  • Pyjs <http://pyjs.org/>_

Most of them are faster than Jaspy but none of them offers the unique features of Jaspy, which are the fully suspendable interpreter with threading support, the integrated debugger and the flexible, preprocessor based architecture.

State

This project is still in an alpha state. The APIs are unstable, it is untested and not ready for productive use. Some of the features listed above aren't yet implemented.

Todo

If you like the ideas of Jaspy feel free to join, there are many things to do:

  • implement all the batteries-included-builtin stuff of Python
  • implement native JS modules for the DOM, JS objects and some Web APIs
  • improve the debugger and make it fully compatible to the PyDev protocol
  • implement a parser and bytecode compiler in JavaScript
  • support for Apache Cordova (Jaspy for cross platform mobile applications)
  • implement a neat UI library on top of Jaspy
  • … and, of course, your own great ideas and cool features

Structure

:libs: third-party dependencies :modules: bundled native JavaScript modules :src: JavaScript source files (need to be preprocessed) :jaspy: Python server, converter and remote debugger