Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Twisol
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
47 ms
·
451.
▲
by
Twisol
5y ago
I do think familiarity plays a big role. I find the Haskell syntax much more pleasant than Java, even though I'm perfectly familiar with both. The equivalent signature in Java (if we could abstract over type functions) would be:
452.
▲
by
Twisol
5y ago
> `a -> b -> f a -> f b` (a -> b) -> F a -> F b; the parentheses are critical. I don't fully disagree with your point, but if you're going to emphasize rigor and definitions, it would be wise to make sure you&
453.
▲
by
Twisol
5y ago
You asked. I'm happy to dissect it to your level, but I don't know what you may be familiar with, and if you're not comfortable with type functions, I'm going to have a hard time motivating the extra bits a functor has.
454.
▲
by
Twisol
5y ago
To expand on this, because it's actually fascinating... Functors capture a particular pattern of "pipelining": a series of operations A -> B, B -> C, etc. can be uniformly assembled in the context of any arbitrary funct
455.
▲
by
Twisol
5y ago
In particular, a functor is a type constructor F together with a higher-order function deriving transformations `F T -> F S` given a transformation `T -> S`, subject to some semantic requirements. This is the `map` or `fmap` people re
456.
▲
by
Twisol
5y ago
> Wait, a functor is just a pure unary function? A functor has two pieces: a pure unary function from types to types, and a pure unary function from functions to functions. The article doesn't talk about the function on types; it do
457.
▲
by
Twisol
5y ago
To be fair, the C compiler also requires a C compiler. Bootstrapping is a common milestone in language development (Rust can bootstrap itself too), so while the current state of affairs for Zig might require a C compiler, that's not ne
458.
▲
by
Twisol
5y ago
For sure! Like I said, this is very similar to fork(), and you've basically called out why :) pid = fork(); if (pid != 0) { printf("parent!"); } else { printf("child!"); } /&#x
459.
▲
by
Twisol
5y ago
Certainly adding call/cc doesn't allow you to represent more computable functions by programs. But there are plenty of internal features of programs that we're interested in, that let us meaningfully distinguish amongst pro
460.
▲
by
Twisol
5y ago
There are two important ideas to pick up here, I think. First, functional programming prefers a reduction-based model of computation: the whole program text represents the current state of the program, and a "step" of computation
461.
▲
by
Twisol
5y ago
Thanks for the nomenclature! That definitely helps find more discussion around the two preferences, like [0]. (FWIW, I'm aware of the semantic differences; I've just never come across that much material referencing it, much less a
462.
▲
by
Twisol
5y ago
...Is the question corpus randomized? Why is nobody talking about this completely incomprehensible grapefruit question? > Bob experiences numerous positive things when surrounded by a grapefruit. He wins a little money at the lottery, li
463.
▲
by
Twisol
5y ago
Hey, you write `const` on the right too! There must be, like, dozens of us! Is there a style guide recommending this, or have I just managed to dodge every example that puts it on the right?
464.
▲
by
Twisol
5y ago
> It sounds like you're thinking of virtual memory (i.e. pages of memory either being in RAM or on disk). I think I mostly just used the wrong term (page instead of line) -- I'm on board with the distinction you're drawing
465.
▲
by
Twisol
5y ago
Recognizing your username, I'd probably best not argue, but wouldn't iterating across (say) two component arrays only cost you two pages in the cache at any given time, since you're doing a sequential scan? You should have th
466.
▲
by
Twisol
5y ago
Mutual single recursion is still a loop; you just pick where you want to cut the cyclic dependencies to return to the top. In the worst case, you can put a `switch` in the loop and track what state you're in, although that's gross
467.
▲
by
Twisol
5y ago
For completeness, what was your solution? I promise not to judge it if you don't want me to :) but it seems like it would be a valuable discussion for others who might be on the fence. My solution (from another conversation on this ver
468.
▲
by
Twisol
5y ago
I suspect you think about recursion in terms of a call stack, yes? So when you have tail recursion, you're still pushing a frame onto the stack by default, unless the compiler recognizes that it can optimize that way. Yes? The tradit
469.
▲
by
Twisol
5y ago
> At some point though things get so abstract it's really difficult to understand what's going on. A lot of that comes down to extremely advanced use of Haskell's type system. Advanced type systems are valuable, and they&#
470.
▲
by
Twisol
5y ago
You might like "How to Design Programs": http://htdp.org/ It appears to exclusively work with the usual FP understanding of computation as reduction (simplification of an expression), avoiding all named mutable
471.
▲
by
Twisol
5y ago
You might be interested to read Hillel Wayne's crossover project, where he interviewed a number of people who had worked in traditional engineering roles as well as in software development. https://www.hillelwayne.com/p
472.
▲
by
Twisol
5y ago
Isn't that the Grudger strategy that's introduced early on?
473.
▲
by
Twisol
5y ago
My understanding is that `static` makes a symbol local to a translation unit, making it invisible to the linker.
474.
▲
by
Twisol
5y ago
Three of them, in fact! The series is called "Orthogonal": http://www.gregegan.net/ORTHOGONAL/ORTHOGONAL.html
475.
▲
by
Twisol
5y ago
> A quarter is made up of a bunch of hours. And a sandpile is made up of a bunch of grains of sand. [0] It's identically disingenuous to suggest that such a difference in quantity does not manifest a difference in quality. I don&#
476.
▲
by
Twisol
5y ago
If you allow yourself the infinite set of the natural numbers, you can pretty easily get an infinite set of sets. For instance, for every natural N, take the set of naturals less than N. Or greater than N, if you'd like an infinite set
477.
▲
by
Twisol
5y ago
> This is an example of survivorship bias. How many ambitious game concepts have collapsed under performance/architecture issues that lead to productivity-killing refactoring? Impossible to say, but no doubt many. I'm reminded
478.
▲
by
Twisol
5y ago
If [commit] is the merge commit for the feature, then this should work: git show [commit]^1..[commit] The ^1 incantation means "first parent", so in the feature branch style I'm describing, this would show the change
479.
▲
by
Twisol
5y ago
I think the scenario you've described assumes that the branches have diverged -- that each branch has a commit not on the other. But if you always rebase your branch onto `develop` before merging, your branch definitively has no confli
480.
▲
by
Twisol
5y ago
I agree with you on the linked article ^_^ but it does at least do a good job of showing how the concerns of state still exist in the absence of mutable data.
More ›