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


Groups > comp.lang.c > #138493 > unrolled thread

Big integers

Started byBart <bc@freeuk.com>
First post2018-12-04 12:17 +0000
Last post2018-12-25 15:54 +0000
Articles 20 on this page of 140 — 29 participants

Back to article view | Back to comp.lang.c


Contents

  Big integers Bart <bc@freeuk.com> - 2018-12-04 12:17 +0000
    Re: Big integers fir <profesor.fir@gmail.com> - 2018-12-04 05:58 -0800
      Re: Big integers Chad <cdalten@gmail.com> - 2018-12-04 08:22 -0800
        Re: Big integers Bart <bc@freeuk.com> - 2018-12-04 17:04 +0000
          Re: Big integers scott@slp53.sl.home (Scott Lurndal) - 2018-12-04 17:19 +0000
    Re: Big integers Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2018-12-04 08:38 -0800
      Re: Big integers Bart <bc@freeuk.com> - 2018-12-04 17:35 +0000
        Re: Big integers Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-12-04 18:13 +0000
          Re: Big integers "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-12-04 10:50 -0800
          Re: Big integers Rosario19 <Ros@invalid.invalid> - 2018-12-06 17:56 +0100
        Re: Big integers Thiago Adams <thiago.adams@gmail.com> - 2018-12-04 10:22 -0800
          Re: Big integers Eli the Bearded <*@eli.users.panix.com> - 2018-12-04 18:58 +0000
            Re: Big integers Thiago Adams <thiago.adams@gmail.com> - 2018-12-04 11:32 -0800
              Re: Big integers Eli the Bearded <*@eli.users.panix.com> - 2018-12-04 22:45 +0000
                Re: Big integers jameskuyper@alumni.caltech.edu - 2018-12-04 14:57 -0800
            Re: Big integers jameskuyper@alumni.caltech.edu - 2018-12-04 12:14 -0800
            Re: Big integers chris.m.thomasson.1@gmail.com - 2018-12-04 16:58 -0800
              Re: Big integers Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-12-05 03:14 +0000
                Re: Big integers "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2018-12-05 14:27 -0800
              Re: Big integers Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2018-12-04 20:03 -0500
                Re: Big integers "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2018-12-05 14:25 -0800
        Re: Big integers jacob navia <jacob@jacob.remcomp.fr> - 2018-12-04 23:45 +0100
          Re: Big integers Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-12-04 23:29 +0000
          Re: Big integers Bart <bc@freeuk.com> - 2018-12-05 00:30 +0000
            Re: Big integers "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2018-12-05 14:28 -0800
          Re: Big integers Jens Stuckelberger <Jens_Stuckelberger@nowhere.net> - 2018-12-05 17:50 +0000
            Re: Big integers jacobnavia <jacob@jacob.remcomp.fr> - 2018-12-05 20:03 +0100
          Re: Big integers Keith Thompson <kst-u@mib.org> - 2018-12-05 13:46 -0800
            Re: Big integers jacobnavia <jacob@jacob.remcomp.fr> - 2018-12-06 06:41 +0100
              Re: Big integers Keith Thompson <kst-u@mib.org> - 2018-12-05 22:40 -0800
    Re: Big integers "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-12-04 09:08 -0800
      Re: Big integers Bart <bc@freeuk.com> - 2018-12-04 19:41 +0000
        Re: Big integers "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-12-04 12:00 -0800
      Re: Big integers Bart <bc@freeuk.com> - 2018-12-08 11:28 +0000
    Re: Big integers Ian Collins <ian-news@hotmail.com> - 2018-12-05 15:19 +1300
      Re: Big integers Bart <bc@freeuk.com> - 2018-12-05 11:58 +0000
        Re: Big integers David Brown <david.brown@hesbynett.no> - 2018-12-05 14:35 +0100
          Re: Big integers Bart <bc@freeuk.com> - 2018-12-05 14:35 +0000
            Re: Big integers Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2018-12-05 07:39 -0800
              Re: Big integers Thiago Adams <thiago.adams@gmail.com> - 2018-12-05 07:45 -0800
                Re: Big integers Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-12-05 17:51 +0000
                  Re: Big integers David Brown <david.brown@hesbynett.no> - 2018-12-05 22:19 +0100
                Re: Big integers "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2018-12-05 14:55 -0800
                  Re: Big integers jameskuyper@alumni.caltech.edu - 2018-12-05 15:19 -0800
                    Re: Big integers "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2018-12-05 16:13 -0800
                      Re: Big integers David Brown <david.brown@hesbynett.no> - 2018-12-06 09:35 +0100
                        Re: Big integers "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2018-12-07 14:26 -0800
                          Re: Big integers "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2018-12-07 19:56 -0800
                  Re: Big integers James Kuyper <jameskuyper@alumni.caltech.edu> - 2018-12-09 12:01 -0500
                    Re: Big integers "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2018-12-10 14:47 -0800
                      Re: Big integers scott@slp53.sl.home (Scott Lurndal) - 2018-12-11 00:50 +0000
                        Re: Big integers "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2018-12-10 17:37 -0800
                          Re: Big integers "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2018-12-14 21:18 -0800
            Re: Big integers Thiago Adams <thiago.adams@gmail.com> - 2018-12-05 07:57 -0800
            Re: Big integers Bart <bc@freeuk.com> - 2018-12-05 15:59 +0000
              Re: Big integers Bart <bc@freeuk.com> - 2018-12-05 22:59 +0000
                Re: Big integers jameskuyper@alumni.caltech.edu - 2018-12-05 15:31 -0800
                  Re: Big integers Robert Wessel <robertwessel2@yahoo.com> - 2018-12-05 20:03 -0600
                Re: Big integers scott@slp53.sl.home (Scott Lurndal) - 2018-12-05 23:42 +0000
                  Re: Big integers James Kuyper <jameskuyper@alumni.caltech.edu> - 2018-12-05 20:15 -0500
                Re: Big integers Ike Naar <ike@iceland.freeshell.org> - 2018-12-10 07:26 +0000
                  Re: Big integers Bart <bc@freeuk.com> - 2018-12-10 18:38 +0000
                    Re: Big integers scott@slp53.sl.home (Scott Lurndal) - 2018-12-10 19:10 +0000
                      Re: Big integers Bart <bc@freeuk.com> - 2018-12-10 21:23 +0000
                    Re: Big integers Ike Naar <ike@iceland.freeshell.org> - 2018-12-10 22:47 +0000
            Re: Big integers David Brown <david.brown@hesbynett.no> - 2018-12-05 22:15 +0100
          Re: Big integers Bart <bc@freeuk.com> - 2018-12-06 13:43 +0000
            Re: Big integers Thiago Adams <thiago.adams@gmail.com> - 2018-12-06 07:50 -0800
        Re: Big integers Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-12-05 15:19 +0000
          Re: Big integers luser droog <luser.droog@gmail.com> - 2018-12-10 23:19 -0800
            Re: Big integers David Brown <david.brown@hesbynett.no> - 2018-12-11 08:45 +0100
              Re: Big integers Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-12-11 11:15 +0000
                Re: Big integers Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2018-12-11 04:36 -0800
                  Re: Big integers David Brown <david.brown@hesbynett.no> - 2018-12-11 14:35 +0100
                Re: Modules again (was: Big integers) Bart <bc@freeuk.com> - 2018-12-11 12:53 +0000
                  Re: Modules again David Brown <david.brown@hesbynett.no> - 2018-12-11 14:45 +0100
                    Re: Modules again Bart <bc@freeuk.com> - 2018-12-11 16:08 +0000
                      Re: Modules again David Brown <david.brown@hesbynett.no> - 2018-12-11 21:37 +0100
                    Re: Modules again Thiago Adams <thiago.adams@gmail.com> - 2018-12-11 08:59 -0800
                      Re: Modules again Bart <bc@freeuk.com> - 2018-12-11 17:49 +0000
                      Re: Modules again David Brown <david.brown@hesbynett.no> - 2018-12-11 21:44 +0100
                    Re: Modules again scott@slp53.sl.home (Scott Lurndal) - 2018-12-11 18:02 +0000
                      Re: Modules again Thiago Adams <thiago.adams@gmail.com> - 2018-12-11 10:10 -0800
                        Re: Modules again scott@slp53.sl.home (Scott Lurndal) - 2018-12-11 18:54 +0000
                      Re: Modules again Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2018-12-11 13:14 -0500
                        Re: Modules again scott@slp53.sl.home (Scott Lurndal) - 2018-12-11 18:54 +0000
                          Re: Modules again Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2018-12-11 14:42 -0500
                            Re: Modules again David Brown <david.brown@hesbynett.no> - 2018-12-11 21:54 +0100
                              Re: Modules again Keith Thompson <kst-u@mib.org> - 2018-12-11 14:53 -0800
                                Re: Modules again David Brown <david.brown@hesbynett.no> - 2018-12-12 08:24 +0100
                      Re: Modules again David Brown <david.brown@hesbynett.no> - 2018-12-11 21:51 +0100
                        Re: Modules again scott@slp53.sl.home (Scott Lurndal) - 2018-12-11 23:24 +0000
                          Re: Modules again Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2018-12-11 18:44 -0500
                            Re: Modules again Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2018-12-11 18:45 -0500
                            Re: Modules again Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-12-12 06:39 +0000
                              Re: Modules again James Kuyper <jameskuyper@alumni.caltech.edu> - 2018-12-12 07:59 -0500
                                Re: Modules again mark.bluemel@gmail.com - 2018-12-12 05:43 -0800
                                Re: Modules again scott@slp53.sl.home (Scott Lurndal) - 2018-12-12 14:20 +0000
                                Re: Modules again David Brown <david.brown@hesbynett.no> - 2018-12-12 17:10 +0100
                                  Re: Modules again James Kuyper <jameskuyper@alumni.caltech.edu> - 2018-12-12 13:39 -0800
                            Re: Modules again scott@slp53.sl.home (Scott Lurndal) - 2018-12-12 14:19 +0000
                              Re: Modules again Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2018-12-12 10:28 -0500
        Re: Big integers Ian Collins <ian-news@hotmail.com> - 2018-12-06 08:10 +1300
          Re: Big integers Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-12-05 20:57 +0000
            Re: Big integers Ian Collins <ian-news@hotmail.com> - 2018-12-06 10:16 +1300
              Re: Big integers Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-12-05 23:15 +0000
                Re: Big integers scott@slp53.sl.home (Scott Lurndal) - 2018-12-05 23:44 +0000
    Re: Big integers Robert Wessel <robertwessel2@yahoo.com> - 2018-12-05 02:51 -0600
    Re: Big integers antispam@math.uni.wroc.pl - 2018-12-07 15:26 +0000
      Re: Big integers Bart <bc@freeuk.com> - 2018-12-07 16:27 +0000
        Re: Big integers scott@slp53.sl.home (Scott Lurndal) - 2018-12-07 16:36 +0000
          Re: Big integers Bart <bc@freeuk.com> - 2018-12-07 17:01 +0000
        Re: Big integers Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-12-07 17:55 +0000
        Re: Big integers antispam@math.uni.wroc.pl - 2018-12-07 19:26 +0000
          Re: Big integers Bart <bc@freeuk.com> - 2018-12-07 21:39 +0000
            Re: Big integers Ian Collins <ian-news@hotmail.com> - 2018-12-08 10:51 +1300
    Re: Big integers Anton Shepelev <anton.txt@gmail.com> - 2018-12-08 00:43 +0300
      Re: Big integers Bart <bc@freeuk.com> - 2018-12-08 01:08 +0000
      Re: Big integers David Brown <david.brown@hesbynett.no> - 2018-12-08 15:13 +0100
        Re: Big integers David Brown <david.brown@hesbynett.no> - 2018-12-08 15:15 +0100
          Re: Big integers Bart <bc@freeuk.com> - 2018-12-08 14:48 +0000
            Re: Big integers Thiago Adams <thiago.adams@gmail.com> - 2018-12-10 05:10 -0800
              Re: Big integers Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2018-12-10 05:22 -0800
                Re: Big integers David Brown <david.brown@hesbynett.no> - 2018-12-10 15:27 +0100
                  Re: Big integers scott@slp53.sl.home (Scott Lurndal) - 2018-12-10 15:59 +0000
                  Re: Big integers antispam@math.uni.wroc.pl - 2018-12-11 21:14 +0000
              Re: Big integers Bart <bc@freeuk.com> - 2018-12-10 14:56 +0000
                Re: Big integers Ike Naar <ike@iceland.freeshell.org> - 2018-12-10 17:46 +0000
                  Re: Big integers Bart <bc@freeuk.com> - 2018-12-10 18:24 +0000
                    Re: Big integers Thiago Adams <thiago.adams@gmail.com> - 2018-12-10 11:12 -0800
                      Re: Big integers Thiago Adams <thiago.adams@gmail.com> - 2018-12-10 11:23 -0800
                      Re: Big integers Bart <bc@freeuk.com> - 2018-12-10 21:44 +0000
                        Re: Big integers Thiago Adams <thiago.adams@gmail.com> - 2018-12-11 10:20 -0800
                          Re: Big integers "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2018-12-11 13:15 -0800
        Re: Big integers Keith Thompson <kst-u@mib.org> - 2018-12-08 12:14 -0800
          Re: Big integers David Brown <david.brown@hesbynett.no> - 2018-12-09 13:31 +0100
        Re: Big integers "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2018-12-08 15:52 -0800
    Re: Big integers Bart <bc@freeuk.com> - 2018-12-16 19:29 +0000
    Re: Big integers "Tristan B. Kildaire" <deavmi@disroot.org> - 2018-12-25 12:59 +0000
      Re: Big integers Bart <bc@freeuk.com> - 2018-12-25 15:54 +0000

