Re: Hashing and comparing of arrays
- From: Helge Jensen <helge.jensen@xxxxxxx>
- Date: Sun, 23 Apr 2006 17:55:34 +0200
Ole Nielsby wrote:
The compiled code for the three ran at *almost* the same
speed! I was especially impressed with the CPS-rewrites
done by the optimizer.
Sounds interesting. My interpreter port will have to be done
in Continuation Passing Style, as the current version (written
in NASM) does things to the stack that simply won't work
with clr stack frames (like piped list processing, and a construct
that works like a mix of structured exception handling and
explicit tail call - this may sound obscure but the construct is
quite central to the language and models the concept of "taking
responsibility", which is of great help when debugging.)
Interesting, have you got any intros/docs/references on any of this?
My main reason for picking C# for the project is, I like the
idea of getting verifiable code "by default" - though I'm
not sure this is possible when WeakReference is involved.
However, if the C++ compiler can produce better optimized
and still verifiable code for the style I will be using (or if I
can't get verifiable code with WeakReference in it), I might
change the horse.
Which definition of "verifiable" are you referring to? verifiable, as in
"no-null-pointer derefs" or "no-undefined-behaviour", or ...
BTW I explored C# generics and found that there were things
I'd like to do but couldn't, some of which I think would be
You can't really do meta-programming with C# generics -- they are not
touring-complete like c++ templates ;) At a point i was quite fascinated
with meta-programming using templates. In the end a realized that it's
just building another *very* poor language, and that I was hard put to
identify problems in my problem-domains which had significant
performance-benefits from it.
Many of the tricks done with templates in C++ is all about letting the
compiler know as much as possible about the types of arguments to allow
more precise analysis and inlining, which may cause increased
performance and almost certainly bloat, and often a long-lasting
sessions of "spoon-feeding-the-compiler".
Many of the things i did with static-dispatch a few years ago I do with
dynamic dispatch (virtual functions or dictionary-lookup) now.
possible with C++ templates, though I'm not too sharp with
templates (no pun inteded) - actually, I shocked a C++ expert
the other day by casually referring to C# generics as "templates".
Generics are certainly not templates. Templates is "type-parameters by
macro". Generics is "limited type-parameters, mostly at compile-time".
precisely how C++ templates relate to C# generics. Do they
merge, in the sense that the C++ compiler will use the clr
generic whenever possible and resort to code bloat when
not... or are they rather separate concepts?
I don't have any answer to that, but I can't imagine how the C++
compiler could share code between all instances of classes or functions
that are parametrised with reference-types, like C# does.
--
Helge Jensen
mailto:helge.jensen@xxxxxxx
sip:helge.jensen@xxxxxxx
-=> Sebastian cover-music: http://ungdomshus.nu <=-
.
- Follow-Ups:
- Re: Hashing and comparing of arrays
- From: Ole Nielsby
- Re: Hashing and comparing of arrays
- References:
- Hashing and comparing of arrays
- From: Ole Nielsby
- Re: Hashing and comparing of arrays
- From: Helge Jensen
- Re: Hashing and comparing of arrays
- From: Ole Nielsby
- Re: Hashing and comparing of arrays
- From: Lucian Wischik
- Re: Hashing and comparing of arrays
- From: Ole Nielsby
- Re: Hashing and comparing of arrays
- From: Helge Jensen
- Re: Hashing and comparing of arrays
- From: Ole Nielsby
- Hashing and comparing of arrays
- Prev by Date: Interesting C# puzzle
- Next by Date: Dragging the mouse over a control
- Previous by thread: Re: Hashing and comparing of arrays
- Next by thread: Re: Hashing and comparing of arrays
- Index(es):
Relevant Pages
|