Better HN
topnewbestaskshowjobs
Log inSign up

hellofunk

9,428 karma · joined Jul 10, 2015 (11y ago) · 3,276 submissions

John Bellick, Mexico City
Submissions

comment 9y ago · link · parent

Okay, but you know what else is Turing complete? BASIC. Bash script. Assembly. In 2017 I'm not sure that something being Turing complete should be considered a shocker, or even that meaningful.

Heck, I've seen people write whole programs just using clojure.spec which is supposed to be only for type annotations.

comment 9y ago · link · parent

As someone who has spent a lot of time with SVG, I can assure you there are very wide discrepancies in how the same file renders even using different tools on the same platform, let alone cross platform.

comment 9y ago · link · parent

> Also true of every programming language, except for the abandoned ones. :)

You are throwing some hyperbole around here. We are discussing the shifting foundation for abstractions in Elm, and I'm pointing out that Elm is a young language that has changed its design patterns significantly in the last year or two, the language is not so mature yet, and is probably years from 1.0 stability. That's a perfectly valid point to make in any discussion about the language's design choices. Your blanket generalization about all programming languages is perhaps your way of agreeing with some developers' frustrations in Elm. It kind of reminds me of the Steve Jobs' excuse during the iPhone 4 antennagate when he slyly admitted to the problems by saying "look, all cell phones have problems."

comment 9y ago · link · parent

I'm not sure if it's me or the article, but something about reading it just made me really tired. More so than, say, Javascript fatigue. Which is interesting, because usually that's my limit.

comment 9y ago · link · parent

The most common stance on hiring Elm developers is to not look for people with experience with Elm (because there are relatively few) but people who are smart and willing to learn it. It is a different way than for hiring in other languages.

For example:

https://groups.google.com/forum/#!msg/elm-discuss/92dXqmB4nJ...

But this is common in niche languages. Most of my background is in Clojure, which has a vastly larger userbase than Elm, but it can still be very difficult to find good developers for it. Many of the professional Clojure developers I know learned the language on the job when they went to work for a company that used it. I wouldn't doubt it is similar with Elm. I saw a presentation once by a CTO of a company that started using Elm in production, and he mentioned that hiring is one of the larger risks to adopting it. But that shouldn't necessarily stop anyone, depends on a company's goals (and spirit).

comment 9y ago · link · parent

Just yesterday on Slack some experienced members were pointing out the workarounds necessary to handle certain challenging abstractions, things which are still being thought about for future versions. It's perfectly valid to admit there are some limitations there which may be too much for some projects.

I don't think the above commenter's claim was any more misleading or vague than your claim. Elm is not a general purpose programming language. It exists for a single and specific use-case, a single design pattern, and this can be fantastic for those who fit their projects into that world. But it is a genuine side-effect of this that there are abstractions the language simply does not make easy or possible as a result of its goals. That's fine, but it can affect some projects -- obviously not yours. There are certain domains for which Elm makes a lot of sense, and others for which it would be the wrong choice.

And Elm as a language is still in search of its ideal abstractions, as they have significantly changed over recent versions, so it's clear that this experience is not unique to the commenter only.

Since Elm is just in its alpha stage, perhaps it is unfair to expect it to be as capable and mature as alternative languages.

comment 9y ago · link · parent

> I believe you can use Google Closure Compiler on Elm JS files with great effect

No, you can't use the advanced optimizations from Closure compiler in Elm. This is unlikely to change any time soon because Elm's compiler emits JS that directly violates one of the restrictions that Closure requires for advanced optimizations, namely the referencing of field names as a string.

comment 9y ago · link · parent

I agree with much of your points but a few things to add clarification:

While lisps do traditionally provide repl-driven development and you can do this in Clojure, most Clojure devs I know are not actively working right at the repl. If you do like some aspects of repl-like interactivity, Elm does have elm-reactor which has some similarities to Clojurescript's figwheel, though not quite as mature or comprehensive.

Aside from the repl, you are right that you can get a proof-of-concept going in Clojurescript extremely fast so if you want to see if an idea succeeds or fails before investing lots of time, you can't beat Clojurescript.

The Elm toolchain is slowly evolving to include things like dead code elimination (which it doesn't have yet but probably will in the near future). However, I think it will be a long time (if ever) that Elm will support global inlining, automatic variable renaming and some other optimizations that come for free with the Google Closure compiler support. The other important difference is that as the Google Closure compiler adds features or further improves its optimizations, these are mature and widely used and immediately available for free without much (if any) extra work on the Clojurescript team. It's a philosophical difference that the Elm devs prefer to solve these problems on their own rather than leverage existing tools in the industry, but since the Elm dev community is small (much of it is only one person), this means that lots of time must be spent on these solutions at the expense of features more specific to the Elm language.

Also I think you are right that Elm as a language is a little easier to learn than Clojurescript (though to someone new to FP, both Elm/Haskell style syntax and Lisp syntax might be equally bizarre). But I think that ease is made up for by some of the concepts in Elm that can be difficult to learn (decoding, Tasks, ports, etc), so it's probably a net flat difference on the learning curves between the two systems.

comment 9y ago · link · parent

Depends on your needs. If you are targeting desktop, there are a couple of UI libraries for Elm. However, they are buggy when you try to test them out on a mobile tablet. I have found that most Elm developers create their own UIs since wider access to JS UI toolkits is not easy. That does mean that you need to enjoy general web design or work with a designer, or be willing to put in extra time when working in Elm.

comment 9y ago · link · parent

Similarities:

1) Re-frame and Elm are both backed by a virtual dom (Re-frame leverages React behind the scenes, Elm uses virtual-dom)

2) Both impose a single app state

3) Both require user events and outgoing state mutation to be explicitly defined somewhere outside of the context of a view

4) Both operate on a sort of "game loop" style of processing events and calling view functions

5) All data is immutable in both languages (though Clojurescript provides explicit mutable structures if desired, which require special syntax so any mutation is evident)

Differences:

1) Elm's model is pure FP -- data is passed to a function, and then it calls other functions. An individual view function in Elm cannot independently subscribe to any kind of data event, either a state change or a socket message, etc; it must receive the data it needs as an argument to the function only. Depending on who you talk to, this is either limiting or properly restrictive. It does mean that a branch of your Elm user interface should generally correspond to a single branch of your app state, or that view functions in complex interfaces must take quite a lot of arguments; this is a pattern for which re-frame explicitly offers a workaround (though you can also do it the Elm way in re-frame if you want). In general, these differences lead to more re-usable components in re-frame than in Elm.

2) Elm has no real asynchronous library for high-level concurrency. Most Clojurescript projects (at least large SPAs) often leverage core.async as an abstraction for large UIs that handle many independent processes simultaneously. Core.async makes clojurescript particularly versatile for accomplishing things in a single-threaded environment as if it were modelled with multiple threads.

3) Elm has its own compilation story that is separate from the JS ecosystem. The Elm devs are working on dead code elimination. Clojurescript projects are all built on Closure, which provides DCE, compression, and global inlining which can provide some projects notable speedups. The Closure libraries also give Clojurescript cross-browser abstractions for hundreds of common tasks in front-end development that have been battle-tested by Google in all of their web services, so it can greatly reduce development and debugging time for complex apps that run everywhere.

4) Elm controls JS interop much differently than Clojurescript. The tradeoff is that in Clojurescript you will inevitably spend more time debugging runtime errors, while in Elm you will spend more time developing your JS interop code and testing cross-browser compatibility.

5) There are many UI libraries available for re-frame because it can wrap existing JS tools (including wrapping UI libraries built for React). There are fewer for Elm, and it's more common to roll your own UI in Elm. There are pros and cons here. I've worked on two large projects in Clojurescript, one which was all custom UI components and another that leveraged polished libraries in the wild. The former took much much longer to make but looked more unique. Having the choice to go either way is a big benefit since project goals widely vary. If you are primarily a developer/coder and not a web/graphic designer, you may be frustrated at UI design in Elm. If you work with a designer, this is not a problem. But if you work alone, having access to a lot of UI tools can free up your time and efforts quite a bit, and Clojurescript has an edge here.

