Better HN
topnewbestaskshowjobs
Log inSign up

zero_shift

4,017 karma · joined Mar 10, 2017 (9y ago) · 930 submissions

I really like computers!
Submissions

comment 12mo ago · link · parent

I published it as a Gist because my own blog deployment pipeline was in a non-functioning state.

comment 1y ago · link · parent

Eh, I'm not convinced.

1. Culturally, using `unwrap` is an omerta to Rust developers in the same way `panic` is an omerta to Go devs;

2. In the Rust projects I've seen there is usually a linter rule forbidding `unwrap` so you can't use it in production

comment 1y ago · link · parent

But I could screw it up in Go, if I made the same assumptions

    fvs, err := features.AppendWithNames(..)
    if err != nil {
        // this will NEVER break
        panic(err)
    }
Ultimately I don't think language design can be the sole line of defence against system failures; it can only guide developers to think about error cases

214.

The Cloudflare outage was a good thing(gist.github.com ↗)

10 points · by zero_shift · 1y ago · discuss

comment 1y ago · link · parent

> If you figure out how to do this completely, please contact me—I must know!

I think you want to use a TypeScript compiler extension / ts-patch

This is a bit difficult as it's not very well documented, but take a look at the examples in https://github.com/nonara/ts-patch

Essentially, you add a preprocessing stage to the compiler that can either enforce rules or alter the code

It could quietly transform all object like types into having read-only semantics. This would then make any mutation error out, with a message like you were attempting to violate field properties.

You would need to decide what to do about Proxies though. Maybe you just tolerate that as an escape hatch (like eval or calling plain JS)

Could be a fun project!

comment 1y ago · link · parent

Why not?

It's better to have diverse, imperfect infrastructure, than one form of infra that goes down with devastating results.

I'm being semi-flippant but people do need to cope with an internet that is less than 100% reliable. As the youth like to say, you need to touch grass

Being less flippant: an economy that is completely reliant on the internet is one vulnerable to cyberattacks, malware, catastrophic hardware loss

It also protects us from the malfeasance or incompetence of actors like Google (who are great stewards of internet infrastructure... until it's no longer in their interests)

comment 1y ago · link · parent

I learned Go this year, and this assertion just... isn't true? There are a bunch of subtleties and footguns, especially with concurrency.

C++ is a basket case, it's not really a fair comparison.

comment 1y ago · link · parent

For a long time, yt-dlp worked completely with Python. They implemented a lightweight JavaScript interpreter that could run basic scripts. But as the runtime requirements became more sophisticated it struggled to scale

comment 1y ago · link · parent

I'm nowhere near as senior as you (12 years). But I've reflected on this a lot recently. I love the technology and feeling like I'm building things, but staying hands on will always limit your scope. Taking the management path improves your scope but the work is - well - just less fun than programming.

My answer right now is to try and build more things myself. Small apps, CLIs, retro games. Not libraries or much OSS stuff so much as actual "products" that give me creative control and concrete outputs. It's hard to make the time though.

Outside of my career I'm also trying to cultivate other works, like my YouTube channel and my writing. Creating a video that 250k people enjoy is at least as meaningful to me as crushing my OKRs

We are all mortal beings: there will inevitably be more things to do than time to do it, and it's easier to ruminate on options than commit to something that feels "suboptimal".

To give an example of that. I spent a lot of time wondering if I should have gone into academia / literary criticism rather than tech, because of a vague sense that because I was very good at something, that's where I should put my efforts. Is that sound reasoning though? I probably achieved more "value" for society working as a programmer, than writing about Chaucer.

So to summarise it may be a choice of making peace with the lower scope / autonomy of hands on work, and finding that satisfaction outside work. If that suggestion makes your soul revolt, though, it may be you have to compromise and take the managerial path

comment 1y ago · link · parent

I have observed it too, it is heavily inspired by economics and mathematics.

Saying "it's better to complete something imperfect than spend forever polishing" - dull, trite, anyone knows that. Saying "effort is a utility curve function that must be clamped to achieve meta-optimisation" - now that sounds clever

If I was going to be uncharitable, I think there is are corners of the internet where people write straightforward things dressed it up in technical language to launder it as somehow academic and data driven.

And you're right, it does show up in the worse parts of the EA / rationalist community.

(This writing style, at its worst, allows people to say things like "I don't want my tax spent on teaching poor kids to read" but without looking like complete psychopaths - "aggregate outcomes in standardised literacy programmes lag behind individualised tutorials")

That's not what the blog post here is doing, but it is definitely bad language use that is doing more work to obscure ideas than illuminate them

comment 1y ago · link · parent

Imagine if 10% of that money had been spent just training young people, or on a new cohort of PhDs. Imagine what benefits we would have reaped in a decade's time.

comment 1y ago · link · parent

Slightly tangential to the article: a lot of the "AI layoffs" are really just old fashioned layoffs, but with exciting press releases meant to reassure investors.

AMZN for example overhired in various functions because it expected demand that never materialised. Admitting that is bad for the share price, but writing some woo about "AI and agility" will convince at least some investors to keep the faith.

comment 1y ago · link · parent

At the risk of a smart-ass reply, I think you could say the same for almost any consumer electronics

Even if you don't suspect malfeasance / advertising / surveillance, a lot of these devices and their software are sloppily developed and highly insecure

comment 1y ago · link · parent

Buried half way down,

    As part of the Family Hub™
    software update, we are 
    piloting a new widget
    for select Cover screens
    themes of Family Hub™ 
    refrigerators. The 
    widget will display 
    useful day-to-day
    information such as 
    news, calendar and 
    weather forecasts, along 
    with curated 
    advertisements.[11]
Wow!! Elevating!!!

comment 1y ago · link · parent

> It will sell very well because it a) will be cheaper than non-advertising laden fridges,

Will it? Investors would prefer full price fridges with full price ads.

Most consumers won't even know they've installed adware until the appliance is turned on, and what are they gonna do? go to all the effort of returning and buying another fridge?

Captive audience

comment 1y ago · link · parent

"Why should I? He's the one who sucks"

comment 1y ago · link · parent

It almost was JavaScript! ES4 was going to have something very similar to JSX tags. Well, an extension to ES4 called E4X

comment 1y ago · link · parent

In a past life we did try it... Marko has been around for years.

It started as a project at eBay and then got spun out to an open project around 2015

comment 1y ago · link · parent

Rather than defining all these one-method interfaces, why not specify a function type?

Instead of

    type Saver interface {
        Save(data []byte) error
    }
You could have

   type saves func([]byte) error
Seems less bulky than an interface, more concise to mock too.

It's more effort when you need to "promote" the port / input type to a full interface, but I think that's a reasonable tradeoff to avoid callers of your function constantly creating structs just to hang methods off

comment 1y ago · link · parent

I think a better distinction is internet enabled software.

I had a good time programming BASIC on my V-Tech pseudocomputer, at age 9. But that's a world away from tiktok, reels and the predatory surveillance economy.

comment 1y ago · link · parent

I agree, actually. Humans are visual creatures and they take cues from the visual design of program code: alignment, grouping, density. All these things are used to signify meaning in product design, including digital design. But we are not allowed to "design" source code.

comment 1y ago · link · parent

As a Go learner, the best explanation that has made sense to me is that interface types essentially just compose two pointers:

P1: The type and its method vtable

P2: The value

Once I understood that I could intuit how a nil Foo was not a nil Bar and not an untyped nil either

1
789
31