<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>Nikita Baksalyar</title>
		<description>Inquiries in Software Development</description>		
		<link>http://nbaksalyar.github.io</link>
		<atom:link href="http://nbaksalyar.github.io/feed.xml" rel="self" type="application/rss+xml" />
		
			<item>
				<title>The Soul of a New Debugger</title>
				        
				
					<description>&lt;p&gt;&lt;em&gt;This blog post is a follow-up to &lt;a href=&quot;/2020/05/19/rust-debug.html&quot;&gt;A Future for Rust Debugging&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Why developers are reluctant to use interactive debuggers and prefer &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;print&lt;/code&gt;s instead?&lt;/p&gt;

&lt;p&gt;This is a question that has been perplexing me, and while it’s not possible to have a definite answer, we can make some educated guesses.
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;print&lt;/code&gt;s are simple and very effective: you don’t have to painstakingly step through your code to understand what’s happening
and you don’t need any external tools – everything is already there, you just need to add a few statements and run your program again.&lt;/p&gt;

&lt;p&gt;Here’s the trick, though: if you code in a language like Python, JavaScript or Ruby, all you need to do to run your program is to execute it.
But there is a bit more friction with compiled native languages like C++ or Rust: every recompilation step costs time, and with larger
code bases with many dependencies it can quickly become non-negligible. It’s even more complicated if you want to debug a problem that occurs on a remote machine (e.g., a production server) or on an embedded platform, since you will need to redeploy the newly compiled binary every time you want to run a new debug experiment.&lt;/p&gt;

&lt;p&gt;Interactive debuggers solve these problems: you can take an existing program that was compiled in the debug mode and probe it to your liking,
setting up conditional breakpoints, looking up current values of variables, and doing a lot of other useful things. However, in my view, the widely-used interactive debuggers have a set of problems of their own:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;A lot of them were designed in a different era. At that time, we didn’t have always-on Internet connections, high-resolution multi-colour displays, and devices with many gigabytes of memory. While the fundamental principles remain the same, the modern needs have changed and so do modern means.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Many existing debuggers are general-purpose. While there is some support for scripting and language-specific extensions, it’s harder to use them for specific domains and it’s harder to integrate them with your dev environment. In practical terms, this means you have to use &lt;em&gt;other&lt;/em&gt; tools in addition to debuggers to observe the behaviour of your software, and oftentimes it’s just easier &amp;amp; faster to move along with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;print&lt;/code&gt;s instead of trying to find a suitable tool.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I also see more general problems with regards to debuggers. They are perceived mostly as a tool to help you find and fix bugs in your code, but not as much as a tool of discovery and exploration. It’s been 8 years since Bret Victor published his “&lt;a href=&quot;http://worrydream.com/#!/LearnableProgramming&quot;&gt;Learnable Programming&lt;/a&gt;”, and these ideas are as relevant today as ever. Debuggers should strive to be a good learning tool too.&lt;/p&gt;

&lt;p&gt;Lastly, interactive debuggers rely on underlying principles that are quite similar to profilers, dynamic tracers like &lt;a href=&quot;https://en.wikipedia.org/wiki/DTrace&quot;&gt;DTrace&lt;/a&gt; and &lt;a href=&quot;https://en.wikipedia.org/wiki/eBPF&quot;&gt;eBPF&lt;/a&gt;, memory leak detectors, and other developer tools. Ideas and code can – and should – be shared across this ecosystem, but it seems like whilst one type of tools gets a lot of attention, the others may still lack support for important features.&lt;/p&gt;

&lt;p&gt;So what can we do to try solving these problems?&lt;/p&gt;

&lt;h2 id=&quot;elements-of-a-modern-debugger&quot;&gt;Elements of a modern debugger&lt;/h2&gt;

&lt;p&gt;In my &lt;a href=&quot;/2020/05/19/rust-debug.html&quot;&gt;previous article&lt;/a&gt;, I argued for a case of extending the existing debuggers to provide better support for Rust. However, after some more research and thinking, I feel that we should consider the idea of creating a new debugger framework from scratch, taking inspiration from other great projects. Not-invented-here syndrome aside, I think there are some valid reasons for going in this direction.&lt;/p&gt;

