Live data from Hacker News

Flix – A powerful effect-oriented programming language

flix.dev

131–140 of 197 posts

Re: Flix – A powerful effect-oriented programming language

#131
post #128

Curious if anyone can weigh in on why Flix requires a developer to explicitly mark a function as pure. I'd imagine in almost all cases this can be derived through static analysis.

I could be wrong, but the sentence "Flix precisely tracks the purity of every expression in a program." together with some examples of function definitions without the purity/impurity annotation, gave me the impression it's optional, because the compiler can infer it on its own most of the time.

Re: Flix – A powerful effect-oriented programming language

#133
Flix FAQ (https://flix.dev/faq/) starts normal, but becomes increasingly more hilarious towards the end :D

Some gems:

---

Q: Wait, division by zero is zero, really?

A: Yes. But focusing on this is a bit like focusing on the color of the seats in a spacecraft.

---

Q: "This site requires JavaScript"

A: People who have criticized the website for using JavaScript: [1], [2], [3], [4], [5].

People who have offered to help refactor the site to use static html: 0.

---

Q: I was disappointed to learn that Flix has feature X instead of my favorite feature Y.

A: We are deeply sorry to have let you down.

---

Q: This is – by far – the worst syntax I have ever seen in a functional language. Semicolons, braces, symbolic soup, et al. It is like if Scala, Java and Haskell had a one night stand in the center of Chernobyl.

A: Quite an achievement, wouldn't you say?

Re: Flix – A powerful effect-oriented programming language

#134
post #128

Curious if anyone can weigh in on why Flix requires a developer to explicitly mark a function as pure. I'd imagine in almost all cases this can be derived through static analysis.

I think if you mark a function as pure the compiler guarantees that this is indeed the case.

Re: Flix – A powerful effect-oriented programming language

#135

Earlier quoted context omitted.

Really? The mix of :/indentation-significant functions and braces for everything else seems extremely questionable.

There is no significant indentation. What leads you to be believe that?

The Python-esque looking function defs.

Re: Flix – A powerful effect-oriented programming language

#136
post #129

I think their DIDYOUKNOW.md file in the source code is worth showing in full, as it describes the language in a more compact form: --- # Did You Know? ## Language Did you know that: - Flix offers a unique combination of features, including: algebraic data types and pattern matching, extensible records, type classes, higher-kinded types, polymorphic effects, and first-class Datalog constraints. - Flix has no global st…

"Controversial: Flix defines division by zero to equal zero." Wait what. Can I read up on the motivation somewhere?

[deleted]

Re: Flix – A powerful effect-oriented programming language

#137
post #66

Earlier quoted context omitted.

Lineage? Aarhus has a strong academic tradition in areas like logic, type theory, functional programming, and object oriented languages. Many influential researchers in these fields have come through there. I also think there's a noticeable bias toward the US in how programming language research is perceived globally. Institutions like Aarhus often don't invest heavily in marketing or self-promotion, they just focus…

Our long winters + free education sure doesn't hurt either - what better way to spend the yearly 6 months of darkness than working on a new proglang?

Six months of darkness is a bit hyperbolic, to say the least. The sunshine, temperature and daylight situation in Denmark is on the whole comparable to what you'd find in Germany, the UK, and Northern France.

Also, long winters? You're thinking about Canada. The daily mean temperature in Aarhus, Denmark in January (the coldest month) is 1.3 C (34.3 F). https://en.wikipedia.org/wiki/Aarhus#Climate.

By comparison, Montreal, Canada has a daily mean temperature in January of -9.2 C (15.4 F).

Re: Flix – A powerful effect-oriented programming language

#138

Earlier quoted context omitted.

As a non-functional-programming, c-language-familiar person, the syntax look fabulous. It seems like the first functional language I've seen that makes simple things look simple and clear.

It's kind of a bummer that "skins/themes" never caught on for programming languages. You see it once in awhile, I think some compiler people at one of the FAANGs did an OCaml skin/theme/alternative syntax (reason? something). And there's stuff like Elixir that's kind of a new language but also an interface to an existing world (very cool, Valim is a brilliant guy). But you could do it for almost anything. I would lov…

Not sure if you have some idea on how, but it feels like an unsolved problem to me. E.g. It is easy to theme a data structure, but if the layout matters it can be very hard to theme while also allowing free form edits.

Re: Flix – A powerful effect-oriented programming language

#139

Earlier quoted context omitted.

The reality is that careless programmers will do bad things with any tool they happen to pick up. Using that as an excuse to reduce the power of a tool is poor form. Another way of putting it is to point out that removing goto from a language isn't going to reduce the occurrence of spaghetti code. The average skill and care of the developers who happen to be using that language is what does that.

Not sure I agree. A simple example: If your language has null as a subtype of every type then you will have null ptr exceptions everywhere. If your language does not have a null value then you won't. The situation is not as clear cut as you suggest. Yes, you can write spaghetti code in any language. But a good language design can help (a) reduce errors and (b) nudge the developer towards writing better code.

I fully agree with you here.

I primarily write JVM applications these days, and my go-to is Kotlin.

Not because I think it's the "best" JVM language -- quite the opposite, I think Scala 3 is potentially the best-designed pragmatically useable language at the moment.

But Scala 3 gives you "too much rope to hang yourself with".

If you're the only person touching a codebase that's fine, but if you have to work with others I don't want to introduce the possibility of a bunch of implicit type classes, macros, and insane type definitions.

I'll take the reduced expressiveness of Kotlin for it's working-class philosophy and simpler mental model.

Re: Flix – A powerful effect-oriented programming language

#140

Earlier quoted context omitted.

I have the opposite gut feeling about LLM's; I think they're going to break down the barriers to adopting new programming languages, since they'll lower the cost of porting code dramatically. The code in a language's standard library is probably enough to train an LLM on the new syntax, and even if it isn't, agents now observe the compiler output and can in principle learn from it. Porting code from one language to a…

I hope so! On one hand I worry about the training corpus being so overwhelmingly biased toward certain languages that everything else will be drowned out. On the other, I think there'll be a point where we realize "reasoning" LLMs are more proficient with the same tools that we are: sound type systems, reusable libraries, concise syntax, DSLs where they make sense, etc. that the end game will look much more like skil…

This a genuine and major reason why I stick to popular languages and tools now.

With how increasingly automated my code authorship is, reliability and training data matter a LOT.

Post reply on HN