Fork me on GitHub

On what things is Clojure and Clojurescript not a good fit?


Maybe real-time embedded systems? Although I know there are folks who have setup robotics controlled by Clojure using a REPL...


If you have either a JVM, a CLR, or a JS runtime, you can use Clojure.


The only short description I can think of is "problems that are easily solved by other tools where Clojure doesn't currently have a quick/easy solution".


(and to extend my answer, given there are native binary tools now like bb, nbb, sci, etc you can use Clojure for all sorts of scripting tooling where you don't have -- or don't want -- JVM, CLR, or JS)


In the long run, you could probably use clojure for most problems. If there is a short/medium term need for a problem Clojure doesn't currently solve, then maybe it's not a good fit.


The fact that clojure is hosted means you can use it in almost any environment. Clojure also provides a lot of simple pieces which make it very flexible.


Trying to embed clojurescript inside an existing javascript app with lots of back and forth interop between them is not something I’d recommend. Things where you really care about high performance and low memory usage are probably better off in some other language. Algorithms that really benefit from imperative, mutable state are much more difficult to write in clojure. There is definitely a difference between can you do it and will it be the most direct way to do it.


Many of those algorithms are already implemented in libraries that you can use from Clojure/Script tho'...


Yeah of course. But typically written in java or JavaScript. So not writing the algorithm in clojure


I haven't embraced bb for scripting, so I still reach for bash instead for shell stuff 🙂


How mature is clojure's AI as compared to python's?


Definitely not as mature. There are ways to call python from clojure. But python has more libraries and resources. I've done some ml with clojure. It was great. But python is just a much bigger ecosystem


Define "AI". For MXNet, Clojure is a first-class citizen: There's a lot of activity in the #data-science community these days around Clojure.


#libpython-clj is already pretty active in terms of using Python stuff directly from Clojure and I think that grew out of the whole data science side of things?


I see! interesting!


My answer would be that there are many things clojure is not perfect for, but I would say that this is true of every language. Python does have a more vibrant ML community. This is obvious. The community around JS is massive and dwarfs clojure-targeted usage of same. No one disputes that. Systems programming is not something clojure on the JVM is geared toward. Rust is getting love in the Linux kernel. You can make a simple web app in Rails much faster than cobbling a dozen libraries together and rolling your own auth. All of that said, it really depends on what you're trying to do, and it depends on who you're working with. You can build your own language for describing your system in clojure, and eventually that can be much more powerful than choosing the easy way in a different language. That's pretty cool! I guess my only point is that I'm personally a hard-line pragmatist, and I appreciate people in tech who start the conversation by telling me why I shouldn't use their tech. To wit: Since you asked, if your goal is to go deep on ML and have immediate access to all of python’s ML ecosystem, clojure really doesn't compete. Thats just a fact. On the other hand, I still have it as my default starting point language-wise. If it's going to be too painful to implement and maintain X, perhaps I'll choose another option.


It may not always be the best choice, but it is frequently a good choice, depending of course on what you're building.


@U06DQC6MA I think I highly agree with you. so a) if python is 100 in AI/ML then what would be clojure at? (just to get a rough idea) b) ML is not my primary goal though but it may get later (just having insurance 🙂 ) c) I am a web dev having a large react/node project and planning to shift to clojure(script). e) I tried a lot. Are there any "really" good video tutorials for clojure and clojurescript?


f) this was very interesting (though I didn't understood 100% due to my lack of knowledge) "You can build your own language for describing your system in clojure,"


g) I feel the notion 100% for "I guess my only point is that I'm personally a hard-line pragmatist, and I appreciate people in tech who start the conversation by telling me why I shouldn't use their tech."


The question is not whether Clojure is 60 or 80 or 40 at ML. The question is what are you trying to achieve, and do the offerings that already exist satisfy your ML needs (MXNet)


Maybe I meant the ecosystem and community support. In many countries, people don't even know what is "clojure" yet... really


I guess e) for now is most important for me to get going


Lisps are notorious for being language toolkits, where you can build up your own programming language. Other languages don't have this flexibility


that's what I meant by powerful


That is sexy!


I love it. I dreamed of this. Excited


I am a "learn by videos" person.


clojure has never been a commodity programming language, and i doubt it ever will be. There are trade offs but I mostly view this as a good thing


anyway, I'm glad you're here :) it's a good community, and there's a ton to learn


oh I wonder why it was never and never will be a commodity / a normal language in mainstream?


just like ruby/ javascript/ java/ php is


Microsoft, google, Amazon don't develop it is all I really mean by that


don't develop "in it" or develop "it" ?


Microsoft developed and throws money behind .NET, typescript . Google hired guido van rossum and adopted python. They created Go with Rob Pike and maintain it. Etc.


I see. I wonder why they didn't used lisps?


