首页> 外文会议>ACM symposium on Applied Computing >Static type inference for Ruby
【24h】

Static type inference for Ruby

机译:Ruby的静态类型推断

获取原文

摘要

Many general-purpose, object-oriented scripting languages are dynamically typed, which provides flexibility but leaves the programmer without the benefits of static typing, including early error detection and the documentation provided by type annotations. This paper describes Diamondback Ruby (DRuby), a tool that blends Ruby's dynamic type system with a static typing discipline. DRuby provides a type language that is rich enough to precisely type Ruby code we have encountered, without unneeded complexity. When possible, DRuby infers static types to discover type errors in Ruby programs. When necessary, the programmer can provide DRuby with annotations that assign static types to dynamic code. These annotations are checked at run time, isolating type errors to unverified code. We applied DRuby to a suite of benchmarks and found several bugs that would cause run-time type errors. DRuby also reported a number of warnings that reveal questionable programming practices in the benchmarks. We believethat DRuby takes a major step toward bringing the benefits of combined static and dynamic typing to Ruby and other object-oriented languages.
机译:许多通用,面向对象的脚本语言是动态键入的,这提供了灵活性,但不会让程序员留下静态键入的好处,包括早期错误检测和类型注释提供的文档。本文介绍了Diamondback Ruby(Droby),该工具将Ruby的动态型系统与静态键入学科融合。 Druby提供了一种富有的型语言,足以精确地键入我们遇到的Ruby代码,没有不需要的复杂性。当可能时,Droby Infers静态类型以发现Ruby程序中的类型错误。必要时,程序员可以使用分配静态类型的注释提供脱滴块。在运行时检查这些注释,将类型错误隔离为未验证的代码。我们将Droby应用于一套基准测试,发现了几个会导致运行时类型错误的错误。 Druby还报告了一些警告,揭示了基准中的可疑的编程实践。我们相信Droby迈出了一个重大步骤,使静态和动态与Ruby和其他面向对象语言的效益带来了效益。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号