Download

Rust for UE ?

I start learn rust lang.
Seems very good for games.
How about add rust support to UE?
I think it be big step to UE game stability.

3 Likes

No any try?

You could start a poll, but my vote is: no thanks. :stuck_out_tongue: … Who needs another language that looks like C++ and is just as complex. UE4 is a big part of architects offices, design shops and film / tv studios, along with many other businesses. Does it make sense for them to learn Rust or C++??? If Epic add a scripting language, it should be simple / easy like LUA / Office VBA… My vote goes for something new anyway, but geared more towards game dev specifically, like AGOG SkookumScript was …

Don’t want to re-learn another language. I tried it a bit and seems pretty different. Not bad but i feel like C++ is more suited for game development anyway. Plus there are other more important things like improving the C++ workflow and improving Live++ and so on.

Maybe Unreal Basic will make the engine complete, one day. The right way to make super basic games.

Stability doesnt come from a language.

Then instead of 50,000 lines of C++ to make a small game we would only need 4 million lines of basic!

Maybe not, but simplicity / predictability often does though… :stuck_out_tongue:

Nope. That claim will not hold.

lol I see you don’t know Futurama.
that is just a reference to an episode of Futurama :wink:

I understand! Still doesn’t make it true.

I took a look.

It’s the same as binding any DLL, in Rust you wrap everything into a extern ‘C’ {…} and then compile your Rust application as *.so or *.a library.
Then you load the library into Unreal and call functions from it. Boring stuff, making extern C functions is the most boring thing to do even if you use automatic header generation tools.

Every time you need something more you have to add more extern functions :confused:

No need to poll, no need to ask. If you think it is good, why dont you make it yourself, and then present it here? :wink:

Rust is actually interesting as a binding because no need for memory management AND no garbage collector needed either.

But yeah, if you want to use it you have to write extern C api yourself and do BP → C++ → C → Rust…
Then Rust → C → C++ → BP.

That is very annoying code to deal with once you go above the HelloWorld level.
Btw I know that some AAA studio migrated to Rust doing that, just don’t remember which one. Maybe was “Ready at Dawn”, not sure.

I went over a small test just to see if Unreal would allow this or if it would complain…
Turns out it’s possible to make it work indeed:

Rust application compiled as --lib:

extern “C” interface:

called Rust functions from within Unreal project’s module:

works fine:

[HR][/HR]

Now all you need is an ARMY of programmers to port Unreal’s code to Rust language :wink:
Good luck lol

2 Likes

Related question… Can ‘Magic Nodes’ ever be extended to support simpler scripting languages?

In theory yes.
In practice I would need funding to do that, because that would become a full-time job for me.


Also, what exactly do you mean with “simpler”?
My first programming language I ever used was BlitzBasic, and I still love the way it was structured.
Do you mean THAT simple or you mean “simple like C# and Java”?! ( those aren’t simple, they just hide complexity)

[USER=“434”]BrUnO XaVIeR[/USER]

Good to know, cheers for the confirm. Will you create a forum thread or blog post about this feature sometime?
(Something specific for the community to rally behind, especially if Sweeney’s reddit turns out to be vaporware)…

By simpler I mean BlitzBasic / OfficeVBA / LUA. While Java / C# are easier vs C++, neither are simple as BP.
Question: If you got funding, could ‘Magic Nodes’ ever be used to expose parts of the engine to Blueprints etc?

I have no idea…
I can’t drop my job to do it, so what I am saying is it’s probably not going to happen anytime soon.
I wouldn’t encourage anyone to wait for it. Can be done, but I won’t even talk about ‘whens’ and ‘ifs’… right now I only tinker with these things on weekends.

I’m not familiar with Rust’s FFI stuff, how much work would it be to transfer more than primitive data types across the boundary? Would it just require doing the mapping into structs on Rust side and annotating them with #[repr(C)]? What about C++ side?