Fork me on GitHub

Frequently Asked Questions

A collection of information that did not seem to fit in anywhere else.

What is the best way to start learning Flix?

We recommend reading the Programming Flix book.

If you get stuck or need help feel free to reach out to us on Zulip.

Does Flix have Language Server Protocol (LSP) support?
Yes, in addition to Visual Studio Code support, Flix also has generic LSP support.
Does Flix have a read-eval-print-loop (REPL)?
Flix has a nascent REPL. It can be started with the repl command.
Are you looking for help with the compiler or language design?
Yes! We welcome any contributions and we are happy to mentor someone who wants to work on the compiler. We are also open to general feedback and discussion about the language design. Head on over to GitHub or Zulip and reach out to us!
Does Flix compile to LLVM?
No and we don't have any plans to target LLVM.
Does Flix compile to WebAssembly (WASM)?
Not yet. It is something we are open to. We are waiting for the WASM ecosystem to mature.
Is Flix a domain specific language (DSL)?

No, Flix is a full-blown general-purpose programming language.

Flix looks similar to Scala. How are the two languages related?

Flix borrows a lot of syntax from Scala, hence the two languages have a similar feel.

We think Scala made many good design choices with respect to syntax, including:

  • the use of short keywords,
  • the x : T syntax for type annotations,
  • the List[Int32] syntax for type parameters, and
  • if, match, etc. as expressions.

However, other than syntax, the two languages are very different:

  • Scala is object-oriented, Flix is not.
  • Scala has sub-typing, Flix does not.
  • Flix has an effect system, Scala does not.
  • And so on.
What is the runtime performance of Flix programs?

Flix runs on the JVM which means that the performance of Flix programs is comparable to that of Java and Scala programs.

Flix is a whole-program optimizing compiler that uses monomorphization and inlining (like Rust and MLton). Hence, sometimes, Flix programs run faster than their Java or Scala equivalent.

Haskell and OCaml compile to native code thus by definition they must be faster than Flix.
This is not necessarily true. For example, Java sometimes beats both OCaml and Haskell in The Computer Language Benchmarks Game.
What controversial design choices are made in Flix?

The following design choices may be considered controversial by some:

  • Unused variables are compile-time errors.
  • Shadowed variables are compile-time errors.
  • Unused definitions, type declarations, etc. are compile-time errors.
  • No variadic or labelled function arguments.
  • No warnings, only compile-time errors.
  • Dividing by zero yields zero.
Wait, division by zero is zero, really?
Yes. But focusing on this is a bit like focusing on the color of the seats in a spacecraft.
Where does the "Flix" name come from?
We do not remember, but we believe it may have come from FIXpoint Language.
Does Flix have a network library with streaming support?
Not yet, but maybe we could call it net-flix?
You do not seem to understand parsing / type theory / code generation / computers!
We are always happy to learn! We are ready to discuss design choices made in Flix. Swing by Zulip or on GitHub.
Why does the website require JavaScript?
It no longer does. Well, almost: the carousel spins better with JavaScript, doesn't it?
The page does not load without JavaScript enabled. If I cannot even view the website without that bloat, I wonder what the language is like?
Good news: the website is now static HTML and loads fine without JavaScript. You can even browse it with curl.
"This site requires JavaScript"

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

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

People who can now complain about the CSS: everyone.

It appears that an example on the website does not work?

The latest compiler version and the website are not always in sync, hence occasionally some examples may stop working.

Occasionally a mischievous visitor will crash the online editor (or rather the virtual machine on which the compiler runs).

The language is probably great from a technical point of view, but unless Apple, Google, Mozilla, or Microsoft is on-board it is pointless.

Yes, no programming language developed outside of those four corporations has ever been successful. See also C, C++, Java, Python, PHP, MATLAB, Perl, R, Ruby, Scala, ...

That said, if you work for a company and would like to help sponsor Flix, please feel free to reach out to us :)

Why is it that all the "big-brain" programming language ideas seems to happen in weird new functional programming languages? Are they just a better petri dish for experimenting with weird shit? I assume that all of this gets funding because ten years later it makes C# programmers more productive, not because of mass appeal.

Yes, we do it all for C#.

"Flix is inspired by OCaml and Haskell with ideas from Rust and Scala". Inspirations and ideas from four of the arguably most complex languages of the modern world, all the best with that.

Yes, we take inspiration from programming languages that are pushing on the boundary of language design.

What would be the point of taking ideas from C, Perl, PHP, and Visual Basic?

Also, who said that we are taking their most complex ideas? Rather we should take their best ideas.

Wow! Amazing! A language where you can iterate through lists and call functions recursively.
Magical, isn't it?
Great! Yet-another-programming-language™. This is exactly what we need; the gazillion of existing programming languages is not enough.
Flix aims to offer a collection of features that are not found in any existing programming language.
Do we really need any more programming languages?

Do we really need safer airplanes?Do we really need electric cars?Do we really need more ergonomic chairs?

I mean, after all, we already have airplanes, cars, and chairs!

We build new programming languages and we conduct research on programming language design because we want to offer developers better tools to write programs. We want to make it simpler, safer, and faster to write correct programs.

And we want to increase developer happiness. It should be a pleasure to use Flix!

This sounds like vaporware. All big promises and no delivery.
The research, the code, and the performance.
I was disappointed to learn that Flix has feature X instead of my favorite feature Y.
We are deeply sorry to have let you down.
It boggles my mind that any developer of a new language would not use Python’s significant use of white space.
Right, because significant whitespace poses no challenges or gotchas whatsoever.
Interesting project but whoever decided "forM" is a good name for a language keyword should be made to gurgle Tabasco sauce for a few minutes.

We much prefer Cholula Hot Sauce.

That said, forM is clear, concise, and works well with forA allowing one to easily switch between monadic-code and applicative-code.

How the fuck can anyone understand such weird syntax? I hate all these symbols.

The Flix syntax is based on keywords except when there is aclearly established historical precedent for using a symbol. For example:

  • The cons of an element x and a list xs is written as x :: xs.
  • The underscore _ denotes a wildcard (or an unused variable).
  • The symbol :- denotes logical implication in Datalog rules.
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.
Quite an achievement, wouldn't you say?
The examples all look horrible. The site looks horrible. This needs a lot of work before it gets close to anything I would even consider using.
Sorry, what was the question?