Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
tw25513397
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
3 ms
·
1.
▲
by
tw25513397
6y ago
Hey, thanks for replying! > But in a nutshell if something is pure it should support substitution. Neat, hadn't thought about it like that before. > If you substitute x into the body of y you get a different result! Heh, I guess
2.
▲
by
tw25513397
6y ago
> That always has to be true, no? Reading from a mutable datastructure is impure in the same way that reading from standard input is. If the function internally reads from stdin, I'd agree. But if a fn takes an input stream as an
3.
▲
by
tw25513397
6y ago
While it may be faster, the "by definition" part hasn't been true for years. The JVM can do some amazing stuff at runtime to outpace statically executed code. Regardless, their principles [1] make the trade-offs clear: - Deve
4.
▲
by
tw25513397
6y ago
It just struck me as odd for reads like `find` (which itself requires a pure fn arg). Is that because given the same reference , the function could yield different outputs? Or because it could be mutated concurrently? Would that imply eve
5.
▲
by
tw25513397
6y ago
Pure speculation on my part (since I couldn't find any details either): their "Closed world assumption" and "No reflection" principles [1] could mean the compiler can output radically different bytecode, e.g., elimi
6.
▲
by
tw25513397
6y ago
> Personally I find the inclusion of Datalog as a first-class citizen in an otherwise functional language to be a pretty powerful feature that I personally haven't really seen done before. It's neat, but IIUC, it needing to be
7.
▲
by
tw25513397
6y ago
Reading through the Design Principles [1]: > Separate pure and impure code So IIUC, the effect system [2] means impurity is contagious. This seems reasonable to me, though I wonder what that means in practice. `Console.printLine` is impu