arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1907.04934cs.PL
收藏

CallE:一个方法调用的效果系统

CallE: An Effect System for Method Calls

Isaac Oscar Gariano, James Noble, Marco Servetto

摘要:

效果系统用于静态地推断表达式在计算时可能具有的效果。在文献中,此类影响包括内存访问和异常抛出等各种行为。在这里,我们介绍了CallE,一种面向对象的语言,它采用了一种灵活的方法,其中效果只是方法调用:这很好,因为普通方法通常会对I/O操作,访问全局状态或原始语言操作(如线程创建)进行建模。CallE支持对这种行为进行灵活和细粒度的控制,旨在最大限度地减少注释的复杂性。CallE的效果系统可以用来防止OO代码执行特权操作,例如查询数据库、修改GUI小部件、退出程序或执行网络通信。它还可以用来确保确定性,通过防止方法(间接)调用非确定性原语,如随机数生成或文件读取。

英文摘要:

Effect systems are used to statically reason about the effects an expression may have when evaluated. In the literature, such effects include various behaviours as diverse as memory accesses and exception throwing. Here we present CallE, an object-oriented language that takes a flexible approach where effects are just method calls: this works well because ordinary methods often model things like I/O operations, access to global state, or primitive language operations such as thread creation. CallE supports both flexible and fine-grained control over such behaviour, in a way designed to minimise the complexity of annotations. CallE's effect system can be used to prevent OO code from performing privileged operations, such as querying a database, modifying GUI widgets, exiting the program, or performing network communication. It can also be used to ensure determinism, by preventing methods from (indirectly) calling non-deterministic primitives like random number generation or file reading.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