comp.lang.ada
 help / color / mirror / Atom feed
From: sbelmont700@gmail.com
Subject: Re: Comprehending subpools
Date: Mon, 18 Jun 2018 17:32:23 -0700 (PDT)
Date: 2018-06-18T17:32:23-07:00	[thread overview]
Message-ID: <351c6acd-8a8c-41a3-bb52-dd3f82322829@googlegroups.com> (raw)
In-Reply-To: <pg1dpq$dsb$1@franka.jacob-sparre.dk>

I guess it's just a case of me reading too much into things.  The rationale declares subpools "a major new facility", but I just couldn't (and perhaps still can't) see a niche feature as being worth all the time and trouble.  When people say "far safer" i think of code that doesn't have to be prefixed with Unchecked_* at all, not just "you have to call it less".

And sure, finalization is of course important, but subpools seem almost specifically engineered to solve one problem that one person had writing one type of program, and not a general-purpose building block (which happily most features in Ada are).  Which is fine for small features that are relatively easy, but just judging from the AI text, subpools seems to be the biggest change to 2012 second only to contracts, and it mostly seems, well, wasted.  It doesn't appear the default pool has to support them (?), so step one to using a subpool is to go and implement a pool-with-subpools and hardcode your program to use it, and that's a high barrier to entry even when it's warrented.  And when there are so many other things developers on CLA are always clamoring for (<cough>constructors<cough>), it all seems like an odd way to focus energies.  Not to be flippant, but my kingdom for a do loop...and 'do' is already a reserved word!

I'd rather pull all the nonsense of wrapping access values in controlled types out of the client in the first place and put it into the pool itself (a callback passed to allocate or something?), instead of just solving the problems piecemeal.  Having to use controlled types for memory management is the problem IMHO.  Let code work with access values directly and leave it to the pool they came from to decide how and when to clean it up.

I suppose i was just hoping for more.  I would, however, be interested to hear examples of how other people have found them useful in their own code (outside of compiler ASTs) to help foster my imagination of what else can be done with them.

Thank you again for the responses and continued support.

-sb


  parent reply	other threads:[~2018-06-19  0:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-14 13:48 Comprehending subpools sbelmont700
2018-06-14 21:21 ` Randy Brukardt
2018-06-15  7:15   ` Dmitry A. Kazakov
2018-06-15 22:15     ` Randy Brukardt
2018-06-16  7:36       ` Dmitry A. Kazakov
2018-06-19  0:32       ` sbelmont700 [this message]
2018-06-29 19:57         ` Randy Brukardt
2018-06-29 22:42           ` Shark8
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox