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...
Ref: https://github.com/nim-lang/Nim/issues/23361 Fixes the first example in referenced issue. The second example requires that pages can be inherited as creating a string allocates which then causes a cell to be...
### Description Download and build latest https://github.com/nim-lang/langserver Remove the lock file and the requires from the `nimlangserver.nimble` so it uses the latest Nim to build. Run `nimble build` Open a...
### Description I tried to load a dynamic library (dll), when I made it from Linux with the exported DllMain like this ```nim import winim/lean proc NimMain() {.cdecl,importc.} proc DllMain(hinstDLL:...
### Description This fails to compile on nimscript (at least on windows): ```nim import times ``` Despite `getTime` being implemented for the VM, it's not usable in nimscript for this...
When defining an iterator variable, the program compiles successfully if the variable is global but causes an internal compiler error if it is local. ### Example The following program compiles...
Hello, This works OK: ```nim proc fn(): int32 | int64 = 1 var v = fn() ``` But using a forward declaration fails, "_Error: invalid type: 'int32 or int64' for...
### Description ```nim proc heya* = proc zzz {.exportc.} = echo "yey" heya() proc zzz {.importc.} zzz() ``` ### Nim Version d73fff1ecc858783a3f1a90830e1bad4a3a23737 ### Current Output ```text @mtestb.nim.c:(.text+0x230): undefined reference to...
If you try to compile the following file: ```nim proc id*[T](t:T):T {.exportc,dynlib,cdecl.} = t discard id(5) discard id("hello world") ``` with the settings: ```nim --app:lib --header --noMain ``` you get:...
My workaround for https://github.com/nim-lang/Nim/issues/9365 relied on stable Nim->C symbols and needed to be updated after https://github.com/nim-lang/Nim/pull/11985. I would use {.exportc.} in the affected place to ensure Nim->C symbol mapping. Unfortunately,...
importc types (eg `cint`) don't alias properly, causing codegen errors. The bug affects not just tuples, but also seq and generics, see example below. ### Example 1: tuple ```nim type...