POSIX shell的可执行形式语义
Executable formal semantics for the POSIX shell
摘要:
POSIX shell是一种广泛部署的、用于管理计算机系统的强大工具。shell是专家的控制面板,是配置、编译、安装、维护和部署系统的必要工具。尽管POSIX shell是一个强大的、关键的基础设施,但它仍然受到诽谤和误解。它的力量和微妙是一个危险的组合。我们为POSIX shell定义了一个正式的、机械化的、可执行的小步骤语义,我们称之为Smoosh。我们将Smoosh与其他七个旨在实现POSIX兼容性的shell(bash、dash、zsh、OSH、mksh、ksh 93和yash)进行了比较。使用三个测试套件--POSIX测试套件,Modernish测试套件和shell诊断,以及我们自己设备的测试套件--我们发现Smoosh的语义是最符合POSIX标准的。Modernish认为Smoosh的bug最少(只有一个,因为使用了dash的解析器),而且没有怪癖。为了证明我们的语义除了生成一个一致的、可执行的shell之外是有用的,我们还实现了一个符号步进器来说明shell的微妙行为。Smoosh将作为POSIX shell正式研究的基础,支持新shell、shell新工具和新shell设计的研究和开发。
英文摘要:
The POSIX shell is a widely deployed, powerful tool for managing computer systems. The shell is the expert's control panel, a necessary tool for configuring, compiling, installing, maintaining, and deploying systems. Even though it is powerful, critical infrastructure, the POSIX shell is maligned and misunderstood. Its power and its subtlety are a dangerous combination. We define a formal, mechanized, executable small-step semantics for the POSIX shell, which we call Smoosh. We compared Smoosh against seven other shells that aim for some measure of POSIX compliance (bash, dash, zsh, OSH, mksh, ksh93, and yash). Using three test suites---the POSIX test suite, the Modernish test suite and shell diagnosis, and a test suite of our own device---we found Smoosh's semantics to be the most conformant to the POSIX standard. Modernish judges Smoosh to have the fewest bugs (just one, from using dash's parser) and no quirks. To show that our semantics is useful beyond yielding a conformant, executable shell, we also implemented a symbolic stepper to illuminate the subtle behavior of the shell. Smoosh will serve as a foundation for formal study of the POSIX shell, supporting research on and development of new shells, new tooling for shells, and new shell designs.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。