Better HN
topnewbestaskshowjobs
Log inSign up

pixelmonkey

6,134 karma · joined Oct 5, 2007 (19y ago) · 831 submissions

Founder of PX Systems, which ships a daily developer tool to go from code to cloud cluster in seconds. More info @ https://px.app

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

Submissions

comment 2y ago · link · parent

I like your suggestions. I haven't looked at this tutorial in awhile but I have an occasion to do so coming up, so I'll keep your feedback in mind for a revision.

comment 2y ago · link · parent

piku installs an agent on the remote machine (piku.py) which itself also provides the support for making that machine a git remote.

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

It's actually worth taking your joke seriously to compare and contrast:

- 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

Sure thing! Bit of cloud computing history. Covered a bit here:

https://leerob.io/blog/heroku

comment 2y ago · link · parent

The new docs look great!

comment 2y ago · link · parent

I love piku. I wrote a webapp tutorial for piku which got turned into a repo as part of the official GitHub piku org. You can find that here:

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

+1, a truly great book.

comment 2y ago · link · parent

Exactly. :)

comment 2y ago · link · parent

Obligatory meme:

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!

[1]: https://frozen-flask.readthedocs.io/

[2]: https://vitepress.dev/

[3]: https://amontalenti.com

[4]: https://www.mediawiki.org/wiki/Skin:Citizen

comment 2y ago · link · parent

k is widely used by a handful of big investment banks and big hedge funds for quant/finance stuff. There are only a handful of such companies in the world but they are extremely price insensitive, especially with regard to technology that lets them get a market edge. I suspect this is the dynamic that kx, the company, tapped into over the years. I also suspect this open source release is mainly because investment banks have come around on their desire for open source (rather than proprietary) software over the years, at least on some teams. You can see the open source release doc explicitly positions k vs Python, pandas, and polars.

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

rga, aka ripgrep-all, is my go-to for this. I suppose grep is a form of AI -- or, at least, an advanced intelligence that's wiser than it looks. ;)

https://github.com/phiresky/ripgrep-all

comment 2y ago · link · parent

This is a cool idea. I also really like simonw’s TIL feed:

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!

https://www.chrisharrison.net/index.php/Home/Log

comment 2y ago · link · parent

Is this site still working? I get no response when doing a search and can’t add my site either.

comment 2y ago · link · parent

This algorithm seems to resemble HyperLogLog (and all its variants), which is also cited in the research paper. Using the same insight of the estimation value of tracking whether we've hit a "run" of heads or tails, but flipping the idea on its head (heh), it leads to the simpler algorithm described, which is about discarding memorized values on the basis of runs of heads/tails.

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

I was looking over some data from a similar article and I found it striking how many of these new business application increases were in the South, Mid-Atlantic, and Mid-West states, rather than the West or Northeast. (At least for 2020 vs 2019.) One interpretation could be that these were places where stay at home orders were for “un-Zoomable” jobs (retail, manufacturing, machinists, construction, services), and thus workers were taking the plunge on entrepreneurship to create their own work. Map visualization here:

https://www.datawrapper.de/_/xv4ys/

comment 2y ago · link · parent

This is a more detailed comparison table that does new iPad Pro 11in (M4) vs new iPad Air 11in (M2) vs old iPad Air 11in (5th Gen, M1). There are some differences but you're right that they are pretty minor.

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

Looks like dailynous.com server is having trouble responding (likely due to HN). But a cached copy of the page is here:

http://archive.today/kHPfz

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

Well said.

comment 2y ago · link · parent

I had 2 suggestions (plus a blog post) in my style guide here:

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

Interesting. I recently rewatched "The Big Chill" and wrote a reflection about the movie vs the internet age:

https://amontalenti.com/2023/12/28/the-blog-chill

comment 2y ago · link · parent

Yes, I saw the issue was already reported in hatch and being worked on so I assumed it'd make its way into rye eventually! Thanks for closing the loop!

comment 2y ago · link · parent

I tried out rye + uv on a recent greenfield project. They are awesome tools and I'm really excited about their potential.

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

[5]: https://github.com/astral-sh/rye/issues/793

comment 2y ago · link · parent

Great post. I posted about my real-world experience of a deep bug like this on lobste.rs. Here is that comment/explainer:

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

Yea, I agree. Part of the reason I used "episodic" as a category was to uninstall 100% of my episodic apps and only reinstall when/if needed.

comment 2y ago · link · parent

I recently did a smartphone app audit and deleted 18 apps I classified as "social media, time wasting, and distraction." I deleted another 40 or so apps that were only occasionally useful, and that I could just install later if/when needed.

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:

https://amontalenti.com/2024/03/26/the-smartphone-app-audit

comment 2y ago · link · parent

This is a great guide. Awhile back, I wrote a blog post[1], "Python double-under, double-wonder," trying to dispel one common misconception I find among new Python programmers. That is, they often think that these methods are "magical" and thus shouldn't be implemented in their own classes (by "mere mortals"). That is true for a small subset of dunder methods (e.g. `__new__`), but not true for many of them (e.g. `__init__`, `__iter__`, `__call__`, `__len__`).

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

I have family in Italy and they were sending me e-mail warnings about the coming lock-downs in February 2020. (I just checked my GMail records to confirm.) Because by then Italy was already locking down. It was declared an emergency in Italy shortly after the WHO declaration and especially due to 2 confirmed cases found in Rome. You can read about this here: https://en.wikipedia.org/wiki/COVID-19_pandemic_in_Italy

comment 2y ago · link · parent

Small correction: the post says "2019 pandemic," but the pandemic was actually in early 2020. "COVID-19" is so named because it is traced back to a first case in China in December 2019. WHO declared it a global emergency on January 30, 2020 which is about when Western press started taking it more seriously. WHO announced "COVID-19" as the name of the new disease, following some international naming guidelines, on February 11, 2020. The graph shows a sharp dropoff in onsite jobs and sharp rise in remote jobs precisely in the February-March 2020 time period, which makes sense.

comment 2y ago · link · parent

One could argue: given that so much useful software has been written with Python after so many years without anonymous functions (beyond lambda expressions), perhaps GvR had some wisdom in never upgrading the lambda expression beyond single-line expressions.[1] It does mean that Python programs tend to be more procedural / imperative / object-oriented in style rather than functional, but maybe that's not such a bad thing. You can still write some nice quasi-functional code that is quite readable.[2] And I say this as someone who has a lot of fun playing with functional programming, and even once wrote a blog post (based on a technical talk) comparing Python and Clojure.[3]

[1]: https://python-history.blogspot.com/2009/04/origins-of-pytho...

[2]: https://github.com/amontalenti/elements-of-python-style?tab=...

[3]: https://amontalenti.com/2014/11/02/clojonic

comment 2y ago · link · parent

I actually agree with you that of these solutions, Cloudflare is the one that has the most delivery issues. But, it's free.
12345
28