This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-07
Channels
- # asami (1)
- # aws (2)
- # babashka (5)
- # babashka-sci-dev (162)
- # beginners (68)
- # biff (1)
- # calva (26)
- # circleci (4)
- # clj-kondo (5)
- # cljs-dev (7)
- # clojure (84)
- # clojure-europe (15)
- # clojure-uk (1)
- # clojured (2)
- # clojurescript (19)
- # conjure (1)
- # datomic (5)
- # emacs (2)
- # graalvm (20)
- # honeysql (6)
- # improve-getting-started (2)
- # kaocha (3)
- # lsp (31)
- # off-topic (7)
- # pathom (7)
- # releases (1)
- # shadow-cljs (1)
- # spacemacs (1)
- # vim (30)
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 🙂
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: 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.
#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?
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
Lisps are notorious for being language toolkits, where you can build up your own programming language. Other languages don't have this flexibility
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
oh I wonder why it was never and never will be a commodity / a normal language in mainstream?
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.
"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
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.
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)
@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?
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.
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 🙂
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)))
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.
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!
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.
It won't work unless you re-export the defs you've imported from a using https://github.com/clj-commons/potemkin, for example
Haha until I find a better way to make project organization more flexible I can't ditch it