Hacker Newsnew | past | comments | ask | show | jobs | submit | more thomasballinger's commentslogin

Minecraft Education Edition provides in-game coding tools for Python, JavaScript, and a MakeCode-style visual block editor! This would be a great activity to do with some children I know.

But it's only available for Office 365 Education accounts, which is a product it seems I can't purchase as an individual.

Are there any educational institutions that I can pay to give me a accounts I could use for this? Or does anyone know what's involved in spinning up your own educational institution that Microsoft will sell Office 365 for education to?


I've played with prototypes of this by calling fork on IPython to take snapshots of interpreter state https://github.com/thomasballinger/rlundo/blob/master/readme... but if you can't serialize state fully, rerunning from the top (bpython's approach) can work, or rerunning as a dependency dag shows is necessary (my current employer Observable's approach) works nicely.


rreusser made a more generic version inspired by Float Toy: https://observablehq.com/@rreusser/binary-input


Here's Colin's blog post with code and diagrams inline: https://blog.scottlogic.com/2019/05/17/webassembly-compiler....

I found Colin's posts real helpful when writing some WebAssembly by hand for the first few days of Advent of Code: https://observablehq.com/collection/@ballingt/advent-of-wasm


Less powerful but more automatic: I added a reload modules key to bpython (F6) for this and an auto reload which reruns the repl session each time an imported module changes (F5)


If anyone wants to walk through these ideas more slowly I write about them in http://ballingt.com/interactive-interpreter-undo and implement this in https://github.com/thomasballinger/rlundo but as you say, eventually decided I had to implement an interpreter for which serialization of state was more efficient and all external resources had amenable interfaces http://dalsegno.ballingt.com/


Will you marry me?

this is really cool, I'm going to give deeper into the code tonight. Awesome work


hooking into readline is a clever idea!


The Jupyter models is hard for this, but if you only allow in-order execution (like a repl, say IPython whose kernel is used in Jupyter) you could do something like this.

We tried plugging in the rlundo tool https://github.com/thomasballinger/rlundo to IPython, it works ok, see http://ballingt.com/interactive-interpreter-undo/ for the long story.

I wanted something like this for live programming and felt like I needed to write my own interpreter because the behavior you need is so different: http://dalsegno.ballingt.com


Here's an idea that I like (so much that I wrote an implementation): use LD_PRELOAD to swap out readline with version that forks on each input. Kill the forked child process and you have undo! https://github.com/thomasballinger/rlundo post: http://ballingt.com/interactive-interpreter-undo/#hacking-fo...


(just to emphasize, I think parent understands this)

The render function here can be stateful, React vdom-style: diff with previous output, efficiently update output based on the perf characteristics of a terminal. But it's an entirely separate domain, which is great for the developer.


One optimization that's not hard to do for terminal output is a line cache: if a row is the same, don't render it. The rendering logic is probably already operating on lines, so this doesn't require the fancy diffing; but diffing a flat grid seems easier anyway vs the dom tree. For context, (I suspect parent already understands this) this is analogous to the vdom optimizations (not shouldComponentUpdate optimizations) possible with React. Except the algorithm is more straightforward: for each character on the grid, is the content the same since the previous render?

This library looks real neat, a declarative TUI with an api already familiar to many developers. I've thought this would be a neat thing to exist since I started using React after having written a similar declarative, redraw-only-as-necessary terminal rendering library for bpython (http://ballingt.com/bpython-curtsies/).

In it (http://curtsies.readthedocs.io/en/latest/) the only rendering optimization was a line cache. For the specific use case of an interactive interpreter this worked pretty well: once a line is changing, it's probably changing a lot. But you could go further using the output of diffing of arrays of terminal text.

edit: whoa https://github.com/Yomguithereal/react-blessed looks awesome for this


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: