JVMBot – a twitter bot that will evaluate JVM (Groovy, Scala and Javascript on Nashorn) code for you. robot-161367_1280

Not so long ago I have attended an awesome conference BuildStuff, organised by Greg Young et all.

The interesting part for me, being a strictly JVM developer for the past decade, was that most of the talks where from the other side of the IT world, the JVM big ol’ nemesis – dot net. And to my surprise on most of the talks I heard jokes being told about C# developers. It seems The Thing now, on the .Net side, is F# (like Scala is on our side).

So I went to a very entertaining and inspiring talk by Mathias Brandewinder called The Great @fsibot Caper. On the talk Mathias told the story about his @fsibot twitter bot that can compile F# code tweeted to it and reply with the result. After he finished it and put it on his own computer he thought – “What can go wrong in 140 characters?” and his talk was exactly about what can go wrong. If you can see it somewhere – don’t think, just go. You’ll like it.

So then I talked with my good friend Adam Warski and we decided – next time on our company hackathon we will create exactly the same thing, but for the JVM world. Registered the handle @jvmbot and few days later we got into coding (together with Piotr Buda and Michał Matłoka).

Here is how the whole thing works out (a bit simplified)

The whole thing works on Akka actors, full source code can be found on github. For security reasons have decided to use Docker to sandbox the execution of code. When running the images we are limiting memory and switch off the network, so that hackers can’t hack (too much) ;-). The bot itself is hosted on Amazon EC2.

Please go ahead and send the bot your code snippets at https://twitter.com/jvmbot. Show us what awesome things you can do with it and/or what did we not think about 😉 Enjoy!

Below a tweet I have copied from Srdjan (this tweet exactly) and translated from F# to Groovy doing some really cool stuff

Say hello to JVMBot!

2 thoughts on “Say hello to JVMBot!

Leave a Reply

Your email address will not be published. Required fields are marked *