static mps_res_t Type_isfwd_fn( mps_addr_t addr )
{
Type_type type = addr ;
switch ( type->kind ) {
case Type_forwardType: return type->fwd ;
default: return NULL ;
}
}
So the question here is, do you think this is reasonable C code, and
would you write something similar yourself? After all, /kind/ is an
enum, and the compiler might complain if you don't handle all the cases,
and not do that if you merely use an if (). I wouldn't know, as I don't
keep track of changes within G.C.C. nor clang anymore.
Another question is, would you consider using the MPS memory pool system
if you were to implement something garbage collected, like Common Lisp
or ML [1]?
So the question here is, do you think this is reasonable C code, and
would you write something similar yourself? After all, /kind/ is an
enum, and the compiler might complain if you don't handle all the cases,
Another question is, would you consider using the MPS memory pool systemThe intersection of "people who still write in C" and "people who want
if you were to implement something garbage collected, like Common Lisp
or ML [1]?
to use someone else's C memory pool thing" is slowly converging to null.
On 10/8/2026 9:31 AM, Kaz Kylheku wrote:
And don't forget that just recently, people found a security bug in
OpenSSL [again] just because they neglected to include a garbage coll-
ector in the system. Maybe they would have been better off, if they'd
just used MPS from the start?
On 2026-10-09, Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> wrote:
On 10/8/2026 9:31 AM, Kaz Kylheku wrote:
And don't forget that just recently, people found a security bug in
OpenSSL [again] just because they neglected to include a garbage coll-
ector in the system. Maybe they would have been better off, if they'd
just used MPS from the start?
Many programs that use OpenSSL nowadays are threaded.
Threads + GC + stuff written in C => shit show
You may fix some use-after-free bug, but you introduce 17 others,
the 16th and 17th of which won't be found until 2037 and 2050.
I've pulled out my hair debugging GC problems in a single-threaded Lisp implementation.
You have to develop all the tooling and approaches for it because
none of the regular memory debugging tools understand your GC objects.
I wanted Valgrind, so I had to integrate it, and it's not perfect.
A newly created GC object is wrongly garbage collected, perhaps just
before it was properly made reachable. The object is reassigned to
a different purpose, but the original context uses it also. Happy
case: the object has a different type, incompatible with what the
original owner is doing, and so that blows up, and (happy again)
it happens close to where it was created. From there, there are
various shades of unhappy.
I forgot for which programming language MPS was originally designed for, though I suspect it was ML, and the Ravenbrook website was gone last
time I checked.
On 10/10/2026 4:45 AM, Kaz Kylheku wrote:
On 2026-10-09, Johann 'Myrkraverk' Oskarsson
<johann@myrkraverk.invalid> wrote:
On 10/8/2026 9:31 AM, Kaz Kylheku wrote:
And don't forget that just recently, people found a security bug in
OpenSSL [again] just because they neglected to include a garbage coll-
ector in the system.-a Maybe they would have been better off, if they'd
just used MPS from the start?
Many programs that use OpenSSL nowadays are threaded.
Threads + GC + stuff written in C => shit show
You may fix some use-after-free bug, but you introduce 17 others,
the 16th and 17th of which won't be found until 2037 and 2050.
I've pulled out my hair debugging GC problems in a single-threaded Lisp
implementation.
You have to develop all the tooling and approaches for it because
none of the regular memory debugging tools understand your GC objects.
I wanted Valgrind, so I had to integrate it, and it's not perfect.
A newly created GC object is wrongly garbage collected, perhaps just
before it was properly made reachable. The object is reassigned to
a different purpose, but the original context uses it also. Happy
case: the object has a different type, incompatible with what the
original owner is doing, and so that blows up, and (happy again)
it happens close to where it was created. From there, there are
various shades of unhappy.
That's fair.-a And I deplore your lack of hair.-a Mine -- as seen on Blue- Sky -- is not from fighting garbage collectors.-a Though I suppose I
could put more pictures of myself there.-a So I'll keep that in mind as something to do over the weekend.
Now, on debugging garbage collectors, the MPS manual has this chapter on
the subject,
-a https://memory-pool-system.readthedocs.io/en/latest/guide/debug.html
and I have to say that I have not had the displeasure of needing to use
it -- yet.
And on the subject of garbage collection and threads, the Memory Pool
manual has this to say on the subject.
-a The MPS is designed to work with multi-threaded programs. Functions in
-a the C interface are thread safe, except in a few documented cases. See
-a Threads. The allocation point protocol provides fast lock-free
-a allocation on multiple threads simultaneously. See Allocation.
So it would seem, at first glance, that the OpenSSL security issue --
I'll link it if anyone cares to ask, but it should be readily found --
would not have happened if they'd used the MPS from the start.-a And
since they don't, and never did, there is no second glance to prove me
wrong.
I'll just note that I made the personal promise to myself, that I'd
never contribute code to OpenSSL, so I will not undertake the effort
of proving myself wrong in this case.
Best wishes, and happy garbage collection!
[1] I have not dug into the intern guts of it, and my memory of that
part of the manual is vague.
Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> wrote:
I forgot for which programming language MPS was originally designed for,
though I suspect it was ML, and the Ravenbrook website was gone last
time I checked.
Dylan, I am almost certain.
On Sat, 10 Oct 2026 09:45:19 -0000 (UTC), tfb <tfb@work.it.out> wrote:
Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> wrote:
I forgot for which programming language MPS was originally designed for, >>> though I suspect it was ML, and the Ravenbrook website was gone last
time I checked.
Dylan, I am almost certain.
I /don't/ know for certain, but according to its own history MPS was developed by Harlequin - which made a Lisp. Dylan came from Apple.
https://memory-pool-system.readthedocs.io/en/latest/bib.html#brooksby02
I /don't/ know for certain, but according to its own history MPS was developed by Harlequin - which made a Lisp. Dylan came from Apple.
George Neuner <gneuner2@comcast.net> wrote:
I /don't/ know for certain, but according to its own history MPS was
developed by Harlequin - which made a Lisp. Dylan came from Apple.
Harlequin had a Dylan implementation, DylanWorks (I don't remember if it shipped). MLWorks was earlier and some of the people who did MPS had
worked on its memory management. MPS seems to have been developed for DylanWorks however. https://www.ravenbrook.com/project/mps/doc/2002-01-30/ismm2002-paper/ makes the history reasonably clear.
George Neuner <gneuner2@comcast.net> wrote:
I /don't/ know for certain, but according to its own history MPS was
developed by Harlequin - which made a Lisp. Dylan came from Apple.
Harlequin had a Dylan implementation, DylanWorks (I don't remember if it >shipped). MLWorks was earlier and some of the people who did MPS had
worked on its memory management. MPS seems to have been developed for >DylanWorks however. >https://www.ravenbrook.com/project/mps/doc/2002-01-30/ismm2002-paper/ makes >the history reasonably clear.
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 76 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 56:27:32 |
| Calls: | 1,265 |
| Calls today: | 1 |
| Files: | 1,362 |
| D/L today: |
3 files (2,684K bytes) |
| Messages: | 285,806 |