new here, my lang project...
From: cr88192 (cr88192_at_NOSPAM.hotmail.com)
Date: 01/07/05
- Next message: frebe: "Re: What is an OODBMS?"
- Previous message: Neo: "Re: What is an OODBMS?"
- Next in thread: H. S. Lahman: "Re: new here, my lang project..."
- Reply: H. S. Lahman: "Re: new here, my lang project..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 07 Jan 2005 16:09:41 GMT
I am new here. from what I can see this group seems rather active...
afaik this group is about programming, oo, and programming language design.
at least part of this assertion seems held by what messages I have seen.
just introducing myself, and wondering if anyone is interested in talking to
me (with some tweaking to the address at least email should be possible if
one feels not like replying in group).
ok, so for my own personal use I had created a scripting language.
in many ways it resembles javascript (well, this is what had served as a lot
of the basis of the syntax). I had a fair amount of prior experience with
scheme, which served as some of the design as well. some inspiration also
came from self. other ideas came from elsewhere (or from somewhere
below...).
my main programming language, however, is c.
so, basically, it sort of resembles javascript, except a lot of minor things
are changed:
closures, for example, are now called 'fun';
inline syntax exists for creating objects exists;
in many cases the statement/expression distinction is blurred (eg: to allow
terser and more fp style usages);
it supports curried function calls (note: fairly explicit);
also it uses object scoping as the default vs lexical (dynamic is also
present);
it uses a naming convention to indicate delegates, and supports cyclic
delegation graphs;
tail-call optimization is used;
...
I have tried to be conservative where possible, but there are limits...
one can't really gain and utilize new features without making things look or
behave different.
however, I have retained at least a partial emulation of a lot of c's
pointer semantics, for example. this does not, however, preclude other uses,
eg, adding/subtracting from strings (eg, to shift them around) is useful,
and one can still use methods if they feel like it.
operator overloading is used heavily within the implementation, and types
can have built-in methods, ...
all is not well though. this is by no means a "magic" language, nor even
particularly useful for anyone probably besides me, eg:
the language is still rather crude;
the compiled variant has not been well developed or tested;
there is no ffi or bindings to existing apis;
there is a lack of documentation;
the persistent store stuff still needs a lot of work;
I have no real network concurrency features, ... (however, I did implement
an xmpp binding which may still be functional, but I don't remember);
so much more;
...
(not only that but my dad riding me about trying to focus attention on
something that could actually get me a job...).
I don't have any great/compelling examples, things where I have actually
used the language don't look very impressive (I have largely just been using
it like c...).
a few actual fragments for the 3d engine part:
function trigger_multiple()
{
self.solidtype="solid_trigger";
self.movetype="move_none";
if(!self.origin)self.origin=#[0, 0, 0];
self.mins=self.absmin-self.origin;
self.maxs=self.absmax-self.origin;
if(!self.wait)self.wait=2;
self.touch=fun(other)
{
trigger_usetargets();
self.solidtype="solid_not";
self.movetype="move_none";
self.thinktime=self.wait;
self.think=fun()
{
self.solidtype="solid_trigger";
self.movetype="move_none";
}
}
}
function trigger_always()
trigger_usetargets();
function trigger_relay()
self.use=fun()
trigger_usetargets();
even my test fragments were not that impressive...
multi-level breaks/continues:
for(i=0; i<10; i++)for(j=0; j<10; j++)for(k=0; k<10; k++)
{
if(k>2)continue 2;
if(j>2)continue 3;
if(i>2)break 3;
println("nlt ", i, " ", j, " ", k);
}
continuation test:
withcc(cc)
{
println("p1");
fun()
{
println("p1_2");
cc(1);
println("p2_2");
}();
println("p2");
}
println("p3");
async test (err, idea ripped from c-omega where typically async is printed
after sync):
async foo(x, y)
{
println("async ", x, " ", y);
}
foo(2, 3);
println("sync");
thread and pool test:
var a=pool();
var b=pool();
thread {
while(1)
{
println("thread 1: got ", join(a), " ", join(a), " ", join(b));
// println("thread 1: hello");
// sleep(1);
}
};
thread {
local i, s;
i=0;
while(1)
{
s="msg"&(i++);
println("thread 2: send ", s);
a(s);
sleep(1);
}
};
thread {
local i, s;
i=0;
while(1)
{
s="msg2_"&(i++);
println("thread 3: send ", s);
b(s);
sleep(1.5);
}
};
yet I also have goto:
function gfun()
{
local i;
i=0;
l0:
i++;
if(i>10)goto l1;
if(i<5)goto l0;
println("gfun ", i);
goto l0;
l1:
}
hypothetical ones:
(fun r(x, y, n)if(n)r(y, x+y, n-1) else x)
(1, 1, 10);
11th fibonacci number.
var T=fun(x)fun(y)x;
var F=fun(x)fun(y)y;
var IF=fun(c)fun(x)fun(y)c(x)(y);
var AND=fun(x)fun(y)IF(x)(y)(F);
var OR=fun(x)fun(y)IF(x)(T)(y);
...
as one that could demonstate the power of lambda...
- Next message: frebe: "Re: What is an OODBMS?"
- Previous message: Neo: "Re: What is an OODBMS?"
- Next in thread: H. S. Lahman: "Re: new here, my lang project..."
- Reply: H. S. Lahman: "Re: new here, my lang project..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|