Posted by
timothy
on from the not-the-same-as-self-flagellation dept.
Bob Smith writes: "Miguel just commited the last patch nessisary to get Mono's C# compiler to compile itself. After 7 odd months, MCS is now self hosting."jbarn adds: "Mono-list email is here."
Re:a dumb question
by
deltavivis
·
· Score: 2, Interesting
this just means that they have a compiler on their target platform that can compile the source code to the compiler. To compile something just means to put the high level language into a form that the metal+OS can deal with it. SO, by compiling the compiler on the target platform they are demonstrating that they have an effective compiler for at least that subset of the language that is used to write the compiler.
how do you think new versions of gcc get compiled anyway?
Realitive?
by
minusthink
·
· Score: 1, Interesting
Can someone who is more knowledgable give me a couple answers?
Generally, how mature is a compiler when it reaches self compiling capabilities? young? is it a main goal of the project?
also how does this compiler compare to the average lifeline of a compiler? is it on track, slow in development, etc.
thanks.
-- "when life gets complicated, I like to take a nap in a tree and wait for dinner" - Hobbes.
A compiler is basically a program which converts a program in a source language (A) to a target langage (B). The compiler itself is written in a language (C) which may or may not be equal to A or B.
Therefore lot of compilers can never compile themselves, since they are written in a langauage other than the one that they compile. I suspect, for example, that the Visual Basic compiler is written in C++, and therefore cannot self-compile.
In the case that A = C, the compiler can compile itself assuming that it supports a sufficiently large feature set from the language. This is the point that the Mono project has apparently reached. This is a decent achievement for a complex compiler, since it suggests that the project is getting near to being feature complete.
You could probably write a self-hosting toy compiler relatively quickly if that was your goal. Especially if you chose a "nice" target language, i.e. something like Scheme rather than x86 assembler.....
Re:Samba anyone ?
by
MagPulse
·
· Score: 3, Interesting
Horrible analogy. Being able to port C# programs written in VS.NET is only a part of the reason for Mono. And MS won't stray far from the ECMA standard, which is what the first release of VS.NET follows. It's taken until now to break free of some legacy "features" like incorrect for-scoping introduced way back in VC++ 4, just for backward compatibility.
Right now, all Linux has for standard middleware is CORBA. Sure there are Linux die-hards that will stand by CORBA, but most will agree that COM is superior. Now with Mono, Linux will finally have a decent object technology with which to build large OO projects that will work together.
I have another (dumb?) question about compilers. I remember once reading a statement saying that one of the keys to understanding how compilers work is to be able to write a program that prints it's own source code. Does anybody out there know how to do this?
I thought about it and kept hitting the same road block. I would write a program that looks like the following psudo-code:
#include stdio.h
int main()
{
printf("
#include stdio.h
int main()
{
printf(^INFINTE SERIES^);//This is the problem.
return 0;
}");
return 0;
}
I know there must be a way to short-hand the Infinte Series that occurs in the print statement, but for the life of me I can't figure out what it is.
Any insight would be help ease my troubled mind.
I know someone might mod this OT. But I figure, "Where's the harm?". And besides what is so wrong with a conversation naturely progressing and going off in a slightly diffrent but related direction?
Cautionary Tale
by
devnullkac
·
· Score: 3, Interesting
Well, it's not a tale, really, but don't forget Ken Thompson's musings on the dangers of compiling compilers without knowing their full pedigree: the binary compiler can be a trojan horse factory that inserts weaknesses into programs it thinks should be targeted (e.g. "login"), including copying its trojan generation code into the next version of the compiiler.
-- What do you mean they cut the power? How can they cut the power, man? They're animals!
Re:a dumb question
by
bittmann
·
· Score: 2, Interesting
Until a compiler compiles itself it is usally considered a "toy" language. There are 100's of them out there. They may be interesting academiclly, but they get no respect.
...kind of like the COBOL compiler that's been putting food on my table for the past decade-and-a-half...Although I'm not certain I would call it "interesting"...and the academic applications are questionable...I certainly agree that I get no respect!
(grin)
Seriously, though...IMO, the best indication of the importance of a complier is in how many lines of code/how many executables the compiler has been used to...compile..., and not necessarily any artifical metric.
That being said, I'll consider Mono's C# implementation a success if and only if it will allow a sizable chunk of C# sourcecode to be *used* on non-Microsoft platforms. Anything less, and it becomes at best "just another Java", only not as portable.
Miguel has now produced a "real compiler"...but I still think the jury's out on it becoming a "real success." I'm rooting for them, though!
Re:Compile itself
by
Anonymous Coward
·
· Score: 1, Interesting
Steve Wozniak wrote an integer basic interpreter in 6800 (IIRC) asm. Without having a computer to test it with. When he wrote integer basic for the Apple II, he couldn't afford a timesharing 6502 assembler, so he did the assembly by hand, and only introduced 1 error.
Re:a dumb question
by
wadetemp
·
· Score: 2, Interesting
Until a compiler compiles itself it is usally considered a "toy" language
Does Perl compile itself? Nice toy.
Re:Samba anyone ?
by
NumberSyx
·
· Score: 4, Interesting
Well considering the base class library has also gone through ECMA standardisation along with C# I'm not sure you need worry.
Mono will be implimenting the ECMA spec, so MS an drift where they like.
Microsoft will stick with the "Standard" just like they did with Java, only this time there won't be anyone to sue them.
--
"Our products just aren't engineered for security,"
-Brian Valentine,VP in charge of MS Windows Development
You may well be wrong about the functional languages.
It won't be long before the overheads of FP will be pretty negligible compared to the increased programmer productivity and software robustness. This advantage will gradually start to overcome inertia in the marketplace and start to make a real impact.
Also, with the incresing use of Virtual Machines as an execution platform it's going to get a lot easier to use functional languages and integrate them into larger projects. My bet is that something like Haskell will suddenly start to make headlines in the next couple of years on the.NET platform.
Re:a dumb question
by
coug_
·
· Score: 2, Interesting
Any language that is incapable of compiling itself is obviously incomplete in some fundamental way.
You might want to be a little more specific here for those who don't know the difference between interpreted and compiled languages. Interpreted languages (Java, Perl, Python, etc.) won't compile themselves. Before all the Java programmers jump all over me.. yes, Java is "compiled", but the output is not a machine-code executable, it's bytecode that is interpeted by the JVM.
An interesting thought - In theory the Java compiler could be implemented using a JVM and a "Compiler" bytecode...
C# is not vapor-ware...
by
Da+VinMan
·
· Score: 4, Interesting
If it were I might agree with you for the reasons you state. But, in fact, the "still-haven't-seen-it" C# compiler from Microsoft can be obtained in a SDK from Microsoft at here.
It's not free "as in speech", but it is free "as in beer".
Also, I think that, in the end that you're right about "Bill & Co. will definately come out with a way to extend it either by libraries or functionality that will leave Miguel in a constant state of catch-up". Only Microsoft will be smart enough not to touch core functionality, it will be just enough to provide the veneer of portability, which will become a selling point of.NET (and therefore Windows) in the future. What they'll do instead is make platform dependent improvements that either can't be ported, or will be difficult to port. Actually, now that I think about it, they're already doing that. It's called the.NET Enterprise servers. If you're using.NET, it will make a lot of sense to use those products that will require Windows on the server.
So, yes,.NET is fundamentally a strike against all other platforms. It will be a small consolation to have all your C# code running on your Linux server, only to have it surrounded by.NET Enterprise servers.
I feel obligated to point out that, while all of this sounds very onerous and hateful, Microsoft isn't doing anything wrong in this area at all. They're simply providing more value on top of their platform than the competition can provide.
Finally, I think anyone will admit it's nice to have the option to use C# on Linux. C# is turning out to be pretty sweet and I for one would like to have it as a portable language skill.
*ironic mode on*
Gee, maybe everyone would prefer that C# would just die and go away? That way, the other leading language contender in the market, Java, could just take the market. After all, it's not under the influence of the "evil corporations", like C# is.
*ironic mode off*
At least this is still a fair fight between MS and the rest of the world and at least we'll have a choice.
BTW - The open source world already has at least two languages that are achieving.NET capability: Python and PERL. Check out ActiveState.com.
--
Please mod this post only if you think others should/n't read this. I have enough ego^H^H^Hkarma. Thanks!
this just means that they have a compiler on their target platform that can compile the source code to the compiler. To compile something just means to put the high level language into a form that the metal+OS can deal with it. SO, by compiling the compiler on the target platform they are demonstrating that they have an effective compiler for at least that subset of the language that is used to write the compiler.
how do you think new versions of gcc get compiled anyway?
Can someone who is more knowledgable give me a couple answers?
Generally, how mature is a compiler when it reaches self compiling capabilities? young? is it a main goal of the project?
also how does this compiler compare to the average lifeline of a compiler? is it on track, slow in development, etc.
thanks.
"when life gets complicated, I like to take a nap in a tree and wait for dinner" - Hobbes.
Horrible analogy. Being able to port C# programs written in VS.NET is only a part of the reason for Mono. And MS won't stray far from the ECMA standard, which is what the first release of VS.NET follows. It's taken until now to break free of some legacy "features" like incorrect for-scoping introduced way back in VC++ 4, just for backward compatibility.
Right now, all Linux has for standard middleware is CORBA. Sure there are Linux die-hards that will stand by CORBA, but most will agree that COM is superior. Now with Mono, Linux will finally have a decent object technology with which to build large OO projects that will work together.
I have another (dumb?) question about compilers. I remember once reading a statement saying that one of the keys to understanding how compilers work is to be able to write a program that prints it's own source code. Does anybody out there know how to do this?
//This is the problem.
I thought about it and kept hitting the same road block. I would write a program that looks like the following psudo-code:
#include stdio.h
int main()
{
printf("
#include stdio.h
int main()
{
printf(^INFINTE SERIES^);
return 0;
}");
return 0;
}
I know there must be a way to short-hand the Infinte Series that occurs in the print statement, but for the life of me I can't figure out what it is.
Any insight would be help ease my troubled mind.
I know someone might mod this OT. But I figure, "Where's the harm?". And besides what is so wrong with a conversation naturely progressing and going off in a slightly diffrent but related direction?
Well, it's not a tale, really, but don't forget Ken Thompson's musings on the dangers of compiling compilers without knowing their full pedigree: the binary compiler can be a trojan horse factory that inserts weaknesses into programs it thinks should be targeted (e.g. "login"), including copying its trojan generation code into the next version of the compiiler.
What do you mean they cut the power? How can they cut the power, man? They're animals!
Until a compiler compiles itself it is usally considered a "toy" language. There are 100's of them out there. They may be interesting academiclly, but they get no respect.
...kind of like the COBOL compiler that's been putting food on my table for the past decade-and-a-half...Although I'm not certain I would call it "interesting"...and the academic applications are questionable...I certainly agree that I get no respect!
(grin)
Seriously, though...IMO, the best indication of the importance of a complier is in how many lines of code/how many executables the compiler has been used to...compile..., and not necessarily any artifical metric.
That being said, I'll consider Mono's C# implementation a success if and only if it will allow a sizable chunk of C# sourcecode to be *used* on non-Microsoft platforms. Anything less, and it becomes at best "just another Java", only not as portable.
Miguel has now produced a "real compiler"...but I still think the jury's out on it becoming a "real success." I'm rooting for them, though!
Steve Wozniak wrote an integer basic interpreter in 6800 (IIRC) asm. Without having a computer to test it with. When he wrote integer basic for the Apple II, he couldn't afford a timesharing 6502 assembler, so he did the assembly by hand, and only introduced 1 error.
Until a compiler compiles itself it is usally considered a "toy" language
Does Perl compile itself? Nice toy.
Well considering the base class library has also gone through ECMA standardisation along with C# I'm not sure you need worry.
Mono will be implimenting the ECMA spec, so MS an drift where they like.
Microsoft will stick with the "Standard" just like they did with Java, only this time there won't be anyone to sue them.
"Our products just aren't engineered for security,"
-Brian Valentine,VP in charge of MS Windows Development
You may well be wrong about the functional languages.
.NET platform.
It won't be long before the overheads of FP will be pretty negligible compared to the increased programmer productivity and software robustness. This advantage will gradually start to overcome inertia in the marketplace and start to make a real impact.
Also, with the incresing use of Virtual Machines as an execution platform it's going to get a lot easier to use functional languages and integrate them into larger projects. My bet is that something like Haskell will suddenly start to make headlines in the next couple of years on the
You might want to be a little more specific here for those who don't know the difference between interpreted and compiled languages. Interpreted languages (Java, Perl, Python, etc.) won't compile themselves. Before all the Java programmers jump all over me.. yes, Java is "compiled", but the output is not a machine-code executable, it's bytecode that is interpeted by the JVM.
An interesting thought - In theory the Java compiler could be implemented using a JVM and a "Compiler" bytecode...
java com.sun.JavaCompiler1_2 com/sun/JavaCompiler1_3.java
Hmmm....
If it were I might agree with you for the reasons you state. But, in fact, the "still-haven't-seen-it" C# compiler from Microsoft can be obtained in a SDK from Microsoft at here.
.NET (and therefore Windows) in the future. What they'll do instead is make platform dependent improvements that either can't be ported, or will be difficult to port. Actually, now that I think about it, they're already doing that. It's called the .NET Enterprise servers. If you're using .NET, it will make a lot of sense to use those products that will require Windows on the server.
.NET is fundamentally a strike against all other platforms. It will be a small consolation to have all your C# code running on your Linux server, only to have it surrounded by .NET Enterprise servers.
.NET capability: Python and PERL. Check out ActiveState.com.
It's not free "as in speech", but it is free "as in beer".
Also, I think that, in the end that you're right about "Bill & Co. will definately come out with a way to extend it either by libraries or functionality that will leave Miguel in a constant state of catch-up". Only Microsoft will be smart enough not to touch core functionality, it will be just enough to provide the veneer of portability, which will become a selling point of
So, yes,
I feel obligated to point out that, while all of this sounds very onerous and hateful, Microsoft isn't doing anything wrong in this area at all. They're simply providing more value on top of their platform than the competition can provide.
Finally, I think anyone will admit it's nice to have the option to use C# on Linux. C# is turning out to be pretty sweet and I for one would like to have it as a portable language skill.
*ironic mode on*
Gee, maybe everyone would prefer that C# would just die and go away? That way, the other leading language contender in the market, Java, could just take the market. After all, it's not under the influence of the "evil corporations", like C# is.
*ironic mode off*
At least this is still a fair fight between MS and the rest of the world and at least we'll have a choice.
BTW - The open source world already has at least two languages that are achieving
Please mod this post only if you think others should/n't read this. I have enough ego^H^H^Hkarma. Thanks!