C++ 17 may support headerless code. Will UE4, too?

Headers exist because they act as metadata for the compiler. Those were written by hand because back in floppy disk drive age (and still are) since CPUs weren’t fast enough to perform two pass compilation. Now they are fast enough and most languages are compiled in a two pass method. With a module system each .cpp file, class, function, or other block of code is handled separately just like they are handled with headers. The only difference is that the compiler generates the (header) metadata by itself. And I’m sure that the process of including systems into builds would stay somewhat the same, only that instead of working with headers you’d work with modules.

@NegInfinity

Read this sentence again:

Don’t bother about the second sentence, because it would require you also to think:

And I can do the thinking for you. The second sentence is a simple wish and not an actual suggestion. Obviously… -.-

Here you go. This can be found in my original post:

The linked N4047 document, of the proposal for a module system in C++, says the same thing.

TL/DR, But Module support in VS is EXPERIMENTAL.
Which means that there could be breaking changes between now and when/if it is incorporated into the C++ standard.

Modules would be very welcome if they get done right, We just have to wait and see how they turn out.

HTH

True.

I’m wondering if the implementation of modules, could even change more than we think in the end. As far as I know, C# does have only minor native code support. Yeah, I know nothing about native coding in C#. I only know that pointers can be used within the unsafe block.

Once modules are implement into C++. And it actually works, couldn’t C# itself get a more extended support for native code? Like for example using C++ files inside a C# project itself. You wouldn’t be able to create headers. And because of that, you would only be able to use C++ APIs that do have modules.

However, the benefit of this could be a more closer relationship between C# and C++. Let’s call this managed code/native code multi talent: C##. Unity Tech even had to make that IL2CPP thing so that they could maintain their code much easier. Yet, not everybody does have an IL2CPP and with C##, one wouldn’t have to make one. Any engine using C## could offer C# programming much easier. But if C++ speed is needed, just use C++ files instead.

Yeah I know that one doesn’t need IL2CPP to use C# along C++. I just was wondering if a C## language could make things smoother regarding all this. And allow a more effective use of managed code and native code.

So, giving C++ a module support would make all this much more possible in the first place. Game engines could benefit from such a C## very much, obviously.

Just what the heck is wrong with you?

Look, I’d normally expect some level of professionalism and language knowledge in the gamedev community.

Headers are frequently used to control visibility of portions of code as additional visibility control measure in additiona to access modifiers AND namespaces. The paper you linked gets the wrong idea. It assumes that “treating compilation units as separate” is bad thing. It is a good thing, it is actually frequently used feature, and I’d expect you to be already aware of that if you’re using C++. It is something you’re supposed to know and understand. Private/public/interface headers, specific to some feature headers, etc. With module based approach you’ll end up doing more typing.

And instead of working on better mechanism that can fully utilize resources of modern computer during compilation the article wants to modify language. Sure, who the heck would want to utilize gigabytes of available memory on modern machine.

Might?, quote your sources, If C++17 has headerless support only sub-standard programmers would use it, and UE4 is not a sub-standard piece of software, so no, it won’t happen

Plenty is wrong with me, as a matter of fact. For instance, I do have an imaginary bucket full of black paint standing next to my rig. And if don’t like somebody’s mortal face. I Google that person geographical location, grab that bucket, waltz over to their place… and then… paint their rooms in black! Yeah, that will show them… :smiley:

Anyways, that part you quoted. My point was that I don’t make this a C# vs C++. So get this point.

So what you’re saying is that all not C programmers are sub-standard?

C is full of headers as well, So what are you trying to say?

Sorry I must’ve misunderstood you. What exactly did you mean when you wrote “If C++17 has headerless support only sub-standard programmers would use it”? What’s it? Module system?

In this case I expect my room painted by tomorrow. You’re also paying for your own airplane ticket and are expected to handle the visas in allocated time.


Keep polite attitude on those forums. People that go berzerk over small things create very unpleasant impression of the community as a whole. And it is not like it is easy to get assistance with anything non-trivial.

“Headers are a bad thing” is something you’re unlikely to hear from experienced C++ programmer, they’re here for a reason.

And honestly, I haven’t seen other decent approach to this.
Python’s packages, lisp packages, C# unit organization result in more typing in general.
With header based approach, you get overview of what’s important, and then if you need details into *.cpp. It is extremely simple solution, but elegant at the same time.

Speaking of UE4 codebase, it sorta relies on header-based isolation of pieces of code, so I think switching over to that feature is unlikely to happen.

So, just get used to them. If you need examples, Qt source code used to be quite clean, and their projects tend to have nice structure that also minimizes unnecessary recompilation.

That won’t work as all .Net languages compile in IL(I think this is the right term) that then uses a JIT(Just In Time) compiler to generate a (more) optimal code to run on the machine.

HTH

Jesus… Why do programming threads always get so out of control?

Worth mentioning that during the Beta/Rocket program, UE4 only came out with the Header files. We didn’t have the .cpp’s during that time, but the headers were enough to work out how to program in the engine.

All conversation on this subject is hypothetical until some wizard who thinks in assembly implements all this anyway. According to that Wiki page, Mr Stroustrup would ‘prefer’ to have Modules implemented by C++17 but it says nothing about ditching header files. I’m sure that if there are backwards-compatible, non-breaking ways to improve compile times and locality then C++ will eventually adopt them, no programmer is going to want to shoot themselves in the foot. Expecting every major adopter of C++ to move to such a massive change in such a short time period though? Nah. I wouldn’t expect any official comment on this, unless someone at Epic has a magical crystal ball that we don’t know about.

Even so, common sense says that even if C++17 gets it, Unreal isn’t going to jump on it straight away. If we ever see it, it won’t be for years - so in the meantime I would suggest just learning how the header system works / it’s caveats and getting used to it :wink:

IMO, C++ without headers may as well be a new programming language.

That won’t work as all .Net languages compile in IL(I think this is the right term) that then uses a JIT(Just In Time) compiler to generate a (more) optimal code to run on the machine.

HTH
[/QUOTE]

C++, actually has already managed code support. It’s called C++/CLI. However, this makes the C++ source look like even more garbage.

With C##, I would aim for a cleaner solution. Separated C++ and C# files. Eventually the C++ language itself would strip more of its legacy syntax and get some more polish. So C++ wouldn’t look like the original C++, and would really only keep that what it actually needs to maintain its advantage as a native code.

Sadly true. Source code doesn’t update itself to the latest language. Epic Games does have enough work already and the engine is huge, too. Some conversion tools may help, though, with the conversion.

What do you mean?

Anyways, did you know that Jesus is a ferry tale and actually never existed? And even if, that chances are high that he looked like a middle eastern terrorist? Not to mention the fact that religion itself, is as ancient and outdated as C++ headers?

/ troll face
/ science fact

Epic Games would call this a triple kill. See? I’m in control, human. Everything is under control! :smiley:

Oh yeah! That’s what we need! Bring religion into these C++, C# wars.
What’s next politics? :slight_smile:

9ba9582661fb0c340c30131a0fc7f768750e7196.jpeg

I don’t see any C++, C# wars here. I only see evolution. And once I have acquired that evolution, the game dev world is going to kneel before me! Muahahahaha! Har! Har!

I only see intelligent design. Careful my friend, the Gamedev Gods my strike you down. :slight_smile:

Why is C# even discussed here? It has nothing to do with the upcoming module support in C++.

Isn’t that what I was talking about? 0.o

Seems some think that modules are exclusive to managed code.