excel-d v0.0.1 - D API to write functions callable from Excel
Laeeth Isharc via Digitalmars-d-announce
digitalmars-d-announce at puremagic.com
Mon Mar 20 18:12:45 PDT 2017
On Tuesday, 21 March 2017 at 00:25:46 UTC, Steven Schveighoffer
wrote:
> On 3/20/17 4:09 PM, Atila Neves wrote:
>> http://code.dlang.org/packages/excel-d
>>
>> This dub package allows D code to be called from Excel. It uses
>> compile-time reflection to register the user's code in an XLL
>> (a DLL
>> loaded by Excel) so no boilerplate is necessary. Not even
>> `DllMain`! It
>> works like this:
>
> If I wanted to replace our horrifying web queries from Excel
> with this, I'm assuming I could? That would be awesome.
>
> -Steve
Yes - you could, provided the function is nogc. Have done some
work on using std.experimental.allocator (well I had a working
version, but was trimmed a bit), and will publish a revised
version when we get time, but it wouldn't be hard to add directly
yourself. PRs welcome. If you allocate memory just make sure
that you hook into the xlautofree callback (or whatever it's
called - long time since I touched this) to free it.
I try to keep the excel functions as simple as possible, because
I don't want to crash a trader's spreadsheet. So we end up with
a little local server running as a windows service that does the
work. (We use nanomsg tcp/ip on localhost as struggled with IPC
on windows, but you could talk to it however is convenient).
Look forward to catching up at dconf in Berlin. Atila will be
there too (and Stefan of course). I'm staying at the Beethoven
too.
Laeeth.
More information about the Digitalmars-d-announce
mailing list