forked from Whiley/WhileyCompiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
executable file
·123 lines (90 loc) · 4.77 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
__ ___ _ _
\ \ / / |__ (_) | ___ _ _ ___ _ __ __ _
\ \ /\ / /| '_ \| | |/ _ \ | | | / _ \| '__/ _` |
\ V V / | | | | | | __/ |_| |_| (_) | | | (_| |
\_/\_/ |_| |_|_|_|\___|\__, (_)\___/|_| \__, |
|___/ |___/
======================================================================
Introduction
======================================================================
Whiley is a programming language particularly suited to
safety-critical systems. It is a hybrid object-oriented and functional
programming language which employs extended static checking to
eliminate errors at compile time, including divide-by-zero, array
out-of-bounds and null dereference errors.
Whiley compiles to the Java Virtual Machine and is fully
inter-operable with existing Java applications. Whiley will operate
on any system that can run Java including Windows, Mac OS and Linux.
Whiley is released under the New BSD License --- see the LICENSE file
for more on this.
To find out more, visit http://whiley.org
======================================================================
Installation
======================================================================
There are several ways to get started with Whiley:
1) You can install the Eclipse Plugin.
2) Or, you can download and run the executable Jar.
3) Or, you can download and setup the Whiley Development Kit.
The Eclipse plugin is the easiest way to get started with Whiley (see
instructions below). If you don't use Eclipse, another simple option
is to download and run the executable Jar. Finally, developers may
like to download the Whiley Development Kit (WDK), which includes the
source code for the compiler/runtime and various scripts to simplify
compiling and running Whiley programs from the command-line.
1. Whiley Eclipse Plugin (Wyclipse)
----------------------------------------------------------------------
To install the Whiley Eclipse plugin start Eclipse and select "Install
New Software" (normally found under "Help"). Then, add
http://whiley.org/eclipse as a "software site", afterwhich you should
find the "Whiley Eclipse Plugin" becomes an option to install. At
this point, "select all" and follow the instructions to install the
plugin.
For more info on Wyclipse, see http://whiley.org/tools/wyclipse/
2. Whiley Executable Jar
----------------------------------------------------------------------
If you're running on a Windows system without cygwin, or you're having
trouble getting the wyjc scripts to work, then a useful alternative is
to run the executable jar file directly. First, download the
wyjc-all-vX.Y.Z.jar file from http://whiley.org/downloads. Then, you
can compile Whiley files as follows:
% cd examples
% java -jar wyjc-all-vX.Y.Z.jar -bp wyjc-all-vX.Y.Z.jar hello-world.whiley
(here, vX.Y.Z is the version number of the distribution)
Then, to run the program you would do this:
% java -cp "wyjc-all-vX.Y.Z.jar;." hello-world
Hello World
(note: under Mac OS and UNIX you will want to replace the ';' with a ':')
3. Whiley Development Kit (WDK)
----------------------------------------------------------------------
To install the Whiley Development Kit, first download it from
http://whiley.org/downloads. Then, unpack the tarball into an
appropriate directory (as you've probably already done). You then
need to make sure that PATH environment variable points to the bin/
directory, where several scripts are provided for running Whiley.
(don't worry if you don't know what the PATH is, as you can instead
run the jar directly --- see below).
With the PATH setup correctly, you should be able to run the wyjc
command to compile Whiley programs as follows:
% cd examples
% wyjc hello-world.whiley
At this point, you can run the program using the whiley command:
% wyj hello-world
Hello World
(note: the wyj command is just a wrapper for java -cp lib/wyrt-vX.Y.Z.jar).
NOTE: if you're running on a Windows system without cygwin, or you're
having trouble getting the wyjc scripts to work, then a useful
alternative is to run the jar file directly. You can do this as
follows:
% cd examples
% java -jar ../lib/wyjc-vX.Y.Z.jar -bp ../lib/wyrt-vX.Y.Z.jar hello-world.whiley
(here, vX.Y.Z is the version number of the distribution)
Then, to run the program you would do this:
% java -cp "../lib/wyrt-vX.Y.Z.jar;." hello-world
Hello World
(note: under Mac OS and UNIX you will want to replace the ';' with a ':')
============================================================================
Making a Contribution
============================================================================
When making a contribution to the Whiley project, you will need to
first sign-off the developers certificate of origin. Please see the
CONTRIBUTORS file for more details.