4 ms·
I would have liked to have seen custom operators stay around in 19, but I understand the motivations. I think it was in 18 they removed back-ticks for the same
by dsiegel2275 8y ago
I would have liked to have seen custom operators stay around in 19, but I understand the motivations. I think it was in 18 they removed back-ticks for the same reason. Just makes it way easier for newcomers to learn the language.
As far as I understand it, the native modules lockdown had to take place. Period. The one thing that most attracts myself (and many others, I'm sure) to Elm is the guarantees that the compiler gives you towards ensuring no run-time errors. Give folks the ability to author and publish Elm native modules and the entire platform loses that guarantee.
- jarcane 8y agoNot only that, it was a completely undocumented hack in the first place that it was repeatedly communicated shouldn't be used. And I really don't see how JSON parsing is a task that actually needed hacks to work short of massive GB dumps or something. I am sometimes frustrated by the way Elm is almost more a DSL for web apps than a complete language, but I also don't see anything wrong with closing an unsafe API in a language that's specifically about type safety. It seems like complaining that Haskell doesn't give you instructed ASM blocks.
- owl57 8y agoIt seems like complaining that Haskell doesn't give you instructed ASM blocks. Well, Haskell doesn't give them out of the box, but it allows implementing and distributing all sorts of crazy unsafe stuff in libraries, including exactly this sort: http://hackage.haskell.org/package/inline-c-0.6.1.0/docs/Language-C-Inline.html http://hackage.haskell.org/package/inline-c-0.6.1.0/docs/Lan...
- berns 8y ago> Give folks the ability to author and publish Elm native modules and the entire platform loses that guarantee. Note that you can't even compile native modules for your private modules.
- endgame 8y agoI don't. If you ban custom operators, how can you find out future use cases where custom operators make a lot of sense? I am extremely distrustful of a language where certain people are more equal than others. Those elevated people could be blessed library authors, or within the core implementation or whatever, but I hate not being trusted to use my tools properly.
- vmchale 8y agoAgreed. Not allowing footguns is great, but custom operators aren't a footgun and in any case the fact that Elm has operators at all kind of indicates that they you're just being treated as a second-class citizen.
- vmchale 8y ago> Just makes it way easier for newcomers to learn the language. I don't think that's true. In either case, being beginner-friendly above all else is a bad design goal. > the compiler gives you towards ensuring no run-time errors lol except for the part where you can cause infinite loops at runtime. whoops!