This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-12-07
Channels
- # adventofcode (38)
- # aleph (1)
- # bangalore-clj (3)
- # beginners (126)
- # boot (165)
- # boulder-clojurians (5)
- # cider (42)
- # cljsrn (11)
- # clojure (203)
- # clojure-greece (6)
- # clojure-hk (1)
- # clojure-italy (11)
- # clojure-new-zealand (1)
- # clojure-nl (1)
- # clojure-russia (112)
- # clojure-spec (86)
- # clojure-uk (176)
- # clojurescript (38)
- # code-reviews (2)
- # core-async (2)
- # cryogen (2)
- # cursive (16)
- # datascript (2)
- # datomic (80)
- # events (2)
- # garden (28)
- # hoplon (115)
- # jobs (1)
- # jobs-discuss (7)
- # klipse (50)
- # lein-figwheel (15)
- # liberator (17)
- # luminus (6)
- # off-topic (8)
- # om (31)
- # onyx (26)
- # parinfer (4)
- # planck (35)
- # protorepl (26)
- # quil (2)
- # re-frame (50)
- # reagent (21)
- # ring (5)
- # rum (2)
- # schema (1)
- # untangled (29)
- # vim (10)
- # yada (40)
Understanding destructuring and all of its many forms is an essential thing to get familiar with from the very beginning
Clojure is so magic. I'm trying to wrap my head around how clojure can do argument destructuring if it's not even possible in java.
I'm just going to go ahead and assume it's a pretty efficient operation
@goomba Even if Clojure didn't have it you would be able to write the destructure function yourself and then write a macro for let and fn that wraps the args in your destructure function
@gary: if that doesn't get you hot under the collar I don't know what does.
(probably says a lot about my love life but I'll save that for #off-topic lol)
@goomba If it's any help, most folks I know who do Clojure for any length of time tend to fall in love with the language š
it wasnāt thai
@gary: this one? https://www.google.ca/amp/s/ezhillang.wordpress.com/2014/11/14/programming-in-tamil-lisp-like-language-in-clojure/amp/?client=safari https://github.com/echeran/clj-thamil
It was Tamil I think
yeah, jinx
destructuring is actually pretty straightforward to think about
Clojure west talk too, right?
just imagine rewriting destructuring as a let, and thatās pretty much what it does
Such a cool project
https://www.youtube.com/watch?v=MqjMZNwnYCY is Elangoās talk at clojurewest
My gf is still harassing me about writing a library like that except it would be Clojure in long English
It shouldn't be that difficult since there aren't a ton of Clojure functions that are abbreviations
I have an endpoint at '/messagesā that executes a sql query. This endpoint has worked within the past couple of days but today I am receiving this error:
IllegalArgumentException db-spec mount.core.DerefableState@54afee5f is missing a required parameter clojure.java.jdbc/get-connection (jdbc.clj:309)
The google responses for this error are a little vague to me and would appreciate some help if anyone has come across this in the past?@kyle_schmidt is mount started? Seems that your mount usage is a bit wonky
@alexmiller @shaun-mahood thanks for helping me find that project, it does exactly what I was going to do ā
question about the clojure beginner preconference workshop
personally feel like biggest challenge in taking clojure from small projects to production (and more importantly convincing my company to do so) is setting up the architecture and best practices for incorporating database, web api, and biz logic. Obviously the nuances are important. Does the intro to clojure workshop cover that sort of thing or is it more about writing in Clojure in general?
I assume you're asking about the workshop prior to the conj
That workshop is primarily about the syntax and features of Clojure
We've considered doing something that is more architecture / project based too, but it's problematic in some ways
@goomba I think one of the challenges with that āarchitecture and best practicesā piece is that it changes a lot over time (and itās also often very tied to your system / company / project).
I find, after five and a half years of production Clojure, that Iām constantly learning new and better ways to structure my applications.
In particular, we worry a little about picking some set of libs and "endorsing" them as Cognitect as "the" way to make Clojure apps
Yes, that is definitely a concern once you move beyond the Contrib suite of libraries.
I at least don't think that does or should exist
Contrib?
I think he means "the" way (should not exist)
Or ātheā way to make apps?
Which āthatā do you mean @alexmiller ? https://clojurians.slack.com/archives/beginners/p1481140927000772
That = a single way to make apps
There are many answers and many kinds of apps and we should always be open to something new too
I think maybe what I'm looking for (hopefully) is a little more basic, like how to use lein to manage dependencies, how to set up your project.clj file, those sorts of things
I'm looking for a more of "this does that" than a "this is what you should do"
Some of that actually is in the intro workshop
And some of that is covered in the community docs? http://clojure-doc.org
@goomba One of the things we found, as our projects grew in complexity, was that Leiningenās declarative approach was a bit too restrictive and we switched to Boot (about a year ago). There are many, many upsides to that choice but there is also a big downside: with Boot, your build file is ājust Clojure codeā so there really are very few proscribed ways of dealing with projects.
On the topic of dependencies, we have a central version.properties
file that specifies the versions of any library that we use in more than one project, and then each project has a deps.edn
file containing just the list of (production) dependencies for that project. Our build files read both and replace the version from deps.edn
with the one from version.properties
as needed (we usually put a dummy āx.y.zā
version placeholder in the deps.edn
file to signify that it is always overridden).
Interesting. I'll look into that. Hell I wouldn't even mind a 'hand-tooled' approach, as long as I know what I'm doing. Coming from a Python shop we don't really have any build tools anyway, everything is more or less hand-tooled
That way we can assemble artifacts in any way we want from a number of projects, by sucking in all the deps.edn
files and concatenating the dependencies from each.
Problem is I have no idea what I'm doing yet š
Yeah, and it took us a good long while to evolve that approach.
Adding in ClojureScript seems to take the complexity up a notch due the nature or requiring various cross-compilations
Even with the web apps weāve built, weāve taken several approaches over the years and weāre still constantly evolving our own in-house ābest practicesā.
Ah, maybe Clojure "devops" is the word I'm looking for
If youāre interested in reading a bit more about the capabilities of Boot and how we use it, check out some of my blog posts http://seancorfield.github.io/blog/archives/
To make this transition I need to make sure developers can just focus on developing, shouldn't have to worry as much about their code not working because I didn't set up the project right
beautiful @seancorfield , thank you!
We actually keep boot
itself under version control in our repo and have a shell script wrapper tailored for our environment (also under version control).
I'm working through the book "Web Development with Clojure, 2nd Ed", and when I try to run (mount/start #'guestbook.db.core/db) in the nREPL, I get the following error: 'ClassCastException mount.core.DerefableState cannot be cast to clojure.lang.IFn guestbook.db.core/eval30818/fn--30819 (core.clj:8)' Does anyone know what the issue might be? I also had an issue connecting to the nREPL server on port 7000 using "lein repl :connect 7000", so I went with "lein repl" instead, which then worked and connected properly.
If you did lein repl
, it just started up a new REPL, it didnāt connect to your running app (just FYI).
That ClassCastException
indicates you are trying to call something that is not a function (instead itās a DerefableState
object.
There is a #luminus channel BTW, in case folks here canāt help (Iāve never used Luminus so my help here will be rather generic).
this is a problem that can be solved generically, the mount library is trying to use a state object as function
the mount/start doesn't specify the valid args, it's just [& args] so it will accept anything and then blow up at runtime
@seancorfield , thanks I posted to that channel as well š Maybe it is a more simple issue to start off with. If lein repl
does not start it from the same directory at the app, how can I start a repl connected to the app?
The books says >When the application starts in development mode, it automatically runs the nREPL server on port 7000. We can connect to this REPL and inspect the running application as follows lein repl :connect 7000
Sorry, I donāt have the book so I donāt know what itās asking you to do...
This is the connection error message: >onnecting to nREPL at ......:7000 ConnectException Connection refused: connect java.net.DualStackPlainSocketImpl.connect0 (DualStackPlainSocketImpl.java:-2) java.net.DualStackPlainSocketImpl.socketConnect (DualStackPlainSocketImpl.java:79) java.net.AbstractPlainSocketImpl.doConnect (AbstractPlainSocketImpl.java:350) java.net.AbstractPlainSocketImpl.connectToAddress (AbstractPlainSocketImpl.java:206) java.net.AbstractPlainSocketImpl.connect (AbstractPlainSocketImpl.java:188) java.net.PlainSocketImpl.connect (PlainSocketImpl.java:172) java.net.SocksSocketImpl.connect (SocksSocketImpl.java:392) java.net.Socket.connect (Socket.java:589) java.net.Socket.connect (Socket.java:538) java.net.Socket.<init> (Socket.java:434) java.net.Socket.<init> (Socket.java:211) clojure.tools.nrepl/connect (nrepl.clj:184) Bye for now!>
@gdeer81, I think I need to connect to the repl before I can try running (mount/start #'guestbook.config/env)
@mlev: Have you started the application? You will probably have to do something like lein run
to get it started.
@shaun-mahood , when I run "lein run" I get: >"2016-12-07 17:25:40,528 [main] DEBUG org.jboss.logging - Logging Provider: org.jboss.logging.Slf4jLoggerProvider read config from resource: "config.edn" read config from file: ".lein-env" 2016-12-07 17:25:41,077 [main] INFO guestbook.env - -=[guestbook started successfully using the development profile]=- 2016-12-07 17:25:41,171 [main] INFO luminus.http-server - starting HTTP server on port 3000 2016-12-07 17:25:41,233 [main] INFO org.xnio - XNIO version 3.3.6.Final 2016-12-07 17:25:41,437 [main] INFO org.projectodd.wunderboss.web.Web - Registered web context / 2016-12-07 17:25:41,437 [main] INFO luminus.repl-server - starting nREPL server on port 7000 2016-12-07 17:25:41,452 [main] INFO guestbook.core - #'guestbook.config/env started 2016-12-07 17:25:41,468 [main] INFO guestbook.core - #'guestbook.handler/init-app started 2016-12-07 17:25:41,468 [main] INFO guestbook.core - #'guestbook.core/http-server started 2016-12-07 17:25:41,468 [main] INFO guestbook.core - #'guestbook.core/repl-server started"
You could open up another terminal and connect to the running repl now 'lein repl connect localhost 3000'
if i give reducers/fold core/concat as a combiner, it would simply return things out of order right?
@gdeer81, thanks, that is good to know. I tried lein repl connect localhost 3000
but the result was unknown subcommand connect
.
@mlev he meant lein repl :connect localhost:7000
I think
(based on what lein help repl
shows)
You could also try lein repl :connect 127.0.0.1:7000
(I know some peopleās laptops have some network setup that prevents access via localhost
but allows it via 127.0.0.1
)
@seancorfield , lein repl :connect 127.0.0.1:7000
worked perfectly. Thanks for all your help everyone!
Howdy everyone! I'm a totally new Clojure. I'm coming from a javascript (ember) and ruby (ruby on rails) background. Looking for an ambitious intro to language and ecosystem. Any suggestions for the best resource to start with to give me an ambitious trip through clojureland? Looking at: Joy of Clojure, Clojure for the Brave and True, and Living Clojure... didn't know if there was a canonical best first serious step?
hey @ryanlabouve š I'm in the same proverbial boat
Any resource in particular stick out to you so far? š
2nded for Clojure for the Brave and True
it does a pretty good breadth/depth, light on 'ecosystem' though
Are you both already emacs'ers?
Cursive
Iād start with either Brave and True or Living Clojure first
and either Joy of Clojure or Clojure Applied second
(I am a co-author of the latter, so bias noted :)
HA! Thanks for the disclosure š No shame in being proud of your work though š
agreed
I recommend all the other books too :)
any suggestions on a light weight web framework for clojure apps?
would love something a la Flask
(Python)
trying to get Clojure in on some microservices action š
there is not one canonical answer in Clojure
lol I don't need a canonical answer just any answer š
many things are built on top of Ring (which is almost too light be a āframeworkā)
I'm good with that
Luminus is a set of libraries glued together in a template
The Web Dev with Clojure book uses this
there are alternatives to Ring as well like Pedestal or Yada
Living Clojure will teach you more fundamentals of the language, Clojure for the Brave and True will have you work on more application-style beginner work, based on my experience with them.
yeah, Luminus is probably the "safest" option for a newcomer, in terms of using tools that are well documented, and other people are actively maintaining
If you find yourself buying multiple books, you may want to consider https://www.safaribooksonline.com/pricing/
You can get a monthly membership, and it gives you access to all of the latest books, which includes most of the latest Clojure dev books.
And don't forget @ericnormand has some excellent training resources
Oh, is that the http://purelyfunctional.tv dude?
just something that can serve up APIs is all I really need
thank you all for the suggestions š