Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Every living thing wants to survive. -- Spock, "The Ultimate Computer", stardate 4731.3


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 *DE*throne c?

<ub2bvt$b6ko$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED.cpc109573-know16-2-0-cust636.17-2.cable.virginm.net!not-for-mail
From: bc...@freeuk.com (Bart)
Newsgroups: comp.lang.c
Subject: Re: you think rust may *DE*throne c?
Date: Thu, 10 Aug 2023 10:51:58 +0100
Organization: A noiseless patient Spider
Message-ID: <ub2bvt$b6ko$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<uaavm0$3ln4f$1@dont-email.me> <uab5ja$3mc91$1@dont-email.me>
<uabeq1$3nigh$1@dont-email.me> <uabobj$3oias$1@dont-email.me>
<uaduf0$54pp$1@dont-email.me> <uajaqg$1bc41$4@dont-email.me>
<uajfq3$1cesi$1@dont-email.me> <uat7t4$3cco6$1@dont-email.me>
<uat9ca$3cjmt$1@dont-email.me> <uatjcp$3ec7b$1@dont-email.me>
<uatlrr$3epln$1@dont-email.me> <uatr2m$3fla4$1@dont-email.me>
<909acf23-ef0e-44c7-9ebf-89846e50e871n@googlegroups.com>
<p_uAM.489417$mPI2.398490@fx15.iad>
<e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com>
<87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me>
<slrnud6spf.f45.dan@djph.net> <ub010k$3um69$1@dont-email.me>
<ub245n$aa8v$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 10 Aug 2023 09:51:57 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="cpc109573-know16-2-0-cust636.17-2.cable.virginm.net:94.175.38.125";
logging-data="367256"; mail-complaints-to="abuse@eternal-september.org"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
In-Reply-To: <ub245n$aa8v$1@dont-email.me>
 by: Bart - Thu, 10 Aug 2023 09:51 UTC

On 10/08/2023 08:38, David Brown wrote:
> On 09/08/2023 14:32, Bart wrote:
>> On 09/08/2023 12:05, Dan Purgert wrote:
>> > On 2023-08-09, Bart wrote:
>> >> On 09/08/2023 03:04, Ben Bacarisse wrote:
>>
>> >> How does it know then to deal with prog.c and not prog.cpp or
>> prog.ftn?
>> >
>> > Because you wrote your makefile target such that it's dealing with
>> > "prog.c" and not prog.cpp or prog.ftn. Make isn't intelligent in the
>> > case of changing file extensions or similar. For example, renaming
>> > "prog.c" to "prog.cpp" will result in 'file not found' errors when
>> make
>> > is trying to run the defined 'gcc prog.c -o prog' command.
>>
>> I was replying to a post that says you can use 'make' without any
>> makefile; give it a filename, not even an extension, and it can
>> determine exactly what you want to do, even though it is not specific
>> to a language or compiler.
>>
>
> You can. Make installations usually have a set of default rules that
> work in simple cases.
>
> But if you have a more advanced case, you need at least some rules in
> your makefile. Surely this is not a surprise to you.

Compared to what I normally do, 'make' is neolithic.

Given the lead module 'prog.m' of any project, no matter where it is
located:

mm prog # compiles to prog.exe
ms prog # compiles and runs it (there is no .exe)

Given the lead module 'prog.q' of any scripting project:

qq prog # runs it

'make'? Where are we, in the 1980s still? (Even then /I/ was using IDEs
that whizzed through the modules of my projects!)

So all this stuff about extensions and gcc and make, for me is a
sideshow. It's only relevant when stuff to do with C comes up.

>> * You have to supply the extension (I hate that)
>
> We all feel /so/ sorry for you. Imagine having to type ".c" sometimes -
> the horror! If you add up all the Usenet posts you've made complaining
> about trivia, it would cover many lifetimes' worth of ".c" or "_t".

It is not sometimes, it's pretty much every time you run a language
tool; this is not limited to C, or compilers.

On Linux, it even applies to running executables. I imagine this is one
reason why Linux executable files don't have have extensions, otherwise
you'd have to do 'gcc.exe prog.c'.

/My/ tools tend to work on a specific file type, which becomes the
default since 100% of inputs will have that extension; what is the point
of typing it?

They are a total joy to use.

Yes, I know that gcc works on a million different languages, that was a
mistake. (Although in that case, what is the purpose of having 'g++'?)

Anyway all you suckers can keep typing your extensions; it's no skin off
my nose!

>> You have to define set of dependences between modules (and you may
>> need to do that manually, so it can be error prone).
>>
>
> I do it all automatically. But you'll blow a fuse if I try to tell you
> how.

At what point in C's evolution did that come about? And is it a reason
why it never acquired a proper module system?

In any case, if it can do automatically, presumably via some special
incantations fed to gcc, why is there a need for a makefile; why doesn't
gcc use its special powers to determine what to compile, using those
same incantations?

In my latest module system, there is nothing clever: all the modules
comprising a project are listed in the lead module. (In the 1980s, they
were listed in a project file the IDE used.)

You have to list a set of all enum names; modules are no different.

Only my C compiler tries something clever to discover all the modules
comprising a project, by recursively following #includes starting from
the lead modules. But it can't work in general because the pattern of .h
and .c files in C can be chaotic.

Re: you think rust may *DE*throne c?

<4n6BM.359401$xMqa.122594@fx12.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx12.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: you think rust may *DE*throne c?
Newsgroups: comp.lang.c
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com> <uajfq3$1cesi$1@dont-email.me> <uat7t4$3cco6$1@dont-email.me> <uat9ca$3cjmt$1@dont-email.me> <uatjcp$3ec7b$1@dont-email.me> <uatlrr$3epln$1@dont-email.me> <uatr2m$3fla4$1@dont-email.me> <909acf23-ef0e-44c7-9ebf-89846e50e871n@googlegroups.com> <p_uAM.489417$mPI2.398490@fx15.iad> <e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com> <87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me> <87bkffg6qz.fsf@bsb.me.uk>
Lines: 17
Message-ID: <4n6BM.359401$xMqa.122594@fx12.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Thu, 10 Aug 2023 14:20:48 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Thu, 10 Aug 2023 14:20:48 GMT
X-Received-Bytes: 1589
 by: Scott Lurndal - Thu, 10 Aug 2023 14:20 UTC

Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>Bart <bc@freeuk.com> writes:
>

>> So how does make help here?
>
>There go the goalposts again. Why would it? Mind you, I don't like
>your commands since they overwrite the same executable. When comparing
>compilers and flags I use a one-line shell function so that the output
>file is, for example, 'gcc-O1-prog'.

Indeed, even something as simple as

make NO_OPTIMIZE

is sufficient if the makefile is properly written.

Re: you think rust may *DE*throne c?

<8o6BM.359402$xMqa.47599@fx12.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx12.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: you think rust may *DE*throne c?
Newsgroups: comp.lang.c
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com> <uat9ca$3cjmt$1@dont-email.me> <uatjcp$3ec7b$1@dont-email.me> <uatlrr$3epln$1@dont-email.me> <uatr2m$3fla4$1@dont-email.me> <909acf23-ef0e-44c7-9ebf-89846e50e871n@googlegroups.com> <p_uAM.489417$mPI2.398490@fx15.iad> <e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com> <87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me> <87bkffg6qz.fsf@bsb.me.uk> <ub1840$3q1k$1@dont-email.me> <20230809171316.695@kylheku.com>
Lines: 17
Message-ID: <8o6BM.359402$xMqa.47599@fx12.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Thu, 10 Aug 2023 14:21:56 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Thu, 10 Aug 2023 14:21:56 GMT
X-Received-Bytes: 1693
 by: Scott Lurndal - Thu, 10 Aug 2023 14:21 UTC

Kaz Kylheku <864-117-4973@kylheku.com> writes:
>On 2023-08-09, Bart <bc@freeuk.com> wrote:
>> So if everyone thinks it's bad, WHY HAS IT NOT BEEN FIXED? Bite the
>
>If I were to guess, it's because the only person in the world who cares
>about it just complains in a newsgroup, that nobody in GCC development
>reads.
>
>Plus there are probably scripts out there that depend on a.out
>popping out of the compiler.
>
>(The GCC people don't even read the mailing list intended for GCC
>patches. In April 2022 I submitted a change (documented and test cased).
>Pinged a few times over the following six months. Never got a reply.)

That doesn't mean it wasn't read.

Re: you think rust may *DE*throne c?

<np6BM.359403$xMqa.40798@fx12.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx12.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: you think rust may *DE*throne c?
Newsgroups: comp.lang.c
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com> <uatlrr$3epln$1@dont-email.me> <uatr2m$3fla4$1@dont-email.me> <909acf23-ef0e-44c7-9ebf-89846e50e871n@googlegroups.com> <p_uAM.489417$mPI2.398490@fx15.iad> <e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com> <87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me> <87bkffg6qz.fsf@bsb.me.uk> <ub1840$3q1k$1@dont-email.me> <20230809171316.695@kylheku.com> <ub1dsn$4b9s$1@dont-email.me> <20230809190512.308@kylheku.com>
Lines: 21
Message-ID: <np6BM.359403$xMqa.40798@fx12.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Thu, 10 Aug 2023 14:23:15 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Thu, 10 Aug 2023 14:23:15 GMT
X-Received-Bytes: 1825
 by: Scott Lurndal - Thu, 10 Aug 2023 14:23 UTC