Page 5 of 7 — ← Prev page 1 2 3 4 [5] 6 7  Next page →


#138675 — Re: Modules again

FromDavid Brown <david.brown@hesbynett.no>
Date2018-12-11 21:44 +0100
SubjectRe: Modules again
Message-ID<pup7kb$tpc$1@dont-email.me>
In reply to#138665
On 11/12/2018 17:59, Thiago Adams wrote:
> On Tuesday, December 11, 2018 at 11:45:38 AM UTC-2, David Brown wrote:
> ...
>> Namespaces, as found in C++, are a better solution than prefixes for
>> exported functions.  I would like namespaces to be added to C.  And I
>> would expect any large newer language to support a similar concept.
> 
> To include namespace, I think you must include name mangling.
> If you bring name mangling you can bring function overloading.
> If you bring function overloading you can bring... ...
> 

No, that is all unnecessary.

> One alternative would be to have some predefined name mangling
> like add "namespace_" as suffix.
> 

Yes, that is the simple and clear way to handle it.

Unfortunately that would conflict with existing legal naming (you can 
always have a normal identifier called "namespace_foo").  I can see 
three alternatives:

1. Have a standards-specified convention based on reserved identifiers, 
such as "_NS_namespace_foo".

2. Have implementation-specific naming, so that an implementation could 
use something like "namespace$$foo".

3. Use whatever C++ uses on that implementation, which would be 
convenient for interaction with C++ code and have the positive 
side-effect of banning non-prototype function declarations and giving 
link errors when you get the prototype and definition inconsistent.

[toc] | [prev] | [next] | [standalone]


#138667 — Re: Modules again

Fromscott@slp53.sl.home (Scott Lurndal)
Date2018-12-11 18:02 +0000
SubjectRe: Modules again
Message-ID<iZSPD.358363$X82.277912@fx22.iad>
In reply to#138663
On Tuesday, December 11, 2018 at 11:45:38 AM UTC-2, David Brown wrote:

> Namespaces, as found in C++, are a better solution than prefixes for
> exported functions.  I would like namespaces to be added to C.  And I
> would expect any large newer language to support a similar concept.

You know, C is a proper subset (for the most part) of C++, and you
are free to select and choose which C++ features you adopt if you use
a C++ compiler instead of C compiler to compile your code.

I've worked on two operating systems and a hypervisor that were written
primarily in C + classes.   But you could certainly just use C + namespaces
and leave the rest of your application in bog-standard C.

[toc] | [prev] | [next] | [standalone]


#138668 — Re: Modules again

FromThiago Adams <thiago.adams@gmail.com>
Date2018-12-11 10:10 -0800
SubjectRe: Modules again
Message-ID<2076d2e8-b381-47cc-9319-0f22850a548b@googlegroups.com>
In reply to#138667
On Tuesday, December 11, 2018 at 4:03:02 PM UTC-2, Scott Lurndal wrote:
> On Tuesday, December 11, 2018 at 11:45:38 AM UTC-2, David Brown wrote:
> 
> > Namespaces, as found in C++, are a better solution than prefixes for
> > exported functions.  I would like namespaces to be added to C.  And I
> > would expect any large newer language to support a similar concept.
> 
> You know, C is a proper subset (for the most part) of C++, and you
> are free to select and choose which C++ features you adopt if you use
> a C++ compiler instead of C compiler to compile your code.
> 
> I've worked on two operating systems and a hypervisor that were written
> primarily in C + classes.   But you could certainly just use C + namespaces
> and leave the rest of your application in bog-standard C.

But then you cannot use C features like compound literals,
variably types, initialization etc.

[toc] | [prev] | [next] | [standalone]


#138671 — Re: Modules again

Fromscott@slp53.sl.home (Scott Lurndal)
Date2018-12-11 18:54 +0000
SubjectRe: Modules again
Message-ID<oJTPD.240813$Ol2.19575@fx17.iad>
In reply to#138668
Thiago Adams <thiago.adams@gmail.com> writes:
>On Tuesday, December 11, 2018 at 4:03:02 PM UTC-2, Scott Lurndal wrote:
>> On Tuesday, December 11, 2018 at 11:45:38 AM UTC-2, David Brown wrote:
>> 
>> > Namespaces, as found in C++, are a better solution than prefixes for
>> > exported functions.  I would like namespaces to be added to C.  And I
>> > would expect any large newer language to support a similar concept.
>> 
>> You know, C is a proper subset (for the most part) of C++, and you
>> are free to select and choose which C++ features you adopt if you use
>> a C++ compiler instead of C compiler to compile your code.
>> 
>> I've worked on two operating systems and a hypervisor that were written
>> primarily in C + classes.   But you could certainly just use C + namespaces
>> and leave the rest of your application in bog-standard C.
>
>But then you cannot use C features like compound literals,
>variably types, initialization etc.

Depends on the compiler, doesn't it.  g++ most of them.

[toc] | [prev] | [next] | [standalone]


#138669 — Re: Modules again

FromLew Pitcher <lew.pitcher@digitalfreehold.ca>
Date2018-12-11 13:14 -0500
SubjectRe: Modules again
Message-ID<puoupo$14s$1@dont-email.me>
In reply to#138667
Scott Lurndal wrote:

> 
> On Tuesday, December 11, 2018 at 11:45:38 AM UTC-2, David Brown wrote:
> 
>> Namespaces, as found in C++, are a better solution than prefixes for
>> exported functions.  I would like namespaces to be added to C.  And I
>> would expect any large newer language to support a similar concept.
> 
> You know, C is a proper subset (for the most part) of C++, and you
> are free to select and choose which C++ features you adopt if you use
> a C++ compiler instead of C compiler to compile your code.
> 
> I've worked on two operating systems and a hypervisor that were written
> primarily in C + classes.   But you could certainly just use C +
> namespaces and leave the rest of your application in bog-standard C.

Ahhh, but then you wouldn't be writing an application in "C", now, would 
you?

Your application would rely on specific features of C++; features not found 
in C. So, you'd be writing a crippled C++ application, not a full-featured C 
application.

-- 
Lew Pitcher
"In Skills, We Trust"

[toc] | [prev] | [next] | [standalone]


#138672 — Re: Modules again

Fromscott@slp53.sl.home (Scott Lurndal)
Date2018-12-11 18:54 +0000
SubjectRe: Modules again
Message-ID<0KTPD.240814$Ol2.168534@fx17.iad>
In reply to#138669
Lew Pitcher <lew.pitcher@digitalfreehold.ca> writes:
>Scott Lurndal wrote:
>
>> 
>> On Tuesday, December 11, 2018 at 11:45:38 AM UTC-2, David Brown wrote:
>> 
>>> Namespaces, as found in C++, are a better solution than prefixes for
>>> exported functions.  I would like namespaces to be added to C.  And I
>>> would expect any large newer language to support a similar concept.
>> 
>> You know, C is a proper subset (for the most part) of C++, and you
>> are free to select and choose which C++ features you adopt if you use
>> a C++ compiler instead of C compiler to compile your code.
>> 
>> I've worked on two operating systems and a hypervisor that were written
>> primarily in C + classes.   But you could certainly just use C +
>> namespaces and leave the rest of your application in bog-standard C.
>
>Ahhh, but then you wouldn't be writing an application in "C", now, would 
>you?

Does it matter?

[toc] | [prev] | [next] | [standalone]


#138673 — Re: Modules again

FromLew Pitcher <lew.pitcher@digitalfreehold.ca>
Date2018-12-11 14:42 -0500
SubjectRe: Modules again
Message-ID<pup3us$3j3$1@dont-email.me>
In reply to#138672
Scott Lurndal wrote:

> Lew Pitcher <lew.pitcher@digitalfreehold.ca> writes:
>>Scott Lurndal wrote:
>>
>>> 
>>> On Tuesday, December 11, 2018 at 11:45:38 AM UTC-2, David Brown wrote:
>>> 
>>>> Namespaces, as found in C++, are a better solution than prefixes for
>>>> exported functions.  I would like namespaces to be added to C.  And I
>>>> would expect any large newer language to support a similar concept.
>>> 
>>> You know, C is a proper subset (for the most part) of C++, and you
>>> are free to select and choose which C++ features you adopt if you use
>>> a C++ compiler instead of C compiler to compile your code.
>>> 
>>> I've worked on two operating systems and a hypervisor that were written
>>> primarily in C + classes.   But you could certainly just use C +
>>> namespaces and leave the rest of your application in bog-standard C.
>>
>>Ahhh, but then you wouldn't be writing an application in "C", now, would
>>you?
> 
> Does it matter?

Yes, it does matter.

-- 
Lew Pitcher
"In Skills, We Trust"

[toc] | [prev] | [next] | [standalone]


#138677 — Re: Modules again

FromDavid Brown <david.brown@hesbynett.no>
Date2018-12-11 21:54 +0100
SubjectRe: Modules again
Message-ID<pup85u$i0$2@dont-email.me>
In reply to#138673
On 11/12/2018 20:42, Lew Pitcher wrote:
> Scott Lurndal wrote:
> 
>> Lew Pitcher <lew.pitcher@digitalfreehold.ca> writes:
>>> Scott Lurndal wrote:
>>>
>>>>
>>>> On Tuesday, December 11, 2018 at 11:45:38 AM UTC-2, David Brown wrote:
>>>>
>>>>> Namespaces, as found in C++, are a better solution than prefixes for
>>>>> exported functions.  I would like namespaces to be added to C.  And I
>>>>> would expect any large newer language to support a similar concept.
>>>>
>>>> You know, C is a proper subset (for the most part) of C++, and you
>>>> are free to select and choose which C++ features you adopt if you use
>>>> a C++ compiler instead of C compiler to compile your code.
>>>>
>>>> I've worked on two operating systems and a hypervisor that were written
>>>> primarily in C + classes.   But you could certainly just use C +
>>>> namespaces and leave the rest of your application in bog-standard C.
>>>
>>> Ahhh, but then you wouldn't be writing an application in "C", now, would
>>> you?
>>
>> Does it matter?
> 
> Yes, it does matter.
> 

Sometimes it matters - often it does not.  It is no different from using 
any other dialect of C, such as "gcc C" with its extensions - for some 
kinds of coding, such extensions are totally inappropriate.  For other 
types of coding, they are not only entirely reasonable but absolutely 
essential.

You need to be clear about the dialect or version of C you are using, 
that it is non-standard, and the tools and options needed to compile it. 
  But if the project is suitable, then there is no reason not to use it.


[toc] | [prev] | [next] | [standalone]


#138680 — Re: Modules again

FromKeith Thompson <kst-u@mib.org>
Date2018-12-11 14:53 -0800
SubjectRe: Modules again
Message-ID<lnftv3iskx.fsf@kst-u.example.com>
In reply to#138677
David Brown <david.brown@hesbynett.no> writes:
> On 11/12/2018 20:42, Lew Pitcher wrote:
>> Scott Lurndal wrote:
>>> Lew Pitcher <lew.pitcher@digitalfreehold.ca> writes:
>>>> Scott Lurndal wrote:
[...]
>>>>> I've worked on two operating systems and a hypervisor that were written
>>>>> primarily in C + classes.   But you could certainly just use C +
>>>>> namespaces and leave the rest of your application in bog-standard C.
>>>>
>>>> Ahhh, but then you wouldn't be writing an application in "C", now, would
>>>> you?
>>>
>>> Does it matter?
>> 
>> Yes, it does matter.
>
> Sometimes it matters - often it does not.  It is no different from using 
> any other dialect of C, such as "gcc C" with its extensions - for some 
> kinds of coding, such extensions are totally inappropriate.  For other 
> types of coding, they are not only entirely reasonable but absolutely 
> essential.
>
> You need to be clear about the dialect or version of C you are using, 
> that it is non-standard, and the tools and options needed to compile it. 
>   But if the project is suitable, then there is no reason not to use it.

If you're using some "dialect" of C (or of C++), your compiler
isn't going to warn you if you accidentally write something outside
that dialect.  If you can live with that, or if you can enforce the
restrictions using some other tool, that's fine, but it's a valid
reason not to try to use a subset of a language

-- 
Keith Thompson (The_Other_Keith) kst@mib.org  <http://www.ghoti.net/~kst>
Will write code for food.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

[toc] | [prev] | [next] | [standalone]


#138685 — Re: Modules again

FromDavid Brown <david.brown@hesbynett.no>
Date2018-12-12 08:24 +0100
SubjectRe: Modules again
Message-ID<puqd3v$ipg$1@dont-email.me>
In reply to#138680
On 11/12/2018 23:53, Keith Thompson wrote:
> David Brown <david.brown@hesbynett.no> writes:
>> On 11/12/2018 20:42, Lew Pitcher wrote:
>>> Scott Lurndal wrote:
>>>> Lew Pitcher <lew.pitcher@digitalfreehold.ca> writes:
>>>>> Scott Lurndal wrote:
> [...]
>>>>>> I've worked on two operating systems and a hypervisor that were written
>>>>>> primarily in C + classes.   But you could certainly just use C +
>>>>>> namespaces and leave the rest of your application in bog-standard C.
>>>>>
>>>>> Ahhh, but then you wouldn't be writing an application in "C", now, would
>>>>> you?
>>>>
>>>> Does it matter?
>>>
>>> Yes, it does matter.
>>
>> Sometimes it matters - often it does not.  It is no different from using
>> any other dialect of C, such as "gcc C" with its extensions - for some
>> kinds of coding, such extensions are totally inappropriate.  For other
>> types of coding, they are not only entirely reasonable but absolutely
>> essential.
>>
>> You need to be clear about the dialect or version of C you are using,
>> that it is non-standard, and the tools and options needed to compile it.
>>    But if the project is suitable, then there is no reason not to use it.
> 
> If you're using some "dialect" of C (or of C++), your compiler
> isn't going to warn you if you accidentally write something outside
> that dialect.  If you can live with that, or if you can enforce the
> restrictions using some other tool, that's fine, but it's a valid
> reason not to try to use a subset of a language
> 

That's certainly true for some dialects (such as "C with some features 
of C++") - you will be using a compiler in C++ mode, and that means any 
C++ code will be valid.  You might be able to enable some warnings on 
features for restrictions - with gcc, "-Wtemplates 
-Wmultiple-inheritance -fno-exceptions -fno-rtti" would be a start.  I 
already do something similar in C, such as disabling (by error message) 
non-prototype function declarations.

You would need additional checking mechanisms or style checkers to 
enforce all the rules for your preferred dialect - if indeed you are 
able to specify the rules tightly enough to allow automatic checking. 
But this applies to any kind of style guide or coding standard in C or 
C++.  The only difference is that in this hypothetical case, we are 
disallowing quite a large proportion of the base language (C++) - 
usually style guides only disallow a small proportion.


(For a dialect such as "gcc C", you get more complete checking - just 
choose "-std=gnu11" and the compiler will complain about anything 
outside it!)

Whatever dialect, style, or restrictions you have in your coding, it is 
important to think about how you can check that you are using it 
correctly.  And it is certainly a valid viewpoint to say that a rule 
that cannot be enforced, should not be used.

[toc] | [prev] | [next] | [standalone]


#138676 — Re: Modules again

FromDavid Brown <david.brown@hesbynett.no>
Date2018-12-11 21:51 +0100
SubjectRe: Modules again
Message-ID<pup7vs$i0$1@dont-email.me>
In reply to#138667
On 11/12/2018 19:02, Scott Lurndal wrote:
> On Tuesday, December 11, 2018 at 11:45:38 AM UTC-2, David Brown wrote:
> 
>> Namespaces, as found in C++, are a better solution than prefixes for
>> exported functions.  I would like namespaces to be added to C.  And I
>> would expect any large newer language to support a similar concept.
> 
> You know, C is a proper subset (for the most part) of C++, and you
> are free to select and choose which C++ features you adopt if you use
> a C++ compiler instead of C compiler to compile your code.

Yes, I realise that - and I agree it is a viable solution.

> 
> I've worked on two operating systems and a hypervisor that were written
> primarily in C + classes.   But you could certainly just use C + namespaces
> and leave the rest of your application in bog-standard C.
> 

Indeed.  There are definite advantages there if you want the simplicity 
and minimal object code of C (or almost C), while taking a few useful 
features from C++ (like namespaces and better const, and possibly simple 
class structures).  Compile with "-fno-exceptions -fno-rtti" (or 
equivalent flags for non-gcc compatibles) and avoid code from the C++ 
library, and the result will be as small as a pure C equivalent.  The 
code will not be valid C, but it should at least be easily understood by 
C programmers who do not know C++.

[toc] | [prev] | [next] | [standalone]


#138681 — Re: Modules again

Fromscott@slp53.sl.home (Scott Lurndal)
Date2018-12-11 23:24 +0000
SubjectRe: Modules again
Message-ID<KGXPD.442612$XG2.303074@fx16.iad>
In reply to#138676
David Brown <david.brown@hesbynett.no> writes:
>On 11/12/2018 19:02, Scott Lurndal wrote:
>> On Tuesday, December 11, 2018 at 11:45:38 AM UTC-2, David Brown wrote:
>> 
>>> Namespaces, as found in C++, are a better solution than prefixes for
>>> exported functions.  I would like namespaces to be added to C.  And I
>>> would expect any large newer language to support a similar concept.
>> 
>> You know, C is a proper subset (for the most part) of C++, and you
>> are free to select and choose which C++ features you adopt if you use
>> a C++ compiler instead of C compiler to compile your code.
>
>Yes, I realise that - and I agree it is a viable solution.
>
>> 
>> I've worked on two operating systems and a hypervisor that were written
>> primarily in C + classes.   But you could certainly just use C + namespaces
>> and leave the rest of your application in bog-standard C.
>> 
>
>Indeed.  There are definite advantages there if you want the simplicity 
>and minimal object code of C (or almost C), while taking a few useful 
>features from C++ (like namespaces and better const, and possibly simple 
>class structures).  Compile with "-fno-exceptions -fno-rtti" (or 
>equivalent flags for non-gcc compatibles) and avoid code from the C++ 
>library, and the result will be as small as a pure C equivalent.  The 
>code will not be valid C, but it should at least be easily understood by 
>C programmers who do not know C++.

All true, and we found it so.   At the beginning of the first OS (1989),
none of us knew C++.

[toc] | [prev] | [next] | [standalone]


#138682 — Re: Modules again

FromLew Pitcher <lew.pitcher@digitalfreehold.ca>
Date2018-12-11 18:44 -0500
SubjectRe: Modules again
Message-ID<pupi5a$t3e$1@dont-email.me>
In reply to#138681
Scott Lurndal wrote:
[snip]

> All true, and we found it so.   At the beginning of the first OS (1989),

Quote:
  "The first operating system used for real work was GM-NAA I/O, produced in
   1956 by General Motors' Research division for its IBM 704."

That's 33 years before your "first OS". And, GM-NAA IO wasn't the "first 
operating system" either, by about 10 years.

> none of us knew C++.

True. Because, in 1956, the programming language landscape didn't include 
even the immediate progenetors to C, let alone C's children.

-- 
Lew Pitcher
"In Skills, We Trust"

[toc] | [prev] | [next] | [standalone]


#138683 — Re: Modules again

FromLew Pitcher <lew.pitcher@digitalfreehold.ca>
Date2018-12-11 18:45 -0500
SubjectRe: Modules again
Message-ID<pupi78$t3e$2@dont-email.me>
In reply to#138682
Lew Pitcher wrote:

