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!!

view this post on Zulip Will Hawkins (Aug 25 2026 at 13:56):

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:

  1. Would you please review the text above to make sure that I have properly followed their "best practices";
  2. Would you please verify that I have used the language's name appropriately (i.e., do we want Roc or Roc Lang?); and
  3. In the next version of the DWARF standard (v6), languages and their versions can be specified separately. The versions are specified simply as an integer, but the standard specifies a format for that number. There are several different patterns that DWARF allows for the specification of versions (https://dwarfstd.org/languages-v6.html) and I wanted to make sure that I specified the right one in our application. I messaged @Richard Feldman directly with this question, but thought that I would bring it to the wider community at the same time!

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!

view this post on Zulip Anton (Aug 25 2026 at 15:18):

Thanks for your work on this @Will Hawkins :heart:

view this post on Zulip Anton (Aug 25 2026 at 15:18):

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.

view this post on Zulip Anton (Aug 25 2026 at 15:20):

  1. 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

view this post on Zulip Anton (Aug 25 2026 at 15:21):

This should be https:

## References
Official Roc Website: [roc-lang.org](https://www.roc-lang.org)

view this post on Zulip Anton (Aug 25 2026 at 16:05):

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?

view this post on Zulip Anton (Aug 25 2026 at 16:14):

For the version I would go with major × 10,000 + minor × 100 + patch but that would require us having released 0.1

view this post on Zulip Will Hawkins (Aug 25 2026 at 22:02):

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!

view this post on Zulip Richard Feldman (Aug 25 2026 at 23:08):

looks great! And yes, "Roc" is correct.

Thanks for doing this, @Will Hawkins! :smiley:

view this post on Zulip Will Hawkins (Aug 28 2026 at 13:22):

Anton said:

For the version I would go with major × 10,000 + minor × 100 + patch but 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!

view this post on Zulip Richard Feldman (Aug 28 2026 at 14:00):

yes, that sounds good to me!

view this post on Zulip Will Hawkins (Aug 29 2026 at 02:07):

FYI: The request has been submitted: https://lists.dwarfstd.org/pipermail/dwarf-discuss/2026-August/002851.html


Last updated: Sep 03 2026 at 15:16 UTC