Kaz Kylheku <864-117-4973@kylheku.com> writes:
>On 2023-08-10, Bart <bc@freeuk.com> wrote:
>> On 10/08/2023 01:21, Kaz Kylheku wrote:
>> > On 2023-08-09, Bart <bc@freeuk.com> wrote:
>> >> So if everyone thinks it's bad, WHY HAS IT NOT BEEN FIXED? Bite the
>> >
>> > If I were to guess, it's because the only person in the world who cares
>> > about it just complains in a newsgroup, that nobody in GCC development
>> > reads.
>> >
>> > Plus there are probably scripts out there that depend on a.out
>> > popping out of the compiler.
>>
>> How many depend on a.exe coming out of it?
>
>That's not easily knowable.

Perhaps not, but it is a logical extention of the historic practice
of generating a.out on unix-like systems with suitable modification
for the windows file extension scheme.

Re: you think rust may *DE*throne c?

<rq6BM.359404$xMqa.260532@fx12.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!newsfeed.hasname.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx12.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: you think rust may *DE*throne c?
Newsgroups: comp.lang.c
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com> <uatlrr$3epln$1@dont-email.me> <uatr2m$3fla4$1@dont-email.me> <909acf23-ef0e-44c7-9ebf-89846e50e871n@googlegroups.com> <p_uAM.489417$mPI2.398490@fx15.iad> <e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com> <87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me> <87bkffg6qz.fsf@bsb.me.uk> <ub1840$3q1k$1@dont-email.me> <20230809171316.695@kylheku.com> <68da0b32-268d-4309-891b-740daa604f89n@googlegroups.com>
Lines: 14
Message-ID: <rq6BM.359404$xMqa.260532@fx12.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Thu, 10 Aug 2023 14:24:23 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Thu, 10 Aug 2023 14:24:23 GMT
X-Received-Bytes: 1641
 by: Scott Lurndal - Thu, 10 Aug 2023 14:24 UTC

Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>On Thursday, 10 August 2023 at 01:21:40 UTC+1, Kaz Kylheku wrote:
>> On 2023-08-09, Bart <b...@freeuk.com> wrote:
>> > So if everyone thinks it's bad, WHY HAS IT NOT BEEN FIXED? Bite the
>> If I were to guess, it's because the only person in the world who cares
>> about it just complains in a newsgroup, that nobody in GCC development
>> reads.
>>
>When I first used it, I thought it was a bit odd. Especially when the second
>run overwrote a.out instead of writing b.out.

As Keith pointed out, 'a.out' was the output from the assembler
back in the day.

Re: you think rust may *DE*throne c?

<Hr6BM.359405$xMqa.20823@fx12.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx12.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: you think rust may *DE*throne c?
Newsgroups: comp.lang.c
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com> <uat9ca$3cjmt$1@dont-email.me> <uatjcp$3ec7b$1@dont-email.me> <uatlrr$3epln$1@dont-email.me> <uatr2m$3fla4$1@dont-email.me> <909acf23-ef0e-44c7-9ebf-89846e50e871n@googlegroups.com> <p_uAM.489417$mPI2.398490@fx15.iad> <e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com> <87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me> <87bkffg6qz.fsf@bsb.me.uk> <ub1840$3q1k$1@dont-email.me> <87zg2zej54.fsf@bsb.me.uk>
Lines: 11
Message-ID: <Hr6BM.359405$xMqa.20823@fx12.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Thu, 10 Aug 2023 14:25:43 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Thu, 10 Aug 2023 14:25:43 GMT
X-Received-Bytes: 1335
 by: Scott Lurndal - Thu, 10 Aug 2023 14:25 UTC

Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>Bart <bc@freeuk.com> writes:

>> If working with Linux and you need -lm, then 'make prog' won't work. That's
>> just a fact.
>
>2+2 = 4. That's just a fact.

Indeed, and it is a fact for _any_ library containing optional functionality
that is needed by the application.

Re: you think rust may *DE*throne c?

<Ft6BM.359406$xMqa.64508@fx12.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx12.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: you think rust may *DE*throne c?
Newsgroups: comp.lang.c
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com> <uat7t4$3cco6$1@dont-email.me> <uat9ca$3cjmt$1@dont-email.me> <uatjcp$3ec7b$1@dont-email.me> <uatlrr$3epln$1@dont-email.me> <uatr2m$3fla4$1@dont-email.me> <909acf23-ef0e-44c7-9ebf-89846e50e871n@googlegroups.com> <p_uAM.489417$mPI2.398490@fx15.iad> <e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com> <87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me> <ub1358$3806$1@dont-email.me> <ub173j$3mno$1@dont-email.me>
Lines: 13
Message-ID: <Ft6BM.359406$xMqa.64508@fx12.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Thu, 10 Aug 2023 14:27:49 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Thu, 10 Aug 2023 14:27:49 GMT
X-Received-Bytes: 1471
 by: Scott Lurndal - Thu, 10 Aug 2023 14:27 UTC

Bart <bc@freeuk.com> writes:
>On 09/08/2023 23:15, David Brown wrote:

>
> > Only a perverse masochist would want to have the same output file for
> > all of these, as they would be impossible to test.
>
>Well, they /are/ the same program! The thing about gcc is that it keeps
>using the same output file even for DIFFERENT programs.

No, it doesn't. You are the only person in the world that doesn't
specify the -o option to the tool chain.

Making accountants cross (wa Re: you think rust may outthrone c?)

<ub2sp5$d6sv$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: vir.camp...@invalid.invalid (Vir Campestris)
Newsgroups: comp.lang.c
Subject: Making accountants cross (wa Re: you think rust may outthrone c?)
Date: Thu, 10 Aug 2023 15:38:29 +0100
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <ub2sp5$d6sv$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<uag05n$nmu5$1@dont-email.me> <uagcgc$ppbn$1@dont-email.me>
<87fs50ulog.fsf@bsb.me.uk> <uagpni$rt71$1@dont-email.me>
<87r0ohrvg0.fsf@bsb.me.uk> <uamlh1$1tr9i$1@dont-email.me>
<875y5tkptn.fsf@bsb.me.uk> <uans1e$26toe$1@dont-email.me>
<87cyzzkfxh.fsf@nosuchdomain.example.com> <uap5e6$2gd8e$1@dont-email.me>
<87350vke4n.fsf@nosuchdomain.example.com> <uap73l$2gktp$1@dont-email.me>
<87y1initxx.fsf@nosuchdomain.example.com> <uapf90$2ht0t$1@dont-email.me>
<87leenirja.fsf@nosuchdomain.example.com> <uaqdst$2q82c$1@dont-email.me>
<8M4AM.510037$TPw2.337804@fx17.iad> <uaqqou$2sa5t$1@dont-email.me>
<87wmy6j37n.fsf@bsb.me.uk>
<ad304448-30f9-4630-83c2-7d19c026fa31n@googlegroups.com>
<87r0oej0rt.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 10 Aug 2023 14:38:29 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="0414bc80f25c5e7845fd11fd04d5817f";
logging-data="433055"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+FlFT4rwVscaDBM83FWw4/uMrAtMuuZNg="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:JPwFXoFQFMrNDsyUcE0O71ZMnK8=
Content-Language: en-GB
In-Reply-To: <87r0oej0rt.fsf@bsb.me.uk>
 by: Vir Campestris - Thu, 10 Aug 2023 14:38 UTC

On 07/08/2023 17:05, Ben Bacarisse wrote:
> Hmm... With statically allocated strings, or using malloc and therefore
> requiring free call not shown?
>
> I would rather do this: anywhere a type is defined, I'd define a FMT_xxx
> macro:
>
> typedef float salary_t;
> #define FMT_SALARY "f"
>
> typedef unsigned long int payrollid_t;
> #define FMT_PAYROLLID "lu"
>
> so that one can write
>
> printf("Hello %s your salary is %" FMT_SALLARY
> ", your payrollid %" FMT_PAYROLLID "\n",
> employee.name, employee.salary, employee.payrollid);
>
> -- Ben.

Ben, if you put floating points in money accountants get upset.

Three employees are paid $100.00, so it adds up to $300.

Deduct $20 from each, and it's $240.

Use floating point and sooner or later it won't add up. You can't have a
third of a cent.

Use integers and cents for money. Or pounds, shekels, whatever...

Andy

Re: you think rust may *DE*throne c?

<87o7jfdjf5.fsf@bsb.me.uk>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: you think rust may *DE*throne c?
Date: Thu, 10 Aug 2023 16:08:30 +0100
Organization: A noiseless patient Spider
Lines: 50
Message-ID: <87o7jfdjf5.fsf@bsb.me.uk>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<uaavm0$3ln4f$1@dont-email.me> <uab5ja$3mc91$1@dont-email.me>
<uabeq1$3nigh$1@dont-email.me> <uabobj$3oias$1@dont-email.me>
<uaduf0$54pp$1@dont-email.me> <uajaqg$1bc41$4@dont-email.me>
<uajfq3$1cesi$1@dont-email.me> <uat7t4$3cco6$1@dont-email.me>
<uat9ca$3cjmt$1@dont-email.me> <uatjcp$3ec7b$1@dont-email.me>
<uatlrr$3epln$1@dont-email.me> <uatr2m$3fla4$1@dont-email.me>
<909acf23-ef0e-44c7-9ebf-89846e50e871n@googlegroups.com>
<p_uAM.489417$mPI2.398490@fx15.iad>
<e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com>
<87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me>
<87bkffg6qz.fsf@bsb.me.uk>
<1b31e9c0-0162-4bce-8cf9-69f6704ca429n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: dont-email.me; posting-host="1e9312cf9931c060dc623a19d6d4488d";
logging-data="435270"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+KsS8wB5Na5t/Apvou3rh06+hhxRLW+dk="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:gWFiucjjjEWFbGB6/pX8WfZ0cgA=
sha1:6K+qvKQyjPH79IqR75i3olr9iaQ=
X-BSB-Auth: 1.30f2606b3902f2f8b875.20230810160830BST.87o7jfdjf5.fsf@bsb.me.uk
 by: Ben Bacarisse - Thu, 10 Aug 2023 15:08 UTC

