-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(#3343): Allow Partial XMIR Printing #3344
feat(#3343): Allow Partial XMIR Printing #3344
Conversation
@maxonfjvipon Could you review that changes, please? |
@yegor256 Could you take a look, please? |
@yegor256 friendly reminder |
1 similar comment
@yegor256 friendly reminder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@volodya-lombrozo the intent is not clear. Would be great to add some explanation to the Javadoc.
@yegor256 Could you take a look one more time, please? |
@yegor256 reminder |
@volodya-lombrozo even though the idea looks simple and straight-forward, I'm not convinced. If you use only a single |
@yegor256 I constantly face this problem when I need to print a single |
@yegor256 It's rather important changes that blocks other issues |
@yegor256 reminder |
@volodya-lombrozo why can't you use a normal printing? Because you want to minimize the size of the XMIR, getting rid of the header part? |
@yegor256 yes. When you need to print ~100 different objects and test them, the task of "wrapping" each case with boilerplate code becomes tedious. |
@yegor256 Reminder |
@volodya-lombrozo the problem is this: if we allow printing just a part of XMIR, we loose some meta information and, what is more important, loose the ability to provide such information in the future. It's similar to allowing Java compiler to compile just a method of a class, not the entire class. Even though it's technically possible (in some cases), such a partial compiler would be a very strange feature, don't you think? |
@yegor256 Of course, regarding compilers, I agree — It would definitely be a strange feature indeed. Is
I thought it is the representation of the same I consider this feature as an alternative "short view" on some parts of
As for this:
Why do we need this information in the future? The only purpose for this partial printing is testing, no more. |
@volodya-lombrozo the printing may expect the entire XMIR document to be available in order to print EO. If we allow printing of just a part of the XMIR, we introduce some other assumptions, which may not be in line with the previous one. Thus, we will have to maintain them both, not always understanding what to do if they conflict. For example, this pseudo XMIR:
It prints to (using both the info from the
You introduce just-one-object printer, which will produce (for example):
Here, you will have to replace Now, we have two EO outputs for the same input. How they correlate? Hard to say. How to maintain this correlation? Hard to say. |
@yegor256 Sorry, maybe I don't clearly understand you. If you're asking about the correlation between 'object' and 'file' printing (how to update both of these xslt transformations), then it's a separate question, but I'm sure we can solve this easily in the code. As for this: we introduce some other assumptions, which may not be in line with the previous ones <o id=1/> will give me
Why this?
Moreover, it's a problem of 'object' printing: how to retrieve some missing elements. As I've already said many times, 'object' printing is suitable only for testing, so we can't rely on it in pipelines or make any assumptions based on it. |
@volodya-lombrozo the |
@yegor256 Yes, I understood that. When we print only a single object without a header - we use only the information we have, of course. I believe it's fine in the context of testing. |
@volodya-lombrozo yes, for testing it's fine, in your own project, where you understand the context and the risks. But shipping this functionality to everybody would be a mistake, I believe. |
@volodya-lombrozo If I move this changes to my own project:
|
@volodya-lombrozo why can't you print this:
instead of:
It's a question of these "extra" four lines? |
@yegor256 Let's imagine I have 100 java objects that can create only some parts of the entire program. For example <o base=".plus">
<o base="int" data="bytes">00 00 00 00 00 00 00 01</o>
<o base="int" data="bytes">00 00 00 00 00 00 00 02</o>
</o> It doesn't know anything about the entire |
@volodya-lombrozo yes, you need to wrap them, but you don't do this manually, do you? You create unit tests, which wrap them and then print. Or I misunderstand the scenario? |
@yegor256 Reminder |
@yegor256 Friendly reminder |
Since there are many concerns about this functionality, I close this PR |
In this PR I added
Xmir.Simplified
that can print partial XMIR documents to EO.Closes: #3343.
History:
PR-Codex overview
The PR introduces a new
Simplified
class inXmir
for partial XMIR printing. It includes tests and XSLT transformations for simplified EO printing.Detailed summary
Simplified
class for partial XMIR printing inXmir
Simplified
andDefault
classes