> Scott Lurndal wrote:
> [snip]
> 
>> All true, and we found it so.   At the beginning of the first OS (1989),
> 
> Quote:
>   "The first operating system used for real work was GM-NAA I/O, produced
>   in
>    1956 by General Motors' Research division for its IBM 704."
> 
> That's 33 years before your "first OS". And, GM-NAA IO wasn't the "first
> operating system" either, by about 10 years.

My mistake: GM-NAA IO wasn't the "first operating system" either, by about 
*5* years.


> 
>> none of us knew C++.
> 
> True. Because, in 1956, the programming language landscape didn't include
> even the immediate progenetors to C, let alone C's children.
> 


-- 
Lew Pitcher
"In Skills, We Trust"

[toc] | [prev] | [next] | [standalone]


#138684 — Re: Modules again

FromJorgen Grahn <grahn+nntp@snipabacken.se>
Date2018-12-12 06:39 +0000
SubjectRe: Modules again
Message-ID<slrnq11b9t.1p1h.grahn+nntp@frailea.sa.invalid>
In reply to#138682
On Tue, 2018-12-11, Lew Pitcher wrote:
> Scott Lurndal wrote:
> [snip]
>
>> All true, and we found it so.   At the beginning of the first OS (1989),
>
> Quote:
>   "The first operating system used for real work was GM-NAA I/O, produced in
>    1956 by General Motors' Research division for its IBM 704."
>
> That's 33 years before your "first OS". And, GM-NAA IO wasn't the "first 
> operating system" either, by about 10 years.

SL was writing about the first of two OSes /he helped develop/ -- that
was clear from context.

/Jorgen

-- 
  // Jorgen Grahn <grahn@  Oo  o.   .     .
\X/     snipabacken.se>   O  o   .

[toc] | [prev] | [next] | [standalone]


#138686 — Re: Modules again

FromJames Kuyper <jameskuyper@alumni.caltech.edu>
Date2018-12-12 07:59 -0500
SubjectRe: Modules again
Message-ID<pur0nc$tj0$1@dont-email.me>
In reply to#138684
On 12/12/18 01:39, Jorgen Grahn wrote:
> On Tue, 2018-12-11, Lew Pitcher wrote:
>> Scott Lurndal wrote:
>> [snip]
>>
>>> All true, and we found it so.   At the beginning of the first OS (1989),
>>
>> Quote:
>>   "The first operating system used for real work was GM-NAA I/O, produced in
>>    1956 by General Motors' Research division for its IBM 704."
>>
>> That's 33 years before your "first OS". And, GM-NAA IO wasn't the "first 
>> operating system" either, by about 10 years.
> 
> SL was writing about the first of two OSes /he helped develop/ -- that
> was clear from context.

I disagree - it was not clear. If you happened to know (as I did not)
that he had been involved in developing an OS, you might be able to
guess that he was referring to the first OS he had developed - but even
in that case he should have used different wording.

[toc] | [prev] | [next] | [standalone]


#138687 — Re: Modules again

Frommark.bluemel@gmail.com
Date2018-12-12 05:43 -0800
SubjectRe: Modules again
Message-ID<880cd5c7-913e-4e1b-9952-8fce9799eaf2@googlegroups.com>
In reply to#138686
On Wednesday, 12 December 2018 12:59:32 UTC, James Kuyper  wrote:
> On 12/12/18 01:39, Jorgen Grahn wrote:
> > On Tue, 2018-12-11, Lew Pitcher wrote:
> >> Scott Lurndal wrote:
> >> [snip]
> >>
> >>> All true, and we found it so.   At the beginning of the first OS (1989),
> >>
> >> Quote:
> >>   "The first operating system used for real work was GM-NAA I/O, produced in
> >>    1956 by General Motors' Research division for its IBM 704."
> >>
> >> That's 33 years before your "first OS". And, GM-NAA IO wasn't the "first 
> >> operating system" either, by about 10 years.
> > 
> > SL was writing about the first of two OSes /he helped develop/ -- that
> > was clear from context.
> 
> I disagree - it was not clear. If you happened to know (as I did not)
> that he had been involved in developing an OS, you might be able to
> guess that he was referring to the first OS he had developed - but even
> in that case he should have used different wording.

The context was clear, until Lew [snip]ped the vital information.

[toc] | [prev] | [next] | [standalone]


#138689 — Re: Modules again

Fromscott@slp53.sl.home (Scott Lurndal)
Date2018-12-12 14:20 +0000
SubjectRe: Modules again
Message-ID<yO8QD.963412$lM2.388767@fx39.iad>
In reply to#138686
James Kuyper <jameskuyper@alumni.caltech.edu> writes:
>On 12/12/18 01:39, Jorgen Grahn wrote:
>> On Tue, 2018-12-11, Lew Pitcher wrote:
>>> Scott Lurndal wrote:
>>> [snip]
>>>
>>>> All true, and we found it so.   At the beginning of the first OS (1989),
>>>
>>> Quote:
>>>   "The first operating system used for real work was GM-NAA I/O, produced in
>>>    1956 by General Motors' Research division for its IBM 704."
>>>
>>> That's 33 years before your "first OS". And, GM-NAA IO wasn't the "first 
>>> operating system" either, by about 10 years.
>> 
>> SL was writing about the first of two OSes /he helped develop/ -- that
>> was clear from context.
>
>I disagree - it was not clear. If you happened to know (as I did not)
>that he had been involved in developing an OS, you might be able to
>guess that he was referring to the first OS he had developed - but even
>in that case he should have used different wording.

It was right there in the article, to wit:

