Higgs, a JavaScript JIT done in D

Nick Sabalausky SeeWebsiteToContactMe at semitwist.com
Sun Feb 3 12:54:21 PST 2013


On Sun, 03 Feb 2013 14:56:12 +0100
"bearophile" <bearophileHUGS at lycos.com> wrote:
> 
> The author has used asserts at the beginning of methods, outside 
> a the pre-condition, this is silly.

Why is it silly? (Genuine question)

> Not using foreach loops on 
> numerical intervals is a waste of fingers and increases the risk 
> of mistakes, final switches often help you, text() is shorter 
> than to!string(),

Yea, I agree there.

Although I've found that the existence of text() is easy
to overlook (and if I were looking for it, I'd be looking in
std.string, though I realize it makes sense either way).

Also, AIUI, "foreach(i; 0..10)" involves a range and function calls, so
perhaps they want to be certain there isn't any overhead that
accidentally fails to get optimized out?

Plus they may be new to D, now be aware of things like "final switch"
or exactly which of the advanced features are potentially problematic.



More information about the Digitalmars-d-announce mailing list