6,134 karma · joined Oct 5, 2007 (19y ago) · 831 submissions
Formerly the founding CTO of Parse.ly. Coding in: Python, JavaScript, Zig. Pleased to be a Pythonista and UNIX lover.
Parse.ly was acquired by Automattic (creators of WordPress.com) in February 2021; more here: https://www.techmeme.com/210208/p12#a210208p12
My essays & technical blog: https://amontalenti.com
My AngelList profile: https://angel.co/p/amontalenti
My occasional tweets: https://twitter.com/amontalenti
comment 2y ago · link · parent
There is no commit hook on the local machine. On the local machine, you simply have a shim named "piku" which is essentially running "ssh remote /path/to/piku.py $@" to control the remote machine.
comment 2y ago · link · parent
- piku deploys via git rather than scp/sftp, but authenticates via ssh like those tools
- piku supports a number of runtimes, including Python, Ruby, Node, Go, Clojure. The runtimes are implemented rather simply, you can add your own rather easily, see examples here in the code: https://github.com/piku/piku/blob/8777cc093a062c67d3bead9a5d...
- For each runtime, a mechanism is utilized to install and isolate package dependencies (requirements.txt in Python, Gemfile in Ruby, packages.json in Node, etc.)
- a Procfile and ENV file are used to declare your application entrypoints and envvars akin to Heroku / 12 Factor App ideas
- a CLI (ssh shim on dev client machine) is provided for checking status and logs from the client (as well as stop/start/restart)
- since all applications are managed via uwsgi on the remote, there is also support for worker/sidecar processes and cronjob-style scheduled tasks
- HTTPS via Let's Encrypt (acme.sh) is handled automagically for web apps
I describe more about how piku works in this tutorial:
https://github.com/piku/webapp-tutorial?tab=readme-ov-file#b...
You're right that PHP apps have a simple deployment story, and in a way piku brings something akin to this level of simplicity to other web programming runtimes.
comment 2y ago · link · parent
https://github.com/piku/webapp-tutorial?tab=readme-ov-file#b...
It explains how piku works under the hood, as well as showing a minimalistic Python web app example from a user standpoint.
comment 2y ago · link · parent
https://rakhim.org/honestly-undefined/19/
I'm personally in the top left corner and bottom right corner at the same time, which is sort of funny.
I have used WordPress since 2004-2005, and I've also written a Python static site generator before using Flask, Frozen-Flask[1], and webpack. I've also made stops through tools like Sphinx, Hugo, Gatsby, and VitePress[2]. But my personal site continues to run WordPress[3].
I think I'd prefer something like VitePress these days for a technical documentation site. It has a lot going for it for that use case.
Also, I recently learned that MediaWiki with a reasonable theme like Citizen[4] is a nice choice for an open source powered private wiki, although I do find the Mediawiki markup language a little cumbersome versus simpler markup languages like reST or Markdown/MyST in the Python community (or GitHub-Flavored Markdown or Asciidoc supported elsewhere). But Mediawiki has a lot of nice features (after all, Mediawiki powers Wikipedia). The theme makes it work properly on mobile and makes content editing a bit simpler. It still isn't nearly as polished as commercial wiki-like software (e.g. Notion) but it's better than open source wikis used to be.
I do find it kind of amusing how many tools and frameworks developers have created for making it easier to edit HTML pages. Truly a foundational 21st century problem, I guess!
comment 2y ago · link · parent
For example, I have an old friend from a major investment bank who used to work on an internal (proprietary) pub/sub system but who, these days, works on integrations between that system and Apache Kafka.
comment 2y ago · link · parent
https://til.simonwillison.net/
Like a microblog of little learnings in day-to-day development.
One interesting thing that occurred to me recently is that my personal site (https://amontalenti.com) is more an essay archive and identity verification tool, than it is a “blog” or “microblog.” That is, the timestamps of the content on there are the least interesting thing about it. The most valuable page, for me, is https://amontalenti.com/archive.
As for something like /now, the most fascinating implementation of this is an old friend of mine from college. He and I were both early 2000s bloggers, but he came up with the idea, in 2001 or so, to keep a nearly-daily one sentence personal diary on his blog. He kept that up for the last 20+ years (he is nowadays a CS researcher and inventor in HCI). Very impressive near-daily microblogging habit over a lifetime!
comment 2y ago · link · parent
This also works especially well (that is, efficiently) in the streaming case, allowing you to keep something resembling a "counter" for the distinct elements, albeit with a error rate.
The benefit of HyperLogLog is that it behaves similarly to a hash set in some respects -- you can add items, count distinct them, and, importantly, merge two HLLs together (union), all the while keeping memory fixed to mere kilobytes even for billion-item sets. In distributed data stores, this is the trick behind Elasticsearch/OpenSearch cardinality agg, as well as behind Redis/Redict with its PFADD/PFMERGE/PFCOUNT.
I am not exactly sure how this CVM algorithm compares to HLL, but they got Knuth to review it, and they claim an undergrad can implement it easily, so it must be pretty good!
comment 2y ago · link · parent
comment 2y ago · link · parent
https://www.apple.com/ipad/compare/?modelList=ipad-pro-11-m4...
I guess the big difference is the display. OLED for the iPad Pro (which they weirdly call "Ultra Retina XDR") whereas the new iPad Air and the old one have a similar "advanced LCD" display (which they weirdly call "Liquid Retina").
Otherwise, the M4/Pro also has a higher core count, more storage options (up to 2TB) and even more storage available via Thunderbolt (e.g. USB storage devices), so long as you don't mind wires or Thunderbolt/USB hubs.
Then there are some differences that are just pricing or upgrade cycle wedges, like the "pro" keyboard support (only on M4) and the new Apple Pencil "pro" (on M2/M4).
I think I'll personally stick with the iPad Air line, especially since I much prefer Touch ID to Face ID, and I just use a full-blown Apple Bluetooth keyboard anyway rather than the iPad-specific ones. I described my iPad "fancy typewriter" setup here:
https://news.ycombinator.com/item?id=37643678
Hard to say whether this particular iPad Air release will warrant an upgrade over my iPad Air 5th Gen, though. Doubt it. Identical dimensions, nearly identical core count, identical RAM, and I got the 256 GB option last time around, so it has plenty of storage.
comment 2y ago · link · parent
Daniel Dennett was an important philosopher of mind, whose Wikipedia page is here:
https://en.wikipedia.org/wiki/Daniel_Dennett
When I studied philosophy in college (2002-2006), his ideas were among the most discussed and debated at NYU's philosophy department. I always enjoyed his thoughts and writings, even if I often didn't agree with them. RIP.
comment 2y ago · link · parent
https://github.com/amontalenti/elements-of-python-style#some...
The style guide itself, published a few years back, also has some suggestions with small code snippets.
comment 2y ago · link · parent
For me, rye (+ uv underneath) has perhaps the perfect workflow for an open source Python project. So I'm definitely using rye for that from now on -- instead of, say, poetry -- or hatchling directly, following the PyPA boilerplate[1].
You have a way of doing local development against any Python interpreter version. You have a way of tweaking dependencies and a straightforward sync/lock workflow. It all works atop "standard" PyPA infrastructure like pyproject.toml. You have a single command to build[1] project artifacts, like wheels. And you have a single command to publish new artifact versions to PyPI[2].
I think if you're doing local development on a project that is not meant to be published to PyPI, like a private Django project, then whether to use rye becomes more of a debate. For example, for a Django project I'm working on, I decided to just use uv directly, along with a Makefile. This is because during development of a Django project, I preferred to just use a plain requirements.txt (really, requirements.in) file, avoid the sync/lock workflow that rye imposes, and avoid the need to use something like "rye run". And rye's ability to build and package didn't solve a problem this project had, since the Django project wasn't being deployed via a PyPA packaging mechanism.
But this is probably also because the Python interpreter management problem, for me, is already handled by pyenv. I think if you're not already a pyenv user, rye is even more appealing because it handles "all" of the Python issues -- interpreters, requirements/dependencies, and packaging/publishing. (As well as a number of other standard dev-time issues besides, like testing, linting, and formatting.) But, in my case, I could hand venv management to uv, and then make dependency management part of a larger Makefile for my Django project, including custom linting, testing, and deployment steps. I wrote a little bit about my high level thoughts on Python packaging and dependency management, though this post was written before rye and uv were out.[4] If I were to update this post now, I'd say that you could swap uv for pyenv-virtualenv + pip-tools and be happier for it, and you could swap rye for the PyPA boilerplate. That is, you could upgrade to rye, or use it from the start, if you need packaging support, or if you like its dev-time workflow.
I'll also say, I found a little bug in how rye (+ hatch) interacted with my local git setup, and reported it to the rye team, and they helped me get to the bottom of it rather quickly.[5]
[1]: https://packaging.python.org/en/latest/tutorials/packaging-p...
[2]: https://rye-up.com/guide/commands/build/
[3]: https://rye-up.com/guide/commands/publish/
[4]: https://amontalenti.com/2022/10/09/python-packaging-and-zig
comment 2y ago · link · parent
https://lobste.rs/s/qjrdss/computers_can_be_understood#c_hqu...
For any fellow sufferers, the needle in the haystack is "skb rides the rocket." Same bug was also hit by Brendan Gregg around the same time.
comment 2y ago · link · parent
As part of that process, I personally found that the full set of app categories useful for an audit are:
A) essential (e.g. PW manager, email, maps, calendar)
B) direct and group messaging (e.g. Signal, Element, Telegram, WhatsApp)
C) social media, time wasting, distraction (serves no other real purpose other than to kill time, e.g. Facebook, Instagram)
D) episodic utilities (e.g. Airbnb, TripAdvisor)
E) always-on utilities (e.g. Venmo, Uber)
When you do this categorization, with a strong will, you can uninstall everything in categories C and D and end up with a much more utilitarian phone, primarily using the stuff in A and B.
I find that when you work on companies or projects, Slack and Discord are the tricky ones, because of how noisy they are but also how much people expect to be able to reach you there, especially via their DMs feature, which many use in lieu of email. I'm experimenting with the Texts.com app to work around this edge case. That is, keep Slack/Discord DMs visible via Texts.com app, but only use full Slack/Discord channels when on desktop when I am in a "channel skimming mood," via the desktop apps only. Haven't tried this fully yet on mobile since their Android app is still under development.
Anyway, I wrote up my personal experience with a smartphone app audit here:
comment 2y ago · link · parent
A better way to think about it is that the double-underscore naming convention simply means "reserved by the core Python team" -- they offer ways to hook into widely-implemented protocols in the Python runtime.
That also means you should never invent your own dunder methods or dunder attributes. This is another mistake new Python programmers -- and even some experienced Python programmers, even some Python framework writers! -- tend to make, "imitating" this naming convention to mark parts of their own code as "magic." Don't do that: the whole idea is that the core Python team reserved this namespace (`__*__`) for Python-wide protocols.
[1]: https://amontalenti.com/2013/04/11/python-double-under-doubl...
comment 2y ago · link · parent
comment 2y ago · link · parent
comment 2y ago · link · parent
[1]: https://python-history.blogspot.com/2009/04/origins-of-pytho...
[2]: https://github.com/amontalenti/elements-of-python-style?tab=...