trash
@federico3
link
fedilink
110M

Is this a marketing spin? The software industry does not need more hype.

rust supports trans rights (human rights)

@ttmrichter
link
fedilink
210M

Rust is a programming language. Rust has literally no agency. Rust supports nothing. Please do stop trolling.

@ttmrichter
link
fedilink
-110M

Note the extra-subtle spin of saying Ada programmers are white supremacists. For that extra goodness!

@ttmrichter
link
fedilink
610M

C vs. Rust: Which to choose for programming hardware abstractions

The correct answer, of course, is Ada.

@marcuse1w
link
fedilink
510M

Ada is really good at making this kind of bit hacking very transparent. It might be interesting to create a Ada version of the examples in the Article to illustrate this. Even the Rust solution looks really messy compared to how Ada approaches this.

@ttmrichter
link
fedilink
210M

Absolutely. Between subtyping and size aspects and packing and bit ordering all baked into the record notation it’s an absolutely amazingly concise yet expressive language for what every other language I’ve used tended to make a chore.

@ttmrichter
link
fedilink
1
edit-2
10M
type Bit    is mod 2**1  with Size => 1;
type UInt4  is mod 2**4  with Size => 4;
type UInt8  is mod 2**8  with Size => 8;
type UInt19 is mod 2**19 with Size => 19;

subtype HSEM_Lock   is Bit;
subtype HSEM_Master is UInt4;
subtype HSEM_Proc   is UInt8;

type HSEM_Rx is record
  PROCID         : HSEM_Proc   := 32#0#;
  MASTERID       : HSEM_Master := 32#0#;
  reserved_12_30 : UInt19      := 32#0#;
  LOCK           : HSEM_Lock   := 32#0#;
end record
 with
  Volatile,
  Size      => 32,
  Bit_Order => System.Low_Order_First;

for HSEM_Rx use record
  PROCID         at 0 range 0..7;
  MASTERID       at 0 range 8..11;
  reserved_12_30 at 0 range 12..30;
  LOCK           at 0 range 31..31;
end record;

That’s a real-world register definition (off the top of my head) of real-world kit I work with. The C code that does this is longer, uglier, and far more fragile.

edited to be less dashed-off-at-work-before-running-for-the-bus

@federico3
link
fedilink
410M

Or Nim.

@ttmrichter
link
fedilink
110M

Don’t know enough about Nim to comment. I looked at it and it didn’t grab me, but hey, that was my reaction to a lot of language (including Ada) when I first saw them.

big yikes on this one, ada is often used by white supremacists

@k_o_t
link
fedilink
810M

pretty sure white supremacists also use rust and c lmao

white supremacists use c but not rust, one of the many reasons rust is the perfect language

@k_o_t
link
fedilink
3
edit-2
10M

i can’t really argue with that hehe

Relected
link
fedilink
210M

OK and?

@ttmrichter
link
fedilink
110M

I’m pretty sure he’s trying to “subtly” say I must be a white supremacist because I like well-designed programming languages over languages that were written.

Relected
link
fedilink
110M

lmao true

@ttmrichter
link
fedilink
110M

White supremacists use the Internet. Better drop off quickly before you get associated with them!

no, we must get rid of these white supremacists

fuck hate ✊🏿

General Programming Discussion
!programming

    A general programming discussion community.

    Rules:

    1. Be civil.

    Other communities:

    • /c/rust
    • /c/python
    • /c/powershell
    • /c/haskell
    • /c/fpcomplete
    • /c/cpp
    • /c/c_programming
    • /c/julia
    • 0 users online
    • 2 users / day
    • 9 users / week
    • 28 users / month
    • 119 users / 6 months
    • 2.91K subscribers
    • 820 Posts
    • 1K Comments
    • Modlog