Better HN
topnewbestaskshowjobs
Log inSign up

thomasballinger

190 karma · joined Dec 12, 2011 (14y ago) · 39 submissions

ballingt.com, me@ballingt.com, @ballingt
Submissions

comment 1y ago · link · parent

Codex remote environments seem to do this, we had to add support (via two lines of code) for these proxy environment variables to our CLI to support talking to GitHub from these environments.

comment 1y ago · link · parent

There's a change history in the spec at https://webassembly.github.io/spec/core/appendix/changes.htm... and I see a 3.0 branch with updates for 3 https://github.com/WebAssembly/spec/blob/1e8f1dad8ca35ef3941...

comment 1y ago · link · parent

My favorite talk (although I haven't gotten through them all yet) was Alex Miller's Enough with all the Raft https://www.hytradboi.com/2025/2016d6c4-b08d-40b3-af2f-67926...

comment 2y ago · link · parent

HTTP handlers for requests can be defined, many Convex apps define these to handle webhook notifications and some apps consist primarily of these endpoints or app-specific REST APIs. (I work at Convex)

Edit: simultaneous post with my manager

5.

The Ent Framework: Meta's ORM(youtube.com ↗)

3 points · by thomasballinger · 3y ago · discuss

comment 3y ago · link · parent

I figure compilation is a big tent and this counts, but imagine

--rename-properties WARNING: renaming properties requires deeper analysis, considered compilation in the US

comment 4y ago · link · parent

I so appreciate these being public, see also Steve's Compose readme[1] and post-mortem[2].

I got to sit in for a day during prototyping for user 2 and was impressed but intimidated: reinventing the web stack is a lot of work! The team won me over though. If you have the chance to pair program with JP I highly recommend it, and I expect to be impressed by this team again in the future.

[1]https://github.com/compose-run/client [2]https://composerun.notion.site/Jan-2022-17761ede06f94e2abc42...

comment 4y ago · link · parent

Note that this sentence was about browser-based integration tests. Browser automation has come a long way, but even on very frontend-fluent teams I've been on we had a few flakey tests, and browser-based integration tests are sometimes flakey in ways that are difficult and tedious to debug! Not understanding why doesn't necessarily indicate any lack of understanding of DNS.

But maybe it increases the odds of a "Let's understand Playwright!" post in the future!

comment 5y ago · link · parent

A nice surprise to see this here! I did a web port of this game with Emscripten which much help from janisozaur: https://play-endless-web.com

There's an outdated post about what was hard about the port at http://ballingt.com/porting-endless-sky/ – with Emscripten as good as it is, it really wasn't bad!

comment 5y ago · link · parent

Here's another implementation of what's described above, it forks on each invocation of readline to provide undo for interactive interpreters. https://github.com/thomasballinger/rlundo

comment 6y ago · link · parent

A related project is fatcat.wiki

12.

Offering a solution for Terminal Wide Character issues(jeffquast.com ↗)

3 points · by thomasballinger · 6y ago · discuss

13.

Inside a Hello World executable on OS X (2018)(adrummond.net ↗)

1 points · by thomasballinger · 6y ago · discuss

comment 6y ago · link · parent

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?

15.

Observable for Jupyter Users(observablehq.com ↗)

3 points · by thomasballinger · 6y ago · discuss

comment 6y ago · link · parent

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.

comment 6y ago · link · parent

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

comment 6y ago · link · parent

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

comment 7y ago · link · parent

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)

comment 7y ago · link · parent

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/

comment 8y ago · link · parent

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

comment 8y ago · link · parent

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

comment 9y ago · link · parent

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

comment 9y ago · link · parent

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

comment 10y ago · link · parent

I've hacked on this interpreter some, it's pretty nice to read! It implements a very limited subset of JavaScript, something like ES3.

I'd be really interested to hear about other similar implementations of JavaScript in JavaScript. I stopped working on https://github.com/thomasballinger/hotswapping-js-interp#js-... partially because copying the state of the interpreter was relatively slow. I'd be interested in implementations that would handle this better by using a more bytecode-like VM or immutable data structures.

comment 10y ago · link · parent

Indeed it does, https://github.com/awslabs/aws-shell/blob/master/setup.py#L1...

Python Prompt Toolkit is pretty stellar, enough so to motivated writing a command line interface in Python instead of another language in my opinion.

comment 11y ago · link · parent

Great point, particularly relevant to autocompletion: IPython magics are tab completable and therefore more discoverable than bpython special keys. Real quick, they're emacs-style readline keys but with ctrl-r for undo. F1-F10 do things too.

Docs for shortcut keys, for anyone F1 doesn't work for: http://docs.bpython-interpreter.org/configuration.html#keybo...

The F1 issue with GNOME terminal is frustrating, I agree a cheatsheet-style help page on the site would be good. I've been meaning to do this for a while and might finally get time to work through backlog next week :)

comment 11y ago · link · parent

I feel similarly about autocomplete (particularly the "best way to learn Python" bit) and suggest Python users looking for autocompletion similar to zsh at the command line pip install bpython (which I work on).

See https://github.com/bpython/bpython for source, http://ballingt.com/bpython-curtsies for some (old) gifs.

More generally, build your own tools like this with the excellent Python Prompt Toolkit! (https://github.com/jonathanslenders/python-prompt-toolkit)

29.

Not everything is an expression(codewords.recurse.com ↗)

125 points · by thomasballinger · 11y ago · 53 comments

12