Context: Roblox Studio lets millions of creators build interactive experiences by programming in a variant of Lua called Luau. The creators form a broad group, ranging from novices writing their first script to professional developers; thus, Luau must support a wide audience. As part of its efforts to support all kinds of programmers, Luau includes an optional, gradual type system and goes to great lengths to minimize false positive errors. Inquiry: Since Luau is currently being used by many creators, we want to collect data to improve the language and, in particular, the type system. The standard way to collect data is to deploy client-side telemetry; however, we cannot scrape personal data or proprietary information, which means we cannot collect source code fragments, error messages, or even filepaths. The research questions are thus about how to conduct telemetry that is not invasive and obtain insights from it about type errors. Approach: We designed and implemented a pseudonymized, randomly-sampling telemetry system for Luau. Telemetry records include a timestamp, a session id, a reason for sending, and a numeric summary of the most recent type analyses. This information lets us study type errors over time without revealing private data. We deployed the system in Roblox Studio during Spring 2023 and collected over 1.5 million telemetry records from over 340,000 sessions. Knowledge: We present several findings about Luau, all of which suggest that telemetry is an effective way to study type error pragmatics. One of the less-surprising findings is that opt-in gradual types are unpopular: there is an 100x gap between the number of untyped Luau sessions and the number of typed ones. One surprise is that the strict mode for type analysis is overly conservative about interactions with data assets. A reassuring finding is that type analysis rarely hits its internal limits on problem size. Grounding: Our findings are supported by a dataset of over 1.5 million telemetry records. The data and scripts for analyzing it are available in an artifact. Importance: Beyond the immediate benefits to Luau, our findings about types and type errors have implications for adoption and ergonomics in other gradual languages such as TypeScript, Elixir, and Typed Racket. Our telemetry design is of broad interest, as it reports on type errors without revealing sensitive information.
翻译:上下文:Roblox Studio 允许数百万创作者使用名为Luau的Lua变体编程语言构建交互式体验。创作者群体涵盖从首次编写脚本的新手到专业开发人员的广泛范围,因此Luau必须支持多元用户群体。作为支持各类程序员努力的一部分,Luau包含可选的渐进类型系统,并竭尽全力减少误报错误。问题:鉴于Luau目前被众多创作者使用,我们希望通过收集数据来改进该语言,特别是其类型系统。标准数据收集方式是部署客户端遥测技术,但我们不能抓取个人数据或专有信息,这意味着无法收集源代码片段、错误消息甚至文件路径。研究问题因而聚焦于如何实施非侵入式遥测并从中获取类型错误相关洞见。方法:我们设计并实现了Luau的假名化随机采样遥测系统。遥测记录包含时间戳、会话ID、发送原因及最近类型分析的数值摘要。这些信息使我们能够在不泄露隐私数据的情况下研究类型错误随时间的变化。我们于2023年春季在Roblox Studio部署该系统,从超过34万个会话中收集了150余万条遥测记录。知识:我们呈现了关于Luau的多项发现,所有结果均表明遥测是研究类型错误实用性的有效方法。其中最不令人意外的发现是可选渐进类型并不受欢迎:未类型化Luau会话数量与类型化会话数量存在100倍差距。令人惊讶的是,类型分析的严格模式对数据资产交互过于保守。令人欣慰的是,类型分析很少触及问题规模的内在限制。依据:我们的发现基于超过150万条遥测记录数据集。分析数据及脚本可通过工件获取。重要性:除对Luau的直接改进外,我们关于类型及类型错误的发现对TypeScript、Elixir、Typed Racket等其他渐进语言在易用性与推广方面具有借鉴意义。我们的遥测设计方案在不泄露敏感信息的前提下报告类型错误,具有广泛适用价值。