www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Performance, operating system in D?

reply Will <Will_member pathlink.com> writes:
I read that modern garbage collected languages are faster than non-gbc ones.
Given that all other thins (compiler optimization quality) are equal, I suppose
that's true for an application program. If one wants to make an operating system
on the other hand, which be its definition must manage memory itself(?) is it
possible to achieve the same control and performance as if it was made in C/C++?

And for application programs - is there a D gc DLL that D programs can share?
Somewhat out-of-topic but Will Windows Vista have gc built-in?

are there some good tests of D performance vs C?
Oct 06 2005
next sibling parent clayasaurus <clayasaurus gmail.com> writes:
Will wrote:
 I read that modern garbage collected languages are faster than non-gbc ones.
 Given that all other thins (compiler optimization quality) are equal, I suppose
 that's true for an application program. If one wants to make an operating
system
 on the other hand, which be its definition must manage memory itself(?) is it
 possible to achieve the same control and performance as if it was made in
C/C++?
 
 And for application programs - is there a D gc DLL that D programs can share?
 Somewhat out-of-topic but Will Windows Vista have gc built-in?
 
 are there some good tests of D performance vs C?
 
 
Maybe this will help. http://shootout.alioth.debian.org/benchmark.php?test=all&lang=dlang&sort=fullcpu
Oct 06 2005
prev sibling next sibling parent James Dunne <james.jdunne gmail.com> writes:
Will wrote:
 I read that modern garbage collected languages are faster than non-gbc ones.
 Given that all other thins (compiler optimization quality) are equal, I suppose
 that's true for an application program. If one wants to make an operating
system
 on the other hand, which be its definition must manage memory itself(?) is it
 possible to achieve the same control and performance as if it was made in
C/C++?
 
 And for application programs - is there a D gc DLL that D programs can share?
 Somewhat out-of-topic but Will Windows Vista have gc built-in?
 
 are there some good tests of D performance vs C?
 
 
Let's see... It's my take that garbage collected languages' performance derives directly from two things: 1) quality of implementation of the GC 2) frequency of memory allocations/deallocations in the compiled program For a language like D, where the new operator is a common occurence, the performance of the application is directly related to the performance of the GC. D's current GC implementation leaves a bit to be desired and is not an implementation of a top-notch GC. It is very simple and gets the job done reasonably well for most applications. Moving on... No DLL housing currently exists for D's GC (that I'm aware of), and I don't think you'd want to put one in a DLL either. If you're attempting to write an OS from scratch using D, then it is a good idea to learn the ins and outs of phobos. If I were in your position, I would scratch the phobos GC and most of phobos itself in your operating system. I would keep only the very basic parts of the code which are necessary in order for D to work - things like bit slicing functions, the Object class, TypeInfos, etc. Then, I would write a top-notch, tested, garbage collection implementation using proven concepts from the latest research on the topic. However, you must consider the memory model of whatever type of OS you're trying to write. If you're writing a multi-tasking, multi-user OS, design your GC such that sufficient access protections are in place. I hope this can get you headed in the right direction, and I hope to see Will/OS in the future! -- Regards, James Dunne
Oct 06 2005
prev sibling next sibling parent Dave <Dave_member pathlink.com> writes:
In article <di4149$69$1 digitaldaemon.com>, Will says...
I read that modern garbage collected languages are faster than non-gbc ones.
Given that all other thins (compiler optimization quality) are equal, I suppose
that's true for an application program. If one wants to make an operating system
on the other hand, which be its definition must manage memory itself(?) is it
possible to achieve the same control and performance as if it was made in C/C++?
The current D GC implementation is decent but hasn't had the large amount of tweaking that others have had (i.e.: Sun Java and .NET). It is now a conservative collector, and swapping to a generational/copying algorithm would probably increase performance quite a bit for things like allocating lots of small objects, which is probably the biggest weakness right now. OTOH, a change like that would probably make the GC less space efficient overall which is a current strength I think.
And for application programs - is there a D gc DLL that D programs can share?
Somewhat out-of-topic but Will Windows Vista have gc built-in?
The beauty of D is that you can use traditional malloc/free memory management, and you can also still use the GC to manage a block of memory used to relatively easily "pool" a group of often allocated objects. Along with that, D has two other advantages over most other GC'd languages: easy array slicing and built-in stack allocated UDT's (D structs). AFAICT, Vista will not have the GC built-in unless your app. runs under the .NET runtime.
are there some good tests of D performance vs C?
Here are some results you can take with a grain of salt <g> http://shootout.alioth.debian.org/benchmark.php?test=all&lang=all&sort=fullcpu
Oct 10 2005
prev sibling next sibling parent Don Clugston <dac nospam.com.au> writes:
Will wrote:
 I read that modern garbage collected languages are faster than non-gbc ones.
You need to be a little careful with such generalisations. In practice, Doug Lea Malloc is hard to beat in most situations, but it is very easy to do better than Microsoft's default malloc. The only hard data I've seen shows that the best GC outperforms dlmalloc once it has access to 5-10 times as much memory as is allocated at any given time. Sc... * in the cases where GC is faster, it will use 10x as much memory * There is huge variation in quality of implementation. * Doug Lea malloc is probably nearly as good as malloc can be, GC is much more complicated and is less well optimised, so it is likely to improve with time. * Right now, the languages (apart from D) which produce the fastest programs are not gc-based. But that's not because they don't use gc, it's because they were designed for speed. * The benefits of gc are in code simplicity, not speed.
 Given that all other thins (compiler optimization quality) are equal, I suppose
 that's true for an application program. If one wants to make an operating
system
 on the other hand, which be its definition must manage memory itself(?) is it
 possible to achieve the same control and performance as if it was made in
C/C++?
 
 And for application programs - is there a D gc DLL that D programs can share?
 Somewhat out-of-topic but Will Windows Vista have gc built-in?
 
 are there some good tests of D performance vs C?
 
 
Oct 10 2005
prev sibling parent reply "Walter Bright" <newshound digitalmars.com> writes:
"Will" <Will_member pathlink.com> wrote in message
news:di4149$69$1 digitaldaemon.com...
 And for application programs - is there a D gc DLL that D programs can
share?
 Somewhat out-of-topic but Will Windows Vista have gc built-in?
I've always thought that gc ought to be a service provided by the operating system. There are so many garbage collected languages in common use - having it in the o.s. makes it worthwhile to make a very good one, and so all the languages benefit.
Oct 10 2005
next sibling parent Sean Kelly <sean f4.ca> writes:
In article <diekpi$qev$1 digitaldaemon.com>, Walter Bright says...
"Will" <Will_member pathlink.com> wrote in message
news:di4149$69$1 digitaldaemon.com...
 And for application programs - is there a D gc DLL that D programs can
share?
 Somewhat out-of-topic but Will Windows Vista have gc built-in?
I've always thought that gc ought to be a service provided by the operating system. There are so many garbage collected languages in common use - having it in the o.s. makes it worthwhile to make a very good one, and so all the languages benefit.
That would be darn nice. And since the OS handles context switching and such, it seems a natural fit. Does the Java OS have built-in GC? Or maybe one of the other fancy thin-client OSes? Sean
Oct 10 2005
prev sibling next sibling parent "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"Walter Bright" <newshound digitalmars.com> wrote in message 
news:diekpi$qev$1 digitaldaemon.com...
 I've always thought that gc ought to be a service provided by the 
 operating
 system. There are so many garbage collected languages in common use - 
 having
 it in the o.s. makes it worthwhile to make a very good one, and so all the
 languages benefit.
I wonder if Vista will have a built-in GC facility, as .Net will become more intimately integrated into the OS? Maybe D.Net would be a worthwhile investment.. ;)
Oct 10 2005
prev sibling parent reply Trevor Parscal <Trevor_member pathlink.com> writes:
In article <diekpi$qev$1 digitaldaemon.com>, Walter Bright says...
"Will" <Will_member pathlink.com> wrote in message
news:di4149$69$1 digitaldaemon.com...
 And for application programs - is there a D gc DLL that D programs can
