admin-announcements

Announcements from the Clojurians Admin Team (@U11BV7MTK @U077BEWNQ @U050TNB9F @U0ETXRFEW @U04V70XH6 @U8MJBRSR5 and others)
2016-01-15T05:35:58.003886Z

hello all!

dominicm 2016-01-15T07:53:28.003887Z

howdy

2016-01-15T10:09:59.003888Z

hi everybody, can anyone recommend a free video tutorial on how to build webapps with clojure?

2016-01-15T10:18:37.003889Z

@dev-hartmann: Hey there. Try this one: http://www.parens-of-the-dead.com/

đź‘Ť 2
đź‘€ 1
2016-01-15T10:21:39.003890Z

@bluurn that actually looks like pefect, thanks a lot!

2016-01-15T10:22:07.003891Z

yw!

meow 2016-01-15T12:30:03.003892Z

:deadpeople:

2016-01-15T17:44:33.003898Z

looking for some general advice on getting started. I want to build a websocket backend in clojure. I've read up on the basics of clojure, and I've made it through the first few chapters of living clojure. Would it be more advantageous to finish the book and learn the more advanced topics before I start the app, or should I learn as I go?

2016-01-15T17:46:55.003900Z

when I was learning python/django a few years ago, it was pretty easy to pick things up as I came across various problems. But something tells me clojure's more advanced topics might make that tough

stian 2016-01-15T17:47:06.003901Z

bcoop713: Jump right in :simple_smile: You could also check out @magnars excellent game tutorial, http://www.parens-of-the-dead.com .. It features a frontend and backend communicating using websockets.

2016-01-15T17:49:25.003902Z

thanks, just bookmarked it actually. Does that tutorial use the core.asyc library at all?

jaen 2016-01-15T17:51:03.003903Z

Clojure is hard only if you are not familiar enough with functional programming IMO. Most of it's features are straightforward to understand. It might get a bit harder when trying to understand how to write applications with component or how to use core.async effectively, but for the most part the language is straightforward.

2016-01-15T17:52:10.003904Z

@jaen adopting a more lisp-like workflow takes a change of mindset

2016-01-15T17:52:55.003905Z

@bcoop713: there's quite a bit of core.async in Parens of the Dead, yes. :)

2016-01-15T17:52:59.003906Z

@tmtwd: do you mean repl/emacs style development?

2016-01-15T17:52:59.003907Z

and it seems to me the jvm makes that a bit more difficult still

2016-01-15T17:53:17.003908Z

@bcoop713: basically yes

jaen 2016-01-15T17:53:38.003909Z

Well, but don't you do that in Python as well? It has a REPL by default.

2016-01-15T17:53:46.003910Z

of course

jaen 2016-01-15T17:53:47.003911Z

At least I know I used the REPL a lot when developing in Ruby.

2016-01-15T17:54:11.003915Z

that is true

2016-01-15T17:54:20.003916Z

it does, but it's use isn't as heavily encouraged as in the clojure community

2016-01-15T17:54:40.003917Z

infact, I never heard the term REPL until after I got out of python development

mpenet 2016-01-15T17:55:37.003918Z

python has fast startup, so not everybody cares to work from/on a repl, the jvm/clojure on the other hand....

2016-01-15T17:56:01.003919Z

I don't think I saw a single example of using the python repl for debugging. Only time it came up was in the first chapter of a python tutorial haha

2016-01-15T17:56:07.003920Z

@mpenet: exactly

2016-01-15T17:56:52.003921Z

in scheme, for example its so fast, you don’t need to adopt that typical lisp-like workflow

jaen 2016-01-15T17:56:54.003922Z

Interesting, I'd think it would be more similar to Ruby - I was debugging using pry all the time, which is basically an interactive REPL.

2016-01-15T17:57:26.003923Z

I learned a lot of scheme without using too much of the repl

roberto 2016-01-15T17:57:37.003924Z

it is common to use the repl in racket and in ML also.

jaen 2016-01-15T17:57:43.003925Z

Even though I agree it's not really all that needed, but I kinda got exposed to Haskell early on through ghci.

jaen 2016-01-15T17:57:48.003926Z

So I thought it's natural to use REPLs.

roberto 2016-01-15T17:57:50.003927Z

I think it is a common practice in more fp languages

roberto 2016-01-15T17:58:21.003928Z

because you are encouraged to handle state differently than in ruby/python etc

mpenet 2016-01-15T17:58:52.003929Z