Michael S <already5chosen@yahoo.com> writes:

> On Thursday, August 10, 2023 at 2:01:55 AM UTC+3, Ben Bacarisse wrote:
>> Bart <b...@freeuk.com> writes:
>>
>> > On 09/08/2023 03:04, Ben Bacarisse wrote:
>> >> Malcolm McLean <malcolm.ar...@gmail.com> writes:
>> >>
>> >>> On Tuesday, 8 August 2023 at 18:32:21 UTC+1, Scott Lurndal wrote:
>> >>>>
>> >>>> 1) Using a make variable in the rule for '.c' -> '.o' and setting the
>> >>>> variable to the name of the compiler:
>> >>>>
>> >>>> CC=bcc
>> >>>> ...
>> >>>> %.o: %.c
>> >>>> @$(QUIET) || echo " COMPILE $<"
>> >>>> $(HUSHCOMPILE)$(CC) $(CFLAGS) -MMD -MP -o $@ -c $<
>> >>>>
>> >>> Exactly,
>> >>> Bart is right.
>> >>
>> >> You are deliberately ignoring the context. Bart wants gcc prog.c to
>> >> write to prog, but in the computer world I inhabit, you do that with
>> >> make prog.
>> >
>> > This is a good example of double standards.
>> >
>> > I've complained in the past about having to supply the .c extension to a
>> > /C/ compiler.
>> >
>> > Now here make does not need an extension.
>>
>> I call it consistency. A compiler is given the file to process, make is
>> given the file to build (AKA "make").
>
> I disagree.

OK, but your disagreement is about something else.

> Consistent design, a.k.a. principle of minimal surprise, would be for
> basal utility 'make' to have no built-in rules. On top of it, system
> can supply one or more extended utilities, probably implemented as
> shell scripts, that do have built-in rules.

So you also disagree with Bart whose compiler has a built-in rule about
what file extension to assume. You probably won't bring that up, though.

--
Ben.

Re: you think rust may *DE*throne c?

<87il9ndiz9.fsf@bsb.me.uk>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: you think rust may *DE*throne c?
Date: Thu, 10 Aug 2023 16:18:02 +0100
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <87il9ndiz9.fsf@bsb.me.uk>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<uat9ca$3cjmt$1@dont-email.me> <uatjcp$3ec7b$1@dont-email.me>
<uatlrr$3epln$1@dont-email.me> <uatr2m$3fla4$1@dont-email.me>
<909acf23-ef0e-44c7-9ebf-89846e50e871n@googlegroups.com>
<p_uAM.489417$mPI2.398490@fx15.iad>
<e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com>
<87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me>
<87bkffg6qz.fsf@bsb.me.uk> <ub1840$3q1k$1@dont-email.me>
<87zg2zej54.fsf@bsb.me.uk> <Hr6BM.359405$xMqa.20823@fx12.iad>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="1e9312cf9931c060dc623a19d6d4488d";
logging-data="435270"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX194wsciJ0SfNfFKBjCsy+q/pbb6Sn2ufMo="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:3M3bBXLiqQnDd1K9RokEpTiwiBA=
sha1:KMNLBNWUlSG4RSLJHmUl+ZBYPJo=
X-BSB-Auth: 1.5564171f8f8bc1af1ff5.20230810161802BST.87il9ndiz9.fsf@bsb.me.uk
 by: Ben Bacarisse - Thu, 10 Aug 2023 15:18 UTC

scott@slp53.sl.home (Scott Lurndal) writes:

> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>>Bart <bc@freeuk.com> writes:
>
>>> If working with Linux and you need -lm, then 'make prog' won't work. That's
>>> just a fact.
>>
>>2+2 = 4. That's just a fact.
>
> Indeed, and it is a fact for _any_ library containing optional functionality
> that is needed by the application.

That's only true in a circular way. Why are the math functions
considered optional? Why not, for example, consider the IO functions
optional so that any program that includes <stdio.h> has to link with
-lio? (I know the history -- that's not what I'm asking.)

There's even a division that could be justified by the standard. Any
program that uses functions not required in a freestanding
implementation could be obliged to link with -lhosted, but requiring -lm
is just a historical barnacle.

--
Ben.

Re: Making accountants cross (wa Re: you think rust may outthrone c?)

<87cyzuex5j.fsf@bsb.me.uk>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: Making accountants cross (wa Re: you think rust may outthrone c?)
Date: Thu, 10 Aug 2023 16:26:32 +0100
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <87cyzuex5j.fsf@bsb.me.uk>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<87fs50ulog.fsf@bsb.me.uk> <uagpni$rt71$1@dont-email.me>
<87r0ohrvg0.fsf@bsb.me.uk> <uamlh1$1tr9i$1@dont-email.me>
<875y5tkptn.fsf@bsb.me.uk> <uans1e$26toe$1@dont-email.me>
<87cyzzkfxh.fsf@nosuchdomain.example.com>
<uap5e6$2gd8e$1@dont-email.me>
<87350vke4n.fsf@nosuchdomain.example.com>
<uap73l$2gktp$1@dont-email.me>
<87y1initxx.fsf@nosuchdomain.example.com>
<uapf90$2ht0t$1@dont-email.me>
<87leenirja.fsf@nosuchdomain.example.com>
<uaqdst$2q82c$1@dont-email.me> <8M4AM.510037$TPw2.337804@fx17.iad>
<uaqqou$2sa5t$1@dont-email.me> <87wmy6j37n.fsf@bsb.me.uk>
<ad304448-30f9-4630-83c2-7d19c026fa31n@googlegroups.com>
<87r0oej0rt.fsf@bsb.me.uk> <ub2sp5$d6sv$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="1e9312cf9931c060dc623a19d6d4488d";
logging-data="435270"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/LFYt+t0pApxL8VG5RJ7KVym9YLy6fJPA="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:AQN4kErVMr1xkRKr6tQNaFWb6Ew=
sha1:SuEMD4UAz9efbLU4AQIiIE5757o=
X-BSB-Auth: 1.5379d6db48ff712ce678.20230810162632BST.87cyzuex5j.fsf@bsb.me.uk
 by: Ben Bacarisse - Thu, 10 Aug 2023 15:26 UTC

Vir Campestris <vir.campestris@invalid.invalid> writes:

> On 07/08/2023 17:05, Ben Bacarisse wrote:
>> Hmm... With statically allocated strings, or using malloc and therefore
>> requiring free call not shown?
>> I would rather do this: anywhere a type is defined, I'd define a FMT_xxx
>> macro:
>> typedef float salary_t;
>> #define FMT_SALARY "f"
>> typedef unsigned long int payrollid_t;
>> #define FMT_PAYROLLID "lu"
>> so that one can write
>> printf("Hello %s your salary is %" FMT_SALLARY
>> ", your payrollid %" FMT_PAYROLLID "\n",
>> employee.name, employee.salary, employee.payrollid);
>> -- Ben.
>
> Ben, if you put floating points in money accountants get upset.

I'm not. When I offer an alternative to someone's code, I change as
little as possible to keep the discussion focused. I took Malcolm's
QFMT_REAL to denote some real floating-point type.

--
Ben.

Re: you think rust may *DE*throne c?

<ub2vvq$doo0$1@dont-email.me>

  copy mid

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

  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 *DE*throne c?
Date: Thu, 10 Aug 2023 16:33:15 +0100
Organization: A noiseless patient Spider
Lines: 56
Message-ID: <ub2vvq$doo0$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<uat9ca$3cjmt$1@dont-email.me> <uatjcp$3ec7b$1@dont-email.me>
<uatlrr$3epln$1@dont-email.me> <uatr2m$3fla4$1@dont-email.me>
<909acf23-ef0e-44c7-9ebf-89846e50e871n@googlegroups.com>
<p_uAM.489417$mPI2.398490@fx15.iad>
<e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com>
<87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me>
<87bkffg6qz.fsf@bsb.me.uk> <ub1840$3q1k$1@dont-email.me>
<87zg2zej54.fsf@bsb.me.uk> <Hr6BM.359405$xMqa.20823@fx12.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 10 Aug 2023 15:33:14 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="133262a320001d4d748f60986a4adb35";
logging-data="451328"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/WFp+3R0jX/rdcbh3aQVc8cus98EMwYAM="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:vWQJcTSS8jGFMz1vXMko2DhVXHk=
In-Reply-To: <Hr6BM.359405$xMqa.20823@fx12.iad>
 by: Bart - Thu, 10 Aug 2023 15:33 UTC

On 10/08/2023 15:25, Scott Lurndal wrote:
> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>> Bart <bc@freeuk.com> writes:
>
>>> If working with Linux and you need -lm, then 'make prog' won't
work. That's
>>> just a fact.
>>
>> 2+2 = 4. That's just a fact.
>
> Indeed, and it is a fact for _any_ library containing optional
functionality
> that is needed by the application.
>

Yet, C programs can use `printf` without needing to specifically link in
a library for it. What's the difference with `sqrt`?

One difference is that many machines these days actually implement sqrt
in the hardware, but very few implement printf in hardware. Yet guess
which one is made optional.

How big is the library (libm.so?) anyway?

My own library from 8-bit days, where I also had to emulate basic
floating point arithmetic, was 4KB IIRC, on a 64KB machine. What's the
hit these days?

