Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #105796

Re: Return statement: anything goes?

From BartC <bc@freeuk.com>
Newsgroups comp.lang.c
Subject Re: Return statement: anything goes?
Date 2017-03-11 16:31 +0000
Organization A noiseless patient Spider
Message-ID <oa18ji$l75$1@dont-email.me> (permalink)
References (1 earlier) <87o9x8yjgp.fsf@bsb.me.uk> <e06a31f8-6c98-4fe3-a87f-aaddbef8d138@googlegroups.com> <87inngy57x.fsf@bsb.me.uk> <oa0pct$9ll$1@dont-email.me> <87d1dnyi73.fsf@bsb.me.uk>

Show all headers | View raw


On 11/03/2017 14:57, Ben Bacarisse wrote:
> BartC <bc@freeuk.com> writes:
>
>> On 11/03/2017 01:25, Ben Bacarisse wrote:
>>> bart4858@gmail.com writes:
>>
>>>> My problem (and this is one example) is that if I'm too strict, then I
>>>> may not be able to compile existing code that might have passed the
>>>> lower standards of other compilers.
>>>
>>> It's more a matter of matched the language standard.  That's why
>>> rejecting correct programs like:
>>>
>>>   #include <stdio.h>
>>>   int f(void) { puts("OK"); }
>>>   int main(void) { f(); }
>>>
>>> would create a new dialect.
>>
>> It would be a better, safer dialect then.
>
> It would be safer.  Some people would argue that a compiler that rejects
> some C programs is not "better", so that one would be endlessly
> debatable.
>
> But this raises the question of why you would implement C at all.

Just for fun. Also to see whether I can do it, and meet certain criteria 
doing so:

(Being able to present the complete thing as one source file [currently 
15Kloc]; being able to compile it as easily as Hello World; being able 
run it just as easily; including everything needed in one executable; 
being able to directly run programs from source; and being extremely 
fast. And, a bit trickier, to have generated code not be that terrible.)

> C has
> all sorts of things you hate, so if you are not going to implement
> standard C, why not implement something entirely "better" (by your own
> criteria of course)?

I've already done that (and I'm using it to implement this C project). 
But that needed a better, faster compiler; that project became this one 
(compiling an entire C project from multiple sources), and I will get 
back to the original purpose later.

What's interesting about the C version, is that while some aspects of 
the language slow it down (preprocessor, all the quirks, and repeated 
headers), others make it faster to compile. It'll be interesting to see 
how far I get.

That I don't like C so much is not so important; I don't have to use it!

-- 
bartc

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Return statement: anything goes? BartC <bc@freeuk.com> - 2017-03-10 19:13 +0000
  Re: Return statement: anything goes? John Bode <jfbode1029@gmail.com> - 2017-03-10 11:59 -0800
    Re: Return statement: anything goes? Keith Thompson <kst-u@mib.org> - 2017-03-10 12:34 -0800
  Re: Return statement: anything goes? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-03-10 20:17 +0000
    Re: Return statement: anything goes? bart4858@gmail.com - 2017-03-10 13:17 -0800
      Re: Return statement: anything goes? Ian Collins <ian-news@hotmail.com> - 2017-03-11 10:30 +1300
      Re: Return statement: anything goes? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-03-11 01:25 +0000
        Re: Return statement: anything goes? BartC <bc@freeuk.com> - 2017-03-11 12:11 +0000
          Re: Return statement: anything goes? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-03-11 14:57 +0000
            Re: Return statement: anything goes? BartC <bc@freeuk.com> - 2017-03-11 16:31 +0000
              Re: Return statement: anything goes? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-03-11 17:47 +0000
                Re: Return statement: anything goes? BartC <bc@freeuk.com> - 2017-03-11 17:57 +0000
                Re: Return statement: anything goes? jameskuyper@verizon.net - 2017-03-11 10:59 -0800
                Re: Return statement: anything goes? BartC <bc@freeuk.com> - 2017-03-11 19:34 +0000
                Re: Return statement: anything goes? jameskuyper@verizon.net - 2017-03-11 11:59 -0800
                Re: Return statement: anything goes? supercat@casperkitty.com - 2017-03-11 12:26 -0800
                Re: Return statement: anything goes? supercat@casperkitty.com - 2017-03-11 12:22 -0800
                Re: Return statement: anything goes? jameskuyper@verizon.net - 2017-03-11 12:42 -0800
                Re: Return statement: anything goes? supercat@casperkitty.com - 2017-03-11 13:01 -0800
                Re: Return statement: anything goes? Gordon Burditt <gordon@hammy.burditt.org> - 2017-03-13 16:25 -0500
            Re: Return statement: anything goes? Gareth Owen <gwowen@gmail.com> - 2017-03-11 16:43 +0000
              Re: Return statement: anything goes? BartC <bc@freeuk.com> - 2017-03-11 18:13 +0000
                Re: Return statement: anything goes? BartC <bc@freeuk.com> - 2017-03-11 18:27 +0000
          Re: Return statement: anything goes? gordonb.rlpr3@burditt.org (Gordon Burditt) - 2017-03-13 16:18 -0500
        Re: Return statement: anything goes? supercat@casperkitty.com - 2017-03-11 12:44 -0800
      Re: Return statement: anything goes? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2017-03-11 07:43 -0800
        Re: Return statement: anything goes? BartC <bc@freeuk.com> - 2017-03-11 18:34 +0000
          Re: Return statement: anything goes? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2017-03-11 10:43 -0800
  Re: Return statement: anything goes? Keith Thompson <kst-u@mib.org> - 2017-03-10 12:27 -0800
  Re: Return statement: anything goes? Noob <root@127.0.0.1> - 2017-03-10 22:06 +0100
    Re: Return statement: anything goes? bart4858@gmail.com - 2017-03-10 13:26 -0800
      Re: Return statement: anything goes? antispam@math.uni.wroc.pl - 2017-03-12 05:29 +0000
        Re: Return statement: anything goes? BartC <bc@freeuk.com> - 2017-03-12 10:52 +0000
          Re: Return statement: anything goes? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-03-12 12:19 +0000
            Re: Return statement: anything goes? BartC <bc@freeuk.com> - 2017-03-12 12:51 +0000

csiph-web