goby-lang / goby

Goby - Yet another programming language written in Go
MIT License
3.49k stars 171 forks source link

When an expected standard library file is not found, the interpreter panics. #644

Closed 64kramsystem closed 6 years ago

64kramsystem commented 6 years ago

When an expected standard library file is not found, eg. lib/range_enumerator.gb the interpreter panics.

Although this is an abnormal setup case, I think there should be a cleaner/user friendlier way of handling the requires, which would raise the standard InternalError.

Test case:

rm lib/range_enumerator.gb
./goby -i
64kramsystem commented 6 years ago

@st0012 shouldn't there be a return after https://github.com/goby-lang/goby/blob/29e1190ef4270529a43f16e34a1d275caeb080ad/vm/thread.go#L82? It doesn't fix the error, but I think execution should halt if the file can't be read.

st0012 commented 6 years ago

yes there should be a return, I must missed it

64kramsystem commented 6 years ago

Closed by #645.