4 ms·
People get excited about things happening to Javascript because, if you want to run your code in a browser, there's no alternative. So it's not so much "Javascr
by derefr 13y ago
People get excited about things happening to Javascript because, if you want to run your code in a browser, there's no alternative. So it's not so much "Javascript", some crappy language, getting that feature; it's all-web-programming getting that feature.
- catnaroek 13y agoSome people (myself included) prefer a more radical approach: Rather than fixing the inteface JavaScript presents ot the programmer, we replace JavaScript (or, actually, all three of HTML, CSS and JavaScript) with a different language that is actually designed not to be crap. For example: http://elm-lang.org/ http://elm-lang.org/
- hoverbear 13y agoThen we all get stuck supporting both until its universally adopted (you know how some people still use XP?) It is a noble desire though.
- catnaroek 13y agoElm compiles to HTML, CSS and JavaScript.
- moe 13y agoI'd love a modern GWT. One that's not rooted in java. Elm doesn't look like it wants to be that, though. It seems to be aimed at games and graphics. There is not a single complex form, multi page flow or interactive layout in the examples.
- chris_mahan 13y agoooooohhh where have you been all my programming life... edit: explanation: I really dig it!
- catnaroek 13y agoI am not sure how to interpret this comment. :-| edit: Heh! Go thank Elm's author, not me. :-P
- prodigal_erik 13y agoDoes Elm have a progressive enhancement story at all? http://elm-lang.org/ http://elm-lang.org/ is blank, and at a glance it entombs all content in javascript string literals, making linking and repurposing and any kind of semantic work just about impossible. The attitude that my content has only one useful rendering and I am fully responsible for it, and the client should only be able to execute that precisely, is destroying the web.
- catnaroek 13y agoThis kind of stuff is better handled on the server side by analyzing the user agent string, do you not agree?
- mistercow 13y agoI can't speak for prodigal_erik, but I strongly disagree. User agent strings are, to put it mildly, a clusterfuck. First off, they identify browsers, not features. If a user disables JS, you can't detect that. Worse, you would need know every UA string out there. This is, of course, impossible when a new browser shows up. And even if it weren't, it's not an elegant way to handle the situation of different browsers having different features. You're either going to have to do a separate code path for every version of every browser you support, or you're going to have to create a dictionary on your server to tell you what features are supported for each UA string, and then essentially do progressive enhancement on the server side. At that point, you're going through an awful lot of effort to do the work on the server instead of the client, with no clear net gain. But the problem of new browsers is worse still. When existing browser vendors release a new version, they don't want all of the new features they added to be ignored by sites that rely on the UA string. And when someone makes a new browser, they don't want it to have everything disabled on every site it renders. So they go to elaborate lengths to load down the string with as much crazy as possible to trick sites into misidentifying them as existing modern browsers.
- nostrademons 13y agoThe big reason to do server-side browser detection is latency. Each feature you support takes code, and if you ship the code to the client-side, that code takes bytes and slows down the page load. If you do your browser detection on the server side, you can avoid shipping code to the client that won't work on it anyway. It's usually a poor business trade-off to slow down the several hundred million Chrome, Firefox, and IE users for the sake of a few thousand users on a new browser. Numerous studies (first publicized by Google but replicated several times since) show a direct link between latency and conversions: the slower your webpage is, the fewer people buy from it.
- krapp 13y agoBut html, css and javascript serve different purposes. Why would you want to force them all into one syntax?
- catnaroek 13y agoMarkdown is an embedded language for content inside Elm, so it is strictly speaking not a single syntax. And Elm provides a better way to specify dynamically evolving content that eliminates the need for a separate language for specifying static styles.
- wavesounds 13y agoOnce you get Microsoft, Apple, Google, Mozilla and Linux to all agree to and implement your new language please let us know so we can have you go fix congress.
- gizmo686 13y agoWhat does Linux have to do with this?
- wavesounds 13y agoFigured node.js would become node.elm too right?
- catnaroek 13y agoIt is not really my language, I am just a user. And Elm is already implemented using a compiler that translates Elm source code to HTML, CSS and JavaScript.
- totalbs 13y ago> if you want to run your code in a browser, there's no alternative. ^^^^ YES. Although: 1. there was Java in the browser until recently when the Government said not to use it. Eh, it was dead anyway (in the browser at least- very few new projects using it). 2. there are those things called Flash/Flex/Air/etc. that Jobs killed when Apple wouldn't support them- they still live too all over the place though. 3. HTML 5- it's not just for breakfast anymore. 4. Javascript isn't just there because it is the only thing- morons at Google, etc. helped make faster JS compilers/interpreters. How is another scripting language going to erupt if they keep making the bad one faster. It's like PhP all over. Bastards. Now back to the post to comment on just one thing: > Just take 10 minutes and read the documentation! 10 minutes! I was with it and then I read that and thought, "That's bullshit. Total bullshit." So #1 magic JS MVC framework? AngularJS. AngularJS documentation? Yes it has it... but even though I understand it, when something goes wrong, it is not RTFM, it's TFM: Too Fucking Magic. Batarang doesn't help when things aren't wired correctly, and when it does, it is not written for the beginner. EmberJS? EmberJS has only a community of hardcore Rails devs and Sproutcore people that didn't care it got renamed twice (sproutcore->amber.js->EmberJS) and DHH won't embrace it, so it's is F.U.C.K'd- even one of its big time proponents admitted it would be years before it is ready: http://hawkins.io/2013/05/ember-data-is-pre-alpha-software/ http://hawkins.io/2013/05/ember-data-is-pre-alpha-software/ http://hawkins.io/2013/07/we-are-pioneers/ http://hawkins.io/2013/07/we-are-pioneers/