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


Groups > comp.lang.c > #64643

Re: "core C"

From Steve Thompson <stevet810@gmail.com>
Newsgroups comp.lang.c
Subject Re: "core C"
Date 2015-07-03 12:25 +0000
Organization Friends of the Galactic Collective
Message-ID <cZf6wf.Aku.9IRNp@gmail.com> (permalink)
References <ind4patt3nos39qrqj92b5dlp014o68g3v@4ax.com> <f4001c33-3768-4c92-82c0-10825a331ea9@googlegroups.com> <mmu6hv$84a$1@dont-email.me>

Show all headers | View raw


On Tue, Jun 30, 2015 at 03:46:58PM +0200, David Brown wrote:
> On 30/06/15 13:27, Rick C. Hodgin wrote:
> > We can define Core C here if you'd like. :-)  I appoint myself chair,
> > and the rest of us a "committee of the whole" to address the issue.
> 
> That would be the "royal we"?  This is entirely /your/ thoughts on a
> language.  Others (like me) might comment, but don't pretend that any
> one other than /you/ thinks this is a useful idea in practice.
> 
> However, it can always be fun to think about what would make up a
> "perfect" C language, from an almost entirely subjective viewpoint.

It must be a coincidence that his "Core C" feature enumeration has a
close correspondence with several of the features I am putting in my
VM project.  It must be the nature of the beast; C-derived systems
will tend to be similar, right?  At any rate, my thing is a research
project and not something I am worried about promoting on Usenet.
 
> > 
> > #1 Little endian.
> 
> There are far too many big endian systems around for this to be defined
> as "core".  I'd be happy to say it should support big endian and little
> endian systems, but not mixed endian systems.
> 
> More usefully, I would like to see type/variable qualifiers for
> specifying endianness, which would eliminate all issues that different
> endianness causes today (e.g., when specifying a binary file format, you
> would explicitly give the endianness of the fields).
> 
> The bit-endianness (order of bitfields) would also need to be specified.

That's a pretty good idea.  If you had a CPU instruction to byteswap
16-64 bit words it would be easy to implement.
 
> > #2 Two's complement.
> 
> I'm OK with that.
> 
> > #3 All pointers are the same size per target.
> 
> I don't see the point of this restriction, and it would cause limitation
> on real-world microcontrollers.

Doesn't really make sense with some of his criterion.
 
> > #4 All memory is executable.
> 
> Nope - that's a terrible idea.  C does not currently distinguish between
> types of memory (code, data, bss and stack sections are all
> implementation details, not part of the standards).  But if you want to
> make memory areas part of "Core C", then you definitely want
> restrictions on executable parts.
> 
> And for many real-world microcontrollers, only some of the memory can be
> executable.  If "Core C" is to have a point, it must be suitable for a
> range of "normal" systems, even if it excludes odd or outdated systems.
> 
> > #5 All memory is read/write unless explicitly flagged as read-only.
> 
> Again, that's a terrible idea.  And it would not work on
> microcontrollers, which have read-only memory regardless of what the
> user might try to do with flagging.

His "core C" is not going to work where there is no hardware memeory
protection.

> > #6 No default support for char, short, int, long, long long, etc.,
> >    but these keywords are reserved for use with typedef or #define
> >    statements to map to the appropriate target for the machine.
> 
> That's going to upset a lot of people...
> 
> > #7 Signed variable types:  s8, s16, s32, s64
> 
> No, these are called int8_t, int16_t, int32_t and int64_t.  Don't change
> these to non-standard names that could easily be mixed up, just to save
> a couple of keystrokes.
> 
> > #8 Unsigned variable types:  u8, u16, u32, u64
> 
> Again, these are uint8_t, uint16_t, uint32_t and uint64_t.

These types should have been defined way back when C was an unruly
teenager and used then instead of char, int, etc.

How much trouble has the indeterminate range of int types caused when
porting code?



Regards,

Steve Thompson

-- 
"If I had a nickel for every time some idiot called me about a
computer problem that turned out to be user error, I would be able to
retire and spend the rest of my days cultivating clues in my backyard
hillside garden."  -- MysteryDog in 24hoursupport.helpdesk.

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


Thread

