Stream: compiler development

Topic: Applying for DWARF Language Code


view this post on Zulip Will Hawkins (Aug 01 2026 at 01:05):

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.

view this post on Zulip Luke Boswell (Aug 01 2026 at 01:31):

Would you be able to help us get a code with the standards team?

view this post on Zulip Richard Feldman (Aug 01 2026 at 02:54):

I have no idea what the consequences are of being in the language codes :sweat_smile:

view this post on Zulip Richard Feldman (Aug 01 2026 at 02:54):

I guess it presumably helps debuggers somehow? It looks like it's just an integer with no metadata attached?

view this post on Zulip Aurélien Geron (Aug 01 2026 at 03:41):

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?

view this post on Zulip Will Hawkins (Aug 01 2026 at 03:44):

Luke Boswell said:

Would you be able to help us get a code with the standards team?

I would love that!!

view this post on Zulip Will Hawkins (Aug 01 2026 at 03:45):

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.

view this post on Zulip Will Hawkins (Aug 01 2026 at 03:46):

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.

view this post on Zulip Will Hawkins (Aug 01 2026 at 03:47):

The standard handles mappings between generated machine code and line #s in the source program, for instance.

view this post on Zulip Will Hawkins (Aug 01 2026 at 03:58):

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!

view this post on Zulip Will Hawkins (Aug 03 2026 at 17:07):

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!

view this post on Zulip Richard Feldman (Aug 03 2026 at 17:11):

go for it!

view this post on Zulip Will Hawkins (Aug 03 2026 at 17:16):

Richard Feldman said:

go for it!

THANKS!! I will keep you posted!!


Last updated: Aug 12 2026 at 12:35 UTC