<div dir="ltr">- Rust got C-like unions as of 1.19 (20 July 2017).  This is primarily for interfacing with C code; in native Rust you almost always opt for enums (aka tagged unions, sum types).<div><br></div><div>- Rust does not have bitfields but it does have the same bit mashing operators as C (& | ^ !  << >>).   C bitfields have different memory layouts on different platforms which limits their usefulness.  All the microcontroller C code I've ever seen has opted for explicit bit mashing instead of bitfields.<br><br>- There is an OS written in Rust, <a href="https://www.redox-os.org/">https://www.redox-os.org/</a> .  The drivers are all in Rust.</div><div><br></div><div><br><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Sep 12, 2017 at 9:27 PM zxq9 <<a href="mailto:zxq9@zxq9.com">zxq9@zxq9.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 2017年09月13日 水曜日 01:47:08 Thom Cherryhomes wrote:<br>
> For a language that purports to be a replacement for low-level systems<br>
> programming, Rust not having bitfields or unions, would be a real pain in<br>
> the ass to do any intricate hardware driver work... I'm guessing that Rust<br>
> is designed by 20-somethings who have never done a line of assembler in<br>
> their lives?<br>
<br>
That is curious. I wonder if these have been deferred for the time being in favor of using C as an extension (as Rust conforms to the C ABI)?<br>
<br>
-Craig<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div></div></div>