Might be quick when running but the jvm startup time is a pain. By the time the java solution starts up, my c based solution has already finished.
http://blog.ndk.io/2014/02/11/jvm-slow-startup.html 40ms sounds okay for me, even for most command line tools. Oh and I most probably don't get a segmentation fault ;-)
$ time ruby -e "puts 'hello world'"
> hello world
>
> real 0m0.076s
> user 0m0.029s
> sys 0m0.017s
And here's jruby: $ time ruby -e "puts 'hello world'"
> hello world
>
> real 0m1.161s
> user 0m2.050s
> sys 0m0.093s