Realbasic
Realbasic (RB) is the object-oriented dialect of the BASIC programming language used in Real Studio, a programming environment, developed and commercially marketed by Real Software, Inc of Austin, Texas for Mac OS X, Microsoft Windows, 32-bit x86 Linux and the web.
Language features
RB is a strongly typed language with minimal automatic type conversion, which supports single inheritance and interfaces, class methods and class properties, automatic memory management via reference counting, and operator overloading. A very important feature is the ability to extend (not just inherit from) existing classes, like Objective-C Categories. This considerably reduces the need for the Abstract Factory Pattern, which complicates using Application Frameworks in Java and C++. Realbasic also includes delegates, introspection, and namespace support, which allows modules to contain classes, interfaces and other modules.
Framework features
As described in the language reference, its built-in framework supports (Real Software 2008):
- dictionaries,
- declarations to external libraries (dll, dylib)
- Visual Basic datatypes compatibility,
- full Unicode support,
- regular expressions,
- application programming interface calls to compiled C libraries on all supported platforms,
- ActiveX and basic OLE support (on Windows); COM objects are not fully supported,
- Notification icons (on Windows),
- Windows registry (on Windows),
- cooperative threads,
- scripting language embedded in Realbasic programs through RBScript,
- XML parsing and generation,
- console and service application support (Professional & Enterprise editions only)
- Apple events (on Mac),
- Address book (on Mac),
- Keychain (on Mac),
- Spotlight (on Mac),
- QuickTime (on Mac and Windows),
- sound,
- real-time 3D graphics,
- serial communications,
- sockets (both TCP, UDP and IPC),
- SSL (Professional edition only),
- HTTP, POP3, SMTP and SOAP
The framework functionality can also be extended by creating plugins using the Plugin SDK provided by Real Software. Plugins are created using C/C++ with a variety of supported compilers, including Xcode, Microsoft Visual Studio and gcc. Plugins can support any platform Realbasic supports, but are not required to support all platforms.
Example code
This is an example of operator overloading for a hypothetical Complex class which permits to sum a real to a complex number, and to sum two complex numbers:
Function Operator_Add (rhs As Single) As Complex
Dim ret As New Complex
ret.Real = Self.Real + rhs
ret.Imaginary = Self.Imaginary
Return ret
End Function
Function Operator_Add (rhs As Complex) As Complex
Dim ret As New Complex
ret.Real = Self.Real + rhs.Real
ret.Imaginary = Self.Imaginary + rhs.Imaginary
Return ret
End Function
The same function can be defined to accept Double datatype values. This code shows how to use the Complex class to sum a real with a complex number:
Dim First As New Complex (0, 1)
Dim Second As New Complex (1, 1)
Dim Sum As Complex
Sum = First + 5.0 + Second
// Sum will be (6, 2)
See also
- RBScript - related scripting language
Comparable Basic Dialects
- Gambas - a free approach to object basic
- Visual Basic
Other Programming Languages
References
- Smith, Tony (September 13, 2005). "RealBasic 2005 for Mac, Windows and Linux". The Register. Retrieved 2006-04-11.
- Barr, Joe (August 4, 2005). "Review: RealBasic 2005 for Linux". Linux.com. Retrieved 2006-04-11.
- Real Software (May 6, 2008). "Realbasic Language Reference". Real Software. Retrieved 2008-05-06.
- Tejkowski, Erick (2001). REALbasic for Dummies. Hungry Minds. ISBN 0-7645-0793-1.