[erlang-questions] Erlang VM in Rust

Daniel Goertzen daniel.goertzen@REDACTED
Wed Sep 13 21:46:08 CEST 2017


- 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).

- 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.

- There is an OS written in Rust, https://www.redox-os.org/ .  The drivers
are all in Rust.




On Tue, Sep 12, 2017 at 9:27 PM zxq9 <zxq9@REDACTED> wrote:

> On 2017年09月13日 水曜日 01:47:08 Thom Cherryhomes wrote:
> > For a language that purports to be a replacement for low-level systems
> > programming, Rust not having bitfields or unions, would be a real pain in
> > the ass to do any intricate hardware driver work... I'm guessing that
> Rust
> > is designed by 20-somethings who have never done a line of assembler in
> > their lives?
>
> 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)?
>
> -Craig
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170913/6d54fe04/attachment.htm>


More information about the erlang-questions mailing list