This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # arachne (1)
- # beginners (71)
- # boot (14)
- # cider (17)
- # cljs-dev (3)
- # clojure (169)
- # clojure-gamedev (35)
- # clojure-greece (1)
- # clojure-russia (30)
- # clojure-spec (3)
- # clojurescript (16)
- # core-async (2)
- # cursive (1)
- # datomic (3)
- # dirac (1)
- # hoplon (95)
- # off-topic (10)
- # onyx (1)
- # parinfer (1)
- # pedestal (2)
- # re-frame (2)
- # reagent (2)
- # untangled (1)
@polymeris: Clojure Applied talks a lot about defining your own constructors that call
->Thing and this post also encourages the same: https://stuartsierra.com/2015/05/17/clojure-record-constructors
Also, Stuart points out in follow up on that post that mucking with
->Thing itself would be relying on implementation details.
@lewix: The Luminus framework (http://www.luminusweb.net/) and the book by his author Web Development in Clojure (https://pragprog.com/book/dswdcloj2/web-development-with-clojure-second-edition) are great places to start
@lewix: that's because there's not much to web development in Clojure. I think many web frameworks in other languages need to make up for deficiencies in the language's standard library and features set. Because Clojure is data-oriented, has declarative syntax, and good constructs for declaring / communicating between components, web concepts translate naturally into the language without much need for new technology.
Basically, web development in Clojure is an HTTP-mapping layer + app development in Clojure
val_waeselynck: just looking for a screencast from A to Z about web development in clojure is not a walk in the park as opposed to rails/node.js/django/C#...
val_waeselynck: What you say may be true but I believe that the community doesn't invest as much in learning ressources
@lewix: I agree about learning resources. Also, because of the emphasis of the community on simplicity over ease, you will tend not to find many out-of-the-box solutions. AFAICT people tend to choose Clojure to optimize their asymptotic speed, oftentimes at the expense of their startup speed.
2) Don't forget you have a REPL! You can learn very fast thanks to interactive programming.
Yeah, the main thing I wanted with web apps in Clojure was the ability to have convention-based controller namespaces found and loaded, rather than declarative routes. So I ported the lightweight MVC framework I wrote in 2009 from another language to Clojure, and that’s what we use at work for some of our stuff.
It’s basically Ring / Jetty / Selmer / Cheshire and my dynamic routes-to-namespaces logic.
They way I usually learn is a mix of both reading , looking at screencast , and doing. Clojure/clojurescript has some books, not enough good and long enough screencast to refer to. It adds to the learning curve to always wonder if you're doing things right, and you can't refer to best practices. (my two cents)
3) watch out for Arachne: https://www.kickstarter.com/projects/1346708779/arachne-rapid-web-development-for-clojure
I’ll be interested to see what Arachne brings to the table but it sounds like it’s going to be so modular and general purpose (and data-configuration-driven) that I have a hard time believing it will be truly simple.
(supported it all the same, I'd love to see a solution for web development that's both robust and accessible)
@lewix: I agree with you on the lack of screencasts (although I personally don’t like them, I know many people find them one of the best ways to learn "how to").
@val_waeselynck: Oh, totally, yes, having a great web framework that’s easy for new folks to stand up decent-sized apps will be a big boost for Clojure. But I’m no fan of Rails / Grails (or ColdBox in CFML) or any of the "big" frameworks.
People learn differently @seancorfield. i found screencast a way to speed up my learning experience or get it started. Books usually reinforce it, and take me to the next level
@seancorfield: I think there a fundamental opposition between simplicity and accessibility so I'm not too optimistic... But I have known Clojure to break such kind of tradeoffs 🙂 so looking forward to what's gonna come out.
In rails/django there's a bunch of course where you see an app being built from A to Z. I wish clojure had more of those
@lewix: I also think that in the Clojure web community, a lot of the attention is focused on very cutting-edge paradigms like Om/Next etc. Definitely too early stage for that kind of resource.
I guess but won't it always make clojure a language for other languages to get inspiration from rather than a to go to language?
I don’t think so. And I mean that I don’t think Clojure’s popularity will be predicated on the presence of in-depth screencasts. Clojure’s still young, all things considered, and tends to demote all-encompassing frameworks so no one really wants to create a 7-10 hour screencast for a framework or paradigm that might six months down the road be relegated.
Also, people won't adopt Clojure because it's comfortable for web development, for which there are established (and quite good) alternatives. I believe language becomes mainstream when it's the first to solve a problem that's becoming popular, and classical Rails-like web development isn't a good candidate problem IMHO. Sophisticated single-page-app development might be.
If I were to plan Clojure's strategy for taking over the world (which I'm not), I'd be looking for such a new problem domain.
@lewix: in any case it's a good thing of you to report this kind of difficulty.
akiva: ok. what about elixir then, go ahead and google elixir screencast or learning materials.
Clojure isn’t Elixir. Maybe their community is different. Just because language A is supported in a certain way that is amenable to you doesn’t mean language B must follow suit. Clojure promotes learning-by-doing which is why we have the Koans and whatnot. There are tons of learning materials for Clojure such as Clojure for the Brave and True and Living Clojure. Maybe Clojure people prefer to read than they do watch screencasts.
I think that you miss the point. As I stated above I do both, and for your information I read both brave and true and living clojure.
@lewix again, I'm not sure I can tell what you're looking for, but it seems to me that there are screencasts on youtube
@lewix by the way, I was thinking of learning a bit of Django one of these days, do you have such a screencast to recommend ?
I watched a bit of http://www.parens-of-the-dead.com which I thought was quite good although probably too fast for someone new to Clojure.
val_waeselynck: I did more rails than django a long time ago. However, I heard that https://godjango.com/series/building-a-product/ is good
I find it interesting that the "state of the union" survey for Clojure has shown web development as the number one thing people do with the language . . . and yet there are still so few resources on "best practice" for web development and no "mainstream" ways to build web apps, beyond assembling a collection of your "favorite" libraries.
And there are certainly a myriad ways to assemble libraries and build web apps with Clojure!
@seancorfield: we chose Clojure and Datomic for my startup because we needed the 'superpowers' that go with it, the things these technologies let you do that have no equivalent in mainstream languages... we're still pioneering here, so i guess it's no wonder the best practices aren't established yet
Is there a more concise way to remove one level of structure than
(mapcat identity coll)?
can something like
(juxt (take-nth 2) (comp (drop 1) (take-nth 2))) be sensibly wielded? Or do I need to use
partial on the inner arguments to prevent them from becoming transducers for this to work?
The goal: split an collection into two sub-collections with alternating elements. I've already solved it using
partition 2 and then transposing, but I thought
juxt would be a more elegant and clear way to express things
Is working for now, but, all the
(juxt (partial take-nth 2) (comp (partial take-nth 2) (partial drop 1)))
partialshurt my soul
@montanonic: The only simplifications coming to mind are anonymous function literals (in lieu of partial), and
(juxt #(take-nth 2 %) (comp #(take-nth 2 %) rest))
Being used to currying,
partial just seems much too long a name for such a common thing to do, especially in an otherwise succinct language.