News for hackers. Stuff that matters.
Re:God Writes Haskell by misja111 on Thursday September 07, 2023 @04:32AM (#37416212)
I would like to add that just like in our universe, in Haskell entropy only ever increases and never goes down. I.E., add more functionality to your program and the complexity will go up. This is true for all programming languages of course, but in my limited experience larger Haskell programs seem to become exponentially more complex.
Re:God Writes Haskell by quickthrower2 on Thursday September 07, 2023 @04:54AM (#37416353)
Item is not O(functionality) but O(category theory knowledge)
Re:God Writes Haskell by zadler on Thursday September 07, 2023 @05:09AM (#37416451)
More instances. More.
Re:God Writes Haskell by whateveracct on Thursday September 07, 2023 @08:49AM (#37418154)
The key is to not write large Haskell programs. Write many Haskell libraries and compose them. This scales infinitely and is an excellent way to build software. But it's also hard to do and takes good & deliberate technical leadership if you want to get 50+ engineers doing it.
Re:God Writes Haskell by kaba0 on Thursday September 07, 2023 @09:21AM (#37418530)
If you can reason about f and g that doesn’t mean that you can tell anything useful about f o g, so no, this is a factually incorrect statement. Sure, if we have a separate unit of functionality, write a function for that. But that’s no silver bullet - complexity is unbounded.
Re:God Writes Haskell by louthy on Thursday September 07, 2023 @10:01AM (#37419043)
That isn’t true. If f and g are pure then the composition holds the same guarantees as the component parts
Re:God Writes Haskell by woolion on Thursday September 07, 2023 @10:08AM (#37419119)
>If you can reason about f and g that doesn’t mean that you can tell anything useful about f o g

I'm confused. If you can reason about f and g, there is nothing more to know about f o g -- provided f and g are pure functions. The whole thing is about making sure side-effects are properly pushed at the boundaries so that you can keep working with pure functions. Haskell just provides more help (or more constraints) to ensure that you work with pure functions. Because if you aren't, all bets are off, and indeed the case of f o g may be a haze.

Re:God Writes Haskell by kaba0 on Thursday September 07, 2023 @10:34AM (#37419494)

  f  :: Integer -> Boolean

  g f n = if (f n) then (g f (n+1)) else (is_it_reachable)
Will it ever terminate (or insert any other interesting property that you wish) with f = collatz?

I know this is the atomic bomb case, but you can actually quite easily increase the complexity in realistic programs by just a few compositions, it doesn’t take much.

Re:God Writes Haskell by louthy on Thursday September 07, 2023 @10:50AM (#37419738)
Who said anything about termination? The original point was about composition. The guarantees of the component parts are the same as the composition. It's neither clear that f or g will terminate, and it's the same for f . g

If the halting problem is really your biggest concern when developing software then you're lucky!

Re:God Writes Haskell by kaba0 on Thursday September 07, 2023 @11:53AM (#37420830)
The Halting problem’s immediate consequence is Rice’s theorem, which is much more wide-reaching then termination.
Re:God Writes Haskell by Quekid5 on Thursday September 07, 2023 @03:52PM (#37424671)
... and entirely irrelevant when talking about function composition.
Re:God Writes Haskell by woolion on Thursday September 07, 2023 @11:41AM (#37420614)
Here you are defining a new function, not composing two functions.

But if you consider a program implementation of pure functions, this might not be true; for example f and g use a quantity of RAM, but the RAM used by f o g exceeds your computer RAM and thus explodes. Or, if we work with objects, some values (e.g. internal values of the object, or context values) may be changed that make the final result of f o g different from what you would normally expect.

The promise of working "functionally" is to avoid the second class of problems. For the first class this is just a problem of computer systems, but pure functions means that the memory should be able to be reclaimed efficiently. And for the limits of computability theory (like the halting problem), nothing works except oracle machines, but no startup has ever delivered a functional one!

Re:God Writes Haskell by sterlind on Friday September 08, 2023 @02:59PM (#37437871)
Composing pure functions is equivalent to defining a new function, that's the idea behind the set of combinators being Turing-complete.
Re:God Writes Haskell by whateveracct on Thursday September 07, 2023 @12:57PM (#37421944)
> If you can reason about f and g that doesn’t mean that you can tell anything useful about f o g

What? The ability to reason about f o g (for various definitions of o) is the promise of Haskell and one of its entire ecosystem's foundational principles.

Local reasoning is absolutely possible.

Re:God Writes Haskell by cageface on Thursday September 07, 2023 @09:23AM (#37418554)
How is this different from any other programming language?
Re:God Writes Haskell by whateveracct on Thursday September 07, 2023 @12:59PM (#37421965)
Honestly, it isn't!

But Haskell technical leadership sometimes is either lacking/inexperienced or goes down the rabbit hole of overusing the compiler to prevent fuckups to the point where you're compiling way too much code and get into a coupling nightmare.

Re:God Writes Haskell by ohduran on Thursday September 07, 2023 @08:57AM (#37418242)
You could say that it requires God levels of discipline.
Re:God Writes Haskell by koolala on Thursday September 07, 2023 @09:29AM (#37418625)
Monads!
Re:God Writes Haskell by pyuser583 on Thursday September 07, 2023 @11:40PM (#37428959)
Yes. Seriously. Closest we have to this is micro services.

But at the code level - nobody cares at all. It’s like we are writing literature, not building tools.

Re:God Writes Haskell by slacknatcher12 on Thursday September 07, 2023 @09:12AM (#37418418)
not to argue your major point, but more entropy makes things more uniform/less complex. think of the heat death of the universe.
Re:God Writes Haskell by mathisfun123 on Thursday September 07, 2023 @09:16AM (#37418463)
complex can be a synonym for disorder and it can also be a synonym for structure. in this instance, the clear meaning is disorder.

> become exponentially more complex

obviously this can't be read as "become exponentially more structured" given the tone of the sentence.

Re:God Writes Haskell by ogogmad on Thursday September 07, 2023 @09:26AM (#37418586)
I have a theory that Haskell's main applications are in teaching and academic research - both concerning theoretical computer science. It's not a practical engineering language.
Re:God Writes Haskell by agentultra on Thursday September 07, 2023 @10:26AM (#37419371)
I have evidence to the contrary. I have a job writing Haskell for a living doing boring, normal software. I also started a stream where I write libraries and games and build stuff in Haskell purely to disprove this theory. It's been going well: we've written a logical replication client library for Postgres, built an asteroids clone, etc. It is a very practical language.
Re:God Writes Haskell by dannyobrien on Thursday September 07, 2023 @10:51AM (#37419741)
Do you have a link to your stream?
Re:God Writes Haskell by agentultra on Thursday September 07, 2023 @10:57AM (#37419840)
Re:God Writes Haskell by slacknatcher12 on Thursday September 07, 2023 @10:16AM (#37419222)
this is an interesting observation. I have various explanation on why that might be the case.

on a commercial setting there is more pressure to deliver code then to review it. combine it with the lack of our benevolent dictator for life (that has been on the project the world life cycle, not just recently), there is no one with power to actually say no to changes.

language geeks are novelty seekers. they will use every feature of their language . stronger languages have more features to abuse. so on a commercial setting you will have all the features being used without much thought an architectural design that says you that no, we shouldn't do that.

that's also why I think projects with benevolent dictators for life on the open source ward don't fall these in paths even though they use languages that are stronger.

you could restrict yourself to use languages that have only one way to be used, so python as it was originally. or use a language little abstraction power. but you will suffer in other ways. as abstraction power is genuinely useful. accidental complexity has a way of getting in by expressive means or by social means.

Re:God Writes Haskell by riku_iki on Thursday September 07, 2023 @01:49PM (#37422806)
I imagine there can be some language, which can automatically modify programs, e.g. you added some conditions, and compiled removed/disabled/moved to obsolete package all unnecessary branches which became unreachable or simplified logic.