Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
tubthumper8
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
1.
▲
by
tubthumper8
10mo ago
What do you mean by "failing tests", are you talking about runtime code? TypeScript erases all types at compile so these wouldn't affect tests. Unless you meant "compile errors" instead. I've noticed LLMs just
2.
▲
by
tubthumper8
11mo ago
Who said that anyone is absolved of the responsibility to write tests for business logic when using Rust? I struggle to see anything in the comment you replied to that is anywhere close to claiming this
3.
▲
by
tubthumper8
1y ago
Not sure what you mean here by "most JavaScript parser rejects null" - did you mean "JSON parsers"? And why would they reject null, which is a valid JSON value? It's more that when building an API that adheres to a
4.
▲
by
tubthumper8
1y ago
Inline breakpoint, the same way you set a breakpoint on an expression in any language
5.
▲
by
tubthumper8
1y ago
The "Error Return Trace" described in the next section down also seems like an interesting alternative to a stack trace, possibly solving the same problem with less noise. How well does it work in practice?
6.
▲
by
tubthumper8
1y ago
I've read elsewhere that one idea for the zero value of sum types is not making it nillable, but rather making the zero value as the 0th variant of the sum type (and if it has associated data, the zero value of that as well). It's
7.
▲
by
tubthumper8
1y ago
This post from the React team has more detail on that topic: https://overreacted.io/algebraic-effects-for-the-rest-of-us/
8.
▲
by
tubthumper8
1y ago
Can you expand more on the Gang of Four comment? Which separation does GoF describe that is applicable in this context? And what is the definition of a "concern"?
9.
▲
by
tubthumper8
1y ago
Can you do it for functions defined by other people, or only for functions that you defined? I'm thinking in the general case, but motivated by this example of a 3rd party function that accepts a SQL query as a string, and we'd li
10.
▲
by
tubthumper8
1y ago
Do the python type checkers / linters / whatever have the ability to warn or error on calling certain functions? That would be nice to eventually enforce migration over to the newer functions that only take a t-string template
11.
▲
by
tubthumper8
2y ago
"pit of success" from the previous comment might refer to this video, which is long but good especially to adjust to a different mindset https://youtu.be/US8QG9I1XW0?si=N07ZsYSYfA12mGVc
12.
▲
by
tubthumper8
2y ago
>that's what discriminated unions (aka product types aka algebraic data types) Just an FYI, discriminated unions are not product types, they are sum types. It's named so because the total number of possibilities is the sum of t
13.
▲
by
tubthumper8
2y ago
There's also going to be quite a big ecosystem / standard library difference between languages that had fundamental type system features since the beginning vs. languages that added fundamental features 23 years later. Imagine all
14.
▲
by
tubthumper8
2y ago
> But that is unnecessary in Go as it believes that values should always be useful – which means you don't need to even consider the error to use the value. Is this true? Are values always useful? You shouldn't even need to con
15.
▲
by
tubthumper8
2y ago
> You can do something like this Do people actually do this? Is it included in the standard library? If not, should it be?
16.
▲
by
tubthumper8
2y ago
It's not just syntax, a sum type forces checking for the error whereas a product type does not, so it's a semantic distinction too
17.
▲
by
tubthumper8
2y ago
That _shouldn't_ be ambiguous, `false` is a valid JSON document according to specification, but not all parsers are compliant. There's some interesting examples of ambiguities here: https://seriot.ch/projects/
18.
▲
by
tubthumper8
2y ago
Yeah, that's one of the core problems, there's no overloading of equals in JS and no other cases of objects using non-reference equality. Adding that in itself would be a big deal (ex. see the Records and Tuples proposal which has
19.
▲
by
tubthumper8
2y ago
> I understand you have an advertising quota to fill This is a ridiculous statement and you are intentionally engaging in bad faith. There's no need for this in response to people genuinely trying to answer your questions. Be better
20.
▲
by
tubthumper8
2y ago
Sorry to have disappointed you. I don't walk, talk, or sleep either Rust or Go, but was trying to provide some resources to help in case you hadn't seen them yet. One difference I noticed in the docs is in the Go Reference it says
21.
▲
by
tubthumper8
2y ago
The documentation is probably the best resource to start with the concept and how it works / what the goals are: https://doc.rust-lang.org/edition-guide/editions/index.html For example, https://doc
22.
▲
by
tubthumper8
2y ago
That's exactly what what they're talking about, "tenantId" shouldn't be in the function signature for functions that aren't concerned with the tenant ID, such as business logic
23.
▲
by
tubthumper8
2y ago
Yeah, and that comic is about standards anyways, not tools, so it's doubly annoying when it's linked out of context
24.
▲
by
tubthumper8
2y ago
Right, but what happens if the Assert isn't true? Does the program crash/abort? If so, is there a stack trace or how do you troubleshoot it?
25.
▲
by
tubthumper8
2y ago
What happens when the predicate returns false for the refinement type? Like if `(Nat 5) - (Nat 6)`. Or is subtraction disallowed?
26.
▲
by
tubthumper8
2y ago
Adding on, I find that the people who manually navigate everywhere rather than using the IDE navigation features also don't use IDE refactoring features. When people say "just organize your code well", this isn't somethi
27.
▲
by
tubthumper8
2y ago
If complex situations arise, they can slap `any` on it, at least it would be explicit, and marker to revisit in the future. Is there really that much legwork otherwise? Adding ": string" to a function parameter assumes they know w
28.
▲
by
tubthumper8
2y ago
Yep, I'm aware. The question you asked was about the Go language designers ignoring the fundamentals, which is the root cause of this situation today where fundamentals can't be bolted on to the language later
29.
▲
by
tubthumper8
2y ago
"Ignoring" is the charitable framing of this. Sum types and product types are fundamental to a type system, the same way that addition and multiplication are fundamental to arithmetic. You wouldn't design a language with on
30.
▲
by
tubthumper8
2y ago
Just a clarification (that doesn't really change the point), he was in his early fifties when Go was first released
More ›