Is there a statically typed language that runs on both the JVM and the CLR?

I am writing code that I want to eventually execute on PC, Xbox and Android platforms, and if possible also Mac and Linux. Instead of rewriting it for each platform, I would like to write it once in a language that will work on all of those platforms. I looked at Fantom, but it doesn't seem to work on Android and it has limited support for static typing and generics, and I've heard that Scala will work in the CLR, but it doesn't currently work. which don't allow XNA to be used. I don't want to use a dynamically typed language because dynamic typing is slower (especially important on smartphones) and harder to debug.


source to share

2 answers

Why do you need to configure the JVM? If this need is purely for Android, then probably check out MonoTouch , which is a .NET stack for popular mobile platforms developed by Xamarin (the people behind Mono when it was developed back then at Novell). Mono itself is a way to target Mac and other POSIX platforms using the X Window System for graphical interaction (what you call "Linux").

Keep in mind that you still have to rewrite GUI components for different platforms: firstly, the approach to interfaces used on touch devices is quite different from that on "desktop" devices and secnd, while MonoTouch will probably provide a unified user interface across the platforms it targets (Android, iOS, WinPhone). Windows, Mac and X platforms have their preferred GUI stacks available via .NET or Mono - WPF or Winforms on Windows, MonoMac on Mac OS X (via Cocoa), and Gtk # on POSIX platforms using X. Mono seems to be provides a unified GUI stack for all these desktop platforms as it supports Winformsbut the overall look and feel can be suboptimal on non-Windows platforms, so you'll have to search.

But at least the core programming logic doesn't need to be ported to every platform.

PS Also note that most of the modern JVM based software stacks I have had to look at on different occasions supported the CLR via IKVM , what type of CLR "wraps" pretending to be a JVM in the eyes of Java code.



Yes, Scala is commonly used in the JVM . also has some CLR support . Clojure is not statically typed, but I believe it also has (or does) support for both JVM and CLR.



All Articles