share?
 Somewhat out-of-topic but Will Windows Vista have gc built-in?
I've always thought that gc ought to be a service provided by the operating system. There are so many garbage collected languages in common use - having it in the o.s. makes it worthwhile to make a very good one, and so all the languages benefit.
I still am looking for some other ambitious programmers to work on a D kernel that can run multiple types of compiled executables (ELF, PE, COFF, etc)... Than, you could just GC at the OS level, and .. yeah.. Do something amazing you know.. Any takers? Thanks, Trevor Parscal
Oct 11 2005
next sibling parent Thomas Kühne <thomas-dloop kuehne.cn> writes:
In article <difq92$t5v$1 digitaldaemon.com>, Trevor Parscal says...
In article <diekpi$qev$1 digitaldaemon.com>, Walter Bright says...
"Will" <Will_member pathlink.com> wrote in message
news:di4149$69$1 digitaldaemon.com...
 And for application programs - is there a D gc DLL that D programs can
share?
 Somewhat out-of-topic but Will Windows Vista have gc built-in?
I've always thought that gc ought to be a service provided by the operating system. There are so many garbage collected languages in common use - having it in the o.s. makes it worthwhile to make a very good one, and so all the languages benefit.
I still am looking for some other ambitious programmers to work on a D kernel that can run multiple types of compiled executables (ELF, PE, COFF, etc)... Than, you could just GC at the OS level, and .. yeah.. Do something amazing you know.. Any takers?
Are you talking about a "day job" or spare time? ;) Thomas
Oct 11 2005
prev sibling next sibling parent reply "Ameer Armaly" <ameer_armaly hotmail.com> writes:
"Trevor Parscal" <Trevor_member pathlink.com> wrote in message 
news:difq92$t5v$1 digitaldaemon.com...
 In article <diekpi$qev$1 digitaldaemon.com>, Walter Bright says...
"Will" <Will_member pathlink.com> wrote in message
news:di4149$69$1 digitaldaemon.com...
 And for application programs - is there a D gc DLL that D programs can
share?
 Somewhat out-of-topic but Will Windows Vista have gc built-in?
I've always thought that gc ought to be a service provided by the operating system. There are so many garbage collected languages in common use - having it in the o.s. makes it worthwhile to make a very good one, and so all the languages benefit.
I still am looking for some other ambitious programmers to work on a D kernel that can run multiple types of compiled executables (ELF, PE, COFF, etc)... Than, you could just GC at the OS level, and .. yeah.. Do something amazing you know.. Any takers?
I would be willing to help, though I'll admit that I'm no expert at all on such things; a D kernel would rock though.
 Thanks,
 Trevor Parscal 
Oct 11 2005
parent reply The Neuromancer <The_member pathlink.com> writes:
In article <dig9bf$1aov$1 digitaldaemon.com>, Ameer Armaly says...
"Trevor Parscal" <Trevor_member pathlink.com> wrote in message 
news:difq92$t5v$1 digitaldaemon.com...
 In article <diekpi$qev$1 digitaldaemon.com>, Walter Bright says...
"Will" <Will_member pathlink.com> wrote in message
news:di4149$69$1 digitaldaemon.com...
 And for application programs - is there a D gc DLL that D programs can
share?
 Somewhat out-of-topic but Will Windows Vista have gc built-in?
I've always thought that gc ought to be a service provided by the operating system. There are so many garbage collected languages in common use - having it in the o.s. makes it worthwhile to make a very good one, and so all the languages benefit.
I still am looking for some other ambitious programmers to work on a D kernel that can run multiple types of compiled executables (ELF, PE, COFF, etc)... Than, you could just GC at the OS level, and .. yeah.. Do something amazing you know.. Any takers?
I really want to write a OS in D (I have some experience), but I have to wait full debugging support for Linux. I only started to code something based on my old code :-) I'll use the GC in the kernel, but I'll wait to add user-level GC facilities.
I would be willing to help, though I'll admit that I'm no expert at all on 
such things; a D kernel would rock though.
 Thanks,
 Trevor Parscal 
Oct 11 2005
parent J C Calvarese <technocrat7 gmail.com> writes:
In article <digph8$1qhp$1 digitaldaemon.com>, The Neuromancer says...
In article <dig9bf$1aov$1 digitaldaemon.com>, Ameer Armaly says...
"Trevor Parscal" <Trevor_member pathlink.com> wrote in message 
news:difq92$t5v$1 digitaldaemon.com...
 In article <diekpi$qev$1 digitaldaemon.com>, Walter Bright says...
..
 Than, you could just GC at the OS level, and .. yeah.. Do something 
 amazing you
 know.. Any takers?
I really want to write a OS in D (I have some experience), but I have to wait full debugging support for Linux. I only started to code something based on my old code :-) I'll use the GC in the kernel, but I'll wait to add user-level GC facilities.
FYI, here are some notes about some similar D projects: http://www.prowiki.org/wiki4d/wiki.cgi?KernelWithD jcc7
Oct 11 2005
prev sibling next sibling parent JT <jtd514 ameritech.net> writes:
Build it and they will come.


seriously tho, Ive been doing some thinking towards this end and 
eventually hope to do something like that. it would be interesting to 
see a real working os in D, i would definately be interested if you were 
to get something going. but im currently working on a few projects of my 
own.


Trevor Parscal wrote:
 I still am looking for some other ambitious programmers to work on a D kernel
 that can run multiple types of compiled executables (ELF, PE, COFF, etc)...
 
 Than, you could just GC at the OS level, and .. yeah.. Do something amazing you
 know.. Any takers?
 
 Thanks,
 Trevor Parscal
Oct 11 2005
prev sibling next sibling parent pragma <pragma_member pathlink.com> writes:
In article <difq92$t5v$1 digitaldaemon.com>, Trevor Parscal says...
In article <diekpi$qev$1 digitaldaemon.com>, Walter Bright says...
"Will" <Will_member pathlink.com> wrote in message
news:di4149$69$1 digitaldaemon.com...
 And for application programs - is there a D gc DLL that D programs can
share?
 Somewhat out-of-topic but Will Windows Vista have gc built-in?
I've always thought that gc ought to be a service provided by the operating system. There are so many garbage collected languages in common use - having it in the o.s. makes it worthwhile to make a very good one, and so all the languages benefit.
I still am looking for some other ambitious programmers to work on a D kernel that can run multiple types of compiled executables (ELF, PE, COFF, etc)... Than, you could just GC at the OS level, and .. yeah.. Do something amazing you know.. Any takers?
Sadly, I'm pretty much tapped for development time, but I'd be happy to do some testing once you get a bootable image put together (or even a proof of concept of some kind). Outside that, I'm working hard on getting my act together (my machine 'sploded recently) to push the next milestone out for DDL... which I'm sure will be helpful for this project. Now all you need is a name... I gather that "DOS" is already taken. ;) - EricAnderton at yahoo
Oct 11 2005
prev sibling parent Kyle Furlong <kylefurlong gmail.com> writes:
Trevor Parscal wrote:
 In article <diekpi$qev$1 digitaldaemon.com>, Walter Bright says...
 
"Will" <Will_member pathlink.com> wrote in message
news:di4149$69$1 digitaldaemon.com...

And for application programs - is there a D gc DLL that D programs can
share?
Somewhat out-of-topic but Will Windows Vista have gc built-in?
I've always thought that gc ought to be a service provided by the operating system. There are so many garbage collected languages in common use - having it in the o.s. makes it worthwhile to make a very good one, and so all the languages benefit.
I still am looking for some other ambitious programmers to work on a D kernel that can run multiple types of compiled executables (ELF, PE, COFF, etc)... Than, you could just GC at the OS level, and .. yeah.. Do something amazing you know.. Any takers? Thanks, Trevor Parscal
As much programming time as I have, this sounds like a worthy and fun effort. Would this take the place of Terra in your schedule?
Oct 11 2005