Readit News logoReadit News
ekimekim commented on Swift is a more convenient Rust (2023)   nmn.sh/blog/2023-10-02-sw... · Posted by u/behnamoh
Mond_ · a month ago
It's worth pointing out that the two examples that you're writing are actually strictly different, and not just "better syntax for the same thing". (This is assuming `String | Int` works as in Python, and the second example works as in Rust.)

To understand the difference, `String | String` is just `String`. It's a union, not a sum type. There's no tag or identifier, so you cannot distinguish whether it's the first or the second string.

If this sounds pedantic, this has pretty important ramifications, especially once generics get involved.

ekimekim · a month ago
To provide a concrete example, this bit me in a typescript codebase:

    type Option<T> = T | undefined

    function f<T>(value: T): Option<T> { ... }

    let thing: string | undefined = undefined;
    let result = f(thing);
Now imagine the definition of Option is in some library or other file and you don't realize how it works. You are thinking of the Option as its own structure and expect f to return Option<string | undefined>. But Option<string | undefined> = string | undefined | undefined = string | undefined = Option<string>.

The mistake here is in how Option is defined, but it's a footgun you need to be aware of.

ekimekim commented on Advent of Code 2025: Number of puzzles reduce from 25 to 12 for the first time   adventofcode.com/2025/abo... · Posted by u/vismit2000
petesergeant · 5 months ago
I’ve been trying to design a puzzle for a game this year that humans can solve but LLMs can’t. I’ve come up with one, but it was hard work! It’s based around message cracking.
ekimekim · 5 months ago
There was one in a previous AoC that I think stumped a lot of AI at the time because it involved something that was similar to poker with the same terminology but different rules. The AI couldn't help but fall into a "this is poker" trap and make a solution that follows the standard rules.
ekimekim commented on You are the scariest monster in the woods   jamie.ideasasylum.com/202... · Posted by u/mohi-kalantari
ekimekim · 5 months ago
As always, there is a relevant XKCD: https://xkcd.com/1968/
ekimekim commented on YouTube's new anti-adblock measures   iter.ca/post/yt-adblock/... · Posted by u/smitop
k12sosse · 9 months ago
How does Twitch do it? They're super aggressive and even using third party clients that do a good job and not displaying ads, you still get an occasional "commercial break" screen where they're not serving you the content, or the ad, just a "let's all go to the lobby" screen.
ekimekim · 9 months ago
Twitch puts the ads directly in the HLS stream, but as seperate segments from the content (a HLS stream is made of many small video files, on twitch they're about 2s long). They're trivial to recognize and filter out (they're actually explicitly tagged as ad segments) but it still won't serve you the actual stream you were trying to watch - the ad segments override it. The best you can do is just block until the first non-ad segment arrives.
ekimekim commented on The Difference Between Downloading and Streaming   danq.me/2025/05/26/downlo... · Posted by u/kruemmelspalter
majormajor · 10 months ago
> What about actual live events? My impression is that Twitch and YouTube livestreaming are using a 10-30 second delay relative to realtime, specifically to allow for significant buffering on the client, and then using reliable TCP faster-than-realtime downloads of the "near future" of the video content. Since these streams are purely unidirectional, users don't have a way to notice that they're not literally live. (I don't understand how this interacts with the typical ability to start watching almost instantly, with no visible buffering delay, though.)

For TV, last I worked on a system like this the clients received data the same way as non-live streams: Http streaming (HLS or Dash), where you fetch playlists and small video files and the player stitches them all together. There's buffering along the pipe, the 30-60s total delay (which you'll notice if you watch sports and chat with someone who has cable and is watching the same thing) is a cumulative thing, so you don't see a 1-min startup delay, you just near-instantly get dropped into something that's already quite a bit behind.

Not sure what Twitch does. The over-the-network video game streaming-console services are obviously completely different from TV land, they couldn't get away with it there; but for TV the expense of better isn't seen worth it.

ekimekim · 10 months ago
Twitch is HLS, but they've tightened the buffers and shortened the segments (2s is standard) so that latencies of down to a couple of seconds is common. It's quite impressive, tbh.
ekimekim commented on Tail Call Recursion in Java with ASM (2023)   unlinkedlist.org/2023/03/... · Posted by u/hyperbrainer
fsckboy · a year ago
the "lambda the ultimate" papers and the birth of scheme was a loong time ago, so it grates on my ears to hear this topic presented as "an optimization". Yes, it is sometimes an optimization a compiler can make, but the idea is much better presented as a useful semantic of a language.

in the same way that passing parameters to a subfunction "creates" a special set of local variables for the subfunction, the tail recursion semantic updates this set of local variables in an especially clean way for loop semantics, allowing "simultaneous assignment" from old values to new ones.

(yes, it would be confusing with side effected C/C++ operators like ++ because then you'd need to know order of evaluation or know not to do that, but those are already issues in those languages quite apart from tail recursion)

because it's the way I learned it, I tend to call the semantic "tail recursion" and the optimization "tail call elimination", but since other people don't do the same it's somewhat pointless; but I do like to crusade for awareness of the semantic beyond the optimization. If it's an optimization, you can't rely on it because you could blow the stack on large loops. If it's a semantic, you can rely on it.

(the semantic is not entirely "clean" either. it's a bit of a subtle point that you need to return straightaway the return value of the tail call or it's not a tail call. fibonacci is the sum of the current with the next so it's not a tail call unless you somewhat carefully arrange the values you pass/keep around. also worth pointing out that all "tail calls" are up for consideration, not just recursive ones)

ekimekim · a year ago
In a weird way it kinda reminds me of `exec` in sh (which replaces the current process instead of creating a child process). Practically, there's little difference between these two scripts:

    #!/bin/sh
    foo
    bar
vs

    #!/bin/sh
    foo
    exec bar
And you could perhaps imagine a shell that does "tail process elimination" to automatically perform the latter when you write the former.

But the distinction can be important due to a variety of side effects and if you could only achieve it through carefully following a pattern that the shell might or might not recognize, that would be very limiting.

ekimekim commented on First Orbital Rocket Launched from European Soil, Rocket Crashes, but It's Cool [video]   youtube.com/watch?v=eFyMA... · Posted by u/consumer451
0_____0 · a year ago
ESA has had loads of orbital launches. Arianespace is a French company and the world's first commercial space launch co. Not sure it's reasonable to discount EU as stagnated.

There are few places in EU that make sense to launch from - the ideal launch site is from the equator, from land, with an empty ocean to the East to launch over. Look at the EU geographically and you can see why the European launches would chose a non EU site.

Now with the US and Russia both becoming poor candidates geopolitically, I suppose it makes sense to explore local options, even if they're less efficient/safe/convenient.

ekimekim · a year ago
I'm surprised they don't see more activity for polar orbits. You want to launch north-west or south-west and into ocean, northern scandanavia seems perfect for that.
ekimekim commented on Breaking Up with On-Call   reflector.dev/articles/br... · Posted by u/0xlosh
WhyIsItAlwaysHN · a year ago
So it takes 10 min until you've gone to the drastic solution? With this time-frame it would be risky to go the bathroom, not go to a movie. Also even the backup sounds like a primary in this scenario.
ekimekim · a year ago
Sure, but the assumption here is that primary and backup (edit: probably, ie. they're not coordinating this) aren't going to the bathroom at the same time. It's also based on the idea that alerts are extremely rare to begin with. If you're expecting at least one page every rotation, that's way, way too often. Step one is to get alerts under control, step two is a sane on-call rotation.
ekimekim commented on Breaking Up with On-Call   reflector.dev/articles/br... · Posted by u/0xlosh
dakiol · a year ago
For me the worst thing about being on-call is not the actual work outside business hours (it’s usually not much), but the potential work: if something happens I need to jump into my laptop within X minutes (changes from company to company, but it’s usually within 10 minutes). This means: I cannot go for a run, I cannot go to the movies, I cannot go for a dinner with family, I cannot even go shopping (shopping mall is further than a 10 min. trip). Basically, all I can do is stay at home and be available. It sucks, and the money is not worth it.
ekimekim · a year ago
When I'm in charge of an on-call rotation I always try to make it very clear that this is not the expectation.

In my preferred model of on-call, you have a primary, then after 5min an escalation to secondary, then after 5min an escalation to something drastic (sometimes "everyone", sometimes a manager).

The expectation is that most of the time you should be able to respond within 5 minutes, but if you can't then that's what the secondary role is for - to catch you. This means it's perfectly acceptable to go for a run, go to a movie, etc.

You relax the responsibility on the individual and let a sensible amount of redundancy solve the problem instead. Everyone is less stressed, and sure you get the occasional 5min delay in response but I'm willing to bet that the overall MTTR is lower since people are well rested and happier to be on call to begin with.

ekimekim commented on Resistance to Rust abstractions for DMA mapping   lwn.net/SubscriberLink/10... · Posted by u/mustache_kimono
flohofwoe · a year ago
I wonder why that C file which maps a more abstract Rust-friendly C-API on top of the existing API can't live inside the Rust directory and build structure. If I would be one of the Rust maintainers, I would try to be as non-intrusive to the established project structure as possible, ideally completely invisible. It's also cleaner to keep all the Rust-related changes on the 'Rust side' of the project, even if they happen to be written in C (I'm also still wondering why Rust-for-Linux cannot live completely downstream in a temporary fork).

I also can fully understand that a C programmer doesn't want to deal with such a 'Rust idiomatic' C API.

ekimekim · a year ago
> I wonder why that C file which maps a more abstract Rust-friendly C-API on top of the existing API can't live inside the Rust directory and build structure

This is more or less what the RfL folks are asking for - they have a Rust API to be used by other Rust code, which uses the existing C API, and are promising to maintain that API themselves. It lives in the Rust "directory".

The C maintainer is rejecting this, seemingly because his goal isn't to find a compromise that works but to completely block the project.

u/ekimekim

KarmaCake day2335November 9, 2012
About
Programmer, gamer, chaser of random interests. github: https://github.com/ekimekim
View Original