Earlier quoted context omitted.
Because I really like syntax like Haskell (the type signature is much clearer especially in generic code compared to Java or Scala etc. for example), I'm curious, what is so uncomfortable about the syntax?
The lack of parentheses around function calls makes it hard for people not familiar with ML-style languages to tell where the function calls are and what the arguments are to each function call. There is a wide variety of syntax among mainstream languages, but basic function calls are pretty much all the same. Take a look at Reason [1] for an example of how a functional language (OCaml in this case) can be made more…
Elm for the Front End, Right Now
51–60 of 81 posts
Re: Elm for the Front End, Right Now
#52Earlier quoted context omitted.
Yes, I am not saying it is a big thing. It's a small thing in itself, but breaking backwards compatibility for no good reason is huge red flag for the future.
> breaking backwards compatibility for no good reason I'd say reducing weird syntax is a perfectly good reason. How is doing this while offering an easy migration solution in an early stage language a "huge red flag"?
There's a very good example in C++ of how this causes problems, where vector::clear and vector::empty are much too easy to confuse (which one of them deletes all elements, and which one of them checks if a vector is empty?). Replacing them with clear! and empty? (or is it clear? and empty!) would be a huge improvement. Whenever a language moves away from arbitrary legacy restrictions, that's a good thing.
Re: Elm for the Front End, Right Now
#53Earlier quoted context omitted.
Wow, couldn't be more wrong. It's indeed C family (BCPL, B). Thanks a lot for the note.
Well, I wouldn't be so hard on yourself. IIRC (and I hope someone corrects me if I'm wrong), algol introduced block scoping. Whether you use BEGIN/END or {/} I think is a pretty minor point. C has braces to introduce a new scope. The irony is that JS (until recently) didn't have block scope. It just has braces :-). Now this is where it gets screwy. You are supposed to (but don't have to usually) add a semi-colon on t…
It does indeed, and it leads to some ugly code:
a = function() { if(1>0) { return "Yay" } else { return "Nay" } }()
Re: Elm for the Front End, Right Now
#54I really want to like Elm. When I'm writing JS/React code, I sometimes think "this would be so much nicer in Elm!" - especially for architectural issues. But the few times I’ve actually tried doing something in it, I find that the parts of what I want to do that fit cleanly within Elm’s walls are really nice, but the parts that don’t quite fit get hard quickly. Suppose I want to do something with the DOM that doesn’t…
I think two things are require for to solve this:
1. Some way to make it easy to drop in components into an existing view. Global state makes this hard, but it may be possible with some of Haskell's funky features, or even just type classes.
2. With the above we just need people to write some basic controls for Elm and give them more features. We need an ecosystem.
Re: Elm for the Front End, Right Now
#55Earlier quoted context omitted.
Well, I wouldn't be so hard on yourself. IIRC (and I hope someone corrects me if I'm wrong), algol introduced block scoping. Whether you use BEGIN/END or {/} I think is a pretty minor point. C has braces to introduce a new scope. The irony is that JS (until recently) didn't have block scope. It just has braces :-). Now this is where it gets screwy. You are supposed to (but don't have to usually) add a semi-colon on t…
>You can not use if "statements" as expressions in Javascript (which sucks quite a bit). It does indeed, and it leads to some ugly code: a = function() { if(1>0) { return "Yay" } else { return "Nay" } }()
a = 1 > 0 ? "Yay" : "Nay"
Re: Elm for the Front End, Right Now
#56Earlier quoted context omitted.
Well they're both the lambda calculus, Lisp just had parentheses.
Does lambda calculus have character strings, structures, exceptions, symbols, mutable variables, quoting code as data, macros and three different kinds of object equality?
Re: Elm for the Front End, Right Now
#57Earlier quoted context omitted.
Yeah, it seems like a step back in readability... It's not at all intuitive and once I figure out what its doing, I can't find a reason for it.. Lisps are hard to read, but there are at least a few reasons for the syntax (not that i like them) ... This just seems... weird and unusual for no reason...
Have you spent much time with it? Like all things, you need to learn before you understand, and then it becomes clear.
Re: Elm for the Front End, Right Now
#58Earlier quoted context omitted.
Have you spent much time with it? Like all things, you need to learn before you understand, and then it becomes clear.
Thats kinda the point... with the vast array of languages out there, that are performant and powerful and very well established, why should anyone suffer through the learning curve? what value does the language offer to make that worth the effort?
Re: Elm for the Front End, Right Now
#59Earlier quoted context omitted.
See my reply to the other thread. 1. If it is not ready for prime time, maybe we should stop promoting it? 2. React was 0.14 up to a year or so ago. The number doesn't mean anything.
> prime time Apparently, prime time came and went :) > If it is not ready for prime time, maybe we should stop promoting it? It's about as ready as the impression it makes: yes, you can use it for project. But you may need half an hour every few months to update.
:D. Pun was not intended!
Re: Elm for the Front End, Right Now
#60Which is why for now I'm looking into Purescript and GHCJS which support features such as Rank N types, generics, typeclasses, functional dependencies/type families. Even though I don't use many of those features directly, I do benefit from libraries that depend on them.