News for hackers. Stuff that matters.

thomasballinger

Re:Cloudflare Sandbox SDK on Friday October 17, 2025 @11:32AM (#45617921)
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.
Re:WASM 2.0 on Friday May 09, 2025 @11:28AM (#43937906)
Re:HYTRADBOI 2025 Conference Postmortem on Thursday March 06, 2025 @08:11AM (#43279791)
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...
Re:How Convex Works on Sunday April 14, 2024 @04:53PM (#40034388)
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

Re:Substack is (not) now powered by Ghost on Monday December 12, 2022 @12:42PM (#33957625)
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

Re:Zaplib post-mortem on Saturday April 30, 2022 @03:45PM (#31218676)
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...

Re:Mess with DNS on Wednesday December 15, 2021 @03:31PM (#29571241)
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!

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!

Re:Unfork: The Inverse of Fork(2) on Saturday May 29, 2021 @03:56PM (#27327824)
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
Re:Dozens of scientific journals have vanished from the internet on Wednesday September 09, 2020 @03:08PM (#24424606)
A related project is fatcat.wiki
Re:Minecraft Education Edition Worlds Available for Free on Friday April 10, 2020 @03:39PM (#22836590)
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?

Re:What’s wrong with computational notebooks? on Monday January 27, 2020 @07:23PM (#22165244)
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.
Re:Float Toy on Wednesday January 22, 2020 @04:58PM (#22122495)
rreusser made a more generic version inspired by Float Toy: https://observablehq.com/@rreusser/binary-input
Re:Build Your Own WebAssembly Compiler on Friday December 27, 2019 @02:30PM (#21893740)
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

Re:How to Grow Software Architecture out of Jupyter Notebooks on Wednesday December 12, 2018 @11:57AM (#18665478)
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)
Re:How to Grow Software Architecture out of Jupyter Notebooks on Wednesday December 12, 2018 @11:54AM (#18665447)
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/
Re:D compilation is too slow and I am forking the compiler on Wednesday November 21, 2018 @01:15PM (#18504744)
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...
Re:Ink: React for interactive command-line apps on Sunday July 23, 2017 @07:00PM (#14834832)
(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.

Re:Ink: React for interactive command-line apps on Sunday July 23, 2017 @06:49PM (#14834809)
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

Re:A Javascript journey with only six characters on Saturday October 08, 2016 @08:15PM (#12669313)
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.

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.

Re:Autocomplete as an interface on Sunday September 27, 2015 @01:12PM (#10287157)
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 :)

Re:Autocomplete as an interface on Sunday September 27, 2015 @07:21AM (#10286183)
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)

Re:A string of unexpected lengths on Saturday February 21, 2015 @12:51PM (#9086195)
How do you find this in practice? I mention this in the 3rd footnote of the post, but didn't have much to say about it because I haven't used it myself. The one person I've talked about this says it's rather awkward right now because Swift doesn't provide great tools for working with these objects.

Older »