HNHacker News
TopNewBestAskShowJobs

benwilber0

1,356 karma · joined August 24, 2013

submissionscomments
benwilber0··on Koto Programming Language
Or like saying that C++ was somehow deficient just because NodeJS had to be created in order to script v8.
benwilber0··on Koto Programming Language
I've used OpenResty extensively which is basically just nginx + luajit with a lot of additional APIs and features. The nginx-lua-module is available separately from the OpenResty distribution of nginx, so you can just install and run it as a dynamic nginx module.
benwilber0··on Koto Programming Language
This is already available as an optional Lua target in mlua [0]. I recently built a programmable server for Server-Sent Events scriptable with Lua [1]. I chose Lua 5.4, but it's trivial to switch it to LuaJIT, or really any other Lua derivative including Roblox Luau. It's just a matter of enabling the mlua feature you want.

[0] https://github.com/mlua-rs/mlua

[1] https://tinysse.com/

benwilber0··on A love letter to the CSV format
Right, obviously.
benwilber0··on A love letter to the CSV format
JSON is a textual encoding no different than CSV.

It's just that people tend to use specialized tools for encoding and decoding it instead of like ",".join(row) and row.split(",")

I have seen people try to build up JSON strings like that too, and then you have all the same problems.

So there is no problem with CSV except that maybe it's too deceptively simple. We also see people trying to build things like URLs and query strings without using a proper library.

benwilber0··on A Walk with LuaJIT
LuaJIT.org stopped publishing release tarballs [1] which caused leafo's GH actions builds [2] to suddenly stop working. The workaround was to start testing against OpenResty's distribution of LuaJIT [3] which is incompatible with LuaJIT.org's version.

There is no faster way to make a fork the de facto standard version than to break everyone's CI builds.

[1] https://luajit.org/download.html

[2] https://github.com/leafo/gh-actions-lua/issues/49

[3] https://github.com/openresty/luajit2

benwilber0··on Apple may stop producing Vision Pro by the end of 2024
For streaming in VR it has to be at least 4K per eye. So 8k in the general case, but realistically it will be higher than that.

Nobody can stream 2x 4K to my Apple VR headset. I can barely get a single 4K stream to my TV!

benwilber0··on Apple may stop producing Vision Pro by the end of 2024
VR tech still isn't ready yet.

It needs very high-res video streams which basically no internet provider/CDN can offer at scale. 40Mbps+ HEVC just isn't scalable. So the only content is whatever can be downloaded to the device itself. A few games? A cool screensaver experience? It's all cool, but mostly novelty tech.

benwilber0··on Everything I built with Claude Artifacts this week
+1 to the completions/inferences in Zed. It's the first editor that I feel (mostly) confident about just tabbing-through the AI completions with minimal prompting/re-editing.
benwilber0··on Eliminating Memory Safety Vulnerabilities at the Source
You're a legend. Thanks for writing The Book. It really affected my life in a very positive way.
benwilber0··on Eliminating Memory Safety Vulnerabilities at the Source
> Increasing productivity: Safe Coding improves code correctness and developer productivity by shifting bug finding further left, before the code is even checked in. We see this shift showing up in important metrics such as rollback rates (emergency code revert due to an unanticipated bug).

> The Android team has observed that the rollback rate of Rust changes is less than half that of C++.

I've been writing high-scale production code in one language or another for 20 years. But I when I found Rust in 2016 I knew that this was the one. I was going to double-down on this. I got Klabnik and Carol's book literally the same day. Still have my dead-tree copy.

It's honestly re-invigorated my love for programming.

benwilber0··on B-Trees and Database Indexes
Probably the worst PK index of all time. There's a reason why it's barely ever used.
benwilber0··on B-Trees and Database Indexes
Maybe? idk. Not in Postgres. The default index is a B-Tree. A hash-based index would be terrible for disk-seeking, in any case.
benwilber0··on B-Trees and Database Indexes
You only need 1 index on the UUID. Instead of everywhere the UUID is referenced from other tables
benwilber0··on B-Trees and Database Indexes
This is why you should _never_ make your UUID column the primary key.

For one, it's enormous. Now you have to copy that 128bit int to every side of the relation.

Two, in most cases it's completely random. Unless you had the forethought to use something other than UUIDv4 (gen_random_uuid). So now you just have a bunch of humongous random numbers clogging up your indexes and duplicated everywhere for no good reason.

Use regular bigserial (64bit) PKs for internal table relations and UUIDs (128bit) for application-level identifiers and natural keys. Your database will be very happy!

