Commit graph

2001 commits

Author SHA1 Message Date
Kim Morrison
b2b385b456 chore: update stage0 2025-10-30 18:43:59 +11:00
Lean stage0 autoupdater
33e92677ba chore: update stage0 2025-10-30 07:41:23 +00:00
Lean stage0 autoupdater
8ff5b8ec2c chore: update stage0 2025-10-28 13:47:28 +00:00
Kim Morrison
a9d6bc60d0 chore: update stage0 2025-10-26 10:29:47 +11:00
Lean stage0 autoupdater
be2c2bcf9b chore: update stage0 2025-10-25 11:32:01 +00:00
Lean stage0 autoupdater
fb3e2c15fd chore: update stage0 2025-10-23 08:03:18 +00:00
Henrik Böving
52b1b342ab
feat: zero cost BaseIO (#10625)
This PR implements zero cost `BaseIO` by erasing the `IO.RealWorld`
parameter from argument lists and structures. This is a **major breaking
change for FFI**.

Concretely:
- `BaseIO` is defined in terms of `ST IO.RealWorld`
- `EIO` (and thus `IO`) is defined in terms of `EST IO.RealWorld`
- The opaque `Void` type is introduced and the trivial structure
optimization updated to account for it. Furthermore, arguments of type
`Void s` are removed from the argument lists of the C functions.
- `ST` is redefined as `Void s -> ST.Out s a` where `ST.Out` is a pair
of `Void s` and `a`

This together has the following major effects on our generated code:
- Functions that return `BaseIO`/`ST`/`EIO`/`IO`/`EST` now do not take
the dummy world parameter anymore. To account for this FFI code needs to
delete the dummy world parameter from the argument lists.
- Functions that return `BaseIO`/`ST` now return their wrapped value
directly. In particular `BaseIO UInt32` now returns a `uint32_t` instead
of a `lean_object*`. To account for this FFI code might have to change
the return type and does not need to call `lean_io_result_mk_ok` anymore
but can instead just `return` values right away (same with extracting
values from `BaseIO` computations.
- Functions that return `EIO`/`IO`/`EST` now only return the equivalent
of an `Except` node which reduces the allocation size. The
`lean_io_result_mk_ok`/`lean_io_result_mk_error` functions were updated
to account for this already so no change is required.

Besides improving performance by dropping allocation (sizes) we can now
also do fun new things such as:
```lean
@[extern "malloc"]
opaque malloc (size : USize) : BaseIO USize
```
2025-10-22 10:55:12 +02:00
Lean stage0 autoupdater
28dd72d514 chore: update stage0 2025-10-19 23:45:51 +00:00
Lean stage0 autoupdater
888b59bf95 chore: update stage0 2025-10-14 08:04:41 +00:00
Lean stage0 autoupdater
0dc862e3ed chore: update stage0 2025-10-11 05:57:21 +00:00
Lean stage0 autoupdater
3a26eb7281 chore: update stage0 2025-10-10 22:22:55 +00:00
Lean stage0 autoupdater
aa86d95c08 chore: update stage0 2025-10-08 22:00:53 +00:00
Lean stage0 autoupdater
a89463bf9e chore: update stage0 2025-10-08 16:51:08 +00:00
Lean stage0 autoupdater
486d93c5fd chore: update stage0 2025-10-07 13:47:20 +00:00
Lean stage0 autoupdater
1ac81c6a7a chore: update stage0 2025-10-05 02:59:23 +00:00
Lean stage0 autoupdater
d9058225a9 chore: update stage0 2025-10-01 14:32:36 +00:00
Lean stage0 autoupdater
ee8f0cca33 chore: update stage0 2025-10-01 12:32:50 +00:00
Lean stage0 autoupdater
663d4d2c79 chore: update stage0 2025-10-01 08:21:46 +00:00
Lean stage0 autoupdater
7d55c033e1 chore: update stage0 2025-09-30 01:46:26 +00:00
Lean stage0 autoupdater
239c348239 chore: update stage0 2025-09-29 14:24:13 +00:00
Lean stage0 autoupdater
19f6c168ef chore: update stage0 2025-09-29 00:32:08 +00:00
Lean stage0 autoupdater
9b1109c55d chore: update stage0 2025-09-28 05:44:06 +00:00
Lean stage0 autoupdater
db8c77a8fa chore: update stage0 2025-09-26 22:39:54 +00:00
Lean stage0 autoupdater
fd4a8c5407 chore: update stage0 2025-09-24 08:23:57 +00:00
Lean stage0 autoupdater
27fa5b0bb5 chore: update stage0 2025-09-23 06:22:49 +00:00
Lean stage0 autoupdater
d0d5d4ca39 chore: update stage0 2025-09-21 11:13:12 +00:00
Lean stage0 autoupdater
7cbeb14e46 chore: update stage0 2025-09-20 22:47:35 +00:00
Lean stage0 autoupdater
3ce554abd7 chore: update stage0 2025-09-18 13:48:00 +00:00
Lean stage0 autoupdater
5d50ec90f9 chore: update stage0 2025-09-18 04:56:02 +00:00
Lean stage0 autoupdater
b6d590ccc3 chore: update stage0 2025-09-17 21:44:32 +00:00
Lean stage0 autoupdater
11b0e7d89c chore: update stage0 2025-09-17 18:46:58 +00:00
Lean stage0 autoupdater
e6dfde1ad6 chore: update stage0 2025-09-17 14:32:29 +00:00
Lean stage0 autoupdater
89e4f9815f chore: update stage0 2025-09-17 09:11:32 +00:00
Lean stage0 autoupdater
5a7d663624 chore: update stage0 2025-09-17 03:26:25 +00:00
Lean stage0 autoupdater
850a4c897f chore: update stage0 2025-09-16 13:43:34 +00:00
Lean stage0 autoupdater
917715c862 chore: update stage0 2025-09-16 11:06:37 +00:00
Lean stage0 autoupdater
d1577fda7a chore: update stage0 2025-09-16 09:49:47 +00:00
Lean stage0 autoupdater
6d30aeefe5 chore: update stage0 2025-09-15 17:51:09 +00:00
Lean stage0 autoupdater
32a4c88986 chore: update stage0 2025-09-15 17:07:15 +00:00
Lean stage0 autoupdater
06ba748221 chore: update stage0 2025-09-15 15:31:41 +00:00
Lean stage0 autoupdater
d869c38e7b chore: update stage0 2025-09-15 05:12:36 +00:00
Lean stage0 autoupdater
1e12cdddc0 chore: update stage0 2025-09-14 22:54:32 +00:00
Lean stage0 autoupdater
c2521e94e1 chore: update stage0 2025-09-14 21:03:42 +00:00
Lean stage0 autoupdater
3146f6c651 chore: update stage0 2025-09-14 08:05:12 +00:00
Lean stage0 autoupdater
4b6eab762f chore: update stage0 2025-09-12 13:30:23 +00:00
Lean stage0 autoupdater
2422b9db87 chore: update stage0 2025-09-12 11:43:21 +00:00
Lean stage0 autoupdater
5c88a2bf56 chore: update stage0 2025-09-11 13:47:30 +00:00
Lean stage0 autoupdater
c8117a34c1 chore: update stage0 2025-09-11 12:27:01 +00:00
Lean stage0 autoupdater
176fb1cf0e chore: update stage0 2025-09-11 06:13:42 +00:00
Lean stage0 autoupdater
f4c7a0d25c chore: update stage0 2025-09-10 07:49:18 +00:00