There is a use case where I can load even a cutom object provided by the user
You can provide an interface to user and enforce user to implement it. The most convinient way. Another strategy is to accept source code, check its structure, then run scalac/sbt and link