Skip to content
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b7ffded
Fixed the linking of the uv library for Intel Macbooks
Oct 10, 2025
ebb8b9c
df: Added benchmarks
Oct 24, 2025
ca83943
Basic Bumb allocation
Sep 24, 2025
0dd2a6c
First approach of a 2nd step of memory-management, but first done in …
Oct 6, 2025
fe49498
df: Added ctrc for effekt (except for sender_receiver and server_client)
Feb 27, 2026
563f3c6
df: sender_receiver and server_client should work now as well.
Feb 27, 2026
f21ddfd
Delete cMalloc
phischu Mar 3, 2026
b2bc845
Revise acquire
phischu Mar 3, 2026
bad6968
Remove imports
phischu Mar 3, 2026
c2689fa
Fixed the linking of the uv library for Intel Macbooks
Oct 10, 2025
82da493
df: Added benchmarks
Oct 24, 2025
c699d9c
Basic Bumb allocation
Sep 24, 2025
4402387
First approach of a 2nd step of memory-management, but first done in …
Oct 6, 2025
ea2fcf4
df: Added ctrc for effekt (except for sender_receiver and server_client)
Feb 27, 2026
3801f88
df: sender_receiver and server_client should work now as well.
Feb 27, 2026
2e8cfcc
Delete cMalloc
phischu Mar 3, 2026
e8601f8
Revise acquire
phischu Mar 3, 2026
bc05601
Remove imports
phischu Mar 3, 2026
b9d68ad
Merge remote-tracking branch 'origin/final-constant-time-rc' into fin…
Mar 3, 2026
a1985c8
Insert other free call
phischu Mar 3, 2026
d0cc38e
Delete tests for now
phischu Mar 3, 2026
baa4542
Replace switch by invoke
phischu Mar 3, 2026
90fefea
Emit instructions into basic block
phischu Mar 3, 2026
42d07eb
Avoid matching on alias info
phischu Mar 3, 2026
3b5609f
Reuse loading of environment
phischu Mar 4, 2026
fd54b3c
Reorder definitions
phischu Mar 5, 2026
26e8252
Inline definitions
phischu Mar 5, 2026
5669780
More refactoring
phischu Mar 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions effekt/jvm/src/main/scala/effekt/Runner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -306,17 +306,24 @@ object LLVMRunner extends Runner[String] {

def libuvArgs(using C: Context): Seq[String] =
val OS = System.getProperty("os.name").toLowerCase

// only relevant for macOS
val arch: String = System.getProperty("os.arch")
assert(!OS.contains("mac") || List("aarch64", "x86_64").contains(arch), "If you have a macbook -> It should have either an aarch64 or x86_64 architecture.")

val libraries = C.config.clangLibraries.toOption.map(file).orElse {
OS match {
case os if os.contains("mac") => Some(file("/opt/homebrew/lib"))
case os if os.contains("mac") && arch.equals("aarch64") => Some(file("/opt/homebrew/lib"))
case os if os.contains("mac") => Some(file("/usr/local/lib"))
case os if os.contains("win") => None
case os if os.contains("linux") => Some(file("/usr/local/lib"))
case os => None
}
}
val includes = C.config.clangIncludes.toOption.map(file).orElse {
OS match {
case os if os.contains("mac") => Some(file("/opt/homebrew/include"))
case os if os.contains("mac") && arch.equals("aarch64") => Some(file("/opt/homebrew/include"))
case os if os.contains("mac") => Some(file("/usr/local/include"))
Comment on lines +310 to +326
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Someone with a Mac should test and approve this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw, this works on my machine (though I use nix-darwin, so I'm not the best guinea pig)

case os if os.contains("win") => None
case os if os.contains("linux") => Some(file("/usr/local/include"))
case os => None
Expand Down
23 changes: 23 additions & 0 deletions effekt/jvm/src/test/scala/effekt/CTRCTests.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package effekt

import sbt.io.*
import sbt.io.syntax.*

import java.io.File
import scala.language.implicitConversions
import scala.sys.process.Process

class CTRCTests extends EffektTests {

def backendName = "llvm"

override def valgrind = false // works on linux only

override lazy val positives: Set[File] = Set(
examplesDir / "ctrc" / "optimized"
)

override lazy val withoutOptimizations: Set[File] = Set(
examplesDir / "ctrc" / "nooptimized",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are the tests in a folder nooptimized? I can't find the "optimized" folder.

I personally would not add any tests at all. Others surely disagree.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, there is no optimized folder because during the thesis, it was helpful to work with the pure program rather than the optimized one. These tests were done to "debug" better through Effekt.

It would be cool if we could test stronger by asserting the number of used chunks or other invariants. Then these tests would have more value

)
}
529 changes: 478 additions & 51 deletions effekt/shared/src/main/scala/effekt/generator/llvm/Transformer.scala

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@

record OneSlotPerson(
field1: Int,
field2: Int,
field3: Int,
field4: Int,
field5: Int,
field6: Int
)

def allocate65SlotsAndReleaseThem() = {
var x1 = OneSlotPerson(1, 2, 3, 4, 5, 6)
var x2 = OneSlotPerson(2, 3, 4, 5, 6, 7)
var x3 = OneSlotPerson(3, 4, 5, 6, 7, 8)
var x4 = OneSlotPerson(4, 5, 6, 7, 8, 9)
var x5 = OneSlotPerson(5, 6, 7, 8, 9, 10)
var x6 = OneSlotPerson(6, 7, 8, 9, 10, 11)
var x7 = OneSlotPerson(7, 8, 9, 10, 11, 12)
var x8 = OneSlotPerson(8, 9, 10, 11, 12, 13)
var x9 = OneSlotPerson(9, 10, 11, 12, 13, 14)
var x10 = OneSlotPerson(10, 11, 12, 13, 14, 15)
var x11 = OneSlotPerson(11, 12, 13, 14, 15, 16)
var x12 = OneSlotPerson(12, 13, 14, 15, 16, 17)
var x13 = OneSlotPerson(13, 14, 15, 16, 17, 18)
var x14 = OneSlotPerson(14, 15, 16, 17, 18, 19)
var x15 = OneSlotPerson(15, 16, 17, 18, 19, 20)
var x16 = OneSlotPerson(16, 17, 18, 19, 20, 21)
var x17 = OneSlotPerson(17, 18, 19, 20, 21, 22)
var x18 = OneSlotPerson(18, 19, 20, 21, 22, 23)
var x19 = OneSlotPerson(19, 20, 21, 22, 23, 24)
var x20 = OneSlotPerson(20, 21, 22, 23, 24, 25)
var x21 = OneSlotPerson(21, 22, 23, 24, 25, 26)
var x22 = OneSlotPerson(22, 23, 24, 25, 26, 27)
var x23 = OneSlotPerson(23, 24, 25, 26, 27, 28)
var x24 = OneSlotPerson(24, 25, 26, 27, 28, 29)
var x25 = OneSlotPerson(25, 26, 27, 28, 29, 30)
var x26 = OneSlotPerson(26, 27, 28, 29, 30, 31)
var x27 = OneSlotPerson(27, 28, 29, 30, 31, 32)
var x28 = OneSlotPerson(28, 29, 30, 31, 32, 33)
var x29 = OneSlotPerson(29, 30, 31, 32, 33, 34)
var x30 = OneSlotPerson(30, 31, 32, 33, 34, 35)
var x31 = OneSlotPerson(31, 32, 33, 34, 35, 36)
var x32 = OneSlotPerson(32, 33, 34, 35, 36, 37)
var x33 = OneSlotPerson(33, 34, 35, 36, 37, 38)
var x34 = OneSlotPerson(34, 35, 36, 37, 38, 39)
var x35 = OneSlotPerson(35, 36, 37, 38, 39, 40)
var x36 = OneSlotPerson(36, 37, 38, 39, 40, 41)
var x37 = OneSlotPerson(37, 38, 39, 40, 41, 42)
var x38 = OneSlotPerson(38, 39, 40, 41, 42, 43)
var x39 = OneSlotPerson(39, 40, 41, 42, 43, 44)
var x40 = OneSlotPerson(40, 41, 42, 43, 44, 45)
var x41 = OneSlotPerson(41, 42, 43, 44, 45, 46)
var x42 = OneSlotPerson(42, 43, 44, 45, 46, 47)
var x43 = OneSlotPerson(43, 44, 45, 46, 47, 48)
var x44 = OneSlotPerson(44, 45, 46, 47, 48, 49)
var x45 = OneSlotPerson(45, 46, 47, 48, 49, 50)
var x46 = OneSlotPerson(46, 47, 48, 49, 50, 51)
var x47 = OneSlotPerson(47, 48, 49, 50, 51, 52)
var x48 = OneSlotPerson(48, 49, 50, 51, 52, 53)
var x49 = OneSlotPerson(49, 50, 51, 52, 53, 54)
var x50 = OneSlotPerson(50, 51, 52, 53, 54, 55)
var x51 = OneSlotPerson(51, 52, 53, 54, 55, 56)
var x52 = OneSlotPerson(52, 53, 54, 55, 56, 57)
var x53 = OneSlotPerson(53, 54, 55, 56, 57, 58)
var x54 = OneSlotPerson(54, 55, 56, 57, 58, 59)
var x55 = OneSlotPerson(55, 56, 57, 58, 59, 60)
var x56 = OneSlotPerson(56, 57, 58, 59, 60, 61)
var x57 = OneSlotPerson(57, 58, 59, 60, 61, 62)
var x58 = OneSlotPerson(58, 59, 60, 61, 62, 63)
var x59 = OneSlotPerson(59, 60, 61, 62, 63, 64)
var x60 = OneSlotPerson(60, 61, 62, 63, 64, 65)
var x61 = OneSlotPerson(61, 62, 63, 64, 65, 66)
var x62 = OneSlotPerson(62, 63, 64, 65, 66, 67)
var x63 = OneSlotPerson(63, 64, 65, 66, 67, 68)
var x64 = OneSlotPerson(64, 65, 66, 67, 68, 69)
var x65 = OneSlotPerson(65, 66, 67, 68, 69, 70)

println(x1.field1)
println(x2.field1)
println(x3.field1)
println(x4.field1)
println(x5.field1)
println(x6.field1)
println(x7.field1)
println(x8.field1)
println(x9.field1)
println(x10.field1)
println(x11.field1)
println(x12.field1)
println(x13.field1)
println(x14.field1)
println(x15.field1)
println(x16.field1)
println(x17.field1)
println(x18.field1)
println(x19.field1)
println(x20.field1)
println(x21.field1)
println(x22.field1)
println(x23.field1)
println(x24.field1)
println(x25.field1)
println(x26.field1)
println(x27.field1)
println(x28.field1)
println(x29.field1)
println(x30.field1)
println(x31.field1)
println(x32.field1)
println(x33.field1)
println(x34.field1)
println(x35.field1)
println(x36.field1)
println(x37.field1)
println(x38.field1)
println(x39.field1)
println(x40.field1)
println(x41.field1)
println(x42.field1)
println(x43.field1)
println(x44.field1)
println(x45.field1)
println(x46.field1)
println(x47.field1)
println(x48.field1)
println(x49.field1)
println(x50.field1)
println(x51.field1)
println(x52.field1)
println(x53.field1)
println(x54.field1)
println(x55.field1)
println(x56.field1)
println(x57.field1)
println(x58.field1)
println(x59.field1)
println(x60.field1)
println(x61.field1)
println(x62.field1)
println(x63.field1)
println(x64.field1)
println(x65.field1)
}

def main() = {
allocate65SlotsAndReleaseThem();
var finalObjectThatTriggersFlushingTodoList = OneSlotPerson(1, 2, 3, 4, 5, 6)
}
Empty file.
Loading
Loading