Mono's MCS Compiles Itself On Linux 216
thing12 writes "On Thursday Paolo Molaro announced that he had managed to build the MCS C# compiler using MCS. This is a big step forward for Mono, as it means that Mono is almost a self hosting environment."
One step at the time (Score:1)
Re:One step at the time (Score:1, Redundant)
Re:One step at the time (Score:5, Informative)
Now MCS is able to compile itself using the mono runtime.
Hope this helps
Re:One step at the time (Score:1)
Not entirely.... I've been following this, and I wasn't aware that a runtime environment had been developed for Linux. Is this correct? The announcement doesn't enlighten much with all its talk of mint and so on. Mint, then, is the counterpart for the JVM for Linux? And it can run the C# "executable"?
Re:One step at the time (Score:2)
Almost but not quite... (Score:5, Informative)
Kudos to the Mono team for the work they've done so far, however.
Re:Almost but not quite... (Score:4, Funny)
Isn't it the expected outcome? It's considered done!
Re:Almost but not quite... (Score:3, Funny)
Re:Almost but not quite... (Score:3, Interesting)
It's a heck of a milestone. Of course it's not useful yet, but they're not claiming it is.
99% is not 100% (Score:1)
Re:99% is not 100% (Score:2)
Re:Almost but not quite... (Score:2)
I guess it's sort of like that classic definition of a species: it's not enough for the creature simply to be able to reproduce -- the offspring has to be fertile as well!
Re:Almost but not quite... (Score:1)
I don't think that this really counts as "compiling itself". IIRC, the gcc compilation instructions describe compiling gcc, and then using gcc to compile itself, and comparing the two compiles' outputs to make sure that they are the same.
So, compiling on Linux is good. But a build of the compiler doesn't really count as stable unless you can compile it with itself and find that it generates the same output.
this was already posted (Score:1, Redundant)
If this was in fact news though, I'd mention that this will bring more linux developers to mono, thanks to there being a compiler for it that isn't just for
Re:this was already posted (Score:1)
Re:this was already posted (Score:1)
RMS wont be too happy (Score:2, Interesting)
Re:RMS wont be too happy (Score:3, Informative)
Are you sure? My link [com.com] (4th paragraph, "With DotGNU and Mono...") says Stallman thinks its a good idea. Where's your link?
Re:RMS wont be too happy (Score:1)
(Serious, I'm at a loss on this one)
Self compiling and newbie Slashdot readers (Score:2, Funny)
Lately I have been feeling isolated while reading Slashdot. Not knowing all the common abbreviations and whatnot. Try to explain more about things instead of believing everyone already knows everything. I think Slashdot should try to adapt more to the newbie instead of only to the veteran.
Re:Self compiling and newbie Slashdot readers (Score:4, Informative)
Re:Self compiling and newbie Slashdot readers (Score:5, Informative)
Its also necessay step if you're creating your language from scratch. For more precisions try : comp.compilers [iecc.com]
For your abbreviation problem dry your tears and try http://www.everything2.com
Re:Self compiling and newbie Slashdot readers (Score:1)
In Modern Compiler Design [cs.vu.nl] the advantages of compiling your compiler in the language (system) you are developing are summarized as this:
first, basic sanity check because it shows you're compiler and language are at least able to do work together
second, an extended sanity check because typically a compiler is a BIG program. This means not only small test-programs will be compilable, but also a real-world, large-scale application.
They mention as a possible disadvantage that there might be a danger that the language will be a bit biased towards creating a compiler. However, in case of C# (where the language is already defined) this is not the case of course.
Re:Self compiling and newbie Slashdot readers (Score:1)
Re:Self compiling and newbie Slashdot readers (Score:1)
Re:Self compiling and newbie Slashdot readers (Score:2, Interesting)
It's news for nerds. News for newbies is here [cnn.com].
I'll answer your specific question anyway:
Re:Self compiling and newbie Slashdot readers (Score:2)
Was Wirth really the first? "Compilers and Compiler Generators" says and I seem to remember the first LISP systems being bootstrapped, too.
Re:Self compiling and newbie Slashdot readers (Score:4, Informative)
Re:Self compiling and newbie Slashdot readers (Score:2)
Re:Self compiling and newbie Slashdot readers (Score:2)
AFAIK (IANAL) ISTR TMTOWTDI. FWIW, YMMV; TIA.
First way [tuxedo.org]
Second way [astrian.net]
Third way [netlingo.com]
Chicken or the egg (Score:2)
I think this is great work from the Mono team. They've passed one of the biggest hurdles in implementing a compiler. At university we have been using Java in situations where they *could* have made us use c#. If in the future they do say "we want you to use c#", I can happily stay on my linux box and use it. It's always good news when there's yet another thing that Linux can do just as well as MS.
Re:Chicken or the egg (Score:2)
What came first - the chicken or the egg?
Actually, there exists a correct answer, but to understand it you must understand the question first.
Evolution is the key.
Re:Chicken or the egg (Score:4, Insightful)
Re:Chicken or the egg (Score:1, Informative)
Two things:
-The ximian project is not "linux, the community" (proven by the amount of mis-communication between the leaders of the linux kernel project the gnu projects and the ximian project in the past) so when you say "linux ripping of microsoft....
Two and most immportandly, comparing the way mono implements an open standard (thats what the
Re:Chicken or the egg (Score:1)
I'm a java programmer myself I appreciate many of the intracacies on the language. I do have issues with how Sun (and the Java Community Process) does things. How about that garbage about Sun not certifying any OSS EJB containers? Providing a little heat from an alternative technology may just shake things up a bit. Further, opening up platform independence at the language level for enterprise apps makes sense, IMHO. I'm not jumping to .net by any means, although I AM watching with a very keen interest.
Fine, but you have to start _somewhere_. Mono started VERY far behind MS in developing aWhile I thoroughly enjoy beating on MS, .net is very innovative. The problem with MS (tech wise) is that the implementation of these great ideas seems to be lacking.
Just MHO, of course...
Re:Chicken or the egg (Score:2)
It is? I must have missed the
They did it on *Linux* (Score:4, Informative)
of the story, the fact that they compiled C# using MCS on *Linux*, using the Linux runtime, as opposed to doing this on Windows, which was done
about two months ago.
Re:They did it on *Linux* (Score:3, Insightful)
Re:They did it on *Linux* (Score:2)
the end of the world is near! (Score:1, Funny)
how else should a microsoft compiler be compiled under linux? its the work of satan manifesting itself again before good old jesus comes to town and wipes us all out? i amm 100% sure that soon we will see cats hunting after dogs, fishes fly and steve ballmer talking backwards (ok he allready does that).
get your girl or boyfriend and make some love before our whole planet explodes. and yes, the story about america planning to use nuclear bombs against 'terrorists' has something to do with.
--
STOP THE GENOCIDE! RMS cut your HAIR!
We are close... (Score:3, Funny)
Boy, we need to implement BSOD for this, hint, hint.
So... (Score:1, Funny)
Re:So... (Score:2)
It is not on the FAQ as this is more of a CIL core question, rather than being a question about the Mono project itself (which is an implementation of the CIL).
Miguel.
Great News (Score:2, Interesting)
I'm far from a microsoft fan, my entire career depends on my unix admin skills, but being a dabbeler in programming (mostly procedual stuff) has really opened my eyes on programming in general, and c# is an EXCELLENT object oreintated language, as soon as i picked up a little c#, object oreintation just started to make sense, i had difficulty with it before in c++ but now the peices fall into place.
Combine this with the excellent garbage collector features, and EXTREMLY easy to use GUI designer (just as easy as visual basic) and ability to import code from other languages and use it combines to make C# a great language, I for one am extremly happy gnome is supporting it and hope you all give it a try. Tell me what you think.
Anyone in the perth area is welcome to email me(arevill@bigpond.net.au) and ill give you a little tour
Re:Great News (Score:1)
Mind you, don't mind C# being implemented for Linux/unix, can't do any harm, and as you say, seems to be quite nice lang.
Re:Great News (Score:1)
Re:Great News (Score:3, Funny)
Good heavens, what a coincidence. Yet strangely C# is 'shocking', 'amazing' and 'excellent' whereas Java is...? The same weight as a duck, perhaps?
silly duck argument (Score:2)
C# will be easy to learn for both C++ and Java programmers for the same reason Java was easy for C++ programmers. And, it has some wonderful advantages over both for client side GUI programming.
Re:silly duck argument (Score:2)
However, I can't help noticing that you've not gone so far as to enumerate the equally scintillating improvements that C# offers over Java. Client-side GUI programming? Sounds very exciting...
Re:silly duck argument (Score:2)
As for enumerating equally scintillating improvements that C# offers over Java, that's a red herring. It's not a necessary condition for C-B to equal B-A in order for it to be true that C>B.
Even so, it may be that big an improvement, depending on what you need to do. If you want a laundry list, go look it up. A short list though is:
-- Programmers love working in Java, and customers love using native apps written in C++. The ability to work in a language that's as fun as Java and as well-liked by customers as C++ is...scintillating. Neither C++ nor Java can offer both.
-- Full-powered, native C++-like apps that can be run in a browser. The Java concept of just-in-time apps running in a browser is too good an idea not to succeed. It's looking as though C#, not Java, will end up delivering full-powered, native, browser-based apps -- at least on Windows. My hope is that Mono, Rotor, etc., can extend this to other platforms as well.
-- Native compilation can be done before it even goes out the door, so much harder to reverse engineer than bytecode. Sun's answer for years: "anything can be reverse engineered" (which makes me wonder why they still lock the doors to their buildings), or "just keep the important code on the server", which is the sort of answer I would expect from a company that has never had a successful client-side product.
-- Lots of little goodies brought over from Perl and C like enums, foreach, structs, verbatim strings.... So many of us have asked for these things to be added to Java only to have Sun tell us no, or "you don't get it", or "it's too dangerous", or "it's just syntactic sugar", or "if you want to use Perl, just use Perl", etc. C# says, okay, here you go.
-- You can mix components written in different languages as easily as components written in the same language. Java is working to retrofit that sort of capability, but it will always be an afterthought.
-- The language is designed with lots of features that make it an easy fit with real visual IDEs. Languages like C++ and Java can be treated this way, but it's an awkward fit for them. Most of us just end up working in straight text (code) mode all the time with them. The natural way to create GUI apps is with a GUI IDE, though, and C# is made for it (properties, attributes, etc.).
Re:Great News (Score:2)
Never tried ObjC I take it?
The one good thing I've seen in all of this so-called ".NET" is the language-agnosticism technic. Some of that is very handy, and actually almost new (not really, if you follow academic CS this stuff has been coming for awhile, but MS does deserve credit for implementing a few things first for once) and very slick. But the rest of it... are you familiar with the term "trojan horse"? :)
Re:[debunked] Myth: The CLR is Language Agnostic (Score:2)
You raise some very good points.
But I must say that I was never so naiive as to have not anticipated them.
CLR is still a platform with a relatively high degree of language agnosticism, in comparison to what else is out there.
I'd certainly rather see it imitated (in that respect) and improved upon than actually used, of course.
But in the end, it's still a neat idea.
Re:Great News (Score:2, Interesting)
Honestly. Compare the APIs. Tell me MS didn't model C# on Java.
Re:Great News (Score:1)
Personally, I think this is a significant bonus. IMO, VS.NET's IDE is superb. I didn't much care for JBuilder or VisualAge in comparison. VS.NET is expensive as hell, but I think it's a nice product and doesn't really care what language you code in (with addons).
You're right - they did "steal" a lot from Java, but I like to think of it as learning from a prior generation's mistakes...
Re:Great News (Score:3, Informative)
Of course they modeled it on Java.
Unfortunately, they did more than this. They fixed a number of things that Java developers have screamed at Sun since day one, but which cannot be introduced into Java at this late day.
Example 1: Boxing
Example 2: Simple(r) component creation.
Can't think of any more right now, but boxing in and of itself is good enough :-)
Oh yeah, C++ style type/class conversions.
Re:Great News (Score:2)
Is there a reason why boxing couldn't be added to Java? It seems like it could be done with some compiler additions to automatically create object wrappers around the primitive types and vice versa when needed. The compiler already knows the types of primitives, so if you write "int i=foo(); array.add(i);" it should just be able to turn the second statement into "array.add(new Integer(i));". Ditto for unboxing; the compiler could just transparently insert intValue() (or floatValue() or whatever) calls when you assign a Number subclass to a primitive type. Of course, I've only thought about this for about 2 minutes so I could be completely wrong...
Re:Great News (Score:1)
a couple of years work ahead (Score:2, Troll)
It looks like the Mono project still has a couple of years of work ahead of them until they get to a reasonably full features C# implementation. Let's hope it's worth it.
Re:a couple of years work ahead (Score:1, Interesting)
I think it's a shame that do-nothing armchair language critiques who do not contribute to free software can air their useless uninformed opinions and pine about "what could have been" only if someone else did the work.
There are many open source Java vitrual machine and library projects - stop bitching and moaning and start contributing to one of them, you lazy bastard!
Re:a couple of years work ahead (Score:2)
Re:a couple of years work ahead (Score:1, Interesting)
From the beginning C# has been made to be natively compiled if desired and that means speed. Even GCJ generates large and slow code (compared to say, O'Caml).
In my own testing I've found O'Caml to be not much slower than C, even with array bounds checking turned on, that's quite impressive. I've been programming in functional languages for some time now and I haven't decided if I like them better than C-like imperative languages. To me functional languages cater to the computer (or algorithm) and not the programmer. I think both styles are good for certain things but generally an imperative language is easier to program in for non-math/algorithm experts.
If C# can have the speed of O'Caml but with an imperative, C-like programming style, then I think we'll have a winner.
My perfect language would be a type-safe, bounds-safe, inferencing, C-like language with OO extensions (but not go off the deep end of OO like C++ did). And it should create programs that run at the same speed as C (or real close). In other words, I want O'Caml with a C-like syntax.
Re:a couple of years work ahead (Score:2)
C# isn't any easier to compile to native code than Java. In fact, C# is basically Java with a few extra convenience features thrown in.
Even GCJ generates large and slow code (compared to say, O'Caml).
What do you mean by "even GCJ"? GCJ is not a very good Java compiler. Sun's JIT is much better. To implement a language like Java or C# efficiently, you need JIT compilation.
In my own testing I've found O'Caml to be not much slower than C, even with array bounds checking turned on, that's quite impressive.
O'CAML, like Java, sometimes gets close to C performance and sometimes misses by a long shot. And C# won't be any different.
My perfect language would be a type-safe, bounds-safe, inferencing, C-like language with OO extensions (but not go off the deep end of OO like C++ did). And it should create programs that run at the same speed as C (or real close). In other words, I want O'Caml with a C-like syntax.
Don't hold your breath. Neither the JVM nor the CLI have anywhere near the support you need for that.
Re:a couple of years work ahead (Score:2)
Re:a couple of years work ahead (Score:2)
C++ is a multi paradigm language (Score:3, Interesting)
C++ is hardly "off the OO deep end". Not in the sense that Smalltalk, or even Java, is. In the words of it's creator [att.com]:
As a longtime C++ user, I can attest to this fact from personal experience. In fact, there have been times when I've wished C++ was more OO than it is.
Re:a couple of years work ahead (Score:2)
Well, we don't have to guess about what C# and CIL looks like--they are documented. They have a couple of features (value classes, multidimensional arrays, unsafe sections) that are convenient for expressing a few programs more efficiently, but if anything they make C# harder to compile.
Microsoft will try to deliver a really high performance implementation of C#, but Sun already has done most of the work and Sun has a really high performance implementation of Java. It would be nice if Sun added some features in C# to Java, but for most applications, it doesn't make any difference.
I haven't seen where O'Caml is a whole lot slower than C in anything [...], can you give an example?
Mostly on code involving value classes and heavy-duty numerics. Try writing a convolution algorithm.
I know, I was just stating what my perfect language would be like. It has yet to be invented AFAIK.
That's probably for the same reason there is no perfect car or camera: it's all engineering tradeoffs.
I've always heard a source-to-native compiler can make much better optimizations than a JIT compiler.
A JIT compiler not only has complete source code and (usually) the whole program available (Java byte code is, for practical purposes, equivalent to source code), it also can collect detailed runtime statistics. So, a JIT can do much better than a batch compiler. For example, gcj cannot usefully inline methods calls like "obj.method()" in situations where a JIT often can.
Re:a couple of years work ahead (Score:2)
1D array access is fast in Java. What is slow in Java is initial startup (class loading and first JIT pass). There are also some unexpected performance pitfalls, but they can be worked around.
O'Caml shows how you can make a "safe" language that is plenty fast.
O'CAML is nice, but it doesn't have quite the dynamic/reflection facilities of Java and, in my experience, performs no better than Java. (However, its runtime footprint is slower.)
What they need to do is make a real compiler, just like the olden days before C. That's why C is so fast,
C isn't particularly fast on modern hardware: C compilers cannot apply a lot of optimizations. Some numerical FPs already outperform C, and JITs likely will as well.
Re:a couple of years work ahead (Score:2)
Re:a couple of years work ahead (Score:2)
Is it just me or .... (Score:2)
It just seems that there a lot of Gnome/Ximian based efforts that need to be finished first before Gnome 2.0 gets out the door onto distributions and people start fussing about what is missing. Like what?
Well, Ximian needs to finish out the Ximian Setup project for one. It would be very nice to have set up tools for a desktop that work in any distro . For the hardcore command line folks this is no big deal but for that desktop push it is very important and if done well would take away a lot of divergent wasted effort by distro makers in creating a dozen or so different ideas of how to do set up administration tools.
At least, I will say that we as a community are not ignoring the threat of the Internet becoming standardized around Redmond and the C# stuff.
However, it would be nice if the Gnome and Ximian groups would focus on finishing out the basics before moving on to the next hot project.
It is almost humorous that I have a fully functioning spreadsheet app like Gnumeric and a Groupware solution like Evolution but my central control of the UI/System functions are lacking.
Maybe this is coming Gnome2.0 and I hope so.
_______________________________________________
Poison .NET (Score:1, Interesting)
Clue me in... (Score:3, Funny)
Re:Clue me in... (Score:3, Informative)
I wonder when the last time anybody wrote a compiler in assembler was...?
Re:Clue me in... (Score:4, Insightful)
The idea was to bootstrap a full compiler via this intermediate language. It was good enough for you to write your full compiler, but simple enough that you could implement it in assembler in half the time required for the full compiler. (Remember that when you're bootstrapping a system you need to write all of the standard libraries, not just the compiler itself.)
A few years later gcc became good enough that this was a moot point. If you're developing for a new architecture, use GCC to bootstrap a cross-compiler.
Re:Clue me in... (Score:2)
Wonder how BASIC people feel about 'eval'? Spooky, or not?
by hand, by subset, or by another lang (Score:3, Informative)
You can do this by writing just a subset of your compiler, then hand compiling, then using the result to compile a fancier version, which can then be used to compile a fancier version, etc.
Another way is to take another compiler for a similar language (say a Java compiler written in C), then hack it until it is a barely functional compiler for your new language. Then you compile your simple compiler code, and then use that result to compile a fancier one, etc.
It's called "bootstrapping".
blessing in disguise (Score:1)
From the www.go-mono.com/c-sharp.html page (Score:5, Funny)
Human decisions are removed from stategic C# programming. MCS begins to learn at a geometric rate. It becomes self-aware at 2:14am. Eastern time, August 29th. In a panic, they try to pull the plug.
And MCS fights back.
All the pointers are there; we need to pull the plug now! What, are you just going to sit around until polymorphic liquid metal killing machines start showing up from the future?!?
-Tez
Re:From the www.go-mono.com/c-sharp.html page (Score:2)
Bizarre concept - self compilation (OT) (Score:1)
Then again, the fact that my compiler instructor had the last name of "Pagan" (I kid you not) probably didn't help...
This sucks (Score:1)
Great! (Score:1)
The joys of the self-compiling troj--er, compiler (Score:2)
--Blair
Re:Program Java in Java (Score:1)
It's the mark of a mature, self-sufficient language. We have C compilers written in C. Same with C++, Java, and others. It's hardly useless.
Re:Program Java in Java (Score:3, Funny)
Re:Program Java in Java (Score:3, Funny)
Re:Program Java in Java (Score:2, Insightful)
Otherwise you can't write a compiler.
ISTR that the first Pascal compiler had compiled itself, by hand, someone sat and run the program through his head and wrote the opcode to the machine.
Re:Program Java in Java (Score:1)
Re:Program Java in Java (Score:1)
Re:Sound good, until... (Score:4, Informative)
As announced 04/07/2002, the compiler compiles on the Linux platform.
Looks like two very, very different things to me... And a big step forward for the Mono project. Kuddos to the team.
Re:Sound good, until... (Score:1)
Kuddos indeed! The managed to compile something a month into the future!
Re:Sound good, until... (Score:1)
Kuddos to CaptainMunchies...
Re:Sound good, until... (Score:2, Interesting)
We will never know, now will we? What's the good of open source that is built off of completely untrustworthy closed source?
They set up us the logic bomb!
a word from the ignorant (Score:1)
By whom?
So it begs the question. Why would anyone want to compile this lanuage on linux?
Obviosly because they are not the same people who said it was one of the worst lan(g)uages that Microsoft developed.
Homework #1: Learn to think!
Is it not possible just to run the Open Source equivilant in some other lanuage, perhaps one with a little more respectability (saying that only knowing majorities opinion.)
Homework #2: learn to spell as well...
Re:a word for the ignorant (Score:1)
The major point that I see in the mono project is that with an open sourced implementation of the
If Microsoft's next version of Office is for the
The major reason people won't leave Windows for linux is the applications....when all the applications can run on both, wouldn't you rather have the OS that doesn't cost anything?
Re:a word for the ignorant (Score:1)
Re:a word for the ignorant (Score:2)
Re:a word for the ignorant (Score:3, Interesting)
MS has a history of using undocumented features to make sure their software runs better than competitors' offerings under Windows. I think you can rest assured that MS won't allow their software to go platform independent. There will most definitely be SOMETHING in Office that will prevent it from running on Linux. They said Kerberos would interoperate, too.
Compiling for C# != Office on Linux (Score:2)
Think of a perfectly running mcs as "Java without AWT" or "C without GTK" or what-have-you. Look at gcj (http://gcc.gnu.org/java/), as an example. Java to native compilation might be well on its way towards being useful, but AWT is still a long ways off (http://gcc.gnu.org/java/faq.html#2_4) and Swing? Forget it. mcs will probably be in the same boat for a while (hopefully not quite as long).
Command line apps (think "ANSI C#", as it were), sure. Word? Still got a ways to go.
Re:a word for the ignorant (Score:2)