-
Notifications
You must be signed in to change notification settings - Fork 114
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
updated to layer 143 #121
updated to layer 143 #121
Conversation
tdesktop's |
Yeah, should probably update that to 143. And while we are at it... |
If you mean things like: int ? = Int;
long ? = Long;
double ? = Double;
string ? = String;
vector {t:Type} # [ t ] = Vector t;
int128 4*[ int ] = Int128;
int256 8*[ int ] = Int256; They're "core" definitions which grammers must understand anyway, so I did not consider it necessary to complicate the parser for something that wouldn't be used. We can definitely improve the parse to accept those though, but the code generator will still ignore them. Feel free to do so in a separate PR. (I think Telegram Desktop also straight up ignores these.)
I think I tried to do that but it didn't work. When I looked at the problem I'm pretty sure the solution / standard way was to use the out environment if generating code from a The "jump to definition" problem is definitely annoying, but if we used macros instead of code generation we still wouldn't have the definition,, so we have to stick with code generation and I don't know if that can put files in |
Not only those (and it should be safe to ignore those core types). Most errors come from the fact that TG authors (for some reason) use
Just replacing |
As far as I remember, both Because in Rust String must be valid UTF-8, and those "core" types will deal with non-UTF-8, we must either special-case them in the generator to force bytes or edit the TL. (For non-crucial types where
Alright, although then we might face Files generated by build script into src/ are compiled twice (it's an old issue, I have not checked if this is still the case), and both the suggestion:
...and the Cargo Book (emphasis mine):
...seem to hint that we should not do that. Personally I agree that it's a bit dirty for a build script to write to the filesystem other than the controlled |
Yeah, best solution here it to replace some
It is indeed somewhat dirty but I'll take that for a working RA. No problem though, I'll keep that change to my fork only. Anyways, I've updated .tl to layer 143 (required some minor i32 -> i64 massaging but it works ok for me). |
/////////////////////////////// | ||
///////// Main application API | ||
/////////////////////////////// | ||
// LAYER 143 |
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.
Where's this TL from, tdesktop?
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.
Where's this TL from, tdesktop?
https://github.com/tdlib/td
tdesktop should be using that lib too
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.
What are drawbacks of putting generated.rs
into src and committing to git? And manually re-generating it when schema is updated. This way RA will work fine and no double-compilation happens.
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.
Where's this TL from, tdesktop?
https://github.com/tdlib/td tdesktop should be using that lib too
I mean, I think I've always grabbed it from tdesktop (main reason being so the order of the definitions doesn't change much, making the diffs harder). The layer comment at the top made me ask this since tdesktop has it at the bottom.
What are drawbacks of putting
generated.rs
into src and committing to git? And manually re-generating it when schema is updated. This way RA will work fine and no double-compilation happens.
I don't feel all that comfortable writing outside of the designated OUT_DIR
. Committing to git would also be a large unnecessary bloat. In any case this topic needs a separate issue or PR to talk about.
Thanks. |
Basic support for 139 that updates TL and what is necessary to get code compiled. At least client can now log in :)