BETA (programming language): Difference between revisions

Content deleted Content added
No edit summary
m Disambiguating links to Object-orientation (link changed to Object-oriented programming) using DisamAssist.
 
(18 intermediate revisions by 17 users not shown)
Line 1:
{{multiple issues|
{{RefimproveMore citations needed|date=September 2014}}
{{Technical|date=September 2010}}
 
}}
{{Infobox programming language
Line 21 ⟶ 22:
| operating_system =
| license =
| website = {{URL|beta.cs.au.dk/~beta}}
}}
 
'''BETA''' is a pure [[Object-oriented programming|object-oriented]] language originating within the [[Kristen Nygaard|"Scandinavian School"]] in object-orientation where the first object-oriented language [[Simula]] was developed.<ref name="overview">Source: [http://daimi.au.dk/~beta/Papers/BetaOverview/BetaOverview.pdf] Ole Lehrmann Madsen: An overview of BETA</ref> Among its notable features, it introduced [[nested class]]es, and unified classes with procedures into so called patterns.
 
It has been in development since 1976, with implementations known since 1986, by [[Kristen Nygaard]] together with Bent Bruun Kristensen, Ole Lehrmann Madsen, and [[Birger Møller-Pedersen]], at the [[University of Oslo]].
 
The project is inactive as of October 2020.<ref>{{Cite web|url=https://beta.cs.au.dk/|title=The BETA Language Home Page|website=beta.cs.au.dk}}</ref>
 
==Features==
Line 36 ⟶ 41:
 
For example, a simple class in C++ would have the form
<sourcesyntaxhighlight lang="cpp">
class point {
int x, y;
};
</syntaxhighlight>
</source>
In BETA, the same class could be represented by the pattern
<!-- This isn't Pascal, but syntax is similar -->
<pre>
<syntaxhighlight lang="pascal">
point: (#
x, y: @integer
#)
</syntaxhighlight>
</pre>
That is, a class called ''point'' will have two fields, ''x'' and ''y'', of type [[integer (computer science)|integer]]. The symbols ''(#'' and ''#)'' introduce patterns. The colon is used to declare patterns and variables. The ''@'' sign before the integer type in the field definitions specifies that these are integer fields, and not, by contrast, references, arrays or other patterns.
 
OnAs theanother other handcomparison, a procedure in C++ could have the form
<sourcesyntaxhighlight lang="cpp">
int max(int x, int y)
{
if (x >= y)
{
return x;
Line 62 ⟶ 68:
}
}
</syntaxhighlight>
</source>
In BETA, such a function could be written using a pattern
<!-- This isn't Pascal, but syntax is similar -->
<pre>
<syntaxhighlight lang="pascal">
max: (#
x, y, z: @integer
Line 76 ⟶ 83:
exit z
#)
</syntaxhighlight>
</pre>
The ''x'', ''y'' and ''z'' are local variables. The '''enter''' keyword specifies the input parameters to the pattern, while the '''exit''' keyword specifies the result of the function. Between the two, the '''do''' keyword prefixes the sequence of operations to be made. The conditional block is delimited by ''(if'' and ''if)'', that is the '''if''' keyword becomes part of the opening and closing parenthesis. Truth is checked through ''// True'' within an if block. Finally, the assignment operator ''-&gt;'' assigns the value on its left hand side to the variable on its right hand side.
 
===Hello world!===
This snippet prints the standard line [[Hello world program|"Hello world!"]]:<br />
<pre>
(#
Line 88 ⟶ 95:
 
==Further reading==
*Ole Lehrmann Madsen, Birger Møller-Pedersen, Kristen Nygaard: Object-Oriented Programming in the BETA Programming Language, [http://daimi.au.dk/~beta/Books/index.html The Mjølner System: Books]
*Bent Bruun Kristensen, Ole Lehrmann Madsen, Birger Møller-Pedersen: The When, Why and Why Not of the BETA Programming Language, ACM History of Programming Languages III, Conference, San Diego 2007, [https://beta.alexandra.dk/sites/default/files/pdf/BETA-HOPL-V4.7_ref.pdf ] {{Webarchive|url=https://web.archive.org/web/20170211155057/https://beta.alexandra.dk/sites/default/files/pdf/BETA-HOPL-V4.7_ref.pdf |date=2017-02-11 }}
 
==References==
{{Reflist}}
 
==External links==
*{{Official website|https://beta.cs.au.dk/~beta}}
*[https://web.archive.org/web/20040603082024/http://www.daimi.au.dk/~eernst/gbeta/ gbeta] Generalized BETA
 
{{Authority control}}
 
{{DEFAULTSORT:Beta}}