&lt;p&gt;Modern languages like Rust have lots of new important features that weren’t available in languages that the classic debuggers were written in. Things like fearless concurrency, first-class modules &amp;amp; packages, async I/O and zero-cost abstractions can affect the design of a new debugger in a significant way. With the Rust’s package manager, &lt;a href=&quot;https://doc.rust-lang.org/cargo/&quot;&gt;Cargo&lt;/a&gt;, extensibility becomes even more relevant and viable. We’ve already seen what modular debuggers are capable of – for example, the Illumos Modular Debugger, &lt;a href=&quot;https://illumos.org/books/mdb/preface.html&quot;&gt;mdb&lt;/a&gt;, allows to debug both native and JavaScript code in Node.js with an &lt;a href=&quot;https://github.com/joyent/mdb_v8&quot;&gt;mdb_v8&lt;/a&gt; extension, and the architecture of the debugger itself allows to extend it further using a simple, modular interface. With language features like traits, it can become even easier to create your own domain-specific debuggers using a new framework.&lt;/p&gt;

&lt;p&gt;Another project to take inspiration from is &lt;a href=&quot;https://github.com/go-delve/delve&quot;&gt;Delve&lt;/a&gt;, a Go debugger. It’s built with modern tools and has several features important for Go developers, but I want to highlight the &lt;a href=&quot;https://github.com/go-delve/delve/tree/master/Documentation/api/json-rpc&quot;&gt;JSON-RPC API&lt;/a&gt; it provides. This API addresses the important problem of integration with the development environment, and by using &lt;a href=&quot;https://microsoft.github.io/debug-adapter-protocol/&quot;&gt;a well-defined protocol&lt;/a&gt; we can create an ecosystem for debuggers that’s similar to the one that’s flourished around the &lt;a href=&quot;https://microsoft.github.io/language-server-protocol/&quot;&gt;language server protocol&lt;/a&gt;. With an HTTP-based API, we can build custom debugger front-ends using HTML and WebAssembly and run them in web browsers. With the rich front-end tools &amp;amp; frameworks, it opens up lots of interesting options for data representation and visualisation. Integration doesn’t have to be one-sided, too: language servers can be reused for debugging purposes, and integrating a Rust-specific debugger with the Rust compiler would allow us to utilise the full power of the existing language syntax parser and other compiler components.&lt;/p&gt;

&lt;h2 id=&quot;whats-next&quot;&gt;What’s next?&lt;/h2&gt;

&lt;p&gt;Overall, I believe this is a project worth building. While we’re seeing a lot of innovation in compilers and language design, debuggers are somewhat neglected, even though debugging is no less important; as Kernighan’s law postulates, it’s twice as hard as writing the code in the first place.&lt;/p&gt;

&lt;p&gt;Creating a new debugger is an insurmountable task and a very long journey. But it can have a modest start: if we cover only a few popular operating systems and a few simple cases first, we can quickly achieve small wins that can save us a lot of time and frustration.&lt;/p&gt;

&lt;p&gt;This post outlines the initial project plan for &lt;strong&gt;&lt;a href=&quot;https://github.com/headcrab-rs/headcrab&quot;&gt;Headcrab&lt;/a&gt;&lt;/strong&gt;, a Rust debugger library. I will be publishing more code and documentation in the coming weeks. If you are interested in updates, please &lt;a href=&quot;https://twitter.com/nbaksalyar&quot;&gt;follow me on Twitter&lt;/a&gt;. Progress updates will be also published on this blog.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;You can find a more detailed roadmap in the &lt;a href=&quot;https://github.com/headcrab-rs/headcrab/blob/master/README.md&quot;&gt;project repository&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;resources-and-further-reading&quot;&gt;Resources and further reading&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://rustc-dev-guide.rust-lang.org/debugging-support-in-rustc.html&quot;&gt;Debugging support in the Rust compiler&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://illumos.org/books/mdb/preface.html&quot;&gt;mdb, Illumos Debugger&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Rosenberg, J.B. (1996). &lt;em&gt;How debuggers work : Algorithms, data structures, and architecture&lt;/em&gt;. ISBN 0471149667.&lt;/li&gt;
  &lt;li&gt;Uresh Vahalia (1996). &lt;em&gt;UNIX internals : the new frontiers&lt;/em&gt;. ISBN 9780131019089.&lt;/li&gt;
