January 13 Re: Obvious Things C Should Do | ||||
---|---|---|---|---|
| ||||
Posted in reply to matheus | On 1/13/2025 9:26 AM, matheus wrote:
> "The last meeting was pretty jam-packed, and a lot of things made it through at the 11th hour. We also lost quite a few good papers and features too, so they’ll have to be reintroduced next cycle, which might take us a whole extra 10 years to do."
"wide pointers (a native pointer + size construct)"
!!!
|
6 days ago Re: Obvious Things C Should Do | ||||
---|---|---|---|---|
| ||||
Posted in reply to Zz | On Monday, 13 January 2025 at 17:00:39 UTC, Zz wrote:
> On Sunday, 12 January 2025 at 09:51:29 UTC, Paulo Pinto wrote:
>> On Sunday, 12 January 2025 at 00:57:11 UTC, monkyyy wrote:
>>> [...]
>>
>> C23 just came out, and C2y is on the way.
>>
>> It is still the official language of key industry standards like the ones from Khronos and Open Group (POSIX 2024 now requires C17 as minimum), so beloved by FOSS folks.
>>
>> It is more existent than it should be.
>
> TrapC: Memory Safe C Programming with No UB
>
> Paper will be presented by Robin Rowe at the upcoming ISO WG14 C Committee meeting.
>
> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3423.pdf
>
> Zz
Interesting, thanks for sharing.
|
6 days ago Re: Obvious Things C Should Do | ||||
---|---|---|---|---|
| ||||
Posted in reply to Zz | On 1/13/2025 9:00 AM, Zz wrote:
> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3423.pdf
With all the features listed below, they'd be better off using D:
TrapC is a C language extension that improves code safety
TrapC memory management is automatic, cannot memory leak, with pointers lifetime managed not garbage collected"
TrapC pointers may look the same as in C/C++, but all pointers are diligently compiler managed and memory safe
TrapC pointers have Run-Time Type Information (RTTI), with typeof(), nameof() and
other details accessible
TrapC reuses a few code safety features from C++, notably member functions,
constructors, destructors and ‘new’
TrapC adds 2 keywords unique to TrapC: ‘trap’ (error handling) and ‘alias’ (operator,
function and data overloading)
TrapC removes 2 keywords: ‘goto’ and ‘union’, as unsafe and having been widely
deprecated from use
TrapC uses castplates to make C containers typesafe, without the complexity of C++
templates
TrapC printf() and scanf() are typesafe, overloadable, and have JSON and localization
support built in
TrapC has an integer-based ‘decimal’ fixed-point data type suitable for use in financial
transactions
TrapC is one-way ABI compatible with C, such that TrapC functions may call any C
function as-is
Passing a raw C pointer safely to a TrapC function requires extra steps, because TrapC
pointers have hidden RTTI
TrapC has API-compatible versions of C POSIX and C++ STL standard libraries, to not
return raw pointers
TrapC doesn’t do more than C for thread safety to prevent race conditions, but may in the
future
|
Copyright © 1999-2021 by the D Language Foundation