Carp icon indicating copy to clipboard operation
Carp copied to clipboard

Make Core more modular

Open scolsen opened this issue 3 years ago • 1 comments

--no-core is great if you don't want to pull in anything from the standard library, however, because of interdependencies between files in core, you cannot pick and choose which modules to use easily.

For example, copy is defined in the module/file for the corresponding type, but str for all types is defined in String. In order to load core String routines, then, one needs to load every module that has str defined in String.carp. Likewise, Array defines for, which is needed by StaticArray and Control and Array in turn requires Maybe.

We should try to make the dependencies graph a bit simpler so that it's at least a little bit easier to use the core modules modularly.

scolsen avatar Feb 23 '22 21:02 scolsen

Yeah, I agree it's often hard to import things selectively in a good way. Moving str to each individual module could potentially help a lot, but maybe it leads to other problems?

eriksvedang avatar Feb 25 '22 13:02 eriksvedang