benwilber0··on Streaming every NFL game this season requires 7 different services, costs $2,500
some people want to watch the game and not just the highlights 3 hours later
benwilber0··on MongoDB takes a swing at PostgreSQL after claiming wins against rival
I had such a bad experience with Mongo DB back in 2012-2013 that I don't think I'll ever use it again, or even really consider it. But maybe it's changed and gotten better since then?

Anyway. I just use Postgres.

benwilber0··on What's New in SQLAlchemy 2.1?
I'm not talking about trivial applications. PK lookups are easy no matter what you use. I'm talking about non-trivial applications.

> > And they're always lazy, so you never really know when the N+1s are going to happen.

> There are tools to detect this. Please use them regardless. Even if you're writing queries but hand, enough functions on the stack can hide an N+1

I don't want to have to use a tool to "detect" anything. I want my queries to return exactly what they're expected to return, or my code will fail. No surprises.

benwilber0··on Scaling Rails and Postgres to millions of users at Microsoft
Postgres can scale to millions of users, but Rails definitely can't. Unless you're prepared to spend a ton of money.
benwilber0··on What's New in SQLAlchemy 2.1?
I've loved and used SQLAlchemy for many years. It got me a long way in my career. But at this point I've sworn-off using query-builders and ORMs. I just write real, hand-crafted SQL now. These "any db" abstractions just make for the worst query patterns. They're easy and map nicely to your application language, but they're really terrible unless you want to put in the effort to meta-program SQL using whatever constructs the builder library offers you. CTEs? Windows? Correlated subqueries? It's a lot. And they're always lazy, so you never really know when the N+1s are going to happen.

Just write SQL. I figured this out when I realized that my application was written in Rust, but really it was a Postgres application. I use PG-specific features extensively. My data, and database, are the core of everything that my application does, or will ever do. Why am I caring about some convenient abstractions to make it easier to work with in Rust, or Python, or whatever?

Nah. Just write the good SQL for your database.

benwilber0··on Never enable 2FA for accounts that you actually care about (2023)
> GitHub will send a prompt to their app on your phone

I lost my phone, though. There's no prompt they could send me.

> I believe Google can send a similar prompt to YT or GMail apps

There was no phone, anymore. No way to prompt.

benwilber0··on Never enable 2FA for accounts that you actually care about (2023)
Do you think that you could get Google, or Github, to turn off your 2FA login requirement if you really needed it? Like if you lost your codes? Or never saved them in the first place?
benwilber0··on Never enable 2FA for accounts that you actually care about (2023)
Author here. Explain to me why I should be permanently banned from Uber because I accidentally forgot the secret key to log in to my account.
benwilber0··on Never enable 2FA for accounts that you actually care about (2023)
> let this be a lesson

I forgot my backup code, so now I can just never use Uber again.

Lesson learned!

(you see how ridiculous this is, right?)

benwilber0··on Never enable 2FA for accounts that you actually care about (2023)
> What if you made a new Uber account with another email address? Would you be committing a venal sin?

Uber accounts are tied to phone numbers. Should I get a new phone number just because Uber's support bot is incapable of helping me recover my account?

benwilber0··on Never enable 2FA for accounts that you actually care about (2023)
How many backups of my Uber codes should I have had? If I have 0, does that mean that I can never get a car to take me to the airport again?
benwilber0··on Never enable 2FA for accounts that you actually care about (2023)
But what if I did't do any of those things? What if I made a mistake and didn't save my backup codes on 3 different types of storage medium (at least one of them offsite)?

Or at all?

benwilber0··on Never enable 2FA for accounts that you actually care about (2023)
Well, hopefully you never lose your original birth certificate and your social security card! You won't be a citizen anymore!
benwilber0··on Never enable 2FA for accounts that you actually care about (2023)
oh shit I lost my backup codes. So now I'm just never allowed to use Uber again?
benwilber0··on Twitch to Cut 500 Employees, About 35% of Staff
Several years ago I cobbled together all the pieces to make a live video streaming website [1] like Twitch.tv, et al. It's impossible to actually run at any kind of scale without being an ISP or Google-scale peer. Not to mention the enormous amount of DMCAs when people are trying to stream live sports, Pay-per-view, etc.

It was fun to play with it for a couple months. But there's no business here. Twitch.tv is also finding that out.

[1] https://github.com/benwilber/boltstream

← PreviousPage 2 of 8Next →