Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion Ideas on RTTI support?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
Dmitry A. Kazakov  
View profile   Translate to Translated (View Original)
 More options 19 June, 08:54
Newsgroups: alt.os.development, comp.lang.misc
From: "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
Date: Fri, 19 Jun 2009 09:54:57 +0200
Local: Fri 19 June 2009 08:54
Subject: Re: Ideas on RTTI support?

On Fri, 19 Jun 2009 02:50:23 -0400, Rod Pemberton wrote:
> "Scott Balmos" <sbal...@fastmail.fm> wrote in message
> news:4a516244-9d26-4e26-b46a-9d5a0b0823fd@m19g2000yqk.googlegroups.com...
>> [snip]
>> Has anyone ever attempted writing C++ RTTI support in an OS, if not in
>> a kernel?

> No, I use C.  I'll listen to your idea though.  But, I'm not familiar with
> RTTI.   Since I'm not, could you explain why or what you're wanting to do in
> your OS?

> I mean, from what I've been able to gather about RTTI, it's a C++ feature
> that apparently allows you to perform a validity check on a type cast or
> type conversion at runtime instead of at compile time.  What advantage does
> doing this at runtime have?  What I'm trying to ask is, once your code is
> compiled and passes the compile time checks for a specific cast or
> conversion, why would it also need to do a runtime check?  I'm assuming this
> has something to do with C++'s programming paradigm...  Overloading?

Checking is a wrong word, identification is a correct one. The type
identification is necessary to be able to perform dynamic dispatch. Since C
is does not have polymorphic objects there is no dispatch and no need in
identification.

As for OS support there are problems with it:

1. Reuse of the type identifiers (tags), after the type dies (leaving its
scope). The tags should be dense or hashable in order to have dispatch
efficient.

2. Global scope of the tags. In a distributed OS you will need to have
unique tag for whatever possible type.

3. Persistence (stored polymorphic objects must keep their unique type
tags)

4. Language impedance. Some languages like C++ define the way type tags
must behave, which is inconsistent, limiting, and inefficient for more
advanced OO languages. It might be difficult to find a common denominator.

I guess that tags (and dispatching tables) would have much in common with
the virtual memory management.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google