Live data from Hacker News

The Flix Programming Language

flix.dev

71–80 of 126 posts

Re: The Flix Programming Language

#71

Earlier quoted context omitted.

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

Yes and no. In theory, writing in a functional language that allows only "pure" functions (aka. functions w.o. side effects), makes it easier to control state. In practice, side effects exists and are required for programs to do anything useful. In my opinion, one mistake of many purely functional languages was to be so focused on this purity, that it made it needlessly hard to write useful code in them, especially f…

An "unpure FP" is a procedural programming language, because "unpure functions" are generally called "procedures".

But people tend to avoid the name "procedural" at all cost - which is bad because procedural programming really has it's advantages and should be clearly separated from FP which also has certain advantages.

Re: The Flix Programming Language

#72

Earlier quoted context omitted.

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...

Thanks! I'm not familiar with that, I'll try to look it up.

Re: The Flix Programming Language

#73
From the website "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.

Re: The Flix Programming Language

#74
post #46

Earlier quoted context omitted.

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, whi…

What you describe is exactly what the V compiler does.

It produces warnings for unused variables, and warnings become errors, when you want to compile a production executable with -prod , so you can get both the benefit of prototyping without losing your flow, and you are still required to cleanup after that, when you are finished, before release.

Re: The Flix Programming Language

#76
post #62
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…

It's Rust.

Rust sucks for functional programming because it has no GC. While you get controlled mutation, you don't get anywhere near the ergonomics that it requires.

The reason why Haskell and other popular FP languages all require a GC.

Re: The Flix Programming Language

#77
post #55
post #46

Earlier quoted context omitted.

> 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, whi…

Zig and Go both let you silence the error with `_ = myvar`. It can still be annoying, but it avoids the recursive problem you mentioned. Language design is hard, and it's best to not just assume that people are "idiotic" for not thinking the way you do. Turn the volume down a bit, and maybe find a synonym for "literally" for the sake of variety.

So now you just silenced a warning and transformed it into a semantically correct form you have no way of recognizing from afar, making the original problem 10-fold worse.

It is a brain-dead feature, verbatim if you prefer that word.

Re: The Flix Programming Language

#78
post #52

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. W…

Is the compiler written in Flix?

The Flix compiler is written in Scala. The Flix Standard Library and runtime, which includes a Datalog JIT, is written in Flix. GitHub does not yet recognize .flix, so the numbers reported are an inaccurate representation of the actual code in the repo.

Re: The Flix Programming Language

#79
post #69
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…

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.

Lisp is even not a language, it's a family of languages. It started as a "LISt Processor", but it

A lot of early FP teaching was done in Lisp. Some kind of "Pure Lisp" was used, which are imaginary subsets of Lisp, restricted to side-effect-free, non-destructive functions.

FP started quite a bit before Miranda.

Re: The Flix Programming Language

#80
post #19

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 did like seeing the FAQ become more and more deranged the further I scrolled! I'll perhaps be the first to jump on the 1/0 != 0 hate train though; they mention they designed the stdlib to avoid the partial-function pitfalls of Haskell's, but the article they linked to support their design decision of 1/0 being 0 mentions that it boils down to division being a partial function - x/0 is not a case division can handle…

It would probably be reasonable but a lot of people would complain because they don't want to think about the zero case all the time, so maybe it's also reasonable to not do that.
Post reply on HN