3 ms·
The autoloader feature sounds interesting. I've always wondered why there is so much ceremony around importing modules when it seems like the compiler could fi
by chubot 6y ago
The autoloader feature sounds interesting. I've always wondered why there is so much ceremony around importing modules when it seems like the compiler could figure it out in many cases (e.g. when you follow the Go-like style of having module names at the call site).
For example every Java file seems to start with entire screenfuls of imports.
I've never seen that in any other language. Though I'm sure there are a lot of pitfalls, because module systems tend to grow complex over time.
- hikhvar 6y agoI don't see the appeal in omitting that ceremony. Modern IDEs do it for you. On the other hand, a reader of the code must not replicate the work the autoloader does. If there is a class named Database from the backend module. The concrete class referenced there is highly dependent on the environment, the autoloader has at runtime. For me, this seems to be a source of many non reproducable bugs.