C# and Java

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

C# and Java

Post by Love4Boobies »

How many of you are using C# or Java?
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: How many C++ kernels?

Post by Troy Martin »

Holy necro batman!

*has nothing useful to post here, shutting up now*
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: C# and Java

Post by Combuster »

Please don't post offtopic, and especially not in dead threads.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: C# and Java

Post 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
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: C# and Java

Post 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.
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
User avatar
TheDragon
Member
Member
Posts: 43
Joined: Mon Aug 25, 2008 8:23 pm
Location: Middle of Nowhere

Re: C# and Java

Post 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.
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Re: C# and Java

Post 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++.
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: C# and Java

Post 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
User avatar
Colonel Kernel
Member
Member
Posts: 1437
Joined: Tue Oct 17, 2006 6:06 pm
Location: Vancouver, BC, Canada
Contact:

Re: C# and Java

Post 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.
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: C# and Java

Post 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.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: C# and Java

Post 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
Post Reply