It's cost effective to commodify programmers


interesting, what benefit they will get in it?


cheaper labor


I wonder.. /me thinks


like giving simple toys to dummies and getting the job done.


though fwiw I know Apple has Clojure in prod


It's just not their default interview


Is that the same for Rust as well?


If what you said is true, c, c++, assembly, lisp would have just suffice..


which part?


"It's cost effective to commodify programmers" this


Commodity programming languages don't start that way, they become it


So we’ll see


"cheaper labor" part. I take out of it that when they make a new langauge, they divide programmers as commodities thus reduce code after taking away some part of brain from the developers


seems these languages were not that much needed.


c, c++, assembly, lisps, would have been enough. But it is a deep topic. I should not talk much on it without good knowledge. I just know webdev so not qualified to speak much.


sure you are! 🙂

🙌 1

It was nice talking with you, but I must go to bed.


DM me if you ever want to chat. Good evening!


Same here. Thank you! 🙂


Pleasure was mine

🙇 1

on the commodity languages topic, Alan Kay talks about this here: "corps are telling universities that they need people who are experts in programming in this lang or that lang. all those languages are completely obsolete, but they happen to be the ones that your legacy software is written in. and b/c universities have decided to turn themselves into businesses they're feeling the pressure from corps b/c they want to get money from the corps " Rob Pike has also talked about this dominant programming model/philosophy (java, c++ etc) taught in universities being a conscious constraint on the design of go: So we see the interesting "new" languages come out of one person's head outside of any of the straight jacket environments of corps or universities (rust developed by one , clojure developed by one

👍 1

@U051V5LLP I very much feel the notion and the words you typed in quotes (the words this man in videos spoke) but I also wonder, if c++/c, Lisp etc was enough, why people went ahead with Java, why Javascript was not taken over by some other language. THen we have Objective C and other crap. Why still clojure is not welcomed in corporates and not in mainstream?


I mean, corps should have no problem if it gives them advantage..


To your first point "if c++/c, Lisp etc was enough" - where is this claim made? Who made it? With what evidence? To the second point "Why still clojure is not welcomed in corporates and not in mainstream?" Probably a combination of 1. and 2. the positive feedback loop of incentives mentioned in Alan's talk between the outputs of business (legacy software) and the inputs into businesses of new workers trained in yesterday's technologies. You end up with a Pareto distribution of language use, which once established is very hard to break. As to why the humans operating businesses don't see novel technology and research as an advantage (you perhaps didn't watch Alan's talk because this is a core thesis of it) - it likely comes down to a combination of market incentives as currently practiced in society (arriving at local maximums via short term iteration instead of delayed gratification for potentially exponential upside later) and the well know of humans built into our hardware. I would recommend looking into Alan Kay's work and talks (his recommend books will provide lots of insights), he is one of the people who has seen the truth about the implications of human cognitive limitations and has talked about (for decades now) why these phenomena occur.


one of the standout talks of his is "Normal considered harmful" which contains insights into why groups of humans do not change, particularly to known better solutions


@U051V5LLP Interesting. Can you summarise in one line on what is the reason why clojure is not so famous like Java is (lets say). Or any other language with similar age. Why less devs. Why less jobs.


@U051V5LLP understandable. Your comments were very helpful 🙂


Eye opening and somewhat I was already trying to agree under the gut


Does this look like a reasonable workaround for

(let [^PrintWriter orig-*err* *err*
      ignored-lines #{"WARNING: parse-long already refers to: #'clojure.core/parse-long in namespace: taoensso.carmine, being replaced by: #'taoensso.carmine/parse-long"
                      "WARNING: parse-double already refers to: #'clojure.core/parse-double in namespace: taoensso.carmine, being replaced by: #'taoensso.carmine/parse-double"}]
  (set! *err* (PrintWriter-on (fn [s]
                                (let [s (->> (str/split-lines s)
                                             (remove ignored-lines)
                                             (str/join "\n"))]
                                  (.println orig-*err* s)))


I import namespace a in namespace b. After import b in namespace c, how can I access the methods in ns a? For example, something like b/a/foobar ? I know it is not common, but is it possible?


You can't. require a in namespace c to access its functions


Actually you can but you have to use a full reference name like a/foobar but that is definitely not a good practice.


Can you elaborate on the a/foobar part?

Sam Ritchie15:05:32

It's not good practice because if b stops depending on a, c will break. Have c declare its dependency on a and you're safe!

☝️ 1

I have a namespace (which is actually the b here). I want it to consolidate all the data manipulation function such as specter and others.

Sam Ritchie15:05:07

It won't work unless you re-export the defs you've imported from a using, for example


oh no! don't tell people about potemkin! 😅

😂 2
Sam Ritchie16:05:04

Haha until I find a better way to make project organization more flexible I can't ditch it