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


Groups > comp.lang.c > #159246

Re: STC - A "Standard Template Containers" library for C, similar to STL

From Manfred <noname@add.invalid>
Newsgroups comp.lang.c
Subject Re: STC - A "Standard Template Containers" library for C, similar to STL
Date 2021-03-08 18:53 +0100
Organization Aioe.org NNTP Server
Message-ID <s25oa2$ral$1@gioia.aioe.org> (permalink)
References (2 earlier) <s1qf4d$3td$1@dont-email.me> <a27c5551-71cf-4c2f-b1d9-abc230f0c8a3n@googlegroups.com> <s24van$q4i$1@dont-email.me> <e408f2db-2e39-4b81-8beb-307dea578e72n@googlegroups.com> <s25bpu$jhc$1@dont-email.me>

Show all headers | View raw


On 3/8/2021 3:19 PM, David Brown wrote:
> On 08/03/2021 14:36, tylo wrote:
>> Ok, last post from me for now because of time:
>> mandag 8. mars 2021 kl. 11:46:57 UTC+1 skrev David Brown:

>>> /If/ you can get your library into common use, then your arguments
>>> hold - until then, the opposite is true. This is the reality of the
>>>   situation, unfortunate and unfair though it might seem.
>>
>> I accept this. I don't think it is unfair, but admit it may feel like
>> casting pearls before swines, because people will continue to hold
>> back the C language by either avoiding such containers, or making
>> their own poor versions of them, and to program even high-level
>> abstractions as it was low-level details. I think this  eventually
>> will result in that C becomes a marginal language, unfortunately.
>>
> 
> I also think that C will become a marginal language.  But I think it
> /should/ become a marginal language.  I think C is the wrong choice for
> a great deal of code that is written in C at the moment.  C has its
> place - in some kinds of systems code, in some low-level portable
> libraries, in very small embedded systems, and as a common denominator
> as an interface between libraries and programs written in different
> languages.  In my view, its use for applications is in the past.  If you
> need a container structure beyond what you can easily put together
> yourself, and it is not so specialised that you /need/ to create it
> yourself, then you should be questioning if C is the right choice of
> language for the task.  (I don't want to be too general here -
> /sometimes/ it will be the right choice.)

Define marginal. But before that how do you classify server code? 
Application or system? I think it is best a class on its own, and we all 
know there's a lot of it written in C - and, as far as I have seen, with 
good results, meaning that C is the right choice for the task.
For interactive applications I agree that since the last few decades 
better choices than C are available.

Defining marginal.
If you mean with respect to the number of programs being /written/, then 
I agree with you.
With respect to the amount of code that is or will be /run/, then, 
irrespective of the fact this may be code that has already been written, 
I don't think C is likely to become marginal any time soon.

> 
> Often you see questions about "how to I write a C program that does some
> analysis and manipulation of text files?"  To me, you first have to ask
> "Is this a task to help me learn advanced C programming?  Or is this the
> kind of challenge I think is fun?"  If the answer to these questions is
> no, then the answer to the first one is "You don't write it in C.  You
> write it in Python.  Your code will be much shorter, simpler, clearer,
> far more likely to be correct, and will probably run faster with any
> samples that are big enough for speed to matter."
> 
> 
>>> Static linkage is good if the code is only used within one
>>> translation unit (i.e., one C file, unless you are doing something
>>> really weird). If you are using the same container structures, or
>>> the same functions, in different C files then you will end up with
>>> a lot of code bloat. (Whether or not code bloat is an issue depends
>>> on the application. But since you mentioned embedded systems, it
>>> can certainly be an issue on some small systems.)
>>>
>>> C does not have a good solution for this. Some C toolchains can be
>>>   helpful, if you pick the right options, allowing the compiler and
>>> linker to cooperate on merging duplicate code sections and
>>> eliminated sections that are not actually used.
>>>
>>> To get better, you need to move to C++, where templates and
>>> "inline" give you better control of code duplication.
>>
>> STC will by default generate static or inline methods, but if you
>> globally define STC_HEADER, the files only expose the API (like
>> traditional headers), and you must create one c-file with #define
>> STD_IMPLEMENTATION before including and declaring all your containers
>> you use in your app (by the using_.. macros). I totally accept that
>> this is simpler in C++, but this should be managable in C as well.
>>
> 

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


Thread

