BETA (programming language): Difference between revisions

Content deleted Content added
m Removed needless piping in 2 links. Added official website template. Finished dividing text into 3 paragraphs.
m Disambiguating links to Object-orientation (link changed to Object-oriented programming) using DisamAssist.
 
(46 intermediate revisions by 36 users not shown)
Line 1:
{{multiple issues|
{{About|the programming language||Beta (disambiguation)}}
{{UnreferencedMore citations needed|date=DecemberSeptember 20072014}}
{{Technical|date=September 2010}}
 
}}
'''BETA''' is a pure [[object-oriented]] language originating within the "Scandinavian School" in object-orientation where the first object-oriented language [[Simula]] was developed.
{{Infobox programming language
| name = BETA
| logo =
| paradigm = [[Object-oriented programming|Object-oriented]]
| year =
| designer = [[Bent Bruun Kristensen]], [[Ole Lehrmann Madsen]], [[Birger Møller-Pedersen]], [[Kristen Nygaard]]
| developer =
| latest_release_version =
| latest_release_date =
| latest_test_version =
| latest_test_date =
| typing =
| implementations =
| dialects =
| influenced_by = [[Simula]]
| influenced =
| operating_system =
| license =
| website = {{URL|beta.cs.au.dk}}
}}
 
'''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.
From a technical perspective, BETA provides several unique features. Classes and Procedures are unified to one concept, a [[BETA pattern|Pattern]]. Also, classes are defined as properties/attributes of objects. This means that a class cannot be instantiated without an explicit object context. A consequence of this is that BETA supports [[nested class]]es; and BETA's nested classes are indeed{{Reference necessary|date=June 2010}} one of the primary sources of inspiration for [[Java (programming language)|Java]]'s [[inner class]]es. Classes can be virtually defined, much like virtual methods can be in most object-oriented programming languages. Virtual entities (such as methods and classes) are never overwritten; instead they are redefined or specialized.
 
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]].
BETA supports the object-oriented perspective on programming and has comprehensive facilities for procedural and functional programming. It has powerful abstraction mechanisms to support identification of objects, classification and composition. BETA is a strongly typed language like [[Simula]], [[Eiffel (programming language)|Eiffel]] and [[C++]], with most type checking done at compile-time. BETA aims to achieve an optimal balance between compile-time type checking and run-time type checking.
 
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>
== See also ==
 
*[[Simula]]
==Features==
*[[Birger Møller-Pedersen]]
===Technical overview===
*[[Kristen Nygaard]]
From a technical perspective, BETA provides several unique features. Classes and Procedures are unified to one concept, a [[BETA pattern|Pattern]]. Also, classes are defined as properties/attributes of objects. This means that a class cannot be instantiated without an explicit object context. A consequence of this is that BETA supports [[nested class]]es. Classes can be virtually defined, much like virtual methods can be in most object-oriented programming languages. Virtual entities (such as methods and classes) are never overwritten; instead they are redefined or specialized.
 
BETA supports the object-oriented perspective on programming and has comprehensive facilities for procedural and functional programming. It has powerful abstraction mechanisms to support identification of objects, classification and composition. BETA is a statically typed language like Simula, [[Eiffel (programming language)|Eiffel]] and [[C++]], with most type checking done at compile-time.<ref name="overview"/> BETA aims to achieve an optimal balance between compile-time type checking and run-time type checking.
 
===Patterns===
A major and peculiar feature of the language is the concept of patterns. In another programming language, such as [[C++]], one would have several classes and procedures. BETA expresses both of these concepts using patterns.
 
For example, a simple class in C++ would have the form
<syntaxhighlight lang="cpp">
class point {
int x, y;
};
</syntaxhighlight>
In BETA, the same class could be represented by the pattern
<!-- This isn't Pascal, but syntax is similar -->
<syntaxhighlight lang="pascal">
point: (#
x, y: @integer
#)
</syntaxhighlight>
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.
 
As another comparison, a procedure in C++ could have the form
<syntaxhighlight lang="cpp">
int max(int x, int y)
{
if (x >= y)
{
return x;
}
else
{
return y;
}
}
</syntaxhighlight>
In BETA, such a function could be written using a pattern
<!-- This isn't Pascal, but syntax is similar -->
<syntaxhighlight lang="pascal">
max: (#
x, y, z: @integer
enter (x, y)
do
(if x >= y // True then
x -> z
else
y -> z
if)
exit z
#)
</syntaxhighlight>
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>
(#
do ’Hello world!’->PutLine
#)
</pre>
 
==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==
*{{officialOfficial website|httphttps://daimibeta.cs.au.dk/~beta}}
*[https://web.archive.org/web/20040603082024/http://www.daimi.au.dk/~eernst/gbeta/ gbeta] Generalized BETA
 
{{Authority control}}
[[Category:Object-oriented programming languages]]
 
{{DEFAULTSORT:Beta}}
[[af:BETA]]
[[Category:Object-oriented programming languages]]
[[cs:BETA]]
[[da:BETA]]
[[de:Beta (Programmiersprache)]]
[[it:BETA]]
[[no:BETA (programmeringsspråk)]]