How "mandatory" is PolyglotEngine?

Peter Niederwieser peter at pniederw.com
Mon Apr 25 18:58:02 UTC 2016


It’s not clear to me what the supported options are for interacting with my own Truffle language from the host language (Java):

1. Is it OK to interact directly with `MyTruffleLanguage` (which extends `TruffleLanguage`), or do I always have to go through `PolyglotEngine`? (The latter seems more complicated, less flexible, and seems to do a lot of wrapping.)

2. Say I get back an instance of `MyTruffleObject` (which implements `TruffleObject`) from `PolyglotEngine`. Is it OK to get a `CallTarget` from that instance (assuming it offers an API for that), and call that directly? Or do I always have to go through a `TruffleObject` message send instead?

If `PolyglotEngine` is not mandatory, are there nevertheless good reasons to use it when all I want is to interact with my own language?

Thanks,
Peter


More information about the graal-dev mailing list