As many of you might know, I have a weird obsession with writing scripting languages entirely in Xojo (see ObjoScript and Roo).
I have a technical question about language implementation that I’m hoping someone on this forum is smart enough to help me out with.
How does a language like Xojo handle compiling classes in the correct order? For example, in my scripting language say I have these two classes:
class Person {
occuptaion As Job
}
class Job {}
This will work if Job
is defined before Person
but not the other way around. How does a language like Xojo handle this because presumably when it assembles your project it needs to figure out the same problem. In some of my Xojo projects I have hundreds of classes in the navigator and yet Xojo’s autocomplete and compiler assemble things correctly. Do you think the IDE does some clever semantic analysis before assembling the classes in the correct order?
I’d like to add static typing to my scripting language but unless I can figure out an approach to this I will struggle to get it working.
2 posts - 2 participants