Missing dependencies

So, guys, i have the following errors. They are i'm sure from missing import of/dependency on/usage of j.m.baseLanguage. Could you please say to me what to do for it to work, assuming that i'm trying to recreate Part I of Constants language tutorial. And i also get the warning on hovering generator that Constants_Demo2 should extend j.m.baseLanguage. (And that is not what i want — right?)
image1
14 comments
Comment actions Permalink
Seems i managed to do that. I needed to add baseLanguage to used ones, right? And also list as a default-type dependency (not extended language).
0
Comment actions Permalink
But after each rebuild of a project, warning stays for some time then disappears.
0
Comment actions Permalink
No, it does not disappear.
0
Comment actions Permalink
Why should it extend j.m.baseLanguage?
0
Comment actions Permalink
Ok. Have i got it? I think it should extend Java, because everything written in that language is now valid Java class.
0
Comment actions Permalink
Check if "JDK" is listed in the dependencies (Constants_Demo2.sandbox -> Module Properties -> Dependencies Tab). If not, add it and it should compile.
0
Comment actions Permalink
No, i'm confused. Please explain the topic to me.
0
Comment actions Permalink
Yeah, thanks! It compiles now :) And what about the warning?
0
Comment actions Permalink
Hey, anybody! What does this warning mean? Is it right? Should my language really extend baseLanguage?
0
Comment actions Permalink
"Extend" dependency between languages in MPS mean one of the following:
1. "extend" relation between languages concepts (for example, if a language has a concept that extends Expression from baseLanguage, then this language should extend baseLanguage).
2. "generates" relation between languages (for example, language has a concepts which is generated into an Expression from baseLanguage).
I know that these cases should be separated, but this is how it is in MPS now. So, answering to your question, you should extend baseLanguage.
0
Comment actions Permalink
Hi, Julia! In the light of just said i would like to know what is the rationalization of the second meaning? (BTW the phrase i used "in the light of just said" — will it be ununderstandable/incomprehensible by our non-Russian-speaking talkers?)
0
Comment actions Permalink
Adding JDK into sandbox as a dependency is not required here. The language generates baseLanguage, therefore it should extend it, therefore JDK will be in compilation dependencies of sanbox since it is a baseLanguage runtime.
0
Comment actions Permalink
Actually, the current MPS dependency system is not precise enough to describe real module dependencies. We plan to reinvent this subsystem in further versions.

As for current state, there's a number of questions a correct dependencies system should give answer for. E.g. "which generators should I use to generate a model that uses languages A, B and C?", "which code is visible from here?" etc. So, our solution about which type of dependency should be added in the current system was based on which dependency type will give correct answers for most of these questions in most cases.

In your example, the error shown can be somehow explained like "if you generate into some language, your language extends the possibilities given to you by a language you generate into. That's why you should extend it". To be honest, this is not true because the meaning of "extended language" is not defined actually. This is what we plan to fix.

Plus, though it's not obvious why an extended language should be added, but it's very simple to check and ask the user to do a thing which will fix his problem. We know that asking the user to do something he doesn't understand fully is not a correct way for IDE to behave, but still we can't fix everything immediately. Regretfully.
0
Comment actions Permalink
Thanks, Mihail!
0

Please sign in to leave a comment.