well once you're used to working like this it's painful to work without, it's not uncommon to have a single repl session running all day without a restart.

mpenet 2016-01-15T17:59:34.003930Z

mainly due to the fact that it's very well integrated to the various editors/ide too

jaen 2016-01-15T18:02:23.003931Z

@tmtwd: but I'll give you that the JVM makes some things more difficult. I basically hate Java so when I had to deploy Clojure and had to deal with them JARs, WARs, servlet containers and what have you - that was painful. Also the parts where Clojure internals stick out or you have long-winded stacktraces and bad error messages.

jaen 2016-01-15T18:02:42.003932Z

But the language itself is I think pretty simple to grok.

shaun-mahood 2016-01-15T18:03:15.003934Z

I found ClojureScript a lot easier to get started with than Clojure, just because of the Java environment stuff.

âś… 1
mpenet 2016-01-15T18:03:29.003935Z

I love the jvm

roberto 2016-01-15T18:03:45.003936Z

I think it depends on what you are familiar with. I found Clojure easier to start with because I’m familiar with the jvm.

roberto 2016-01-15T18:03:51.003937Z

I found Clojurescript harder.

futuro 2016-01-15T18:03:51.003938Z

I've always enjoyed using a repl; even with python, startup time wasn't so small that putting in several print statements was faster than loading a repl and blocking at the part I needed to debug

shaun-mahood 2016-01-15T18:04:29.003939Z

@roberto: Yeah, totally based on familiarity - there's a lot of web development stuff that is a bit of a nightmare to figure out if you've never done it before

roberto 2016-01-15T18:04:45.003940Z

I also find deploying jars easier than deploying a python app. I had so many issues deploying python and rails apps.

đź‘Ť 1
jaen 2016-01-15T18:04:53.003941Z

Oh, JVM is a solid piece for engineering, that's for sure. It also fives you an ecosystem of battle-tested libraries. But I just can't stop doing "UGH JAVA" each time something non-Clojure sticks out : V

futuro 2016-01-15T18:04:59.003942Z

being able to inspect the program state at the precise point where I'm having difficulty -- without having to restart the program -- has been an immense boon

shaun-mahood 2016-01-15T18:05:14.003943Z

But I actually thing ClojureScript is a more straightforward path for modern SPA development than a lot of the javascript options

2016-01-15T18:05:38.003944Z

@futuro: how do you do that?

futuro 2016-01-15T18:06:25.003945Z

tmtwd: depends on the language, but generally mark the line of code near where I'm having trouble so the debugging stops there

jaen 2016-01-15T18:06:41.003946Z

@roberto: re: deployment that's certainly true. Being able to pack up (almost) everything in an uberjar and just run it? That's certainly nicer than the dependency hell Python or Ruby have. But it's kind of assumed to be common knowledge in the Clojure land, which it exactly isn't if you don't come from Java.

futuro 2016-01-15T18:06:58.003947Z

so python is something like break someBuggyFunction or break 154

2016-01-15T18:07:48.003948Z

@futuro: oh of course, I mean in the context of clojure

mpenet 2016-01-15T18:07:49.003949Z

well the I never touched the whole war/servlet containers thing, I just uberjar all the things and handle the static stuff separately in deploys. less headaches

đź‘Ť 1
futuro 2016-01-15T18:08:40.003950Z

tmtwd: I'm not entirely certain, tbh, since my functions are generally really small, I just iterate through definitions until I get it right

futuro 2016-01-15T18:09:05.003951Z

I've heard cider+emacs has the ability to place break points, but I haven't experimented with it yet

shanekilkelly 2016-01-15T18:09:23.003952Z

Weighing in on the whole JVM thing, The JVM is a plus if you’re already invested in Java and it’s ecosystem. If you’re coming from Python/Ruby/Erlang/etc, and you don’t already have that investment in the JVM then it can be a real downer.

mpenet 2016-01-15T18:10:14.003953Z

small price to pay to an incredible ecosystem. depends on what you're into of course

futuro 2016-01-15T18:10:33.003954Z

tmtwd: but there again I'm using the repl to do so; so different kind of use, similar benefit

shanekilkelly 2016-01-15T18:11:22.003955Z

eh, the ecosystem is overstated. sure there’s a lot of java libraries out there, but frankly a lot of it is crap. And there isn’t really any killer library that doesn’t exist in other ecosystems. So I don’t really see it as a huge plus.

mpenet 2016-01-15T18:11:31.003956Z

netty

mpenet 2016-01-15T18:11:33.003957Z

