How do I set up GDNative Rust

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Joe0239

I know that you can use Rust in Godot but I can I please have some help in setting this up?

I never found any docs of this, but may be you can ask the developers on gdnative/rust github page and open an issue requesting for information.

p7f | 2019-01-08 14:43

Thank you for the link

Joe0239 | 2019-01-08 23:44

You are welcome. If you find a solution, please post it here as it may help others.

p7f | 2019-01-08 23:48

I will bro :slight_smile: By the way, at Github, it seems like people have posted issues 4 months ago, is the project dead?

Joe0239 | 2019-01-09 07:58

i don’t think is dead… 4 moth is not too long time in my opinion for open source projects, specially for one not too much used ad godot-rust…

By the way, as the github says, rust support for godot is a work in progress… if you are planning to do some serious game developing with godot, i would recommend you using official supported language. What is your goal with this?

p7f | 2019-01-09 11:42

Oh I see, thanks for letting me know.

I don’t even like GDScript, GDScript’s syntax kinda sucks and it is slower compared to other languages.

While C# is better and I actually do like its syntax, cause its an interpreted language, its slower than GDNative C++.

I could have been using GDNative C++, but Rust has this memory safety features plus it has high level language features. That is why I am after GDNaitve Rust. Especially since I have now been using Rust for some time now.

Do you know how they did the benchmark tests with Godot and compared various languages?

Joe0239 | 2019-01-10 00:21

Hi, about the benchmarks, i havent seen anything. However, imho, processing speed is not the main focus when programming games. You only look for better performance if your game is running performance issues. The programming goals differs depending what are you trying to achieve. Today, game programming goal is time to market primarly. If you can achieve same look and feel and gameplay with a “slower” language, but in less time, then tou should use it. I think there are only two good reazons to not using gdscript. The first would be that you already tryed gdscript and did not worked out cause performance issue. The second would be tha you are a really experienced programmer in some language and you think you’ll finish the game in less time if you use it.

I must disagree that gdscript syntax sucks. I really like it, and of course i would not use it for everithing, but is my first choice for games. In my opinion, gdscript syntax is way more clean and easy to read than C#, and i think (can’t be sure) that the reason for including C# is because is an already used language in Unity.

Also, i must point out that godot tryed also lua and python languages before making gdscript, and they realized the best experience for programmers would be having a language specifically made for games, and it was a good choice in my opinion.

That being said,If you are planning to do a serious game, with deadlines, well defined goals, and all that… i highly recommend gdscript. If you already know that you are going to have performance issues with gdscript, just use gdscript for things with no performance issues and GDNative (with C++ or Rust or D) ONLY in the scripts you do have performance issues. Other way i think you’ll be investing time in something that was not necesary.

So, what is your goal with godot?

p7f | 2019-01-10 00:59

If you can achieve same look and feel and gameplay with a “slower” language, but in less time, then tou should use it.

I do believe that I can use Rust and it can offer me a faster language and in less time as it has all the high level features while being a low level langauge. This is not true with C++ but Rust addresses these issues and offers a language where you can use high level features, that is why I want to use it. In fact, Rust might be even “safer” compared to C# as it has got strict compile checks and with certain logical errors get converted into compile errors so that there is less debugging involved.

The second would be tha you are a really experienced programmer in some language and you think you’ll finish the game in less time if you use it.

Well I am more experienced with C# compared to GDScript but I have been using (learning) Rust these days so I might have more experience with it compared to C#.

I must disagree that gdscript syntax sucks. I really like it, and of course i would not use it for everithing, but is my first choice for games. In my opinion, gdscript syntax is way more clean and easy to read than C#, and i think (can’t be sure) that the reason for including C# is because is an already used language in Unity.

I can see why GDScript might be cleaner compared to C# and Rust and I will agree on you with that. But I kinda like the curly braces and the use of semicolins that indicate end of line. It gives more more control as to where I want to place the code. I guess cause I have used C-like syntax a lot more compared to something like Python’s syntax so I guess this is just my perference.

just use gdscript for things with no performance issues and GDNative (with C++ or Rust or D) ONLY in the scripts you do have performance issues.

Thanks for the suggestion I will keep that in mind. For my learning purposes I would like to use GDScript and GDNative Rust and learn how to use both.

So, what is your goal with godot?

Well I want to start developing games using Godot. I just need to create some models and animate them before I am really ready to use the game engine.

Can I ask how long have you been using Godot and what languages have you used with Godot?

Joe0239 | 2019-01-10 07:43

Hi, most that i said is just matter of opinions and taste. I hope the project is not dead and that they answer how to set it up soon. If you like C syntax, have you tried D language with gdnative? I haven’t but at least github page tells you how to setup.

I’ve been using godot for only a couple of month now. I’ used python a vplay before, and also tryed lua a little. Then i started to use godot and i think is the best i found untill now. I tryed Unity also, but is windows only and i dont use windows. In godot i tryed gdnative C++ jus for curiosity, but never really needed to go outside gdscript yet. My purpose are only educational untill know (i teach in school and univeristy)
As other programming experiences, I’ve also been teching introduction to numerical programming in my university for 6 years now, and tryed python fortran C, and now we are using scilab. Also i work programming embedded systems in C, some web application programming, and GUIs in C++ and Qt/QML. Sometimes when i run performance issues in GUI, i mix QML with C++ (similar to what i suggested you to do with Gdscript and gdnative).

p7f | 2019-01-10 11:10

Hey bro

have you tried D language with gdnative? I haven’t but at least github page tells you how to setup.

I am not even familiar with D plus there is not much D tutorials and references.

I’ve been using godot for only a couple of month now. I’ used python a vplay before, and also tryed lua a little. Then i started to use godot and i think is the best i found untill now. I tryed Unity also, but is windows only and i dont use windows.

What OS do you use, is it Ubuntu or something based on GNU/Linux? Also in your personal opinion which game engine is better, Unity or Godot. I used to use Unity but man I just found it so horrible to use. It was slow, I had to do something and when I exactly copied from a video tutorial it just didn’t work for some reason, the interface kinda sucks. exporting models didn’t always work for me perfectly etc. Yes sure I am also inexperienced but still I had the worst experience using Unity. That is why I came to Godot, one thing I do like about it is that it is really fast, like I make a change to one of my files in the project folder via external program (for example editing a Blender model file), with Unity it took forever to update when you focused on a Window, with Godot, less than a second it updates everything in its editor.

In godot i tryed gdnative C++ jus for curiosity

Is setting up GDNative C++ similar to setting up GDNative Rust?

As other programming experiences, I’ve also been teching introduction to numerical programming in my university for 6 years now, and tryed python fortran C, and now we are using scilab.

Wow I never knew you were a professor, nice :slight_smile:

Also i work programming embedded systems in C, some web application programming, and GUIs in C++ and Qt/QML. Sometimes when i run performance issues in GUI, i mix QML with C++ (similar to what i suggested you to do with Gdscript and gdnative).

I have no idea what is QML but wow you seem quite smart :slight_smile:

Joe0239 | 2019-01-10 13:50

What OS do you use, is it Ubuntu

Right now i’m with ubuntu studio.

Also in your personal opinion which game engine is better

Godot all the way. But is my opinion.

Is setting up GDNative C++ similar to setting up GDNative Rust?

IDK because i’ve never set up GDNative Rurst, but here you have info about using C++

I have no idea what is QML

Is just a scripting language Qt developed for fast development of GUI. Is declarative and very easy to use. It allows you also to script in javascript and use javascript libraries (with some limitations) VPlay is a framework to make games with QML, but is not open source.

seem quite smart :slight_smile:

Not at all! i’ve just worked in different things many years and got this experience. Is not being smart what make you get experience in my opinion… its just time (more knows the devil for being old than for being the devil). Surely there are plenty other users that knows more and better. I follow a lot kidscancode, gdquest, and others.

p7f | 2019-01-10 14:04

Have you ever tried BSD before?

Godot all the way. But is my opinion.

In what way Godot makes it a better game engine compared to Unity in your opinion?

IDK because i’ve never set up GDNative Rurst, but here you have info about using C++

Thanks for the link mate :slight_smile:

Not at all! i’ve just worked in different things many years and got this experience. Is not being smart what make you get experience in my opinion.

Well you know a lot of stuff, the more stuff you know the smarter you are. Cause you put in the effort to learn all these different kinds of stuff that is how you became smart.

Joe0239 | 2019-01-10 22:19

:bust_in_silhouette: Reply From: Joe0239

So there is a video made to help set up GDNative Rust for Godot.

Here is the ‘issue’ that I created on Github.