From stackoverflow answering why -lm is needed:

"Because of ridiculous historical practice that nobody is willing to
fix. Consolidating all of the functions required by C and POSIX into a
single library file would not only avoid this question getting asked
over and over, but would also save a significant amount of time and
memory when dynamic linking, since each .so file linked requires the
filesystem operations to locate and find it, and a few pages for its
static variables, relocations, etc."

https://stackoverflow.com/questions/1033898/why-do-you-have-to-link-the-math-library-in-c

On Windows, such functions are in msvcrt.dll, and the total size of
that, for 1400 functions in total, is 700KB. But since it is so widely
used, it is near-100% certain that it is already in memory.

(I suspect libm is already incorporated into a bigger library, but '-lm'
is needed for 'historical' reasons.)

But this is by the by; in my stuff I haven't needed to worry about
special options to include maths libraries since ... never. Other than
having to /implementent/ such libraries and support.

I'm just bemused by C users (and on Linux) having to bother themselves
with it.

Re: Making accountants cross (wa Re: you think rust may outthrone c?)

<ub304i$doo0$2@dont-email.me>

  copy mid

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

  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: Making accountants cross (wa Re: you think rust may outthrone c?)
Date: Thu, 10 Aug 2023 16:35:47 +0100
Organization: A noiseless patient Spider
Lines: 41
Message-ID: <ub304i$doo0$2@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<uag05n$nmu5$1@dont-email.me> <uagcgc$ppbn$1@dont-email.me>
<87fs50ulog.fsf@bsb.me.uk> <uagpni$rt71$1@dont-email.me>
<87r0ohrvg0.fsf@bsb.me.uk> <uamlh1$1tr9i$1@dont-email.me>
<875y5tkptn.fsf@bsb.me.uk> <uans1e$26toe$1@dont-email.me>
<87cyzzkfxh.fsf@nosuchdomain.example.com> <uap5e6$2gd8e$1@dont-email.me>
<87350vke4n.fsf@nosuchdomain.example.com> <uap73l$2gktp$1@dont-email.me>
<87y1initxx.fsf@nosuchdomain.example.com> <uapf90$2ht0t$1@dont-email.me>
<87leenirja.fsf@nosuchdomain.example.com> <uaqdst$2q82c$1@dont-email.me>
<8M4AM.510037$TPw2.337804@fx17.iad> <uaqqou$2sa5t$1@dont-email.me>
<87wmy6j37n.fsf@bsb.me.uk>
<ad304448-30f9-4630-83c2-7d19c026fa31n@googlegroups.com>
<87r0oej0rt.fsf@bsb.me.uk> <ub2sp5$d6sv$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 10 Aug 2023 15:35:46 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="133262a320001d4d748f60986a4adb35";
logging-data="451328"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18thTt7Y5HGrPlxmmgw1JY2tw6xtZtTbyQ="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:w+1tk20Cycpqv+vZO8Oq4ewvJJI=
In-Reply-To: <ub2sp5$d6sv$1@dont-email.me>
 by: Bart - Thu, 10 Aug 2023 15:35 UTC

On 10/08/2023 15:38, Vir Campestris wrote:
> On 07/08/2023 17:05, Ben Bacarisse wrote:
>> Hmm...  With statically allocated strings, or using malloc and therefore
>> requiring free call not shown?
>>
>> I would rather do this: anywhere a type is defined, I'd define a FMT_xxx
>> macro:
>>
>>    typedef float salary_t;
>>    #define FMT_SALARY "f"
>>
>>    typedef unsigned long int payrollid_t;
>>    #define FMT_PAYROLLID "lu"
>>
>> so that one can write
>>
>>    printf("Hello %s your salary is %" FMT_SALLARY
>>           ", your payrollid %" FMT_PAYROLLID "\n",
>>           employee.name, employee.salary, employee.payrollid);
>>
>> -- Ben.
>
> Ben, if you put floating points in money accountants get upset.
>
> Three employees are paid $100.00, so it adds up to $300.
>
> Deduct $20 from each, and it's $240.
>
> Use floating point and sooner or later it won't add up. You can't have a
> third of a cent.
>
> Use integers and cents for money. Or pounds, shekels, whatever...

How does that work out for calculating daily compound interest?

Or even working out 6.9% sales tax on $199.99?

You need to follow whatever guidelines are mandated for rounding
intermediate results.

Re: you think rust may *DE*throne c?

<HJ7BM.25894$Wk53.19314@fx01.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx01.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: you think rust may *DE*throne c?
Newsgroups: comp.lang.c
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com> <uatlrr$3epln$1@dont-email.me> <uatr2m$3fla4$1@dont-email.me> <909acf23-ef0e-44c7-9ebf-89846e50e871n@googlegroups.com> <p_uAM.489417$mPI2.398490@fx15.iad> <e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com> <87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me> <87bkffg6qz.fsf@bsb.me.uk> <ub1840$3q1k$1@dont-email.me> <87zg2zej54.fsf@bsb.me.uk> <Hr6BM.359405$xMqa.20823@fx12.iad> <87il9ndiz9.fsf@bsb.me.uk>
Lines: 30
Message-ID: <HJ7BM.25894$Wk53.19314@fx01.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Thu, 10 Aug 2023 15:53:11 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Thu, 10 Aug 2023 15:53:11 GMT
X-Received-Bytes: 2226
 by: Scott Lurndal - Thu, 10 Aug 2023 15:53 UTC

Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>scott@slp53.sl.home (Scott Lurndal) writes:
>
>> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>>>Bart <bc@freeuk.com> writes:
>>
>>>> If working with Linux and you need -lm, then 'make prog' won't work. That's
>>>> just a fact.
>>>
>>>2+2 = 4. That's just a fact.
>>
>> Indeed, and it is a fact for _any_ library containing optional functionality
>> that is needed by the application.
>
>That's only true in a circular way. Why are the math functions
>considered optional? Why not, for example, consider the IO functions
>optional so that any program that includes <stdio.h> has to link with
>-lio? (I know the history -- that's not what I'm asking.)
>
>There's even a division that could be justified by the standard. Any
>program that uses functions not required in a freestanding
>implementation could be obliged to link with -lhosted, but requiring -lm
>is just a historical barnacle.

Yes, it's historical, and an artifact of small memory systems and
archive libraries.

None the less, would you also expect that -lopenssl, -lncurses, -lpthread,
-ldl, -lrt, -lz, etc. should also be automatically appended by the compiler
driver (cc)?

Re: you think rust may *DE*throne c?

<20230810090521.27@kylheku.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c
Subject: Re: you think rust may *DE*throne c?
Date: Thu, 10 Aug 2023 16:15:32 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 63
Message-ID: <20230810090521.27@kylheku.com>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<uatlrr$3epln$1@dont-email.me> <uatr2m$3fla4$1@dont-email.me>
<909acf23-ef0e-44c7-9ebf-89846e50e871n@googlegroups.com>
<p_uAM.489417$mPI2.398490@fx15.iad>
<e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com>
<87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me>
<87bkffg6qz.fsf@bsb.me.uk> <ub1840$3q1k$1@dont-email.me>
<87zg2zej54.fsf@bsb.me.uk> <Hr6BM.359405$xMqa.20823@fx12.iad>
<87il9ndiz9.fsf@bsb.me.uk> <HJ7BM.25894$Wk53.19314@fx01.iad>
Injection-Date: Thu, 10 Aug 2023 16:15:32 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c8ceb3884c73c57508aac2a066fd132c";
logging-data="463356"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18kMTKFUhm2Wvp1nTiJgE6xN+qXrc2gE4Q="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:OYPh286Vxrqwzz3N1e6TK0yjCdo=
 by: Kaz Kylheku - Thu, 10 Aug 2023 16:15 UTC

On 2023-08-10, Scott Lurndal <scott@slp53.sl.home> wrote:
> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>>scott@slp53.sl.home (Scott Lurndal) writes:
>>
>>> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>>>>Bart <bc@freeuk.com> writes:
>>>
>>>>> If working with Linux and you need -lm, then 'make prog' won't work. That's
>>>>> just a fact.
>>>>
>>>>2+2 = 4. That's just a fact.
>>>
>>> Indeed, and it is a fact for _any_ library containing optional functionality
>>> that is needed by the application.
>>
>>That's only true in a circular way. Why are the math functions
>>considered optional? Why not, for example, consider the IO functions
>>optional so that any program that includes <stdio.h> has to link with
>>-lio? (I know the history -- that's not what I'm asking.)
>>
>>There's even a division that could be justified by the standard. Any
>>program that uses functions not required in a freestanding
>>implementation could be obliged to link with -lhosted, but requiring -lm
>>is just a historical barnacle.
>
> Yes, it's historical, and an artifact of small memory systems and
> archive libraries.
>
> None the less, would you also expect that -lopenssl, -lncurses, -lpthread,
> -ldl, -lrt, -lz, etc. should also be automatically appended by the compiler
> driver (cc)?

This is entirely feasible, technologically.

As a pretty simple hack, header files for these libraries could
declare the "soname" that is required to call their functions.

The compiler would attach that to the declarations made in those
headers and then if any of those symbols are referenced, append
the -l<soname> to the linker line.

In the Microsoft Visual C/C++ world, a source file can indicate that it
needs a particular DLL, so that it doesn't have to be specified on the
command line.

Another solution would be entirely at run-time.

What we could have is that an executable just dynamically links to
functions in these libraries, and the system automatically finds them at
load time, without the executable having to specify which libraries.

