[Cryptography] tail recursion in C [was Re: "NSA-linked Cisco exploit poses bigger threat than previously thought"]
Howard Chu
hyc at symas.com
Sun Aug 28 20:13:10 EDT 2016
Ron Garret wrote:
>
> On Aug 28, 2016, at 12:40 PM, Tom Mitchell <mitch at niftyegg.com
> <mailto:mitch at niftyegg.com>> wrote:
>
>> On Sun, Aug 28, 2016 at 12:16 AM, Ron Garret <ron at flownet.com
>> <mailto:ron at flownet.com>> wrote:
>>
>> On Aug 27, 2016, at 7:16 AM, Howard Chu <hyc at symas.com
>> <mailto:hyc at symas.com>> wrote:
>>
>> > Ron Garret wrote:
>> >> All of these are reasons why I dispute the claim that C is “a good portable assembler.”
>>
>>
>>
>> > We live in a world of finite resources. We are all always operating under very tight resource constraints. Wasting cycles or bytes is not doing anyone any favors.
>>
>> You can’t be serious. Remember, we’re not talking about the efficiency
>> of the compiled code here, we’re talking about the efficiency of the
>> *compiler*. Arguing that we should use unsafe languages in order to
>> conserve electricity is just ridiculous.
>>
>>
>> I once thought that modern processors would remove a lot of the frugal
>> habits of many old timers (Clearly emacs is not frugal.). The resources of
>> a Raspberry Pi are luxurious...
>>
>> However the IOT is emerging on some rather sparse resources
>> and those tool chains and programmers are wrestling with the old
>> fast vs space battles. Stacks so small that recursion of any kind
>> is a big risk and should be recast as looping structures. And no operating
>> system...
>>
>> For this and other reasons C is not going away quickly and the freedom
>> and ambiguous bits of C make optimization near impossible.
>> Instruction sets are growing in complexity so quality hand coding
>> has become very uncommon and a "portable" assembler is still
>> needed.
>
> The first half of my career I worked on autonomous mobile robots. Back in
> those days (late 80’s, early 90’s) we didn’t have Raspberry Pi’s, we had 8-bit
> processors with typically 16k of flash and 1-2k of RAM. If we were lucky we
> had a 68020 with 8MB of RAM. We programmed those systems in Common Lisp. On
> the 68020 systems we ran Lisp directly, and on the 8-bit processors we wrote
> code in Forth and in DSL’s whose compilers were written in CL because writing
> a compiler in CL was (and still is) really easy.
>
> Yes, a portable assembler is a very handy thing. But C is not the only option.
Man, you brought back a lot of fond memories. But I also remember the Sun
workstations, their boot PROMs were written in Forth. I love Forth, I think
it's a brilliant language. But I also remember that Sun workstation boot
consoles had abysmally slow scroll rates, and reimplementing them in compiled
C made them orders of magnitude faster. Life is too short waiting for slow
code to execute.
--
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/
More information about the cryptography
mailing list