Ancestors

Toot

Written by Δῃάνειρα on 2024-10-10 at 22:09

is there a lang you know of that could do something like the following?

uint32 bits = 8

uint{bits} num = 128

=> More informations about this toot | More toots from deianeira@merveilles.town

Descendants

Written by Csepp 🌢 on 2024-10-11 at 08:23

@deianeira Idris, Coq, any dependently typed language. But it depends on what you want it to compile to.

If "bits" is a const then C++ can almost certainly do it and compile it to efficient machine code.

There is also multi-stage compilation, but that is even less mainstream than dependent types. If you embed the compiler, then that lifts the requirement for "bits" to be const or for your type system to be dependently typed.

=> More informations about this toot | More toots from csepp@merveilles.town

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113285411222020807
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
214.024871 milliseconds
Gemini-to-HTML Time
0.5477 milliseconds

This content has been proxied by September (ba2dc).