Live data from Hacker News

PyFL – new functional programming language from Bill Wadge

billwadge.com

31–40 of 51 posts

Re: PyFL – new functional programming language from Bill Wadge

#31

Earlier quoted context omitted.

What is it?

Similar to 'let' (or 'letrec' in lisps), but written after the block it applies to. For example: average xs = total / count where total = sum xs count = length xs

best define `average []` first

Re: PyFL – new functional programming language from Bill Wadge

#32
post #29
post #20

Earlier quoted context omitted.

Haskell is more versatile: f(a, b) is a function applied to a single tuple, f a b is a function applied to two arguments. I do not understand the "instead of" in the cited part and it makes me somewhat skeptical (so does the "Py" in the name).

In python, f(a, b) is a function applied to two arguments and f((a, b)) is a function applied to a single tuple.

But is that closer to math notation as claimed in this thread?

https://en.wikipedia.org/wiki/Argument_of_a_function

"For example, the binary function f(x, y) = x + y has two arguments, x and y, in an ordered pair (x, y)."

So, function application to an ordered pair, i.e., a tuple, does not use double parentheses. Also, of course, currying in Python is atrocious.

Re: PyFL – new functional programming language from Bill Wadge

#33
post #19

Earlier quoted context omitted.

Here's a historical one. 1976. https://en.wikipedia.org/wiki/SASL_(programming_language)

Indeed, these languages are descendants of ISWIM by Peter Landin. ISWIM also inspired Lucid, so I guess PyFL would be a nephew of SASL in that case.

ISWIM isn't lazy, I think, nor fully functional.

Re: PyFL – new functional programming language from Bill Wadge

#34
I'm surprised at choosing not to fix the lack of multiple statements in Python's lambda. That grinds my gears, i'm so often denied using lambda in python in places i'd like to because of this limitation.

That said, i do prefer PyFl's lambda syntax.

This is definitely a cool project, i could see myself using this.

Re: PyFL – new functional programming language from Bill Wadge

#35
post #33

Earlier quoted context omitted.

Indeed, these languages are descendants of ISWIM by Peter Landin. ISWIM also inspired Lucid, so I guess PyFL would be a nephew of SASL in that case.

ISWIM isn't lazy, I think, nor fully functional.

Right, but it’s still the root of the functional branch of the PL family tree. ISWIM to ML is mostly a matter of removing the few imperative features from ISWIM. Once you do that, lazy execution comes naturally.

Re: PyFL – new functional programming language from Bill Wadge

#36
post #9

> … valof clauses (basically where clauses) I so wish Python had valof/where already. And it’s the one feature I was surprised not to find in OCaml after seeing it in Haskell – why isn’t it more common?

It's not very natural in langages with strict evaluation. Haskell is a good fit because, with lazyness, the order matters less. Same thing goes with purity : what if some side effects hide in "where"?

Re: PyFL – new functional programming language from Bill Wadge

#37

I wonder if the niche of functional language with a lightweight syntax is already being served by F#?

The lisps all have more lightweight syntax than F#. F# is just OCaml for .NET, it is not inherently more lightweight than any other ML.

Re: PyFL – new functional programming language from Bill Wadge

#38

Earlier quoted context omitted.

Similar to 'let' (or 'letrec' in lisps), but written after the block it applies to. For example: average xs = total / count where total = sum xs count = length xs

best define `average []` first

Heh; better to use a non-empty list (AKA a tuple) I suppose. It's also wildly inefficient compared to:

    average (x, xs) = total / count
      where (total, count) = Data.List.foldl' go (x, 1) xs
            go (total, count) x = (total + x, count + 1)
In a naive interpreter, this will do one pass rather than two. A smart compiler like GHC can probably optimise away the entire list, getting a tight numeric loop (e.g. https://dl.acm.org/doi/10.1145/1291220.1291199 )

Re: PyFL – new functional programming language from Bill Wadge

#39

I wonder if the niche of functional language with a lightweight syntax is already being served by F#?

For a project already invested in the Python ecosystem, F# isn't going to even enter anyone's mind. Think of it as PyFL => Python as F# => C#.
Post reply on HN