<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Rust on Ilya's Blog</title><link>https://ilyabiz.com/tags/rust/</link><description>Recent content in Rust on Ilya's Blog</description><generator>Hugo</generator><language>en-DE</language><copyright>2026 Ilya Bizyaev</copyright><lastBuildDate>Sat, 29 Dec 2018 00:21:52 +0000</lastBuildDate><atom:link href="https://ilyabiz.com/tags/rust/feed.xml" rel="self" type="application/rss+xml"/><item><title>2018 — what a year!</title><link>https://ilyabiz.com/2018/12/2018-what-a-year/</link><pubDate>Sat, 29 Dec 2018 00:21:52 +0000</pubDate><guid isPermaLink="false">https://ilyabiz.com/?p=404</guid><description>&lt;p&gt;2018, my favorite year so far, has come to its end. So, I decided to recap what happened in my life this year, as well as to tell about events I haven&amp;rsquo;t covered yet.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Snow-covered path through a park during heavy snowfall" loading="lazy" src="https://ilyabiz.com/2018/12/2018-what-a-year/snowy-park.jpg"&gt;&lt;/p&gt;
&lt;p&gt;2018 was the first year for me that started with exams. Not that I haven&amp;rsquo;t spent holidays studying for exams before, though, so with some persistence and tangerine fuel 🍊 I &lt;a href="https://ilyabiz.com/2018/02/exams-are-over-new-studies-coming/"&gt;passed&lt;/a&gt; them all good enough and had a week of TV series and open source contribution before the upcoming semester. With some help from Halium project maintainers and a steep learning curve, I was finally able to conquer graphics libraries on an x86 Android phone and &lt;a href="https://ilyabiz.com/2018/02/halium-on-asus-zenfone-5/"&gt;start a Wayland compositor&lt;/a&gt;. At the same time, my efforts on the Russian-speaking KDE community became visible, as our friendly local group &lt;a href="https://ilyabiz.com/2018/02/kde-russia/"&gt;crossed&lt;/a&gt; a symbolic border of 1000 members!&lt;/p&gt;</description><content:encoded><![CDATA[<p>2018, my favorite year so far, has come to its end. So, I decided to recap what happened in my life this year, as well as to tell about events I haven&rsquo;t covered yet.</p>
<p><img alt="Snow-covered path through a park during heavy snowfall" loading="lazy" src="/2018/12/2018-what-a-year/snowy-park.jpg"></p>
<p>2018 was the first year for me that started with exams. Not that I haven&rsquo;t spent holidays studying for exams before, though, so with some persistence and tangerine fuel 🍊 I <a href="/2018/02/exams-are-over-new-studies-coming/">passed</a> them all good enough and had a week of TV series and open source contribution before the upcoming semester. With some help from Halium project maintainers and a steep learning curve, I was finally able to conquer graphics libraries on an x86 Android phone and <a href="/2018/02/halium-on-asus-zenfone-5/">start a Wayland compositor</a>. At the same time, my efforts on the Russian-speaking KDE community became visible, as our friendly local group <a href="/2018/02/kde-russia/">crossed</a> a symbolic border of 1000 members!</p>
<p>The new courses at university were difficult at first, so I had to really focus on my studies. I had a nice weekend break at the <a href="/2018/05/cpp-russia-2018/">C++ Russia</a> conference, but otherwise had been immersed, and that helped me catch up and finish the freshman year <a href="/2018/06/summertime/">proudly</a>. 🏆</p>
<p>In July, August, and September I could finally participate in the world of free software again. I was mostly focused on Plasma Mobile, KDE&rsquo;s mobile platform, and KDE Russia. I prepared and gave an introductory talk about <a href="/2018/08/plasma-mobile-at-a-demoparty/">GNU/Linux on mobile devices</a>, then developed and launched the <a href="/2018/09/new-kde-ru-website/">kde.ru website</a>. I&rsquo;m thankful to Chaos Constructions conference managers and local FOSS news platforms for the chance to promote KDE&rsquo;s amazing work to wider audiences. 📱</p>
<h2 id="vk-hackathon">VK Hackathon</h2>
<p>As part of an amateur yet motivated team, I was working on a corporate assistant application for the State Hermitage Museum. Our aim was to provide a 3-in-1 cross-platform solution: a task management system, an internal messenger and a navigation system (Hermitage is <em>huge</em>). The deadline was tough, but we managed to deliver a working prototype.</p>



  <div class="youtube-embed ">
    <iframe
      allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen"
      loading="eager"
      referrerpolicy="strict-origin-when-cross-origin"
      src="https://www.youtube-nocookie.com/embed/tZJVR8ZdT4o?autoplay=0&amp;controls=1&amp;end=0&amp;loop=0&amp;mute=0&amp;start=0"
      title="VK Hackathon Demo"
    ></iframe>
  </div>


<div class="gallery gallery-cols-2"><img alt="Kaidan channels list used by the Hermitage Assistant" loading="lazy" src="/2018/12/2018-what-a-year/kaidan-channels.png">
<img alt="Hermitage Assistant navigation menu on a phone" loading="lazy" src="/2018/12/2018-what-a-year/hermitage-assistant-menu.png"></div>

<p><img alt="Hermitage Assistant desktop dashboard with tasks, messages, and places" loading="lazy" src="/2018/12/2018-what-a-year/hermitage-assistant-desktop.jpg"></p>
<p>Our application was not selected by case managers, but the atmosphere of passionate hacking is unforgettable. Besides, some of my work <a href="/2018/11/automatic-qml-import-by-qt-deployment-tools/">went upstream</a> and will benefit many applications to come 🙂</p>
<p><img alt="Four members of the team at the VK Hackathon" loading="lazy" src="/2018/12/2018-what-a-year/vk-hackathon-team.jpg"></p>
<h2 id="icpc-neerc-2018">ICPC NEERC 2018</h2>
<p>My second time in this competitive programming contest as a Technical Committee assistant. It is an amazing experience, as well as a steep learning curve. Thanks to everyone who participated in this year&rsquo;s programming competitions at ITMO University, both teams and fellow volunteers! 👨‍💻💪</p>
<p><img alt="Ilya holding a silver volunteer certificate at ICPC NEERC 2018" loading="lazy" src="/2018/12/2018-what-a-year/icpc-volunteer.jpg"></p>
<h2 id="rust">Rust</h2>
<p>An ordinary algorithm class assignment can become a challenging experiment if you give up on your habits and try solving it using a different programming language, like <a href="https://www.rust-lang.org">Rust</a>. I&rsquo;ve had a deep dive into the Rust ecosystem, <a href="/2018/12/rust-for-algorithms/">implementing some algorithms</a>, trying a <a href="https://github.com/amethyst/amethyst">game framework</a> and building a <a href="https://servo.org">research web browser</a> (with small <a href="https://github.com/servo/servo/pull/22569">fixes</a> along the way).</p>
<p>I&rsquo;ll definitely continue learning the ways of oxidized metal in 2019! 📔</p>
<p><img alt="Cartoon knight representing the Rust programming language" loading="lazy" src="/2018/12/2018-what-a-year/rust-knight.png"></p>
<h2 id="to-the-awesome-new-year">To the awesome new year!</h2>
<p>Let 2019 be even better for us all! Thank you for reading, and all the best in 2019! 😃</p>
]]></content:encoded></item><item><title>Rust for algorithms</title><link>https://ilyabiz.com/2018/12/rust-for-algorithms/</link><pubDate>Sun, 23 Dec 2018 20:54:31 +0000</pubDate><guid isPermaLink="false">https://ilyabiz.com/?p=383</guid><description>&lt;p&gt;&lt;img alt="Rust logo over colorful source code" loading="lazy" src="https://ilyabiz.com/2018/12/rust-for-algorithms/rust-code-logo.png"&gt;&lt;/p&gt;
&lt;p&gt;This week I was assigned to implement a number of string related algorithms that perform substring search and count, calculate helper functions and build performant structures on them, etc. Algorithms themselves were not too complicated, so I decided to challenge myself and solve the problems using Rust (instead of my main language C++).&lt;/p&gt;
&lt;p&gt;Now that I&amp;rsquo;ve &lt;a href="https://github.com/IlyaBizyaev/rust-experiments"&gt;solved&lt;/a&gt; the task, I can tell a bit about my experience, things that I found convenient or complicated. I&amp;rsquo;m a beginner in Rust, but if my idea of the language is interesting to you, read on! 🙂&lt;/p&gt;</description><content:encoded><![CDATA[<p><img alt="Rust logo over colorful source code" loading="lazy" src="/2018/12/rust-for-algorithms/rust-code-logo.png"></p>
<p>This week I was assigned to implement a number of string related algorithms that perform substring search and count, calculate helper functions and build performant structures on them, etc. Algorithms themselves were not too complicated, so I decided to challenge myself and solve the problems using Rust (instead of my main language C++).</p>
<p>Now that I&rsquo;ve <a href="https://github.com/IlyaBizyaev/rust-experiments">solved</a> the task, I can tell a bit about my experience, things that I found convenient or complicated. I&rsquo;m a beginner in Rust, but if my idea of the language is interesting to you, read on! 🙂</p>
<p>The assignment I had to solve is part of my Algorithms and Data Structures course at ITMO University. It has been published on the Codeforces competitive programming platform that has recently <a href="https://codeforces.com/blog/entry/62423?locale=en">moved to ITMO</a>. The version of Rust available on Codeforces is 1.26, so I haven&rsquo;t yet had a chance to check out the new features of <a href="https://blog.rust-lang.org/2018/12/06/Rust-1.31-and-rust-2018.html">Rust 2018 edition</a>.</p>
<p>Searching for an IDE for Rust, I&rsquo;ve chosen CLion with JetBrains&rsquo; official <a href="https://intellij-rust.github.io">Rust plugin</a>. This IDE is proprietary, but of all IDEs and editors I checked only CLion provided debugging out of the box. I also enjoyed VSCode quite much, but couldn&rsquo;t get any plugins that provide debug support to work with Rust. I am aware of some efforts to support <a href="https://github.com/KDE/kdev-rust">Rust in KDevelop</a>, as well as of an official <a href="https://github.com/rust-lang/rust.vim">Vim plugin</a>, but decided to stick to something I use regularly anyway.</p>
<p><img alt="Rust source code open in CLion" loading="lazy" src="/2018/12/rust-for-algorithms/clion-rust-code.png"></p>
<p>In the end, I solved 12 of 13 tasks using Rust and wrote some extra code for personal tests. I published all of it in a <a href="https://github.com/IlyaBizyaev/rust-experiments/">GitHub repository</a>, in case it might be useful for someone.</p>
<p><img alt="String algorithm problems on Codeforces" loading="lazy" src="/2018/12/rust-for-algorithms/codeforces-problems.png"></p>
<p>Generally, the C++ → Rust switch felt pretty natural. With Rust, it takes a lot more time to persuade the compiler that the code is worth building, but it actually helps to fix bugs, and in the end you&rsquo;re thankful to the borrow checker for its hard work. Then a number of issues gets fixed during a couple of first launches, when the program panics on integer overflows and out-of-bounds array indexes. And finally, a nice static analyzer called clippy suggests some final touches to optimize and prettify the code. Compiler errors feel unexpectedly pleasant and friendly after GCC&rsquo;s text walls.</p>
<p><img alt="Rust compiler error for mismatched types" loading="lazy" src="/2018/12/rust-for-algorithms/mismatched-types-error.png"></p>
<p><img alt="Rust compiler error suggesting a format string" loading="lazy" src="/2018/12/rust-for-algorithms/format-string-error.png"></p>
<p>Built-in collections were sufficient for the programs I needed to write. Not much to say here really, except for that data structures want to be cloned rather than copied to avoid memory errors.</p>
<p>Sadly, there&rsquo;s a couple of negative aspects I discovered, both related to performance. First is that rustc <a href="https://mail.mozilla.org/pipermail/rust-dev/2013-April/003557.html">does not support tail call optimization (TCO)</a>, and likely won&rsquo;t anytime soon. That was a big disappointment for me because there are so many algorithms out there that are described in a recursive manner, have proper asymptotics limits, but expect a compiler to do the optimization. Of course, they <a href="https://cs.stackexchange.com/a/67918">can be rewritten using loops</a>, but usually you want to stick to idiomatic implementations and not reinvent.</p>
<p>Second, the file IO speed. Buffered file input-output in Rust is as fast as <code>fstream</code> in C++ <em>unless</em> the latter is &ldquo;optimized&rdquo; with <code>sync_with_stdio(false)</code>, <code>tie(nullptr)</code> and no flushes (like <code>std::endl</code>). It&rsquo;s the sole reason for that 13th program to not be submitted in Rust: it was really hitting the time limit. And even though it may seem to be a rare case, it can play its role in competitive programming.</p>
<p>To sum up, I loved Rust for its strict yet friendly compiler, a nice standard library, and a nice community ready to help (check out <a href="ircs://irc.mozilla.org/rust">#rust</a> on irc.mozilla.org!). There are many cool libraries out there, and I am very eager to try <a href="https://github.com/kde/rust-qt-binding-generator">Qt with Rust</a> as soon as I get some free time.</p>
<p>Other than that — have to go now! 🙂 Thanks for bearing with me if you made it to this sentence. Stick around for more random posts about the stuff I enjoy, and have a great day! 😃</p>
]]></content:encoded></item></channel></rss>