Live data from Hacker News

The Flix Programming Language

flix.dev

61–70 of 126 posts

Re: The Flix Programming Language

#61

Earlier quoted context omitted.

Do you worry about side-effects that leak beyond the scope of the routines you're authoring? Why / why not?

i do, does functional programming make this a non issue? maybe im just not smart enough to wrap my head around it.

Haskell makes it a compile-time issue.

If you declare a function effect-free, and try to perform effects inside it, then you'll get a compiler error.

You are still allowed (and it's common practice!) to declare your functions as effectful.

Unfortunately the 'signal' of this message is often lost in the noise: For every Haskeller happily writing effects, there's 9 non-Haskellers writing that 'Haskell's big mistake was being pure and not allowing effects - you should use X instead'.

Re: The Flix Programming Language

#62
post #7

Woah, the effect system looks really neat at first glance. Also, “region-based local mutation” so your pure functions can use mutation under the hood for performance? Sweet!

I'd like to see an experimental language that leans hard into the concept of controlled mutation. I always say that purely in terms of design my ideal language is high-level Haskell, low-level C. Conceptually, purely functional design is how programming "should" (note the quotes) be, but doing so down to the level of functions is both not very practical (some algorithms are just easier to express in terms pointers mo…

It's Rust.

Re: The Flix Programming Language

#63

Earlier quoted context omitted.

Yes, there have. And not a single one of them was able to even gain a sizeable fraction of the mindspace that imperative languages have, let alone replace or obsolete even a single one of them . So maybe it's time for FP as a whole to accept the fact, that there seems to be something fundamental about the way it's paraded implementations look and feel like, that puts off a lot of programmers. Maybe it's time for FP t…

Strict/constrained things are generally less appealing. That does not mean they are not the right approach. I dont agree with the popularity contest approach though. Many languages are in use for different things without the need for a language to win. It is a bit anthropomorphic to approach tools like that IMO. Instead, there has been a healthy influence of more research FP languages into mainstream languages (as yo…

> I dont agree with the popularity contest approach though.

Insofar as it didn't prevent the good parts of FP to become mainstream features, I agree.

But the popularity contest IS important for language emergence. I still believe there would be a place for a functional language that strives to adhere to the principles more stricly, and that programming could benefit from such a language gaining a lot of traction. But, as mentioned before, if such a language requires people to deal with a very different syntax, or applies it's principles too rigidly, it will likely fail the popularity contest.

It also is important for paradigms to become pervasive. As I mentioned, FP has a lot to teach even to OOP people. Writing functional code is a great way to organise a program.

But tell that to a young software developer who has only ever been served enterprise spaghetti OOP pasta with extra abstraction sauce garnished with pseudo-encapsulation cheese, and for whom "functional programming" is something he only saw ridiculed as a meme on some subreddits.

No, popularity isn't the only important thing. But it can help things to reach their potential.

Re: The Flix Programming Language

#65
post #37

Earlier quoted context omitted.

> OOP simply came first Not really. Lisp is a functional programming language and has existed since at least 1960. Some claim there were many other proto-functional languages since the early 60's, and the FP language [1] (a clearly functional programming language and the result of the famous paper "Can Programming Be Liberated From the von Neumann Style?") appeared in 1977 - was inspired by much earlier efforts like…

> Not really. *sight* Okay, let's dot the i's and cross the t's then, shall we, and include languages used long long before software development became the industry behemoth it is today. You're right. There, I said it. You are absolutely right. Many of the concepts of functional programming were indeed pioneered in LISP, and it was indeed specified in 1960, 7 years before Simula. But hey, let's dot another "i" and co…

This was not a pedantic comment. Saying OOP is more popular because it just came first is a complete misunderstanding of history. In fact, Lisp was much more popular than any OOP language for a long time, OOP only took the world by storm with C++ and Java, much, much later.

Re: The Flix Programming Language

#66
post #3

Great, But \ is ugly

Your username matches your comment! Also, I agree but I'm not sure what I would propose as a better token. Maybe another colon? def printAndInc(x: Int32): Int32 \ IO = becomes: def printAndInc(x: Int32): Int32 : IO = Or maybe, since functions need something after the \, even for pure functions, we just drop the \ and use the last argument? def printAndInc(x: Int32): Int32 IO =

Why not something human readable? pure vs mut?

Other languages already have readable keywords in the function definition; extends, raises, where, having, Optional, and so on. They don’t feel unnecessarily verbose.

Re: The Flix Programming Language

#67
post #7

Woah, the effect system looks really neat at first glance. Also, “region-based local mutation” so your pure functions can use mutation under the hood for performance? Sweet!

I'd like to see an experimental language that leans hard into the concept of controlled mutation. I always say that purely in terms of design my ideal language is high-level Haskell, low-level C. Conceptually, purely functional design is how programming "should" (note the quotes) be, but doing so down to the level of functions is both not very practical (some algorithms are just easier to express in terms pointers mo…

That does exist, it's called Koka: https://koka-lang.github.io/koka/doc/book.html

Re: The Flix Programming Language

#68
post #7

Earlier quoted context omitted.

I'd like to see an experimental language that leans hard into the concept of controlled mutation. I always say that purely in terms of design my ideal language is high-level Haskell, low-level C. Conceptually, purely functional design is how programming "should" (note the quotes) be, but doing so down to the level of functions is both not very practical (some algorithms are just easier to express in terms pointers mo…

That does exist, it's called Koka: https://koka-lang.github.io/koka/doc/book.html

To elaborate on the controlled mutation theory, here is a paper they wrote about FIP (Fully In-Place) programming https://www.microsoft.com/en-us/research/uploads/prod/2023/0...

Re: The Flix Programming Language

#69
post #37

Earlier quoted context omitted.

Functional Programming was, for a long time, talked about as yet-another-solution to solve the issue of complexity in larger codebases, primarily the complexity of controlling state getting out o hand. Similar to OOP, which promised to do this by encapsulating state, FP promised to do this via purity, aka. getting rid of as much state as possible, and only allowing stateful transition at certain well defined sections…

> OOP simply came first Not really. Lisp is a functional programming language and has existed since at least 1960. Some claim there were many other proto-functional languages since the early 60's, and the FP language [1] (a clearly functional programming language and the result of the famous paper "Can Programming Be Liberated From the von Neumann Style?") appeared in 1977 - was inspired by much earlier efforts like…

Lisp is not a FP. It's a "List processing language" with some features based on Lambda calculus.

Real FP means referential transparency and that started with languages like Miranda and later Haskell.

What many people consider "FP" today is in fact just procedural programming with higher order procedures and lexical closure.

Re: The Flix Programming Language

#70
post #65

Earlier quoted context omitted.

> Not really. *sight* Okay, let's dot the i's and cross the t's then, shall we, and include languages used long long before software development became the industry behemoth it is today. You're right. There, I said it. You are absolutely right. Many of the concepts of functional programming were indeed pioneered in LISP, and it was indeed specified in 1960, 7 years before Simula. But hey, let's dot another "i" and co…

This was not a pedantic comment. Saying OOP is more popular because it just came first is a complete misunderstanding of history. In fact, Lisp was much more popular than any OOP language for a long time, OOP only took the world by storm with C++ and Java, much, much later.

> Saying OOP is more popular because it just came first is a complete misunderstanding of history.

No it isn't, because the history relevant for this question doesn't begin at the very start of programming. Most programmers active today didn't go to university in the 60s. In the timeframe relevant to answer this question, the people were indeed confronted with OOP languages, and FP languages were already a niche topic, end of story.

This also coincides with programming, as an activity, massively gaining in popularity across many industries.

Post reply on HN