Learn ClojureScript in a Cloud IDE
sekao.net
sekao.net
This is the thing that makes me angry the most. We started with interpreted languages with fast feedback loops and then "real" software engineers got into the game and turned all these interpreted languages with fast feedback loops into "compiled" messes with nightmarish debugging experiences.
Fast feedback loops and obvious debugging trails should be a feature that more people pay attention to and the more layers you add the less likely you are to have either one.
Clojurescript tends to do well with 2 of the 3 you listed. Feedback loops are quick with hot code reloading, side-by-side development, browser tools integrations (ex: with chrome dev tools) and so on. The Clojure/Clojurescript REPL itself is probably one of the best feedback loops I can think of that I've used other than proper Lisp machines or good Smalltalk images. Add in working with a data-oriented approach cljs encourages and using immutable data structures, EDN, transit, and things like that, and again things are a fast feedback loop predictable, and easy to debug.
The actual debug trails however in Clojure and Clojurescript leave much to be desired but are getting better. I personally haven't had many issues but I grew up on assembler, Lisp, C, C++, and that kind of stuff. After a few days, most of the more obscure things are at least predictable and you understand what they are. Given you can attach with a debugger from Emacs, Intellij, Vim, etc. it's even easier to figure out what's going on. Clojurescript and Clojure tend to discourage big monolithic things that aren't composable via the standard library, 3rd party libraries, and language design. You simply will shoot yourself in the foot if you start creating giant framework blobs and things that can't compose, so to me that's a good thing. For instance, using things like map, reduce, cat, transduce, apply, update, etc. become infinitely harder. Of course like any language, anyone can still do dumb stuff but it's nice that things are pretty simple from the functional point of view that common sense hopefully sets off alarm bells for people.
Anyway, Clojurescript in general for me is a superior experience compared to the old days when I messed around with Perl, CGI scripts, PHP, ASP classic (COM+ add-ons!), and so on to get a dynamic website going for something. Refresh, print line, and approaches like that are and have always been garbage. I've never had better visibility into an app than with Clojurescript, and given that most things are idempotent and pure that I write where possible, testing is also even easier. In most SPA frameworks in Clojurescript, you also have a single source of truth and visibility into it is as simple as running a built-in function to grab a map key or just printing the map if you want the old school approach.
That is the state of affairs that upsets me. Each framework and toolset in the js ecosystem is basically a virtual machine with its own idiosyncrasies and incompatible bytecode that doesn't interoperate with anything else in the js ecosystem.
Clojurescript commits some of the same sins but at this point things are too far along and diveristy in general is not necessarily a bad thing. I just wish the debugging experience was better and the tooling was a bit more standardized so I wouldn't have to relearn everything every time I wanted to try another flavor of js.
I've been a bit spoiled by ClojureScript and I can't imagine using much else as far as js tooling. I'm less familiar with Elixir and some other newer options. I've only played with Elixir a bit and not used it on a real deployed project, but some people like the experience of that too. For me what puts Clojurescript over the top is it brings most of the sane things about Clojure and allows me to write JavaScript essentially in a sane way. It also does so without stopping me from being able to use JS libraries when I absolutely have no choice. The isomorphic code potential is just a side benefit - most of the time I can just take a Clojure file and rename it cljs or cljc and it just works as long as I'm not doing anything obviously pure Java there.
I agree Clojurescript commits some of the same sins. As far as tooling, I feel at least Clojurescript's is pretty standardized. I agree there are too many ways of doing the same things out there. JavaScript in my eyes is a terrible language that needs to be taken out back and shot - faster VMs and the browser are not an excuse - the browser itself is in a similar position, but that's another discussion. I've been programming a long time and I've been exposed to some pretty terrible things so I don't say that lightly. JavaScript is doubly awful in the browser. And yes, I get it and am aware of the new enhancements to the language long overdue. Clojurescript is the best current compromise for me, but like anything, I'm happy to use something else if it makes sense.
I'd still advise everyone to be wary and there's no one size fits all. In the past, I tried things like GWT and various approaches in .NET to transpiling and found them lacking or inferior, but I understand they work great for some people. Clojurescript is the first time I've found a happy medium, but it's not for the inexperienced programmer. Some people complain about the barriers to entry, but I'm somewhat glad they are there. Trying not to sound like a get off my lawn guy or an elitist, but I'll say that learning a language and to program in general is best first before trying to do things like networked service i.e. web and mobile apps. I understand people sometimes need immediate gratification and feedback, but it's also why we have so much trash just put out there - it's so easy and people who don't really know how to program often speak the loudest. Patience to learn and overcoming adversity are really valuable skills for programmers. For as many steps we've taken forward, there are so many back.
Clojurescript is a good compromise for me. The signal to noise ratio is a bit better vs. other JS-related offerings for now. I don't feel like we should always chase the lowest common denominator, and I wish people would stop the TLDR approach to programming. To that end, I feel being responsive and positive when interacting with new-comers to programming, and not trying to proselytize <insert your favorite one true way> to everyone is a better approach. Moreover, writing good documentation, organizing things cleanly, and so on is valuable to helping people get off the ground easier. I think we've reached a bit of an age where people want to fly the plane before learning what flaps or a landing gear are. I'm all for helping people, just the right way.
So from that point of view, I do somewhat disagree with part of the article's implied premise of wanting to be friendly to non-programmers with regard to Clojurescript. I've heard this promise so many times, from Visual Basic to Smalltalk to Visual Development Environments to various Web Apps - let's just do better with what we have and focus on taking some risks to replace the bad stuff we're so attached to rather than trying to make everyone into a programmer. Many better choices out there and I can't really see Clojurescript itself as being too friendly to non-programmers. I'm also not a believer in free lunches. But what do I know, I'm just another guy that learned the old way with pencil and paper and believes in learning concepts more than syntax.
I also wouldn't call their feedback loops "fast"; you lose all state between reloads, you're switching application focus back and forth, and more.
It's easy to get angry about losing your pet features without realizing Lisp had it much, much better all along :)
For example the ClojureScript SPA I'm working on has been running for the past day and I've done countless iterations on it, as it runs without ever rebooting it. It receives data from a few websockets and displays it live; I can be the user AND the developer at once.
Iteration times are almost instant without changing application focus; that's easily a few times faster than the feedback loop you mention! Not even counting the fact that you get a live REPL into the running application. And setting all that up was easier than following a LAMP tutorial.
lein new reagent-frontend myapp
You can start it up by running lein figwheel
You now have your app running at localhost:3449 and you can open it in the browser.You can now edit any source in the src folder and see changes reflected live in the browser without having to reload the page.
My current CLJS setup is boot with boot-cljs, boot-reload and boot-cljs-repl. They're configured using normal Clojure code in a build.boot file and the entry points are configured in live-reloadable *.edn files.
That setup is simpler and far more powerful than anything else I've seen in other languages.
I was using leiningen previously but boot proved to be more powerful for less work in my case.
https://github.com/boot-clj/boot
https://github.com/boot-clj/boot-cljs
boot-reload will hot reload new code on file changes, and optionally run a client-side hook. I use it to remount my react views. boot-cljs-repl provides a REPL into the browser you can use from the cmd line or directly in your editor. I'm using it with emacs-cider, but there are clients for most major editors.
I maintain Luminus http://www.luminusweb.net/docs specifically to make it easier for people to get started. For example, if you wanted to make a new web app with Clojure you could do:
lein new luminus myapp
cd myapp
lein run
That's all there is to it.I would recommend using Leiningen, just because it is more popular. If you're starting out, then you don't really need to change that much stuff in the project file aside from adding dependencies.
And thank you for your work in the community. Luminus is great, and I Macchiato looks really nice as well.
As I pointed out in the original comment, you don't really have to use Cursive if you're starting out. Cursive is great for working on serious projects, but it's certainly not a requirement for trying Clojure.
Aside from Atom, you also have Light Table, VS Code, Vim, Emacs, and Eclipse. Chances are a lot of people would be using at least one of these tools. As far as having to download the JVM and Leiningen, it's not really different than what you'd have to do for Python, Ruby, or Node.js.
So, I don't think the situation for Clojure is really any worse than most languages. That said, I think that Nightcoders could remove any friction in starting with the language.
Usually there's one place for dependencies, one for builds, one for configuration; each using their own tools and/or languages. That list grows quickly as well. A single tool to drive it all is bliss.
I recently had to take over a few Ruby projects and the tooling is so spread over its hell; bundle, gem, rake and others.
After signing in to my Google account, the popup disappears and nothing happens.
I seem to get this in my browser console everytime I load the page:
Uncaught DOMException: Failed to read the 'sessionStorage' property from 'Window': Access is denied for this document.
I tried disabling adblock as well.
/home/sekao/nightcodersdeploy/data/308/317/hs_err_pid25822.log