DConf 2013 Day 2 Talk 6: Higgs, an experimental JIT compiler written in D by Maxime Chevalier-Boisvert

bearophile bearophileHUGS at lycos.com
Sat Jun 8 14:23:11 PDT 2013


Andrei Alexandrescu:

> http://www.reddit.com/r/programming/comments/1fv4zx/dconf_2013_day_2_talk_6_higgs_an_experimental_jit/

A nice talk. Some comments on the slides:

------------------------

Slide 34:

> - If you know C++, you can write D code
> - Similar enough, easy adaptation
> - Slightly less verbose

If you write functional-style D code that uses UCFS a lot, the 
code is different from the usual C++ code and much shorter (and 
slower).

------------------------

Slide 53:

> Needed template with list of integer arguments

I agree that arrays as template arguments is a natural 
enhancement for D.

------------------------

Slide 57:

> Unit Tests Blocks
> - Don't support naming unit tests
> - Failing tests not reported at the end
> - The main function is still called normally
>   Higgs starts a REPL by default
> - No way to select which tests are run
> - Tempted to write our own framework

I agree that in the built-in unittests some essential features 
are missing.

------------------------

Slide 58:

static this()
{
     codeGenFns[&SET_TRUE]       = &gen_set_true;
     codeGenFns[&SET_FALSE]      = &gen_set_false;
     codeGenFns[&SET_UNDEF]      = &gen_set_undef;
     codeGenFns[&SET_MISSING]    = &gen_set_missing;
     codeGenFns[&SET_NULL]       = &gen_set_null;
...
}

==>

static this()
{
     codeGenFns = [&SET_TRUE:    &gen_set_true,
                   &SET_FALSE:   &gen_set_false,
                   &SET_UNDEF:   &gen_set_undef,
                   &SET_MISSING: &gen_set_missing,
                   &SET_NULL:    &gen_set_null,
     ...];
}

(That associative array can even be generated with a string 
mixin, if there's enough RAM).

------------------------

Slide 64:

> Precompile most library code used in CTFE

Where to put such compiled code?

------------------------

Slide 67:

- D integer types have guaranteed sizes, but
   they're not obvious from the name
- Why not have int8, uint8, int32, uint32, etc. in
   default namespace, encourage their use?

I agree. It's hard to guess the size and signedness of types as 
byte, ubyte, wchar, dchar. I prefer names that are more clear.

Bye,
bearophile


More information about the Digitalmars-d-announce mailing list