Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411506 Posts in 69374 Topics- by 58429 Members - Latest Member: Alternalo

April 25, 2024, 10:42:01 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Nim or Rust for gamedev: which one?
Pages: [1]
Print
Author Topic: Nim or Rust for gamedev: which one?  (Read 1162 times)
loik_1
Level 0
*


View Profile
« on: April 11, 2018, 02:16:43 PM »

The Nim's readme says "its a compiled, garbage-collected systems programming language which has an excellent productivity/performance ratio. Nim's design focuses on efficiency, expressiveness, elegance (in the order of priority)." Nim include features like a deterministic soft real-time GC that allows for its max pause time and supports manual memory management. Other features, compile to C (C++, Objective C, or JavaScript), strongly statically typed, powerful meta-programming, compile-time execution, easy to read (Python like syntax), and local type inference. It is multi-paradigm supporting, imperative, minimal object-oriented (encouraging composition over inheritance), functional procedural styles. Some tools like a package manager (nimble), C2nim (C and C++ bindings), and Nimsuggest. Also these a game development framework and are two cons are the bus factor and not release yet.

Rust's website says "is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety." Features include, CFFI, immutability, robust meta-programming, RAII, modern type system, strongly statically typed, compiles to native code, safe rust by default (you can unsafe too), immutability, fine grained control over memory, and modules. It is multi-paradigm supporting, concurrent, functional, imperative, structured, and generic procedural styles. Some tools like Cargo (a package manager), RLS (Rust Language Server), rustfmt (formating), clippy (lints), and rust-bindgen (Automatically generate C or C++ bindings). Coming features are generators/async/await, SIMD, custom allocators, and compiles to WASM. Also verysus resources and strong game dev community.

I took two intro programming courses well in school ( JavaScript & Python). Both are memory safe and can do low-level programming and between Nim or Rust which one is more susceptible for game development?

Thank you for the advice.Smiley

https://www.rust-lang.org
https://nim-lang.org/
Logged
bateleur
Level 10
*****



View Profile
« Reply #1 on: April 12, 2018, 03:37:11 AM »

Difficult to answer without understanding your requirements better. You don't list C# (used, for example, by Unity) but you don't say why not. If the reason is that you want to use something you've used before, I'd suggest abandoning that restriction. You can learn a new language in a week, more or less, but choosing the wrong game dev enivronment could cost you months or even years of dev time.

Of the two you list, Rust seems like the better option purely for the community support. If you get stuck you can ask for help, whereas with Nim if you get stuck you might have hit something which the language doesn't handle yet and then you're left having to hack around it.
Logged

Crimsontide
Level 5
*****


View Profile
« Reply #2 on: April 12, 2018, 05:45:36 AM »

Having never used either...

I prefer rust.  Its has some cool features (or so I've read) like traits and memory management just makes sense.  Its a very pragmatic language.
Logged
loik_1
Level 0
*


View Profile
« Reply #3 on: April 12, 2018, 10:56:40 AM »

Difficult to answer without understanding your requirements better. You don't list C# (used, for example, by Unity) but you don't say why not. If the reason is that you want to use something you've used before, I'd suggest abandoning that restriction. You can learn a new language in a week, more or less, but choosing the wrong game dev enivronment could cost you months or even years of dev time.

Of the two you list, Rust seems like the better option purely for the community support. If you get stuck you can ask for help, whereas with Nim if you get stuck you might have hit something which the language doesn't handle yet and then you're left having to hack around it.

Requirements are to learn one of the two and learning to make games. Rust learning curve is steep and it takes a month or more to learn it because you are fighting the borrow checker.
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic