Monstera: new branch

Here you can discuss ReactOS related topics.

Moderator: Moderator Team

Z98
Release Engineer
Posts: 3379
Joined: Tue May 02, 2006 8:16 pm
Contact:

Re: Monstera: new branch

Post by Z98 » Thu Nov 07, 2013 10:36 pm

Don't try to equate Basic and C/C++. There's a reason that C is often described as high level assembly. While misusing certain C++ features can cause bloated machine code, proper usage of those features will allow one to achieve the same performance as that of just using C.

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

Re: Monstera: new branch

Post by PurpleGurl » Fri Nov 08, 2013 12:53 am

Z98 wrote:Don't try to equate Basic and C/C++. There's a reason that C is often described as high level assembly. While misusing certain C++ features can cause bloated machine code, proper usage of those features will allow one to achieve the same performance as that of just using C.
You are right, I don't know what I am talking about, since I've never tried C++ and haven't attempted to mess with C in years. I was burned out by a bad experience involving C many years ago. I know I should let it go and maybe confront the language head on. 24 years is a long time to hold hangups and grudges. I wonder how good of a dev I would make if I could get up to speed... I've asked before and I know there is a tutorial on the site (I know how to get there).

I was using my experiences more as a metaphor and for the principles, but I cannot make a fair comparison unless I have used the languages involved. I've "flirted" with this project for years. I don't think I have really done much worthwhile to help. I guess I stick around out of some illusion in my mind that I am, but then someone says something that snaps me back to reality, and it is not comfortable. I guess maybe I need to make a decision, either get all the way in or all the way out. I still would like to somehow try my idea for the project, but I don't know anything about coding for Windows. I do know that even assembly is different for Windows, and that outside of kernel code, a lot of things are off-limits. Monstera is Fireball's pet project, and I have one in mind and would love to get proficient enough to try it. I end up getting pulled into argue about it when I should be putting the energy into trying it. And I probably should learn C, since there is no way to do what I propose without it.

I've optimized things before where others told me I was wasting my time. I used DOS disk caching software on a BBS I ran on a 286 with a 2400 bps modem. I mentioned that to another sysop and he told me that was a waste of time. But I disagreed. Yes, the modem was the worst bottleneck, but not the only one. I wanted to make sure that the modem was the online one or as close to the only one. I'd want there to be no wasted transmission cycles, and no disk thrashing to further slow the slow data rate. I'd regularly repack the databases for the BBS. In many ways, you can think of them as the Windows registry. They used B-Tree, and like the system hives, they would get internally fragmented. And there was a nightly event set to defrag the drive. I later upgraded to a 386 and a 28,800 modem. And someone told me about locked DTR. I still use that principle to this day with network cards. I have a 30MB bidirectional connection, and I don't use the router they gave me. Why? The fiber optic box can handshake at 1 Gb/s and so can the network controller. The router only does 100. Sure, the connection only needs 30. But still, other things like latency and ping rate are also important, and I want to squeeze every ounce of speed out and cut every possible bottleneck that I can.

So if I am serious about what I said, what do I need to do to get up to speed? Obviously I need to learn C. And I know I need to learn Win32 architecture and programming. What would be the best way to do all that?

PascalDragon
Posts: 123
Joined: Wed Aug 04, 2010 7:34 pm

Re: Monstera: new branch

Post by PascalDragon » Fri Nov 08, 2013 9:56 am

PurpleGurl wrote:You want to argue about the coding "logic," and that is exactly what I am talking about - compilers often change the logic. I guess you missed what I said above about compilers converting integers to string and forcing you to convert back, and adding many unnecessary cycles,
Than that's either a problem of the language or the specific compiler used. I don't see C(++) or Pascal compilers converting Integers to Strings or char* by accident.
PurpleGurl wrote:or the example of the "And If" blocks. Guess how the compiler does those vs. how I would do it? The compiler executes and evaluates all the code in the block first, assigns each a bouillon value, and then evaluates that value. That is very inefficient. What I would do would be to evaluate from the most likely estimated to fail to the most likely to succeed. Thus the entire block does not have to execute if a section is going to fail. And the decision to branch and break out of the code would be done immediately and from the registers, not deferred, placed in memory, and then unnecessary logic operators used. Yes, there was a work around in the language I was using, and that was not not use If blocks but use individual If statements. Nesting is a better approach and saves about a paragraph of space per operation used.
There are also things like "short evaluation". I don't know whether one of the C(++) compilers supports it (I'd assume so though), but Delphi and Free Pascal for example support this. Thereby if you have a series of "and"ed conditions and the first one is False then the whole expression is assumed False. Analog for "or".

Edit:
PurpleGurl wrote:So if I am serious about what I said, what do I need to do to get up to speed? Obviously I need to learn C. And I know I need to learn Win32 architecture and programming. What would be the best way to do all that?
Maybe start looking at the GNU C tutorial (I don't know of a MSVC one, but maybe Google is your friend here :) ). And for WinAPI you might either look for tutorials on Google or you could try to learn by the small programs that Raymond Chen posts here and then on his blog The Old New Thing

Regards,
Sven
Free Pascal compiler developer

Aeneas
Posts: 465
Joined: Sat Oct 10, 2009 10:09 pm

Re: Monstera: new branch

Post by Aeneas » Fri Nov 08, 2013 4:15 pm

I think C is overvalued. That pointer boilerplate is practically unbearable - to a point where Java is "proud not to have pointers".

I prefer, from the imperative languages, Fortran - Fortran 90 is an entirely different beast from Fortran 77, mind you.

It usually does not always matter that much if you pick anything from some "family" - in some cases (I heard, Intel's) the compilers generate code for one and the same backend, so the opiminisatins are pretty much all the same. Except that Fortran, not really being "the pointer language", can usually be optimised a bit better.

-------------

But generally, I have fallen in love with Lisp (particularly Scheme). I can only recommend functional programming - Haskell is nice, too. And Scheme is extremely cool as you can have (some list with elements of other types like numbers 1 2 3 -985 (and even) (further lists (and sublists))) - lists are kind of like arrays, just you can "extend" them and "shorten" them as needed, and you can have data of different type in them. (The trade-off: large lists are slow to handle.)

Generally, Lisp lets you develop faster - but you usually trade for that speed. Which usually does not matter all that much, if you do your own private thingy. I am not sure how long that will continue, though: Functional programming is "naturally" apt for parallelisation, because it does not muck around with "memory locations" (variables), loops and thelike. So far, you are fine with unrolled loops, inlined functions etc., but what would you do if your computer gets 65536 cores? How long can "serial code" be "transmuted into parallel code"?

-------------

Now, if you develop an OS, that might be a different story... But that's by far not "what everybody does".

milon
Posts: 969
Joined: Sat Sep 05, 2009 9:26 pm

Re: Monstera: new branch

Post by milon » Fri Nov 08, 2013 5:35 pm

Aeneas wrote:Now, if you develop an OS, that might be a different story... But that's by far not "what everybody does".
But that's kind of the whole point. PurpleGurl wants to be able to develop for ReactOS, which is an operating system. You may not prefer C for coding applications, and there's nothing wrong with that, but all coding for ROS is required to be done in C(++).

Zc456
Posts: 155
Joined: Fri Feb 11, 2011 10:42 pm

Re: Monstera: new branch

Post by Zc456 » Thu Nov 14, 2013 2:17 pm

oldman wrote:
Monstera is a new implementation of a memory manager (along with a cache manager) compatible with the ReactOS kernel
Yes. More memory manager development!
Stay frosty, Squeaks.

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests