Skip to content

Proposal: Debug and experiment flags #1720

@gbrail

Description

@gbrail

We're a bit stuck on Reflect and Proxy support because it isn't feature-complete, and we want to have some sort of "experiment" capability so that we can enable it while we complete the implementation, rather than relying on a huge feature branch. However, our current configuration mechanism, which is the feature flags on the Context class, is a bit cumbersome, especially for enabling something that might be temporary in nature, like an experimental feature that will eventually "graduate."

As a secondary problem, we have a bunch of hard-coded static boolean "debug" flags in the product, which are currently only enabled by changing the code. Rhino doesn't need a complicated "debug framework" like an enterprise Java app, but it'd be nice to be able to enable and disable this debugging more easily.

So, I'm proposing that we add a few system properties to Rhino, and also an environment variable:

VariableTypeMeaning
rhino.experimentsSystem propertyEnables experimental features. Value is a comma-separated list of feature names.
rhino.debugSystem propertyEnables debugging. Value is a comma-separated list of things to debug.
RHINO_DEBUGEnvironment variableSame as "rhino.debug". Values will be combined and the "or" of both values will be used to enable debugging.

All of these properties will work by scanning the comma-separated list of either experiments to enable, or debug flags to enable, and if the value is in the list, it'll enable that experiment or debug flags. Unknown entries in the list will be ignored.

The idea here, at least for experiments, is that when an experiment runs its course and can be "graduated," we will just retire the flag.

So, for example, setting:

rhino.experiments=proxy,foobar

Enables the experiments named "proxy" and "foobar". If there is no feature named "foobar," then that part is just ignored, and the "proxy" feature is enabled.

Finally, I think that we should also support setting debug flags via environment variable, because depending on how we're running Rhino, it may be easier to set an environment variable than a system property.

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