This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # announcements (4)
- # babashka (88)
- # beginners (128)
- # bristol-clojurians (1)
- # calva (8)
- # cider (8)
- # clj-kondo (4)
- # clojars (7)
- # clojure (148)
- # clojure-dev (16)
- # clojure-europe (5)
- # clojure-gamedev (1)
- # clojure-italy (10)
- # clojure-nl (7)
- # clojure-uk (57)
- # clojurescript (57)
- # clojutre (1)
- # community-development (2)
- # crux (10)
- # cursive (7)
- # data-science (1)
- # datascript (5)
- # datomic (9)
- # events (6)
- # figwheel-main (1)
- # fulcro (91)
- # garden (11)
- # graalvm (14)
- # graphql (1)
- # immutant (4)
- # jobs (1)
- # kaocha (33)
- # off-topic (70)
- # onyx (3)
- # pathom (4)
- # re-frame (23)
- # ring-swagger (1)
- # shadow-cljs (49)
- # sql (6)
- # testing (8)
- # tools-deps (45)
- # vrac (1)
I am trying to motivate some coworkers to try out Clojure. I am looking for some example codes that are way smaller in Clojure than say Java/C#. Better if the code does something useful and not just a toy example. What can you think of?
https://github.com/openweb-nl/kafka-graphql-examples has the functionally same GraphQL endpoint in multiple languages / frameworks. Smaller is not always better through, you could argue the Java code is better maintanable.
At such a level it's a bit hard to compare through. As some of the code can be replaced by using an additional dependency in some cases, and more things like that.
I made a fun little demo of live coding and java interop. The code isn't super clean. But I was trying to show how to use a java delay queue. And how you can use the repl to test out various scenarios to prove to yourself that things work the way you expect. https://github.com/jimmyhmiller/PlayGround/blob/418feee0bfe018b77063b6344451039c76ea062f/blocking-queue/src/blocking_queue/core.clj Basically, you can start up multiple workers. Then they are "hitting a remote service" (mocked as an atom). You can take the service down, watch as things get delayed, bring the service back up and watch as requests start going through. Code isn't organized cause it was the result of a live demo. But I've found that sort of demonstration to be very useful.
Thanks for this. This is very real worldish, exactly what I had in mind. I will go through it. And I'm sure it was a cool demo!
True, 😀. But if someone took the time to write the same thing in Clojure and some other languages, perhaps a blog post, that will we great for showcasing.
Some of them are more or less serious, like http://rosettacode.org/wiki/2048 (albeit, it's a toy in a different sense)
Interesting, will take a look. This reminds me... My manager is open to new languages (teammates are not). I showed a Sudoku solver to him and he got impressed by the terseness.
It might not convince them to switch primary development languages, on its own, but it might convince them to look further.
To get them interested. Without some serious examples, we will never move past the "oh, it's a LISP" stage.
I suppose, but I guess my experience colors my response here. I didn't have much luck convincing people with terseness
The famous Rich Hickey talks are what sold me (Simple Made Easy, Are We There Yet, etc)
Yes, but honestly, they are not easy to get the first time. And people with preconceived notions of LISP weirdness won't have the patience.
I am not saying that this will convince anyone, but Rich has a few sentence in an early "Clojure for Java programmers" talk that tries to address this, very briefly: "I do not see a lot of people who know Lisp here, but that does not mean there is not a bias against Lisps. I mean, how many people have seen Lisps and said: Oh, my god! Ugh! I cannot believe the parentheses. And I would say: I would hope you put that bias aside for the purposes of this talk. It ends up that for people who have not used Lisp, those biases have no basis, and for most people who have given it a solid try, they vanish. And in fact, many of the things that you consider to be problems with Lisp are features, down the line. But having said that, Clojure is a very different Lisp. It is syntactically much leaner than a lot of Lisps. It has fewer parentheses. It uses more data structures in its syntax, and as a result, I think is more succinct and more readable. So it may be the time to try Lisp again."
If someone truly has a knee-jerk reaction to certain aspects of things, e.g. loves to get in long drawn out arguments on the fine points of vi vs. emacs (or worse, stick to surface-level details), they may not yet be at the point of looking past surface-level aspects yet.
I find the most convincing thing that Clojure offers is the REPL -- because it is not like "REPL" in other languages.
@hindol.adhya I’d make a PoC that’s work related - perhaps automating some annoying process, showcasing the repl by investigating a bug or the shape of your data. Showcasing finished code to people who can’t read it rarely helps.
Been there, done that. Problem is, since it was real work, it became non-trivial and spanned 6/7 files and used
Pedestal. I felt the sweet spot is something simpler, maybe a single file with a few hundred lines that is also easy to understand.
I found that generating Excel reports with Clojure is stupidly simple, almost like pseudocode.
Tie it in with some fetching of external resources (e.g. JSON) and it also becomes a breeze.
This integration of REPL and editors is indeed one of the killer features of Clojure IMHO.
It changes the way I think about code a lot. Even if you already know the function you're using, having the documentation / source just a keystroke away can give you insights about better ways, unknown arities, etc 🙂
But not without cost. Keeping your system repl driven has an overhead. Keeping my repl integrated into my editor tends to mean it crashes a bit more. I agree its amazing and worth the cost though.
YMMV when i eval something huge in emacs it might fall over. It's getting better all the time though.
Interesting. I don't have that problem with vim-fireplace but my hobby game is also not huge
I sometimes accidentally open a huge .xml file. I'd better just kill the emacs process rightaway
Yes. And the workaround is to disable font locking for the whole file if there's a single long line.
This disables the language specific major mode entirely so there goes IDE like features and syntax highlighting. Bottom line is, don't use long lines in code. so-long.el is very useful for log files and other data files though.
M-x package-install? I am on my phone right now but I can try that later. Previously I used it along with Doom Emacs without issues.
Sorry for being off topic in #off-topic, but I just misread #hochiminhcity as #homoiconicity on Insta. What has happened to me?
Services for mailing lists. Looking at this for the first time (Mailchimp, sendinblue etc.). Anyone use these? Are people using this with their own landing pages and using these services API's, or do some of these services provide fully blown hosting/database/smtp?
Any nice coding / software / programming languages podcasts I should listen to? I listen to pretty much every Clojure podcast, also Linux action news, CoRecursive, functional geekery... but somehow for the last few weeks the stream dried up.
I find InfoQ podcast, CaSe (Conversations about Software Engineering) and Software Engineering Radio good. Also Eric Normand's Thoughts on Functional Programming if that's not already on your list.
@UQ4QVMYV8 I listen to those while working out or vacuum cleaning, that doesn’t take extra time
I've been loving on the metal. https://oxide.computer/blog/categories/on-the-metal/
Not coding, I can't help but also suggest the glass cannon podcast. Endless hours of content. Wonderful pathfinder actual play podcast. https://glasscannonpodcast.com/