{"id":886,"date":"2022-12-18T16:57:03","date_gmt":"2022-12-18T16:57:03","guid":{"rendered":"https:\/\/www.martyndavis.com\/?p=886"},"modified":"2022-12-18T17:07:03","modified_gmt":"2022-12-18T17:07:03","slug":"rust-projects","status":"publish","type":"post","link":"https:\/\/www.martyndavis.com\/?p=886","title":{"rendered":"Rust Projects"},"content":{"rendered":"\n<p>I&#8217;ve been having a lot of fun recently learning Rust. It&#8217;s a breath of fresh air in so many ways compared to C++: for instance the standardised package management, a consistent way of building projects, and simple-to-add unit tests. These are in addition to the much-touted safer memory management. We won&#8217;t be giving up with C++ at work, but we will be using Rust for several new projects.<\/p>\n\n\n\n<p>As a learning exercise, I&#8217;ve re-written a game I first wrote for the ZX-Spectrum forty years ago, called <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/md81544\/xtarda2\" target=\"_blank\">Xtarda Rescue<\/a>. It&#8217;s  not the cleanest code &#8211; there was a lot of learning along the way, and I&#8217;d definitely refactor parts of it if I had the time, but it plays really well and, while I tried to keep it retro, it&#8217;s far more advanced than the original.<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" width=\"2720\" height=\"1756\" class=\"wp-image-890\" style=\"width: 640px;\" src=\"https:\/\/www.martyndavis.com\/wp-content\/uploads\/2022\/12\/xtarda_rescue.png\" alt=\"\" srcset=\"https:\/\/www.martyndavis.com\/wp-content\/uploads\/2022\/12\/xtarda_rescue.png 2720w, https:\/\/www.martyndavis.com\/wp-content\/uploads\/2022\/12\/xtarda_rescue-300x194.png 300w, https:\/\/www.martyndavis.com\/wp-content\/uploads\/2022\/12\/xtarda_rescue-1024x661.png 1024w, https:\/\/www.martyndavis.com\/wp-content\/uploads\/2022\/12\/xtarda_rescue-768x496.png 768w, https:\/\/www.martyndavis.com\/wp-content\/uploads\/2022\/12\/xtarda_rescue-1536x992.png 1536w, https:\/\/www.martyndavis.com\/wp-content\/uploads\/2022\/12\/xtarda_rescue-2048x1322.png 2048w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/p>\n\n\n\n<p>I also wrote probably about the millionth version of <a href=\"https:\/\/github.com\/md81544\/life\">Conway&#8217;s Life<\/a>.<\/p>\n\n\n\n<p>There&#8217;s also a tiny little CLI utility called <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/md81544\/temperature\" data-type=\"URL\" data-id=\"https:\/\/github.com\/md81544\/temperature\" target=\"_blank\">Temperature<\/a> I&#8217;ve just created, which is a good example of how to do async calls, in this case to a couple of REST APIs, one for IP-based geolocation (so not very accurate!) and then, given that location, a call to get localised weather information.<\/p>\n\n\n\n<p>I&#8217;m definitely looking forward to continuing learning more Rust.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been having a lot of fun recently learning Rust. It&#8217;s a breath of fresh air in so many ways compared to C++: for instance the standardised package management, a consistent way of building projects, and simple-to-add unit tests. These are in addition to the much-touted safer memory management. We won&#8217;t be giving up with &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.martyndavis.com\/?p=886\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Rust Projects&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.martyndavis.com\/index.php?rest_route=\/wp\/v2\/posts\/886"}],"collection":[{"href":"https:\/\/www.martyndavis.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.martyndavis.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.martyndavis.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.martyndavis.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=886"}],"version-history":[{"count":3,"href":"https:\/\/www.martyndavis.com\/index.php?rest_route=\/wp\/v2\/posts\/886\/revisions"}],"predecessor-version":[{"id":891,"href":"https:\/\/www.martyndavis.com\/index.php?rest_route=\/wp\/v2\/posts\/886\/revisions\/891"}],"wp:attachment":[{"href":"https:\/\/www.martyndavis.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=886"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.martyndavis.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=886"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.martyndavis.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=886"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}