druntime, templates and traits

2013-09-13 Thread monarch_dodra
One of the issues of druntime is that is that almost everything in it is resolved at runtime. This is good because it avoids bloat. However, it also means we run into 2 regular issues: 1. Performance (small issue). A lot of code that should be otherwise fast is slower than it could be, since

Re: druntime, templates and traits

2013-09-13 Thread bearophile
monarch_dodra: So the two challenges are: 1. If we integrate a large amount of template code, where would it go? How much large it is? 2. How will we deal with not having massive code duplication? Go developers accept a little amount of duplication. But in your case a solution could be

Re: druntime, templates and traits

2013-09-13 Thread Jacob Carlborg
On 2013-09-13 12:26, monarch_dodra wrote: I had started toying around with this, and the main and immediate challenge I ran into is the integration of templates. The 2 issues are: 1. All templates must be in object.d, or the compiler won't see it. Do you know why that is? Can they be put in a

Re: druntime, templates and traits

2013-09-13 Thread Maxim Fomin
On Friday, 13 September 2013 at 10:26:35 UTC, monarch_dodra wrote: 1. Performance (small issue). A lot of code that should be otherwise fast is slower than it could be, since druntime will check, at runtime, if postblit is needed, if destruction should be done. For example, if you dup a

Re: druntime, templates and traits

2013-09-13 Thread Sean Kelly
On Sep 13, 2013, at 5:35 AM, Jacob Carlborg d...@me.com wrote: On 2013-09-13 12:26, monarch_dodra wrote: I had started toying around with this, and the main and immediate challenge I ran into is the integration of templates. The 2 issues are: 1. All templates must be in object.d, or the

Re: druntime, templates and traits

2013-09-13 Thread H. S. Teoh
On Fri, Sep 13, 2013 at 03:20:10PM +0200, Maxim Fomin wrote: On Friday, 13 September 2013 at 10:26:35 UTC, monarch_dodra wrote: 1. Performance (small issue). A lot of code that should be otherwise fast is slower than it could be, since druntime will check, at runtime, if postblit is needed,

Re: druntime, templates and traits

2013-09-13 Thread monarch_dodra
On Friday, 13 September 2013 at 17:02:24 UTC, H. S. Teoh wrote: For example, dup is not nothrow, yet it is safe and pure. Reserve is nothrow, yet assumeSafeAppend is not. Reserve may actually call postblit, but not assumeSafeAppend. Why is assumeSafeAppend not nothrow? If it were up to me, I'd

Re: druntime, templates and traits

2013-09-13 Thread H. S. Teoh
On Fri, Sep 13, 2013 at 07:47:32PM +0200, monarch_dodra wrote: On Friday, 13 September 2013 at 17:02:24 UTC, H. S. Teoh wrote: For example, dup is not nothrow, yet it is safe and pure. Reserve is nothrow, yet assumeSafeAppend is not. Reserve may actually call postblit, but not

Re: druntime, templates and traits

2013-09-13 Thread monarch_dodra
On Friday, 13 September 2013 at 18:01:30 UTC, H. S. Teoh wrote: On Fri, Sep 13, 2013 at 07:47:32PM +0200, monarch_dodra wrote: On Friday, 13 September 2013 at 17:02:24 UTC, H. S. Teoh wrote: For example, dup is not nothrow, yet it is safe and pure. Reserve is nothrow, yet assumeSafeAppend is