Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Merovius
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
1.
▲
by
Merovius
3mo ago
> Using conventional commits gives you a framework and mechanism that undoubtedly improves contribution semantics. I do not want to contribute to a project using conventional commits. I have consistently found, that I am unable to decide
2.
▲
by
Merovius
4mo ago
When I said "you need a runtime implementation of generics" I did not mean "you need dynamic dispatch". I meant "you need a type-checker and at least limited code generator at runtime". > Similar to what jav
3.
▲
by
Merovius
4mo ago
I'm not sure what you mean. Perhaps you are referring to the reflect package? In that case, yes, that exists. But it is limited in its power (for example, it doesn't allow to create types with methods – precisely because of the
4.
▲
by
Merovius
4mo ago
More specifically, it is because of interface type assertions – the fact that if you have a value of some interface type (e.g. `any`), you can dynamically assert that it is another interface type (e.g. `io.Reader`). A good example of that i
5.
▲
by
Merovius
4mo ago
FWIW I found, so far, that bringing up dyn-compatibility to Rust people was very useful in helping them understand why Go's interfaces won't ever have generic methods. The one additional piece of information you need is that in Go
6.
▲
by
Merovius
4mo ago
> but the reason against using runtime reflection is mostly that it's slow. More specifically, it is that it would introduce surprising performance cliffs – code becoming surprisingly slow due to seemingly unrelated changes. Thoug
7.
▲
by
Merovius
7mo ago
To be clear, I have no skin in the game here. I thought the point you made sounded plausible and as I have zero experience or expertise, I wouldn't argue against it. I just thought it's ridiculous - and kind of funny - to deny mak
8.
▲
by
Merovius
7mo ago
> perhaps less quippy Being quippy is the point. That's how aphorisms work: creating a short, pithy distillation of a complex argument, that you can then use pars pro toto to make a point. I certainly agree that POSWID is easily (an
9.
▲
by
Merovius
7mo ago
Wow that post is bad. The author clearly never actually attempted to understand what POSWID actually means and where it is coming from. Perhaps, instead of looking at Twitter, they should have opened Wikipedia. Or, better yet, Stafford Beer
10.
▲
by
Merovius
7mo ago
> There was no "drilling is good for the environment" narrative. … > Oil drilling actually made the water cleaner.
11.
▲
by
Merovius
7mo ago
> it's a known problem and civilization hasn't collapsed. Waiting for civilizational collapse to justify regulation seems like an unhelpful standard TBH. In fact, I would argue that it's one of the main problems we are hav
12.
▲
by
Merovius
7mo ago
If this happened to me, I would publish a blog post that starts "this is my official response:", followed by 10K words generated by a Markov Chain.
13.
▲
by
Merovius
10mo ago
Which, for the purposes of this topic, means a flat toll. Because we're talking (for the most part) about passenger cars.
14.
▲
by
Merovius
10mo ago
1. I'm not a driver, much less in a country with toll roads. But is it common to have per-vehicle customized toll prices? I would expect to pay a fixed per-car, per-use fee. 2. How is this dependent on privatization? Every car is regis
15.
▲
by
Merovius
10mo ago
> But, like, this is exactly as easy with every single other language that I can think of. I mean, not exactly . Rust (or rather Cargo) requires you to declare binaries in your Cargo.toml, for example. It also, AIUI, requires a specific
16.
▲
by
Merovius
1y ago
> Bluesky's architecture was pretty much dictated by the premise that anyone needs to be able to see any post on the entire system, regardless of whether they have any connections with the author. That algorithmic entertainment-styl
17.
▲
by
Merovius
1y ago
> You could, of course, sell or wind down your company, which would solve all problems outlined here. But this is not an option for most entrepreneurs. Yes, it is literally an option, you dunce. There is no law requiring you to keep owne
18.
▲
by
Merovius
1y ago
Uhm correct me if I'm wrong, but… you can sell your stake and leave at will, with zero exit tax? So really, the only thing that the exit tax prevents is the company leaving the country. And you know, every time someone brings up taxi
19.
▲
by
Merovius
1y ago
> AI is really good at generating repetitive patterns, like plain types, or code that implements a certain interface. If you reduce the cost of creating the verbose code [at write time] we can all enjoy the benefit of reduced complexity
20.
▲
by
Merovius
1y ago
> Minor nitpick: It isn't all that difficult to come up with type structural/generic edge cases for ANY language compiler where compilation takes forever and times out in a playground. Here is a small program of ~100 lines leve
21.
▲
by
Merovius
1y ago
> There are common solutions for the library issue. Authors of libraries for example can force instantiations for a dummy type that checks their concepts. But that just ensures that the code type-checks for `Dummy`. It doesn't ensur
22.
▲
by
Merovius
1y ago
Just to clarify why this is a problem: it’s possible for foo and bar to be defined in different libraries maintained by different people. Potentially several layers deep. And the author of the foo library tests their code and it compiles an
23.
▲
by
Merovius
1y ago
> You need to have something that uses those templates. Exactly. That is what I said: > because you need to know the actual type arguments used, regardless of what the constraints might say. It is because type-checking concept code is
24.
▲
by
Merovius
1y ago
It seems fairly clear to me, that it is preferable to import `rsc.io/omap` over having to implement a self-balancing binary search tree?
25.
▲
by
Merovius
1y ago
As I said in the other comment, I'm not a C++ user, so I'm relying on cargo-culting and copy-paste. But I think gcc disagrees - otherwise this would not compile, as line 14 is provably invalid: https://godbolt.org/
26.
▲
by
Merovius
1y ago
https://chromewebstore.google.com/detail/go-docs-syntax-high...
27.
▲
by
Merovius
1y ago
> C++ templates are duck typed at compile time. "Compile time" is not the right distinction. This is about "instantiation time". Go's implementation specifically allows to type-check the body and the call separat
28.
▲
by
Merovius
1y ago
> Maybe when you have code that works with the `interface{}` a lot (e.g. unknown JSON data) you'll have a use case for it. I think in those cases, generics are specifically kind of pointless. Because you will inherently need to use
29.
▲
by
Merovius
1y ago
I don't disagree that Go's generics are pretty limited. But I find it a strange complaint, when contrasted with C++ templates. Which, as I understand, are literally not part of the type system and thus there seems to be a far stro
30.
▲
by
Merovius
1y ago
In practice, currently, that depends on inlining decisions. If the function taking the function (say `node.insert`) is inlined, then yes. There are also other optimizations, like escape analysis, that matter here: the compiler can prove tha
More ›