Live data from Hacker News

Skulpt: client side Python without preprocessing

skulpt.org

11–20 of 49 posts

Re: Skulpt: client side Python without preprocessing

#11
post #10

How long until we can compile Python to Web-assembly? EDIT: I just realized this can mean two things: 1. Compiling python source code to Web-assembly. 2. Compiling the python interpreter/compiler to Web-assembly.

(Contributor to skulpt and pypy.js here)

That is a difficult question to ask and I think the original developer of pypy.js Ryan Kelly is most suited to answer it. There are some people that have tried feeding the asm.js from pypy.js to the asm.js -> wasm compiler.

Which with a lot of fiddling may work for the non-jitted version. But if you want all the pypy speed you'll want to jit wasm to the browser.

I would love to know if you can do synchronous calls in wasm.

Re: Skulpt: client side Python without preprocessing

#12

How does this compare to Brython ( http://brython.info/ ), apart from missing the Python 3 support? Are there any custom bindings to the browser API?

We are working on python3 support and skulpt does have a python3 mode which emulates the biggest differences between py2 and py3. (like from __future__ import).

But it doesn't understand any of the new syntax added by python3 yet.

Re: Skulpt: client side Python without preprocessing

#13

Many people, especially kids, will at some point encounter an online learning tool where you can just run Python in the browser. Chances are the underlying interpreter is Skulpt. A short list of examples: - https://pythonroom.com : has a free online curriculum with more helpful error messages that kids can understand and real-time analytics for teachers - https://trinket.io : handles Python, turtle graphics, and pyga…

I work as an engineer at https://datacamp.com, and we run the code directly on a server, but I've always thought it would be interesting to try building interactive programming exercises with Skulpt.

Re: Skulpt: client side Python without preprocessing

#14

Many people, especially kids, will at some point encounter an online learning tool where you can just run Python in the browser. Chances are the underlying interpreter is Skulpt. A short list of examples: - https://pythonroom.com : has a free online curriculum with more helpful error messages that kids can understand and real-time analytics for teachers - https://trinket.io : handles Python, turtle graphics, and pyga…

Python dev and trainer here.

Skulp is terrible as a python implementations go. Error reporting is meh. Many advanced features are not supported.

Brython is a much better alternative. More complete and robust.

However, i advise against running a js python in general. Exposing secured and isolated jupyter notebooks is much better for learning.

Re: Skulpt: client side Python without preprocessing

#16
post #10

How long until we can compile Python to Web-assembly? EDIT: I just realized this can mean two things: 1. Compiling python source code to Web-assembly. 2. Compiling the python interpreter/compiler to Web-assembly.

The runtime is several Mo. Not worth it.

Re: Skulpt: client side Python without preprocessing

#17
post #13

Many people, especially kids, will at some point encounter an online learning tool where you can just run Python in the browser. Chances are the underlying interpreter is Skulpt. A short list of examples: - https://pythonroom.com : has a free online curriculum with more helpful error messages that kids can understand and real-time analytics for teachers - https://trinket.io : handles Python, turtle graphics, and pyga…

I work as an engineer at https://datacamp.com , and we run the code directly on a server, but I've always thought it would be interesting to try building interactive programming exercises with Skulpt.

I've always wondered, how do you isolate/protect against people doing nefarious things in a setup like that?

Re: Skulpt: client side Python without preprocessing

#18
post #17
post #13

Earlier quoted context omitted.

I work as an engineer at https://datacamp.com , and we run the code directly on a server, but I've always thought it would be interesting to try building interactive programming exercises with Skulpt.

I've always wondered, how do you isolate/protect against people doing nefarious things in a setup like that?

Virtual machine is probably the most common solution.

Re: Skulpt: client side Python without preprocessing

#19
post #13

Many people, especially kids, will at some point encounter an online learning tool where you can just run Python in the browser. Chances are the underlying interpreter is Skulpt. A short list of examples: - https://pythonroom.com : has a free online curriculum with more helpful error messages that kids can understand and real-time analytics for teachers - https://trinket.io : handles Python, turtle graphics, and pyga…

I work as an engineer at https://datacamp.com , and we run the code directly on a server, but I've always thought it would be interesting to try building interactive programming exercises with Skulpt.

I'm a big fan of datacamp. You should definitely give this a try. It would be great to expand the reach of your lessons without the infrastructure overhead of every user hitting your server with their code. Hit up the skulpt dev listserve if you want some help. Or I'm at elliott@trinket.io.

Plug: you could easily prototype this with Trinket embeds. Add #!/bin/python3 to the top of our Python (Skulpt) trinkets to get strict Py3 mode. Add data files via the + button (no directory support, so treat them as all in the local directory). Use the Share menu to get embed code. Paste. You've got your first interactive lesson. If your users like it, you can then decide whether and how to build skulpt in to the site.

Re: Skulpt: client side Python without preprocessing

#20
post #8

Earlier quoted context omitted.

Thank you for building such a fantastic tool that has gotten so many more people coding in Python.

Thank-you! It's definitely a team effort, including several educators as well as the teams from Trinket and Anvil (where I'm a cofounder). A particular shout-out for Albert-Jan Nijburg, who does some contracting for Trinket but donates a lot of his own time to the project. (I think we're top two contributors at the moment, but this varies a lot - we also get summer students who are very helpful.)

I can second this sentiment. Meredydd and Albert Jan have made a good deal of Skulpt's most technically interesting features (which in turn enable a more seamless user experience). I'm a cofounder of Trinket and we knew early on that this project was something we would use heavily and wanted to support. We support more languages now (including server side Python, Java, and with R coming soon) but our skulpt-based free Python trinket remains our most popular one.

Our users have benefitted hugely from contributions by Meredydd, Albert Jan, Michael Ebert, Marie Chatfield, Scott Rixner, Brad Miller, and a whole bunch of other contributors. Go team!

Post reply on HN