4 ms·
>an ISO C++ compliant implementation can run bare metal, there isn't any requirement that an OS must exist Ok? so This point contradicts you, the language defi
by Banana699 5y ago
>an ISO C++ compliant implementation can run bare metal, there isn't any requirement that an OS must exist
Ok? so This point contradicts you, the language defines no runtime support, so it's very difficult to do the things that a language with a runtime in its specification considers for-granted.
>a C++ runtime is responsible for running all global variable contructors and destructors, handling exceptions, soft floating operations, loading shared libraries on demand for dynamic linking (depending on OS capabilities or bare metal), how new/delete translation into the underlying OS/MMU.
This is a misuse of the term as used in our context, almost all of the above can be considered as simply linked/injected code. The global variable initialization is done by startup code injected by the linker, the construction and destruction code is routine boilerplate inserted by the compiler at specific fixed locations, the new/delete operators simply wrap calls to the underlying memory allocators to call constructors and destructors properly, etc... Nothing of these features knows anything of value about the source code it's injected into, they are just boilerplate function calls inserted for housekeeping. Only loading dynamic libraries can be considered as remotely "runtimey", and I have never heard of them done on anything without an OS.
>so when I use static reflection in C++, either via template metaprogramming,
This is compile-time reflection, it's neat but has nothing to do with dynamacity or runtime support. The original point was 'C++ is drastically less dynamic than Java because it's binaries are very thin and it's philosophy is that the compiler shaves as much of the high-level semantics as it can and leaves nothing but raw, dumb, optimized bits'. I don't see how compile-time metaprogramming contradicts this.
>or with the features that sadly will only come in C++26,
What are those features exactly? do they include, for example, that the compiler injects the name, fields and method signatures of every class into an inspectable object? If yes, then those features, when they come, _will_ make C++ significantly more dynamic. (and its binaries significantly fatter)
>really I just picked C++ as first example that came into my mind
A very bad example to say the least.
>We can also start discussing Eiffel, Delphi, Swift or Go
Let's do it indeed, I love discussing programming languages! What exact features or abstractions of each of those language that you think will classify it as dynamic? If they are similar in quantity or quality to what the JVM does it should indeed qualify as more dynamic than C/C++ (almost everything is). Dynamic-Static is a spectrum, not a binary category.
- pjmlp 5y agoI got you have created your own definition of what a "dynamic" language is supposed to be, live happy.