nbuilding/N-lang

Python built-in module

Closed this issue · 1 comments

Also see #214 and https://discord.com/channels/710932856251351111/710936824121655396/878023177572347936

Add a built-in module monty_python_snake_wow or some other name to be decided later that allows N programs to interface with the Python runtime.

Its behaviour is implementation defined.

Maybe it only needs to export a single type (monty_python_snake_wow.value) and a single function:

import monty_python_snake_wow

assert type monty_python_snake_wow.eval : str -> cmd[result[monty_python_snake_wow.value, monty_python_snake_wow.value]]

eval can (but doesn't have to) evaluate the given string in Python and return either an ok with the resulting value or an err with the Exception if an error was raised.

I'll name the module python