Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Chemistry professors never die, they just fail to react.


devel / comp.lang.c / Re: you think rust may *DE*throne c?

SubjectAuthor
* you think rust may outthrone c?fir
`* Re: you think rust may outthrone c?Blue-Maned_Hawk
 +- Re: you think rust may outthrone c?jak
 +* Re: you think rust may outthrone c?fir
 |`- Re: you think rust may outthrone c?fir
 +* Re: you think rust may outthrone c?rek2 hispagatos
 |`* Re: you think rust may outthrone c?Kaz Kylheku
 | `* Re: you think rust may outthrone c?Kalevi Kolttonen
 |  +* Re: you think rust may outthrone c?Scott Lurndal
 |  |`* Re: you think rust may outthrone c?Kalevi Kolttonen
 |  | +- Re: you think rust may outthrone c?Kaz Kylheku
 |  | +* Re: you think rust may outthrone c?Bart
 |  | |`* Re: you think rust may outthrone c?Kalevi Kolttonen
 |  | | +* Re: you think rust may outthrone c?Bart
 |  | | |+* Re: you think rust may outthrone c?Kalevi Kolttonen
 |  | | ||`* Re: you think rust may outthrone c?Kaz Kylheku
 |  | | || `- Re: you think rust may outthrone c?Kalevi Kolttonen
 |  | | |`* Re: you think rust may outthrone c?David Brown
 |  | | | `* Re: you think rust may outthrone c?Kalevi Kolttonen
 |  | | |  +* Re: you think rust may outthrone c?David Brown
 |  | | |  |`* Re: you think rust may outthrone c?Kaz Kylheku
 |  | | |  | `- Re: you think rust may outthrone c?Kalevi Kolttonen
 |  | | |  `* Re: you think rust may outthrone c?Kaz Kylheku
 |  | | |   `* Re: you think rust may outthrone c?Kalevi Kolttonen
 |  | | |    `* Re: you think rust may outthrone c?David Brown
 |  | | |     +* Re: you think rust may outthrone c?Scott Lurndal
 |  | | |     |`- Re: you think rust may outthrone c?Keith Thompson
 |  | | |     `* Re: you think rust may outthrone c?Keith Thompson
 |  | | |      +- Re: you think rust may outthrone c?David Brown
 |  | | |      `* Re: you think rust may outthrone c?Malcolm McLean
 |  | | |       `* Re: you think rust may outthrone c?David Brown
 |  | | |        `* Re: you think rust may outthrone c?Malcolm McLean
 |  | | |         `* Re: you think rust may outthrone c?David Brown
 |  | | |          +- Re: you think rust may outthrone c?fir
 |  | | |          +* Re: you think rust may outthrone c?fir
 |  | | |          |`* Re: you think rust may outthrone c?fir
 |  | | |          | `- Re: you think rust may outthrone c?fir
 |  | | |          `* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |           `* Re: you think rust may outthrone c?Bart
 |  | | |            +* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |            |`* Re: you think rust may outthrone c?Malcolm McLean
 |  | | |            | +* Re: you think rust may outthrone c?David Brown
 |  | | |            | |+* Re: you think rust may outthrone c?Malcolm McLean
 |  | | |            | ||+* Re: you think rust may outthrone c?David Brown
 |  | | |            | |||+* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |            | ||||`* Re: you think rust may outthrone c?Tim Rentsch
 |  | | |            | |||| `- Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |            | |||`* Re: you think rust may outthrone c?Bart
 |  | | |            | ||| +- Re: you think rust may outthrone c?Malcolm McLean
 |  | | |            | ||| `- Re: you think rust may outthrone c?David Brown
 |  | | |            | ||`- Re: you think rust may outthrone c?Scott Lurndal
 |  | | |            | |`* Re: you think rust may outthrone c?Kaz Kylheku
 |  | | |            | | +- Re: you think rust may outthrone c?David Brown
 |  | | |            | | `* Re: you think rust may outthrone c?jak
 |  | | |            | |  `* Re: you think rust may outthrone c?Kaz Kylheku
 |  | | |            | |   +- Re: you think rust may outthrone c?jak
 |  | | |            | |   `- Re: you think rust may outthrone c?Tim Rentsch
 |  | | |            | `* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |            |  `* Re: you think rust may outthrone c?Malcolm McLean
 |  | | |            |   +- Re: you think rust may outthrone c?David Brown
 |  | | |            |   `- Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |            `* Re: you think rust may outthrone c?David Brown
 |  | | |             `* Re: you think rust may outthrone c?fir
 |  | | |              +* Re: you think rust may outthrone c?Chris M. Thomasson
 |  | | |              |`* Re: you think rust may outthrone c?David Brown
 |  | | |              | +* Re: you think rust may outthrone c?Chris M. Thomasson
 |  | | |              | |+* Re: you think rust may outthrone c?Chris M. Thomasson
 |  | | |              | ||+- Re: you think rust may outthrone c?Chris M. Thomasson
 |  | | |              | ||+* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |              | |||`- Re: you think rust may outthrone c?Chris M. Thomasson
 |  | | |              | ||`- Re: you think rust may outthrone c?fir
 |  | | |              | |`- Re: you think rust may outthrone c?Bart
 |  | | |              | `- Re: you think rust may outthrone c?Chris M. Thomasson
 |  | | |              `* Re: you think rust may outthrone c?fir
 |  | | |               `* Re: you think rust may outthrone c?Bart
 |  | | |                +* Re: you think rust may outthrone c?Keith Thompson
 |  | | |                |+* Re: you think rust may outthrone c?Bart
 |  | | |                ||+* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |                |||`* Re: you think rust may outthrone c?Bart
 |  | | |                ||| +- Re: you think rust may outthrone c?Kaz Kylheku
 |  | | |                ||| +* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |                ||| |+* Re: you think rust may outthrone c?David Brown
 |  | | |                ||| ||+- Re: you think rust may outthrone c?Bart
 |  | | |                ||| ||`* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |                ||| || `* Re: you think rust may outthrone c?David Brown
 |  | | |                ||| ||  `* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |                ||| ||   +* Re: you think rust may outthrone c?David Brown
 |  | | |                ||| ||   |`* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |                ||| ||   | `* Re: you think rust may outthrone c?David Brown
 |  | | |                ||| ||   |  `- Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |                ||| ||   `* Re: you think rust may outthrone c?Kaz Kylheku
 |  | | |                ||| ||    `- Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |                ||| |+* Re: you think rust may outthrone c?Bart
 |  | | |                ||| ||+* Re: you think rust may outthrone c?Ike Naar
 |  | | |                ||| |||`- Re: you think rust may outthrone c?Bart
 |  | | |                ||| ||+* Re: you think rust may outthrone c?David Brown
 |  | | |                ||| |||`* Re: you think rust may outthrone c?Bart
 |  | | |                ||| ||| `- Re: you think rust may outthrone c?David Brown
 |  | | |                ||| ||`* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |                ||| || +- Re: you think rust may outthrone c?Kaz Kylheku
 |  | | |                ||| || +* Re: you think rust may outthrone c?Malcolm McLean
 |  | | |                ||| || `* Re: you think rust may outthrone c?Bart
 |  | | |                ||| |`* Re: you think rust may outthrone c?Scott Lurndal
 |  | | |                ||| `* Re: you think rust may outthrone c?Keith Thompson
 |  | | |                ||`- Re: you think rust may outthrone c?Keith Thompson
 |  | | |                |`* Re: you think rust may outthrone c?Kaz Kylheku
 |  | | |                `* Re: you think rust may outthrone c?fir
 |  | | +* Yeah, C is harder than many programming languages. Your point? (Was: you think Kenny McCormack
 |  | | +* Re: you think rust may outthrone c?Po Lu
 |  | | `* Re: you think rust may outthrone c?Kaz Kylheku
 |  | +* Re: you think rust may outthrone c?David Brown
 |  | `- Re: you think rust may outthrone c?Po Lu
 |  `* Re: you think rust may outthrone c?Anton Shepelev
 `* Re: you think rust may outthrone c?Bonita Montero

Pages:123456789101112131415161718192021222324252627282930313233343536373839
Re: you think rust may outthrone c?

<86bkg4ukic.fsf@linuxsc.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26467&group=comp.lang.c#26467

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Sat, 22 Jul 2023 06:46:19 -0700
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <86bkg4ukic.fsf@linuxsc.com>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com> <UpYrM.257503$W7d4.2562@fx18.iad> <u8pmt9$3o80g$1@dont-email.me> <u8q0q4$3p89v$1@dont-email.me> <u8qqpv$3v3pg$1@dont-email.me> <s3ma5vyveo9.fsf@yahoo.com> <u8rhrs$1b2m$1@dont-email.me> <20230714140259.603@kylheku.com> <u8si9j$53qt$1@dont-email.me> <875y6myurr.fsf@nosuchdomain.example.com> <u8sjqj$57ab$1@dont-email.me> <u8u45v$cscl$2@dont-email.me> <u8u4vf$cuu1$1@dont-email.me> <u8uihh$ediv$2@dont-email.me> <u8ul00$ekod$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: dont-email.me; posting-host="c20a25be915291dc36b638c24dc060a9";
logging-data="4029631"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+4h+Was0f/yKbrFUhC/SGaOFG1y2oPZus="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:GT9igEk//XceXhO1q7EDy/LeekU=
sha1:v/G5iwp8YSpr+KBPTIt4s2gPMNI=
 by: Tim Rentsch - Sat, 22 Jul 2023 13:46 UTC

kalevi@kolttonen.fi (Kalevi Kolttonen) writes:

> In other words, I did not know that the implementations
> can "override" UB (i.e. UB according to C stardard) and
> turn it into Implementation Defined behavior.

The phrasing here is somewhat incorrect. Undefined behavior
is a specification, not a state of being. If a particular
construct is specified in the C standard as being undefined
behavior, it is still undefined behavior even if there is an
extension (documented by an implementation of interest) that
gives the construct a well-defined semantics in that
implementation.

Similarly, implementation-defined behavior is a specification,
not a state of being. Any constructs stated in the C standard
to have ID behavior are always implementation defined, but no
others are, and there is nothing an implementation can do to
change that. I suggest using "implementation specific", a
term not defined by the C standard, to refer to behavior that
a given implementation specifies but is not (or might not be)
implementation defined.

> That kind of ignorance is not something to be proud of.

Neither is it something to be ashamed of. We were all
beginners once, even with a long history of programming
experience. I didn't take an active interest in the ISO C
standard for a decade or so after it was first ratified,
because it wasn't relevant to what I was doing at the
time. Moreover the terminology used in the C standard
is rather unintuitive, or even counter-intuitive, in some
cases, so some level of misunderstanding isn't surprising.

Re: you think rust may outthrone c?

<u9gmvs$3r01u$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26468&group=comp.lang.c#26468

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bc...@freeuk.com (Bart)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Sat, 22 Jul 2023 14:53:01 +0100
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <u9gmvs$3r01u$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u8o2jf$3isv1$1@bluemanedhawk.eternal-september.org>
<u93q47$19p2n$1@dont-email.me>
<u95q1j$1k1sq$1@bluemanedhawk.eternal-september.org>
<u991ot$27egh$2@dont-email.me>
<u99qru$2brfo$1@bluemanedhawk.eternal-september.org>
<u9atgg$2ku7m$2@dont-email.me>
<u9bafs$2n7dq$1@bluemanedhawk.eternal-september.org>
<u9bg5f$2o9ci$1@dont-email.me> <u9bs1u$2qj43$1@dont-email.me>
<u9d79c$34qp8$1@bluemanedhawk.eternal-september.org>
<u9dcb1$35gmv$1@dont-email.me>
<u9fpi9$3msci$1@bluemanedhawk.eternal-september.org>
<u9gjsn$3qfeq$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 22 Jul 2023 13:53:01 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e56898821d7c0219e079c4f94d2335de";
logging-data="4030526"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19RNumkYvoWn6th/ddcsjT4Mhxid6UmKQA="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:PtBsxWglm6HneQ7MBm/6eNTnOI4=
In-Reply-To: <u9gjsn$3qfeq$2@dont-email.me>
 by: Bart - Sat, 22 Jul 2023 13:53 UTC

On 22/07/2023 14:00, Bonita Montero wrote:
> Am 22.07.2023 um 07:30 schrieb Blue-Maned_Hawk:
>> On 7/21/23 03:32, Bonita Montero wrote:
>>> <snip />
>>>
>>> If you're know C++ halfway you're multiple times faster than
>>> with C, where you have to deal with every details yourself.
>>
>> Okay, where's your evidence for that?
>
> Show me the C-code for that:
>
> vector<string> vs;
>
> void fn( char const *str )
> {
>     vs.emplace_back( str );
> }
>
> Thats just an example how convenient the STL is. Imagine what effort
> you need to do the exponential growth of the vector yoursel. And you
> don't need to deal with the errors of emplace_back where they happen,
> but just catch bad_alloc some call levels above.
> C++ is full of such convenient features which make a lot of work in C.

If you going to use a function anyway, and not special syntax like vs +=
str, then you can emulate this in C easily. Sure you need a few dozen
lines of code, but how big is the STL that you'd need to compile into
every program.

Re: you think rust may outthrone c?

<0ffc9f99-3451-4be9-93c1-52fee91f12e2n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26469&group=comp.lang.c#26469

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:11c4:b0:405:4376:fed5 with SMTP id n4-20020a05622a11c400b004054376fed5mr12778qtk.3.1690035047484;
Sat, 22 Jul 2023 07:10:47 -0700 (PDT)
X-Received: by 2002:a05:6808:1292:b0:3a1:dd24:5ac6 with SMTP id
a18-20020a056808129200b003a1dd245ac6mr10089307oiw.11.1690035047181; Sat, 22
Jul 2023 07:10:47 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sat, 22 Jul 2023 07:10:46 -0700 (PDT)
In-Reply-To: <u9gjne$3qfeq$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.226; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.226
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u8o2jf$3isv1$1@bluemanedhawk.eternal-september.org> <u93q47$19p2n$1@dont-email.me>
<u95q1j$1k1sq$1@bluemanedhawk.eternal-september.org> <u991ot$27egh$2@dont-email.me>
<u99qru$2brfo$1@bluemanedhawk.eternal-september.org> <u9atgg$2ku7m$2@dont-email.me>
<u9bafs$2n7dq$1@bluemanedhawk.eternal-september.org> <u9bg5f$2o9ci$1@dont-email.me>
<u9bs1u$2qj43$1@dont-email.me> <u9d79c$34qp8$1@bluemanedhawk.eternal-september.org>
<u9dcb1$35gmv$1@dont-email.me> <94f31ccb-c536-4262-881a-207edc53139dn@googlegroups.com>
<u9gjne$3qfeq$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0ffc9f99-3451-4be9-93c1-52fee91f12e2n@googlegroups.com>
Subject: Re: you think rust may outthrone c?
From: profesor...@gmail.com (fir)
Injection-Date: Sat, 22 Jul 2023 14:10:47 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3375
 by: fir - Sat, 22 Jul 2023 14:10 UTC

sobota, 22 lipca 2023 o 14:57:32 UTC+2 Bonita Montero napisał(a):
> Am 21.07.2023 um 15:06 schrieb fir:
>
> > that is what you belive... but i think you dont know c ...
>
> I've been programming C when I guess that you didn't exist.
> > in c you dont need to deal with every detail ..
> Of course you neeed. You'd have to do anything manually the
> STL does or you. People don't use anything comparable in C
> since C doesn't has the features to be as covenient with
> that like with C++. Real OOP, RAII and exceptions make the
> life much easier.

writing a container in c which i better than vector for me is a metter of few lines of code

for example my container for bullets in game

void AddBullet(float x,float y, float angle,
float vspeed, int life, unsigned color, int type, int owner, float power)
{ static int index = 0;

bullet[index].x = x;
bullet[index].y = y;
bullet[index].enabled = 1;
bullet[index].angle = angle;
bullet[index].life = life;//life;
bullet[index].v = vspeed ;
bullet[index].type = type ;
bullet[index].owner = owner ;
bullet[index].power = power ;
bullet[index].color = color ;

for(int i=0; i<bullet_max;i++)
{
index++; if(index>=bullet_max) index-=bullet_max;
if(bullet[index].enabled==0) return;
}

ERROR_("Out OF Space in bullet[]");
}

this is for static allocated array where you may add and deleta things dynamically with addiionel few lines you make it dynamically resizable - but the static is often okay

and that is about your mythical blabling about advantages of crappy designed pony++

Re: you think rust may outthrone c?

<874ebd85-84f6-4959-9ee1-6afd810a5d7dn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26470&group=comp.lang.c#26470

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:3acc:b0:762:4ec5:9a17 with SMTP id ss12-20020a05620a3acc00b007624ec59a17mr11569qkn.12.1690035542382;
Sat, 22 Jul 2023 07:19:02 -0700 (PDT)
X-Received: by 2002:a05:6830:81:b0:6b7:4d84:ce4d with SMTP id
a1-20020a056830008100b006b74d84ce4dmr3101673oto.1.1690035542151; Sat, 22 Jul
2023 07:19:02 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sat, 22 Jul 2023 07:19:01 -0700 (PDT)
In-Reply-To: <u9gjsn$3qfeq$2@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.226; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.226
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u8o2jf$3isv1$1@bluemanedhawk.eternal-september.org> <u93q47$19p2n$1@dont-email.me>
<u95q1j$1k1sq$1@bluemanedhawk.eternal-september.org> <u991ot$27egh$2@dont-email.me>
<u99qru$2brfo$1@bluemanedhawk.eternal-september.org> <u9atgg$2ku7m$2@dont-email.me>
<u9bafs$2n7dq$1@bluemanedhawk.eternal-september.org> <u9bg5f$2o9ci$1@dont-email.me>
<u9bs1u$2qj43$1@dont-email.me> <u9d79c$34qp8$1@bluemanedhawk.eternal-september.org>
<u9dcb1$35gmv$1@dont-email.me> <u9fpi9$3msci$1@bluemanedhawk.eternal-september.org>
<u9gjsn$3qfeq$2@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <874ebd85-84f6-4959-9ee1-6afd810a5d7dn@googlegroups.com>
Subject: Re: you think rust may outthrone c?
From: profesor...@gmail.com (fir)
Injection-Date: Sat, 22 Jul 2023 14:19:02 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3648
 by: fir - Sat, 22 Jul 2023 14:19 UTC

sobota, 22 lipca 2023 o 15:00:22 UTC+2 Bonita Montero napisał(a):
> Am 22.07.2023 um 07:30 schrieb Blue-Maned_Hawk:
> > On 7/21/23 03:32, Bonita Montero wrote:
> >> <snip />
> >>
> >> If you're know C++ halfway you're multiple times faster than
> >> with C, where you have to deal with every details yourself.
> >
> > Okay, where's your evidence for that?
> Show me the C-code for that:
>
> vector<string> vs;
>
> void fn( char const *str )
> {
> vs.emplace_back( str );
> }
>
> Thats just an example how convenient the STL is. Imagine what effort
> you need to do the exponential growth of the vector yoursel. And you
> don't need to deal with the errors of emplace_back where they happen,
> but just catch bad_alloc some call levels above.
> C++ is full of such convenient features which make a lot of work in C.

i dont know what is emplace back and what you mean exponentiol growth
but something like vector in c you do

struct ExpressionList { int x; int y; unsigned long long tag;};
static ExpressionList* expression_list1 = NULL;
static int expression_list1_size = 0;

void expression_list1_AddOne(int i, int j)
{
expression_list1_size++;
expression_list1 = (ExpressionList*) realloc(expression_list1, expression_list1_size * sizeof(ExpressionList) );
expression_list1[expression_list1_size-1] = {i,j};
return ;
}

if you dont want you might not call reallock by evary add but realoock by *1.5 or bby +1000 or what you
need - but in fact the reallock casches it itself and did not do the reallock by one only really rare so this
reallock called each time is practically near zero cost so its quite okay to call it by one
(add flag enabled to mark record as deleted and some increment cursor code to find empty ones and you got
terribly good and fast container suited for your needs)

Re: you think rust may outthrone c?

<00a98f7c-9f3d-4d86-94e3-3932061832dbn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26471&group=comp.lang.c#26471

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a37:5881:0:b0:767:16e2:7c94 with SMTP id m123-20020a375881000000b0076716e27c94mr11196qkb.8.1690035724883;
Sat, 22 Jul 2023 07:22:04 -0700 (PDT)
X-Received: by 2002:a05:6870:5a99:b0:1ba:5bdd:c8ac with SMTP id
dt25-20020a0568705a9900b001ba5bddc8acmr6061058oab.7.1690035724585; Sat, 22
Jul 2023 07:22:04 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sat, 22 Jul 2023 07:22:04 -0700 (PDT)
In-Reply-To: <u9gmvs$3r01u$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.226; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.226
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u8o2jf$3isv1$1@bluemanedhawk.eternal-september.org> <u93q47$19p2n$1@dont-email.me>
<u95q1j$1k1sq$1@bluemanedhawk.eternal-september.org> <u991ot$27egh$2@dont-email.me>
<u99qru$2brfo$1@bluemanedhawk.eternal-september.org> <u9atgg$2ku7m$2@dont-email.me>
<u9bafs$2n7dq$1@bluemanedhawk.eternal-september.org> <u9bg5f$2o9ci$1@dont-email.me>
<u9bs1u$2qj43$1@dont-email.me> <u9d79c$34qp8$1@bluemanedhawk.eternal-september.org>
<u9dcb1$35gmv$1@dont-email.me> <u9fpi9$3msci$1@bluemanedhawk.eternal-september.org>
<u9gjsn$3qfeq$2@dont-email.me> <u9gmvs$3r01u$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <00a98f7c-9f3d-4d86-94e3-3932061832dbn@googlegroups.com>
Subject: Re: you think rust may outthrone c?
From: profesor...@gmail.com (fir)
Injection-Date: Sat, 22 Jul 2023 14:22:04 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3220
 by: fir - Sat, 22 Jul 2023 14:22 UTC

sobota, 22 lipca 2023 o 15:53:15 UTC+2 Bart napisał(a):
> On 22/07/2023 14:00, Bonita Montero wrote:
> > Am 22.07.2023 um 07:30 schrieb Blue-Maned_Hawk:
> >> On 7/21/23 03:32, Bonita Montero wrote:
> >>> <snip />
> >>>
> >>> If you're know C++ halfway you're multiple times faster than
> >>> with C, where you have to deal with every details yourself.
> >>
> >> Okay, where's your evidence for that?
> >
> > Show me the C-code for that:
> >
> > vector<string> vs;
> >
> > void fn( char const *str )
> > {
> > vs.emplace_back( str );
> > }
> >
> > Thats just an example how convenient the STL is. Imagine what effort
> > you need to do the exponential growth of the vector yoursel. And you
> > don't need to deal with the errors of emplace_back where they happen,
> > but just catch bad_alloc some call levels above.
> > C++ is full of such convenient features which make a lot of work in C.
> If you going to use a function anyway, and not special syntax like vs +=
> str, then you can emulate this in C easily. Sure you need a few dozen
> lines of code, but how big is the STL that you'd need to compile into
> every program.

few lines not few dosens

(the containers i showed 1-2 post before ilustrate this (one is static with deletion/insertion) and one is dynamic with only groving but you can combine them in one) ... [they are my ovn personal invention btw]

Re: you think rust may outthrone c?

<u9gp3r$3rdi9$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26472&group=comp.lang.c#26472

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Sat, 22 Jul 2023 16:29:18 +0200
Organization: A noiseless patient Spider
Lines: 50
Message-ID: <u9gp3r$3rdi9$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u8o2jf$3isv1$1@bluemanedhawk.eternal-september.org>
<u93q47$19p2n$1@dont-email.me>
<u95q1j$1k1sq$1@bluemanedhawk.eternal-september.org>
<u991ot$27egh$2@dont-email.me>
<u99qru$2brfo$1@bluemanedhawk.eternal-september.org>
<u9atgg$2ku7m$2@dont-email.me>
<u9bafs$2n7dq$1@bluemanedhawk.eternal-september.org>
<u9bg5f$2o9ci$1@dont-email.me> <u9bs1u$2qj43$1@dont-email.me>
<u9d79c$34qp8$1@bluemanedhawk.eternal-september.org>
<u9dcb1$35gmv$1@dont-email.me>
<94f31ccb-c536-4262-881a-207edc53139dn@googlegroups.com>
<u9gjne$3qfeq$1@dont-email.me>
<0ffc9f99-3451-4be9-93c1-52fee91f12e2n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 22 Jul 2023 14:29:15 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b6114a3f4692fe67f4d329876e1b7ab5";
logging-data="4044361"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19v5K1fYJ4334MHNhKvVeDaYkEcaZwcQLI="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:UI3J9eC/XaT231xf3XizEIBa+G0=
Content-Language: de-DE
In-Reply-To: <0ffc9f99-3451-4be9-93c1-52fee91f12e2n@googlegroups.com>
 by: Bonita Montero - Sat, 22 Jul 2023 14:29 UTC

Am 22.07.2023 um 16:10 schrieb fir:
> sobota, 22 lipca 2023 o 14:57:32 UTC+2 Bonita Montero napisał(a):
>> Am 21.07.2023 um 15:06 schrieb fir:
>>
>>> that is what you belive... but i think you dont know c ...
>>
>> I've been programming C when I guess that you didn't exist.
>>> in c you dont need to deal with every detail ..
>> Of course you neeed. You'd have to do anything manually the
>> STL does or you. People don't use anything comparable in C
>> since C doesn't has the features to be as covenient with
>> that like with C++. Real OOP, RAII and exceptions make the
>> life much easier.
>
> writing a container in c which i better than vector for me is a metter of few lines of code
>
> for example my container for bullets in game
>
> void AddBullet(float x,float y, float angle,
> float vspeed, int life, unsigned color, int type, int owner, float power)
> {
> static int index = 0;
>
> bullet[index].x = x;
> bullet[index].y = y;
> bullet[index].enabled = 1;
> bullet[index].angle = angle;
> bullet[index].life = life;//life;
> bullet[index].v = vspeed ;
> bullet[index].type = type ;
> bullet[index].owner = owner ;
> bullet[index].power = power ;
> bullet[index].color = color ;
>
> for(int i=0; i<bullet_max;i++)
> {
> index++; if(index>=bullet_max) index-=bullet_max;
> if(bullet[index].enabled==0) return;
> }
>
> ERROR_("Out OF Space in bullet[]");
> }
>
> this is for static allocated array where you may add and deleta things dynamically with addiionel few lines you make it dynamically resizable - but the static is often okay
>
> and that is about your mythical blabling about advantages of crappy designed pony++

You're not doing what an emplace_back() does. There's a lot of
complexity taken from you and you'd have to do that manually
over and over every time in C.

Re: you think rust may outthrone c?

<u9gp9e$3rdi9$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26473&group=comp.lang.c#26473

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Sat, 22 Jul 2023 16:32:17 +0200
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <u9gp9e$3rdi9$2@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u8o2jf$3isv1$1@bluemanedhawk.eternal-september.org>
<u93q47$19p2n$1@dont-email.me>
<u95q1j$1k1sq$1@bluemanedhawk.eternal-september.org>
<u991ot$27egh$2@dont-email.me>
<u99qru$2brfo$1@bluemanedhawk.eternal-september.org>
<u9atgg$2ku7m$2@dont-email.me>
<u9bafs$2n7dq$1@bluemanedhawk.eternal-september.org>
<u9bg5f$2o9ci$1@dont-email.me> <u9bs1u$2qj43$1@dont-email.me>
<u9d79c$34qp8$1@bluemanedhawk.eternal-september.org>
<u9dcb1$35gmv$1@dont-email.me>
<u9fpi9$3msci$1@bluemanedhawk.eternal-september.org>
<u9gjsn$3qfeq$2@dont-email.me> <u9gmvs$3r01u$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 22 Jul 2023 14:32:14 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b6114a3f4692fe67f4d329876e1b7ab5";
logging-data="4044361"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/+vuGfKGHPIMzSm8lesbcpp8nfBN63pHI="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:ct1rxNxisBjSttoGC7FnglmfwwU=
Content-Language: de-DE
In-Reply-To: <u9gmvs$3r01u$1@dont-email.me>
 by: Bonita Montero - Sat, 22 Jul 2023 14:32 UTC

Am 22.07.2023 um 15:53 schrieb Bart:
> On 22/07/2023 14:00, Bonita Montero wrote:
>> Am 22.07.2023 um 07:30 schrieb Blue-Maned_Hawk:
>>> On 7/21/23 03:32, Bonita Montero wrote:
>>>> <snip />
>>>>
>>>> If you're know C++ halfway you're multiple times faster than
>>>> with C, where you have to deal with every details yourself.
>>>
>>> Okay, where's your evidence for that?
>>
>> Show me the C-code for that:
>>
>> vector<string> vs;
>>
>> void fn( char const *str )
>> {
>>      vs.emplace_back( str );
>> }
>>
>> Thats just an example how convenient the STL is. Imagine what effort
>> you need to do the exponential growth of the vector yoursel. And you
>> don't need to deal with the errors of emplace_back where they happen,
>> but just catch bad_alloc some call levels above.
>> C++ is full of such convenient features which make a lot of work in C.
>
>
> If you going to use a function anyway, and not special syntax like vs +=
> str, then you can emulate this in C easily. Sure you need a few dozen
> lines of code, but how big is the STL that you'd need to compile into
> every program.

Show me how to do what I did in C. The above code increases the size
of the vector, thereby increasing the capacity exponentially (amortized
constant overhead) if necessary, constructs the string-object, thereby
allocating the storage of the string and if that fails the capacity
remains and the size is the old. That's a lot of work you'd have to
do in C over and over since it lacks the language facilites to to
that as convenient.

Re: you think rust may outthrone c?

<a1a16b55-148c-440a-b082-f91b45dd40d3n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26474&group=comp.lang.c#26474

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:1486:b0:403:b707:400f with SMTP id t6-20020a05622a148600b00403b707400fmr11959qtx.7.1690036383193;
Sat, 22 Jul 2023 07:33:03 -0700 (PDT)
X-Received: by 2002:a05:6808:308d:b0:3a4:13ba:9f6 with SMTP id
bl13-20020a056808308d00b003a413ba09f6mr9786249oib.10.1690036382861; Sat, 22
Jul 2023 07:33:02 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sat, 22 Jul 2023 07:33:02 -0700 (PDT)
In-Reply-To: <u9gp3r$3rdi9$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.226; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.226
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u8o2jf$3isv1$1@bluemanedhawk.eternal-september.org> <u93q47$19p2n$1@dont-email.me>
<u95q1j$1k1sq$1@bluemanedhawk.eternal-september.org> <u991ot$27egh$2@dont-email.me>
<u99qru$2brfo$1@bluemanedhawk.eternal-september.org> <u9atgg$2ku7m$2@dont-email.me>
<u9bafs$2n7dq$1@bluemanedhawk.eternal-september.org> <u9bg5f$2o9ci$1@dont-email.me>
<u9bs1u$2qj43$1@dont-email.me> <u9d79c$34qp8$1@bluemanedhawk.eternal-september.org>
<u9dcb1$35gmv$1@dont-email.me> <94f31ccb-c536-4262-881a-207edc53139dn@googlegroups.com>
<u9gjne$3qfeq$1@dont-email.me> <0ffc9f99-3451-4be9-93c1-52fee91f12e2n@googlegroups.com>
<u9gp3r$3rdi9$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a1a16b55-148c-440a-b082-f91b45dd40d3n@googlegroups.com>
Subject: Re: you think rust may outthrone c?
From: profesor...@gmail.com (fir)
Injection-Date: Sat, 22 Jul 2023 14:33:03 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4303
 by: fir - Sat, 22 Jul 2023 14:33 UTC

sobota, 22 lipca 2023 o 16:29:29 UTC+2 Bonita Montero napisał(a):
> Am 22.07.2023 um 16:10 schrieb fir:
> > sobota, 22 lipca 2023 o 14:57:32 UTC+2 Bonita Montero napisał(a):
> >> Am 21.07.2023 um 15:06 schrieb fir:
> >>
> >>> that is what you belive... but i think you dont know c ...
> >>
> >> I've been programming C when I guess that you didn't exist.
> >>> in c you dont need to deal with every detail ..
> >> Of course you neeed. You'd have to do anything manually the
> >> STL does or you. People don't use anything comparable in C
> >> since C doesn't has the features to be as covenient with
> >> that like with C++. Real OOP, RAII and exceptions make the
> >> life much easier.
> >
> > writing a container in c which i better than vector for me is a metter of few lines of code
> >
> > for example my container for bullets in game
> >
> > void AddBullet(float x,float y, float angle,
> > float vspeed, int life, unsigned color, int type, int owner, float power)
> > {
> > static int index = 0;
> >
> > bullet[index].x = x;
> > bullet[index].y = y;
> > bullet[index].enabled = 1;
> > bullet[index].angle = angle;
> > bullet[index].life = life;//life;
> > bullet[index].v = vspeed ;
> > bullet[index].type = type ;
> > bullet[index].owner = owner ;
> > bullet[index].power = power ;
> > bullet[index].color = color ;
> >
> > for(int i=0; i<bullet_max;i++)
> > {
> > index++; if(index>=bullet_max) index-=bullet_max;
> > if(bullet[index].enabled==0) return;
> > }
> >
> > ERROR_("Out OF Space in bullet[]");
> > }
> >
> > this is for static allocated array where you may add and deleta things dynamically with addiionel few lines you make it dynamically resizable - but the static is often okay
> >
> > and that is about your mythical blabling about advantages of crappy designed pony++
> You're not doing what an emplace_back() does. There's a lot of
> complexity taken from you and you'd have to do that manually
> over and over every time in C.

and what is that emplace back doin?

in c (when writing my game prototypes or compiler etc) i just might need a
container for my records that is dynamic (adds, deletes, iterations, eventuall resizing) and fast
- and thsi is what i need... i didnt noticed any need for emplace back, whatever it is

Re: you think rust may outthrone c?

<u9gpds$3rdi9$3@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26475&group=comp.lang.c#26475

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Sat, 22 Jul 2023 16:34:39 +0200
Organization: A noiseless patient Spider
Lines: 52
Message-ID: <u9gpds$3rdi9$3@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u8o2jf$3isv1$1@bluemanedhawk.eternal-september.org>
<u93q47$19p2n$1@dont-email.me>
<u95q1j$1k1sq$1@bluemanedhawk.eternal-september.org>
<u991ot$27egh$2@dont-email.me>
<u99qru$2brfo$1@bluemanedhawk.eternal-september.org>
<u9atgg$2ku7m$2@dont-email.me>
<u9bafs$2n7dq$1@bluemanedhawk.eternal-september.org>
<u9bg5f$2o9ci$1@dont-email.me> <u9bs1u$2qj43$1@dont-email.me>
<u9d79c$34qp8$1@bluemanedhawk.eternal-september.org>
<u9dcb1$35gmv$1@dont-email.me>
<u9fpi9$3msci$1@bluemanedhawk.eternal-september.org>
<u9gjsn$3qfeq$2@dont-email.me>
<874ebd85-84f6-4959-9ee1-6afd810a5d7dn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 22 Jul 2023 14:34:36 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b6114a3f4692fe67f4d329876e1b7ab5";
logging-data="4044361"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/eDFXejPhFiIit3JkbzZAWdk2ELHlj1C4="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:E9BcgTOxw+1I55K4sP++c85OP3U=
Content-Language: de-DE
In-Reply-To: <874ebd85-84f6-4959-9ee1-6afd810a5d7dn@googlegroups.com>
 by: Bonita Montero - Sat, 22 Jul 2023 14:34 UTC

Am 22.07.2023 um 16:19 schrieb fir:
> sobota, 22 lipca 2023 o 15:00:22 UTC+2 Bonita Montero napisał(a):
>> Am 22.07.2023 um 07:30 schrieb Blue-Maned_Hawk:
>>> On 7/21/23 03:32, Bonita Montero wrote:
>>>> <snip />
>>>>
>>>> If you're know C++ halfway you're multiple times faster than
>>>> with C, where you have to deal with every details yourself.
>>>
>>> Okay, where's your evidence for that?
>> Show me the C-code for that:
>>
>> vector<string> vs;
>>
>> void fn( char const *str )
>> {
>> vs.emplace_back( str );
>> }
>>
>> Thats just an example how convenient the STL is. Imagine what effort
>> you need to do the exponential growth of the vector yoursel. And you
>> don't need to deal with the errors of emplace_back where they happen,
>> but just catch bad_alloc some call levels above.
>> C++ is full of such convenient features which make a lot of work in C.
>
>
> i dont know what is emplace back and what you mean exponentiol growth
> but something like vector in c you do
>
>
> struct ExpressionList { int x; int y; unsigned long long tag;};
> static ExpressionList* expression_list1 = NULL;
> static int expression_list1_size = 0;
>
> void expression_list1_AddOne(int i, int j)
> {
> expression_list1_size++;
> expression_list1 = (ExpressionList*) realloc(expression_list1, expression_list1_size * sizeof(ExpressionList) );
> expression_list1[expression_list1_size-1] = {i,j};
> return ;
> }
>
> if you dont want you might not call reallock by evary add but realoock by *1.5 or bby +1000 or what you
> need - but in fact the reallock casches it itself and did not do the reallock by one only really rare so this
> reallock called each time is practically near zero cost so its quite okay to call it by one
> (add flag enabled to mark record as deleted and some increment cursor code to find empty ones and you got
> terribly good and fast container suited for your needs)

You don't even have a clue what C++ does for you with the above code.
Consider for example the exponential growth of the vector to keep the
number of reallocations small; that would be much work in C.

Re: you think rust may outthrone c?

<u9gpfg$3rdi9$4@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26476&group=comp.lang.c#26476

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Sat, 22 Jul 2023 16:35:32 +0200
Organization: A noiseless patient Spider
Lines: 60
Message-ID: <u9gpfg$3rdi9$4@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u8o2jf$3isv1$1@bluemanedhawk.eternal-september.org>
<u93q47$19p2n$1@dont-email.me>
<u95q1j$1k1sq$1@bluemanedhawk.eternal-september.org>
<u991ot$27egh$2@dont-email.me>
<u99qru$2brfo$1@bluemanedhawk.eternal-september.org>
<u9atgg$2ku7m$2@dont-email.me>
<u9bafs$2n7dq$1@bluemanedhawk.eternal-september.org>
<u9bg5f$2o9ci$1@dont-email.me> <u9bs1u$2qj43$1@dont-email.me>
<u9d79c$34qp8$1@bluemanedhawk.eternal-september.org>
<u9dcb1$35gmv$1@dont-email.me>
<94f31ccb-c536-4262-881a-207edc53139dn@googlegroups.com>
<u9gjne$3qfeq$1@dont-email.me>
<0ffc9f99-3451-4be9-93c1-52fee91f12e2n@googlegroups.com>
<u9gp3r$3rdi9$1@dont-email.me>
<a1a16b55-148c-440a-b082-f91b45dd40d3n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 22 Jul 2023 14:35:28 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b6114a3f4692fe67f4d329876e1b7ab5";
logging-data="4044361"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+gH7TQodH4faxzGMMALCPuqQWDRYGclNU="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:7GtOndFQGFqF5pGUZd3HTL2v7Nw=
In-Reply-To: <a1a16b55-148c-440a-b082-f91b45dd40d3n@googlegroups.com>
Content-Language: de-DE
 by: Bonita Montero - Sat, 22 Jul 2023 14:35 UTC

Am 22.07.2023 um 16:33 schrieb fir:
> sobota, 22 lipca 2023 o 16:29:29 UTC+2 Bonita Montero napisał(a):
>> Am 22.07.2023 um 16:10 schrieb fir:
>>> sobota, 22 lipca 2023 o 14:57:32 UTC+2 Bonita Montero napisał(a):
>>>> Am 21.07.2023 um 15:06 schrieb fir:
>>>>
>>>>> that is what you belive... but i think you dont know c ...
>>>>
>>>> I've been programming C when I guess that you didn't exist.
>>>>> in c you dont need to deal with every detail ..
>>>> Of course you neeed. You'd have to do anything manually the
>>>> STL does or you. People don't use anything comparable in C
>>>> since C doesn't has the features to be as covenient with
>>>> that like with C++. Real OOP, RAII and exceptions make the
>>>> life much easier.
>>>
>>> writing a container in c which i better than vector for me is a metter of few lines of code
>>>
>>> for example my container for bullets in game
>>>
>>> void AddBullet(float x,float y, float angle,
>>> float vspeed, int life, unsigned color, int type, int owner, float power)
>>> {
>>> static int index = 0;
>>>
>>> bullet[index].x = x;
>>> bullet[index].y = y;
>>> bullet[index].enabled = 1;
>>> bullet[index].angle = angle;
>>> bullet[index].life = life;//life;
>>> bullet[index].v = vspeed ;
>>> bullet[index].type = type ;
>>> bullet[index].owner = owner ;
>>> bullet[index].power = power ;
>>> bullet[index].color = color ;
>>>
>>> for(int i=0; i<bullet_max;i++)
>>> {
>>> index++; if(index>=bullet_max) index-=bullet_max;
>>> if(bullet[index].enabled==0) return;
>>> }
>>>
>>> ERROR_("Out OF Space in bullet[]");
>>> }
>>>
>>> this is for static allocated array where you may add and deleta things dynamically with addiionel few lines you make it dynamically resizable - but the static is often okay
>>>
>>> and that is about your mythical blabling about advantages of crappy designed pony++
>> You're not doing what an emplace_back() does. There's a lot of
>> complexity taken from you and you'd have to do that manually
>> over and over every time in C.
>
> and what is that emplace back doin?
>
> in c (when writing my game prototypes or compiler etc) i just might need a
> container for my records that is dynamic (adds, deletes, iterations, eventuall resizing) and fast
> - and thsi is what i need... i didnt noticed any need for emplace back, whatever it is

You're a n00b and you never understood C++.

Re: you think rust may outthrone c?

<f3b7921d-846f-4bee-b16c-82eefc230e65n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26477&group=comp.lang.c#26477

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ad4:4f46:0:b0:634:81f6:569b with SMTP id eu6-20020ad44f46000000b0063481f6569bmr13346qvb.10.1690036973802;
Sat, 22 Jul 2023 07:42:53 -0700 (PDT)
X-Received: by 2002:a05:6870:715:b0:1a6:d518:f72c with SMTP id
ea21-20020a056870071500b001a6d518f72cmr5748166oab.11.1690036973405; Sat, 22
Jul 2023 07:42:53 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sat, 22 Jul 2023 07:42:52 -0700 (PDT)
In-Reply-To: <u9gp9e$3rdi9$2@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.226; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.226
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u8o2jf$3isv1$1@bluemanedhawk.eternal-september.org> <u93q47$19p2n$1@dont-email.me>
<u95q1j$1k1sq$1@bluemanedhawk.eternal-september.org> <u991ot$27egh$2@dont-email.me>
<u99qru$2brfo$1@bluemanedhawk.eternal-september.org> <u9atgg$2ku7m$2@dont-email.me>
<u9bafs$2n7dq$1@bluemanedhawk.eternal-september.org> <u9bg5f$2o9ci$1@dont-email.me>
<u9bs1u$2qj43$1@dont-email.me> <u9d79c$34qp8$1@bluemanedhawk.eternal-september.org>
<u9dcb1$35gmv$1@dont-email.me> <u9fpi9$3msci$1@bluemanedhawk.eternal-september.org>
<u9gjsn$3qfeq$2@dont-email.me> <u9gmvs$3r01u$1@dont-email.me> <u9gp9e$3rdi9$2@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f3b7921d-846f-4bee-b16c-82eefc230e65n@googlegroups.com>
Subject: Re: you think rust may outthrone c?
From: profesor...@gmail.com (fir)
Injection-Date: Sat, 22 Jul 2023 14:42:53 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4103
 by: fir - Sat, 22 Jul 2023 14:42 UTC

sobota, 22 lipca 2023 o 16:32:28 UTC+2 Bonita Montero napisał(a):
> Am 22.07.2023 um 15:53 schrieb Bart:
> > On 22/07/2023 14:00, Bonita Montero wrote:
> >> Am 22.07.2023 um 07:30 schrieb Blue-Maned_Hawk:
> >>> On 7/21/23 03:32, Bonita Montero wrote:
> >>>> <snip />
> >>>>
> >>>> If you're know C++ halfway you're multiple times faster than
> >>>> with C, where you have to deal with every details yourself.
> >>>
> >>> Okay, where's your evidence for that?
> >>
> >> Show me the C-code for that:
> >>
> >> vector<string> vs;
> >>
> >> void fn( char const *str )
> >> {
> >> vs.emplace_back( str );
> >> }
> >>
> >> Thats just an example how convenient the STL is. Imagine what effort
> >> you need to do the exponential growth of the vector yoursel. And you
> >> don't need to deal with the errors of emplace_back where they happen,
> >> but just catch bad_alloc some call levels above.
> >> C++ is full of such convenient features which make a lot of work in C.
> >
> >
> > If you going to use a function anyway, and not special syntax like vs +=
> > str, then you can emulate this in C easily. Sure you need a few dozen
> > lines of code, but how big is the STL that you'd need to compile into
> > every program.
> Show me how to do what I did in C. The above code increases the size
> of the vector, thereby increasing the capacity exponentially (amortized
> constant overhead) if necessary, constructs the string-object, thereby
> allocating the storage of the string and if that fails the capacity
> remains and the size is the old. That's a lot of work you'd have to
> do in C over and over since it lacks the language facilites to to
> that as convenient.

struct String {char* str; /*more fields*/};

static String* strings = NULL;
static int strings_size = 0;
int strings_addOne(char* str) { strings_size++; strings = (String*) realloc(strings, trings_size * sizeof(String) ); strings[strings_size-1].str = str;}

int main()
{ strings_addOne("ala");
strings_addOne("ma");
strings_addOne("kota");

for(int i=0; i<strings_size;i++) printf(strings[i].str);
} not checked for typos but it is about that, vector in c but better

Re: you think rust may outthrone c?

<05c87f55-f8bb-4411-8e5c-9c11829351ean@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26478&group=comp.lang.c#26478

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:6214:174b:b0:63c:b11f:2be8 with SMTP id dc11-20020a056214174b00b0063cb11f2be8mr12034qvb.6.1690037304889;
Sat, 22 Jul 2023 07:48:24 -0700 (PDT)
X-Received: by 2002:a05:6808:13c2:b0:39e:9757:6263 with SMTP id
d2-20020a05680813c200b0039e97576263mr10453641oiw.0.1690037304458; Sat, 22 Jul
2023 07:48:24 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.us.feeder.erje.net!feeder.erje.net!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sat, 22 Jul 2023 07:48:24 -0700 (PDT)
In-Reply-To: <u9gpds$3rdi9$3@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.8; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.8
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u8o2jf$3isv1$1@bluemanedhawk.eternal-september.org> <u93q47$19p2n$1@dont-email.me>
<u95q1j$1k1sq$1@bluemanedhawk.eternal-september.org> <u991ot$27egh$2@dont-email.me>
<u99qru$2brfo$1@bluemanedhawk.eternal-september.org> <u9atgg$2ku7m$2@dont-email.me>
<u9bafs$2n7dq$1@bluemanedhawk.eternal-september.org> <u9bg5f$2o9ci$1@dont-email.me>
<u9bs1u$2qj43$1@dont-email.me> <u9d79c$34qp8$1@bluemanedhawk.eternal-september.org>
<u9dcb1$35gmv$1@dont-email.me> <u9fpi9$3msci$1@bluemanedhawk.eternal-september.org>
<u9gjsn$3qfeq$2@dont-email.me> <874ebd85-84f6-4959-9ee1-6afd810a5d7dn@googlegroups.com>
<u9gpds$3rdi9$3@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <05c87f55-f8bb-4411-8e5c-9c11829351ean@googlegroups.com>
Subject: Re: you think rust may outthrone c?
From: profesor...@gmail.com (fir)
Injection-Date: Sat, 22 Jul 2023 14:48:24 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 66
 by: fir - Sat, 22 Jul 2023 14:48 UTC

sobota, 22 lipca 2023 o 16:34:50 UTC+2 Bonita Montero napisał(a):
> Am 22.07.2023 um 16:19 schrieb fir:
> > sobota, 22 lipca 2023 o 15:00:22 UTC+2 Bonita Montero napisał(a):
> >> Am 22.07.2023 um 07:30 schrieb Blue-Maned_Hawk:
> >>> On 7/21/23 03:32, Bonita Montero wrote:
> >>>> <snip />
> >>>>
> >>>> If you're know C++ halfway you're multiple times faster than
> >>>> with C, where you have to deal with every details yourself.
> >>>
> >>> Okay, where's your evidence for that?
> >> Show me the C-code for that:
> >>
> >> vector<string> vs;
> >>
> >> void fn( char const *str )
> >> {
> >> vs.emplace_back( str );
> >> }
> >>
> >> Thats just an example how convenient the STL is. Imagine what effort
> >> you need to do the exponential growth of the vector yoursel. And you
> >> don't need to deal with the errors of emplace_back where they happen,
> >> but just catch bad_alloc some call levels above.
> >> C++ is full of such convenient features which make a lot of work in C.
> >
> >
> > i dont know what is emplace back and what you mean exponentiol growth
> > but something like vector in c you do
> >
> >
> > struct ExpressionList { int x; int y; unsigned long long tag;};
> > static ExpressionList* expression_list1 = NULL;
> > static int expression_list1_size = 0;
> >
> > void expression_list1_AddOne(int i, int j)
> > {
> > expression_list1_size++;
> > expression_list1 = (ExpressionList*) realloc(expression_list1, expression_list1_size * sizeof(ExpressionList) );
> > expression_list1[expression_list1_size-1] = {i,j};
> > return ;
> > }
> >
> > if you dont want you might not call reallock by evary add but realoock by *1.5 or bby +1000 or what you
> > need - but in fact the reallock casches it itself and did not do the reallock by one only really rare so this
> > reallock called each time is practically near zero cost so its quite okay to call it by one
> > (add flag enabled to mark record as deleted and some increment cursor code to find empty ones and you got
> > terribly good and fast container suited for your needs)
> You don't even have a clue what C++ does for you with the above code.
> Consider for example the exponential growth of the vector to keep the
> number of reallocations small; that would be much work in C.

realloc does it for you
check this thread

https://groups.google.com/g/comp.lang.c/c/YXejwDRKSAQ/m/E8ka_jpAAgAJ

Re: you think rust may outthrone c?

<0532066d-77d2-4507-94f4-880c3bf859e4n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26479&group=comp.lang.c#26479

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:6214:905:b0:63c:f2b6:a2f8 with SMTP id dj5-20020a056214090500b0063cf2b6a2f8mr4765qvb.9.1690037900212;
Sat, 22 Jul 2023 07:58:20 -0700 (PDT)
X-Received: by 2002:a05:6808:30a2:b0:3a3:fa7c:c951 with SMTP id
bl34-20020a05680830a200b003a3fa7cc951mr10097435oib.10.1690037899928; Sat, 22
Jul 2023 07:58:19 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!fdn.fr!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sat, 22 Jul 2023 07:58:19 -0700 (PDT)
In-Reply-To: <05c87f55-f8bb-4411-8e5c-9c11829351ean@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.8; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.8
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u8o2jf$3isv1$1@bluemanedhawk.eternal-september.org> <u93q47$19p2n$1@dont-email.me>
<u95q1j$1k1sq$1@bluemanedhawk.eternal-september.org> <u991ot$27egh$2@dont-email.me>
<u99qru$2brfo$1@bluemanedhawk.eternal-september.org> <u9atgg$2ku7m$2@dont-email.me>
<u9bafs$2n7dq$1@bluemanedhawk.eternal-september.org> <u9bg5f$2o9ci$1@dont-email.me>
<u9bs1u$2qj43$1@dont-email.me> <u9d79c$34qp8$1@bluemanedhawk.eternal-september.org>
<u9dcb1$35gmv$1@dont-email.me> <u9fpi9$3msci$1@bluemanedhawk.eternal-september.org>
<u9gjsn$3qfeq$2@dont-email.me> <874ebd85-84f6-4959-9ee1-6afd810a5d7dn@googlegroups.com>
<u9gpds$3rdi9$3@dont-email.me> <05c87f55-f8bb-4411-8e5c-9c11829351ean@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0532066d-77d2-4507-94f4-880c3bf859e4n@googlegroups.com>
Subject: Re: you think rust may outthrone c?
From: profesor...@gmail.com (fir)
Injection-Date: Sat, 22 Jul 2023 14:58:20 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: fir - Sat, 22 Jul 2023 14:58 UTC

sobota, 22 lipca 2023 o 16:48:34 UTC+2 fir napisał(a):
> sobota, 22 lipca 2023 o 16:34:50 UTC+2 Bonita Montero napisał(a):
> > Am 22.07.2023 um 16:19 schrieb fir:
> > > sobota, 22 lipca 2023 o 15:00:22 UTC+2 Bonita Montero napisał(a):
> > >> Am 22.07.2023 um 07:30 schrieb Blue-Maned_Hawk:
> > >>> On 7/21/23 03:32, Bonita Montero wrote:
> > >>>> <snip />
> > >>>>
> > >>>> If you're know C++ halfway you're multiple times faster than
> > >>>> with C, where you have to deal with every details yourself.
> > >>>
> > >>> Okay, where's your evidence for that?
> > >> Show me the C-code for that:
> > >>
> > >> vector<string> vs;
> > >>
> > >> void fn( char const *str )
> > >> {
> > >> vs.emplace_back( str );
> > >> }
> > >>
> > >> Thats just an example how convenient the STL is. Imagine what effort
> > >> you need to do the exponential growth of the vector yoursel. And you
> > >> don't need to deal with the errors of emplace_back where they happen,
> > >> but just catch bad_alloc some call levels above.
> > >> C++ is full of such convenient features which make a lot of work in C.
> > >
> > >
> > > i dont know what is emplace back and what you mean exponentiol growth
> > > but something like vector in c you do
> > >
> > >
> > > struct ExpressionList { int x; int y; unsigned long long tag;};
> > > static ExpressionList* expression_list1 = NULL;
> > > static int expression_list1_size = 0;
> > >
> > > void expression_list1_AddOne(int i, int j)
> > > {
> > > expression_list1_size++;
> > > expression_list1 = (ExpressionList*) realloc(expression_list1, expression_list1_size * sizeof(ExpressionList) );
> > > expression_list1[expression_list1_size-1] = {i,j};
> > > return ;
> > > }
> > >
> > > if you dont want you might not call reallock by evary add but realoock by *1.5 or bby +1000 or what you
> > > need - but in fact the reallock casches it itself and did not do the reallock by one only really rare so this
> > > reallock called each time is practically near zero cost so its quite okay to call it by one
> > > (add flag enabled to mark record as deleted and some increment cursor code to find empty ones and you got
> > > terribly good and fast container suited for your needs)
> > You don't even have a clue what C++ does for you with the above code.
> > Consider for example the exponential growth of the vector to keep the
> > number of reallocations small; that would be much work in C.
> realloc does it for you
> check this thread
>
> https://groups.google.com/g/comp.lang.c/c/YXejwDRKSAQ/m/E8ka_jpAAgAJ

you see there if you use

for(int i=1; i<100000; i++)
dipa = AllocChunk(dipa, i);

where dipa is
struct chunk {char* beg; char* end;};
and AloocChunk is

chunk AllocChunk(rchunk x, int size)
{
x.c.beg = (char*) realloc(x.c.beg, size );
x.c.end = x.c.beg + size -1;
return x;
}

the reallock will only work few times other times just return and do nothing (you dont need to hold end pointer as realoock holds it internally but its konda wrong (as there is no accas to it) so i personally prefer to keep both in form of so called chunk

thsi one offers just resizing but you often need not resizing but more ads and deletes the other code i show shows how to do it in c, you simply hold a static integer that iterates thru records and a flag /enabled in each record which yu set to zero if you want to free that record andhis record and a couple of i++ if you need to find first free record before insertion

that is what i use insetad of tiotally crapppy pony ++ stl vector for noobs

Re: you think rust may outthrone c?

<u9gqsk$3rn87$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26480&group=comp.lang.c#26480

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Sat, 22 Jul 2023 16:59:35 +0200
Organization: A noiseless patient Spider
Lines: 67
Message-ID: <u9gqsk$3rn87$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u8o2jf$3isv1$1@bluemanedhawk.eternal-september.org>
<u93q47$19p2n$1@dont-email.me>
<u95q1j$1k1sq$1@bluemanedhawk.eternal-september.org>
<u991ot$27egh$2@dont-email.me>
<u99qru$2brfo$1@bluemanedhawk.eternal-september.org>
<u9atgg$2ku7m$2@dont-email.me>
<u9bafs$2n7dq$1@bluemanedhawk.eternal-september.org>
<u9bg5f$2o9ci$1@dont-email.me> <u9bs1u$2qj43$1@dont-email.me>
<u9d79c$34qp8$1@bluemanedhawk.eternal-september.org>
<u9dcb1$35gmv$1@dont-email.me>
<u9fpi9$3msci$1@bluemanedhawk.eternal-september.org>
<u9gjsn$3qfeq$2@dont-email.me>
<874ebd85-84f6-4959-9ee1-6afd810a5d7dn@googlegroups.com>
<u9gpds$3rdi9$3@dont-email.me>
<05c87f55-f8bb-4411-8e5c-9c11829351ean@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 22 Jul 2023 14:59:32 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b6114a3f4692fe67f4d329876e1b7ab5";
logging-data="4054279"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1836TG2+Jy7fHZyQrro95kpm+PfrBXgMOs="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:ABHtnardFs4RIiiYDUzKfjdMxLc=
In-Reply-To: <05c87f55-f8bb-4411-8e5c-9c11829351ean@googlegroups.com>
Content-Language: de-DE
 by: Bonita Montero - Sat, 22 Jul 2023 14:59 UTC

Am 22.07.2023 um 16:48 schrieb fir:
> sobota, 22 lipca 2023 o 16:34:50 UTC+2 Bonita Montero napisał(a):
>> Am 22.07.2023 um 16:19 schrieb fir:
>>> sobota, 22 lipca 2023 o 15:00:22 UTC+2 Bonita Montero napisał(a):
>>>> Am 22.07.2023 um 07:30 schrieb Blue-Maned_Hawk:
>>>>> On 7/21/23 03:32, Bonita Montero wrote:
>>>>>> <snip />
>>>>>>
>>>>>> If you're know C++ halfway you're multiple times faster than
>>>>>> with C, where you have to deal with every details yourself.
>>>>>
>>>>> Okay, where's your evidence for that?
>>>> Show me the C-code for that:
>>>>
>>>> vector<string> vs;
>>>>
>>>> void fn( char const *str )
>>>> {
>>>> vs.emplace_back( str );
>>>> }
>>>>
>>>> Thats just an example how convenient the STL is. Imagine what effort
>>>> you need to do the exponential growth of the vector yoursel. And you
>>>> don't need to deal with the errors of emplace_back where they happen,
>>>> but just catch bad_alloc some call levels above.
>>>> C++ is full of such convenient features which make a lot of work in C.
>>>
>>>
>>> i dont know what is emplace back and what you mean exponentiol growth
>>> but something like vector in c you do
>>>
>>>
>>> struct ExpressionList { int x; int y; unsigned long long tag;};
>>> static ExpressionList* expression_list1 = NULL;
>>> static int expression_list1_size = 0;
>>>
>>> void expression_list1_AddOne(int i, int j)
>>> {
>>> expression_list1_size++;
>>> expression_list1 = (ExpressionList*) realloc(expression_list1, expression_list1_size * sizeof(ExpressionList) );
>>> expression_list1[expression_list1_size-1] = {i,j};
>>> return ;
>>> }
>>>
>>> if you dont want you might not call reallock by evary add but realoock by *1.5 or bby +1000 or what you
>>> need - but in fact the reallock casches it itself and did not do the reallock by one only really rare so this
>>> reallock called each time is practically near zero cost so its quite okay to call it by one
>>> (add flag enabled to mark record as deleted and some increment cursor code to find empty ones and you got
>>> terribly good and fast container suited for your needs)
>> You don't even have a clue what C++ does for you with the above code.
>> Consider for example the exponential growth of the vector to keep the
>> number of reallocations small; that would be much work in C.
>
> realloc does it for you
> check this thread

Absolutely not. When you do an emplace_back the vecotr first checks
if there's enough capacity to hold another element. If not it allo-
cates new memory with a constant factor of the current size, _moves_
all current elements there (huge difference to memcpy()ing since
the objects can have an arbitrary complexity) increases the size by
one, constructs the new object according to the parameters passed
to emplace_back() and, if an exception occurs shrinks back the con-
tainer of the size (!= capacity) before.
Doing that in C would be a lot of work if you have non-trivial
objects as usual.

Re: you think rust may outthrone c?

<fad5ffbe-3390-4292-a8ec-d919b8912ef5n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26481&group=comp.lang.c#26481

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:6214:14af:b0:63c:e685:1469 with SMTP id bo15-20020a05621414af00b0063ce6851469mr10576qvb.0.1690038020436;
Sat, 22 Jul 2023 08:00:20 -0700 (PDT)
X-Received: by 2002:a05:6808:20a7:b0:3a1:f295:3e with SMTP id
s39-20020a05680820a700b003a1f295003emr10354691oiw.1.1690038020065; Sat, 22
Jul 2023 08:00:20 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!fdn.fr!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sat, 22 Jul 2023 08:00:19 -0700 (PDT)
In-Reply-To: <0532066d-77d2-4507-94f4-880c3bf859e4n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.8; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.8
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u8o2jf$3isv1$1@bluemanedhawk.eternal-september.org> <u93q47$19p2n$1@dont-email.me>
<u95q1j$1k1sq$1@bluemanedhawk.eternal-september.org> <u991ot$27egh$2@dont-email.me>
<u99qru$2brfo$1@bluemanedhawk.eternal-september.org> <u9atgg$2ku7m$2@dont-email.me>
<u9bafs$2n7dq$1@bluemanedhawk.eternal-september.org> <u9bg5f$2o9ci$1@dont-email.me>
<u9bs1u$2qj43$1@dont-email.me> <u9d79c$34qp8$1@bluemanedhawk.eternal-september.org>
<u9dcb1$35gmv$1@dont-email.me> <u9fpi9$3msci$1@bluemanedhawk.eternal-september.org>
<u9gjsn$3qfeq$2@dont-email.me> <874ebd85-84f6-4959-9ee1-6afd810a5d7dn@googlegroups.com>
<u9gpds$3rdi9$3@dont-email.me> <05c87f55-f8bb-4411-8e5c-9c11829351ean@googlegroups.com>
<0532066d-77d2-4507-94f4-880c3bf859e4n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <fad5ffbe-3390-4292-a8ec-d919b8912ef5n@googlegroups.com>
Subject: Re: you think rust may outthrone c?
From: profesor...@gmail.com (fir)
Injection-Date: Sat, 22 Jul 2023 15:00:20 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: fir - Sat, 22 Jul 2023 15:00 UTC

sobota, 22 lipca 2023 o 16:58:30 UTC+2 fir napisał(a):
> sobota, 22 lipca 2023 o 16:48:34 UTC+2 fir napisał(a):
> > sobota, 22 lipca 2023 o 16:34:50 UTC+2 Bonita Montero napisał(a):
> > > Am 22.07.2023 um 16:19 schrieb fir:
> > > > sobota, 22 lipca 2023 o 15:00:22 UTC+2 Bonita Montero napisał(a):
> > > >> Am 22.07.2023 um 07:30 schrieb Blue-Maned_Hawk:
> > > >>> On 7/21/23 03:32, Bonita Montero wrote:
> > > >>>> <snip />
> > > >>>>
> > > >>>> If you're know C++ halfway you're multiple times faster than
> > > >>>> with C, where you have to deal with every details yourself.
> > > >>>
> > > >>> Okay, where's your evidence for that?
> > > >> Show me the C-code for that:
> > > >>
> > > >> vector<string> vs;
> > > >>
> > > >> void fn( char const *str )
> > > >> {
> > > >> vs.emplace_back( str );
> > > >> }
> > > >>
> > > >> Thats just an example how convenient the STL is. Imagine what effort
> > > >> you need to do the exponential growth of the vector yoursel. And you
> > > >> don't need to deal with the errors of emplace_back where they happen,
> > > >> but just catch bad_alloc some call levels above.
> > > >> C++ is full of such convenient features which make a lot of work in C.
> > > >
> > > >
> > > > i dont know what is emplace back and what you mean exponentiol growth
> > > > but something like vector in c you do
> > > >
> > > >
> > > > struct ExpressionList { int x; int y; unsigned long long tag;};
> > > > static ExpressionList* expression_list1 = NULL;
> > > > static int expression_list1_size = 0;
> > > >
> > > > void expression_list1_AddOne(int i, int j)
> > > > {
> > > > expression_list1_size++;
> > > > expression_list1 = (ExpressionList*) realloc(expression_list1, expression_list1_size * sizeof(ExpressionList) );
> > > > expression_list1[expression_list1_size-1] = {i,j};
> > > > return ;
> > > > }
> > > >
> > > > if you dont want you might not call reallock by evary add but realoock by *1.5 or bby +1000 or what you
> > > > need - but in fact the reallock casches it itself and did not do the reallock by one only really rare so this
> > > > reallock called each time is practically near zero cost so its quite okay to call it by one
> > > > (add flag enabled to mark record as deleted and some increment cursor code to find empty ones and you got
> > > > terribly good and fast container suited for your needs)
> > > You don't even have a clue what C++ does for you with the above code.
> > > Consider for example the exponential growth of the vector to keep the
> > > number of reallocations small; that would be much work in C.
> > realloc does it for you
> > check this thread
> >
> > https://groups.google.com/g/comp.lang.c/c/YXejwDRKSAQ/m/E8ka_jpAAgAJ
> you see there if you use
>
> for(int i=1; i<100000; i++)
> dipa = AllocChunk(dipa, i);
>
> where dipa is
> struct chunk {char* beg; char* end;};
> and AloocChunk is
>
> chunk AllocChunk(rchunk x, int size)
> {
> x.c.beg = (char*) realloc(x.c.beg, size );
> x.c.end = x.c.beg + size -1;
> return x;
> }
>
> the reallock will only work few times other times just return and do nothing (you dont need to hold end pointer as realoock holds it internally but its konda wrong (as there is no accas to it) so i personally prefer to keep both in form of so called chunk
>
> thsi one offers just resizing but you often need not resizing but more ads and deletes the other code i show shows how to do it in c, you simply hold a static integer that iterates thru records and a flag /enabled in each record which yu set to zero if you want to free that record andhis record and a couple of i++ if you need to find first free record before insertion
>
> that is what i use insetad of tiotally crapppy pony ++ stl vector for noobs
(in fact for ponys not noobs - ponny is better word for that )

Re: you think rust may outthrone c?

<u9gr03$3rn87$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26482&group=comp.lang.c#26482

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Sat, 22 Jul 2023 17:01:27 +0200
Organization: A noiseless patient Spider
Lines: 60
Message-ID: <u9gr03$3rn87$2@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u8o2jf$3isv1$1@bluemanedhawk.eternal-september.org>
<u93q47$19p2n$1@dont-email.me>
<u95q1j$1k1sq$1@bluemanedhawk.eternal-september.org>
<u991ot$27egh$2@dont-email.me>
<u99qru$2brfo$1@bluemanedhawk.eternal-september.org>
<u9atgg$2ku7m$2@dont-email.me>
<u9bafs$2n7dq$1@bluemanedhawk.eternal-september.org>
<u9bg5f$2o9ci$1@dont-email.me> <u9bs1u$2qj43$1@dont-email.me>
<u9d79c$34qp8$1@bluemanedhawk.eternal-september.org>
<u9dcb1$35gmv$1@dont-email.me>
<u9fpi9$3msci$1@bluemanedhawk.eternal-september.org>
<u9gjsn$3qfeq$2@dont-email.me> <u9gmvs$3r01u$1@dont-email.me>
<u9gp9e$3rdi9$2@dont-email.me>
<f3b7921d-846f-4bee-b16c-82eefc230e65n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 22 Jul 2023 15:01:23 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b6114a3f4692fe67f4d329876e1b7ab5";
logging-data="4054279"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18I25jXrIz8w2Un8V9rqMnghbU+X754HKQ="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:RtsjPKXN2UB/YWAWPydtc7WF7Vc=
In-Reply-To: <f3b7921d-846f-4bee-b16c-82eefc230e65n@googlegroups.com>
Content-Language: de-DE
 by: Bonita Montero - Sat, 22 Jul 2023 15:01 UTC

Am 22.07.2023 um 16:42 schrieb fir:
> sobota, 22 lipca 2023 o 16:32:28 UTC+2 Bonita Montero napisał(a):
>> Am 22.07.2023 um 15:53 schrieb Bart:
>>> On 22/07/2023 14:00, Bonita Montero wrote:
>>>> Am 22.07.2023 um 07:30 schrieb Blue-Maned_Hawk:
>>>>> On 7/21/23 03:32, Bonita Montero wrote:
>>>>>> <snip />
>>>>>>
>>>>>> If you're know C++ halfway you're multiple times faster than
>>>>>> with C, where you have to deal with every details yourself.
>>>>>
>>>>> Okay, where's your evidence for that?
>>>>
>>>> Show me the C-code for that:
>>>>
>>>> vector<string> vs;
>>>>
>>>> void fn( char const *str )
>>>> {
>>>> vs.emplace_back( str );
>>>> }
>>>>
>>>> Thats just an example how convenient the STL is. Imagine what effort
>>>> you need to do the exponential growth of the vector yoursel. And you
>>>> don't need to deal with the errors of emplace_back where they happen,
>>>> but just catch bad_alloc some call levels above.
>>>> C++ is full of such convenient features which make a lot of work in C.
>>>
>>>
>>> If you going to use a function anyway, and not special syntax like vs +=
>>> str, then you can emulate this in C easily. Sure you need a few dozen
>>> lines of code, but how big is the STL that you'd need to compile into
>>> every program.
>> Show me how to do what I did in C. The above code increases the size
>> of the vector, thereby increasing the capacity exponentially (amortized
>> constant overhead) if necessary, constructs the string-object, thereby
>> allocating the storage of the string and if that fails the capacity
>> remains and the size is the old. That's a lot of work you'd have to
>> do in C over and over since it lacks the language facilites to to
>> that as convenient.
>
> struct String {char* str; /*more fields*/};
>
> static String* strings = NULL;
> static int strings_size = 0;
> int strings_addOne(char* str) { strings_size++; strings = (String*) realloc(strings, trings_size * sizeof(String) ); strings[strings_size-1].str = str;}
>
> int main()
> {
> strings_addOne("ala");
> strings_addOne("ma");
> strings_addOne("kota");
>
> for(int i=0; i<strings_size;i++) printf(strings[i].str);
> }
> not checked for typos but it is about that, vector in c but better

This doesn't do what I've shown. I've described that in the
ther posting. I think you don't program professionally at all.

Re: you think rust may outthrone c?

<u9gr10$3rn87$3@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26483&group=comp.lang.c#26483

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Sat, 22 Jul 2023 17:01:56 +0200
Organization: A noiseless patient Spider
Lines: 83
Message-ID: <u9gr10$3rn87$3@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u8o2jf$3isv1$1@bluemanedhawk.eternal-september.org>
<u93q47$19p2n$1@dont-email.me>
<u95q1j$1k1sq$1@bluemanedhawk.eternal-september.org>
<u991ot$27egh$2@dont-email.me>
<u99qru$2brfo$1@bluemanedhawk.eternal-september.org>
<u9atgg$2ku7m$2@dont-email.me>
<u9bafs$2n7dq$1@bluemanedhawk.eternal-september.org>
<u9bg5f$2o9ci$1@dont-email.me> <u9bs1u$2qj43$1@dont-email.me>
<u9d79c$34qp8$1@bluemanedhawk.eternal-september.org>
<u9dcb1$35gmv$1@dont-email.me>
<u9fpi9$3msci$1@bluemanedhawk.eternal-september.org>
<u9gjsn$3qfeq$2@dont-email.me>
<874ebd85-84f6-4959-9ee1-6afd810a5d7dn@googlegroups.com>
<u9gpds$3rdi9$3@dont-email.me>
<05c87f55-f8bb-4411-8e5c-9c11829351ean@googlegroups.com>
<0532066d-77d2-4507-94f4-880c3bf859e4n@googlegroups.com>
<fad5ffbe-3390-4292-a8ec-d919b8912ef5n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 22 Jul 2023 15:01:52 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b6114a3f4692fe67f4d329876e1b7ab5";
logging-data="4054279"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18bxN2jcp6hlvTgJH+llM8tYyBA25i1PYY="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:+FflHKE+nVDtvT37Zu+cdHJSHEA=
In-Reply-To: <fad5ffbe-3390-4292-a8ec-d919b8912ef5n@googlegroups.com>
Content-Language: de-DE
 by: Bonita Montero - Sat, 22 Jul 2023 15:01 UTC

Am 22.07.2023 um 17:00 schrieb fir:
> sobota, 22 lipca 2023 o 16:58:30 UTC+2 fir napisał(a):
>> sobota, 22 lipca 2023 o 16:48:34 UTC+2 fir napisał(a):
>>> sobota, 22 lipca 2023 o 16:34:50 UTC+2 Bonita Montero napisał(a):
>>>> Am 22.07.2023 um 16:19 schrieb fir:
>>>>> sobota, 22 lipca 2023 o 15:00:22 UTC+2 Bonita Montero napisał(a):
>>>>>> Am 22.07.2023 um 07:30 schrieb Blue-Maned_Hawk:
>>>>>>> On 7/21/23 03:32, Bonita Montero wrote:
>>>>>>>> <snip />
>>>>>>>>
>>>>>>>> If you're know C++ halfway you're multiple times faster than
>>>>>>>> with C, where you have to deal with every details yourself.
>>>>>>>
>>>>>>> Okay, where's your evidence for that?
>>>>>> Show me the C-code for that:
>>>>>>
>>>>>> vector<string> vs;
>>>>>>
>>>>>> void fn( char const *str )
>>>>>> {
>>>>>> vs.emplace_back( str );
>>>>>> }
>>>>>>
>>>>>> Thats just an example how convenient the STL is. Imagine what effort
>>>>>> you need to do the exponential growth of the vector yoursel. And you
>>>>>> don't need to deal with the errors of emplace_back where they happen,
>>>>>> but just catch bad_alloc some call levels above.
>>>>>> C++ is full of such convenient features which make a lot of work in C.
>>>>>
>>>>>
>>>>> i dont know what is emplace back and what you mean exponentiol growth
>>>>> but something like vector in c you do
>>>>>
>>>>>
>>>>> struct ExpressionList { int x; int y; unsigned long long tag;};
>>>>> static ExpressionList* expression_list1 = NULL;
>>>>> static int expression_list1_size = 0;
>>>>>
>>>>> void expression_list1_AddOne(int i, int j)
>>>>> {
>>>>> expression_list1_size++;
>>>>> expression_list1 = (ExpressionList*) realloc(expression_list1, expression_list1_size * sizeof(ExpressionList) );
>>>>> expression_list1[expression_list1_size-1] = {i,j};
>>>>> return ;
>>>>> }
>>>>>
>>>>> if you dont want you might not call reallock by evary add but realoock by *1.5 or bby +1000 or what you
>>>>> need - but in fact the reallock casches it itself and did not do the reallock by one only really rare so this
>>>>> reallock called each time is practically near zero cost so its quite okay to call it by one
>>>>> (add flag enabled to mark record as deleted and some increment cursor code to find empty ones and you got
>>>>> terribly good and fast container suited for your needs)
>>>> You don't even have a clue what C++ does for you with the above code.
>>>> Consider for example the exponential growth of the vector to keep the
>>>> number of reallocations small; that would be much work in C.
>>> realloc does it for you
>>> check this thread
>>>
>>> https://groups.google.com/g/comp.lang.c/c/YXejwDRKSAQ/m/E8ka_jpAAgAJ
>> you see there if you use
>>
>> for(int i=1; i<100000; i++)
>> dipa = AllocChunk(dipa, i);
>>
>> where dipa is
>> struct chunk {char* beg; char* end;};
>> and AloocChunk is
>>
>> chunk AllocChunk(rchunk x, int size)
>> {
>> x.c.beg = (char*) realloc(x.c.beg, size );
>> x.c.end = x.c.beg + size -1;
>> return x;
>> }
>>
>> the reallock will only work few times other times just return and do nothing (you dont need to hold end pointer as realoock holds it internally but its konda wrong (as there is no accas to it) so i personally prefer to keep both in form of so called chunk
>>
>> thsi one offers just resizing but you often need not resizing but more ads and deletes the other code i show shows how to do it in c, you simply hold a static integer that iterates thru records and a flag /enabled in each record which yu set to zero if you want to free that record andhis record and a couple of i++ if you need to find first free record before insertion
>>
>> that is what i use insetad of tiotally crapppy pony ++ stl vector for noobs
> (in fact for ponys not noobs - ponny is better word for that )

You're nervous and you don't program professionally at at.

Re: you think rust may outthrone c?

<05a15143-1fd2-4152-840b-15cebc067562n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26484&group=comp.lang.c#26484

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:1828:b0:401:dfc4:6f8f with SMTP id t40-20020a05622a182800b00401dfc46f8fmr12444qtc.13.1690038157763;
Sat, 22 Jul 2023 08:02:37 -0700 (PDT)
X-Received: by 2002:a05:6808:150f:b0:3a1:f368:6b1 with SMTP id
u15-20020a056808150f00b003a1f36806b1mr10347285oiw.3.1690038157493; Sat, 22
Jul 2023 08:02:37 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!fdn.fr!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sat, 22 Jul 2023 08:02:37 -0700 (PDT)
In-Reply-To: <u9gqsk$3rn87$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.8; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.8
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u8o2jf$3isv1$1@bluemanedhawk.eternal-september.org> <u93q47$19p2n$1@dont-email.me>
<u95q1j$1k1sq$1@bluemanedhawk.eternal-september.org> <u991ot$27egh$2@dont-email.me>
<u99qru$2brfo$1@bluemanedhawk.eternal-september.org> <u9atgg$2ku7m$2@dont-email.me>
<u9bafs$2n7dq$1@bluemanedhawk.eternal-september.org> <u9bg5f$2o9ci$1@dont-email.me>
<u9bs1u$2qj43$1@dont-email.me> <u9d79c$34qp8$1@bluemanedhawk.eternal-september.org>
<u9dcb1$35gmv$1@dont-email.me> <u9fpi9$3msci$1@bluemanedhawk.eternal-september.org>
<u9gjsn$3qfeq$2@dont-email.me> <874ebd85-84f6-4959-9ee1-6afd810a5d7dn@googlegroups.com>
<u9gpds$3rdi9$3@dont-email.me> <05c87f55-f8bb-4411-8e5c-9c11829351ean@googlegroups.com>
<u9gqsk$3rn87$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <05a15143-1fd2-4152-840b-15cebc067562n@googlegroups.com>
Subject: Re: you think rust may outthrone c?
From: profesor...@gmail.com (fir)
Injection-Date: Sat, 22 Jul 2023 15:02:37 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: fir - Sat, 22 Jul 2023 15:02 UTC

sobota, 22 lipca 2023 o 16:59:45 UTC+2 Bonita Montero napisał(a):
> Am 22.07.2023 um 16:48 schrieb fir:
> > sobota, 22 lipca 2023 o 16:34:50 UTC+2 Bonita Montero napisał(a):
> >> Am 22.07.2023 um 16:19 schrieb fir:
> >>> sobota, 22 lipca 2023 o 15:00:22 UTC+2 Bonita Montero napisał(a):
> >>>> Am 22.07.2023 um 07:30 schrieb Blue-Maned_Hawk:
> >>>>> On 7/21/23 03:32, Bonita Montero wrote:
> >>>>>> <snip />
> >>>>>>
> >>>>>> If you're know C++ halfway you're multiple times faster than
> >>>>>> with C, where you have to deal with every details yourself.
> >>>>>
> >>>>> Okay, where's your evidence for that?
> >>>> Show me the C-code for that:
> >>>>
> >>>> vector<string> vs;
> >>>>
> >>>> void fn( char const *str )
> >>>> {
> >>>> vs.emplace_back( str );
> >>>> }
> >>>>
> >>>> Thats just an example how convenient the STL is. Imagine what effort
> >>>> you need to do the exponential growth of the vector yoursel. And you
> >>>> don't need to deal with the errors of emplace_back where they happen,
> >>>> but just catch bad_alloc some call levels above.
> >>>> C++ is full of such convenient features which make a lot of work in C.
> >>>
> >>>
> >>> i dont know what is emplace back and what you mean exponentiol growth
> >>> but something like vector in c you do
> >>>
> >>>
> >>> struct ExpressionList { int x; int y; unsigned long long tag;};
> >>> static ExpressionList* expression_list1 = NULL;
> >>> static int expression_list1_size = 0;
> >>>
> >>> void expression_list1_AddOne(int i, int j)
> >>> {
> >>> expression_list1_size++;
> >>> expression_list1 = (ExpressionList*) realloc(expression_list1, expression_list1_size * sizeof(ExpressionList) );
> >>> expression_list1[expression_list1_size-1] = {i,j};
> >>> return ;
> >>> }
> >>>
> >>> if you dont want you might not call reallock by evary add but realoock by *1.5 or bby +1000 or what you
> >>> need - but in fact the reallock casches it itself and did not do the reallock by one only really rare so this
> >>> reallock called each time is practically near zero cost so its quite okay to call it by one
> >>> (add flag enabled to mark record as deleted and some increment cursor code to find empty ones and you got
> >>> terribly good and fast container suited for your needs)
> >> You don't even have a clue what C++ does for you with the above code.
> >> Consider for example the exponential growth of the vector to keep the
> >> number of reallocations small; that would be much work in C.
> >
> > realloc does it for you
> > check this thread
> Absolutely not. When you do an emplace_back the vecotr first checks
> if there's enough capacity to hold another element. If not it allo-
> cates new memory with a constant factor of the current size, _moves_
> all current elements there (huge difference to memcpy()ing since
> the objects can have an arbitrary complexity) increases the size by
> one, constructs the new object according to the parameters passed
> to emplace_back() and, if an exception occurs shrinks back the con-
> tainer of the size (!= capacity) before.
> Doing that in C would be a lot of work if you have non-trivial
> objects as usual.

you shouldnt go in crapy 'non trivial' objects - use proper ..c is not for mimicking crap

Re: you think rust may outthrone c?

<u9grbc$3rqh0$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26485&group=comp.lang.c#26485

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Sat, 22 Jul 2023 17:07:27 +0200
Organization: A noiseless patient Spider
Lines: 76
Message-ID: <u9grbc$3rqh0$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u8o2jf$3isv1$1@bluemanedhawk.eternal-september.org>
<u93q47$19p2n$1@dont-email.me>
<u95q1j$1k1sq$1@bluemanedhawk.eternal-september.org>
<u991ot$27egh$2@dont-email.me>
<u99qru$2brfo$1@bluemanedhawk.eternal-september.org>
<u9atgg$2ku7m$2@dont-email.me>
<u9bafs$2n7dq$1@bluemanedhawk.eternal-september.org>
<u9bg5f$2o9ci$1@dont-email.me> <u9bs1u$2qj43$1@dont-email.me>
<u9d79c$34qp8$1@bluemanedhawk.eternal-september.org>
<u9dcb1$35gmv$1@dont-email.me>
<u9fpi9$3msci$1@bluemanedhawk.eternal-september.org>
<u9gjsn$3qfeq$2@dont-email.me>
<874ebd85-84f6-4959-9ee1-6afd810a5d7dn@googlegroups.com>
<u9gpds$3rdi9$3@dont-email.me>
<05c87f55-f8bb-4411-8e5c-9c11829351ean@googlegroups.com>
<u9gqsk$3rn87$1@dont-email.me>
<05a15143-1fd2-4152-840b-15cebc067562n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 22 Jul 2023 15:07:24 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b6114a3f4692fe67f4d329876e1b7ab5";
logging-data="4057632"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+R4/2uYoYRWLJgjbaoH1jyTGhUKdRhG/g="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:Tz80r++pZ9UmMbAh2L4EvZ1RxJc=
Content-Language: de-DE
In-Reply-To: <05a15143-1fd2-4152-840b-15cebc067562n@googlegroups.com>
 by: Bonita Montero - Sat, 22 Jul 2023 15:07 UTC

Am 22.07.2023 um 17:02 schrieb fir:
> sobota, 22 lipca 2023 o 16:59:45 UTC+2 Bonita Montero napisał(a):
>> Am 22.07.2023 um 16:48 schrieb fir:
>>> sobota, 22 lipca 2023 o 16:34:50 UTC+2 Bonita Montero napisał(a):
>>>> Am 22.07.2023 um 16:19 schrieb fir:
>>>>> sobota, 22 lipca 2023 o 15:00:22 UTC+2 Bonita Montero napisał(a):
>>>>>> Am 22.07.2023 um 07:30 schrieb Blue-Maned_Hawk:
>>>>>>> On 7/21/23 03:32, Bonita Montero wrote:
>>>>>>>> <snip />
>>>>>>>>
>>>>>>>> If you're know C++ halfway you're multiple times faster than
>>>>>>>> with C, where you have to deal with every details yourself.
>>>>>>>
>>>>>>> Okay, where's your evidence for that?
>>>>>> Show me the C-code for that:
>>>>>>
>>>>>> vector<string> vs;
>>>>>>
>>>>>> void fn( char const *str )
>>>>>> {
>>>>>> vs.emplace_back( str );
>>>>>> }
>>>>>>
>>>>>> Thats just an example how convenient the STL is. Imagine what effort
>>>>>> you need to do the exponential growth of the vector yoursel. And you
>>>>>> don't need to deal with the errors of emplace_back where they happen,
>>>>>> but just catch bad_alloc some call levels above.
>>>>>> C++ is full of such convenient features which make a lot of work in C.
>>>>>
>>>>>
>>>>> i dont know what is emplace back and what you mean exponentiol growth
>>>>> but something like vector in c you do
>>>>>
>>>>>
>>>>> struct ExpressionList { int x; int y; unsigned long long tag;};
>>>>> static ExpressionList* expression_list1 = NULL;
>>>>> static int expression_list1_size = 0;
>>>>>
>>>>> void expression_list1_AddOne(int i, int j)
>>>>> {
>>>>> expression_list1_size++;
>>>>> expression_list1 = (ExpressionList*) realloc(expression_list1, expression_list1_size * sizeof(ExpressionList) );
>>>>> expression_list1[expression_list1_size-1] = {i,j};
>>>>> return ;
>>>>> }
>>>>>
>>>>> if you dont want you might not call reallock by evary add but realoock by *1.5 or bby +1000 or what you
>>>>> need - but in fact the reallock casches it itself and did not do the reallock by one only really rare so this
>>>>> reallock called each time is practically near zero cost so its quite okay to call it by one
>>>>> (add flag enabled to mark record as deleted and some increment cursor code to find empty ones and you got
>>>>> terribly good and fast container suited for your needs)
>>>> You don't even have a clue what C++ does for you with the above code.
>>>> Consider for example the exponential growth of the vector to keep the
>>>> number of reallocations small; that would be much work in C.
>>>
>>> realloc does it for you
>>> check this thread
>> Absolutely not. When you do an emplace_back the vecotr first checks
>> if there's enough capacity to hold another element. If not it allo-
>> cates new memory with a constant factor of the current size, _moves_
>> all current elements there (huge difference to memcpy()ing since
>> the objects can have an arbitrary complexity) increases the size by
>> one, constructs the new object according to the parameters passed
>> to emplace_back() and, if an exception occurs shrinks back the con-
>> tainer of the size (!= capacity) before.
>> Doing that in C would be a lot of work if you have non-trivial
>> objects as usual.
>
> you shouldnt go in crapy 'non trivial' objects - use proper ..c is not for mimicking crap

That's not crap but standard data structures, handled with the most
efficient way. Have a look at what an unordered_map saves you a lot
of work. This is needed really often and in C++ that's a few lines
of code.

Re: you think rust may outthrone c?

<fef1f328-ba0c-401e-acd1-88034a19ae79n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26486&group=comp.lang.c#26486

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ae9:df04:0:b0:767:c5a6:8eed with SMTP id t4-20020ae9df04000000b00767c5a68eedmr11172qkf.0.1690038578904;
Sat, 22 Jul 2023 08:09:38 -0700 (PDT)
X-Received: by 2002:a05:6808:23c7:b0:3a3:89aa:21c1 with SMTP id
bq7-20020a05680823c700b003a389aa21c1mr9891907oib.6.1690038577196; Sat, 22 Jul
2023 08:09:37 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sat, 22 Jul 2023 08:09:36 -0700 (PDT)
In-Reply-To: <u9gr10$3rn87$3@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.8; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.8
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u8o2jf$3isv1$1@bluemanedhawk.eternal-september.org> <u93q47$19p2n$1@dont-email.me>
<u95q1j$1k1sq$1@bluemanedhawk.eternal-september.org> <u991ot$27egh$2@dont-email.me>
<u99qru$2brfo$1@bluemanedhawk.eternal-september.org> <u9atgg$2ku7m$2@dont-email.me>
<u9bafs$2n7dq$1@bluemanedhawk.eternal-september.org> <u9bg5f$2o9ci$1@dont-email.me>
<u9bs1u$2qj43$1@dont-email.me> <u9d79c$34qp8$1@bluemanedhawk.eternal-september.org>
<u9dcb1$35gmv$1@dont-email.me> <u9fpi9$3msci$1@bluemanedhawk.eternal-september.org>
<u9gjsn$3qfeq$2@dont-email.me> <874ebd85-84f6-4959-9ee1-6afd810a5d7dn@googlegroups.com>
<u9gpds$3rdi9$3@dont-email.me> <05c87f55-f8bb-4411-8e5c-9c11829351ean@googlegroups.com>
<0532066d-77d2-4507-94f4-880c3bf859e4n@googlegroups.com> <fad5ffbe-3390-4292-a8ec-d919b8912ef5n@googlegroups.com>
<u9gr10$3rn87$3@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <fef1f328-ba0c-401e-acd1-88034a19ae79n@googlegroups.com>
Subject: Re: you think rust may outthrone c?
From: profesor...@gmail.com (fir)
Injection-Date: Sat, 22 Jul 2023 15:09:38 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 6600
 by: fir - Sat, 22 Jul 2023 15:09 UTC

sobota, 22 lipca 2023 o 17:02:07 UTC+2 Bonita Montero napisał(a):
> Am 22.07.2023 um 17:00 schrieb fir:
> > sobota, 22 lipca 2023 o 16:58:30 UTC+2 fir napisał(a):
> >> sobota, 22 lipca 2023 o 16:48:34 UTC+2 fir napisał(a):
> >>> sobota, 22 lipca 2023 o 16:34:50 UTC+2 Bonita Montero napisał(a):
> >>>> Am 22.07.2023 um 16:19 schrieb fir:
> >>>>> sobota, 22 lipca 2023 o 15:00:22 UTC+2 Bonita Montero napisał(a):
> >>>>>> Am 22.07.2023 um 07:30 schrieb Blue-Maned_Hawk:
> >>>>>>> On 7/21/23 03:32, Bonita Montero wrote:
> >>>>>>>> <snip />
> >>>>>>>>
> >>>>>>>> If you're know C++ halfway you're multiple times faster than
> >>>>>>>> with C, where you have to deal with every details yourself.
> >>>>>>>
> >>>>>>> Okay, where's your evidence for that?
> >>>>>> Show me the C-code for that:
> >>>>>>
> >>>>>> vector<string> vs;
> >>>>>>
> >>>>>> void fn( char const *str )
> >>>>>> {
> >>>>>> vs.emplace_back( str );
> >>>>>> }
> >>>>>>
> >>>>>> Thats just an example how convenient the STL is. Imagine what effort
> >>>>>> you need to do the exponential growth of the vector yoursel. And you
> >>>>>> don't need to deal with the errors of emplace_back where they happen,
> >>>>>> but just catch bad_alloc some call levels above.
> >>>>>> C++ is full of such convenient features which make a lot of work in C.
> >>>>>
> >>>>>
> >>>>> i dont know what is emplace back and what you mean exponentiol growth
> >>>>> but something like vector in c you do
> >>>>>
> >>>>>
> >>>>> struct ExpressionList { int x; int y; unsigned long long tag;};
> >>>>> static ExpressionList* expression_list1 = NULL;
> >>>>> static int expression_list1_size = 0;
> >>>>>
> >>>>> void expression_list1_AddOne(int i, int j)
> >>>>> {
> >>>>> expression_list1_size++;
> >>>>> expression_list1 = (ExpressionList*) realloc(expression_list1, expression_list1_size * sizeof(ExpressionList) );
> >>>>> expression_list1[expression_list1_size-1] = {i,j};
> >>>>> return ;
> >>>>> }
> >>>>>
> >>>>> if you dont want you might not call reallock by evary add but realoock by *1.5 or bby +1000 or what you
> >>>>> need - but in fact the reallock casches it itself and did not do the reallock by one only really rare so this
> >>>>> reallock called each time is practically near zero cost so its quite okay to call it by one
> >>>>> (add flag enabled to mark record as deleted and some increment cursor code to find empty ones and you got
> >>>>> terribly good and fast container suited for your needs)
> >>>> You don't even have a clue what C++ does for you with the above code..
> >>>> Consider for example the exponential growth of the vector to keep the
> >>>> number of reallocations small; that would be much work in C.
> >>> realloc does it for you
> >>> check this thread
> >>>
> >>> https://groups.google.com/g/comp.lang.c/c/YXejwDRKSAQ/m/E8ka_jpAAgAJ
> >> you see there if you use
> >>
> >> for(int i=1; i<100000; i++)
> >> dipa = AllocChunk(dipa, i);
> >>
> >> where dipa is
> >> struct chunk {char* beg; char* end;};
> >> and AloocChunk is
> >>
> >> chunk AllocChunk(rchunk x, int size)
> >> {
> >> x.c.beg = (char*) realloc(x.c.beg, size );
> >> x.c.end = x.c.beg + size -1;
> >> return x;
> >> }
> >>
> >> the reallock will only work few times other times just return and do nothing (you dont need to hold end pointer as realoock holds it internally but its konda wrong (as there is no accas to it) so i personally prefer to keep both in form of so called chunk
> >>
> >> thsi one offers just resizing but you often need not resizing but more ads and deletes the other code i show shows how to do it in c, you simply hold a static integer that iterates thru records and a flag /enabled in each record which yu set to zero if you want to free that record andhis record and a couple of i++ if you need to find first free record before insertion
> >>
> >> that is what i use insetad of tiotally crapppy pony ++ stl vector for noobs
> > (in fact for ponys not noobs - ponny is better word for that )
> You're nervous and you don't program professionally at at.

well ponnys call themselves profesionally, but this profasionally mean something like a basic problems with logic so it isnt teribbly professional imo

Re: you think rust may outthrone c?

<394f9834-b998-447e-9c42-b59f1646b749n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26487&group=comp.lang.c#26487

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:1a28:b0:400:ab8e:5f86 with SMTP id f40-20020a05622a1a2800b00400ab8e5f86mr12671qtb.3.1690039136982;
Sat, 22 Jul 2023 08:18:56 -0700 (PDT)
X-Received: by 2002:a05:6870:e811:b0:1ba:5cf2:6bbf with SMTP id
o17-20020a056870e81100b001ba5cf26bbfmr5886733oan.6.1690039136697; Sat, 22 Jul
2023 08:18:56 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sat, 22 Jul 2023 08:18:56 -0700 (PDT)
In-Reply-To: <u9grbc$3rqh0$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.8; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.8
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u8o2jf$3isv1$1@bluemanedhawk.eternal-september.org> <u93q47$19p2n$1@dont-email.me>
<u95q1j$1k1sq$1@bluemanedhawk.eternal-september.org> <u991ot$27egh$2@dont-email.me>
<u99qru$2brfo$1@bluemanedhawk.eternal-september.org> <u9atgg$2ku7m$2@dont-email.me>
<u9bafs$2n7dq$1@bluemanedhawk.eternal-september.org> <u9bg5f$2o9ci$1@dont-email.me>
<u9bs1u$2qj43$1@dont-email.me> <u9d79c$34qp8$1@bluemanedhawk.eternal-september.org>
<u9dcb1$35gmv$1@dont-email.me> <u9fpi9$3msci$1@bluemanedhawk.eternal-september.org>
<u9gjsn$3qfeq$2@dont-email.me> <874ebd85-84f6-4959-9ee1-6afd810a5d7dn@googlegroups.com>
<u9gpds$3rdi9$3@dont-email.me> <05c87f55-f8bb-4411-8e5c-9c11829351ean@googlegroups.com>
<u9gqsk$3rn87$1@dont-email.me> <05a15143-1fd2-4152-840b-15cebc067562n@googlegroups.com>
<u9grbc$3rqh0$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <394f9834-b998-447e-9c42-b59f1646b749n@googlegroups.com>
Subject: Re: you think rust may outthrone c?
From: profesor...@gmail.com (fir)
Injection-Date: Sat, 22 Jul 2023 15:18:56 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 6952
 by: fir - Sat, 22 Jul 2023 15:18 UTC

sobota, 22 lipca 2023 o 17:07:38 UTC+2 Bonita Montero napisał(a):
> Am 22.07.2023 um 17:02 schrieb fir:
> > sobota, 22 lipca 2023 o 16:59:45 UTC+2 Bonita Montero napisał(a):
> >> Am 22.07.2023 um 16:48 schrieb fir:
> >>> sobota, 22 lipca 2023 o 16:34:50 UTC+2 Bonita Montero napisał(a):
> >>>> Am 22.07.2023 um 16:19 schrieb fir:
> >>>>> sobota, 22 lipca 2023 o 15:00:22 UTC+2 Bonita Montero napisał(a):
> >>>>>> Am 22.07.2023 um 07:30 schrieb Blue-Maned_Hawk:
> >>>>>>> On 7/21/23 03:32, Bonita Montero wrote:
> >>>>>>>> <snip />
> >>>>>>>>
> >>>>>>>> If you're know C++ halfway you're multiple times faster than
> >>>>>>>> with C, where you have to deal with every details yourself.
> >>>>>>>
> >>>>>>> Okay, where's your evidence for that?
> >>>>>> Show me the C-code for that:
> >>>>>>
> >>>>>> vector<string> vs;
> >>>>>>
> >>>>>> void fn( char const *str )
> >>>>>> {
> >>>>>> vs.emplace_back( str );
> >>>>>> }
> >>>>>>
> >>>>>> Thats just an example how convenient the STL is. Imagine what effort
> >>>>>> you need to do the exponential growth of the vector yoursel. And you
> >>>>>> don't need to deal with the errors of emplace_back where they happen,
> >>>>>> but just catch bad_alloc some call levels above.
> >>>>>> C++ is full of such convenient features which make a lot of work in C.
> >>>>>
> >>>>>
> >>>>> i dont know what is emplace back and what you mean exponentiol growth
> >>>>> but something like vector in c you do
> >>>>>
> >>>>>
> >>>>> struct ExpressionList { int x; int y; unsigned long long tag;};
> >>>>> static ExpressionList* expression_list1 = NULL;
> >>>>> static int expression_list1_size = 0;
> >>>>>
> >>>>> void expression_list1_AddOne(int i, int j)
> >>>>> {
> >>>>> expression_list1_size++;
> >>>>> expression_list1 = (ExpressionList*) realloc(expression_list1, expression_list1_size * sizeof(ExpressionList) );
> >>>>> expression_list1[expression_list1_size-1] = {i,j};
> >>>>> return ;
> >>>>> }
> >>>>>
> >>>>> if you dont want you might not call reallock by evary add but realoock by *1.5 or bby +1000 or what you
> >>>>> need - but in fact the reallock casches it itself and did not do the reallock by one only really rare so this
> >>>>> reallock called each time is practically near zero cost so its quite okay to call it by one
> >>>>> (add flag enabled to mark record as deleted and some increment cursor code to find empty ones and you got
> >>>>> terribly good and fast container suited for your needs)
> >>>> You don't even have a clue what C++ does for you with the above code..
> >>>> Consider for example the exponential growth of the vector to keep the
> >>>> number of reallocations small; that would be much work in C.
> >>>
> >>> realloc does it for you
> >>> check this thread
> >> Absolutely not. When you do an emplace_back the vecotr first checks
> >> if there's enough capacity to hold another element. If not it allo-
> >> cates new memory with a constant factor of the current size, _moves_
> >> all current elements there (huge difference to memcpy()ing since
> >> the objects can have an arbitrary complexity) increases the size by
> >> one, constructs the new object according to the parameters passed
> >> to emplace_back() and, if an exception occurs shrinks back the con-
> >> tainer of the size (!= capacity) before.
> >> Doing that in C would be a lot of work if you have non-trivial
> >> objects as usual.
> >
> > you shouldnt go in crapy 'non trivial' objects - use proper ..c is not for mimicking crap
> That's not crap but standard data structures, handled with the most
> efficient way. Have a look at what an unordered_map saves you a lot
> of work. This is needed really often and in C++ that's a few lines
> of code.

i told you writing such things in c by hand is few lines of code, even if you need something more complex ypu may spend few days on it then use it rest of your life so it is not like you priobably imagine it takes years or months

and if you need something like half of google you may download library

c has some problems that makes some code in old c can be written so celan and short as it could (i wrote tens of times on it) but still is totally unparalebly cleener and better tnan pony++ (named also cobol++, new cobol or c++) - unserstand it or not but note many people has opinion quite other than you so maybe stop repeating it as a spam... if you want so seriously evengelise take my examples write it properly in such clean c and compare, i will not be writng it for you as i gut much better work to do and what you say is totally not interesting those are religious propaganda spam

Re: you think rust may outthrone c?

<u9gtda$3s5fq$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26488&group=comp.lang.c#26488

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Sat, 22 Jul 2023 17:42:37 +0200
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <u9gtda$3s5fq$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u8o2jf$3isv1$1@bluemanedhawk.eternal-september.org>
<u93q47$19p2n$1@dont-email.me>
<u95q1j$1k1sq$1@bluemanedhawk.eternal-september.org>
<u991ot$27egh$2@dont-email.me>
<u99qru$2brfo$1@bluemanedhawk.eternal-september.org>
<u9atgg$2ku7m$2@dont-email.me>
<u9bafs$2n7dq$1@bluemanedhawk.eternal-september.org>
<u9bg5f$2o9ci$1@dont-email.me> <u9bs1u$2qj43$1@dont-email.me>
<u9d79c$34qp8$1@bluemanedhawk.eternal-september.org>
<u9dcb1$35gmv$1@dont-email.me>
<u9fpi9$3msci$1@bluemanedhawk.eternal-september.org>
<u9gjsn$3qfeq$2@dont-email.me>
<874ebd85-84f6-4959-9ee1-6afd810a5d7dn@googlegroups.com>
<u9gpds$3rdi9$3@dont-email.me>
<05c87f55-f8bb-4411-8e5c-9c11829351ean@googlegroups.com>
<u9gqsk$3rn87$1@dont-email.me>
<05a15143-1fd2-4152-840b-15cebc067562n@googlegroups.com>
<u9grbc$3rqh0$1@dont-email.me>
<394f9834-b998-447e-9c42-b59f1646b749n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 22 Jul 2023 15:42:34 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b6114a3f4692fe67f4d329876e1b7ab5";
logging-data="4068858"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19pxBXX5yutWHoebiG6LkDZ0r0C0Ikivqw="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:De5AscuOGnrN8ONVqh5X95j6rY0=
In-Reply-To: <394f9834-b998-447e-9c42-b59f1646b749n@googlegroups.com>
Content-Language: de-DE
 by: Bonita Montero - Sat, 22 Jul 2023 15:42 UTC

Am 22.07.2023 um 17:18 schrieb fir:

> i told you writing such things in c by hand is few lines of code, ...

You don't understand what the C++ containers do. If there wouldn't
be a large productivity ehancement with C++ over C people would use C.
You for sure never programmed professionally.

Re: you think rust may outthrone c?

<e486102e-5f9b-4f47-8df3-39d3db5c2709n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26489&group=comp.lang.c#26489

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:1a28:b0:403:22b8:6e21 with SMTP id f40-20020a05622a1a2800b0040322b86e21mr12796qtb.10.1690040579900;
Sat, 22 Jul 2023 08:42:59 -0700 (PDT)
X-Received: by 2002:a05:6808:198e:b0:3a3:df1d:4369 with SMTP id
bj14-20020a056808198e00b003a3df1d4369mr9768861oib.7.1690040579615; Sat, 22
Jul 2023 08:42:59 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sat, 22 Jul 2023 08:42:59 -0700 (PDT)
In-Reply-To: <u9grbc$3rqh0$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.8; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.8
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u8o2jf$3isv1$1@bluemanedhawk.eternal-september.org> <u93q47$19p2n$1@dont-email.me>
<u95q1j$1k1sq$1@bluemanedhawk.eternal-september.org> <u991ot$27egh$2@dont-email.me>
<u99qru$2brfo$1@bluemanedhawk.eternal-september.org> <u9atgg$2ku7m$2@dont-email.me>
<u9bafs$2n7dq$1@bluemanedhawk.eternal-september.org> <u9bg5f$2o9ci$1@dont-email.me>
<u9bs1u$2qj43$1@dont-email.me> <u9d79c$34qp8$1@bluemanedhawk.eternal-september.org>
<u9dcb1$35gmv$1@dont-email.me> <u9fpi9$3msci$1@bluemanedhawk.eternal-september.org>
<u9gjsn$3qfeq$2@dont-email.me> <874ebd85-84f6-4959-9ee1-6afd810a5d7dn@googlegroups.com>
<u9gpds$3rdi9$3@dont-email.me> <05c87f55-f8bb-4411-8e5c-9c11829351ean@googlegroups.com>
<u9gqsk$3rn87$1@dont-email.me> <05a15143-1fd2-4152-840b-15cebc067562n@googlegroups.com>
<u9grbc$3rqh0$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e486102e-5f9b-4f47-8df3-39d3db5c2709n@googlegroups.com>
Subject: Re: you think rust may outthrone c?
From: profesor...@gmail.com (fir)
Injection-Date: Sat, 22 Jul 2023 15:42:59 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: fir - Sat, 22 Jul 2023 15:42 UTC

sobota, 22 lipca 2023 o 17:07:38 UTC+2 Bonita Montero napisał(a):
> That's not crap but standard data structures, handled with the most
> efficient way. Have a look at what an unordered_map saves you a lot
> of work. This is needed really often and in C++ that's a few lines
> of code.

you think c has no libraries? isnt that stupid do compare pony++ with libraries with c withaut any? does it not make you think? c libraries have simpler interface
but it also has strong advanteges (and this c++ name mangling is trash)

in fact as i said for containers for my usage i dont use libraries as whet i ever need
was a few pices of code i am able to write myself with no problem

(im not programming 'professionally' but you may name it i code hobbystically or legendary depending what you need.. seeing that profesionally i would feel ashemed (if not worse) to be such professional - and this insulting me for writing or not writing professionally is ponish (pony-ish)

Re: you think rust may outthrone c?

<u9gtjm$3s72a$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26490&group=comp.lang.c#26490

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nos...@please.ty (jak)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Sat, 22 Jul 2023 17:45:57 +0200
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <u9gtjm$3s72a$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u8o2jf$3isv1$1@bluemanedhawk.eternal-september.org>
<u93q47$19p2n$1@dont-email.me>
<u95q1j$1k1sq$1@bluemanedhawk.eternal-september.org>
<u991ot$27egh$2@dont-email.me>
<u99qru$2brfo$1@bluemanedhawk.eternal-september.org>
<u9atgg$2ku7m$2@dont-email.me>
<u9bafs$2n7dq$1@bluemanedhawk.eternal-september.org>
<u9bg5f$2o9ci$1@dont-email.me> <u9bs1u$2qj43$1@dont-email.me>
<u9d79c$34qp8$1@bluemanedhawk.eternal-september.org>
<u9dcb1$35gmv$1@dont-email.me>
<u9fpi9$3msci$1@bluemanedhawk.eternal-september.org>
<u9gjsn$3qfeq$2@dont-email.me> <u9gmvs$3r01u$1@dont-email.me>
<u9gp9e$3rdi9$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 22 Jul 2023 15:45:58 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="cdce0a80dcf3f7d6ab5c777e7c22131d";
logging-data="4070474"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+m+/SlLPNsh4VkiUMndgSI"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.16
Cancel-Lock: sha1:+cdeItPWgI56abwC46Y1/w4NCb8=
In-Reply-To: <u9gp9e$3rdi9$2@dont-email.me>
 by: jak - Sat, 22 Jul 2023 15:45 UTC

Bonita Montero ha scritto:
> Am 22.07.2023 um 15:53 schrieb Bart:
>> On 22/07/2023 14:00, Bonita Montero wrote:
>>> Am 22.07.2023 um 07:30 schrieb Blue-Maned_Hawk:
>>>> On 7/21/23 03:32, Bonita Montero wrote:
>>>>> <snip />
>>>>>
>>>>> If you're know C++ halfway you're multiple times faster than
>>>>> with C, where you have to deal with every details yourself.
>>>>
>>>> Okay, where's your evidence for that?
>>>
>>> Show me the C-code for that:
>>>
>>> vector<string> vs;
>>>
>>> void fn( char const *str )
>>> {
>>>      vs.emplace_back( str );
>>> }
>>>
>>> Thats just an example how convenient the STL is. Imagine what effort
>>> you need to do the exponential growth of the vector yoursel. And you
>>> don't need to deal with the errors of emplace_back where they happen,
>>> but just catch bad_alloc some call levels above.
>>> C++ is full of such convenient features which make a lot of work in C.
>>
>>
>> If you going to use a function anyway, and not special syntax like vs
>> += str, then you can emulate this in C easily. Sure you need a few
>> dozen lines of code, but how big is the STL that you'd need to compile
>> into every program.
>
> Show me how to do what I did in C. The above code increases the size
> of the vector, thereby increasing the capacity exponentially (amortized
> constant overhead) if necessary, constructs the string-object, thereby
> allocating the storage of the string and if that fails the capacity
> remains and the size is the old. That's a lot of work you'd have to
> do in C over and over since it lacks the language facilites to to
> that as convenient.

<https://github.com/Mashpoe/c-vector/blob/master/vec.c>

Re: you think rust may outthrone c?

<u9gtpa$3s5qr$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26491&group=comp.lang.c#26491

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bc...@freeuk.com (Bart)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Sat, 22 Jul 2023 16:48:59 +0100
Organization: A noiseless patient Spider
Lines: 70
Message-ID: <u9gtpa$3s5qr$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u8o2jf$3isv1$1@bluemanedhawk.eternal-september.org>
<u93q47$19p2n$1@dont-email.me>
<u95q1j$1k1sq$1@bluemanedhawk.eternal-september.org>
<u991ot$27egh$2@dont-email.me>
<u99qru$2brfo$1@bluemanedhawk.eternal-september.org>
<u9atgg$2ku7m$2@dont-email.me>
<u9bafs$2n7dq$1@bluemanedhawk.eternal-september.org>
<u9bg5f$2o9ci$1@dont-email.me> <u9bs1u$2qj43$1@dont-email.me>
<u9d79c$34qp8$1@bluemanedhawk.eternal-september.org>
<u9dcb1$35gmv$1@dont-email.me>
<u9fpi9$3msci$1@bluemanedhawk.eternal-september.org>
<u9gjsn$3qfeq$2@dont-email.me> <u9gmvs$3r01u$1@dont-email.me>
<u9gp9e$3rdi9$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 22 Jul 2023 15:48:58 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e56898821d7c0219e079c4f94d2335de";
logging-data="4069211"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+1xUk3JD/7uO/Cp01hM1JWcuQoBInxge0="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:P7y/wMtJJwy7IucWCnFTuab29p0=
In-Reply-To: <u9gp9e$3rdi9$2@dont-email.me>
 by: Bart - Sat, 22 Jul 2023 15:48 UTC

On 22/07/2023 15:32, Bonita Montero wrote:
> Am 22.07.2023 um 15:53 schrieb Bart:
>> On 22/07/2023 14:00, Bonita Montero wrote:
>>> Am 22.07.2023 um 07:30 schrieb Blue-Maned_Hawk:
>>>> On 7/21/23 03:32, Bonita Montero wrote:
>>>>> <snip />
>>>>>
>>>>> If you're know C++ halfway you're multiple times faster than
>>>>> with C, where you have to deal with every details yourself.
>>>>
>>>> Okay, where's your evidence for that?
>>>
>>> Show me the C-code for that:
>>>
>>> vector<string> vs;
>>>
>>> void fn( char const *str )
>>> {
>>>      vs.emplace_back( str );
>>> }
>>>
>>> Thats just an example how convenient the STL is. Imagine what effort
>>> you need to do the exponential growth of the vector yoursel. And you
>>> don't need to deal with the errors of emplace_back where they happen,
>>> but just catch bad_alloc some call levels above.
>>> C++ is full of such convenient features which make a lot of work in C.
>>
>>
>> If you going to use a function anyway, and not special syntax like vs
>> += str, then you can emulate this in C easily. Sure you need a few
>> dozen lines of code, but how big is the STL that you'd need to compile
>> into every program.
>
> Show me how to do what I did in C. The above code increases the size
> of the vector, thereby increasing the capacity exponentially (amortized
> constant overhead) if necessary, constructs the string-object, thereby
> allocating the storage of the string and if that fails the capacity
> remains and the size is the old. That's a lot of work you'd have to
> do in C over and over since it lacks the language facilites to to
> that as convenient.

I misunderstood your code to be defining a string which it then appends
to, that's how clear it was!

So my C equivalent created a suitable string type which it then appended
to in a loop like this:

appendsv(s, "Hello");

The whole C 'library' to create, append to and free such a type was 50
lines of code.

I then compared it in speed with a C++ version that did the same thing:

#include <iostream>
using namespace std;

string vs;

int main(void) {
for (int i=0; i<100000000; ++i)
vs +="Hello";

std::cout << vs.size();
}

Optimised, it ran in 0.8 seconds. My optimised C ran in 0.55 seconds.

BTW if I leave off the `()` at the end of that C++ code, I get 400 lines
of impenetrable error messages.


devel / comp.lang.c / Re: you think rust may *DE*throne c?

Pages:123456789101112131415161718192021222324252627282930313233343536373839
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor