Slashdot Mirror


Mono's MCS Compiles Itself On Linux

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."

25 of 215 comments (clear)

  1. Almost but not quite... by Linux+Freak · · Score: 5, Informative

    The release does mention that MCS could be compiled, but that the resultant executable immediately crashes. Close, but still more work is needed before this is really an exciting milestone.

    Kudos to the Mono team for the work they've done so far, however.

    1. Re:Almost but not quite... by jsse · · Score: 4, Funny

      The release does mention that MCS could be compiled, but that the resultant executable immediately crashes.

      Isn't it the expected outcome? It's considered done!

    2. Re:Almost but not quite... by John_Booty · · Score: 3, Interesting

      That's sort of like saying "well, the Wright brothers' airplane only few for a minute or so. Close, but still more work is needed before this is really an exciting milestone"

      It's a heck of a milestone. Of course it's not useful yet, but they're not claiming it is.

      --

      OtakuBooty.com: Smart, funny, sexy nerds.
    3. Re:Almost but not quite... by kubrick · · Score: 3, Funny

      After all, it's the unoffical Microsoft slogan -- "If it compiles, ship it!" What could be more appropriate for an implementation of a Microsoft-derived technology? :)

      --
      deus does not exist but if he does
  2. Re:Self compiling and newbie Slashdot readers by Anonymous Coward · · Score: 4, Informative

    The basic idea for mono is that you don't need windows anymore. Right now (before it compiles itself correctly) you need the ms .NET-tools. To get this thing hosted 100% on linux you need it to be able to compile itself.

  3. Re:Self compiling and newbie Slashdot readers by anpe · · Score: 5, Informative

    It's a kind of proof that the compiler actually works
    Its also necessay step if you're creating your language from scratch. For more precisions try : comp.compilers

    For your abbreviation problem dry your tears and try http://www.everything2.com

  4. Re:Sound good, until... by ultraw · · Score: 4, Informative
    All you guys have really a short memory. :) The previous post on slashdot on this subject (Mono) mentioned that the mono compiler could compile itself. As the example stated in the mail (original post):


    Microsoft C# compiler generates mcs.exe
    mcs.exe compiles itself and genreates mcs2.exe
    mcs2.exe compiles itself and generates mcs3.exe


    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.

  5. Re:One step at the time by Jabes · · Score: 5, Informative

    For those that don't understand the difference. Two months ago, the mcs was able to compile itself on Windows, using the Microsoft implementation of the framework (ie the core .net libraries).

    Now MCS is able to compile itself using the mono runtime.

    Hope this helps

  6. Re:Program Java in Java by DA-MAN · · Score: 3, Funny

    What came first, The Compiler or the Language?

    --
    Can I get an eye poke?
    Dog House Forum
  7. Re:Chicken or the egg by jaavaaguru · · Score: 4, Insightful

    On that mentality, Linux is being as bad as MS in re-ripping off an idea from Sun. If one car manufacturer releases a model with built-in GPS/sat-nav, and others follow, do we say they're ripping off an innovative idea? To compete in an industry you must either provide what your competitors do, or provide something better.

  8. They did it on *Linux* by vojtech · · Score: 4, Informative

    The slashdot headline misses the important part
    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.

    1. Re:They did it on *Linux* by thing12 · · Score: 3, Insightful

      Yeah, I probably should have mentioned the difference between then and now in the content of the story. This really is a huge milestone for them - going forward they no longer need any Microsoft tools. C# is a great language, it's fast and flexible - it fills the gap between C and Perl nicely. And while it may be the bastard cousin of Java, I think it's got a much more polished feel to it. Being developed under Microsoft's wing wasn't the best, but at least now it's an ECMA standard, not owned by any company - much less Sun whose position on open source sways like trees in the wind.

  9. We are close... by jsse · · Score: 3, Funny

    The bad news is that the compiled mcs crashes, because some field tokens are wrong and this confuses the runtime (we still don't have a verifier,hint, hint).

    Boy, we need to implement BSOD for this, hint, hint.

  10. Re:Program Java in Java by -douggy · · Score: 3, Funny

    I think that is a personal matter between the compiler and the language. Slashdot is not the place for bedroom discussions

  11. Re:Self compiling and newbie Slashdot readers by Fnord · · Score: 4, Informative

    Speaking as a software tester that's done compiler work, one of the first tests for any compiler is to compile itself, and then use the newly compiled compiler to compile itself again. Then you look at the two binaries. If they're exactly the same the compiler passes the test.

  12. Re:RMS wont be too happy by sydb · · Score: 3, Informative

    RMS was fighting for it in order to counter the Mono threat

    Are you sure? My link (4th paragraph, "With DotGNU and Mono...") says Stallman thinks its a good idea. Where's your link?

    --
    Yours Sincerely, Michael.
  13. Clue me in... by toupsie · · Score: 3, Funny

    I don't know about you, but I think its kind of creepy that a compiler can compile itself. How they heck did the "first compiler" come into creation if there was nothing to compile it with the first place? Roswell Aliens?

    --
    Strange women lying in ponds distributing swords is no basis for a system of government.
    1. Re:Clue me in... by mikeee · · Score: 3, Informative

      You write a really lousy but functional C compiler in assembler. Then you write a decent C complier in C. Compile it with the first compiler; now that you have an executable, recompile it with itself to get an executable that isn't awful. Possibly the first compiler doesn't handle anything but a subset of your language and you have to make multiple iterations of this.

      I wonder when the last time anybody wrote a compiler in assembler was...?

    2. Re:Clue me in... by coyote-san · · Score: 4, Insightful

      There were some mid-80s articles in Dr. Dobbs or Micro Cornucopia or the like that used a subset of C. No floats, and IIRC no typedefs, no multidimensional arrays, etc. Overall you probably lost about half of the features in a standard C compiler.

      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.

      --
      For every complex problem there is an answer that is clear, simple, and wrong. -- H L Mencken
  14. Re:a word for the ignorant by LinuxHam · · Score: 3, Interesting

    If Microsoft's next version of Office is for the .NET framework, and mono is fully working, There will be Office on Linux.

    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.

    --
    Intelligent Life on Earth
  15. From the www.go-mono.com/c-sharp.html page by tez_h · · Score: 5, Funny

    "MCS was able to parse itself on April 2001, MCS compiled itself for the first time on December 28 2001. MCS became self hosting on January 3rd, 2002"

    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

    --
    Haskell, the static-typed, lazy, polymorphic, programming language.
  16. C++ is a multi paradigm language by avdi · · Score: 3, Interesting

    but not go off the deep end of OO like C++ did

    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:

    C++ is a multi-paradigm programming language that supports Object-Oriented and other useful styles of programming. If what you are looking for is something that forces you to do things in exactly one way, C++ isn't it. There is no one right way to write every program - and even if there were there would be no way of forcing programmers to use it.

    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.

    --

    --
    CPAN rules. - Guido van Rossum
  17. Re:Great News by Jhan · · 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

    int i=17;
    String s=i.toString();
    i=String.valueOf(s);

    OR

    ArrayList al=new ArrayList();
    int i=4711;
    al.add(i);

    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.

    --

    I choose to remain celibate, like my father and his father before him.

  18. Re:Great News by alext · · Score: 3, Funny

    The Java -> C# learning curve in negligable [sic]

    Good heavens, what a coincidence. Yet strangely C# is 'shocking', 'amazing' and 'excellent' whereas Java is...? The same weight as a duck, perhaps?

  19. by hand, by subset, or by another lang by GCP · · Score: 3, Informative

    Sometimes what you do is you write your compiler in your new language, then literally walk down your code and hand convert it into assembly. You know how to compile by hand if you know how to write a compiler. (Think about it.)

    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".

    --
    "Those who have never entered upon scientific pursuits know not a tithe of the poetry by which they are surrounded."