www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15950] New: Wish: __compressed_import("file.ext");


          Issue ID: 15950
           Summary: Wish: __compressed_import("file.ext");
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: aliloko gmail.com

I've an idea for a practical quality-of-life but non-orthogonal feature.

__compressed_import("file.ext") would be like import("file.ext"), but instead
giving the file ZIP-compressed or any other friendly format.

The use case is that using multiple import("file.exe") are really practical to
bundle resources with a program(fonts, images, any data).
It really does make builds easier and with less redundancy and it is
cross-platform alternatives to PE resources, Mac bundle resources, or something
else on *nix.

But the size of these resources can be critical for binary size. On Apple
platforms they could be duplicated within each executable of an Universal

I've considered using CTFE to ZIP imported resources, but was advised not to.
It may be prohibitive and use a lot of memory. It's an option though, perhaps
the reasonable one.

Apr 22 2016