This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-24
Channels
- # aws (7)
- # aws-lambda (3)
- # beginners (65)
- # boot (43)
- # cider (7)
- # cljs-dev (12)
- # cljsrn (15)
- # clojure (284)
- # clojure-austin (32)
- # clojure-brasil (4)
- # clojure-dusseldorf (4)
- # clojure-germany (1)
- # clojure-italy (40)
- # clojure-spec (21)
- # clojure-uk (69)
- # clojurescript (97)
- # core-async (11)
- # cursive (19)
- # data-science (1)
- # datascript (6)
- # datomic (30)
- # dirac (2)
- # emacs (4)
- # events (2)
- # fulcro (76)
- # graphql (38)
- # juxt (1)
- # lein-figwheel (1)
- # leiningen (6)
- # luminus (4)
- # lumo (13)
- # mount (4)
- # off-topic (24)
- # om (28)
- # onyx (32)
- # other-languages (1)
- # parinfer (40)
- # pedestal (1)
- # portkey (47)
- # re-frame (21)
- # reagent (4)
- # ring (4)
- # ring-swagger (3)
- # rum (1)
- # shadow-cljs (115)
- # spacemacs (5)
- # sql (14)
- # unrepl (1)
- # yada (3)
@noisesmith / @seancorfield, i understand about the AOT and dependencies, snowball effect… now another question, why is aot so bad, this i still dont understand, what it causes, why ppl avoid it
well, that snowball effect is mutually exclusive - if two libs try to aot, one wins the other breaks
also, there are bugs that can happen in your repl that never happen without aot (things with protocols and gen-class in particular)
right - because if they use other libs (which most do) only one of them will succeed since the libs are aot compiled
and the compiled versions of the same lib are not compatible in most cases - one wins, the other breaks
I see, for deploy / production aot is bad because of the libs, and in dev is bad because of repl
umm... libs shouldn't aot because that breaks everything if two of your libs use a third lib and also aot compile
production or repl
as a smaller problem if you aot your app (apps are better to AOT compile than libs), it causes problems when reloading / repl stuff
right
for your app using aot, the problems are smaller, but can happen even if you dev/repl config doesn't use aot - because if you have aot compiled to deploy your app recently, the repl will want to use that instead of the source code on startup
all the app level aot problems can be fixed with workflow discipline and careful program design - but it's a set of problems that go away if you just don't use aot
so the general advice is it's easier to just not use aot unless you absolutely need it to run
I often talk to beginners (or even more experienced devs) that waste hours debugging and the problem was a stale aot class file somewhere
not run-time performance, just startup time, but I think that's what you mean yeah
@noisesmith a personal question, do you use boot?
umm... aot is a default if you make an app with lein, but it doesn't force you, it's possible to turn it off by editing project.clj
I don't use boot, I haven't had to - it seems interesting though
yeah, that warning is annoying - but it is safe to ignore it
(as long as you know how to start an app that didn't use aot at least 😄 )
newbie here. For the "Situated Software" as in Rich's keynote, what is such a typical Clojure software structure look like? Does it use single atom state? What's the difference between such structure and redux? Is there any good open source project I can learn with?
I think Rich was actually talking about much of the software systems we see out there, e.g any website backed by a database
is there anyting similar to this in clojure ?https://github.com/awaitility/awaitility
@U3EJ7ND1T (deref fut 5000 :timed-out)
maybe?
Oh no I see it does not work quite the same way. Well I guess it would not be too hard to make an awaitility wrapper in Clojure.
found something similar, https://github.com/mhjort/clj-async-test
core.async can provide you with similar functionality taken that you actually build your system on top of it
will look into it. im writing an end to end test for kaka stream , its a bit of java interop involved
found something similar https://github.com/mhjort/clj-async-test
Oh no I see it does not work quite the same way. Well I guess it would not be too hard to make an awaitility wrapper in Clojure.
How do I use both these libraries 1) https://github.com/juhakaremo/clj-containment-matchers
(is (equal? 1 1))
2) https://github.com/mhjort/clj-async-test
(is (eventually (= 1 1)
I want to use both, but the below code throws compile error
(is (evetually (equal? 1 1)
Which web framework is easy to use for a beginner?
Luminus (http://www.luminusweb.net/) is worth checking out IMHO. I disagree with some of its design choices (such as the use of Mount), but it's definitely well documented and provides a good introduction to the Clojure web ecosystem, especially since it was made by the author of the excellent book Web Development With Clojure https://pragprog.com/book/dswdcloj2/web-development-with-clojure-second-edition
most think that frameworks are not the way to go, one should compose libraries to do your work. Then again, for beginners that is not exactly the easiest way to approach things
I think this is a classic "easy" vs "simple" issue that cuts to the heart of Clojure's philosophy. "Everyone" is used to "easy" web development, which means frameworks that do (nearly) all of the plumbing for you -- but often provide a lot more functionality than you really need as a beginner. And learning a framework means you miss out on learning the basics of what happens under the hood.
Pedestal has both server and client side stuff available in a framework manner https://github.com/pedestal
I personally haven’t been that interested about that because it is in fact a framework and thus it will ultimately limit my power to do things
@arno http://www.luminusweb.net/ is a good way to get started
Anybody ever use datascript on the server?
Any good reason for that?
You may have been thinking of the first alpha version of the pedestal project, which had aspirations of being client-server-framework. The current pedestal service is very comparable to ring, just with a focus on allowing manipulation of the handler stack and enabling async throughout.
I think this is a classic "easy" vs "simple" issue that cuts to the heart of Clojure's philosophy. "Everyone" is used to "easy" web development, which means frameworks that do (nearly) all of the plumbing for you -- but often provide a lot more functionality than you really need as a beginner. And learning a framework means you miss out on learning the basics of what happens under the hood.
OTOH, Ring is "simple" and learning that first lets you build simple web apps without much pain. Then you can add a routing library (e.g., Compojure, Bidi) which, again, are "simple". So you understand how web apps work at a fundamental level.
I think trying to learn a full stack -- ClojureScript on the front end and Clojure on the back end -- all at once is neither "simple" nor "easy" 🙂
i am getting Uncaught Error: Undefined nameToPath for faker
also, what's the easiest way to have more debug messages when using cider and figwheel?
defrecord doesn't create a var, so there's nothing to attach the doc metadata to (I guess clojure could attach it to theconstructor functions it creates, but it doesn't) if nothing else you can make comments - a convention I use is lines starting with ;;;
are "documentation comments" for things like that
Hmm. that's a pity. Oh well, I'll stick to the old emacs ;;; convention for now, thanks!
@mseddon another way to do it is to make your own custom constructor (even if it just calls map->Foo
inside) and add the documentation to the record there
(defrecord Foo [])
(defn make-foo
"creates a Foo, which is a record that only exists for example purposes;
it implements no protocols or interfaces beyond the default, in fact it
is only here so we can have a doc string example"
[m]
(map->Foo m))
https://github.com/clojure/clojure/blob/9f277c80258b3d2951128ce26a07c30ad0b47af0/src/clj/clojure/reflect/java.clj#L148 thought I'd look at the source from the docs for those ->'s to see if there was a trick, but it seems that those functions aren't generated from :doc, at least, not as far as I can tell.