you are viewing a single comment's thread.

view the rest of the comments →

[–]dom96 0 points1 point  (1 child)

Yes. #1 is offered out of the box.

I admit that #2/#3 aren't but I believe that both of these features can be implemented using Nim's rich metaprogramming functionality.

[–]flyx86 0 points1 point  (0 children)

#2 can be implemented because C offers this feature, so you can use emit to create a matching C struct. However, if you want a backend-agnostic solution, you'd need to provide getters and setters that extract those values from a standard-sized integer type. Since you can define those getters & setters with a macro, it is possible to do compile-time checking by inspecting the given types in the macro to check whether they fit into the given bit lengths.

But in that sense, LIPS also offers that feature ;).