Live data from Hacker News

PyFL – new functional programming language from Bill Wadge

billwadge.com

11–20 of 51 posts

Re: PyFL – new functional programming language from Bill Wadge

#11
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?

What is it?

It's the syntax that allows you to write

    x + y
    where y = g(x, 17)
    where x = f(42)
instead of

    let x = f(42) in
    let y = g(x, 17) in
    x + y

Re: PyFL – new functional programming language from Bill Wadge

#12
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?

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

Re: PyFL – new functional programming language from Bill Wadge

#13

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

Ah, I see, it's the "where" that is natural in mathematics.

Re: PyFL – new functional programming language from Bill Wadge

#14
post #3

> min, max = bounds(x) Doesn't Python already de-structure? Repackaged: does PyFL lose touch with the regular language?

I had the same thought. There was surprisingly little discussion of how this new language relates to Python - the only mention on the whole page is that need Python installed to use it. At pyflang.com it says that "PyFL = Python based Functional Language".

I'd be curious to know: Does PyFL benefit from Python's libraries, in the way that Scala and Clojure can use Java libraries? Are there any syntactic similarities? Or does it just happen to be built on Python as an implementation detail?

Re: PyFL – new functional programming language from Bill Wadge

#16
post #5

There's also hylang and coconut...

Also Fable, which can now transpile F# to Python. https://github.com/fable-compiler/Fable.Python

Ohh, that's nice. One of downsides of coconut is very little developer tooling.

Re: PyFL – new functional programming language from Bill Wadge

#17

> Function application uses conventional mathematical notation, e.g. f(a,b) instead of (f a b) as in Haskell. Thank you for that.

I wonder if it were possible to create a language with the power of Haskell, but with a better, more mathematical-like syntax?

Re: PyFL – new functional programming language from Bill Wadge

#18
post #17

> Function application uses conventional mathematical notation, e.g. f(a,b) instead of (f a b) as in Haskell. Thank you for that.

I wonder if it were possible to create a language with the power of Haskell, but with a better, more mathematical-like syntax?

You may want to look into Wolfram Mathematica. It has the syntax f[x,y] and a super extensive standard library, being otherwise very LISPy.

Re: PyFL – new functional programming language from Bill Wadge

#20

> Function application uses conventional mathematical notation, e.g. f(a,b) instead of (f a b) as in Haskell. Thank you for that.

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).

Post reply on HN