{"id":375697,"date":"2024-05-21T06:31:02","date_gmt":"2024-05-21T06:31:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=375697"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-21T06:31:02","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=375697","title":{"rendered":"<span>\u041a\u0430\u043a \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 K2 \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e Kotlin \u043d\u0430 94%<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/6c3\/8d3\/325\/6c38d332550568fd7efb5f3edef32e81.jpeg\" width=\"1280\" height=\"719\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6c3\/8d3\/325\/6c38d332550568fd7efb5f3edef32e81.jpeg\" data-blurred=\"true\"\/><\/figure>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u043c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u041c\u044f\u043b\u043a\u0438\u043d \u041c\u0430\u043a\u0441\u0438\u043c, \u044f \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0432 <a href=\"https:\/\/kts.tech\/\"><u>KTS.<\/u><\/a><\/p>\n<p>\u041d\u0435 \u0437\u0430 \u0433\u043e\u0440\u0430\u043c\u0438 \u0432\u044b\u043f\u0443\u0441\u043a \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Kotlin 2.0, \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u043d\u0430 K2.\u00a0<\/p>\n<p><a href=\"https:\/\/blog.jetbrains.com\/kotlin\/2024\/04\/k2-compiler-performance-benchmarks-and-how-to-measure-them-on-your-projects\/\"><u>\u041f\u043e \u0437\u0430\u043c\u0435\u0440\u0430\u043c JB<\/u><\/a>, K2 \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e \u043d\u0430 94%. \u0422\u0430\u043a\u0436\u0435 \u043e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043d\u043e\u0432\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0445 \u0444\u0438\u0447 \u0438 \u0443\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0434\u043b\u044f \u043c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432.<\/p>\n<p>\u041d\u043e \u043c\u0430\u043b\u043e \u043a\u0442\u043e \u043f\u043e\u0433\u0440\u0443\u0436\u0430\u043b\u0441\u044f \u0432 \u0442\u043e, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 K2, \u0438 \u0447\u0435\u043c \u043e\u043d \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 K1.\u00a0<\/p>\n<p>\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u043e\u043b\u0435\u0435 \u043e\u0441\u0432\u0435\u0449\u0430\u0435\u0442 \u043d\u044e\u0430\u043d\u0441\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u0447\u0442\u043e \u0436\u0435 JB \u0443\u043b\u0443\u0447\u0448\u0430\u044e\u0442 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c, \u0438 \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p>\u041a\u043e\u043d\u0442\u0435\u043d\u0442 \u0441\u0442\u0430\u0442\u044c\u0438 \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 <a href=\"https:\/\/www.youtube.com\/watch?v=wUGfuWHCqrc\"><u>\u0432\u044b\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438<\/u><\/a> \u0438 <a href=\"https:\/\/www.youtube.com\/watch?v=iTdJJq_LyoY\"><u>\u043e\u0432\u0435\u0440\u0432\u044c\u044e<\/u><\/a>, \u043d\u043e \u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438.<\/p>\n<h2>\u041e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u0435  <\/h2>\n<ul>\n<li>\n<p><a href=\"#1\">\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#2\">Frontend  <\/a><\/p>\n<ul>\n<li>\n<p><a href=\"#3\">\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f K1  <\/a><\/p>\n<ul>\n<li>\n<p><a href=\"#4\">\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 K1  <\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#5\">Parsing Phase  <\/a><\/p>\n<ul>\n<li>\n<p><a href=\"#6\">\u0417\u0430\u0434\u0430\u0447\u0430 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430  <\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#7\">\u00a0\u042d\u0442\u0430\u043f\u044b Parsing phase  <\/a><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><a href=\"#8\">Resolution Phase  <\/a><\/p>\n<ul>\n<li>\n<p><a href=\"#9\">\u0417\u0430\u0434\u0430\u0447\u0430 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430<\/a>  <\/p>\n<\/li>\n<li>\n<p><a href=\"#10\">\u042d\u0442\u0430\u043f\u044b Resolution Phase  <\/a><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><a href=\"#11\">\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b K1 <\/a> <\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><a href=\"#12\">\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f K2  <\/a><\/p>\n<ul>\n<li>\n<p><a href=\"#13\">\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 K2  <\/a><\/p>\n<ul>\n<li>\n<p><a href=\"#14\">Parsing  <\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#15\">Psi2Fir  <\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#16\">Resolution  <\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#17\">Checking  <\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#18\">Fir2Ir  <\/a><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><a href=\"#19\">\u0412\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 K1 \u0438 K2   <\/a><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><a href=\"#20\">Backend  <\/a><\/p>\n<ul>\n<li>\n<p><a href=\"#22\">\u0426\u0435\u043b\u0438 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f Backend  <\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#23\">\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 Backend  <\/a><\/p>\n<ul>\n<li>\n<p><a href=\"#24\">IR <\/a> <\/p>\n<\/li>\n<li>\n<p><a href=\"#24\">IR lowering  <\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#26\">Target code <\/a> <\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><a href=\"#27\">\u0412\u044b\u0432\u043e\u0434\u044b<\/a>  <\/p>\n<\/li>\n<li>\n<p><a href=\"#27\">\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b  <\/a><\/p>\n<\/li>\n<\/ul>\n<p><a class=\"anchor\" name=\"1\" id=\"1\"><\/a><\/p>\n<h2>\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440<\/h2>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u0445 \u0432 \u0446\u0435\u043b\u043e\u043c. \u041f\u043e \u0441\u0443\u0442\u0438, <strong>\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 <\/strong>\u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430. \u041e\u043d\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u043e\u0434 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0435\u0433\u043e \u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u044c.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0439, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0445 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439. \u0415\u0441\u043b\u0438 \u043e\u0447\u0435\u043d\u044c \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c, \u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0434\u0435\u043b\u0430\u0435\u0442 \u0434\u0432\u0435 \u0432\u0435\u0449\u0438:<\/p>\n<ul>\n<li>\n<p>\u043c\u0435\u043d\u044f\u0435\u0442 \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u0430\u043d\u043d\u044b\u0445 (compiling)<\/p>\n<\/li>\n<li>\n<p>\u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0435\u0433\u043e (lowering)<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/270\/87c\/d74\/27087cd740cefa8036228a3fabb6ca55.png\" width=\"2020\" height=\"1218\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/270\/87c\/d74\/27087cd740cefa8036228a3fabb6ca55.png\"\/><\/figure>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 Kotlin \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e. \u0412 \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0432\u044b\u0445\u043e\u0434\u044f\u0442 \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 <strong>\u043f\u043b\u0430\u0433\u0438\u043d\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430<\/strong>.<\/p>\n<p>\u041f\u043b\u0430\u0433\u0438\u043d\u044b \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0440\u0430\u0431\u043e\u0442\u0443 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 Kotlin \u043d\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0444\u0430\u0437\u0430\u0445 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438 \u043c\u0435\u043d\u044f\u044e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c.\u00a0<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/202\/f74\/7c5\/202f747c54865c34df0132635279f51c.png\" width=\"602\" height=\"319\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/202\/f74\/7c5\/202f747c54865c34df0132635279f51c.png\"\/><\/figure>\n<blockquote>\n<p>\u041f\u043b\u0430\u0433\u0438\u043d\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0442\u0430\u043a\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043a\u0430\u043a Jetpack Compose, Kotlinx serialization.<\/p>\n<\/blockquote>\n<p>Kotlin \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 2 \u0447\u0430\u0441\u0442\u0435\u0439:<\/p>\n<ul>\n<li>\n<p>Frontend<\/p>\n<ul>\n<li>\n<p>\u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 <strong>\u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 (\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043a\u043e\u0434\u0430)<\/strong> \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 <strong>\u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 (\u0441\u043c\u044b\u0441\u043b \u043a\u043e\u0434\u0430)<\/strong><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>Backend<\/p>\n<ul>\n<li>\n<p>\u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0446\u0435\u043b\u0435\u0432\u043e\u0439 (target) \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b: JVM, JS, Native, WASM (\u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0439)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/56e\/8b2\/853\/56e8b28531b3b0326d360f788f139ccb.png\" width=\"1972\" height=\"1082\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/56e\/8b2\/853\/56e8b28531b3b0326d360f788f139ccb.png\"\/><\/figure>\n<p>\u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u0447\u0430\u0441\u0442\u0435\u0439.<\/p>\n<p><a class=\"anchor\" name=\"2\" id=\"2\"><\/a><\/p>\n<h2>Frontend  <\/h2>\n<p>\u0423 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 Kotlin \u0435\u0441\u0442\u044c \u0434\u0432\u0435 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434-\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:\u00a0<\/p>\n<ul>\n<li>\n<p>K1 (FE10-)\u00a0<\/p>\n<\/li>\n<li>\n<p>K2 (Fir-)<\/p>\n<\/li>\n<\/ul>\n<p>\u0423\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u043e \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0431\u043e\u0442\u044b \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<ul>\n<li>\n<p>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434\u00a0<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u043a\u043e\u0434\u0430<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0431\u044d\u043a\u0435\u043d\u0434 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 IR (Intermediate representation)\u00a0\u0438 \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b (target)<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1f5\/6c4\/f1e\/1f56c4f1e203bf04bb04fb29d8663a18.png\" width=\"1600\" height=\"842\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1f5\/6c4\/f1e\/1f56c4f1e203bf04bb04fb29d8663a18.png\"\/><\/figure>\n<p>\u041e\u0431\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u0445\u043e\u0436\u0438, \u043d\u043e K2 \u0432\u0432\u043e\u0434\u0438\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c, \u043a\u0430\u043a \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 \u0431\u044d\u043a\u0435\u043d\u0434.\u00a0<\/p>\n<p><a class=\"anchor\" name=\"3\" id=\"3\"><\/a><\/p>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f K1<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2af\/bfd\/412\/2afbfd412cd2a88b69f5b706e1c82cd8.png\" width=\"2052\" height=\"592\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2af\/bfd\/412\/2afbfd412cd2a88b69f5b706e1c82cd8.png\"\/><\/figure>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f K1 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 c:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/plugins.jetbrains.com\/docs\/intellij\/psi.html\"><strong><u>PSI<\/u><\/strong><\/a><strong> <\/strong>(Programming Structure Interface)<\/p>\n<ul>\n<li>\n<p>PSI \u2014 \u044d\u0442\u043e \u0441\u043b\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b IntelliJ, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u043e\u043c \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0438 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043a\u043e\u0434\u0430 (\u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0438 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0437\u0436\u0435)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/JetBrains\/kotlin\/tree\/c5e70c7d3f1d3e75e9bd4be74bd1c9e488852471\/core\/descriptors\/src\/org\/jetbrains\/kotlin\/descriptors\"><strong><u>\u0414\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u0430\u043c\u0438<\/u><\/strong><\/a><\/p>\n<ul>\n<li>\n<p>\u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u044b \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043d\u0435\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u043a\u043b\u0430\u0441\u0441\u0430: \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u043a\u043b\u0430\u0441\u0441\u0430, overrides, companion object \u0438 \u0442\u0434.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/JetBrains\/kotlin\/blob\/master\/compiler\/frontend\/src\/org\/jetbrains\/kotlin\/resolve\/BindingContext.java\"><strong><u>BindingContext<\/u><\/strong><\/a><strong> <\/strong>\u2014 \u044d\u0442\u043e Map, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0435\u0442 PSI.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 K1 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 <strong>PSI<\/strong> \u0438 <strong>BindingContext<\/strong> \u043d\u0430 Backend, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430 \u0432\u0445\u043e\u0434\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 PSI \u0432 IR (Psi2Ir) \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b.\u00a0<\/p>\n<p><a class=\"anchor\" name=\"4\" id=\"4\"><\/a><\/p>\n<h4>\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 K1<\/h4>\n<p>\u041e\u0431\u0449\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/572\/7f9\/705\/5727f97056517eff98516ca70f34d2bb.png\" width=\"1325\" height=\"811\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/572\/7f9\/705\/5727f97056517eff98516ca70f34d2bb.png\"\/><\/figure>\n<p>\u0415\u0441\u0442\u044c 2 \u0444\u0430\u0437\u044b:\u00a0<\/p>\n<ul>\n<li>\n<p><strong>Parsing Phase<\/strong> \u2014 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442 \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a. \u041d\u0430 \u044d\u0442\u043e\u0439 \u0444\u0430\u0437\u0435 \u0435\u0449\u0435 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0431\u0443\u0434\u0435\u0442 \u043b\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434. \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043a\u043e\u0434 \u043d\u0430\u043f\u0438\u0441\u0430\u043d <strong>\u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438<\/strong> \u0432\u0435\u0440\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p><strong>Resolution Phase<\/strong> \u2014 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u0430\u043d\u0430\u043b\u0438\u0437, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u0431\u0443\u0434\u0435\u0442 \u043b\u0438 \u043a\u043e\u0434 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u043e\u043d <strong>\u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0438<\/strong> \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c (<a href=\"https:\/\/docs.google.com\/document\/d\/17dBSxlXRW7PRD92QZGcGeotnsPSOsp0NSdnFXXZ41sg\/edit\"><u>\u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u0431\u043e\u0440 Resolution Phase<\/u><\/a>).<\/p>\n<\/li>\n<\/ul>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u0434\u0430\u043b\u044c\u0448\u0435 \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u043c\u0435\u0436\u0434\u0443 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c \u0438 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u043e\u0439.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 K1, \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434\u00a0<\/p>\n<pre><code class=\"kotlin\">fun two() = 2 <\/code><\/pre>\n<p>\u041f\u043e\u043a\u0430 \u0447\u0442\u043e \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a\u0430 \u0442\u0435\u043a\u0441\u0442\u0430.  <\/p>\n<p><a class=\"anchor\" name=\"5\" id=\"5\"><\/a><\/p>\n<h4>Parsing Phase<\/h4>\n<p><a class=\"anchor\" name=\"6\" id=\"6\"><\/a><\/p>\n<h3>\u0417\u0430\u0434\u0430\u0447\u0430 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430<\/h3>\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u2014 <\/strong>\u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c <strong>\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443<\/strong> \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043e\u043d\u0430 \u0432\u0435\u0440\u043d\u0430\u044f \u0438 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 <a href=\"https:\/\/kotlinlang.org\/docs\/reference\/grammar.html\"><strong><u>\u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c<\/u><\/strong><\/a><strong> \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c<\/strong> \u044f\u0437\u044b\u043a\u0430.\u00a0<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/adb\/053\/2c7\/adb0532c76d3dd7f4af419179adb371a.png\" width=\"441\" height=\"228\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/adb\/053\/2c7\/adb0532c76d3dd7f4af419179adb371a.png\"\/><\/figure>\n<p><a class=\"anchor\" name=\"7\" id=\"7\"><\/a><\/p>\n<h3>\u042d\u0442\u0430\u043f\u044b Parsing phase<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/33e\/6ab\/daa\/33e6abdaadc3bcc914c9994631c794b6.png\" width=\"720\" height=\"595\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/33e\/6ab\/daa\/33e6abdaadc3bcc914c9994631c794b6.png\"\/><\/figure>\n<ol>\n<li>\n<p>\u0412\u0441\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 <strong>\u043b\u0435\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 (Lexer Analysis)<\/strong>. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 Kotlin Parser \u0441\u043a\u0430\u043d\u0438\u0440\u0443\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 (\u0441\u0442\u0440\u043e\u043a\u0443) \u0438 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442 \u0435\u0433\u043e \u043d\u0430 \u043b\u0435\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0447\u0430\u0441\u0442\u0438 (<a href=\"https:\/\/github.com\/JetBrains\/kotlin\/blob\/master\/compiler\/psi\/src\/org\/jetbrains\/kotlin\/lexer\/KtTokens.java\"><strong><u>KtTokens<\/u><\/strong><\/a>). \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<ul>\n<li>\n<p><code>(<\/code><strong><em> \u2014> <\/em><\/strong><code>KtSingleValueToken.LPAR<\/code><strong><em>\u00a0<\/em><\/strong><\/p>\n<\/li>\n<li>\n<p><code>)<\/code><strong><em> \u2014><\/em><\/strong><code>KtSingleValueToken.RPAR<\/code><\/p>\n<\/li>\n<li>\n<p><code>=<\/code><strong><em> \u2014><\/em><\/strong><code>KtSingleValueToken.EQ<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e\u043a\u0435\u043d\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/84b\/844\/f04\/84b844f04ff3b6d314c6090cfa366179.png\" alt=\"\" title=\"\" width=\"1600\" height=\"881\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/84b\/844\/f04\/84b844f04ff3b6d314c6090cfa366179.png\"\/><\/figure>\n<p>\u041f\u0440\u043e\u0431\u0435\u043b\u044b \u0442\u043e\u0436\u0435 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0432 \u0442\u043e\u043a\u0435\u043d\u044b. \u041d\u043e \u043e\u043d\u0438 \u043d\u0435 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u044b, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u0442\u044c  \u043b\u0438\u0448\u043d\u0435\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439.\u00a0<\/p>\n<\/p>\n<\/li>\n<li>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f <strong>\u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 (Syntax Analysis)<\/strong>. \u0415\u0433\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u0442\u0430\u043f \u2014 \u044d\u0442\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 <strong>\u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0433\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 (AST)<\/strong>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043b\u0435\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432. \u0412\u0430\u0436\u043d\u0430\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c: \u0434\u0435\u0440\u0435\u0432\u043e \u0443\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u043d\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0430 <strong>\u0438\u043c\u0435\u0435\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443<\/strong>.\u00a0<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u044d\u0442\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u043d\u0430\u0448\u0435\u0433\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/fb7\/6db\/748\/fb76db748ef1fbec2e7e8288de575e6d.png\" width=\"1600\" height=\"896\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fb7\/6db\/748\/fb76db748ef1fbec2e7e8288de575e6d.png\"\/><\/figure>\n<\/li>\n<\/ol>\n<ol start=\"3\">\n<li>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u044d\u0442\u0430\u043f\u043e\u043c \u043c\u044b \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c PSI \u043d\u0430 \u0443\u0437\u043b\u044b \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0433\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430. \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c <strong>PSI-\u0434\u0435\u0440\u0435\u0432\u043e,<\/strong> \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/de9\/320\/09d\/de932009d0f8cc2fd0fd1e386ae6e491.png\" width=\"1600\" height=\"885\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/de9\/320\/09d\/de932009d0f8cc2fd0fd1e386ae6e491.png\"\/><\/figure>\n<\/li>\n<\/ol>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043c\u044b \u0438\u0449\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438. \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434, \u043d\u043e \u043f\u043e\u043a\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043e\u043d \u0438\u043b\u0438 \u043d\u0435\u0442 \u0438 \u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u043c \u0441\u043c\u044b\u0441\u043b \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430.\u00a0<\/p>\n<details class=\"spoiler\">\n<summary>\u0412 IntelliJ IDEA, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d PSIViewer \u0447\u0442\u043e\u0431\u044b \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c PSI \u0434\u043b\u044f \u043a\u043e\u0434\u0430, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u0430\u043c\u0438.\u00a0<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/165\/821\/e8b\/165821e8b1855a9d51d6dbf38e93d51e.png\" width=\"1600\" height=\"752\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/165\/821\/e8b\/165821e8b1855a9d51d6dbf38e93d51e.png\"\/><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"8\" id=\"8\"><\/a><\/p>\n<h4>Resolution Phase<\/h4>\n<p><a class=\"anchor\" name=\"9\" id=\"9\"><\/a><\/p>\n<h3>\u0417\u0430\u0434\u0430\u0447\u0430 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c <strong>\u0441\u043c\u044b\u0441\u043b<\/strong> \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <strong>Resolution Phase<\/strong>.\u00a0<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c PSI-\u0434\u0435\u0440\u0435\u0432\u043e \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u043d\u0430\u0431\u043e\u0440 \u044d\u0442\u0430\u043f\u043e\u0432, \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0430\u044f \u043f\u043e\u043d\u044f\u0442\u044c (resolving) \u0438\u043c\u0435\u043d\u0430 <strong>\u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0442\u0438\u043f\u043e\u0432, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445<\/strong> \u0438 \u043e\u0442\u043a\u0443\u0434\u0430 \u043e\u043d\u0438 \u0432\u0437\u044f\u043b\u0438\u0441\u044c.\u00a0<\/p>\n<p>\u0412\u0441\u0435 \u043c\u044b \u0432 \u043a\u043e\u0434\u0435 \u0432\u0438\u0434\u0435\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438\u0437 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0434\u0438\u0438.\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/11b\/a47\/d11\/11ba47d11cf39386fc081444fd0a1c73.png\" width=\"716\" height=\"164\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/11b\/a47\/d11\/11ba47d11cf39386fc081444fd0a1c73.png\"\/><\/figure>\n<p>\u00a0<strong>\u0421\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e<\/strong>:  <\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/990\/679\/b56\/990679b5695fc4eb454e6f5f69b88d14.jpg\" width=\"290\" height=\"204\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/990\/679\/b56\/990679b5695fc4eb454e6f5f69b88d14.jpg\" data-blurred=\"true\"\/><\/figure>\n<p>\u041d\u0430 \u0441\u0442\u0430\u0434\u0438\u0438 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f pet \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 play, \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0422\u0438\u043f\u0430\u0445<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b06\/012\/0a7\/b060120a757af3fd4cb173261860d6d3.png\" width=\"1600\" height=\"462\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b06\/012\/0a7\/b060120a757af3fd4cb173261860d6d3.png\"\/><\/figure>\n<p>\u0421\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0442\u043e\u043c, \u043d\u0430 \u043a\u0430\u043a\u0438\u0435 \u0442\u0438\u043f\u044b \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u0434, \u0432 \u043a\u0430\u043a\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u043e\u043d\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u044b. <\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0412\u044b\u0437\u043e\u0432\u0430\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4c0\/7be\/40d\/4c07be40d527d5ac1c9c54e9d211135e.png\" width=\"1494\" height=\"408\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4c0\/7be\/40d\/4c07be40d527d5ac1c9c54e9d211135e.png\"\/><\/figure>\n<p>\u041c\u043e\u0436\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 <em>meow<\/em>, \u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u043a\u0430\u043a\u0443\u044e \u0438\u043c\u0435\u043d\u043d\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c. \u042d\u0442\u0430 \u0441\u0442\u0430\u0434\u0438\u044f \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430. \u0422\u043a <em>meow<\/em> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c: \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043b\u0430\u0441\u0441\u0430, extension, property. \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f, \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0438\u043b\u0438 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435. \u041d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u043d\u0443\u0436\u043d\u044b\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438. <\/p>\n<\/div>\n<\/details>\n<p><strong>\u042d\u0442\u0430 \u0441\u0442\u0430\u0434\u0438\u044f \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043d\u0430 \u043f\u043e\u0445\u043e\u0436\u0438\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b<\/strong>:<\/p>\n<ul>\n<li>\n<p>\u041e\u0442\u043a\u0443\u0434\u0430 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\/\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f\/\u0442\u0438\u043f \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u0422\u043e\u0447\u043d\u043e \u043b\u0438 \u0434\u0432\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u043a \u043e\u0434\u043d\u043e\u0439 \u0438 \u0442\u043e\u0439 \u0436\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438\u043b\u0438 \u044d\u0442\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0433\u0434\u0435 \u043e\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f?<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a\u043e\u0439 \u0442\u0438\u043f \u0443 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430?  <\/p>\n<\/li>\n<\/ul>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"kotlin\">val list1 = listOf(1, 2, 3) val list2 = listOf(\"one\", \"two\", \"three\")<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c.<\/p>\n<p>\u0422\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f generic-\u0444\u0443\u043d\u043a\u0446\u0438\u044f <em>listOf<\/em><\/p>\n<pre><code class=\"kotlin\">public fun &lt;T> listOf(vararg elements: T): List&lt;T><\/code><\/pre>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u2014 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0442\u0438\u043f\u0430 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  <\/p>\n<pre><code class=\"kotlin\">val list1 = listOf(1, 2, 3)<\/code><\/pre>\n<p>\u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <em>T = Int<\/em>  <\/p>\n<pre><code class=\"kotlin\">val list2 = listOf(\"one\", \"two\", \"three\")<\/code><\/pre>\n<p>\u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u2014 <em>T = String<\/em>.  <\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"10\" id=\"10\"><\/a><\/p>\n<h3>\u042d\u0442\u0430\u043f\u044b Resolution Phase<\/h3>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f K1 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 <strong>PSI-\u0434\u0435\u0440\u0435\u0432\u0435<\/strong>, \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u044b \u0438 <strong>BindingContext<\/strong> map, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0432\u0441\u0435 \u044d\u0442\u043e \u043d\u0430 \u0431\u044d\u043a\u0435\u043d\u0434. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0431\u044d\u043a\u0435\u043d\u0434 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 IR \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>Psi2Ir<\/strong>.<\/p>\n<p>\u0412\u0441\u044f \u044d\u0442\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435 \u043d\u0430 \u0431\u044d\u043a\u0435\u043d\u0434\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ece\/610\/25f\/ece61025f9a00c4e4606f0e8d9bb1c46.png\" width=\"1600\" height=\"895\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ece\/610\/25f\/ece61025f9a00c4e4606f0e8d9bb1c46.png\"\/><\/figure>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441 \u0434\u0435\u0440\u0435\u0432\u043e\u043c PSI \u0438 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 BindingContext<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043a\u0430\u043a \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 (\u0441\u0442\u0440\u043e\u043a\u0430) \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 (\u0434\u0435\u0440\u0435\u0432\u043e) \u0438 \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0443\u0437\u043b\u0443 \u0434\u0435\u0440\u0435\u0432\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f (\u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0430).<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/836\/1fd\/265\/8361fd265640179683030531eb4af37f.png\" width=\"1600\" height=\"739\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/836\/1fd\/265\/8361fd265640179683030531eb4af37f.png\"\/><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"11\" id=\"11\"><\/a><\/p>\n<h4>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b K1<\/h4>\n<p>\u041c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0441 \u0442\u0435\u043c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434-\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f K1. \u041e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0430 \u0441\u0445\u0435\u043c\u0435 K1:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/745\/b50\/65d\/745b5065de514b84b60da07976b05ad0.png\" width=\"1600\" height=\"572\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/745\/b50\/65d\/745b5065de514b84b60da07976b05ad0.png\"\/><\/figure>\n<p>\u0423 \u044d\u0442\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438 (<a href=\"https:\/\/kotlinlang.slack.com\/archives\/C7L3JB43G\/p1622478266038500\"><u>\u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u0414\u043c\u0438\u0442\u0440\u0438\u044f \u041d\u043e\u0432\u043e\u0436\u0438\u043b\u043e\u0432\u0430 \u0432 kotlin slack<\/u><\/a>). \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 <strong>PSI<\/strong> \u0438 <strong>BindingContext<\/strong> \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430.\u00a0<\/p>\n<p>\u0422\u043a \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043b\u0435\u043d\u0438\u0432\u044b\u043c\u0438 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u0430\u043c\u0438, \u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u0440\u044b\u0433\u0430\u0435\u0442 \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0447\u0430\u0441\u0442\u044f\u043c\u0438 \u043a\u043e\u0434\u0430, \u044d\u0442\u043e \u0441\u0432\u043e\u0434\u0438\u0442 \u043d\u0430 \u043d\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 JIT-\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438. \u041a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 resolution phase \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0431\u043e\u043b\u044c\u0448\u043e\u043c <strong>BindingContext<\/strong>, \u0438\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u0426\u041f \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u043e \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b.\u00a0<\/p>\n<p>\u0412\u0441\u0435 \u044d\u0442\u043e \u0432\u0435\u0434\u0435\u0442 \u043a \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e.<\/p>\n<p><a class=\"anchor\" name=\"12\" id=\"12\"><\/a><\/p>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f K2<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0438 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, JB \u0441\u043e\u0437\u0434\u0430\u043b\u0430 \u043d\u043e\u0432\u0443\u044e \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434-\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e <strong>K2 (Fir frontend)<\/strong>.<\/p>\n<p>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412\u043c\u0435\u0441\u0442\u043e \u0441\u0442\u0430\u0440\u044b\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 (<strong>PSI<\/strong> + <strong>BindingContext<\/strong>) \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f K2 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <strong>Fir (Frontend Intermediate Representation)<\/strong>. \u042d\u0442\u043e <strong>\u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e <\/strong>(\u0434\u0435\u0440\u0435\u0432\u043e, \u0432 \u0443\u0437\u043b\u0430\u0445 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043a \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u043a\u043e\u0434\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f). \u041e\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/20e\/340\/2a3\/20e3402a3355374bcbf03cf3a99c238e.png\" width=\"1600\" height=\"741\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/20e\/340\/2a3\/20e3402a3355374bcbf03cf3a99c238e.png\"\/><\/figure>\n<p><a class=\"anchor\" name=\"13\" id=\"13\"><\/a><\/p>\n<h4>\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 K2<\/h4>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u043a \u0440\u0430\u043d\u044c\u0448\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c <strong>PSI<\/strong> \u0438 <strong>BindingContext<\/strong> \u0432 Backend, \u0432 K2 \u043d\u0430 Frontend \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<ol>\n<li>\n<p><a href=\"#31\">\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 raw PSI \u043d\u0430 \u0432\u0445\u043e\u0434\u0435 (Parsing)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#32\">\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u043d\u0435\u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u043e\u0435 raw Fir-\u0434\u0435\u0440\u0435\u0432\u043e (Psi2Fir)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#33\">\u0421\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442 Fir-\u0434\u0435\u0440\u0435\u0432\u043e (Resolution + Checking)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/34\">\u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 Fir \u0432 Ir (Fir2Ir)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/35\">\u041f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 Ir \u0431\u044d\u043a\u0435\u043d\u0434\u0443\u00a0<\/a><\/p>\n<\/li>\n<\/ol>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 K2, \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0438 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u0442\u0435 \u0444\u0430\u0437\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 K1 \u0438 K2 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e.<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434\u00a0<\/p>\n<pre><code class=\"kotlin\">private val kotlinFiles = mutableListOf(1, 2, 3)<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d51\/12a\/97d\/d5112a97d9581d6e903dc8ccb1e27fdf.png\" width=\"1049\" height=\"572\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d51\/12a\/97d\/d5112a97d9581d6e903dc8ccb1e27fdf.png\"\/><\/figure>\n<p><a class=\"anchor\" name=\"14\" id=\"14\"><\/a><\/p>\n<h3>Parsing<\/h3>\n<p><a class=\"anchor\" name=\"31\" id=\"31\"><\/a><\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0443\u0440\u043e\u0432\u043d\u044f PSI<strong> <\/strong>(\u0434\u043e \u044d\u0442\u043e\u0433\u043e K1 \u0438 K2 \u0441\u0445\u043e\u0436\u0438):<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a9b\/89f\/a7b\/a9b89fa7bb1d10a0c160659817323df8.png\" width=\"1442\" height=\"799\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a9b\/89f\/a7b\/a9b89fa7bb1d10a0c160659817323df8.png\"\/><\/figure>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f K1 \u043f\u0440\u043e\u0441\u0442\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u0431\u044b \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 PSI \u043d\u0430 \u0431\u044d\u043a\u0435\u043d\u0434.\u00a0<\/p>\n<p><a class=\"anchor\" name=\"15\" id=\"15\"><\/a><\/p>\n<h3>Psi2Fir<\/h3>\n<p><a class=\"anchor\" name=\"32\" id=\"32\"><\/a><\/p>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043d\u0435\u0435, K2 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0434 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c Ir. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f <strong>Fir <\/strong>\u2014 \u044d\u0442\u043e <em>mutable-<\/em>\u0434\u0435\u0440\u0435\u0432\u043e, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0435 \u0438\u0437 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043f\u0430\u0440\u0441\u0435\u0440\u0430 (PSI-\u0434\u0435\u0440\u0435\u0432\u0430):<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f65\/1b1\/0c0\/f651b10c054bc941fb3516f04817e779.png\" width=\"1452\" height=\"812\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f65\/1b1\/0c0\/f651b10c054bc941fb3516f04817e779.png\"\/><\/figure>\n<p>\u0422\u0443\u0442 \u0432\u0438\u0434\u043d\u043e \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u043c\u0435\u0436\u0434\u0443 PSI \u0438 raw Fir.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1e8\/868\/4e7\/1e88684e78583306c60d3baa8cc79948.png\" width=\"1756\" height=\"1060\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1e8\/868\/4e7\/1e88684e78583306c60d3baa8cc79948.png\"\/><\/figure>\n<p><a class=\"anchor\" name=\"16\" id=\"16\"><\/a><\/p>\n<h3>Resolution<\/h3>\n<p>\u0418\u0442\u0430\u043a, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c raw FIR \u0438 \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u0430\u0435\u043c \u0435\u0433\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c. \u041e\u043d\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u044d\u0442\u0430\u043f\u044b \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u0434\u0435\u0440\u0435\u0432\u043e \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/10c\/ab4\/2c1\/10cab42c14a33d2d388845583ddf0049.png\" width=\"1453\" height=\"802\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/10c\/ab4\/2c1\/10cab42c14a33d2d388845583ddf0049.png\"\/><\/figure>\n<p><a class=\"anchor\" name=\"33\" id=\"33\"><\/a><\/p>\n<p>\u0412\u0441\u0435 \u0444\u0430\u0439\u043b\u044b \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442 \u044d\u0442\u0438 \u044d\u0442\u0430\u043f\u044b \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.\u00a0<\/p>\n<p>\u0412 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u043a\u0430\u043a:<\/p>\n<ul>\n<li>\n<p>\u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 import\u2019\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0438\u0441\u043a \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043b\u044f \u0441\u0443\u043f\u0435\u0440\u0442\u0438\u043f\u043e\u0432 \u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u043e\u0432 sealed \u043a\u043b\u0430\u0441\u0441\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437 \u0442\u0435\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0430 \u0441\u0442\u0430\u0434\u0438\u0438 Resolution \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 raw Fir, \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u044f \u0434\u0435\u0440\u0435\u0432\u043e \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439:\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9ea\/d4b\/700\/9ead4b70078c70c14a4d19c1d8d62f96.png\" width=\"1455\" height=\"811\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9ea\/d4b\/700\/9ead4b70078c70c14a4d19c1d8d62f96.png\"\/><\/figure>\n<p>\u041d\u0430 \u044d\u0442\u0438\u0445 \u044d\u0442\u0430\u043f\u0430\u0445 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 desugaring. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, `if` \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 `when` \u0438\u043b\u0438 `for` \u2014 \u043d\u0430 `while`.\u00a0<\/p>\n<p>\u0420\u0430\u043d\u044c\u0448\u0435 \u043c\u044b \u0434\u0435\u043b\u0430\u043b\u0438 \u0432\u0441\u0435 \u044d\u0442\u043e \u043d\u0430 Backend, \u043d\u043e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f K2 \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 Frontend.\u00a0<\/p>\n<p><a class=\"anchor\" name=\"17\" id=\"17\"><\/a><\/p>\n<h3>Checking<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6dc\/4ba\/282\/6dc4ba2823a579a6e58c74e18ed50ed4.png\" width=\"1464\" height=\"806\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6dc\/4ba\/282\/6dc4ba2823a579a6e58c74e18ed50ed4.png\"\/><\/figure>\n<p>\u041c\u044b \u043f\u0440\u0438\u0448\u043b\u0438 \u043a \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0442\u0430\u0434\u0438\u0438 \u2014 \u0441\u0442\u0430\u0434\u0438\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438. \u0417\u0434\u0435\u0441\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0431\u0435\u0440\u0435\u0442 Fir \u0438 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0443 \u043d\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u0438 \u043e\u0448\u0438\u0431\u043e\u043a.\u00a0<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c, \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0443 IDEA \u2014 \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u0438\u0432\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 \u043a\u0440\u0430\u0441\u043d\u043e\u0439 \u043b\u0438\u043d\u0438\u0435\u0439. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 \u0431\u044d\u043a\u0435\u043d\u0434.\u00a0<\/p>\n<p><a class=\"anchor\" name=\"18\" id=\"18\"><\/a><\/p>\n<h3>Fir2Ir<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u043d\u0435\u0442<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/128\/67e\/571\/12867e5715f0fa5c6650a4a3715f9eb7.png\" width=\"1460\" height=\"820\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/128\/67e\/571\/12867e5715f0fa5c6650a4a3715f9eb7.png\"\/><\/figure>\n<p><a class=\"anchor\" name=\"34\" id=\"34\"><\/a><\/p>\n<p>FIR \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 IR<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5f5\/0f6\/810\/5f50f68104937a2fbcb4f6cb3a90c1a1.png\" width=\"1455\" height=\"810\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5f5\/0f6\/810\/5f50f68104937a2fbcb4f6cb3a90c1a1.png\"\/><\/figure>\n<p><a class=\"anchor\" name=\"35\" id=\"35\"><\/a><\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0431\u044d\u043a\u0435\u043d\u0434\u0430<\/p>\n<p><a class=\"anchor\" name=\"19\" id=\"19\"><\/a><\/p>\n<h2>\u0412\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 K1 \u0438 K2   <\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/57d\/17a\/34d\/57d17a34de9a0b9eef198ce7dcd0216e.png\" width=\"5734\" height=\"2815\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/57d\/17a\/34d\/57d17a34de9a0b9eef198ce7dcd0216e.png\"\/><\/figure>\n<p>\u0418\u0442\u043e\u0433\u043e \u0432 K2 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 Fir (\u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043c\u0435\u0441\u0442\u043e \u0434\u0432\u0443\u0445 \u0432 K1 \u0432\u0435\u0440\u0441\u0438\u0438)  <\/p>\n<p><a class=\"anchor\" name=\"20\" id=\"20\"><\/a><\/p>\n<h2>Backend<\/h2>\n<p><a class=\"anchor\" name=\"21\" id=\"21\"><\/a><\/p>\n<h3>\u0426\u0435\u043b\u0438 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f Backend<\/h3>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 Kotlin \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 (IR). \u0422\u043a \u044d\u0442\u043e \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0430\u0434\u0438\u044f \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432.\u00a0<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043d\u043e\u043d\u0438\u0447\u043d\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/48b\/6a1\/0e4\/48b6a10e4b25df66253d762008826cc0.png\" width=\"944\" height=\"1049\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/48b\/6a1\/0e4\/48b6a10e4b25df66253d762008826cc0.png\"\/><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 IR \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u043e Kotlin \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0440\u0430\u043d\u043d\u0438\u0445 \u0441\u0442\u0430\u0434\u0438\u044f\u0445. Kotlin \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 JVM, \u043d\u043e \u0442\u0430\u043a \u0436\u0435 \u0438 \u0432 JS. JS \u0432\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0439 \u044f\u0437\u044b\u043a \u0438 \u043e\u043d \u043f\u043e\u0445\u043e\u0436 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0430 Kotlin, \u0447\u0435\u043c \u043d\u0430 JVM \u0431\u0430\u0439\u0442\u043a\u043e\u0434. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 IR \u0431\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0440\u043c\u043e\u0437\u0438\u043b\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/06b\/521\/b96\/06b521b96545144de6567e249ac0d863.png\" width=\"1258\" height=\"988\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/06b\/521\/b96\/06b521b96545144de6567e249ac0d863.png\"\/><\/figure>\n<p>\u041d\u043e \u0432\u0441\u043a\u043e\u0440\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0435\u0449\u0435 1 native backend.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/863\/3a4\/4e3\/8633a44e35800c2fdc31298245f43fe8.png\" width=\"1600\" height=\"685\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/863\/3a4\/4e3\/8633a44e35800c2fdc31298245f43fe8.png\"\/><\/figure>\n<p>\u0421\u0442\u0430\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0447\u0442\u043e \u0432\u0441\u0435 3 \u0431\u044d\u043a\u0435\u043d\u0434\u0430 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0449\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u043e \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044e \u043a\u043e\u0434\u0430, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0444\u0438\u0447\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0431\u0435\u043a\u0435\u043d\u0434\u043e\u0432 \u043f\u0440\u043e\u0449\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 native-backend \u043a\u043e\u043c\u0430\u043d\u0434\u0430 Kotlin \u0440\u0435\u0448\u0438\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c IR, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0441\u0430\u043c\u043e\u0433\u043e.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2e9\/14e\/f6f\/2e914ef6feb4ab75068486290e87bc95.png\" width=\"1600\" height=\"919\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2e9\/14e\/f6f\/2e914ef6feb4ab75068486290e87bc95.png\"\/><\/figure>\n<p>\u0418\u0442\u0430\u043a, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0446\u0435\u043b\u0435\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043b\u043e\u0433\u0438\u043a\u0438 \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0431\u0435\u043a\u0435\u043d\u0434\u0430\u043c\u0438<\/p>\n<\/li>\n<li>\n<p>\u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u043d\u043e\u0432\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 Backend \u043d\u0435 \u044f\u0432\u043b\u044f\u043b\u043e\u0441\u044c \u0446\u0435\u043b\u044c\u044e. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f Frontend-\u0447\u0430\u0441\u0442\u0438.<\/p>\n<p>\u041d\u043e\u0432\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f Backend \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043d\u044b\u0445 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f Jetpack Compose \u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043d\u043e\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0431\u0435\u043a\u0435\u043d\u0434\u0430 c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c IR.<\/p>\n<p><a class=\"anchor\" name=\"22\" id=\"22\"><\/a><\/p>\n<h3>\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 Backend<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c78\/534\/63e\/c7853463ed3b31b4e99c4698a6f4b4ab.png\" width=\"1426\" height=\"795\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c78\/534\/63e\/c7853463ed3b31b4e99c4698a6f4b4ab.png\"\/><\/figure>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u0432 Kotlin \u0435\u0441\u0442\u044c \u0447\u0435\u0442\u044b\u0440\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 backend:\u00a0<\/p>\n<ul>\n<li>\n<p>JVM<\/p>\n<\/li>\n<li>\n<p>JS<\/p>\n<\/li>\n<li>\n<p>Native\u00a0<\/p>\n<\/li>\n<li>\n<p>WASM<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u043a\u043e\u0439 \u0431\u044b \u0431\u044d\u043a\u0435\u043d\u0434 \u0432\u044b \u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0432 \u043d\u0435\u043c \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 IR \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0442\u043e\u0440\u0430. \u0417\u0430\u0442\u0435\u043c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434:<\/p>\n<p>\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/98b\/e2d\/008\/98be2d00820accf6e676d0332f0f4f90.png\" width=\"2524\" height=\"1466\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/98b\/e2d\/008\/98be2d00820accf6e676d0332f0f4f90.png\"\/><\/figure>\n<p>\u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u0431\u044d\u043a\u0435\u043d\u0434 JVM \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 mutableList<\/p>\n<p><a class=\"anchor\" name=\"23\" id=\"23\"><\/a><\/p>\n<h4>IR<\/h4>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/991\/90e\/0a2\/99190e0a2a44ffce6f512fe4a0aa4163.png\" width=\"1460\" height=\"814\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/991\/90e\/0a2\/99190e0a2a44ffce6f512fe4a0aa4163.png\"\/><\/figure>\n<p>IR \u044d\u0442\u043e \u0442\u0430\u043a\u0436\u0435 \u0434\u0435\u0440\u0435\u0432\u043e. \u0412 IR \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0432\u0441\u044f \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f. \u0414\u043b\u044f \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 IR \u043d\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e, \u043d\u043e \u0437\u0430\u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u0432\u0438\u0434 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u0435\u0435 \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430.\u00a0\u0412 \u043c\u043e\u043c\u0435\u043d\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 IR \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u0442\u043e\u043a \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0441\u0442\u0435\u043a\u0438 \u0432\u044b\u0437\u043e\u0432\u043e\u0432.<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c IR \u043a\u0430\u043a \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u0432 \u0432\u0438\u0434\u0435 \u0434\u0435\u0440\u0435\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 <strong>\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 target-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b<\/strong>. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 Fir \u043d\u0430 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p><a class=\"anchor\" name=\"24\" id=\"24\"><\/a><\/p>\n<h4>IR lowering<\/h4>\n<p>\u0417\u0430\u0442\u0435\u043c \u043d\u0430 IR \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u044d\u0442\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <strong>lowering<\/strong>.\u00a0 \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c Kotlin. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432 IR \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 local \u0438 internal \u043a\u043b\u0430\u0441\u0441\u044b, \u043e\u043d\u0438 \u0437\u0430\u043c\u0435\u043d\u0435\u043d\u044b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438 \u0441\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0438\u043c\u0435\u043d\u0430\u043c\u0438. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u0439 \u0440\u0430\u0437\u043d\u044b\u043c backend\u2019\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u043e\u0440\u043e\u0442\u044c\u0441\u044f \u0441\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u044f\u0437\u044b\u043a\u0430 Kotlin \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0449\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/674\/cfd\/3bd\/674cfd3bd2547984874c6d26b1b7c661.png\" width=\"1449\" height=\"811\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/674\/cfd\/3bd\/674cfd3bd2547984874c6d26b1b7c661.png\"\/><\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0443\u043f\u0440\u043e\u0449\u0430\u044e\u0442\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p><a class=\"anchor\" name=\"25\" id=\"25\"><\/a><\/p>\n<h4>Target code<\/h4>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b. \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044d\u0442\u043e JVM \u0431\u0430\u0439\u0442-\u043a\u043e\u0434. \u0414\u0430\u043b\u0435\u0435 \u043e\u043d \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443, \u0433\u0434\u0435 \u043e\u043d \u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1e8\/495\/dda\/1e8495dda92dc53af904e3a5756b14ee.png\" width=\"1453\" height=\"814\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1e8\/495\/dda\/1e8495dda92dc53af904e3a5756b14ee.png\"\/><\/figure>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0437\u0430\u0434\u0430\u0447\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0441\u0447\u0438\u0442\u0430\u044e\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u043c\u0438.<\/p>\n<p><a class=\"anchor\" name=\"26\" id=\"26\"><\/a><\/p>\n<h2>\u0412\u044b\u0432\u043e\u0434\u044b<\/h2>\n<p>\u0427\u0442\u043e \u0434\u0430\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440:<\/p>\n<ul>\n<li>\n<p>\u0415\u0434\u0438\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 Fir \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0438 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430<\/p>\n<\/li>\n<li>\n<p>\u0423\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u043d\u043e\u0432\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 target-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c.<\/p>\n<\/li>\n<li>\n<p>\u0423\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0438 IDE (\u043f\u043b\u0430\u0433\u0438\u043d Kotlin \u0432 IDE \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 Frontend \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430). <a href=\"https:\/\/blog.jetbrains.com\/kotlin\/2024\/04\/k2-compiler-performance-benchmarks-and-how-to-measure-them-on-your-projects\/\"><u>\u041f\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u0437\u0430\u043c\u0435\u0440\u043e\u0432 JB<\/u><\/a>:<\/p>\n<ul>\n<li>\n<p>\u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043d\u0430 94%<\/p>\n<\/li>\n<li>\n<p>\u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u0444\u0430\u0437\u044b \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 488%<\/p>\n<\/li>\n<li>\n<p>\u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u0444\u0430\u0437\u044b \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043d\u0430 376%<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 Kotlin. \u041d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443 \u0440\u0435\u0434\u043a\u043e \u0443\u0433\u043b\u0443\u0431\u043b\u044f\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438. \u042f \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432\u0430\u043c \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442 \u0438 \u0443\u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u0436\u0435 \u0442\u0430\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0435.<\/p>\n<p><a class=\"anchor\" name=\"27\" id=\"27\"><\/a><\/p>\n<h3>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b<\/h3>\n<ul>\n<li>\n<p>\u0412\u0438\u0434\u0435\u043e <a href=\"https:\/\/youtu.be\/wUGfuWHCqrc\"><u>Crash Course on the Kotlin Compiler by Amanda Hinchman-Dominguez<\/u><\/a>\u00a0<\/p>\n<\/li>\n<li>\n<p>\u0412\u0438\u0434\u0435\u043e <a href=\"https:\/\/www.youtube.com\/watch?v=w-GMlaziIyo\"><u>KotlinConf 2018 &#8212; Writing Your First Kotlin Compiler Plugin by Kevin Most<\/u><\/a>\u00a0<\/p>\n<\/li>\n<li>\n<p>\u0412\u0438\u0434\u0435\u043e <a href=\"https:\/\/www.youtube.com\/watch?v=iTdJJq_LyoY\"><u>What Everyone Must Know About The NEW Kotlin K2 Compiler<\/u><\/a>\u00a0<\/p>\n<\/li>\n<li>\n<p>\u0412\u0438\u0434\u0435\u043e <a href=\"https:\/\/www.droidcon.com\/2022\/06\/28\/ha-hitchhikers-guide-to-compose-compiler-composers-compiler-plugins-and-snapshots\/\"><u>A Hitchhiker&#8217;s Guide to Compose Compiler: Composers, Compiler Plugins, and Snapshots<\/u><\/a><\/p>\n<\/li>\n<li>\n<p>\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 <a href=\"https:\/\/github.com\/ahinchman1\/Kotlin-Compiler-Crash-Course\"><u>Kotlin-Compiler-Crash-Course<\/u><\/a> \u0441 \u0437\u0430\u043c\u0435\u0442\u043a\u0430\u043c\u0438 \u043e\u0431 \u043e\u0442\u043b\u0430\u0434\u043a\u0435, \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 Kotlin\u00a0<\/p>\n<\/li>\n<li>\n<p>\u0426\u0438\u043a\u043b \u0441\u0442\u0430\u0442\u0435\u0439 Crash course on the Kotlin compiler<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/medium.com\/google-developer-experts\/crash-course-on-the-kotlin-compiler-k1-k2-frontends-backends-fe2238790bd8\"><u>K1 + K2 Frontends, Backends<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/medium.com\/google-developer-experts\/crash-course-on-the-kotlin-compiler-1-frontend-parsing-phase-9898490d922b\"><u>1. Frontend: Parsing phase<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.google.com\/document\/d\/17dBSxlXRW7PRD92QZGcGeotnsPSOsp0NSdnFXXZ41sg\/edit\"><u>2. Frontend: Resolution phase<\/u><\/a>\u00a0<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u041a\u043d\u0438\u0433\u0430 \u201cCompilers: Principles, Techniques, and Tools\u201d by Alfred Aho, Jeffrey Ullman, Ravi Sethi, Monica Lam<\/p>\n<\/li>\n<\/ul>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/76d\/a8f\/ea9\/76da8fea949241a9417e3c6013d57c2a.png\" width=\"340\" height=\"443\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/76d\/a8f\/ea9\/76da8fea949241a9417e3c6013d57c2a.png\"\/><\/figure>\n<p><strong>\u0414\u0440\u0443\u0433\u0438\u0435 \u043d\u0430\u0448\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e Android \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435:<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/kts\/articles\/814363\/\">Developer Keynote Google I\/O 2024: \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 KMP, \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 Gemini \u0438 AI \u0432 \u0410\u043d\u0434\u0440\u043e\u0438\u0434\u0435<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/kts\/articles\/767224\/\">4 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0442\u0430\u0432\u043a\u0443 \u043d\u0430 Kotlin Multiplatform, \u0430 \u043d\u0435 Flutter<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/kts\/articles\/771498\/\">Kotlin Multiplatform \u043f\u0435\u0440\u0435\u0448\u0451\u043b \u0432 stable. \u0427\u0442\u043e \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442?<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/kts\/articles\/798607\/\">\u041a\u043e\u0442 \u0432 \u043c\u0435\u0448\u043a\u0435: \u043c\u0430\u0441\u0442\u0435\u0440\u0441\u0442\u0432\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043a\u043b\u044e\u0447\u0435\u0439 SQLite<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/813085\/\"> https:\/\/habr.com\/ru\/articles\/813085\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u043c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u041c\u044f\u043b\u043a\u0438\u043d \u041c\u0430\u043a\u0441\u0438\u043c, \u044f \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0432 <a href=\"https:\/\/kts.tech\/\"><u>KTS.<\/u><\/a><\/p>\n<p>\u041d\u0435 \u0437\u0430 \u0433\u043e\u0440\u0430\u043c\u0438 \u0432\u044b\u043f\u0443\u0441\u043a \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Kotlin 2.0, \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u043d\u0430 K2.\u00a0<\/p>\n<p><a href=\"https:\/\/blog.jetbrains.com\/kotlin\/2024\/04\/k2-compiler-performance-benchmarks-and-how-to-measure-them-on-your-projects\/\"><u>\u041f\u043e \u0437\u0430\u043c\u0435\u0440\u0430\u043c JB<\/u><\/a>, K2 \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e \u043d\u0430 94%. \u0422\u0430\u043a\u0436\u0435 \u043e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043d\u043e\u0432\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0445 \u0444\u0438\u0447 \u0438 \u0443\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0434\u043b\u044f \u043c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432.<\/p>\n<p>\u041d\u043e \u043c\u0430\u043b\u043e \u043a\u0442\u043e \u043f\u043e\u0433\u0440\u0443\u0436\u0430\u043b\u0441\u044f \u0432 \u0442\u043e, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 K2, \u0438 \u0447\u0435\u043c \u043e\u043d \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 K1.\u00a0<\/p>\n<p>\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u043e\u043b\u0435\u0435 \u043e\u0441\u0432\u0435\u0449\u0430\u0435\u0442 \u043d\u044e\u0430\u043d\u0441\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u0447\u0442\u043e \u0436\u0435 JB \u0443\u043b\u0443\u0447\u0448\u0430\u044e\u0442 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c, \u0438 \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p>\u041a\u043e\u043d\u0442\u0435\u043d\u0442 \u0441\u0442\u0430\u0442\u044c\u0438 \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 <a href=\"https:\/\/www.youtube.com\/watch?v=wUGfuWHCqrc\"><u>\u0432\u044b\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438<\/u><\/a> \u0438 <a href=\"https:\/\/www.youtube.com\/watch?v=iTdJJq_LyoY\"><u>\u043e\u0432\u0435\u0440\u0432\u044c\u044e<\/u><\/a>, \u043d\u043e \u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438.<\/p>\n<h2>\u041e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u0435  <\/h2>\n<ul>\n<li>\n<p><a href=\"#1\">\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#2\">Frontend  <\/a><\/p>\n<ul>\n<li>\n<p><a href=\"#3\">\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f K1  <\/a><\/p>\n<ul>\n<li>\n<p><a href=\"#4\">\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 K1  <\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#5\">Parsing Phase  <\/a><\/p>\n<ul>\n<li>\n<p><a href=\"#6\">\u0417\u0430\u0434\u0430\u0447\u0430 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430  <\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#7\">\u00a0\u042d\u0442\u0430\u043f\u044b Parsing phase  <\/a><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><a href=\"#8\">Resolution Phase  <\/a><\/p>\n<ul>\n<li>\n<p><a href=\"#9\">\u0417\u0430\u0434\u0430\u0447\u0430 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430<\/a>  <\/p>\n<\/li>\n<li>\n<p><a href=\"#10\">\u042d\u0442\u0430\u043f\u044b Resolution Phase  <\/a><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><a href=\"#11\">\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b K1 <\/a> <\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><a href=\"#12\">\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f K2  <\/a><\/p>\n<ul>\n<li>\n<p><a href=\"#13\">\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 K2  <\/a><\/p>\n<ul>\n<li>\n<p><a href=\"#14\">Parsing  <\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#15\">Psi2Fir  <\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#16\">Resolution  <\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#17\">Checking  <\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#18\">Fir2Ir  <\/a><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><a href=\"#19\">\u0412\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 K1 \u0438 K2   <\/a><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><a href=\"#20\">Backend  <\/a><\/p>\n<ul>\n<li>\n<p><a href=\"#22\">\u0426\u0435\u043b\u0438 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f Backend  <\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#23\">\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 Backend  <\/a><\/p>\n<ul>\n<li>\n<p><a href=\"#24\">IR <\/a> <\/p>\n<\/li>\n<li>\n<p><a href=\"#24\">IR lowering  <\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#26\">Target code <\/a> <\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><a href=\"#27\">\u0412\u044b\u0432\u043e\u0434\u044b<\/a>  <\/p>\n<\/li>\n<li>\n<p><a href=\"#27\">\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b  <\/a><\/p>\n<\/li>\n<\/ul>\n<p><a class=\"anchor\" name=\"1\" id=\"1\"><\/a><\/p>\n<h2>\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440<\/h2>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u0445 \u0432 \u0446\u0435\u043b\u043e\u043c. \u041f\u043e \u0441\u0443\u0442\u0438, <strong>\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 <\/strong>\u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430. \u041e\u043d\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u043e\u0434 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0435\u0433\u043e \u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u044c.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0439, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0445 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439. \u0415\u0441\u043b\u0438 \u043e\u0447\u0435\u043d\u044c \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c, \u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0434\u0435\u043b\u0430\u0435\u0442 \u0434\u0432\u0435 \u0432\u0435\u0449\u0438:<\/p>\n<ul>\n<li>\n<p>\u043c\u0435\u043d\u044f\u0435\u0442 \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u0430\u043d\u043d\u044b\u0445 (compiling)<\/p>\n<\/li>\n<li>\n<p>\u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0435\u0433\u043e (lowering)<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><\/figure>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 Kotlin \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e. \u0412 \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0432\u044b\u0445\u043e\u0434\u044f\u0442 \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 <strong>\u043f\u043b\u0430\u0433\u0438\u043d\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430<\/strong>.<\/p>\n<p>\u041f\u043b\u0430\u0433\u0438\u043d\u044b \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0440\u0430\u0431\u043e\u0442\u0443 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 Kotlin \u043d\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0444\u0430\u0437\u0430\u0445 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438 \u043c\u0435\u043d\u044f\u044e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c.\u00a0<\/p>\n<figure class=\"\"><\/figure>\n<blockquote>\n<p>\u041f\u043b\u0430\u0433\u0438\u043d\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0442\u0430\u043a\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043a\u0430\u043a Jetpack Compose, Kotlinx serialization.<\/p>\n<\/blockquote>\n<p>Kotlin \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 2 \u0447\u0430\u0441\u0442\u0435\u0439:<\/p>\n<ul>\n<li>\n<p>Frontend<\/p>\n<ul>\n<li>\n<p>\u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 <strong>\u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 (\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043a\u043e\u0434\u0430)<\/strong> \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 <strong>\u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 (\u0441\u043c\u044b\u0441\u043b \u043a\u043e\u0434\u0430)<\/strong><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>Backend<\/p>\n<ul>\n<li>\n<p>\u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0446\u0435\u043b\u0435\u0432\u043e\u0439 (target) \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b: JVM, JS, Native, WASM (\u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0439)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><\/figure>\n<p>\u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u0447\u0430\u0441\u0442\u0435\u0439.<\/p>\n<p><a class=\"anchor\" name=\"2\" id=\"2\"><\/a><\/p>\n<h2>Frontend  <\/h2>\n<p>\u0423 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 Kotlin \u0435\u0441\u0442\u044c \u0434\u0432\u0435 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434-\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:\u00a0<\/p>\n<ul>\n<li>\n<p>K1 (FE10-)\u00a0<\/p>\n<\/li>\n<li>\n<p>K2 (Fir-)<\/p>\n<\/li>\n<\/ul>\n<p>\u0423\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u043e \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0431\u043e\u0442\u044b \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<ul>\n<li>\n<p>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434\u00a0<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u043a\u043e\u0434\u0430<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0431\u044d\u043a\u0435\u043d\u0434 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 IR (Intermediate representation)\u00a0\u0438 \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b (target)<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><\/figure>\n<p>\u041e\u0431\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u0445\u043e\u0436\u0438, \u043d\u043e K2 \u0432\u0432\u043e\u0434\u0438\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c, \u043a\u0430\u043a \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 \u0431\u044d\u043a\u0435\u043d\u0434.\u00a0<\/p>\n<p><a class=\"anchor\" name=\"3\" id=\"3\"><\/a><\/p>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f K1<\/h2>\n<figure class=\"full-width\"><\/figure>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f K1 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 c:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/plugins.jetbrains.com\/docs\/intellij\/psi.html\"><strong><u>PSI<\/u><\/strong><\/a><strong> <\/strong>(Programming Structure Interface)<\/p>\n<ul>\n<li>\n<p>PSI \u2014 \u044d\u0442\u043e \u0441\u043b\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b IntelliJ, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u043e\u043c \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0438 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043a\u043e\u0434\u0430 (\u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0438 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0437\u0436\u0435)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/JetBrains\/kotlin\/tree\/c5e70c7d3f1d3e75e9bd4be74bd1c9e488852471\/core\/descriptors\/src\/org\/jetbrains\/kotlin\/descriptors\"><strong><u>\u0414\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u0430\u043c\u0438<\/u><\/strong><\/a><\/p>\n<ul>\n<li>\n<p>\u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u044b \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043d\u0435\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u043a\u043b\u0430\u0441\u0441\u0430: \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u043a\u043b\u0430\u0441\u0441\u0430, overrides, companion object \u0438 \u0442\u0434.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/JetBrains\/kotlin\/blob\/master\/compiler\/frontend\/src\/org\/jetbrains\/kotlin\/resolve\/BindingContext.java\"><strong><u>BindingContext<\/u><\/strong><\/a><strong> <\/strong>\u2014 \u044d\u0442\u043e Map, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0435\u0442 PSI.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 K1 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 <strong>PSI<\/strong> \u0438 <strong>BindingContext<\/strong> \u043d\u0430 Backend, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430 \u0432\u0445\u043e\u0434\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 PSI \u0432 IR (Psi2Ir) \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b.\u00a0<\/p>\n<p><a class=\"anchor\" name=\"4\" id=\"4\"><\/a><\/p>\n<h4>\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 K1<\/h4>\n<p>\u041e\u0431\u0449\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0415\u0441\u0442\u044c 2 \u0444\u0430\u0437\u044b:\u00a0<\/p>\n<ul>\n<li>\n<p><strong>Parsing Phase<\/strong> \u2014 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442 \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a. \u041d\u0430 \u044d\u0442\u043e\u0439 \u0444\u0430\u0437\u0435 \u0435\u0449\u0435 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0431\u0443\u0434\u0435\u0442 \u043b\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434. \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043a\u043e\u0434 \u043d\u0430\u043f\u0438\u0441\u0430\u043d <strong>\u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438<\/strong> \u0432\u0435\u0440\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p><strong>Resolution Phase<\/strong> \u2014 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u0430\u043d\u0430\u043b\u0438\u0437, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u0431\u0443\u0434\u0435\u0442 \u043b\u0438 \u043a\u043e\u0434 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u043e\u043d <strong>\u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0438<\/strong> \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c (<a href=\"https:\/\/docs.google.com\/document\/d\/17dBSxlXRW7PRD92QZGcGeotnsPSOsp0NSdnFXXZ41sg\/edit\"><u>\u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u0431\u043e\u0440 Resolution Phase<\/u><\/a>).<\/p>\n<\/li>\n<\/ul>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u0434\u0430\u043b\u044c\u0448\u0435 \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u043c\u0435\u0436\u0434\u0443 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c \u0438 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u043e\u0439.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 K1, \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434\u00a0<\/p>\n<pre><code class=\"kotlin\">fun two() = 2 <\/code><\/pre>\n<p>\u041f\u043e\u043a\u0430 \u0447\u0442\u043e \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a\u0430 \u0442\u0435\u043a\u0441\u0442\u0430.  <\/p>\n<p><a class=\"anchor\" name=\"5\" id=\"5\"><\/a><\/p>\n<h4>Parsing Phase<\/h4>\n<p><a class=\"anchor\" name=\"6\" id=\"6\"><\/a><\/p>\n<h3>\u0417\u0430\u0434\u0430\u0447\u0430 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430<\/h3>\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u2014 <\/strong>\u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c <strong>\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443<\/strong> \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043e\u043d\u0430 \u0432\u0435\u0440\u043d\u0430\u044f \u0438 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 <a href=\"https:\/\/kotlinlang.org\/docs\/reference\/grammar.html\"><strong><u>\u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c<\/u><\/strong><\/a><strong> \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c<\/strong> \u044f\u0437\u044b\u043a\u0430.\u00a0<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<figure class=\"\"><\/figure>\n<p><a class=\"anchor\" name=\"7\" id=\"7\"><\/a><\/p>\n<h3>\u042d\u0442\u0430\u043f\u044b Parsing phase<\/h3>\n<figure class=\"full-width\"><\/figure>\n<ol>\n<li>\n<p>\u0412\u0441\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 <strong>\u043b\u0435\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 (Lexer Analysis)<\/strong>. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 Kotlin Parser \u0441\u043a\u0430\u043d\u0438\u0440\u0443\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 (\u0441\u0442\u0440\u043e\u043a\u0443) \u0438 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442 \u0435\u0433\u043e \u043d\u0430 \u043b\u0435\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0447\u0430\u0441\u0442\u0438 (<a href=\"https:\/\/github.com\/JetBrains\/kotlin\/blob\/master\/compiler\/psi\/src\/org\/jetbrains\/kotlin\/lexer\/KtTokens.java\"><strong><u>KtTokens<\/u><\/strong><\/a>). \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<ul>\n<li>\n<p><code>(<\/code><strong><em> \u2014> <\/em><\/strong><code>KtSingleValueToken.LPAR<\/code><strong><em>\u00a0<\/em><\/strong><\/p>\n<\/li>\n<li>\n<p><code>)<\/code><strong><em> \u2014><\/em><\/strong><code>KtSingleValueToken.RPAR<\/code><\/p>\n<\/li>\n<li>\n<p><code>=<\/code><strong><em> \u2014><\/em><\/strong><code>KtSingleValueToken.EQ<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e\u043a\u0435\u043d\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u0440\u043e\u0431\u0435\u043b\u044b \u0442\u043e\u0436\u0435 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0432 \u0442\u043e\u043a\u0435\u043d\u044b. \u041d\u043e \u043e\u043d\u0438 \u043d\u0435 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u044b, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u0442\u044c  \u043b\u0438\u0448\u043d\u0435\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439.\u00a0<\/p>\n<\/p>\n<\/li>\n<li>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f <strong>\u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 (Syntax Analysis)<\/strong>. \u0415\u0433\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u0442\u0430\u043f \u2014 \u044d\u0442\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 <strong>\u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0433\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 (AST)<\/strong>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043b\u0435\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432. \u0412\u0430\u0436\u043d\u0430\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c: \u0434\u0435\u0440\u0435\u0432\u043e \u0443\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u043d\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0430 <strong>\u0438\u043c\u0435\u0435\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443<\/strong>.\u00a0<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u044d\u0442\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u043d\u0430\u0448\u0435\u0433\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><\/figure>\n<\/li>\n<\/ol>\n<ol start=\"3\">\n<li>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u044d\u0442\u0430\u043f\u043e\u043c \u043c\u044b \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c PSI \u043d\u0430 \u0443\u0437\u043b\u044b \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0433\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430. \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c <strong>PSI-\u0434\u0435\u0440\u0435\u0432\u043e,<\/strong> \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443:<\/p>\n<figure class=\"full-width\"><\/figure>\n<\/li>\n<\/ol>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043c\u044b \u0438\u0449\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438. \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434, \u043d\u043e \u043f\u043e\u043a\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043e\u043d \u0438\u043b\u0438 \u043d\u0435\u0442 \u0438 \u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u043c \u0441\u043c\u044b\u0441\u043b \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430.\u00a0<\/p>\n<details class=\"spoiler\">\n<summary>\u0412 IntelliJ IDEA, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d PSIViewer \u0447\u0442\u043e\u0431\u044b \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c PSI \u0434\u043b\u044f \u043a\u043e\u0434\u0430, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u0430\u043c\u0438.\u00a0<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"8\" id=\"8\"><\/a><\/p>\n<h4>Resolution Phase<\/h4>\n<p><a class=\"anchor\" name=\"9\" id=\"9\"><\/a><\/p>\n<h3>\u0417\u0430\u0434\u0430\u0447\u0430 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c <strong>\u0441\u043c\u044b\u0441\u043b<\/strong> \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <strong>Resolution Phase<\/strong>.\u00a0<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c PSI-\u0434\u0435\u0440\u0435\u0432\u043e \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u043d\u0430\u0431\u043e\u0440 \u044d\u0442\u0430\u043f\u043e\u0432, \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0430\u044f \u043f\u043e\u043d\u044f\u0442\u044c (resolving) \u0438\u043c\u0435\u043d\u0430 <strong>\u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0442\u0438\u043f\u043e\u0432, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445<\/strong> \u0438 \u043e\u0442\u043a\u0443\u0434\u0430 \u043e\u043d\u0438 \u0432\u0437\u044f\u043b\u0438\u0441\u044c.\u00a0<\/p>\n<p>\u0412\u0441\u0435 \u043c\u044b \u0432 \u043a\u043e\u0434\u0435 \u0432\u0438\u0434\u0435\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438\u0437 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0434\u0438\u0438.\u00a0<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u00a0<strong>\u0421\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e<\/strong>:  <\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"\"><\/figure>\n<p>\u041d\u0430 \u0441\u0442\u0430\u0434\u0438\u0438 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f pet \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 play, \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0422\u0438\u043f\u0430\u0445<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><\/figure>\n<p>\u0421\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0442\u043e\u043c, \u043d\u0430 \u043a\u0430\u043a\u0438\u0435 \u0442\u0438\u043f\u044b \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u0434, \u0432 \u043a\u0430\u043a\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u043e\u043d\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u044b. <\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0412\u044b\u0437\u043e\u0432\u0430\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><\/figure>\n<p>\u041c\u043e\u0436\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 <em>meow<\/em>, \u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u043a\u0430\u043a\u0443\u044e \u0438\u043c\u0435\u043d\u043d\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c. \u042d\u0442\u0430 \u0441\u0442\u0430\u0434\u0438\u044f \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430. \u0422\u043a <em>meow<\/em> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c: \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043b\u0430\u0441\u0441\u0430, extension, property. \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f, \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0438\u043b\u0438 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435. \u041d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u043d\u0443\u0436\u043d\u044b\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438. <\/p>\n<\/div>\n<\/details>\n<p><strong>\u042d\u0442\u0430 \u0441\u0442\u0430\u0434\u0438\u044f \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043d\u0430 \u043f\u043e\u0445\u043e\u0436\u0438\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b<\/strong>:<\/p>\n<ul>\n<li>\n<p>\u041e\u0442\u043a\u0443\u0434\u0430 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\/\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f\/\u0442\u0438\u043f \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u0422\u043e\u0447\u043d\u043e \u043b\u0438 \u0434\u0432\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u043a \u043e\u0434\u043d\u043e\u0439 \u0438 \u0442\u043e\u0439 \u0436\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438\u043b\u0438 \u044d\u0442\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0433\u0434\u0435 \u043e\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f?<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a\u043e\u0439 \u0442\u0438\u043f \u0443 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430?  <\/p>\n<\/li>\n<\/ul>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"kotlin\">val list1 = listOf(1, 2, 3) val list2 = listOf(\"one\", \"two\", \"three\")<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c.<\/p>\n<p>\u0422\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f generic-\u0444\u0443\u043d\u043a\u0446\u0438\u044f <em>listOf<\/em><\/p>\n<pre><code class=\"kotlin\">public fun &lt;T> listOf(vararg elements: T): List&lt;T><\/code><\/pre>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u2014 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0442\u0438\u043f\u0430 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  <\/p>\n<pre><code class=\"kotlin\">val list1 = listOf(1, 2, 3)<\/code><\/pre>\n<p>\u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <em>T = Int<\/em>  <\/p>\n<pre><code class=\"kotlin\">val list2 = listOf(\"one\", \"two\", \"three\")<\/code><\/pre>\n<p>\u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u2014 <em>T = String<\/em>.  <\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"10\" id=\"10\"><\/a><\/p>\n<h3>\u042d\u0442\u0430\u043f\u044b Resolution Phase<\/h3>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f K1 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 <strong>PSI-\u0434\u0435\u0440\u0435\u0432\u0435<\/strong>, \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u044b \u0438 <strong>BindingContext<\/strong> map, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0432\u0441\u0435 \u044d\u0442\u043e \u043d\u0430 \u0431\u044d\u043a\u0435\u043d\u0434. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0431\u044d\u043a\u0435\u043d\u0434 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 IR \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>Psi2Ir<\/strong>.<\/p>\n<p>\u0412\u0441\u044f \u044d\u0442\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435 \u043d\u0430 \u0431\u044d\u043a\u0435\u043d\u0434\u0435:<\/p>\n<figure class=\"full-width\"><\/figure>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441 \u0434\u0435\u0440\u0435\u0432\u043e\u043c PSI \u0438 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 BindingContext<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043a\u0430\u043a \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 (\u0441\u0442\u0440\u043e\u043a\u0430) \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 (\u0434\u0435\u0440\u0435\u0432\u043e) \u0438 \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0443\u0437\u043b\u0443 \u0434\u0435\u0440\u0435\u0432\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f (\u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0430).<\/p>\n<figure class=\"full-width\"><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"11\" id=\"11\"><\/a><\/p>\n<h4>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b K1<\/h4>\n<p>\u041c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0441 \u0442\u0435\u043c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434-\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f K1. \u041e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0430 \u0441\u0445\u0435\u043c\u0435 K1:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0423 \u044d\u0442\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438 (<a href=\"https:\/\/kotlinlang.slack.com\/archives\/C7L3JB43G\/p1622478266038500\"><u>\u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u0414\u043c\u0438\u0442\u0440\u0438\u044f \u041d\u043e\u0432\u043e\u0436\u0438\u043b\u043e\u0432\u0430 \u0432 kotlin slack<\/u><\/a>). \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 <strong>PSI<\/strong> \u0438 <strong>BindingContext<\/strong> \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430.\u00a0<\/p>\n<p>\u0422\u043a \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043b\u0435\u043d\u0438\u0432\u044b\u043c\u0438 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u0430\u043c\u0438, \u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u0440\u044b\u0433\u0430\u0435\u0442 \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0447\u0430\u0441\u0442\u044f\u043c\u0438 \u043a\u043e\u0434\u0430, \u044d\u0442\u043e \u0441\u0432\u043e\u0434\u0438\u0442 \u043d\u0430 \u043d\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 JIT-\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438. \u041a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 resolution phase \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0431\u043e\u043b\u044c\u0448\u043e\u043c <strong>BindingContext<\/strong>, \u0438\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u0426\u041f \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u043e \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b.\u00a0<\/p>\n<p>\u0412\u0441\u0435 \u044d\u0442\u043e \u0432\u0435\u0434\u0435\u0442 \u043a \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e.<\/p>\n<p><a class=\"anchor\" name=\"12\" id=\"12\"><\/a><\/p>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f K2<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0438 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, JB \u0441\u043e\u0437\u0434\u0430\u043b\u0430 \u043d\u043e\u0432\u0443\u044e \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434-\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e <strong>K2 (Fir frontend)<\/strong>.<\/p>\n<p>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412\u043c\u0435\u0441\u0442\u043e \u0441\u0442\u0430\u0440\u044b\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 (<strong>PSI<\/strong> + <strong>BindingContext<\/strong>) \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f K2 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <strong>Fir (Frontend Intermediate Representation)<\/strong>. \u042d\u0442\u043e <strong>\u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e <\/strong>(\u0434\u0435\u0440\u0435\u0432\u043e, \u0432 \u0443\u0437\u043b\u0430\u0445 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043a \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u043a\u043e\u0434\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f). \u041e\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p><a class=\"anchor\" name=\"13\" id=\"13\"><\/a><\/p>\n<h4>\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 K2<\/h4>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u043a \u0440\u0430\u043d\u044c\u0448\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c <strong>PSI<\/strong> \u0438 <strong>BindingContext<\/strong> \u0432 Backend, \u0432 K2 \u043d\u0430 Frontend \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<ol>\n<li>\n<p><a href=\"#31\">\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 raw PSI \u043d\u0430 \u0432\u0445\u043e\u0434\u0435 (Parsing)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#32\">\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u043d\u0435\u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u043e\u0435 raw Fir-\u0434\u0435\u0440\u0435\u0432\u043e (Psi2Fir)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#33\">\u0421\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442 Fir-\u0434\u0435\u0440\u0435\u0432\u043e (Resolution + Checking)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/34\">\u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 Fir \u0432 Ir (Fir2Ir)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/35\">\u041f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 Ir \u0431\u044d\u043a\u0435\u043d\u0434\u0443\u00a0<\/a><\/p>\n<\/li>\n<\/ol>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 K2, \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0438 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u0442\u0435 \u0444\u0430\u0437\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 K1 \u0438 K2 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e.<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434\u00a0<\/p>\n<pre><code class=\"kotlin\">private val kotlinFiles = mutableListOf(1, 2, 3)<\/code><\/pre>\n<figure class=\"full-width\"><\/figure>\n<p><a class=\"anchor\" name=\"14\" id=\"14\"><\/a><\/p>\n<h3>Parsing<\/h3>\n<p><a class=\"anchor\" name=\"31\" id=\"31\"><\/a><\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0443\u0440\u043e\u0432\u043d\u044f PSI<strong> <\/strong>(\u0434\u043e \u044d\u0442\u043e\u0433\u043e K1 \u0438 K2 \u0441\u0445\u043e\u0436\u0438):<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f K1 \u043f\u0440\u043e\u0441\u0442\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u0431\u044b \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 PSI \u043d\u0430 \u0431\u044d\u043a\u0435\u043d\u0434.\u00a0<\/p>\n<p><a class=\"anchor\" name=\"15\" id=\"15\"><\/a><\/p>\n<h3>Psi2Fir<\/h3>\n<p><a class=\"anchor\" name=\"32\" id=\"32\"><\/a><\/p>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043d\u0435\u0435, K2 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0434 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c Ir. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f <strong>Fir <\/strong>\u2014 \u044d\u0442\u043e <em>mutable-<\/em>\u0434\u0435\u0440\u0435\u0432\u043e, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0435 \u0438\u0437 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043f\u0430\u0440\u0441\u0435\u0440\u0430 (PSI-\u0434\u0435\u0440\u0435\u0432\u0430):<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0422\u0443\u0442 \u0432\u0438\u0434\u043d\u043e \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u043c\u0435\u0436\u0434\u0443 PSI \u0438 raw Fir.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p><a class=\"anchor\" name=\"16\" id=\"16\"><\/a><\/p>\n<h3>Resolution<\/h3>\n<p>\u0418\u0442\u0430\u043a, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c raw FIR \u0438 \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u0430\u0435\u043c \u0435\u0433\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c. \u041e\u043d\u0438 <\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-375697","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/375697","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=375697"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/375697\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=375697"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=375697"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=375697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}