This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-13
Channels
- # aleph (5)
- # beginners (92)
- # cider (37)
- # cljs-dev (38)
- # cljsjs (2)
- # cljsrn (3)
- # clojure (50)
- # clojure-berlin (1)
- # clojure-canada (3)
- # clojure-dusseldorf (4)
- # clojure-france (1)
- # clojure-germany (1)
- # clojure-italy (7)
- # clojure-nl (21)
- # clojure-spec (2)
- # clojure-uk (106)
- # clojurescript (165)
- # code-reviews (1)
- # community-development (3)
- # cursive (5)
- # datomic (13)
- # editors (12)
- # emacs (3)
- # figwheel-main (141)
- # fulcro (28)
- # graphql (1)
- # immutant (1)
- # jobs (1)
- # jobs-discuss (5)
- # midje (8)
- # nrepl (3)
- # off-topic (28)
- # onyx (4)
- # re-frame (21)
- # reagent (70)
- # ring (2)
- # ring-swagger (9)
- # shadow-cljs (18)
- # spacemacs (6)
- # specter (23)
- # tools-deps (21)
I found one https://stackoverflow.com/questions/17048076/big-o-of-clojure-library-functions
not a table, but in the book “Clojure Standard Library” for every discussed function there is a performance considerations paragraph: https://www.manning.com/books/clojure-standard-library
a good place to start :thinking_face: https://rosettacode.org/wiki/Reports:Tasks_not_implemented_in_Clojure
Hey all, I've been listening to Rich Hickey's talks and I've been convinced. I want to make a web app with a clojure back end and a clojurescript front end.
I want to have user authentication/authorization and I'd prefer to use a document store like mongodb.
Will compojure work for me?
Compojure will likely be part of your app, since it's widely used and you'll find lots of people who know it well enough to answer questions about it. Compojure is just the piece that connects /some/app/url
to the code that's supposed to respond to that URL, so you'll need more than just Compojure.
Hi all, I'm currently trying to follow leiningen+cljsbuild setup instructions and having trouble running lein cljsbuild once
-- which yields a java.lang.ClassNotFoundException: clojure.lang.Tuple
exception. Has anyone encountered said problem and/or could point me to ways of debugging this?
project.clj
contains
(defproject hello_world "0.1.0-SNAPSHOT"
:plugins [[org.clojure/clojure "1.9.0"]
[lein-cljsbuild "1.1.7"]]
:dependencies [[org.clojure/clojurescript "1.10.339"]
[cljs-ajax "0.7.3"]]
:cljsbuild {:builds
[{:source-paths ["src"]
:compiler {:output-to "out/main.js"
:optimizations :advanced}}]})
Output of lein cljsbuild once
:
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
Compiling ClojureScript...
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
Exception in thread "main" java.lang.NoClassDefFoundError: clojure/lang/Tuple
at cljs.build.api__init.__init0(Unknown Source)
at cljs.build.api__init.<clinit>(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at clojure.lang.RT.loadClassForName(RT.java:2098)
at clojure.lang.RT.load(RT.java:430)
at clojure.lang.RT.load(RT.java:411)
at clojure.core$load$fn__5018.invoke(core.clj:5530)
at clojure.core$load.doInvoke(core.clj:5529)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5336)
at clojure.core$load_lib$fn__4967.invoke(core.clj:5375)
at clojure.core$load_lib.doInvoke(core.clj:5374)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:619)
at clojure.core$load_libs.doInvoke(core.clj:5413)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:619)
at clojure.core$require.doInvoke(core.clj:5496)
at clojure.lang.RestFn.invoke(RestFn.java:512)
at cljsbuild.compiler$eval9$loading__4910__auto____10.invoke(compiler.clj:1)
at cljsbuild.compiler$eval9.invoke(compiler.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6619)
at clojure.lang.Compiler.eval(Compiler.java:6608)
at clojure.lang.Compiler.load(Compiler.java:7064)
at clojure.lang.RT.loadResourceScript(RT.java:370)
at clojure.lang.RT.loadResourceScript(RT.java:361)
at clojure.lang.RT.load(RT.java:440)
at clojure.lang.RT.load(RT.java:411)
at clojure.core$load$fn__5018.invoke(core.clj:5530)
at clojure.core$load.doInvoke(core.clj:5529)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5336)
at clojure.core$load_lib$fn__4967.invoke(core.clj:5375)
at clojure.core$load_lib.doInvoke(core.clj:5374)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:619)
at clojure.core$load_libs.doInvoke(core.clj:5413)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:619)
at clojure.core$require.doInvoke(core.clj:5496)
at clojure.lang.RestFn.invoke(RestFn.java:436)
at user$eval5.invoke(form-init769454222035647546.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6619)
at clojure.lang.Compiler.eval(Compiler.java:6608)
at clojure.lang.Compiler.load(Compiler.java:7064)
at clojure.lang.Compiler.loadFile(Compiler.java:7020)
at clojure.main$load_script.invoke(main.clj:294)
at clojure.main$init_opt.invoke(main.clj:299)
at clojure.main$initialize.invoke(main.clj:327)
at clojure.main$null_opt.invoke(main.clj:362)
at clojure.main$main.doInvoke(main.clj:440)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:419)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.main.main(main.java:37)
Caused by: java.lang.ClassNotFoundException: clojure.lang.Tuple
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 57 more
Subprocess failed
There's one file ins src
: src/hello_world/core.cljs
, containing
(ns hello-world.core
(:require [ajax.core :refer [GET]]))
(GET "")
lein --version
says
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
Leiningen 2.8.1 on Java 1.8.0_152 OpenJDK 64-Bit Server VM
also, currently there is no file under ~/.lein/profiles.clj
path
@U9TGHG3LP Try fixing that
Yes! Great thanks! Do you happen to know why this also fails without explicit clojure dependency? Some hardcoded old clojure version in leiningen? The example on the lein-cljsbuild github page does not include the clojure dependency either..
When replacing clojure version above with 1.8 build still works here, 1.7 breaks then -- I guess the default version is dependent on leiningen build. Thanks again for spotting this! 🙂
@lee.justin.m “I’d like to maintain the “looks imperative” style.” Aha! I have been trying to get a Clojurian to admit threading is imperative/procedural! You will be cited in many footnotes to come. 🙂
We’re gonna need a bigger bibliography…
@hiskennyness well undoubtedly someone will tell me i’m using the word “imperative” wrong. but when my internal model is “do this then that” I want the code to look that way. i think this is why sql of any complexity is very hard to understand.
Yeah, a die-hard Clojurian swore to me that do-this-do-that threading was functional, so yer in trouble. 🙂
I use CTEs in SQL so I do not lose my mind.
the problem is in what is meant by these words. threading still gives you referential transparency (which is functional), but the code is time-ordered (which is imperative, in my mind).
any synchronous code is time-ordered. by that logic do
or when
or even defn
are imperative because you can have multiple sequential statements?
imo threading is just syntax sugar for regular clojure code, syntax sugar can't be imperative or functional, as it does nothing by itself
I agree, but I think let
(as opposed to threading) is a bit more than just syntactic sugar for regular code. let
lets you get away with writing very imperative-styled code though
Y’all need to read Paul Graham’s On Lisp. Syntax is semantics.
Right, Paul Graham wanted an imaginary tax on let
.
@vale yes, i do think they are imperative in a sense. any def is imperative since it mutates the global state 🙂
def is definitely imperative to me, as well as ns
these are unimportant labels
Threading’s excuse is that no new “places” in the sense of named state are introduced. Not buying it, ->>
! 🙂
in my case, I don’t care. but in my original question from yesterday i was trying to use some word to communicate what problem i was trying to solve
Who cares about code readability? Me, anyway.
maybe I’ll say “time-ordered code” next time because the word “imperative” always draws sharp reactions
i think it’s downright funny that people emoji’d up the “who cares” above because people clearly do care! it always draws a reaction
I don't really get what you mean time-ordered
, but I get what you mean by imperative. It's not like every top-level form executes asynchronously
I guess as-> helps a little. Me, I can never keep straight where the imaginary “place” is in threaded code. No, ,,,
was not the answer. 🙂
I mean, who cares that def
is imperative (creating side effects), if it doesn't create problems for you/your program (in contrast with general data structure mutability)
Funny seeing the incredibly conformist Clojure crowd suddenly cheering “Who cares?”
I do not see the Clojure crowd as conformist :)
@joelsanchez That’s fine, but if I put a closing parens on its own line I get tarred and feathered. 🙂

