Article View: comp.lang.c
Article #82Re: will it be optimized?
From: fir
Date: Fri, 09 Oct 2026 13:01
Date: Fri, 09 Oct 2026 13:01
179 lines
6359 bytes
6359 bytes
fir pisze:
> fir pisze:
>> fir pisze:
>>> fir pisze:
>>>> bart pisze:
>>>>> On 07/10/2026 13:45, fir wrote:
>>>>>
>>>>>> really c should have that
>>>>>> 1) references like in c++
>>>>>> 2) adhoc damn enums /tags
>>>>>> 3) builtin operators for float3 type
>>>>>
>>>>> That last is a very specific type for C.
>>>>>
>>>>> Why not go instead for a more general ability to be able to
>>>>> overload operators for user-defined types?
>>>>>
>>>>> You know, like C++.
>>>>>
>>>>> Or maybe you can just use C++ because it's right there, and you use
>>>>> a C++ compiler anyway.
>>>>
>>>>
>>>> ye operator 'overloading' and references are good concepts.. here
>>>> above i jut mentioned more modest changes that are needed (more
>>>> specifically i mentioned those who anoy me practically when i code
>>>> this rasterizer, and the lack of operators for float3 is heavy pain)
>>>>
>>>>
>>>>
>>>
>>> aside the fact that syntax for this operators in c++ are not quite
>>> good imo (where builtin operators for float3 for sure would have
>>> proper syntax )
>>>
>>>
>>> in fact i recently think that function definition syntax in c also
>>> may not be much good..if you got this what i call hipermodularity or
>>> fractal modularity i language then the function not "returns" value
>>> but "has a value"
>>>
>>> like
>>>
>>> foo()
>>> {
>>> static float x;
>>> static float y;
>>> static float z;
>>> }
>>>
>>> which you eventually oculd "cast" (or something other which waork
>>> close way) on different subsets (or maybe even supersets) of its value
>>>
>>>
>>> printf ("%.1f ", (x) foo()); // call and take x
>>>
>>> (x,z) foo(); //call and take x y
>>>
>>>
>>> (x,x,y) foo(); //call and take x x y
>>>
>>> (z,y,x) foo //dont call just take z y x
>>>
>>>
>>> clasic return hass to narrow usability probably and with this cast
>>> you could just fit result of one function to another
>>>
>>> like also
>>>
>>> boo ( (2,3 x,y, "sasaS") foo() )
>>>
>>> im not sure as to syntax though, as this should be done carefully and
>>> its not clear now
>>>
>>>
>> if returning is showed to be a bad concept (and it seems so)
>>
>> and returning is replaced by function having a value just as structure
>> has a value then the syntax problem in simplest version is like that
>>
>> if a is a structure (like float x,y,z) c got such things like a.x a.y
>> a.z but it has lack of something like a.xy a.yxz and so on and it is
>> needed and a question is how syntax to have to express it
>>
>
> a.yxz
>
> cant stand but maybe there should be operator that groups things like
> in structure
>
> then a.x+y+z or a.x&z&y would mean return such fields
>
> probably should coz to much of this all () could have problems
>
>> casting is somewhat suitable for that
>>
>> (x y)a
>>
>> but im not sure as to this its kinda simple but not so easy to read
>> sometimes maybe and not sure if enough general
>>
>> it is important becouse its quite fundamental operation (takin a
>> field(s))
>> around as same fundamental as assigning
>>
>>
>> it also seems quite opposite as calling becouse
>> if you call f(a b) you liek "pass" a b into f and
>> when you take things out (a b) f its like you pull things out of f
>>
>> wonder if some take this syntax ('pushing' and 'pulling') and it
>> it would work or just make syntax errors
>>
>> (c d)f(a b)
>>
>> is the above absolute clear you push a b into f and pull c d form it?
>> now what if you use composing of such syntaxes
>>
>>
>> (c d)f(( f k)g((v)a(3) b))
>>
>
PROBABLY
a.x|y culd be used
x|y|z means here adhoc structure
so
x|y|z = foo(a|b|c) //pass the struct and ret the struct (if returning
would be good idea)
returning seem to be bad idea iit also assumes like copying
if returning byval or writing thru pointer..when traating function as a
value its just acces
foo(a|b|c).x|y
could be considered
hovever this
x|y|z = foo(a|b|c)
also can be used but if someone uses additional copying
overally with this hipermodularity if foo is just a kind of
namespace opening than
foo(a|b|c) just opens its inner fields to stright use
OVERRALY im happy with thsis noticing that
i alrady considered this syntax lik foo a|b|c|d as
an optional separator for arguments but now i see it can be used
for adhoc structure and subset/superset of fields (and thats nwe thought)
> this above is sorta unabiguos and not so hard to read but
> seems just to much of this ()
>
>>
>> im not sure
>>
>> for sure classic a.b.c.d cant quite stay as its too poor it only like
>> has serial factor of pulling but not parralel factor and not denotes
>> pushing
>>
>>
>>
>
Technical Details
Message-ID:
<11aaoim$q0qj$1@dont-email.me>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<11a1f4c$1g3sg$1@dont-email.me> <11a4qor$2kj95$1@dont-email.me> <11a50tk$2m3b3$2@dont-email.me> <11a5etj$2saav$1@dont-email.me> <11a5l3q$2urvl$1@dont-email.me> <11a63p7$34vce$1@dont-email.me> <11a7dh0$3ifm4$1@dont-email.me> <11a8s0n$5k6m$1@dont-email.me> <11aaa7v$kga5$1@dont-email.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: fir <profesor.fir@gmail.com> Newsgroups: comp.lang.c Subject: Re: will it be optimized? Date: Fri, 9 Oct 2026 15:01:09 +0200 Organization: A noiseless patient Spider Lines: 179 Message-ID: <11aaoim$q0qj$1@dont-email.me> References: <11a1f4c$1g3sg$1@dont-email.me> <11a4qor$2kj95$1@dont-email.me> <11a50tk$2m3b3$2@dont-email.me> <11a5etj$2saav$1@dont-email.me> <11a5l3q$2urvl$1@dont-email.me> <11a63p7$34vce$1@dont-email.me> <11a7dh0$3ifm4$1@dont-email.me> <11a8s0n$5k6m$1@dont-email.me> <11aaa7v$kga5$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Fri, 09 Oct 2026 13:01:11 +0000 (UTC) Injection-Info: dont-email.me; logging-data="852819"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18hebiwaV1uAom4dQsiTJZv5hzMbV4JYb8="; posting-host="6bfced547515b2d762c33aed4cf2722f" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:140.0) Gecko/20100101 Firefox/140.0 SeaMonkey/2.53.24 Cancel-Lock: sha1:FdnLBAfyXCp2IeFa6AznF2jvbgg= sha256:+qtok1SnnUrKMalEHL/DLJF2Ht0dRCDK2ganu3XHqBU= sha1:4BbNYx4GyU+/UoUPs7HKEvPOzqM= sha256:wrJsVbJ10uk5ePp4yJxjZ1Z11FLPJQ6ei7b/fF/OFXs= In-Reply-To: <11aaa7v$kga5$1@dont-email.me>