Publishing a JavaScript library requires creating an artifact (a .tar.gz file, aka tarball) that will be downloaded when your users install the package, say with npm install your-package . Call the directory in a git repo the “source package” and the tarball artifact the “distribution package.” After creating this artifact you upload it to a package registry, typically npm.…

 I’ve been reading Simon Willison , Matt Webb , and Geoffrey Litt this week on using LLMs to accomplish things I didn’t realize computers could do. 
 That’s Large Language Models, often we’re talking about GPT-3 from OpenAI but the technology is more than a specific product. Open versions of this aren’t far behind. Google might have had better versions of all…
Here’s a shortcode for embedding Observable notebooks in Hugo. 
 {{< obs
 specifier='@ballingt/embedding-example'
 cells='vegaPetalsWidget,viewof minSepalLength,viewof minSepalWidth'
>}}
 When the shortcode is installed in layouts/shortcodes/obs.html in your Hugo site, the input above produces the output below. 
 
 

 Here’s the code to stick in the…

 I spent a couple weekends in 2018 and 2019 trying and giving up at porting Endless Sky , an open source 2D space exploration game in the vein of Escape Velocity, to the web. I’d start with writing Hello World in C using Emscripten to compile to WebAssembly and then try to draw the rest of the owl: porting a whole application. 
 This year I decided to ask for help. I was fortunate…

 This Year 
 New biking destinations! 
 
 China Camp, great for first time biking campers, bike path almost the whole way, <30mi 
 Pinehurst Road around Redwood Regional Park from Berkeley, great forest! 
 
 
 Reading : lots of scifi! I had a great reading summer. 
 Traveled to Serbia and Argentina! 
 
 Work: I joined a data engineering team at Dropbox…
The time may be ripe for a new Python implementation. 
 A lot of keynotes lately have called for one anyway. They are joined — informally, not speaking in an official capacity — by Python core developers in issuing a wakeup call: where is Python in the browser? Where is Python on mobile devices? How could Python be 2x faster? 
 Barry Warsaw at the PyCon 2019 Python Steering…
Tetris Effect : doing certain kinds of really absorbing things will make the activity pevasive in your thoughts when you close your eyes. This isn’t conversing with characters from a book I’m reading in a dream, this is starting to fall asleep and suddenly seeing falling blocks. I’d consider this different from “thinking with portals” where I start to be reminded of a…



 Making things even 
 When I was little I liked (had a compulsion 1 ) to make certain things symmetrically even: if I accidentally brushed my face with my left hand, I might purposefully brush it with my right. 
 Sometimes left then right wasn’t enough: the right touch had been more recent! As the mental weight of each touch decayed with time, the right touch remained…

 abstract 
 
 
 

 
 Python is not Java, nor is it C++ 
 It’s different! Let’s talk about how. 
 Why? 
 Because as Python experts (you did choose to come to a Python conference so likely you’re either an expert already or in time you’re going to become one if you keep going to Python conferences) we have a responsibility to help our…
Brandon Rhodes, in addition to chairing the PyCon and giving a talk this year,
MC’d the Python trivia night as he has done for the past three years.
( 2014 ,
 2015 ,
 2016 ) 
 This year for some reason (maybe because I see him at
work ) Brandon asked me to help out with the
trivia night. Along with Larry Hastings, each of the three of us wrote eight
trivia…
Meet self 
 In Python we have functions and methods. 
 Function definitions in Python look like this: 
 def sloganify (x):
 return ' {} or bust!' . format(x) 
 And method definitions look like this: 
 class Person :
 def sloganize (self, x):
 return ' {} or bust!' . format(x) 
 Classes are buckets of functions 
 When we write Python code, we don’t…
A couple of tweet threads from Sarah Drasner caught my eye today: 
 The decision by Stanford to use JavaScript to teach instead of Java has me wondering, why not Python? — Sarah Drasner (@sarah_edo) April 22, 2017 
 
 After a few hours of this tweet going and some interesting discussion in the thread, I think my opinion on this has swayed https://t.co/1z1z5EJyNf — Sarah…

 When I get stuck on a computer thing, I tend to ask a question
in an irc channel or Slack or Zulip. 
 
 
 Sometimes it takes a while for my question to be answered. This is OK!
Sometimes the act of asking the question helps me get unstuck.
Often I end up making some progress after asking the question.
At this point I can say “nevermind, I don’t need…
Mariatta Wijaya tweeted 
 💭Thought process: - I wanna do a talk about lib X 💡 - nah I'm not qualified 😩 - lib author should give the talk How can I overcome this? 😓😕 — Mariatta 🤦 (@mariatta) January 9, 2017 
 
 tonight, asking how to get over the feeling that
you are not qualified to give a talk you have an idea for.
You can read other answers by following the tweet…

 Last September I moved on from the Recurse Center , f.k.a. Hacker School.
Three and a half wonderful years there shaped me as a programmer, an educator,
a contributing community member and above all as a learner. 
 There’s so much to say about the Recurse Center that I have trouble saying anything at all.
