Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Future of C Date: Thu, 15 Mar 2018 10:25:02 -0700 Organization: None to speak of Lines: 46 Message-ID: References: <0231327b-9e28-46e4-9178-46c881a8dd91@googlegroups.com> <3r7jne-t3h.ln1@gangtai.grep.be> <8e201938-ada4-42d9-8ae6-13b1047306e2@googlegroups.com> <0iXpC.1451$kF1.89@fx41.am4> <40d27639-bea8-460a-add2-f5ad2f26cbdc@googlegroups.com> <5e80c990-fe53-4d7e-8a81-bc411cc21d76@googlegroups.com> <2ac9ccf7-5b25-4822-8dbd-5b749bed2c07@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="4062d3804107f3b0a8439aa53526a52c"; logging-data="4354"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+duDhLTjZ6KPN7bLU+vLA5" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:Mlfm0vodD1AA2bSCLhlLtFuUzpU= sha1:O7O9LHThpeJQL5f+MfOXCdACw2Q= Xref: csiph.com comp.lang.c:127878 supercat@casperkitty.com writes: > On Wednesday, March 14, 2018 at 7:09:16 PM UTC-5, Keith Thompson wrote: >> supercat@casperkitty.com writes: >> > How would you go about efficiently supporting VLAs on small micro which >> > statically-allocates automatic variables, and handles recursion--if so >> > configured--by copying variables to storage which can only be efficiently >> > handled sequentially (as was the case IIRC with Archimedes v4 for the 8x51). >> > That development system's floating point was insufficiently precise to >> > qualify for a "double", but I think it otherwise conformed to C89 and would >> > probably have been adaptable to support all C99 features except VLAs, >> > though "long long" would likely have been more trouble than it was worth. >> >> I don't know. Of course support for recursion is mandatory, and the >> implementers apparently went to the trouble to support it. > > It may nominally be a requirement for conformance, but so's the ability > to support at least 9 full decimal digits of floating-point precision. Support for recursion is mandatory. Anything that doesn't support recursion is not a conforming C implementation. (Not even for your beloved C74.) [...] >> A quick Google search indicates that the compiler in question has been >> abandoned (I'm not certain of this). It probably just supports C89/C90. >> If someone were to take that compiler and update it to support C99, how >> much of that effort would be required to implement VLAs? I have no >> idea; if you don't know either, then you're just speculating. > > I think it was abandoned around 1995, but I mentioned it to show that > some actual real-world platforms would be capable of supporting recursion > without being able to efficiently support VLAs. From your description, it sounds like the support for recursion isn't particularly efficient. To support recursion, you need to implement something that acts like a stack; if there's no hardware support for a stack, that's going to be awkward. Likewise for VLAs. [...] -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"