Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
tubthumper8
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
11 ms
·
31.
▲
by
tubthumper8
2y ago
Untagged unions lack the ability to model "the success value is a string and the error is a string", right?
32.
▲
by
tubthumper8
2y ago
Can you provide an example?
33.
▲
by
tubthumper8
2y ago
In Rust, there's a `#[must_use]` attribute that can be applied to types, such as Result, and on functions. This triggers if the return value is not used. It's only a warning though, but you could imagine a hypothetical imperative
34.
▲
by
tubthumper8
2y ago
~~I can't tell if you're being sarcastic, but that's exactly what TFA does. But just to pull it out explicitly:~~ Edit: I think I misunderstood your point. You were asking for a similar kind of list as TFA from the other comm
35.
▲
by
tubthumper8
2y ago
Genuinely curious for all these follow up questions: Is immutability exclusive to functional programming? Is the ability to use data/values exclusive to functional programming? Are monads exclusive to functional programming? For discus
36.
▲
by
tubthumper8
2y ago
Hmm, I'm not sure about that interpretation, they said "It’s technically the same type from two perspectives." It's not the same type at all. I do agree with your example of the usage of those words in spoken English, bu
37.
▲
by
tubthumper8
2y ago
I don't think this is right, for two reasons: 1. As a nit-pick "unconstrained object" is not best modeled by `unknown` because that includes non-objects as well, there's better types to use for that 2. Someone asking you
38.
▲
by
tubthumper8
2y ago
I think they just mean that sum types are defined by the programmer using the `enum` keyword
39.
▲
by
tubthumper8
2y ago
It is a subset as of JavaScript edition ES2019, when JavaScript strings are now allowed to contain U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR. Prior to ES2019, that was the only known example of legal JSON that was not legal JavaS
40.
▲
by
tubthumper8
2y ago
> deriving a parser for it somehow Serde in Rust does this with the Rust macro system, but TypeScript doesn't have a macro system. That's why people have to go the other way, the programmer defines the parser, then TypeScript c
41.
▲
by
tubthumper8
2y ago
Obviously in the function name! void vendorReturnsDataInInvalidFormatAndButShouldBeResolvedByVendorOpenTicketXYZ_123ExpectedResolutionQ42024(String input) {} /s
42.
▲
by
tubthumper8
2y ago
Cfront being around 1983 would mean at least ALGOL68 and Pascal would've been well-known at the time. Ada is cited as an influence on C++. ML languages were definitely not mainstream but if Wikipedia is to be believed, ML was an influe
43.
▲
by
tubthumper8
2y ago
I don't think tag is an implementation detail generally, for example: enum Option<T> { None, Some(T), } The tags are "None" and "Some" which are definitely user facing. But I see w
44.
▲
by
tubthumper8
2y ago
Can anyone explain why this is called "type unions"? I've never heard it named that before. It's a bit weird, because it's not a union across types (like ALGOL68), it appears to be a tagged union like in ML-family l
45.
▲
by
tubthumper8
2y ago
The "and_then" that they mentioned is the flatmap
46.
▲
by
tubthumper8
2y ago
I think it's not so much about interpreted vs. compiled but more about the delivery of client code to the user - every time any user visits any website the browser may have to download the code (if not cached), then parse it, then exec
47.
▲
by
tubthumper8
2y ago
Links for those (like me) who didn't recognize the acronyms: CBOR - RFC 8949 Concise Binary Object Representation https://www.rfc-editor.org/rfc/rfc8949.html CDDL - RFC 8610 Concise Data Definition Language (CDDL)
48.
▲
by
tubthumper8
2y ago
Resizing the browser is a legitimate use case. I snap browser windows to the left/right on a laptop all the time to be able to look at two things at once
49.
▲
by
tubthumper8
2y ago
> Alphabet CEO Sundar Pichai was awarded compensation worth more than $225 million in 2022, which marked a staggering 3,474% increase from the previous year, making him the nation's highest-paid CEO, according to Equilar data. If I
50.
▲
by
tubthumper8
2y ago
Alphabet, Meta, Microsoft, Uber, Salesforce are some recent-ish examples https://abcnews.go.com/Business/ceos-pay-climbed-layoffs-tec...
51.
▲
by
tubthumper8
2y ago
Some languages do this already but with a designated placeholder, like filter(_.price < 10) That may not work because plain underscore is already a valid identifier but another placeholder could potentially be used and no need f
52.
▲
by
tubthumper8
2y ago
Oh I agree on those but it seemed the person I was replying to was primarily interested in developer experience (tooling, documentation, etc.), not language features. So I was curious about what was missing from the Go developer experience
53.
▲
by
tubthumper8
2y ago
Yeah, and the common/un-comment workflow isn't just for debugging but also for trying new things out to see what works. You're right that judging on the engagement of this post and others in the past there must be a big appet
54.
▲
by
tubthumper8
2y ago
> I've said for a while that a language that focused on this sort of "developer experience" but used a GC to be a bit more flexible would probably be enough for a large portion of Rust developers Why then would Go not fit?
55.
▲
by
tubthumper8
2y ago
Integer 0 means empty with respect to a particular operation (addition) but is not empty with respect to all operations (ex. multiplication)
56.
▲
by
tubthumper8
2y ago
Which you can't do in C# either without sum types :)
57.
▲
by
tubthumper8
2y ago
In a non-lazily evaluated language (i.e. most languages not named Haskell) it would have to be done by passing in functions ("thunks")
58.
▲
by
tubthumper8
3y ago
> you can still think of an entity as "inheriting from" the various components its built from. If it's based on components, wouldn't that mean you would think of it as being... _composed_? I typically don't hear
59.
▲
by
tubthumper8
3y ago
Which kind of polymorphism? Subtype polymorphism I'm guessing?
60.
▲
by
tubthumper8
3y ago
Interesting articles! I think the first part of the first article immediately introduces an anti-pattern - forcing the user to make an instance of a class just to be able to call a pure function. It's just unnecessary noise, either mak
More ›