Views for resources other than memory?

25 views
Skip to first unread message

Shea Levy

unread,
Aug 30, 2014, 1:01:50 AM8/30/14
to ats-lan...@googlegroups.com
Hi all,

Can views/linear types be used to represent resources besides memory?
For example, can I encode rules like "file descriptors must be closed to
be released" or "you can only read from a file descriptor open for
reading" with linear types? How would I go about doing that, if so?

Thanks,
Shea

gmhwxi

unread,
Aug 30, 2014, 1:12:01 AM8/30/14
to ats-lan...@googlegroups.com
Well, you have to use your imagination :)

You can find some articles here:

http://www.ats-lang.org/EXAMPLE/EFFECTIVATS

This one is especially related:

http://www.ats-lang.org/EXAMPLE/EFFECTIVATS/Readers-and-Writers/main.html

Shea Levy

unread,
Aug 30, 2014, 1:51:31 AM8/30/14
to ats-lan...@googlegroups.com
Ah, thank you! The existence of abstract views was a key bit I was
missing.

Is 'assume' required to only occur once per program for abstract views?
That is, can I make a set of abstract views representing a file being
open, readable, writable, etc. and then ensure that only my
implementation can actually create instances of those views without a
praxi?

~Shea
> --
> 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/35c5c987-93aa-47d3-b777-ec54920fe82f%40googlegroups.com.

Hongwei Xi

unread,
Aug 30, 2014, 2:01:36 AM8/30/14
to ats-lan...@googlegroups.com
>>Is 'assume' required to only occur once per program for abstract views?

Yes. If an absview (or abstype) is implemented more than once, then a link-time error
will be reported.



Reply all
Reply to author
Forward
0 new messages