&lt;/ul&gt;
</description>
				
				<pubDate>Sun, 12 Jul 2020 00:00:00 +0000</pubDate>
				<link>http://nbaksalyar.github.io/2020/07/12/soul-of-a-new-debugger.html</link>
				<guid isPermaLink="true">http://nbaksalyar.github.io/2020/07/12/soul-of-a-new-debugger.html</guid>
			</item>
		
			<item>
				<title>A Future for Rust Debugging</title>
				        
				
					<description>&lt;p&gt;Recently, there has been a lot of progress in the Rust logging &amp;amp; tracing ecosystem: projects like &lt;a href=&quot;https://github.com/tokio-rs/tracing&quot;&gt;&lt;em&gt;tracing&lt;/em&gt;&lt;/a&gt; make our lives much simpler, allowing us to track down bugs even in complex asynchronous environments in production. However, they still can’t replace interactive debuggers like &lt;em&gt;gdb&lt;/em&gt; or &lt;em&gt;lldb&lt;/em&gt;, which provide so much more than just stack traces and variables printing.&lt;/p&gt;

&lt;p&gt;In an ideal world, you can use your debugger as a &lt;a href=&quot;https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop&quot;&gt;read-eval-print loop&lt;/a&gt;, writing, rewriting, and testing entire functions in an interactive session. Techniques like &lt;em&gt;post-mortem debugging&lt;/em&gt; make it possible to prod dead processes, providing immeasurable help in understanding the state of a program just before it crashed. But the harsh reality is that debuggers can be counter-intuituve, hard to use, or &lt;a href=&quot;https://robert.ocallahan.org/2019/11/your-debugger-sucks.html&quot;&gt;just suck&lt;/a&gt;, and it’s doubly challenging for Rust.&lt;/p&gt;

&lt;p&gt;Considering the complexity of modern Rust projects, it’s sometimes outright impossible to debug certain cases because the commonly used debug tools like &lt;em&gt;gdb&lt;/em&gt; or &lt;em&gt;lldb&lt;/em&gt; are tailored mostly for C or C++, and they make certain assumptions about the way your code is written. Needless to say, these assumptions sometimes can be drastically wrong because C++ and Rust are very different languages. For example, here’s a relatively simple program that uses &lt;a href=&quot;https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html&quot;&gt;&lt;em&gt;thread-local variables&lt;/em&gt;&lt;/a&gt;:&lt;/p&gt;

&lt;div class=&quot;language-rust highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;std&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;nn&quot;&gt;cell&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;RefCell&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;nd&quot;&gt;thread_local!&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;pub&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;XYZ&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;RefCell&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;u64&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;RefCell&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;fn&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;XYZ&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;.with&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;.borrow_mut&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And here’s what happens if I want to print the current value of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;XYZ&lt;/code&gt; in lldb:&lt;/p&gt;

&lt;figure class=&quot;fit-to-page&quot;&gt;
	&lt;img src=&quot;/static/dbg/tls-not-found.png&quot; alt=&quot;Attempting to read thread-local variables&quot; style=&quot;width: 90&quot; /&gt;
	&lt;figcaption&gt;Attempting to read thread-local variables.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;The first intuitive attempt to print out the variable using the standard Rust syntax fails miserably because &lt;em&gt;lldb&lt;/em&gt; doesn’t understand Rust at all; in fact, it uses a C++ expression parser instead. But even if we peek into the Rust &lt;a href=&quot;https://github.com/rust-lang/rust/blob/d8878868c8d7ef3779e7243953fc050cbb0e0565/src/libstd/thread/local.rs#L165-L166&quot;&gt;thread-local vars implementation&lt;/a&gt; and use a C++ expression to print them, it wouldn’t work because &lt;em&gt;lldb&lt;/em&gt; is &lt;a href=&quot;https://github.com/llvm/llvm-project/blob/e16111ce2fce7fd86c10d3f1dfe3e3b62b76d73b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp#L106-L107&quot;&gt;made to think&lt;/a&gt; it works with C++, and it doesn’t know that Rust has a &lt;a href=&quot;https://github.com/rust-lang/rfcs/pull/2603&quot;&gt;new name mangling scheme&lt;/a&gt; which has diverted from C++.&lt;/p&gt;

&lt;p&gt;And thread-local variables isn’t a very contrived case: for example, they are used in the &lt;a href=&quot;https://github.com/tokio-rs/tokio/blob/f39c15334e74b07a44efaa0f7201262e17e4f062/tokio/src/runtime/context.rs#L1-L8&quot;&gt;Tokio runtime implementation&lt;/a&gt; to store information about tasks, and it would be very helpful to inspect them for understanding how your async code is executed (or, at the very least, this kind of debug info can be helpful for developers of Tokio). Speaking of Tokio and the async ecosystem, it is impossible to print out async backtraces without also having to plod through async runtime internals. Sometimes a runtime can reschedule tasks, losing the original stack context in the process, and if you want to track the origin of an async failure in this case, you are left with only one option – logs and traces (if there’s an alternative way, I’d be happy to learn about it!).&lt;/p&gt;

&lt;p&gt;All of these problems have the same underlying cause: Rust has to live in the C/C++-centric world. So what can we do about it (other than &lt;em&gt;Rewriting-It-In-Rust&lt;/em&gt;, of course)? I think that the ideal systems programming language needs to have ideal, modern debugging tools.&lt;/p&gt;

&lt;p&gt;Luckily for us, a debugger like &lt;em&gt;lldb&lt;/em&gt; does not insist on using C/C++ for everything. It has a modular core, and languages support can be added &lt;a href=&quot;https://github.com/llvm/llvm-project/tree/master/lldb/source/Plugins&quot;&gt;as &lt;em&gt;plugins&lt;/em&gt;&lt;/a&gt; – and that’s exactly what &lt;em&gt;lldb&lt;/em&gt; does for C++, which is not really a special case, but a plugin that’s built on top of &lt;a href=&quot;https://clang.llvm.org/&quot;&gt;Clang&lt;/a&gt;, an LLVM-based C++ compiler. There has been an effort to implement a similar &lt;a href=&quot;https://github.com/tromey/lldb/tree/832406ba3d682c1c59f801e5ee836bdbc26e8bd0/source/Plugins/Language/Rust&quot;&gt;language plugin for Rust&lt;/a&gt; – which, however, is a tricky enterprise, because the lldb plugin API is private&lt;sup&gt;&lt;a href=&quot;#n1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt; and it’s written – you guessed it – in C++. Implementing a parser for a subset of Rust in C++ is hard enough, but keeping up with all the changes in the language is barely possible.&lt;/p&gt;

&lt;p&gt;But now, with an effort to &lt;a href=&quot;http://smallcultfollowing.com/babysteps/blog/2020/04/09/libraryification/&quot;&gt;“library-ify” Rust&lt;/a&gt;, I hope that this project can be reinvigorated. And while we are at it, we can try to apply the idea of &lt;em&gt;compiler as a library&lt;/em&gt; in another interesting way: &lt;em&gt;debugger as a library&lt;/em&gt;.&lt;/p&gt;

&lt;figure class=&quot;fit-to-page&quot;&gt;
	&lt;img src=&quot;/static/dbg/rust-debugger-scheme.png&quot; alt=&quot;A possible structure of the debugger library&quot; /&gt;
&lt;/figure&gt;

&lt;p&gt;In this example, the private lldb plugin API, which implements the language support, calls into the shared Rust debugger library to parse debug expressions. The debugger library can then delegate parsing to Rust compiler libraries, and in turn use debugger APIs provided by lldb when needed&lt;sup&gt;&lt;a href=&quot;#n2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;

&lt;p&gt;It should be noted that this hypothetical debugger library will work entirely in the Rust domain, so it will have the access to knowledge and power of &lt;a href=&quot;https://rustc-dev-guide.rust-lang.org/mir/index.html&quot;&gt;mid-level internal representation&lt;/a&gt;. Of course, this doesn’t have to work for &lt;em&gt;lldb&lt;/em&gt; only: the abstract interface can be ported to other debuggers. And if we make this library itself modular, it opens up a lot of interesting possibilities, like a more complete Rust REPL, custom &lt;a href=&quot;https://github.com/hediet/vscode-debug-visualizer/tree/master/extension&quot;&gt;visualizations&lt;/a&gt;, or &lt;em&gt;domain-specific debuggers&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;This is not a new idea and there are numerous good examples we can learn from. &lt;em&gt;mdb&lt;/em&gt;, or a &lt;a href=&quot;https://illumos.org/books/mdb/preface.html&quot;&gt;Modular Debugger&lt;/a&gt;, was &lt;a href=&quot;https://www.joyent.com/blog/mdb-and-node-js&quot;&gt;extended to inspect NodeJS programs&lt;/a&gt;. The .NET Core &lt;a href=&quot;https://github.com/dotnet/diagnostics&quot;&gt;runtime diagnostics tool&lt;/a&gt; has a &lt;a href=&quot;https://github.com/dotnet/diagnostics&quot;&gt;debugger abstraction library&lt;/a&gt; with adapters for lldb and Windows Debugger. I’m sure there are many others, but most of these examples boil down to the same idea of extending the debugger core with language-specific capabilities.&lt;/p&gt;

&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Obviously, this is a huge effort, which might (and most certainly will) require lots of changes across different projects like LLVM, the Rust compiler, or even the DWARF debug format specification&lt;sup&gt;&lt;a href=&quot;#n3&quot;&gt;[3]&lt;/a&gt;&lt;/sup&gt;. Instability of private APIs is definitely one of the challenges here, but it can be partially solved by having stable forks – which is how it’s done in a large number of cases anyway&lt;sup&gt;&lt;a href=&quot;#n4&quot;&gt;[4]&lt;/a&gt;&lt;/sup&gt;. Supporting abstractions like traits can be another difficult task because debuggers are not particularly suited to work with generic code (which is compiled down to concrete types). But I believe that even a basic Rust-aware debugger can make a huge difference in users experience, and I deem it a worthy goal to pursue.&lt;/p&gt;

&lt;p&gt;Thank you for reading this!&lt;/p&gt;

&lt;h2 id=&quot;references&quot;&gt;References&lt;/h2&gt;

&lt;p&gt;&lt;a name=&quot;n1&quot;&gt;&lt;/a&gt;
&lt;small&gt;[1]&lt;/small&gt; &lt;a href=&quot;http://lists.llvm.org/pipermail/lldb-dev/2018-January/013200.html&quot;&gt;[lldb-dev] Rust language support question&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a name=&quot;n2&quot;&gt;&lt;/a&gt;
&lt;small&gt;[2]&lt;/small&gt; There is even a &lt;a href=&quot;https://github.com/endoli/lldb.rs&quot;&gt;bindings crate&lt;/a&gt; for the public part of the lldb API.&lt;/p&gt;

&lt;p&gt;&lt;a name=&quot;n3&quot;&gt;&lt;/a&gt;
&lt;small&gt;[3]&lt;/small&gt; &lt;a href=&quot;https://www.youtube.com/watch?v=elBxMRSNYr4&quot;&gt;Tom Tromey discusses debugging support in rustc&lt;/a&gt; (video).&lt;/p&gt;

&lt;p&gt;&lt;a name=&quot;n4&quot;&gt;&lt;/a&gt;
&lt;small&gt;[4]&lt;/small&gt; E.g., see an &lt;a href=&quot;https://github.com/apple/llvm-project/tree/6c7c40694408d78286b3839964d144efd1a9669e/lldb/source/Plugins/Language/Swift&quot;&gt;Apple’s fork of lldb&lt;/a&gt; to add support for Swift.&lt;/p&gt;
</description>
				
				<pubDate>Tue, 19 May 2020 00:00:00 +0000</pubDate>
				<link>http://nbaksalyar.github.io/2020/05/19/rust-debug.html</link>
				<guid isPermaLink="true">http://nbaksalyar.github.io/2020/05/19/rust-debug.html</guid>
			</item>
		
			<item>
				<title>Rust in Detail, Part 2</title>
				        
				
					<description>&lt;aside class=&quot;warning&quot;&gt;
&lt;strong&gt;This blog post is outdated.&lt;/strong&gt; Please refer to the &lt;a href=&quot;https://tokio.rs/docs/getting-started/hello-world/&quot;&gt;Tokio documentation&lt;/a&gt; to learn more about a modern approach to asynchronous I/O in Rust.
&lt;/aside&gt;

