Comment

Comment by breckinloggins

I've been working on a NES emulator in rust and so far I really like the language.

Other than managing lifetimes, which can be difficult, the only thing that really bugs me is the lack of safe type promotion. for example, if I have:

fn add(a: u8) -> u16 { a + 7 }

the compiler should not complain that the expression is of type u8 and not u16 - it is safe to widen the type!

Other minor nits:

- it would be nice if enums were scoped. I think putting names in the outer namespace repeats a poor design in C. Enums should look like MyEnum.MyValue. I know the ADT nature of rust enums might throw a wrench in this

- I really dislike the word "mut". it looks like mutt to me. I don't really know how to fix this, though. Perhaps reuse the @ sigil once it goes away?

- Once macros are mature, it would be nice not to require them to be suffixed with !. I'm a lisp guy at heart in this respect... macros should be full power and macro use should feel just like that feature was built into the language

- JSON style literals for hash maps would be nice

- Ternary operator pls

Other than those small complaints, I have to say that rust has been a joy!

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton