This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-20
Channels
- # babashka (36)
- # beginners (26)
- # calva (1)
- # clj-kondo (10)
- # clojure (94)
- # clojure-europe (7)
- # clojure-uk (16)
- # clojurescript (5)
- # conjure (6)
- # data-science (8)
- # datomic (24)
- # events (1)
- # fulcro (11)
- # funcool (1)
- # graalvm (6)
- # malli (18)
- # nrepl (5)
- # off-topic (13)
- # parinfer (3)
- # reagent (3)
- # reitit (6)
- # shadow-cljs (14)
I was reading "How to Take Smart Notes" and found a quote: > The best way to deal with complexity is to keep things as simple as possible and to follow a few basic principles. > Remind anyone of anything?
Is there a thing to take Java source code and convert it to clojure source code? Presumably one could use something like the https://javaparser.org/ and write some transformers (to take the Java AST and emit clojure source code) and have something that gets you 80% there. Would really be peachy if it could convert the javadoc into clojure function doc.
Like this (but for java)? https://roman01la.github.io/javascript-to-clojurescript/
@U0502D2GL I reckon that such a transformer would emit highly unidiomatic clojure code, e.g. lots of deftype, gen-class, other interop constructs there would also a lot of local mutability, which is not supported OOTB, see e.g. https://github.com/ztellman/proteus So, one can wonder if the result would be worth it
I'm curious @U0502D2GL what problem a tool like this would solve for you.
Well specifically I'm working in a mostly java world... and upon a occasion I'd like to repl though something... but to get very specific, atm I'm converting this example from Java to Clojure and the process is just tedious... https://github.com/gsuitedevs/java-samples/blob/master/gmail/quickstart/src/main/java/GmailQuickstart.java
as a practical matter... I will just fiddle with the Java code... and set aside the conversion for now...
My thought was to write a thing which reads/polls/events off new messages in my INBOX and reacts to certain email messages by invoking some clojure code on them.
The conversion doesn't look like a lot of work tbh...
normally I'd paste GoogleNetHttpTransport
, then invoke https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-add-missing-libspec for having the relevant :import inserted
I have cljr-add-missing-libspec bound to a particularly handy keybinding, so the whole process isn't too demanding
Yea, the conversion of the single file isnt particularly onerous - just a pita... however if I wanted to convert something more substantial then a tool might be useful...
Maybe a Clojure-based bytecode inspector would be more valuable for that