Undo is my favorite feature of the fancy python shell I help
maintain , and I wish more interactive
interpreters had it. I’ve previously
written about the mechanics
of implementing a command line interface that can rewrite its history, but not
about how to teach a system to undo. I’d like to tell you why I like undo, and
I hope afterward you’ll consider adding undo to…
This post is preceded by a description of two types of command line
interfaces . The more command line-like of these
two types integrates into a normal shell session ( python , telnet , bash )
instead of using the alternate screen to present a fullscreen text user interface
( top , vim , emacs ).
Sometimes programs blur this boundary with fancy formatting in a…
Command Line Creature Comforts 
 When a command line utility writes to stdout, sometimes that output is going
to be piped to another utility or redirected to a file. And sometimes the
input it reads from stdin will be coming from a file or another utility.
But other times that output is just going to be displayed by a terminal emulator,
and that input is going to be provided by…
I’m attempting to write a bot and I was trying to find some information
about ports on other computers. If anyone could help me out, I would appreciate it. 
 When you create a socket in Python, what does it represent? 
 What would be the underlying procedure for creating a connection with a host? 
 Let’s say I try to connect to a host using socket.connect, does it raise…
This is a presentation I gave at PyCon 2016.
You can watch the video on YouTube 
and view the slides 
served from the
 repo on GitHub . 
 
 A friend of mine was asked what a closure was at a programming interview a few
years ago. Despite being a competent Python and JavaScript programmer who took
advantage of closures in code he wrote, he froze up at the…
Since the release of Python 2.2 
in 2001, all Python functions have closed over bindings in outer scopes.
Before this release variables referenced from outer scopes had to be passed in
as arguments. A common workaround to this limiting behavior
was to set these at function definition time
with keyword arguments: 
 #!/usr/bin/env python2.0 
 def find (self, name):
…
This code fails 42% of the time. https://t.co/kTWKHrff3Q pic.twitter.com/pxLTYjkPYU — Thomas Ballinger (@ballingt) December 21, 2015 
 


 I was getting intermittent failures of a
test that checked that a feature of
 bpython was working. 1 
The test was failing on my computer
despite passing on Travis CI ,
a service that automatically runs the tests…
Last night Amy Hanlon , A. Jesse Jiryu Davis 
and I gave previews of our upcoming PyCon talks at an NYC Python Meetup Group 
event hosted at Venmo. 
 I had a great talk with James Powell about
 rlundo and his many adventures
with loading shared libraries, and got valuable feedback about the talk from a
few folks, particularly Jesse.
I won’t be able to post the…
lmontopo and I recently contributed
to jquast’s wcwidth , a pure Python
implementation of the system call of the same name. Contributing was really
easy, and jquast was very supportive and helpful. Working on wcwidth led me to
(re)discover Blessed, a terminal wrapper used in wcwidth
to assist with manually inspecting whether character sequences were the right
length…
I finally bit the bullet and wrote documentation for
Curtsies this last weekend.
This required getting familiar with a few new tools like reStructuredText
and Sphinx’s additions to it, including learning enough about those projects'
internals to write a hacky
 custom directive and parser 
for displaying ANSI escape code-containing terminal output. But the…
A conversation with current Hacker Schooler Cerek 
about writing a
boggle solver in Haskell motivated me to squeeze in writing up a
solution in Python yesterday morning between appointments with
Hacker Schoolers. 
 The strategy I followed was to generate all candidate
words and check them for validity with a dictionary, with the optimization
of not actually traversing…
Last week’s Hacker School 
 Paper of the Week 
was Richard Hamming’s “Error Detecting and Error Correcting
Codes.” 
I worked through the paper (not something I do a lot)
and wanted to show an example of my process reading it. 
 I’m probably an “active
learner,” insofar as that’s a useful label in describing learning…
Last night I discovered Jonathan Slenders’ Python Terminal Toolkit : a fancy interface to
the Python interpreter very much like
 bpython-curtsies , the project I’ve
been working on on and off for a year. I was simultaneously very excited to
see this work and a little depressed - on first glance many aspects
of the project seem better than bpython, and appears to…
Guy Steele is a smart man who gave a talk sixteen 1 years ago about the
design 2 of the Java 3 programming 4 language. 5 6 
In Guy Steele’s talk “ Growing a
Language ” he
does not tell what garbage collection means, and says that is a task
for you to try in
your spare time. I have some spare time this day, and so will try to tell
what garbage…
I just took a vacation for a week! I spend time with my family in Washington
State mostly doing fun outdoorsy things.
I didn’t answer email for the week but I did try to get some
work in on bpython: only as much as was fun to do at the time. I made a list of
issues 1 
to try to tackle and chose the deadline of the first day of the next batch of
Hacker School to finish…
The Python REPL is great! You can try out code before putting it in your
program and get information about types and objects: 
 
 A while ago some people created an even better REPL - you probably haven’t
heard of it: 1 
 
 Then a fellow named Bob created bpython. It does some cool things. I wrote
bpython-curtsies, an alternative frontend to bpython, that’s…
bpython 0.13 has just been released 
and it includes bpython-curtsies, the bpython
frontend I’ve been working on on and off for 9 months. If you’re
not reading on your phone or in bed with an ipad, take a moment to try it out: 
 $ pip install bpython[curtsies]
...
$ bpython-curtsies
>>> s = 'abc'
>>> s. <look at that great autocompletion and call a…
Sometimes Python serves as a convenient lingua franca:
it stands in for psuedocode as a language for expressing
general programming ideas. For example,
this excellent introduction to functional programming 
uses map(function, iterable) 
to to express the same idea
that list comprehensions express.
This isn’t as Pythonic, but it’s more universal.
The…
One late night at Hacker School a few months ago, I had the chance to
discuss programming languages with the inimitable Will Byrd.
At one point I mentioned that JavaScript and Python felt terrifically similar to me.
Will thought that seemed odd, which made me want to examine it further. 
 Let me tell you about my favorite dynamically typed language. 
 JavaScript∪Python 
 In…
Here are some things that surprise folks about Python.
I’ll present one with some background, then list a few others. 
 
 Ever since Kristen Widman built a bittorrent client 
at Hacker School last year, building one from scratch has been a popular project here. 1 
 A few months ago my friend Joe Wilner was having fun with the parser section of the
project, decoding a…
Last Saturday I went to the Museum of Mathematics , across from Madison Square Park
with Casey. The museum of math appears to be primarily a playground where parents
bring their children to osmose math from pretty geometric shapes.
It was a bit expensive, small, and broken. But it was also pretty fun. 
 Exhibits were generally interactive activities you could enjoy without…
This week I wrote a lot of trees: 
 
 
 Regular expression
parser - builds regular expressions with a recursive
descent parser 
 
 
 Regression trees - building a decision tree for classification 
 
 
 Program Synthesis - I talked to a lot of other people about program
synthesis and built things with some of them. 
 
 
 Simple Tree in…
I added better paste support to
 bpython-curtsies this week, and when I
finally got around to testing the feature in Python 3 I found things weren’t
working as expected. The bug was to do with doing nonblocking
reads of stdin working differently in Python 2 vs 3. 
 Once I traced the problem (pressing keys didn’t do anything) to recent changes
I’d made to…
After not making much progress on bpython for a while, someone in #bpython
asked for better paste support, and I found I needed the same feature.
Building something someone else needs and building something I want are two
of my favorite things! 
 I’d like to give a presentation this week at Hacker School about features of
Python folks might not have seen, in the form of…
I’ve mostly finished up work on an alternative frontend for bpython. 
 Updated: this is now the default bpython frontend,
installed with pip install bpython 
and then run with bpython . To use the old frontend, use bpython-curses .
The rest of this post refers to this new frontend as bpython-curtsies . 
 bpython-curtsies is bpython with native terminal scrolling: 
…

 
 
 Books I've read 
 
 
 2024 
 In progress -->
 -->
 A Deepness in the Sky - Vernor Vinge 
 The Wee Free Men - Terry Pratchett 
 It's been a rough year for reading! I've been pretty into work. 
 2023 
 Ace - Angela Chen 
 The Warmth of Other Suns - Isabel Wilderson 
 Happy Go Lucky - David Sedaris 
 Soul Music - Terry Pratchett…

 
 
 Games I've played 
 
 
 2026 
 2025 
 Peglin 
 Balatro 
 Thronefall 
 2024 
 2023 
 Final Fantasy XVI 
 2022 
 Horizon Zero Dawn: Forbidden West 
 Cult of the Lamb 
 Vampire Survivors 
 Slay the Spire 
 Hades 
 2021 
 Horizon Zero Dawn 
 Stardew Valley 
 Frog Fractions 3 
 Final Fantasy XV 
…

 
 
 Marie's Crisis 
 How fun is Marie's Crisis? More fun if you like singing, more fun if you know the music, more fun if you know the words.
 
 
 Pianists 
 Michael James Roy - most Saturdays? 
 Saturdays are great.
 Brandon James Gwinn - Thursdays maybe? 
 Thursdays sometimes maybe?
 Playlists 
 Most Popular Spotify list 
 Really popular…

 
 
 Things in Programming 
 that I'm paying attention to 
 
 
 Philip Guo 
 Publications 
 repl.it 
 lighttable+eve 
 The tragedy of a wonderful run 
 Runkit 
 I wonder what's going on with this 
 Observable.hq 
 I want to understand how this can work product-wise 
 Glitch 
 fast.ai 
 Airtable 
 


 
 
 Thomas Ballinger 
 Variable length bio 
 Move the slider to get a bio of the length you need.
 Prompted by @pgbovine .
 
 42 chars 
 
 full name in body
 
 
 
 Tom is pretty awesome. You'll need to enable JavaScript for this. If you'd prefer a handcrafted bio for your purposes, send me an email .