Boot: Getting Started with Clojure(lionfacelemonface.wordpress.com)
lionfacelemonface.wordpress.com
Boot: Getting Started with Clojure
https://lionfacelemonface.wordpress.com/2015/01/17/boot-getting-started-with-clojure-in-10-minutes/
6 comments
what's the difference between boot and leiningen?
This is a good comparison: https://groups.google.com/d/msg/clojurescript/yxpDGv6RrXQ/Fs...
I don't see myself ditching lein anytime soon, but I'm glad to see some competition in this area.
One of the things that nags me about boot, is that it recommends using file extension `.boot`. Is it just me?
Is there any specific advantages to using another file extension rather than using `.clj`
Is there any specific advantages to using another file extension rather than using `.clj`
The reason we use a different extension is because a build.boot file is not semantically a Clojure file.
Clojure's default namespace is 'user'; .boot files run in 'boot.user'. Clojure only automatically refers clojure.core; we refer clojure.core and also boot.core.
So, dependencies notwithstanding, Clojure wouldn't be able to make sense of a build.boot file, and we think the .clj extension would be disingenuous.
We differ in these ways from .clj because one of our goals was to make it easy to create Clojure applications as single scripts.
The downside is users must configure their editors to get syntax highlighting, but we think this is the lesser evil.
Clojure's default namespace is 'user'; .boot files run in 'boot.user'. Clojure only automatically refers clojure.core; we refer clojure.core and also boot.core.
So, dependencies notwithstanding, Clojure wouldn't be able to make sense of a build.boot file, and we think the .clj extension would be disingenuous.
We differ in these ways from .clj because one of our goals was to make it easy to create Clojure applications as single scripts.
The downside is users must configure their editors to get syntax highlighting, but we think this is the lesser evil.
The problems you mention seem generic issues others face when using clojure in similar ways. So may be we can convince clojure core developers to add hooks that provide these features without having to introduce new fileextensions each time somebody needs to refer an extra namespace by default.
Just a suggestion. But the current solution seems reasonable until then.
Just a suggestion. But the current solution seems reasonable until then.
Why in the world would you use Boot over Leiningen if you've never used Clojure before? `lein repl` and you're on your way.
'boot repl' works just fine too.
Imperative builds are a different mindset - where lein projects feel like a different language which emulates Clojure syntax, boot feels more like a library, and context switching is a favourite HN bugbear. Being able to program a build can be a boon, where otherwise you might've had to rely on the creator of your build tool catering to your special case with an appropriate flag.
In practice, though, I've never created a project with very interesting builds in either tool, I only dabble in Clojure. The test will ultimately be whether the community finds it useful.
Imperative builds are a different mindset - where lein projects feel like a different language which emulates Clojure syntax, boot feels more like a library, and context switching is a favourite HN bugbear. Being able to program a build can be a boon, where otherwise you might've had to rely on the creator of your build tool catering to your special case with an appropriate flag.
In practice, though, I've never created a project with very interesting builds in either tool, I only dabble in Clojure. The test will ultimately be whether the community finds it useful.
The biggest thing that grabbed me about boot was the scripting capability. To be able to build concise little applications - 'complete', 'real' applications that can be distributed and deployed - is very freeing. The point of the article was to illustrate how you can get running quickly using that feature and logically evolve into "serious" project-based work as needed.
Ultimately there's more to being productive as a beginner than using the REPL.
Ultimately there's more to being productive as a beginner than using the REPL.
I absolutely refuse to use this because of the inappropriate name of the tool. It is far too general to be anywhere near what I would consider well-named, and seems mostly just a lazy convenience. cloboot would work just as well, and give a user some chance of associating the name of the tool with the purpose of the tool. (I already have a boot.)
When you install the tool you can name it whatever you want. I have qualms about "just download this binary and execute it, trust me" installation methods, but the advantage is you can put it wherever, and name it whatever suits your system.
I recommend naming it 'unicorn-slomp'. Or 'mustash-cash-stash' - but you can pick your own cartoons to make a reference to, you are totally empowered here.
I recommend naming it 'unicorn-slomp'. Or 'mustash-cash-stash' - but you can pick your own cartoons to make a reference to, you are totally empowered here.
Better if the canonical name was just set in a sensible way by its proprietors...
When I've tried using clojure for really simple things, like a "Hello, World" program, and compiled this to a jar to run with something like "java -jar hello.jar," the time it takes to start up the program is pretty abysmal. I'd like to use clojure for something on the Raspberry Pi, but it can take about 30 seconds to run "Hello, World!"
Any secrets to getting it to start up faster, or am I just stuck?