Live data from Hacker News

The Flix Programming Language

flix.dev

41–50 of 126 posts

Re: The Flix Programming Language

#41

do functional languages mainly appeal to computer language enthusiasts/researchers? im just not seeing the benefit personally.

You need a pragmatic combination of functional and non-functional.

Many functional zealots aim for a purity beyond all reason and comprehension. When what you really want is something like Erlang/Elixir or even C#.

Re: The Flix Programming Language

#42
post #41

do functional languages mainly appeal to computer language enthusiasts/researchers? im just not seeing the benefit personally.

You need a pragmatic combination of functional and non-functional. Many functional zealots aim for a purity beyond all reason and comprehension. When what you really want is something like Erlang/Elixir or even C#.

What you want is something like Kotlin.

Re: The Flix Programming Language

#44

do functional languages mainly appeal to computer language enthusiasts/researchers? im just not seeing the benefit personally.

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

I don't worry about side effects because in practice they don't cause me many problems (although I do focus on isolating mutable state). But if I thought about it a lot then I might start to worry about the theoretical possibilities. So I think the question is well phrased. "Worry" is mainly psychological.

Other advantages of pure FP might be thread safety but queues take care of most of this (and often locks are not hard to use). Or low-level compositionality. But as Alan Kay said, what we need are bigger objects. John Ousterhout seems to agree. Re-use in the small increases complexity.

Re: The Flix Programming Language

#45
The website is infrequently updated, so let me provide some information about what we are currently working on:

- We are trying to make the entire compiler resilient (error-tolerant), incremental, and parallel. We have managed to make every single compiler phase (of which there are 28) parallel. This has already led to significant speed-ups. We are now trying to increase the degree of parallelism within each phase. We are also working on error resilience to provide LSP support no matter what errors a program contains (syntax, naming, type). For example, it should be possible to rename a variable even if the program currently has multiple errors.

- We are adding support for algebraic effects and handlers. This will allow users to define and handle their own effects.

- We are also exploring a novel way to combine type classes ("traits") and effects.

- We have recently added support for package management and integration with Maven.

In summary, we are already in a great spot, and useful programs can be written in Flix today. I encourage you to check out the documentation: https://doc.flix.dev/ and to try Flix!

(I am one of the developers of Flix).

Re: The Flix Programming Language

#46

Lots of interesting bits in the FAQ: https://flix.dev/faq/ Particularly in the sections titled "What features are not supported" (no exceptions or panics, so e.g. indexing has to return an Option in case it's out of bounds) and "What controversial design choices are made". Some pithy remarks towards the end as well. To follow HN tradition and find the most controversial topic to discuss, my guess is it's either not a…

I also don't like "Unused definitions, type declarations, etc. are compile-time errors" as I often want to test the validity of a statement, like a type declaration, by compiling before using it. Much prefer warnings. I don't mind the disallowing name shadowing, but I really, really hate (I mean that) websites that are just good ol' text and the odd picture that require Javascript. The excuse of "we used React, it's…

> Unused definitions, type declarations, etc. are compile-time errors

Any language that does it, is beyond usable (notably go and zig). Like, I would literally fork the compiler before using them with that “feature” on. It’s completely braindead thing to do — like okay, have a separate production release mode and make it an error there. But for quickly testing out stuff, you will inevitably comment something out, which makes a variable unused. Commenting that out will also make something else unused, so you literally have a recursive problem with some random depth, and depending on how deep it goes, you will literally lose all of the context on what you wanted to debug in the first place.

There is literally zero advantage of this idiotic bullshit, my proposed solution of doing it only in prod release gives all the benefits with none of the negatives.

Re: The Flix Programming Language

#47

Lots of interesting bits in the FAQ: https://flix.dev/faq/ Particularly in the sections titled "What features are not supported" (no exceptions or panics, so e.g. indexing has to return an Option in case it's out of bounds) and "What controversial design choices are made". Some pithy remarks towards the end as well. To follow HN tradition and find the most controversial topic to discuss, my guess is it's either not a…

I think the most controversial feature is actually its effect system. Unlike division-by-zero, which is typically a rare occurrence, the effect system permeates the language and must be learned before one can write useable programs. This requires a new and refreshing mindset: I write pure functions, but inside each function, I can use mutable data structures to get the job done!

(I am one of the developers of Flix)

Re: The Flix Programming Language

#48

do functional languages mainly appeal to computer language enthusiasts/researchers? im just not seeing the benefit personally.

Functional programming “won” in terms of getting many of their features implemented into mainstream programming languages. This is a paradigm, it doesn’t require 100% pure usage. It allows for additional safety in parallel contexts.

Re: The Flix Programming Language

#49

Lots of interesting bits in the FAQ: https://flix.dev/faq/ Particularly in the sections titled "What features are not supported" (no exceptions or panics, so e.g. indexing has to return an Option in case it's out of bounds) and "What controversial design choices are made". Some pithy remarks towards the end as well. To follow HN tradition and find the most controversial topic to discuss, my guess is it's either not a…

I also don't like "Unused definitions, type declarations, etc. are compile-time errors" as I often want to test the validity of a statement, like a type declaration, by compiling before using it. Much prefer warnings. I don't mind the disallowing name shadowing, but I really, really hate (I mean that) websites that are just good ol' text and the odd picture that require Javascript. The excuse of "we used React, it's…

The situation here is not unlike the problem with null: If you allow null in your language, you will have NullPointerExceptions at runtime. Unused local variables (and other unused constructs) are known to be correlated with bugs (see e.g., Xie and Engler, 2002), so if you allow them, you will allow these bugs. So, by enforcing the absence of unused constructs, a large class of bugs is eliminated.

But I agree, this can be cumbersome. So, Flix allows any unused construct to be prefixed with an underscore to mark it as unused. (But underscored things cannot be referenced.) This seems like a pragmatic trade-off.

(I am one of the developers of Flix).

Post reply on HN