Fork me on GitHub
#boot
<
2015-09-17
>
Doug Kirk00:09:40

@micha Sorry I'm a bit late to the discussion, but you don't have to write your own ClassLoader, you can use instances of the standard ones. If you're inclined, and really want to be able to "remove" things from the classpath, You just create a new CL instance, add the paths to it, and set it as the thread's contextClassLoader. A lot of the Java EE containers manage classpaths that way. The default CL is a java.net.URLClassLoader. Ping me if you want to go that direction...I've done some pretty weird things with CLs.

micha00:09:26

@kirked: wouldn't that do crazy things with the Clojure runtime? Clojure uses the TCCL for its mutable state

Doug Kirk00:09:05

@micha I'm sure it could be managed. I'd have to see the TCCL code

micha00:09:10

like when it generates bytecode

Doug Kirk00:09:34

You could have the code gen in one CL and then load the gen'd code in another

micha00:09:46

you would also have to track down all references to things that have been "removed", i guess

Doug Kirk00:09:40

I'd think it would be more explicit than that; remember, you're not "removing" individual classes, but rather classpath entries

Doug Kirk00:09:32

We're just adding in to the new CL the paths we want, vs. diff'ing against something. We just don't add the paths that were "removed"

micha00:09:10

that's kind of what pods achieve

micha00:09:36

pods allow you to make new runtimes that have a different classpath

Doug Kirk01:09:36

Yeah, when I noticed them I'd guessed you were just using different classloaders to implement pods

cigitia03:09:44

Let’s say that there is a task `x`. When (boot (watch) (x)) is run, is there a way for task `x` to detect whether certain files have changed since the last time it was run within the current pipeline?

cigitia03:09:48

My use case is that I have a task that takes a considerable amount of time to occur, but its output changes rarely. I also have tasks that depend on the first task’s output, and those downstream tasks are frequently modified.

cigitia03:09:09

I could use cache folders, but I’d like to ask first if there’s a way to do it this way. Caches seem dirtier, since they introduce incidental state that I have to additionally manage.

cigitia03:09:39

@mynomoto: Excellent; thank you. This looks like exactly what I need.

jeluard16:09:15

How do people use boot projects in IDE like cursive? manually maintaining an associated project.clj?

juhoteperi16:09:19

I'm hoping the authors of lein-generate task would package it as a library simple_smile

jeluard16:09:48

That’s still manual as I have to regenerate it every time I change my deps.

jeluard16:09:14

Like good old style maven when IDE didn’t support it natively.

juhoteperi16:09:32

You could compose lein-generate task with your other tasks

jeluard16:09:09

Do you mean having a boot task calling lein-generate to create a project.clj from my build file?

jeluard16:09:21

Ideally I’d want to have everything transparent. Are there plans in that regard or are people happy the way it is?

jeluard16:09:20

I understand from @micha recent comment cursive couldn’t possibly support boot without running tasks.

onetom16:09:53

jeluard: most of our machines are a bit underpowered (2.5GHz i5 + hdd) so we are just using sublime text 3 which is still lightning fast + terminal to run ~ boot watch serve hoplon cljs speak we don't really use repl much either. no one really feels the need for more, at least until we have more cutting edge machines i guess

jeluard16:09:32

Ok so I guess sublime doesn’t rely on data from your build file in this case. One nice feature of cursive is understanding your dependencies (completion, doc, arity check, ..). That requires extracting this information from your build file.

onetom16:09:05

it's a nice thing until u realize how rarely u need to rely on this. i see arity error maybe once a week and i might pop into a boot -BP repl or a planck recently maybe every second day.

onetom16:09:51

i might check documentation out on http://conj.io 1-2 times every day and of course refer to github pages

onetom16:09:29

otherwise i have a ~/r/ directory with hoplon, boot-hoplon, castra, javelin, etc source in it and i have that whole directory open in a 2nd sublime window and i can do a full-text search on it in 2-3 seconds or a fuzzy search for a filename instantaneously...

onetom16:09:44

our primary window contains all of our company specific source code. they are in different git repos but under the same dir, so i can just open it up with subl ~/exicon

onetom16:09:16

it's 3.6GB, but sublime file name fuzzy search is near instant in it

onetom16:09:12

all this is not as accurate as cursive might be, but in practice it's just not a problem

onetom16:09:09

opening 4-5 repos as different projects in different windows in intellij IS a problem though, because it's annoyingly laggy even on our 3.8GHz i7 quad-core mac...

onetom16:09:56

tab completion for symbol names are the same story. sometimes it completes to the wrong one, but 95% of the time i just type some fragment of what i want, even "soem grabage" and sublime autocompletes it correctly, since it corrects swapped letters...

jeluard16:09:07

Ok makes sense. Surely this removes the issues of integrating boot with cursive simple_smile

onetom16:09:17

and it's compatible with lein too 😉

onetom17:09:11

or gulp or rake or mocha or whatever buildshistem u have to use

onetom17:09:12

i just tried, so i can give u a realistic example of our experience: if i type sre<tab> or ser<tab> it gets autocompleted to search-results (in a 100 line file) in summary: fck accurate (~=costly) language analysis...

onetom17:09:07

