{"title":"Erlang/otp行为的运行时类型安全","authors":"J. Harrison","doi":"10.1145/3331542.3342571","DOIUrl":null,"url":null,"abstract":"Callback-oriented Erlang/OTP behaviours such as the gen_server library are susceptible to malformed requests and ill-typed messages, causing server processes to crash unless a defensive programming style is used. We contribute an alternative approach in the form of a fully automatic hybrid analysis of callback modules using a notion of type safety based upon a sub-typing relation for Erlang. A combination of compile-time type inference, automatic code injection, and modifications to the request dispatch code of gen_server are used to demonstrate how generic server processes can be protected from client-side type errors.","PeriodicalId":115673,"journal":{"name":"Proceedings of the 18th ACM SIGPLAN International Workshop on Erlang","volume":"1 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2019-08-18","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"4","resultStr":"{\"title\":\"Runtime type safety for Erlang/otp behaviours\",\"authors\":\"J. Harrison\",\"doi\":\"10.1145/3331542.3342571\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Callback-oriented Erlang/OTP behaviours such as the gen_server library are susceptible to malformed requests and ill-typed messages, causing server processes to crash unless a defensive programming style is used. We contribute an alternative approach in the form of a fully automatic hybrid analysis of callback modules using a notion of type safety based upon a sub-typing relation for Erlang. A combination of compile-time type inference, automatic code injection, and modifications to the request dispatch code of gen_server are used to demonstrate how generic server processes can be protected from client-side type errors.\",\"PeriodicalId\":115673,\"journal\":{\"name\":\"Proceedings of the 18th ACM SIGPLAN International Workshop on Erlang\",\"volume\":\"1 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2019-08-18\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"4\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Proceedings of the 18th ACM SIGPLAN International Workshop on Erlang\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1145/3331542.3342571\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 18th ACM SIGPLAN International Workshop on Erlang","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3331542.3342571","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
Callback-oriented Erlang/OTP behaviours such as the gen_server library are susceptible to malformed requests and ill-typed messages, causing server processes to crash unless a defensive programming style is used. We contribute an alternative approach in the form of a fully automatic hybrid analysis of callback modules using a notion of type safety based upon a sub-typing relation for Erlang. A combination of compile-time type inference, automatic code injection, and modifications to the request dispatch code of gen_server are used to demonstrate how generic server processes can be protected from client-side type errors.