Re: lang effort: type conversions
- From: "Curtis W" <cwarren89@xxxxxxxxx>
- Date: 30 Jun 2006 12:41:49 -0700
cr88192 wrote:
if anyone cares (or wants to make comment), after working some more of theis that your entire type system? It seems pretty limited to me.
inferencer for the lang I am implementing, I have started to consider some
rules.
in its basic semantics, the lang will be dynamically typed with a prototype
object system, however, the lang will also have the ability to define static
types and use them for basic optimizations.
at this point in time, a lot of type violations aren't caught, and those
that are often only generate warnings. this may change eventually (it is
still the first month of implementation).
the basic syntax is more or less c style, and similar goes for declarations:
int x;
int fib(int x)if(x>2)fib(x-1)+fib(x-2) else 1;
there will also the variant type ('var'), which may take any other type, and
will not have many of the same restrictions as the other types.
in the case of functions, types may be ommited:
fact(x)if(x>1)x*fact(x-1) else 1;
in which case, variant will be assumed (unless the inferencer thinks
otherwise).
in the case of variables, a type is still required so that the parser is
sure that it is a definition, eg:
var x;
most casts will be implicit, but an explicit cast may be written as the typeThere's no need for casting in a dynamic language. That's a conversion
name followed by an expression:
(long 3)/4.
:) Also, if you have special syntax just to convert between built-in
types, I don't like it.
.
- References:
- lang effort: type conversions
- From: cr88192
- lang effort: type conversions
- Prev by Date: Re: RAD vs. performance
- Next by Date: Re: RAD vs. performance
- Previous by thread: Re: lang effort: type conversions
- Index(es):