?

Log in

No account? Create an account
Dryice Update - The Desian Universe
Links Home / GitHub January 2017
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
 
 
 
deskitty
deskitty
Des
Sun, Jul. 25th, 2004 01:59 pm
Dryice Update

So ... I was quite productive yesterday with Dryice.

Libdiutil is mostly ready to go. I think there might be a few more bits of documentation that need to be done, but it's passing all its unit tests now, which makes me inordinately happy. I can now concentrate on writing the meat of the language ... I can decide things like "What is an object?" "What is a class?" "What basic operations will the language support?" and all that other fun stuff.

I'm still wrestling with two problems, though ... first is the constructor problem, and then the problem of how to handle parameterized types (a la C++'s class templates).

>>> More Constructor Problem Ideas

I think I have an idea about the constructor problem ... perhaps have a real "constructor" (like C++, Java, etc), but make it return the constructed frame which contains all the object's private data, e.g.:

class My3DPoint(int: x, int: y, int: z) is My2DPoint(x, y):
    {
        frame(
            // x and y are handled by the 2d point earlier
            int: _z = z
        )
    };

    public function<My3DPoint>: blah = { ... };
.


[A frame is an object that holds name->value pairings, but unlike a dictionary or hash, those pairings can't be changed once the frame is created. In Dryice, there is one frame per class in an object, to hold that object's private data.]

...except that seems very unwieldy, and it requires some special-casing with respect to parameters passed to the constructor (so that the parent class' constructor gets called first and with the right parameters).

Or perhaps I only allow has-a relationships internally and add some syntactic sugar to make some of those has-as look like is-as:

class My3DPoint:
    { let (int: x, int: y, int: z).
        object(
            class My3DPoint;
            is My2DPoint(x, y);
            int: _z = z;
        )
    }
.


...except that also presents a problem, because it opens up the possibility for dynamic inheritance which tends to make things slow (I don't want to look at each individual class in the inheritance tree to find a method), or memory-intensive (no, thank you, I don't want to maintain a list of public members for each and every single object :p). It also doesn't handle interfaces too well (yes, as in Java interfaces ... I don't like the idea, but it's easier to implement and more deterministic than multiple inheritance), and it still has the same kludgy feel as solution #1.

I'm not really sure which of the two is more palatable ... I think this is one of those things I'm going to have to sit and play with for a while before I come up with a decent answer.

-- Des

Current Mood: geeky geeky
Current Music: Paul Oakenfold - Hold Your Hand (Vocals Emiliana Torrini)

15CommentReplyShare

elocinoco
elocinoco
Elocin Oco
Sun, Jul. 25th, 2004 04:25 pm (UTC)

::shivers:: Honey? That's just....::deep sigh:: lovely. I have no idea what it all means but tell me more. ::purrs::


ReplyThread
deskitty
deskitty
Des
Sun, Jul. 25th, 2004 04:46 pm (UTC)

And here I was expecting innuendo about how productive I was writing code on Code Naked Day ... ;)

Or wait, that probably wouldn't be innuendo at that point ...

More? There's much more. Hell, you can read the source if you want, or at least, the documentation ... ;)

The docs are probably pretty boring, though. At least, I got sick of writing them very quickly. ;P


ReplyThread Parent
elocinoco
elocinoco
Elocin Oco
Sun, Jul. 25th, 2004 05:14 pm (UTC)

::purrs and rubs against you sinuously:: Wouldn't you rather read them to me??


ReplyThread Parent
deskitty
deskitty
Des
Sun, Jul. 25th, 2004 06:42 pm (UTC)

I don't know ... would I get through the first 20 lines? :)


ReplyThread Parent
elocinoco
elocinoco
Elocin Oco
Sun, Jul. 25th, 2004 07:17 pm (UTC)

::arches eyebrow:: Darling, would it matter?


ReplyThread Parent
deskitty
deskitty
Des
Sun, Jul. 25th, 2004 07:24 pm (UTC)

hmmmm. Knowing you, probably not. ;P


ReplyThread Parent
elocinoco
elocinoco
Elocin Oco
Sun, Jul. 25th, 2004 07:31 pm (UTC)

::licks your jaw and bites your earlobe, tugging on it, gently:: You're right. I would be most...accomodating. You wouldn't even remember your silly code.


ReplyThread Parent
xenithtoast
xenithtoast
Xenith
Sun, Jul. 25th, 2004 08:23 pm (UTC)

Silly? Code is not silly, foolish woman!


ReplyThread Parent
elocinoco
elocinoco
Elocin Oco
Sun, Jul. 25th, 2004 08:32 pm (UTC)

::twines self around Josh and glares:: I wasn't talking to you. You had your chance. So kiss your knuckles for foreplay and work it out for yourself.

::nuzzles Josh's neck, threads fingers through his hair:: Tell him to go, away love. And I'll make it every so good for you...::purrs::


ReplyThread Parent
deskitty
deskitty
Des
Sun, Jul. 25th, 2004 08:30 pm (UTC)

Earlobes ... *shiver*


ReplyThread Parent
xenithtoast
xenithtoast
Xenith
Sun, Jul. 25th, 2004 06:52 pm (UTC)

Good lord woman, I know geeks are sexy and all... (being one myself), but you need to take a cold shower. ;-)


ReplyThread Parent
elocinoco
elocinoco
Elocin Oco
Sun, Jul. 25th, 2004 07:17 pm (UTC)

Honey, if you're looking to get in on the action...just start talking. There's enough of me to go around! ::winks suggestively::


ReplyThread Parent
xenithtoast
xenithtoast
Xenith
Sun, Jul. 25th, 2004 07:22 pm (UTC)

Maybe, maybe. But I'm sure I'm certainly more than you can handle.

Besides, I'm at a geek low at the moment. :)


ReplyThread Parent
elocinoco
elocinoco
Elocin Oco
Sun, Jul. 25th, 2004 07:38 pm (UTC)

Honey, I doubt you'd know what to do with me if you had me.


ReplyThread Parent
xenithtoast
xenithtoast
Xenith
Sun, Jul. 25th, 2004 07:46 pm (UTC)

Don't underestimate the power of the Xenith. I'd know exactly what to do.

The question is, would I want to? :)


ReplyThread Parent