473,406 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

C++ improvements: core and user properties, default compiler

To continue some ideas of "C++ Archeology: Limits of OO paradigm", i want
to ask about C++ development.

There are C++ compilers, that has been written in old good C. Are C or
pascal perfect languages that can be used to build any powerful OO
language with mutable source representation, as C++ could be? Obviously
no.

Is current C++ can be used to build the OO language? Obviously no, because
unfortunatelly C++ simultaneously is not-trivial for implementation, but
quite limited for users.

I have got a hint, that we can select "core of C++" (that does not mean
the core must be completely compatible with current C++ or its subset) and
use the not-mutable core language to build all concrete-hardware "complete
C++" compilers. The "complete C++" language can be the powerful OO
language with mutable source representation, structured by dialects.

The core language properties must be:
- compiler of the core must be able to be easy implemented by C-like
language
- the core must be very conservative (to resists all possible
improvements)
- the core must be suitable to express complete C++ compiler

The related questions are:
- what kind (enumerated set of properties) of language must we take for
core compiler?
- what set of properties and paradigms (in comparison with current C++)
must be supported by the core language?

The complete language can have "default compiler" - the thing with the
follow properties:
- public source code in terms of "core language"
- very slow, but pure incremental
- very easy to be extended by users with new dialects

The "default compiler" can be represented as:
- front-end translator from any concrete representation of "C++ source" to
concrete unified "internal (not for human using) representation"
- front-end compiler and logical optimiser from "internal representation"
to "code generator source code"
- code generator and hardware optimiser from "code generator source code"
to "compiled representation"
- C++ uints linker from "compiled representation"
- traditional static linker -//-
- C++ dynamic linker -//-
- traditional dynamic linker -//-

The related questions are:
- what (enumerated set of properties) is
- unified "internal (not for human using) representation"
- "code generator source code"
- "compiled representation"

Pure logical optimiser can be impossible to implement, so logical and
hardware optimisers can be implemented as separated, but related to the
concrete hardware pair for each concrete hardware

So, what can you advise about all of these?

Maksim A. Polyanin
http://grizlyk1.narod.ru/cpp_new
--
Message posted using http://www.talkaboutprogramming.com/...comp.lang.c++/
More information at http://www.talkaboutprogramming.com/faq.html

Feb 23 '08 #1
8 1897
co**@mailvault.com wrote:
>There are C++ compilers, that has been written
in old good C. Are C or pascal perfect
languages that can be used to build any
powerful OO language with mutable source
representation, as C++ could be?
Obviously no.

This is a problem with the gnu stuff.
No, i am not speaking about gnu stuff. Limitations here can be explained
by nature of programming language - nature of supported paradigms.

It is hard to write mutable results in languages, that has no enough
abstraction.

Maksim A. Polyanin
http://grizlyk1.narod.ru/cpp_new
--
Message posted using http://www.talkaboutprogramming.com/...comp.lang.c++/
More information at http://www.talkaboutprogramming.com/faq.html

Feb 25 '08 #2
Mattias wrote:
>What do you mean by "mutable results"?
Read first message of the thread.

By the way, it seems to me, the first message is an example of questions
of OO conceptual level decomposition of the C++ domain and i asked experts
of C++ compilers who can describe the domain.
C++ compiler can be written in C
Have _you_ done it already?

Maksim A. Polyanin
http://grizlyk1.narod.ru/cpp_new

--
Message posted using http://www.talkaboutprogramming.com/...comp.lang.c++/
More information at http://www.talkaboutprogramming.com/faq.html

Feb 27 '08 #3
Grizlyk wrote:
>What do you mean by "mutable results"?

Read first message of the thread.
I did before responding. The term "mutable result(s)" doesn't appear in
there. What does appear is "mutable source representation" but I have no
idea what this is supposed to mean.
What exactly is your question?
By the way, it seems to me, the first message is an example of questions
of OO conceptual level decomposition of the C++ domain and i asked experts
of C++ compilers who can describe the domain.
It sounds more like gibberish to me, sorry.
>C++ compiler can be written in C
Have _you_ done it already?
I don't have to.
Feb 27 '08 #4
Grizlyk wrote:
>>>C++ compiler can be written in C
Have _you_ done it already?
I don't have to.

The "have to" is wrong modal verb maybe? If you say "can be written", you
can prove it by anything, can't you?
The g++ (Gnu) compiler is written in C. Probably some others too.
Feb 27 '08 #5
LR
Grizlyk wrote:
Mattias wrote:
>C++ compiler can be written in C

Have _you_ done it already?

I'm sorry, but I don't understand the point of this question. No matter
the language of the compiler, the compiler is compiled too, and runs in
machine language.

And I think that it is well established that any task that can be
performed by a particular Turing complete language can be performed by
any Turing complete language.

Am I mistaken?

Do you think there is some requirement for C++ that requires something
special in the language used to implement it? What in particular?

LR
Feb 27 '08 #6
LR wrote:
I'm sorry, but I don't understand the point of this question. No matter
the language of the compiler, the compiler is compiled too, and runs in
machine language.

And I think that it is well established that any task that can be
performed by a particular Turing complete language can be performed by
any Turing complete language.

Am I mistaken?
This doesn't take anything away from the point you're making, but it
seemed worth pointing out that this is only true in the context of
Turing machines. C and sed are both Turing-complete; but you can't open
a network socket in sed*. :)

*Ignoring silly things like using the "r" command to open a device file
that opens a network connection, or using sed to drive a program through
a pipe to do so.

Of course, only someone who has neither written nor studied any sort of
compilers could believe that a language such as C would not be capable
of handling a compiler for the complete C++ language.

Grizlyk's arguments would make _somewhat_ more sense if the argument
were whether you could write a program to translate C++ into C programs
with identical functionality, though even there phe'd be wrong. In fact,
I believe Comeau Computing has just such a beast (and, of course, C++
was originally implemented via a compiler-to-C, though the language back
then was not nearly as complex).

If I were planning to write a C++ implementation, writing it in C would
be something I'd strongly consider, in no small part because (old)
standards-conformant C implementations still appear to be more plentiful
than C++ implementations, and because even if I chose to write it in
C++, I might choose to avoid many of the most advantageous pieces of the
C++ Standard Library, as I might not be able to depend on their having
been implemented as optimally as I might wish.

Of course, writing in C++ would have the advantage that I could then
bootstrap my implementation, which is a terrific, "eating your own
dogfood" way to test it. :)

--
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
Feb 27 '08 #7
Micah Cowan wrote:
LR wrote:
>I'm sorry, but I don't understand the point of this question. No
matter the language of the compiler, the compiler is compiled too,
and runs in machine language.

And I think that it is well established that any task that can be
performed by a particular Turing complete language can be
performed by any Turing complete language.

Am I mistaken?

This doesn't take anything away from the point you're making, but it
seemed worth pointing out that this is only true in the context of
Turing machines. C and sed are both Turing-complete; but you can't
open a network socket in sed*. :)

*Ignoring silly things like using the "r" command to open a device
file that opens a network connection, or using sed to drive a
program through a pipe to do so.

Of course, only someone who has neither written nor studied any
sort of compilers could believe that a language such as C would not
be capable of handling a compiler for the complete C++ language.

Grizlyk's arguments would make _somewhat_ more sense if the argument
were whether you could write a program to translate C++ into C
programs with identical functionality, though even there phe'd be
wrong. In fact, I believe Comeau Computing has just such a beast
(and, of course, C++ was originally implemented via a
compiler-to-C,
Which was, of course, written in C++.

http://www.research.att.com/~bs/bs_f...#bootstrapping
though the language back then was not nearly as
complex).

If I were planning to write a C++ implementation, writing it in C
would be something I'd strongly consider, in no small part because
(old) standards-conformant C implementations still appear to be
more plentiful than C++ implementations, and because even if I
chose to write it in C++, I might choose to avoid many of the most
advantageous pieces of the C++ Standard Library, as I might not be
able to depend on their having been implemented as optimally as I
might wish.
Hey, if you write your own C++ compiler, you will of course have the
best Standard Library implementation as well. Just write that one
first!
>
Of course, writing in C++ would have the advantage that I could then
bootstrap my implementation, which is a terrific, "eating your own
dogfood" way to test it. :)
See! :-)
Bo Persson
Feb 28 '08 #8
Let's return to OP questions. Of course, at last, I will do it myself, but
conditions, selected by me, could be incomplete.

I hope, one can see by the thread why i have written once, that we must
strictly divide C++ and STDLib. This is _really_ different things and the
things have really different experts.

Maksim A. Polyanin
http://grizlyk1.narod.ru/cpp_new
--
Message posted using http://www.talkaboutprogramming.com/...comp.lang.c++/
More information at http://www.talkaboutprogramming.com/faq.html

Mar 1 '08 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Logan | last post by:
Several people asked me for the following HOWTO, so I decided to post it here (though it is still very 'alpha' and might contain many (?) mistakes; didn't test what I wrote, but wrote it - more or...
23
by: Rotem | last post by:
Hi, while working on something in my current project I have made several improvements to the logging package in Python, two of them are worth mentioning: 1. addition of a logging record field...
6
by: martin | last post by:
Hi, I am a web page and a web user control. My web user control is placed in my web page using the following directive <%@ Register TagPrefix="uc1" TagName="Header"...
7
by: Bit Twiddler | last post by:
Hi, I have a windows form app which would benefit from the new application settings support in VS2005. Say that my form has a single textbox on it. When the form closes I would like to save...
6
by: wenmang | last post by:
Here is the code which causes core dump when is built differently, 1 for regular dev built, the other for packaging build. class my_class{ public: my_class(){}; ~my_class(){}; private:...
15
by: John Nagle | last post by:
I've been installing Python and its supporting packages on a dedicated server with Fedora Core 6 for about a day now. This is a standard dedicated rackmount server in a colocation facility,...
16
by: arnuld | last post by:
/* C++ Primer 4/e * section 3.2 - String Standard Library * exercise 3.8 * STATEMENT * write a programme to read strings from standard input, concatenate all of them * in one string where...
71
by: Jack | last post by:
I understand that the standard Python distribution is considered the C-Python. Howerver, the current C-Python is really a combination of C and Python implementation. There are about 2000 Python...
5
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
Prior to C# 3.0, I would typically define a property of a custom user control with pattern A: === PATTERN A ========== private bool myBool = true; public bool MyBool { get { return myBool; }...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.