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!!
Last updated: Aug 12 2026 at 12:35 UTC