🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #2232

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

#2232
From: Tristan Wibberley
Date: Sat, 05 Dec 2026 08:10
36 lines
3027 bytes
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.

-- 
Tristan Wibberley

The message body is Copyright (C) 2026 Tristan Wibberley except
citations and quotations noted. All Rights Reserved except that you may,
of course, cite it academically giving credit to me, distribute it
verbatim as part of a usenet system or its archives, and use it to
promote my greatness and general superiority without misrepresentation
of my opinions other than my opinion of my greatness and general
superiority which you _may_ misrepresent. You definitely MAY NOT train
any production AI system with it but you may train experimental AI that
will only be used for evaluation of the AI methods it implements.
Technical Details
Message-ID: <11f0gtg$2i7jn$3@dont-email.me>
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <11eh538$3fet7$1@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!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Tristan Wibberley <tristan.wibberley+netnews2@alumni.manchester.ac.uk>
Newsgroups: comp.lang.c
Subject: Re: is wraper on realloc good idea? maybe more wrappers?
Date: Sat, 5 Dec 2026 08:10:24 +0000
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <11f0gtg$2i7jn$3@dont-email.me>
References: <11eh538$3fet7$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 05 Dec 2026 08:10:25 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="2694775"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18g5p5m41s7j+FpVFiBQnoDvsM1ai+wvTIus8bb1o/uqg=="; posting-host="e210ba6551fa09f4d8612e67f408742d"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:lIBF+P4PUs822e8+H1gGGNKQlWU= sha256:1WujRwnRgi/9m5M7DNWaSUIz3i4vzchvKOhUr+0tI+U=
	sha1:xwPA+Wm/SAqVuOk/nUDMEbFxqqw= sha256:F8akwXW9Fy3gKL/2+Q1YisUsd2JBo9wYjYx5K6CdA8E=
Content-Language: en-GB
In-Reply-To: <11eh538$3fet7$1@dont-email.me>