6) Types: Elm has static types, while Clojurescript offers clojure.spec (which is optional though widely used). Spec is a runtime contract system so you can guarantee that all args passed to functions or setup in data structures meet specified criteria; not just types of the args, but also any other predicates, such as a valid range for an integer, etc. For example, an Elm union type would be a Clojure set, where each element could be a specific data structure with other specs attached to it. However, Elm has proper static types, which are caught at compile time, not runtime. There are benefits of both styles. If you want to tightly catch very specific data aberrations that flow through an app, clojure.spec is easy to use for that purpose; but if you want more general checks before the program runs, Elm would be preferable.

7) Performance: All of Clojurescript libraries that wrap React (including Re-frame, vanilla Reagent, and Om) offer an interesting runtime optimization that I've not seen in other languages, and is not available in React itself. If the data that a view function requires (either via its arguments or subscription) has not changed from the prior render frame, then the entire view function is skipped without running, since its output would not be any different. What this means is vast sections of your app's code don't even need to run on each render frame, and this is not trivial. In a small app, it would make no difference, but in complex SPAs this can be very significant. Elm offers a library, Html.Lazy, that attempts something similar, though my impression is that most Elm projects do not use it since it can be tricky to explicitly add this behavior; in Clojurescript, it is built in automatically. In Re-frame, they go an extra step by de-duplicating any queries or subscriptions so that multiple views which use the same data context do not query, fetch or calculate the required data more than once, which is then passed to all requested functions. If you are working on an app that processes lots of data frequently, this can be the single selling point of using Clojurescript, as it frees up the CPU to deal with only those things that are guaranteed to require processing.

Clojure's syntax is very tight and concise, while Elm's language is elegant but more verbose. I have found that there is approximately a 2.5X increase in code size in Elm when trying the same ideas out in both languages.

All other things being equal, you can probably get a re-frame app going very quickly; if you need to prototype something or get to an MVP as soon as possible, it is really hard to beat Clojurescript compared to any other compile-to-JS language. If however you are going for application purity and a reduction in runtime debugging, Elm (or Purescript or some other statically-typed languages) would be a better fit.

Ultimately, Clojurescript is a general purpose language, while Elm has a very specific use-case; if you fit into the Elm model, it can be nice. If you need to reach outside that model, it is a challenge.

comment 9y ago · link · parent

Here are some relevant discussions related:

https://news.ycombinator.com/item?id=14870642

comment 9y ago · link · parent

That's great that you are having a good time. But a few points:

1) The experiences you've personally had do not capture all problems that everyone has, and to assume you've seen it all is pretentious at best. You are quick to dismiss the very idea that anyone would find limitations in the language or its architecture, without even knowing the details of the myriad other projects out there; sorry, that is just naive or arrogant.

2) I've noticed that on nearly any forum, you like to brag about the size of your... codebase. The quality of a project and the problems it has solved are not revealed in quantity of lines. It doesn't matter if you have 100K or now you say 150K lines of code. I have no idea what problems you are solving, nor you us; so stop hiding behind a nice round number and claiming it gives you all manner of authority on what developers need.

> let's not pretend there's some spooky "abstraction wall"

Honestly, it's comments like this that underscore what many others here have said about the general stance in the Elm community. How about actually listening to people's experiences rather than dismissing them? You can't end your comments with little emojis and pretend it washes over the general brush-off you are presenting.

comment 9y ago · link · parent

Or God mode.

comment 9y ago · link · parent

I think ido mode in the mini buffer is a requirement for smooth emacs use. And of course, installing any editing modes for particular program languages that you use.

comment 9y ago · link · parent

