Fork me on GitHub
#boot
<
2015-09-16
>
alandipert00:09:50

no, but that's what boot.sh is

alandipert00:09:21

not to say that we couldn't all use something like that tho - boot.sh just runs a minimal java program that downloads the rest of boot from maven

alandipert00:09:46

and so is able to update most of itself easily, but is not self-contained

alandipert00:09:07

it's how we make the windows boot executable

dave00:09:20

aha - that could be super useful

alandipert00:09:31

a task around that, combined with the existing uber task, could be dope

dave00:09:38

i'm curious how you handle updates with boot.sh -- what happens when you run boot -u?

alandipert00:09:49

the idea is to manually manage or use your system's pkg manager to manage boot.sh

alandipert00:09:02

then boot.sh manages the version of boot core, the stuff from maven

alandipert00:09:20

boot -u updates core but not boot.sh

dave00:09:59

i think we're doing something similar with alda -- the alda launch script is just a boot script which loads the dependency [alda "LATEST"] and then passes any command line args to the alda.cli/-main method

dave00:09:54

i'm not sure we want to automatically update, though -- might move to manual updates, for more flexibility

dave00:09:09

(so we're not forcing updates on people)

alandipert00:09:02

with alda it seems like it might make more sense to forego boot at runtime.. like use boot to construct a jar that is boot-free and has all deps

alandipert00:09:27

otherwise you pay boot startup time which is a little slower than just clojure, because it starts up pod pools

dave00:09:34

yeah! i had that thought

dave00:09:20

it's also a better user experience, since we're trying to make this as easy as possible for beginners -- not having to install boot first would be a big win

dave00:09:30

we've had a bunch of github issues raised by people running into boot-related issues -- the kinds of things regular clojure/jvm users are used to (having a recent enough JDK, heap space issues, etc.), but which are not as intuitive for people who just want to download alda and go

dave00:09:39

i think i'll look into writing a boot task that pairs with the uber task to create standalone executables

dave00:09:11

is there an advantage to not AOT-compiling? the lein-bin task in particular requires that you AOT the main class

alandipert00:09:06

that's something boot-ubermain avoids

alandipert00:09:12

i wrote a java shim that dynamically loads clojure

alandipert00:09:32

the advantage to not doing it is AOT makes for all kinds of weird bugs

alandipert00:09:10

https://github.com/adzerk-oss/boot-ubermain/blob/master/java/adzerk/MainSploder.java does the same thing that a servlet container would do, in that it adds jars in the jar to the classpath and calls an entrypoint

meow00:09:47

@juhoteperi: I'm not the original author of lein-generate, though I do use it for Cursive. Would be great for it to be part of Boot. On my machine I called it lein-project as that was easier for me to remember since I always think "oh, I need a lein project.clj file for cursive..."

alandipert00:09:59

@dave: this goes pretty far:

boot -d boot/base:2.2.0 -d boot/core:2.2.0 -d org.clojure/clojure:1.7.0 -d alda:LATEST -d adzerk/boot-ubermain:1.0.0-SNAPSHOT ubermain -m alda.cli/-main

alandipert01:09:09

the ubermain task is flawed in that the resulting jar doesn't have pods/dynamic dep support... and you're using merge-env to pull in fluid r3. if you don't do that -- and set fluidr3 as a dep in the alda build.boot -- i think ubermain could do what you want

dave01:09:58

ah, i didn't think about dynamic dep support

alandipert01:09:13

yeah the ubermain makes a jar that starts in kind of a crippled environment

alandipert01:09:29

not the full boot environment, but you can work around it i bet

alandipert01:09:51

and with a standalone jar you can use all the existing java tooling to make .exe, etc

dave01:09:34

this definitely gets me halfway there

martinklepsch11:09:10

Re lein-generate I think there is a link to a gist at the bottom from where I copied most of it. Later on I made some small modifications.

isaac15:09:00

Can boot use latest version for dependency when not specify dependency version? such as gem of ruby

micha15:09:39

isaac: yes, you can use "RELEASE" version

micha15:09:45

for latest release

micha15:09:06

or a version range, like "(0,)" to include snapshots etc

micha15:09:38

you never ever ever ever ever ever ever ever want to release artifacts with these kinds of dependencies though

micha15:09:48

you can use that for development though

isaac15:09:12

@micha thanks, I got it

micha15:09:13

eg. boot -Bd adzerk/bootlaces show -u

micha15:09:00

the -d option will use RELEASE if you don't specify a version

isaac15:09:12

lein can do this?

micha15:09:35

usually you use snapshot versions for this

micha15:09:48

i never specify RELEASE or anything

micha15:09:57

i just make a SNAPSHOT release if i need to

micha15:09:20

what are you needing to do?

isaac15:09:46

some time, I want write some test code quickly

micha15:09:06

how do you mean?

micha15:09:24

oh like just load something in a repl

micha15:09:51

with the latest version of some dependency so you can fiddle around?

isaac15:09:10

yes, your are right, I’m testing reagent now

micha15:09:25

i'd use the -d option for that

micha15:09:29

to boot itself

micha15:09:37

you don't need a build.boot file or anything

micha15:09:21

boot -r src -d org.clojure/clojurescript -d adzerk/boot-cljs -d reagent repl

isaac15:09:23

I was started repl already, I want to add some dependencies

micha15:09:24

or something like that

micha15:09:45

yeah at the repl you can add them with the RELEASE version

micha15:09:02

(set-env! :dependencies '[[something/reagent "RELEASE"]])

micha15:09:12

you'll get the latest release version

micha15:09:45

a little trick to see what the latest version is you can do:

micha15:09:05

boot -d some/dependency show -u

micha15:09:18

that will show the latest version of some/dependency

isaac15:09:36

Is set-env! for :dependencies will concat to dependencies?

isaac15:09:45

instead of replace

micha15:09:50

no it will overwrite

micha15:09:03

but remember that :dependencies only matters when you're making a pom.xml

micha15:09:14

if you care what's in there you can do like this

micha15:09:31

(set-env! :dependencies #(conj % '[some/dep "1.2.3"]))

micha15:09:35

or like this

micha15:09:54

(merge-env! :dependencies '[[some/dep "1.2.3"]])

micha15:09:12

merge-env! will do the right thing depending on the key

micha15:09:41

it is not possible to remove a jar from the classpath once it's been added

micha15:09:53

so removing it from :dependencies doesn't actually remove it from the JVM

micha15:09:58

there is no way to do that

micha15:09:14

we have pods for that

micha15:09:24

if you need to load and unload dependencies

isaac16:09:09

Can remove dependency from the JVM by remove it before require it

micha16:09:28

classloaders don't support removing a jar

micha16:09:43

once you add a url to the classloader it's there for good

micha16:09:52

and it will resolve classes from the jar

micha16:09:58

until you close the classloader

micha16:09:42

i suppose you could write your own classloader but it would be fraught because objects could exist that were created from bytecode in the jar

micha16:09:12

seems like you'd need to be a real classloader expert to do it correctly

ericnormand19:09:17

Hi there fine folks!

ericnormand19:09:33

I'm trying to get boot-cljs to output to a different file

ericnormand19:09:42

is there a setting for that?

micha19:09:48

hi ericnormand!

micha19:09:22

are you using a .cljs.edn file to tell it how to build?

ericnormand19:09:42

was working from the boot-cljs-example

micha19:09:47

that's how i would recommend, you can then eliminate pretty much all :compiler-options

ericnormand19:09:51

I'm actually writing something up about the build process

ericnormand19:09:01

is there an example I can see somewhere?

ericnormand19:09:08

is it in your blog post?

micha19:09:17

the .cljs.edn file is just a edn file that boot will construct a cljs namespace from

micha19:09:42

{:require [foo.bar baz.baf]
 :init-fns [foo.bar/main]}

micha19:09:08

the idea is that this is just data, which all tasks can parse and understand, and even modify

micha19:09:24

that would be the contents of say src/main.cljs.edn

micha19:09:45

that would result in main.js, and a namespace that :requires etc

micha19:09:13

so boot-cljs uses info in there to generate the :main and :output-to settings for the cljs compiler

micha19:09:15

and other things

micha19:09:26

but the cool part is that other tasks can now inject code

micha19:09:42

like the cljs-repl task adds to :require and so does boot-reload

ericnormand19:09:49

by modifying the edn?

micha19:09:50

so you don't need flags and stuff in your application

micha19:09:12

this is open, vs a real namespace, which is closed

micha19:09:28

since it's impossible to statically understand cljs namespace

ericnormand19:09:51

and the filename main.js is taken from the foo.bar/main init-fn?

micha19:09:07

it's taken from the .cljs.edn file name

micha19:09:25

so like if src/ is on the classpath

micha19:09:33

and you have src/foo/bar.cljs.edn

micha19:09:51

that would result in foo/bar.js in your output

micha19:09:31

the boot-cljs README should have some more specific details

micha19:09:41

it's basically a cljs shim

ericnormand19:09:15

do you mind if I run the text I write by you when it's ready?

ericnormand19:09:19

it's not long

micha19:09:56

sure no problem!

ericnormand19:09:38

I assume you don't need to put all of the namespaces in the :require list

ericnormand19:09:45

it will pull in transitive ones

micha19:09:58

exactly yes

ericnormand19:09:06

and can init-fns be omitted?

micha19:09:09

it's so you can restrict it

micha19:09:19

this was started before the :main option existed in cljs

micha19:09:36

init-fns can be omitted yes

micha19:09:01

the idea was that we'd generate .cljs.edn files with boot tasks

micha19:09:09

like hoplon generates them etc

micha19:09:37

and then we'd have enough info about the context and application that boot-cljs could figure out all the compiler options on its own

micha19:09:46

and just do the right thing

micha19:09:20

like hoplon generates html and .cljs.edn files based on a single "page" spec

micha19:09:44

that way it can automatically ensure that the html file loads the correct js file and so on

ericnormand20:09:13

would you mind having a read?

ericnormand20:09:18

it's supposed to be very basic

ericnormand20:09:24

just give people an idea, mostly

ericnormand20:09:37

of how easy it is to set it up

micha20:09:40

that looks great

micha20:09:10

when you say "built-in" i was thinking like not needing to get any maven dependencies

ericnormand20:09:23

ah, good call

ericnormand20:09:49

I'll just remove "built-in"

micha20:09:20

sorry i haven't responded to youremail btw, i saw it and appreciate what you did simple_smile

micha20:09:30

i was in finland, just got back last night

ericnormand20:09:40

I saw the video

ericnormand20:09:48

I'll be linking to it this week

micha20:09:52

finland is beautiful

micha20:09:58

highly recommend

ericnormand20:09:32

## [Hoplon and Javelin, WebDev Alternate Reality][1] Youtube

[1]: 

Micha Niskin is making really cool stuff in an alternate reality. He
visited this reality through a portal in a finnish sauna to present the
awesomeness of Hoplon and Javelin.

micha20:09:47

hahahahaha

micha20:09:56

:thumbsup: 💯

ericnormand20:09:10

I do want to write a post about Hoplon

ericnormand20:09:17

but it's not on the schedule yet

micha20:09:34

we're in the middle of getting organized, too

ericnormand20:09:45

just trying to get through the launch of ClojureScript and Om, which starts on monday

micha20:09:01

it'll be a little while before everything is set up with hoplon

micha20:09:12

i saw that, good luck!

ericnormand20:09:42

I'd love to see what could be done in terms of interactive development with the cljs-in-cljs

ericnormand20:09:05

well, I really want to play with Hoplon

micha20:09:12

have you done anything with cljs-in-cljs yet?

ericnormand20:09:13

it's very compelling

micha20:09:34

i'm very curious about it

micha20:09:48

like maybe doing some more dynamic stuff in the client

ericnormand20:09:04

there's a code editor that guides you through tdd

micha20:09:10

using require/refer and so on in the client

ericnormand20:09:17

I've done a few posts using it

ericnormand20:09:31

and I've got an updated version of that editor coming soon

micha20:09:36

interesting

ericnormand20:09:49

for a small function, it compiles fast enough to do it as you type

micha20:09:12

i imagine things like hot-patching code and stuff

micha20:09:29

could be more robust with cljs-in-cljs

ericnormand20:09:23

a meteor-like system would be cool

ericnormand20:09:02

store cljs code in one cell, the js version is a calculated cell from that

micha20:09:07

haha man that little editor you have is awesome

ericnormand20:09:09

all synced to the server

micha20:09:29

it's like unlocking the next level when you handle each case

micha20:09:41

this is great

micha20:09:54

perfect way to show how it works

ericnormand20:09:01

going to strange loop micha?

micha20:09:29

i think i'll go to the next one

micha20:09:36

never been yet

micha20:09:48

everyone says it's the best one

jaen20:09:10

@ericnormand: sorry of OT, but that eval exercise is really swell

ericnormand20:09:38

there's one for implementing map and reduce too

ericnormand20:09:42

I hope to have more

ericnormand20:09:41

also seeing people's answers has been enlightening

ericnormand20:09:52

they share them in the forum I link to at the end

jaen20:09:07

Yup, I've noticed. Though I must say I kind suck at the TDD part of it, since I usually end up skipping a few tests at a time implementing something before it's even tested ; f