1,670 karma · joined Mar 13, 2012 (14y ago) · 593 submissions
comment 4mo ago · link · parent
comment 10mo ago · link · parent
I rewrote a C project in Rust some years ago, and in the Rust version I included many optimizations that I probably wouldn't have in C code, thanks to the ability to do them "fearlessly". The end result was so much more performant I had to double check I didn't leave something out!
comment 1y ago · link · parent
For scraping HN directly, in my experience you have to go extremely slow, like 1 minute between fetching items. And if you get blocked, it may be better to wait a long time (minutes) before trying again rather than exponential backoff, in order to get out of the penalty box. You'll need a cache for sure.
comment 1y ago · link · parent
comment 1y ago · link · parent
Not requiring client auth certainly makes things simple. It can even work for private data if the topics are sufficiently unguessable.
6.
Show HN: Fastly Pub/Sub(github.com ↗)
2 points · by jkarneges · 1y ago · discuss
comment 2y ago · link · parent
> What problem is this envisioned as solving?
Its core mission is to legitimize all candidates on the ballot. This is something caucuses and ranked-choice voting can do, but since our general elections don't work this way, I wonder if the voting experience could be augmented from the private sector. (Of course, efforts to change how our actual elections work is still worthwhile and can be pursued in parallel).
Basically, if enough people (millions) were to use an app like this to meta-vote before committing to a single actual vote, we could simulate alternative voting processes without government involvement.
comment 2y ago · link · parent
13.
Show HN: Presidential polling with instant electoral results(ileantoward.com ↗)
4 points · by jkarneges · 2y ago · 8 comments
20.
Show HN: Who Should Be the President?(ileantoward.com ↗)
9 points · by jkarneges · 2y ago · 21 comments
comment 2y ago · link · parent
I made a presidential polling website with real-time electoral results. It requires semi-live participation and votes can be changed at any time. Only visitors from the USA can participate. Congressional district is determined by IP address.
The idea is to enable a coordinated voting process, where selections are non-binding and negotiable rather than blindly cast once. Kind of like a presidential caucus, but national and over the Internet.
The infra is Fastly & DigitalOcean. Backend is a Django service running on DO App Platform with Postgres. Fastly is used for edge logic, captcha, and pushing updates to the page (Fanout). In theory it should be able to handle millions of participants.
23.
Show HN: Who Should Be the President?(ileantoward.com ↗)
3 points · by jkarneges · 2y ago · 6 comments
comment 2y ago · link · parent
comment 2y ago · link · parent
What an extreme take!
Async Rust as-it-is makes perfect sense for Rust's primary audience: folks who desire control/performance enough that they would otherwise be using C/C++. To call async an "efficiency hack" is to underestimate how important that efficiency is to Rust's existence. If async didn't work the way it does, it wouldn't have gained traction within the Rust community (folks would have just ignored it and kept writing state machines by hand) and it wouldn't have been able to act as a draw for C/C++ developers. It's a killer feature, and has enabled the language to thrive.
Not only is it a killer feature, the way it is designed is the only way it could have been. See: https://without.boats/blog/why-async-rust/
comment 2y ago · link · parent
Currently, Fanout supports HTTP in addition to WebSockets. We consider the system to be generalized, in the sense that the user can build whatever they want on top of the available primitives, and we can always add more primitives. Most people are implementing "web" protocols (REST, SSE, GraphQL, etc), so what's available today gets us pretty far. You're right of course that we don't support arbitrary TCP protocols.
I suppose the reason we don't support bare TCP is Fanout is optimized for implementing pub/sub-style interfaces with minimal compute. In that context, it is preferable to work with coarse-grained input in order to avoid per-session processing. However, with Fastly Compute now in arms reach, I think we could embrace per-session processing, in which case implementing arbitrary TCP protocols could become practical.
Your idea of supplying custom L7 parsers to the routing layer is clever, and is not too far off from some things already on our mind. For example, our routing layer supports inspecting requests using custom rules supplied by the compute layer, though this is not yet exposed to Fastly users. Relatedly, the routing layer has an internal component that parses TCP streams into messages (by known protocol) and ships them over an IPC without caring about their content. So it's not too much of a jump to imagine how we could get to user-supplied L7 parsing.
comment 2y ago · link · parent
Fastly Fanout + Compute?
(disclosure: Fanout tech lead)