Language C

Here you can discuss ReactOS related topics.

Moderator: Moderator Team

binarymaster
Posts: 271
Joined: Sun Nov 16, 2014 7:05 pm
Location: Russia, Moscow
Contact:

Re: Language C

Post by binarymaster » Thu Mar 14, 2019 11:57 pm

justincase wrote:
Thu Mar 14, 2019 10:58 pm
Well, I thought SOOAHPAZ was real at first, but he/she/it is seeming more and more like a bot to me.
Same here. :geek:

Quim
Posts: 235
Joined: Wed Jul 04, 2018 11:45 pm

Re: Language C

Post by Quim » Fri Mar 15, 2019 5:43 am

SOOAHPAZ wrote:
Thu Mar 14, 2019 8:02 pm
Why ReactOS is writing in language C?
I try then do search in site but not found any things

Thanks everyone!
According to I know, ReactOS is written mostly in C, and tiny parts written in C++.
But what about to use C++ only?
C is only better for kernel?

EmuandCo
Developer
Posts: 4323
Joined: Sun Nov 28, 2004 7:52 pm
Location: Germany, Bavaria, Steinfeld
Contact:

Re: Language C

Post by EmuandCo » Fri Mar 15, 2019 11:58 am

Ok.... I sit in a train here, a German train aka 3rd world internet available on my way to Chemnitz, and all I see in here is kindergarten?! Back to topic and please stop attacking ppl because of their language. If you don't understand it at all, you can ask, but otherwise reply or do NOT reply. Thanks for your attention!
Image
ReactOS is still in alpha stage, meaning it is not feature-complete and is recommended only for evaluation and testing purposes.

PurpleGurl
Posts: 1777
Joined: Fri Aug 07, 2009 5:11 am
Location: USA

Re: Language C

Post by PurpleGurl » Fri Mar 15, 2019 5:17 pm

Back to the original question, it is written mostly in C, with some things like parts of the shell that work with com objects written in C++, and parts of the kernel written in assembly.

justincase
Posts: 434
Joined: Sat Nov 15, 2008 4:13 pm

Re: Language C

Post by justincase » Fri Mar 15, 2019 6:24 pm

PurpleGurl wrote:
Fri Mar 15, 2019 5:17 pm
Back to the original question, ...
And basically, the parts written in Assembly are manually optimized to run fast on one platform, the C parts are in C because it's fairly close to Assembly in speed while also being more portable, allowing it to be compiled for different architectures, and the C++ parts are in C++ because they use some of features that aren't available in C to make the source notably easier to write and read the code when doing certain things (like working with COM objects, as PurpleGurl says).
I reserve the right to ignore any portion of any post if I deem it not constructive or likely to cause the discussion to degenerate.

PurpleGurl
Posts: 1777
Joined: Fri Aug 07, 2009 5:11 am
Location: USA

Re: Language C

Post by PurpleGurl » Sun Mar 17, 2019 9:54 am

Well, the assembly in the kernel is to be not just efficient, but exact, as you are dealing with specific locations, and sometimes you cannot leave it to chance which opcodes are used. C would take more fiddling, but can be done (or use some inline assembly with it). Portability is not an option when working this intimately with the hardware with a specific architecture. To be more portable, you'd need programming directives and multiple compiler/linker pathways, and selecting during build which one you want.

And while COM objects can be done in C as David originally proved, where he had to make custom macros and similar, he eventually went to C++ as that seemed more sane and easier to follow.

Julcar
Posts: 112
Joined: Thu Jul 31, 2008 8:19 pm

Re: Language C

Post by Julcar » Sun Mar 17, 2019 9:36 pm

on topic, I wonder if ReactOS code could be ported to FreePascal

hbelusca
Developer
Posts: 1128
Joined: Sat Dec 26, 2009 10:36 pm
Location: Zagreb, Croatia

Re: Language C

Post by hbelusca » Sun Mar 17, 2019 9:42 pm

Julcar wrote:
Sun Mar 17, 2019 9:36 pm
on topic, I wonder if ReactOS code could be ported to FreePascal
And not in VisualBasic?

shunesburg
Posts: 155
Joined: Wed Feb 21, 2018 3:46 pm
Location: Somewhere in France

Re: Language C

Post by shunesburg » Mon Mar 18, 2019 1:24 am

justincase wrote:
Thu Mar 14, 2019 10:58 pm
Well, I thought SOOAHPAZ was real at first, but he/she/it is seeming more and more like a bot to me.
Not like bot, because he/she answers like a human being, but maybe is a spammer (it's not incompatible).

Julcar
Posts: 112
Joined: Thu Jul 31, 2008 8:19 pm

Re: Language C

Post by Julcar » Mon Mar 18, 2019 11:42 am

hbelusca wrote:
Sun Mar 17, 2019 9:42 pm
Julcar wrote:
Sun Mar 17, 2019 9:36 pm
on topic, I wonder if ReactOS code could be ported to FreePascal
And not in VisualBasic?
Or even in freebasic...

MadWolf
Posts: 540
Joined: Sat Dec 31, 2005 4:19 am
Contact:

Re: Language C

Post by MadWolf » Tue Mar 19, 2019 12:22 am

hi
a bit off topic but I wonder if you where to make a new os what parts can be written using programming languages like Java or VB.net or c# and what parts you need to write using c/c++

PurpleGurl
Posts: 1777
Joined: Fri Aug 07, 2009 5:11 am
Location: USA

Re: Language C

Post by PurpleGurl » Tue Mar 19, 2019 1:14 am

Generally, your lower level languages are needed for the kernel, but all the stuff you mentioned could be acceptable for user mode stuff, particularly end user apps.

ThFabba
Developer
Posts: 263
Joined: Sun Jul 11, 2010 11:39 am

Re: Language C

Post by ThFabba » Tue Mar 19, 2019 10:07 am

There are operating systems written in C# and probably Java... it's just a question of how much effort you want to put into the toolchain and execution environment.
There are at least three aproaches I can think of:
1. You could create/use a toolchain that will compile these languages to native code, which may give you about the same flexibility that you get from C. [Singularity does this, with some of (2) mixed in]
2. You can create your own minimal execution environment as part of the OS, e.g. build a JVM that runs on bare metal. This part would have to either be written in a lower-level language or use the trick from (1).
3. You can implement a basic stub OS that's just enough to run your higher level execution environment. This will require essentially an entire working kernel written in a lower-level language. [I've worked on getting a JVM to work in a toy OS. You pretty much need a fully-fledged scheduler and memory manager.]

middings
Posts: 1008
Joined: Tue May 07, 2013 9:18 pm
Location: California, USA

Re: Language C

Post by middings » Tue Mar 19, 2019 1:42 pm

MadWolf wrote:
Tue Mar 19, 2019 12:22 am
...what OS parts can be written using programming languages like Java or VB.net or c#(...?)
Programs that accompany the OS could be written in interpreted languages such as the ones you mentioned, MadWolf. Programs that most people think of as part of a modern, full-featured OS aren't really part of the OS itself. Examples of such programs are help systems, application installers, shells, and utilities. They could be written in interpreted languages. Microsoft itself is increasingly using C# and its accompanying .NET Framework in that way. For example, Microsoft's .NET is required by its PowerShell shell.

ReactOS's devs stay with C and C++ because they are mature, well-understood tools supported by many other commonly used development tools. Adding support in the ReactOS tool chain for just one additional language, especially an interpreted one, would be a great burden on the developer team (devs) but yield relatively little new coding productivity or benefit. Then comes the even greater burden of maintenance! As a result, the Missing ReactOS Functionality page of the ReactOS Wiki lists ".NET alternative such as Mono" among the Low Priority Framework implementations.

Yet, ReactOS Newsletter 96 (back when there was a periodic newsletter written by one of the devs and the Higgs boson was not yet found) included this remark, "There is a very large body of applications on Windows written using the .NET framework, especially in the corporate world. Ultimately, support for that framework is going to be important from a strategic perspective." Be warned though, "ultimately" could be a day far, far in ReactOS's future.

shunesburg
Posts: 155
Joined: Wed Feb 21, 2018 3:46 pm
Location: Somewhere in France

Re: Language C

Post by shunesburg » Wed Mar 20, 2019 12:11 pm

The problem is not the language used but the code.
I mean, if someone use an exotic language, but made a clean code with commented for useful features, everyone doesn't care of the language used.
But if you use a famous language, and made some mistake, causing BSoD, with no comment for a useless think, everyone should be mad.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 2 guests