Liste des Groupes | Revenir à c arch |
Michael S <already5chosen@yahoo.com> writes:
On Tue, 3 Sep 2024 17:46:38 +0200
Terje Mathisen <terje.mathisen@tmsw.no> wrote:
Q&D programming is still far faster for me in C, but using Rust I>
don't have to worry about how well the compiler will be able to
optimize my code, it is pretty much always close to speed of light
since the entire aliasing issue goes away.
I am trying to compare speed of few compiled languages in one
benchmark that I find interesting.
In order to make comparison I have to port a test bench first,
because while most of this languages are able, with various level of
difficulties, to call C routines, none of them can be called from
'C', at least at my level of knowledge.
>
Porting test bench from C to Go was quite easy, the only part that I
didn't grasp immediately was related to time measurements.
>
Today I started Rust port and it is VERY much harder. After several
hours of reading of various tutorials, examples and Stack Overflow
articles I still don't know how to write
switch (argv[1][0]) {
case 't':
case 'T':
x = 42;
break;
}
>
At this rate, I am not sure that my motivation will last long
enough to finish the porting.
Disclaimer: I have very little experience with Rust. The
example shown below looks like Rust but may very well have
syntax errors (or worse).
match argv[1][0] {
't' | 'T' => { x = 42; }
_ => { }
}
The _ pattern matches anything that hasn't been matched (and
may be necessary, I'm not sure about that).
Les messages affichés proviennent d'usenet.