(Symbolic references would have to be fastidiously versioned since
if multiple versions of a library were installed, the executable would
not be indicataing which file it wants, other than through the
names it needs. And also for another reason: clashing names between
libraries. But the programmer wouldn't see the library and verison
qualification on the symbol; that's handled transparently by the
toolchain.)

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: Making accountants cross (wa Re: you think rust may outthrone c?)

<20230810091601.978@kylheku.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c
Subject: Re: Making accountants cross (wa Re: you think rust may outthrone c?)
Date: Thu, 10 Aug 2023 16:31:31 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 75
Message-ID: <20230810091601.978@kylheku.com>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<uag05n$nmu5$1@dont-email.me> <uagcgc$ppbn$1@dont-email.me>
<87fs50ulog.fsf@bsb.me.uk> <uagpni$rt71$1@dont-email.me>
<87r0ohrvg0.fsf@bsb.me.uk> <uamlh1$1tr9i$1@dont-email.me>
<875y5tkptn.fsf@bsb.me.uk> <uans1e$26toe$1@dont-email.me>
<87cyzzkfxh.fsf@nosuchdomain.example.com> <uap5e6$2gd8e$1@dont-email.me>
<87350vke4n.fsf@nosuchdomain.example.com> <uap73l$2gktp$1@dont-email.me>
<87y1initxx.fsf@nosuchdomain.example.com> <uapf90$2ht0t$1@dont-email.me>
<87leenirja.fsf@nosuchdomain.example.com> <uaqdst$2q82c$1@dont-email.me>
<8M4AM.510037$TPw2.337804@fx17.iad> <uaqqou$2sa5t$1@dont-email.me>
<87wmy6j37n.fsf@bsb.me.uk>
<ad304448-30f9-4630-83c2-7d19c026fa31n@googlegroups.com>
<87r0oej0rt.fsf@bsb.me.uk> <ub2sp5$d6sv$1@dont-email.me>
Injection-Date: Thu, 10 Aug 2023 16:31:31 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c8ceb3884c73c57508aac2a066fd132c";
logging-data="467402"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+bAowJe6oPwBC799Ke1YaHSfkWeR8bQCg="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:bITSzNYbbC7y+LYotiwbFkyu/QU=
 by: Kaz Kylheku - Thu, 10 Aug 2023 16:31 UTC

On 2023-08-10, Vir Campestris <vir.campestris@invalid.invalid> wrote:
> On 07/08/2023 17:05, Ben Bacarisse wrote:
>> Hmm... With statically allocated strings, or using malloc and therefore
>> requiring free call not shown?
>>
>> I would rather do this: anywhere a type is defined, I'd define a FMT_xxx
>> macro:
>>
>> typedef float salary_t;
>> #define FMT_SALARY "f"
>>
>> typedef unsigned long int payrollid_t;
>> #define FMT_PAYROLLID "lu"
>>
>> so that one can write
>>
>> printf("Hello %s your salary is %" FMT_SALLARY
>> ", your payrollid %" FMT_PAYROLLID "\n",
>> employee.name, employee.salary, employee.payrollid);
>>
>> -- Ben.
>
> Ben, if you put floating points in money accountants get upset.
>
> Three employees are paid $100.00, so it adds up to $300.
>
> Deduct $20 from each, and it's $240.
>
> Use floating point and sooner or later it won't add up.

Use floating-point *naively* and the truncation errors will accumulate
to the point of making at least a one cent difference, screwing up the
accounting.

Use floating-point intelligently and that won't happen.

> You can't have a third of a cent.

That is neither here nor there.

You can't have a third of a cent in accounting, because accounting is
decimal based, at least with US dollars and similar currencies,
where you don't have beasties like sixths of a dollar.

"Third of a cent" is a financial quantity nobody works with, in any
representation of dollars. And even if they did, floating point
could handle it just fine, if everyone agreed that around 15
digits of precision is good enough.

The problem specific to floating point is that you can't have a
hundredth of a dollar in floating point, if 1.0 is used to represent
$1.00.

However, floating-point will give you a ridiculously precise
approximation of 0.01.

You have to do many calculations before enough error accumulates
so that the result goes to the wrong penny.

There is a way to prevent accumulating error: after each calculation,
snap the result to the nearest cent (or whatever fundamental fraction
you are working with, tenth of a cent, ...).

If, after each calculation, you ensure that it has the best
floating-point approximation of the result that pencil-and-paper
accounting would produce, you cannot have a problem. Almost.

The remaining issue is that you get so rich that the dollar amounts you
are working with can no longer represent individual pennies in floating
point.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: you think rust may *DE*throne c?

<877cq2etrz.fsf@bsb.me.uk>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: you think rust may *DE*throne c?
Date: Thu, 10 Aug 2023 17:39:28 +0100
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <877cq2etrz.fsf@bsb.me.uk>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<uatlrr$3epln$1@dont-email.me> <uatr2m$3fla4$1@dont-email.me>
<909acf23-ef0e-44c7-9ebf-89846e50e871n@googlegroups.com>
<p_uAM.489417$mPI2.398490@fx15.iad>
<e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com>
<87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me>
<87bkffg6qz.fsf@bsb.me.uk> <ub1840$3q1k$1@dont-email.me>
<87zg2zej54.fsf@bsb.me.uk> <Hr6BM.359405$xMqa.20823@fx12.iad>
<87il9ndiz9.fsf@bsb.me.uk> <HJ7BM.25894$Wk53.19314@fx01.iad>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="1e9312cf9931c060dc623a19d6d4488d";
logging-data="467667"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19fzKGQxTKJ87rZz0pMEmhPNySG/8X2bHE="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:f417KY7f+wWydfTnDga/eVUKn0g=
sha1:FmhWYSFZGVO0m+EllsenEu5WcoI=
X-BSB-Auth: 1.5424468654e43c07f428.20230810173928BST.877cq2etrz.fsf@bsb.me.uk
 by: Ben Bacarisse - Thu, 10 Aug 2023 16:39 UTC

scott@slp53.sl.home (Scott Lurndal) writes:

> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>>scott@slp53.sl.home (Scott Lurndal) writes:
>>
>>> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>>>>Bart <bc@freeuk.com> writes:
>>>
>>>>> If working with Linux and you need -lm, then 'make prog' won't work. That's
>>>>> just a fact.
>>>>
>>>>2+2 = 4. That's just a fact.
>>>
>>> Indeed, and it is a fact for _any_ library containing optional functionality
>>> that is needed by the application.
>>
>>That's only true in a circular way. Why are the math functions
>>considered optional? Why not, for example, consider the IO functions
>>optional so that any program that includes <stdio.h> has to link with
>>-lio? (I know the history -- that's not what I'm asking.)
>>
>>There's even a division that could be justified by the standard. Any
>>program that uses functions not required in a freestanding
>>implementation could be obliged to link with -lhosted, but requiring -lm
>>is just a historical barnacle.
>
> Yes, it's historical, and an artifact of small memory systems and
> archive libraries.
>
> None the less, would you also expect that -lopenssl, -lncurses, -lpthread,
> -ldl, -lrt, -lz, etc. should also be automatically appended by the compiler
> driver (cc)?

Of course not. But the functions in <math.h> are part of the C language
just like malloc and printf. It's not the same kind of thing at all.

--
Ben.

Re: you think rust may *DE*throne c?

<facbf3fd-f41c-4df7-a8da-d5717e9faff3n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:6214:184b:b0:63f:8aaf:164c with SMTP id d11-20020a056214184b00b0063f8aaf164cmr36518qvy.8.1691685658774;
Thu, 10 Aug 2023 09:40:58 -0700 (PDT)
X-Received: by 2002:a17:902:d503:b0:1bc:6799:3f69 with SMTP id
b3-20020a170902d50300b001bc67993f69mr1049847plg.12.1691685658255; Thu, 10 Aug
2023 09:40:58 -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: Thu, 10 Aug 2023 09:40:57 -0700 (PDT)
In-Reply-To: <HJ7BM.25894$Wk53.19314@fx01.iad>
Injection-Info: google-groups.googlegroups.com; posting-host=199.203.251.52; posting-account=ow8VOgoAAAAfiGNvoH__Y4ADRwQF1hZW
NNTP-Posting-Host: 199.203.251.52
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<uatlrr$3epln$1@dont-email.me> <uatr2m$3fla4$1@dont-email.me>
<909acf23-ef0e-44c7-9ebf-89846e50e871n@googlegroups.com> <p_uAM.489417$mPI2.398490@fx15.iad>
<e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com> <87zg31ezu5.fsf@bsb.me.uk>
<uavpcf$3t64r$1@dont-email.me> <87bkffg6qz.fsf@bsb.me.uk> <ub1840$3q1k$1@dont-email.me>
<87zg2zej54.fsf@bsb.me.uk> <Hr6BM.359405$xMqa.20823@fx12.iad>
<87il9ndiz9.fsf@bsb.me.uk> <HJ7BM.25894$Wk53.19314@fx01.iad>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <facbf3fd-f41c-4df7-a8da-d5717e9faff3n@googlegroups.com>
Subject: Re: you think rust may *DE*throne c?
From: already5...@yahoo.com (Michael S)
Injection-Date: Thu, 10 Aug 2023 16:40:58 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Michael S - Thu, 10 Aug 2023 16:40 UTC

