Literal types and typed string length
### Summary

Nim provides subrange types which is awesome because it provides automatic run-time checking (and compile-time checking when it can) of a numeric value being in a certain range, but this makes me ask: is there a reason for not having literal types like TypeScript or Python does ?
Example:
```
type FortyTwo = 42
type ConnectionStatus = "NOT_CONNECTED" or "CONNECTING" or "CONNECTED" or "DISCONNECTED"
```
Or to go even further in this way, it would be neat to also have TypeScript's format string types:
```
type ConnectionString = "${ConnectionStatus} USERNAME = ${string} ID = ${uint64}"
```

It would also be great to have, like for subranges, a way to typecheck the length of a string by using ranges, for example:
```
type Max512Chars = string^0..512
type Exactly30Chars = string'30
```

### Description

There's a lot of things I hate about TypeScript, but their literal type capabilities are awesome, and I would love to see them in Nim because it makes developer experience so much better in combination with language servers by allowing very powerful auto-completion when coding, those features are just very satisfying to use.

And for the last suggestion (checked length string) I think it's a very common use case to want to check the length of a string, either with a fixed size or a ranged size, so having it as a language built-in feature could definitely be useful.

### Alternatives

_No response_

### Examples

_No response_

### Backwards Compatibility

_No response_

### Links

_No response_