Strumenta / kolasu

Kotlin Language Support – AST Library
Apache License 2.0
110 stars 12 forks source link

Decide if and how to support multiple packages in Kolasu 1.6 and successive #366

Open ftomassetti opened 1 month ago

ftomassetti commented 1 month ago

We should also consider exporting to LionWeb

alessiostalla commented 1 month ago

I'm a fan of using multiple packages for larger languages or languages that embed other languages (such as SAS + SQL + SAS macro language). However maybe those different packages could be translated into multiple single-package languages in Lionweb, and even in Kolasu we could have each Language correspond to a single package.

ftomassetti commented 1 month ago

I'm a fan of using multiple packages for larger languages or languages that embed other languages

Then we will find a way to support them

However maybe those different packages could be translated into multiple single-package languages in Lionweb, and even in Kolasu we could have each Language correspond to a single package.

Yes, I think this is one option. Probably it would be the most straightforward, however I think for that to work we should ensure we do not have circular dependencies among the packages.

If circular dependencies are needed and we cannot support with the approach you suggest, as an alternative approach we could translate them as a single language in LionWeb but add annotations indicating to which package they belong. Then we could use that information when generating code.