Hacker Newsnew | past | comments | ask | show | jobs | submit | masklinn's commentslogin

It is relevant to all languages with static type checkers from idris to python. But of course since it is about expressing properties via the type system the more expressive that is the easier and more applicable.

Java has sum types, incidentally. And pattern matching.


Only if you ignore the billion cases where it doesn't work, such that half the standard library explodes if you try to use it with zero values because they make no sense[0], special mention to reflect.Value's

> Panic: call of reflect.Value.IsZero on zero Value

And the "cool" stuff like database/sql's plethora of Null* for every single type it can support. So you're not really avoiding "wrapping values in Option types", you're instead copy/pasting ad-hoc ones all over, and have to deal with zero values in places where they have no reason to be, forced upon you by the language.

And then of course it looks even worse because... not having universal default values doesn't preclude having opt-in default values. So when that's useful and sensible your type gets a default value, and when it's not it doesn't, and that avoids having to add a check in every single method so your code doesn't go off the rail when it encounters a nonsensical zero value.

[0] or even when you might think it does, like a nil Logger or Handler


That's exactly the problem. Thanks for describing! What I find is people using linters to ensure all struct fields are initialized explicitly (e.g. https://github.com/GaijinEntertainment/go-exhaustruct), which is uhh...

I think they're talking about cases when you can make the "zero" behave like an algebraic identity.

> it feels like sometime after Java got popular [...] a large chunk of the collective programming community forgot why strong static type checking was invented and are now having to rediscover this.

I think you have a very rose-tinted view of the past: while on the academic side static types were intended for proof on the industrial side it was for efficiency. C didn't get static types in order to prove your code was correct, and it's really not great at doing that, it got static types so you could account for memory and optimise it.

Java didn't help either, when every type has to be a separate file the cost of individual types is humongous, even more so when every field then needs two methods.

> In most strong statically typed languages, you wouldn't often pass strings and generic dictionaries around.

In most strong statically typed languages you would not, but in most statically typed codebases you would. Just look at the Windows interfaces. In fact while Simonyi's original "apps hungarian" had dim echoes of static types that got completely washed out in system, which was used widely in C++, which is already a statically typed language.


> I think you have a very rose-tinted view of the past

I think they also forgot the entire Perl era.


That's understandable. Youthful indiscretion is best forgotten.

I can still remember trying to deal with structured binary data in Perl, just because I didn't want to fiddle around with memory management in C. I'm not sure it was actually any less painful, and I ultimately abandoned that first attempt.

(Decades later, my "magnum opus" has been through multiple mental redesigns and unsatisfactory partial implementations. This time, for sure...)



The baseline is static: low QoS tasks are dispatched to the E cores, while high QoS tasks are dispatched to P cores. IIRC high QoS cores can migrate to the E cores if all P cores are loaded, but my understanding is that the lowest QoS tasks (background) never get promoted to P cores.

How is the QoS communicated to the scheduler? Is there a mark on the binary or does the code do it at thread startup?

The Apple software stack makes heavy use of thread pools via libdispatch. Individual work items are tagged with QoS, which influences which thread picks up the work item from the queue.

There's also priority inheritance (two different systems for it) so that requests originating from users/apps are more important.

Swift concurrency is more about structured concurrency than thread pools. A lot of other systems seem to use futures, which aren't good at priority inheritance.


It’s done in code.

> The sci-fi keywords are all specifically space-related.

Worse, half are confined to the solar system.


> science fiction titles have become more abstract and less literal over time.

Not even abstract, just not completely on the nose. Just as a lot if fantasy is not: only two discord novels would match the author’s search terms even though you’ll find all five inside the pages. None for Malazan. Or Nix’s old kingdom.

And worse, 40% of the sci-fi terms pretty only allow settings of “future solar system”. Not one of the Foundation books would match. Pretty much no classic sci-fi either. Wells’s fucking The War of the Worlds would not, because for some reason (of having any sort of taste) it was not titled “the day Mars invaded planet earth through space and then was beaten” like some lone star light novel.


Yep.

In that sense I think it's less an overall literary trends and more reflecting the pretty basic way of marketing pulpy stories to teens means putting "vampire" rather than "planet" in big letters in the title. Also, people still writing fantasy novels about alien civilizations aren't setting them on the moon or Mars any more, for reasons...


Not one of the culture books either, even though several have spaceships as main characters. And only a handful of Hamilton books. And I reckon a single Polity book.

I was disappoints to go into a large Waterstones in Peterborough last year and not see any Peter F Hamilton books.

It is true but meaningless. Derivative works are not illegal, and you don’t need authorisation to create one.

So if you draw sonic in your living room you are indeed creating an unauthorised derivative work. And someone can call it an unauthorised derivative work. And the only reaction that should induce is raising an eyebrow and replying “ok?”


I don’t believe there’s any country where derivative work is intrinsically illegal. The Berne convention considers them protected same as originals.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: