Redub: A faster build system promising 90% compatibility with dub

Hipreme msnmancini at hotmail.com
Mon Jan 22 21:19:22 UTC 2024


On Saturday, 20 January 2024 at 16:03:52 UTC, ryuukk_ wrote:
> On Saturday, 20 January 2024 at 15:25:35 UTC, Renato wrote:
>> On Saturday, 20 January 2024 at 14:14:10 UTC, Hipreme wrote:
>>>
>>> - I have tried contributing to dub's project on 
>>> parallelization, I waste 1 week trying that and could not get 
>>> it working, so, I decided it would be a better use of my time 
>>> into rewriting a completely new dub which would focus on 
>>> being easy to read -- An example of that is how easily 
>>> someone was able to integrate an experimental support to 
>>> building C with it.
>>>
>>>
>>
>> Could you expand on that? Perhaps someone else could continue 
>> your work.
>>
>> While I understand you preferred to write your own system (we 
>> all probably prefer greenfield development, after all that 
>> means it's fully yours, and you can fully understand it, own 
>> it, and change it as you see fit which is a very attractive 
>> proposition), I'm afraid your project will only be alive while 
>> you have interest in maintaining it (I've seen similar 
>> projects in other languages before, often they have one or two 
>> releases before the author moves on to the next greenfield 
>> project) - unless you manage to create an active community 
>> around it, which is exceedingly difficult and might be more 
>> than you're signing up for once a lot of people join in and 
>> start demanding features - while dub, even if it's so "buggy" 
>> as you claim, is the official tool everyone is likely to 
>> continue to use, and consequently improvements to it would be 
>> highly welcome.
>
>
> This quote says it all:
>
>> A full rebuild on Hipreme Engine reduced its compilation time 
>> from 14 seconds to 3
>
> dub is over engineered
>
> We should encourage more of these projects, they defy the 
> stalled status quo in D

Just came to announce that I've finished implementing redub as a 
library, present on version 1.2.1:

```d
import redub.api;
import redub.logging;

     void main()
     {
     	import std.file;

     	setLogLevel(LogLevel.verbose);
     	
     	ProjectDetails d = resolveDependencies(
     		invalidateCache: false,
     		std.system.os,
     		CompilationDetails("dmd", "arch not yet implemented", "dmd 
v[2.105.0]"),
     		ProjectToParse("configuration", getcwd(), "subPackage", 
"path/to/dub/recipe.json (optional)")
     	);

     	buildProject(d);
     }
```

Beyond that, I've also done 2 new optimizations:

1. Fixed a problem where memory was being allocated in a non 
essential task, causing some GC pauses while resolving 
dependencies. This reduced dependency resolution time to 1/4. 
Hipreme Engine went from 200ms to 50m, now the bottleneck being 
mostly `std.json`, but I don't think it is worth changing it.

2. Added support for compiler version assumption. This makes it 
even faster since it won't need to keep rerunning the `compiler 
--version` each time. This is a minor optimization that got 30 ms 
faster (on Windows).


More information about the Digitalmars-d-announce mailing list