Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
pka
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
8 ms
·
31.
▲
A Critique of Impure Reason (2009)
(blog.higher-order.com)
1 points
by
pka
8y ago
|
0 comments
32.
▲
by
pka
8y ago
> OO is not about state OO is very much about state, and that's the fundamental difference between non-FP languages and FP. a1 = object.f(b); a2 = object.f(b); If a1 != a2 or f performs any side effects at all you'
33.
▲
by
pka
8y ago
You try to parse the received data into a predefined data type, if this fails you are forced by the type system to handle the failure scenario, if it parses correctly you now have a 100% valid data structure you can work with in the rest of
34.
▲
by
pka
8y ago
Did you read the whole thing? This is exactly the point the author is trying to make. Look, you both arrive at the same conclusion even: > Or you change the game and just use PureScript. Or ReasonML, or Elm, or even ClojureScript. >
35.
▲
by
pka
8y ago
Two obvious differences off the top of my head: 1. Overriden methods have access to the internal state of the parent class, which is almost universally a bad idea. 2. Since functions are values, you can freely mix and match different view c
36.
▲
by
pka
8y ago
> OOP is good for domains that naturally give rise to a clearcut inheritance structure, such as stateful GUI frameworks React begs to differ. > or ontologies that directly mirror real-world objects. Such as?
37.
▲
by
pka
8y ago
Use higher order functions to customise behaviour. I.e. your hypothetical NSTableView would look like this: nsTableView :: { renderCell :: a -> NSView -- this is the function that renders a cell given an `a` , header
38.
▲
by
pka
8y ago
Most, if not all, functional languages support pattern matching: Haskell, OCaml, Clojure, Erlang/Elixir, Purescript, Idris, Elm, etc.
39.
▲
by
pka
8y ago
> Do you think the tool you use to achieve a task doesn’t matter? I think many people do think that, with a twist; specifically, when presented with a higher level language they'd argue "it's just a tool", while a low
40.
▲
by
pka
8y ago
I'm not sure you could cover up a data breach that easily. Those data dumps are going to be sold on the black market eventually, and I speculate that in many cases government agencies will be able to identify unannounced breaches. Sl
41.
▲
by
pka
8y ago
> Nothing can explain "everything". I'm not saying I argue for the opposite, but that is very definitive statement in need of a very strong argument to be taken seriously. > What does that even mean? Things that we do
42.
▲
by
pka
8y ago
> I think this comes down to low ceremony vs high ceremony One of the most cited qualities of languages like Haskell are their "refactorability" - i.e. one can routinely rip out the guts of a 100KLOC codebase and replace fundam
43.
▲
by
pka
8y ago
I don't think that's a very controversial point of view. Emergent behavior is all around us - ant colonies, neural networks, and yes, biological organisms. Whether emergence can explain everything is another matter though, and I
44.
▲
by
pka
8y ago
> I was part of a SaaS startup using Java Spring You may accuse me of shifting the goalposts, but do notice I said modern above. I'm not up-to-date with Java anymore, but iirc Play [0] would be worth checking out. > This is a p
45.
▲
by
pka
8y ago
> A year and a half of how much effort? > The project originally began with 1 full-time engineer and a small army of volunteers. We grew that team to 4 full-time engineers plus the volunteers. They had four full-time people working
46.
▲
by
pka
8y ago
If you're talking about CRUD boilerplate apps, literally any modern web framework in a static language. Again, even if "rapid prototyping" was a thing in Rails (i.e. rapid as opposed to what?) you start paying back the pric
47.
▲
by
pka
8y ago
It is a massive failure, and it would be solved by static types. I could take a big, unmaintained 10 years old Haskell codebase and upgrade it to the newest compiler and libraries in a couple of days, at most (and it would most likely w
48.
▲
by
pka
8y ago
> that is more productive than Rails So, spending a year and a half on a major version upgrade of your web framework is "productive" how exactly? I mean, whatever time you think you've saved by using Rails during the ini
49.
▲
by
pka
8y ago
This is already possible to a degree within existing type systems - here’s a small experiment tracking execution time of list comprehensions on the type level in Purescript [0]. [0] https://twitter.com/pkamenarsky/stat
50.
▲
by
pka
8y ago
Doubting your competence is not a personal attack/ad hominem, so don’t try to twist my words.
51.
▲
by
pka
8y ago
I agree, but it’s the best you can get if for some reason you’re stuck with Clojure.
52.
▲
by
pka
8y ago
For Clojure, check out Ghostwheel [1] - a lightweight DSL for writing specs. If you want proper static typing though, ReasonML might be a good choice. Static, compiles to js and native, super easy to learn, and there’s an experimental Lis
53.
▲
by
pka
8y ago
> And this is the most hilarious aspect of Haskell community. You assume that the only reason people might not like the approach is due to their sheer ignorance of the wonders of the type system. No, I don’t, and when I happen upon someb
54.
▲
by
pka
8y ago
> I'm also not sure what you're judging my competence in it on exactly as you've likely never seen a single line of code that I've written in it. And I don’t need to. I (and anyone proficient in Haskell, really) can i
55.
▲
by
pka
8y ago
> You've already conceded that your solution is not appropriate for production I’ve done no such thing. > You can't even acknowledge that your preferred approach to dealing with side effects has any drawbacks to it. It does,
56.
▲
by
pka
8y ago
> However, my experience is that if you question the effectiveness of static typing, or ask for evidence in support of the claimed benefits you'll get a very hostile reaction. That's an interesting thing to say, seeing how repr
57.
▲
by
pka
8y ago
Well yeah, because a logging statement in production can fail (i.e. network connection drops). The type system forces you to deal with that fact instead of letting you write code that e.g. brings down your server unexpectedly because of som
58.
▲
by
pka
8y ago
http://hackage.haskell.org/package/base-4.11.1.0/docs/Debug-... For future reference, this isn’t a good argument for trolling Haskellers.
59.
▲
by
pka
8y ago
> Reading and understanding the Idris proof is actually more work than understanding the untyped Python version, therefore it's actually harder to say whether it's correct or not in a semantic sense. That was your original, n
60.
▲
by
pka
8y ago
> I can read through the 5 lines of Python code implementing insertion code, and be reasonably sure that it's correct. Binary search is possibly one of the simplest and most basic CS algorithms, and yet, it took people who were &quo
More ›