Stream: beginners

Topic: panic when just adding a new Dict


view this post on Zulip Steve Howell (Mar 15 2026 at 22:34):

See the following commit that causes a panic:

https://github.com/showell/zulip-roc/commit/bb2e53a4eb38b7d857015e934ba8ac8b1266fcc6

view this post on Zulip Steve Howell (Mar 15 2026 at 22:34):

    $ ~/roc/roc database.roc
    thread 'main' panicked at crates/compiler/gen_llvm/src/llvm/build.rs:5582:19:
    Error in alias analysis: error in module ModName("UserApp"), function definition FuncName("\x0f\x00\x00\x00\x1f\x00\x00\x006\xb7\xa8\xd7\x8cT\xc2\x99"), definition of value binding ValueId(11): could not find func in module ModName("UserApp") with name FuncName("\t\x00\x00\x00\x7f\x00\x00\x00\xa1\x891\xed\xc6\xf9\x823")
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

    $ ~/roc/roc version
    roc nightly pre-release, built from commit d73ea109 on Tue 09 Sep 2025 09:02:08 AM UTC

view this post on Zulip Steve Howell (Mar 15 2026 at 22:36):

Is the 9/9/2025 build the most stable build on the old compiler? This isn't the first panic that I have encountered while doing fairly simple things.

view this post on Zulip Steve Howell (Mar 15 2026 at 22:37):

I'm running Ubuntu through WSL on Windows. I installed Roc by following the link from the tutorial.

view this post on Zulip Steve Howell (Mar 15 2026 at 22:46):

I started getting the panic when I added a dictionary called "user_map" with type of "User" to a "Database" type that already had three very similar maps and was passing tests.

view this post on Zulip Steve Howell (Mar 17 2026 at 11:33):

I'm kinda stuck here. Is there anybody that can help diagnose why the panic is happening for the relatively simple project that I have? It's under 300 lines of code, and I am basically just manipulating Dicts using small test programs.

view this post on Zulip Steve Howell (Mar 17 2026 at 11:34):

To be clear, the final commit "causes" the panic for some reason. If you revert that commit, the code compiles and does what I expect.

view this post on Zulip Steve Howell (Mar 17 2026 at 11:36):

--- a/Database.roc
+++ b/Database.roc
@@ -1,11 +1,12 @@
 module [Database, new, insert_channel, insert_message, set_topic]

-import DbTypes exposing [ID, Channel, Message, Topic]
+import DbTypes exposing [ID, Channel, Message, Topic, User]

 Database : {
     channel_map : Dict ID Channel,
     message_map : Dict ID Message,
     topic_map : Dict ID Topic,
+    user_map : Dict ID User,
 }

 new : Database
@@ -13,6 +14,7 @@ new = {
     channel_map: Dict.empty({}),
     message_map: Dict.empty({}),
     topic_map: Dict.empty({}),
+    user_map: Dict.empty({}),
 }

 insert_channel : Database, Channel -> Database
diff --git a/DbTypes.roc b/DbTypes.roc
index 19a3856..24ec39a 100644
--- a/DbTypes.roc
+++ b/DbTypes.roc
@@ -1,4 +1,4 @@
-module [ID, Channel, Message, Topic]
+module [ID, Channel, Message, Topic, User]

 ID : U32

@@ -20,3 +20,8 @@ Topic : {
     channel_id : ID,
     topic_name : Str,
 }
+
+User: {
+    user_id: ID,
+    full_name: Str,
+}

view this post on Zulip Steve Howell (Mar 18 2026 at 12:12):

One thing that is oddly coincidental is that the panic message says "error in module ModName("UserApp")", and I am doing stuff with my own "User" object. But that seems like it has to just be a coincidence. I don't have enough Rust expertise or compiler expertise to really dig into this, so I am kinda stuck.

view this post on Zulip Anton (Mar 20 2026 at 08:58):

One thing that is oddly coincidental is that the panic message says "error in module ModName("UserApp")", and I am doing stuff with my own "User" object. But that seems like it has to just be a coincidence.

Yes that is indeed a coincidence, UserApp is an internal name we use.

Putting everything that is in DbTypes in Database.roc could be a possible workaround. I am afraid I can't prioritize issue with the old compiler. One reason for the zig re-write is that the old compiler was too buggy, even for small projects.

view this post on Zulip Anton (Mar 20 2026 at 09:02):

Is the 9/9/2025 build the most stable build on the old compiler?

This is indeed the most stable build.


Last updated: Mar 20 2026 at 12:28 UTC