5 ms·
Learn ClojureScript in a Cloud IDE
- zimablue 10y agoThis is really cool, I gave up on Clojurescript partly because the weight of tooling combined with everything being bleeding edge when I didn't even understand Javascript tooling buried me at the time.
- yogthos 10y agoThe tooling is actually much simpler than equivalent Js setups from what I've seen. All you need is a copy of the JVM and Leiningen installed. Then you can make a new project simply by running: 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.
- kenshi 10y agoNice. Have been meaning to play around with ClojureScript but the tooling has always put me off.
- jeremiep 10y agoWhat's wrong with the tooling? 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 https://github.com/boot-clj/boot-cljs https://github.com/boot-clj/boot-cljs https://github.com/adzerk-oss/boot-reload https://github.com/adzerk-oss/boot-reload https://github.com/adzerk-oss/boot-cljs-repl https://github.com/adzerk-oss/boot-cljs-repl
- smnplk 10y agoI still need to try boot. So for clojurescript, I don't need figwheel, I can just use boot-reload and coot-cljs-repl ?
- jeremiep 10y agoYeah, and their configuration is mostly automatic; running the tasks starts their respective server and injects the client-side code to connect to them in the build. 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.
- WillPostForFood 10y agoWhat are you using to edit? I don't think the any one piece of the tooling for Clojure or ClojureScript is a problem, but getting it all going together for people who aren't familiar with the ecosystem and terminology (possibly including Java, Lisp, Emacs, functional programming, and Clojure itself) can be an obstacle. Even by your choice of boot over lein, means a majority of beginner tutorials are going to have a gap because they tend to focus on Leiningen.
- yogthos 10y agoI highly recommend using Cursive https://cursive-ide.com/ https://cursive-ide.com/ for editing. It's an excellent IDE with lots of great features. For as simple editor Atom is a good choice as well http://yogthos.net/posts/2016-10-15-AtomWithLuminus.html http://yogthos.net/posts/2016-10-15-AtomWithLuminus.html I maintain Luminus http://www.luminusweb.net/docs 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.
- dangerbird2 10y agoOne thing to remember is that clojure (and most Lisp dialects) take the concept of code-as-data and vice-versa very seriously. Your configuration of a clojure/script project is not done via magical directories full of yaml and json files with an obtuse build description language: instead, you just use ordinary lisp code, ideally with utility macros and functions provided by your build tool. Likewise, everything from defining dependencies to configuring tasks is described by simple Clojure lists, maps, and literals: all of which can be generated by ordinary clojure functions and macros. Basically, if you understand the core concepts of clojure, you can configure you project to exacly the way you want it with little extra difficulty.
- jeremiep 10y agoWhat I like best is that a single tool (lein or boot) drives the entire development pipeline and you get to choose between data-driven or code-driven approaches respectively. 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.
- zubairq 10y agoThis is great. I built something similar over the last two years, but I pivoted to something else, as it is a hard problem to build a cloud IDE
- zubairq 10y agoThis is great. I built something similar over the last two years, but I pivoted to something else, as it is a hard problem to build a cloud IDE
- EamonnMR 10y agoI got an out of memory error when I tried this out-if the author is following along, they can apparently find the error log at: /home/sekao/nightcodersdeploy/data/308/317/hs_err_pid25822.log
- _qc3o 10y ago> When I was a teenager, I got a Dreamhost account and learned web development by uploading PHP scripts and refreshing the page until I got what I wanted. The world of transpilers and SPAs has robbed beginners of this simple experience. 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.
- optionalparens 10y agoI don't understand what you are getting at here, can you explain more? How is an interpreted language turned into something compiled? It sounds more like you have an issue with heavy weight frameworks, which I can agree with, but I am not sure if this is what you are really trying to say. I also agree that feedback loops and debugging trails are important. 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.
- abrax3141 10y agoBioBike (originally BioLingua & BioLisp) has had a full CL, incrementally compiled, cloud IDE since ~2002. It was also pre-loaded with tons of bioinformatics software and data, statistical software, and a theorem prover. The concept was for biologists to use it. Some did. [Edit: And it had a precursor to clojurescript, called lispscript, due to Peter Seibel.]
- pcr0 10y agoI can't run the IDE. 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.
- joeevans1000 10y agoLooks really cool! Any chance you'll let us sign up at some point with an email and password, or username and password, and not google?