Page 2 of 2

Re: Language C

Posted: Thu Mar 14, 2019 11:57 pm
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:

Re: Language C

Posted: Fri Mar 15, 2019 5:43 am
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?

Re: Language C

Posted: Fri Mar 15, 2019 11:58 am
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!

Re: Language C

Posted: Fri Mar 15, 2019 5:17 pm
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.

Re: Language C

Posted: Fri Mar 15, 2019 6:24 pm
by justincase
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).

Re: Language C

Posted: Sun Mar 17, 2019 9:54 am
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.

Re: Language C

Posted: Sun Mar 17, 2019 9:36 pm
by Julcar
on topic, I wonder if ReactOS code could be ported to FreePascal

Re: Language C

Posted: Sun Mar 17, 2019 9:42 pm
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?

Re: Language C

Posted: Mon Mar 18, 2019 1:24 am
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).

Re: Language C

Posted: Mon Mar 18, 2019 11:42 am
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...

Re: Language C

Posted: Tue Mar 19, 2019 12:22 am
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++

Re: Language C

Posted: Tue Mar 19, 2019 1:14 am
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.

Re: Language C

Posted: Tue Mar 19, 2019 10:07 am
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.]

Re: Language C

Posted: Tue Mar 19, 2019 1:42 pm
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.

Re: Language C

Posted: Wed Mar 20, 2019 12:11 pm
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.