Fork me on GitHub
JP Silva16:09:26

Hi folks, quick question/survey: If you were not allowed to use Clojure when working on a backend application (non-user-facing) what language would you choose? In other words, what's your first alternative to Clojure?


Most of the time it would be Python. If on the JVM would be Scala. 🙂


Apart from some Java, I have done 1 project with jRuby. Clojure is probably 99% of the backends I've done on the JVM.


Oh yes, I've also done Scala, but somehow I didn't remember that ;)


I guess it depends on what kind of project it is. If it's a simple CRUD app jRuby on rails might not be that bad.


I'd be interested in trying Kotlin, but I have no experience with that so far


I would consider learning a new language for that - Kotlin, Ruby, Rust, Common Lisp, even Haskell. Python - not a chance.


Oh, wait, I thought we were limited to the JVM. Depending on the size and type of work, Rust might also be a nice choice.


Not sure about Haskell. It's interesting, but personally I haven't found myself being very productive with it


If you're looking for something close to Clojure: Elixir or clojerl on the BEAM might also nice to try


Honestly, I wouldn't recommend Rust unless your app really needs to avoid a garbage collector for some reason. For your typical backend service rust is overkill


I agree. It depends on what you need: low memory consumption, optimal performance, just a small thing in between: then Rust is fine


+1 to Elixir too! I love using it for high I/O use cases and is quite pleasant to write too!

Josef Richter16:09:00

Isn’t it kinda. Road question to give meaningful answers? What kind of app?


The experience using it is also extremely different from clojure. There's nothing like a repl based workflow

JP Silva16:09:00

Let's say a web api (rest or gRPC) or an event-driven service (think consuming messages from a queue doing some processing then publishing the result to another queue and/or database)


I’d definitely do Elixir


If I were to pick a language that I've already used in production, I'd probably just hold my nose and use Java or CFML depending on the context. If I could use any language that I've experimented with (for the purposes of Pragmatic Programmer learn-a-new-language-every-year), I'd probably pick Kotlin so that I could get solid production experience with it.