STC - A "Standard Template Containers" library for C, similar to STL tylo <tylovset@gmail.com> - 2021-03-03 07:16 -0800
  Re: STC - A "Standard Template Containers" library for C, similar to STL Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-03-03 21:36 +0000
    Re: STC - A "Standard Template Containers" library for C, similar to STL "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-03-03 20:49 -0800
  Re: STC - A "Standard Template Containers" library for C, similar to STL "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-03-03 13:50 -0800
    Re: STC - A "Standard Template Containers" library for C, similar to STL "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-03-03 13:56 -0800
  Re: STC - A "Standard Template Containers" library for C, similar to STL John Dill <jadill33@gmail.com> - 2021-03-03 14:17 -0800
    Re: STC - A "Standard Template Containers" library for C, similar to STL olcott <NoOne@NoWhere.com> - 2021-03-03 16:21 -0600
      Re: STC - A "Standard Template Containers" library for C, similar to STL Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-03-03 22:45 +0000
        Re: STC - A "Standard Template Containers" library for C, similar to STL olcott <NoOne@NoWhere.com> - 2021-03-03 17:21 -0600
      Re: STC - A "Standard Template Containers" library for C, similar to STL John Dill <jadill33@gmail.com> - 2021-03-03 15:05 -0800
        Re: STC - A "Standard Template Containers" library for C, similar to STL olcott <NoOne@NoWhere.com> - 2021-03-03 17:28 -0600
  Re: STC - A "Standard Template Containers" library for C, similar to STL "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-03-03 20:44 -0800
    Re: STC - A "Standard Template Containers" library for C, similar to STL "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-03-03 20:45 -0800
  Re: STC - A "Standard Template Containers" library for C, similar to STL jacobnavia <jacob@jacob.remcomp.fr> - 2021-03-04 10:16 +0100
    Re: STC - A "Standard Template Containers" library for C, similar to STL David Brown <david.brown@hesbynett.no> - 2021-03-04 12:09 +0100
      Re: STC - A "Standard Template Containers" library for C, similar to STL Bart <bc@freeuk.com> - 2021-03-04 12:00 +0000
        Re: STC - A "Standard Template Containers" library for C, similar to STL David Brown <david.brown@hesbynett.no> - 2021-03-04 14:15 +0100
          Re: STC - A "Standard Template Containers" library for C, similar to STL tylo <tylovset@gmail.com> - 2021-03-07 14:51 -0800
      Re: STC - A "Standard Template Containers" library for C, similar to STL Anton Shepelev <anton.txt@g{oogle}mail.com> - 2021-03-04 19:19 +0300
        Re: STC - A "Standard Template Containers" library for C, similar to STL Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2021-03-04 11:41 -0800
      Re: STC - A "Standard Template Containers" library for C, similar to STL Ian Collins <ian-news@hotmail.com> - 2021-03-05 10:19 +1300
      Re: STC - A "Standard Template Containers" library for C, similar to STL tylo <tylovset@gmail.com> - 2021-03-08 00:23 -0800
        Re: STC - A "Standard Template Containers" library for C, similar to STL David Brown <david.brown@hesbynett.no> - 2021-03-08 11:46 +0100
          Re: STC - A "Standard Template Containers" library for C, similar to STL tylo <tylovset@gmail.com> - 2021-03-08 05:36 -0800
            Re: STC - A "Standard Template Containers" library for C, similar to STL David Brown <david.brown@hesbynett.no> - 2021-03-08 15:19 +0100
              Re: STC - A "Standard Template Containers" library for C, similar to STL tylo <tylovset@gmail.com> - 2021-03-08 08:23 -0800
              Re: STC - A "Standard Template Containers" library for C, similar to STL Manfred <noname@add.invalid> - 2021-03-08 18:53 +0100
                Re: STC - A "Standard Template Containers" library for C, similar to STL David Brown <david.brown@hesbynett.no> - 2021-03-08 20:01 +0100
                Re: STC - A "Standard Template Containers" library for C, similar to STL Manfred <noname@add.invalid> - 2021-03-09 17:16 +0100
                Re: STC - A "Standard Template Containers" library for C, similar to STL David Brown <david.brown@hesbynett.no> - 2021-03-09 17:55 +0100
                Re: STC - A "Standard Template Containers" library for C, similar to STL Kaz Kylheku <563-365-8930@kylheku.com> - 2021-03-09 17:19 +0000
                Re: STC - A "Standard Template Containers" library for C, similar to STL David Brown <david.brown@hesbynett.no> - 2021-03-09 19:58 +0100
                Re: STC - A "Standard Template Containers" library for C, similar to STL Manfred <noname@add.invalid> - 2021-03-09 18:42 +0100
                Re: STC - A "Standard Template Containers" library for C, similar to STL "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-03-08 17:41 -0800
                Re: STC - A "Standard Template Containers" library for C, similar to STL "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-03-08 17:45 -0800
    Re: STC - A "Standard Template Containers" library for C, similar to STL Eli the Bearded <*@eli.users.panix.com> - 2021-03-04 18:46 +0000
    Re: STC - A "Standard Template Containers" library for C, similar to STL "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-03-04 23:35 -0800
  Re: STC - A "Standard Template Containers" library for C, similar to STL "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-03-08 17:05 -0800
    Re: STC - A "Standard Template Containers" library for C, similar to STL "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-03-08 17:18 -0800
      Re: STC - A "Standard Template Containers" library for C, similar to STL tylo <tylovset@gmail.com> - 2021-03-16 14:49 -0700
    Re: STC - A "Standard Template Containers" library for C, similar to STL Siri Cruise <chine.bleu@yahoo.com> - 2021-03-09 21:25 -0800

csiph-web