🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #2248

Re: is wraper on realloc good idea? maybe more wrappers?

#2248
From: Ross Finlayson
Date: Sat, 05 Dec 2026 12:38
31 lines
2842 bytes
On 12/05/2026 12:10 AM, Tristan Wibberley wrote:
> On 29/11/2026 12:16, fir wrote:
>> never used it but generally wrappers on some standard functions
>> probably are good idea, or not?
>
> The art of programming is all about wrapping, wrapping all the way down.
>
> The compsci way is to write a solution in the language of the problem
> domain then interpret that language in a language of the domain of
> interpreting that (class of) languages, and so forth until you get to
> your preferred system programming language. That's all wrapping and it's
> equivalent to looping and recursion without wrapping, just an
> alternative expression.
>
> But it's mostly a waste of time to wrap for the sake of wrapping -
> unless you're adding some type annotations/(pre/post)conditions/asserts,
> etc. Sometimes you can use the linker for that stuff instead of C.
>
> I don't know where to place EDSLs there.
>
> In C++ I sometimes wrap heap-stuff with smart-references because
> managing heap allocations is too hard, like chess - the rules are easy
> but it's not so easy to play a game; that's /almost/ an EDSL: couching
> allocation in terms of lexical scopes.
>

Often usual accounts of low-level programming in C/C++ like C++ 98/03
have that reference-counting smart-pointers hand-written in a page or
two are entirely common and completely ubiquitous for heap objects.

Technical Details
Message-ID: <YtKcnd7kZMAsmIn2nZ2dnZfqnPadnZ2d@giganews.com>
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!border-3.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-3.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
References: <11eh538$3fet7$1@dont-email.me> <11f0gtg$2i7jn$3@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!border-3.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-3.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Sat, 05 Dec 2026 12:38:09 +0000
Subject: Re: is wraper on realloc good idea? maybe more wrappers?
Newsgroups: comp.lang.c
References: <11eh538$3fet7$1@dont-email.me> <11f0gtg$2i7jn$3@dont-email.me>
From: Ross Finlayson <ross.a.finlayson@gmail.com>
Date: Sat, 5 Dec 2026 04:38:05 -0800
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.6.0
MIME-Version: 1.0
In-Reply-To: <11f0gtg$2i7jn$3@dont-email.me>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <YtKcnd7kZMAsmIn2nZ2dnZfqnPadnZ2d@giganews.com>
Lines: 31
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-khEjlK6Fkk2M0Izu0FBejowjrP0WCZEfcsJTqS2orxpUJ4bWvDd+SVzq4DRuY8smtM9UgxCHLL3UEed!NTMbW92tpx4Q7XooHDZCtxKm8OYON0qEeaZh/KiDiS7AyCjaRNHLit0QXOKQvYgTctD1JcxdpzIQ!4A==
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40