>> 
>> I've worked on two operating systems and a hypervisor that were written
>> primarily in C + classes.   But you could certainly just use C + namespaces
>> and leave the rest of your application in bog-standard C.
>> 
>
>Indeed.  There are definite advantages there if you want the simplicity 
>and minimal object code of C (or almost C), while taking a few useful 
>features from C++ (like namespaces and better const, and possibly simple 
>class structures).  Compile with "-fno-exceptions -fno-rtti" (or 
>equivalent flags for non-gcc compatibles) and avoid code from the C++ 
>library, and the result will be as small as a pure C equivalent.  The 
>code will not be valid C, but it should at least be easily understood by 
>C programmers who do not know C++.

All true, and we found it so.   At the beginning of the first OS (1989),
none of us knew C++.

[toc] | [prev] | [next] | [standalone]


#138691 — Re: Modules again

FromDavid Brown <david.brown@hesbynett.no>
Date2018-12-12 17:10 +0100
SubjectRe: Modules again
Message-ID<purbt9$5qg$1@dont-email.me>
In reply to#138686
On 12/12/18 13:59, James Kuyper wrote:
> On 12/12/18 01:39, Jorgen Grahn wrote:
>> On Tue, 2018-12-11, Lew Pitcher wrote:
>>> Scott Lurndal wrote:
>>> [snip]
>>>
>>>> All true, and we found it so.   At the beginning of the first OS (1989),
>>>
>>> Quote:
>>>   "The first operating system used for real work was GM-NAA I/O, produced in
>>>    1956 by General Motors' Research division for its IBM 704."
>>>
>>> That's 33 years before your "first OS". And, GM-NAA IO wasn't the "first 
>>> operating system" either, by about 10 years.
>>
>> SL was writing about the first of two OSes /he helped develop/ -- that
>> was clear from context.
> 
> I disagree - it was not clear. If you happened to know (as I did not)
> that he had been involved in developing an OS, you might be able to
> guess that he was referring to the first OS he had developed - but even
> in that case he should have used different wording.
> 

A few steps up in this thread, Scott wrote:

"""
I've worked on two operating systems and a hypervisor that were written
primarily in C + classes.   But you could certainly just use C +
namespaces and leave the rest of your application in bog-standard C.
"""

He kept that quotation in the post when he later wrote "At the beginning
of the first OS (1989), none of us knew C++".

The first mention in this thread of using C++ as a "C with a few extras"
was in the context of the operating systems that Scott had worked on.

No one (not even you, James) can be expected to remember the
achievements of all the regulars here, even when they have come up
before (Scott has mentioned his work before).  But in this case, the
context was clear, and the wording was clear.  I don't know why Lew
snipped half of Scott's post before replying to the other half out of
context - I guess sometimes people snip too much or fail to read
everything in a post.  I know I certainly do.

[toc] | [prev] | [next] | [standalone]


#138692 — Re: Modules again

FromJames Kuyper <jameskuyper@alumni.caltech.edu>
Date2018-12-12 13:39 -0800
SubjectRe: Modules again
Message-ID<946d61b2-086f-4535-aeb1-bdaf871c94b7@googlegroups.com>
In reply to#138691
On Wednesday, December 12, 2018 at 11:10:26 AM UTC-5, David Brown wrote:
> On 12/12/18 13:59, James Kuyper wrote:
> > On 12/12/18 01:39, Jorgen Grahn wrote:
> >> On Tue, 2018-12-11, Lew Pitcher wrote:
> >>> Scott Lurndal wrote:
> >>> [snip]
> >>>
> >>>> All true, and we found it so.   At the beginning of the first OS (1989),
...
> >> SL was writing about the first of two OSes /he helped develop/ -- that
> >> was clear from context.
> > 
> > I disagree - it was not clear. If you happened to know (as I did not)
> > that he had been involved in developing an OS, you might be able to
> > guess that he was referring to the first OS he had developed - but even
> > in that case he should have used different wording.
> > 
> 
> A few steps up in this thread, Scott wrote:
> 
> """
> I've worked on two operating systems and a hypervisor that were written
> primarily in C + classes.   But you could certainly just use C +
> namespaces and leave the rest of your application in bog-standard C.
> """
> 
> He kept that quotation in the post when he later wrote "At the beginning
> of the first OS (1989), none of us knew C++".
> 
> The first mention in this thread of using C++ as a "C with a few extras"
> was in the context of the operating systems that Scott had worked on.
> 
> No one (not even you, James) can be expected to remember the
> achievements of all the regulars here, ...

I've never claimed to have an exceptionally reliable memory - quite the
contrary, in fact. I've found some particular things extraordinarily
easy to remember, such as my wife's phone number, license plate number,
birth date, and social security number, all of which I memorized
immediately after I first learned them. But I've always had other things
I couldn't remember 3 minutes after hearing them. And lately my memory's
become noticeably less reliable.

> ... even when they have come up
> before (Scott has mentioned his work before).  But in this case, the
> context was clear, and the wording was clear.  I don't know why Lew
> snipped half of Scott's post before replying to the other half out of
> context - I guess sometimes people snip too much or fail to read
> everything in a post.  I know I certainly do.

And I did, too. My best guess is that I read only Scott's new text and
Lew's text that he was responding to, ignoring earlier text, since I had
already read it in the previous message. But by that point I'd forgotten
that he'd mentioned creating operating systems in the earlier message -
it wasn't a point of interest to me when I read it. That's very typical
of how I read usenet messages.

When I tried to figure out what "OS" was referring to, I searched only
for preceding occurrences of "OS" - it didn't occur to me that he would
have said "OS" in one post and "operating system" in a previous post.

[toc] | [prev] | [next] | [standalone]


Page 5 of 7 — ← Prev page 1 2 3 4 [5] 6 7  Next page →

Back to top | Article view | comp.lang.c


csiph-web