On Thursday, August 10, 2023 at 6:53:26 PM UTC+3, Scott Lurndal wrote:
> Ben Bacarisse <ben.u...@bsb.me.uk> writes:
> >sc...@slp53.sl.home (Scott Lurndal) writes:
> >
> >> Ben Bacarisse <ben.u...@bsb.me.uk> writes:
> >>>Bart <b...@freeuk.com> writes:
> >>
> >>>> If working with Linux and you need -lm, then 'make prog' won't work. That's
> >>>> just a fact.
> >>>
> >>>2+2 = 4. That's just a fact.
> >>
> >> Indeed, and it is a fact for _any_ library containing optional functionality
> >> that is needed by the application.
> >
> >That's only true in a circular way. Why are the math functions
> >considered optional? Why not, for example, consider the IO functions
> >optional so that any program that includes <stdio.h> has to link with
> >-lio? (I know the history -- that's not what I'm asking.)
> >
> >There's even a division that could be justified by the standard. Any
> >program that uses functions not required in a freestanding
> >implementation could be obliged to link with -lhosted, but requiring -lm
> >is just a historical barnacle.
> Yes, it's historical, and an artifact of small memory systems and
> archive libraries.
>
> None the less, would you also expect that -lopenssl, -lncurses, -lpthread,
> -ldl, -lrt, -lz, etc. should also be automatically appended by the compiler
> driver (cc)?

When linking for Linux:
pthread - yes
ncurses - no
openssl - probably, not sure
For the rest of them, I don't know what they are.

Re: you think rust may *DE*throne c?

<ub34ck$ebol$1@dont-email.me>

  copy mid

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

  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 *DE*throne c?
Date: Thu, 10 Aug 2023 17:48:21 +0100
Organization: A noiseless patient Spider
Lines: 79
Message-ID: <ub34ck$ebol$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<uatlrr$3epln$1@dont-email.me> <uatr2m$3fla4$1@dont-email.me>
<909acf23-ef0e-44c7-9ebf-89846e50e871n@googlegroups.com>
<p_uAM.489417$mPI2.398490@fx15.iad>
<e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com>
<87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me>
<87bkffg6qz.fsf@bsb.me.uk> <ub1840$3q1k$1@dont-email.me>
<87zg2zej54.fsf@bsb.me.uk> <Hr6BM.359405$xMqa.20823@fx12.iad>
<87il9ndiz9.fsf@bsb.me.uk> <HJ7BM.25894$Wk53.19314@fx01.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 10 Aug 2023 16:48:20 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="133262a320001d4d748f60986a4adb35";
logging-data="470805"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/6DJUL0nEvDVe5LAVKiMo5z3TUZdU4qLE="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:1PPKI4lPA8Ugu0MZiFPeA57J6xs=
In-Reply-To: <HJ7BM.25894$Wk53.19314@fx01.iad>
 by: Bart - Thu, 10 Aug 2023 16:48 UTC

On 10/08/2023 16:53, Scott Lurndal wrote:
> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>> scott@slp53.sl.home (Scott Lurndal) writes:
>>
>>> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>>>> Bart <bc@freeuk.com> writes:
>>>
>>>>> If working with Linux and you need -lm, then 'make prog' won't work. That's
>>>>> just a fact.
>>>>
>>>> 2+2 = 4. That's just a fact.
>>>
>>> Indeed, and it is a fact for _any_ library containing optional functionality
>>> that is needed by the application.
>>
>> That's only true in a circular way. Why are the math functions
>> considered optional? Why not, for example, consider the IO functions
>> optional so that any program that includes <stdio.h> has to link with
>> -lio? (I know the history -- that's not what I'm asking.)
>>
>> There's even a division that could be justified by the standard. Any
>> program that uses functions not required in a freestanding
>> implementation could be obliged to link with -lhosted, but requiring -lm
>> is just a historical barnacle.
>
> Yes, it's historical, and an artifact of small memory systems and
> archive libraries.
>
> None the less, would you also expect that -lopenssl, -lncurses, -lpthread,
> -ldl, -lrt, -lz, etc. should also be automatically appended by the compiler
> driver (cc)?

The Windows program below uses the maths library, and the equivalent of
'dl'.

It builds to a 2.5KB executable (with my compiler, which is the minimum
size).

It automatically links to dynamic libraries msvcrt.dll, gdi32.dll,
kernel32.dll, user32.dll, all of which are likely already memory-resident.

Between them those export 5000 functions (and some variables), yet it
does not impact the executable size: they are shared libraries.

I don't need to muck about with -lm or -ldl.

(C is a little backward, but in my language, if the functions from a
particular library are declared with the FFI, it will automatically
include that DLL for dynamic linking.

In more complex cases (eg. functions are spread over diverse DLLs), the
DLLs have to be listed manually, but this is done in the source code. No
extra command line inputs are needed. The compiler input is always just
the name of the lead module.)

----------------------------------
#include <stdio.h>
#include <windows.h>
#include <math.h>

int main(void) {
void* handle;
void* fnptr;
double x=3.0;

handle=LoadLibrary("msvcrt.dll");

if (handle) {
fnptr=GetProcAddress(handle, "sqrt");
printf("fnptr=%p\n",fnptr);
} else {
puts("no lib");
}

printf("%f\n",sqrt(x));
}

Re: you think rust may *DE*throne c?

<ceb751b1-bce0-4f2e-b207-7bb7bacfd207n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ad4:58ab:0:b0:641:8b47:26f8 with SMTP id ea11-20020ad458ab000000b006418b4726f8mr7741qvb.4.1691686150471;
Thu, 10 Aug 2023 09:49:10 -0700 (PDT)
X-Received: by 2002:a17:902:ec92:b0:1bb:9e6e:a9f1 with SMTP id
x18-20020a170902ec9200b001bb9e6ea9f1mr1068104plg.13.1691686149983; Thu, 10
Aug 2023 09:49:09 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.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: Thu, 10 Aug 2023 09:49:09 -0700 (PDT)
In-Reply-To: <87o7jfdjf5.fsf@bsb.me.uk>
Injection-Info: google-groups.googlegroups.com; posting-host=199.203.251.52; posting-account=ow8VOgoAAAAfiGNvoH__Y4ADRwQF1hZW
NNTP-Posting-Host: 199.203.251.52
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<uaavm0$3ln4f$1@dont-email.me> <uab5ja$3mc91$1@dont-email.me>
<uabeq1$3nigh$1@dont-email.me> <uabobj$3oias$1@dont-email.me>
<uaduf0$54pp$1@dont-email.me> <uajaqg$1bc41$4@dont-email.me>
<uajfq3$1cesi$1@dont-email.me> <uat7t4$3cco6$1@dont-email.me>
<uat9ca$3cjmt$1@dont-email.me> <uatjcp$3ec7b$1@dont-email.me>
<uatlrr$3epln$1@dont-email.me> <uatr2m$3fla4$1@dont-email.me>
<909acf23-ef0e-44c7-9ebf-89846e50e871n@googlegroups.com> <p_uAM.489417$mPI2.398490@fx15.iad>
<e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com> <87zg31ezu5.fsf@bsb.me.uk>
<uavpcf$3t64r$1@dont-email.me> <87bkffg6qz.fsf@bsb.me.uk> <1b31e9c0-0162-4bce-8cf9-69f6704ca429n@googlegroups.com>
<87o7jfdjf5.fsf@bsb.me.uk>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ceb751b1-bce0-4f2e-b207-7bb7bacfd207n@googlegroups.com>
Subject: Re: you think rust may *DE*throne c?
From: already5...@yahoo.com (Michael S)
Injection-Date: Thu, 10 Aug 2023 16:49:10 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4302
 by: Michael S - Thu, 10 Aug 2023 16:49 UTC

On Thursday, August 10, 2023 at 6:08:45 PM UTC+3, Ben Bacarisse wrote:
> Michael S <already...@yahoo.com> writes:
>
> > On Thursday, August 10, 2023 at 2:01:55 AM UTC+3, Ben Bacarisse wrote:
> >> Bart <b...@freeuk.com> writes:
> >>
> >> > On 09/08/2023 03:04, Ben Bacarisse wrote:
> >> >> Malcolm McLean <malcolm.ar...@gmail.com> writes:
> >> >>
> >> >>> On Tuesday, 8 August 2023 at 18:32:21 UTC+1, Scott Lurndal wrote:
> >> >>>>
> >> >>>> 1) Using a make variable in the rule for '.c' -> '.o' and setting the
> >> >>>> variable to the name of the compiler:
> >> >>>>
> >> >>>> CC=bcc
> >> >>>> ...
> >> >>>> %.o: %.c
> >> >>>> @$(QUIET) || echo " COMPILE $<"
> >> >>>> $(HUSHCOMPILE)$(CC) $(CFLAGS) -MMD -MP -o $@ -c $<
> >> >>>>
> >> >>> Exactly,
> >> >>> Bart is right.
> >> >>
> >> >> You are deliberately ignoring the context. Bart wants gcc prog.c to
> >> >> write to prog, but in the computer world I inhabit, you do that with
> >> >> make prog.
> >> >
> >> > This is a good example of double standards.
> >> >
> >> > I've complained in the past about having to supply the .c extension to a
> >> > /C/ compiler.
> >> >
> >> > Now here make does not need an extension.
> >>
> >> I call it consistency. A compiler is given the file to process, make is
> >> given the file to build (AKA "make").
> >
> > I disagree.
> OK, but your disagreement is about something else.
> > Consistent design, a.k.a. principle of minimal surprise, would be for
> > basal utility 'make' to have no built-in rules. On top of it, system
> > can supply one or more extended utilities, probably implemented as
> > shell scripts, that do have built-in rules.
> So you also disagree with Bart whose compiler has a built-in rule about
> what file extension to assume. You probably won't bring that up, though.
>
> --
> Ben.

Compiler and generic build utility are not in the same boat.
It is less surprising to have defaults in compiler than to have built-in
implicit rules in generic build utility.
But yes, I don't like Bart's decision to allow omission of .c.
However as long as his compiler is his personal toy I am not going to complain.

Re: you think rust may *DE*throne c?

<20230810093826.596@kylheku.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c
Subject: Re: you think rust may *DE*throne c?
Date: Thu, 10 Aug 2023 16:57:42 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 69
Message-ID: <20230810093826.596@kylheku.com>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<uat9ca$3cjmt$1@dont-email.me> <uatjcp$3ec7b$1@dont-email.me>
<uatlrr$3epln$1@dont-email.me> <uatr2m$3fla4$1@dont-email.me>
<909acf23-ef0e-44c7-9ebf-89846e50e871n@googlegroups.com>
<p_uAM.489417$mPI2.398490@fx15.iad>
<e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com>
<87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me>
<87bkffg6qz.fsf@bsb.me.uk> <ub1840$3q1k$1@dont-email.me>
<87zg2zej54.fsf@bsb.me.uk> <Hr6BM.359405$xMqa.20823@fx12.iad>
<ub2vvq$doo0$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 10 Aug 2023 16:57:42 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c8ceb3884c73c57508aac2a066fd132c";
logging-data="474309"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18e8pyMg/zvEFSV8ZK3Wi23T9N2Vk20AOY="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:ckm+0aH2iG75P/Tbw+q/UYtcGaM=
 by: Kaz Kylheku - Thu, 10 Aug 2023 16:57 UTC

On 2023-08-10, Bart <bc@freeuk.com> wrote:
> On 10/08/2023 15:25, Scott Lurndal wrote:
> > Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
> >> Bart <bc@freeuk.com> writes:
> >
> >>> If working with Linux and you need -lm, then 'make prog' won't
> work. That's
> >>> just a fact.
> >>
> >> 2+2 = 4. That's just a fact.
> >
> > Indeed, and it is a fact for _any_ library containing optional
> functionality
> > that is needed by the application.
> >
>
> Yet, C programs can use `printf` without needing to specifically link in
> a library for it. What's the difference with `sqrt`?

It's just a historic baggage.

More programs in a system can be expected to use math functions
than, say, setsid()!

Why is setsid linked by default, but not math functions?

If even one program in a given system installation uses math function,
you save disk space by having that in the same library image
instead of a separate libm.so.6 (with wasteful symlinks thereto taking
up more inodes).

The fix is to have a dummy, empty library for those programs that
specify -lm in their build, so that they don't break.

I rember reading some article years ago about how some libary
was planning to remove the need for -lm; I seem to be misremember
that it was glibc? If so, what happened?

I think some systems do this? Ah, OK, here is one example. Do you know
of the C library called Musl? It's a Glibc alternative. Some distros
like Alpine Linux, are based on it.

https://www.musl-libc.org/faq.html

Why is libm.a empty?

On musl, the entire standard library is included in a single
library file — libc.a for static linking, and libc.so for
dynamic linking. This significantly improves the efficiency of
dynamic linking, and avoids all sorts of symbol interposition
bugs that arise when you split the libraries up — bugs which
have plagued glibc for more than a decade.

Why not just omit libm.a, libpthread.a, etc. entirely? POSIX says
-lm, -lpthread, etc. are valid options to the compiler and
conforming applications must use these options when they need the
corresponding functionality, and the easiest way to comply with that
requirement (and avoid breaking applications) is with empty .a files
by those names. What is ridiculous is that there are many funtions
in the main library, including ones which are very rare.

So they are doing exactly what I say; -lm is there so that your
compiler command line doesn't break, effectively as a backward
compatibility dongle, and it works via an actual empty library.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: Making accountants cross (wa Re: you think rust may outthrone c?)

<ub350r$cvgb$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED.108.175.226.73!not-for-mail
From: lew.pitc...@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.lang.c
Subject: Re: Making accountants cross (wa Re: you think rust may outthrone
c?)
Date: Thu, 10 Aug 2023 16:59:07 -0000 (UTC)
Organization: The Pitcher Digital Freehold
Message-ID: <ub350r$cvgb$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<uag05n$nmu5$1@dont-email.me> <uagcgc$ppbn$1@dont-email.me>
<87fs50ulog.fsf@bsb.me.uk> <uagpni$rt71$1@dont-email.me>
<87r0ohrvg0.fsf@bsb.me.uk> <uamlh1$1tr9i$1@dont-email.me>
<875y5tkptn.fsf@bsb.me.uk> <uans1e$26toe$1@dont-email.me>
<87cyzzkfxh.fsf@nosuchdomain.example.com> <uap5e6$2gd8e$1@dont-email.me>
<87350vke4n.fsf@nosuchdomain.example.com> <uap73l$2gktp$1@dont-email.me>
<87y1initxx.fsf@nosuchdomain.example.com> <uapf90$2ht0t$1@dont-email.me>
<87leenirja.fsf@nosuchdomain.example.com> <uaqdst$2q82c$1@dont-email.me>
<8M4AM.510037$TPw2.337804@fx17.iad> <uaqqou$2sa5t$1@dont-email.me>
<87wmy6j37n.fsf@bsb.me.uk>
<ad304448-30f9-4630-83c2-7d19c026fa31n@googlegroups.com>
<87r0oej0rt.fsf@bsb.me.uk> <ub2sp5$d6sv$1@dont-email.me>
<20230810091601.978@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 10 Aug 2023 16:59:07 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="108.175.226.73";
logging-data="425483"; mail-complaints-to="abuse@eternal-september.org"
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
 by: Lew Pitcher - Thu, 10 Aug 2023 16:59 UTC

On Thu, 10 Aug 2023 16:31:31 +0000, Kaz Kylheku wrote:

> On 2023-08-10, Vir Campestris <vir.campestris@invalid.invalid> wrote:
>> On 07/08/2023 17:05, Ben Bacarisse wrote:
>>> Hmm... With statically allocated strings, or using malloc and therefore
>>> requiring free call not shown?
>>>
>>> I would rather do this: anywhere a type is defined, I'd define a FMT_xxx
>>> macro:
>>>
>>> typedef float salary_t;
>>> #define FMT_SALARY "f"
>>>
>>> typedef unsigned long int payrollid_t;
>>> #define FMT_PAYROLLID "lu"
>>>
>>> so that one can write
>>>
>>> printf("Hello %s your salary is %" FMT_SALLARY
>>> ", your payrollid %" FMT_PAYROLLID "\n",
>>> employee.name, employee.salary, employee.payrollid);
>>>
>>> -- Ben.
>>
>> Ben, if you put floating points in money accountants get upset.
>>
>> Three employees are paid $100.00, so it adds up to $300.
>>
>> Deduct $20 from each, and it's $240.
>>
>> Use floating point and sooner or later it won't add up.
>
> Use floating-point *naively* and the truncation errors will accumulate
> to the point of making at least a one cent difference, screwing up the
> accounting.
>
> Use floating-point intelligently and that won't happen.
>
>> You can't have a third of a cent.
>
> That is neither here nor there.
>
> You can't have a third of a cent in accounting, because accounting is
> decimal based, at least with US dollars and similar currencies,
> where you don't have beasties like sixths of a dollar.

Actually, many currencies (including the US Dollar) allow for measurements
in the thousandths of a dollar, and such calculations are common in both
stock brokerage pricing (a broker may charge, say, 5 mils per share on
bulk trades, earning $5.00 for every 1000 shares bought/sold) and property
tax calculation.

> "Third of a cent" is a financial quantity nobody works with, in any
> representation of dollars.

Except for those who work with money as a commodity, stock brokers,
municipal property tax assessors, and a wide variety of others. Consider,
at this moment, I see that 1 Japanese Yen will buy 0.0069 US Dollars.
How inconvenient would it be if programmers just took the position that
there are no fractions of a US dollar lower than 1 cent, and that 1 Yen,
therefore, purchases $0.00 USD?

> And even if they did, floating point
> could handle it just fine, if everyone agreed that around 15
> digits of precision is good enough.

For very small and very large sums of money, most banking systems
will stay /very/ far away from floatingpoint in any form. Better
to do (expensive) fixed-precision math and get exact answers than
to do (cheaper) floatingpoint math and get the final /financial/
answer wrong. That's how banks fail, and programmers get rich
from rounding errors (watch the movie "Office Space").

[snip]

--
Lew Pitcher
A retired programmer/analyst/architect for a large Canadian bank
"In Skills We Trust"

Re: you think rust may *DE*throne c?

<yH8BM.430010$TCKc.359327@fx13.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx13.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: you think rust may *DE*throne c?
Newsgroups: comp.lang.c
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com> <909acf23-ef0e-44c7-9ebf-89846e50e871n@googlegroups.com> <p_uAM.489417$mPI2.398490@fx15.iad> <e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com> <87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me> <87bkffg6qz.fsf@bsb.me.uk> <ub1840$3q1k$1@dont-email.me> <87zg2zej54.fsf@bsb.me.uk> <Hr6BM.359405$xMqa.20823@fx12.iad> <87il9ndiz9.fsf@bsb.me.uk> <HJ7BM.25894$Wk53.19314@fx01.iad> <20230810090521.27@kylheku.com>
Lines: 48
Message-ID: <yH8BM.430010$TCKc.359327@fx13.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Thu, 10 Aug 2023 16:59:10 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Thu, 10 Aug 2023 16:59:10 GMT
X-Received-Bytes: 3036
 by: Scott Lurndal - Thu, 10 Aug 2023 16:59 UTC

