Skip to content

option to unbundle docstrings and potential consequences #1411

@llmII

Description

@llmII

I saw in 5de889419ff26b710b706958bf99e180d084f564 that docstrings take up RAM. This thought never crossed my mind until I saw that.

Further thought revealed there is a huge dependence on the website for more extensive documentation.

The more I gave this thought, along with @sogaiu, an idea came to mind.

What if in a production build (with jpm) docstrings were stripped out of the build completely. What if doc strings were stored in a separate file somewhere and doc knew how to look up and retrieve from it. What if the documentation system new mendoza related things and pretend mendoza had tags. A doc string could reference a tag and doc could be extended to understand tags, and one could then use doc to bring in the info from another set of files (say, the entire website but stored as mendoza documents).

The idea sums up with having a way to store documentation associated with the build of Janet (both the site, and doc strings) separately from within the Janet executable, saving RAM, and leading to being able to access extensive documentation offline.

The key thing to note is that this is an idea. It may or may not be worth pursuing. I think the RAM benefits might be good, and the offline documentation benefits phenomenal. I also think it's a lot of work which means someone (be it myself or another) would have to give it a considerable amount of thought and bring it to fruition.

Finally, I realized, man pages and info pages are entirely unsuitable because Janet is cross platform and must work under windows too, and those are more unix centric documentation bundles.

If this idea has enough merit, perhaps this should be a discussion as to how such a thing might should work.

NOTE:
I believe the first thing would be to try unbundling doc strings from libraries (like spork or similar) before trying to figure out how to (in the janet executable itself) remove docstrings from the vm but have them in a file that the doc function can access. Next would possibly be a mendoza reader for the site (and if there aren't tag capabilities, figure out a different manner to go about it, or add such). Then somehow include the site, in mendoza, in a build of Janet (with correct build options) so one can have those offline and searchable by doc or referenced by doc strings somehow. After that would be getting this to work with the janet executable and for the docstrings that are generally part of the janet vm to live in another file when compiled (but remain inside the source files).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions