Re: extended operators
- From: "cr88192" <cr88192@xxxxxxxxxxx>
- Date: Mon, 19 Nov 2007 11:19:58 +1000
"Charlie Gordon" <news@xxxxxxxxxxx> wrote in message
news:4740a910$0$30944$426a74cc@xxxxxxxxxxxxxxx
"cr88192" <cr88192@xxxxxxxxxxx> a écrit dans le message de news:
9d788$473ed1e0$ca8010a3$6731@xxxxxxxxxxxxx
"Douglas A. Gwyn" <DAGwyn@xxxxxxxx> wrote in message
news:473E5252.70A3E0D2@xxxxxxxxxxx
Charlie Gordon wrote:
C-- is tempting, but already has several failed incarnations.
Maybe C+- ?
No, this one would not reflect the spirit: first simplify C by removing
the historical crud, then extend it with modern useful stuff. It would
have to be C-+ but it is not sexy ;-)
maybe.
if I were to change a few things about C (making an essentially new,
C-derived lang):
removing the expected support of K&R style declarations;
make prototypes mandatory, at least for external functions, that or add in a
different means for managing shared code (such as a module system);
limit the syntax to only 1 prototype per declaration;
maybe, try to find a way to make parsing context-independent;
find some less horrid syntax for function pointers, and for returning
function pointers;
maybe more clearly splitting out what is part of the declaration and what is
part of the type;
....
however, this would break most backwards compatibility, but oh well...
the language would probably end up looking something like a hybrid between C
and Java.
examples:
import foolib.*; //java-like import notions
int(int)* fp; //this is a function pointer...
vs:
int (*fp)(int);
likewise, for returning said pointer:
int(int)* bar();
vs:
int (*bar())(int);
likewise, such a syntax can be handled linearly, without turrning quite as
horrid:
int(int)*(int)* bar();
vs:
int (*(*bar())(int))(int); //or, however the hell this would go...
in this system, maybe make the type itself is a fully atomic unit, and not a
fused in part of the declaration.
so:
int[64] a, b;
vs:
int a[64], b[64];
context independence, if added, would require either eliminating typedefs,
of for finding a different way to manage them. one example would be to make
typedefs behave similarly to macro-expansion, rather than semantic.
another way would be to find some context-independent way of identifying
types...
an example would be to make it part of statement parsing:
<typename> <name> ...
<typedecl> <name> ...
....
are recognized as declarations.
this case will be recognized if:
in statement context (not part of a sub expession);
is not recognizable as some other valid expression or statement type.
typedecl could be potentially recognized explicitly:
modifier=static | const | ...
specifier= <args_list> | <array_bounds> | '*' | '&'
typedecl=<modifier*> <typename> <specifier*>
aka: anything that looks like a declaration, is assumed to be one by the
parser.
this does limit a few things, for example:
a*b;
is libable to be parsed as a declaration, weather or not 'a' is a visible
type (nevermind that cases like this make little sense).
"(a*b);" would still be an expression though.
failing this, one can live with the context dependency.
and so on...
C$
C%
C^
C&
C*
C_
or, maybe this:
C?
do you use C!
were you @C?
dos boot @C.
...
semantic thoughts:
C? implies "well, maybe it is still C".
no, "C!", could be C with Erlang-style concurrency mechanisms tacked on.
C_ could be sort of like C#, but so named because it falls a little
flat...
You really like operators, don't you?
C* does have appeal.
maybe...
and endless other possibilities...
Yes:
C:
C:\
C:>
C~
C~~
red-C
\C
|C|
<C>
C<C>>
hmm:
C:\>
dos boot?...
nine.
dos command prompt?...
jaw.
....
I like C* best, it is not used to name a computer language yet.
maybe...
--
Chqrlie.
.
- References:
- Re: extended operators
- From: David R Tribble
- Re: extended operators
- From: Charlie Gordon
- Re: extended operators
- From: Antoine Leca
- Re: extended operators
- From: Charlie Gordon
- Re: extended operators
- From: Douglas A. Gwyn
- Re: extended operators
- From: Charlie Gordon
- Re: extended operators
- From: Douglas A. Gwyn
- Re: extended operators
- From: Charlie Gordon
- Re: extended operators
- From: jacob navia
- Re: extended operators
- From: Charlie Gordon
- Re: extended operators
- From: Douglas A. Gwyn
- Re: extended operators
- From: cr88192
- Re: extended operators
- From: Charlie Gordon
- Re: extended operators
- Prev by Date: Re: extended operators
- Next by Date: isodigit
- Previous by thread: Re: extended operators
- Next by thread: Re: extended operators
- Index(es):
Relevant Pages
|