News for hackers. Stuff that matters.
Re:Go+: Go designed for data science by c3534l on Saturday March 27, 2021 @06:58PM (#26606382)
> strong type system, pattern matching, immutability-by-default for lists and dictionaries

As a side note, its really interesting just how much the popular conception of "functional" has changed. 10 years ago, I don't think anyone would have listed any of those as being important or suggestive of functional programming. Nowadays, "functional" means "like Haskell" instead of "like Lisp." I think we need to be careful when we talk about functional programming because so many ideas have jumped the paradaigm and it means so many different things to different people.

Re:Go+: Go designed for data science by reikonomusha on Saturday March 27, 2021 @08:10PM (#26606852)
Scheme and Standard ML standardized these very features in the 70s and 80s as a part of the “functional programming” paradigm.
Re:Go+: Go designed for data science by skissane on Saturday March 27, 2021 @09:55PM (#26607339)
Scheme doesn't have a "strong type system", "pattern matching", or "immutability-by-default".

Scheme didn't standardise those very features in the 70s and 80s – it still doesn't have them.

Some of those features are available in add-on libraries or as extensions in some specific Scheme implementations, but they are thus far absent from the standardised language.

Re:Go+: Go designed for data science by thayne on Monday March 29, 2021 @12:23AM (#26617675)
That's true, but python isn't really functional in the "like lisp" way either. Things like ifs, loops, etc. are statements, not expressions. Lambdas are pretty limited (they can only be one line). There is no tail recursion.

Functions are first-class objects, and it supports higher-order functions, and had closure (even if in any non-trivial case you needed a full nested def) which were less common features when Python was first introduced, and probably why python was labeled as "functional." But now those are standard features in almost every modern language, so using that as a criteria for "functional" languages is not a very useful distinction.

Re:Go+: Go designed for data science by gilch on Wednesday March 31, 2021 @05:17PM (#26653294)
No, Python's lambdas can have as many lines of code as you please. They are not limited to one line.

I'm not sure where this myth comes from, but I see it a lot. Maybe some people think that "lines of code" == "statements", but these are not remotely the same thing, even if they happen to coincide in simple cases.

Python's lambdas are limited to one expression in the implied return statement, but not allowing multiple statements in lambdas is no real limitation when programming in the functional style, as the true functional languages have no statements to speak of, only expressions, and their lambdas work exactly the same way Python's does. A single expression is all that a functional programming language's lambda needs.

Multiline lambdas are considered poor style in Python ("Why not use a `def`?" they'd say.), so you may not see them much, but they do work. The Hissp compiler, for example, relies on this feature. (I am the author of Hissp BTW.)