Roc Zulip Daily Summary — 2026-03-04

  • Realm: https://roc.zulipchat.com
  • Window: 2026-03-04 12:00 AM to 2026-03-05 12:00 AM (America/Los_Angeles)
  • Messages: 31
  • LLM: vertex_open_model model=zai-org/glm-5-maas topics=4 ok=4/4

Top threads


Unexpected type mismatch with parameterised function

Summary

Jonathan reported an unexpected type mismatch error when testing a parameterized function involving a recursive RBTree type, which also triggered compiler panics and internal errors. Anton identified the root causes as bugs related to handling recursive types and method calls, subsequently opening three pull requests to fix the issues.

Key points

  • Jonathan encountered a type mismatch error that appeared inconsistently depending on whether the code was in a separate file or run via roc test.
  • The provided RBTree.roc gist caused a thread ... panic: reached unreachable code during canonicalization when built from source.
  • Jonathan found that the panic was triggered by specific lambda captures in apply calls (e.g., |x| before vs |x| x).
  • Anton linked the uninformative type errors (e.g., expecting X but got Error) to the compiler serializing recursive self-references as errors to break cycles.

Open questions

  • None explicitly pending; the immediate compiler bugs are being addressed by the PRs.

Action items

Key links


How would FFI python → roc work?

Summary

Lukas Juhrich asked how to compile Roc code into a shared library (.so) for use with Python FFI, questioning if he needed to write a custom platform to do so. Luke Boswell explained that while roc build defaults to executables, platform authors can configure it to output dynamic libraries, pointing to existing WASM and Zig templates as the best available examples.

Key points

  • A platform module header determines the build target, which can be configured to produce a dynamic library (like .so) instead of an executable.
  • The roc glue tool is intended to assist in generating type-safe interfaces between the platform host (e.g., Python) and Roc.
  • The workflow for creating custom platforms and FFI bindings is currently undocumented and considered an advanced topic.
  • The roc-platform-template-zig repository and WASM platforms serve as the best current references for how to structure platforms.

Open questions

  • None.

Action items

Key links


List concatMany and insert

Summary

Based on the provided transcript, the thread appears to be a single message without any replies. Brendan Hansknecht suggests that HAMT (Hash Array Mapped Trie) data structures could be implemented in Roc userspace if a specific need arises.

Key points

  • HAMT data structures are a potential candidate for user-level implementation in Roc.
  • The necessity of such an implementation depends on specific user needs.

Open questions

  • None identified from the single message.

Action items


compile time evaluation

Summary

Brendan Hansknecht agrees with a prior statement regarding the complexity of re-doing type-checking and polymorphism at runtime, suggesting that a simpler approach would involve waiting until after monomorphization to start the interpreter.

Key points

  • Re-doing type-checking and polymorphism operations at runtime is seen as a complexity driver.
  • Kicking off the interpreter after the “mono” (monomorphization) stage is proposed as a simpler alternative.

Open questions

  • None.

Action items