Operation execution and types

Norbert Widmann <widmann@forwiss.tu-muenchen.de>
12 Feb 1999 02:53:50 -0500

          From comp.compilers

Related articles
Operation execution and types widmann@forwiss.tu-muenchen.de (Norbert Widmann) (1999-02-12)
| List of all articles for this month |

From: Norbert Widmann <widmann@forwiss.tu-muenchen.de>
Newsgroups: comp.compilers
Date: 12 Feb 1999 02:53:50 -0500
Organization: Compilers Central
Keywords: types, design


we are implementing a DBMS for multidimensional raster data
(http://www.forwiss.de/~rasdaman/). For a variety of reasons we
decided to implement our own type system. We support as primitive
types 1, 2 and 4 byte signed and unsigned integers and Float,
Double. Additionally, user-defined composite types are supported.
Implementation is done in C++, operation execution is done by
mapping char* to the appropriate C++ types using conversion

What we have to do is choose the appropriate C++ function actually
executing the operation depending on the types involved.
Obviously, errors have to be raised if the operation is not
applicable to the types.

Now back to the topic: Compilers have to do the same when
generating code for executing operations. I took a (very) short
look at the gcc source code to check how it is done there. All I
could find was a huge amount of nested if-statements looking very
similar to my code. The problem is that modifications to this code
(e.g. when adding new operations or primitive types) are not
exactly simple and usually produce bugs.

What I would like to have is a simple abstract specification
language where I can specify the operations available, their
applicability on type combinations and rules for generating code
(C++ in my case) depending on the types. I am thinking of
implementing this myself in Perl, as our type system is not too
complicated. But I am very curious about publications adressing
this problem or even systems doing this. I am not exactly an
expert in compiler construction, I just know the basic principles.
And I never actually used tools like yacc or lex.

Best regards,
-Norbert Widmann

    Norbert Widmann FORWISS Muenchen Projekt: RasDaMan
      Bayerisches Forschungszentrum fuer wissensbasierte Systeme
                        E-Mail: widmann@forwiss.tu-muenchen.de
                WWW: http://www.forwiss.tu-muenchen.de/~widmann/

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.