"rust is great it's gonna kill C and C++ and all other low-level languages" i'm still hitting undefined behavior on printing a string to console and nothing else so i'm gonna say no as it's got the same issues C has

  • 7
    I've been using Rust for years and never seen undefined behaviour outside of unsafe blocks. How the hell did you manage that with a simple print?

    Although I'd say Rust competes more with C++, people who prefer the C coding style would probably like Zig more.
  • 1
    So, it's gonna commit suicide?
  • 1
    @deadlyRants For great justice
  • 1
    Rust doesn't have undefined behaviour nor any memory unsafety at all without using unsafe. Certainly a lone println!() shouldn't have any problems. Are you getting a deadlock because you .lock()'ed stdout?
  • 0
    @12bitfloat just print and then die. sometimes works, sometimes doesn't.
  • 2
    @Parzi That's weird. What platform are you on?
    It can't be a flushing problem because println auto flushes
  • 0
    @12bitfloat Linux or Windows
  • 2
    @Parzi print!() does not flush because stdout is line buffered like in many other languages. Use println!() or flush it manually.
Add Comment