{"id":331681,"date":"2022-04-08T09:00:33","date_gmt":"2022-04-08T09:00:33","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=331681"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=331681","title":{"rendered":"<span>Cling \u2013 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 C++<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"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\/bc3\/948\/c4f\/bc3948c4fb9a7febfe09a292d6624232.jpeg\" width=\"600\" height=\"399\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bc3\/948\/c4f\/bc3948c4fb9a7febfe09a292d6624232.jpeg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<h2>\u0418\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u044f C++ \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Cling<\/h2>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f Cling, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u043e\u043f\u0435\u0440\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u043e\u0441\u0442\u044c. \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u0435\u043c\u0441\u044f \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443; \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u0435 Cling \u043a\u0430\u043a \u0443\u0441\u043b\u0443\u0433\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0445\u0432\u0430\u0441\u0442\u0430\u0435\u043c\u0441\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0434\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u043b\u0435\u0442\u0443.<\/p>\n<h3>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443<\/h3>\n<p>Cling \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u00a0\u00a0<code>LookupHelper<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0435\u0440\u0435\u0442 \u043a\u043e\u0434 C++ \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043b\u0438 \u0443\u0436\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0442\u0430\u043a \u043a\u0432\u0430\u043b\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: <\/p>\n<pre><code class=\"cpp\">[cling] #include \"cling\/Interpreter\/Interpreter.h\" [cling] #include \"cling\/Interpreter\/LookupHelper.h\" [cling] #include \"clang\/AST\/Decl.h\" [cling] struct S{}; [cling] cling::LookupHelper&amp; LH = gCling->getLookupHelper() (cling::LookupHelper &amp;) @0x7fcba3c0bfc0 [cling] auto D = LH.findScope(\"std::vector&lt;S>\",                  cling::LookupHelper::DiagSetting::NoDiagnostics) (const clang::Decl *) 0x1216bdcd8 [cling] D->getDeclKindName() (const char *) \"ClassTemplateSpecialization\"<\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435\u00a0<code>findScope<\/code>\u00a0\u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0435\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 \u0432\u0438\u0434\u0435 \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 \u0434\u043b\u044f clang. \u0418\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u043f\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044e \u0440\u0435\u0448\u0430\u0435\u0442 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u0443\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u00ab\u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0442\u043e\u0440\u043d\u044b\u0439 \u0432\u0437\u0440\u044b\u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u00bb (template combinatorial explosion). \u0418\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u043f\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044e \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u043a\u0432\u0430\u043b\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0438\u043c\u0435\u043d C++ \u0432 \u043c\u0435\u0442\u0430\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u043e\u0431\u044a\u0435\u043a\u0442\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e \u0441\u0435\u0431\u044f \u043a\u0430\u043a \u043e\u0447\u0435\u043d\u044c \u043c\u043e\u0449\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c, \u0441\u043f\u043e\u0441\u043e\u0431\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u043e\u043f\u0435\u0440\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<h3>\u042f\u0437\u044b\u043a\u043e\u0432\u0430\u044f \u0438\u043d\u0442\u0435\u0440\u043e\u043f\u0435\u0440\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044e<\/h3>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c\u00a0\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 <a href=\"https:\/\/cppyy.readthedocs.io\/\">cppyy<\/a>, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u043a\u043e\u0434\u0430 Python \u043a \u043a\u043e\u0434\u0443 \u043d\u0430 C++, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Cling. Python \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u2013 \u044d\u0442\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u043e\u043c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u043a\u043e\u0434\u043e\u043c C++ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c, \u0435\u0441\u043b\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0437\u0432\u0435\u043d\u0430 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 Cling. \u0421\u0440\u0435\u0434\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u2013 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0439 (\u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439), \u043c\u0435\u0436\u044a\u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u043e\u043d\u0438\u0436\u0430\u044e\u0449\u0435\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 (downcasting) \u0438 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 (exception mapping). \u041c\u043d\u043e\u0433\u0438\u0435 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 C++, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u044e\u0449\u0438\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 new (placement new), \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435, \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 (variadic templates), \u0442.\u0434., \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 LookupHelper.<\/p>\n<p>cppyy \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0443\u0442\u0435\u043c \u00ab\u0432\u0441\u0435\u043b\u0435\u043d\u0438\u0432\u043e\u0433\u043e\u00bb \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043a \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u043f\u0440\u0438\u0432\u044f\u0437\u043e\u043a \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043f\u0443\u0442\u0435\u043c \u043e\u0442\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u0412 \u0446\u0435\u043b\u043e\u043c \u043e\u043d \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043c\u0435\u043d\u044c\u0448\u0438\u043c\u0438 \u0438\u0437\u0434\u0435\u0440\u0436\u043a\u0430\u043c\u0438 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0430\u0445, \u0447\u0435\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, pybind11, \u0438 \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0442\u044c\u00a0<code>std::vector<\/code>\u00a0\u0447\u0435\u0440\u0435\u0437 cppyy \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 numpy \u0442\u043e\u0433\u043e \u0436\u0435 \u0442\u0438\u043f\u0430. \u0415\u0441\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0449\u0435 \u0448\u0430\u0433 \u0432\u043f\u0435\u0440\u0435\u0434, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e cppyy \u0434\u043b\u044f PyPy, \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 Python, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0445\u0432\u0430\u0441\u0442\u0430\u0442\u044c\u0441\u044f\u00a0<a href=\"https:\/\/pypy.org\/\">\u0442\u0440\u0430\u0441\u0441\u0438\u0440\u0443\u044e\u0449\u0438\u043c JIT<\/a>-\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c. \u0412\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043a\u043e\u0434\u0443 C++ \u043f\u0440\u0438 JIT \u0432 \u0441\u0442\u0438\u043b\u0435 PyPy, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044f, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043e\u043a \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438 JIT, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u0430\u0433\u0440\u0435\u0441\u0441\u0438\u0432\u043d\u0430\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f. <\/p>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043e\u0442\u0440\u0430\u0436\u0435\u043d\u0438\u044e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c\u0443 \u0432 Cling, cppyy \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0435\u043a\u0430; \u043a\u0440\u043e\u043c\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u043a \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0443 Python, \u0438\u043c\u0435\u044e\u0449\u0435\u0439\u0441\u044f \u0432 cppyy, \u044d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0432\u0438\u0441\u0435\u043b \u0431\u044b \u043e\u0442 Python. \u0422\u043e \u0435\u0441\u0442\u044c, \u043c\u043e\u0434\u0443\u043b\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 cppyy, \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043f\u0440\u0438 \u0441\u043c\u0435\u043d\u0435 \u0432\u0435\u0440\u0441\u0438\u0439 Python (\u043d\u0438 \u0434\u0430\u0436\u0435, \u0435\u0441\u043b\u0438, \u0441\u043a\u0430\u0436\u0435\u043c, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430\u043c\u0438 CPython \u0438 PyPy).<\/p>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u043f\u043b\u043e\u0442\u043d\u0430\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u043c\u0435\u0436\u0434\u0443 C++ \u0438 Python; \u0437\u0434\u0435\u0441\u044c \u0432\u0438\u0434\u043d\u0430 \u0430\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u0434\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0438 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u0441 \u043f\u0435\u0440\u0435\u043a\u0440\u0435\u0441\u0442\u043d\u044b\u043c \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435\u043c; \u0435\u0449\u0435 \u0437\u0434\u0435\u0441\u044c \u0432\u0438\u0434\u043d\u044b \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f, \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u043d\u044b\u0435 \u0434\u043b\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f (\u0432\u0441\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0437\u0434\u0435\u0441\u044c \u043d\u0435\u0442).<\/p>\n<pre><code class=\"python\">import cppyy  cppyy.cppdef(r\"\"\"\\ template&lt;typename T> class Producer { private:   T m_value;  protected:   virtual T produce_imp() = 0;  public:   Producer(const T&amp; value) : m_value(value) {}   virtual ~Producer() {}    T produce_total() { return m_value + produce_imp(); } };  class Consumer { public:   template&lt;typename T>   void consume(Producer&lt;T>&amp; p) {     std::cout &lt;&lt; \"received: \\\"\" &lt;&lt; p.produce_total() &lt;&lt; \"\\\"\\n\";   } };\"\"\")  def factory(base_v, *derived_v):   class _F(cppyy.gbl.Producer[type(base_v)]):     def __init__(self, base_v, *derived_v):       super().__init__(base_v)       self._values = derived_v      def produce_imp(self):       return type(base_v)(sum(self._values))      return _F(base_v, *derived_v)  consumer = cppyy.gbl.Consumer() for producer in [factory(*x) for x in \\                   ((\"hello \", 42), (3., 0.14, 0.0015))]:   consumer.consume(producer)<\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code class=\"bash\">python3 cppyy_demo.py received: \"hello 42\" received: \"3.1415\"<\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u043a\u043e\u0434\u0430 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u044b Python, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u0445 Python, \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0435 \u043e\u0442 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 C++, \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0442\u0438\u043f\u0430. \u041a\u043b\u0430\u0441\u0441 Python \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0434\u0430\u0435\u0442 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u044d\u043a\u0440\u0430\u043d. \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0437\u0430\u043e\u0441\u0442\u0440\u044f\u0435\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c: <\/p>\n<ul>\n<li>\n<p>Python \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043a\u043b\u0430\u0441\u0441\u044b \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0438 Cling, \u043f\u0443\u0441\u0442\u044c \u0434\u0430\u0436\u0435 \u043e\u043d\u0438 \u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 (\u0437\u0434\u0435\u0441\u044c      \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u0444\u0430\u0431\u0440\u0438\u0447\u043d\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435);<\/p>\n<\/li>\n<li>\n<p>\u0428\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b C++ \u043c\u043e\u0436\u043d\u043e \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043b\u0435\u0442\u0443 \u043f\u0440\u044f\u043c\u043e \u0438\u0437 Python, \u0432\u0437\u044f\u0432 \u0442\u0438\u043f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 (\u0442.e., \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c \u0438\u043d\u0442\u0440\u043e\u0441\u043f\u0435\u043a\u0446\u0438\u0435\u0439 \u0432\u043e \u0432\u0440\u0435\u043c\u044f      \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432 Python), \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0439      \u043a\u043b\u0430\u0441\u0441 C++ \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 Python.<\/p>\n<\/li>\n<li>\n<p>\u041c\u0435\u0436\u044a\u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f      \u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 \u0421++ \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0441\u0432\u0435\u0440\u0445 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e      \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p>\u00ab\u0417\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u044b\u0435\u00bb \u043c\u0435\u0442\u043e\u0434\u044b C++ \u0432 Python \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b,      \u043f\u0443\u0441\u0442\u044c \u0434\u0430\u0436\u0435 \u0432 Python \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 \u043d\u0435\u0442, \u0438 \u0432\u044b, \u0432 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438, \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435      \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0432 Python \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u0437 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 C++;<\/p>\n<\/li>\n<li>\n<p>\u0412\u0441\u0435 \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u044f\u043c\u043e \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb.<\/p>\n<\/li>\n<\/ul>\n<p>cppyy \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0431\u0430\u0437\u0430\u0445 \u043a\u043e\u0434\u0430 \u043f\u043e \u0444\u0438\u0437\u0438\u043a\u0435, \u0445\u0438\u043c\u0438\u0438, \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0435 \u0438 \u0431\u0438\u043e\u043b\u043e\u0433\u0438\u0438. \u0415\u0433\u043e \u043b\u0435\u0433\u043a\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 pip \u0438\u0437 PyPI (<a href=\"https:\/\/pypi.org\/project\/cppyy\/\">https:\/\/pypi.org\/project\/cppyy\/<\/a>), \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <a href=\"https:\/\/anaconda.org\/conda-forge\/cppyy\">conda<\/a>.<\/p>\n<p>\u0414\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u2013 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u044f\u0437\u044b\u043a Symmetry (SIL). \u042d\u0442\u043e \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u043e\u043b\u043a\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044f\u0437\u044b\u043a\u0430 D. \u041e\u043d \u0431\u044b\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u0434\u043b\u044f \u0432\u043d\u0443\u0442\u0440\u0438\u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438\u00a0<a href=\"https:\/\/symmetryinvestments.com\/\">Symmetry Investments<\/a>, \u0438 \u0442\u0430\u043c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f. \u041e\u0434\u043d\u0430 \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0439 SIL \u2013 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043b\u0435\u0433\u043a\u0443\u044e \u0438\u043d\u0442\u0435\u0440\u043e\u043f\u0435\u0440\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u043e \u0432\u0441\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c\u0438 \u044f\u0437\u044b\u043a\u0430\u043c\u0438 \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438. \u042d\u0442\u043e \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432. \u0414\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u043a\u043e\u0434\u0430 C++ \u044f\u0437\u044b\u043a SIL \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u043b\u0430\u0433\u0438\u043d \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c\u00a0<code>sil-cling<\/code>, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u043c \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043d\u0438\u043a \u043c\u0435\u0436\u0434\u0443 SIL \u0438 Cling. \u041e\u0434\u043d\u0430\u043a\u043e, sil-cling \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 Cling \u043d\u0435 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u0430 \u0447\u0435\u0440\u0435\u0437 cppyy-\u0431\u0435\u043a\u0435\u043d\u0434. \u042d\u0442\u043e \u043e\u0431\u0435\u0440\u0442\u043a\u0430 cppyy \u043d\u0430 C\/C++, \u043e\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0430\u044f Cling, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0439 API \u0434\u043b\u044f \u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u0438 C\/C++.<\/p>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0432\u0430 \u043a\u043e\u0440\u0435\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0437 sil-cling \u0432 SIL. \u041e\u0434\u0438\u043d \u0438\u0437 \u043d\u0438\u0445 &#8212;\u00a0<code>CPPNamespace<\/code>, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0435\u043d C++ \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u043d \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438\u0437 \u0442\u0435\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0447\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d. \u0414\u0440\u0443\u0433\u043e\u0439 &#8212; <code>ClingObj<\/code>, \u044d\u0442\u043e \u043f\u043e\u0441\u0440\u0435\u0434\u043d\u0438\u043a \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 C++, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 \u0438 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u0441 \u0447\u043b\u0435\u043d\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u0430. \u041f\u0440\u0438\u0442\u043e\u043c, \u0447\u0442\u043e cppyy \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043b\u0430\u0441\u0441\u044b, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u043d C++ \u043a\u0430\u043a \u00ab\u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438\u00bb, \u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u0438 \u043b\u044e\u0431\u044b\u0445 \u044d\u0442\u0438\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 C++ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0430\u0441\u0441\u043e\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0441 \u043d\u0438\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u00ab\u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438\u00bb, \u043e\u0431\u0430 \u043e\u0431\u0435\u0440\u0442\u043e\u0447\u043d\u044b\u0445 \u0442\u0438\u043f\u0430, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u0434\u043b\u044f SIL, \u0445\u0440\u0430\u043d\u044f\u0442 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0430\u0441\u0441\u043e\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0441 \u043d\u0438\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438. \u0422\u0430\u043a\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u044f\u043a\u0438\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043e\u0431\u0435\u0440\u0442\u043e\u0447\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u043a\u043e\u0434\u0430 C++.<\/p>\n<p>\u0412\u0441\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0438\u0437 SIL \u0447\u0435\u0440\u0435\u0437 \u0434\u0432\u0430 \u043e\u0431\u0435\u0440\u0442\u043e\u0447\u043d\u044b\u0445 \u0442\u0438\u043f\u0430, \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e 3 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442-\u043e\u0431\u0435\u0440\u0442\u043a\u0430, \u0438\u043c\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 C++, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0438 (\u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e) \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043e\u043a \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432, sil-cling \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e cppyy, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u0435\u0440\u043d\u0435\u0442 \u0432\u044b\u0437\u043e\u0432 \u0438 \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0438\u0437\u0443\u0435\u0442 \u0435\u0433\u043e \u0432 Cling \u0434\u043b\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438. \u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 sil-cling \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0442\u0430\u043a\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a C++ \u043a\u0430\u043a\u00a0<code>Boost.Asio<\/code>,\u00a0<code>dlib<\/code>\u00a0\u0438\u043b\u0438\u00a0<code>Xapian<\/code>.<\/p>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u043b\u0438\u0435\u043d\u0442-\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Boost Asio, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u043d\u0430 SIL \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u0430 sil-cling. Server.sil \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u043e\u0434 SIL \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u041e\u043d \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u044b\u0445 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438\u00a0<code>cppCompile<\/code>. \u041d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0448\u0430\u0433\u0435 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u043e\u0431\u0435\u0440\u0442\u043e\u0447\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0434\u043b\u044f \u0442\u0435\u0445 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432 \u0438\u043c\u0435\u043d, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b, \u0438 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043f\u0443\u0442\u0435\u043c \u0432\u044b\u0437\u043e\u0432\u0430 cppNamespace \u0441 \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u0442\u0435\u0445 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432, \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f. \u042d\u0442\u0438 \u043e\u0431\u0435\u0440\u0442\u043a\u0438 CPPNamespace \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 \u0442\u0435\u0445 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432 \u0438\u043c\u0435\u043d C++, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u044d\u0442\u0438\u0445 \u043e\u0431\u0435\u0440\u0442\u043a\u0430\u0445 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u044b. \u041f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0442\u0430\u043a\u0438\u0445 \u043e\u0431\u0435\u0440\u0442\u043e\u043a \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0439 \u0441\u043e\u043a\u0435\u0442 (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043b\u0443\u0448\u0430\u0435\u0442 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f) \u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u043e\u043a\u0435\u0442 (\u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u044e \u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c). \u0417\u0430\u0442\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440 \u0434\u043e\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0438, \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u0438\u0435\u043d\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0441\u044f, \u0441\u0435\u0440\u0432\u0435\u0440 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u044d\u0442\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0442\u043a\u043b\u0438\u043a.<\/p>\n<pre><code class=\"cpp\">\/\/ Server.sil import * from silcling import format from format  cppCompile (\"#include &lt;boost\/asio.hpp>\") cppCompile (\"#include \\\"helper.hpp\\\"\")  \/\/ \u041e\u0431\u0435\u0440\u0442\u043a\u0438 CPPNamespace  asio = cppNamespace(\"boost::asio\") tcp = cppNamespace(\"boost::asio::ip::tcp\") helpers = cppNamespace(\"helpme\")  \/\/ \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u0435\u0440\u0442\u043e\u043a \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432 \u0438\u043c\u0435\u043d \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 - \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f ClingObj(s) ioService = asio.obj(\"io_service\") endpoint = tcp.obj(\"endpoint\", tcp.v4(), 9999)  \/\/ \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0439 \u0441\u043e\u043a\u0435\u0442 \u2013 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f acceptorSocket = tcp.obj(\"acceptor\", ioService, endpoint) \/\/ \u0410\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u043e\u043a\u0435\u0442 \u2013 \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u044f \u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c activeSocket = tcp.obj(\"socket\", ioService)  \/\/ \u041e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 activeSocket \u0434\u043b\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c helpers.accept(acceptorSocket, activeSocket)  \/\/ \u041e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f message = helpers.getData(activeSocket); print(format(\"[Server]: Received \\\"%s\\\" from client.\", message.getString()))  \/\/ \u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0442\u043a\u043b\u0438\u043a reply = \"Hello \\'\" ~ message.getString() ~ \"\\'!\" helpers.sendData(activeSocket, reply) print(format(\"[Server]: Sent \\\"%s\\\" to client.\", reply))<\/code><\/pre>\n<p>Client.sil \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u043e\u0434 SIL \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u043e \u0441\u0435\u0440\u0432\u0435\u0440, \u043e\u043d \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438, \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043e\u0431\u0435\u0440\u0442\u043a\u0438 \u0434\u043b\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432 \u0438\u043c\u0435\u043d \u0438 \u0434\u0430\u043b\u0435\u0435 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0438 \u0441\u043e\u043a\u0435\u0442\u0430. \u0417\u0430\u0442\u0435\u043c \u043a\u043b\u0438\u0435\u043d\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0438 \u0436\u0434\u0435\u0442, \u043f\u043e\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0442\u0432\u0435\u0442\u0438\u0442. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u0432\u0435\u0442 \u043f\u0440\u0438\u0434\u0435\u0442, \u043a\u043b\u0438\u0435\u043d\u0442 \u0432\u044b\u0432\u0435\u0434\u0435\u0442 \u0435\u0433\u043e \u043d\u0430 \u044d\u043a\u0440\u0430\u043d.<\/p>\n<pre><code class=\"cpp\">\/\/ Client.sil import * from silcling import format from format  cppCompile (\"#include &lt;boost\/asio.hpp>\") cppCompile (\"#include \\\"helper.hpp\\\"\")  asio = cppNamespace(\"boost::asio\") tcp = cppNamespace(\"boost::asio::ip::tcp\") helpers = cppNamespace(\"helpme\")  \/\/ \u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 &lt;-> address::static_method() \u0438\u043b\u0438 address::static_member address = classScope(\"boost::asio::ip::address\")  ioService = asio.obj(\"io_service\") endpoint = tcp.obj(\"endpoint\", address.from_string(\"127.0.0.1\"), 9999)  \/\/ \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043e\u043a\u0435\u0442\u0430 client_socket = tcp.obj(\"socket\", ioService) \/\/ \u0421\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 client_socket.connect(endpoint)  message = \"demo\" helpers.sendData(client_socket, message) print(format(\"[Client]: Sent \\\"%s\\\" to server.\", message))  message = helpers.getData(client_socket);<\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code class=\"bash\">[Client]: Sent \"demo\" to server. [Server]: Received \"demo\" from client. [Server]: Sent \"Hello demo\" to client. [Client]: Received \"Hello demo\" from server.<\/code><\/pre>\n<h3>\u0418\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\/\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043a\u0430\u043a \u0443\u0441\u043b\u0443\u0433\u0430<\/h3>\n<p>Cling, \u0442\u043e\u0447\u043d\u043e \u043a\u0430\u043a \u0438 Clang, \u0443\u0441\u0442\u0440\u043e\u0435\u043d \u0442\u0430\u043a, \u0447\u0442\u043e \u0438\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e, \u043a\u0430\u043a \u0438\u043d\u043a\u043e\u0440\u043f\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c libCling \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043d\u0430 C++. Cling \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044e, \u043a\u0430\u043a \u0443\u0441\u043b\u0443\u0433\u0443 \u2013 \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u043b\u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 C++. \u0412 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0439 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u043e\u0433\u0443\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 C++<strong>:<\/strong><\/p>\n<ul>\n<li>\n<p><code>callCompiledFn<\/code>\u00a0\u2013 cling-demo.cpp      \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e\u00a0<code>aGlobal<\/code>; \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0434\u043b\u044f \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439      \u0442\u043e\u0447\u043a\u043e\u0439,\u00a0<code>anotherGlobal<\/code>; \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u0430. \u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442      <code>interp<\/code>\u00a0\u2013 \u044d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0440\u0430\u043d\u0435\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 Cling. \u0422\u043e\u0447\u043d\u043e \u043a\u0430\u043a \u0438 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u043c C++, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0442\u044c \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435      \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0443, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0442\u043e\u043c \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u0417\u0430\u0442\u0435\u043c      \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043e\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c,      \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u043e\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0435 Cling\u00a0<code>Value<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0431\u043c\u0435\u043d\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439      \u043c\u0435\u0436\u0434\u0443 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u043c \u043a\u043e\u0434\u043e\u043c.<\/p>\n<\/li>\n<li>\n<p><code>callInterpretedFn<\/code>\u00a0\u2013 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u00a0<code>callCompiledFn<\/code>, \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u0443\u044e      \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0432 Cling \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c      \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u0441\u043a\u0430\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u043c\u0435\u043d\u0438. \u0414\u0430\u043b\u0435\u0435 \u0432 \u0432\u044b\u0437\u043e\u0432\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 C++.<\/p>\n<\/li>\n<li>\n<p><code>modifyCompiledValue<\/code>\u00a0\u2013 Cling \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442 C++, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0435      \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0434 \u043f\u0430\u043c\u044f\u0442\u044c\u044e, \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u043e\u0439 \u0432 \u0441\u0442\u0435\u043a\u0435. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u043c \u0443 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430      \u0430\u0434\u0440\u0435\u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 loc      \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u0438\u043a\u0430\u0436\u0435\u043c      \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0443 \u043f\u0440\u044f\u043c\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432\u043e\u0437\u0432\u0435\u0441\u0442\u0438 \u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043a\u0432\u0430\u0434\u0440\u0430\u0442.<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cpp\">\/\/ cling-demo.cpp \/\/ g++ ... cling-demo.cpp; .\/cling-demo #include &lt;cling\/Interpreter\/Interpreter.h> #include &lt;cling\/Interpreter\/Value.h> #include &lt;cling\/Utils\/Casting.h> #include &lt;iostream> #include &lt;string> #include &lt;sstream>  \/\/\/ \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0439, \u0442\u0430\u043a\u0436\u0435 \u0432\u043d\u0435\u0434\u0440\u044f\u0435\u043c\u044b\u0445 \u0432 cling. \/\/\/ \u041f\u0420\u0418\u041c\u0415\u0427\u0410\u041d\u0418\u0415: \u044d\u0442\u043e \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 #included, \u0438 \u0432 cling, \u043d\u043e \/\/\/ \u0440\u0430\u0434\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u043e\u0431\u044a\u044f\u0432\u0438\u043c \u0438\u0445 \u0437\u0434\u0435\u0441\u044c. int aGlobal = 42; static float anotherGlobal = 3.141; float getAnotherGlobal() { return anotherGlobal; } void setAnotherGlobal(float val) { anotherGlobal = val; }  \/\/\/\\brief Call compiled functions from the interpreter. void callCompiledFn(cling::Interpreter&amp; interp) {   \/\/ We could use a header, too...   interp.declare(\"int aGlobal;\\n\"                  \"float getAnotherGlobal();\\n\"                  \"void setAnotherGlobal(float val);\\n\");    cling::Value res; \/\/ \u0411\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f.   interp.process(\"aGlobal;\", &amp;res);   std::cout &lt;&lt; \"aGlobal is \" &lt;&lt; res.getAs&lt;long long>() &lt;&lt; '\\n';   interp.process(\"getAnotherGlobal();\", &amp;res);   std::cout &lt;&lt; \"getAnotherGlobal() returned \" &lt;&lt; res.getAs&lt;float>() &lt;&lt; '\\n';    setAnotherGlobal(1.); \/\/ \u043c\u044b \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435,   interp.process(\"getAnotherGlobal();\", &amp;res); \/\/ \u0432\u0438\u0434\u0438\u0442 \u043b\u0438 \u044d\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440?   std::cout &lt;&lt; \"getAnotherGlobal() returned \" &lt;&lt; res.getAs&lt;float>() &lt;&lt; '\\n';    \/\/ \u0418\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430, \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u0438\u0434\u0438\u0442 \u043d\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.   interp.process(\"setAnotherGlobal(7.777); getAnotherGlobal();\");   std::cout &lt;&lt; \"getAnotherGlobal() returned \" &lt;&lt; getAnotherGlobal() &lt;&lt; '\\n'; }  \/\/\/ \u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e \u0435\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443. void callInterpretedFn(cling::Interpreter&amp; interp) {   \/\/ \u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0443. \u0414\u0435\u043b\u0430\u0435\u043c \u0435\u0435 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0434\u043b\u044f \"C\", \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442   \/\/ \u0438\u0441\u043a\u0430\u0436\u0435\u043d\u0438\u044f \u0438\u043c\u0435\u043d.   interp.declare(\"extern \\\"C\\\" int plutification(int siss, int sat) \"                  \"{ return siss * sat; }\");   void* addr = interp.getAddressOfGlobal(\"plutification\");   using func_t = int(int, int);   func_t* pFunc = cling::utils::VoidToFunctionPtr&lt;func_t*>(addr);   std::cout &lt;&lt; \"7 * 8 = \" &lt;&lt; pFunc(7, 8) &lt;&lt; '\\n'; }  \/\/\/ \u041f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432 cling \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043a\u0430\u043a \u0441\u0442\u0440\u043e\u043a\u0443. void modifyCompiledValue(cling::Interpreter&amp; interp) {   int loc = 17; \/\/ \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043e    \/\/ \u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 loc, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f \u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0443.   std::ostringstream sstr;   \/\/ \u0432 Windows, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0434 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043f\u0440\u0435\u0444\u0438\u043a\u0441 '0x',   \/\/ \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c: std::hex &lt;&lt; std::showbase &lt;&lt; (size_t)pointer   sstr &lt;&lt; \"int&amp; ref = *(int*)\" &lt;&lt; std::hex &lt;&lt; std::showbase &lt;&lt; (size_t)&amp;loc &lt;&lt; ';';   sstr &lt;&lt; \"ref = ref * ref;\";   interp.process(sstr.str());   std::cout &lt;&lt; \"The square of 17 is \" &lt;&lt; loc &lt;&lt; '\\n'; }  int main(int argc, const char* const* argv) {   \/\/ \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440. LLVMDIR \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a -D \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438.   cling::Interpreter interp(argc, argv, LLVMDIR);    callCompiledFn(interp);   callInterpretedFn(interp);   modifyCompiledValue(interp);    return 0; }<\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code class=\"bash\">.\/cling-demo aGlobal is 42 getAnotherGlobal() returned 3.141 getAnotherGlobal() returned 1 getAnotherGlobal() returned 7.777 7 * 8 = 56 The square of 17 is 289<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u044f \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c\u044b\u043c \u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u043c\u044b \u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u0443\u044e \u0432 Clang \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 (ABI) \u0445\u043e\u0441\u0442-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0421 \u0433\u043e\u0434\u0430\u043c\u0438 \u044d\u0442\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043e\u0431\u0440\u0435\u043b\u0430 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0441\u0442\u044c \u043a\u0430\u043a \u0432 Unix, \u0442\u0430\u043a \u0438 \u0432 Windows, \u0445\u043e\u0442\u044f, Cling \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0431\u0430\u0437\u0430\u043c\u0438 \u043a\u043e\u0434\u0430, \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 GCC \u0438 \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u0435\u043d \u043a \u043d\u0435\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044f\u043c ABI \u043c\u0435\u0436\u0434\u0443 GCC \u0438 Cling \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 Itanium ABI. <\/p>\n<h3>\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f<\/h3>\n<p>Cling, \u0442\u043e\u0447\u043d\u043e \u043a\u0430\u043a \u0438 Clang, \u043f\u043e\u0434\u0434\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044e \u043f\u043b\u0430\u0433\u0438\u043d\u0430\u043c\u0438. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f Cling \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0434\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u044d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/compiler-research.org\/clad\/\">Clad<\/a>. Clad \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0435 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e Clang \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0435 \u0438 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u044b \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 Cling \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c -fplugin \u0438 \u043f\u0443\u0442\u044c \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u043f\u043b\u0430\u0433\u0438\u043d\u0443. \u0417\u0430\u0442\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0446\u0435\u043b\u0435\u0432\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e pow2 \u0438 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u0435\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u0443\u044e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0435\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430.<\/p>\n<pre><code class=\"cpp\">#include &lt;cling\/Interpreter\/Interpreter.h> #include &lt;cling\/Interpreter\/Value.h>  \/\/ \u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0435 \u043a\u0430\u043a \u0443\u0441\u043b\u0443\u0433\u0430.  void gimme_pow2dx(cling::Interpreter &amp;interp) {   \/\/ Definitions of declarations injected also into cling.   interp.declare(\"double pow2(double x) { return x*x; }\");   interp.declare(\"#include &lt;clad\/Differentiator\/Differentiator.h>\");   interp.declare(\"auto dfdx = clad::differentiate(pow2, 0);\");    cling::Value res; \/\/ \u0417\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f    interp.process(\"dfdx.getFunctionPtr();\", &amp;res);    using func_t = double(double);   func_t* pFunc = res.getAs&lt;func_t*>();   printf(\"dfdx at 1 = %f\\n\", pFunc(1)); }  int main(int argc, const char* const* argv) {  std::vector&lt;const char*> argvExt(argv, argv+argc);   argvExt.push_back(\"-fplugin=etc\/cling\/plugins\/lib\/clad.dylib\");   \/\/ \u0421\u043e\u0437\u0434\u0430\u0435\u0442 cling. LLVMDIR \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a -D \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438.   cling::Interpreter interp(argvExt.size(), &amp;argvExt[0], LLVMDIR);   gimme_pow2dx(interp);   return 0; }<\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code class=\"bash\">.\/clad-demo dfdx at 1 = 2.000000<\/code><\/pre>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041c\u044b \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 Cling, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0435 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u043f\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044e, \u0438\u043d\u043a\u043e\u0440\u043f\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u043c \u043a\u043e\u0434\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430. \u041b\u0435\u043d\u0438\u0432\u043e\u0435 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0432\u043e \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u043e\u043c \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0438\u043b\u044c\u043d\u043e \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u043e\u043f\u0435\u0440\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441 C++. \u0420\u0430\u0441\u0448\u0438\u0440\u044f\u044f \u0442\u0430\u043a\u043e\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0442\u0430\u043a\u043e\u0439 \u043d\u0443\u0436\u043d\u044b\u0439 \u0432\u044b\u0445\u043e\u0434 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u043d\u0430\u0443\u0447\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0448\u0438\u0440\u043e\u043a\u0438\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<h3>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u043e\u0441\u0442\u0438<\/h3>\n<p>\u0410\u0432\u0442\u043e\u0440 \u0432\u044b\u0440\u0430\u0436\u0430\u0435\u0442 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u043e\u0441\u0442\u0438 \u0421\u0438\u043b\u044c\u0432\u0435\u0439\u043d\u0443 \u041a\u043e\u0440\u043b\u0435\u044e (Sylvain Corlay), \u0421\u0438\u043c\u0435\u043e\u043d\u0443 \u042d\u0440\u0438\u0433\u0443 (Simeon Ehrig), \u0414\u044d\u0432\u0438\u0434\u0443 \u041b\u0430\u043d\u0436\u0443 (David Lange), \u041a\u0440\u0438\u0441\u0443 \u041b\u0430\u0442\u0442\u043d\u0435\u0440\u0443 (Chris Lattner), \u0425\u0430\u0432\u044c\u0435\u0440\u0443 \u041b\u043e\u043f\u0435\u0441\u0443 \u0413\u043e\u043c\u0435\u0441\u0443 (Javier Lopez Gomez), \u0412\u0438\u043c\u0443 \u041b\u0430\u0432\u0440\u0438\u0439\u0441\u0435\u043d\u0443 (Wim Lavrijsen), \u0410\u043a\u0441\u0435\u043b\u044e \u041d\u0430\u0443\u043c\u0430\u043d\u043d\u0443 (Axel Naumann), \u0410\u043b\u0435\u043a\u0441\u0430\u043d\u0434\u0440\u0443 \u041f\u0435\u043d\u0435\u0432\u0443 (Alexander Penev), \u0425\u0430\u0432\u044c\u0435\u0440\u0443 \u0412\u0430\u043b\u043b\u044c\u0441\u0443 \u041f\u043b\u0430 (Xavier Valls Pla), \u0420\u0438\u0447\u0430\u0440\u0434\u0443 \u0421\u043c\u0438\u0442\u0443 (Richard Smith), \u041c\u0430\u0440\u0442\u0438\u043d\u0443 \u0412\u0430\u0441\u0438\u043b\u044c\u0435\u0432\u0443 (Martin Vassilev), \u0418\u043e\u0430\u043d\u0435 \u0418\u0444\u0440\u0438\u043c (Ioana Ifrim), \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0432\u0448\u0438\u043c \u0432 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/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\/company\/piter\/blog\/659733\/\"> https:\/\/habr.com\/ru\/company\/piter\/blog\/659733\/<\/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_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h2>\u0418\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u044f C++ \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Cling<\/h2>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f Cling, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u043e\u043f\u0435\u0440\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u043e\u0441\u0442\u044c. \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u0435\u043c\u0441\u044f \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443; \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u0435 Cling \u043a\u0430\u043a \u0443\u0441\u043b\u0443\u0433\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0445\u0432\u0430\u0441\u0442\u0430\u0435\u043c\u0441\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0434\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u043b\u0435\u0442\u0443.<\/p>\n<h3>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443<\/h3>\n<p>Cling \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u00a0\u00a0<code>LookupHelper<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0435\u0440\u0435\u0442 \u043a\u043e\u0434 C++ \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043b\u0438 \u0443\u0436\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0442\u0430\u043a \u043a\u0432\u0430\u043b\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: <\/p>\n<pre><code class=\"cpp\">[cling] #include \"cling\/Interpreter\/Interpreter.h\" [cling] #include \"cling\/Interpreter\/LookupHelper.h\" [cling] #include \"clang\/AST\/Decl.h\" [cling] struct S{}; [cling] cling::LookupHelper&amp; LH = gCling->getLookupHelper() (cling::LookupHelper &amp;) @0x7fcba3c0bfc0 [cling] auto D = LH.findScope(\"std::vector&lt;S>\",                  cling::LookupHelper::DiagSetting::NoDiagnostics) (const clang::Decl *) 0x1216bdcd8 [cling] D->getDeclKindName() (const char *) \"ClassTemplateSpecialization\"<\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435\u00a0<code>findScope<\/code>\u00a0\u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0435\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 \u0432\u0438\u0434\u0435 \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 \u0434\u043b\u044f clang. \u0418\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u043f\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044e \u0440\u0435\u0448\u0430\u0435\u0442 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u0443\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u00ab\u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0442\u043e\u0440\u043d\u044b\u0439 \u0432\u0437\u0440\u044b\u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u00bb (template combinatorial explosion). \u0418\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u043f\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044e \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u043a\u0432\u0430\u043b\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0438\u043c\u0435\u043d C++ \u0432 \u043c\u0435\u0442\u0430\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u043e\u0431\u044a\u0435\u043a\u0442\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e \u0441\u0435\u0431\u044f \u043a\u0430\u043a \u043e\u0447\u0435\u043d\u044c \u043c\u043e\u0449\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c, \u0441\u043f\u043e\u0441\u043e\u0431\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u043e\u043f\u0435\u0440\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<h3>\u042f\u0437\u044b\u043a\u043e\u0432\u0430\u044f \u0438\u043d\u0442\u0435\u0440\u043e\u043f\u0435\u0440\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044e<\/h3>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c\u00a0\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 <a href=\"https:\/\/cppyy.readthedocs.io\/\">cppyy<\/a>, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u043a\u043e\u0434\u0430 Python \u043a \u043a\u043e\u0434\u0443 \u043d\u0430 C++, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Cling. Python \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u2013 \u044d\u0442\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u043e\u043c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u043a\u043e\u0434\u043e\u043c C++ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c, \u0435\u0441\u043b\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0437\u0432\u0435\u043d\u0430 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 Cling. \u0421\u0440\u0435\u0434\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u2013 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0439 (\u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439), \u043c\u0435\u0436\u044a\u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u043e\u043d\u0438\u0436\u0430\u044e\u0449\u0435\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 (downcasting) \u0438 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 (exception mapping). \u041c\u043d\u043e\u0433\u0438\u0435 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 C++, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u044e\u0449\u0438\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 new (placement new), \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435, \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 (variadic templates), \u0442.\u0434., \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 LookupHelper.<\/p>\n<p>cppyy \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0443\u0442\u0435\u043c \u00ab\u0432\u0441\u0435\u043b\u0435\u043d\u0438\u0432\u043e\u0433\u043e\u00bb \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043a \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u043f\u0440\u0438\u0432\u044f\u0437\u043e\u043a \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043f\u0443\u0442\u0435\u043c \u043e\u0442\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u0412 \u0446\u0435\u043b\u043e\u043c \u043e\u043d \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043c\u0435\u043d\u044c\u0448\u0438\u043c\u0438 \u0438\u0437\u0434\u0435\u0440\u0436\u043a\u0430\u043c\u0438 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0430\u0445, \u0447\u0435\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, pybind11, \u0438 \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0442\u044c\u00a0<code>std::vector<\/code>\u00a0\u0447\u0435\u0440\u0435\u0437 cppyy \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 numpy \u0442\u043e\u0433\u043e \u0436\u0435 \u0442\u0438\u043f\u0430. \u0415\u0441\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0449\u0435 \u0448\u0430\u0433 \u0432\u043f\u0435\u0440\u0435\u0434, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e cppyy \u0434\u043b\u044f PyPy, \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 Python, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0445\u0432\u0430\u0441\u0442\u0430\u0442\u044c\u0441\u044f\u00a0<a href=\"https:\/\/pypy.org\/\">\u0442\u0440\u0430\u0441\u0441\u0438\u0440\u0443\u044e\u0449\u0438\u043c JIT<\/a>-\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c. \u0412\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043a\u043e\u0434\u0443 C++ \u043f\u0440\u0438 JIT \u0432 \u0441\u0442\u0438\u043b\u0435 PyPy, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044f, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043e\u043a \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438 JIT, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u0430\u0433\u0440\u0435\u0441\u0441\u0438\u0432\u043d\u0430\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f. <\/p>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043e\u0442\u0440\u0430\u0436\u0435\u043d\u0438\u044e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c\u0443 \u0432 Cling, cppyy \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0435\u043a\u0430; \u043a\u0440\u043e\u043c\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u043a \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0443 Python, \u0438\u043c\u0435\u044e\u0449\u0435\u0439\u0441\u044f \u0432 cppyy, \u044d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0432\u0438\u0441\u0435\u043b \u0431\u044b \u043e\u0442 Python. \u0422\u043e \u0435\u0441\u0442\u044c, \u043c\u043e\u0434\u0443\u043b\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 cppyy, \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043f\u0440\u0438 \u0441\u043c\u0435\u043d\u0435 \u0432\u0435\u0440\u0441\u0438\u0439 Python (\u043d\u0438 \u0434\u0430\u0436\u0435, \u0435\u0441\u043b\u0438, \u0441\u043a\u0430\u0436\u0435\u043c, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430\u043c\u0438 CPython \u0438 PyPy).<\/p>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u043f\u043b\u043e\u0442\u043d\u0430\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u043c\u0435\u0436\u0434\u0443 C++ \u0438 Python; \u0437\u0434\u0435\u0441\u044c \u0432\u0438\u0434\u043d\u0430 \u0430\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u0434\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0438 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u0441 \u043f\u0435\u0440\u0435\u043a\u0440\u0435\u0441\u0442\u043d\u044b\u043c \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435\u043c; \u0435\u0449\u0435 \u0437\u0434\u0435\u0441\u044c \u0432\u0438\u0434\u043d\u044b \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f, \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u043d\u044b\u0435 \u0434\u043b\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f (\u0432\u0441\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0437\u0434\u0435\u0441\u044c \u043d\u0435\u0442).<\/p>\n<pre><code class=\"python\">import cppyy  cppyy.cppdef(r\"\"\"\\ template&lt;typename T> class Producer { private:   T m_value;  protected:   virtual T produce_imp() = 0;  public:   Producer(const T&amp; value) : m_value(value) {}   virtual ~Producer() {}    T produce_total() { return m_value + produce_imp(); } };  class Consumer { public:   template&lt;typename T>   void consume(Producer&lt;T>&amp; p) {     std::cout &lt;&lt; \"received: \\\"\" &lt;&lt; p.produce_total() &lt;&lt; \"\\\"\\n\";   } };\"\"\")  def factory(base_v, *derived_v):   class _F(cppyy.gbl.Producer[type(base_v)]):     def __init__(self, base_v, *derived_v):       super().__init__(base_v)       self._values = derived_v      def produce_imp(self):       return type(base_v)(sum(self._values))      return _F(base_v, *derived_v)  consumer = cppyy.gbl.Consumer() for producer in [factory(*x) for x in \\                   ((\"hello \", 42), (3., 0.14, 0.0015))]:   consumer.consume(producer)<\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code class=\"bash\">python3 cppyy_demo.py received: \"hello 42\" received: \"3.1415\"<\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u043a\u043e\u0434\u0430 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u044b Python, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u0445 Python, \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0435 \u043e\u0442 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 C++, \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0442\u0438\u043f\u0430. \u041a\u043b\u0430\u0441\u0441 Python \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0434\u0430\u0435\u0442 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u044d\u043a\u0440\u0430\u043d. \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0437\u0430\u043e\u0441\u0442\u0440\u044f\u0435\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c: <\/p>\n<ul>\n<li>\n<p>Python \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043a\u043b\u0430\u0441\u0441\u044b \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0438 Cling, \u043f\u0443\u0441\u0442\u044c \u0434\u0430\u0436\u0435 \u043e\u043d\u0438 \u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 (\u0437\u0434\u0435\u0441\u044c      \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u0444\u0430\u0431\u0440\u0438\u0447\u043d\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435);<\/p>\n<\/li>\n<li>\n<p>\u0428\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b C++ \u043c\u043e\u0436\u043d\u043e \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043b\u0435\u0442\u0443 \u043f\u0440\u044f\u043c\u043e \u0438\u0437 Python, \u0432\u0437\u044f\u0432 \u0442\u0438\u043f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 (\u0442.e., \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c \u0438\u043d\u0442\u0440\u043e\u0441\u043f\u0435\u043a\u0446\u0438\u0435\u0439 \u0432\u043e \u0432\u0440\u0435\u043c\u044f      \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432 Python), \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0439      \u043a\u043b\u0430\u0441\u0441 C++ \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 Python.<\/p>\n<\/li>\n<li>\n<p>\u041c\u0435\u0436\u044a\u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f      \u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 \u0421++ \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0441\u0432\u0435\u0440\u0445 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e      \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p>\u00ab\u0417\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u044b\u0435\u00bb \u043c\u0435\u0442\u043e\u0434\u044b C++ \u0432 Python \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b,      \u043f\u0443\u0441\u0442\u044c \u0434\u0430\u0436\u0435 \u0432 Python \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 \u043d\u0435\u0442, \u0438 \u0432\u044b, \u0432 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438, \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435      \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0432 Python \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u0437 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 C++;<\/p>\n<\/li>\n<li>\n<p>\u0412\u0441\u0435 \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u044f\u043c\u043e \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb.<\/p>\n<\/li>\n<\/ul>\n<p>cppyy \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0431\u0430\u0437\u0430\u0445 \u043a\u043e\u0434\u0430 \u043f\u043e \u0444\u0438\u0437\u0438\u043a\u0435, \u0445\u0438\u043c\u0438\u0438, \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0435 \u0438 \u0431\u0438\u043e\u043b\u043e\u0433\u0438\u0438. \u0415\u0433\u043e \u043b\u0435\u0433\u043a\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 pip \u0438\u0437 PyPI (<a href=\"https:\/\/pypi.org\/project\/cppyy\/\">https:\/\/pypi.org\/project\/cppyy\/<\/a>), \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <a href=\"https:\/\/anaconda.org\/conda-forge\/cppyy\">conda<\/a>.<\/p>\n<p>\u0414\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u2013 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u044f\u0437\u044b\u043a Symmetry (SIL). \u042d\u0442\u043e \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u043e\u043b\u043a\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044f\u0437\u044b\u043a\u0430 D. \u041e\u043d \u0431\u044b\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u0434\u043b\u044f \u0432\u043d\u0443\u0442\u0440\u0438\u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438\u00a0<a href=\"https:\/\/symmetryinvestments.com\/\">Symmetry Investments<\/a>, \u0438 \u0442\u0430\u043c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f. \u041e\u0434\u043d\u0430 \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0439 SIL \u2013 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043b\u0435\u0433\u043a\u0443\u044e \u0438\u043d\u0442\u0435\u0440\u043e\u043f\u0435\u0440\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u043e \u0432\u0441\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c\u0438 \u044f\u0437\u044b\u043a\u0430\u043c\u0438 \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438. \u042d\u0442\u043e \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432. \u0414\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u043a\u043e\u0434\u0430 C++ \u044f\u0437\u044b\u043a SIL \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u043b\u0430\u0433\u0438\u043d \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c\u00a0<code>sil-cling<\/code>, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u043c \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043d\u0438\u043a \u043c\u0435\u0436\u0434\u0443 SIL \u0438 Cling. \u041e\u0434\u043d\u0430\u043a\u043e, sil-cling \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 Cling \u043d\u0435 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u0430 \u0447\u0435\u0440\u0435\u0437 cppyy-\u0431\u0435\u043a\u0435\u043d\u0434. \u042d\u0442\u043e \u043e\u0431\u0435\u0440\u0442\u043a\u0430 cppyy \u043d\u0430 C\/C++, \u043e\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0430\u044f Cling, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0439 API \u0434\u043b\u044f \u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u0438 C\/C++.<\/p>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0432\u0430 \u043a\u043e\u0440\u0435\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0437 sil-cling \u0432 SIL. \u041e\u0434\u0438\u043d \u0438\u0437 \u043d\u0438\u0445 &#8212;\u00a0<code>CPPNamespace<\/code>, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0435\u043d C++ \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u043d \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438\u0437 \u0442\u0435\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0447\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d. \u0414\u0440\u0443\u0433\u043e\u0439 &#8212; <code>ClingObj<\/code>, \u044d\u0442\u043e \u043f\u043e\u0441\u0440\u0435\u0434\u043d\u0438\u043a \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 C++, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 \u0438 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u0441 \u0447\u043b\u0435\u043d\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u0430. \u041f\u0440\u0438\u0442\u043e\u043c, \u0447\u0442\u043e cppyy \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043b\u0430\u0441\u0441\u044b, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u043d C++ \u043a\u0430\u043a \u00ab\u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438\u00bb, \u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u0438 \u043b\u044e\u0431\u044b\u0445 \u044d\u0442\u0438\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 C++ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0430\u0441\u0441\u043e\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0441 \u043d\u0438\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u00ab\u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438\u00bb, \u043e\u0431\u0430 \u043e\u0431\u0435\u0440\u0442\u043e\u0447\u043d\u044b\u0445 \u0442\u0438\u043f\u0430, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u0434\u043b\u044f SIL, \u0445\u0440\u0430\u043d\u044f\u0442 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0430\u0441\u0441\u043e\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0441 \u043d\u0438\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438. \u0422\u0430\u043a\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u044f\u043a\u0438\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043e\u0431\u0435\u0440\u0442\u043e\u0447\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u043a\u043e\u0434\u0430 C++.<\/p>\n<p>\u0412\u0441\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0438\u0437 SIL \u0447\u0435\u0440\u0435\u0437 \u0434\u0432\u0430 \u043e\u0431\u0435\u0440\u0442\u043e\u0447\u043d\u044b\u0445 \u0442\u0438\u043f\u0430, \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e 3 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442-\u043e\u0431\u0435\u0440\u0442\u043a\u0430, \u0438\u043c\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 C++, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0438 (\u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e) \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043e\u043a \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432, sil-cling \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e cppyy, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u0435\u0440\u043d\u0435\u0442 \u0432\u044b\u0437\u043e\u0432 \u0438 \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0438\u0437\u0443\u0435\u0442 \u0435\u0433\u043e \u0432 Cling \u0434\u043b\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438. \u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 sil-cling \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0442\u0430\u043a\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a C++ \u043a\u0430\u043a\u00a0<code>Boost.Asio<\/code>,\u00a0<code>dlib<\/code>\u00a0\u0438\u043b\u0438\u00a0<code>Xapian<\/code>.<\/p>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u043b\u0438\u0435\u043d\u0442-\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Boost Asio, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u043d\u0430 SIL \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u0430 sil-cling. Server.sil \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u043e\u0434 SIL \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u041e\u043d \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u044b\u0445 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438\u00a0<code>cppCompile<\/code>. \u041d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0448\u0430\u0433\u0435 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u043e\u0431\u0435\u0440\u0442\u043e\u0447\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0434\u043b\u044f \u0442\u0435\u0445 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432 \u0438\u043c\u0435\u043d, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b, \u0438 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043f\u0443\u0442\u0435\u043c \u0432\u044b\u0437\u043e\u0432\u0430 cppNamespace \u0441 \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u0442\u0435\u0445 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432, \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f. \u042d\u0442\u0438 \u043e\u0431\u0435\u0440\u0442\u043a\u0438 CPPNamespace \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 \u0442\u0435\u0445 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432 \u0438\u043c\u0435\u043d C++, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u044d\u0442\u0438\u0445 \u043e\u0431\u0435\u0440\u0442\u043a\u0430\u0445 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u044b. \u041f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0442\u0430\u043a\u0438\u0445 \u043e\u0431\u0435\u0440\u0442\u043e\u043a \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0439 \u0441\u043e\u043a\u0435\u0442 (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043b\u0443\u0448\u0430\u0435\u0442 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f) \u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u043e\u043a\u0435\u0442 (\u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u044e \u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c). \u0417\u0430\u0442\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440 \u0434\u043e\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0438, \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u0438\u0435\u043d\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0441\u044f, \u0441\u0435\u0440\u0432\u0435\u0440 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u044d\u0442\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0442\u043a\u043b\u0438\u043a.<\/p>\n<pre><code class=\"cpp\">\/\/ Server.sil import * from silcling import format from format  cppCompile (\"#include &lt;boost\/asio.hpp>\") cppCompile (\"#include \\\"helper.hpp\\\"\")  \/\/ \u041e\u0431\u0435\u0440\u0442\u043a\u0438 CPPNamespace  asio = cppNamespace(\"boost::asio\") tcp = cppNamespace(\"boost::asio::ip::tcp\") helpers = cppNamespace(\"helpme\")  \/\/ \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u0435\u0440\u0442\u043e\u043a \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432 \u0438\u043c\u0435\u043d \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 - \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f ClingObj(s) ioService = asio.obj(\"io_service\") endpoint = tcp.obj(\"endpoint\", tcp.v4(), 9999)  \/\/ \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0439 \u0441\u043e\u043a\u0435\u0442 \u2013<\/code><\/pre>\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-331681","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/331681","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=331681"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/331681\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=331681"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=331681"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=331681"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}