Discussion:
The Ultimate Representation of C++ Semantics
(too old to reply)
borisS
2011-12-07 12:19:50 UTC
Permalink
The starting idea for this approach is fairly simple -- since the
fundamental types of C++ are quite similar to the conventional C++
classes -- why not represent them with the help of standard C++
constructs. Consequently applying this idea to other C++ built-ins,
the complete language could be defined in the form of a primordial
library containing the explicit definition of all language
fundamentals. The version of C++, extended by such expression
abilities, will allow compositions of distinct collections of
fundamental types, control statements and implementation mechanisms.

Unfortunately, the practical attempt to compose such a description
fails immediately because several characteristics of C++ built-ins are
looked at as being basically inexpressible in the conceptual system of
this programming language.

The work www.generalinformationtheory.com/cpp.php shows how minor
extensions of C++ enable the explicit definition of its complete
semantics and demonstrates the general specification of C++ produced
in the extended C++.
Simon Trew
2013-01-15 08:48:09 UTC
Permalink
Post by borisS
The starting idea for this approach is fairly simple -- since the
fundamental types of C++ are quite similar to the conventional C++
classes -- why not represent them with the help of standard C++
constructs. Consequently applying this idea to other C++ built-ins,
the complete language could be defined in the form of a primordial
library containing the explicit definition of all language
fundamentals. The version of C++, extended by such expression
abilities, will allow compositions of distinct collections of
fundamental types, control statements and implementation mechanisms.
Unfortunately, the practical attempt to compose such a description
fails immediately because several characteristics of C++ built-ins are
looked at as being basically inexpressible in the conceptual system of
this programming language.
The work www.generalinformationtheory.com/cpp.php shows how minor
extensions of C++ enable the explicit definition of its complete
semantics and demonstrates the general specification of C++ produced
in the extended C++.
I think it's generally accepted that base types in C++ are not first class types as they are in other languages especially functional languages, and are sometimes are in Java or c# (all the boxing malarkey that goes on there).

It's all Bertie Russell's fault really by insisting that a class is not a set (that is essentially the Russel Paradox). So having set the scene for a set not being allowed to be a member of itself, you have to then have a hierarchy of types (classes, sets, call them what you will). The thing is he was worried about infinite sets, but as computer programmers, we are always dealing with the finite. Memory and processors get bigger and faster, but are still finite. So those problems go away wqhen you allow a class to be a member of a class (set or type, I am not het up on the names). Often these are called metaclasses etc these days, but they are not metaclasses. The class "Class" describes classes. Its instances are classes. And so "Class" is an instance of class. From that, all else follows.
Loading...