Language C

Here you can discuss ReactOS related topics.

Moderator: Moderator Team

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

Re: Language C

Post by binarymaster »

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: 257
Joined: Wed Jul 04, 2018 11:45 pm

Re: Language C

Post by Quim »

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?
User avatar
EmuandCo
Developer
Posts: 4723
Joined: Sun Nov 28, 2004 7:52 pm
Location: Germany, Bavaria, Steinfeld
Contact:

Re: Language C

Post by EmuandCo »

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!
ReactOS is still in alpha stage, meaning it is not feature-complete and is recommended only for evaluation and testing purposes.

If my post/reply offends or insults you, be sure that you know what sarcasm is...
PurpleGurl
Posts: 1790
Joined: Fri Aug 07, 2009 5:11 am
Location: USA

Re: Language C

Post by PurpleGurl »

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: 441
Joined: Sat Nov 15, 2008 4:13 pm

Re: Language C

Post by justincase »

PurpleGurl wrote: Fri Mar 15, 2019 5:17 pmBack 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: 1790
Joined: Fri Aug 07, 2009 5:11 am
Location: USA

Re: Language C

Post by PurpleGurl »

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: 164
Joined: Thu Jul 31, 2008 8:19 pm

Re: Language C

Post by Julcar »

on topic, I wonder if ReactOS code could be ported to FreePascal
hbelusca
Developer
Posts: 1204
Joined: Sat Dec 26, 2009 10:36 pm
Location: Zagreb, Croatia

Re: Language C

Post by hbelusca »

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: 215
Joined: Wed Feb 21, 2018 3:46 pm
Location: Somewhere in France

Re: Language C

Post by shunesburg »

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: 164
Joined: Thu Jul 31, 2008 8:19 pm

Re: Language C

Post by Julcar »

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: 688
Joined: Sat Dec 31, 2005 4:19 am
Contact:

Re: Language C

Post by MadWolf »

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: 1790
Joined: Fri Aug 07, 2009 5:11 am
Location: USA

Re: Language C

Post by PurpleGurl »

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: 293
Joined: Sun Jul 11, 2010 11:39 am

Re: Language C

Post by ThFabba »

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: 1073
Joined: Tue May 07, 2013 9:18 pm
Location: California, USA

Re: Language C

Post by middings »

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: 215
Joined: Wed Feb 21, 2018 3:46 pm
Location: Somewhere in France

Re: Language C

Post by shunesburg »

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], Google [Bot] and 36 guests