-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Fri, Jun 02, 2017 at 10:00:18PM -0400, Mark H Weaver wrote: > <to...@tuxteam.de> writes:
[...] > > This would at least suggest having a way to query whether madvise is > > available, through some introspection (giving the program a chance > > to adapt its behavior)? > > First of all, you should read this for background: > > https://wingolog.org/archives/2014/03/17/stack-overflow Done. > If you've done that, then you should understand that this new feature in > guile-2.2 fundamentally changes the way we can express loops in Scheme > that build recursive data structures where scalability is important. [...] Yes, I got that: in a nutshell, getting the stack auto-extended instead of being blown out of existence by a segfault or similar. > Consider how frequently patterns like this occur. Do you really want to > duplicate every piece of code with a loop of this form? It would be > better to just give up on this new feature entirely. > > Anyway, even if you did duplicate your code, that would not solve the > problem, because many procedures in Guile itself are now written in the > nicer way to take advantage of this. One such example is 'map'. You are right, duplicating every piece of code doesn't seem to be a Good Thing. I rather proposed the introspection for those who want to come up with whatever other ideas: it might be they'll want to warn the user right off at the beginning ("uh, oh: no madvise: expect a rough ride", so they can then segfault without guilt :) > I'm quite fond of the Hurd design, and I hope it continues to grow, but > it's unrealistic to expect developers to write loops like this in a > fundamentally less clear way to cater to an experimental OS that has so > few users. > > Does that make sense? It does. As I said, I just proposed that, if Guile decides to use madvise() dynamically (by "bypassing" ENOSYS -- that's IMO a good idea anyway), it should give the user a possibility to check for that very fact ("do we, actually, have an madvise()?"). WDYT? Cheers - -- tomás > > Mark -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlkyWhwACgkQBcgs9XrR2kYkSACdE8BsW58sCblJWhv0PSQV7+wO 9vYAnjezj0Fr9jg0I7SJDsJBG2pQhLhK =wSGI -----END PGP SIGNATURE-----