Fork me on GitHub

What's a good alternative to luminus (ideally that has a lein template) that is perhaps more light weight? I'm noticing on a brand new luminus project, just a lein test takes 30 seconds to execute the stub test

Silenced Ego01:08:42

@m131 shadow-cljs


@m131 Depends what you mean by "alternative to luminus"... If you want something lightweight, you could start with lein new compojure lightapp


(I tend to recommend folks start with bare bones Ring, Compojure, and gradually add the libraries they need as they understand each piece... Luminus has a lot of moving parts to understand)


thanks all - I'll give them a look


what is the difference between s/map-of and s/every-kv, both have similar usages ? The doc string for map-of says - Unlike 'every-kv', map-of will exhaustively conform every value. What does this mean, will not every spec apply exhaustively anyways ?


@murtaza52 What is s/reduce-kv? Did you paste the wrong function there.


@seancorfield thanks, have edited the question


Ah, you mean s/every-kv? OK, that's like s/every which says "Note that 'every' does not do exhaustive checking, rather it samples coll-check-limit elements. Nor (as a result) does it do any conforming of elements."


So every and every-kv check a sample of elements (useful for large collections where you want a sanity check, but don't need all the values conformed), whereas map-of and coll-of will both check the entire collection and conform all the values. That might not work for very large (or even infinite) collections.


@murtaza52 If you're working with very large/infinite collections, the overhead of validating and conforming every single element is going to be really large.


@seancorfield thanks, that explains it.

David Pham05:08:54

@seancorfield would you recommend to start a new project with next.jdbc or go with the standard version?


next.jdbc is the standard thing now. Less baggage, more performance.


next.jdbc is the "next" version of so I'd recommend using it instead of c.j.j at this point.

David Pham05:08:16

Ok! Thanks :)


c.j.j will continue to get bug fix updates but that's about it. next.jdbc is where all my effort is focused now.


And feel free to ask in #sql if you have any Qs.

David Pham05:08:09

Thanks a lot for your help.


I'm traveling a bit over the next week so be patient if I'm slow to answer. Hmm, 07:36 where you are? Europe?


If so, I'll actually be on your timezone next week ๐Ÿ™‚

Lennart Buit05:08:05

7:36 is UTC+2 (amsterdam, berlin, paris, โ€ฆ CEST)


Ah, I'll be in the UK so... close...

Silenced Ego07:08:27

In spacemacs, does anyone know the correct way to cancel a leader/space-bar command? Esc is kinda working but it also displays a message SPC ESC is undefined


there's also standard C-g but it has the same effect. However, I would just ignore that message ๐Ÿ™‚

Iwo Herka08:08:06

Is there any consensus on how .edn should be formatted? Does any style-guide exists perhaps?


If a person is not going to be examining it, then one big long line is reasonable.


If a person is going to be reading it, there are various pretty-printers that can be used, although they might not produce exactly the format you want, e.g. clojure.pprint/pprint, fipp, and a few others.


You must be cautious with the pretty printers to avoid using options that many of them have to eliminate part of the data, e.g. when a vector or list is very long, or the nesting of data goes more than N levels deep.

๐Ÿ’ฏ 1
Iwo Herka08:08:48

I see. Thanks for the heads-up ๐Ÿ™‚


any examples of usng google drive with clojue? found the google-apps-clj library but seems to be unmaintained


On running the following code - (r/foldcat (r/mapcat prepare-event events)) 1) When (count events) ->100, the above code returns a data of type of java.util.ArrayList 2) When (count events) ->1000, the above code returns a data of type of and the above behavior is breaking my code, why would it return different types depending on if the data was parallelized or not using the r/cat combine fn ? Shouldnโ€™t it always return realized data ?


@murtaza52 How it is breaking your code?

Benny kach11:08:04

Hi, i have a problem that im struggling to solve. Any help will be much appreciated. I want to navigate inside a map. The map has :content key that its value might be a collection of string (that i want to extract), or a collection, this collection may contain maps with :content key as well that i want to iterate on each one of these maps (probably recursively) and extract the :content value (when its a collection of strings and not a map).

Benny kach11:08:33

i tried to use specter but its API is kinda hard to understood

Benny kach11:08:00

clojure.walk might be handy as well but my attempts were unsuccessful


I can't seem to catch exceptions within a map. Is this expected behavior?

user=> (try (map #(/ % 0) [1]) (catch Exception e "what"))
Error printing return value (ArithmeticException) at clojure.lang.Numbers/divide (
Divide by zero


Without the map it works "normally"

user=> (try (/ 1 0) (catch Exception e "foo"))


I've confirmed this happens on 1.8 and 1.10...


Map is lazy


indeed. makes sense.


@jahson Initially when I wrote the code I tested it with a small dataset, and the code worked. However when I tested it with a larger dataset, it started throwing an error, bcoz the above snippet was returning an object while the expectation was a seq.


@bennyk you can map your fn over the hash-map, and then recursively call the fn based on the value of the :content key.


@murtaza52 Yeah, I'm trying to understand what is causing that error because according to > To produce an output collection, use clojure.core/into to choose the collection type or the provided r/foldcat to produce a collection that is reducible, foldable, seqable, and counted.


In a clojure.core.spec is there a way to define relationship between two keys ? I have a hash-map which contains 2 dates, and I want to specify the relationship between them.


It is needed for generating test data, as my logic fails when the relation ship between doesnt hold true.


@murtaza52 You can "attach" any predicate on a s/keys with a s/and but you will have to write your own generators to ensure the property.


@me1740 thanks, that worked

David Pham18:08:52

@seancorfield I am from Zurich :) I wish I will be able attend a Clojure conference soon to meet everyone. I have never been happier working while working with a language, itโ€™s tools and community:)

clj 4
cider 1

@neo2551 hi! You are the first Swiss I hear about who uses Clojure! :)

David Pham21:08:22

@alpox it is a big honor :) but I think many use it, the issue are companies here are not extremely risk seeking for IT

David Pham21:08:43

I think 3/4 companies in the list who advertise using Clojure are in Switzerland


I must have missed that! I guess I should lay my eyes on them when looking for a job ๐Ÿ™‚ I'm from Andelfingen btw. (Kanton Zรผrich)

David Pham21:08:12

I sneaked Clojure in mine: they wanted me to build a web app with R Shiny/Python Dash, and I said NO WAY (been burned before by R Shiny)

David Pham21:08:36

So I got a white card to use CLJS


@neo2551 way to go! ๐Ÿ™‚

David Pham21:08:58

I am in Zรผrich :) if you work there we can definitely meet :)

David Pham21:08:18

The companies using Clojure are


@neo2551 Thanks! I save these gladly to the side and consider them in my job search ๐Ÿ™‚

David Pham21:08:06

Hahah good luck :) I wished we could become a hub like London

David Pham21:08:40

Clojure needs a push to make it first class language for data analysis as well


Thanks ๐Ÿ™‚ It would be dream-like to find a job with clojure. Its so much nicer to work with than say JavaScript which I did for the last year. (Any more) I would also welcome if more used Clojure for things like ML, DataScience and similar to compete a bit with python ๐Ÿ™‚


are you guys volunteering to make data science libraries for clojure?

David Pham21:08:43

I think we will have to reuse python

David Pham21:08:59

I think I might invest some time with the libpython-clj


@christian.gonzalez I maybe would, if I had more experience in that field (And with clojure) ๐Ÿ˜„

๐Ÿ˜ 1
David Pham21:08:40

This is a wrapper around pandas


there have been discussions on here about whether clojure actually needs a dataframe library like pandas

David Pham21:08:34

I want to do some benchmarks to see the performance and if the price is not to high letโ€™s check for other wrapper like scikit


given how easy it is to filter/transform/etc. hashmaps as rows

David Pham21:08:01

I like pandas for its time series functionality

David Pham21:08:27

And also it is slow to perform operations on sequences of maps

David Pham21:08:41

Like x+y on data frame


yeah i guess it doesnโ€™t have to be maps


but thatโ€™s a good point


I heard about Neanderthal and wondered if this or some other library in Clojure can compete/replace Numpy in Clojure?

David Pham21:08:08

I tried to reimplement time series with ordered maps, but the issue is you can almost never get to add matriciels


neanderthal is supposed good for matrix operations like that, was going to mention that too

David Pham21:08:43

Replace Numpy yes, for sur (especially with the ClojureCuda)


you can even use cuda with neanderthal

David Pham21:08:02

But matrix operations is only a really small part of the problem


Sounds great! (Well not for my AMD-Graphics tho) ๐Ÿ˜„

David Pham21:08:41

(Nรฉandertal also supports OpenCL)

๐Ÿ˜ 1
David Pham21:08:00

I wondered if you could port this into Clojure)


Maybe I gotta play around with neanderthal a bit sometime

David Pham21:08:23

Neanderthal relies on JCuda for porting the cuda libraries

David Pham21:08:47

So you have access to the standard package but not these ones.

David Pham21:08:51

Moreover, dragan (the author of Neanderthal) mentioned he could port cuDNN (cuda for Neural nets) into Clojure.

David Pham21:08:41

It would be great, but then do you also get all the supporting tools like tensorboard, or what not from MXNet/Pytorch/TF


I see the landscape in the datascience field is growing in clojure ๐Ÿ˜„ I'm happy to hear that!

David Pham21:08:03

I think there would be a utility of cuDNN bindings in Clojure but more realistically we would might start as a symbiotic language

David Pham21:08:27

Maybe with less interop than with JVM and JS

David Pham21:08:39

But at least a way to reuse python libraries.

David Pham21:08:09

For the data science field, we would need a community effort to have monopolistic framework (yes framework) that would centralize all the effort, this is what the data science channel is trying to achieve

David Pham21:08:19

But this is only my honest opinion :)


I wish them the best luck with it ๐Ÿ™‚ I got stuck in the webdev field until now - maybe I find a way into DataScience some day. With a bit of luck ๐Ÿ™‚