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, and elegance (in that order of priority).
I ran into a incredible frustrating issue where my compiler was seg faulting due to missing a ref in a type declaration. In the below code just swapping Node[T] = object to Node[T] = ref object stops the seg fault and compiles and runs as expected. In fact on MacOS I don't even get the segfault error, Segmentation fault (core dumped), instead the compiler just mysteriously stopped. The same thing happens with the devel branch I grabbed from choosenim.
type
Node[T] = object
item: T
next: Node[T]
Bag*[T] = ref object
first: Node[T]
size: int
Originally from: https://forum.nim-lang.org/t/6679
I ran into a incredible frustrating issue where my compiler was seg faulting due to missing a ref in a type declaration. In the below code just swapping Node[T] = object to Node[T] = ref object stops the seg fault and compiles and runs as expected. In fact on MacOS I don't even get the segfault error, Segmentation fault (core dumped), instead the compiler just mysteriously stopped. The same thing happens with the devel branch I grabbed from choosenim.
Example
You can reproduce the seg fault here: https://play.nim-lang.org/#ix=2u3O
Current Output
Segmentation fault (core dumped)
Expected Output
An error of some kind pointing out the need for a reference.
Nim Compiler Version 1.0 and beyond