Page 1 of 1

C# and Java

Posted: Thu Sep 18, 2008 8:54 pm
by Love4Boobies
How many of you are using C# or Java?

Re: How many C++ kernels?

Posted: Thu Sep 18, 2008 8:59 pm
by Troy Martin
Holy necro batman!

*has nothing useful to post here, shutting up now*

Re: C# and Java

Posted: Fri Sep 19, 2008 12:46 am
by Combuster
Please don't post offtopic, and especially not in dead threads.

Re: C# and Java

Posted: Fri Sep 19, 2008 3:37 am
by AJ
Hi,

I use C# - but not for OS dev. I just use it to create frontends for my Windows programs. I would ultimately like to use it as the main apps language for my OS, but that's years off.

Cheers,
Adam

Re: C# and Java

Posted: Fri Sep 19, 2008 8:44 am
by Troy Martin
I find C or C++ easier than C# for programming, but I do all OS development stuff in assembly language, since you can do whatever the hell you want with it. It may take longer to write the code since there's no C library etc, but I think it's better.

Re: C# and Java

Posted: Fri Sep 26, 2008 7:07 pm
by TheDragon
I love C#, and I'm learning Java, but as I understand it, one can't really use those for OS Development because you can't really do any asm in it. But couldn't you do an extern thing? Anyway, I've loved C# because it has much more readable code than C/C++, and It doesn't have pointers, and because of the "this" keyword.

Re: C# and Java

Posted: Fri Sep 26, 2008 7:53 pm
by pcmattman
@TheDragon - you can actually use C# for OS development. There's a project called Singularity which is an OS in C#. I'm sure others on this forum also have C# OS projects.

As for me, I like C# for rapid prototyping, but nothing beats a well-written C++ application in my opinion. When I want to write something fast, I'll use C#. When I want something written well, C++. For instance, I've written several little programs in C# but my game engine and OS projects use C++.

Re: C# and Java

Posted: Sat Sep 27, 2008 5:51 am
by AJ
TheDragon wrote:Anyway, I've loved C# because it has much more readable code than C/C++, and It doesn't have pointers, and because of the "this" keyword.
Hopefully that was a slip and you realise that C++ can make use of "this" as well (although in C++ "this" is a pointer) :wink: .

As for C# for OS development (and to expand on pcmattman's post), I am very interested in this area too, but my idea is to have the kernel completely in compiled C++ (and obviously some asm) but achieve user-space C# support as closely to the kernel as possible. What I mean by this is that I would like to design the kernel from the ground-up with managed user apps in mind. This is in contrast with a kernel designed for running compiled user apps which then adds layers all over the place for adding managed code support.

If I understand correctly, Singularity is more about writing a minimal compiled core which is capable of JIT compiling the kernel at a very basic level. Where possible, things are carried out in "unsafe" blocks of C# rather than resorting to precompiled code. I have yet to read up on more detail, but from what I understand, there is no single kernel entity - the "kernel" is made up of a combination of the compiler and C# code. For some reason, I find managed code OSes a very interesting area...

Cheers,
Adam

Re: C# and Java

Posted: Sat Sep 27, 2008 11:30 am
by Colonel Kernel
AJ wrote:If I understand correctly, Singularity is more about writing a minimal compiled core which is capable of JIT compiling the kernel at a very basic level.
There is no JIT compilation of any kind in Singularity, anywhere. The kernel is compiled directly to native code. Apps are compiled to IL, and then compiled by Bartok to native code before the first time they are run. However, this first-time compilation is traditional ahead-of-time compilation, not JIT.
AJ wrote:Where possible, things are carried out in "unsafe" blocks of C# rather than resorting to precompiled code.
"unsafe" has nothing to do with whether the code is pre-compiled or not. The "unsafe" keyword just means that you can use pointers without the type system getting in the way, just like in C.
AJ wrote:I have yet to read up on more detail, but from what I understand, there is no single kernel entity - the "kernel" is made up of a combination of the compiler and C# code. For some reason, I find managed code OSes a very interesting area...
Singularity does have a kernel, but it doesn't necessarily need to make a distinction between "kernel-mode" and "user-mode" due to its use of software isolation. The compiler is part of the OS, but not the kernel proper. Singularity is a micro-kernel, so the compiler is just another application from the kernel's point of view.

Re: C# and Java

Posted: Sun Sep 28, 2008 3:05 am
by Love4Boobies
pcmattman wrote:There's a project called Singularity which is an OS in C#. I'm sure others on this forum also have C# OS projects.
Actually, Singularity is written in Sing#, a superset of Spec#, which is actually derived from C#.
Colonel Kernel wrote:Singularity does have a kernel, but it doesn't necessarily need to make a distinction between "kernel-mode" and "user-mode" due to its use of software isolation.
However, rings can be enforced to separate domains if you don't trust the Bartok compiler for some reason.

Re: C# and Java

Posted: Tue Sep 30, 2008 3:09 am
by AJ
Hi,

I *knew* there was another managed code OS, but couldn't remember its name until now #-o Have a look at http://www.sharpos.org/ .

Cheers,
Adam