Re: [OT] Sed and Awk
From: Alan Connor (zzzzzz_at_xxx.yyy)
Date: 12/15/03
- Next message: Alan Connor: "Re: Using alias within a bash script"
- Previous message: Icarus Sparry: "Re: Invoking Shell Script through VAX/VMS machine."
- In reply to: Ed Morton: "Re: [OT] Sed and Awk"
- Next in thread: Ed Morton: "Re: [OT] Sed and Awk"
- Reply: Ed Morton: "Re: [OT] Sed and Awk"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 15 Dec 2003 19:58:57 GMT
On Mon, 15 Dec 2003 05:59:04 -0600, Ed Morton <morton@lsupcaemnt.com> wrote:
>
<snip>
>> Speed, replacing HL code with ASM where something is done countless times,
>> is the only practical application using *your* rather mercenary definition
>> of the word.
>
> But I already said "assuming that code runs fast enough to satisfy your
> requirements" and "that runs fast enough" so speed isn't a reason I was
> looking for. If your code runs fast enough to satisfy your requirements,
> there's no point in optimizing it at the expense of
> readability/maintainability and time-to-market.
>
> Even after re-reading it a couple of times, I honestly don't think my
> definition was particularly mercenary - what about it appears mercenary
> to you?
>
Just seemed that way. Because of the terms you used, like "time-to-market".
>> If one was into having the smallest and fastest and most efficient and glitch-
>> free binaries, including leaving out the compiler and the libs necessary to
>> make it work, then ASM would be the way to go.
>
> Not sure what you mean by "glitch-free binaries", but if you mean
> bug-free, then I doubt if you'll have fewer bugs in hand-written
> assembly than in compiler-generated assenmbly code. I spent several
> years studying quality metrics and, unless you take heroic measures in
> code inspection, etc. (see
> http://www.fastcompany.com/online/06/writestuff.html for what that
> means!) the more code you write by hand the more bugs you have.
>
With ASM you can write code perfectly optomized for the exact cpu you
are dealing with. C et al write to "virtual cpu's".
> I will accept your and Charles Demas's other point, though, that
> sometimes you just have to do it for size. I've never come across that
> and I'm surprised to hear it's a real problem, but I'll bow to your
> collective experiences.
>
Better bow to Charles', not mine. Both you guys are way beyond me. I am
just parroting things I've read and running them past my superiors in
these arcane arts.
>> You'd have to be into the art of it I guess, and art is always more expensive
>> than assembly-line products, one way or another.
>>
>> ASM is supposed to be very handy for de-bugging too.
>
> Having had to debug programs written in M68000 assembly, I couldn't
> agree less. Unless you mean that knowing assembly is handy for
> debugging a suspected compiler bug? I could buy that, though any time
> I've suspected a compiler bug (it couldn't be a bug in MY code ;-)),
> I've been proven wrong without having to resort to wading through the
> assembly.
>
Yes. For compiler bugs.
> One other use for a knowledge of assembly - I have read the assembly
> code generated from C code to see how best to generate my C code (from
> one of the higher-level languages I mentioned) for a specific
> compiler+platform to produce the fastest assembly code (obvious one:
> switches on contiguous ranges are faster than nested "if-else"s,
> non-obvious is that switches on non-contiguous ranges generated exactly
> the same assembly as nested ifs from my target compiler). Again, though,
> it isn't necessary to write the assembly by hand to do that, just to
> understand what the C you write implies for the assembly on that target
> compiler+platform.
>
Makes sense.
> Hmmm, seems like we've wandered just a tad OT from sed vs awk. Ah well,
> the whole thread was labelled OT so I probably don't need to add a
> second OT to the subject line...
>
Thank you Ed.
Who do you think will win the World Series?
:-)
AC
- Next message: Alan Connor: "Re: Using alias within a bash script"
- Previous message: Icarus Sparry: "Re: Invoking Shell Script through VAX/VMS machine."
- In reply to: Ed Morton: "Re: [OT] Sed and Awk"
- Next in thread: Ed Morton: "Re: [OT] Sed and Awk"
- Reply: Ed Morton: "Re: [OT] Sed and Awk"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|