Linked by Thom Holwerda on Tue 1st May 2012 21:59 UTC
Mono Project Wow. "One crazy idea that the team had at that dinner was to translate Android's source code to C#. Android would benefit from C# performance features like structures, P/Invoke, real generics and our more mature runtime. [...] We decided it was crazy enough to try. So we started a small skunkworks project with the goal of doing a machine translation of Android from Java to C#. We called this project XobotOS." Most of Android's layouts and controls are now in C#. The small benchmark is stunning, but as much as I admire the work, I'm wondering that this like going from bad to worse - from Oracle's Java to Microsoft's C#.
Thread beginning with comment 516597
To read all comments associated with this story, please click here.
I'm disappointed
by Dasher42 on Tue 1st May 2012 22:19 UTC
Dasher42
Member since:
2007-04-05

I'm disappointed that they didn't translate it into Vala which would ditch the VM, but it could be that their work proved the possibilities and moved that forward. Vala is pretty similar to C#.

There are things I like about Android, but I wish we were using C or Vala or Genie as needed with LLVM where needed.

Reply Score: 1

RE: I'm disappointed
by schala09 on Tue 1st May 2012 22:26 in reply to "I'm disappointed"
schala09 Member since:
2012-05-01

Are you really surprised? This came from the team that's responsible for writing Mono, a free version of C#. And anyway, C# is a major language, used by millions of programmers worldwide, and which is an ECMA standard. I have never heard of Vala until just now; based on a quick Google search, it seems to be written by two people in their spare time.

Also, note that a language is not its implementation! It is possible to use any compilation strategy for any language. gcj is an ahead-of-time compiler for Java, and Microsoft produces an ahead-of-time compiler for C# called ngen.

Reply Parent Score: 3

RE[2]: I'm disappointed
by Dasher42 on Wed 2nd May 2012 03:18 in reply to "RE: I'm disappointed"
Dasher42 Member since:
2007-04-05

Two people in their spare time - maybe five years ago. It's now a leading language for developing GTK and Gnome applications, and the language behind the applications made by yorba.org and elementaryos.org.

One of the most fascinating things about it is that it has a syntactic front end for a language almost as elegant and concise as Python that compiles down to machine code, no VM, and has performance and memory footprints near C's.

http://live.gnome.org/Genie

Reply Parent Score: 2

RE[2]: I'm disappointed
by moondevil on Wed 2nd May 2012 06:26 in reply to "RE: I'm disappointed"
moondevil Member since:
2005-07-08

Many people like to refer to the EMCA standard for .NET and C# without reading it.

I guess it is better to state that "there is a ECMA standard for C#" as "there is a ECMA standard for C# v2.0".

Using just the ECMA standard compliant implementation, you are not able to make use of:

- Generics
- Nullable types
- Dynamic types
- LINQ
- CLR libraries for parallel programming

Microsoft stopped updating the standard in 2006.

Just check the ECMA web site for the standard documents.

I do develop with .NET everyday, so I am pretty aware of Microsoft actions in this area.

Reply Parent Score: 6

RE: I'm disappointed
by theuserbl on Tue 1st May 2012 22:43 in reply to "I'm disappointed"
theuserbl Member since:
2006-01-10

The most Android-smartphones have an ARM-CPU. But the last times, there comes some smartphones with x86-CPU.
To run ONE binary on different CPUs, is only possible with VMs (like Dalivik, Java or Mono) or with "universal binaries" (like Apple have done for some time).
The last one blow out the binaries. And if there comes additional CPUs-architectures, the existing programs will not run on it.
So a VM is the only solution!

Reply Parent Score: 6

RE[2]: I'm disappointed
by Alfman on Tue 1st May 2012 23:18 in reply to "RE: I'm disappointed"
Alfman Member since:
2011-01-28

theuserbl,

As you say, binary portability is an extremely good reason to have a VM, particularly in the mobile device market where there are a large variety of platforms. Compiling to specific individual targets just is not future-proof. Well designed VM's just about completely eliminate problems of locked hardware. Also, new JIT compilers can optimize older programs to use new CPU features.

Another benefit of VMs is applications sandboxing as well as eliminating most memory corruption conditions.

Reply Parent Score: 6

RE[2]: I'm disappointed
by Dasher42 on Wed 2nd May 2012 03:23 in reply to "RE: I'm disappointed"
Dasher42 Member since:
2007-04-05

Open source and builds are a solution. As much fragmentation as there is for Android phones, it seems like this problem exists anyway. I'm thinking that virtualizing the processor is a better solution - hence using LLVM and compiling the bytecode to machine code.

Reply Parent Score: 1

RE: I'm disappointed
by henderson101 on Tue 1st May 2012 22:54 in reply to "I'm disappointed"
henderson101 Member since:
2006-05-30

Vala is tied to the GObject system and is pretty far from a drop in replacement, where as C# is an almost direct analogue with many advantages over Java (P/invoke being the most obvious.)

Reply Parent Score: 4

RE[2]: I'm disappointed
by Valhalla on Wed 2nd May 2012 02:18 in reply to "RE: I'm disappointed"
Valhalla Member since:
2006-01-24

Vala is tied to the GObject system and is pretty far from a drop in replacement,

It was quite some time ago I looked at Vala but unless I'm mistaken you could write a Vala program without using GObject and also add bindings to any library you wish (either straight up bindings or 'objectifying' using a VAPI file).

As I recall the biggest difference is that there's no full-blown GC but only reference counting and that Vala compiles to C and then to native code.

The only Vala program I've used is Shotwell and that is indeed great, certainly way more performant than F-spot was (although I can't say for sure if that is a question of Vala vs Mono or a matter of the the skill of the actual programmers).

Reply Parent Score: 3

RE: I'm disappointed
by Zifre on Wed 2nd May 2012 00:10 in reply to "I'm disappointed"
Zifre Member since:
2009-10-04

Vala doesn't have garbage collection, so there would be a lot of leakage from reference cycles without major manual modifications.

Reply Parent Score: 4

RE: I'm disappointed
by Delgarde on Wed 2nd May 2012 02:49 in reply to "I'm disappointed"
Delgarde Member since:
2008-08-19

I'm disappointed that they didn't translate it into Vala which would ditch the VM, but it could be that their work proved the possibilities and moved that forward. Vala is pretty similar to C#.


Only superficially. The language syntax is similar, yes, but that's where it ends. The runtime environments are completely different, and it's the similarity of the Java and .NET runtime environments that makes things like this possible.

Reply Parent Score: 2

RE[2]: I'm disappointed
by Dasher42 on Wed 2nd May 2012 03:21 in reply to "RE: I'm disappointed"
Dasher42 Member since:
2007-04-05

I agree, you're right, but I'm very interested in seeing a Linux-based OS for smartphones where any virtualization happens at the machine level, not the runtime library level, hence using stuff like LLVM in a way akin to Taos: http://www.uruk.org/emu/Taos.html

Reply Parent Score: 1