RE: Compiler questions

new topic     » goto parent     » topic index » view thread      » older message » newer message

----- Original Message -----
From: Mike <vulcan at win.co.nz>
To: <EUforum at topica.com>
Subject: Compiler questions


>
>
> I am about to start writing a compiler which I hope will be as easy to
> use as Euphoria but generate executables that run at asm speed. This
> project seems quite ambitious (though that never stopped me before) and
> I would like to get some views from the list on the following questions.
> I have some opinion about most of them but a variety of concisely
> expressed arguments will help me definitely
> decide each point.
>
> Regards,
> Mike
>
> 1. What sort of numerical data types should be there? Only integer
> (signed 32-bit) and real (double precision floats)?
>
Maybe big integers (undefined length). Maybe complex numbers.

> 2. Can restrictions be placed on bitwise operations with real types?
 Yes.
>
> 3. Would 1-d arrays and lists of character strings be enough?
You mean no Euphoria-like sequences? If so, I'll add them. Also
N-dimensional matrixes.
>
> 4. Should it support cdecl?
>
Why not?
> 5. Type conversion - implicit or explicit?
>
I'd prefer explicit conversion.
> 6. Pass by reference - when is this needed?
I'd consider automatic pass by reference: variables passed always by
reference, constants and expressions by value. Parenthesizing a variable
will make it an expression.
>
> 7. What sort of notation could be used to access arrays? structures?
A dot for structures. This is a difficult point for arrays: you should be
able to specify both:
A[{2, 3},{6, 2},{3, 3}] to get a sequence of elements 2:3 6:2 3:3 of a
2-dimensional array, and:
A[{3, 6, 1}, {2, 7}] to get a 2-dimensional array comprising the
intersection of rows 3,6,1 with columns 2,7.
Not clear what notation to use in order to decide among both cases, and more
complex ones.

> 8. Forward references?
>
Yes.
> 9. Control structures other than: if, for, while ?
Maybe switch - case. Not sure.
>
> 10. Error recovery?
Another conflicting point. Try - catch is a pain in the neck. Maybe a single
routine that:
a) if not present, default behavior is provided.
b) if present, the programmer could check the type of error, the routine
where it happened, etc., and take appropiate actions.
Not sure...
>
> 11. Anything else?
Yes. Ability to determine if a variable or routine is or not defined.
Also, capability to dinamically execute strings, or define
functions/procedures.

Too ambitious?
>
>
>
> TOPICA - Start your own email discussion group. FREE!
>
>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu