kleinesfilmroellchen / sof-language

The Stack with Objects and Functions Programming Language, a pure stack-based reverse-polish-notation functional and object-oriented experimental programming language.
https://kleinesfilmroellchen.github.io/sof-language/
GNU General Public License v3.0
11 stars 0 forks source link

Module system only works on files -> breaks standard library in other directories #6

Closed kleinesfilmroellchen closed 3 years ago

kleinesfilmroellchen commented 3 years ago

The standard library may be bound in a JAR. Because the module system only uses files to search for SOF source code, see ModuleDiscoverer, this means that the standard library must always exist outside of the JAR.

In addition, the standard library is searched for relatively with the standard path, see ModuleDiscoverer.java line 19. This means that SOF must be run in the parent directory out of the class source, or else no standard library files are found.

The solution is to use the getResource API for standard library files and normal file API for relative files.