Fork me on GitHub
eccentric J13:09:21

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?

💯 3

Is there a thing to take Java source code and convert it to clojure source code? Presumably one could use something like the 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.


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


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


I have something for that


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