DEV Community

Discussion on: Unresolved compilation problem (with no explanation?).

 
ducaale profile image
Mohamed Dahir • Edited

Wouldn't Rust require you to install something as well

When you compile your game, a statically linked binary will be created. This means end-users will not have to install anything.

Is it compiled?

Yes, and it is the fastest language out there (just behind C/C++)

And will the compiled product work on all devices, like it would Java or C#?

You just have to compile for each platform you need to target.

I can't even figure out how to compile my .cs file with .NET through Command Prompt, like I do Java

The best thing about Rust is Cargo which is a modern package manager / build tool that just works™.

If you're interested, check macroquad which supports Windows, macOS, Linux, Android, iOS and HTML5.

Thread Thread
 
baenencalin profile image
Calin Baenen

Regarding question three's answer, is there ANY way I don't have to recompile for EACH platform, is there like some "master-platform" compilation?

If not, how do I compile for a specific platform? And can I merge the binaries in to one whole so that they will work on any device when installed?

Thread Thread
 
ducaale profile image
Mohamed Dahir

What people usually do is to setup CI/CD pipeline that automatically builds the project for each target when a new release is made.

For example, you can see in the assets section of this project, the different binaries that target different platforms.

However, you could always write a script to do this step locally. Take a look at rust-lang.github.io/rustup/cross-c...

And can I merge the binaries in to one whole so that they will work on any device when installed?

I believe having a seperate binary for each platform, will lead to smaller and faster binaries.

Thread Thread
 
baenencalin profile image
Calin Baenen

A lot of this confused my since I hate (am not friends with (never got to know)) external tools outside of compiling. Wjy can't it just be Files -> Compiler => Product, instead of all this extra vomplex BS??

Though, thanks for the advice, I'll try to look in to it further, and see if I can learn anything.