Fork me on GitHub
#boot
<
2016-02-01
>
donmullen01:02:53

@seancorfield: you are on a roll!

seancorfield01:02:47

I’ll blog about boot-new next I expect, and then go back to some of the specifics of our setup at work.

donmullen01:02:22

@seancorfield: Looking forward to the boot-new post - will be taking a look this week. Hoping to put together a template this week — hopefully with a couple of variants in the template to choose from.

akiva01:02:30

The timing is impeccable, @seancorfield. I woke up this morning and my first thought was, ‘I’m switching to Boot!'

akiva01:02:44

Found your blog posts all of 15 minutes later through Twitter, heh.

seancorfield01:02:27

@donmullen: So boot -d seancorfield/boot-new new -t template -n mytemplate will get you started simple_smile

seancorfield01:02:03

@akiva: If there’s anything specific you’d like me to blog about… no promises, but always open to suggestions…

akiva02:02:58

I’ll see if I come up with anything. I only messed with it a bit this morning. But my experience with Boot has been similar to yours. I was unimpressed when I first messed with it last year but the latest release is, as you put it, ‘hella slick’.

martinklepsch10:02:41

> Unfortunately there was no equivalent for Boot so this was my first chance to roll up my sleeves and write a Boot task as a standalone project. @seancorfield typo in that sentence I believe

dm310:02:51

is there an analog of lein release in Boot?

dm310:02:14

how do you approach that, as the task would need to modify the version in build.boot - do you put the version in a separate file?

dm310:02:01

e.g. I'd want to update to non-snapshot version, tag in VCS, build the artifact and push to the repo

dm310:02:21

ok, so bootlaces build-jar and push-release take care of 3 last points

dm310:02:28

just the version bump remaining

dm310:02:46

Feel free to try:

boot -d tulos/boot-criterium \
      bench -l "1.6" -g "'(reduce + (range 1000))" -Q -d org.clojure/clojure:1.6.0 -- \
      bench -l "1.7" -g "'(reduce + (range 1000))" -Q -d org.clojure/clojure:1.7.0 -- \
      bench -l "1.8" -g "'(reduce + (range 1000))" -Q -d org.clojure/clojure:1.8.0 -- \
      report -f table -O

martinklepsch10:02:01

Some people use a version.properties file in the project root

nha10:02:02

@dm3 :

boot -d tulos/boot-criterium \
>       bench -l "1.6" -g "'(reduce + (range 1000))" -Q -d org.clojure/clojure:1.6.0 -- \
>       bench -l "1.7" -g "'(reduce + (range 1000))" -Q -d org.clojure/clojure:1.7.0 -- \
>       bench -l "1.8" -g "'(reduce + (range 1000))" -Q -d org.clojure/clojure:1.8.0 -- \
>       report -f table -O
Retrieving boot-criterium-0.1.0.jar from 
WARNING: JVM argument TieredStopAtLevel=1 is active, and may lead to unexpected results as JIT C2 compiler may not be active. See .
WARNING: Final GC required 5.281677860549284 % of runtime
WARNING: Final GC required 44.58526630009102 % of runtime
WARNING: JVM argument TieredStopAtLevel=1 is active, and may lead to unexpected results as JIT C2 compiler may not be active. See .
WARNING: Final GC required 5.656352080834244 % of runtime
WARNING: Final GC required 41.77912144672444 % of runtime
WARNING: JVM argument TieredStopAtLevel=1 is active, and may lead to unexpected results as JIT C2 compiler may not be active. See .
WARNING: Final GC required 4.922599703901996 % of runtime
WARNING: Final GC required 47.784064042933686 % of runtime

| :benchmark/goal |      :mean |   :variance |    :upper-q |   :lower-q | :evaluation-count | :outlier-effect |
|-----------------+------------+-------------+-------------+------------+-------------------+-----------------|
|             1.6 | 94.4719 µs |   4.9134 µs | 100.3137 µs | 88.4984 µs |              6960 |       :moderate |
|             1.7 | 29.8147 µs | 666.6242 ns |  30.6617 µs | 29.2901 µs |             20262 |       :moderate |
|             1.8 | 34.3943 µs |   1.7045 µs |  35.8316 µs | 31.3956 µs |             18414 |       :moderate |
Implicit target dir is deprecated, please use the target task instead.
Set BOOT_EMIT_TARGET=no to disable implicit target dir.

dm310:02:39

ok, so need to pass better JVM_OPTS to boot first

dm310:02:51

to get rid of the warnings

nha10:02:46

oh right

dm310:02:33

export BOOT_EMIT_TARGET=no

dm310:02:36

export BOOT_JVM_OPTIONS=-XX:+TieredCompilation

nha10:02:29

boot -d tulos/boot-criterium \
      bench -l "1.6" -g "'(reduce + (range 1000))" -Q -d org.clojure/clojure:1.6.0 -- \
      bench -l "1.7" -g "'(reduce + (range 1000))" -Q -d org.clojure/clojure:1.7.0 -- \
      bench -l "1.8" -g "'(reduce + (range 1000))" -Q -d org.clojure/clojure:1.8.0 -- \
      report -f table -O
WARNING: Final GC required 2.56721392080561 % of runtime
WARNING: Final GC required 56.36157027919461 % of runtime
WARNING: Final GC required 3.1793859479060917 % of runtime
WARNING: Final GC required 38.52524948607234 % of runtime
WARNING: Final GC required 4.761463704088819 % of runtime
WARNING: Final GC required 60.68148534637626 % of runtime

