Hello everyone! I was just curious whether there was interest in starting the process of getting a DWARF Language Code for roc (i.e., an assigned value that can be put in DW_AT_language)? It looks like there is a reasonably well-defined process for it: https://dwarfstd.org/languages.html
On a related note, it looks like currently the DWARF information embedded in Roc programs claims to be from the ANSI C99 (value 12). Given that DW_AT_language is not a required element of the Compilation Unit, do you think that we should omit it rather than supply misleading information? If so, I'd be more than happy to make a PR to fix it. I just didn't want to do that unless there was consensus.
Would you be able to help us get a code with the standards team?
I have no idea what the consequences are of being in the language codes :sweat_smile:
I guess it presumably helps debuggers somehow? It looks like it's just an integer with no metadata attached?
IIUC it allows debuggers to know that the binary came from Roc. I guess it enables debuggers to correctly interpret the language's data structures?
Luke Boswell said:
Would you be able to help us get a code with the standards team?
I would love that!!
Richard Feldman said:
I guess it presumably helps debuggers somehow? It looks like it's just an integer with no metadata attached?
That's right! I see it more as a "stamp" of approval.
Aurélien Geron said:
IIUC it allows debuggers to know that the binary came from Roc. I guess it enables debuggers to correctly interpret the language's data structures?
That is absolutely one reason!! Although the goal of DWARF is to turn language-specific data structures into representations that are independent and can be rendered the same way.
The standard handles mappings between generated machine code and line #s in the source program, for instance.
I did find two places where the standard calls out the value of a debugger knowing DW_AT_Language. First, " If no ordering attribute [of the layout of arrays] is present, the default ordering for the source language (which is indicated by the DW_AT_language attribute of the enclosing compilation unit entry) is assumed." Second, there is an implicit "lower bound" value associated with each language (for when the lower index of a range operation is omitted (i.e., is the language 0 or 1 indexed!).
Of course, I am sure that people smarter than me can find other examples in the standard where interpretation depends on DW_AT_Language. I just wanted to support @Aurélien Geron 's statement!
If there is consensus that it would be a good idea to explore getting registered with DWARF, and the community is okay with me representing it in that process, I would be happy to start exploring!
go for it!
Richard Feldman said:
go for it!
THANKS!! I will keep you posted!!
Here is the draft of the message that I intend to send to the DWARF standards body requesting allocation for Roc:
# Add Language Codes For Roc Programming Language
## Background
Roc (https://www.roc-lang.org/) is a "fast, friendly, functional [programming] language" quickly advancing toward its first named release. The roc compiler currently generates DWARF info to aid debugging in its compiled executables on and the community would appreciate recognition in the DWARF standard.
## Overview
The roc community politely requests the assignment of a Language and Version Code for DWARF Version 6:
| Language | Language Code (`DW_AT_language_name`)| Value | Default Lower Bound |Version Scheme |
| -- | -- | -- | -- | -- |
| Roc | `DW_LNAME_Roc` | _TBD_ | `0` | _TBD_ |
Further, we politely request the assignment of a Language Code for DWARF Version 5:
| Language Name | Value | Default Lower Bound |
| -- | -- | -- |
| `DW_LANG_Roc` | _TBD_ | `0` |
## Dependencies
N/A
## References
Official Roc Website: [roc-lang.org](http://www.roc-lang.org)
If you don't mind, I have three requests:
Thank you for the feedback! I wanted to make sure that I got everyone's signoff before I sent a message representing the Roc community!
Thanks for your work on this @Will Hawkins :heart:
Minor corrections of the background text:
Roc (https://www.roc-lang.org/) is a "fast, friendly, functional [programming] language", quickly advancing toward its first numbered release. The Roc compiler currently generates DWARF info to aid debugging of its compiled executables, and the community would appreciate recognition in the DWARF standard.
- Would you please verify that I have used the language's name appropriately (i.e., do we want Roc or Roc Lang?);
Probably just Roc
This should be https:
## References
Official Roc Website: [roc-lang.org](https://www.roc-lang.org)
make sure that I have properly followed their "best practices";
Their template has blank lines before and after the subtitles. Also, the Proposed Changes section is missing or is that not necessary for this particular request?
For the version I would go with major × 10,000 + minor × 100 + patch but that would require us having released 0.1
Thanks to @Anton for the feedback. To make it easier to keep track of what will ultimately be submitted, I have transferred the markdown here:
https://sonic.cerfca.st/DApXxNfnTo23-wIrz1daCA
If you have a github account, you can log in to that instance of Hedgedoc and make edits! I figured transferring it there would make it easier to coordinate changes!
Thank you @Anton and @Luke Boswell for the confirmation that we want "Roc". I have updated to make sure that "Roc" is capitalized throughout. I also added a Proposed Changes section and added blank lines.
I believe I got all the feedback incorporated!!
Once we get confirmation from @Richard Feldman about version format, we can start the submission process!
looks great! And yes, "Roc" is correct.
Thanks for doing this, @Will Hawkins! :smiley:
Anton said:
For the version I would go with
major × 10,000 + minor × 100 + patchbut that would require us having released 0.1
Sorry -- one other question: Is there agreement on @Anton 's description of the version scheme that we will use? I have listened to @Richard Feldman in several interviews and know that he wants to be very intentional about numbering, so I just want to make sure that I don't screw up something!
yes, that sounds good to me!
FYI: The request has been submitted: https://lists.dwarfstd.org/pipermail/dwarf-discuss/2026-August/002851.html
Will Hawkins said:
FYI: The request has been submitted: https://lists.dwarfstd.org/pipermail/dwarf-discuss/2026-August/002851.html
GUESS WHAT?!?!?!?!?!
https://dwarfstd.org/issues/260828.1.html
2026-09-10: Assigned language codes DW_LNAME_Roc = 0x33 and DW_LANG_Roc = 0x49
super cool!!!
Richard Feldman said:
2026-09-10: Assigned language codes DW_LNAME_Roc = 0x33 and DW_LANG_Roc = 0x49
I will be posting a PR to start using it!!
thanks for making this happen @Will Hawkins!
Richard Feldman said:
thanks for making this happen Will Hawkins!
No, thank _you_ for giving me the freedom to pursue it!!
Check this out -- LLVM supports our language code (well, after the PR lands, but still, I can see it locally!)!!
[hawkinsw@ininer roc]$ ./zig-out/bin/roc build --opt=size --keep-temp test/echo/hello.roc --debug
── ● kept temporary directory ──────────────────────────────────────────────────
Kept temporary directory:
/tmp/roc/debug-01c8e8c2/ct5caf8Y5ymBEspOHeHJyDoQiYqChCYQ.
── ● kept temporary directory ──────────────────────────────────────────────────
Kept temporary directory:
/tmp/roc/debug-01c8e8c2/cbj10cwmaQ87NygF6TPTcpfsmXWxDKzQ.
0 errors and 0 warnings found in 92ms while successfully building:
hello
[hawkinsw@ininer roc]$ ~/code/llvm-project/build/bin/llvm-dwarfdump hello | head -n 20
hello: file format elf64-x86-64
.debug_info contents:
0x00000000: Compile Unit: length = 0x000000b5, format = DWARF32, version = 0x0004, abbr_offset = 0x0000, addr_size = 0x08 (next unit at 0x000000b9)
0x0000000b: DW_TAG_compile_unit
DW_AT_producer ("roc debug-01c8e8c2")
DW_AT_language (DW_LANG_Roc)
DW_AT_name ("Builtin")
DW_AT_stmt_list (0x00000000)
DW_AT_comp_dir (".")
DW_AT_GNU_pubnames (true)
DW_AT_low_pc (0x0000000000000000)
DW_AT_ranges (0x00000000
[0x0000000000201970, 0x00000000002019e2)
[0x00000000002019f0, 0x0000000000201a35))
0x0000002a: DW_TAG_subprogram
DW_AT_linkage_name ("roc__proc_b")
DW_AT_name ("echo!")
The PR to LLVM is submitted!
The PR to Roc is submitted!
Will Hawkins said:
Check this out -- LLVM supports our language code (well, after the PR lands, but still, I can see it locally!)!!
[hawkinsw@ininer roc]$ ./zig-out/bin/roc build --opt=size --keep-temp test/echo/hello.roc --debug ── ● kept temporary directory ────────────────────────────────────────────────── Kept temporary directory: /tmp/roc/debug-01c8e8c2/ct5caf8Y5ymBEspOHeHJyDoQiYqChCYQ. ── ● kept temporary directory ────────────────────────────────────────────────── Kept temporary directory: /tmp/roc/debug-01c8e8c2/cbj10cwmaQ87NygF6TPTcpfsmXWxDKzQ. 0 errors and 0 warnings found in 92ms while successfully building: hello [hawkinsw@ininer roc]$ ~/code/llvm-project/build/bin/llvm-dwarfdump hello | head -n 20 hello: file format elf64-x86-64 .debug_info contents: 0x00000000: Compile Unit: length = 0x000000b5, format = DWARF32, version = 0x0004, abbr_offset = 0x0000, addr_size = 0x08 (next unit at 0x000000b9) 0x0000000b: DW_TAG_compile_unit DW_AT_producer ("roc debug-01c8e8c2") DW_AT_language (DW_LANG_Roc) DW_AT_name ("Builtin") DW_AT_stmt_list (0x00000000) DW_AT_comp_dir (".") DW_AT_GNU_pubnames (true) DW_AT_low_pc (0x0000000000000000) DW_AT_ranges (0x00000000 [0x0000000000201970, 0x00000000002019e2) [0x00000000002019f0, 0x0000000000201a35)) 0x0000002a: DW_TAG_subprogram DW_AT_linkage_name ("roc__proc_b") DW_AT_name ("echo!")The PR to LLVM is submitted!
The PR to Roc is submitted!
Sorry that I didn't specify this fact initially, but the new language code is emitted in the DWARF no matter whether the user builds with the dev or LLVM backend!
Last updated: Sep 24 2026 at 15:59 UTC