TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Elm for the Front End, Right Now

101 点作者 listrophy超过 8 年前

8 条评论

kcarnold超过 8 年前
I really want to like Elm. When I&#x27;m writing JS&#x2F;React code, I sometimes think &quot;this would be so much nicer in Elm!&quot; - 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 quite fit into virtual-dom’s model -- I suddenly have to make a complicated JS interop and work around things to get at the raw DOM node... whereas with React I can just hack something together, try it with users, and learn that I should actually be doing something completely different anyway. Or maybe I don’t actually know yet what I want to have happen in every possible condition? Maybe I feel this way because I just don’t have enough experience, but it may be a fundamental trade-off involved in how Elm makes it hard to do things wrong.<p>Has anyone had some positive experiences with prototyping &#x2F; rapid design iteration with Elm and can share some tips &#x2F; encouragement?
评论 #13027365 未加载
评论 #13031098 未加载
评论 #13030917 未加载
评论 #13031035 未加载
kinkdr超过 8 年前
I wish they would stop making changes just for the shake of change. E.g. Up until 0.17 most code examples where using the prime &#x27; character.<p>With 0.18, Evan decided that using prime is bad taste, so he decided to break any code that uses it.<p>Sure, it is not a big change, but it means they are not respecting user&#x27;s time and it is a sign of things to come.<p>Sorry for the rant.<p>Edit: I hope my reply doesn&#x27;t get misunderstood. I love Elm and use it in all my side projects. I think it made wonders for introducing new people to the ML world.<p>Edit2: Sorry, didn&#x27;t meant to make so much fuss about it. It is indeed a small thing.
评论 #13026039 未加载
评论 #13026032 未加载
评论 #13026671 未加载
nmdanny超过 8 年前
I think that Elm is a fundamentally good language, being catered towards JS developers will hopefully attract more of them to FP development. However, I feel that the language is too restricted compare to other FP languages (Haskell, Purescript, even Scala), as a result you often need to write too much boilerplate and the Elm architecture doesn&#x27;t seem to fit nicely for all kinds of components.<p>Which is why for now I&#x27;m looking into Purescript and GHCJS which support features such as Rank N types, generics, typeclasses, functional dependencies&#x2F;type families. Even though I don&#x27;t use many of those features directly, I do benefit from libraries that depend on them.
rdtsc超过 8 年前
Speaking of Elm I liked this video from Erlang Factory about using Phoenix and Elm together. They both have a functional flavors so I think it might appeal to same people:<p><a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=XJ9ckqCMiKk" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=XJ9ckqCMiKk</a><p>The first half is about Phoenix, the second about Elm. I don&#x27;t know much about front-end stuff but I did like the Elm bit as an intro, especially the debugging and nice error messages part.
ggregoire超过 8 年前
From what languages is Elm inspired? I&#x27;ve a Java&#x2F;C#&#x2F;PHP&#x2F;JS background and I feel really uncomfortable with Elm syntax.
评论 #13026317 未加载
评论 #13026156 未加载
评论 #13026184 未加载
评论 #13026058 未加载
评论 #13026248 未加载
评论 #13026142 未加载
评论 #13026211 未加载
评论 #13026060 未加载
评论 #13026436 未加载
leeoniya超过 8 年前
in case anyone&#x27;s wondering, it performs about the same as 0.17:<p><a href="https:&#x2F;&#x2F;rawgit.com&#x2F;krausest&#x2F;js-framework-benchmark&#x2F;master&#x2F;webdriver-ts&#x2F;table.html" rel="nofollow">https:&#x2F;&#x2F;rawgit.com&#x2F;krausest&#x2F;js-framework-benchmark&#x2F;master&#x2F;we...</a>
评论 #13030609 未加载
mullsork超过 8 年前
I remember evaluating Elm and ClojueScript as an alternative to ES6 about a year and a half ago. Eventually I had to decide against both as we absolutely needed to render parts of our page server side (Google saying they&#x27;ll index SPAs is a joke.)<p>If I&#x27;m not mistaken this wasn&#x27;t possible in Elm back then, and felt uncomfortable or even hard in ClojureScript. Has that changed?<p>To be fair if I started a new project like the one I&#x27;m working at now I&#x27;d much rather use server + template for most pages and add interactivity through JS once it boots up.
评论 #13030849 未加载
botexpert超过 8 年前
why not flowtype&#x2F;typescript+js es6+react+redux&#x2F;mobx?<p>currently a pretty nice reactive mobx-state-tree is on the frontpage of hn.
评论 #13026375 未加载
评论 #13026441 未加载