| :benchmark/goal |      :mean |  :variance |    :upper-q |   :lower-q | :evaluation-count | :outlier-effect |
|-----------------+------------+------------+-------------+------------+-------------------+-----------------|
|             1.6 | 87.9661 µs | 16.9452 µs | 103.3679 µs | 66.0190 µs |              5832 |       :moderate |
|             1.7 | 11.3507 µs |  3.5532 µs |  17.4694 µs |  9.4659 µs |             41754 |         :severe |
|             1.8 | 28.1620 µs |  4.1321 µs |  31.3467 µs | 22.3552 µs |             20616 |       :moderate |

dm310:02:58

the Criterium warnings I didn't get rid of

dm311:02:06

should capture the output and have the option to show/hide it

dm311:02:25

you can remove the -Q flag and get a more representative benchmark

dm311:02:32

anyway, hope it's useful

nha11:02:27

One of my projects still uses lein, and criterium so I will give it a shot at some point simple_smile

martinklepsch16:02:50

"Unfortunately there was no equivalent for Boot so this was my first chance to roll up my sleeves and write a Boot task as a standalone project." I think that probably was meant to be "no equivalent for Expectations" ?

seancorfield16:02:26

For Boot. As opposed to for Leiningen

jaen16:02:09

I'm with Martin on this one - also felt it reads as if "there was no equivalent [of boot test] for Boot" to me. And that's probably not what was mean, but "there was no equivalent [of the leiningen Expectations task] for Boot".

jethroksy16:02:14

easy fix by adding task: no equivalent task/plugin for boot

jethroksy16:02:26

task would make sense

jaen16:02:01

IMO task would be confusing, because last task mentioned is boot test. I think something like "there was no Expectations task for Boot" with "equivalent" optionally before "Expectations".

danielsz16:02:26

@seancorfield: Not a biggie, but yes, I was also confused with that sentence.

jaen16:02:29

Kind of in a proofreading mode recently ; d

jethroksy16:02:23

ah well I wasn't reading it in context

martinklepsch16:02:53

maybe typo wasn't quite the right word 😊

seancorfield17:02:30

Ah, now I’m not reading this on my phone while out exercising, I see what you mean… yes, that could be clearer… I was thinking it was a different part of the blog post… Sorry!

seancorfield17:02:22

Thank you for reading!

jaen17:02:41

Looking forward to the part on boot new.

martinklepsch18:02:05

Thanks for writing @seancorfield 👍

alandipert18:02:38

hey all, for those that frequent IRC also - just created #bootclj on freenode

alandipert18:02:02

#C08BDAPRA doubled as the boot channel there for many years, figure it's high time for boot to graduate

pandeiro19:02:24

when using a task keyword typed arg at the command-line, does one include the :?

seancorfield19:02:43

No, Boot converts it for you.

seancorfield19:02:04

so —opt foo becomes :foo in the opt variable.

seancorfield19:02:31

If you have o opt VAL #{kw} "keyword args" for example, then -o foo —opt bar will produce #{:foo :bar} in the opt variable.

sooheon21:02:45

I found this gist for using google-maps as a foreign lib: https://gist.github.com/bensu/edd68d11102c2197a729. Trying give the cljs compiler the foreign lib in task-options like this:

cljs {:source-map true
       :compiler {:foreign-libs [{:file ~(str ""
                                              $APIKEY
                                              "&libraries=places")
                                  :provides ["google.maps"]}]}}

sooheon21:02:05

Just directly copy pasted from the gist give me an error that #'clojure.core/unquote is unbound. Replacing :file val with just a string will seem to work, but the “google.maps” namespace won’t be found.

bensu21:02:27

@asolovyov: that is a bad idea!

sooheon21:02:33

d’oh ignore my question above, the correct key is :compiler-options, not :compiler like lein

bensu21:02:08

@sooheon: at the time I didn't realize it but when you do that, you fetch the google maps file at compile time and they come with another key which then expires

bensu21:02:21

then your compiled artifacts suddenly start failing

bensu21:02:28

I'll update the gist

sooheon21:02:23

@bensu: Ah didn’t see you were the author of the gist :) So there’s a better way to do it than this?

sooheon21:02:52

Ok, so the better way is just to add it to html

bensu21:02:22

@sooheon: yeah, just add it as they point out in the tutorial

sooheon21:02:10

@bensu: got it, thanks

leblowl22:02:25

Hello master booters! I have a question for ya'll... I am deploying an http-kit application & was wondering what you guys recommend for simple versioned deployment. Ideally I'd like to be able to run my application with systemd. In the past I made an uberjar and installed that to the local maven repo - I get the versioning & I can run the app with java -jar. I have heard this may not be the best way to do things & am curious what ya'll think.. gracias

alandipert22:02:24

@seancorfield: thanks for pushing 0.3.1 of boot-new so quickly, now the hoplon tutorial doesn't require lein! https://github.com/hoplon/hoplon/wiki/Get-Started

seancorfield22:02:32

Nice! Have you tried it on Windows? Two folks complained in comments on my blog that Boot and more specifically the Hoplon tutorial "doesn’t work" on Windows?

seancorfield22:02:23

BTW, where it says "You will need to make two small changes to the generated files before Running on Windows." — the page it links to has only one change (adding BOOT_EMIT_TARGET=no).

laforge4923:02:57

Where's that link? There used to be 2 changes, but then some code got fixed.

laforge4923:02:24

Never mind, found it.