Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

function puns? (funs!) #47

Open
Gankra opened this issue Jul 1, 2024 · 0 comments
Open

function puns? (funs!) #47

Gankra opened this issue Jul 1, 2024 · 0 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@Gankra
Copy link
Owner

Gankra commented Jul 1, 2024

We support type puns...

pun "MetersU32" {
lang "rust" {
@repr "transparent"
struct "MetersU32" {
_ "u32"
}
}
lang "c" "cpp" {
alias "MetersU32" "u32"
}
}

Why not function puns?

fun "sick_call" {
    lang "rust" {
        fn "sick_call" {
            inputs { _ "[u64; 2]"; }
        }
    }

    lang "c" "cpp" {
        fn "sick_call" {
            inputs { _ "u64"; _ "u64"; }
        }
    }
}

I'm not sure exactly when we'd want this, but I wanted to write it down.

As with puns, there needs to be restrictions that allow us to keep the ValueTree in sync across puns. In the case of ValueTree we require there to be an equal number of Values (primitives + enum tags) produced (so [u32; 2] can pun (u32, u32), but u64 can't). So the above example might be an invalid fun.

A more realistic fun might be "varargs vs not".

@Gankra Gankra added enhancement New feature or request question Further information is requested labels Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant