@effekt-lang/effekt 0.3.0 → 0.4.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/README.md +6 -18
- package/bin/effekt +0 -0
- package/libraries/common/args.effekt +0 -27
- package/libraries/common/array.effekt +11 -16
- package/libraries/common/bench.effekt +32 -6
- package/libraries/common/effekt.effekt +30 -69
- package/libraries/common/exception.effekt +0 -1
- package/libraries/common/io/console.effekt +32 -36
- package/libraries/common/io/error.effekt +111 -2
- package/libraries/common/io/filesystem.effekt +274 -0
- package/libraries/common/io/network.effekt +30 -54
- package/libraries/common/io/time.effekt +9 -12
- package/libraries/common/io.effekt +54 -124
- package/libraries/common/list.effekt +18 -0
- package/libraries/common/process.effekt +0 -1
- package/libraries/common/ref.effekt +4 -7
- package/libraries/common/string/tty.effekt +66 -0
- package/libraries/common/string.effekt +0 -34
- package/libraries/common/test.effekt +96 -34
- package/libraries/js/unsafe/cont.effekt +1 -1
- package/libraries/llvm/io.c +258 -378
- package/libraries/llvm/main.c +3 -0
- package/libraries/llvm/rts.ll +57 -38
- package/libraries/llvm/types.c +10 -1
- package/licenses/eclipse public license, version 2.0 - epl-2.0.html +4 -4
- package/licenses/mit license - mit-license.html +19 -19
- package/licenses/the bsd license - bsd-license.html +19 -19
- package/licenses/the mit license - mit.html +20 -20
- package/package.json +1 -1
- package/libraries/chez/lift/effekt.ss +0 -118
- package/libraries/common/io/files.effekt +0 -282
- package/libraries/js/io.js +0 -143
- package/libraries/llvm/io.ll +0 -19
- package/libraries/ml/effekt.sml +0 -65
- package/libraries/ml/internal/mllist.effekt +0 -9
- package/libraries/ml/internal/mloption.effekt +0 -18
- package/libraries/ml/random.effekt +0 -85
- package/libraries/ml/text/regex.effekt +0 -102
package/libraries/llvm/main.c
CHANGED
package/libraries/llvm/rts.ll
CHANGED
|
@@ -110,19 +110,23 @@ declare ptr @realloc(ptr, i64)
|
|
|
110
110
|
declare void @memcpy(ptr, ptr, i64)
|
|
111
111
|
declare i64 @llvm.ctlz.i64 (i64 , i1)
|
|
112
112
|
declare i64 @llvm.fshr.i64(i64, i64, i64)
|
|
113
|
+
declare double @llvm.sqrt.f64(double)
|
|
114
|
+
declare double @llvm.round.f64(double)
|
|
115
|
+
declare double @llvm.ceil.f64(double)
|
|
116
|
+
declare double @llvm.floor.f64(double)
|
|
113
117
|
declare void @print(i64)
|
|
114
118
|
declare void @exit(i64)
|
|
115
119
|
|
|
116
120
|
|
|
117
121
|
; Prompts
|
|
118
122
|
|
|
119
|
-
define %Prompt @currentPrompt(%Stack %stack) {
|
|
123
|
+
define private %Prompt @currentPrompt(%Stack %stack) {
|
|
120
124
|
%prompt_pointer = getelementptr %StackValue, ptr %stack, i64 0, i32 3
|
|
121
125
|
%prompt = load %Prompt, ptr %prompt_pointer
|
|
122
126
|
ret %Prompt %prompt
|
|
123
127
|
}
|
|
124
128
|
|
|
125
|
-
define %Prompt @freshPrompt() {
|
|
129
|
+
define private %Prompt @freshPrompt() {
|
|
126
130
|
%currentPrompt = load %Prompt, ptr @lastPrompt
|
|
127
131
|
%newPrompt = add %Prompt %currentPrompt, 1
|
|
128
132
|
store %Prompt %newPrompt, ptr @lastPrompt
|
|
@@ -131,7 +135,7 @@ define %Prompt @freshPrompt() {
|
|
|
131
135
|
|
|
132
136
|
; Garbage collection
|
|
133
137
|
|
|
134
|
-
define %Object @newObject(%Eraser %eraser, i64 %environmentSize) alwaysinline {
|
|
138
|
+
define private %Object @newObject(%Eraser %eraser, i64 %environmentSize) alwaysinline {
|
|
135
139
|
; This magical 16 is the size of the object header
|
|
136
140
|
%size = add i64 %environmentSize, 16
|
|
137
141
|
%object = call ptr @malloc(i64 %size)
|
|
@@ -142,13 +146,13 @@ define %Object @newObject(%Eraser %eraser, i64 %environmentSize) alwaysinline {
|
|
|
142
146
|
ret %Object %object
|
|
143
147
|
}
|
|
144
148
|
|
|
145
|
-
define %Environment @objectEnvironment(%Object %object) alwaysinline {
|
|
149
|
+
define private %Environment @objectEnvironment(%Object %object) alwaysinline {
|
|
146
150
|
; Environment is stored right after header
|
|
147
151
|
%environment = getelementptr %Header, ptr %object, i64 1
|
|
148
152
|
ret %Environment %environment
|
|
149
153
|
}
|
|
150
154
|
|
|
151
|
-
define void @shareObject(%Object %object) alwaysinline {
|
|
155
|
+
define private void @shareObject(%Object %object) alwaysinline {
|
|
152
156
|
%isNull = icmp eq %Object %object, null
|
|
153
157
|
br i1 %isNull, label %done, label %next
|
|
154
158
|
|
|
@@ -175,7 +179,7 @@ define void @shareNegative(%Neg %val) alwaysinline {
|
|
|
175
179
|
ret void
|
|
176
180
|
}
|
|
177
181
|
|
|
178
|
-
define void @eraseObject(%Object %object) alwaysinline {
|
|
182
|
+
define private void @eraseObject(%Object %object) alwaysinline {
|
|
179
183
|
%isNull = icmp eq %Object %object, null
|
|
180
184
|
br i1 %isNull, label %done, label %next
|
|
181
185
|
|
|
@@ -215,7 +219,7 @@ define void @eraseNegative(%Neg %val) alwaysinline {
|
|
|
215
219
|
|
|
216
220
|
|
|
217
221
|
; Arena management
|
|
218
|
-
define ptr @getRegionPointer(%Prompt %prompt, %Stack %stack) {
|
|
222
|
+
define private ptr @getRegionPointer(%Prompt %prompt, %Stack %stack) {
|
|
219
223
|
entry:
|
|
220
224
|
%prompt_pointer = getelementptr %StackValue, %Stack %stack, i64 0, i32 3
|
|
221
225
|
%currentPrompt = load %Prompt, ptr %prompt_pointer
|
|
@@ -233,7 +237,7 @@ found:
|
|
|
233
237
|
ret ptr %stackRegion
|
|
234
238
|
}
|
|
235
239
|
|
|
236
|
-
define { ptr, %Reference } @alloc(i64 %index, %Prompt %prompt, %Stack %stack) alwaysinline {
|
|
240
|
+
define private { ptr, %Reference } @alloc(i64 %index, %Prompt %prompt, %Stack %stack) alwaysinline {
|
|
237
241
|
%region_pointer = call ptr @getRegionPointer(%Prompt %prompt, %Stack %stack)
|
|
238
242
|
|
|
239
243
|
%stackPointer_pointer = getelementptr %Region, ptr %region_pointer, i64 0, i64 %index, i32 0
|
|
@@ -295,7 +299,7 @@ realloc:
|
|
|
295
299
|
}
|
|
296
300
|
|
|
297
301
|
|
|
298
|
-
define ptr @getPointer(%Reference %reference, i64 %index, %Stack %stack) {
|
|
302
|
+
define private ptr @getPointer(%Reference %reference, i64 %index, %Stack %stack) {
|
|
299
303
|
%prompt32 = extractvalue %Reference %reference, 0
|
|
300
304
|
%offset32 = extractvalue %Reference %reference, 1
|
|
301
305
|
%prompt = zext i32 %prompt32 to i64
|
|
@@ -308,7 +312,7 @@ define ptr @getPointer(%Reference %reference, i64 %index, %Stack %stack) {
|
|
|
308
312
|
ret ptr %pointer
|
|
309
313
|
}
|
|
310
314
|
|
|
311
|
-
define %Stack @getStack(%Stack %stack, %Prompt %prompt) {
|
|
315
|
+
define private %Stack @getStack(%Stack %stack, %Prompt %prompt) {
|
|
312
316
|
%promptPointer = getelementptr %StackValue, %Stack %stack, i64 0, i32 3
|
|
313
317
|
%thisPrompt = load %Prompt, ptr %promptPointer
|
|
314
318
|
%found = icmp eq %Prompt %prompt, %thisPrompt
|
|
@@ -324,7 +328,7 @@ recurse:
|
|
|
324
328
|
ret %Stack %result
|
|
325
329
|
}
|
|
326
330
|
|
|
327
|
-
define ptr @getVarPointer(%Reference %reference, %Stack %stack) {
|
|
331
|
+
define private ptr @getVarPointer(%Reference %reference, %Stack %stack) {
|
|
328
332
|
%prompt32 = extractvalue %Reference %reference, 0
|
|
329
333
|
%offset32 = extractvalue %Reference %reference, 1
|
|
330
334
|
%prompt = zext i32 %prompt32 to i64
|
|
@@ -337,7 +341,7 @@ define ptr @getVarPointer(%Reference %reference, %Stack %stack) {
|
|
|
337
341
|
ret ptr %varPointer
|
|
338
342
|
}
|
|
339
343
|
|
|
340
|
-
define %Reference @newReference(%Stack %stack) alwaysinline {
|
|
344
|
+
define private %Reference @newReference(%Stack %stack) alwaysinline {
|
|
341
345
|
%stackPointerPointer = getelementptr %StackValue, %Stack %stack, i64 0, i32 1, i32 0
|
|
342
346
|
%basePointer = getelementptr %StackValue, %Stack %stack, i64 0, i32 1, i32 1
|
|
343
347
|
|
|
@@ -361,7 +365,7 @@ define %Reference @newReference(%Stack %stack) alwaysinline {
|
|
|
361
365
|
|
|
362
366
|
; Stack management
|
|
363
367
|
|
|
364
|
-
define %StackPointer @stackAllocate(%Stack %stack, i64 %n) {
|
|
368
|
+
define private %StackPointer @stackAllocate(%Stack %stack, i64 %n) {
|
|
365
369
|
%stackStackPointer = getelementptr %StackValue, %Stack %stack, i64 0, i32 1, i32 0
|
|
366
370
|
%stackPointer = load %StackPointer, ptr %stackStackPointer
|
|
367
371
|
|
|
@@ -370,7 +374,7 @@ define %StackPointer @stackAllocate(%Stack %stack, i64 %n) {
|
|
|
370
374
|
ret %StackPointer %stackPointer
|
|
371
375
|
}
|
|
372
376
|
|
|
373
|
-
define %StackPointer @stackDeallocate(%Stack %stack, i64 %n) {
|
|
377
|
+
define private %StackPointer @stackDeallocate(%Stack %stack, i64 %n) {
|
|
374
378
|
%stackStackPointer = getelementptr %StackValue, %Stack %stack, i64 0, i32 1, i32 0
|
|
375
379
|
%stackPointer = load %StackPointer, ptr %stackStackPointer
|
|
376
380
|
|
|
@@ -383,7 +387,7 @@ define %StackPointer @stackDeallocate(%Stack %stack, i64 %n) {
|
|
|
383
387
|
|
|
384
388
|
; Meta-stack management
|
|
385
389
|
|
|
386
|
-
define %Memory @newMemory() {
|
|
390
|
+
define private %Memory @newMemory() {
|
|
387
391
|
%stackPointer = call %StackPointer @malloc(i64 268435456)
|
|
388
392
|
%limit = getelementptr i8, ptr %stackPointer, i64 268435456
|
|
389
393
|
|
|
@@ -394,7 +398,7 @@ define %Memory @newMemory() {
|
|
|
394
398
|
ret %Memory %memory.2
|
|
395
399
|
}
|
|
396
400
|
|
|
397
|
-
define %Stack @newStack(%Prompt %prompt) {
|
|
401
|
+
define private %Stack @newStack(%Prompt %prompt) {
|
|
398
402
|
|
|
399
403
|
; TODO find actual size of stack
|
|
400
404
|
%stack = call ptr @malloc(i64 120)
|
|
@@ -413,7 +417,7 @@ define %Stack @newStack(%Prompt %prompt) {
|
|
|
413
417
|
ret %Stack %stack
|
|
414
418
|
}
|
|
415
419
|
|
|
416
|
-
define void @pushStack(%Stack %stack, %Stack %oldStack) {
|
|
420
|
+
define private void @pushStack(%Stack %stack, %Stack %oldStack) {
|
|
417
421
|
%stackRest = getelementptr %StackValue, %Stack %stack, i64 0, i32 4
|
|
418
422
|
%rest = load %Stack, ptr %stackRest
|
|
419
423
|
%isNull = icmp eq %Stack %rest, null
|
|
@@ -428,7 +432,7 @@ next:
|
|
|
428
432
|
ret void
|
|
429
433
|
}
|
|
430
434
|
|
|
431
|
-
define %Stack @popStacks(%Stack %stack, %Prompt %prompt) {
|
|
435
|
+
define private %Stack @popStacks(%Stack %stack, %Prompt %prompt) {
|
|
432
436
|
entry:
|
|
433
437
|
%prompt_pointer = getelementptr %StackValue, %Stack %stack, i64 0, i32 3
|
|
434
438
|
%currentPrompt = load %Prompt, ptr %prompt_pointer
|
|
@@ -448,13 +452,13 @@ found:
|
|
|
448
452
|
ret %Stack %nextStack2
|
|
449
453
|
}
|
|
450
454
|
|
|
451
|
-
define void @eraseMemory(%Memory %memory) {
|
|
455
|
+
define private void @eraseMemory(%Memory %memory) {
|
|
452
456
|
%stackPointer = extractvalue %Memory %memory, 0
|
|
453
457
|
call void @free(%StackPointer %stackPointer)
|
|
454
458
|
ret void
|
|
455
459
|
}
|
|
456
460
|
|
|
457
|
-
define void @forEachObject(ptr %elementPointer, ptr %end, ptr %f) alwaysinline {
|
|
461
|
+
define private void @forEachObject(ptr %elementPointer, ptr %end, ptr %f) alwaysinline {
|
|
458
462
|
%done = icmp uge ptr %elementPointer, %end
|
|
459
463
|
br i1 %done, label %return, label %erase
|
|
460
464
|
|
|
@@ -470,7 +474,7 @@ return:
|
|
|
470
474
|
ret void
|
|
471
475
|
}
|
|
472
476
|
|
|
473
|
-
define void @eraseRegion(%Region %region) alwaysinline {
|
|
477
|
+
define private void @eraseRegion(%Region %region) alwaysinline {
|
|
474
478
|
%valuesBase = extractvalue %Region %region, 0, 1
|
|
475
479
|
call void @free(%Base %valuesBase)
|
|
476
480
|
|
|
@@ -487,7 +491,7 @@ define void @eraseRegion(%Region %region) alwaysinline {
|
|
|
487
491
|
ret void
|
|
488
492
|
}
|
|
489
493
|
|
|
490
|
-
define %Stack @underflowStack(%Stack %stack) {
|
|
494
|
+
define private %Stack @underflowStack(%Stack %stack) {
|
|
491
495
|
%stackMemory = getelementptr %StackValue, %Stack %stack, i64 0, i32 1
|
|
492
496
|
%stackRegion = getelementptr %StackValue, %Stack %stack, i64 0, i32 2
|
|
493
497
|
%stackRest = getelementptr %StackValue, %Stack %stack, i64 0, i32 4
|
|
@@ -503,7 +507,7 @@ define %Stack @underflowStack(%Stack %stack) {
|
|
|
503
507
|
ret %Stack %rest
|
|
504
508
|
}
|
|
505
509
|
|
|
506
|
-
define %Memory @copyMemory(%Memory %memory) alwaysinline {
|
|
510
|
+
define private %Memory @copyMemory(%Memory %memory) alwaysinline {
|
|
507
511
|
%stackPointer = extractvalue %Memory %memory, 0
|
|
508
512
|
%base = extractvalue %Memory %memory, 1
|
|
509
513
|
%limit = extractvalue %Memory %memory, 2
|
|
@@ -530,7 +534,7 @@ define %Memory @copyMemory(%Memory %memory) alwaysinline {
|
|
|
530
534
|
ret %Memory %memory.2
|
|
531
535
|
}
|
|
532
536
|
|
|
533
|
-
define %Region @copyRegion(%Region %region) alwaysinline {
|
|
537
|
+
define private %Region @copyRegion(%Region %region) alwaysinline {
|
|
534
538
|
%memory.0 = extractvalue %Region %region, 0
|
|
535
539
|
%memory.1 = extractvalue %Region %region, 1
|
|
536
540
|
%memory.2 = extractvalue %Region %region, 2
|
|
@@ -554,7 +558,7 @@ define %Region @copyRegion(%Region %region) alwaysinline {
|
|
|
554
558
|
ret %Region %region.2
|
|
555
559
|
}
|
|
556
560
|
|
|
557
|
-
define %Stack @uniqueStack(%Stack %stack) alwaysinline {
|
|
561
|
+
define private %Stack @uniqueStack(%Stack %stack) alwaysinline {
|
|
558
562
|
|
|
559
563
|
entry:
|
|
560
564
|
%stackReferenceCount = getelementptr %StackValue, %Stack %stack, i64 0, i32 0
|
|
@@ -658,7 +662,7 @@ done:
|
|
|
658
662
|
ret void
|
|
659
663
|
}
|
|
660
664
|
|
|
661
|
-
define void @shareFrames(%StackPointer %stackPointer) alwaysinline {
|
|
665
|
+
define private void @shareFrames(%StackPointer %stackPointer) alwaysinline {
|
|
662
666
|
%newStackPointer = getelementptr %FrameHeader, %StackPointer %stackPointer, i64 -1
|
|
663
667
|
%stackSharer = getelementptr %FrameHeader, %StackPointer %newStackPointer, i64 0, i32 1
|
|
664
668
|
%sharer = load %Sharer, ptr %stackSharer
|
|
@@ -666,7 +670,7 @@ define void @shareFrames(%StackPointer %stackPointer) alwaysinline {
|
|
|
666
670
|
ret void
|
|
667
671
|
}
|
|
668
672
|
|
|
669
|
-
define void @eraseFrames(%StackPointer %stackPointer) alwaysinline {
|
|
673
|
+
define private void @eraseFrames(%StackPointer %stackPointer) alwaysinline {
|
|
670
674
|
%newStackPointer = getelementptr %FrameHeader, %StackPointer %stackPointer, i64 -1
|
|
671
675
|
%stackEraser = getelementptr %FrameHeader, %StackPointer %newStackPointer, i64 0, i32 2
|
|
672
676
|
%eraser = load %Eraser, ptr %stackEraser
|
|
@@ -676,23 +680,23 @@ define void @eraseFrames(%StackPointer %stackPointer) alwaysinline {
|
|
|
676
680
|
|
|
677
681
|
; RTS initialization
|
|
678
682
|
|
|
679
|
-
define tailcc void @topLevel(%Pos %val, %Stack %stack) {
|
|
683
|
+
define private tailcc void @topLevel(%Pos %val, %Stack %stack) {
|
|
680
684
|
%rest = call %Stack @underflowStack(%Stack %stack)
|
|
681
685
|
; assert %rest == null
|
|
682
686
|
ret void
|
|
683
687
|
}
|
|
684
688
|
|
|
685
|
-
define void @topLevelSharer(%Environment %environment) {
|
|
689
|
+
define private void @topLevelSharer(%Environment %environment) {
|
|
686
690
|
; TODO this should never be called
|
|
687
691
|
ret void
|
|
688
692
|
}
|
|
689
693
|
|
|
690
|
-
define void @topLevelEraser(%Environment %environment) {
|
|
694
|
+
define private void @topLevelEraser(%Environment %environment) {
|
|
691
695
|
; TODO this should never be called
|
|
692
696
|
ret void
|
|
693
697
|
}
|
|
694
698
|
|
|
695
|
-
define %Stack @withEmptyStack() {
|
|
699
|
+
define private %Stack @withEmptyStack() {
|
|
696
700
|
; TODO all stacks share the same source of fresh prompts
|
|
697
701
|
%prompt = call %Prompt @freshPrompt()
|
|
698
702
|
%stack = call %Stack @newStack(%Prompt %prompt)
|
|
@@ -714,7 +718,23 @@ define %Stack @withEmptyStack() {
|
|
|
714
718
|
ret %Stack %stack
|
|
715
719
|
}
|
|
716
720
|
|
|
717
|
-
define void @
|
|
721
|
+
define void @resume_Int(%Stack %stack, %Int %argument) {
|
|
722
|
+
%stackPointer = call ccc %StackPointer @stackDeallocate(%Stack %stack, i64 24)
|
|
723
|
+
%returnAddressPointer = getelementptr %FrameHeader, %StackPointer %stackPointer, i64 0, i32 0
|
|
724
|
+
%returnAddress = load %ReturnAddress, ptr %returnAddressPointer
|
|
725
|
+
tail call tailcc void %returnAddress(%Int %argument, %Stack %stack)
|
|
726
|
+
ret void
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
define void @resume_Pos(%Stack %stack, %Pos %argument) {
|
|
730
|
+
%stackPointer = call ccc %StackPointer @stackDeallocate(%Stack %stack, i64 24)
|
|
731
|
+
%returnAddressPointer = getelementptr %FrameHeader, %StackPointer %stackPointer, i64 0, i32 0
|
|
732
|
+
%returnAddress = load %ReturnAddress, ptr %returnAddressPointer
|
|
733
|
+
tail call tailcc void %returnAddress(%Pos %argument, %Stack %stack)
|
|
734
|
+
ret void
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
define void @run(%Neg %f) {
|
|
718
738
|
; fresh stack
|
|
719
739
|
%stack = call %Stack @withEmptyStack()
|
|
720
740
|
|
|
@@ -725,12 +745,11 @@ define void @run_i64(%Neg %f, i64 %arg) {
|
|
|
725
745
|
%functionPointer = load ptr, ptr %functionPointerPointer
|
|
726
746
|
|
|
727
747
|
; call
|
|
728
|
-
tail call tailcc %Pos %functionPointer(%Object %object,
|
|
748
|
+
tail call tailcc %Pos %functionPointer(%Object %object, %Stack %stack)
|
|
729
749
|
ret void
|
|
730
750
|
}
|
|
731
751
|
|
|
732
|
-
|
|
733
|
-
define void @run_Pos(%Neg %f, %Pos %arg) {
|
|
752
|
+
define void @run_Int(%Neg %f, i64 %argument) {
|
|
734
753
|
; fresh stack
|
|
735
754
|
%stack = call %Stack @withEmptyStack()
|
|
736
755
|
|
|
@@ -741,11 +760,11 @@ define void @run_Pos(%Neg %f, %Pos %arg) {
|
|
|
741
760
|
%functionPointer = load ptr, ptr %functionPointerPointer
|
|
742
761
|
|
|
743
762
|
; call
|
|
744
|
-
tail call tailcc %Pos %functionPointer(%Object %object, %
|
|
763
|
+
tail call tailcc %Pos %functionPointer(%Object %object, %Evidence 0, i64 %argument, %Stack %stack)
|
|
745
764
|
ret void
|
|
746
765
|
}
|
|
747
766
|
|
|
748
|
-
define void @
|
|
767
|
+
define void @run_Pos(%Neg %f, %Pos %argument) {
|
|
749
768
|
; fresh stack
|
|
750
769
|
%stack = call %Stack @withEmptyStack()
|
|
751
770
|
|
|
@@ -756,6 +775,6 @@ define void @run(%Neg %f) {
|
|
|
756
775
|
%functionPointer = load ptr, ptr %functionPointerPointer
|
|
757
776
|
|
|
758
777
|
; call
|
|
759
|
-
tail call tailcc %Pos %functionPointer(%Object %object, %Stack %stack)
|
|
778
|
+
tail call tailcc %Pos %functionPointer(%Object %object, %Evidence 0, %Pos %argument, %Stack %stack)
|
|
760
779
|
ret void
|
|
761
780
|
}
|
package/libraries/llvm/types.c
CHANGED
|
@@ -26,18 +26,27 @@ static const struct Pos BooleanTrue = (struct Pos) { .tag = 1, .obj = NULL, };
|
|
|
26
26
|
|
|
27
27
|
typedef struct Pos String;
|
|
28
28
|
|
|
29
|
+
struct StackValue;
|
|
30
|
+
|
|
31
|
+
typedef struct StackValue* Stack;
|
|
32
|
+
|
|
29
33
|
|
|
30
34
|
// Defined in rts.ll
|
|
31
35
|
|
|
36
|
+
extern void resume_Int(Stack, Int);
|
|
37
|
+
extern void resume_Pos(Stack, struct Pos);
|
|
38
|
+
|
|
32
39
|
extern void run(struct Neg);
|
|
33
|
-
extern void
|
|
40
|
+
extern void run_Int(struct Neg, Int);
|
|
34
41
|
extern void run_Pos(struct Neg, struct Pos);
|
|
35
42
|
|
|
36
43
|
// Reference counting primitives defined in LLVM
|
|
37
44
|
extern void eraseNegative(struct Neg);
|
|
38
45
|
extern void erasePositive(struct Pos);
|
|
46
|
+
extern void eraseStack(Stack);
|
|
39
47
|
|
|
40
48
|
extern void shareNegative(struct Neg);
|
|
41
49
|
extern void sharePositive(struct Pos);
|
|
50
|
+
extern void shareStack(Stack);
|
|
42
51
|
|
|
43
52
|
#endif
|
|
@@ -1,4 +1,4 @@
|
|
|
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><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/logos/eclipse-foundation-400x400.png"><meta name=twitter:image content="https://www.eclipse.org/images/logos/eclipse-foundation-400x400.png"><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.110.0"><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=
|
|
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><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/logos/eclipse-foundation-400x400.png"><meta name=twitter:image content="https://www.eclipse.org/images/logos/eclipse-foundation-400x400.png"><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.110.0"><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=1727705015"><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 class=sr-only href=#content>Skip to main content</a><header class="header-wrapper header-wrapper" id=header><div class=header-toolbar><div class=container><div class=header-toolbar-row><div class="toolbar-btn toolbar-search-btn dropdown"><button class=dropdown-toggle id=toolbar-search type=button data-toggle=dropdown tabindex=0 aria-label=Search>
|
|
2
2
|
<i class="fa fa-search fa-lg" aria-role=none></i></button><div class="toolbar-search-bar-wrapper dropdown-menu dropdown-menu-right" aria-labelledby=toolbar-search><form action=https://www.eclipse.org/home/search method=get><div class=search-bar><input class=search-bar-input name=q placeholder=Search>
|
|
3
3
|
<button>
|
|
4
4
|
<i class="fa fa-search" type=submit></i></button></div></form></div></div><div class="toolbar-btn toolbar-user-menu-btn dropdown"><button class=dropdown-toggle id=toolbar-user-menu type=button data-toggle=dropdown tabindex=0 aria-label="User Menu">
|
|
@@ -24,7 +24,7 @@ Download</a>
|
|
|
24
24
|
<i class="fa fa-chevron-down" aria-hidden=true></i></a><div class=mobile-menu-sub-menu-wrapper><ul class="mobile-menu-sub-menu mobile-menu-links-menu hidden" id=collaborations-industry-collaborations-sub-menu><li><a class=mobile-menu-item href=/collaborations/>About Industry Collaborations</a></li><li><a class=mobile-menu-item href=/org/workinggroups/explore.php>Current Collaborations</a></li><li><a class=mobile-menu-item href=/org/workinggroups/about.php>About Working Groups</a></li><li><a class=mobile-menu-item href=/collaborations/interest-groups/>About Interest Groups</a></li></ul></div></li><li class=mobile-menu-dropdown><a data-target=collaborations-research-collaborations-sub-menu class="mobile-menu-item mobile-menu-dropdown-toggle" aria-expanded=false><span>Research Collaborations</span>
|
|
25
25
|
<i class="fa fa-chevron-down" aria-hidden=true></i></a><div class=mobile-menu-sub-menu-wrapper><ul class="mobile-menu-sub-menu mobile-menu-links-menu hidden" id=collaborations-research-collaborations-sub-menu><li><a class=mobile-menu-item href=/research/>Research @ Eclipse</a></li></ul></div></li></ul></div></li><li class=mobile-menu-dropdown><a class="mobile-menu-item mobile-menu-dropdown-toggle" data-target=resources-menu><span>Resources</span>
|
|
26
26
|
<i class="fa fa-chevron-down" aria-hidden=true></i></a><div class=mobile-menu-sub-menu-wrapper><ul class="mobile-menu-sub-menu hidden" id=resources-menu><li class=mobile-menu-dropdown><a data-target=resources-open-source-sub-menu class="mobile-menu-item mobile-menu-dropdown-toggle" aria-expanded=false><span>Open Source for Business</span>
|
|
27
|
-
<i class="fa fa-chevron-down" aria-hidden=true></i></a><div class=mobile-menu-sub-menu-wrapper><ul class="mobile-menu-sub-menu mobile-menu-links-menu hidden" id=resources-open-source-sub-menu><li><a class=mobile-menu-item href=/org/value/>Business Value of Open Source</a></li><li><a class=mobile-menu-item href=/os4biz/ospo/>Open Source Program Offices</a></li></ul></div></li><li class=mobile-menu-dropdown><a data-target=resources-happening-sub-menu class="mobile-menu-item mobile-menu-dropdown-toggle" aria-expanded=false><span>What's Happening</span>
|
|
27
|
+
<i class="fa fa-chevron-down" aria-hidden=true></i></a><div class=mobile-menu-sub-menu-wrapper><ul class="mobile-menu-sub-menu mobile-menu-links-menu hidden" id=resources-open-source-sub-menu><li><a class=mobile-menu-item href=/org/value/>Business Value of Open Source</a></li><li><a class=mobile-menu-item href=/os4biz/services/>Professional Services</a></li><li><a class=mobile-menu-item href=/os4biz/ospo/>Open Source Program Offices</a></li></ul></div></li><li class=mobile-menu-dropdown><a data-target=resources-happening-sub-menu class="mobile-menu-item mobile-menu-dropdown-toggle" aria-expanded=false><span>What's Happening</span>
|
|
28
28
|
<i class="fa fa-chevron-down" aria-hidden=true></i></a><div class=mobile-menu-sub-menu-wrapper><ul class="mobile-menu-sub-menu mobile-menu-links-menu hidden" id=resources-happening-sub-menu><li><a class=mobile-menu-item href=https://newsroom.eclipse.org/>News</a></li><li><a class=mobile-menu-item href=https://events.eclipse.org/>Events</a></li><li><a class=mobile-menu-item href=/community/eclipse_newsletter/>Newsletter</a></li><li><a class=mobile-menu-item href=https://newsroom.eclipse.org/news/press-releases>Press Releases</a></li><li><a class=mobile-menu-item href=/org/foundation/eclipseawards/>Awards & Recognition</a></li></ul></div></li><li class=mobile-menu-dropdown><a data-target=resources-developer-sub-menu class="mobile-menu-item mobile-menu-dropdown-toggle" aria-expanded=false><span>Developer Resources</span>
|
|
29
29
|
<i class="fa fa-chevron-down" aria-hidden=true></i></a><div class=mobile-menu-sub-menu-wrapper><ul class="mobile-menu-sub-menu mobile-menu-links-menu hidden" id=resources-developer-sub-menu><li><a class=mobile-menu-item href=https://eclipse.org/forums/>Forum</a></li><li><a class=mobile-menu-item href=https://accounts.eclipse.org/mailing-list>Mailing Lists</a></li><li><a class=mobile-menu-item href=/blogs-and-videos/>Blogs & Videos</a></li><li><a class=mobile-menu-item href=/resources/marketplaces/>Marketplaces</a></li></ul></div></li></ul></div></li><li class=mobile-menu-dropdown><a class="mobile-menu-item mobile-menu-dropdown-toggle" data-target=the-foundation-menu><span>The Foundation</span>
|
|
30
30
|
<i class="fa fa-chevron-down" aria-hidden=true></i></a><div class=mobile-menu-sub-menu-wrapper><ul class="mobile-menu-sub-menu hidden" id=the-foundation-menu><li class=mobile-menu-dropdown><a data-target=the-foundation-about-sub-menu class="mobile-menu-item mobile-menu-dropdown-toggle" aria-expanded=false><span>About</span>
|
|
@@ -40,7 +40,7 @@ important to your product strategy, or simply want to explore a specific
|
|
|
40
40
|
innovation area with like-minded organisations, the Eclipse Foundation is
|
|
41
41
|
the open source home for industry collaboration.</p></div><div class=mega-menu-submenu-links-section><div class=mega-menu-submenu-links><p class=menu-heading>Industry Collaborations</p><ul><li><a href=/collaborations/>About Industry Collaborations</a></li><li><a href=/org/workinggroups/explore.php>Current Collaborations</a></li><li><a href=/org/workinggroups/about.php>About Working Groups</a></li><li><a href=/collaborations/interest-groups/>About Interest Groups</a></li></ul></div><div class=mega-menu-submenu-links><p class=menu-heading>Research Collaborations</p><ul><li><a href=/research/>Research @ Eclipse</a></li></ul></div></div><div class=mega-menu-submenu-ad-wrapper><div class="eclipsefdn-mega-menu-promo-content mega-menu-promo-content" data-ad-format=ads_square data-ad-publish-to=eclipse_org_home></div></div></div><div class="mega-menu-submenu container hidden" data-menu-id=resources-menu><div class=mega-menu-submenu-featured-story><p class=mega-menu-submenu-featured-story-heading>Resources</p><p class=mega-menu-submenu-featured-story-text>The Eclipse community consists of individual developers and organisations
|
|
42
42
|
spanning many industries. Stay up to date on our open source community
|
|
43
|
-
and find resources to support your journey.</p></div><div class=mega-menu-submenu-links-section><div class=mega-menu-submenu-links><p class=menu-heading>Open Source for Business</p><ul><li><a href=/org/value/>Business Value of Open Source</a></li><li><a href=/os4biz/ospo/>Open Source Program Offices</a></li></ul></div><div class=mega-menu-submenu-links><p class=menu-heading>What's Happening</p><ul><li><a href=https://newsroom.eclipse.org/>News</a></li><li><a href=https://events.eclipse.org/>Events</a></li><li><a href=/community/eclipse_newsletter/>Newsletter</a></li><li><a href=https://newsroom.eclipse.org/news/press-releases>Press Releases</a></li><li><a href=/org/foundation/eclipseawards/>Awards & Recognition</a></li></ul></div><div class=mega-menu-submenu-links><p class=menu-heading>Developer Resources</p><ul><li><a href=https://eclipse.org/forums/>Forum</a></li><li><a href=https://accounts.eclipse.org/mailing-list>Mailing Lists</a></li><li><a href=/blogs-and-videos/>Blogs & Videos</a></li><li><a href=/resources/marketplaces/>Marketplaces</a></li></ul></div></div><div class=mega-menu-submenu-ad-wrapper><div class="eclipsefdn-mega-menu-promo-content mega-menu-promo-content" data-ad-format=ads_square data-ad-publish-to=eclipse_org_home></div></div></div><div class="mega-menu-submenu container hidden" data-menu-id=the-foundation-menu><div class=mega-menu-submenu-featured-story><p class=mega-menu-submenu-featured-story-heading>The Foundation</p><p class=mega-menu-submenu-featured-story-text>The Eclipse Foundation provides our global community of individuals and
|
|
43
|
+
and find resources to support your journey.</p></div><div class=mega-menu-submenu-links-section><div class=mega-menu-submenu-links><p class=menu-heading>Open Source for Business</p><ul><li><a href=/org/value/>Business Value of Open Source</a></li><li><a href=/os4biz/services/>Professional Services</a></li><li><a href=/os4biz/ospo/>Open Source Program Offices</a></li></ul></div><div class=mega-menu-submenu-links><p class=menu-heading>What's Happening</p><ul><li><a href=https://newsroom.eclipse.org/>News</a></li><li><a href=https://events.eclipse.org/>Events</a></li><li><a href=/community/eclipse_newsletter/>Newsletter</a></li><li><a href=https://newsroom.eclipse.org/news/press-releases>Press Releases</a></li><li><a href=/org/foundation/eclipseawards/>Awards & Recognition</a></li></ul></div><div class=mega-menu-submenu-links><p class=menu-heading>Developer Resources</p><ul><li><a href=https://eclipse.org/forums/>Forum</a></li><li><a href=https://accounts.eclipse.org/mailing-list>Mailing Lists</a></li><li><a href=/blogs-and-videos/>Blogs & Videos</a></li><li><a href=/resources/marketplaces/>Marketplaces</a></li></ul></div></div><div class=mega-menu-submenu-ad-wrapper><div class="eclipsefdn-mega-menu-promo-content mega-menu-promo-content" data-ad-format=ads_square data-ad-publish-to=eclipse_org_home></div></div></div><div class="mega-menu-submenu container hidden" data-menu-id=the-foundation-menu><div class=mega-menu-submenu-featured-story><p class=mega-menu-submenu-featured-story-heading>The Foundation</p><p class=mega-menu-submenu-featured-story-text>The Eclipse Foundation provides our global community of individuals and
|
|
44
44
|
organisations with a mature, scalable, and vendor-neutral environment for
|
|
45
45
|
open source software collaboration and innovation.</p></div><div class=mega-menu-submenu-links-section><div class=mega-menu-submenu-links><p class=menu-heading>About</p><ul><li><a href=/org/>About the Eclipse Foundation</a></li><li><a href=/org/governance>Board & Governance</a></li><li><a href=/org/foundation/staff/>Staff</a></li><li><a href=/org/services>Services</a></li></ul></div><div class=mega-menu-submenu-links><p class=menu-heading>Legal</p><ul><li><a href=/legal/>Legal Policies</a></li><li><a href=/legal/privacy/>Privacy Policy</a></li><li><a href=/legal/terms-of-use/>Terms of Use</a></li><li><a href=/legal/compliance>Compliance</a></li><li><a href=/legal/epl-2.0/>Eclipse Public License</a></li></ul></div><div class=mega-menu-submenu-links><p class=menu-heading>More</p><ul><li><a href=https://newsroom.eclipse.org/news/press-releases>Press Releases</a></li><li><a href=/careers/>Careers</a></li><li><a href=/org/artwork/>Logos & Artwork</a></li><li><a href=/org/foundation/contact.php>Contact Us</a></li></ul></div></div><div class=mega-menu-submenu-ad-wrapper><div class="eclipsefdn-mega-menu-promo-content mega-menu-promo-content" data-ad-format=ads_square data-ad-publish-to=eclipse_org_home></div></div></div></div></header><main><div class="container padding-bottom-30"><div class=row><div class=col-md-18><div class="default-breadcrumbs hidden-print" id=breadcrumb><div><div class=row><div class=col-sm-24><ol aria-label=Breadcrumb class=breadcrumb><li><a href=https://www.eclipse.org/>Home</a></li><li><a href=https://www.eclipse.org/legal/>Eclipse Foundation Legal Resources</a></li><li class=active aria-current=page><a href=https://www.eclipse.org/legal/epl-2.0/>Eclipse Public License 2.0 (EPL)</a></li></ol></div></div></div></div><div id=content></div><script async src=/public/js/generate-body-content.js type=text/javascript></script></div><div class="col-md-6 padding-bottom-30"><aside class=main-sidebar-default-margin id=main-sidebar><ul class=ul-left-nav id=leftnav role=tablist aria-multiselectable=true><li class="main-sidebar-main-item main-sidebar-item-indented separator"><a class="main-sidebar-heading link-unstyled" href=/legal>Legal</a></li><li class="main-sidebar-item main-sidebar-item-indented"><li class="main-sidebar-item main-sidebar-item-indented"><a class=link-unstyled role=button data-toggle=collapse href=#legal-eca aria-expanded=false aria-controls=legal-eca><span>ECA</span>
|
|
46
46
|
<i class="main-sidebar-item-icon fa fa-chevron-down" aria-hidden=true></i></a><div class=collapse id=legal-eca><ul class="main-sidebar-item-submenu list-unstyled"><li class=submenu-item><a class=link-unstyled href=/legal/eca target=_self>About</a></li><li class=submenu-item><a class=link-unstyled href=https://accounts.eclipse.org/user/eca target=_self>Sign</a></li><li class=submenu-item><a class=link-unstyled href=https://accounts.eclipse.org/user/eca target=_self>Validation Tool</a></li></ul></div></li></li><li class="main-sidebar-item main-sidebar-item-indented"><li class="main-sidebar-item main-sidebar-item-indented"><a class=link-unstyled role=button data-toggle=collapse href=#legal-epl-20 aria-expanded=false aria-controls=legal-epl-20><span>EPL-2.0</span>
|
|
@@ -57,5 +57,5 @@ open source software collaboration and innovation.</p></div><div class=mega-menu
|
|
|
57
57
|
<i class="fa fa-linkedin fa-stack-1x fa-inverse" aria-hidden=true></i>
|
|
58
58
|
<span class=sr-only>Linkedin account</span></span></a></li></ul></div></div><div class="footer-sections row equal-height-md font-bold"><div class=col-md-15><div class=row><section id=footer-eclipse-foundation class="footer-section col-sm-8"><div class=menu-heading>Eclipse Foundation</div><ul class=nav><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></section><section id=footer-legal class="footer-section col-sm-8"><div class=menu-heading>Legal</div><ul class=nav><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><a class=toolbar-manage-cookies href=# onclick=event.preventDefault()>Manage Cookies</a></li></ul></section><section id=footer-more class="footer-section col-sm-8"><div class=menu-heading>More</div><ul class=nav><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></section></div></div><div id=footer-end class="footer-section col-md-8 col-md-offset-1 col-sm-24"><div class=footer-end-newsletter><form id=mc-embedded-subscribe-form action=https://eclipsecon.us6.list-manage.com/subscribe/post method=post novalidate target=_blank><label class=footer-end-newsletter-label for=email>Subscribe to our Newsletter</label><div class=footer-end-newsletter-input-wrapper><input class=footer-end-newsletter-input type=email id=email name=EMAIL autocomplete=email placeholder="Enter your email address"><div><i class="fa fa-solid fa-envelope fa-lg" aria-hidden=true></i></div></div><input type=hidden name=u value=eaf9e1f06f194eadc66788a85>
|
|
59
59
|
<input type=hidden name=id value=46e57eacf1>
|
|
60
|
-
<input id=mc-embedded-subscribe type=submit name=subscribe hidden></form></div></div></div><div class="col-sm-24 margin-top-20"><div class=row><div id=copyright class=col-md-16><p id=copyright-text>Copyright © Eclipse Foundation AISBL. All Rights Reserved.</p></div></div></div><a href=# class=scrollup>Back to the top</a></div></footer><div id=footer-js><script src="/public/js/main.js?v1.0?v=
|
|
60
|
+
<input id=mc-embedded-subscribe type=submit name=subscribe hidden></form></div></div></div><div class="col-sm-24 margin-top-20"><div class=row><div id=copyright class=col-md-16><p id=copyright-text>Copyright © Eclipse Foundation AISBL. All Rights Reserved.</p></div></div></div><a href=# class=scrollup>Back to the top</a></div></footer><div id=footer-js><script src="/public/js/main.js?v1.0?v=1727705015"></script>
|
|
61
61
|
<script>(function(){})(jQuery,document)</script></div></body></html>
|