"core C" Rosario19 <Ros@invalid.invalid> - 2015-06-30 08:38 +0200
  Re: "core C" jt@toerring.de (Jens Thoms Toerring) - 2015-06-30 07:54 +0000
    Re: "core C" Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-06-30 02:55 -0700
    Re: "core C" Rosario19 <Ros@invalid.invalid> - 2015-06-30 17:31 +0200
      Re: "core C" Rosario19 <Ros@invalid.invalid> - 2015-06-30 18:15 +0200
        Re: "core C" "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-06-30 12:19 -0700
  Re: "core C" "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-06-30 04:27 -0700
    Re: "core C" "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-06-30 04:48 -0700
      Re: "core C" Bartc <bc@freeuk.com> - 2015-06-30 13:07 +0100
        Re: "core C" "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-06-30 05:15 -0700
    Re: "core C" Bartc <bc@freeuk.com> - 2015-06-30 13:02 +0100
      Re: "core C" "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-06-30 05:13 -0700
        Re: "core C" Bartc <bc@freeuk.com> - 2015-06-30 13:58 +0100
          Re: "core C" "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-06-30 06:11 -0700
            Re: "core C" Bartc <bc@freeuk.com> - 2015-06-30 15:11 +0100
              Re: "core C" "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-06-30 07:50 -0700
                Re: "core C" Rosario19 <Ros@invalid.invalid> - 2015-06-30 17:24 +0200
                Re: "core C" Bartc <bc@freeuk.com> - 2015-06-30 17:44 +0100
                Re: "core C" "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-06-30 10:04 -0700
                Re: "core C" Bartc <bc@freeuk.com> - 2015-07-01 11:46 +0100
                Re: "core C" "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-07-01 04:40 -0700
                Re: "core C" Keith Thompson <kst-u@mib.org> - 2015-07-01 08:05 -0700
                Re: "core C" Bartc <bc@freeuk.com> - 2015-07-01 17:01 +0100
                Re: "core C" Keith Thompson <kst-u@mib.org> - 2015-07-01 10:56 -0700
                Re: "core C" BGB <cr88192@hotmail.com> - 2015-07-04 12:59 -0500
                Re: "core C" Bartc <bc@freeuk.com> - 2015-07-04 20:25 +0100
                Re: "core C" BGB <cr88192@hotmail.com> - 2015-07-04 20:56 -0500
        Re: "core C" Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-06-30 14:17 +0100
    Re: "core C" Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-06-30 14:03 +0100
      Re: "core C" "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-06-30 06:16 -0700
    Re: "core C" David Brown <david.brown@hesbynett.no> - 2015-06-30 15:46 +0200
      Re: "core C" "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-06-30 07:54 -0700
      Re: "core C" Steve Thompson <stevet810@gmail.com> - 2015-07-03 12:25 +0000
    Re: "core C" jt@toerring.de (Jens Thoms Toerring) - 2015-07-01 15:04 +0000
      Re: "core C" "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-07-01 08:12 -0700
    Re: "core C" BGB <cr88192@hotmail.com> - 2015-07-04 10:36 -0500
  Re: "core C" "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-06-30 04:41 -0700
    Re: "core C" Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-06-30 14:19 +0100
      Re: "core C" "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-06-30 06:25 -0700
        Re: "core C" Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-06-30 15:48 +0100
          Re: "core C" "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-06-30 07:52 -0700
  Re: "core C" "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-06-30 04:42 -0700
  Re: "core C" "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-06-30 08:28 -0700
    Re: "core C" David Brown <david.brown@hesbynett.no> - 2015-06-30 22:28 +0200
      Re: "core C" Ian Collins <ian-news@hotmail.com> - 2015-07-01 08:45 +1200
        Re: "core C" "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-06-30 13:56 -0700
          Re: "core C" David Brown <david.brown@hesbynett.no> - 2015-07-01 10:27 +0200
        Re: "core C" Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-06-30 14:56 -0700
          Re: "core C" Ian Collins <ian-news@hotmail.com> - 2015-07-01 10:03 +1200
            Re: "core C" Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-06-30 15:31 -0700
              Re: "core C" Ian Collins <ian-news@hotmail.com> - 2015-07-01 10:52 +1200
                Re: "core C" Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-06-30 16:58 -0700
                Re: "core C" Keith Thompson <kst-u@mib.org> - 2015-06-30 17:30 -0700
                Re: "core C" David Brown <david.brown@hesbynett.no> - 2015-07-01 08:54 +0200
                Re: "core C" Keith Thompson <kst-u@mib.org> - 2015-07-01 07:54 -0700
                Re: "core C" Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-07-01 09:42 -0700

csiph-web