Fork me on GitHub
#clojure
<
2022-05-07
>
Intelo00:05:56

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

seancorfield00:05:38

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

seancorfield00:05:09

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

phronmophobic00:05:32

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

seancorfield00:05:08

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

phronmophobic00:05:42

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.

phronmophobic00:05:02

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.

Jimmy Miller00:05:33

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.

seancorfield00:05:01

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

Jimmy Miller00:05:35

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

seancorfield00:05:52

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

Intelo00:05:45

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

Jimmy Miller00:05:30

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

seancorfield00:05:44

Define "AI". For MXNet, Clojure is a first-class citizen: https://mxnet.apache.org/versions/1.8.0/api/clojure There's a lot of activity in the #data-science community these days around Clojure.

seancorfield00:05:36

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

Intelo00:05:03

I see! interesting!

devn06:05:36

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.

devn06:05:30

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

Intelo06:05:11

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

Intelo06:05:17

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,"

Intelo06:05:14

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

devn06:05:50

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)

Intelo06:05:04

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

Intelo06:05:30

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

devn06:05:39

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

devn06:05:47

that's what I meant by powerful

Intelo06:05:58

That is sexy!

Intelo06:05:22

I love it. I dreamed of this. Excited

Intelo06:05:08

I am a "learn by videos" person.

devn06:05:06

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

devn06:05:33

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

Intelo06:05:09

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

Intelo06:05:21

just like ruby/ javascript/ java/ php is

devn06:05:15

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

Intelo06:05:06

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

devn06:05:18

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.

Intelo06:05:48

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

devn06:05:17

It's cost effective to commodify programmers

Intelo06:05:49

interesting, what benefit they will get in it?

devn06:05:00

cheaper labor

Intelo06:05:20

I wonder.. /me thinks

Intelo06:05:05

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

devn06:05:51

though fwiw I know Apple has Clojure in prod

devn06:05:00

It's just not their default interview

Intelo06:05:42

Is that the same for Rust as well?

Intelo06:05:05

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

devn06:05:05

which part?

Intelo06:05:42

"It's cost effective to commodify programmers" this

devn06:05:25

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

devn06:05:32

So we’ll see

Intelo06:05:41

"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

Intelo06:05:31

seems these languages were not that much needed.

Intelo06:05:14

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.

devn06:05:51

sure you are! 🙂

🙌 1
devn06:05:12

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

devn06:05:45

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

Intelo06:05:27

Same here. Thank you! 🙂

Intelo06:05:36

Pleasure was mine

🙇 1
dvingo15:05:22

on the commodity languages topic, Alan Kay talks about this here: https://youtu.be/NdSD07U5uBs?t=169 "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: https://news.ycombinator.com/item?id=16143918 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 https://web.archive.org/web/20160609195720/https://www.rust-lang.org/faq.html#project , clojure developed by one https://clojure.org/about/history)

👍 1
Intelo08:05:53

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

Intelo08:05:26

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

dvingo15:05:52

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. https://en.wikipedia.org/wiki/Path_dependence 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 https://en.wikipedia.org/wiki/List_of_cognitive_biases 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.

dvingo15:05:51

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

Intelo16:05:04

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

Intelo17:05:11

@U051V5LLP understandable. Your comments were very helpful 🙂

Intelo17:05:34

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

p-himik13:05:26

Does this look like a reasonable workaround for https://clojure.atlassian.net/browse/CLJ-1592?

(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)))
                              nil)))

pinkfrog14:05:09

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?

delaguardo14:05:52

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

delaguardo15:05:41

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

pinkfrog15:05:34

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
pinkfrog15:05:36

I have a app.util.data 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 https://github.com/clj-commons/potemkin, for example

devn16:05:55

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