8

Does anyone know of some alternative JVM language, however obscure it might be, which can compile to plain old java bytecode, without the need of a language runtime.

I need this in order to try to develop android applications without startup or size penalty. Scala, Clojure and Groovy all require its own runtime library distributed with the application, so they are out of the scope of this question.

The only one language which claims to satisfy this goal is Charles Nutter's Mirah, but I couldn't make it to work on windows.

EDIT: To clarify a bit, I know any language has to have runtime library. Obviously, what I am looking for is a language that has no additional runtime required besides JRE, or at least very limited one.

Marko
  • 30,263
  • 18
  • 74
  • 108
  • 1
    If you've got the patience, [there's a web site devoted to languages for the JVM](http://www.is-research.de/info/vmlanguages/). It shouldn't be too difficult to go through that and spot the likely candidates. – JUST MY correct OPINION Sep 08 '10 at 13:23
  • 1
    Incidentally, I think it's going to be very difficult to find a language -- any language on any platform -- which doesn't have its own runtime library. I mean to make even C useful you have a standard C library that comes along for the ride 99 times out of 100. – JUST MY correct OPINION Sep 08 '10 at 13:29
  • I clarified the question to note that no-runtime actually means no additional runtime besides JRE, of course. – Marko Sep 08 '10 at 14:03

2 Answers2

6

There is none I can think of (maybe Mirah, which is experimental and will need at least some additional classes I guess). Every language needs a runtime for the task you want to do.

The only difference is how much usable classes are already on your device. If you develop Java and only use the libraries which are already on the device, your application will be quite small.

While it may not be the best approach to your problem, do you have considered using ProGuard? ProGuard can remove parts of a runtime which are not used in your specific program.

Another approach if speed and time is really critical would be going with the NDK (C/C++) instead.

soc
  • 27,983
  • 20
  • 111
  • 215
  • The goal is to avoid Java, but not to pay too big size and performance penalty. Code minimizers like ProGuard can reduce runtime footprint, but can't remove it completely. Also, as much as I would like to avoid Java, I would even more like to avoid C/C++. – Marko Sep 08 '10 at 15:04
  • 1
    I would use Scala. The size is OK with Proguard, it is not Java and it is as fast as Java (not like JRuby, Mirah, Jython, etc.). – soc Sep 08 '10 at 15:10
  • 6
    FYI Mirah is a compiled language on the JVM & can produce either `.class` files or `.java` files. It doesn't need a separate interpreter or runtime and currently has no standard library, so it is as fast as Java--like Scala. – BaroqueBobcat Sep 13 '10 at 23:25
1

Xtend has a super slim library (100kb) which directly delegates to JDK and Guava.

Sven Efftinge
  • 3,065
  • 17
  • 17