Lune

OOPSLA2025顶会

Code Style Sheets: CSS for Code

Sam Cohen, Ravi Chugh

摘要

Program text is rendered using impoverished typographic styles. Beyond choice of fonts and syntax-highlighting colors, code editors and related tools utilize very few text decorations. These limited styles are, furthermore, applied in monolithic fashion, regardless of the programs and tasks at hand.

We present the notion of code style sheets for styling program text. Motivated by analogy to cascading style sheets (CSS) for styling HTML documents, code style sheets provide mechanisms for defining rules to select elements from an abstract syntax tree (AST) in order to style their corresponding visual representation. Technically, our selector language generalizes essential constructs from CSS to a programming-language setting with algebraic data types (such as ASTs). Practically, code style sheets allow ASTs to be styled granularly, based on semantic information-such as the structure of abstract syntax, static type information, and corresponding run-time values-as well as design choices on the part of authors and readers of a program. Because programs are heavily nested in structure, a key aspect of our design is a layout algorithm that renders nested, multiline text blocks more compactly than in existing box-based layout systems such as HTML.

In this paper, we design and implement a code style sheets system for a subset of Haskell, using it to illustrate several code presentation and visualization tasks. These examples demonstrate that code style sheets provide a uniform framework for rendering programs in multivarious ways, which could be employed in future designs for text-based as well as structure editors.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 2 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Filling typed holes with live GUIs 引用了 Projection Boxes: On-the-fly Reconfigurable Visualization for Live Programming
  • Filling typed holes with live GUIs 引用了 Adding interactive visual syntax to textual code
  • Ragged Blocks: Rendering Structured Text with Style 引用了 Filling typed holes with live GUIs
  • Ragged Blocks: Rendering Structured Text with Style 引用了 Structured Editing for All: Deriving Usable Structured Editors from Grammars
  • Ragged Blocks: Rendering Structured Text with Style 引用了 Adding interactive visual syntax to textual code
  • Ragged Blocks: Rendering Structured Text with Style 引用了 Penrose: from mathematical notation to beautiful diagrams
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper2

  1. Ragged Blocks: Rendering Structured Text with StyleSam Cohen, Ravi ChughUIST 2025 · 1 次引用
  2. Syntactic Completions with Material ObligationsDavid Moon, Andrew Blinn, Thomas Porter, Cyrus OmarOOPSLA 2025

它引用的 Paper8

  1. Penrose: from mathematical notation to beautiful diagramsKatherine Ye, Wode Ni, Max Krieger, Dor Ma'ayan 等SIGGRAPH 2020 · 53 次引用
  2. Projection Boxes: On-the-fly Reconfigurable Visualization for Live ProgrammingSorin LernerCHI 2020 · 52 次引用
  3. Filling typed holes with live GUIsCyrus Omar, David Moon, Andrew Blinn, Ian Voysey 等PLDI 2021 · 35 次引用
  4. Adding interactive visual syntax to textual codeLeif Andersen, Michael Ballantyne, Matthias FelleisenOOPSLA 2020 · 28 次引用
  5. Structured Editing for All: Deriving Usable Structured Editors from GrammarsTom Beckmann, Patrick Rein, Stefan Ramson, Joana Bergsiek 等CHI 2023 · 21 次引用

相关 Paper

  1. A Pretty Expressive PrinterSorawee Porncharoenwase, Justin Pombrio, Emina TorlakOOPSLA 2023
  2. Taking ASCII Drawings Seriously: How Programmers Diagram CodeDevamardeep Hayatpur, Brian Hempel, Kathy Chen, William Duan 等CHI 2024 · 7 次引用
  3. Stylette: Styling the Web with Natural LanguageTae Soo Kim, DaEun Choi, Yoonseo Choi, Juho KimCHI 2022 · 71 次引用
  4. Digging for fold: synthesis-aided API discovery for HaskellMichael B. James, Zheng Guo, Ziteng Wang, Shivani Doshi 等OOPSLA 2020 · 19 次引用
  5. AST-Trans: Code Summarization with Efficient Tree-Structured AttentionZe Tang, Xiaoyu Shen, Chuanyi Li, Jidong Ge 等ICSE 2022 · 57 次引用
黄昏的海面,两侧是细线勾勒的悬崖