PLEASE READ SECTIONS A, B, C, D BEFORE USING ANY OF THIS! |
BETA_OOLI-<date>.zip
. This will create a directory named
BETA_OOLI
.nbeta.exe
and jbeta.exe
resides in the bin
subdirectory.
Make sure you have the BETA_Net/bin directory in your search PATH, if
you want to invoke the compiler from other directories.
BETALIB
to the location of
your BETA_OOLI
directory before using the compiler.JAVAHOME
JNIDIR
DYNEXTENSION
Start->Settings->Control Panels->System->Advanced->Environment Variables
cmd.exe
as shell issue the
command
configuration\cmd_setup.batand if you are using Cygwin
bash
, issue the command
. configuration/cygwin_bash_setup.sh
examples
subdirectory. Some of the programs are more of the test kind than
actual demos. To mention a few of them:
Some .NET specific examples include:
hello.bet
- The traditional "Hello World" program in BETA
LL1.bet
- A simple LL1 parser for a small expression language.
stack.bet
,stackBody.bet
,stackuser.bet
- A small example showing separation of declaration and implementation using the BETA fragment system.
The filestack.bet
declared the patternStack
with SLOTs as its implementation. This is pretty much like an interface in Java/.NET.
The filestackBody.bet
is a trivial implementation of the Stack. It could be replaced by another implementation.
Finally, the filestackuser.bet
instantiates and use such a stack. It suffices to compile this file - the compiler will detect dependency on the other files and compile them as well.NumList.bet
- An example showing parameterized classes in BETA using virtual inner patterns: A pattern
List
is declared with a virtual element-type of justobject
. The patternNumList
inherits fromList
but furtherbinds theelement
type to benumber
, which make the compiler aware that element types in this list now hasnumber
type. Thus there is no need for any generics mechanism in BETA - it's all done by general handling of scoping and virtuality!beer.bet
- Cheers! Just an implementation generation of the lyrics for the traditional song 99 Bottles of Beer on the Wall using various standard BETA facilities.
Bclass.bet
,BclassUser.java
,BclassUser.cs
- A simple BETA class with a few methods.
The .java and .cs files show how to inherit from this BETA class from Java and C#, respectively (see comments in beginning of these files for instructions).
See also Cross language support below.google.bet
- A BETA program that use the Google web service to make a search from the command line.
See also Cross language support below.
Note for ROTOR: The demo programs also compile and work under ROTOR, except - of course - the programs using framework libraries not available in ROTOR; specificly the
hellographics.bet
- A "Hello World" program using Windows Forms and other graphics.
An example of inheriting from an external .NET class (System.Windows.Forms.Form) in BETA.
See also Cross language support below.hellobox.bet
- A simple program showing a Windows MessageBox.
(Jørgen Thyme is the person at Microsoft Denmark who sponsored the initial work on the BETA.Net project).
google
programs do not works, since
System.Web.Services
is not in ROTOR, and the graphics
demos fails because the System.Windows
libraries are not
in ROTOR.
Some JAVA specific examples include:
Notice also the file
helloapplet.bet
- A "Hello World" applet written in BETA.
An example of inheriting from an external JAVA class (java.applet.Applet) in BETA.
See instructions in comment in top of heloapplet.bet.
See also Cross language support below.bpackage.bet
- Example showing how to make the class files generated by the
jbeta
compile end up in another Java package than the defaultbeta
.
SEE_ALSO.txt
which lists various
other demonstration programs.
nbeta.exe
, and the compiler generating java class files
is named jbeta.exe
.
cmd.exe
.
It is also known to work with cygwin bash [http://www.cygwin.com/setup.exe]
nbeta foo[.bet]or
jbeta foo[.bet]for .NET and JVM, respectively, where
foo.bet
is a beta source file containing the definition of
the program
fragment. as indicated, the
.bet
extension need not be given at the command line.
jbeta
.
nbeta --help
--noWarn
(or simply -w
)
option for these first compilations to reduce output.
nbeta.exe
, although much slower.
managed-nbeta.exe foo[.bet]or
managed-nbeta.bat foo[.bet]The first execution will run the compiler as a .NET CLR managed executable, using the Microsoft .NET environment, whereas the second form (the
.bat
) file will execute nbeta.exe
using the ROTOR clix
kick-starter.
Both execution forms will run much slower than the native nbeta.exe
(about a factor 50 slower for a "free" build of ROTOR) and be rather memory consuming
too - these are merely included for demonstration purposes.
The major reason for the slowdown is currently believed to be due
to the very preliminary implementation of Coroutines, of which the
compiler use a lot.
nbeta.exe
before compiling anything with managed-nbeta
to get
the basic libraries compiled before playing with managed-nbeta
.
Also we have seen managed-nbeta.exe
crash with
System.OutOfMemoryException
for some compilations, whereas the same
compilation using the ROTOR wrapper managed-nbeta.bat
never has failed this way. Seems like a functional difference in .NET
and ROTOR.
class
and BETA patterns used only as methods can likewise be
prefixed with keyword proc
. This will reduce the number of
generated .NET classes.
foo.dln
file for DbgCLR.exe
foo.sln
file for
Visual Studio.NET
jdb
, see
documentation/Debugging.html#jdb
nbeta
,
and then reference it from the other language.
A simple example is in Bclass.bet
and
BclassUser.cs
/BclassUser.java
.
Compilation statements are given in the start of the C# and Java files.
clr
and jvm
sub
directories (to avoid cluttering the source directory).
csc
/javac
where to find the DLL's and class files.BclassUser.exe.config
.
-classpath
option
for the Java VM.
External
and ExternalClass
.
See examples/hellobox.bet
, and
examples/hellographics.bet
for .NET examples.examples/helloapplet.bet
for a Java-only example.
examples/google.bet
which use different external classes for .NET and Java using the
MDBODY
fragment mechanism in the BETA compiler,
see
examples/google_clrbody.bet
and
examples/google_jvmbody.bet
.
The latest version of this page is always available at Object-Oriented Language Interoperability