Fork me on GitHub
#boot
<
2015-12-31
>
laforge4901:12:07

MS really made a mess of things with its intentional unix incompatibilities. All that has changed now and Windows 10 fixes many, but not all, the issues. Only I figure that over time the number of ads will increase to the point where you must pay to turn them off.

micha01:12:53

i couldn't figure out a way to detect this situation

micha01:12:13

and the exception is a generic one

micha01:12:33

i suppose when there's an exception it can just try again with different settings

laforge4901:12:18

The prefix concept is used to handle root directories on UNIX platforms, and drive specifiers, root directories and UNC pathnames on Microsoft Windows platforms, as follows: For UNIX platforms, the prefix of an absolute pathname is always "/". Relative pathnames have no prefix. The abstract pathname denoting the root directory has the prefix "/" and an empty name sequence. For Microsoft Windows platforms, the prefix of a pathname that contains a drive specifier consists of the drive letter followed by ":" and possibly followed by "\\" if the pathname is absolute. The prefix of a UNC pathname is "\\\\"; the hostname and the share name are the first two names in the name sequence. A relative pathname that does not specify a drive has no prefix.

micha01:12:04

like given two paths: new java.io.File("/foo/bar") and new java.io.File("/baz/baf")

micha01:12:21

i'm not sure how to know if those are on the same filesystem or not

micha01:12:36

if they're not then some operations will fail

micha01:12:19

i think that windows exception "can't move file to another device" or whatever, i think that's actually being thrown when the .createLink() method is being called

laforge4901:12:20

Convert to absolute paths and look at them.

micha01:12:49

i guess on windows you can't mount filesystems in arbitrary directories?

micha01:12:05

because in unix the path doesn't tell you anything about which filesystem it's on

laforge4901:12:06

yup! Typically, a file system requires that all links (directory entries) for a file be on the same file system. Furthermore, on some platforms, the Java virtual machine may require to be started with implementation specific privileges to create hard links or to create links to directories.

micha01:12:02

yeah it's interesting that windows says it can't move a file

micha01:12:07

when nobody's trying to move a file

micha01:12:03

soft links won't work because they need to point to something

micha01:12:33

with a hard link you can treat it as a regular file

micha01:12:45

and if you delete the original it will still be a valid file

micha01:12:21

i mean if you delete the original, the link will still be a valid file

laforge4901:12:48

ok. I was wondering about this: The target parameter is the target of the link. It may be an absolute or relative path and may not exist. When the target is a relative path then file system operations on the resulting link are relative to the path of the link.

micha01:12:05

so in windows all absolute paths have a drive letter prefix?

micha01:12:23

and all filesystems mounted must be assigned a drive letter?

micha01:12:42

if this is true then the path comparison test will work on windows

laforge4901:12:05

As for deletion, you can write a function to test for links and do what you consider right. 😄

laforge4901:12:22

Such joy!... not

micha01:12:50

yeah really i need to make a function that wraps java.nio.file.Files/createLink

micha01:12:59

and throws proper exceptions

laforge4901:12:05

But in reading the java api, it looks like delete always just deletes the link if it is one

micha01:12:16

yeah i'm using this code:

micha01:12:03

there's still a race condition there, but i'm using a semaphore to synchronize these operations

laforge4901:12:04

so delete if exists deletes the link if it exists.

micha01:12:42

yeah the problem is with createLink()

laforge4901:12:17

Just always use symbolic links?

micha01:12:17

if the destination and the source are on different filesystems it says "can't move to different filesystem"

micha01:12:35

symbolic links don't really work for this application

micha01:12:57

i can just catch exceptions

micha01:12:17

and then do some heuristics to figure out what caused it

laforge4901:12:17

well, that's better than nottin.

micha01:12:35

yeah and rethrow with a more specific exception

laforge4901:12:47

I usually do not have a second drive, but it stinks not to support it.

micha01:12:00

yeah and we want to warn the user also

laforge4901:12:03

read, commercial apps?

micha01:12:09

because in that case we'd have to fall back to copying all the files

micha01:12:21

which is obviously a lot less efficient

laforge4901:12:20

As an old java/windows user I generally just work with strings and avoid links. Its strings in the config file anyway.

micha01:12:52

boot uses hard links to avoid copying files

laforge4901:12:15

and unix devs will never give up their links.

micha01:12:27

structural sharing

micha01:12:37

a wonderful thing

laforge4901:12:58

yeah, if some poor fool hasn't created a bowl of spagetti!

