Skip to content

Conversation

@rtfeldman
Copy link
Contributor

No description provided.

@rtfeldman rtfeldman force-pushed the improve-platform-modules branch from da304ef to 5f5a64d Compare November 5, 2025 14:41
@rtfeldman rtfeldman closed this Nov 5, 2025
@rtfeldman rtfeldman force-pushed the improve-platform-modules branch from 7fa5616 to c1b7650 Compare November 5, 2025 15:56
@rtfeldman rtfeldman reopened this Nov 5, 2025
@rtfeldman rtfeldman force-pushed the improve-platform-modules branch from 81ae2f6 to 9443c69 Compare November 5, 2025 16:47
@rtfeldman rtfeldman force-pushed the improve-platform-modules branch from c6994bb to 0cf9ed0 Compare November 6, 2025 01:11
@rtfeldman rtfeldman force-pushed the improve-platform-modules branch from 809cb71 to b85b05c Compare November 6, 2025 13:00
@rtfeldman rtfeldman force-pushed the improve-platform-modules branch from 2245560 to f880f64 Compare November 6, 2025 20:57
…orm propagation

- Set root_is_platform from package kind at PackageEnv creation instead of during module canonicalization
- Fix TupleAccessor.getElement to return null pointer for zero-sized elements
- Fix RecordAccessor and TupleAccessor assertions to allow null pointers for zero-sized types
- Fix copyToPtr to check size before checking for null pointer
- Fix evaluateExpression to use null pointer for zero-sized argument tuples
- Replace ZeroSizedType error with TypeMismatch in field access code

These fixes improve zero-sized type support but fx_platform_test still fails with TypeMismatch during evaluation.
The host was passing a bare unit value, but Roc functions always expect
arguments wrapped in a tuple, even for single parameters. Updated fx
platform host to pass arguments as a struct matching tuple layout.

Still debugging TypeMismatch in interpreter evaluation.
- Changed main! lambda from |_| to || to match () => {} signature
- Exposed Stdout, Stderr, Host from platform so they get built with building_platform_modules=true
- Updated host to pass zero-sized empty tuple for zero-parameter function

Still failing with TypeMismatch - requires deeper investigation into hosted function dispatch.
Removed implementations from Stdout and Stderr, making them annotation-only
like the int/str platforms. Still investigating TypeMismatch - appears to be
a fundamental issue with how the platform accesses required app functions or
how the interpreter evaluates effectful entry points.

Findings:
- int/str platforms work fine with interpreter
- fx platform fails even with simplest app that just returns {}
- Issue occurs before any hosted function calls
- May be related to platform's main_for_host! accessing app's main! through requires clause
- Type Module transformation may not be the root cause
@rtfeldman rtfeldman force-pushed the improve-platform-modules branch from 48bea70 to 1c78bc0 Compare November 10, 2025 02:01
@rtfeldman rtfeldman force-pushed the improve-platform-modules branch from 3a055c7 to cafc129 Compare November 10, 2025 20:26
@rtfeldman rtfeldman force-pushed the improve-platform-modules branch from cafc129 to aeeaa6e Compare November 10, 2025 20:32
@rtfeldman rtfeldman force-pushed the improve-platform-modules branch from 59a4df2 to a3f414a Compare November 11, 2025 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants