{"id":362415,"date":"2024-05-21T01:34:37","date_gmt":"2024-05-21T01:34:37","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=362415"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=362415","title":{"rendered":"<span>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Nim \u0412 Python<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0441\u0432\u043e\u0439 Python \u043a\u043e\u0434 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Nim.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0443\u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430 Python \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Nim \u0438 \u0434\u0430\u0436\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u0432\u043e\u0439 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2ed\/bf8\/345\/2edbf83454087b1cd7acb6e364054e82.png\" alt=\"\u041e\u0431\u043b\u043e\u0436\u043a\u0430 \u0441\u0442\u0430\u0442\u044c\u0438\" title=\"\u041e\u0431\u043b\u043e\u0436\u043a\u0430 \u0441\u0442\u0430\u0442\u044c\u0438\" width=\"1920\" height=\"1080\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2ed\/bf8\/345\/2edbf83454087b1cd7acb6e364054e82.png\"\/><\/p>\n<div><figcaption>\u041e\u0431\u043b\u043e\u0436\u043a\u0430 \u0441\u0442\u0430\u0442\u044c\u0438<\/figcaption><\/div>\n<\/figure>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h2>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0447\u0430\u0442\u044c &#8212; \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c <a href=\"https:\/\/nim-lang.org\/install.html\" rel=\"noopener noreferrer nofollow\">Nim<\/a>. \u0415\u0441\u043b\u0438 \u043e\u043d \u0443 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c &#8212; \u043e\u0442\u043b\u0438\u0447\u043d\u043e, \u0438\u0434\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<p>\u0412\u0441\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043d\u0438\u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0441 <code>Nim 2.0.0<\/code> \u0438 \u0441 <code>Python 3.10.9<\/code>.<\/p>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 <a href=\"https:\/\/nimble.directory\/\" rel=\"noopener noreferrer nofollow\">nimble<\/a> \u0441\u0442\u0430\u0432\u0438\u043c \u043f\u0430\u043a\u0435\u0442 <a href=\"https:\/\/github.com\/yglukhov\/nimpy\" rel=\"noopener noreferrer nofollow\">nimpy<\/a>, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c Python \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430 Nim.<\/p>\n<pre><code class=\"powershell\">nimble install nimpy<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a <strong>Python<\/strong> \u0438 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043b\u044f \u0437\u0430\u043c\u0435\u0440\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <strong>\u0444\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438<\/strong>. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b <code>fib.py<\/code> \u0438 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u0430\u043c\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e.<\/p>\n<pre><code class=\"python\">def fib(n: int) -> int:     if n == 0:         return 0     elif n &lt; 3:         return 1     return fib(n - 1) + fib(n - 2)<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a <strong>Nim<\/strong> \u0438 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b <code>nimfib.nim<\/code>. \u041a\u0430\u043a \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0437\u0434\u0435\u0441\u044c?<\/p>\n<pre><code class=\"python\">import nimpy  # \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 nimpy  # \u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e fib(n)  func fib(n: int): int {.exportpy.} =   if n == 0:     return 0   elif n &lt; 3:     return 1   return fib(n - 1) + fib(n - 2)<\/code><\/pre>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0445\u043e\u0436\u0435, \u043d\u0435 \u0442\u0430\u043a \u043b\u0438? \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 <strong>python \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443<\/strong>:<\/p>\n<pre><code class=\"powershell\">nim c -o:nimfib.pyd --tlsEmulation:off --passL:-static --threads:on --app:lib -d:danger --opt:speed nimfib<\/code><\/pre>\n<p>\u042d\u0442\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b.<\/p>\n<p>\u0414\u043b\u044f <strong>Unix<\/strong> \u0441\u0438\u0441\u0442\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u044b\u0448\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code>nim c -o:nimfib.so --app:lib -d:danger --threads:on --opt:speed nimfib<\/code><\/pre>\n<blockquote>\n<p>\u041f\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>--threads:on<\/code> Nim \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c<code>--tlsEmulation:on<\/code> (\u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f Windows), \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u0440\u0435\u0434\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f Nim \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430 (\u0447\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u043c\u0435\u0435\u0442 \u043c\u0435\u0441\u0442\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0434\u0443\u043b\u044f Python).<\/p>\n<\/blockquote>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 <strong>Nim<\/strong> \u0438 <strong>Python<\/strong>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0442\u0430\u0432\u0438\u043c \u043f\u0430\u043a\u0435\u0442\u044b <a href=\"https:\/\/pypi.org\/project\/pytest\/\" rel=\"noopener noreferrer nofollow\">pytest<\/a> \u0438 <a href=\"https:\/\/pypi.org\/project\/pytest-benchmark\/\" rel=\"noopener noreferrer nofollow\">pytest-benchmark<\/a>.<\/p>\n<pre><code class=\"powershell\">pip install pytest pytest-benchmark<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b <code>main.py<\/code>:<\/p>\n<pre><code class=\"python\">from timeit import default_timer import pytest import fib import nimfib   @pytest.mark.benchmark(group=\"fibonacci\", timer=default_timer) def test_py_fib(benchmark):     result = benchmark(fib.fib, 35)  @pytest.mark.benchmark(group=\"fibonacci\", timer=default_timer) def test_nim_fib(benchmark):     result = benchmark(nimfib.fib, 35)<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u044d\u0442\u043e \u0447\u0435\u0440\u0435\u0437 <code>pytest<\/code>:<\/p>\n<pre><code class=\"powershell\">pytest main.py<\/code><\/pre>\n<p>\u0410 \u0432\u043e\u0442 \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b:<\/p>\n<pre><code>--------------------------------------------------------------------------------- benchmark 'fibonacci': 2 tests --------------------------------------------------------------------------------- Name (time in ms)            Min                   Max                  Mean             StdDev                Median                IQR            Outliers     OPS            Rounds  Iterations -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- test_nim_fib             93.4353 (1.0)        117.2837 (1.0)        102.3561 (1.0)       7.9790 (1.0)         99.2676 (1.0)      11.3069 (1.0)           3;0  9.7698 (1.0)           9           1 test_py_fib           2,986.7212 (31.97)    3,013.6137 (25.70)    2,998.6946 (29.30)    11.7603 (1.47)     3,001.7616 (30.24)    20.1307 (1.78)          3;0  0.3335 (0.03)          5           1 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  Legend:   Outliers: 1 Standard Deviation from Mean; 1.5 IQR (InterQuartile Range) from 1st Quartile and 3rd Quartile.   OPS: Operations Per Second, computed as 1 \/ Mean ====================================================================== 2 passed in 23.19s =======================================================================<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0438\u0434\u0435\u0442\u044c &#8212; <strong>Nim<\/strong>, \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432 <strong>C \u0431\u044b\u0441\u0442\u0440\u0435\u0435 Python \u0432 30 \u0440\u0430\u0437<\/strong>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c <strong>Nim<\/strong> \u0432 <strong>C++<\/strong> (\u0437\u0430\u043c\u0435\u043d\u0438\u0432 <code>nim c<\/code> \u043d\u0430 <code>nim cpp<\/code>), \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0443\u0436\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b:<\/p>\n<pre><code>--------------------------------------------------------------------------------- benchmark 'fibonacci': 2 tests --------------------------------------------------------------------------------- Name (time in ms)            Min                   Max                  Mean            StdDev                Median               IQR            Outliers       OPS            Rounds  Iterations -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- test_nim_fib              9.4439 (1.0)         14.0821 (1.0)          9.7844 (1.0)      0.7489 (1.0)          9.5708 (1.0)      0.1119 (1.0)          7;15  102.2032 (1.0)         106           1 test_py_fib           3,003.1009 (317.99)   3,016.5476 (214.21)   3,009.6761 (307.60)   5.4503 (7.28)     3,010.4404 (314.55)   8.8961 (79.50)         2;0    0.3323 (0.00)          5           1 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  Legend:   Outliers: 1 Standard Deviation from Mean; 1.5 IQR (InterQuartile Range) from 1st Quartile and 3rd Quartile.   OPS: Operations Per Second, computed as 1 \/ Mean ====================================================================== 2 passed in 23.19s ======================================================================= <\/code><\/pre>\n<p>\u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 <strong>300 \u0440\u0430\u0437<\/strong>, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u044f\u0435\u0442. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0435\u0433\u043e \u0435\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435, \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 &#8212; \u0443 Nim \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e <a href=\"https:\/\/nim-lang.org\/docs\/nimc.html#dll-generation\" rel=\"noopener noreferrer nofollow\">\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/a>.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0431\u043e\u043b\u0435\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c<\/p>\n<hr\/>\n<h2>\u0413\u043e\u0442\u043e\u0432\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/h2>\n<p>\u0415\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <a href=\"https:\/\/github.com\/yglukhov\/nimpy\" rel=\"noopener noreferrer nofollow\">nimpy<\/a> \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 <strong>Python<\/strong> \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pypi.org\/project\/faster-than-requests\/\" rel=\"noopener noreferrer nofollow\">faster-than-requests<\/a> (<a href=\"https:\/\/github.com\/juancarlospaco\/faster-than-requests\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/a>) &#8212; \u0442\u043e\u0442 \u0436\u0435 <a href=\"https:\/\/pypi.org\/project\/requests\/\" rel=\"noopener noreferrer nofollow\">requests<\/a>, \u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 Nim.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pypi.org\/project\/faster-than-csv\/\" rel=\"noopener noreferrer nofollow\">faster-than-csv<\/a> (<a href=\"https:\/\/github.com\/juancarlospaco\/faster-than-csv#faster-than-csv\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/a>) &#8212; \u0442\u043e\u0442 \u0436\u0435 <a href=\"https:\/\/docs.python.org\/3\/library\/csv.html\" rel=\"noopener noreferrer nofollow\">csv<\/a>, \u043d\u043e \u043d\u0430 Nim.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pypi.org\/project\/nimporter\/\" rel=\"noopener noreferrer nofollow\">nimporter<\/a> (<a href=\"https:\/\/github.com\/Pebaz\/Nimporter\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/a>) &#8212; \u0443\u0442\u0438\u043b\u0438\u0442\u0430, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c Nim \u0444\u0430\u0439\u043b\u044b \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432 Python. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pypi.org\/project\/happyx\/\" rel=\"noopener noreferrer nofollow\">HappyX <\/a>(<a href=\"https:\/\/github.com\/HapticX\/happyx\/tree\/master\/src\/happyx\/bindings\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/a>) &#8212; \u0432\u0435\u0431-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 Nim \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u043a\u0430\u043a \u0434\u043b\u044f Python, \u0442\u0430\u043a \u0438 \u0434\u043b\u044f NodeJS \u0438 JVM.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/qb-0\/pyMeow\/releases\/tag\/1.53.36\" rel=\"noopener noreferrer nofollow\">pyMeow<\/a> (<a href=\"https:\/\/github.com\/qb-0\/pyMeow\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/a>) &#8212; \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0447\u0438\u0442\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Raylib, Python \u0438 Nim.<\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<h2>\u041a\u043e\u0448\u043a\u0438, \u0441\u043e\u0431\u0430\u043a\u0438 \u0438 Python \u043a\u043b\u0430\u0441\u0441\u044b<\/h2>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 <strong>Nim<\/strong> \u043e\u0431\u044a\u0435\u043a\u0442 <strong>Entity<\/strong>. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b <code>entity.nim<\/code>:<\/p>\n<pre><code class=\"python\">import nimpy import strformat   type   Entity* = ref object of PyNimObjectExperimental     health: int     maxHealth: int     damage: int     name: string   proc initEntity*(name: string, health: int, damage: int = 1): Entity {.exportpy: \"create_entity\".} =   return Entity(     name: name,     health: health,     maxHealth: health,     damage: damage   )   proc isAlive*(self: Entity): bool {.exportpy: \"is_alive\".} =   return self.health > 0   proc hit*(self: Entity, other: Entity) {.exportpy.} =   # \u041f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0443\u0434\u0430\u0440\u0430   other.health -= self.damage   if other.health &lt;= 0:     echo fmt\"{other.name} \u043f\u043e\u0433\u0438\u0431 \u0432 \u0431\u043e\u044e \u043e\u0442 \u0440\u0443\u043a\u0438 {self.name} ?\"   else:     echo fmt\"{other.name} \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 {self.damage} \u0443\u0440\u043e\u043d\u0430 \u043e\u0442 {self.name} \u2694\"   proc name*(self: Entity): string {.exportpy.} =   return self.name<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c:<\/p>\n<pre><code class=\"powershell\">nim c -o:entity.pyd --tlsEmulation:off --passL:-static --app:lib entity<\/code><\/pre>\n<p>\u0418 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0432 Python:<\/p>\n<pre><code class=\"python\">import entity   dog = entity.create_entity(\"\u0421\u043e\u0431\u0430\u043a\u0430\", 10) cat = entity.create_entity(\"\u041a\u043e\u0442\", 4, 2)   while dog.is_alive() and cat.is_alive():     dog.hit(cat)     cat.hit(dog)  if dog.is_alive():     print(f\"{dog.name()} \u043e\u0434\u0435\u0440\u0436\u0430\u043b \u043f\u043e\u0431\u0435\u0434\u0443!\") else:     print(f\"{cat.name()} \u043e\u0434\u0435\u0440\u0436\u0430\u043b \u043f\u043e\u0431\u0435\u0434\u0443!\")<\/code><\/pre>\n<p>\u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c &#8212; \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0441\u043e\u0431\u0430\u043a\u0438 \u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u043b\u0438\u0448\u044c 2 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0438\u0437 \u0442\u0440\u0435\u0445, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 <code>create_entity<\/code> \u0443 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 <code>damage<\/code> \u0435\u0441\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0438 \u0432\u0438\u0434\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<pre><code>\u041a\u043e\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 1 \u0443\u0440\u043e\u043d\u0430 \u043e\u0442 \u0421\u043e\u0431\u0430\u043a\u0430 \u2694 \u0421\u043e\u0431\u0430\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 2 \u0443\u0440\u043e\u043d\u0430 \u043e\u0442 \u041a\u043e\u0442 \u2694 \u041a\u043e\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 1 \u0443\u0440\u043e\u043d\u0430 \u043e\u0442 \u0421\u043e\u0431\u0430\u043a\u0430 \u2694 \u0421\u043e\u0431\u0430\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 2 \u0443\u0440\u043e\u043d\u0430 \u043e\u0442 \u041a\u043e\u0442 \u2694 \u041a\u043e\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 1 \u0443\u0440\u043e\u043d\u0430 \u043e\u0442 \u0421\u043e\u0431\u0430\u043a\u0430 \u2694 \u0421\u043e\u0431\u0430\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 2 \u0443\u0440\u043e\u043d\u0430 \u043e\u0442 \u041a\u043e\u0442 \u2694 \u041a\u043e\u0442 \u043f\u043e\u0433\u0438\u0431 \u0432 \u0431\u043e\u044e \u043e\u0442 \u0440\u0443\u043a\u0438 \u0421\u043e\u0431\u0430\u043a\u0430 ? \u0421\u043e\u0431\u0430\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 2 \u0443\u0440\u043e\u043d\u0430 \u043e\u0442 \u041a\u043e\u0442 \u2694 \u0421\u043e\u0431\u0430\u043a\u0430 \u043e\u0434\u0435\u0440\u0436\u0430\u043b \u043f\u043e\u0431\u0435\u0434\u0443!<\/code><\/pre>\n<hr\/>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0414\u0430, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>Nim<\/strong> \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u0438 \u0434\u043b\u044f <strong>Python<\/strong>, \u043e\u0434\u043d\u0430\u043a\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u043d\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u043d\u0430 <strong>C<\/strong>\/<strong>C++<\/strong>. \u0412 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u044d\u0442\u043e \u043a\u0430\u043a\u0438\u0435-\u0442\u043e <em>\u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438<\/em>, <em>\u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u043e\u0442\u043e\u043a\u0430\u043c\u0438<\/em> \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 <em>cpu-bound \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f<\/em>.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><\/p>\n<div class=\"tm-article-poll-container\"><!--[--><\/p>\n<div class=\"tm-article-poll tm-article-poll_variant-bordered\">\n<div class=\"tm-notice tm-notice_positive tm-article-poll__notice\"><!----><\/p>\n<div class=\"tm-notice__inner\"><!----><\/p>\n<div class=\"tm-notice__content\" data-test-id=\"notice-content\"><!--[--><span>\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a rel=\"nofollow\" href=\"\/kek\/v1\/auth\/habrahabr\/?back=\/ru\/articles\/779370\/&#038;hl=ru\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/span><!--]--><\/div>\n<\/div>\n<\/div>\n<p><!--[--><\/p>\n<div class=\"tm-article-poll__header\">\u0427\u0442\u043e \u0431\u044b \u0432\u044b \u0441\u0442\u0430\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f Python?<\/div>\n<div class=\"tm-article-poll__answers\"><!--[--><\/p>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">10% <\/span><span class=\"tm-article-poll__answer-label\">Nim + nimpy\/nimporter<\/span><span class=\"tm-article-poll__answer-votes\">8<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 10%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">10% <\/span><span class=\"tm-article-poll__answer-label\">Cython<\/span><span class=\"tm-article-poll__answer-votes\">8<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 10%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">22.5% <\/span><span class=\"tm-article-poll__answer-label\">C\/C++<\/span><span class=\"tm-article-poll__answer-votes\">18<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 22.5%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">10% <\/span><span class=\"tm-article-poll__answer-label\">\u041c\u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 numba<\/span><span class=\"tm-article-poll__answer-votes\">8<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 10%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">21.25% <\/span><span class=\"tm-article-poll__answer-label\">\u041d\u0435 \u043d\u0443\u0436\u0434\u0430\u044e\u0441\u044c \u0432 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0438 \u043a\u043e\u0434\u0430<\/span><span class=\"tm-article-poll__answer-votes\">17<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 21.25%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent tm-article-poll__answer-percent_winning\">26.25% <\/span><span class=\"tm-article-poll__answer-label\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b<\/span><span class=\"tm-article-poll__answer-votes\">21<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress tm-article-poll__answer-progress_winning\" style=\"width: 26.25%\"><\/div>\n<\/div>\n<\/div>\n<p><!--]--><\/div>\n<div class=\"tm-article-poll__stats\"> \u041f\u0440\u043e\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b\u0438 80 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.   \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u043b\u0438\u0441\u044c 7 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. <\/div>\n<p><!--]--><\/div>\n<p><!--]--><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/779370\/\"> https:\/\/habr.com\/ru\/articles\/779370\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0441\u0432\u043e\u0439 Python \u043a\u043e\u0434 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Nim.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0443\u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430 Python \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Nim \u0438 \u0434\u0430\u0436\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u0432\u043e\u0439 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041e\u0431\u043b\u043e\u0436\u043a\u0430 \u0441\u0442\u0430\u0442\u044c\u0438<\/figcaption><\/div>\n<\/figure>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h2>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0447\u0430\u0442\u044c &#8212; \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c <a href=\"https:\/\/nim-lang.org\/install.html\" rel=\"noopener noreferrer nofollow\">Nim<\/a>. \u0415\u0441\u043b\u0438 \u043e\u043d \u0443 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c &#8212; \u043e\u0442\u043b\u0438\u0447\u043d\u043e, \u0438\u0434\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<p>\u0412\u0441\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043d\u0438\u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0441 <code>Nim 2.0.0<\/code> \u0438 \u0441 <code>Python 3.10.9<\/code>.<\/p>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 <a href=\"https:\/\/nimble.directory\/\" rel=\"noopener noreferrer nofollow\">nimble<\/a> \u0441\u0442\u0430\u0432\u0438\u043c \u043f\u0430\u043a\u0435\u0442 <a href=\"https:\/\/github.com\/yglukhov\/nimpy\" rel=\"noopener noreferrer nofollow\">nimpy<\/a>, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c Python \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430 Nim.<\/p>\n<pre><code class=\"powershell\">nimble install nimpy<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a <strong>Python<\/strong> \u0438 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043b\u044f \u0437\u0430\u043c\u0435\u0440\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <strong>\u0444\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438<\/strong>. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b <code>fib.py<\/code> \u0438 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u0430\u043c\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e.<\/p>\n<pre><code class=\"python\">def fib(n: int) -> int:     if n == 0:         return 0     elif n &lt; 3:         return 1     return fib(n - 1) + fib(n - 2)<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a <strong>Nim<\/strong> \u0438 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b <code>nimfib.nim<\/code>. \u041a\u0430\u043a \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0437\u0434\u0435\u0441\u044c?<\/p>\n<pre><code class=\"python\">import nimpy  # \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 nimpy  # \u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e fib(n)  func fib(n: int): int {.exportpy.} =   if n == 0:     return 0   elif n &lt; 3:     return 1   return fib(n - 1) + fib(n - 2)<\/code><\/pre>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0445\u043e\u0436\u0435, \u043d\u0435 \u0442\u0430\u043a \u043b\u0438? \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 <strong>python \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443<\/strong>:<\/p>\n<pre><code class=\"powershell\">nim c -o:nimfib.pyd --tlsEmulation:off --passL:-static --threads:on --app:lib -d:danger --opt:speed nimfib<\/code><\/pre>\n<p>\u042d\u0442\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b.<\/p>\n<p>\u0414\u043b\u044f <strong>Unix<\/strong> \u0441\u0438\u0441\u0442\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u044b\u0448\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code>nim c -o:nimfib.so --app:lib -d:danger --threads:on --opt:speed nimfib<\/code><\/pre>\n<blockquote>\n<p>\u041f\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>--threads:on<\/code> Nim \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c<code>--tlsEmulation:on<\/code> (\u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f Windows), \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u0440\u0435\u0434\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f Nim \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430 (\u0447\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u043c\u0435\u0435\u0442 \u043c\u0435\u0441\u0442\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0434\u0443\u043b\u044f Python).<\/p>\n<\/blockquote>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 <strong>Nim<\/strong> \u0438 <strong>Python<\/strong>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0442\u0430\u0432\u0438\u043c \u043f\u0430\u043a\u0435\u0442\u044b <a href=\"https:\/\/pypi.org\/project\/pytest\/\" rel=\"noopener noreferrer nofollow\">pytest<\/a> \u0438 <a href=\"https:\/\/pypi.org\/project\/pytest-benchmark\/\" rel=\"noopener noreferrer nofollow\">pytest-benchmark<\/a>.<\/p>\n<pre><code class=\"powershell\">pip install pytest pytest-benchmark<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b <code>main.py<\/code>:<\/p>\n<pre><code class=\"python\">from timeit import default_timer import pytest import fib import nimfib   @pytest.mark.benchmark(group=\"fibonacci\", timer=default_timer) def test_py_fib(benchmark):     result = benchmark(fib.fib, 35)  @pytest.mark.benchmark(group=\"fibonacci\", timer=default_timer) def test_nim_fib(benchmark):     result = benchmark(nimfib.fib, 35)<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u044d\u0442\u043e \u0447\u0435\u0440\u0435\u0437 <code>pytest<\/code>:<\/p>\n<pre><code class=\"powershell\">pytest main.py<\/code><\/pre>\n<p>\u0410 \u0432\u043e\u0442 \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b:<\/p>\n<pre><code>--------------------------------------------------------------------------------- benchmark 'fibonacci': 2 tests --------------------------------------------------------------------------------- Name (time in ms)            Min                   Max                  Mean             StdDev                Median                IQR            Outliers     OPS            Rounds  Iterations -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- test_nim_fib             93.4353 (1.0)        117.2837 (1.0)        102.3561 (1.0)       7.9790 (1.0)         99.2676 (1.0)      11.3069 (1.0)           3;0  9.7698 (1.0)           9           1 test_py_fib           2,986.7212 (31.97)    3,013.6137 (25.70)    2,998.6946 (29.30)    11.7603 (1.47)     3,001.7616 (30.24)    20.1307 (1.78)          3;0  0.3335 (0.03)          5           1 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  Legend:   Outliers: 1 Standard Deviation from Mean; 1.5 IQR (InterQuartile Range) from 1st Quartile and 3rd Quartile.   OPS: Operations Per Second, computed as 1 \/ Mean ====================================================================== 2 passed in 23.19s =======================================================================<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0438\u0434\u0435\u0442\u044c &#8212; <strong>Nim<\/strong>, \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432 <strong>C \u0431\u044b\u0441\u0442\u0440\u0435\u0435 Python \u0432 30 \u0440\u0430\u0437<\/strong>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c <strong>Nim<\/strong> \u0432 <strong>C++<\/strong> (\u0437\u0430\u043c\u0435\u043d\u0438\u0432 <code>nim c<\/code> \u043d\u0430 <code>nim cpp<\/code>), \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0443\u0436\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b:<\/p>\n<pre><code>--------------------------------------------------------------------------------- benchmark 'fibonacci': 2 tests --------------------------------------------------------------------------------- Name (time in ms)            Min                   Max                  Mean            StdDev                Median               IQR            Outliers       OPS            Rounds  Iterations -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- test_nim_fib              9.4439 (1.0)         14.0821 (1.0)          9.7844 (1.0)      0.7489 (1.0)          9.5708 (1.0)      0.1119 (1.0)          7;15  102.2032 (1.0)         106           1 test_py_fib           3,003.1009 (317.99)   3,016.5476 (214.21)   3,009.6761 (307.60)   5.4503 (7.28)     3,010.4404 (314.55)   8.8961 (79.50)         2;0    0.3323 (0.00)          5           1 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  Legend:   Outliers: 1 Standard Deviation from Mean; 1.5 IQR (InterQuartile Range) from 1st Quartile and 3rd Quartile.   OPS: Operations Per Second, computed as 1 \/ Mean ====================================================================== 2 passed in 23.19s ======================================================================= <\/code><\/pre>\n<p>\u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 <strong>300 \u0440\u0430\u0437<\/strong>, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u044f\u0435\u0442. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0435\u0433\u043e \u0435\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435, \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 &#8212; \u0443 Nim \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e <a href=\"https:\/\/nim-lang.org\/docs\/nimc.html#dll-generation\" rel=\"noopener noreferrer nofollow\">\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/a>.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0431\u043e\u043b\u0435\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c<\/p>\n<hr\/>\n<h2>\u0413\u043e\u0442\u043e\u0432\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/h2>\n<p>\u0415\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <a href=\"https:\/\/github.com\/yglukhov\/nimpy\" rel=\"noopener noreferrer nofollow\">nimpy<\/a> \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 <strong>Python<\/strong> \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pypi.org\/project\/faster-than-requests\/\" rel=\"noopener noreferrer nofollow\">faster-than-requests<\/a> (<a href=\"https:\/\/github.com\/juancarlospaco\/faster-than-requests\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/a>) &#8212; \u0442\u043e\u0442 \u0436\u0435 <a href=\"https:\/\/pypi.org\/project\/requests\/\" rel=\"noopener noreferrer nofollow\">requests<\/a>, \u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 Nim.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pypi.org\/project\/faster-than-csv\/\" rel=\"noopener noreferrer nofollow\">faster-than-csv<\/a> (<a href=\"https:\/\/github.com\/juancarlospaco\/faster-than-csv#faster-than-csv\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/a>) &#8212; \u0442\u043e\u0442 \u0436\u0435 <a href=\"https:\/\/docs.python.org\/3\/library\/csv.html\" rel=\"noopener noreferrer nofollow\">csv<\/a>, \u043d\u043e \u043d\u0430 Nim.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pypi.org\/project\/nimporter\/\" rel=\"noopener noreferrer nofollow\">nimporter<\/a> (<a href=\"https:\/\/github.com\/Pebaz\/Nimporter\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/a>) &#8212; \u0443\u0442\u0438\u043b\u0438\u0442\u0430, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c Nim \u0444\u0430\u0439\u043b\u044b \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432 Python. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pypi.org\/project\/happyx\/\" rel=\"noopener noreferrer nofollow\">HappyX <\/a>(<a href=\"https:\/\/github.com\/HapticX\/happyx\/tree\/master\/src\/happyx\/bindings\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/a>) &#8212; \u0432\u0435\u0431-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 Nim \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u043a\u0430\u043a \u0434\u043b\u044f Python, \u0442\u0430\u043a \u0438 \u0434\u043b\u044f NodeJS \u0438 JVM.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/qb-0\/pyMeow\/releases\/tag\/1.53.36\" rel=\"noopener noreferrer nofollow\">pyMeow<\/a> (<a href=\"https:\/\/github.com\/qb-0\/pyMeow\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/a>) &#8212; \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0447\u0438\u0442\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Raylib, Python \u0438 Nim.<\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<h2>\u041a\u043e\u0448\u043a\u0438, \u0441\u043e\u0431\u0430\u043a\u0438 \u0438 Python \u043a\u043b\u0430\u0441\u0441\u044b<\/h2>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 <strong>Nim<\/strong> \u043e\u0431\u044a\u0435\u043a\u0442 <strong>Entity<\/strong>. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b <code>entity.nim<\/code>:<\/p>\n<pre><code class=\"python\">import nimpy import strformat   type   Entity* = ref object of PyNimObjectExperimental     health: int     maxHealth: int     damage: int     name: string   proc initEntity*(name: string, health: int, damage: int = 1): Entity {.exportpy: \"create_entity\".} =   return Entity(     name: name,     health: health,     maxHealth: health,     damage: damage   )   proc isAlive*(self: Entity): bool {.exportpy: \"is_alive\".} =   return self.health > 0   proc hit*(self: Entity, other: Entity) {.exportpy.} =   # \u041f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0443\u0434\u0430\u0440\u0430   other.health -= self.damage   if other.health &lt;= 0:     echo fmt\"{other.name} \u043f\u043e\u0433\u0438\u0431 \u0432 \u0431\u043e\u044e \u043e\u0442 \u0440\u0443\u043a\u0438 {self.name} ?\"   else:     echo fmt\"{other.name} \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 {self.damage} \u0443\u0440\u043e\u043d\u0430 \u043e\u0442 {self.name} \u2694\"   proc name*(self: Entity): string {.exportpy.} =   return self.name<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c:<\/p>\n<pre><code class=\"powershell\">nim c -o:entity.pyd --tlsEmulation:off --passL:-static --app:lib entity<\/code><\/pre>\n<p>\u0418 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0432 Python:<\/p>\n<pre><code class=\"python\">import entity   dog = entity.create_entity(\"\u0421\u043e\u0431\u0430\u043a\u0430\", 10) cat = entity.create_entity(\"\u041a\u043e\u0442\", 4, 2)   while dog.is_alive() and cat.is_alive():     dog.hit(cat)     cat.hit(dog)  if dog.is_alive():     print(f\"{dog.name()} \u043e\u0434\u0435\u0440\u0436\u0430\u043b \u043f\u043e\u0431\u0435\u0434\u0443!\") else:     print(f\"{cat.name()} \u043e\u0434\u0435\u0440\u0436\u0430\u043b \u043f\u043e\u0431\u0435\u0434\u0443!\")<\/code><\/pre>\n<p>\u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c &#8212; \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0441\u043e\u0431\u0430\u043a\u0438 \u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u043b\u0438\u0448\u044c 2 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0438\u0437 \u0442\u0440\u0435\u0445, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 <code>create_entity<\/code> \u0443 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 <code>damage<\/code> \u0435\u0441\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0438 \u0432\u0438\u0434\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<pre><code>\u041a\u043e\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 1 \u0443\u0440\u043e\u043d\u0430 \u043e\u0442 \u0421\u043e\u0431\u0430\u043a\u0430 \u2694 \u0421\u043e\u0431\u0430\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 2 \u0443\u0440\u043e\u043d\u0430 \u043e\u0442 \u041a\u043e\u0442 \u2694 \u041a\u043e\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 1 \u0443\u0440\u043e\u043d\u0430 \u043e\u0442 \u0421\u043e\u0431\u0430\u043a\u0430 \u2694 \u0421\u043e\u0431\u0430\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 2 \u0443\u0440\u043e\u043d\u0430 \u043e\u0442 \u041a\u043e\u0442 \u2694 \u041a\u043e\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 1 \u0443\u0440\u043e\u043d\u0430 \u043e\u0442 \u0421\u043e\u0431\u0430\u043a\u0430 \u2694 \u0421\u043e\u0431\u0430\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 2 \u0443\u0440\u043e\u043d\u0430 \u043e\u0442 \u041a\u043e\u0442 \u2694 \u041a\u043e\u0442 \u043f\u043e\u0433\u0438\u0431 \u0432 \u0431\u043e\u044e \u043e\u0442 \u0440\u0443\u043a\u0438 \u0421\u043e\u0431\u0430\u043a\u0430 ? \u0421\u043e\u0431\u0430\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 2 \u0443\u0440\u043e\u043d\u0430 \u043e\u0442 \u041a\u043e\u0442 \u2694 \u0421\u043e\u0431\u0430\u043a\u0430 \u043e\u0434\u0435\u0440\u0436\u0430\u043b \u043f\u043e\u0431\u0435\u0434\u0443!<\/code><\/pre>\n<hr\/>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0414\u0430, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>Nim<\/strong> \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u0438 \u0434\u043b\u044f <strong>Python<\/strong>, \u043e\u0434\u043d\u0430\u043a\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u043d\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u043d\u0430 <strong>C<\/strong>\/<strong>C++<\/strong>. \u0412 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u044d\u0442\u043e \u043a\u0430\u043a\u0438\u0435-\u0442\u043e <em>\u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438<\/em>, <em>\u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u043e\u0442\u043e\u043a\u0430\u043c\u0438<\/em> \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 <em>cpu-bound \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f<\/em>.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><\/p>\n<div class=\"tm-article-poll-container\"><!--[--><\/p>\n<div class=\"tm-article-poll tm-article-poll_variant-bordered\">\n<div class=\"tm-notice tm-notice_positive tm-article-poll__notice\"><!----><\/p>\n<div class=\"tm-notice__inner\"><!----><\/p>\n<div class=\"tm-notice__content\" data-test-id=\"notice-content\"><!--[--><span>\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a rel=\"nofollow\" href=\"\/kek\/v1\/auth\/habrahabr\/?back=\/ru\/articles\/779370\/&#038;hl=ru\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/span><!--]--><\/div>\n<\/div>\n<\/div>\n<p><!--[--><\/p>\n<div class=\"tm-article-poll__header\">\u0427\u0442\u043e \u0431\u044b \u0432\u044b \u0441\u0442\u0430\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f Python?<\/div>\n<div class=\"tm-article-poll__answers\"><!--[--><\/p>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">10% <\/span><span class=\"tm-article-poll__answer-label\">Nim + nimpy\/nimporter<\/span><span class=\"tm-article-poll__answer-votes\">8<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 10%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">10% <\/span><span class=\"tm-article-poll__answer-label\">Cython<\/span><span class=\"tm-article-poll__answer-votes\">8<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 10%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">22.5% <\/span><span class=\"tm-article-poll__answer-label\">C\/C++<\/span><span class=\"tm-article-poll__answer-votes\">18<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 22.5%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">10% <\/span><span class=\"tm-article-poll__answer-label\">\u041c\u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 numba<\/span><span class=\"tm-article-poll__answer-votes\">8<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 10%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">21.25% <\/span><span class=\"tm-article-poll__answer-label\">\u041d\u0435 \u043d\u0443\u0436\u0434\u0430\u044e\u0441\u044c \u0432 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0438 \u043a\u043e\u0434\u0430<\/span><span class=\"tm-article-poll__answer-votes\">17<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 21.25%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent tm-article-poll__answer-percent_winning\">26.25% <\/span><span class=\"tm-article-poll__answer-label\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b<\/span><span class=\"tm-article-poll__answer-votes\">21<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress tm-article-poll__answer-progress_winning\" style=\"width: 26.25%\"><\/div>\n<\/div>\n<\/div>\n<p><!--]--><\/div>\n<div class=\"tm-article-poll__stats\"> \u041f\u0440\u043e\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b\u0438 80 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.   \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u043b\u0438\u0441\u044c 7 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. <\/div>\n<p><!--]--><\/div>\n<p><!--]--><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/779370\/\"> https:\/\/habr.com\/ru\/articles\/779370\/<\/a><br \/><\/br><\/br><\/p>\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-362415","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/362415","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=362415"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/362415\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=362415"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=362415"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=362415"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}