110 points · by tilt · 14y ago · 55 comments
The reality of much programming is that once you've got your set of tools, and a good familiarity with a language which helps you solve problems you're happy. You're happy because you're getting stuff done in a manner that you find elegant, or easy.
For example, I really like Go because it's C-like, with an OO paradigm that I'm comfortable with, lightweight 'processes', and neat communication. Also, builds and tests really, really fast. But you probably don't learn much more from me saying that other than "John likes Google Go because he's comfortable with it".
I think there's some value in your list of things that you like about Go. It gives others an idea of what they might be missing out on. (And for me with my work on Open Dylan, it gives me a nice target to aim for.)
The JVM is a proven and stable platform, with nice tooling and exceptional support. It's also polyglot.
And 180,000 LOC is not that much --it depends on the requirements. Perhaps you are thinking "I can do all that in 1/10 the size in language X", but chances are you are wrong.
It's not about doing the same thing in the turing-complete sense, it's about doing the same thing in the real world sense.
You might achieve the same functionality with less code. But can you achieve the same interoperability with other systems the company uses with that other language? Could you utilize the 20-something already existing dev team of JVM coders? Could you have the same support from the vendor? The same toolkits? The same performance characteristics? Etc etc...
"Moreover, JS is really fast to write and test. Write – save – refresh[2]; it’s an absurdly fast dev cycle that lets me iterate on questionable portions of the code much faster than any environment I’ve worked in."
With ClojureScript and Emacs, this cycle is replaced with "write - C-x C-e" (For the unfamiliar, Ctrl-x Ctrl-e sends the Lisp form immediately before the cursor to the compiler, and sends the resulting JavaScript to the browser for execution. It lets you evaluate bits of code directly from your editing buffer. It's the classic Lisp and Emacs set up and it's fantastic.)
Is there no browser-connected REPL for regular-ole JavaScript? I don't know the details of the ClojureScript implementation, but I would imagine you could hack it up to use plain JS. I'm sure I sound like a smug Lisp weenie, but actually I'm just hoping that this does exist in case I ever have to use regular JS.
edit I found something call mozrepl but this seems specific to Firefox. https://github.com/bard/mozrepl/wiki/Emacs-integration
It works really, really well. In fact, it's using exactly the same protocol and Emacs libraries that ClojureScript uses (SLIME). It's really neat to see SLIME still being used today for such cool and practical things.
But in general, you have to set up your inferior-lisp-program in Emacs with the shell script desribed here: https://github.com/clojure/clojurescript/wiki/Emacs-%26-infe... (for ClojureScript One, it suffices to use "lein repl" as your inf-lisp.)
Then you need to (:require [clojure.browser.repl :as repl) in your ns, and run (repl/repl "http://localhost:9000 ") (there's a space here to prevent HN from swallowing the close-quote, but it shouldn't be there) at the beginning of your ClojureScript app.
Start the REPL in Emacs (M-x inferior-lisp RET, ie press Alt-x, type "inferior-lisp", hit return) and then open the browser and point it at your app. Test it by typing (js/alert) in Emacs. Then, when you're in a ClojureScript buffer (or any Lisp buffer, I think) C-x C-e will send the form before the point to the REPL, which is actually connected to the browser.
I'll leave setting it up for Vim as an exercise for the reader (kidding, kind of, I just don't have any idea if any one has worked on this yet, although there are Vim modes for regular Clojure, so maybe)
I also kind of misread MatthewPhillips post and thought he was looking for Emacs instructions. For sending code to the browser from a normal REPL, (started with `lein repl`) I think a good place to start is these two files from Cljs One:
https://github.com/brentonashworth/one/blob/master/src/app/c...
https://github.com/brentonashworth/one/blob/master/src/lib/c...
Together they should help in setting this up for a vanilla Cljs project, or require them in your fork of Cljs One and start a REPL.
That is just full of crap. What he forgets to mention is that you have to fix a good deal of the bugs at runtime(spending time in debugger), that would otherwise be picked up by a compiler and also figuring out the workarounds on the shitty toolchain.
"We now send hundreds of kb’s of minified Javascript to the client, and we expect all of it to run smoothly."
Again, these are inherent deficiencies of the toolchain, where you have to compress the textual code, instead of using byte-code.
And on top of that we have Coffee Script, LESS, SASS, Jade and God knows what to try to compensate for the amount of legacy, instead of just rebuild proper framework from the start, right and for all.
But it's not just a case of rebuilding a proper framework, the "internet" is just too big to scrap everything that is already there... we'd end up with this real mixture of technologies floating around, browsers become more bloated to support both set of technologies, we end up with those "Best Viewed in..." gif's all over the place again AND we would never be able to fully move onto that tech set for a long long time... how long before HTML5/CSS3 become the defacto standard for every new project you work on? I'm currently working on a site which needs to work with Javascript off AND support IE6 (both of which just sucks balls).
I am a bit biased. I love working with JavaScript (I am a C# developer btw) and I have loved seeing it evolve, how much it can do, how well it can do it and how GOOD javascript code makes it very easy and straight forward to work with... on the flip side of that I have seen far too many rubbish scripts from non-programmers!
I think that this is a subjective position, some people find that the dev cycle is faster, in some cases fast enough to offset the debugging and yet others don't experience the issue to the degree that it is highlighted. I see this position from a good deal of people that prefer static languages and for me personally it is just not a huge issue. I just don't run into the issue that static languages are supposed to save me from enough to forgo the rapid development of languages such as JavaScript and Lisp. I think this issue is bore more out of how each of us develops and thinks, rather than some correctness of one over the other.
And this is why I'm scared of writing anything in node.js.
Just getting modules to work in node seemed less intuitive than C includes. Despite all the hype it felt like a step backwards, and a tool to be used only when its strengths (events/streaming) really demanded it.
I am happy to not be a front-end developer in most of my work :)
Node modules are actually well thought out. They resolve circular dependency, and all code inside a module is confined to that namespace.
Whatever tool you take - if you start comparing with another tool that you already use, it's going to be strange and less intuitive. It's almost human nature to gravitate towards familiar things. If that's your own goal, then it's fine. But - to discount something just because it's not familiar to the way you do things is not exactly fair.
I'm planning on looking into headless testing to eliminate the whole icky business of switching to the browser and hitting refresh. I find this much more of a drag than rerunning server side tests in a terminal.
1. Use Google's jsTestDriver (https://github.com/larrymyers/ichabod)
2. Roll your own (My take on a solution: https://github.com/larrymyers/ichabod Node.js + selenium)
By the way, I used to work using GWT and the way we test it is via using MVP pattern + JUnit for any logic code. Works well 99% minus the cross-browser UI bug (but then if we started testing the actual UI code then we're testing GWT itself).
That being said, I hope some meta layer can make it work better while still offering robust debuggability in all browsers.
I keep thinking that Javascript would work okay for things that I'd normally try Lua for (or Guile, if I'm feeling ornery), but I've never seen anyone actually doing it. The existing implementations all seem very heavy-weight.
http://www.nodejs-news.com/NodeConf/browserling-on-Building-...
https://github.com/philbooth/lepr-js/blob/master/precommit.j...