&lt;h2 id=&quot;part-2-sending-and-receiving-messages&quot;&gt;Part 2: Sending and Receiving Messages&lt;/h2&gt;

&lt;p&gt;In this series of articles we’ll follow the process of creating a scalable, real-time chat service — everything in excruciating detail, of course! The objective is to learn more about system APIs and the emerging language Rust on a practical (and not too contrived) example, going step by step.&lt;/p&gt;

&lt;p&gt;The second part takes up where the &lt;a href=&quot;http://nbaksalyar.github.io/2015/07/10/writing-chat-in-rust.html&quot;&gt;part one&lt;/a&gt; left off and continues with the WebSocket protocol implementation. If you haven’t read the first part yet, it’s better to start there.&lt;/p&gt;

&lt;aside&gt;
Translated versions:&lt;br /&gt;
Russian (&lt;a href=&quot;https://habrahabr.ru/post/278635/&quot;&gt;Rust в деталях, часть 2&lt;/a&gt;)
&lt;/aside&gt;

</description>
				
				<pubDate>Mon, 09 Nov 2015 00:00:00 +0000</pubDate>
				<link>http://nbaksalyar.github.io/2015/11/09/rust-in-detail-2.html</link>
				<guid isPermaLink="true">http://nbaksalyar.github.io/2015/11/09/rust-in-detail-2.html</guid>
			</item>
		
			<item>
				<title>Rust in Detail: Writing Scalable Chat Service from Scratch</title>
				        
				
					<description>&lt;aside class=&quot;warning&quot;&gt;
&lt;strong&gt;This blog post is outdated.&lt;/strong&gt; Please refer to the &lt;a href=&quot;https://tokio.rs/docs/getting-started/hello-world/&quot;&gt;Tokio documentation&lt;/a&gt; to learn more about a modern approach to asynchronous I/O in Rust.
&lt;/aside&gt;

&lt;h2 id=&quot;part-1-implementing-websocket-introduction&quot;&gt;Part 1: Implementing WebSocket. Introduction.&lt;/h2&gt;

&lt;p&gt;In this series of articles we’ll follow the process of creating a scalable, real-time chat service.&lt;br /&gt;
The objective is to learn more about practical usage of the emerging language Rust and to cover the basic problems of using system programming interfaces, going step by step.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Part 1&lt;/em&gt; covers the project setup and the implementation of a bare bones WebSocket server. You don’t need to know Rust to follow, but some prior knowledge of POSIX API or C/C++ would certainly help. And what would help you even more is a good cup of coffee — beware that this article is fairly long and very low-level.&lt;/p&gt;

&lt;p&gt;Let’s begin the journey!&lt;/p&gt;

&lt;aside&gt;
Translated versions:&lt;br /&gt;
Korean (&lt;a href=&quot;http://blog.naver.com/futurewave01/220539095123&quot;&gt;Rust in Detail: 확장 가능한 채팅 서비스 만들기&lt;/a&gt;, thanks to &lt;a href=&quot;https://brunch.co.kr/@futurewave&quot;&gt;futurewave&lt;/a&gt;!)&lt;br /&gt;
Chinese (&lt;a href=&quot;http://markindev.github.io/2016/02/15/Rust-in-Details-Part-1/&quot;&gt;Rust in Detail Part 1: 实现Websocket协议&lt;/a&gt;, thanks to &lt;a href=&quot;http://markindev.github.io/&quot;&gt;Jingkai Mao&lt;/a&gt;!)&lt;br /&gt;
Russian (&lt;a href=&quot;http://habrahabr.ru/post/268609/&quot;&gt;Rust в деталях: пишем масштабируемый чат с нуля, часть 1&lt;/a&gt;)
&lt;/aside&gt;

</description>
				
				<pubDate>Fri, 10 Jul 2015 00:00:00 +0000</pubDate>
				<link>http://nbaksalyar.github.io/2015/07/10/writing-chat-in-rust.html</link>
				<guid isPermaLink="true">http://nbaksalyar.github.io/2015/07/10/writing-chat-in-rust.html</guid>
			</item>
		
	</channel>
</rss>
