trueagi-io / hyperon-experimental

MeTTa programming language implementation
https://metta-lang.dev
MIT License
133 stars 44 forks source link

Add pragma to turn off library interpreter written in minimal MeTTa #625

Closed vsbogd closed 5 months ago

vsbogd commented 5 months ago

Executing !(pragma! interpreter bare-minimal) turns off interpreter written in minimal MeTTa and only minimal MeTTa interpreter is used.

I used "interpreter" keyword because I would like to try implementing switchable interpreter.

luketpeterson commented 5 months ago

Right now, pragma settings are global across a whole runner. But is this something we want to change on a single-module level?

vsbogd commented 5 months ago

My understanding right now it is required more for experimenting with code. Generally it would be great to have ability switching interpreter on the module level.

luketpeterson commented 5 months ago

If you want to merge this to make progress elsewhere or unblock other work, that's fine.

At some future point, I think we should decide how settings can work generally. i.e. should we try an unify the settings-like mechanisms like PkgInfo (module-level), Environment (runner-level), pragmas (runner-level), REPL settings (A space created by repl app) etc.

Fundamentally some settings have different scopes and different mutability (and different mutability at different scopes!). But maybe we can define a mechanism to capture that.

I'm not saying we need to unify all the settings or that it's even desirable to do that. More just that it deserves to be talked about.

The current state of things is: Environment: Shared across runner, immutable after runner is created pragmas: Shared across runner, can be configured by any running MeTTa code at any time. PkgInfo: Configured at module load time, immutable after module is loaded. May not exist at all with pkgmgmt off. Usually reflects constant info from module author like version, etc.