Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
hutao
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
1.
▲
by
hutao
4mo ago
First of all, nice post! I can tell that you put deliberate effort into using a concrete example, introducing a problem and then building up to how to solve it. However, the continuation monad has limitations. In your example, it serves a s
2.
▲
by
hutao
4mo ago
I've always felt that ML hit the sweet spot between functional and imperative programming. It affords conveniences such as algebraic data types and first-class functions, but unlike Haskell, it doesn't require monadic programming
3.
▲
by
hutao
6mo ago
This is the gist of Andrej Bauer's paper: - An algebraic theory consists of a "signature" (specifying a set of operation symbols with their arities) and a set of equations about those operations. An algebraic theory is purely
4.
▲
by
hutao
6mo ago
Here is an article by Andrej Bauer answering the exact question, "What is algebraic about algebraic effects and handlers?": https://arxiv.org/abs/1807.05923v2 Contrary to the claim from the comment you are re
5.
▲
by
hutao
6mo ago
I'm curious about the other Stack Exchange sites. Have they seen the same decline as Stack Overflow? Stack Overflow was the "flagship" product of the Stack Exchange company, and if the company pivots to AI, I wonder what the
6.
▲
by
hutao
6mo ago
I was not looking to disagree with your point, I only wanted to make additional commentary. Sorry if my comment came across the wrong way. I do think "There are no function colors in Go in the way being discussed," versus "al
7.
▲
by
hutao
6mo ago
Go (and other language with threads) implicitly run inside the "async IO monad." In the function color analogy, what this means is that all functions are red, and the "ordinary" function call corresponds to "await&q
8.
▲
by
hutao
6mo ago
> Propagating errors up the stack is not the same, because the top-level function is not developing an error return because of the 10-level-nested function. It is developing one because the function it called has one, and apparently, it
9.
▲
by
hutao
7mo ago
To clarify: ML started out as a scripting language for Robin Milner's proof assistant, LCF. The formal system, or "logic," is implemented in a minimal, trusted kernel, and the proof data structure is protected as an abstract
10.
▲
by
hutao
8mo ago
One language that uses the tuple argument convention described in the article is Standard ML. In Standard ML, like OCaml and Haskell, all functions take exactly one argument. However, while OCaml and Haskell prefer to curry the arguments, S
11.
▲
by
hutao
8mo ago
This seems to be a plagiarized paraphrase of @le-mark's comment, which was posted one hour earlier: https://news.ycombinator.com/item?id=47424625 @dang I think the account that I'm replying to might be a bot?
12.
▲
by
hutao
8mo ago
One of the unwritten takeaways of this post is that async/await is a leaky abstraction. It's supposed to allow you to write non-blocking I/O as if it were blocking I/O, and make asynchronous code resemble synchronous cod
13.
▲
by
hutao
9mo ago
Note that addition also won't overflow if one addend is greater than half the range, but the other addend is still small enough (e.g. for the range -128 to 127, adding 65 + 12 will not overflow, even though 65 is greater than half of 1
14.
▲
by
hutao
9mo ago
The phrasing that I hear more often is "make illegal states unrepresentable"; both the submitted article and Alexis King's original article use this phrase. At least according to https://fsharpforfunandprofit.com&#
15.
▲
by
hutao
9mo ago
Note that the division-by-zero example used in this article is not the best example to demonstrate "Parse, Don't Validate," because it relies on encapsulation. The principle of "Parse, Don't Validate" is best e
16.
▲
by
hutao
9mo ago
> With Prop, I think what you need to dig into is ‘non-computational’ not ‘non-computable’. Here's another way to explain this: As you state, Prop has to do with proof-irrelevance. When doing constructive mathematics, proofs are pro
17.
▲
by
hutao
9mo ago
This is my point of view as someone who learned WebGPU as a precursor to learning Vulkan, and who is definitely not a graphics programming expert: My personal experience with WebGPU wasn't the best. One of my dislikes was pipelines, wh
18.
▲
by
hutao
9mo ago
Typed functional programming has the perspective that types are like propositions and their values are proofs of that proposition. For example, the product type A * B encodes logical conjunction, and having a pair with its first element of
19.
▲
by
hutao
9mo ago
A great way to understand monads is as a "design pattern," because they pop up extremely often in practical programming. Consider functions with a type signature that looks like `A -> T<B>`, such as `A -> Promise<B&
20.
▲
by
hutao
9mo ago
It's serendipitous that I'm seeing this blog post on the front page today, because I'm currently writing an article discussing the free monad. In addition to the free monad presented in this post, there is a variant, called t
21.
▲
by
hutao
9mo ago
Over the past few years, OCaml has seen an abundance of new language features and standard library additions. OCaml 4.08 added let-binding operators (syntactic sugar for continuation-passing style and monadic programming), OCaml 5 implement
22.
▲
by
hutao
10mo ago
This is the difference between functions and effect handlers, to my understanding: Functions map inputs to outputs, with a type signature that looks like A -> B. Functions may be composed, so if you have f: A -> B and g: B -> C, yo
23.
▲
by
hutao
10mo ago
You are right, in Haskell type constructors may be partially applied. In my opinion, this feature has less to do with any fundamental difference between `Either` in Haskell and `Result` in other languages, and more to do with Haskell's
24.
▲
by
hutao
10mo ago
I'd never heard of "resumable exceptions" before, so I searched them up [1][2]. Is this another name for the language feature called "effect handlers" in OCaml 5? [1] https://osa1.net/posts/2024
25.
▲
by
hutao
10mo ago
The `Either a b` type in Haskell is equivalent to the `Result<T, Error>` type in other languages. The only difference is in the naming: "Result" semantically implies error handling, while "Either" implies a more ge
26.
▲
by
hutao
10mo ago
One of the most thorough articles on error handling in programming language design that I've read is this one: https://joeduffyblog.com/2016/02/07/the-error-model/ . It was written by Joe Duffy, who
27.
▲
by
hutao
10mo ago
Today, we tend to see The Great Gatsby as a work of historical literature, as it gives a window into the Roaring Twenties. However, F. Scott Fitzgerald did not set out to depict the past; he was depicting his own present. Similarly, Proust&
28.
▲
by
hutao
10mo ago
> TypeScript’s type system is purely structural and exists only at compile time. It has no way to verify that your function actually implements what its signature claims. You can declare that a function transforms a User into a SafeUser,
29.
▲
by
hutao
1y ago
When I first tried to learn Vulkan, I felt the exact same way. As I was following the various Vulkan tutorials online, I felt that I was just copying the code, without understanding any of it and internalizing the concepts. So, I decided to