Sign in to follow this  
sankrant

Writing a game engine in Rust

Recommended Posts

sankrant    121
Rust programming language can be the next systems programming language and can be great for game programming.
My question is how much logistic and scripting support should I get if I write a game engine in rust....
My next question is, Should I wait for the 0.3 release or a beta release...
Can anyone probably guess if a systems programming language will be used in future to write game engines, and not managed application languages?

Share this post


Link to post
Share on other sites
Hodgman    51341
[quote][b]11 Interacting with foreign code[/b]
One of Rust's aims, as a system programming language, is to interoperate well with C code.[/quote]The Lua VM is a C API, so yes, you should be able to use it from Rust easily.[quote]My question is how much logistic and scripting support should I get if I write a game engine in rust....[/quote]Can you re-phrase the question? I don't understand what you're asking.[quote]Can anyone probably guess if a systems programming language will be used in future to write game engines, and not managed application languages?[/quote]That's been the trend so far, with C++ being the popular systems programming language. It will be a long time until managed languages replace C++ for this job. Edited by Hodgman

Share this post


Link to post
Share on other sites
sankrant    121
the question to be rephraced is self answered... thanks.( it meant canned libraries and tools)

I started using rust because everybody says that C++ is less used now, and its future is just like cobol.

Talking about C++
Why there is much talk (and scoldings to me for 'wasting my time with c++') about using a managed language at systems programming sphere??
Are you sure C++ has a bright future? (at least in game engines)???

Share this post


Link to post
Share on other sites
Tordin    625
[quote name='sankrant' timestamp='1341469113' post='4955856']
I started using rust because everybody says that C++ is less used now, and its future is just like cobol.
[/quote]

I dont think c++ is less used now than it was five years ago, and i dont think c++ will be going out soon either.

Share this post


Link to post
Share on other sites
sankrant    121
Then who are those people who misguide young people like me?
Why my freinds laugh at me when I use c++?

So according to you, we will not be switching languages, and keep on using newer standards of c++ only(in present case c++11)?????

Share this post


Link to post
Share on other sites
M6dEEp    904
[quote name='sankrant' timestamp='1341472849' post='4955876']
Why my freinds laugh at me when I use c++?
[/quote]

Do they only use managed languages?? I told some of my buddies that I wanted to learn C++ and I got weird looks followed by the all too common question "Why".

Share this post


Link to post
Share on other sites
sankrant    121
[quote name='M6dEEp' timestamp='1341474599' post='4955882']
[quote name='sankrant' timestamp='1341472849' post='4955876']
Why my freinds laugh at me when I use c++?
[/quote]

Do they only use managed languages?? I told some of my buddies that I wanted to learn C++ and I got weird looks followed by the all too common question "Why".
[/quote]

And thats the main reason that makes me ask about the status of c++ at present, and obviuosly at the future...

Can someone solidly state about the future of game programming and the future of c++ ?????
In future, are we going to see c++xx or c# or something else like rust??
Who is right? My freinds or my soul??

There are many questions(especially doubts about my skills..) to be answered.

Share this post


Link to post
Share on other sites
Hodgman    51341
To quote wikipedia:[quote]A System programming language is usually used to mean "a language for system programming": that is, a language designed for writing system software as distinct from application software.[/quote]

The very names of these categories should be a hint -- "systems programming" languages are well suited for low level "systems programming" tasks, where you're thinking about bits and bytes and structures made up of them.
"Managed" languages are not as suitable for these tasks, because they've already done a lot of the systems programming tasks for you ([i]e.g. they've implemented a GC for you, often precluding your own implementation[/i]). Instead, these languages are often called "productivity languages" ([i]because programmers are supposedly more productive when using them[/i]) and are designed to make "application programming" easier, where you're thinking about abstract objects and high-level "business logic", instead of bits and bytes.

Systems programming languages are great for writing [i]game engines[/i], but aren't the best for writing [i]games[/i]. Higher level ("managed"/"application"/domain-specific) languages are generally able to implement high-level game logic with less code, and with less effort from the programmer, but make low-level operations harder or even impossible to write.

For example, Lua is often used for game programming, but it is of little use to engine programmers, because it's lacking in the fundamental data types required by a lot of low-level systems code ([i]e.g. it can't manipulate bytes or raw integers[/i]).
C# (+ .NET) is a great "managed" language, and it lets programmers write code very quickly, but when used for systems programming tasks, it becomes complicated and extremely verbose (arguably more verbose than C++).

The standard practice in the games industry is (IMHO):
*Engine runtimes and performance-critical systems are written in C/C++.
*Game logic is written in a "productivity language", such as Lua or C#. Sometimes C++ is used here, but only when the game team are more comfortable/experienced with it than other languages. Edited by Hodgman

Share this post


Link to post
Share on other sites
Hannesnisula    1126
[quote name='sankrant' timestamp='1341476507' post='4955894']
Can someone solidly state about the future of game programming and the future of c++ ?????
In future, are we going to see c++xx or c# or something else like rust??
Who is right? My freinds or my soul??
[/quote]

I guess it's not possible to solidly state any future but it doesn't seem like C++ is going away for a while.
If you learn C++ (or any other language really) it will be quite easy to learn any other language. Programming is a skill and the language is just a tool.
You don't risk "wasting" your time learning a specific language.

Share this post


Link to post
Share on other sites
SimonForsman    7642
[quote name='sankrant' timestamp='1341476507' post='4955894']
And thats the main reason that makes me ask about the status of c++ at present, and obviuosly at the future...

Can someone solidly state about the future of game programming and the future of c++ ?????
In future, are we going to see c++xx or c# or something else like rust??
Who is right? My freinds or my soul??

There are many questions(especially doubts about my skills..) to be answered.
[/quote]

As for the current state, it is used less in general these days for application level work (With C# taking a very large chunk from it), game logic is being moved to higher level languages(Lua, Python, C#, and many others are common), as a systems programming language it is still standing strong though (And thus it is the most commonly used language in game engines).

As for the future it really is impossible to tell, C++ is severely flawed, (its getting better and better but its far from perfect), Most system programming languages however suffer from similar problems, Rather than replacing C++ as a language for game engines in the near future i'd expect us to get better tools and libraries, (The industry is heavily invested in C++ so a new systems programming language has to be significantly better to take over making it fairly unlikely to happen)
Things like compilers that actually tell you what you did wrong (clang is miles ahead here and i'm sure gcc and msvc will follow suit) and libraries such as boost(Allthough C++11 includes most of the good features from it) go a long way to make C++ far less of a pain in the ass and more will come.

Share this post


Link to post
Share on other sites
sankrant    121
Thank you all..

I am conviced that, we would not be switching anything, but willbe building better things upon the infrastructure..
We will continue to use C++ for engines, and use HL Languages for logic for a considerably long future ahead.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this