Once you find what you like about spacemacs, it is usually better to start with a raw configuration and add those things that you found and remove everything else. You end up with a much faster and lighter editor.

comment 9y ago · link · parent

I do all front end development in emacs, using Clojurescript. Lisp support is of course great in emacs.

I also use web-mode a lot for source files that are a mix of CSS, Js and HTML.

comment 9y ago · link · parent

At least on MacBook Pros, there is not a control key anywhere in the same pinky area as the caps lock key. A solid inch or two is quite a big deal.

comment 9y ago · link · parent

I had the same reaction when I read this. I was looking forward to getting to my computer later today so I can see what that key map does!

comment 9y ago · link · parent

I used to think that walking trees was a standard task in functional programming languages because the one I am used to (Clojure) contains gobs of functions in its library for all kinds of walking, zipping, combining, separating trees of different structures. But I've learned since studying other functional languages that it isn't as commonly done as I'd thought.

comment 9y ago · link · parent

I updated my comment; indeed I was confusing you with another commenter, my apologies.

I'm not sure how you are so confident that the user "allover" is not actually using Elm, though.

comment 9y ago · link · parent

> for people who are actually writing and using Elm, it does not apply

You assume the OP is not actually using the language.

comment 9y ago · link · parent

> He just wants to use it, remember?

It was recently pointed out somewhere (maybe the Elm mailing list) that Evan does not actually touch a production codebase in Elm often.

comment 9y ago · link · parent

The issue is that after awhile, a language should not be an individual person's gift to the world. It's a tool, after all. People and companies use and depend on it; users should be given greater freedoms or voices. It's not a piece of art to marvel at; it's something to be tugged on by many angles to create real work by people other than the language author.

In most languages, like C++, Javascript, Clojure, Elixir -- you find a single person who created the language, and then the real guts of how the industry actually uses it are the results of a large community; the original author usually isn't the sole source of best practices.

comment 9y ago · link · parent

The interesting thing to me is that you highlight how priorities are different among different people/companies; to me, choice of indentation spacing is trivial. But to you and the sibling comment, it obviously is not. And that's the point: a developer should be respected to decide what is important for their work. In this case, we are talking about indentation flexibility. But this problem scales throughout on many other issues that I might find important but you do not. Most languages give developers more freedom, even if starting out with a consistent default that everyone can understand first.

comment 9y ago · link · parent

> wider discussion just bogs him down in pointless extra work

> Nothing stopping you or anyone else from forking Elm if you don't like how things are going.

Comments like this are what supports the points I've made here. It's just an attitude I have not seen in other language communities, for better or worse.

Discussions about language design and direction are not usually seen as "pointless."

comment 9y ago · link · parent

> Basically everything below mid-level is these conditions.

Hyperbole.

comment 9y ago · link · parent

The other problem is that no matter how many times different people bring up the same recommendations for Elm language features, if those opinions are not shared by Evan, they are seen as trivial and unnecessary.

Also, for such a very tiny community, they make it hard to participate in some ways. Many of the github issues are locked for comments unless you are a core contributor. And the mailing list has a lengthy waiting period on the first several new messages sent to it (I've never seen such a tightly moderated list in any language). You would think they would want to embrace anyone who chooses to spend time with their language, but they don't really give average users much of a voice.

comment 9y ago · link · parent

The "our way is the right way" mentality that is common in the Elm community is really the larger issue here, and it has been a bit of a turn off for me. There is a lot about Elm to really like, but it is a rather closed off development culture without a lot of appreciation for hearing ideas and experiences from others.

If Elm could open up and allow developers to experiment with other architectures, like pretty much every other language, and not be so restrictive in forcing everyone into the exact same pattern, I think it would be very successful, because the language itself is nice. If someone wants to use Elm as it currently is, that should be one simple option available to everyone. But you should be able to easily discard that if you want to, and do other things, including making a choice on the trade-offs for JavaScript interaction. Languages that don't give developers much choice in how they are used are usually not going to be very successful.

1
545556
110