micha01:12:21

they're probably rich, that fool

micha01:12:31

rich as in money, not as in hickey, that is

laforge4901:12:49

I've seen too many operators with only a hs ed. And in the old days most devs only had 6 mo of trade school!

laforge4901:12:28

Yeah, give the manager's raises to the person who created the mess.

laforge4901:12:40

--that will be the day!

laforge4901:12:37

I did a lot of research today. Looking for reactive hoplon sites.

laforge4901:12:51

And I found your comment (defc page-width) (.on (js/jQuery js/window) "resize" #(reset! page-width (.width (js/jQuery js/window)))) (defc= dynamic-rules (cond (<= page-width 800) {:background-color "red" :border "4px black"}))) (div :css (cell= (merge {:height "400px"} dynamic-rules)))

laforge4901:12:07

--frame that somewhere, will you?

laforge4901:12:56

As a non-js dev, I see a ton of value in hoplon, but a terrible lac of readable docs!

laforge4901:12:08

Looking for "hoplon for dummies"

laforge4901:12:33

Or at least some reactive demos that will run on any device. simple_smile

laforge4901:12:10

I mean, all the capability is there, @micha but it is not intended for folk like me.

micha01:12:30

documentation is hard

escherize01:12:42

Ah, I just found this HN thread: https://news.ycombinator.com/item?id=9671106 might be worth posting it somewhere i dont know

laforge4901:12:49

And code is just way too much fun!!!

laforge4901:12:41

nice link. and yes, boot is getting there. But there is a huge market for haplon that can not yet be addressed.

laforge4901:12:58

Hoplon would be great for a first web page!

micha01:12:32

@escherize: whoa

laforge4901:12:35

You could have beginners writing reactive web pages on their first day. simple_smile

micha01:12:11

yeah that's the dream!

laforge4901:12:15

@escherize I really liked that link too!

laforge4901:12:33

So get funded why not? 😄

laforge4901:12:45

It is a wonderful dream

laforge4901:12:52

I plan to ask a lot of dumb questions here. And one thing I know is that you need a sample audience.

laforge4901:12:34

I also want to teach my wife, who knows html and css but is not a programmer. I figure hoplon would get her coding without her knowing it. 😄

micha01:12:14

i mean if you use html and css you're already programming

micha01:12:26

html is a programming language, just a really bad one

laforge4901:12:27

The integration is so painless in hoplon.

laforge4901:12:43

using js on a web page is normally deep magic

laforge4901:12:59

--especially for non-programmers.

micha02:12:04

like when a html file is loaded in the browser it's parsed and lexed, then it's built into an AST, and evaluated to produce the DOM

micha02:12:48

hoplon just adds a means of abstraction and better primitives to that, basically

laforge4902:12:49

yes, thank god! I am hopeful that one day I can create nice web pages. Though my wife will need to provide the visuals. 😄

escherize02:12:03

Actually my gf knows html/css as well. Been slogging through learning parinfer with her.

escherize02:12:19

I built my company's frontend on re-frame, never really gave hoplon a look, though i did like the Javelin concept.

escherize02:12:45

She's done just a tiny bit of reagent/hiccup editing for us

laforge4902:12:03

@escherize There's still, I suspect, some work needed before we see commercial apps in production.

micha02:12:31

there are commercial apps in production simple_smile

laforge4902:12:51

But mostly there is this lack of docs for the less technically inclined, or for those who just are not web devs.

laforge4902:12:32

I find everything is hoplon very easy and friendly, especially after talking with @micha

laforge4902:12:07

Glad to hear that @micha. But where is the hoplon sponsor page? simple_smile

laforge4902:12:00

The nyc lisp clubs spend $1,400 on a joint cristmas party paid entirely by commercial sponsors!

escherize02:12:54

would you believe I've been using clojure for 2 years and never even noticed

:source-paths ["src"]
:resource-paths ["assets" "out"]
in a project.clj?

laforge4902:12:50

yup. That kind of thing happens a lot.

laforge4902:12:05

I'll stick with generating project.clj files from build.boot.

laforge4902:12:00

--Ijust need it to make cursive work.

laforge4902:12:20

Boot is just so right compared to build, make, ant, lein etc etc etc.

laforge4902:12:48

Thanks so much for that Micha and friends!

micha02:12:34

🍻 happy you enjoy it!

flyboarder02:12:42

@laforge49: 🍪 for everyone!!!

laforge4902:12:56

me and much of the clojure community!

laforge4902:12:21

--especially those working in clojurescript!

laforge4902:12:31

@flyboarder I find it funny that there is much talk about hoplon being an alternative reactive framework. But I looked at demos today and except for one commercial project, I couldn't find any demos that would resize for mobile/tablet/desktop. Seems like a huge hole!

laforge4902:12:50

Making this easy for mere mortals would be a huge selling point. Easy enough, I am sure. But then where are the demos? (I know. hoplon is so wonderful that everyone is too busy using it!)

laforge4902:12:08

And yes. I am being selfish. I want working examples that i can crib into my code. 😄

laforge4902:12:02

An interesting set of demos is a first, non-trivial, step. Once you have that, writing docs will still be very hard, but will be a bit more manageable.

laforge4902:12:42

Hoplon by example, as it were.

laforge4902:12:34

Preferable examples that run fine on mobile.

micha02:12:48

i mean there are a lot of demos in the hoplon/demos repository

micha02:12:55

more than most projects i think

laforge4902:12:34

Ah, I only went through the links on the web page.

laforge4902:12:50

u have a resizing demo???

micha02:12:57

the problem with demos and mobile is that the problem is still pretty much open

micha02:12:09

there are no good solutions yet

micha02:12:17

there are things like what twitter bootstrap does

micha02:12:24

"responsive design"

micha02:12:37

but that's a hack that involves a lot of incidental complexity

micha02:12:47

some of the demos use bootstrap though

laforge4902:12:50

and hoplon is perfect for defining the solution.

micha02:12:20

right but until then the demos would be unnecessarily complex

laforge4902:12:24

hoplon/boot that is.

laforge4902:12:40

lets not waste the effort then.

laforge4902:12:23

some folk will anyway and that will be helpful, of course. simple_smile

micha02:12:31

i've made commercial hoplon apps that were mobile, web, etc

laforge4902:12:08

and I gather they were needlessly complex.

micha02:12:28

well they needed to work

micha02:12:59

i don't think it was that bad

micha02:12:09

we did things like what you pasted above

laforge4902:12:28

A bit of wrapping needed then, hmm?

laforge4902:12:44

--the work being in defining the api, of course!

micha02:12:48

well sometimes you need to completely swap a widget for another one on mobile

micha02:12:05

like on a webpage you have a ton more space

laforge4902:12:12

but again, handled by a common wrapper.

micha02:12:16

compare that to a 3" phone display

micha02:12:26

well it ends up being two different applications

laforge4902:12:39

it is good boot can be made so smart.

micha02:12:47

trying to pretend that they're the same usually adds totally unnecessary layers

laforge4902:12:53

sure--different layout and all that

micha02:12:08

you need to just omit a lot of functionality for mobile

micha02:12:36

we used http://trigger.io to wrap the hoplon app in a native app container

micha02:12:47

so we could put it in the app store and whatnot

micha02:12:54

and it was usable like a regular app

laforge4902:12:55

I figure demos should be largely designed for demos, and for tablets etc you just add things.

laforge4902:12:11

--better than omitting things

micha02:12:22

yeah that's pretty much how we did it

laforge4902:12:29

for mobiles I mean

micha02:12:30

we started with a mobile web app

micha02:12:46

then we built on top of that for the desktop web app

micha02:12:00

and then we packaged the mobile web app as a native app for the app store

laforge4902:12:20

yeah, ouch. but ok when someone is paying for it.

micha02:12:33

i don't know of any other way to do it

laforge4902:12:46

no one wants web apps on safarie

micha02:12:06

oh by web app i mean website

micha02:12:25

not browser extensions or plugins or anything like that

laforge4902:12:32

download a real browser,, baby!

laforge4902:12:25

I've seen a lot of prejudice among apple users against non-native apps. 😄

laforge4902:12:17

But then, that market has the money.

laforge4902:12:35

http://trigger.io sounds cool. But all this is really way out of my field!

micha02:12:27

yeah i haven't checked in on http://trigger.io lately

micha02:12:36

progress moves fast in that area

micha02:12:43

new tools coming along all the time

laforge4902:12:16

its such a huge market!

seancorfield03:12:33

Note to self: Boot will not work on a Windows 10 VM inside Parallels hosted on a Mac if you have Home folder sharing enabled...

seancorfield03:12:06

(because it cannot correctly create the hard links that it wants)

seancorfield03:12:08

@micha: How does Boot decide whether it has completed its first run?

seancorfield03:12:52

I installed Boot.exe on Windows 10 on a VM, mistakenly had Home folder sharing on, and Boot failed (see above). Fair enough I though, just disable Home folder sharing and reboot.

seancorfield03:12:12

Now Boot won’t run — I’m getting

java.io.IOException: The network name cannot be found
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(File.java:1879)
at Boot.download(Boot.java:168)
at Boot.install(Boot.java:224)
at Boot.main(Boot.java:250)

seancorfield03:12:56

So I guess it’s finding a network name from some cached location… but I’m not sure where?

seancorfield03:12:40

Ah, I’m guessing it’s something to do with environment variables pointing Boot to the wrong place… will do some digging and report back…

micha03:12:23

@tcrawley: that looks great

seancorfield03:12:00

Hmm, I might have to try to build boot-bin from source on that VM to add some debugging to figure out what it doesn't like

flyboarder03:12:03

@laforge49: regarding examples, have you ever looked through the code for the old hoplon site?

tcrawley04:12:30

if you want to fold that in to boot show, I'm happy to help

tcrawley04:12:53

or leave it as a standalone task, I'm cool with that as well

micha05:12:44

@tcrawley: i think it would be great to have as part of the show task

tcrawley05:12:20

okiedoke - I can work on a PR tomorrow

seancorfield05:12:50

FYI, I'm reaching out to Jean Niklas about lifting the Leiningen new/template code to turn into a Boot task, to make sure they're cool with me creating a boot new task that can pull templates from Clojars etc and render new projects.

seancorfield05:12:55

Specifically to be able to render Leiningen templates as well as similar Boot templates...

seancorfield05:12:37

I was reading over the lein new/template code and was surprised how small it all is... Powerful for something so simple simple_smile

tolitius08:12:54

added a couple of code analyzers drafts kibit and yagni to https://github.com/tolitius/boot-check logically eastwood and bikeshed are next. note: keep in mind most of code analyzers don't support reader conditionals yet

micha09:12:11

very nice!

seancorfield16:12:33

Jean Niklas says they'd be very happy for us to go ahead with a boot new style task based on the Leiningen code! So I'll go ahead and take a run at that.

alandipert16:12:07

why would he object?

alandipert16:12:36

(it would be awesome btw, thanks in advance)

jaen16:12:55

@seancorfield: I'm not that familiar with lein templates - can it only create whole projects, or can it as well emulate something like Rails generators, when you can define code that will generate some part of the project. Having an option to do something like boot new some-framework-template generate component User would be awesome.

micha17:12:27

@jaen: i think maybe generators or scaffolding belongs in a dependency package that exports a new task of its own, like this:

alandipert17:12:59

oh i get it re: coordinating with lein, possible "namespace" interference

jaen17:12:03

I suppose that also could work, though looks slightly less appealing syntactically.

seancorfield17:12:17

lein new some-template just creates a new folder tree from a template but we can do a bit better because boot new -t some/framework can generate based on a template but boot new -g component=User can generate a component (`User`) based on the current project.

jaen17:12:36

And I'm unsure about extensibility - if I understand correctly --component would be a keyword option on some task, right? Then how could this be extensible with new types of generators?

seancorfield17:12:12

So the template project can include a dependency that boot new knows how to use to generate new pieces of code.

seancorfield17:12:07

@alandipert: It was more a case of "Would the Leiningen folks feel aggrieved if Boot could generate projects from lein-template templates that already exist — which I think is an important use case to get us off the ground.

alandipert17:12:29

@seancorfield: gotcha, yeah i'm tracking, and i agree

seancorfield17:12:08

Since if both Leiningen and Boot can use lein-tempate projects, then template authors have more of an incentive to just add build.boot (and maybe boot.properties) to an existing template and we get Boot support out of the box.

micha17:12:09

@jaen: that's the idea, it would be a different task for each generator

micha17:12:23

i guess they wouldn't all be able to use the name generate

seancorfield17:12:39

@jaen: Well, we can discuss how best to have both templates and generators… @micha

micha17:12:00

sure, i was just throwing things against the wall there simple_smile

jaen17:12:19

Yeah, I guess that's a bit of a problem - Rails generators are great in how uniform they are

micha17:12:40

rails is like the opposite of boot though

alandipert17:12:44

i wonder about resolving against github instaed of maven

jaen17:12:44

People can expect if some library provides a way to generate some code

alandipert17:12:47

for templates only

micha17:12:50

philosophically

jaen17:12:05

Then it can be accessed in the usual way

jaen17:12:17

Well, sure I can agree the Rails world is at odds with the Clojure way of doing things

jaen17:12:24

But convention are a useful thing

micha17:12:25

github, that's an interesting idea

seancorfield17:12:30

Feel free to add issues and comments here https://github.com/seancorfield/boot-new

alandipert17:12:35

we can own the transitive dep info convention

seancorfield17:12:45

(that’s just a brand new repo where I’ll write the task etc)

jaen17:12:58

If some convention could be figured out that would let those generative tasks be uniform

alandipert17:12:59

also presumably a template will never depend on another template

donmullen17:12:02

@alandipert: I like the github for templates idea.

jaen17:12:35

It might be a huge boon to anyone who would want to make a CoCy web framework in Clojure

jaen17:12:46

And boom, we're suddenly as big as Rails ; d

jaen17:12:54

I'm exaggerating a bit here of course

seancorfield17:12:54

I plan to add Boot support into two Leiningen templates I maintain, so having boot new -t some/template be able to use Leiningen templates will be useful for me at least simple_smile

alandipert17:12:21

cool, yeah maybe the github thing we do later. i'm attracted to it because i never want old versions of templates

jaen17:12:32

But a common, extensible way for templating projects in whole or in part would be a huge boon.

jaen17:12:37

As for github

jaen17:12:48

I'm not sure I like it

jaen17:12:55

At least in the way it being limited to github

alandipert17:12:28

maybe it needn't be

jaen17:12:29

Any git repo on the other hand (so I can use, say, gitlab) - sounds good and lowers the barrier to creating new templates.

donmullen17:12:43

Agreed - should be generic git url.

seancorfield17:12:24

Oh, and my Windows 10 weirdness from yesterday is due to Java thinking my user.home folder is still the \\Mac\Home network folder that it was when Parallels was still sharing my host home folder… 😞

jaen17:12:55

Another example is git, where you have main git command and then subcommands that have their own, different options tailored to the semantics of a command. There's even an example in tools.cli how something like that could be implemented. I'm not sure how boot's CLI parser is done and it's certainly geared more towards understanding a pipeline composition rather than subcommands, but if generators are to be useful (and used) they need to be ergonomic and I'm just wondering if there could be a way to simplify the CLI syntax for that case. Also the fact that boot -d some/framework generate --component User would be hardly extensible (you can't add options to an already existing tasks if I understand correctly) also seems problematic in terms of composability of those generators. Maybe they could warrant their own syntactic case and/or macro? I don't know.

micha17:12:35

maybe generators belong in a shebang style boot script

micha17:12:05

the pattern there gives you the full git-like subcommand experience

micha17:12:26

different from boot's rigid pipeline cli

micha17:12:16

seems like it might make sense to have that in source control, maybe, like a migration

micha17:12:31

your project plus the script used to generate the scaffold

seancorfield17:12:08

"Also the fact that boot -d some/framework generate --component User would be hardly extensible " — thats why I suggested boot new -g component=User since it could use something in the project itself as the generator...

jaen17:12:01

This sounds sensible. I imagine keeping generators as tasks would be a good idea in that you could easily compose them up to building a whole-application template from a composition of generators, but having a script that supports calling them outside of the rigid boot CLI structure would be helpful.

jaen17:12:12

@seancorfield: ah, right, sorry - didn't pick up on that.

seancorfield17:12:54

So boot new -t template would generate a project (`build.boot` etc) and then boot new -g could make use of something the project provides. Well, the project template could also provide its own generate task in the build.boot file so generate would be based on the project itself. We’ll have to discuss what is the best approach.

seancorfield17:12:57

Oh the horror… So Java uses entries in the registry to figure out your home directory on Windows apparently and Parallels had \\Mac\Home\Desktop etc in the registry even after I deactivated sharing 😞 https://clojurians.slack.com/archives/boot/p1451583324007718

seancorfield17:12:19

Anyways, a quick bit of regedit and Boot is back up and running on my Windows 10 VM now.

jaen17:12:19

#windows

micha17:12:32

@seancorfield: maybe a note on the wiki?

seancorfield17:12:00

Is there a good page for Windows stuff?

micha17:12:07

2.5.5 has an update that fixes an issue with windows btw

micha17:12:36

there is a page for developing on windows, but nothing authoritative yet

micha17:12:48

i have a placeholder in the wiki home page for it