6 ms·
I'm so glad to see this, congrats to Evan and everyone who helped get 0.19 out the door! I've been working in Elm for about a year now and it is a joy to work
by antew 8y ago
I'm so glad to see this, congrats to Evan and everyone who helped get 0.19 out the door!
I've been working in Elm for about a year now and it is a joy to work with, moving from vanilla JS/Angular/React to Elm has been a boon to productivity and I actually have confidence that when I refactor something and have fixed any compiler errors that it is going to work.
- eksemplar 8y agoWe had a lot of trouble doing things without typesafety and declarations, so we tried a few things. Elm was one of the better ones, and we migrated a few minor systems to it. A few others to typescript and we even made a few pocs with Xamarin and Wasm. Then one of my older employees randomly watched “JavaScript the better parts”, and recommended it to me and we’ve been doing classless JavaScript ever since. Elm is great, certainly one of the better alternatives, but now it really feels like a step backwards.
- spuz 8y agoWhat is classless JavaScript? I don't understand how you had trouble doing things without typesafety but found that going from JavaScript to Elm is a step backwards? Maybe I'm missing something here?
- digitalzombie 8y ago> What is classless JavaScript? Sounds like old school javascript. Either just functional programming or prototype inheritance.
- eksemplar 8y agohttps://web.archive.org/web/20151029152324/http://ericleads.com/2013/01/javascript-constructor-functions-vs-factory-functions https://web.archive.org/web/20151029152324/http://ericleads.... https://weblogs.asp.net/bleroy/crockford’s-2014-object-creation-pattern https://weblogs.asp.net/bleroy/crockford’s-2014-object-creat... Once you start doing this, most other languages become obsolete. Because you avoid most of the problems of JS that things like elm try to fix, while maintaining the freedom and also writing a lot less code because you don’t have to write a “recipe” for half the things you write. The disadvantage of JS is that it’s actually going in the wrong direction. Class is an attempt to copy C-style languages, and that really what you don’t want to do, because as soon as you use inheritance, the “this” keyword or “new” you’re basically doing JAVA/C#/whatever with all the downfalls of JS.
- ww520 8y agoThat's not classless. It's just class using factory instead of constructor for object instantiation.
- boubiyeah 8y agoJS vs Elm simply cannot be reduced to "classes". Classes is only a tiny part of what's broken in JS. TS (coupled to "JS, the good parts") saves the day though, but I have no idea how avoiding classes also somehow made you abandon the usage of a type system (whether Elm's or TS's) It all seems so unrelated.
- tomtheelder 8y agoMany people (myself included) have never meaningfully used the OOP elements of JS you are referring to. The approaches listed above are common JS patterns and ones that I and I think most JS devs have used extensively. However, they don't really solve any of the problems that Elm sets out to try and tackle. Do you have any examples? Also these patterns certainly do not make any other languages obsolete, and as far as I'm concerned it doesn't solve _any_ of the problems with JS that people complain about.
- leshow 8y agoYour comparison doesn't make any sense. You would use a language like Elm/Purescript/Reason etc for the type safety, that's completely orthogonal to whether something has classes or not.
- eksemplar 8y agoExcept you don’t need typesafety when you do this because you’re never expecting a specific type, and at the same time, you don’t have to waste time writing the recipe for what you’re going to do.
- boubiyeah 8y agoYou're always expecting a specific type, whether the type or schema is made explicit by the language or not.
- pbowyer 8y agoI had to find out: this is Douglas Crockford on it: https://youtu.be/DxnYQRuLX7Q?t=2734 https://youtu.be/DxnYQRuLX7Q?t=2734
- jxxcarlson 8y agoJust wanted to say what a joy it has been to work with the 0.19 compiler. For the project at https://knode.io https://knode.io, it was a game-changer: the elm/parser library is so fast that it makes live rendering of LaTeX to HTML a reality. See - Demo: https://jxxcarlson.github.io/app/miniLatexLive/index.html https://jxxcarlson.github.io/app/miniLatexLive/index.html - Blog post: https://medium.com/@jxxcarlson/elm-0-19-its-parser-and-minilatex-606838dc5645 https://medium.com/@jxxcarlson/elm-0-19-its-parser-and-minil... Many thanks to Evan for this amazing release. The wait for it was very much worth while. Faster compiling, smaller asset size, and more. Yay!!
- jxxcarlson 8y agoOne more point. Writing something like the MiniLatex parser would be somewhere between impossible altogether and nightmarish without an expressive type system. Below is the definition of the type of the abstract syntax tree (AST) for MiniLatex. Just eleven lines of code. Yes, I know. No typeclasses in Elm. But Elm's type system is surprisingly expressive, and with it one can do some rather sophisticated work. I've been very happy with it. type LatexExpression = LXString String | Comment String | Item LatexExpression | InlineMath String | DisplayMath String | SMacro String (List LatexExpression) (List LatexExpression) LatexExpression | Macro String (List LatexExpression) (List LatexExpression) | Environment String (List LatexExpression) LatexExpression | LatexList (List LatexExpression) | LXError (List DeadEnd)