Kaz Kylheku <864-117-4973@kylheku.com> writes:
>On 2023-08-10, Scott Lurndal <scott@slp53.sl.home> wrote:
>> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>>>scott@slp53.sl.home (Scott Lurndal) writes:
>>>
>>>> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>>>>>Bart <bc@freeuk.com> writes:
>>>>
>>>>>> If working with Linux and you need -lm, then 'make prog' won't work. That's
>>>>>> just a fact.
>>>>>
>>>>>2+2 = 4. That's just a fact.
>>>>
>>>> Indeed, and it is a fact for _any_ library containing optional functionality
>>>> that is needed by the application.
>>>
>>>That's only true in a circular way. Why are the math functions
>>>considered optional? Why not, for example, consider the IO functions
>>>optional so that any program that includes <stdio.h> has to link with
>>>-lio? (I know the history -- that's not what I'm asking.)
>>>
>>>There's even a division that could be justified by the standard. Any
>>>program that uses functions not required in a freestanding
>>>implementation could be obliged to link with -lhosted, but requiring -lm
>>>is just a historical barnacle.
>>
>> Yes, it's historical, and an artifact of small memory systems and
>> archive libraries.
>>
>> None the less, would you also expect that -lopenssl, -lncurses, -lpthread,
>> -ldl, -lrt, -lz, etc. should also be automatically appended by the compiler
>> driver (cc)?
>
>This is entirely feasible, technologically.
>
>As a pretty simple hack, header files for these libraries could
>declare the "soname" that is required to call their functions.
>
>The compiler would attach that to the declarations made in those
>headers and then if any of those symbols are referenced, append
>the -l<soname> to the linker line.
>
>In the Microsoft Visual C/C++ world, a source file can indicate that it
>needs a particular DLL, so that it doesn't have to be specified on the
>command line.

Ah, yes. DLL hell. Something that has not yet been an issue for
unix/linux, and hopefully never will.

Re: you think rust may *DE*throne c?

<ub35j3$ehuo$1@dont-email.me>

  copy mid

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

  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 *DE*throne c?
Date: Thu, 10 Aug 2023 18:08:52 +0100
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <ub35j3$ehuo$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<uaavm0$3ln4f$1@dont-email.me> <uab5ja$3mc91$1@dont-email.me>
<uabeq1$3nigh$1@dont-email.me> <uabobj$3oias$1@dont-email.me>
<uaduf0$54pp$1@dont-email.me> <uajaqg$1bc41$4@dont-email.me>
<uajfq3$1cesi$1@dont-email.me> <uat7t4$3cco6$1@dont-email.me>
<uat9ca$3cjmt$1@dont-email.me> <uatjcp$3ec7b$1@dont-email.me>
<uatlrr$3epln$1@dont-email.me> <uatr2m$3fla4$1@dont-email.me>
<909acf23-ef0e-44c7-9ebf-89846e50e871n@googlegroups.com>
<p_uAM.489417$mPI2.398490@fx15.iad>
<e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com>
<87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me>
<87bkffg6qz.fsf@bsb.me.uk>
<1b31e9c0-0162-4bce-8cf9-69f6704ca429n@googlegroups.com>
<87o7jfdjf5.fsf@bsb.me.uk>
<ceb751b1-bce0-4f2e-b207-7bb7bacfd207n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 10 Aug 2023 17:08:51 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="133262a320001d4d748f60986a4adb35";
logging-data="477144"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19u6HvmDDqd5WVXDwC4Wm9/wkndUHQpfH4="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:b0zoCR2gWnQHdODx6aW7uTGzT1w=
In-Reply-To: <ceb751b1-bce0-4f2e-b207-7bb7bacfd207n@googlegroups.com>
 by: Bart - Thu, 10 Aug 2023 17:08 UTC

On 10/08/2023 17:49, Michael S wrote:
>> So you also disagree with Bart whose compiler has a built-in rule about
>> what file extension to assume. You probably won't bring that up, though.

> Compiler and generic build utility are not in the same boat.
> It is less surprising to have defaults in compiler than to have built-in
> implicit rules in generic build utility.
> But yes, I don't like Bart's decision to allow omission of .c.

It's possible the *nix people are downplaying the advantage of having
default extensions, because of those systems it is not practical.

That is because 'prog' and 'prog.' are distinct filenames.

On Windows:

prog means apply a default extension
prog. means use 'prog' with no extension
prog.ext means use the given extension

Under *nix:

prog means the literal file "prog"
prog. means the literal file "prog."
prog.ext means use the given extension

There is no way to indicate a default extension, without losing the
ability to denote a literal filename "prog".

But whether that's the real problem is doubtful; for a C compiler, it
would be unusual to use an extension for source files that is anything
but .c, or one that might clash with an executable file.

> However as long as his compiler is his personal toy I am not going to
complain.

Sure; over about 15 years I sold about $10m of software developed with
my toy compilers. I'm not going to complain either!

Re: you think rust may *DE*throne c?

<542c60aa-a3bb-43ed-8e34-5340d65ed10en@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a37:8647:0:b0:76c:b12c:2fe8 with SMTP id i68-20020a378647000000b0076cb12c2fe8mr35411qkd.13.1691687568827;
Thu, 10 Aug 2023 10:12:48 -0700 (PDT)
X-Received: by 2002:a17:903:2441:b0:1b8:97ed:a437 with SMTP id
l1-20020a170903244100b001b897eda437mr1250510pls.4.1691687568602; Thu, 10 Aug
2023 10:12:48 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!1.us.feeder.erje.net!feeder.erje.net!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: Thu, 10 Aug 2023 10:12:47 -0700 (PDT)
In-Reply-To: <yH8BM.430010$TCKc.359327@fx13.iad>
Injection-Info: google-groups.googlegroups.com; posting-host=199.203.251.52; posting-account=ow8VOgoAAAAfiGNvoH__Y4ADRwQF1hZW
NNTP-Posting-Host: 199.203.251.52
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<909acf23-ef0e-44c7-9ebf-89846e50e871n@googlegroups.com> <p_uAM.489417$mPI2.398490@fx15.iad>
<e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com> <87zg31ezu5.fsf@bsb.me.uk>
<uavpcf$3t64r$1@dont-email.me> <87bkffg6qz.fsf@bsb.me.uk> <ub1840$3q1k$1@dont-email.me>
<87zg2zej54.fsf@bsb.me.uk> <Hr6BM.359405$xMqa.20823@fx12.iad>
<87il9ndiz9.fsf@bsb.me.uk> <HJ7BM.25894$Wk53.19314@fx01.iad>
<20230810090521.27@kylheku.com> <yH8BM.430010$TCKc.359327@fx13.iad>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <542c60aa-a3bb-43ed-8e34-5340d65ed10en@googlegroups.com>
Subject: Re: you think rust may *DE*throne c?
From: already5...@yahoo.com (Michael S)
Injection-Date: Thu, 10 Aug 2023 17:12:48 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4451
 by: Michael S - Thu, 10 Aug 2023 17:12 UTC

On Thursday, August 10, 2023 at 7:59:25 PM UTC+3, Scott Lurndal wrote:
> Kaz Kylheku <864-11...@kylheku.com> writes:
> >On 2023-08-10, Scott Lurndal <sc...@slp53.sl.home> wrote:
> >> Ben Bacarisse <ben.u...@bsb.me.uk> writes:
> >>>sc...@slp53.sl.home (Scott Lurndal) writes:
> >>>
> >>>> Ben Bacarisse <ben.u...@bsb.me.uk> writes:
> >>>>>Bart <b...@freeuk.com> writes:
> >>>>
> >>>>>> If working with Linux and you need -lm, then 'make prog' won't work. That's
> >>>>>> just a fact.
> >>>>>
> >>>>>2+2 = 4. That's just a fact.
> >>>>
> >>>> Indeed, and it is a fact for _any_ library containing optional functionality
> >>>> that is needed by the application.
> >>>
> >>>That's only true in a circular way. Why are the math functions
> >>>considered optional? Why not, for example, consider the IO functions
> >>>optional so that any program that includes <stdio.h> has to link with
> >>>-lio? (I know the history -- that's not what I'm asking.)
> >>>
> >>>There's even a division that could be justified by the standard. Any
> >>>program that uses functions not required in a freestanding
> >>>implementation could be obliged to link with -lhosted, but requiring -lm
> >>>is just a historical barnacle.
> >>
> >> Yes, it's historical, and an artifact of small memory systems and
> >> archive libraries.
> >>
> >> None the less, would you also expect that -lopenssl, -lncurses, -lpthread,
> >> -ldl, -lrt, -lz, etc. should also be automatically appended by the compiler
> >> driver (cc)?
> >
> >This is entirely feasible, technologically.
> >
> >As a pretty simple hack, header files for these libraries could
> >declare the "soname" that is required to call their functions.
> >
> >The compiler would attach that to the declarations made in those
> >headers and then if any of those symbols are referenced, append
> >the -l<soname> to the linker line.
> >
> >In the Microsoft Visual C/C++ world, a source file can indicate that it
> >needs a particular DLL, so that it doesn't have to be specified on the
> >command line.
> Ah, yes. DLL hell. Something that has not yet been an issue for
> unix/linux, and hopefully never will.

In my personal experience DLL hell on Linux is innumerably worse
than it ever was on Windows.
On Windows, at worst one can put needed versions of DLLs in the
same directory with exe and things will work.
On Linux, I found no ways short of static link to cause binaries compiled
on newer Debian to run on LTS variant of Ubuntu. And that's with Debian
and Ununtu, two distros that are rather close relatives. I wonder what is
going to happen if try unrelated distros.


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

Pages:123456789101112131415161718192021222324252627282930313233343536373839
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor