Announcement

Collapse
No announcement yet.

Rust for UE ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #46
    Originally posted by Moth Doctor View Post
    Well, 15% lost on the language itself and even just 10 fps lost? It's huge and unacceptable.
    When I wrote "a small price to pay", I actually quoted somebody. I just didn't say so because I can't find the source now. But if I recall it was a AAA dev testing out Rust, and it was also more engine related and nightmare grade bugs that delay projects and cost major project issues. Anyways...

    Also I didn't say game logic, so to clarify, because when I use metrics like "FPS" it sounds like a game. The scenario I was thinking of would be pure software code, no hardware acceleration. If you make an actual game engine with game logic written in Rust. You would have a ton of graphics code running on the GPU, not CPU. It would be way smaller than 10FPS loss in real world. With code that doesn't show GC issues because of their small size, those small size codes you wouldn't notice any FPS drop compared to C++, I think.

    Disclaimer, I'm still learning Rust. Thinks can be worse, but also better. I'm not a web expert at all either, but I noticed benchmarks that show Rust competing with C++ code speed wise: https://www.techempower.com/benchmar...h&test=fortune

    Notice how in the linked benchmarks above there is C++ code that can't even got faster than Java and C#... clearly those source codes need better algorithms... having to bother less about the language short comings of C++, could give more time on algorithm speed ups.

    Originally posted by Moth Doctor View Post
    Maybe if it would allow for some multithreading code written easier to get some performance back, then it could be interesting. With next-gen consoles better utilization of high CPU core count would be very appreciated.
    I haven't tried it yet, but it should be simpler. Rust is a safe language. That mans it's also thread safe.

    Comment


      #47
      IMHO Rust is a 1000x better than C#; but FII still presents a whole lot of challenges if one is willing to integrate with Unreal because of the many custom types that only exist in Unreal and are built using the many tricks C++ provides. Translating these types to Rust and back, I don't think would be easy.
      | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

      Comment


        #48
        It feels as if the same individual starts all these threads (under different user names) about adding another scripting language to UE4 (C#, Rust, etc.)

        Comment


          #49
          Anyway... If "comfort" is a major point, I would in the end go with Swift lol
          That's such a sweet nice language to use.
          | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

          Comment


            #50
            Originally posted by BrUnO XaVIeR View Post
            Anyway... If "comfort" is a major point, I would in the end go with Swift lol
            That's such a sweet nice language to use.
            Yeah, that's the problem with having a bazillion languages on this planet, at some point I just loose count and track.

            The only thing that I know about Swift is that it was also feature suggestion on the old page for Unity. But F# was leading. As a matter of fact, aside of the black UI skin, F# was quite on the top of the most asked features. Swift was lagging behind a lot last I checked a long time ago until Unity took its page down for stupid reasons.
            Originally posted by BrUnO XaVIeR View Post
            IMHO Rust is a 1000x better than C#; but FII still presents a whole lot of challenges if one is willing to integrate with Unreal because of the many custom types that only exist in Unreal and are built using the many tricks C++ provides. Translating these types to Rust and back, I don't think would be easy.
            I'm currently working on my custom game engine in Rust, to learn Rust, and maybe to keep the engine if I shouldn't go for UE/Unity/Godot.

            Thing is that a lot is changing. I'm not sure when it's the right time for making Rust bindings for UE4. For all we know UE5 could support Rust out of the Box. We may need to wait until 2021.

            Rust managed to convince MS to adopt it. MS made it clear that they don't view C++ as a valid choice for safe code anymore.

            MS makes a COM binding generator for Rust and Rust/WinRT already. Dot Net 5 will be merging with Dot Net Core soonish. According to MS this merge is the reason why they make C#/WinRT by lifting the Dot Net Library out of the compiler/run time, and keep Windows exclusive features separated as WinRT. Looks like WinRT is the future. All of Windows 10 SDK may get deprecated and replaced with "language projections" for WinRT. So, there is C++/WinRT, C#/WinRT, and Rust/WinRT. Rust in its WinRT is safe idiomatic Rust code unlike the bindings on crate.io.

            According to one Github user, XInput will get deprecated like Direct Input already is for a long time. Instead we will use a non UWP bound feature in WinRT under name space Game.Input or something. With 2021, also Visual Studio and actually Rust Edition 2021 should come soon if Rust sticks to their 3 year release period, and VS to its 2 year period. There is already some plugin for VS Rust. This is that kind of working environment that UE5 would require for adopting a new language. Jet Brains also supports Rust.

            I'm afraid, personally, I would be far more inclined to stick with my own custom engine all together, if MS finally brought more DX features to WinRT, like DX Ultimate. Well, actual DX11/12 in the first place... Maybe only DX Ultimate will come to WinRT as their new OS Windows 10X, and Office Ultimate pave the way for their unification of their empire at long last so that it could last for 1000 years.

            Comment


              #51
              Originally posted by NickelCoating View Post
              Rust managed to convince MS to adopt it. MS made it clear that they don't view C++ as a valid choice for safe code anymore.
              Seems like other big influencers including Linus Torvalds are fans of rust too: 1 2.
              Linux support in Win10??? - Must have caused ulcers for the Microsoft old guard.
              Last edited by EntrpriseCustomr; 07-16-2020, 01:13 AM.

              Comment


                #52
                KISS ...no looking above im like ya now document all that ********, do 30 courses on it and achieve very little ....profits right for you only

                Comment


                  #53
                  Originally posted by chronoss2008 View Post
                  KISS ...no looking above im like ya now document all that ********, do 30 courses on it and achieve very little ....profits right for you only
                  If I understand you correctly. You are saying that you don't want to learn yet another language? Well, welcome to the club, nobody wants to learn yet another language.

                  However, in my case, it's C++ that is the yet another language. I have learned already C, C#, F#, and of course now Rust(In progress). Also it's 2020 and not 1997, C++ isn't that dominated anymore at all, not even in the game industry, and certainly not for game logic. Nobody really can predict the winner of this race, but my money is on Rust. All of it. Because the worst case is only to have to make my own engine instead.

                  If UE5 can't do it, and I'm not here for UE4, because the latter **** still got an editor that can break your entire project just by moving around assets. Yeah, I actually managed to break a template project already just recently... However, editor extensions are written in C++, too. Or Python now? Yet another language for that what Unity can use C# for all. Or in my case, with my own engine I just could use Rust for all.

                  Anyways, there is actually one big flaw with Rust, at least if you want to use it with UE4/5. Rust doesn't have hot reload yet, at least not officially. But, if the Rust lang devs are serious, and according to their Are We Game Yet web page, they are having their eyes on gaming, too. There could be such a feature for it soonish. It's Rust's design philosophy to be one packages for all your needs, hence the Cargo, documentation, and formatting systems. They made surveys already, they know how to prioritize regarding game dev.

                  Comment


                    #54
                    Originally posted by NickelCoating View Post

                    If I understand you correctly. You are saying that you don't want to learn yet another language? Well, welcome to the club, nobody wants to learn yet another language.

                    However, in my case, it's C++ that is the yet another language. I have learned already C, C#, F#, and of course now Rust(In progress). Also it's 2020 and not 1997, C++ isn't that dominated anymore at all, not even in the game industry, and certainly not for game logic. Nobody really can predict the winner of this race, but my money is on Rust. All of it. Because the worst case is only to have to make my own engine instead.

                    If UE5 can't do it, and I'm not here for UE4, because the latter **** still got an editor that can break your entire project just by moving around assets. Yeah, I actually managed to break a template project already just recently... However, editor extensions are written in C++, too. Or Python now? Yet another language for that what Unity can use C# for all. Or in my case, with my own engine I just could use Rust for all.

                    Anyways, there is actually one big flaw with Rust, at least if you want to use it with UE4/5. Rust doesn't have hot reload yet, at least not officially. But, if the Rust lang devs are serious, and according to their Are We Game Yet web page, they are having their eyes on gaming, too. There could be such a feature for it soonish. It's Rust's design philosophy to be one packages for all your needs, hence the Cargo, documentation, and formatting systems. They made surveys already, they know how to prioritize regarding game dev.

                    You really need to chill down a little. Why are the anti ue4-c++ people always so ... jumpy?
                    Last edited by EvilCleric; 07-04-2020, 05:17 AM.
                    "I have harnessed the shadows that stride from world to world to sow death and madness."

                    Comment


                      #55
                      Rust has a fine foreign function API, and has pretty reasonable interoperability with C/C++.
                      There's no heavy additional runtime requirement, because it doesn't use garbage collection or write barriers or runtime code generation or any of that stuff that the Java/Ruby/JavaScript/Python/PHP developers have to worry about.
                      Thus, you could write your own Rust binding, and it would probably be pretty good, once you started out with the unreal reflection tools and made them bind the UCLASS() and friends to a Rust FFI.

                      Comment


                        #56
                        Originally posted by NickelCoating View Post

                        If I understand you correctly. You are saying that you don't want to learn yet another language? Well, welcome to the club, nobody wants to learn yet another language.

                        However, in my case, it's C++ that is the yet another language. I have learned already C, C#, F#, and of course now Rust(In progress). Also it's 2020 and not 1997, C++ isn't that dominated anymore at all, not even in the game industry, and certainly not for game logic. Nobody really can predict the winner of this race, but my money is on Rust. All of it. Because the worst case is only to have to make my own engine instead.

                        If UE5 can't do it, and I'm not here for UE4, because the latter **** still got an editor that can break your entire project just by moving around assets. Yeah, I actually managed to break a template project already just recently... However, editor extensions are written in C++, too. Or Python now? Yet another language for that what Unity can use C# for all. Or in my case, with my own engine I just could use Rust for all.

                        Anyways, there is actually one big flaw with Rust, at least if you want to use it with UE4/5. Rust doesn't have hot reload yet, at least not officially. But, if the Rust lang devs are serious, and according to their Are We Game Yet web page, they are having their eyes on gaming, too. There could be such a feature for it soonish. It's Rust's design philosophy to be one packages for all your needs, hence the Cargo, documentation, and formatting systems. They made surveys already, they know how to prioritize regarding game dev.
                        its not just that i dont want to leanr another , it shtat if its already based on C++ and your adding a layer over it that cant be efficient as in emulation , it cant be faster better and safer either your adding more vectors for attack, and more chances of some bug that leads to exploits or crashes
                        the fact is KISS means you got C++ unless they rewrite the engine from scratch in rust. then its differant story and while ya learn if it has a blue print system some stuff can then still get done

                        Comment


                          #57
                          Originally posted by chronoss2008 View Post

                          its not just that i dont want to leanr another , it shtat if its already based on C++ and your adding a layer over it that cant be efficient as in emulation , it cant be faster better and safer either your adding more vectors for attack, and more chances of some bug that leads to exploits or crashes
                          the fact is KISS means you got C++ unless they rewrite the engine from scratch in rust. then its differant story and while ya learn if it has a blue print system some stuff can then still get done
                          First of all, Epic already said that there is going to be another language. It's just the question of which one. They don't want to make such a decision lightly. So, the argument of the bug issues introduced by the bindings is out of the way. You will have them with any language.

                          Obviously my personal choice would be Rust. Rust is a good middle ground between safe and fast. Virtually this: Rust = C/C++ + C# + F#

                          Secondly, Rust is native, so regarding interface speed it certainly beats any managed code or interpreted language like C#/F#/Python/Lua, etc. Obviously regarding run time speed it's faster than them, too.

                          The only issue I see is that Rust needs to be learned. C# for instance, a ton of people already know it, especially Unity devs to whom Epic may want to appeal with UE5. And to make things worse, Rust is indeed a notch harder to use than C#, it's still a native code/system language and not the typical managed code. You have to handle the pointers, because although in safe code Rust there won't be issues during run time, there will be issues during compile time. Yes, Rust is very famous for its very user friendly compiler that is quite informative with is suggestions to fix its errors and warnings. New comers like me would know...

                          I'm afraid that there is zero doubt that C# is the community favorite. And because of that eventually will make it into UE5, and not Rust.

                          Comment


                            #58
                            Originally posted by NickelCoating View Post
                            I'm afraid that there is zero doubt that C# is the community favorite.
                            Is that a fact though?
                            Its really hard to know, because so many calls for C# have actually been from outspoken Unity devs.


                            Originally posted by NickelCoating View Post
                            And because of that eventually will make it into UE5, and not Rust.
                            If you read back over the infamous Sweeney reddit thread, things are hardly certain:

                            We like the simplicity of C# but we don't like the impedance mismatch between C#'s containers and managed runtime and C++ data structures. This makes it tough to share data between the C# and C++ world. UnrealScript had a much more direct mapping between the two worlds, yet still the burden of mirroring data was significant.
                            For sure the business side of Epic is probably screaming go with C#, because it will definitely grab attention from Unity devs. But what about Sweeney's original critique here (C# in UE4 will never be Unity componentized C#)... Meantime Epic acquired the SkookumScript team, who might be working on something great and innovative. Plus there were some vague hints about building a middle-ware layer / interface that could possibly allow any kind of scripting to hook into the engine. So its so tricky to call....

                            Comment


                              #59
                              Originally posted by NickelCoating View Post

                              If I understand you correctly. You are saying that you don't want to learn yet another language? Well, welcome to the club, nobody wants to learn yet another language.

                              However, in my case, it's C++ that is the yet another language. I have learned already C, C#, F#, and of course now Rust(In progress). Also it's 2020 and not 1997, C++ isn't that dominated anymore at all, not even in the game industry, and certainly not for game logic. Nobody really can predict the winner of this race, but my money is on Rust. All of it. Because the worst case is only to have to make my own engine instead.

                              If UE5 can't do it, and I'm not here for UE4, because the latter **** still got an editor that can break your entire project just by moving around assets. Yeah, I actually managed to break a template project already just recently... However, editor extensions are written in C++, too. Or Python now? Yet another language for that what Unity can use C# for all. Or in my case, with my own engine I just could use Rust for all.

                              Anyways, there is actually one big flaw with Rust, at least if you want to use it with UE4/5. Rust doesn't have hot reload yet, at least not officially. But, if the Rust lang devs are serious, and according to their Are We Game Yet web page, they are having their eyes on gaming, too. There could be such a feature for it soonish. It's Rust's design philosophy to be one packages for all your needs, hence the Cargo, documentation, and formatting systems. They made surveys already, they know how to prioritize regarding game dev.
                              Learned a lot! Thanks!
                              So many information for Rust.
                              Look forward to something like "WebAssembly" in UE4, which doesn't care about the programming language.

                              Comment


                                #60
                                Originally posted by yinaak View Post
                                Look forward to something like "WebAssembly" in UE4, which doesn't care about the programming language.
                                I think WebAssembly is an excellent addition to Rust.

                                I'm not a web guy. Seems it may chance though. Because I like to make small tools for myself once in a while. I just finished Rusty Savings that computes from my bank account's transactions how much money I didn't spend for a month, so how much I "saved" for that month and the entire year. I'm not under the impression that a managed code language could write those 206 lines of code much faster.

                                Of course one doesn't need a system language for such non performance driven tasks, but doing it with another language gets you to have to learn yet another language, and worse, you may have to learn yet another set of APIs, too, a huge waste of time. Side note, F# can use ALL C# code/bindings just like that since it also supports OOP and .Net. But unlike F#, not even Rust is that lucky with C. Because Rust is safe by default, while C isn't. You may have to create safe wrappers yourself.

                                Anyways, I never thought that managed code could outlive its usefulness. And now try to do the same thing with C/C++. You will get slowed down not by one notch, but by at least two, writing the same code.

                                WebAssembly seems to be another step towards making the programming world more universal by allowing it to run compiled binaries from virtually any language. If you game's GUI is solid enough. You can use it not only for the game itself, and the usual tooling/editor or even game launcher task, but also your web site, so forum, so everything else. This is another case where sticking to one language gives you benefits. You won't have to make bindings either or give up on an API. And with Rust no matter how small, or how big the code is, or how fasts it needs to be, with Rust you can write it all with a descent production speed and quality.

                                At least that's my opinion judged by what I could learn from my Rusty Savings tool and the current game engine that I write to also learn Rust in the first place.

                                Comment

                                Working...
                                X