for one

mpenet 2016-01-15T18:12:00.003958Z

just on top of my head, it's probably the most polished networking lib out there, all languages/platforms considered

shanekilkelly 2016-01-15T18:12:11.003959Z

I mean, what do I want really, database drivers, web/networking stuff? all of those are covered just fine in other languages too. Aside from that I can’t think of anything in Java-land that I’d actually want.

shanekilkelly 2016-01-15T18:13:06.003960Z

plus, i think it becomes a negative when the internals of the wrapped java libraries jump out and bite you. then you’re back in imperrative-mutable-state-java-land again

roberto 2016-01-15T18:13:19.003961Z

I don’t think there is anything like drools in other langs, for instance.

roberto 2016-01-15T18:13:43.003962Z

maybe in .NET

shanekilkelly 2016-01-15T18:14:14.003963Z

oooh, drools looks kinda cool

roberto 2016-01-15T18:14:23.003964Z

also, Hikari

jaen 2016-01-15T18:15:07.003965Z

The connection pool?

roberto 2016-01-15T18:15:10.003966Z

yeah

2016-01-15T18:15:22.003967Z

java has some nice game libraries

jaen 2016-01-15T18:15:51.003968Z

Well, that's hardly unique. Maybe the quality of implementation is, can't compare that though.

shanekilkelly 2016-01-15T18:16:00.003970Z

good point @bcoop713, there are some cool game/3D libs

jaen 2016-01-15T18:16:30.003971Z

On the flip side - you can't really make a complex game with Java anyway.

jaen 2016-01-15T18:16:49.003972Z

But for some indie-ish explorations? It could be cool. Especially if you could model the world with Clojure STM.

2016-01-15T18:16:53.003973Z

minecraft not a complex game?

jaen 2016-01-15T18:17:45.003974Z

No, not really all that complex. And look at the performance problems it has.

shanekilkelly 2016-01-15T18:17:59.003975Z

still, none of this screams “OH MY GOD JVM IS AWESOME” to me, it’s a selection of mediocre libraries with correspondingly mediocre equivalents in other languages. I just don’t see the big draw, because I’m not already invested in the JVM. Now for the guys who have 15 years of production java to work with, and enterprise things to consider, I can see that being a boon. But that’s not me, and I suspect I’m not alone in that position in this community :simple_smile:

🦜 1
roberto 2016-01-15T18:18:11.003976Z

Hystrix

jaen 2016-01-15T18:18:21.003977Z

Oh yeah, all the Netflix ecosystem.

jaen 2016-01-15T18:18:27.003978Z

You get that only on the JVM.

shanekilkelly 2016-01-15T18:18:41.003979Z

good call @jaen, I’d forgotten about them

jaen 2016-01-15T18:19:19.003980Z

But then again, if you need to worry about that you already won big anyway ; d

jaen 2016-01-15T18:19:37.003981Z

What else... machine learning libraries, I suppose.

jaen 2016-01-15T18:19:55.003982Z

Python can probably rival that, since it's a go-to language for scientists, but I don't think much else can.

shanekilkelly 2016-01-15T18:20:18.003983Z

yeah, I suppose, and I was mostly coming from Python.

futuro 2016-01-15T18:24:23.003984Z

How does everyone structure their core.async code in their apps?

đź‘Ť 1
jaen 2016-01-15T18:25:32.003985Z

Hmm, that's rather vague.

futuro 2016-01-15T18:26:18.003986Z

Yeah, sorry, I'm trying to understand core.async so my questions aren't that well informed atm

futuro 2016-01-15T18:26:36.003987Z

I'm reading through a couple tutorials, but I'm still a little too ignorant to know what to ask

roberto 2016-01-15T18:26:56.003988Z

just continue working through the literature

roberto 2016-01-15T18:27:48.003989Z

I don’t understand transducers, and have not had any need for it. And that is ok. Similarly, if you don’t find a need for core.async yet, that is fine. You don’t have to grok everything and pile it in your code just because it exists.

jaen 2016-01-15T18:28:39.003990Z

Yeah, I suppose at first it might not be so obvious what to ask about. But in general how I structure core.async code isn't all that much different from how I structure normal code (at least not enough that I would have an obvious answer for you). It's a bit of a feature of core.async - that you can write your async code similarly to the sync code. Though I didn't yet have to write tons of core.async, just some, so maybe it's different down the line.

roberto 2016-01-15T18:29:19.003992Z

I’ve only used it when doing network requests. It isn’t a prominent thing in my apps.

2016-01-15T18:29:41.003993Z

when I was writing a frp node backend, i broke my code out into inputs, transformers, and outputs

2016-01-15T18:29:51.003994Z

not sure if that helps your situation, but it worked for my use case

roberto 2016-01-15T18:30:14.003995Z

look at the workshop given by david nolen in the cognitec website if you want to see some more intermediate to advanced usage.

roberto 2016-01-15T18:30:35.003996Z

I always go to that code in github when working with core.async

futuro 2016-01-15T18:30:57.003997Z

cool, thanks @roberto, @jaen and @bcoop713 :simple_smile:

shaun-mahood 2016-01-15T18:33:49.003998Z

On the JVM stuff, are there many products that only really have Java APIs and there aren't any other real options? I know of a couple instances like that in .NET where in the past your only real option was the .NET API or C++

2016-01-15T18:36:06.003999Z

again, I think java has the best game libraries outside of c++, but at this rate, probably won't be long before rust is a rival in that space

shaun-mahood 2016-01-15T18:37:32.004Z

@bcoop713: Do you know of any really good ones off the top of your head? I've never really looked into that space for Java

2016-01-15T18:38:42.004001Z

https://libgdx.badlogicgames.com/index.html is the major one

shaun-mahood 2016-01-15T18:39:32.004002Z

Oh that does look cool

2016-01-15T18:39:43.004003Z

there's also this one, but I haven't looked at it much

2016-01-15T18:39:44.004004Z

https://www.lwjgl.org

2016-01-15T18:39:50.004006Z

and of course, there is Android

shanekilkelly 2016-01-15T18:41:14.004007Z

@shaun-mahood: I did once work at a job where we needed to interface with some ancient and horrifying database system, which only had decent drivers in java. We ended up wrapping it in python. That’s the only case I can think of, but I’m sure the enterprise world is full of similar stories.

jaen 2016-01-15T18:41:51.004008Z

Eh, but while the usual "Java is slow" spiel means little for webdevelopment, this is actually significant in game development unfortunately. So there's that to take into account.

meow 2016-01-15T18:42:14.004009Z

core.matrix has vectorz-clj over vectorz

jaen 2016-01-15T18:42:15.004010Z

For Clojure you have a wrapper over libgdx, I think - https://github.com/oakes/play-clj

2016-01-15T18:43:31.004014Z

there is also Adobe Experience Manager, which is unfortunately taking the enterprise CMS world by storm

2016-01-15T18:44:01.004015Z

and many of AEMs competitors also run on the JVM

2016-01-15T20:26:13.004017Z

I'm kind of new to the concept of logging as opposed to just println'ing everywhere. Is it normal to put log statements everywhere in a codebase? I keep debuggins something, logging a bunch of stuff to figure it out, then leaving it there. Is it fine to pull in the logging stuff in pretty much every namespace and just logging stuff all willy nilly or should I be trying to be more discretionary?

roberto 2016-01-15T20:42:40.004018Z

set a log level

âť” 1
meow 2016-01-15T21:55:56.004022Z

anyone? ^

dave 2016-01-15T22:24:23.004023Z

@jjttjj as roberto alluded, you can have your cake and eat it too by using debug-level logs. you can just leave them in or take them out as you prefer, and you'll only ever see them if your log level is set to debug or below

2016-01-15T22:26:24.004024Z

@dave @roberto thanks!

dave 2016-01-15T22:26:28.004025Z

no prob!

2016-01-15T22:27:36.004026Z

@dave so it's not really bad coding style per se to have a bunch of logging statements littered throughout all the namespaces, so long as they are potentially useful, ie they were added during debugging something then just left in?

dave 2016-01-15T22:28:25.004027Z

it's fine, in my opinion

dave 2016-01-15T22:28:51.004028Z

i generally like to keep things tidy, so if i put in a debug log statement that i don't think i'll ever need to see again, i'll remove it when i'm done debugging

dave 2016-01-15T22:28:59.004029Z

but there are certain things that it's useful to keep in as debug logs

dave 2016-01-15T22:29:05.004030Z

things you might need to see in the future

2016-01-15T22:29:57.004031Z

cool makes sense

dave 2016-01-15T22:30:52.004034Z

being able to see when MIDI events happen is a useful thing when i'm debugging, so i keep those debug statements in

2016-01-15T22:31:25.004035Z

nice thanks again!

dave 2016-01-15T22:31:30.004036Z

sure thing