News for hackers. Stuff that matters.
Re:Discovering Dennis Ritchie’s Lost Dissertation by ChrisMarshallNY on Saturday June 20, 2020 @07:53AM (#23583419)
> I liked procedural languages better than functional ones.

(Emphasis, mine). I suspect that he understood functional languages quite well.

He just didn't like them.

I like some aspects of FP, but there are other aspects that I don't like.

My own development style is a ghastly chimera of techniques, technologies and jargon that coagulate into a disgusting bouillabaisse that makes everyone go "tsk, tsk," but that always seems to work quite well, is of extremely high quality, easy to understand, and results in a great deal of ship.

I am...impure. All zealots hate me.

Re:Discovering Dennis Ritchie’s Lost Dissertation by ratww on Saturday June 20, 2020 @08:20AM (#23583531)
> I like some aspects of FP, but there are other aspects that I don't like.

Care to enumerate? Asking because I feel the same: I really enjoy immutability, first class functions, map/filter/reduce, Option<T> and powerful types (I dislike: currying, point-free, monads), but at the same time I feel more at home doing that in imperative-ish languages like C#, JS/TS and Rust where I can have guard ifs and the odd mutation here and there. Wondering if anyone else is the same.

Re:Discovering Dennis Ritchie’s Lost Dissertation by brmgb on Saturday June 20, 2020 @08:31AM (#23583581)
> I dislike: currying, point-free, monads

Don't worry then, that's fine, you just dislike Haskell.

I personally really like functional programming but can't stand Haskell. The style favoured by the community is optimised to be the most impenetrable possible.

You should try Ocaml. The preferred style favours piping to point-free and uses monads sparingly. Currying is everywhere but copious use of named arguments tends to make things simpler.

Re:Discovering Dennis Ritchie’s Lost Dissertation by ratww on Saturday June 20, 2020 @08:42AM (#23583633)
Ah, funny thing: I worked with Haskell professionally for a while. I even enjoy the laziness.

My biggest gripe with it is not so much the language itself but the culture: it favours bloated and pompous solutions much in the same way Java/Spring does. Monad Lifting, Lenses, Aspects and FactoryFactories occupy the same space in my head.

I guess I just prefer both the simple side of functional and the simple side of imperative.

I definitely have to give OCaml a try.

Re:Discovering Dennis Ritchie’s Lost Dissertation by shpongled on Saturday June 20, 2020 @09:58AM (#23583957)
OCaml/Standard ML are both pretty nice because you can still use mutation, and the languages are significantly simpler than Haskell.

My only gripe with them is that there seems to be a culture of having zero type annotations (due to HM), which can make reading other people's code difficult.

Re:Discovering Dennis Ritchie’s Lost Dissertation by brmgb on Saturday June 20, 2020 @10:29AM (#23584136)
> the languages are significantly simpler than Haskell

I don't think that's quite true.

Ocaml has plenty of advanced features (the module system, GADT, structural typing in the object system) but the community relationship with them is very different than how the Haskell community uses the language. For the most part, the Ocaml community tends to dislike gratuitous complexity and be non dogmatic (I fondly remember a lens library announcement on which the top comment could be boiled down to "just use mutations").

> My only gripe with them is that there seems to be a culture of having zero type annotations (due to HM), which can make reading other people's code difficult.

Interfaces tend to be annotated (mli files) but usually people rely on the tooling to know types inside files. Merlin is a blessing. It is a very fast type-checker which keeps working on incorrect files.

Re:Discovering Dennis Ritchie’s Lost Dissertation by shpongled on Saturday June 20, 2020 @10:43AM (#23584218)
Ah, I have more experience with SML than OCaml, I just kinda (ignorantly) lumped them together.

I should put some more time in with OCaml, Merlin sounds nice.

Re:Discovering Dennis Ritchie’s Lost Dissertation by macintux on Saturday June 20, 2020 @11:24AM (#23584435)
You’d probably like Erlang. Functional but pragmatic, an imperative core with immutability, native concurrency...it was my introduction to FP and I hope to get another shot at working with it professionally.
Re:Discovering Dennis Ritchie’s Lost Dissertation by ratww on Saturday June 20, 2020 @11:54AM (#23584604)
Yeah! Actually Joe Armstrong's Programming Erlang was my true introduction to FP, got the book when it was released. Lovely language, a shame I never found an opportunity to use it after that.
Re:Discovering Dennis Ritchie’s Lost Dissertation by jasim on Saturday June 20, 2020 @11:27AM (#23584457)
I do that a lot with Reason/OCaml. It is surprising how powerful imperative, mutable programming is when most of the code you write is functional, and then you want do something a little difficult in the paradigm, and you make a `ref`, write a while loop, mutate an array, or store stuff in a global variable, and it is done! Mutation in OCaml is like a fine scalpel - extremely powerful, occasionally used, and just right on the table whenever you need it.
Re:Discovering Dennis Ritchie’s Lost Dissertation by tartoran on Saturday June 20, 2020 @09:20AM (#23583781)
Have you tried F#? Its brevity makes quite nice but it’s not functionally pure, you can use OOP where you are more comfortable
Re:Discovering Dennis Ritchie’s Lost Dissertation by ChrisMarshallNY on Saturday June 20, 2020 @08:40AM (#23583622)
I like first-class functions. I actually like currying.

But I also like state, polymorphism and identity.

Re:Discovering Dennis Ritchie’s Lost Dissertation by kazinator on Saturday June 20, 2020 @01:05PM (#23585007)
Are you sure you don't mean partial application?
Re:Discovering Dennis Ritchie’s Lost Dissertation by ChrisMarshallNY on Saturday June 20, 2020 @03:09PM (#23586109)
I'm not exactly sure. Partial application is not a term I know. I am not an FP guru.

My familiarity with FP tends to be around "Hey! I like this Swift feature! Where did it come from?"

It's the part where we clump together functions to make a single, rather powerful function that is, in essence, a rabbithole.

Re:Discovering Dennis Ritchie’s Lost Dissertation by kazinator on Saturday June 20, 2020 @12:50PM (#23584933)
C is clearly influenced by functional languages.

Though C programming is usually about effects, effects occur in expressions which usually return a value except in cases when their type is "void" (which was a later introduction into C, possibly from C++).

C even has an if/then conditional that yields a value, the ternary operator x ? y : z, which is a more strongly typed version of (if x y z).

Re:Discovering Dennis Ritchie’s Lost Dissertation by IncRnd on Saturday June 20, 2020 @09:48AM (#23583921)
Ritchie: I liked procedural languages better than functional ones.

ChrisMarshallNY: I suspect that he understood functional languages quite well. He just didn't like them.

Your statement doesn't follow from Ritchie's words that you quoted. Preference of A over B does not have the logical consequence that B is disliked. It doesn't even imply that A is intensely liked.

Re:Discovering Dennis Ritchie’s Lost Dissertation by ChrisMarshallNY on Saturday June 20, 2020 @01:54PM (#23585365)
Fair point.
Re:Discovering Dennis Ritchie’s Lost Dissertation by IncRnd on Saturday June 20, 2020 @03:32PM (#23586405)
I've been researching your point since I read your comment, but I haven't been able to learn if he actually disliked functional languages.

Personally, I prefer Haskell or some functional Python at times, since that solves certain problems well. But, we have a lot more computing resources than existed in the past. I guess it could be possible that he enjoyed the functional paradigm, but pragmatically created a procedural language, given the hardware constraints.

Re:Discovering Dennis Ritchie’s Lost Dissertation by ChrisMarshallNY on Saturday June 20, 2020 @06:58PM (#23588152)
I thought he was talking about Mathematics.

It's a functional language.

Always has been.

Re:Discovering Dennis Ritchie’s Lost Dissertation by IncRnd on Saturday June 20, 2020 @10:14PM (#23589170)
From that standpoint, C is a functional language. Functions are first class citizens in C. I doubt that is what he was discussing.
Re:Discovering Dennis Ritchie’s Lost Dissertation by oh_sigh on Saturday June 20, 2020 @09:52AM (#23583934)
The link on your about page to your LinkedIn profile is broken
Re:Discovering Dennis Ritchie’s Lost Dissertation by ChrisMarshallNY on Saturday June 20, 2020 @07:01PM (#23588167)
Thanks so much for that! It's been fixed.