Hacker Newsnew | past | comments | ask | show | jobs | submit | arakov's commentslogin

A first class message is similar to the function to invoke this message. So it is just a special case of first class function. I uses first class messages to implement a dynamic record - http://www.rosettacode.org/wiki/Dynamic_variable_names#Elena


But it is much more fun to design VM yourself. I could not resist


I can't imagine a modern language without GC. So yes, it has. Destructors are not yet implemented,though I do plan them.


I can. Do you consider Rust not modern?

Destructors are usually hard to support cleanly in the presence of obligate GC. Given destructors, GC turns out to be unnecessary. Lacking destructors, managing non-memory resources becomes foolishly difficult, particularly across library boundaries.


as much as I can see, Rust is a special case. So I mean most of the modern languages. After all I consider C++ modern as well :)


OK then! I will be interested to see how destructors are reconciled with GC.

Where I have seen GC used in C++ runtimes, it is confined to specific, graph-like structures, where tracking cycles would be messy; or provided to obligate-GC languages being interpreted. In both cases it is always clear whether an object's lifetime is tracked, and the C++ runtime does not see the objects.


I know there are problems with destructors. That's why I didn't implement them yet. But in C# they do exist. And after all you may always use explicit finalizers. I don't think that it makes the concept of obligate-GC invalid.

But after all I don't care much. I'm more interested in other parts of language designs :)


ELENA is a general-purpose, object-oriented, polymorphic language with late binding. It features message dispatching / manipulation, dynamic object mutation, a script engine / interpreter and group object support.

The main way to interact with objects in ELENA is sending a message. The message name is structured and consists of a verb, a signature and a parameter counter. The verb defines a message action, for example read or write some data. There are only limited set of possible verbs. The signature is user defined and describes the message parameters. If the signature is not provided the message is considered to be generic and can be qualified (by dispatching).

If the object wants to handle the message it has to contain the method with the same name. If no method mapping was found the flow is considered to be broken and the control goes to the next alternative flow (exception handler) or the program is stopped. It is possible to declare generic handler which will be called for all incoming messages.

A class encapsulates data (fields) with code (methods) to access it. It is not possible to get a direct access to the class content.

To work with the class we have to create its instance with the help of the special methods - constructors.

There are special type of classes which do not have fields and constructors and can be used directly (extensions / symbols).

Classes form the inheritance tree. There is the common super class - system'Object. ELENA does not support multiple inheritance, though it is possible to inherit the code using redirect handler (so called "horizontal inheritance"). When the parent is not provided the class inherits directly system'Object.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: