Nim
Nim copied to clipboard
Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, an...
### Example ```nim macro fn*(fun:untyped):untyped = echo "first" fun macro fn*(key:string, fun:untyped):untyped = echo "second" fun let c = fn(proc(count:int):string = return "x = " & $count ) ``` ###...
[The manual does not currently clarify this](https://nim-lang.org/docs/manual.html#special-types), so this might be a bug. ```nim type Foo[T :static[int]] = object proc bar[T :static[int]](x :T) :Foo[T] = discard ``` The signature of...
Something I've encountered recently while trying to share code between modules: Across various modules I have some exported symbols which happen to have the same name. When I import these...
### Example ```nim macro entity(entityType: typed) = discard type RootEntity = ref object of RootObj Player {.entity.} = ref object of RootEntity x, y: int ``` ### Current Output ```...
When helping someone over on the IRC channel debug a compiler crash I came over this bug. I boiled it down to a var field in a tuple passed to...
When my macro is used in a block, the identifier for my object is suffixed with some numbers (e.g. `_4855001`) but I'm not expecting that. Compare `Bob` with `Another_4855001` below:...
in https://forum.nim-lang.org/t/12463 which seems reasonable enough to me. stdlib has several dozens of places doing result.setLen now, but if `experimental:strictDefs` move sot on by default and there is no easy...
### Description ```nim type Opt[T] = object FutureBase* = ref object of RootObj Future*[T] = ref object of FutureBase ## Typed future. internalValue*: T ## Stored value template err[T](E: type...
### Description i expect this code to pass, but it does not ``` let a : int8 | uint8 = 3 assert sizeof(a)==sizeof(int8) # this fails ``` making the type...
Would it be possible to document when `int` behaves as a `type` and when `int` behaves as a `type class`. The differences between the two have some profound and perhaps...