4 ms·
Lots of interesting bits in the FAQ: https://flix.dev/faq/ https://flix.dev/faq/ Particularly in the sections titled "What features are not supported" (no exce
by subarctic 3y ago
Lots of interesting bits in the FAQ: https://flix.dev/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 allowing name shadowing, or divide by zero equals zero. Or the site not working without javascript (see the section on that near the end, but you'll need to turn on javascript to read it I guess)
- xcdzvyn 3y agoI 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. Would it not then be reasonable to make division return an Option?
- ben0x539 3y agoIt 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.
- brigandish 3y agoI 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 easy" seems odd given that HTML is much easier.
- rmuratov 3y ago> We use JavaScript for the online code editor.
- brigandish 3y agoDoesn't mean the whole site needs it though, just one page.
- troupo 3y agoI think go made the same silly choice. Make those warnings in debug/test builds, and errors in prod builds.
- kaba0 3y ago> 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.
- sekao 3y agoZig 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.
- kaba0 3y ago
- jorkadeen 3y agoI 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)