Article View: comp.lang.c
Article #2260Re: is wraper on realloc good idea? maybe more wrappers?
From: Tristan Wibberley
Date: Sat, 05 Dec 2026 23:06
Date: Sat, 05 Dec 2026 23:06
50 lines
3719 bytes
3719 bytes
On 05/12/2026 08:24, fir wrote: > Tristan Wibberley pisze: >> 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. >> > > wrapers can be inlined and that makes them interesting and i suspect i > use them too sparingly in some way...and it needs some thought Yes, that's how I feel about them too. I gave the deeper answer because I've known people who perceive "wrap" to refer to the act of giving an alternative but identical interface, cutting out nothing, modifying nothing, and so they were opposed to it - of course. However their understanding of words and engineering was bizarre it turned out. -- 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:
<11f25e6$3ca6h$3@dont-email.me>Path:
mbox-mo1.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<11eh538$3fet7$1@dont-email.me> <11f0gtg$2i7jn$3@dont-email.me> <11f0hoj$2j0l9$1@dont-email.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.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 23:06:46 +0000 Organization: A noiseless patient Spider Lines: 50 Message-ID: <11f25e6$3ca6h$3@dont-email.me> References: <11eh538$3fet7$1@dont-email.me> <11f0gtg$2i7jn$3@dont-email.me> <11f0hoj$2j0l9$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 23:06:47 +0000 (UTC) Injection-Info: dont-email.me; logging-data="3549393"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19giw2lJ8Rf18KevAJ9xhqgvvB+02q+poPhDokKFNfpnw=="; posting-host="e210ba6551fa09f4d8612e67f408742d" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:uJYrYfCbmfzBDNZodX6T+yRP5LE= sha256:W7e9SbvkaKsfLDfcrIMjXXYXdVyN6nFT5wedo9qrigk= sha1:4GQRmPSF0e7UAPE9uAKeVa3I1XY= sha256:Uvi4/EGXgcstan0ojwt1IS8BGFTttnd/wX76d3avtAg= Content-Language: en-GB In-Reply-To: <11f0hoj$2j0l9$1@dont-email.me>