Fork me on GitHub
#clojure
<
2016-11-09
>
romain00:11:29

Does anyone use Windows as OS ? How is Clojure on windows nowadays ?

seancorfield01:11:57

I do a fair bit of Clojure on Windows 10 and both Leiningen and Boot seem solid.

shaun-mahood01:11:00

@romain: great, for the most part it just works

seancorfield01:11:11

The Ubuntu bash on Windows 10 is almost solid enough to run Leiningen and Boot there too 🙂 Although there’s a bug with starting new processes in Java that sometimes gives an error about unable to allocate memory. Microsoft know about it...

seancorfield01:11:31

(that’s the Windows Subsystem for Linux)

cschep01:11:36

Docker for Windows is also something to look into.

cschep01:11:59

though the JVM has been running well on windows for a long time 😄

shaun-mahood01:11:19

Ooh that's exciting. Without having to use the Linux subsystem, the only issues I've run into are for libraries that deal with the filesystem or expect bash to be there. But for the most part I've found little difference between using Mac and Windows.

romain01:11:38

it's cool! Surface devices seem more attractive now 🙂

cschep01:11:55

what libraries require bash?

stevenyi01:11:37

I use windows 10. I use a standard cmd prompt for running lein repl, but use mingw or ubuntu bash with tmux and vim and can connect and edit from there.

romain01:11:08

@stevenyi I heard about Powershell, isn't ready yet ?

stevenyi02:11:29

@romain: I don't use Powershell myself so I can not comment on it. Always seemed like an interesting technology to me though.

sophiago02:11:38

oh wow, i had this tab open and probably should not be wasting the time...but have been hearing a ton about powershell lately

sophiago02:11:32

here's the thing tho...how great can a new shell be to gain traction? it's not in POSIX? i can still use AWK for heavy lifting? do people who write shell scripts care enough to adopt a new shell script that's not even standard on anything but .NET?

sophiago02:11:06

(btw, this is with the knowledge it was open sourced in August)

romain02:11:36

Fair enough 🙂

sophiago02:11:36

you know what i'm saying? i feel like there's a certain subset of people who still write shell scripts and they're not about to adopt something that's objectively better if it's new and not supported literally everywhere you could telnet into

sophiago02:11:03

if they think they're going to grow a base of people writing shell scripts then i think that's a little nuts

romain02:11:23

Yes. So I guess when I read the news it was not people enthusiasm but just hype

sophiago02:11:28

well, what i've heard wasn't news. it was actual user enthusiasm. and i'm not on windows so is bash there really that lousy?

cschep02:11:30

there are a lot, lot, lot of .NET devs

cschep02:11:45

their shell sucked, and MS released one that is way better for them. room for both I think.

sophiago02:11:36

yeah i guess i was assuming the people i was talking to were mostly outside of .NET

sophiago02:11:49

and just excited about its feature set

sophiago02:11:01

like if you're learning shell scripting from scratch today

seancorfield02:11:39

PowerShell is a very interesting creature but it's a niche, even on Windows. bash has pretty much won that battle -- and Microsoft recognizes that with WSL (Windows Subsystem for Linux). I remember listening to Scott Hanselman's podcast about PowerShell and being quite excited (as a Mac user) but when I tried it on Windows I found it clunky and not enough stuff was available to use it for anything much...

seancorfield02:11:48

...Microsoft overall are close to tempting me away from 20+ years of Apple tho' at this point. Once WSL is solid enough to run my company's DEV stack, I'll switch to a Surface Studio from an iMac...

seancorfield02:11:34

Lately when I've been using my Windows 10 laptop for any DEV work, I've been entirely in bash / WSL running emacs-snapshot / Boot etc.

cschep02:11:23

Microsoft is a very interesting company and I’m glad they’re moving the direction that they are.

seancorfield03:11:40

I've been a diehard Apple fan for most of 20+ years. I had a System 6 box running Tenon Intersystems' MachTen (BSD based unix) and did nearly all my dev on the unix side back then. I went to System 7 and 7.5... then waited for OS X. I've used every Windows since 3.1 but always preferred Macs... Windows 8 began to sway me, 8.1 was better and 10 is great. Now 10 has WSL / bash, it has pretty much everything I need. I run Outlook on my Mac with Bing as my preferred search engine, and Outlook / Cortana / Bing on my iPhone... so...

seancorfield03:11:23

It's been very interesting to try to run Leiningen / Boot on WSL. Early on you could barely get the version printed, then it just kept improving.

sophiago03:11:32

had some internet downtime so coming in late to this, but thanks for the perspective @seancorfield

sophiago03:11:33

i've been on mac for nearly my whole life and will certainly switch to a very cheap linux machine whenever this one dies. unfortunately it's the first gen with solid state so that's not happening anytime soon and i'm stuck with ~2 hrs battery life

sophiago03:11:28

but i've also been interested to try .NET if the time commitment didn't feel so high and every work opportunity i've had wasn't so opposed to it. scripting excel with F# sounds really appealing

sophiago03:11:28

also interesting aside: i've seen you around Quora...where i somehow became the top writer for Clojure by answering 6 questions or something and usually err on the side of vagueness out of fear i'll get things wrong. i'm always thinking, "what about that guy? surely you should be asking him?" haha

cschep03:11:52

another thing I love about the windows ecosystem is just being able to build up a box for $800 that has soooo much power compared to what you can get for even double the price from Apple

cschep03:11:04

will be hard to sway me away from apple laptops, but I’m open. 🙂

seancorfield03:11:51

When Mono was first porting to Mac, I did a lot of builds and tests. I focused on XSP a lot. I was hopeful for another cross-platform, broadly-adopted option. I'd love to write in F# on Mac/Linux and have it really be viable.

sophiago03:11:10

yeah, that's my point. i won't even run windows. i just want a battery that lasts forever on something super cheap and relatively light

cschep03:11:27

🙂 yeah.

cschep03:11:57

my late 2015 macbook air has the most insane battery life to weight ratio, such a useful machine

cschep03:11:02

.. but the screen omg the screen

cschep03:11:05

4k to that?

cschep03:11:07

my poor eyeballs.

seancorfield03:11:11

After the last round of MacBook updates, I'm "meh". The Surface Book and Surface Studio are awesome pieces of hardware... if we can just get the shell (bash) story sorted there. One of the big issues with the Clojure ecosystem has historically been the focus on bash and the relative lack of support for Windows cmd shell.

seancorfield03:11:42

The latest Surface laptops are claiming 10-12 hour battery life I think?

cschep03:11:51

that’s more than enough

sophiago03:11:10

i think apple has often claimed near that on new models, but i've never experienced it

cschep03:11:05

yeah i’ve gotten 10 on mine i bet, it’s crazy

shaun-mahood05:11:55

@seancorfield: check out the work Frank Krueger has been doing - http://praeclarum.org - his recent work has been in F# and was developed on a Mac (and iPad), and he's had a couple apps with something like 90% code sharing across Mac/Windows/iOS (Calca) - it's super interesting stuff. Website doesn't have it all, but he's got a podcast - http://www.mergeconflict.fm - that has some good info as well, @praeclarum on twitter and github.

yonatanel10:11:38

Now that spec and datomic are getting more popular, what is the recommended naming and nesting scheme for maps representing relationships? For example, a command to register a person to a course would have {:student/id x :course/id y} or {:register/student {:student/id x} :register/course {:course/id y}} or {:register.student/id x :register.course/id y} or {:register/student-id x :register/course-id y} etc?

naomarik15:11:22

@seancorfield windows 10 has a linux subsystem now with full ubuntu, i'm playing with getting a decent dev environment setup now on my new SP4. I got it to supplement my macbook pro and to draw on, and to perhaps switch completely to windows if they release a quad core surface book edit: scrolled up and saw you knew that 😉

ghadi15:11:40

Friendly reminder to take general posts to #general

pvinis16:11:46

are the euroclojure videos available somewhere?

pvinis16:11:53

the one that happened a couple of weeks ago

roelofw17:11:42

Is cursive still the best ide for Clojure on Windows ?

shaun-mahood17:11:11

@roelofw: I wouldn't say it's the best or not, but it's completely functional and works very well in Windows. Emacs can also be setup to work perfectly well on Windows if that's your preference, those are the only 2 editors I have experience with so can't speak to any others.

roelofw17:11:54

oke, and it the "best" way to learn first do the clojure koans and then work on 4 clojure ?

roelofw17:11:33

@naomarik and which "ide" do you use. I tried Atom but it was a non-runner

naomarik17:11:34

@roelofw i use spacemacs

cschep17:11:35

atom on mac with proto-repl and parinfer is nice

cschep17:11:39

not sure about windows, never tried it.

shaun-mahood17:11:44

@roelofw: Lots of good options for getting started - http://www.braveclojure.com/clojure-for-the-brave-and-true/ is a pretty common starting point, there are also plenty of videos on Youtube, https://purelyfunctional.tv/, https://lambdaisland.com/, and more resources at http://clojure.org/community/resources - and make sure to ask lots of questions in #beginners as you go

roelofw17:11:10

oke, and are the exercises not to hard on braveclojure

roelofw17:11:35

expecially the last 2 exercises seems to be hard to do

roelofw17:11:07

here exercise 4 and 5

cschep17:11:46

it’s definitely a new challenge to approach clojure vs. a language that has new syntax but let’s you think the same way

cschep17:11:58

i have found clojure challenging the way i think, which can be harder 🙂

roelofw17:11:13

I have a little experience with ruby and haskell , so I hope I can use this knowlegde a little

roelofw17:11:13

so every exercise is doable for a beginner

jrheard17:11:59

@roelofw i like intellij + cursive

roelofw17:11:37

jrheard (y)

roelofw18:11:46

Why does the function call not responding with a outcome here :

(ns do-things.core)

(defn add100
  "I count 100 to a given number."
  [x]
  (println (+ 100 x )))
=> #'do-things.core/add100
(add100 1)
CompilerException java.lang.RuntimeException: Unable to resolve symbol: add100 in this context, compiling:(C:\Users\rwobb\AppData\Local\Temp\form-init3191465696969623098.clj:1:1) 

roelofw18:11:04

I use the cursive ide

cschep19:11:55

your repl might not be in the right namespace

cschep19:11:00

(ns do-things.core)

cschep19:11:03

in the repl

cschep19:11:07

and then try (add100 1)

roelofw19:11:28

It worked when I copy/paste things. Otherwise I cannot type a closing ) in repl

sandbags19:11:07

It’s a bit of a moot point now as I have taken a different approach but I thought I would pose the question: I am raising an exception in a macro I have written and I was writing a test (using expectations) to ensure the exception was thrown in the right circumstances. Only I found that I couldn’t catch the exception. Presumably because it is occurring at compile time and the (try … (catch …)) only applies to the run-time context and the code the macro would have expanded to if an exception hand’t been thrown. And then I thought… so how can I catch this exception? I couldn’t think of a way or find anything on this topic via Google. Anyone else come across this? I notice some other macros throw exceptions so I don’t think it’s something you should not ever do.

roelofw19:11:57

is paredit a good choice or can I better use parinfer ?

seancorfield19:11:24

You could expect that a call to macro-expand on the quoted expression threw that exception @sandbags

sandbags19:11:36

@seancorfield brilliant suggestion, let me try that

seancorfield19:11:53

@roelofw Not sure what you’re asking — your choice of editor makes that decision for you, doesn’t it?

sandbags19:11:45

@seancorfield Cursive, at least, offers both. I didn’t like the idea of parinfer

roelofw19:11:56

I also not. When I enter something it overrides the ) and I see a error

roelofw19:11:17

and it is correct on Cursive I can change between the two

sandbags19:11:43

@roelofw i think it’s a matter of preference which you use

roelofw19:11:56

@sandbags I did already tried both

roelofw19:11:13

That why I know it overrides things when I type code

slipset21:11:52

thanks to @b06 for pointing that out 🙂

roelofw21:11:13

yep, clojurians for me is a few hours down

piyush22:11:36

hi community - simple question on Yada - access control

piyush22:11:20

If is set access-control :allow-origin to * should that be sufficient for the client to access my servers api methods ?

piyush22:11:01

or conversely if i don’t have any access control on a resource method - should i be able to call the api from a client ?

mccraigmccraig23:11:59

@piyush :access-control {:allow-origin #{"*"}} is for CORS - you won't need it for non-browser-based clients or single-origin browser-based clients