{"id":375035,"date":"2024-05-21T06:14:43","date_gmt":"2024-05-21T06:14:43","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=375035"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=375035","title":{"rendered":"<span>\u041a\u0430\u043a \u0442\u0430\u043a \u0432\u044b\u0448\u043b\u043e, \u0447\u0442\u043e \u043f\u0440\u0438 \u043b\u0438\u0448\u043d\u0435\u043c \u0448\u0430\u0433\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u043e\u0451 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Zig \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442\u0441\u044f \u0432 10 \u0440\u0430\u0437<\/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\u043e\u0442 \u0443\u0436\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0441\u044c \u0434\u0432\u0443\u043c\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f\u043c\u0438: \u044f\u0437\u044b\u043a\u043e\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Zig \u0438 \u043a\u0440\u0438\u043f\u0442\u043e\u0432\u0430\u043b\u044e\u0442\u043e\u0439 Ethereum. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u043e\u0431\u0435, \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043d\u0430 Zig <a href=\"https:\/\/github.com\/mtlynch\/eth-zvm\" rel=\"noopener noreferrer nofollow\">\u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 \u0431\u0430\u0439\u0442-\u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b Ethereum<\/a>.<\/p>\n<p>\u042f\u0437\u044b\u043a Zig \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0435\u0442\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043d\u0430\u0434 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0438 \u043f\u043e\u0442\u043e\u043a\u043e\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439. \u0427\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u0435\u0449\u0451 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435, \u044f \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u0438\u043b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u043b \u043c\u043e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e Ethereum \u0441 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043d\u0430 Go. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/785\/be4\/3de\/785be43de4a37d020520eaace772d4c5.png\" alt=\"\u0412 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u044f \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f Ethereum \u043d\u0430 Zig \u043e\u0431\u0433\u043e\u043d\u044f\u043b\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e (\u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u043d\u0430 Go) \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043d\u0430 40%.   \" title=\"\u0412 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u044f \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f Ethereum \u043d\u0430 Zig \u043e\u0431\u0433\u043e\u043d\u044f\u043b\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e (\u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u043d\u0430 Go) \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043d\u0430 40%.   \" width=\"600\" height=\"300\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/785\/be4\/3de\/785be43de4a37d020520eaace772d4c5.png\"\/><\/p>\n<div><figcaption>\u0412 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u044f \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f Ethereum \u043d\u0430 Zig \u043e\u0431\u0433\u043e\u043d\u044f\u043b\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e (\u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u043d\u0430 Go) \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043d\u0430 40%.   <\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0432\u043e\u0437\u0438\u043b\u0441\u044f \u0441 \u043c\u043e\u0438\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c \u0438, \u043a\u0430\u043a \u043c\u043d\u0435 \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0441\u0434\u0435\u043b\u0430\u043b \u0432 \u043d\u0451\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433 \u2014 \u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u044b\u043f\u0430\u043b\u0430\u0441\u044c. \u041d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f \u0441\u043c\u043e\u0433 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0432\u0441\u0451 \u0434\u0435\u043b\u043e \u0431\u044b\u043b\u043e \u0432 \u0442\u043e\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u0435 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u044d\u0442\u0438\u043c\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438:<\/p>\n<pre><code>$ echo '60016000526001601ff3' | xxd -r -p | zig build run -Doptimize=ReleaseFast execution time:  58.808\u00b5s $ echo '60016000526001601ff3' | xxd -r -p | .\/zig-out\/bin\/eth-zvm execution time:  438.059\u00b5s<\/code><\/pre>\n<p><code>zig build run<\/code>\u00a0\u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0448\u043e\u0440\u0442\u043a\u0430\u0442, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b. \u041e\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u0430 \u0434\u0432\u0443\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c: <\/p>\n<pre><code>zig build .\/zig-out\/bin\/eth-zvm<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0436\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0448\u0430\u0433 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043f\u043e\u0447\u0442\u0438 \u0432 10 \u0440\u0430\u0437\u00a0<em>\u0431\u044b\u0441\u0442\u0440\u0435\u0435<\/em>?<\/p>\n<h2>\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0430\u044f \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u044d\u0442\u043e\u0442 \u0444\u0435\u043d\u043e\u043c\u0435\u043d<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u043e\u0442\u043b\u0430\u0434\u0438\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0441\u0442\u044c \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e, \u044f \u043f\u043e\u043f\u044b\u0442\u0430\u043b\u0441\u044f \u0443\u043f\u0440\u043e\u0449\u0430\u0442\u044c \u043c\u043e\u0451 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0435 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b\u0430\u0441\u044c \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 \u0431\u0430\u0439\u0442-\u043a\u043e\u0434\u0430 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0439\u0442 \u0438 \u0447\u0438\u0442\u0430\u0435\u0442 \u0438\u0445 \u0438\u0437 stdin:<\/p>\n<pre><code class=\"rust\">\/\/ src\/main.zig  const std = @import(\"std\");  pub fn countBytes(reader: anytype) !u32 {     var count: u32 = 0;     while (true) {         _ = reader.readByte() catch |err| switch (err) {             error.EndOfStream => {                 return count;             },             else => {                 return err;             },         };         count += 1;     } }  pub fn main() !void {     var reader = std.io.getStdIn().reader();      var timer = try std.time.Timer.start();     const start = timer.lap();     const count = try countBytes(&amp;reader);     const end = timer.read();     const elapsed_micros = @as(f64, @floatFromInt(end - start)) \/ std.time.ns_per_us;      const output = std.io.getStdOut().writer();     try output.print(\"bytes:           {}\\n\", .{count});     try output.print(\"execution time:  {d:.3}\u00b5s\\n\", .{elapsed_micros}); }<\/code><\/pre>\n<p>\u041d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u0443\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0445\u043e\u0440\u043e\u0448\u043e \u0432\u0438\u0434\u043d\u0430. \u041a\u043e\u0433\u0434\u0430 \u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e \u0441\u0447\u0451\u0442\u0447\u0438\u043a \u0431\u0430\u0439\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>zig build run<\/code>, \u043e\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0437\u0430 13 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434:<\/p>\n<pre><code>$ echo '00010203040506070809' | xxd -r -p | zig build run -Doptimize=ReleaseFast bytes:           10 execution time:  13.549\u00b5s<\/code><\/pre>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u044b\u0442\u0430\u044e\u0441\u044c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a, \u043d\u0430 \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0443 \u0443\u0445\u043e\u0434\u0438\u0442 \u0432 12 \u0440\u0430\u0437 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e, 162 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434\u044b:<\/p>\n<pre><code>$ echo '00010203040506070809' | xxd -r -p | .\/zig-out\/bin\/count-bytes bytes:           10 execution time:  162.195\u00b5s<\/code><\/pre>\n<p>\u042f \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u043b \u0442\u0435\u0441\u0442 \u0438\u0437 \u0442\u0440\u0451\u0445 \u043a\u043e\u043c\u0430\u043d\u0434, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0451\u043d\u043d\u044b\u0445 \u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 bash:<\/p>\n<p>1.\u00a0\u00a0\u00a0\u00a0 <code>echo<\/code>\u00a0\u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438\u0437 \u0434\u0435\u0441\u044f\u0442\u0438 \u0431\u0430\u0439\u0442 \u0432 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u043e\u0439 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435 (0x00,\u00a00x01, \u2026).<\/p>\n<p>2.\u00a0\u00a0\u00a0\u00a0 <code>xxd<\/code>\u00a0\u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0431\u0430\u0439\u0442\u044b\u00a0echo (\u0432 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u043e\u0439 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435) \u0432 \u0431\u0430\u0439\u0442\u044b \u0432 \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0439 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435<\/p>\n<p>3.\u00a0\u00a0\u00a0\u00a0 <code>zig build run<\/code>\u00a0\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043c\u043e\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0430 \u0431\u0430\u0439\u0442, \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0430\u0439\u0442 \u0432 \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0439 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435 \u0432\u044b\u0434\u0430\u043b\u0430\u00a0<code>xxd<\/code>.<\/p>\n<p>\u0412\u0441\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443\u00a0<code>zig build run<\/code>\u00a0\u0438\u00a0<code>.\/zig-out\/bin\/count-bytes<\/code>\u00a0\u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0442\u043e\u0440\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0443\u0436\u0435 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0430 \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 \u044d\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>\u042f \u0432\u043d\u043e\u0432\u044c \u0431\u044b\u043b \u043e\u0448\u0435\u043b\u043e\u043c\u043b\u0451\u043d.<\/p>\n<p>\u041a\u0430\u043a \u0442\u0430\u043a\u043e\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u0448\u0430\u0433\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f <em>\u0431\u044b\u0441\u0442\u0440\u0435\u0435<\/em>? \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 Zig \u0431\u0435\u0433\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0431\u0443\u0434\u0443\u0447\u0438 \u00ab\u0441 \u043f\u044b\u043b\u0443-\u0441 \u0436\u0430\u0440\u0443\u00bb? <\/p>\n<h2>\u041a\u0430\u043a \u044f \u043e\u0431\u0440\u0430\u0442\u0438\u043b\u0441\u044f \u0437\u0430 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e Zig<\/h2>\n<p>\u0417\u0434\u0435\u0441\u044c \u044f \u0437\u0430\u0441\u0442\u0440\u044f\u043b. \u0421\u043d\u043e\u0432\u0430 \u0438 \u0441\u043d\u043e\u0432\u0430 \u043f\u0435\u0440\u0435\u0447\u0438\u0442\u044b\u0432\u0430\u043b \u043c\u043e\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u2014 \u0438 \u043d\u0435 \u043c\u043e\u0433 \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u043f\u0440\u0438 \u00ab\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c\u00bb \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c \u0431\u0443\u0434\u0443\u0447\u0438 \u043f\u043e\u0434\u043d\u044f\u0442\u043e \u0438\u0437 \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430.<\/p>\n<p>Zig \u2014 \u044f\u0437\u044b\u043a \u0435\u0449\u0451 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043d\u043e\u0432\u044b\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u0447\u0442\u043e \u0447\u0435\u0433\u043e-\u0442\u043e \u0432 \u043d\u0451\u043c \u044f \u043c\u043e\u0433\u0443 \u043d\u0435\u0434\u043e\u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c. \u0420\u0435\u0448\u0438\u043b, \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043c\u043e\u0439 \u043a\u043e\u0434 \u043e\u043f\u044b\u0442\u043d\u044b\u043c Zig-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430\u043c, \u043e\u043d\u0438 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043d\u0430\u0439\u0434\u0443\u0442 \u0443 \u043c\u0435\u043d\u044f \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<p>\u042f\u00a0<a href=\"https:\/\/ziggit.dev\/t\/zig-build-run-is-10x-faster-than-compiled-binary\/3446?u=mtlynch\" rel=\"noopener noreferrer nofollow\">\u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043b \u043c\u043e\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 \u043d\u0430 Ziggit<\/a>, \u044d\u0442\u043e \u0434\u0438\u0441\u043a\u0443\u0441\u0441\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u043e\u0440\u0443\u043c \u043f\u043e Zig. \u0412 \u043f\u0435\u0440\u0432\u044b\u0445 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043e\u0442\u0432\u0435\u0442\u0430\u0445 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043b\u0438, \u0447\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u00ab\u0431\u0443\u0444\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0432\u0432\u043e\u0434\u0430\u00bb, \u043d\u043e \u043d\u0435 \u0434\u0430\u043b\u0438 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0439, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0438\u043b\u0438 \u043a\u0430\u043a\u0438\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435.<\/p>\n<p>\u041a \u043c\u043e\u0435\u043c\u0443 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u044e <a href=\"https:\/\/ziggit.dev\/t\/zig-build-run-is-10x-faster-than-compiled-binary\/3446\/8?u=mtlynch\" rel=\"noopener noreferrer nofollow\">\u0432 \u0442\u0440\u0435\u0434 \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u043b<\/a> \u042d\u043d\u0434\u0440\u044e \u041a\u0435\u043b\u043b\u0438, \u043e\u0441\u043d\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0438 \u0432\u0435\u0434\u0443\u0449\u0438\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u044f\u0437\u044b\u043a\u0430 Zig. \u041e\u043d \u043d\u0435 \u0441\u043c\u043e\u0433 \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u0442\u043e\u0442 \u0444\u0435\u043d\u043e\u043c\u0435\u043d, \u0447\u0442\u043e \u044f \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u043b, \u043d\u043e \u0443\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e \u044f \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u044e \u0438\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443, \u043a\u0430\u0441\u0430\u044e\u0449\u0443\u044e\u0441\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438:<\/p>\n<p>\u00ab\u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u0432\u044b \u0434\u0435\u043b\u0430\u0435\u0442\u0435 \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u043c\u0443 \u0432\u044b\u0437\u043e\u0432\u0443 \u043d\u0430 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0431\u0430\u0439\u0442\u0430? \u041e\u0442 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441\u0442\u0440\u0430\u0434\u0430\u0435\u0442. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0443, \u0447\u0442\u043e, \u043a\u043e\u0433\u0434\u0430 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043b\u0438\u0448\u043d\u0438\u0439 \u0448\u0430\u0433, \u043d\u0430 \u044d\u0442\u043e\u043c \u0448\u0430\u0433\u0435 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0431\u0443\u0444\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044f. \u041f\u0440\u0430\u0432\u0434\u0430, \u043d\u0435 \u0443\u0432\u0435\u0440\u0435\u043d, \u043f\u043e\u0447\u0435\u043c\u0443. \u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u044b \u0444\u0430\u0439\u043b\u0430\u00bb.<\/p>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043c\u043e\u0439 \u0434\u0440\u0443\u0433\u00a0<a href=\"https:\/\/www.agwa.name\/\" rel=\"noopener noreferrer nofollow\">\u042d\u043d\u0434\u0440\u044e \u042d\u0439\u0435\u0440<\/a>\u00a0\u0437\u0430\u043c\u0435\u0442\u0438\u043b \u043c\u043e\u0439 \u043f\u043e\u0441\u0442 \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0430 Mastodon \u0438\u00a0<a href=\"https:\/\/m.mtlynch.io\/@agwa@agwa.name\/112039058255070708\" rel=\"noopener noreferrer nofollow\">\u0440\u0430\u0437\u0433\u0430\u0434\u0430\u043b \u0437\u0430\u0433\u0430\u0434\u043a\u0443<\/a>:<\/p>\n<p>\u041c\u0430\u0439\u043a\u043b, \u0432\u0438\u0434\u0438\u0448\u044c \u0434\u0435\u0441\u044f\u0442\u0438\u043a\u0440\u0430\u0442\u043d\u0443\u044e \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u0432 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430 \u0432\u0432\u043e\u0434 \u043f\u043e\u0434\u0430\u044e\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043a\u0443\u0441\u043a\u0438 (\u0441\u043a\u0430\u0436\u0435\u043c, \u0431\u043e\u043b\u0435\u0435 1 \u041c\u0411)? \u0410 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043b\u0438 \u044d\u0442\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u0430, \u0435\u0441\u043b\u0438 \u0442\u044b \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0448\u044c stdin \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u0432 \u043a\u0430\u043d\u0430\u043b \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430?<\/p>\n<p>\u0414\u0443\u043c\u0430\u044e, \u043a\u043e\u0433\u0434\u0430 \u0442\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0448\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, <code>xxd<\/code> \u0438 <code>count-bytes<\/code> \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0443\u0444\u0435\u0440 \u043a\u0430\u043d\u0430\u043b\u0430 \u043f\u0443\u0441\u0442\u0443\u0435\u0442 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 <code>count-bytes<\/code> \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438\u0437 stdin, \u0435\u043c\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0436\u0434\u0430\u0442\u044c, \u043f\u043e\u043a\u0430 xxd \u0435\u0433\u043e \u043d\u0430\u043f\u043e\u043b\u043d\u0438\u0442. \u041d\u043e, \u0435\u0441\u043b\u0438 \u0442\u044b \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0448\u044c\u0441\u044f <code>zig build run<\/code>, \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <code>xxd<\/code> \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0444\u043e\u0440\u0443 \u043f\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a \u0442\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443, \u043a\u043e\u0433\u0434\u0430 count-bytes \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c stdin, \u0431\u0443\u0444\u0435\u0440 \u043a\u0430\u043d\u0430\u043b\u0430 \u0443\u0436\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d. <\/p>\n<p>\u042d\u043d\u0434\u0440\u044e \u042d\u0439\u0435\u0440 \u0431\u044b\u043b \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043f\u0440\u0430\u0432, \u0438 \u043d\u0438\u0436\u0435 \u044f \u0440\u0430\u0437\u043b\u043e\u0436\u0443 \u044d\u0442\u0443 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e \u043f\u043e \u043f\u043e\u043b\u043e\u0447\u043a\u0430\u043c. <\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u0430 \u0435\u0449\u0451 \u042d\u043d\u0434\u0440\u044e \u042d\u0439\u0435\u0440 \u043f\u043e\u043c\u043e\u0433 \u043c\u043d\u0435 \u0440\u0430\u0437\u0433\u0430\u0434\u0430\u0442\u044c \u0438 <a href=\"https:\/\/mtlynch.io\/notes\/picoshare-perf\/#ram-bloat-is-fine-but-crashes-are-not\" rel=\"noopener noreferrer nofollow\">\u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e<\/a>.<\/p>\n<h2>\u042f \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0441\u0435\u0431\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u043b, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u044b bash<\/h2>\n<p>\u042f \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043d\u0435 \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u043b\u0441\u044f \u043e \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430\u0445 bash, \u043d\u043e, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044e \u042d\u043d\u0434\u0440\u044e, \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u0441\u0435\u0431\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u044b.<\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u0435\u0431\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 bash, \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0439:<\/p>\n<pre><code class=\"bash\">.\/jobA | .\/jobB<\/code><\/pre>\n<p>\u042f \u043f\u043e\u043b\u0430\u0433\u0430\u043b, \u0447\u0442\u043e <code>jobA<\/code>\u00a0\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f, \u0430 \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f\u00a0<code>jobB<\/code>, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0435\u0435 \u0432\u044b\u0432\u043e\u0434\u00a0<code>jobA<\/code> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0432\u043e\u0434\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e01\/8b0\/721\/e018b0721966b4c49051f4a80efe6d8b.png\" alt=\"\u0412\u043e\u0442 \u0442\u0430\u043a \u043d\u0435\u0432\u0435\u0440\u043d\u043e \u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u043b \u0441\u0435\u0431\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0435 bash   \" title=\"\u0412\u043e\u0442 \u0442\u0430\u043a \u043d\u0435\u0432\u0435\u0440\u043d\u043e \u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u043b \u0441\u0435\u0431\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0435 bash   \" width=\"573\" height=\"217\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e01\/8b0\/721\/e018b0721966b4c49051f4a80efe6d8b.png\"\/><\/p>\n<div><figcaption>\u0412\u043e\u0442 \u0442\u0430\u043a \u043d\u0435\u0432\u0435\u0440\u043d\u043e \u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u043b \u0441\u0435\u0431\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0435 bash   <\/figcaption><\/div>\n<\/figure>\n<p>\u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432\u0441\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0435 bash \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/86c\/55d\/fc7\/86c55dfc7065c93ee73f1128d88f3fd0.png\" alt=\"\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0435 bash \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0432\u043e\u0442 \u0442\u0430\u043a   \" title=\"\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0435 bash \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0432\u043e\u0442 \u0442\u0430\u043a   \" width=\"572\" height=\"219\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/86c\/55d\/fc7\/86c55dfc7065c93ee73f1128d88f3fd0.png\"\/><\/p>\n<div><figcaption>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0435 bash \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0432\u043e\u0442 \u0442\u0430\u043a   <\/figcaption><\/div>\n<\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0435 bash, \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0434\u0432\u0443\u0445 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043d\u0430 bash. \u0412\u043e\u0442 \u0447\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c.<\/p>\n<p><code>jobA<\/code>\u00a0\u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442, \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u0441\u044b\u043f\u0430\u0435\u0442 \u043d\u0430 \u0442\u0440\u0438 \u0441\u0435\u043a\u0443\u043d\u0434\u044b, \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 stdout, \u0437\u0430\u0441\u044b\u043f\u0430\u0435\u0442 \u0435\u0449\u0451 \u043d\u0430 \u0434\u0432\u0435 \u0441\u0435\u043a\u0443\u043d\u0434\u044b, \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0445\u043e\u0434\u0438\u0442:<\/p>\n<pre><code class=\"rust\">#!\/usr\/bin\/env bash  function print_status() {     local message=\"$1\"     local timestamp=$(date +\"%T.%3N\")     echo \"$timestamp $message\" >&amp;2 }  print_status 'jobA is starting'  sleep 3  echo 'result of jobA is...'  sleep 2  echo '42'  print_status 'jobA is terminating'<\/code><\/pre>\n<p><code>jobB<\/code>\u00a0\u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442, \u0436\u0434\u0451\u0442 \u0432\u0432\u043e\u0434\u0430 \u0432 stdin, \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0432\u0441\u0451, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0438\u0437 stdin, \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 stdin \u043d\u0435 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f:<\/p>\n<pre><code class=\"rust\">#!\/usr\/bin\/env bash  function print_status() {     local message=\"$1\"     local timestamp=$(date +\"%T.%3N\")     echo \"$timestamp $message\" >&amp;2 }  print_status 'jobB is starting'  print_status 'jobB is waiting on input' while read line; do   print_status \"jobB read '${line}' from input\" done &lt; \/dev\/stdin print_status 'jobB is done reading input'  print_status 'jobB is terminating'<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u00a0<code>jobA<\/code>\u00a0\u0438\u00a0<code>jobB<\/code>\u00a0\u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0435 bash, \u0440\u043e\u0432\u043d\u043e 5,009 \u0441\u0435\u043a\u0443\u043d\u0434 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 <code>jobB is starting<\/code>\u00a0\u0438\u00a0<code>jobB is terminating<\/code>:<\/p>\n<pre><code>$ .\/jobA | .\/jobB 09:11:53.326 jobA is starting 09:11:53.326 jobB is starting 09:11:53.328 jobB is waiting on input 09:11:56.330 jobB read 'result of jobA is...' from input 09:11:58.331 jobA is terminating 09:11:58.331 jobB read '42' from input 09:11:58.333 jobB is done reading input 09:11:58.335 jobB is terminating<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0442\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b\u00a0<code>jobA<\/code>\u00a0\u0438\u00a0<code>jobB<\/code>\u00a0\u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0438\u0441\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0430 \u043d\u0435 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u043d\u043e, \u0432\u0441\u0435\u0433\u043e 0,008 \u0441\u0435\u043a\u0443\u043d\u0434 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 <code>starting<\/code>\u00a0\u0438\u00a0<code>terminating<\/code>\u00a0\u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u0437\u0430\u0434\u0430\u043d\u0438\u0439:<\/p>\n<pre><code>$ .\/jobA > \/tmp\/output &amp;&amp; .\/jobB &lt; \/tmp\/output 16:52:10.406 jobA is starting 16:52:15.410 jobA is terminating 16:52:15.415 jobB is starting 16:52:15.417 jobB is waiting on input 16:52:15.418 jobB read 'result of jobA is...' from input 16:52:15.420 jobB read '42' from input 16:52:15.421 jobB is done reading input 16:52:15.423 jobB is terminating<\/code><\/pre>\n<h2>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a \u043c\u043e\u0435\u043c\u0443 \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0443 \u0431\u0430\u0439\u0442<\/h2>\n<p>\u0421\u0442\u043e\u0438\u043b\u043e \u043c\u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0432\u0441\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0435 bash \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e, \u044f \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043c\u043e\u0451\u043c \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0435 \u0431\u0430\u0439\u0442:<\/p>\n<pre><code>$ echo '00010203040506070809' | xxd -r -p | zig build run -Doptimize=ReleaseFast bytes:           10 execution time:  13.549\u00b5s  $ echo '00010203040506070809' | xxd -r -p | .\/zig-out\/bin\/count-bytes bytes:           10 execution time:  162.195\u00b5s<\/code><\/pre>\n<p>\u041f\u043e-\u0432\u0438\u0434\u0438\u043c\u043e\u043c\u0443, \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u00a0<code>echo '00010203040506070809' | xxd -r -p<\/code>\u00a0\u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430 \u0443\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 150 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434. \u0428\u0430\u0433\u00a0zig build run\u00a0\u0434\u043e\u043b\u0436\u0435\u043d \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 150 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434.<\/p>\n<p>\u041a \u0442\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443, \u043a\u0430\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u00a0<code>count-bytes<\/code>\u00a0\u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 \u0441\u00a0<code>zig build<\/code>, \u0435\u043c\u0443 \u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u043e\u0436\u0438\u0434\u0430\u0442\u044c\u0441\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u043d\u0438\u0439, \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u0440\u0430\u043d\u0435\u0435. \u0412\u0432\u043e\u0434 \u0443\u0436\u0435 \u0436\u0434\u0451\u0442 \u0435\u0433\u043e \u0432 stdin.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/55f\/ff1\/7d0\/55fff17d08465ec379b7f3c709718e8e.png\" alt=\"\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u00a0zig build run \u0435\u0441\u0442\u044c \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u043b\u044e\u0431\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u0434\u0430\u043d\u0438\u044f, \u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u0432\u0448\u0438\u0435 \u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440, \u0443\u0436\u0435 \u0443\u0441\u043f\u0435\u0432\u0430\u044e\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u043a \u0442\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443, \u043a\u0430\u043a \u043d\u0430\u0447\u043d\u0451\u0442 \u0440\u0430\u0431\u043e\u0442\u0443\u00a0count-bytes.   \" title=\"\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u00a0zig build run \u0435\u0441\u0442\u044c \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u043b\u044e\u0431\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u0434\u0430\u043d\u0438\u044f, \u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u0432\u0448\u0438\u0435 \u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440, \u0443\u0436\u0435 \u0443\u0441\u043f\u0435\u0432\u0430\u044e\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u043a \u0442\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443, \u043a\u0430\u043a \u043d\u0430\u0447\u043d\u0451\u0442 \u0440\u0430\u0431\u043e\u0442\u0443\u00a0count-bytes.   \" width=\"568\" height=\"328\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/55f\/ff1\/7d0\/55fff17d08465ec379b7f3c709718e8e.png\"\/><\/p>\n<div><figcaption>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u00a0zig build run \u0435\u0441\u0442\u044c \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u043b\u044e\u0431\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u0434\u0430\u043d\u0438\u044f, \u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u0432\u0448\u0438\u0435 \u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440, \u0443\u0436\u0435 \u0443\u0441\u043f\u0435\u0432\u0430\u044e\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u043a \u0442\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443, \u043a\u0430\u043a \u043d\u0430\u0447\u043d\u0451\u0442 \u0440\u0430\u0431\u043e\u0442\u0443\u00a0count-bytes.   <\/figcaption><\/div>\n<\/figure>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u00a0<code>zig build<\/code>\u00a0\u0438 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a, \u0442\u043e <code>count-bytes<\/code>\u00a0\u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443, \u0438 \u0442\u043e\u0433\u0434\u0430 \u0436\u0435 \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442 \u0442\u0430\u0439\u043c\u0435\u0440.\u00a0 \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e <code>count-bytes<\/code>\u00a0\u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u0445\u043e\u043b\u043e\u0441\u0442\u0443\u044e \u043e\u0436\u0438\u0434\u0430\u0442\u044c ~150 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434, \u043f\u043e\u043a\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>echo<\/code>\u00a0\u0438\u00a0<code>xxd<\/code> \u043f\u043e\u043b\u043e\u0436\u0430\u0442 \u043d\u0443\u0436\u043d\u044b\u0439 \u0432\u0432\u043e\u0434 \u0432 stdin.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/599\/767\/831\/599767831b9c5343ed4a8faf03c241c5.png\" alt=\"\u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438\u00a0count-bytes\u00a0\u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0436\u0434\u0430\u0442\u044c \u043e\u043a\u043e\u043b\u043e 150 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434, \u043f\u043e\u043a\u0430\u00a0echo\u00a0\u0438\u00a0xxd\u00a0\u0437\u0430\u043f\u0438\u0448\u0443\u0442 \u0431\u0443\u0434\u0443\u0449\u0438\u0439 \u0432\u0432\u043e\u0434 \u0432 stdin   \" title=\"\u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438\u00a0count-bytes\u00a0\u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0436\u0434\u0430\u0442\u044c \u043e\u043a\u043e\u043b\u043e 150 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434, \u043f\u043e\u043a\u0430\u00a0echo\u00a0\u0438\u00a0xxd\u00a0\u0437\u0430\u043f\u0438\u0448\u0443\u0442 \u0431\u0443\u0434\u0443\u0449\u0438\u0439 \u0432\u0432\u043e\u0434 \u0432 stdin   \" width=\"576\" height=\"299\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/599\/767\/831\/599767831b9c5343ed4a8faf03c241c5.png\"\/><\/p>\n<div><figcaption>\u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438\u00a0count-bytes\u00a0\u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0436\u0434\u0430\u0442\u044c \u043e\u043a\u043e\u043b\u043e 150 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434, \u043f\u043e\u043a\u0430\u00a0echo\u00a0\u0438\u00a0xxd\u00a0\u0437\u0430\u043f\u0438\u0448\u0443\u0442 \u0431\u0443\u0434\u0443\u0449\u0438\u0439 \u0432\u0432\u043e\u0434 \u0432 stdin   <\/figcaption><\/div>\n<\/figure>\n<h2>\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0430<\/h2>\n<p>\u0418\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c\u00a0<a href=\"https:\/\/github.com\/mtlynch\/eth-zvm\/pull\/27\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u043e\u0441\u0442\u043e<\/a>. \u042f \u0440\u0435\u0448\u0438\u043b \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430 bash, \u0430 \u0432\u044b\u043d\u0435\u0441 \u044d\u0442\u0430\u043f\u044b \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<pre><code class=\"rust\"># \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0432\u043e\u0434 \u0438\u0437 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u043e\u0439 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0438 \u0432 \u0434\u0432\u043e\u0438\u0447\u043d\u0443\u044e. $ INPUT_FILE_BINARY=\"$(mktemp)\" $ echo '60016000526001601ff3' | xxd -r -p > \"${INPUT_FILE_BINARY}\"  # \u0421\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u0432\u043e\u0434 \u0432 \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0439 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435 \u0432 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443. $ .\/zig-out\/bin\/eth-zvm &lt; \"${INPUT_FILE_BINARY}\" execution time:  67.378\u00b5s<\/code><\/pre>\n<p>\u0422\u043e\u0433\u0434\u0430 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0432\u0448\u0438\u0439\u0441\u044f \u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0432 438 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u043b\u0441\u044f \u0432\u0441\u0435\u0433\u043e \u0434\u043e 67 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434.   <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ed6\/b6e\/56c\/ed6b6e56ccf41b680415c6c393c43bc2.png\" alt=\"\u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Zig \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u044f \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043b \u043c\u043e\u0439 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438\u043d\u0433\u043e\u0432\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442   \" title=\"\u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Zig \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u044f \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043b \u043c\u043e\u0439 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438\u043d\u0433\u043e\u0432\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442   \" width=\"608\" height=\"304\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ed6\/b6e\/56c\/ed6b6e56ccf41b680415c6c393c43bc2.png\"\/><\/p>\n<div><figcaption>\u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Zig \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u044f \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043b \u043c\u043e\u0439 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438\u043d\u0433\u043e\u0432\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442   <\/figcaption><\/div>\n<\/figure>\n<h2>\u041a\u0430\u043a \u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043b \u0441\u043e\u0432\u0435\u0442\u0443 \u042d\u043d\u0434\u0440\u044e \u041a\u0435\u043b\u043b\u0438 \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c <\/h2>\n<p>\u041d\u0430\u043f\u043e\u043c\u043d\u044e: \u042d\u043d\u0434\u0440\u044e \u041a\u0435\u043b\u043b\u0438 <a href=\"https:\/\/ziggit.dev\/t\/zig-build-run-is-10x-faster-than-compiled-binary\/3446\/8?u=mtlynch\" rel=\"noopener noreferrer nofollow\">\u0443\u043a\u0430\u0437\u0430\u043b \u043c\u043d\u0435<\/a>, \u0447\u0442\u043e \u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u043c\u0443 \u0432\u044b\u0437\u043e\u0432\u0443 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u0431\u0430\u0439\u0442.<\/p>\n<pre><code class=\"rust\">... while (true) {       _ = reader.readByte() { \/\/ \u041c\u0435\u0434\u043b\u0435\u043d\u043d\u043e! \u041e\u0434\u0438\u043d \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0431\u0430\u0439\u0442!           ...       };       ...   }<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432\u0441\u044f\u043a\u0438\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0451 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u043b\u043e\u00a0readByte, \u0440\u0430\u0431\u043e\u0442\u0430\u044f \u0432 \u0446\u0438\u043a\u043b\u0435, \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043f\u0440\u0438\u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435, \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u0443 \u041e\u0421 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0432\u0432\u043e\u0434\u0430, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u043e\u0437\u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u041e\u0421 \u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u043c\u043d\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0431\u0430\u0439\u0442.<\/p>\n<p>\u0418\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443\u00a0<a href=\"https:\/\/github.com\/mtlynch\/eth-zvm\/pull\/26\" rel=\"noopener noreferrer nofollow\">\u043d\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u043e \u0442\u0440\u0443\u0434\u0430<\/a>. \u041c\u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0443\u0444\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u0440\u0438 \u0447\u0442\u0435\u043d\u0438\u0438. \u0422\u0435\u043f\u0435\u0440\u044c \u044f \u043d\u0435 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043b \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0431\u0430\u0439\u0442\u0443 \u0437\u0430 \u0440\u0430\u0437 \u0438\u0437 \u041e\u0421, \u0430 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 std.io.bufferedReader, \u0438\u043c\u0435\u044e\u0449\u0435\u0439\u0441\u044f \u0432 Zig. \u0421 \u0435\u0451 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0451 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0438\u0437 \u041e\u0421 \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u043d\u0435 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432 \u0440\u0430\u0437\u044b \u043c\u0435\u043d\u044c\u0448\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432, \u0447\u0435\u043c \u0440\u0430\u043d\u0435\u0435.<\/p>\n<p>\u0412\u043e\u0442 \u043a\u043e\u0434 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438:<\/p>\n<pre><code class=\"rust\">diff --git a\/src\/main.zig b\/src\/main.zig index d6e50b2..a46f8fa 100644 --- a\/src\/main.zig +++ b\/src\/main.zig @@ -7,7 +7,9 @@ pub fn main() !void {      const allocator = gpa.allocator();      defer _ = gpa.deinit();  -    var reader = std.io.getStdIn().reader(); +    const in = std.io.getStdIn(); +    var buf = std.io.bufferedReader(in.reader()); +    var reader = buf.reader();       var evm = vm.VM{};      evm.init(allocator);<\/code><\/pre>\n<p>\u042f \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b \u043c\u043e\u0439 \u043a\u043e\u0434 \u0438 \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0447\u0442\u043e \u043e\u043d \u0441\u0442\u0430\u043b \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0435\u0449\u0451 \u043d\u0430 11 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434, \u044d\u0442\u043e \u0432\u0435\u0441\u044c\u043c\u0430 \u0441\u043a\u0440\u043e\u043c\u043d\u043e\u0435 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u043d\u0430 16%.<\/p>\n<pre><code class=\"rust\">$ zig build -Doptimize=ReleaseFast &amp;&amp; .\/zig-out\/bin\/eth-zvm &lt; \"${INPUT_FILE_BINARY}\" execution time:  56.602\u00b5s<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4e0\/322\/f2d\/4e0322f2d40386a55e91db43c2bc5d3e.png\" alt=\"\u041f\u0440\u0438 \u0431\u0443\u0444\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0435\u0449\u0451 \u043d\u0430 16%   \" title=\"\u041f\u0440\u0438 \u0431\u0443\u0444\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0435\u0449\u0451 \u043d\u0430 16%   \" width=\"623\" height=\"304\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4e0\/322\/f2d\/4e0322f2d40386a55e91db43c2bc5d3e.png\"\/><\/p>\n<div><figcaption>\u041f\u0440\u0438 \u0431\u0443\u0444\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0435\u0449\u0451 \u043d\u0430 16%   <\/figcaption><\/div>\n<\/figure>\n<h2>\u0427\u0442\u043e, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043a\u0440\u0443\u043f\u043d\u044b\u0439 \u0432\u0432\u043e\u0434?<\/h2>\n<p>\u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043c\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 Ethereum \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043b\u0438\u0448\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0432\u0441\u0435\u0445 \u043e\u043f\u043a\u043e\u0434\u043e\u0432 Ethereum. \u0421\u0430\u043c\u044b\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043d \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u2014 \u044d\u0442\u043e \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u0435\u043b.<\/p>\n<p>\u0412\u043e\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f Ethereum, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0434\u043e \u0442\u0440\u0451\u0445, \u0442\u0440\u0438\u0436\u0434\u044b \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044f\u00a01\u00a0\u0432 \u0441\u0442\u0435\u043a, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044f \u044d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:<\/p>\n<pre><code>PUSH1 1    # \u0421\u0435\u0439\u0447\u0430\u0441 \u0441\u0442\u0435\u043a \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 [1] PUSH1 1    # \u0421\u0435\u0439\u0447\u0430\u0441 \u0441\u0442\u0435\u043a \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 [1, 1] PUSH1 1    # \u0421\u0435\u0439\u0447\u0430\u0441 \u0441\u0442\u0435\u043a \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 [1, 1, 1] ADD        # \u0421\u0435\u0439\u0447\u0430\u0441 \u0441\u0442\u0435\u043a \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 [2, 1] ADD        # \u0421\u0435\u0439\u0447\u0430\u0441 \u0441\u0442\u0435\u043a \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 [3]<\/code><\/pre>\n<p>\u0421\u0430\u043c\u043e\u0435 \u043a\u0440\u0443\u043f\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u044f \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u043b\u044f\u043b \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438 \u2014 \u044d\u0442\u043e \u0431\u0430\u0439\u0442-\u043a\u043e\u0434 Ethereum, \u0441\u0447\u0438\u0442\u0430\u044e\u0449\u0438\u0439 \u0434\u043e 1\u00a0000, \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044f \u0435\u0434\u0438\u043d\u0438\u0446\u044b.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c\u00a0<a href=\"https:\/\/github.com\/mtlynch\/eth-zvm\/pull\/26\" rel=\"noopener noreferrer nofollow\">\u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432<\/a> \u043f\u043e \u0441\u043e\u0432\u0435\u0442\u0443 \u042d\u043d\u0434\u0440\u044e \u041a\u0435\u043b\u043b\u0438, \u043c\u043e\u0439 \u00ab\u0441\u0447\u0451\u0442\u0447\u0438\u043a \u0434\u043e 1000\u00bb \u0441\u0442\u0430\u043b \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0441 \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u043d\u0435 \u0437\u0430 2\u00a0024 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434\u044b, \u043a\u0430\u043a \u0440\u0430\u043d\u0435\u0435, \u0430 \u0432\u0441\u0435\u0433\u043e \u0437\u0430 58 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434 \u2014 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u0432 35 \u0440\u0430\u0437. \u0422\u0435\u043f\u0435\u0440\u044c \u044f \u0443\u0434\u0435\u043b\u044b\u0432\u0430\u043b \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e Ethereum \u043f\u043e\u0447\u0442\u0438 \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9e9\/39f\/6b3\/9e939f6b3ebbb3174b589d307e7afe9b.png\" alt=\"\u0411\u0443\u0444\u0435\u0440\u0438\u0437\u0443\u044f \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u044f \u0443\u0441\u043a\u043e\u0440\u0438\u043b \u043c\u043e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043d\u0430 Zig \u043f\u043e\u0447\u0442\u0438 \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 Ethereum (\u0440\u0435\u0447\u044c \u043e \u0441\u0430\u043c\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0438\u0437 \u0442\u0435\u0445, \u0447\u0442\u043e \u044f \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b)   \" title=\"\u0411\u0443\u0444\u0435\u0440\u0438\u0437\u0443\u044f \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u044f \u0443\u0441\u043a\u043e\u0440\u0438\u043b \u043c\u043e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043d\u0430 Zig \u043f\u043e\u0447\u0442\u0438 \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 Ethereum (\u0440\u0435\u0447\u044c \u043e \u0441\u0430\u043c\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0438\u0437 \u0442\u0435\u0445, \u0447\u0442\u043e \u044f \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b)   \" width=\"621\" height=\"287\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9e9\/39f\/6b3\/9e939f6b3ebbb3174b589d307e7afe9b.png\"\/><\/p>\n<div><figcaption>\u0411\u0443\u0444\u0435\u0440\u0438\u0437\u0443\u044f \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u044f \u0443\u0441\u043a\u043e\u0440\u0438\u043b \u043c\u043e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043d\u0430 Zig \u043f\u043e\u0447\u0442\u0438 \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 Ethereum (\u0440\u0435\u0447\u044c \u043e \u0441\u0430\u043c\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0438\u0437 \u0442\u0435\u0445, \u0447\u0442\u043e \u044f \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b)   <\/figcaption><\/div>\n<\/figure>\n<h2>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0436\u0443\u043b\u044c\u043d\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0440\u0430\u0434\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 <\/h2>\n<p>\u042f \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0432\u043e\u043e\u0434\u0443\u0448\u0435\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0443\u0431\u0435\u0434\u0438\u043b\u0441\u044f, \u0447\u0442\u043e \u043c\u043e\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 Zig \u043d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u043f\u0440\u0435\u0432\u043e\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043d\u0430 Go. \u041d\u043e \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0435\u0449\u0451 \u0443\u0434\u0430\u0441\u0442\u0441\u044f \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f Zig.<\/p>\n<p>\u0422\u0438\u043f\u0438\u0447\u043d\u043e\u0435 \u0443\u0437\u043a\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u041f\u041e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u0430\u043c\u044f\u0442\u0438. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u0443 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u0436\u0434\u0430\u0442\u044c, \u043f\u043e\u043a\u0430 \u041e\u0421 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u0442 \u044d\u0442\u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441.<\/p>\n<p>\u0412 Zig \u0435\u0441\u0442\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u0441 \u0431\u0443\u0444\u0435\u0440\u043e\u043c \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430. \u0421 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u0443 \u041e\u0421, \u0430 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u044b\u0434\u0435\u043b\u044f\u044e\u0449\u0435\u043c\u0443 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0443 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0431\u0443\u0444\u0435\u0440 \u0441 \u0431\u0430\u0439\u0442\u0430\u043c\u0438, \u0438 \u043f\u0440\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u0438 \u0431\u0430\u0439\u0442\u044b.<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0439\u0442\u0438 \u043d\u0430 \u0445\u0438\u0442\u0440\u043e\u0441\u0442\u044c: \u044f \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043b \u0442\u0430\u043a\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 Ethereum, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0441\u0435\u0433\u043e 2 \u041a\u0411 \u043f\u0430\u043c\u044f\u0442\u0438, \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u043e\u0439 \u0438\u0437 \u0441\u0442\u0435\u043a\u0430:<\/p>\n<pre><code class=\"rust\">diff --git a\/src\/main.zig b\/src\/main.zig index a46f8fa..9e462fe 100644 --- a\/src\/main.zig +++ b\/src\/main.zig @@ -3,9 +3,9 @@ const stack = @import(\"stack.zig\");  const vm = @import(\"vm.zig\");   pub fn main() !void { -    var gpa = std.heap.GeneralPurposeAllocator(.{}){}; -    const allocator = gpa.allocator(); -    defer _ = gpa.deinit(); +    var buffer: [2000]u8 = undefined; +    var fba = std.heap.FixedBufferAllocator.init(&amp;buffer); +    const allocator = fba.allocator();       const in = std.io.getStdIn();      var buf = std.io.bufferedReader(in.reader());<\/code><\/pre>\n<p>\u041d\u0430\u0437\u044b\u0432\u0430\u044e \u044d\u0442\u043e\u0442 \u043f\u0440\u0438\u0451\u043c \u00ab\u0436\u0443\u043b\u044c\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u00bb, \u0442\u0430\u043a \u043a\u0430\u043a \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u044e \u043a\u043e\u0434 \u043f\u043e\u0434 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438. \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u043b\u044f Ethereum, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 2 \u041a\u0411 \u043f\u0430\u043c\u044f\u0442\u0438, \u043d\u043e \u043c\u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u043e, \u043a\u0430\u043a \u0441\u0438\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043e\u0433\u043d\u0430\u0442\u044c\u0441\u044f, \u0437\u0430\u043d\u0438\u043c\u0430\u044f\u0441\u044c \u0442\u0430\u043a\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0435\u0439.<\/p>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u044f \u0443\u0436\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0437\u043d\u0430\u044e, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u043c\u043d\u0435 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u043e\u0442\u0440\u0430\u0437\u0438\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438: \u00a0<\/p>\n<pre><code>$ .\/zig-out\/bin\/eth-zvm &lt; \"${COUNT_TO_1000_INPUT_BYTECODE_FILE}\" execution time:  34.4578\u00b5s<\/code><\/pre>\n<p>\u041a\u0440\u0443\u0442\u043e! \u0415\u0441\u043b\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0431\u0443\u0444\u0435\u0440 \u043f\u0430\u043c\u044f\u0442\u0438 \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c, \u043c\u043e\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 Ethereum \u043f\u0440\u043e\u0433\u043e\u043d\u044f\u0435\u0442 \u0431\u0430\u0439\u0442-\u043a\u043e\u0434 \u00ab\u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u0434\u043e 1000\u00bb \u0432\u0441\u0435\u0433\u043e \u0437\u0430 34 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434\u044b, \u0442\u043e \u0435\u0441\u0442\u044c, \u043f\u043e\u0447\u0442\u0438 \u0432\u0442\u0440\u043e\u0435 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 Go.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e74\/827\/dcf\/e74827dcfa9923a67c648adefa829f74.png\" alt=\"\u0415\u0441\u043b\u0438 \u0443\u0436\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u043c\u044f\u0442\u0438 (\u043f\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0443) \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043c\u043e\u0435\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0443 Ethereum, \u044f \u043c\u043e\u0433\u0443 \u043e\u0431\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 \u0442\u0440\u0438 \u0440\u0430\u0437\u0430   \" title=\"\u0415\u0441\u043b\u0438 \u0443\u0436\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u043c\u044f\u0442\u0438 (\u043f\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0443) \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043c\u043e\u0435\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0443 Ethereum, \u044f \u043c\u043e\u0433\u0443 \u043e\u0431\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 \u0442\u0440\u0438 \u0440\u0430\u0437\u0430   \" width=\"644\" height=\"298\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e74\/827\/dcf\/e74827dcfa9923a67c648adefa829f74.png\"\/><\/p>\n<div><figcaption>\u0415\u0441\u043b\u0438 \u0443\u0436\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u043c\u044f\u0442\u0438 (\u043f\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0443) \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043c\u043e\u0435\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0443 Ethereum, \u044f \u043c\u043e\u0433\u0443 \u043e\u0431\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 \u0442\u0440\u0438 \u0440\u0430\u0437\u0430   <\/figcaption><\/div>\n<\/figure>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412\u044b\u0432\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0434\u0435\u043b\u0430\u044e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u2014 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438\u043d\u0433 \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u043f\u043e\u0440\u0430\u043d\u044c\u0448\u0435 \u0438 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u043e\u0447\u0430\u0449\u0435.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u0432 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438\u043d\u0433\u043e\u0432\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432 \u043c\u043e\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u043e\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0438 \u0430\u0440\u0445\u0438\u0432\u0438\u0440\u0443\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b, \u044f \u043b\u0435\u0433\u043a\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0438\u0445 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438\u0441\u044c. \u0415\u0441\u043b\u0438 \u0431\u044b \u044f \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043b \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438\u043d\u0433, \u0432\u044b\u0434\u0435\u043b\u0438\u0432 \u0435\u0433\u043e \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443, \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u0443\u044e \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u0442\u043e \u043c\u043d\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u043b\u043e\u0436\u043d\u043e \u0442\u043e\u0447\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0438\u0437-\u0437\u0430 \u0447\u0435\u0433\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u0437\u0430\u043c\u0435\u0440\u0430\u0445.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u044d\u0442\u043e\u0442 \u043e\u043f\u044b\u0442 \u043f\u043e\u0434\u0447\u0451\u0440\u043a\u0438\u0432\u0430\u0435\u0442, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0442\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u0438\u0437\u043c\u0435\u0440\u044f\u0435\u0442\u0435. \u041f\u0440\u0435\u0436\u0434\u0435, \u0447\u0435\u043c \u043d\u0430\u0442\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u043d\u0430 \u044d\u0442\u043e\u0442 \u0431\u0430\u0433, \u044f \u043f\u043e\u043b\u0430\u0433\u0430\u043b, \u0447\u0442\u043e \u0432 \u043c\u043e\u0451\u043c \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0440\u0435\u043c\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u0436\u0434\u0430\u0442\u044c, \u043f\u043e\u043a\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442 stdin.<\/p>\n<h2>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/h2>\n<p><a href=\"https:\/\/github.com\/mtlynch\/eth-zvm\" rel=\"noopener noreferrer nofollow\">eth-zvm<\/a>: \u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u0430\u0448\u0438\u043d\u0430 \u0434\u043b\u044f Ethereum, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u043d\u0430 Zig   <\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/811277\/\"> https:\/\/habr.com\/ru\/articles\/811277\/<\/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\u043e\u0442 \u0443\u0436\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0441\u044c \u0434\u0432\u0443\u043c\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f\u043c\u0438: \u044f\u0437\u044b\u043a\u043e\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Zig \u0438 \u043a\u0440\u0438\u043f\u0442\u043e\u0432\u0430\u043b\u044e\u0442\u043e\u0439 Ethereum. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u043e\u0431\u0435, \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043d\u0430 Zig <a href=\"https:\/\/github.com\/mtlynch\/eth-zvm\" rel=\"noopener noreferrer nofollow\">\u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 \u0431\u0430\u0439\u0442-\u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b Ethereum<\/a>.<\/p>\n<p>\u042f\u0437\u044b\u043a Zig \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0435\u0442\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043d\u0430\u0434 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0438 \u043f\u043e\u0442\u043e\u043a\u043e\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439. \u0427\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u0435\u0449\u0451 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435, \u044f \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u0438\u043b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u043b \u043c\u043e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e Ethereum \u0441 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043d\u0430 Go. <\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0412 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u044f \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f Ethereum \u043d\u0430 Zig \u043e\u0431\u0433\u043e\u043d\u044f\u043b\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e (\u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u043d\u0430 Go) \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043d\u0430 40%.   <\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0432\u043e\u0437\u0438\u043b\u0441\u044f \u0441 \u043c\u043e\u0438\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c \u0438, \u043a\u0430\u043a \u043c\u043d\u0435 \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0441\u0434\u0435\u043b\u0430\u043b \u0432 \u043d\u0451\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433 \u2014 \u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u044b\u043f\u0430\u043b\u0430\u0441\u044c. \u041d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f \u0441\u043c\u043e\u0433 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0432\u0441\u0451 \u0434\u0435\u043b\u043e \u0431\u044b\u043b\u043e \u0432 \u0442\u043e\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u0435 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u044d\u0442\u0438\u043c\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438:<\/p>\n<pre><code>$ echo '60016000526001601ff3' | xxd -r -p | zig build run -Doptimize=ReleaseFast execution time:  58.808\u00b5s $ echo '60016000526001601ff3' | xxd -r -p | .\/zig-out\/bin\/eth-zvm execution time:  438.059\u00b5s<\/code><\/pre>\n<p><code>zig build run<\/code>\u00a0\u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0448\u043e\u0440\u0442\u043a\u0430\u0442, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b. \u041e\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u0430 \u0434\u0432\u0443\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c: <\/p>\n<pre><code>zig build .\/zig-out\/bin\/eth-zvm<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0436\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0448\u0430\u0433 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043f\u043e\u0447\u0442\u0438 \u0432 10 \u0440\u0430\u0437\u00a0<em>\u0431\u044b\u0441\u0442\u0440\u0435\u0435<\/em>?<\/p>\n<h2>\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0430\u044f \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u044d\u0442\u043e\u0442 \u0444\u0435\u043d\u043e\u043c\u0435\u043d<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u043e\u0442\u043b\u0430\u0434\u0438\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0441\u0442\u044c \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e, \u044f \u043f\u043e\u043f\u044b\u0442\u0430\u043b\u0441\u044f \u0443\u043f\u0440\u043e\u0449\u0430\u0442\u044c \u043c\u043e\u0451 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0435 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b\u0430\u0441\u044c \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 \u0431\u0430\u0439\u0442-\u043a\u043e\u0434\u0430 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0439\u0442 \u0438 \u0447\u0438\u0442\u0430\u0435\u0442 \u0438\u0445 \u0438\u0437 stdin:<\/p>\n<pre><code class=\"rust\">\/\/ src\/main.zig  const std = @import(\"std\");  pub fn countBytes(reader: anytype) !u32 {     var count: u32 = 0;     while (true) {         _ = reader.readByte() catch |err| switch (err) {             error.EndOfStream => {                 return count;             },             else => {                 return err;             },         };         count += 1;     } }  pub fn main() !void {     var reader = std.io.getStdIn().reader();      var timer = try std.time.Timer.start();     const start = timer.lap();     const count = try countBytes(&amp;reader);     const end = timer.read();     const elapsed_micros = @as(f64, @floatFromInt(end - start)) \/ std.time.ns_per_us;      const output = std.io.getStdOut().writer();     try output.print(\"bytes:           {}\\n\", .{count});     try output.print(\"execution time:  {d:.3}\u00b5s\\n\", .{elapsed_micros}); }<\/code><\/pre>\n<p>\u041d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u0443\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0445\u043e\u0440\u043e\u0448\u043e \u0432\u0438\u0434\u043d\u0430. \u041a\u043e\u0433\u0434\u0430 \u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e \u0441\u0447\u0451\u0442\u0447\u0438\u043a \u0431\u0430\u0439\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>zig build run<\/code>, \u043e\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0437\u0430 13 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434:<\/p>\n<pre><code>$ echo '00010203040506070809' | xxd -r -p | zig build run -Doptimize=ReleaseFast bytes:           10 execution time:  13.549\u00b5s<\/code><\/pre>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u044b\u0442\u0430\u044e\u0441\u044c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a, \u043d\u0430 \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0443 \u0443\u0445\u043e\u0434\u0438\u0442 \u0432 12 \u0440\u0430\u0437 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e, 162 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434\u044b:<\/p>\n<pre><code>$ echo '00010203040506070809' | xxd -r -p | .\/zig-out\/bin\/count-bytes bytes:           10 execution time:  162.195\u00b5s<\/code><\/pre>\n<p>\u042f \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u043b \u0442\u0435\u0441\u0442 \u0438\u0437 \u0442\u0440\u0451\u0445 \u043a\u043e\u043c\u0430\u043d\u0434, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0451\u043d\u043d\u044b\u0445 \u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 bash:<\/p>\n<p>1.\u00a0\u00a0\u00a0\u00a0 <code>echo<\/code>\u00a0\u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438\u0437 \u0434\u0435\u0441\u044f\u0442\u0438 \u0431\u0430\u0439\u0442 \u0432 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u043e\u0439 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435 (0x00,\u00a00x01, \u2026).<\/p>\n<p>2.\u00a0\u00a0\u00a0\u00a0 <code>xxd<\/code>\u00a0\u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0431\u0430\u0439\u0442\u044b\u00a0echo (\u0432 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u043e\u0439 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435) \u0432 \u0431\u0430\u0439\u0442\u044b \u0432 \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0439 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435<\/p>\n<p>3.\u00a0\u00a0\u00a0\u00a0 <code>zig build run<\/code>\u00a0\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043c\u043e\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0430 \u0431\u0430\u0439\u0442, \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0430\u0439\u0442 \u0432 \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0439 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435 \u0432\u044b\u0434\u0430\u043b\u0430\u00a0<code>xxd<\/code>.<\/p>\n<p>\u0412\u0441\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443\u00a0<code>zig build run<\/code>\u00a0\u0438\u00a0<code>.\/zig-out\/bin\/count-bytes<\/code>\u00a0\u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0442\u043e\u0440\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0443\u0436\u0435 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0430 \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 \u044d\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>\u042f \u0432\u043d\u043e\u0432\u044c \u0431\u044b\u043b \u043e\u0448\u0435\u043b\u043e\u043c\u043b\u0451\u043d.<\/p>\n<p>\u041a\u0430\u043a \u0442\u0430\u043a\u043e\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u0448\u0430\u0433\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f <em>\u0431\u044b\u0441\u0442\u0440\u0435\u0435<\/em>? \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 Zig \u0431\u0435\u0433\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0431\u0443\u0434\u0443\u0447\u0438 \u00ab\u0441 \u043f\u044b\u043b\u0443-\u0441 \u0436\u0430\u0440\u0443\u00bb? <\/p>\n<h2>\u041a\u0430\u043a \u044f \u043e\u0431\u0440\u0430\u0442\u0438\u043b\u0441\u044f \u0437\u0430 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e Zig<\/h2>\n<p>\u0417\u0434\u0435\u0441\u044c \u044f \u0437\u0430\u0441\u0442\u0440\u044f\u043b. \u0421\u043d\u043e\u0432\u0430 \u0438 \u0441\u043d\u043e\u0432\u0430 \u043f\u0435\u0440\u0435\u0447\u0438\u0442\u044b\u0432\u0430\u043b \u043c\u043e\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u2014 \u0438 \u043d\u0435 \u043c\u043e\u0433 \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u043f\u0440\u0438 \u00ab\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c\u00bb \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c \u0431\u0443\u0434\u0443\u0447\u0438 \u043f\u043e\u0434\u043d\u044f\u0442\u043e \u0438\u0437 \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430.<\/p>\n<p>Zig \u2014 \u044f\u0437\u044b\u043a \u0435\u0449\u0451 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043d\u043e\u0432\u044b\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u0447\u0442\u043e \u0447\u0435\u0433\u043e-\u0442\u043e \u0432 \u043d\u0451\u043c \u044f \u043c\u043e\u0433\u0443 \u043d\u0435\u0434\u043e\u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c. \u0420\u0435\u0448\u0438\u043b, \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043c\u043e\u0439 \u043a\u043e\u0434 \u043e\u043f\u044b\u0442\u043d\u044b\u043c Zig-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430\u043c, \u043e\u043d\u0438 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043d\u0430\u0439\u0434\u0443\u0442 \u0443 \u043c\u0435\u043d\u044f \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<p>\u042f\u00a0<a href=\"https:\/\/ziggit.dev\/t\/zig-build-run-is-10x-faster-than-compiled-binary\/3446?u=mtlynch\" rel=\"noopener noreferrer nofollow\">\u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043b \u043c\u043e\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 \u043d\u0430 Ziggit<\/a>, \u044d\u0442\u043e \u0434\u0438\u0441\u043a\u0443\u0441\u0441\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u043e\u0440\u0443\u043c \u043f\u043e Zig. \u0412 \u043f\u0435\u0440\u0432\u044b\u0445 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043e\u0442\u0432\u0435\u0442\u0430\u0445 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043b\u0438, \u0447\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u00ab\u0431\u0443\u0444\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0432\u0432\u043e\u0434\u0430\u00bb, \u043d\u043e \u043d\u0435 \u0434\u0430\u043b\u0438 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0439, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0438\u043b\u0438 \u043a\u0430\u043a\u0438\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435.<\/p>\n<p>\u041a \u043c\u043e\u0435\u043c\u0443 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u044e <a href=\"https:\/\/ziggit.dev\/t\/zig-build-run-is-10x-faster-than-compiled-binary\/3446\/8?u=mtlynch\" rel=\"noopener noreferrer nofollow\">\u0432 \u0442\u0440\u0435\u0434 \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u043b<\/a> \u042d\u043d\u0434\u0440\u044e \u041a\u0435\u043b\u043b\u0438, \u043e\u0441\u043d\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0438 \u0432\u0435\u0434\u0443\u0449\u0438\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u044f\u0437\u044b\u043a\u0430 Zig. \u041e\u043d \u043d\u0435 \u0441\u043c\u043e\u0433 \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u0442\u043e\u0442 \u0444\u0435\u043d\u043e\u043c\u0435\u043d, \u0447\u0442\u043e \u044f \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u043b, \u043d\u043e \u0443\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e \u044f \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u044e \u0438\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443, \u043a\u0430\u0441\u0430\u044e\u0449\u0443\u044e\u0441\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438:<\/p>\n<p>\u00ab\u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u0432\u044b \u0434\u0435\u043b\u0430\u0435\u0442\u0435 \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u043c\u0443 \u0432\u044b\u0437\u043e\u0432\u0443 \u043d\u0430 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0431\u0430\u0439\u0442\u0430? \u041e\u0442 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441\u0442\u0440\u0430\u0434\u0430\u0435\u0442. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0443, \u0447\u0442\u043e, \u043a\u043e\u0433\u0434\u0430 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043b\u0438\u0448\u043d\u0438\u0439 \u0448\u0430\u0433, \u043d\u0430 \u044d\u0442\u043e\u043c \u0448\u0430\u0433\u0435 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0431\u0443\u0444\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044f. \u041f\u0440\u0430\u0432\u0434\u0430, \u043d\u0435 \u0443\u0432\u0435\u0440\u0435\u043d, \u043f\u043e\u0447\u0435\u043c\u0443. \u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u044b \u0444\u0430\u0439\u043b\u0430\u00bb.<\/p>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043c\u043e\u0439 \u0434\u0440\u0443\u0433\u00a0<a href=\"https:\/\/www.agwa.name\/\" rel=\"noopener noreferrer nofollow\">\u042d\u043d\u0434\u0440\u044e \u042d\u0439\u0435\u0440<\/a>\u00a0\u0437\u0430\u043c\u0435\u0442\u0438\u043b \u043c\u043e\u0439 \u043f\u043e\u0441\u0442 \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0430 Mastodon \u0438\u00a0<a href=\"https:\/\/m.mtlynch.io\/@agwa@agwa.name\/112039058255070708\" rel=\"noopener noreferrer nofollow\">\u0440\u0430\u0437\u0433\u0430\u0434\u0430\u043b \u0437\u0430\u0433\u0430\u0434\u043a\u0443<\/a>:<\/p>\n<p>\u041c\u0430\u0439\u043a\u043b, \u0432\u0438\u0434\u0438\u0448\u044c \u0434\u0435\u0441\u044f\u0442\u0438\u043a\u0440\u0430\u0442\u043d\u0443\u044e \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u0432 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430 \u0432\u0432\u043e\u0434 \u043f\u043e\u0434\u0430\u044e\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043a\u0443\u0441\u043a\u0438 (\u0441\u043a\u0430\u0436\u0435\u043c, \u0431\u043e\u043b\u0435\u0435 1 \u041c\u0411)? \u0410 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043b\u0438 \u044d\u0442\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u0430, \u0435\u0441\u043b\u0438 \u0442\u044b \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0448\u044c stdin \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u0432 \u043a\u0430\u043d\u0430\u043b \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430?<\/p>\n<p>\u0414\u0443\u043c\u0430\u044e, \u043a\u043e\u0433\u0434\u0430 \u0442\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0448\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, <code>xxd<\/code> \u0438 <code>count-bytes<\/code> \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0443\u0444\u0435\u0440 \u043a\u0430\u043d\u0430\u043b\u0430 \u043f\u0443\u0441\u0442\u0443\u0435\u0442 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 <code>count-bytes<\/code> \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438\u0437 stdin, \u0435\u043c\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0436\u0434\u0430\u0442\u044c, \u043f\u043e\u043a\u0430 xxd \u0435\u0433\u043e \u043d\u0430\u043f\u043e\u043b\u043d\u0438\u0442. \u041d\u043e, \u0435\u0441\u043b\u0438 \u0442\u044b \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0448\u044c\u0441\u044f <code>zig build run<\/code>, \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <code>xxd<\/code> \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0444\u043e\u0440\u0443 \u043f\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a \u0442\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443, \u043a\u043e\u0433\u0434\u0430 count-bytes \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c stdin, \u0431\u0443\u0444\u0435\u0440 \u043a\u0430\u043d\u0430\u043b\u0430 \u0443\u0436\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d. <\/p>\n<p>\u042d\u043d\u0434\u0440\u044e \u042d\u0439\u0435\u0440 \u0431\u044b\u043b \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043f\u0440\u0430\u0432, \u0438 \u043d\u0438\u0436\u0435 \u044f \u0440\u0430\u0437\u043b\u043e\u0436\u0443 \u044d\u0442\u0443 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e \u043f\u043e \u043f\u043e\u043b\u043e\u0447\u043a\u0430\u043c. <\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u0430 \u0435\u0449\u0451 \u042d\u043d\u0434\u0440\u044e \u042d\u0439\u0435\u0440 \u043f\u043e\u043c\u043e\u0433 \u043c\u043d\u0435 \u0440\u0430\u0437\u0433\u0430\u0434\u0430\u0442\u044c \u0438 <a href=\"https:\/\/mtlynch.io\/notes\/picoshare-perf\/#ram-bloat-is-fine-but-crashes-are-not\" rel=\"noopener noreferrer nofollow\">\u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e<\/a>.<\/p>\n<h2>\u042f \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0441\u0435\u0431\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u043b, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u044b bash<\/h2>\n<p>\u042f \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043d\u0435 \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u043b\u0441\u044f \u043e \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430\u0445 bash, \u043d\u043e, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044e \u042d\u043d\u0434\u0440\u044e, \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u0441\u0435\u0431\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u044b.<\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u0435\u0431\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 bash, \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0439:<\/p>\n<pre><code class=\"bash\">.\/jobA | .\/jobB<\/code><\/pre>\n<p>\u042f \u043f\u043e\u043b\u0430\u0433\u0430\u043b, \u0447\u0442\u043e <code>jobA<\/code>\u00a0\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f, \u0430 \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f\u00a0<code>jobB<\/code>, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0435\u0435 \u0432\u044b\u0432\u043e\u0434\u00a0<code>jobA<\/code> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0432\u043e\u0434\u0430.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0412\u043e\u0442 \u0442\u0430\u043a \u043d\u0435\u0432\u0435\u0440\u043d\u043e \u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u043b \u0441\u0435\u0431\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0435 bash   <\/figcaption><\/div>\n<\/figure>\n<p>\u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432\u0441\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0435 bash \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0435 bash \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0432\u043e\u0442 \u0442\u0430\u043a   <\/figcaption><\/div>\n<\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0435 bash, \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0434\u0432\u0443\u0445 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043d\u0430 bash. \u0412\u043e\u0442 \u0447\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c.<\/p>\n<p><code>jobA<\/code>\u00a0\u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442, \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u0441\u044b\u043f\u0430\u0435\u0442 \u043d\u0430 \u0442\u0440\u0438 \u0441\u0435\u043a\u0443\u043d\u0434\u044b, \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 stdout, \u0437\u0430\u0441\u044b\u043f\u0430\u0435\u0442 \u0435\u0449\u0451 \u043d\u0430 \u0434\u0432\u0435 \u0441\u0435\u043a\u0443\u043d\u0434\u044b, \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0445\u043e\u0434\u0438\u0442:<\/p>\n<pre><code class=\"rust\">#!\/usr\/bin\/env bash  function print_status() {     local message=\"$1\"     local timestamp=$(date +\"%T.%3N\")     echo \"$timestamp $message\" >&amp;2 }  print_status 'jobA is starting'  sleep 3  echo 'result of jobA is...'  sleep 2  echo '42'  print_status 'jobA is terminating'<\/code><\/pre>\n<p><code>jobB<\/code>\u00a0\u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442, \u0436\u0434\u0451\u0442 \u0432\u0432\u043e\u0434\u0430 \u0432 stdin, \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0432\u0441\u0451, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0438\u0437 stdin, \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 stdin \u043d\u0435 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f:<\/p>\n<pre><code class=\"rust\">#!\/usr\/bin\/env bash  function print_status() {     local message=\"$1\"     local timestamp=$(date +\"%T.%3N\")     echo \"$timestamp $message\" >&amp;2 }  print_status 'jobB is starting'  print_status 'jobB is waiting on input' while read line; do   print_status \"jobB read '${line}' from input\" done &lt; \/dev\/stdin print_status 'jobB is done reading input'  print_status 'jobB is terminating'<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u00a0<code>jobA<\/code>\u00a0\u0438\u00a0<code>jobB<\/code>\u00a0\u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0435 bash, \u0440\u043e\u0432\u043d\u043e 5,009 \u0441\u0435\u043a\u0443\u043d\u0434 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 <code>jobB is starting<\/code>\u00a0\u0438\u00a0<code>jobB is terminating<\/code>:<\/p>\n<pre><code>$ .\/jobA | .\/jobB 09:11:53.326 jobA is starting 09:11:53.326 jobB is starting 09:11:53.328 jobB is waiting on input 09:11:56.330 jobB read 'result of jobA is...' from input 09:11:58.331 jobA is terminating 09:11:58.331 jobB read '42' from input 09:11:58.333 jobB is done reading input 09:11:58.335 jobB is terminating<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0442\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b\u00a0<code>jobA<\/code>\u00a0\u0438\u00a0<code>jobB<\/code>\u00a0\u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0438\u0441\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0430 \u043d\u0435 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u043d\u043e, \u0432\u0441\u0435\u0433\u043e 0,008 \u0441\u0435\u043a\u0443\u043d\u0434 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 <code>starting<\/code>\u00a0\u0438\u00a0<code>terminating<\/code>\u00a0\u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u0437\u0430\u0434\u0430\u043d\u0438\u0439:<\/p>\n<pre><code>$ .\/jobA > \/tmp\/output &amp;&amp; .\/jobB &lt; \/tmp\/output 16:52:10.406 jobA is starting 16:52:15.410 jobA is terminating 16:52:15.415 jobB is starting 16:52:15.417 jobB is waiting on input 16:52:15.418 jobB read 'result of jobA is...' from input 16:52:15.420 jobB read '42' from input 16:52:15.421 jobB is done reading input 16:52:15.423 jobB is terminating<\/code><\/pre>\n<h2>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a \u043c\u043e\u0435\u043c\u0443 \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0443 \u0431\u0430\u0439\u0442<\/h2>\n<p>\u0421\u0442\u043e\u0438\u043b\u043e \u043c\u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0432\u0441\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0435 bash \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e, \u044f \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043c\u043e\u0451\u043c \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0435 \u0431\u0430\u0439\u0442:<\/p>\n<pre><code>$ echo '00010203040506070809' | xxd -r -p | zig build run -Doptimize=ReleaseFast bytes:           10 execution time:  13.549\u00b5s  $ echo '00010203040506070809' | xxd -r -p | .\/zig-out\/bin\/count-bytes bytes:           10 execution time:  162.195\u00b5s<\/code><\/pre>\n<p>\u041f\u043e-\u0432\u0438\u0434\u0438\u043c\u043e\u043c\u0443, \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u00a0<code>echo '00010203040506070809' | xxd -r -p<\/code>\u00a0\u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430 \u0443\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 150 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434. \u0428\u0430\u0433\u00a0zig build run\u00a0\u0434\u043e\u043b\u0436\u0435\u043d \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 150 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434.<\/p>\n<p>\u041a \u0442\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443, \u043a\u0430\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u00a0<code>count-bytes<\/code>\u00a0\u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 \u0441\u00a0<code>zig build<\/code>, \u0435\u043c\u0443 \u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u043e\u0436\u0438\u0434\u0430\u0442\u044c\u0441\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u043d\u0438\u0439, \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u0440\u0430\u043d\u0435\u0435. \u0412\u0432\u043e\u0434 \u0443\u0436\u0435 \u0436\u0434\u0451\u0442 \u0435\u0433\u043e \u0432 stdin.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u00a0zig build run \u0435\u0441\u0442\u044c \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u043b\u044e\u0431\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u0434\u0430\u043d\u0438\u044f, \u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u0432\u0448\u0438\u0435 \u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440, \u0443\u0436\u0435 \u0443\u0441\u043f\u0435\u0432\u0430\u044e\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u043a \u0442\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443, \u043a\u0430\u043a \u043d\u0430\u0447\u043d\u0451\u0442 \u0440\u0430\u0431\u043e\u0442\u0443\u00a0count-bytes.   <\/figcaption><\/div>\n<\/figure>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u00a0<code>zig build<\/code>\u00a0\u0438 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a, \u0442\u043e <code>count-bytes<\/code>\u00a0\u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443, \u0438 \u0442\u043e\u0433\u0434\u0430 \u0436\u0435 \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442 \u0442\u0430\u0439\u043c\u0435\u0440.\u00a0 \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e <code>count-bytes<\/code>\u00a0\u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u0445\u043e\u043b\u043e\u0441\u0442\u0443\u044e \u043e\u0436\u0438\u0434\u0430\u0442\u044c ~150 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434, \u043f\u043e\u043a\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>echo<\/code>\u00a0\u0438\u00a0<code>xxd<\/code> \u043f\u043e\u043b\u043e\u0436\u0430\u0442 \u043d\u0443\u0436\u043d\u044b\u0439 \u0432\u0432\u043e\u0434 \u0432 stdin.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438\u00a0count-bytes\u00a0\u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0436\u0434\u0430\u0442\u044c \u043e\u043a\u043e\u043b\u043e 150<\/figcaption><\/div>\n<\/figure>\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-375035","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/375035","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=375035"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/375035\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=375035"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=375035"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=375035"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}