Have you ever read a Clojure style guide?
I also believe that's poor style but I don't see the connection to the current discussion
Love the closing parens emoji!! On its own line! Twenty pushups for both of you.
Paul Graham illustrates functional code as flowing down and to the right. Lispers “get it”. Clojurians turn it into a thread of steps, losing (to a Lisper) the true functional flow.
OK, back to beating my head against RN.
doesn't CL lack immutability by default, anyway?
let over lambda's author (the book that builds on On Lisp) strongly argues that lisp is not functional (at least common lisp) https://letoverlambda.com/index.cl/guest/chap5.html
so how can we be less functional?
Could someone explain to me the situation with Java licensing? Should I try and get openjdk? Currently I'm talking about my laptop/home computer.
CL is a big ball of mud. We do what we want. If we are smart, we code functionally. It is better. But no one collapses in a heap if a SETF comes in handy.
@joelsanchez I would distinguish between functional and immutability. With threading we start with x then create f(x) which becomes x for the next f(x) etc. Each f(x) leaves its x unmutated, but in effect a “temp” var is being created and then re-written at each step. as->
is explicit about that. Functionally we say “The dog that chased the car that ran the red light”, beginning with the semantic outcome (the dog) then revealing recursively its derivation from inputs. In threading we have, “There was this red light. A car ran it. A dog chased that.” Imperative, step-wise evolution of the semantics.
threadings dont create temp vars, try macroexpanding it to see it...I guess its more of a "mental concept" problem you're talking about
they are also very dumb in the sensw that they dont care what you are threading, as others have noted before
I'd argue against the "rewritten" part regardless - even when you reuse a binding name in let, there's no rewrite in the sequence of operations
shadowing maybe, no mutation
@clojurians-slack yep, threading is a functional pipeline, but it is necessarily of functions with one parameter, the result of the prior step. My functional mind works with functions of N parameters, so threads look like strait jackets.
@hiskennyness I guess we need a thread-fork -<
😉
@avovsya openjdk can't hurt. That's always been the first thing I install on a Linux box.
While you all are on this topic. I've been asking around lately... Do you think learning common lisp along with clojure would be confusing. I'm a hobbyists programmer and I've taken a liken to lisp so there are a lot of older texts that I want to go through. I have Paul graham's ansi common lisp and paip. Ive heard good things about LoL but that seems to be a book I need more under my belt for.
I'd say learning scheme and ml would contribute more directly to appreciating clojure
@noisesmith :thinking_face: OK. I've skimmed through sicp. I also wanted to go through the osaki book at some point so I'd expect to have to take a look at ocaml. But why do you say ML over common lisp? Just to experience a purely functional environment?
in terms of the functions used and idiomatic coding style
there's a lot of things that are normal in common lisp that aren't really normal clojure things
and normal ml things that clojure also shares
So I just switched to Spacemacs. I used Emacs for like a week a few years ago, so I am pretty new to the whole Emacs/Spacemacs thing. I have it installed and set up with the clojure
layer. However, when it comes to the rest of how to use the editor, I'm pretty lost. Any recommendations/links to good tutorials, things to go through? Trying to get up to speed on Spacemacs as fast as I can so I can get back to learning Clojure 🙂 (I also posted this in the #spacemacs channel)
I’m going through this myself really and these have been fairly helpful. But mostly, it’s been pick things up as I need them.
I use lispy/evil-lispy. It kind of adds another mode on top of evil to navigate similar to the built in lispy mode. I use lisp state for certain things but am starting to get used to lispy/evil-lispy
@ryan.russell011 Recommendations? Stop sounding so cheerful and optimistic, you are crossing the River Styx and the boatman does not like you. Abandon most hope. A wise soul once said “It is easier for a good programmer to learn a new language than a new editor,” and Emacs is a lost-in-the-sixties joke. Spacemacs only make it worse with all its opinionation. Get IntelliJ and spend your next night of drinking on Cursive instead. If however you are an RMS-bred Communist refusing to pay for anything other than beer just go with raw Emacs and Cider and paredit. You’ll be fine in a month. hth!
hahaha... well that was an entertaining response. I am wanting to learn Spacemacs for my own personal enjoyment. tbh.. I don't really feel like using IntelliJ for the moment, kind of burned out on it for now. I was using VSCode, but it is still missing things.... and I use Vim for everyday quick editing of config files and such... so figured wth.. might as well learn Spacemacs 🙂 And I am cheerful... I enjoy such things. When I used Emacs for like a week (or two)... I spent like 3 solid days customizing it to what I wanted... started using it for stuff, and ended up in Java where I needed IntelliJ.