Who wants to devolop a native C# compiler together ?
Who wants to devolop a native C# compiler together ?
Someone was asking to develop a c compiler but since there are more than enough c compiler out there, I don't want to add another one.
My idea is to develop a native compiler for the c# programming language.
I know there are some projects out there doing il to asm.
But i never looked at there code so i don't know how much they are tied to the .net runtime or the os.
There's
BARTOK compiler (closed source) --> in singulartity
AOT compiler --> COSMOS
AOT compiler --> SharpOS
maybe there are some more i don't know about ... anyway,
i've seen that the AOT compilers do something strange with the system.dll maybe it's perfectly normal what they do but I'd like to find out by writing a compiler myself.
The idea is to develop the compiler so i can develop a OS with that compiler.
My language of choice would be Microsoft c# so i can port the compiler to the operating system at a later stage without having to re implement the thing.
If anyone is interested in participating
contact me.
My idea is to develop a native compiler for the c# programming language.
I know there are some projects out there doing il to asm.
But i never looked at there code so i don't know how much they are tied to the .net runtime or the os.
There's
BARTOK compiler (closed source) --> in singulartity
AOT compiler --> COSMOS
AOT compiler --> SharpOS
maybe there are some more i don't know about ... anyway,
i've seen that the AOT compilers do something strange with the system.dll maybe it's perfectly normal what they do but I'd like to find out by writing a compiler myself.
The idea is to develop the compiler so i can develop a OS with that compiler.
My language of choice would be Microsoft c# so i can port the compiler to the operating system at a later stage without having to re implement the thing.
If anyone is interested in participating
contact me.
-
- Member
- Posts: 566
- Joined: Tue Jun 20, 2006 9:17 am
Re: Who wants to devolop a native C# compiler together ?
Have you even tried searching on Ngen ??? Anways i would love to be a part of such a project , but now am under lots of time constraints.
Regards
Shrek
Regards
Shrek
Re: Who wants to devolop a native C# compiler together ?
ngen precompiles a .net assembly and stores a image of this compilation in the assembly.
Or something like that, i never really looked in it very deeply but it can not be used for os development.
At least you can't build the entire os with the c# compiler together with ngen.
You would have to create a .net runtime that runs natively on a machine, in that case a native compiler would be redundant.
But then again people who can participate are all welcome even if you can only look at some code and advise or comment.
The problem is there's no real forums for people looking into compilers.
If you know of Forums or communities on this subject please tell me about it.
Or something like that, i never really looked in it very deeply but it can not be used for os development.
At least you can't build the entire os with the c# compiler together with ngen.
You would have to create a .net runtime that runs natively on a machine, in that case a native compiler would be redundant.
But then again people who can participate are all welcome even if you can only look at some code and advise or comment.
The problem is there's no real forums for people looking into compilers.
If you know of Forums or communities on this subject please tell me about it.
-
- Posts: 7
- Joined: Sat Mar 29, 2008 5:31 pm
Re: Who wants to devolop a native C# compiler together ?
I would be very interested in helping with this project. Though C# isn't really designed as a native language, how are you planning on implementing these kind of features? Such as garbage collection. With .net, all of the threads of the program are halted for garbage collection to take place. This is absolutely not a good idea for an operating system. There are a few other things, like how to inline asm, etc. Which means the compiler isn't really compiling c#, rather a similar language.
Re: Who wants to devolop a native C# compiler together ?
The idea is to implement the language as good as possible but
indeed there are features that aren't possible without a framework or runtime of some sort.
Inline assembler shouldn't be much of a problem since i am planning to generate assembler, it wouldn't even break with the current c# standards.
I'm not really sure on how to implement the garbage collection, i think creating a runtime can solve this and then later on i can port this runtime to my Os.
indeed there are features that aren't possible without a framework or runtime of some sort.
Inline assembler shouldn't be much of a problem since i am planning to generate assembler, it wouldn't even break with the current c# standards.
I'm not really sure on how to implement the garbage collection, i think creating a runtime can solve this and then later on i can port this runtime to my Os.
-
- Member
- Posts: 109
- Joined: Thu Feb 26, 2009 12:58 am
- Location: Gurgaon/New Delhi, India
- Contact:
Re: Who wants to devolop a native C# compiler together ?
hmm..
i don't think i'll be able to help much.
but do check out rotor.
something shrek told me about.
microsoft has released most of the specifications for the .net runtime under project rotor.
it makes sense that you write your own runtime, and then port it into the kernel...that's what i'm planning to do for my os, anyway...
if you don't mind, do let me know how this goes...good luck!
i don't think i'll be able to help much.
but do check out rotor.
something shrek told me about.
microsoft has released most of the specifications for the .net runtime under project rotor.
it makes sense that you write your own runtime, and then port it into the kernel...that's what i'm planning to do for my os, anyway...
if you don't mind, do let me know how this goes...good luck!
"Do you program in Assembly?" she asked. "NOP," he said.
"Intel Inside" is a Government Warning required by Law.
"Intel Inside" is a Government Warning required by Law.
Re: Who wants to devolop a native C# compiler together ?
Not trying to hijack your thread - but wanna do the compiler for this http://forum.osdev.org/viewtopic.php?f=2&t=19353 project?
- AndrewAPrice
- Member
- Posts: 2299
- Joined: Mon Jun 05, 2006 11:00 pm
- Location: USA (and Australia)
Re: Who wants to devolop a native C# compiler together ?
Another D compiler would be awesome. Think of D as a native C#, just with FAAAAR more features and it's a systems and applications programming language (in other words, it has everything built in to support OSdev!)
My OS is Perception.
- Steve the Pirate
- Member
- Posts: 152
- Joined: Fri Dec 15, 2006 7:01 am
- Location: Brisbane, Australia
- Contact:
Re: Who wants to devolop a native C# compiler together ?
Native C# compiler is a bit of an oxymoron, isn't it? Still, it would be cool to have something like Vala that could be used for OS dev. For those who haven't seen it before, Vala is a language that is a lot like C# that compiles into C code, and compiles that into a native executable. It's designed for GTK and GObject, so would not be of any use in OS Dev, but a language like it (you'd probably want to compile to C++ or D to get proper object oriented programming) would be pretty cool.
Re: Who wants to devolop a native C# compiler together ?
Actually, we are working on something like that - compiling C# to C code.Steve the Pirate wrote:Native C# compiler is a bit of an oxymoron, isn't it? Still, it would be cool to have something like Vala that could be used for OS dev. For those who haven't seen it before, Vala is a language that is a lot like C# that compiles into C code, and compiles that into a native executable.
-
- Posts: 7
- Joined: Sat Mar 29, 2008 5:31 pm
Re: Who wants to devolop a native C# compiler together ?
How so?Steve the Pirate wrote:Native C# compiler is a bit of an oxymoron, isn't it?
The JIT compiler for .NET on Windows basically runs like this (although granted it has a lot of virtual machine and other runtime stuff).
Re: Who wants to devolop a native C# compiler together ?
I don't have the expertise to work on this project, but I do think it's a good idea.
The distant thought of developing an OS in Visual C# 2008 is very appealing.
The distant thought of developing an OS in Visual C# 2008 is very appealing.
Website: https://joscor.com
Re: Who wants to devolop a native C# compiler together ?
.. You need to either learn more about C# or stop reading the D docs. I know D has a couple of beautiful syntax sugars, but uh, C# has way more features. The OO features of D are weak in comparison to C#. D is a wonderful start, but it needs to complete the job first.MessiahAndrw wrote:Another D compiler would be awesome. Think of D as a native C#, just with FAAAAR more features and it's a systems and applications programming language (in other words, it has everything built in to support OSdev!)
- AndrewAPrice
- Member
- Posts: 2299
- Joined: Mon Jun 05, 2006 11:00 pm
- Location: USA (and Australia)
Re: Who wants to devolop a native C# compiler together ?
I've used C# for some time now (mostly for GUI prototyping, also ported some games from C++ to C# (compact .Net on Xbox 360) until my free 12-month XNA membership expired).NReed wrote:.. You need to either learn more about C# or stop reading the D docs. I know D has a couple of beautiful syntax sugars, but uh, C# has way more features. The OO features of D are weak in comparison to C#. D is a wonderful start, but it needs to complete the job first.MessiahAndrw wrote:Another D compiler would be awesome. Think of D as a native C#, just with FAAAAR more features and it's a systems and applications programming language (in other words, it has everything built in to support OSdev!)
Off the top of my head C# lacks the raw templating power of D aswell as array slicing. It also encourages odd coding practices, for example in the XNA tutorials you see ".. + new Vector3(0,4,5) + ... * new Matrix(new Vector3(1,1,0), new Vector3(0,1,1), new Vector3(0,0,1))" inserted in the middle of equations that could be ran per object per frame. I know the GC may be fast, but still...
Can you please give me a specific case (or several) of when the OO features of D are weak in comparison to C#?
My OS is Perception.
-
- Posts: 7
- Joined: Sat Mar 29, 2008 5:31 pm
Re: Who wants to devolop a native C# compiler together ?
Both Matrix and Vector3 are structures, not classes. Their "new" operator is more of a language feature, and AFAIK they do not even go through the GC system and are allocated on the stack, when designing a new compiler (i'm not sure if the existing Microsoft one does this) it would be very possible to optimize away even that..MessiahAndrw wrote: Off the top of my head C# lacks the raw templating power of D aswell as array slicing. It also encourages odd coding practices, for example in the XNA tutorials you see ".. + new Vector3(0,4,5) + ... * new Matrix(new Vector3(1,1,0), new Vector3(0,1,1), new Vector3(0,0,1))" inserted in the middle of equations that could be ran per object per frame. I know the GC may be fast, but still...