@effekt-lang/effekt 0.65.0 → 0.67.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.
Files changed (33) hide show
  1. package/bin/effekt +0 -0
  2. package/libraries/chez/cps/effekt.ss +5 -11
  3. package/libraries/common/args.effekt +2 -2
  4. package/libraries/common/array.effekt +26 -8
  5. package/libraries/common/bytearray.effekt +18 -10
  6. package/libraries/common/bytestream.effekt +4 -4
  7. package/libraries/common/char.effekt +10 -10
  8. package/libraries/common/dictionary.effekt +44 -43
  9. package/libraries/common/effekt.effekt +16 -5
  10. package/libraries/common/io/channel.effekt +29 -22
  11. package/libraries/common/io/console.effekt +2 -1
  12. package/libraries/common/io/filesystem.effekt +5 -5
  13. package/libraries/common/io/network.effekt +2 -2
  14. package/libraries/common/io/promise.effekt +2 -2
  15. package/libraries/common/io/signal.effekt +86 -22
  16. package/libraries/common/json.effekt +16 -42
  17. package/libraries/common/list.effekt +4 -4
  18. package/libraries/common/process.effekt +6 -2
  19. package/libraries/common/random.effekt +29 -7
  20. package/libraries/common/ref.effekt +4 -1
  21. package/libraries/common/regex.effekt +6 -4
  22. package/libraries/common/resizable_array.effekt +4 -4
  23. package/libraries/common/scanner.effekt +36 -41
  24. package/libraries/common/stream.effekt +76 -36
  25. package/libraries/common/string.effekt +14 -10
  26. package/libraries/common/test.effekt +2 -2
  27. package/libraries/js/effekt_runtime.js +55 -43
  28. package/libraries/llvm/io.c +0 -55
  29. package/licenses/eclipse public license, version 2.0 - epl-2.0.html +4 -4
  30. package/licenses/mit license - mit-license.html +33 -31
  31. package/licenses/the bsd license - bsd-license.html +33 -31
  32. package/licenses/the mit license - mit.html +34 -30
  33. package/package.json +1 -1
@@ -7,13 +7,13 @@ import partial
7
7
  // Effects
8
8
  // -------
9
9
 
10
- /// Describes push streams by emitting values of type `A`.
11
- effect emit[A](value: A): Unit
10
+ /// The effect for emitting an item of type `A` in a push stream.
11
+ effect emit[A](item: A): Unit
12
12
 
13
- /// Describes pull streams by reading values of type `A`.
13
+ /// The effect for getting the next item of type `A` from a pull stream.
14
14
  ///
15
- /// The producer can decide to `stop` emitting values.
16
- effect read[A](): A / stop
15
+ /// Uses the `stop` effect to signal the end of the stream.
16
+ effect next[A](): A / stop
17
17
 
18
18
 
19
19
  /// Like `for[A, R]`, but ignores the result of the stream, and consequently
@@ -30,11 +30,11 @@ def for[A] { stream: () => Unit / emit[A] } { action: A => Unit }: Unit =
30
30
  def map[A, B] { function: A => B } { stream: () => Unit / emit[A] }: Unit / emit[B] =
31
31
  returning::map[A, B, Unit]{function}{stream}
32
32
 
33
- /// Runs the given action whenever the given reader reads an element.
33
+ /// Runs the given action whenever the given driver reads an element.
34
34
  ///
35
- /// e.g. var i = -1; with tap { i = i + 1; i }; reader()
36
- def tap[A] { action: () => A / stop } { reader: () => Unit / read[A] }: Unit =
37
- returning::tap[A, Unit]{action}{reader}
35
+ /// e.g. var i = -1; with tap { i = i + 1; i }; driver()
36
+ def tap[A] { action: () => A / stop } { driver: () => Unit / next[A] }: Unit =
37
+ returning::tap[A, Unit]{action}{driver}
38
38
 
39
39
  /// Runs the stream as a message queue,
40
40
  /// handling each of its elements that can produce new elements ("messages"),
@@ -42,8 +42,8 @@ def tap[A] { action: () => A / stop } { reader: () => Unit / read[A] }: Unit =
42
42
  def fix[T] { one: T => Unit / emit[T] } { stream: => Unit / emit[T] }: Unit =
43
43
  try {
44
44
  stream()
45
- } with emit[T] { value =>
46
- fix {one} { one(value) }
45
+ } with emit[T] { item =>
46
+ fix {one} { one(item) }
47
47
  resume(())
48
48
  }
