I have worked with C in embedded systems for many years now, and for our modern Linux systems we are using a combination of C and Java today. Java for parts where memory safety is more important than speed/determinism, and C for the critical real time parts. There should exist a language between these worlds, where we can achieve memory safety at relatively small costs. C++ is not really an alternative, and D looks much more pleasant for us C programmers than for example Rust.
Does anyone know if D is using the vtable implementation for
virtual functions just like most C++ compilers? If yes, can
someone explain the advantages of this strategy? A function
pointer in C is regarded as expensive because of missing
inlining, but a double indirection through a vtable just looks
insane - if there aren't really good reasons for such an
implementation. Does it make class inheritance or class
polymorphism much simpler to implement or what is the reason?
- Vtable for virtual functions in D Henrik via Digitalmars-d
- Re: Vtable for virtual functions i... sarn via Digitalmars-d
- Re: Vtable for virtual functions i... Patrick Schluter via Digitalmars-d
- Re: Vtable for virtual functions i... Patrick Schluter via Digitalmars-d
- Re: Vtable for virtual functions i... Guillaume Piolat via Digitalmars-d
- Re: Vtable for virtual functio... Henrik via Digitalmars-d
- Re: Vtable for virtual fun... H. S. Teoh via Digitalmars-d
- Re: Vtable for virtual fun... Laeeth Isharc via Digitalmars-d
- Re: Vtable for virtual functio... sarn via Digitalmars-d
- Re: Vtable for virtual fun... Mike Franklin via Digitalmars-d
- Re: Vtable for virtual... sarn via Digitalmars-d