From baf0b01d29b371f834e520f0908e5408b5d0c13f Mon Sep 17 00:00:00 2001 From: Lonami Date: Sun, 10 Sep 2017 15:42:27 +0200 Subject: [PATCH] Created Understanding the Type Language (markdown) --- Understanding-the-Type-Language.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Understanding-the-Type-Language.md diff --git a/Understanding-the-Type-Language.md b/Understanding-the-Type-Language.md new file mode 100644 index 0000000..66a6102 --- /dev/null +++ b/Understanding-the-Type-Language.md @@ -0,0 +1,17 @@ +[Telegram's Type Language](https://core.telegram.org/mtproto/TL) (also known as TL, found on `.tl` files) is a concise way to define what other programming languages commonly call classes or structs. + +Every definition is written as follows for a Telegram object is defined as follows: + +```tl +name#id argument_name:argument_type = CommonType +``` + +This means that in a single line you know what the `TLObject` name is. You know it's unique ID, and you +know what arguments it has. It really isn't that hard to write a generator for generating code to any platform! + +The generated code should also be able to *encode* the `TLObject` (let this be a request or a type) into bytes, so they can be sent over the network. This isn't a big deal either, because you know how the `TLObject`'s are made, and how the types should be serialized. + +You can either write your own code generator, or use the one this library provides, but please be kind and keep some special mention to this project for helping you out. + +This is only a introduction. The `TL` language is not *that* easy. But it's not that hard either. +You're free to sniff the `telethon_generator/` files and learn how to parse other more complex lines, such as `flags` (to indicate things that may or may not be written at all) and `vector`'s. \ No newline at end of file