i often feel like im not typing on the keyboard, i just "think" into/onto the keyboard, like a monkey (or my 11months old daughter simple_smile by pounding on it roughly and the correct text just appears automatically

onetom17:09:48

(without that annoying autocompletion dropdown dialog constantly obscuring the surrounding source code... simple_smile

juhoteperi17:09:15

Cursive requiring to run boot to find the dependencies shouldn't be a problem I think. It could just run some custom task each time it sees that build.boot has been changed and cache the value.

juhoteperi17:09:18

Might even be possible for Cursive to run the tasks in Cursive JVM (it would need to add Boot to the classpath somehow)

juhoteperi17:09:30

Or Cursive could use pods!

micha17:09:50

yeah there are options to boot show for editors to use

juhoteperi17:09:52

show -e should contain all the necessary data

onetom17:09:19

deraen: but cursive is not open source, right? and it wont planned to be opened either, no?

juhoteperi17:09:54

Yeah. But it only means that we need for @cfleming to implement it 😉

micha17:09:14

also boot show -C should provide classpath info more like what an editor expects

micha17:09:38

i.e. source directories where the user's source files are instead of the tempdirs used internally by boot for the real classpath

juhoteperi17:09:55

micha: the same paths are in env? :source-paths :resource-paths

micha17:09:04

the env contains the real classpath

juhoteperi17:09:10

it contain both

juhoteperi17:09:48

dependencies, directories, source-paths, resource-paths, asset-paths, target-path, repositories

micha17:09:35

ah i see what you mean, yes

juhoteperi17:09:51

pretty much the same format as what lein has

micha17:09:15

i'm tracking now simple_smile

juhoteperi17:09:41

though Cursive usually differentiates source, test and resource paths. But I'm not sure if that has any real effect.

jeluard17:09:45

I usually have some special source paths for dev mode merged during some specific tasks execution. Would those show with boot show?

micha17:09:31

if show task is after the specific tasks then yes

micha17:09:54

@juhoteperi: i had an interesting conversation with @jumblerg this morning about a web.edn spec

micha17:09:40

it would be cool if we could maybe get together and work out something simple to start with

micha17:09:16

he's been studying all the java ee web specs

juhoteperi17:09:48

Hmm what would http server need to do to support servlet spec?

juhoteperi17:09:41

I still fear that Http-kit doesn't support servlet stuff

micha17:09:42

nothing, we would generate a web.xml file or whatever we want

micha17:09:02

yeah i told him about that and he said he'd look into it and have a definite answer

micha17:09:36

he needs web sockets for some project so i tried to get him to use http-kit for it simple_smile

micha17:09:52

i guess the idea is similar to .cljs.edn

micha17:09:03

we can generate specific things from the spec file

juhoteperi17:09:27

and in this case it might make sense to allow only one spec file (web.edn) per fileset?

micha17:09:27

but once we have the spec file we can use it to coordinate different tasks that contribute to the overall aim

micha17:09:34

i'm not sure

micha17:09:44

at first probably yeah

micha17:09:18

but like .cljs.edn we might discover that the filename itself could contain the info we need to disambiguate

juhoteperi17:09:39

Also web.edn might be too general name and cause clashes

micha17:09:00

perhaps like

micha17:09:09

foo/bar/baz.web.edn

micha17:09:29

where .web.edn is the extension

micha17:09:45

i thin kthat's specific enough to not cause too many clashes

martinklepsch22:09:49

@micha: a static, “basic” map of dependencies? In my experience the majority of projects don’t dynamically add critical dependencies in separate tasks. “critical” is a bit vague here but maybe let’s say it means something like “needed in uberjar”

micha22:09:52

@martinklepsch: what about like boot watch foo bar baz show --leiningen project.clj

micha22:09:05

that would write the project.clj or whatever

micha22:09:41

yeah i understand the need, but making things that only work when you don't make new abstractions is a really bad way to go imo

micha22:09:06

a better option is to let boot do its thing and then when eevrything is computed write a file

micha22:09:23

you can still consume that file

micha22:09:46

but we're not stuck in the declarative world of having to be able to specify everything sttically

micha22:09:49

*statically

martinklepsch22:09:51

I’m going to sleep. I think I agree with what you’re saying. The cases where you would benefit most is when you use lein/boot side by side which arguably isn’t a common situation.

micha22:09:32

yeah i think definitely the way to achieve this is with some kind of a task

micha22:09:38

boot shouldn't be a build tool

micha22:09:49

it shouldn't know anything about your project, per se

micha22:09:59

it should just get you to a place where you can program in clojure

martinklepsch22:09:22

Can I quote you on that “boot shouldn’t be a build tool”? 😄

micha22:09:30

and provide some library functions for getting your program fully bootstrapped and convenience functions for building jars and other things

micha22:09:45

that's why we named it "boot"

micha22:09:54

it just bootstraps you into program world

micha22:09:06

you write the build tool yourself from there on

micha22:09:18

make your own tasks, or use boot libraries that have tasks in them

martinklepsch22:09:22

cool, didn’t know.

micha22:09:07

our main idea was that your project will inevitably need its own unique build tool once it reaches a certain level of complexity

micha22:09:25

so boot just gives you the foundation for writing this tool

micha22:09:13

this is why boot doesn't assume that you need to compile AOT before making a JAR

micha22:09:20

it knows nothing about JARs really

micha22:09:27

things like that

micha22:09:56

but when you make your tasks, or at the command line, you can specify these things very easily

micha22:09:00

like you know what you want to do

micha22:09:17

boot doesn't know, cause you're probably doing something we never thought of

martinklepsch22:09:16

I -> bed (should have done that a while ago already)

micha22:09:26

haha see you later

micha22:09:31

sorry i was hung over

micha22:09:48

it would have been cool to see some of Tampere together