gbeta


 

What is gbeta?

gbeta is a generalization of the programming language BETA. You can download a compiler/interpreter for gbeta, and the source code of this implementation is freely available under the GPL copyright.

 

small gbeta logo

Here are some features of the language:

In gbeta, object metamorphosis coexists with strict, static type-checking: It is possible to take an existing object and modify its structure until it is an instance of a given class, which is possibly only known or even constructed at run-time. Still, the static analysis ensures that message-not-understood errors can never occur at run-time.

It is possible to define relations between classes, e.g., to specify that the class MyPoint must be a subclass of YourPoint (without committing to exactly what classes they are). This makes it possible to define a kind of constraint graph of classes. It ensures that certain relations hold, such that one inheritance operation may give rise to a complex but orderly propagation of type changes in a framework of classes.

Like BETA, gbeta supports inheritance hierarchies not only for classes but also for methods. This can be used together with dynamic inheritance to build dynamic control structures; dynamic control structures enable your algorithms to be parameterized with e.g. a while statement, an iteration through all elements of a given list, or reading input from a file. (NB: a control structure as a parameter is richer than a procedure or function parameter, because the control structure can provide a name space to its body).

BETA already has strong support for co-evolution of classes. For example, the classes vehicle and operator depend on each other, and they should "know" each other's enhancement to car respectively chauffeur. The support for class co-evolution is even more powerful and flexible in the generalized language gbeta, enabling such things as the observerDesignPattern as a class which can simply be used in stead of a micro-design-guide (a "design pattern") which must be re-implemented again and again.

Finally, you might want to get to know more about that weird language called BETA that you have heard so much about but never really tried out, hands on; the gbeta implementation provides in some ways a more dynamic environment even if it is just used to try out BETA programs.

If you are interested in the design or implementation of modern, object-oriented programming languages, you should take a closer look at gbeta. BETA has been around since 1978 or so, but still it is quite innovative and, IMHO it is very well-designed. gbeta implements a superset of BETA, preserving the static type checking and adding a lot of new possibilities.

small gbeta logo

Who doesn't want it, then?

There is currently no support for calling external code (e.g., C libraries), and this prevents the execution of existing BETA programs which could be compiled by e.g. the Mjolner BETA System because the basic libraries of this system depend on some externals. Another limitation is in program size. It would cost too much memory and take too long to run e.g. a 100,000 line program (using many libraries pushes the effective line-count up); 3000 lines is more realistic, especially if lazy analysis is used to achieve a quick startup time. The current gbeta implementation is more for the (possibly academic) geek who is interested in programming language design, and less for the no-nonsense practical programmer who wants to write large mission-critical applications. In other words, it's slow but it uses a lot of memory. Finally, the library support is hardly existing by now. There is a fair chance that some libraries from the Mjolner BETA System will be adapted to work with gbeta and made available somehow for free, but this hasn't happened yet.

small gbeta logo

Why was it created?

It has been developed as part of my PhD project, as a workbench for language design experiments and as a proof-of-concept implementation. The emphasis has been on a clear, high-level expression of the language semantics. This means that language design experiments can be made at a high level by modifying the gbeta implementation itself, using the existing, rather well-encapsulated abstractions. Moreover the implementation is very general, supporting a number of "gray corners" of BETA which have not been implemented in the Mjolner BETA System.

Nevertheless, the main point in implementing the entire language from scratch was to rethink the basic concepts of the language, and to rebuild a language which has traditional BETA as a special case, but at the same time enhances the expressive power considerably.

Feed-back

is always welcome, about the language and/or its implementation, about the language design effort that it incarnates, and about this web site.

small gbeta logo

Aahhh, yes...

...the funny symbol on the many colored background is a gbeta logo, a stylized version of the letters "gb". You are welcome to use this logo on your own web pages if you want to refer to gbeta. And here is a picture which shows a situation during a gbeta session hosted in GNU Emacs (click on it to see more):

screen shot
 


Signed by: eernst@cs.auc.dk. Last Modified: 3-Jul-01