49
49
 
@@ -58,7 +58,7 @@ def some[A] { action: () => A / stop }: Unit / { emit[A], fail } = {
58
58
 
59
59
 
60
60
  /// In Effekt lower bounds are inclusive and upper bounds are exclusive
61
- record Indexed[A](index: Int, value: A)
61
+ record Indexed[A](index: Int, item: A)
62
62
 
63
63
  def range(lower: Int, upper: Int): Unit / emit[Int] =
64
64
  if (lower < upper) {
@@ -116,7 +116,7 @@ def iterate[A](initial: A) { step: A => A }: Unit / emit[A] = {
116
116
  /// ```
117
117
  def takeWhile[A] { predicate: A => Bool } { stream: () => Unit / emit[A] }: Unit / emit[A] =
118
118
  try { stream() } with emit[A] {
119
- case value and predicate(value) => do emit(value); resume(())
119
+ case item and predicate(item) => do emit(item); resume(())
120
120
  case _ => () // end the stream
121
121
  }
122
122
 
@@ -146,7 +146,7 @@ def product { stream: () => Unit / emit[Int] }: Int =
146
146
  /// ```
147
147
  def all[A] { cond: A => Bool } { stream: => Unit / emit[A] }: Bool =
148
148
  try { stream(); true } with emit[A] {
149
- case value and not(cond(value)) => false
149
+ case item and not(cond(item)) => false
150
150
  case _ => resume(())
151
151
  }
152
152
 
@@ -169,7 +169,7 @@ def all[A] { cond: A => Bool } { stream: => Unit / emit[A] }: Bool =
169
169
  /// ```
170
170
  def any[A] { cond: A => Bool } { stream: => Unit / emit[A] }: Bool =
171
171
  try { stream(); false } with emit[A] {
172
- case value and cond(value) => true
172
+ case item and cond(item) => true
173
173
  case _ => resume(())
174
174
  }
175
175
 
@@ -196,8 +196,8 @@ def countIf[A] { shouldCount: A => Bool } { stream: () => Unit / emit[A] }: Int
196
196
  def count[A] { stream: () => Unit / emit[A] }: Int =
197
197
  countIf[A] { _ => true } {stream}
198
198
 
199
- def source[A] { stream: () => Unit / emit[A] } { reader: () => Unit / read[A] }: Unit =
200
- returning::source[A, Unit]{stream}{reader}
199
+ def source[A] { stream: () => Unit / emit[A] } { driver: () => Unit / next[A] }: Unit =
200
+ returning::source[A, Unit]{stream}{driver}
201
201
 
202
202
  /// Combines two streams together calling action on pairs in lockstep.
203
203
  /// Terminates when either of them terminates.
@@ -206,7 +206,7 @@ def zip[A, B] { stream1: () => Unit / emit[A] } { stream2: () => Unit / emit[B]
206
206
  with source[B] { stream2 }
207
207
 
208
208
  loop {
209
- action(do read(), do read())
209
+ action(do next[A](), do next[B]())
210
210
  }
211
211
  }
212
212
 
@@ -218,15 +218,15 @@ def zipLongest[A, B] { stream1: () => Unit / emit[A] } { stream2: () => Unit / e
218
218
 
219
219
  loop {
220
220
  try {
221
- val a = do read[A]()
221
+ val a = do next[A]()
222
222
  try {
223
- val b = do read[B]()
223
+ val b = do next[B]()
224
224
  action(Both(a, b))
225
225
  } with stop { () =>
226
226
  action(This(a))
227
227
  }
228
228
  } with stop{ () =>
229
- val b = do read[B]()
229
+ val b = do next[B]()
230
230
  action(That(b))
231
231
  }
232
232
  }
@@ -328,8 +328,8 @@ def tee[A]{ cons1: { => Unit / emit[A] } => Unit }{ cons2: { => Unit / emit[A] }
328
328
  /// ```
329
329
  def first[A] { stream: () => Unit / emit[A] }: A / fail = {
330
330
  try {
331
- def body(): A = { stream(); do fail() }
332
- body()
331
+ stream()
332
+ do fail().absurd
333
333
  } with emit[A] { a => a }
334
334
  }
335
335
 
@@ -338,8 +338,8 @@ def first[A] { stream: () => Unit / emit[A] }: A / fail = {
338
338
  def nth[A](n: Int){ stream: () => Unit / emit[A] }: A / fail = {
339
339
  var m = n
340
340
  try {
341
- def body(): A = { stream(); do fail() }
342
- body()
341
+ stream()
342
+ do fail().absurd
343
343
  } with emit[A] { a =>
344
344
  if (m == 0) {
345
345
  return a
@@ -350,6 +350,16 @@ def nth[A](n: Int){ stream: () => Unit / emit[A] }: A / fail = {
350
350
  }
351
351
  }
352
352
 
353
+ // Peeking
354
+ // -------
355
+
356
+ /// Return the next item without advancing.
357
+ effect peek[A](): A / stop
358
+
359
+ /// Provide the ability to peek when consuming a stream.
360
+ def peeking[A] { peeker: () => Unit / {next[A], peek[A]} }: Unit / next[A] =
361
+ returning::peeking[A, Unit]{peeker}
362
+
353
363
  // Counting and padding
354
364
  // --------------------
355
365
 
@@ -380,25 +390,25 @@ def tracking[A]{ body: => Unit / { emit[A], getPos } }: Unit / emit[A] =
380
390
  namespace returning {
381
391
 
382
392
  /// Canonical handler of push streams that performs `action` for every
383
- /// value emitted by `stream`.
393
+ /// item emitted by `stream`.
384
394
  def for[A, R] { stream: () => R / emit[A] } { action: A => Unit }: R =
385
395
  try {
386
396
  stream()
387
- } with emit[A] { value =>
388
- resume(action(value))
397
+ } with emit[A] { item =>
398
+ resume(action(item))
389
399
  }
390
400
 
391
401
  def map[A, B, R] { function: A => B } { stream: () => R / emit[A] }: R / emit[B] =
392
402
  try {
393
403
  stream()
394
- } with emit[A] { value =>
395
- resume(do emit(function(value)))
404
+ } with emit[A] { item =>
405
+ resume(do emit(function(item)))
396
406
  }
397
407
 
398
- def tap[A, R] { action: () => A / stop } { reader: () => R / read[A] }: R =
408
+ def tap[A, R] { action: () => A / stop } { driver: () => R / next[A] }: R =
399
409
  try {
400
- reader()
401
- } with read[A] { () =>
410
+ driver()
411
+ } with next[A] { () =>
402
412
  resume { action() }
403
413
  }
404
414
 
@@ -460,7 +470,7 @@ def product[R] { stream: () => R / emit[Int] }: (R, Int) = {
460
470
  }
461
471
  }
462
472
 
463
- def source[A, R] { stream: () => Unit / emit[A] } { reader: () => R / read[A] }: R = {
473
+ def source[A, R] { stream: () => Unit / emit[A] } { driver: () => R / next[A] }: R = {
464
474
  var next = box { None() }
465
475
  next = box {
466
476
  try {
@@ -473,12 +483,42 @@ def source[A, R] { stream: () => Unit / emit[A] } { reader: () => R / read[A] }:
473
483
  }
474
484
  }
475
485
  try {
476
- reader()
477
- } with read[A] {
486
+ driver()
487
+ } with next[A] {
478
488
  resume {
479
489
  next().getOrElse { do stop() }
480
490
  }
481
491
  }
482
492
  }
483
493
 
494
+ /// Provide the ability to peek when consuming a stream.
495
+ def peeking[A, R] { peeker: () => R / {next[A], peek[A]} }: R / next[A] = {
496
+ def upstream(): A / stop = do next()
497
+ var last = None()
498
+ try {
499
+ peeker()
500
+ } with peek[A] { () =>
501
+ resume {
502
+ last match {
503
+ case None() =>
504
+ val t = upstream()
505
+ last = Some(t)
506
+ return t
507
+ case Some(t) =>
508
+ return t
509
+ }
510
+ }
511
+ } with next[A] {
512
+ resume {
513
+ last match {
514
+ case None() =>
515
+ upstream()
516
+ case Some(t) =>
517
+ last = None()
518
+ return t
519
+ }
520
+ }
521
+ }
522
+ }
523
+
484
524
  }
@@ -237,26 +237,30 @@ extern def unsafeCharAt(str: String, n: Int) at {}: Char =
237
237
  // Streaming
238
238
  // ---------
239
239
 
240
- def feed[R](string: String) { reader: () => R / read[Char] } =
241
- feed(string.fromString) {
242
- decodeUTF8 {
243
- reader()
244
- }
245
- }
240
+ def feed[R](string: String) { driver: () => R / next[Char] } =
241
+ feed(string.fromString) { decodeUTF8 { driver() } }
246
242
 
247
243
  def each(string: String): Unit / emit[Char] =
248
244
  feed(string) {
249
245
  loop {
250
- do emit(do read())
246
+ do emit(do next())
251
247
  }
252
248
  }
253
249
 
250
+ def collect(capacity: Int) { stream: () => Unit / emit[Char] }: String =
251
+ returning::collect[Unit](capacity){stream}.second
252
+
254
253
  def collect { stream: () => Unit / emit[Char] }: String =
255
- returning::collect[Unit]{stream}.second
254
+ collect(4){stream}
256
255
 
257
256
  namespace returning {
258
- def collect[R] { stream: () => R / emit[Char] }: (R, String) = {
259
- val (result, bytes) = bytearray::returning::collect[R] { encodeUTF8 { stream } }
257
+
258
+ def collect[R](capacity: Int) { stream: () => R / emit[Char] }: (R, String) = {
259
+ val (result, bytes) = bytearray::returning::collect[R](capacity) { encodeUTF8 { stream } }
260
260
  (result, bytes.toString)
261
261
  }
262
+
263
+ def collect[R] { stream: () => R / emit[Char] }: (R, String) =
264
+ returning::collect(4){stream}
265
+
262
266
  }
@@ -46,10 +46,10 @@ def assert(obtained: String, expected: String): Unit / { Assertion, Formatted }
46
46
  assertEqual(obtained, expected) { (x, y) => x == y } { x => show(x) }
47
47
 
48
48
  def assertEqual[A](obtained: A, expected: A, msg: String): Unit / Assertion =
49
- assertEqual(obtained, expected, msg) { (x, y) => x.equals(y) }
49
+ assertEqual(obtained, expected, msg) { (x, y) => x.genericEquals(y) }
50
50
 
51
51
  def assertEqual[A](obtained: A, expected: A): Unit / { Assertion, Formatted } =
52
- assertEqual(obtained, expected) { (x, y) => x.equals(y) } { x => x.show }
52
+ assertEqual(obtained, expected) { (x, y) => x.genericEquals(y) } { x => x.genericShow }
53
53
 
54
54
  def assertEqual[A](obtained: A, expected: A, msg: String) { equals: (A, A) => Bool }: Unit / Assertion =
55
55
  do assert(equals(obtained, expected), msg)
@@ -1,46 +1,60 @@
1
- // Complexity of state:
2
- //
3
- // get: O(1)
4
- // set: O(1)
5
- // capture: O(1)
6
- // restore: O(|write operations since capture|)
1
+
2
+ // Sentinel: a node whose .value is Mem is the current root.
7
3
  const Mem = null
8
4
 
9
5
  // reusable buffer for rerooting
10
6
  const _rerootPath = []
11
7
 
12
- function Arena() {
13
- const s = {
14
- root: { value: Mem },
15
- generation: 0,
16
- fresh: (v) => {
17
- const r = {
18
- value: v,
19
- generation: s.generation,
20
- store: s,
21
- set: (v) => {
22
- const s = r.store
23
- const r_gen = r.generation
24
- const s_gen = s.generation
25
-
26
- if (r_gen == s_gen) {
27
- r.value = v;
28
- } else {
29
- const root = { value: Mem }
30
- // update store
31
- s.root.value = { ref: r, value: r.value, generation: r_gen, root: root }
32
- s.root = root
33
- r.value = v
34
- r.generation = s_gen
35
- }
36
- }
37
- };
38
- return r
39
- },
40
- // not implemented
41
- newRegion: () => s
42
- };
43
- return s
8
+ /**
9
+ * A mutable reference inside an `Arena`.
10
+ */
11
+ class Ref {
12
+ constructor(v, s) {
13
+ this.value = v;
14
+ this.generation = s.generation;
15
+ this.store = s;
16
+ }
17
+
18
+ set(v) {
19
+ const s = this.store;
20
+ const r_gen = this.generation;
21
+ const s_gen = s.generation;
22
+ if (r_gen === s_gen) {
23
+ this.value = v;
24
+ } else {
25
+ const root = { value: Mem };
26
+ s.root.value = { ref: this, value: this.value, generation: r_gen, root };
27
+
28
+ s.root = root;
29
+ this.value = v;
30
+ this.generation = s_gen;
31
+ }
32
+ }
33
+ }
34
+
35
+ /**
36
+ * A snapshottable arena: a bag of `Ref`s whose collective state can be
37
+ * captured in O(1) and restored in O(#writes since capture).
38
+ */
39
+ class Arena {
40
+ constructor() {
41
+ this.root = { value: Mem };
42
+ this.generation = 0;
43
+ }
44
+
45
+ /**
46
+ * Allocate a new reference with initial value v.
47
+ */
48
+ fresh(v) {
49
+ return new Ref(v, this);
50
+ }
51
+
52
+ /**
53
+ * Region support (not implemented!).
54
+ */
55
+ newRegion() {
56
+ return this;
57
+ }
44
58
  }
45
59
 
46
60
  function snapshot(s) {
@@ -84,10 +98,8 @@ function restore(store, snap) {
84
98
 
85
99
  // Common Runtime
86
100
  // --------------
87
- let _prompt = 1;
88
-
89
101
  const TOPLEVEL_K = (x, ks) => { throw { computationIsDone: true, result: x } }
90
- const TOPLEVEL_KS = { prompt: 0, arena: Arena(), rest: null }
102
+ const TOPLEVEL_KS = { stack: null, prompt: Symbol("toplevel"), arena: new Arena(), rest: null }
91
103
 
92
104
  function THUNK(f) {
93
105
  f.thunk = true
@@ -106,9 +118,9 @@ const RETURN = (x, ks) => ks.rest.stack(x, ks.rest)
106
118
 
107
119
  // HANDLE(ks, ks, (p, ks, k) => { STMT })
108
120
  function RESET(prog, ks, k) {
109
- const prompt = _prompt++;
121
+ const prompt = Symbol(); // gensym
110
122
  const rest = { stack: k, prompt: ks.prompt, arena: ks.arena, rest: ks.rest }
111
- return prog(prompt, { prompt, arena: Arena([]), rest }, RETURN)
123
+ return prog(prompt, { stack: null, prompt, arena: new Arena(), rest }, RETURN)
112
124
  }
113
125
 
114
126
  function SHIFT(p, body, ks, k) {
@@ -576,61 +576,6 @@ void c_yield(Stack stack) {
576
576
  c_timer_start(0, stack);
577
577
  }
578
578
 
579
- // Signals
580
- // --------
581
-
582
- typedef enum { INITIAL, NOTIFIED } signal_state_t;
583
-
584
- typedef struct {
585
- uint64_t rc;
586
- void* eraser;
587
- signal_state_t state;
588
- struct Pos value;
589
- Stack stack;
590
- } Signal;
591
-
592
- void c_signal_erase(void *envPtr) {
593
- // envPtr points to a Signal _after_ the eraser, so let's adjust it to point to the beginning.
594
- Signal *signal = (Signal*) (envPtr - offsetof(Signal, state));
595
- erasePositive(signal->value);
596
- if (signal->stack != NULL) { eraseStack(signal->stack); }
597
- }
598
-
599
- struct Pos c_signal_make() {
600
- Signal* f = (Signal*)malloc(sizeof(Signal));
601
-
602
- f->rc = 0;
603
- f->eraser = c_signal_erase;
604
- f->state = INITIAL;
605
- f->value = (struct Pos) { .tag = 0, .obj = NULL, };
606
- f->stack = NULL;
607
-
608
- return (struct Pos) { .tag = 0, .obj = f, };
609
- }
610
-
611
- void c_signal_notify(struct Pos signal, struct Pos value, Stack stack) {
612
- Signal* f = (Signal*)signal.obj;
613
- switch (f->state) {
614
- case INITIAL: {
615
- f->state = NOTIFIED;
616
- f->value = value;
617
- f->stack = stack;
618
- erasePositive(signal);
619
- break;
620
- }
621
- case NOTIFIED: {
622
- struct Pos other_value = f->value;
623
- f->value = (struct Pos) { .tag = 0, .obj = NULL, };
624
- Stack other_stack = f->stack;
625
- f->stack = NULL;
626
- erasePositive(signal);
627
- resume_Pos(other_stack, value);
628
- resume_Pos(stack, other_value);
629
- break;
630
- }
631
- }
632
- }
633
-
634
579
  // Subprocesses
635
580
  // ------------
636
581
 
@@ -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=1774203628"><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>
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=1776622808"><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>
@@ -8,7 +8,7 @@ Manage cookies</a></li></ul></li></ul></div><div class="navigation-bar-ctas hidd
8
8
  <i class="fa-solid fa-chevron-down" aria-hidden=true></i></a><ul class=collapse id=mobile-menu-join-us><li><a role=button href=#mobile-menu-membership data-toggle=collapse aria-expanded=false aria-controls=mobile-menu-membership>Membership
9
9
  <i class="fa-solid fa-chevron-down" aria-hidden=true></i></a><ul class=collapse id=mobile-menu-membership><li><a href=https://www.eclipse.org/membership/>Become a member</a></li><li><a href=https://www.eclipse.org/membership#tab-fees>Review membership fees</a></li><li><a href=https://membership.eclipse.org/portal target=_blank>Access member portal</a></li></ul></li><li><a role=button href=#mobile-menu-sponsorship-2 data-toggle=collapse aria-expanded=false aria-controls=mobile-menu-sponsorship-2>Sponsorship
10
10
  <i class="fa-solid fa-chevron-down" aria-hidden=true></i></a><ul class=collapse id=mobile-menu-sponsorship-2><li><a href=https://www.eclipse.org/sponsor/>Support us as a sponsor</a></li></ul></li><li><a role=button href=#mobile-menu-contribute data-toggle=collapse aria-expanded=false aria-controls=mobile-menu-contribute>Contribute
11
- <i class="fa-solid fa-chevron-down" aria-hidden=true></i></a><ul class=collapse id=mobile-menu-contribute><li><a href=https://www.eclipse.org/contribute/>How to contribute</a></li><li><a href=https://www.eclipse.org/projects/training/>Committer training</a></li></ul></li><li><a role=button href=#mobile-menu-collaborate-with-us data-toggle=collapse aria-expanded=false aria-controls=mobile-menu-collaborate-with-us>Collaborate with us
11
+ <i class="fa-solid fa-chevron-down" aria-hidden=true></i></a><ul class=collapse id=mobile-menu-contribute><li><a href=https://www.eclipse.org/contribute/>How to contribute</a></li><li><a href=https://www.eclipse.org/projects/bring-your-project/>Bring us your project</a></li><li><a href=https://www.eclipse.org/projects/training/>Committer training</a></li></ul></li><li><a role=button href=#mobile-menu-collaborate-with-us data-toggle=collapse aria-expanded=false aria-controls=mobile-menu-collaborate-with-us>Collaborate with us
12
12
  <i class="fa-solid fa-chevron-down" aria-hidden=true></i></a><ul class=collapse id=mobile-menu-collaborate-with-us><li><a href=https://www.eclipse.org/org/working-groups/explore/>Join an existing industry collaboration</a></li><li><a href=https://www.eclipse.org/collaborations/#start-collaboration>Start a new collaboration</a></li></ul></li></ul></li><li><a role=button href=#mobile-menu-what-we-do data-toggle=collapse aria-expanded=false aria-controls=mobile-menu-what-we-do>What we do
13
13
  <i class="fa-solid fa-chevron-down" aria-hidden=true></i></a><ul class=collapse id=mobile-menu-what-we-do><li><a role=button href=#mobile-menu-projects data-toggle=collapse aria-expanded=false aria-controls=mobile-menu-projects>Projects
14
14
  <i class="fa-solid fa-chevron-down" aria-hidden=true></i></a><ul class=collapse id=mobile-menu-projects><li><a href=https://projects.eclipse.org/>Explore projects</a></li><li><a href=https://www.eclipse.org/specifications/>View specifications</a></li></ul></li><li><a role=button href=#mobile-menu-industry-collaborations data-toggle=collapse aria-expanded=false aria-controls=mobile-menu-industry-collaborations>Industry collaborations
@@ -26,7 +26,7 @@ Manage cookies</a></li></ul></li></ul></div><div class="navigation-bar-ctas hidd
26
26
  <i class="fa-solid fa-chevron-down" aria-hidden=true></i></a><ul class=collapse id=mobile-menu-the-foundation><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></li><li><a role=button href=#mobile-menu-our-members data-toggle=collapse aria-expanded=false aria-controls=mobile-menu-our-members>Our members
27
27
  <i class="fa-solid fa-chevron-down" aria-hidden=true></i></a><ul class=collapse id=mobile-menu-our-members><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></li><li><a role=button href=#mobile-menu-sponsorship data-toggle=collapse aria-expanded=false aria-controls=mobile-menu-sponsorship>Sponsorship
28
28
  <i class="fa-solid fa-chevron-down" aria-hidden=true></i></a><ul class=collapse id=mobile-menu-sponsorship><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></li><li><a role=button href=#mobile-menu-more data-toggle=collapse aria-expanded=false aria-controls=mobile-menu-more>More
29
- <i class="fa-solid fa-chevron-down" aria-hidden=true></i></a><ul class=collapse id=mobile-menu-more><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></li></ul></li></ul></nav></div><div class=mega-menu><div class="menu hidden" id=join-us-menu><div class=container><nav><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>Membership</h2></div><ul><li><a href=https://www.eclipse.org/membership/>Become a member</a></li><li><a href=https://www.eclipse.org/membership#tab-fees>Review membership fees</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-solid fa-bookmark" aria-hidden=true></i></span><h2 class=menu-heading>Sponsorship</h2></div><ul><li><a href=https://www.eclipse.org/sponsor/>Support us as a sponsor</a></li></ul></div><div class=submenu><div class=menu-heading-group><span class=menu-pre><i class="fa-solid fa-handshake-simple" aria-hidden=true></i></span><h2 class=menu-heading>Contribute</h2></div><ul><li><a href=https://www.eclipse.org/contribute/>How to contribute</a></li><li><a href=https://www.eclipse.org/projects/training/>Committer training</a></li></ul></div><div class=submenu><div class=menu-heading-group><span class=menu-pre><i class="fa-solid fa-users" aria-hidden=true></i></span><h2 class=menu-heading>Collaborate with us</h2></div><ul><li><a href=https://www.eclipse.org/org/working-groups/explore/>Join an existing industry collaboration</a></li><li><a href=https://www.eclipse.org/collaborations/#start-collaboration>Start a new collaboration</a></li></ul></div></nav></div></div><div class="menu hidden" id=what-we-do-menu><div class=container><nav><div class=submenu><div class=menu-heading-group><span class=menu-pre><i class="fa-solid fa-puzzle-piece" aria-hidden=true></i></span><h2 class=menu-heading>Projects</h2></div><ul><li><a href=https://projects.eclipse.org/>Explore projects</a></li><li><a href=https://www.eclipse.org/specifications/>View specifications</a></li></ul></div><div class=submenu><div class=menu-heading-group><span class=menu-pre><i class="fa-solid fa-building" aria-hidden=true></i></span><h2 class=menu-heading>Industry collaborations</h2></div><ul><li><a href=https://www.eclipse.org/org/working-groups/explore/>Explore collaborations</a></li><li><a href=https://www.eclipse.org/org/working-groups/about/>Join a working group</a></li><li><a href=https://www.eclipse.org/collaborations/interest-groups/>Join an interest group</a></li><li><a href=https://www.eclipse.org/org/value/>Read success stories</a></li></ul></div><div class=submenu><div class=menu-heading-group><span class=menu-pre><i class="fa-solid fa-laptop-code" aria-hidden=true></i></span><h2 class=menu-heading>Core services</h2></div><ul><li><a href=https://www.eclipse.org/org/services/>Explore core services</a></li><li><a href=https://www.eclipse.org/security/>Ensure project security</a></li></ul></div><div class=submenu><div class=menu-heading-group><span class=menu-pre><i class="fa-solid fa-bullseye" aria-hidden=true></i></span><h2 class=menu-heading>Key initiatives</h2></div><ul><li><a href=https://www.eclipse.org/topics/edge-and-iot/>Embedded & IoT</a></li><li><a href=https://www.eclipse.org/topics/cloud-native/>Enterprise Java</a></li><li><a href=https://dataspace.eclipse.org/>Data sovereignty</a></li><li><a href=https://www.eclipse.org/security/>Security & privacy</a></li><li><a href=https://www.eclipse.org/topics/ide/>Developer tools & IDEs</a></li><li><a href=https://aieclipse.org/ target=_blank>AI & emerging technologies</a>
29
+ <i class="fa-solid fa-chevron-down" aria-hidden=true></i></a><ul class=collapse id=mobile-menu-more><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></li></ul></li></ul></nav></div><div class=mega-menu><div class="menu hidden" id=join-us-menu><div class=container><nav><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>Membership</h2></div><ul><li><a href=https://www.eclipse.org/membership/>Become a member</a></li><li><a href=https://www.eclipse.org/membership#tab-fees>Review membership fees</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-solid fa-bookmark" aria-hidden=true></i></span><h2 class=menu-heading>Sponsorship</h2></div><ul><li><a href=https://www.eclipse.org/sponsor/>Support us as a sponsor</a></li></ul></div><div class=submenu><div class=menu-heading-group><span class=menu-pre><i class="fa-solid fa-handshake-simple" aria-hidden=true></i></span><h2 class=menu-heading>Contribute</h2></div><ul><li><a href=https://www.eclipse.org/contribute/>How to contribute</a></li><li><a href=https://www.eclipse.org/projects/bring-your-project/>Bring us your project</a></li><li><a href=https://www.eclipse.org/projects/training/>Committer training</a></li></ul></div><div class=submenu><div class=menu-heading-group><span class=menu-pre><i class="fa-solid fa-users" aria-hidden=true></i></span><h2 class=menu-heading>Collaborate with us</h2></div><ul><li><a href=https://www.eclipse.org/org/working-groups/explore/>Join an existing industry collaboration</a></li><li><a href=https://www.eclipse.org/collaborations/#start-collaboration>Start a new collaboration</a></li></ul></div></nav></div></div><div class="menu hidden" id=what-we-do-menu><div class=container><nav><div class=submenu><div class=menu-heading-group><span class=menu-pre><i class="fa-solid fa-puzzle-piece" aria-hidden=true></i></span><h2 class=menu-heading>Projects</h2></div><ul><li><a href=https://projects.eclipse.org/>Explore projects</a></li><li><a href=https://www.eclipse.org/specifications/>View specifications</a></li></ul></div><div class=submenu><div class=menu-heading-group><span class=menu-pre><i class="fa-solid fa-building" aria-hidden=true></i></span><h2 class=menu-heading>Industry collaborations</h2></div><ul><li><a href=https://www.eclipse.org/org/working-groups/explore/>Explore collaborations</a></li><li><a href=https://www.eclipse.org/org/working-groups/about/>Join a working group</a></li><li><a href=https://www.eclipse.org/collaborations/interest-groups/>Join an interest group</a></li><li><a href=https://www.eclipse.org/org/value/>Read success stories</a></li></ul></div><div class=submenu><div class=menu-heading-group><span class=menu-pre><i class="fa-solid fa-laptop-code" aria-hidden=true></i></span><h2 class=menu-heading>Core services</h2></div><ul><li><a href=https://www.eclipse.org/org/services/>Explore core services</a></li><li><a href=https://www.eclipse.org/security/>Ensure project security</a></li></ul></div><div class=submenu><div class=menu-heading-group><span class=menu-pre><i class="fa-solid fa-bullseye" aria-hidden=true></i></span><h2 class=menu-heading>Key initiatives</h2></div><ul><li><a href=https://www.eclipse.org/topics/edge-and-iot/>Embedded & IoT</a></li><li><a href=https://www.eclipse.org/topics/cloud-native/>Enterprise Java</a></li><li><a href=https://dataspace.eclipse.org/>Data sovereignty</a></li><li><a href=https://www.eclipse.org/security/>Security & privacy</a></li><li><a href=https://www.eclipse.org/topics/ide/>Developer tools & IDEs</a></li><li><a href=https://aieclipse.org/ target=_blank>AI & emerging technologies</a>
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><li><a href=https://opensourceglobalvoices.org/ target=_blank>Explore OSS global voices</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-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>
@@ -43,4 +43,4 @@ Manage cookies</a></li></ul></li></ul></div><div class="navigation-bar-ctas hidd
43
43
  <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>
44
44
  <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&amp;id=e7538485cd&amp;f_id=00f9c2e1f0" method=post novalidate target=_blank><div class=text-field-outlined><input name=EMAIL type=email placeholder="Your email">
45
45
  <button class=newsletter-form-submit type=submit name=subscribe id=mc-embedded-subscribe aria-label=Submit>
46
- <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 &copy; 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=1774203628"></script><script>(function(){})(jQuery,document)</script></div></body></html>
46
+ <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 &copy; 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=1776622809"></script><script>(function(){})(jQuery,document)</script></div></body></html>