Thread overview
Bin2d (0.2.0) Rewrite
Jul 23, 2015
Rikki Cattermole
Jul 23, 2015
Suliman
Jul 23, 2015
Rikki Cattermole
Jul 23, 2015
Taylor Hillegeist
Jul 24, 2015
Suliman
July 23, 2015
So Bin2D[0] has been rewritten and adds a bunch of nice new features.

- Limit generated code by:
  - package modifier
  - ``version(unittest)``
- Use enum for usage at compile time, instead of ``const(ubyte[])``
- Report with variable name to original filename

Only dependency is Phobos.
The rewrite adds most importantly usage of e.g. byChunk over the input files to limit the amount of memory used.

[0] https://github.com/rikkimax/bin2d
July 23, 2015
On Thursday, 23 July 2015 at 10:15:17 UTC, Rikki Cattermole wrote:
> So Bin2D[0] has been rewritten and adds a bunch of nice new features.
>
> - Limit generated code by:
>   - package modifier
>   - ``version(unittest)``
> - Use enum for usage at compile time, instead of ``const(ubyte[])``
> - Report with variable name to original filename
>
> Only dependency is Phobos.
> The rewrite adds most importantly usage of e.g. byChunk over the input files to limit the amount of memory used.
>
> [0] https://github.com/rikkimax/bin2d

Cool! Could you add example of usage in readme?
July 23, 2015
On 23/07/2015 11:56 p.m., Suliman wrote:
> On Thursday, 23 July 2015 at 10:15:17 UTC, Rikki Cattermole wrote:
>> So Bin2D[0] has been rewritten and adds a bunch of nice new features.
>>
>> - Limit generated code by:
>>   - package modifier
>>   - ``version(unittest)``
>> - Use enum for usage at compile time, instead of ``const(ubyte[])``
>> - Report with variable name to original filename
>>
>> Only dependency is Phobos.
>> The rewrite adds most importantly usage of e.g. byChunk over the input
>> files to limit the amount of memory used.
>>
>> [0] https://github.com/rikkimax/bin2d
>
> Cool! Could you add example of usage in readme?

There is already a pretty basic example in it.
Anything specific in mind?
July 23, 2015
On Thursday, 23 July 2015 at 12:07:21 UTC, Rikki Cattermole wrote:
> On 23/07/2015 11:56 p.m., Suliman wrote:
>> On Thursday, 23 July 2015 at 10:15:17 UTC, Rikki Cattermole wrote:
>>> So Bin2D[0] has been rewritten and adds a bunch of nice new features.
>>>
>>> - Limit generated code by:
>>>   - package modifier
>>>   - ``version(unittest)``
>>> - Use enum for usage at compile time, instead of ``const(ubyte[])``
>>> - Report with variable name to original filename
>>>
>>> Only dependency is Phobos.
>>> The rewrite adds most importantly usage of e.g. byChunk over the input
>>> files to limit the amount of memory used.
>>>
>>> [0] https://github.com/rikkimax/bin2d
>>
>> Cool! Could you add example of usage in readme?
>
> There is already a pretty basic example in it.
> Anything specific in mind?

To be honest it took me a bit to realize what it was. A Command line application that produces a d modules which represent/store those files.

The example is great but it could also use a bit more generic outline

Bin2d MODULENAME.d=Resource_Reference FILE1_PATH [FILE2_PATH ...]

I'm not sure how its usually done. Also even though its not necessary its always nice to have an example that will compile. It also adds some context.

MAIN.d
-------------------
import std.stdio;
import Resource_Reference;

void main() {
    string[] FILE_LOCATIONS = outputFilesToFileSystem();
    FILE_LOCATIONS.each!writeln();
}
-------------------

compile With dmd MAIN.d MODULENAME.d

Actually this didn't work for me... maybe I'm misinterpreting something.

July 24, 2015
> There is already a pretty basic example in it.
> Anything specific in mind?

How to get access to file after it's was build in executable?