File: index.xml

package info (click to toggle)
nice 0.9.12-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 7,220 kB
  • ctags: 6,894
  • sloc: java: 42,767; xml: 3,508; lisp: 1,079; sh: 736; makefile: 673; cpp: 21; awk: 3
file content (162 lines) | stat: -rw-r--r-- 5,562 bytes parent folder | download | duplicates (4)
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<?xml version="1.0" standalone="no"?>
<page>
<title>Presentation</title>
<description>
Nice is an advanced programming language that extends Java with 
parametric types, functional programming and more!
</description>
<keywords>java, nice, programming language, compiler, free, object oriented, functional, multi-methods, method</keywords>

<section>
<para>
Nice is a new programming language. It extends the ideas behind
object-orientation in order to better support modular programming and
static type safety. It also incorporates features from functional
programming, and puts into practice state-of-the-art results from
academic research. This results in more expressivity, modularity and
safety.
</para>

<variablelist>
<varlistentry><term>Safety</term>
<listitem>
<para>
  Nice detects more errors during compilation than existing 
  object-oriented languages (null pointer accesses, 
  casts exceptions).
  This means that programs written in Nice never throw the infamous
  <literal>NullPointerException</literal> nor 
  <literal>ClassCastException</literal>.
  This aspect is developed in more details in 
  <ulink url="safety.html">this article</ulink>.
</para>
</listitem>
</varlistentry>

<varlistentry><term>Modularity</term><listitem><para>
  In object-oriented languages, it is possible to add a new class 
  to an existing class hierarchy. 
  In Nice, it is also possible to add <emphasis>methods</emphasis> to 
  existing classes without modifying their source file. 
  This is a special case of <emphasis>multi-methods</emphasis>.
</para>
</listitem>
</varlistentry>

<varlistentry><term>Expressivity</term><listitem><para>
  Many repetitive programming tasks can be
  avoided by using Nice's advanced features. 
  Ever got bored
  of writing tons of loops, casts, overloaded methods with default
  values, anonymous classes, ... ?
</para>
</listitem>
</varlistentry>

</variablelist>

<section><title>Advanced features</title>

<para>
In addition to traditional object-oriented features, Nice offers:

<variablelist>
<varlistentry><term>Parametric types</term><listitem><para> 
  This is especially useful for containers 
  (lists, hash-tables) and allows for shorter and safer code.
  Values of primitive type (int, float, ...) can be used in polymorphic code,
  in which case the wrapping and unwrapping is done automatically by the
  compiler.
</para>
</listitem>
</varlistentry>
  

<varlistentry><term>Anonymous functions</term><listitem><para> 
  Functions can be created and manipulated as 
  first-class expressions, just like in Lisp and ML. 
  This is much lighter than Java's anonymous classes in many situations, 
  for instance with listeners in a GUI.
</para>
</listitem>
</varlistentry>
  

<varlistentry><term>Multi-methods</term><listitem><para> 
  They allow methods to be defined outside classes.
  This means that new methods can be defined on classes that
  belong to a different package (even in java.*). 
  This allows for a more modular style: you don't need to pack classes with
  all possibly useful methods, but you can split them into several packages
  dealing with different aspects. Development can then happen independently
  if each package.
  </para><para>
  Multi-methods also extend usual methods with the possibility to
  dispatch on every argument, instead of only the receiver class.
  <ulink url="visitor.html">This article</ulink> shows why using multi-methods 
  is preferable to applying the Visitor pattern.
</para>
</listitem>
</varlistentry>
  

<varlistentry><term>Tuples</term><listitem><para> 
  This allows in particular methods to return several values.
</para>
</listitem>
</varlistentry>
  

<varlistentry><term>Optional parameters to methods</term><listitem><para>
  Optional parameters have a default value that is used when the parameter 
  is not present in the call. This is much simpler than in Java, where one 
  has to write several versions of the method for each combination of 
  parameters. The names of the arguments can also be specified at the call
  site, improving readability and making argument order irrelevant.
</para>
</listitem>
</varlistentry>

<varlistentry><term>Contracts and assertions</term><listitem><para>
  Contracts can be attached to methods, to better describe their specification
  and detect illegal uses automatically at runtime, in debug mode. 
  Contracts and assertions can be disabled, in which case they cause
  no slow down of the running program. Furthermore, they can be used on any 
  version of the JVM, even prior to 1.4.
</para>
</listitem>
</varlistentry>

</variablelist>

</para>
</section>


<section><title>Integration with Java</title>

<para>
The current implementation is tightly integrated with the Java environment,
which offers several advantages. 
The huge amount of Java libraries can be used directly in Nice programs. 
Libraries can also be written in Nice and called from a Java program.
The Nice compiler produces java bytecode, which means
Nice programs can be executed on virtually any platform, with any Java
Virtual Machine. Or they can be compiled to native programs with a native Java compiler.
The compiler is itself written in Java and in Nice. 
The compiler needs a JVM version 1.2 or higher to run.
</para>
</section>

<section><title>Availability</title>

<para>
Nice is freely available under the GPL. The runtime classes are licensed 
under the "GPL + linking exception" license, which means that libraries and 
programs written in Nice can be licensed under any terms.
</para>
</section>

</section>

</page>