dotgnu-visionaries
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Visionaries] WebScheme language core now Pre-Alpha


From: Peter Minten
Subject: [Visionaries] WebScheme language core now Pre-Alpha
Date: Mon, 16 Jun 2003 12:53:41 +0200
User-agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.4) Gecko/20030529

Hi folks,

the WebScheme language core is now in a Pre-Alpha state. Before discussing what that means I'll explain the last new additions to the core.

The WebScheme capability mechanism now works with explicitely distributed keys. You can distribute keys from one object to another by using (obj-that-has-keys.give-keys obj-that-wants-keys). That's a private method however. If obj-that-wants-keys is a.b.c and c (or b) is a private field that doesn't matter, give-keys works even with fields you can't access since giving is always allowed.

Btw, it's possible to see all the fields of an object, but for protected and private ones you only see that they are protected and private, nothing more.

So how does documentation generation work? Well, every object simply documents itself. For normal documentation no private or protected data is revealed, if that's not wanted you need the joker key. The joker key is the most powerful key in WebScheme, every object owned by a certain user can be completely opened using the joker key of the user. If you evaluate the contents of a WebScheme script you become the owner of it. If you simply use an object created by another user in a shared WebScheme space you don't own it. If you create an object using the constructor of a class owned by another user you will still own the resulting object.

Now to the last new addition: static fields. Static fields are object fields
that are copied to the new object in a set! case. For example:
(define a 10
  (define set!
    (\ (value)
      (if (< value 100)
          (this._set! value)
          (throw (Exception.new "Too big!"))))
    (static)))

(set! a 30)
((try (set! a 300))
 (catch
   ((when Exception)
    (return #f))))
=> #f

Note that (\ () ...) <=> (lambda () ...).

Right, this is a little tricky example since the setter is overriden. What happens here is that I define the setter of a to be static and tell it to ensure that the new value is smaller than 100. The _set! method is primitive-set!, the system set! that can't be overriden, if I would have used the normal set! here that would create recursion.

Normally the set method would have been dumped since it's a field of an object that has been replaced. The static attribute causes it to be automatically
copied (and reevaluated) by _set! to the new object however.

Generally you shouldn't use static fields since you don't know how well they work in the new objects (int setter doesn't work to well on a string). The use of domains can make static fields a powerful technique however.

----

Now to what the Pre-Alpha state of the core means. It basically means that I declare the core not gaseous anymore, it's still subject to changes whenever that's needed but it's basic design is done.

With the core stabilized a little development on the other language features can now commence. A large part of the language has already been developed, but those parts are usually based on a previous version of the core and thus need to be updated.

As of today I'm also starting on the development of the interpreter. For your convenience here is a little FAQ:

Q: Will the interpreter use TreeCC?
A: No, TreeCC is a useful tool for languages that have things like operators but
 doesn't really work with LISPy languages. Instead I'm using the good old
Flex/Bison model.

Q: In what language will the interpreter be written?
A: C++, because it's fast and able to interface with both C and C++ without much
problems.

Q: Will the interpreter use Guile?
A: No. Guile Scheme and WebScheme are two quite different languages (it's like C
and C#) so there is little to gain with supporting Guile Scheme.

Q: What other libraries will the interpreter use?
A: Dunno yet. I'm thinking of using the GNU bignum lib for numbers bigger than 64 bits (or 32 bits, have to see where the best boundrary is). I'm also thinking of using some portability libs.

Q: What license will the interpreter have?
A: GPL

Q: What license will the base library have?
A: GPL + Linking Exception

Q: What programs will be provided?
A: The interpreter itself is called 'webscheme', symlinked to 'wscm'. Other programs I don't know yet.

Q: Where will the program be hosted?
A: Probably on Savannah. I first want to get it (and the language) in a
reasonable state before applying for a project.

Q: Will the program be part of the GNU project?
A: I'm going for that at least :-).

Greetings,

Peter












reply via email to

[Prev in Thread] Current Thread [Next in Thread]