@effekt-lang/effekt 0.59.0 → 0.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/effekt +0 -0
- package/libraries/chez/common/effekt_primitives.ss +3 -1
- package/libraries/common/array.effekt +11 -9
- package/libraries/common/dequeue.effekt +2 -10
- package/libraries/common/effekt.effekt +22 -27
- package/libraries/common/list.effekt +13 -12
- package/libraries/common/map.effekt +1 -1
- package/libraries/common/option.effekt +1 -8
- package/libraries/common/partial.effekt +16 -0
- package/libraries/common/random.effekt +1 -1
- package/libraries/common/stream.effekt +4 -0
- package/libraries/common/test.effekt +12 -1
- package/libraries/js/effekt_builtins.js +4 -0
- package/libraries/llvm/bytearray.c +4 -2
- package/libraries/llvm/forward-declare-c.ll +1 -0
- package/libraries/llvm/io.c +5 -1
- package/licenses/eclipse public license, version 2.0 - epl-2.0.html +3 -3
- package/licenses/mit license - mit-license.html +63 -47
- package/licenses/the bsd license - bsd-license.html +68 -48
- package/licenses/the mit license - mit.html +63 -47
- package/package.json +1 -1
package/bin/effekt
CHANGED
|
Binary file
|
|
@@ -60,6 +60,8 @@
|
|
|
60
60
|
out))
|
|
61
61
|
|
|
62
62
|
|
|
63
|
+
(define (print_impl str)
|
|
64
|
+
(display str))
|
|
63
65
|
|
|
64
66
|
(define (println_impl str)
|
|
65
67
|
(display str)
|
|
@@ -140,4 +142,4 @@
|
|
|
140
142
|
(raise
|
|
141
143
|
(condition
|
|
142
144
|
(make-error)
|
|
143
|
-
(make-message-condition ("should not be reachable!")))))
|
|
145
|
+
(make-message-condition ("should not be reachable!")))))
|
|
@@ -624,7 +624,9 @@ def sorted[A](arr: Array[A]) { ord: (A, A) => Ordering }: Array[A] = {
|
|
|
624
624
|
// Show Instances
|
|
625
625
|
// --------------
|
|
626
626
|
|
|
627
|
-
|
|
627
|
+
// TODO: These can eventually be replaced if we ever figure out monomorphization on extern types
|
|
628
|
+
|
|
629
|
+
def showBuiltin[A](arr: Array[A]) { showA: A => String }: String = {
|
|
628
630
|
var output = "Array("
|
|
629
631
|
val lastIndex = arr.size - 1
|
|
630
632
|
|
|
@@ -636,16 +638,16 @@ def show[A](arr: Array[A]) { showA: A => String }: String = {
|
|
|
636
638
|
|
|
637
639
|
output
|
|
638
640
|
}
|
|
639
|
-
def show(l: Array[Int]): String = show(l) { e => show(e) }
|
|
640
|
-
def show(l: Array[Double]): String = show(l) { e => show(e) }
|
|
641
|
-
def show(l: Array[Bool]): String = show(l) { e => show(e) }
|
|
642
|
-
def show(l: Array[String]): String = show(l) { e => e }
|
|
643
641
|
|
|
644
|
-
def
|
|
645
|
-
def
|
|
646
|
-
def
|
|
647
|
-
def
|
|
642
|
+
def showBuiltin(l: Array[Int]): String = showBuiltin(l) { e => show(e) }
|
|
643
|
+
def showBuiltin(l: Array[Double]): String = showBuiltin(l) { e => show(e) }
|
|
644
|
+
def showBuiltin(l: Array[Bool]): String = showBuiltin(l) { e => show(e) }
|
|
645
|
+
def showBuiltin(l: Array[String]): String = showBuiltin(l) { e => e }
|
|
648
646
|
|
|
647
|
+
def println(l: Array[Int]): Unit = println(showBuiltin(l))
|
|
648
|
+
def println(l: Array[Double]): Unit = println(showBuiltin(l))
|
|
649
|
+
def println(l: Array[Bool]): Unit = println(showBuiltin(l))
|
|
650
|
+
def println(l: Array[String]): Unit = println(showBuiltin(l))
|
|
649
651
|
|
|
650
652
|
// Streaming
|
|
651
653
|
// ---------
|
|
@@ -75,18 +75,10 @@ def popBack[R](dq: Dequeue[R]): Option[(R, Dequeue[R])] = dq match {
|
|
|
75
75
|
Some((x, Dequeue(f, fs, rest, rs - 1).check))
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
// TODO: Replace when monomorphization is merged
|
|
78
79
|
|
|
79
|
-
def show[A](d: Dequeue[A]) { showA: A => String }: String = {
|
|
80
|
-
val Dequeue(front, frontSize, rear, rearSize) = d;
|
|
81
|
-
"Dequeue(" ++ show(front){showA} ++ ", " ++ show(frontSize) ++ ", " ++
|
|
82
|
-
show(rear){showA} ++ ", " ++ show(rearSize) ++ ")"
|
|
83
|
-
}
|
|
84
|
-
def show(l: Dequeue[Int]): String = show(l) { e => show(e) }
|
|
85
|
-
def show(l: Dequeue[Double]): String = show(l) { e => show(e) }
|
|
86
|
-
def show(l: Dequeue[Bool]): String = show(l) { e => show(e) }
|
|
87
|
-
def show(l: Dequeue[String]): String = show(l) { e => e }
|
|
88
80
|
|
|
89
81
|
def println(l: Dequeue[Int]): Unit = println(show(l))
|
|
90
82
|
def println(l: Dequeue[Double]): Unit = println(show(l))
|
|
91
83
|
def println(l: Dequeue[Bool]): Unit = println(show(l))
|
|
92
|
-
def println(l: Dequeue[String]): Unit = println(show(l))
|
|
84
|
+
def println(l: Dequeue[String]): Unit = println(show(l))
|
|
@@ -38,6 +38,16 @@ namespace llvm {
|
|
|
38
38
|
// Showing and debugging
|
|
39
39
|
// =====================
|
|
40
40
|
|
|
41
|
+
extern def print(value: String): Unit =
|
|
42
|
+
jsWeb "$effekt.println(${value})"
|
|
43
|
+
jsNode "$effekt.print(${value})"
|
|
44
|
+
chez "(print_impl ${value})"
|
|
45
|
+
llvm """
|
|
46
|
+
call void @c_io_print(%Pos ${value})
|
|
47
|
+
ret %Pos zeroinitializer ; Unit
|
|
48
|
+
"""
|
|
49
|
+
vm "effekt::print(String)"
|
|
50
|
+
|
|
41
51
|
extern def println(value: String): Unit =
|
|
42
52
|
js "$effekt.println(${value})"
|
|
43
53
|
chez "(println_impl ${value})"
|
|
@@ -74,7 +84,7 @@ def println(value: Double): Unit = println(value.show)
|
|
|
74
84
|
def println(value: Bool): Unit = println(value.show)
|
|
75
85
|
def println(value: Byte): Unit = println(value.show)
|
|
76
86
|
|
|
77
|
-
extern def
|
|
87
|
+
extern def showBuiltin(value: Int) at {}: String =
|
|
78
88
|
js "'' + ${value}"
|
|
79
89
|
chez "(show-number ${value})"
|
|
80
90
|
llvm """
|
|
@@ -83,9 +93,7 @@ extern def show(value: Int) at {}: String =
|
|
|
83
93
|
"""
|
|
84
94
|
vm "effekt::show(Int)"
|
|
85
95
|
|
|
86
|
-
def
|
|
87
|
-
|
|
88
|
-
extern def show(value: Double) at {}: String =
|
|
96
|
+
extern def showBuiltin(value: Double) at {}: String =
|
|
89
97
|
js "'' + ${value}"
|
|
90
98
|
chez "(show-number ${value})"
|
|
91
99
|
llvm """
|
|
@@ -94,13 +102,7 @@ extern def show(value: Double) at {}: String =
|
|
|
94
102
|
"""
|
|
95
103
|
vm "effekt::show(Double)"
|
|
96
104
|
|
|
97
|
-
def
|
|
98
|
-
value
|
|
99
|
-
|
|
100
|
-
def show(value: Bool): String =
|
|
101
|
-
if (value) "true" else "false"
|
|
102
|
-
|
|
103
|
-
extern def show(value: Char) at {}: String =
|
|
105
|
+
extern def showBuiltin(value: Char) at {}: String =
|
|
104
106
|
js "String.fromCodePoint(${value})"
|
|
105
107
|
chez "(string (integer->char ${value}))"
|
|
106
108
|
llvm """
|
|
@@ -109,22 +111,17 @@ extern def show(value: Char) at {}: String =
|
|
|
109
111
|
"""
|
|
110
112
|
vm "effekt::show(Char)"
|
|
111
113
|
|
|
112
|
-
extern def
|
|
113
|
-
js "'' + ${value}"
|
|
114
|
-
chez "(
|
|
114
|
+
extern def showBuiltin(value: Byte) at {}: String =
|
|
115
|
+
js "'0x' + ${value}.toString(16).toUpperCase().padStart(2, '0')"
|
|
116
|
+
chez "(format #f \"0x~2,'0X\" ${value})"
|
|
115
117
|
llvm """
|
|
116
|
-
%z = call %Pos @c_bytearray_show_Byte(
|
|
118
|
+
%z = call %Pos @c_bytearray_show_Byte(%Byte ${value})
|
|
117
119
|
ret %Pos %z
|
|
118
120
|
"""
|
|
119
121
|
vm "effekt::show(Byte)"
|
|
120
122
|
|
|
121
|
-
extern def genericShow[R](value: R) at {}: String =
|
|
122
|
-
js "$effekt.show(${value})"
|
|
123
|
-
chez "(show_impl ${value})"
|
|
124
|
-
|
|
125
123
|
extern def inspect[R](value: R) at io: Unit =
|
|
126
|
-
|
|
127
|
-
chez { println(genericShow(value)) }
|
|
124
|
+
default { println(show(value)) }
|
|
128
125
|
vm "effekt::inspect(Any)"
|
|
129
126
|
|
|
130
127
|
/// A fatal runtime error that cannot be caught
|
|
@@ -137,6 +134,10 @@ extern def panic(msg: String) at io: Nothing =
|
|
|
137
134
|
ret %Pos zeroinitializer ; Unit
|
|
138
135
|
"""
|
|
139
136
|
|
|
137
|
+
extern def show[R](value: R) at {}: String =
|
|
138
|
+
js "$effekt.show(${value})"
|
|
139
|
+
chez "(show_impl ${value})"
|
|
140
|
+
llvm "ret %Pos poison"
|
|
140
141
|
|
|
141
142
|
// Strings
|
|
142
143
|
// =======
|
|
@@ -223,12 +224,6 @@ def genericCompare[R](x: R, y: R): Ordering = {
|
|
|
223
224
|
}
|
|
224
225
|
}
|
|
225
226
|
|
|
226
|
-
def show(o: Ordering): String = o match {
|
|
227
|
-
case Less() => "Less()"
|
|
228
|
-
case Equal() => "Equal()"
|
|
229
|
-
case Greater() => "Greater()"
|
|
230
|
-
}
|
|
231
|
-
|
|
232
227
|
def println(o: Ordering): Unit = println(o.show)
|
|
233
228
|
|
|
234
229
|
|
|
@@ -74,6 +74,16 @@ def tail[A](l: List[A]): List[A] / Exception[MissingValue] = l match {
|
|
|
74
74
|
case Cons(a, rest) => rest
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
/// Return all elements of a given list except the last element.
|
|
78
|
+
/// Throws a `MissingValue` exception if it's empty.
|
|
79
|
+
///
|
|
80
|
+
/// O(n)
|
|
81
|
+
def init[A](l: List[A]): List[A] / Exception[MissingValue] = l match {
|
|
82
|
+
case Nil() => do raise(MissingValue(), "Trying to get the beginning of an empty list")
|
|
83
|
+
case Cons(a, Nil()) => Nil()
|
|
84
|
+
case Cons(a, as) => Cons(a, as.init)
|
|
85
|
+
}
|
|
86
|
+
|
|
77
87
|
/// Return the first element of a given list.
|
|
78
88
|
/// Returns `None()` if it's empty.
|
|
79
89
|
///
|
|
@@ -914,24 +924,15 @@ def isSortedBy[A](list: List[A]) { lessOrEqual: (A, A) => Bool }: Bool = {
|
|
|
914
924
|
// Show Instances
|
|
915
925
|
// --------------
|
|
916
926
|
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
case Nil() => "Nil()"
|
|
920
|
-
case Cons(x, xs) => "Cons(" ++ showA(x) ++ ", " ++ go(xs) ++ ")"
|
|
921
|
-
}
|
|
922
|
-
go(l)
|
|
923
|
-
}
|
|
924
|
-
def show(l: List[Int]): String = show(l) { e => show(e) }
|
|
925
|
-
def show(l: List[Double]): String = show(l) { e => show(e) }
|
|
926
|
-
def show(l: List[Bool]): String = show(l) { e => show(e) }
|
|
927
|
-
def show(l: List[String]): String = show(l) { e => e }
|
|
927
|
+
// TODO: Get rid of these after monomorphization is merged
|
|
928
|
+
|
|
928
929
|
|
|
929
930
|
def println(l: List[Int]): Unit = println(show(l))
|
|
930
931
|
def println(l: List[Double]): Unit = println(show(l))
|
|
932
|
+
def println(l: List[Char]): Unit = println(show(l))
|
|
931
933
|
def println(l: List[Bool]): Unit = println(show(l))
|
|
932
934
|
def println(l: List[String]): Unit = println(show(l))
|
|
933
935
|
|
|
934
|
-
|
|
935
936
|
// Streaming
|
|
936
937
|
// ---------
|
|
937
938
|
|
|
@@ -969,7 +969,7 @@ namespace internal {
|
|
|
969
969
|
t match {
|
|
970
970
|
case Tip() => ""
|
|
971
971
|
case Bin(_, k, v, l, r) =>
|
|
972
|
-
val pair = k.
|
|
972
|
+
val pair = k.show ++ " → " ++ v.show
|
|
973
973
|
val currentLine = prefix ++ (if (isTail) "└── " else "├── ") ++ pair ++ "\n"
|
|
974
974
|
|
|
975
975
|
val newPrefix = prefix ++ (if (isTail) " " else "│ ")
|
|
@@ -59,14 +59,7 @@ def undefinedToOption[A](value: A): Option[A] =
|
|
|
59
59
|
// Show Instances
|
|
60
60
|
// --------------
|
|
61
61
|
|
|
62
|
-
def show[A](o: Option[A]) { showA: A => String }: String = o match {
|
|
63
|
-
case None() => "None()"
|
|
64
|
-
case Some(v) => "Some(" ++ showA(v) ++ ")"
|
|
65
|
-
}
|
|
66
|
-
def show(o: Option[Int]): String = show(o) { e => show(e) }
|
|
67
|
-
def show(o: Option[Double]): String = show(o) { e => show(e) }
|
|
68
|
-
def show(o: Option[Bool]): String = show(o) { e => show(e) }
|
|
69
62
|
|
|
70
63
|
def println(o: Option[Int]): Unit = println(show(o))
|
|
71
64
|
def println(o: Option[Double]): Unit = println(show(o))
|
|
72
|
-
def println(o: Option[Bool]): Unit = println(show(o))
|
|
65
|
+
def println(o: Option[Bool]): Unit = println(show(o))
|
|
@@ -46,3 +46,19 @@ def suchThat[A](value: A){ predicate: A => Bool }: Option[A] =
|
|
|
46
46
|
|
|
47
47
|
def getOrFail[A](option: Option[A]): A / fail =
|
|
48
48
|
option.getOrElse { do fail() }
|
|
49
|
+
|
|
50
|
+
namespace returning {
|
|
51
|
+
|
|
52
|
+
def exhaustively[R](init: R) { program: () => R / fail }: R =
|
|
53
|
+
var res = init
|
|
54
|
+
try {
|
|
55
|
+
def go(): R = {
|
|
56
|
+
res = program()
|
|
57
|
+
go()
|
|
58
|
+
}
|
|
59
|
+
go()
|
|
60
|
+
} with fail {
|
|
61
|
+
res
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
}
|
|
@@ -51,7 +51,7 @@ def minstd(seed: Int): Unit / emit[Byte] = {
|
|
|
51
51
|
///
|
|
52
52
|
/// Implementation is similar to `stream::source`, specialized for bytes and the `random` effect.
|
|
53
53
|
def minstd(seed: Int) { randomnessReader: () => Unit / random }: Unit = {
|
|
54
|
-
var next = box {
|
|
54
|
+
var next = box { 0xFF } // sentinel value
|
|
55
55
|
next = box {
|
|
56
56
|
try {
|
|
57
57
|
minstd(seed)
|
|
@@ -192,6 +192,10 @@ def countIf[A] { shouldCount: A => Bool } { stream: () => Unit / emit[A] }: Int
|
|
|
192
192
|
count
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
+
/// Count the number of emitted values.
|
|
196
|
+
def count[A] { stream: () => Unit / emit[A] }: Int =
|
|
197
|
+
countIf[A] { _ => true } {stream}
|
|
198
|
+
|
|
195
199
|
def source[A] { stream: () => Unit / emit[A] } { reader: () => Unit / read[A] }: Unit =
|
|
196
200
|
returning::source[A, Unit]{stream}{reader}
|
|
197
201
|
|
|
@@ -46,7 +46,7 @@ def assertEqual[A](obtained: A, expected: A, msg: String): Unit / Assertion =
|
|
|
46
46
|
assertEqual(obtained, expected, msg) { (x, y) => x.equals(y) }
|
|
47
47
|
|
|
48
48
|
def assertEqual[A](obtained: A, expected: A): Unit / { Assertion, Formatted } =
|
|
49
|
-
assertEqual(obtained, expected) { (x, y) => x.equals(y) } { x => x.
|
|
49
|
+
assertEqual(obtained, expected) { (x, y) => x.equals(y) } { x => x.show }
|
|
50
50
|
|
|
51
51
|
def assertEqual[A](obtained: A, expected: A, msg: String) { equals: (A, A) => Bool }: Unit / Assertion =
|
|
52
52
|
do assert(equals(obtained, expected), msg)
|
|
@@ -56,6 +56,17 @@ def assertEqual[A](obtained: A, expected: A) { equals: (A, A) => Bool } { show:
|
|
|
56
56
|
// NOTE: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
57
57
|
// Here's an accidental capture! Can we prevent this somehow nicely?
|
|
58
58
|
|
|
59
|
+
def assertNotThrown[E](ex: on[E]) { body: => Unit / Exception[E] }: Unit / Assertion =
|
|
60
|
+
ex.default { do assert(false, "Unexpected Exception") } {body}
|
|
61
|
+
|
|
62
|
+
def assertNoThrow[E] { body: => Unit / Exception[E] }: Unit / Assertion =
|
|
63
|
+
on[E].default{ do assert(false, "Unexpected Exception") } {body}
|
|
64
|
+
|
|
65
|
+
def assertThrown[E](ex: on[E]) { body: => Unit / Exception[E] }: Unit / Assertion =
|
|
66
|
+
do assert(ex.default { true } { body(); false }, "Expected Exception, but exited normally")
|
|
67
|
+
|
|
68
|
+
def assertThrows[E] { body: => Unit / Exception[E] }: Unit / Assertion =
|
|
69
|
+
do assert(on[E].default { true } { body(); false }, "Expected Exception, but exited normally")
|
|
59
70
|
|
|
60
71
|
interface Test {
|
|
61
72
|
def success(name: String, duration: Int): Unit
|
|
@@ -54,6 +54,10 @@ $effekt.println = function println$impl(str) {
|
|
|
54
54
|
console.log(str); return $effekt.unit;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
$effekt.print = function println$impl(str) {
|
|
58
|
+
process.stdout.write(str); return $effekt.unit;
|
|
59
|
+
}
|
|
60
|
+
|
|
57
61
|
$effekt.unit = { __unit: true }
|
|
58
62
|
|
|
59
63
|
$effekt.unreachable = function() { throw "should not be reachable!" }
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
#define EFFEKT_BYTEARRAY_C
|
|
3
3
|
|
|
4
4
|
#include <string.h> // For memcopy
|
|
5
|
+
#include <stdint.h>
|
|
6
|
+
#include <inttypes.h>
|
|
5
7
|
|
|
6
8
|
/** We represent bytearrays like positive types.
|
|
7
9
|
*
|
|
@@ -115,8 +117,8 @@ struct Pos c_bytearray_show_Char(const uint64_t n) {
|
|
|
115
117
|
|
|
116
118
|
// TODO do this in Effekt
|
|
117
119
|
struct Pos c_bytearray_show_Byte(const Byte n) {
|
|
118
|
-
char str[
|
|
119
|
-
snprintf(str, sizeof
|
|
120
|
+
char str[5]; // |"0x" ++ <2 hex digits> ++ '\0'| = 5
|
|
121
|
+
snprintf(str, sizeof str, "0x%02" PRIX8, (uint8_t)n);
|
|
120
122
|
return c_bytearray_from_nullterminated_string(str);
|
|
121
123
|
}
|
|
122
124
|
|
package/libraries/llvm/io.c
CHANGED
|
@@ -7,11 +7,15 @@
|
|
|
7
7
|
// Println and Readln and Random
|
|
8
8
|
// -----------------------------
|
|
9
9
|
|
|
10
|
-
void
|
|
10
|
+
void c_io_print(String text) {
|
|
11
11
|
for (uint64_t j = 0; j < text.tag; ++j) {
|
|
12
12
|
putchar(c_bytearray_data(text)[j]);
|
|
13
13
|
};
|
|
14
14
|
erasePositive(text);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
void c_io_println(String text) {
|
|
18
|
+
c_io_print(text);
|
|
15
19
|
putchar('\n');
|
|
16
20
|
}
|
|
17
21
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!doctype html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><title>Eclipse Public License 2.0 (EPL) | The Eclipse Foundation</title>
|
|
2
|
-
<meta property="og:title" content="Eclipse Public License 2.0 (EPL) | The Eclipse Foundation"><meta name=twitter:title content="Eclipse Public License 2.0 (EPL) | The Eclipse Foundation"><meta name=description content="The Eclipse Foundation provides our global community of individuals and organisations with a mature, scalable, and business-friendly environment for open source …"><meta property="og:description" content="The Eclipse Foundation provides our global community of individuals and organisations with a mature, scalable, and business-friendly environment for open source …"><meta name=twitter:description content="The Eclipse Foundation provides our global community of individuals and organisations with a mature, scalable, and business-friendly environment for open source …"><meta name=author content="Wayne Beaton"><link href=/favicon.ico rel=icon type=image/x-icon><meta property="og:image" content="https://www.eclipse.org/images/og-image.jpg"><meta name=twitter:image content="https://www.eclipse.org/images/og-image.jpg"><meta name=twitter:card content="summary"><meta name=twitter:site content="@eclipsefdn"><meta name=twitter:creator content="@eclipsefdn"><meta property="og:url" content="https://www.eclipse.org/legal/epl-2.0/"><meta property="og:type" content="website"><meta property="og:site_name" content="Eclipse Foundation"><meta name=keywords content="epl,epl-2.0,legal,foundation,eclipse,eclipse public license,license,licenses"><meta name=generator content="Hugo 0.144.2"><link rel=canonical href=https://www.eclipse.org/legal/epl-2.0/><link rel=alternate href=/legal/epl-2.0/index.xml type=application/rss+xml title><link rel=stylesheet href="/public/css/styles.css?v=
|
|
2
|
+
<meta property="og:title" content="Eclipse Public License 2.0 (EPL) | The Eclipse Foundation"><meta name=twitter:title content="Eclipse Public License 2.0 (EPL) | The Eclipse Foundation"><meta name=description content="The Eclipse Foundation provides our global community of individuals and organisations with a mature, scalable, and business-friendly environment for open source …"><meta property="og:description" content="The Eclipse Foundation provides our global community of individuals and organisations with a mature, scalable, and business-friendly environment for open source …"><meta name=twitter:description content="The Eclipse Foundation provides our global community of individuals and organisations with a mature, scalable, and business-friendly environment for open source …"><meta name=author content="Wayne Beaton"><link href=/favicon.ico rel=icon type=image/x-icon><meta property="og:image" content="https://www.eclipse.org/images/og-image.jpg"><meta name=twitter:image content="https://www.eclipse.org/images/og-image.jpg"><meta name=twitter:card content="summary"><meta name=twitter:site content="@eclipsefdn"><meta name=twitter:creator content="@eclipsefdn"><meta property="og:url" content="https://www.eclipse.org/legal/epl-2.0/"><meta property="og:type" content="website"><meta property="og:site_name" content="Eclipse Foundation"><meta name=keywords content="epl,epl-2.0,legal,foundation,eclipse,eclipse public license,license,licenses"><meta name=generator content="Hugo 0.144.2"><link rel=canonical href=https://www.eclipse.org/legal/epl-2.0/><link rel=alternate href=/legal/epl-2.0/index.xml type=application/rss+xml title><link rel=stylesheet href="/public/css/styles.css?v=1770578401"><script>(function(e,t,n,s,o){e[s]=e[s]||[],e[s].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var a=t.getElementsByTagName(n)[0],i=t.createElement(n),r=s!="dataLayer"?"&l="+s:"";i.async=!0,i.src="https://www.googletagmanager.com/gtm.js?id="+o+r,a.parentNode.insertBefore(i,a)})(window,document,"script","dataLayer","GTM-5WLCZXC")</script><script>var tableClasses="table"</script><link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel=stylesheet type=text/css></head><body><noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-5WLCZXC" height=0 width=0 style=display:none;visibility:hidden></iframe></noscript><a href=#main class=skip-link>Skip to content</a><div class=eclipsefdn-featured-story-banner data-publish-target=eclipse_org></div><header class="header-wrapper header-wrapper" id=header><div class="navigation-bar dark"><div class=container><div class=navigation-bar-inner><div class=navigation-bar-left><a class="focus-highlight focus-inverse" href=/><img class=navigation-bar-brand src=https://www.eclipse.org/eclipse.org-common/themes/solstice/public/images/logo/eclipse-foundation-white-orange.svg alt="Eclipse Foundation"></a></div><nav class="navigation-bar-nav hidden-xs hidden-sm"><ul><li><button type=button class="btn btn-link" data-target=join-us-menu>Join us</button></li><li><button type=button class="btn btn-link" data-target=what-we-do-menu>What we do</button></li><li><button type=button class="btn btn-link" data-target=resources-menu>Resources</button></li><li><button type=button class="btn btn-link" data-target=about-us-menu>About us</button></li></ul></nav><div class=navigation-bar-right><div class="navigation-bar-controls hidden-xs hidden-sm"><ul><li class=dropdown><a class="dropdown-toggle link-unstyled focus-highlight" tabindex=0 id=search-dropdown-toggle data-toggle=dropdown href=# aria-label=Search><i class="fa-solid fa-magnifying-glass" aria-hidden=true></i></a><form class="search-bar dropdown-menu dropdown-menu-right" aria-labelledby=search-dropdown-toggle action=https://www.eclipse.org/home/search/ method=get><input class=search-bar-input name=q placeholder=Search>
|
|
3
3
|
<button class="btn btn-link" type=submit>
|
|
4
4
|
<i class="fa-solid fa-arrow-right"></i></button></form></li><li class=dropdown><a class="dropdown-toggle focus-highlight" id=user-menu href=# data-toggle=dropdown aria-haspopup=true aria-expanded=false tabindex=0><i class="fa-regular fa-user" aria-hidden=true></i></a><ul class="dropdown-menu dropdown-menu-right" aria-labelledby=user-menu><li><a href=https://accounts.eclipse.org/user><i class="fa-solid fa-user margin-right-10" aria-hidden=true></i>
|
|
5
5
|
View my account</a></li><li><a href=https://accounts.eclipse.org/user/edit><i class="fa-solid fa-edit margin-right-10" aria-hidden=true></i>
|
|
@@ -30,7 +30,7 @@ Manage cookies</a></li></ul></li></ul></div><div class="navigation-bar-ctas hidd
|
|
|
30
30
|
<i class="external-icon fa-solid fa-arrow-up-right-from-square" aria-hidden=true></i></li><li><a href=https://www.eclipse.org/topics/automotive-and-mobility/>Automotive & mobility</a></li><li><a href=https://orcwg.org/ target=_blank>Policy & compliance</a>
|
|
31
31
|
<i class="external-icon fa-solid fa-arrow-up-right-from-square" aria-hidden=true></i></li></ul></div><div class=submenu style=grid-column:-3;margin-top:-20rem><div class=menu-heading-group><span class=menu-pre><i class="fa-solid fa-flag" aria-hidden=true></i></span><h2 class=menu-heading>Strategic services</h2></div><ul><li><a href=https://www.eclipse.org/research/>Transform research into open source</a></li><li><a href=https://www.eclipse.org/os4biz/services/>Engage professional services</a></li><li><a href=https://www.eclipse.org/os4biz/ospo/>Build your OSPO</a></li></ul></div></nav></div></div><div class="menu hidden" id=resources-menu><div class=container><nav><div class=submenu><div class=menu-heading-group><span class=menu-pre><i class="fa-solid fa-bullhorn" aria-hidden=true></i></span><h2 class=menu-heading>What's happening</h2></div><ul><li><a href=https://blogs.eclipse.org/>Read our blog</a></li><li><a href=https://accounts.eclipse.org/mailing-list>Join mailing lists</a></li><li><a href=https://newsroom.eclipse.org/>Get news updates</a></li><li><a href=https://www.eclipse.org/community/eclipse_newsletter>Subscribe to newsletter</a></li></ul></div><div class=submenu><div class=menu-heading-group><span class=menu-pre><i class="fa-solid fa-calendar-days" aria-hidden=true></i></span><h2 class=menu-heading>Events</h2></div><ul><li><a href=https://events.eclipse.org/>Explore events</a></li><li><a href=https://www.eclipse.org/events/open-community-meetups/>Join a community meetup</a></li><li><a href=https://www.eclipse.org/events/open-community-webinars/>Attend a webinar</a></li><li><a href=https://www.ocxconf.org/ target=_blank>Join OCX</a>
|
|
32
32
|
<i class="external-icon fa-solid fa-arrow-up-right-from-square" aria-hidden=true></i></li></ul></div><div class=submenu><div class=menu-heading-group><span class=menu-pre><i class="fa-solid fa-code" aria-hidden=true></i></span><h2 class=menu-heading>Developer resources</h2></div><ul><li><a href=https://www.eclipse.org/projects/>Explore projects hub</a></li><li><a href=https://www.eclipse.org/projects/calendar/#office-hours>Attend office hours</a></li><li><a href=https://www.eclipse.org/security/>Report a vulnerability</a></li><li><a href=https://www.eclipse.org/security/known/>View known vulnerabilities</a></li><li><a href=https://github.com/eclipse-csi/security-handbook/blob/main/docs/vulnerabilities/advisories.md target=_blank>Use the security handbook</a></li></ul></div><div class=submenu><div class=menu-heading-group><span class=menu-pre><i class="fa-solid fa-gear" aria-hidden=true></i></span><h2 class=menu-heading>Industry insights</h2></div><ul><li><a href=https://www.eclipse.org/org/value/#success_stories>View case studies</a></li><li><a href=https://www.eclipse.org/org/value/#whitepapers>View whitepapers</a></li><li><a href=https://www.eclipse.org/org/value/#surveyReports>View surveys & reports</a></li></ul></div><div class=submenu style=grid-column:-2;margin-top:-6rem><div class=menu-heading-group><span class=menu-pre><i class="fa-solid fa-store" aria-hidden=true></i></span><h2 class=menu-heading>Marketplaces</h2></div><ul><li><a href=https://adoptium.net/>Adoptium</a></li><li><a href=https://marketplace.eclipse.org/>Eclipse IDE</a></li><li><a href=https://open-vsx.org/>Open VSX</a></li></ul></div></nav></div></div><div class="menu hidden" id=about-us-menu><div class=container><nav><div class=submenu><div class=menu-heading-group><span class=menu-pre><i class="fa-regular fa-moon rotate-90" aria-hidden=true></i></span><h2 class=menu-heading>The Foundation</h2></div><ul><li><a href=https://www.eclipse.org/about/>About</a></li><li><a href=https://www.eclipse.org/org/foundation/staff/>Meet the team</a></li><li><a href=https://www.eclipse.org/org/governance/>Board & governance</a></li></ul></div><div class=submenu><div class=menu-heading-group><span class=menu-pre><i class="fa-solid fa-user-group" aria-hidden=true></i></span><h2 class=menu-heading>Our members</h2></div><ul><li><a href=https://www.eclipse.org/membership/>Become a member</a></li><li><a href=https://www.eclipse.org/membership/explore-membership/>View member directory</a></li><li><a href=https://membership.eclipse.org/portal target=_blank>Access member portal</a></li></ul></div><div class=submenu><div class=menu-heading-group><span class=menu-pre><i class="fa-regular fa-bookmark" aria-hidden=true></i></span><h2 class=menu-heading>Sponsorship</h2></div><ul><li><a href=https://www.eclipse.org/sponsor/>Become a sponsor</a></li><li><a href=https://www.eclipse.org/org/our-sponsors/>Sponsor directory</a></li></ul></div><div class=submenu><div class=menu-heading-group><span class=menu-pre><i class="fa-solid fa-cube" aria-hidden=true></i></span><h2 class=menu-heading>More</h2></div><ul><li><a href=https://www.eclipse.org/careers/>Join our team</a></li><li><a href=https://www.eclipse.org/org/artwork/>Explore our brand</a></li><li><a href=https://www.eclipse.org/org/foundation/contact.php>Contact us</a></li></ul></div></nav></div></div></div></header><main id=main><nav aria-label=Breadcrumb><div class=container><ol class=breadcrumb><li><a href=https://www.eclipse.org/>Home</a></li><li><a href=https://www.eclipse.org/legal/>Eclipse Foundation Legal …</a></li><li class=active>Eclipse Public License 2.0 (EPL)</li></ol></div></nav><div class="container padding-bottom-30"><div class=row><div class=col-md-6><aside class=sidebar><a class="sidebar-toggle sidebar-toggle-open" type=button href=#sidebar-open><i class="fa-solid fa-bars" aria-hidden=true></i>
|
|
33
|
-
</a><a class="sidebar-toggle sidebar-toggle-close" type=button href=#sidebar-close><i class="fa-solid fa-close" aria-hidden=true></i></a><nav><ul class=sidebar-menu><li class=menu-group><a href=#legal data-toggle=collapse aria-expanded=true class=dropdown-toggle>Legal</a><ul class="collapse in" id=legal><li class=menu-subgroup><a href=#legal-eca data-toggle=collapse aria-expanded=false class=dropdown-toggle>ECA</a><ul class=collapse id=legal-eca><li><a href=/legal/eca>About</a></li><li><a href=https://accounts.eclipse.org/user/eca>Sign</a></li><li><a href=https://accounts.eclipse.org/user/eca>Validation Tool</a></li></ul></li><li class=menu-subgroup><a href=#legal-epl-20 data-toggle=collapse aria-expanded=false class=dropdown-toggle>EPL-2.0</a><ul class=collapse id=legal-epl-20><li><a href=/legal/epl-2.0/>About</a></li><li><a href=/org/documents/epl-2.0/EPL-2.0.html>Plain HTML</a></li><li><a href=/org/documents/epl-2.0/EPL-2.0.txt>Plain Text</a></li><li><a href=/org/documents/epl-2.0/EPL-2.0.pdf>PDF</a></li><li><a href=/legal/epl-2.0/faq/>FAQ</a></li></ul></li><li class=menu-subgroup><a href=#legal-epl-10 data-toggle=collapse aria-expanded=false class=dropdown-toggle>EPL-1.0</a><ul class=collapse id=legal-epl-10><li><a href=/org/documents/epl-
|
|
33
|
+
</a><a class="sidebar-toggle sidebar-toggle-close" type=button href=#sidebar-close><i class="fa-solid fa-close" aria-hidden=true></i></a><nav><ul class=sidebar-menu><li class=menu-group><a href=#legal data-toggle=collapse aria-expanded=true class=dropdown-toggle>Legal</a><ul class="collapse in" id=legal><li class=menu-subgroup><a href=#legal-eca data-toggle=collapse aria-expanded=false class=dropdown-toggle>ECA</a><ul class=collapse id=legal-eca><li><a href=/legal/eca>About</a></li><li><a href=https://accounts.eclipse.org/user/eca>Sign</a></li><li><a href=https://accounts.eclipse.org/user/eca>Validation Tool</a></li></ul></li><li class=menu-subgroup><a href=#legal-epl-20 data-toggle=collapse aria-expanded=false class=dropdown-toggle>EPL-2.0</a><ul class=collapse id=legal-epl-20><li><a href=/legal/epl-2.0/>About</a></li><li><a href=/org/documents/epl-2.0/EPL-2.0.html>Plain HTML</a></li><li><a href=/org/documents/epl-2.0/EPL-2.0.txt>Plain Text</a></li><li><a href=/org/documents/epl-2.0/EPL-2.0.pdf>PDF</a></li><li><a href=/legal/epl-2.0/faq/>FAQ</a></li></ul></li><li class=menu-subgroup><a href=#legal-epl-10 data-toggle=collapse aria-expanded=false class=dropdown-toggle>EPL-1.0</a><ul class=collapse id=legal-epl-10><li><a href=/org/documents/epl-1.0/>About</a></li><li><a href=/org/documents/epl-1.0/EPL-1.0.html>Plain HTML</a></li><li><a href=/org/documents/epl-1.0/EPL-1.0.txt>Plain Text</a></li><li><a href=/legal/epl/faq/>FAQ</a></li></ul></li><li class=menu-subgroup><a href=#legal-licenses data-toggle=collapse aria-expanded=false class=dropdown-toggle>Licenses</a><ul class=collapse id=legal-licenses><li><a href=/legal/licenses#approved>Approved 3rd Party</a></li><li><a href=/legal/licenses#nonapproved>Non Approved</a></li><li><a href=/projects/handbook/#ip-copyright-headers>File Headers</a></li><li><a href=/legal/non-code-licenses>Docs & Examples</a></li></ul></li><li class=menu-subgroup><a href=#legal-specs data-toggle=collapse aria-expanded=false class=dropdown-toggle>Specifications</a><ul class=collapse id=legal-specs><li><a href=/projects/efsp/>Specifications Process</a></li><li><a href=/projects/efsp/operations.php>Specifications Operations</a></li><li><a href=/legal/efsl>Specification License</a></li><li><a href=/legal/tck>TCK License</a></li></ul></li></ul></li></ul></nav></aside></div><div class=col-md-18><div id=content></div><script async src=/public/js/generate-body-content.js type=text/javascript></script></div></main><aside class=featured-footer id=featured-footer><div class="eclipsefdn-featured-footer container-fluid" data-publish-target=eclipse_org><div class=row><div class="col-sm-24 featured-container"></div></div></div></aside><footer class=footer><div class=container><div class=footer-inner><section class=links-section><ul><li>Eclipse Foundation</li><li><ul><li><a href=https://www.eclipse.org/org/>About</a></li><li><a href=https://projects.eclipse.org/>Projects</a></li><li><a href=https://www.eclipse.org/collaborations/>Collaborations</a></li><li><a href=https://www.eclipse.org/membership/>Membership</a></li><li><a href=https://www.eclipse.org/sponsor/>Sponsor</a></li></ul></li></ul><ul><li>Legal</li><li><ul><li><a href=https://www.eclipse.org/legal/privacy/>Privacy Policy</a></li><li><a href=https://www.eclipse.org/legal/terms-of-use/>Terms of Use</a></li><li><a href=https://www.eclipse.org/legal/compliance/>Compliance</a></li><li><a href=https://www.eclipse.org/org/documents/Community_Code_of_Conduct.php>Code of Conduct</a></li><li><a href=https://www.eclipse.org/legal/>Legal Resources</a></li><li><button type=button class="btn btn-link toolbar-manage-cookies">Manage Cookies</button></li></ul></li></ul><ul><li>More</li><li><ul><li><a href=https://www.eclipse.org/security/>Report a Vulnerability</a></li><li><a href=https://status.eclipse.org/>Service Status</a></li><li><a href=https://www.eclipse.org/org/foundation/contact.php>Contact Us</a></li><li><a href=https://www.eclipse.org/projects/support/>Support</a></li></ul></li></ul></section><section class=social-media-section><p class="subheading text-tertiary">See what we're up to</p><ul class=social-media-list><li><a href=https://x.com/EclipseFdn aria-label=X><span class=fa-stack><i class="fa-solid fa-circle fa-stack-2x" aria-hidden=true></i>
|
|
34
34
|
<i class="fa-brands fa-x-twitter fa-stack-1x fa-inverse" aria-hidden=true></i></span></a></li><li><a href=https://bsky.app/profile/eclipse.org aria-label=Bluesky><span class=fa-stack><i class="fa-solid fa-circle fa-stack-2x" aria-hidden=true></i>
|
|
35
35
|
<i class="fa-brands fa-bluesky fa-stack-1x fa-inverse" aria-hidden=true></i></span></a></li><li><a href=https://mastodon.social/@EclipseFdn aria-label=Mastodon><span class=fa-stack><i class="fa-solid fa-circle fa-stack-2x" aria-hidden=true></i>
|
|
36
36
|
<i class="fa-brands fa-mastodon fa-stack-1x fa-inverse" aria-hidden=true></i></span></a></li><li><a href=https://www.facebook.com/eclipse.org aria-label=Facebook><span class=fa-stack><i class="fa-solid fa-circle fa-stack-2x" aria-hidden=true></i>
|
|
@@ -39,4 +39,4 @@ Manage cookies</a></li></ul></li></ul></div><div class="navigation-bar-ctas hidd
|
|
|
39
39
|
<i class="fa-brands fa-youtube fa-stack-1x fa-inverse" aria-hidden=true></i></span></a></li><li><a href=https://www.linkedin.com/company/eclipse-foundation aria-label=LinkedIn><span class=fa-stack><i class="fa-solid fa-circle fa-stack-2x" aria-hidden=true></i>
|
|
40
40
|
<i class="fa-brands fa-linkedin-in fa-stack-1x fa-inverse" aria-hidden=true></i></span></a></li></ul></section><section class=newsletter-section><p class="subheading text-tertiary">Stay up to date</p><h2>Subscribe to our newsletter</h2><form class="newsletter-form margin-top-40" id=mc-embedded-subscribe-form action="https://eclipse.us6.list-manage.com/subscribe/post?u=eaf9e1f06f194eadc66788a85&id=e7538485cd&f_id=00f9c2e1f0" method=post novalidate target=_blank><div class=text-field-outlined><input name=EMAIL type=email placeholder="Your email">
|
|
41
41
|
<button class=newsletter-form-submit type=submit name=subscribe id=mc-embedded-subscribe aria-label=Submit>
|
|
42
|
-
<i class="fa-solid fa-arrow-right" aria-hidden=true></i></button></div></form></section><section class=footer-bottom-section><img class="img-responsive logo" src=https://www.eclipse.org/eclipse.org-common/themes/solstice/public/images/logo/eclipse-foundation-white.svg alt="Eclipse Foundation"><div class=legal-information><p>Copyright © Eclipse Foundation AISBL. All rights reserved.</p><ul class=legal-links><li><a href=https://www.eclipse.org/legal/privacy/>Privacy policy</a></li><li><a href=https://www.eclipse.org/legal/terms-of-use/>Terms of use</a></li><li><a href=https://www.eclipse.org/legal/compliance/>Compliance</a></li><li><a href=https://www.eclipse.org/legal/>Legal</a></li></ul></div></section></div></div></footer><div id=footer-js><script src="/public/js/main.js?v1.0?v=
|
|
42
|
+
<i class="fa-solid fa-arrow-right" aria-hidden=true></i></button></div></form></section><section class=footer-bottom-section><img class="img-responsive logo" src=https://www.eclipse.org/eclipse.org-common/themes/solstice/public/images/logo/eclipse-foundation-white.svg alt="Eclipse Foundation"><div class=legal-information><p>Copyright © Eclipse Foundation AISBL. All rights reserved.</p><ul class=legal-links><li><a href=https://www.eclipse.org/legal/privacy/>Privacy policy</a></li><li><a href=https://www.eclipse.org/legal/terms-of-use/>Terms of use</a></li><li><a href=https://www.eclipse.org/legal/compliance/>Compliance</a></li><li><a href=https://www.eclipse.org/legal/>Legal</a></li></ul></div></section></div></div></footer><div id=footer-js><script src="/public/js/main.js?v1.0?v=1770578401"></script><script>(function(){})(jQuery,document)</script></div></body></html>
|