Fork me on GitHub
#off-topic
<
2020-09-06
>
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?

lispyclouds16:09:52

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

borkdude16:09:13

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

borkdude16:09:11

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

borkdude16:09:14

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.

borkdude16:09:56

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

p-himik16:09:31

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

borkdude16:09:17

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.

borkdude16:09:27

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

borkdude16:09:36

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

scriptor16:09:08

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

borkdude16:09:21

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

lispyclouds16:09:55

+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?

scriptor16:09:14

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)

orestis19:09:09

I’d definitely do Elixir

seancorfield19:09:44

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.

dharrigan20:09:35

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)

dharrigan20:09:42

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 🙂

dharrigan20:09:06

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

dharrigan20:09:22

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

JP Silva20:09:44

Thanks for the answers. Interesting no one mentioned GoLang

👆 3
borkdude20:09:36

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

Cameron20:09:58

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

seancorfield21:09:01

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

seancorfield21:09:20

@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).

seancorfield21:09:09

(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

seancorfield21:09:56

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

seancorfield21:09:30

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.

seancorfield21:09:18

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.

seancorfield21:09:49

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

borkdude21:09:11

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

seancorfield22:09:11

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.

orestis04:09:04

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
seancorfield04:09:42

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).

seancorfield04:09:01

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

gibb06:09:45

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.

gibb06:09:57

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).

Faris07:09:26

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

borkdude07:09:34

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

Faris07:09:22

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

borkdude07:09:36

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.

borkdude08:09:05

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

borkdude08:09:21

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

Faris08:09:06

How was it like maintaining long term?

borkdude08:09:42

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

seancorfield16:09:19

@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.

borkdude16:09:42

Ah I see, didn't know that

seancorfield16:09:46

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

Ahmed Hassan07:09:30

What would you say about new developments in Scala? https://github.com/zio/zio (ZIO — A type-safe, composable library for async and concurrent programming in Scala) https://github.com/zio/zio-prelude (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?

mpenet08:09:32

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

mpenet08:09:49

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

littleli09:09:38

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
littleli09:09:06

We have to live with our choices.

Ahmed Hassan03:09:45

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

adamtait20:09:34

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!

andy.fingerhut20:09:05

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: https://www.smbc-comics.com/comic/on

😂 3
emccue21:09:03

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

seancorfield21:09:21

Some people just can't be reasoned with 🙂

andy.fingerhut21:09:57

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 https://www.youtube.com/watch?v=3H61INFma8g (parody of good will hunting)

emccue21:09:37

This was the response to me defending Java records

pfeodrippe23:09:02

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. https://bit.ly/2QYNDoH

cjsauer23:09:00

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

chucklehead02:09:26

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. https://www.twinstarhome.com/products/desks/ashford-standing-desk/

chucklehead02:09:00

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.

hiredman03:09:47

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).

hiredman04:09:07

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

hiredman04:09:13

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

chucklehead04:09:45

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.

mpenet05:09:04

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.

cjsauer16:09:56

Thanks for the tips 🙏

gklijs18:09:38

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? https://github.com/zio/zio (ZIO — A type-safe, composable library for async and concurrent programming in Scala) https://github.com/zio/zio-prelude (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?