Why did I stop writing D?
One can’t be fluent in more than a couple
of truly different languages – that holds
both for natural and programming languages.
Still, in the C-syntax world (they’re not
“truly different” from each other), D is
among my favorites. I used to have some
compile time metaprogramming fun with it;
but my D’s gotten rusty …
Gonna redo some pet projects in that language.
Am 04.07.21 um 01:59 schrieb Julian Fondren:
On Saturday, July 3rd, 2021 at 6:50 PM, Julian Fondren
<jfond...@minimaltype.com> wrote:
That takes about 80x as long as the attached method
using the FFI and a quick library in D.
That attachment got stripped? Well, it's nothing special.
extern(C) void triples(int* xs, int len) @nogc {
foreach (i; 0 .. len)
xs[i] = triple(xs[i]);
}
triplesd =: './libtriple.so triples n *i i'&cd
triples =: [: triplesd (; #)
triples 123334 122344 121212 111222 112122 555432
+-+-----------+-+
|0|1 0 0 1 0 1|6|
+-+-----------+-+
$(#~ triple"1) sn
33219 6
$(#~ 1 {:: triples) n
33219
30 timex '$(#~ triple"1) sn'
0.869076
30 timex '$(#~ 1 {:: triples) n'
0.0100672
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
--
----------------------
mail written using NEO
neo-layout.org
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm