Bug 15950 – Wish: __compressed_import("file.ext");

Status
RESOLVED
Resolution
WONTFIX
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2016-04-22T12:25:40Z
Last change time
2020-12-19T02:05:19Z
Assigned to
No Owner
Creator
ponce

Comments

Comment #0 by aliloko — 2016-04-22T12:25:40Z
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 Binary. 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.
Comment #1 by dlang-bugzilla — 2017-06-26T19:14:36Z
(In reply to ponce from comment #0) > 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. Instead of using CTFE, how about compressing them as part of your build, and decompressing them at runtime? Using CTFE might be more realistic with Stefan's upcoming new CTFE engine.
Comment #2 by aliloko — 2020-12-19T02:05:19Z
I... don't remember needing this. Looks like a bad idea.