#In the compiler core, what is ModuleInterface?

1 messages · Page 1 of 1 (latest)

daring knoll
mental obsidian
#

module probably contains everything, module interface probably only contains the stuff thats public

daring knoll
#

For now, the only way I find to convert from one to the other would be to re-analyse the cached modules

#

Which I think is wrong

desert spindle
#

That todo comment might be burying the lead on what the underlying issue here is. The ModuleInterface is essentially everything that is cached on compilation while the Module is the raw ast + the ModuleInterface. So the Module is the raw output of a fresh compile whereas a cache load will only have enough to create a ModuleInterface. The issue that hayleigh was asking about should theoretically be solved by changing how the package interface is created to use ModuleInterface information only instead of raw Module information plus whatever wiring you need to make sure you have all the ModuleInterfaces at the right time/spot

daring knoll
#

Also, why are there so many different types with the same names despair

winged ember
#

Real

#

Good luck with this, I tried at one point but didn't get very far

daring knoll
#

Maybe I need to add some info to the cache

#

hope it doesn't make it too bad

winged ember
#

The main problem I ran into is type aliases

daring knoll
#

Tbf I have basically no idea what I'm doing lol

winged ember
#

Since those aren't really recorded anywhere in the ModuleInterface

daring knoll
#

Which of the ModuleInterfaces? 🙂

#

I thought I had it done, then I saw they were from different modules

winged ember
#

Oh right

#

The one that gets cached

#

Not the one that's part of PackageInterface

daring knoll
#

The type_ one I think then

winged ember
#

yeah

#

Basically you need to convert type_::ModuleInterface to package_interface::ModuleInterface, instead of type_::Module to package_interface::ModuleInterface

#

Or that's how I would do it anyway

#

But yeah, type aliases are annoying since the compiler mostly forgets about those after analysis

daring knoll
#

I'm 99% it's done

#

Just hope I didn't quadruple the cache size

winged ember
mental obsidian
#

yeah i noticed

daring knoll
#

Also, I think everyone will need to do a gleam clean if this is pushed

#

🙂

winged ember
#

I believe it automatically cleans outdated cache now

daring knoll
#

Well, I tried running it without cleaning the cache and it gave an error lol

#

Also, I need to remove a println!, it's spamming my console

#

It doesn't work despair

#

    Bincode does not support the serde::Deserializer::deserialize_any method```
#

So close

#

I wonder which type requires the deserialize_any

#

Found it, it's TypeInterface, as it's a enum