Live data from Hacker News

Skulpt: client side Python without preprocessing

skulpt.org

1–10 of 49 posts

Re: Skulpt: client side Python without preprocessing

#2
Hi there! One of the Skulpt maintainers here. (Also founder of Anvil - https://anvil.works. Never thought I'd have two projects on the front page at once!)

Feel free to ask any questions about the gory internals and how it works. You might also enjoy my talk from PyCon US this summer, about how Skulpt compiles blocking Python code into non-blocking Javascript: https://anvil.works/blog/pycon-talk

Re: Skulpt: client side Python without preprocessing

#4

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?

I think it's mostly a difference in approach. Brython sets out to "replace Javascript with Python" as the language of scripting the Web. This means it has custom bindings to the browser API, supports writing Brython in tags, uses slightly funky/un-Pythonic operators to do DOM manipulation, etc. Brython code can't block, to my knowledge (although the Python 3 async stuff makes that constraint much less painful these days).

Skulpt is "a Python implementation in JS". It doesn't have built-in DOM bindings - it's typically used within a project like Anvil or Trinket which provides higher-level (and therefore more Pythonic) modules for display/input/IO. Skulpt code can block, which also helps keep those APIs simple.

I guess my summary would be that Brython is great for scripting your HTML in Python rather than Javascript, but Skulpt is best for providing a Python runtime in your app. Does that make sense? (Of course, you'd have to ask a Brython developer for their take on it ;) )

Re: Skulpt: client side Python without preprocessing

#5
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 pygal charting in the browser

- https://tynker.com: their Python notebook feature uses Skulpt

- http://interactivepython.org: a popular open-source textbook that has excellent Parson's problems

- http://codeskulptor.org: implements some custom Skulpt libraries that I haven't seen anywhere else

- https://www.coursera.org/learn/interactive-python-1: Coursera's interactive Python course

That's just the ones I could remember off the top of my head. I truly believe this is one of the most impactful open-source projects of all time, especially if you consider the impact is has on kids (i.e. future computer scientists) that can use an excellent teaching language like Python directly in their web browser.

Re: Skulpt: client side Python without preprocessing

#6
post #2

Hi there! One of the Skulpt maintainers here. (Also founder of Anvil - https://anvil.works . Never thought I'd have two projects on the front page at once!) Feel free to ask any questions about the gory internals and how it works. You might also enjoy my talk from PyCon US this summer, about how Skulpt compiles blocking Python code into non-blocking Javascript: https://anvil.works/blog/pycon-talk

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

Re: Skulpt: client side Python without preprocessing

#7
post #4

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?

I think it's mostly a difference in approach. Brython sets out to "replace Javascript with Python" as the language of scripting the Web. This means it has custom bindings to the browser API, supports writing Brython in tags, uses slightly funky/un-Pythonic operators to do DOM manipulation, etc. Brython code can't block, to my knowledge (although the Python 3 async stuff makes that constraint much less painful these d…

Why the quotes around "Python implementation in JS"? Isn't it literally just that?

Re: Skulpt: client side Python without preprocessing

#8
post #2

Hi there! One of the Skulpt maintainers here. (Also founder of Anvil - https://anvil.works . Never thought I'd have two projects on the front page at once!) Feel free to ask any questions about the gory internals and how it works. You might also enjoy my talk from PyCon US this summer, about how Skulpt compiles blocking Python code into non-blocking Javascript: https://anvil.works/blog/pycon-talk

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.)

Re: Skulpt: client side Python without preprocessing

#9
post #7
post #4

Earlier quoted context omitted.

I think it's mostly a difference in approach. Brython sets out to "replace Javascript with Python" as the language of scripting the Web. This means it has custom bindings to the browser API, supports writing Brython in tags, uses slightly funky/un-Pythonic operators to do DOM manipulation, etc. Brython code can't block, to my knowledge (although the Python 3 async stuff makes that constraint much less painful these d…

Why the quotes around "Python implementation in JS"? Isn't it literally just that?

They're quotes from each respective project's homepage :)
Post reply on HN