Skip to content

Use GNU Info to parse singular's Info file #32242

@orlitzky

Description

@orlitzky

Our Singular interface currently contains a hand-written parser for Singular's "info" file. In this ticket, we add an optional GNU Info package to parse this file instead.

Relative to running "info", the hand-written parser has several drawbacks:

  • The extra code is a maintenance burden. We should not be wasting
    our time (poorly) reimplementing standard tools.

  • The custom parser is buggy. For example, it is supposed to raise a
    KeyError when documentation for a non-existent function is
    requested. However, the parser does not keep track of what section
    it's in, so, for example, get_docstring("Preface") will happily
    return the contents of the preface even though "Preface" is not a
    Singular function.

  • The first time documentation is requested, the entire info file
    (see above) is loaded into a dictionary. With the Singular info
    file currently weighing in at around 11MiB, this is wasting a
    good chunk of memory.

  • The singular_console() itself tries to launch GNU Info to display
    its interactive help, and cannot use our hand-written parser.

The one downside to requiring "info" is that it would add a new runtime dependency to sagelib. To avoid that, we make GNU Info optional, and suggest to the user that he install it when he tries to read Singular's documentation.

GNU Info (or its superset, Texinfo) are widespread, portable, and easy to install on all of the systems we support, so in most cases this should be a "free" improvement.

Depends on #32302

Component: packages: standard

Author: Michael Orlitzky

Branch/Commit: u/mjo/ticket/32242 @ 137a918

Issue created by migration from https://trac.sagemath.org/ticket/32242

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions