Compilers
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Web Development Archives FAQs Compilers

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Web Development Archives Sponsor:
  #1  
Old July 1st, 2008, 11:40 PM
Gabriele Farina
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Incremental compilation and type checking

Hi,

I'm going to start writing a compiler for a typed language (similar
to Java or JS 2.0). This is my first real compiler and I'd like to ask
you some questions hoping u can help me out in designing the compiler
correctly.

What I want to do is to support incremental and multithreaded
compilation, so I can compile each class file separately in an object
and recompile only the files that have been changed between different
compilations.

My idea is to compile each file in its own thread, generating an
itermediate object code which contains a data section and an header
section. In the data section I'll put the bytecode and the required
tables (class table, constants table, etc ), and in the header
section I'll put some additional informations related to type
dependencies. During compilation I'll do a partial type check when
possible, reserving type checking for externally defined types while
linking the object files.

Linking will be done by one single thread, doing the final checks and
mergin them together the data sections (adding offsets to the tables
when necessary).

Do you think that this could work ?

I'm asking about type checking because I've no idea how it is handled
by multithreaded compilers.

In general it would be great if someone can provide me some links to
useful documentation about this topic.

Gabriele

Reply With Quote
  #2  
Old July 3rd, 2008, 07:40 AM
Eliot Miranda
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Incremental compilation and type checking

Gabriele Farina wrote:
I'm going to start writing a compiler for a typed language (similar
to Java or JS 2.0). This is my first real compiler and I'd like to ask
you some questions hoping u can help me out in designing the compiler
correctly.
>

What I want to do is to support incremental and multithreaded
compilation, so I can compile each class file separately in an object
and recompile only the files that have been changed between different
compilations.
>

My idea is to compile each file in its own thread, generating an
itermediate object code which contains a data section and an header
section. In the data section I'll put the bytecode and the required
tables (class table, constants table, etc ), and in the header
section I'll put some additional informations related to type
dependencies. During compilation I'll do a partial type check when
possible, reserving type checking for externally defined types while
linking the object files.
>

Linking will be done by one single thread, doing the final checks and
mergin them together the data sections (adding offsets to the tables
when necessary).
>

Do you think that this could work ?
>

I'm asking about type checking because I've no idea how it is handled
by multithreaded compilers.

Read up on in-line caches and polymorphic in-line caches in dynamic
languages like Smalltalk and Self. Then leave the type checking to
send time when a message is first sent. If the type check fails rase
a dynamic error. if the type check succeeds the in-line cache at the
send site is suitably updated and subsequent sends for the same type
avoid the type check.

Provide static type checking in a separate whole-program analysis tool
that is not used by the compiler. See Gilad bracha's papers on
typechecking Smalltalk.

You will get both excellent run-time performance form using in-line
caches and a more flexible and pleasant to use type system from keeping
it independent from the run-time.

--
The surest sign that intelligent life exists elsewhere in Calvin &
the universe is that none of it has tried to contact us. Hobbes.
--
Eliot ,,,^^,,, Smalltalk - scene not herd


Reply With Quote
Reply

Viewing: Web Development Archives FAQs Compilers > Incremental compilation and type checking


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway