Quickref: a Stress Test for Texinfo Didier Verna EPITA / LRDE - - PowerPoint PPT Presentation

quickref a stress test for texinfo
SMART_READER_LITE
LIVE PREVIEW

Quickref: a Stress Test for Texinfo Didier Verna EPITA / LRDE - - PowerPoint PPT Presentation

Introduction Overview Demo Challenges Conclusion Quickref: a Stress Test for Texinfo Didier Verna EPITA / LRDE didier@lrde.epita.fr lrde/~didier @didierverna didier.verna in/didierverna e TUG 2019 E Introduction Introduction Quickref:


slide-1
SLIDE 1

Introduction Overview Demo Challenges Conclusion

Quickref: a Stress Test for Texinfo

e TUG 2019 E Didier Verna

EPITA / LRDE

didier@lrde.epita.fr

lrde/~didier @didierverna didier.verna in/didierverna

slide-2
SLIDE 2

Introduction Overview Demo Challenges Conclusion

Introduction

◮ Common Lisp: Social / Community Aspects

◮ The most expressive and extensible language (homoiconicity) ◮ Drawbacks: technical social challenges

◮ Individualism ◮ (Too) Many difgerent solutions for every problem ◮ Quality diffjcult to assert ◮ Many of them ad-hoc or 80% fjnished ◮ Lack of documentation

◮ Consolidation Efgorts

◮ Websites, Resources (guides, tutorials, wikis etc.) ◮ ASDF, Quicklisp

◮ Introducing Quickref

◮ Global automatic documentation project for Quicklisp libraries ◮ <don> Reference manuals = user manuals </don>

Quickref: a Stress Test for Texinfo / TUG 2019 – Didier Verna 2/19

slide-3
SLIDE 3

Introduction Overview Demo Challenges Conclusion

Outline

System Overview Demonstration Challenges Conclusion & Perspectives

Quickref: a Stress Test for Texinfo / TUG 2019 – Didier Verna 3/19

slide-4
SLIDE 4

Introduction Overview Demo Challenges Conclusion

Outline

System Overview Demonstration Challenges Conclusion & Perspectives

Quickref: a Stress Test for Texinfo / TUG 2019 – Didier Verna 4/19

slide-5
SLIDE 5

Introduction Overview Demo Challenges Conclusion

Features

◮ 2000 or so libraries ◮ Public website: quickref.common-lisp.net ◮ Personal copy: Docker image / Lisp REPL ◮ Private website: local installation only

Quickref: a Stress Test for Texinfo / TUG 2019 – Didier Verna 5/19

slide-6
SLIDE 6

Introduction Overview Demo Challenges Conclusion

Documentation Extraction

◮ Distribution (README fjles etc.) ◮ ASDF metadata (author, description, repository, etc.) ◮ Language-level documentation (docstrings) ◮ The rest (software components)

◮ Code Walking (lightweight but very diffjcult) ◮ Introspection (easier but requires loading) system components, packages, constants, variables, macros, functions, methods, structures, classes, types, etc.

Quickref: a Stress Test for Texinfo / TUG 2019 – Didier Verna 6/19

slide-7
SLIDE 7

Introduction Overview Demo Challenges Conclusion

Documentation Extraction

◮ Distribution (README fjles etc.) ◮ ASDF metadata (author, description, repository, etc.) ◮ Language-level documentation (docstrings) ◮ The rest (software components)

◮ Code Walking (lightweight but very diffjcult) ◮ Introspection (easier but requires loading) system components, packages, constants, variables, macros, functions, methods, structures, classes, types, etc.

Quickref: a Stress Test for Texinfo / TUG 2019 – Didier Verna 6/19

ASDF metadata

(asdf:defsystem :net.didierverna.declt :long-name "Documentation Extractor from Common Lisp to Texinfo" :description "A reference manual generator for Common Lisp libraries" :author "Didier Verna" :mailto "didier@didierverna.net" :homepage "http://www.lrde.epita.fr/~didier/software/lisp/" :source-control "https://github.com/didierverna/declt" :license "BSD" ...)

slide-8
SLIDE 8

Introduction Overview Demo Challenges Conclusion

Documentation Extraction

◮ Distribution (README fjles etc.) ◮ ASDF metadata (author, description, repository, etc.) ◮ Language-level documentation (docstrings) ◮ The rest (software components)

◮ Code Walking (lightweight but very diffjcult) ◮ Introspection (easier but requires loading) system components, packages, constants, variables, macros, functions, methods, structures, classes, types, etc.

Quickref: a Stress Test for Texinfo / TUG 2019 – Didier Verna 6/19

Documentation strings

(defmacro @defconstant (name &body body) "Execute BODY within a @defvr {Constant} NAME environment. NAME is escaped for Texinfo prior to rendering. BODY should render on *standard-output*." `(@defvr "Constant" ,name ,@body))

slide-9
SLIDE 9

Introduction Overview Demo Challenges Conclusion

Toolchain

Quicklisp foo/ Declt foo.texi Makeinfo foo.html

◮ Why Texinfo?

◮ Well suited to technical documentation (reference manual) ◮ Easily converted (PDF, HTML, Info, etc.) ◮ Built-in index / anchoring / cross-reference facility

◮ Declt: Introspection

◮ Compilation / loading (of dependencies) may be required ◮ Avoid loading 2000 libraries in the same Lisp image! ◮ Run Declt in external processes

◮ Makeinfo: Perl/C script

◮ Ditto

◮ Quickref: Additional glue + loop over all Quicklisp libraries

Quickref: a Stress Test for Texinfo / TUG 2019 – Didier Verna 7/19

slide-10
SLIDE 10

Introduction Overview Demo Challenges Conclusion

Performance

Library Pool Declt Declt Declt Texinfo Files Makeinfo Makeinfo Makeinfo HTML Files

◮ Sequential Processing

◮ Absolute worst-case sequential scenario: 7h ◮ Typical scenario: 2h

◮ Parallel Processing + scheduling algorithm

◮ 4x performance improvement

Quickref: a Stress Test for Texinfo / TUG 2019 – Didier Verna 8/19

slide-11
SLIDE 11

Introduction Overview Demo Challenges Conclusion

Outline

System Overview Demonstration Challenges Conclusion & Perspectives

Quickref: a Stress Test for Texinfo / TUG 2019 – Didier Verna 9/19

slide-12
SLIDE 12

Introduction Overview Demo Challenges Conclusion

Demonstration

English Conjugation Point demo break = demo breaks

Quickref: a Stress Test for Texinfo / TUG 2019 – Didier Verna 10/19

slide-13
SLIDE 13

Introduction Overview Demo Challenges Conclusion

Outline

System Overview Demonstration Challenges Conclusion & Perspectives

Quickref: a Stress Test for Texinfo / TUG 2019 – Didier Verna 11/19

slide-14
SLIDE 14

Introduction Overview Demo Challenges Conclusion

A Stress Test for Texinfo

◮ Scalability

◮ 2000 or so libraries ◮ Dependency management ◮ Foreign dependencies ◮ Library / documentation size

◮ Texinfo Figures

◮ File sizes: 7Ko – 15Mo (x2 HTML) ◮ Lines of code: 364 – 285,020 ◮ Index entries: 14 – 44,500 ◮ Processing time: 0.3s – 1, 38s

Quickref: a Stress Test for Texinfo / TUG 2019 – Didier Verna 12/19

slide-15
SLIDE 15

Introduction Overview Demo Challenges Conclusion

Metadata Format Underspecifjcation

:author "Didier Verna" :author "Didier Verna <didier@lrde.epita.fr>" :author "Didier Verna didier@lrde.epita.fr" :author "didier@lrde.epita.fr" :author "<didier@lrde.epita.fr>" :author "Didier Verna and Antoine Martin" :author "Didier Verna, Antoine Martin" :author "Didier Verna Antoine Martin" :author "D. Verna Antoine E Martin" :author "D. Verna Antoine \"Joe Cool\" Martin" :author ("Didier Verna" "Antoine Martin") Social incentive: people don’t like their work to look bad on my public website…

Quickref: a Stress Test for Texinfo / TUG 2019 – Didier Verna 13/19

slide-16
SLIDE 16

Introduction Overview Demo Challenges Conclusion

Metadata Format Underspecifjcation

:author" Original Authors: Salvi Péter, Naganuma Shigeta, Tada Masashi, Abe Yusuke, Jianshi Huang, Fujii Ryo, Abe Seika, Kuroda Hisao Author Post MSI CLML Contribution: Mike Maul <maul.mike@gmail.com>" Social incentive: people don’t like their work to look bad on my public website…

Quickref: a Stress Test for Texinfo / TUG 2019 – Didier Verna 13/19

slide-17
SLIDE 17

Introduction Overview Demo Challenges Conclusion

Metadata Format Underspecifjcation

:author "(let ((n \"Christoph-Simon Senjak\")) ~ (format nil \"~A <~C~C~C~C~A>\" ~ n (elt n 0) (elt n 10) (elt n 16) ~ #\\@ \"uxul.de\"))" ◮ Social incentive: people don’t like their work to look bad on my public website…

Quickref: a Stress Test for Texinfo / TUG 2019 – Didier Verna 13/19

slide-18
SLIDE 18

Introduction Overview Demo Challenges Conclusion

Defjnitions Grouping

Example 1: accessors

context-hyperlinksp CONTEXT [Function] (setf context-hyperlinksp) BOOL CONTEXT [Function] Access CONTEXT’s hyperlinksp fmag. Package [net.didierverna.declt], page 29, Source [doc.lisp], page 24, (fjle)

Quickref: a Stress Test for Texinfo / TUG 2019 – Didier Verna 14/19

slide-19
SLIDE 19

Introduction Overview Demo Challenges Conclusion

Defjnitions Grouping

Example 2: generic functions

document ITEM CONTEXT [Generic Function] Render ITEM’s documentation in CONTEXT. Package [net.didierverna.declt], page 29, Source [doc.lisp], page 24, (fjle) Methods document (SYSTEM system) CONTEXT Render SYSTEM’s documentation in CONTEXT. Source [asdf.lisp], page 26, (fjle) document (MODULE module) CONTEXT Render MODULE’s documentation in CONTEXT. Source [asdf.lisp], page 26, (fjle)

Quickref: a Stress Test for Texinfo / TUG 2019 – Didier Verna 14/19

slide-20
SLIDE 20

Introduction Overview Demo Challenges Conclusion

Defjnitions Grouping

◮ Only use the low level interface: @deffn, @defvr, etc.

◮ Environment nesting → unwanted indentation ◮ Heterogeneous @def... / @def...x prohibited ◮ Heterogeneous categories authorized @deffn {Function} ... @deffnx {Compiler Macro} ...

◮ Remaining Limitations

◮ Only 9 fjxed canonical categories ◮ Some distinctions arguable (e.g. typed vs. untyped) ◮ Heterogeneous mixing still prohibited @deffn {Function} foo ... @defvrx {Symbol Macro} foo ...

Quickref: a Stress Test for Texinfo / TUG 2019 – Didier Verna 14/19

slide-21
SLIDE 21

Introduction Overview Demo Challenges Conclusion

Pretty Printing

◮ Names can be anything → escaping vs. “revealing”

◮ |my stuff| vs. my␣stufg ◮ (setf foo) vs. (setf foo) ◮ |argument(s)| vs. argument(s)

◮ Symbol qualifjcation: my.long.package.name:symbol

◮ In general: avoid ◮ Sometimes leads to ambiguous output (e.g. method specializers)

◮ Docstrings: what to do? Verbatim, simple heuristic(s), markup etc. ◮ References: @ref{anchor, , label} gives varying output

HTML label PDF [label], page 12, → trailing comma (or not) Info *note label: anchor. Emacs See label. → Casing seems to vary

Quickref: a Stress Test for Texinfo / TUG 2019 – Didier Verna 15/19

slide-22
SLIDE 22

Introduction Overview Demo Challenges Conclusion

Anchoring

◮ Anchor names limitations (dots, commas, colons, parens)

◮ Use <dot> etc. (ugly; use UTF8 characters instead?) ◮ Anchor text less constrained, not well documented

◮ Avoid nodes as much as possible…

◮ Problems above ◮ Uniqueness of names ◮ No control over the display

◮ …in particular, nodes associated with Lisp symbols

Quickref: a Stress Test for Texinfo / TUG 2019 – Didier Verna 16/19

slide-23
SLIDE 23

Introduction Overview Demo Challenges Conclusion

Outline

System Overview Demonstration Challenges Conclusion & Perspectives

Quickref: a Stress Test for Texinfo / TUG 2019 – Didier Verna 17/19

slide-24
SLIDE 24

Introduction Overview Demo Challenges Conclusion

Conclusion

◮ A successful project

◮ Almost 2000 libraries nicely documented ◮ Less than 2% still cause problems ◮ The community is grateful

◮ A successful stress test for Texinfo

◮ Reliable and scalable ◮ Sometimes gets in the way, but still a good choice

Quickref: a Stress Test for Texinfo / TUG 2019 – Didier Verna 18/19

slide-25
SLIDE 25

Introduction Overview Demo Challenges Conclusion

Perspectives

◮ Casing ◮ More / difgerent indexes ◮ More links / cross-references (external notably) ◮ More / improved pretty-printing ◮ Provide PDF & Info on the website as well ◮ Emacs / Slime integration ◮ More index (web) pages ◮ …

Quickref: a Stress Test for Texinfo / TUG 2019 – Didier Verna 19/19