I use Kotlin on the backend, along with Clojure. Kotlin has been deployed in multiple microservices. I find it a very pleasant language to use (if I couldn't use Clojure)


IMHO, whereas Scala was designed in Academia (and thus shows it), Kotlin was designed to be a working, practical language that scratches a lot of Java's itches 🙂


Our migration from Java to Kotlin was painless and very successful.


Of course, that's if I could not choose Clojure 🙂

JP Silva20:09:44

Thanks for the answers. Interesting no one mentioned GoLang

👆 3

I would give OCaml a chance too but it seems pretty niche still


To be the weirdo here, I'd use Haskell or F# assuming I don't predict any hurdles.


(having used Scala in production, I would not use it again -- that's partly in response to @U11EL3P9U 🙂 )


@USJQXB1PW Go was one of the languages I learned as part of my PragProg practice and I really did not like it at all. I much preferred Rust (which I learned later, and was much more what I had hoped Go might be).


(if you were not "allowed" to use Clojure, I suspect you would not be "allowed" to use any number of minority languages -- unless you were joining a shop that already used such a language and used only that one language for backend work)

JP Silva21:09:06

I'm a consultant and my clients are usually big and/or old organizations which ends up resulting in them using Java + Springboot

JP Silva21:09:52

This has to do with most of them being concerned with difficulties with hiring

JP Silva21:09:00

Which ends up turning into a vicious circle


Yeah, and modern Java + Spring Boot isn't horrible so if that's what I had to use because of a client, I'd hold my nose and do it.

JP Silva21:09:28

But it's still a lot of boilerplate though


It certainly wouldn't be my first choice, after Clojure 🙂 I don't think it would even be in my top five at this point.


True, even modern Java + Spring Boot is still pretty repetitive. Maybe I'd write a Clojure program to generate some of the Java / Boot stuff 🙂

JP Silva21:09:53

Anyway, my hypothesis was that Clojure developers would favor dynamic typed languages over statically typed ones.


Aside from a few Python/Ruby responses, that doesn't generally seem to be holding up? Interesting...


I would favor functional over OO, dynamic vs static is almost secondary to me, although I do prefer Clojure over Haskell / F# / OCaml in the end


Yeah, if my client was a Microsoft shop, I'd probably push for F# rather than C# (I've learned a little of the former, again for my PragProg practice, by attending workshops on F# at conferences and hanging around F# programmers for a week 🙂 ; I don't know any C# but I suspect I could pick it up, based on my Java knowledge, if I really had to). To be honest, as a consultant working for a big client, I could probably muster up enough knowledge quickly to be able to tackle whatever language they mandated -- but I would prefer clients that let me use languages I actually know well (and like).

JP Silva23:09:08

Unfortunately most of the time we don't get to choose.


I recently switched my thinking from language to runtime. Therefore I’d pick either a JVM or an Erlang-based language. Definitely not Python or Ruby or Node. Haskell/Ocaml might suffer from ecosystem issues (eg can you find a production ready database driver?). I’m clueless about .NET but I think it’s also a solid foundation.

💯 6

I've been on the JVM since 1997. I've learned quite a few languages that don't run on the JVM, but the only things I'm ever going to be able to introduce where I've worked are languages that do run on the JVM (natively, not some second-class port like JRuby).


(I was so hopeful for both Frege and Eta...)


Golang works well enough but I don't find it enjoayble to write. I write some Go at work and the best part is how easy it's to get things into production and move on.


Also Go code is very maintainable after the fact, and by other people. The lack of abstractions makes it mostly easy to read and understand (and change).


I’m a Ruby developer trying to get into Clojure, so Ruby it is!


@U014JMH21NK What's your opinion on JRuby? Possibly you can combine Clojure with it?


haven’t tried it to be honest, sounds like an idea to try out though!


I once ported from an MRI based project to a JRuby project. The only thing that we couldn't use was some native binary based image converter, so we switched to java AWT. The rest of the experience was seamless. I don't know why @U04V70XH6 calls it second class. Granted, this was also my only serious Ruby project, so my exposure to this is fairly limited.


The reason for the port was that our customer demanded we use the JVM


and no additional installed binaries. They would run it on their JBoss server


How was it like maintaining long term?


As far as JRuby was concerned, we had no problems with it


@U04V15CAJ I meant "second class" in terms of how, for a long time, JRuby lagged behind Ruby in terms of features: right now the latest JRuby is still at 2.5.x language level, whereas Ruby is up to 2.7.x, with the 3.x coming this year. So JRuby is lagging by a couple of versions and a few years.


Ah I see, didn't know that


(like Clojure CLR is second class and ClojureScript used to be)

Ahmed Hassan07:09:30

What would you say about new developments in Scala? (ZIO — A type-safe, composable library for async and concurrent programming in Scala) (A lightweight, distinctly Scala take on functional abstractions, with tight ZIO integration) These libraries cross compile to Scala.js as well, similar to Clojure/ClojureScript ecosystem. Do we need such libraries in Clojure and ClojureScript ecosystem?


It's slightly OT. It's just a framework


if on the jvm clojure, otherwise it depends on a lot of things for the choice: like hw requirements/limitations, domain etc. I have a thing for Erlang for having used it in the past for work, but it's highly situational again


It's difficult to compare. Scala ZIO is obviously focusing on Statically-typed Functional Programming. You simple model things differently with different approaches. Author once stated, that with Clojure there are things possible which are impossible in Scala/ZIO because it just constraint you on purpose. You'll face different challenges even among statically typed languages if the evaluation strategy is normal order vs applicative order. I like ideas of ZIO, they're just not applicable in Clojure.

💯 3

We have to live with our choices.

Ahmed Hassan03:09:45

@UBLU3FQRZ Thanks. That makes sense. We have different trade-offs.


I’m surprised that ClojureScript hasn’t been mentioned 😎 If you’re just building a web app where consistent performance isn’t required, or you’re running on AWS Lambda, then CLJS on Node could be a great choice!


The real reason turning computers off and on again so often helps. And here with my primitive computer scientists belief that it was because of programmers often making mistakes in managing state:

😂 3

help, I can't stop getting in fights on the internet


Some people just can't be reasoned with 🙂


I mean, there is a ton of history and systems that are mutable-by-default, and it sometimes does help, IMO when the mutability is limited to a small enough part of a system that can be easily reasoned about. Some people have either not hit that pain point, or they are mired in it, but see it as a necessary part of software development.

Drew Verlee21:09:29

Having a goal for the interaction tends to help increase the likely hood it wont be frustrating. What do you hope is going to happen here? On the specific's of the problem at hand. Just calmly explain the relationship between clojures immutable data structures and what their currently using. Let them sleep on it a couple times. Hopefully, In a week they will be telling you how useful they are.

Drew Verlee21:09:55

> I have never seen a real world bug caused by a mutable object. This indicates they're under some amount of stress, as i doubt many OO experts/ thought leaders would attempt this line of reasoning.

Drew Verlee22:09:42

if all else fails. just remember its not your fault (parody of good will hunting)


This was the response to me defending Java records


A online TLA+ REPL (not the Clojure kind, of course) I have been working on, made with Fulcro, but as this is not the point, I put it here.


Considering getting a standing desk. Anyone have any favorites, or things to consider?


I've had this one for a couple of years and like it. I WFH full time so it gets used pretty much every day. I got it on sale at Costco for I think <$250 in store, not sure if they still carry it.


My only real gripe was that the glass top plus the tall but narrow metal rail underneath made it difficult to find a monitor arm that worked. I ended up having to glue a block of MDF to the underside in one corner for the arm to clamp down on. As it turns out I probably could've saved some money because I use it standing almost exclusively and don't really need the motorized adjustments, but didn't know I'd prefer standing so much when I first purchased.


I've been using an adhoc hand me down standing desk for many years and recently made a new pair of legs to make it less adhoc. My design for the "new" desk started with wanting to make it a built in, hang it from the wall, open up all the space under the desk. The existing base was similar to what you see for a lot of these standing desks. Capital I (in a serif font) shaped pillars connected by a rail low down and with the top across (very much like that picture). And that is a nice sturdy shape and design, and deals with moving up and down very well, it the bar on the bottom breaks up the space under the desk and makes it harder to use for storage and makes the back of the desk dead space (assuming it is against a wall at home).


So I very much recommend (if you are fine with a fixed height) just mounting a desktop(maybe an ikea counter top) to the wall, with supports underneath


But I am renting (and just moved, so the pain of that is fresh) so I made some big beefy C(squared though) shaped legs, where the lower support is back against the wall, so I have a huge amount of unbroken under desk space for storage


yeah, I've considered doing something similar wherever my next home office happens to be. I don't actually have enough contiguous wall space for a desktop here because both interior 'walls' are faux archways into other rooms and the exterior walls have lots of windows (not complaining). I thought about wall mounting the monitor arm with a pull-out keyboard/mouse tray but I do like having some actual desktop space to make a mess on also.


The manual ikea standing desks are not bad and cheap. The base is a tank, and the same base is used for both models size (it extends) , so you can replace the top easily if you want and make it larger.


Thanks for the tips 🙏


I previously had my monitor on some books, conbined with the standing desk they would increase the wobbliness. Got two monitor arms, and really like how it turned out. Also got a desk bike to verify ways of working.

Ahmed Hassan07:09:30

What would you say about new developments in Scala? (ZIO — A type-safe, composable library for async and concurrent programming in Scala) (A lightweight, distinctly Scala take on functional abstractions, with tight ZIO integration) These libraries cross compile to Scala.js as well, similar to Clojure/ClojureScript ecosystem. Do we need such libraries in Clojure and ClojureScript ecosystem?