Live data from Hacker News

Flix – A powerful effect-oriented programming language

flix.dev

61–70 of 197 posts

Re: Flix – A powerful effect-oriented programming language

#61

I am deeply impressed by the depth and breadth of this language. Algebraic data types, logic programming, mutability, all there from the get go. Another aspect that I love from their comparison table is that a single executable is both the package manager, LSP and the compiler. As I understand, the language server for Haskell has/had to do a lot of dances and re implement things from ghc as a dance between the partic…

> AFAIK, types are erased by JVM compilers...

Not in all the cases (it keeps type parameters for anonymous classes) and there are various workarounds.

Also, essentially, it's not a problem at all for a compiler, you are free to render applied type constructors as regular classes with mangled names.

Re: Flix – A powerful effect-oriented programming language

#62

Earlier quoted context omitted.

The JVM is a state-of-the-art virtual machine with multiple open source implementations, a large ecosystem, and a fast JIT compiler that runs on most platforms. It is hard to find another VM with the same feature set and robust tooling.

I think the problem is that it targets a VM instead of native machine architectures, not the quality of the VM. I also find the times I need to target a VM to be very limited as I'm generally writing code for a specific platform, not a cross platform application. Of course this will vary between developers.

Targeting JVM means not having to roll your own garbage collector.

And bonus, you get a huge world of third party libraries you can work with.

It's been over a decade since I worked on the JVM, and Java is not my favourite language, but I don't get some people's hate on this topic. It strikes me as immature and "vibe" based rather than founded in genuine analysis around engineering needs.

The JVM gets you a JIT and GC with almost 30 years of engineering and fine tuning behind it and millions of eyes on it for bugs or performance issues.

Re: Flix – A powerful effect-oriented programming language

#64
Tangential, but I have a basic question: What makes Aarhus (mainly its university/techhub) a powerhouse for Programming Languages?

C++, C#/Typescript, Dart, etc all have strong roots in that one small area in Denmark.

In general, I am curious what makes some of these places very special (Delft, INRIA, etc)?

They aren't your 'typical' Ivy League/Oxbridge univ+techhubs.

Is it the water? Or something else? :)

Re: Flix – A powerful effect-oriented programming language

#65

Earlier quoted context omitted.

You gotta ask the question: why does FP care about eliminating side effects? There are two possible answers: 1. It's just something weird that FP people like to do; or 2. It's in service of a larger goal, the ability to reason about programs. If you take the reasonable answer---number 2---then the conclusion is that effects are not a problem so long as you can still reason about programs containing them. Linear / aff…

> No practical program can be written without effects, so they must be in a language somewhere. Or rather, very few. It is like programming languages that trade Turing-completeness for provability, but worse. In theory, one could imagine a program that adds 2 matrices in a purely functional manner, and you would have to skip on outputting the result to stay side-effect-free. Yet, it is running on a computer so the pr…

> It seems that the notion of side effects must be understood relatively to a predefined system, just like in physics. One wouldn't count heat dissipation or power consumption as a side effect of such a program, although side-channel-attackers have a word to say about this.

Absolutely! When you really dig into it, the concept of an effect is quite ill-defined. It comes down to whatever some observer considers important. For example, from the point of view of substitution quick sort and bubble sort are equivalent but most people would argue that they are very much not.

The preface of https://www.proquest.com/openview/32fcc8064e57c82a696956000b... is quite interesting.

Re: Flix – A powerful effect-oriented programming language

#66

Tangential, but I have a basic question: What makes Aarhus (mainly its university/techhub) a powerhouse for Programming Languages? C++, C#/Typescript, Dart, etc all have strong roots in that one small area in Denmark. In general, I am curious what makes some of these places very special (Delft, INRIA, etc)? They aren't your 'typical' Ivy League/Oxbridge univ+techhubs. Is it the water? Or something else? :)

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 on doing solid work. It's not necessarily better or worse, but it does make it harder for their contributions to break through the layers of global attention.

Re: Flix – A powerful effect-oriented programming language

#67

// Computes the delivery date for each component. let r = query p select (c, d) from ReadyDate(c; d) facepalm . Select should always come last, not first, haven't we learned anything from the problems of SQL? LINQ got this right, so it should look like: query p from ReadyDate(c; d) select (c, d) Very cool language otherwise.

It is a fair point-- the implicit argument being that this allows `c` and `d` to be bound before they are used, and hence auto-complete can assist in the `select` clause. Nevertheless, the counter argument is that the form of a logic rule is:

  Path(x, z) :- Path(x, y), Edge(y, z).
i.e. an implication from right to left. This structure matches:

  query p select (x, z) from Path(x, y), Edge(y, z).
So the trilemma is:

A. Keep the logic rules and `query` construct consistent (i.e. read from right-to-left).

B. Reverse the logic rules and query construct-- thus breaking with decades of tradition established by Datalog and Prolog.

C. Keep the logic rules from right-to-left, but reverse the order of `query` making it from left-to-right.

We decided on (A), but maybe we should revisit at some point.

Re: Flix – A powerful effect-oriented programming language

#68
post #53

Probably Elixir spoiled me but when I see enum Shape { case Circle(Int32), case Square(Int32), case Rectangle(Int32, Int32) } def area(s: Shape): Int32 = match s { case Circle(r) => 3 * (r * r) case Square(w) => w * w case Rectangle(h, w) => h * w } I wonder why not this syntax: def area(s: Shape.Circle(r)) = { 3 * (r * r) } def area(s: Share.Square(w)) = { w * w } def area(s: Shape.Rectangle(h, w)) = { h * w } area(…

> The Int32 or Int32, Int32 types are in the definition of Shape, so we can be DRY and spare us the chances to mismatch the types

I have to admit I don't see the distinction here in terms of DRYness--they are basically equivalent--or why the latter would somehow lead to mismatching the types--presumably if Flix has a typechecker this would be a non-issue.

I use Elixir now at work and I have used Haskell and PureScript personally and professionally, which both support analogs of both the case syntax and function-level pattern matching, and in my experience the case syntax is often the better choice even given the option to pattern match at the function level. Not that I'd complain about having both options in Flix, which would still be cool, but I don't think it's as big of a benefit as it may seem, especially when type checking is involved.

Re: Flix – A powerful effect-oriented programming language

#70

Earlier quoted context omitted.

I think the problem is that it targets a VM instead of native machine architectures, not the quality of the VM. I also find the times I need to target a VM to be very limited as I'm generally writing code for a specific platform, not a cross platform application. Of course this will vary between developers.

Targeting JVM means not having to roll your own garbage collector. And bonus, you get a huge world of third party libraries you can work with. It's been over a decade since I worked on the JVM, and Java is not my favourite language, but I don't get some people's hate on this topic. It strikes me as immature and "vibe" based rather than founded in genuine analysis around engineering needs. The JVM gets you a JIT and G…

I strongly agree. Java and JVM bytecode may not be our "cup of tea", but it is simply unrealistic to implement any runtime environment with comparable performance, security, robustness, and tooling. The only alternative is WASM, but they are not yet there feature-wise.
Post reply on HN