JacquelineCasey / Nom

0 stars 0 forks source link

Begin a standard library #13

Open JacquelineCasey opened 1 year ago

JacquelineCasey commented 1 year ago

Although we don't yet have strings (strings are surprisingly complex) we would like to be able to print some things. Perhaps our first standard library functions can be utilities to print common data types for tests (we no longer need to rely on debug printing the error code for tests).

Begin work on a standard library. This will entail adding some way for a nom file to import the standard library or certain functions from the standard library, and may require some name resolution feature.

Standard library functions should only be compiled if they are used. However, I think all functions written by the user should be compiled.

Adding printing in particular may require extending the runtime and referencing some builtin operation somehow. Perhaps some standard library functions can be implemented directly in the bytecode?

JacquelineCasey commented 1 year ago

Note - eventually, we will want a prelude, and we would likely put stuff like print() there too. However, for now I think all imports should be explicit. We can move stuff to a prelude later if necessary.