3 ms·
What’s the benefit of writing this in Clojure, instead of in Java and designing it such that calling it from Clojure feels natural? Does it use any Clojure spec
by _sdegutis 9y ago
What’s the benefit of writing this in Clojure, instead of in Java and designing it such that calling it from Clojure feels natural? Does it use any Clojure specific features or have strict Clojure dependencies?
- dragandj 9y agoIn Java, it would require at least an order of magnitude more code. Additionally, you'd have to know exactly how to do it from the beginning, since it is much more difficult to experiment. High performance computing is not something that is fabulously well documented, so you have to poke around a lot to discover how things work. To see what I'm talking about, you should compare the codebase of neanderhtal (20.000 lines of code) with roughly similar libraries in Java (ND4J is something like 400.000 lines of code), or even Python (numpy is roughly 250.000).
- mac01021 9y agoDoes neanderthal claim feature parity with numpy and ND4J?
- dragandj 9y agoDo numpy and ND4J have feature parity among themselves?
- mac01021 9y agoFine... I should have said "or" instead of "and". I think it's a valid question in the context of your code size comparison.
- dragandj 9y agoThe point is that Neanderthal is not a port of either of those libraries. Sure, it does not have all the features of numpy or ND4J, but, on the other hand, it has many features that neither numpy nor ND4J have.
- tejinderss 9y agoBit offtopic. Would you recommend clojure as a web development programming language? I am from a python background and want to learn a new language. Previously thought of Rust and Haskell, rust seems to be too low level and carries mental burden of manual memory management and haskell seems too complicated for me. Thanks in advance
- dragandj 9y agoI would. Web dev is (for better or worse :) one of the main applications of Clojure. See further at https://clojurescript.org/ https://clojurescript.org/ and https://pragprog.com/book/dswdcloj2/web-development-with-clojure-second-edition https://pragprog.com/book/dswdcloj2/web-development-with-clo...
- iLemming 9y agoClojurescript today is probably the best, most pragmatic choice to do web dev in. It's not difficult to learn, FFI isn't cumbersome, compiled code is extremely optimized, tooling is pretty nice, syntax is a joy - writing Clojure is like poetry. I would never ever touch vanilla JS or TS (unless I really have to).