Readit News logoReadit News
remon commented on Flix – A powerful effect-oriented programming language   flix.dev/... · Posted by u/freilanzer
remon · 2 months ago
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.
remon commented on Flix – A powerful effect-oriented programming language   flix.dev/... · Posted by u/freilanzer
remon · 2 months ago
Ah thanks for the insights and references. And yes I'm still curious why this definition of div/0==0 is needed in the context of Flix
remon · 2 months ago
Gotta be honest, this isn't very inspiring : "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."
remon commented on Flix – A powerful effect-oriented programming language   flix.dev/... · Posted by u/freilanzer
mkl · 2 months ago
The FAQ (https://flix.dev/faq/#:~:text=Dividing%20by%20zero%20yields%...) links to https://www.hillelwayne.com/post/divide-by-zero/, which is more about Pony, but links to https://xenaproject.wordpress.com/2020/07/05/division-by-zer... which properly explains that it's helpful for proof assistants to define division by zero, with particular reference to Lean. Really it's defining a division-like function (Lean calls it real.div) that disagrees with division in this one way, and then making "/" use it. It's unclear to me if this is sensible in a general purpose programming language that isn't a proof assistant.
remon · 2 months ago
Ah thanks for the insights and references. And yes I'm still curious why this definition of div/0==0 is needed in the context of Flix
remon commented on Flix – A powerful effect-oriented programming language   flix.dev/... · Posted by u/freilanzer
plainOldText · 2 months ago
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 state. Any state must be passed around explicitly.

- Flix is one language. There are no pragmas or compiler flags to enable or disable features.

- Flix supports type parameter elision. That is, polymorphic functions can be written without explicitly introducing their type parameters. For example, `def map(f: a -> b, l: List[a]): List[b]`.

- the Flix type and effect system can enforce that a function argument is pure.

- Flix supports effect polymorphism. For example, the `List.map` function is effect polymorphic: its purity depends on the purity of its function argument.

- in Flix every declaration is private by default.

- In Flix no execution happens before `main`. There is no global state nor any static field initializers.

- Flix supports full tail call elimination, i.e. tail calls do not grow the stack. Flix -- being on the JVM -- emulates tail calls until Project Loom arrives.

- Flix supports extensible records with row polymorphism.

- Flix supports string interpolation by default, e.g. "Hello ${name}". String interpolation uses the `ToString` type class.

- Flix supports the "pipeline" operator `|>` and the Flix standard library is designed around it.

- In Flix type variables are lowercase and types are uppercase.

- In Flix local variables and functions are lowercase whereas enum constructors are uppercase.

- Flix supports set and map literals `Set#{1, 2, 3}` and `Map#{1 => 2, 3 => 4}`.

- Flix supports monadic do-notation with the `let*` construct.

- Flix supports "program holes" written as either `???` or as `?name`.

- Flix supports infix function applications via backticks.

- Flix compiles to JVM bytecode and runs on the Java Virtual Machine.

- Flix supports channel and process-based concurrency, including the powerful `select` expression.

- Flix supports first-class Datalog constraints, i.e. Datalog program fragments are values that can be passed to and returned from functions, etc.

- Flix supports compile-time checked stratified negation.

- Flix supports partial application, i.e. a function can be called with fewer arguments that its declared formal parameters.

- the Flix type and effect system is powered by Hindley-Milner. The same core type system that is used by OCaml, Standard ML, and Haskell.

- the Flix type and effect system is sound, i.e. if a program type checks then a type error cannot occur at run-time. If an expression is pure then it cannot have a side-effect.

- the Flix type and effect system supports complete type inference, i.e. if a program is typeable then the type inference with find the typing.

- The Flix "Tips and Tricks"-section https://doc.flix.dev/tipstricks/ describes many useful smaller features of the language.

- Flix has a unique meta-programming feature that allows a higher-order functions to inspect the purity of its function argument(s).

- Flix names its floats and integers types after their sizes, e.g. `Float32`, `Float64`, `Int32` and `Int64`.

- Flix -- by design -- uses records for labelled arguments. Records are a natural part of the type system and works for top-level, local, and first-class functions.

- Flix -- by design -- has no implicit coercions, but provide several functions for explicit coercions.

- Flix -- by design -- disallows unused variables and shadowed variables since these are a frequent source of bugs.

- Flix -- by design -- disallows allow unused declarations. This prevents bit rot.

- Flix -- by design -- does not support unprincipled overloading. Instead, functions are given meaningful names, e.g. `Map.insert` and `Map.insertWithKey`.

- Flix -- by design -- does not support variadic functions. We believe it is better to pass an explicit array or list.

- Controversial: Flix defines division by zero to equal zero.

- Controversial: Flix defines String division as concatenation with the path separator. For example, `"Foo" / "Bar.txt" => "Foo\Bar.txt"` on Windows.

## Standard Library

Did you know that:

- Flix has an extensive standard library with more than 2,600 functions spanning more than 30,000 lines of code.

- the Flix Prelude, i.e. the functions which are imported by default, is kept minimal and contains less than 20 functions.

- most higher-order functions in the Flix standard library are effect polymorphic, i.e. they can be called with pure or impure functions.

- the Flix type and effect system enforces that equality and ordering functions must be pure.

- the Flix standard library uses records to avoid confusion when a function takes multiple arguments of the same type. For example, `String.contains` must be called as `String.contains(substr = "foo", "bar")`.

- the Flix `List` module offers more than 95 functions.

- the Flix `String` module offers more than 95 functions.

- the Flix `Foldable` module offers more than 30 functions.

- the Flix standard library follows the convention of "subject-last" to enable pipelining (`|>`).

## Ecosystem

Did you know that:

- Flix has an official Visual Studio Code extension.

- Flix has an official dark theme inspired by Monokai called "Flixify Dark".

- the Flix website (https://flix.dev/) lists the design principles behind Flix.

- Flix has an online playground available at https://play.flix.dev/

- Flix has online API documentation available at https://doc.flix.dev/

- the Flix VSCode extension uses the real Flix compiler.

- the Flix VSCode extension supports auto-complete, jump to definition, hover to show the type and effect of an expression, find all usages, and more.

- the Flix VSCode extension has built-in snippets for type class instances. Try `instance Eq [auto complete]`.

- the Flix VSCode extension supports semantic highlighting.

- the Flix VSCode extension has built-in "code hints" that suggests when lazy and/or parallel evaluation is enabled or inhibited by impurity.

- Flix has community build where Flix libraries can be included in the CI pipeline used to build the Flix compiler.

- Flix has a nascent build system and package manager based on GitHub releases. Today it is possible to build, package, and install Flix packages. Dependency management is in the works.

## Compiler

Did you know that:

- Flix -- by design -- has no compiler warnings, only compiler errors. Warnings can be ignored, but errors cannot be.

- the Flix compiler uses monomorphization hence primitive values are (almost) never boxed.

- the Flix compiler supports incremental and parallel compilation.

- the Flix compiler has more than 28 compiler phases.

- the Flix compiler contains more than 80,000 lines of code.

- the Flix compiler has more than 13,500 manually written unit tests.

- the performance of the Flix compiler is tracked at https://arewefast.flix.dev/

## Other

Did you know that:

- Flix is developed by programming language researchers at Aarhus University (Denmark) in collaboration with researchers at the University of Waterloo (Canada), and at Eberhard Karls University of Tübingen (Germany), and by a growing open source community.

- Several novel aspects of the Flix programming language has been described in the research literature, including its type and effect system and support for first-class Datalog constraints.

- Flix is funded by the Independent Research Fund Denmark, Amazon Research, DIREC, the Stibo Foundation, and the Concordium Foundation.

- more than 50 people have contributed to the Flix compiler.

- more than 2,000 pull requests have been merged into the Flix compiler.

remon · 2 months ago
"Controversial: Flix defines division by zero to equal zero." Wait what. Can I read up on the motivation somewhere?
remon commented on Flix – A powerful effect-oriented programming language   flix.dev/... · Posted by u/freilanzer
remon · 2 months ago
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.
remon commented on Bulgaria to join euro area on 1 January 2026   ecb.europa.eu//press/pr/d... · Posted by u/toomuchtodo
keiferski · 2 months ago
Also, not for nothing but the Polish economy is mostly doing as well as it does because of the metric ton of EU subsidies injected into it the past decades.

That's one part of it. The other part is that the country had just as much human capital and economic potential as Western European states, but was held back artificially by the Partitions, WW2, the Soviet Union, and the lack of Marshall Plan investment that Western Europe received.

Sorry, but the narrative of "Poland is only doing well because the EU is helping" (of which German companies are benefitting from tremendously) is a historically narrow way to analyze the situation.

remon · 2 months ago
Well, it's a fact, not a narrative. I think the actual debate is whether or not boosting economies of countries in the EU that for one reason or another were or are behind on the curve is a net win. I think it is. Just as it is perfectly justified for other countries to feel a bit hard done by if that same country after an estimates 280 billion euro injection is still rejecting the shared currency of that body.
remon commented on Bulgaria to join euro area on 1 January 2026   ecb.europa.eu//press/pr/d... · Posted by u/toomuchtodo
wolvesechoes · 2 months ago
The biggest sovereignty benefit is that it can stop following fixed exchange rate if necessary, what is much easier than moving away from euro.
remon · 2 months ago
In what way? Both need a constitutional change for every country this distinction is relevant for.
remon commented on Bulgaria to join euro area on 1 January 2026   ecb.europa.eu//press/pr/d... · Posted by u/toomuchtodo
wolvesechoes · 2 months ago
Controlling currency is one of the most important aspects of being a sovereign country. Poland should adopt euro not sooner than Denmark and Sweden.
remon · 2 months ago
That currency has a fixed exchange rate to the euro. Any perceived sovereignty benefits are fictitious.
remon commented on Bulgaria to join euro area on 1 January 2026   ecb.europa.eu//press/pr/d... · Posted by u/toomuchtodo
Roark66 · 2 months ago
Polish here, very much against adopting the euro until our standard of living and growth rate matches Germany (no at least not for next 10 years). Why? Because the disadvantages far out weight the benefits for developing countries. The biggest issue is giving up one of the biggest instrument of control over the economy to a supra-national non-democratic organisation. Surely the monetary policy will follow what is best for the biggest economies (or at best the average) while local policy is way better tweaked towards local needs. The best example of this is money supply. The money supply ideally should match the economy growth rate +X so there is tiny inflation (and definitely no deflation). This growth rate is very different in "old EU" and "new EU" countries. So what happens? In time things get more expensive much faster in countries that grow faster while incomes stay the same. This is a huge negative and this is on top of price increases happening on "day 1" due to rounding up during conversion.

Historically the biggest benefit that was sold as something to outweigh this was a claim that "inflation will be low" and big inflation spikes are impossible. This came about from the short sighted view that all inflation stems from printing money and by giving up our control over it to somebody else we somehow "protect ourselves". This was proven wrong during covid when inflation was vastly different in let's say Latvia and Germany despite sharing a currency.

So what is the bottom line? Is euro all bad? No, it is very useful so we have a common currency in the euro zone that is not controlled from across the ocean. This is a huge benefit, but the same benefit is achieved by having it be a second currency like it is now in Poland rather than the only currency. (you can pay in euros in almost everywhere if you prefer as well as get it from cash machines etc)

remon · 2 months ago
Being able to buy groceries with euros is not a strong, or even related, argument to the point you're making. Even ignoring the real economic cost of having two currencies, there is no serious economist that would argue Poland joining the EUR zone is negative for Poland (as opposed to for stronger EU economies). Every single historic metric points in the other direction. Poland's economy is maturing and strengthening and median household income is slowly reaching parity with neighbouring countries so this particular argument may only hold for maybe another decade but until then it's a bit misguided. Also, not for nothing but the Polish economy is mostly doing as well as it does because of the metric ton of EU subsidies injected into it the past decades. Poland is one of the largest net receivers of EU money since 2004 so arguing it or its single currency was somehow a net negative to Poland is, and by extension an odd argument to make for someone benefiting from the above as a Polish citizen.
remon commented on Paper Shaders: Zero-dependency canvas shaders   github.com/paper-design/s... · Posted by u/nateb2022
yladiz · 2 months ago
It took me a few minutes to find a link to some form of docs or examples. I could not find any written docs, but there is a showcase of the various shaders they support[1].

1: https://shaders.paper.design

remon · 2 months ago
Some of these make "lightweight" a bit of a stretch. Per-pixel iterative shaders are probably a performance/battery risk for most applications.

u/remon

KarmaCake day655November 14, 2013View Original