Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
sapiogram
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
91.
▲
by
sapiogram
1y ago
That's a weak correlation at best. What about when it's still weather in winter? It's not unusual at all.
92.
▲
by
sapiogram
1y ago
Fair, but that's a property of for loops. Variable in closures are still always captured by reference.
93.
▲
by
sapiogram
1y ago
No, that's a mistake in the article. The variable is still captured by reference, but `let` is causing it to be re-declared on every iteration of the loop, not mutated. The following code prints 1, 2, 3. It wouldn't do that if the
94.
▲
by
sapiogram
1y ago
Thanks for the links, that adds a lot of important context.
95.
▲
by
sapiogram
1y ago
I don't think it's fair to call Go and Javascript's behavior "implicit", they just always capture variables by reference. Rust variable capture is implicit though, but it can't cause the problems described in
96.
▲
by
sapiogram
1y ago
If you actually opened the article, I think you would find it interesting. I agree that a well-configured eslint catches 99% of the weirdness, but this article tries to be about the remaining 1%.
97.
▲
by
sapiogram
1y ago
The author's explanation seems perfectly correct to me. Where does he "misunderstand block scoping vs lexical scoping"? By the Wikipedia definition: > lexical scope is "the portion of source code in which a binding of
98.
▲
by
sapiogram
1y ago
> You never programmed in Go, I assume? You might want to step off that extremely high horse for a second, buddy. It's extremely reasonable to expect a type-safe pool that only holds a single type, since that's the most common
99.
▲
by
sapiogram
1y ago
Thank you so much for this comment. I think Russ Cox (along with many others) is way too quick to declare that removing one source of UB is worth a (purportedly) minuscule performance reduction. While I'm sure that's sometimes t
100.
▲
by
sapiogram
2y ago
> I'm not aware of any JS runtime outside a browser that supports concurrency (other than concurrently awaiting IO), so you can't do parallel compilation in a single process. You haven't looked very hard then, NodeJS has s
101.
▲
by
sapiogram
2y ago
So, a go enthusiast who does exclusively backend work? Seems likely enough, given that community's overall disdain for Javascript.
102.
▲
by
sapiogram
2y ago
They're not "definitely" an AI. Sounds like a normal Go enthusiast to me.
103.
▲
by
sapiogram
2y ago
> I mean, I can't think of a time a high profile project written in a lower level representation got ported to a higher level language. Software never gets rewritten in a higher level language, but software is constantly replaced
104.
▲
by
sapiogram
2y ago
Rust loses a lot of its nice properties without borrow checking and lifetimes, though. For example, resources no longer get cleaned up automatically, and the compiler no longer protects you against data races. Which in turn makes the entire
105.
▲
by
sapiogram
2y ago
It's definitely a tool that must be used carefully, and why informal rules like "features should be strictly additive" exist. I'd say they are very commonly used by large libraries, for example, here's the list of f
106.
▲
by
sapiogram
2y ago
> In practice you can't combine no_std and std within a single project anyway You can with Rust features. It allows a library to conditionally compile certain parts of the code, and users of the library can decide which features to
107.
▲
by
sapiogram
2y ago
In Rust it's literally impossible to use a returned value without checking the error. This bug also cannot happen with Java, C# or Javascript exceptions. This particular failure mode is unique to Go.
108.
▲
by
sapiogram
2y ago
errcheck will not catch everything. For example, it will not stop you from using a value before checking the error, as long as you check the error later. I've personally broken things in production because of that corner case, despite
109.
▲
by
sapiogram
2y ago
The go standard library also recovers from panics internally in some places, for example for gradient descent parsers.
110.
▲
by
sapiogram
2y ago
I don't think Jevon's Paradox applies here. People won't buy healthier food, they'll buy less food.
111.
▲
by
sapiogram
2y ago
> If Bob is floating in space in a capsule, and a very heavy asteroid floats past, the amount that Bob's capsule is moved is dependent on the speed of the asteroid? Yes > Does that sort of thing have to be considered when plannin
112.
▲
by
sapiogram
2y ago
No, the formula for the power of a black hole's Hawking Radiation is very straightforward, and it only depends on the black hole's mass.
113.
▲
by
sapiogram
2y ago
What if it passed through you at hyperbolic velocity (with respect to earth)?
114.
▲
by
sapiogram
2y ago
> and the cost to charge was $0.68/kWh. What in the world. In December, southern Norway had similar electricity prices for two hours , and caused enough of an uproar that the government is still trying to live it down.
115.
▲
by
sapiogram
2y ago
I think you need to specify what you mean by "without a runtime". Do you mean "without a garbage collector"? "Without memory allocation"? Even C has a runtime, just a very small one.
116.
▲
by
sapiogram
2y ago
`std::variant` is a clever piece of template hackery, but it doesn't come close to Rust enums. `std::variant` has no named variants, no pattern matching, no exhaustiveness checking. In Rust, it's not unusual to have an enum with d
117.
▲
by
sapiogram
2y ago
> Rust is a subset of C++ with extra static checks. While this may work as a rough heuristic, it's not true in theory nor in practice. First example that comes to mind: Rust has proper sum types (Called enums), which are used every
118.
▲
by
sapiogram
2y ago
Nothing about that implies re-writing legacy code.
119.
▲
by
sapiogram
2y ago
Because of what?
120.
▲
by
sapiogram
2y ago
Definitely agree. My theory is that Rob Pike was mentally stuck in the 90s, when C++ was still a common choice for non-performance-critical entreprise code.
More ›