off-topic

https://github.com/clojurians/community-development/blob/master/Code-of-Conduct.md Clojurians Slack Community Code of Conduct. Searchable message archives are at https://clojurians-log.clojureverse.org/
2020-09-20T13:56:21.012800Z

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?

💯 1
bherrmann 2020-09-20T14:03:56.013500Z

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.

emccue 2020-09-21T18:00:29.045Z

I have something for that

emccue 2020-09-21T18:01:04.045200Z

you have to send me the code in an email and wait a few days for it to run though.

souenzzo 2020-09-20T14:26:31.014100Z

Like this (but for java)? https://roman01la.github.io/javascript-to-clojurescript/

vemv 2020-09-20T16:09:05.014300Z

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

chepprey 2020-09-20T16:24:18.014600Z

I'm curious @bherrmann what problem a tool like this would solve for you.

bherrmann 2020-09-20T17:14:02.014800Z

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

bherrmann 2020-09-20T17:27:05.015100Z

as a practical matter... I will just fiddle with the Java code... and set aside the conversion for now...

bherrmann 2020-09-20T17:31:01.015300Z

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.

vemv 2020-09-20T17:50:46.015700Z

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

bherrmann 2020-09-20T20:36:48.016100Z

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

sova-soars-the-sora 2020-09-20T21:47:47.016300Z

Maybe a Clojure-based bytecode inspector would be more valuable for that