trash
6
jhghjb (he/they)
link
83M

@federico3
link
13M

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

jhghjb (he/they)
link
03M

rust supports trans rights (human rights)

@ttmrichter
link
23M

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

@ttmrichter
link
-13M

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

@ttmrichter
link
63M

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

The correct answer, of course, is Ada.

@marcuse1w
link
53M

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
23M

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
1
edit-2
3M
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
43M

Or Nim.

@ttmrichter
link
13M

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.

jhghjb (he/they)
link
-113M

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

@k_o_t
admin
link
83M

pretty sure white supremacists also use rust and c lmao

jhghjb (he/they)
link
-43M

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

@k_o_t
admin
link
3
edit-2
3M

i can’t really argue with that hehe

Relected
link
23M

OK and?

@ttmrichter
link
13M

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
13M

lmao true

@ttmrichter
link
13M

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

jhghjb (he/they)
link
03M

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
    • 5 users / day
    • 39 users / week
    • 65 users / month
    • 126 users / 6 months
    • 2.63K subscribers
    • 749 Posts
    • 1.04K Comments
    • Modlog