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 slap on…
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
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…
Inline breakpoint, the same way you set a breakpoint on an expression in any language
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?
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…
This post from the React team has more detail on that topic: https://overreacted.io/algebraic-effects-for-the-rest-of-us/
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"?
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,…
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…
"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
>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…
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.…
> 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…
> You can do something like this Do people actually do this? Is it included in the standard library? If not, should it be?
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
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:…
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…
> 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…
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…
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,…
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
Yeah, and that comic is about standards anyways, not tools, so it's doubly annoying when it's linked out of context
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?
What happens when the predicate returns false for the refinement type? Like if `(Nat 5) - (Nat 6)`. Or is subtraction disallowed?
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 slap on…
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
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…
Inline breakpoint, the same way you set a breakpoint on an expression in any language
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?
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…
This post from the React team has more detail on that topic: https://overreacted.io/algebraic-effects-for-the-rest-of-us/
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"?
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,…
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…
"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
>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…
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.…
> 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…
> You can do something like this Do people actually do this? Is it included in the standard library? If not, should it be?
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
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:…
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…
> 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…
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…
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,…
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
Yeah, and that comic is about standards anyways, not tools, so it's doubly annoying when it's linked out of context
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?
What happens when the predicate returns false for the refinement type? Like if `(Nat 5) - (Nat 6)`. Or is subtraction disallowed?