Zig day 4 was actually pretty pleasant. The core language is pretty solid, and they’ve figured out ways to make handling errors and optional returns way more ergonomic than a lot of languages while still forcing you to deal with them, which is really good.
One small annoyance is the relatively close adherence to C syntax makes all the deviations hard to remember and seem out of place. Counterintuitively, if the base syntax was more different I think it’d be easier to remember.
There are a few things in the language that are really nice so far, but a whole lot of things where the language just doesn't tell you you've done something wrong until a totally different part of your code explodes with a cryptic error message.
Similarly, eventually I realized that a problem I was having was that my ArrayLists were being allocated on the stack. Okay, I can sort of see how that makes sense, even though you have to hand them an allocator. Not that the error messages helped.
Can you allocate an ArrayList on the heap via something like `new std.ArrayList(u32)(...)`? Of course not. As far as I can tell, the best you can do is
var ptr = try alloc.create(std.ArrayList(u32));
ptr.* = std.ArrayList(u32).init(alloc);
Alright, it's day 3 of Advent of Code and I'm about to throw Zig out the window. Its basic behavior around pointers is stupendously underspecified and its compiler errors are terrible.
As an example, if you do `var a = &std.ArrayList(u32).init(al)`, what type would you expect a to have? If you said "pointer to ArrayList", wrong! It's a pointer to const ArrayList. Why is it const? I have no idea.
this is such a good debugging story ("Rust std fs slower than Python!? No, it's hardware!”) https://xuanwo.io/2023/04-rust-std-fs-slower-than-python/
I wrote up a blog post for how we’re taking advantage of TypeScript to make developing our APIs easier and less error-prone, check it out!
In truth, it’s more complicated than that, since I also wrongly think that Bret Victor did the wat talk, so the thing I actually think is, “They put the wat guy on the OpenAI board?”
BRITISH TEA TRANSLATION GUIDE
"Cup of tea?" = A valued friend has arrived. Let's welcome them in.
"Spot of tea?" = A foreign guest has arrived. Hyper-English Mary Poppins mode activated.
"Pot of tea?" = The in-laws have arrived. I would very much like to impress them.
"...tea?" = I find this situation awkward. Let's do literally anything else.
"Cuppa?" = I don't know you. This is a veiled threat.
"Fancy a cuppa?" = You are smokin hot. Would you care for some intercourse?
"I'll make some tea." = There has been a death in the family or national tragedy.
The @gbhnews podcast series on Boston's Big Dig finished today. Even if you think you know the story of the Big Dig, this podcast tells it in a level of detail I haven't seen before, with a focus on the human stories behind its construction. It's well worth a listen, especially if you're interested in how #infrastructure is built in the US.
https://www.wgbh.org/podcasts/the-big-dig
https://www.youtube.com/playlist?list=PLMQKK3_a14M3A-SQdVVWhOfOw8xRUuueJ
Parenting sometimes seems like sorcery. We got Ms. 4 a new winter coat, she picked it out herself, a nice pink one.
She’s refused to put it on for the past week.
This morning, after I made her put it on because it was cold, I said that she looked like a “big pink cutie”, and that incantation was enough to transmute it into a beloved object. She’ll wear it every day now.
Experiments aren't expressions of customer desire:
https://www.billjings.com/posts/title/experiments-aren't-expressions-of-customer-desire/
Not so technical, but... I have seen this opinion expressed a lot, and I think it's incredibly harmful.
It's in the nature of the work we do that we get to decide more about what our customers get to do than they do. But it's important not to lie to ourselves about when we are and aren't doing this.
Software engineering manager at Cord. Counterculture-adjacent. Strong opinions, rarely tooted. (he/him)