Skip to content

[DSLX] Switch multidimensional arrays to Rustic syntax? #616

@cdleary

Description

@cdleary

As mentioned in #526 there is an outstanding discrepancy between DSL multidimensional arrays and Rustic ones. I do think the DSL ones we formulated this way before we got serious about making it as close to Rust as possible (back then we were trying to make it look more like parameterized and concise IR), but some of the nice properties we were thinking at the time we around the inside-out nature of unwrapping the type definition with indexing, e.g. when mixing tuples and arrays:

let x: ((u2, u3)[4], (u6, u8)[2][5])[3]

In that sort of type definition you unravel the outermost entities to the innermost ones, e.g. x[0][1][4][1][1] gets you the u8 because you're always unwrapping the "rightmost" decorating dimension.

I /believe/ there's no difference in power or clarity in the Rust array syntax (Rust just nests the multidimensional array items more verbosely) but was discussing this with @RobSpringer recently so CC him for his thoughts as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cleanupTech debt reduction, factoring, consolidation, rework, etc.dslxDSLX (domain specific language) implementation / front-end

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions