Live data from Hacker News

Why Isn't Functional Programming the Norm? [video]

youtube.com

41–50 of 417 posts

Re: Why Isn't Functional Programming the Norm? [video]

#41
post #33
post #24

Earlier quoted context omitted.

The fact to he took the time to do that shows who the real man-child is

That, or he hates the HN hug of death.

Nah, just having a problem with the hug of death would be an explanation for redirecting to a polite static message saying "sorry, my site can't handle the load when HN links to it". What he has done instead is excessively diskish.

Re: Why Isn't Functional Programming the Norm? [video]

#42

Earlier quoted context omitted.

> personally I find my brain works very much like a Turing Machine Exactly this. How baking a cake in FP looks like: * A cake is a hot cake that has been cooled on a damp tea towel, where a hot cake is a prepared cake that has been baked in a preheated oven for 30 minutes. * A preheated oven is an oven that has been heated to 175 degrees C. * A prepared cake is batter that has been poured into prepared pans, where ba…

And then you actually try to write it in a functional language, and end up with something like: cake = map (cool . bake 30 175) . splitIntoPans $ mix [ butter, sugar, walnuts ]

I think partial application and pipe operators make this so very intuitive though:

[butter, sugar, walnuts] |> mix() |> splitIntoPans(pans = 3) |> bake(time = 30, temp = 175) |> cool(time = 5)

Re: Why Isn't Functional Programming the Norm? [video]

#44
post #7

Earlier quoted context omitted.

An historical mistake that humanity is paying (and will pay) for a long time. Scheme 'cloths' was a viable option. Lisp remains the most popular scripting language among Autocad users despite Autodesk pushing other languages (.NET and JS). So popular that Autocad clones use it also as a scripting language[1]. Edited [1] https://www.zwsoft.com/zwcad/features#Dynamic-Block

I was working for bigest Autocad competitor for more than 10 years and never had to touch anything similar to lisp :)

If my guess is right, that's because your company's product had their own proprietary language (MDL).

But, that was OK too, because if my guess is right, your company's product also had FAR FAR FAR better COM bindings than Autocad did for 99% of what you'd want to automate.

Re: Why Isn't Functional Programming the Norm? [video]

#45
post #27

Earlier quoted context omitted.

An historical mistake that humanity is paying (and will pay) for a long time. Scheme 'cloths' was a viable option. Lisp remains the most popular scripting language among Autocad users despite Autodesk pushing other languages (.NET and JS). So popular that Autocad clones use it also as a scripting language[1]. Edited [1] https://www.zwsoft.com/zwcad/features#Dynamic-Block

Was it a mistake, though? Languages have to be accessible to their audience, and Javascript caught on because of its relatively gentle learning curve. If SchemeScript hadn't caught on, it might have been that VBScript took over the web.

Insufficiently C-like languages get ignored, according to: http://james-iry.blogspot.com/2009/05/brief-incomplete-and-m...

Re: Why Isn't Functional Programming the Norm? [video]

#46
post #30

The top comment on YouTube raises a valid point: > I've programmed both functional and non-functional (not necessarily OO) programming languages for ~2 decades now. This misses the point. Even if functional programming helps you reason about ADTs and data flow, monads, etc, it has the opposite effect for helping you reason about what the machine is doing. You have no control over execution, memory layout, garbage col…

Many functional languages acknowledge this and are not pretending to have low-level language facilities. Instead, they have built-in mechanisms (FFI) to interface with those low level languages whenever needed.

Re: Why Isn't Functional Programming the Norm? [video]

#47

People at the places I work keep memeing links to blog posts along the lines of "OOP is dead. Functional programming is the new king". Yet to see a single line of a functional language in production. As other commenters have mentioned most decent modern lanuages are multi-paradigm.

There is lots of functional language code in production.

As a recent example GitHub uses this Haskell application for code analysis: https://github.com/github/semantic

Also, Erlang powers a huge amount of the US’ cellular infrastructure, as well as RabbitMQ, which is used in a ton of production workloads.

There’s actually a pretty decent list on Wikipedia: https://en.m.wikipedia.org/wiki/Functional_programming

Re: Why Isn't Functional Programming the Norm? [video]

#48
post #33

Earlier quoted context omitted.

That, or he hates the HN hug of death.

Nah, just having a problem with the hug of death would be an explanation for redirecting to a polite static message saying "sorry, my site can't handle the load when HN links to it". What he has done instead is excessively diskish.

What has he done? Everyone’s commenting he doesn’t like HN but when I clicked the link everything looks fine. Serious question.

Re: Why Isn't Functional Programming the Norm? [video]

#49
post #39

Earlier quoted context omitted.

> personally I find my brain works very much like a Turing Machine Exactly this. How baking a cake in FP looks like: * A cake is a hot cake that has been cooled on a damp tea towel, where a hot cake is a prepared cake that has been baked in a preheated oven for 30 minutes. * A preheated oven is an oven that has been heated to 175 degrees C. * A prepared cake is batter that has been poured into prepared pans, where ba…

I actually don't know of any functional programming languages that don't have syntactic and semantic support for writing step-by-step algorithms.

Could you elaborate on this a bit? Basically calling a functions form an other is how a step-by-step algorithm would work in FP, no? And pattern match on what comes in, and return an immutable copy.

For example you can put functions in a list, and push a datastructure through them, like a pipeline.

edit: https://probablydance.com/2016/02/27/functional-programming-...

Re: Why Isn't Functional Programming the Norm? [video]

#50
post #36
post #28

Earlier quoted context omitted.

but now that you've written the cake baking data type, with a little small tweak, you've got a bread baking data type.

I'd rather have a baking class that takes an argument for what I want to bake, either bread or cake, and spares me the details of how baking is done. I don't have to know that a preheated oven is one that is at 175 grades etc

But then your cake might easily burn.
Post reply on HN