linear vs. gc (was Re: ATS+Emscripten)

26 views
Skip to first unread message

Raoul Duke

unread,
Oct 21, 2015, 6:08:51 PM10/21/15
to ats-lang-users
> course, using
> linear types to avoid GC is another option, especially, for performant code.

some ignorant questions i have in my head (and might make good FAQs / PR):

Q: Is it truly reasonable / easy to do everything with linear typing,
and totally avoid GC?

Q: It is easy to (gradually) go from GC to linear typing?

Q: How does it all interplay with 3rd party libraries?

thanks.

Barry Schwartz

unread,
Oct 21, 2015, 6:26:09 PM10/21/15
to ats-lan...@googlegroups.com
Raoul Duke <rao...@gmail.com> skribis:
> Q: It is easy to (gradually) go from GC to linear typing?

No matter what anyone else might say, I’m going to stick with
resounding, echoing, reverberating ‘NO!’ as my personal answer to that
question. :)

(Especially after just having coded a bunch of ‘immutable’ data
structures in both C and ATS, thoroughly relying on garbage collection
to clean up the mess such structures otherwise would leave.)

Hongwei Xi

unread,
Oct 21, 2015, 10:13:24 PM10/21/15
to ats-lan...@googlegroups.com

>>Q: Is it truly reasonable / easy to do everything with linear typing,
and totally avoid GC?

As can be expected, the answer always depends on what system is
being implemented and who is implementing it.

>>Q: It is easy to (gradually) go from GC to linear typing?

This depends on how the code being worked on is actually written.

>>Q: How does it all interplay with 3rd party libraries?

To work with a third party library, one in general needs to first acquire a solid understanding
on how the library does its own memory management.

As I see it now, reference counting backed up by linear types can go a very long way.



--
You received this message because you are subscribed to the Google Groups "ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/CAJ7XQb7Mbn0muXVXF%3DEU9mQJ1Ddn_tE-O0Sx3a-f_YhZMe4Cbw%40mail.gmail.com.

Reply all
Reply to author
Forward
0 new messages