Malebolgia & Pixy problem: expression has no address

2023-06-19 Thread ingo
Adding `{.nimcall.}` results in `Error: illegal capture 'function' because 'function' has the calling convention: `

macro - issue with the identifiers

2023-06-19 Thread sls1005
Try using `{.inject.}`. result = quote do: proc setStartValues*(comp {.inject.}: ModelInstanceRef) = `body` Run

MoveWindow()

2023-06-19 Thread awr1
[here you go.](https://developer.apple.com/documentation/appkit/nswindow/1419690-setframeorigin?language=objc) you may prefer using a cross-platform windowing library instead, e.g. [SDL2](https://github.com/nim-lang/sdl2) or [windy](https://github.com/treeform/windy)

How doeas NIM differ from Mojo programming language?

2023-06-19 Thread jibal
I suggest looking up the definition of the word "same" in the dictionary, because you seem to be misusing it.

macro - issue with the identifiers

2023-06-19 Thread mantielero
The following seems to work as intended: macro init*(args: varargs[typed]) = result = nnkStmtList.newTree() # 1. Function name var newFunc = nnkProcDef.newTree() newFunc.add( nnkPostfix.newTree( newIdentNode("*"), newIdentNode("setSt

macro - issue with the identifiers

2023-06-19 Thread __arathanis__
Try using `std/genasts`. import std/genasts # add this import macro init*(args: varargs[typed]) = var body = nnkStmtList.newTree() var comp: ModelInstanceRef var names:seq[string] for arg in args: names &= arg.strVal var id

Building 1.6 on RHEL 7 on POWER (pp64le)?

2023-06-19 Thread cheekm
I'm trying to bootstrap nim v1.6.x on a RHEL 7 server running on IBM POWER9 ppc64lc hardware. Unfortunately, all I have is gcc 4.8.5. (Ancient, I know.) I'm getting the "undefined reference to __builtin_saddll_overflow" messages at the link step when running "sh build.sh". I searched the forum

macro - issue with the identifiers

2023-06-19 Thread mantielero
I am working on a macro and I am having an issue with it (I think it must be something silly). My macro: macro init*(args: varargs[typed]) = var body = nnkStmtList.newTree() var comp: ModelInstanceRef var names:seq[string] for arg in args: name

Malebolgia & Pixy problem: expression has no address

2023-06-19 Thread PMunch
By adding the `{.nimcall.}` pragma to it I believe

MoveWindow()

2023-06-19 Thread Steven
Because it's not built in to [webview](https://github.com/webview/webview)

MoveWindow()

2023-06-19 Thread SpotlightKid
Suspiciously: why do you want to move a window?

MoveWindow()

2023-06-19 Thread Steven
Could somebody please to fill in the Mac OS branch below: when defined windows: proc MoveWindow(nHandle: HWND, x, y, w, h: clong) {.stdcall, dynlib: "user32", importc: "MoveWindow".} elif defined linux: proc gtk_window_move(nHandle, x, y: clong) {.cdecl, dynlib:

How doeas NIM differ from Mojo programming language?

2023-06-19 Thread didlybom
For those that are interested in this topic, Chris Lattner addressed this particular topic (Swift for Tensorflow's failure) in his recent podcast with Lex Fridman. His explanation is that "Swift is not Python".

How doeas NIM differ from Mojo programming language?

2023-06-19 Thread mratsim
5 years ago there was a lot of hype for Swift for Tensorflow: * * with large projects planning to migrate to it: *

how to make a dll in nim-lang?

2023-06-19 Thread sls1005
Another problem is that the string wasn't referenced by any living Python variable, thus could be freed.

how to make a dll in nim-lang?

2023-06-19 Thread sls1005
Because you are using a Python `string` instead of `bytes` or `bytearray`.

how to make a dll in nim-lang?

2023-06-19 Thread SpotlightKid
You need to pass a byte string from the Python side: import ctypes lib = ctypes.cdll.LoadLibrary('./libhello.so') lib.hello(b"Hello World!") Run Also, your Nim function should probably return `void` instead of `cstring`.

how to make a dll in nim-lang?

2023-06-19 Thread ploxotnuj1
thank you, IT WORKS, but for some reason only one letter is displayed: import ctypes lb = ctypes.cdll.LoadLibrary("./main.dll") result = lb.hello("LOL") print(result) Run proc hello(slovo: cstring): cstring {.exportc, dynlib.} = echo slovo

how to make a dll in nim-lang?

2023-06-19 Thread Calonger
`string` != `cstring` . Use `cstring` no `string`

Malebolgia & Pixy problem: expression has no address

2023-06-19 Thread ingo
After some changes I'm at `Error: closure call is not allowed`. How do I pass a proc to a proc without it becoming a closure? proc renderXYFunc2( image: Image, function: proc(x: float, y: float, funcVA: varargs[float]): float {.gcsafe.}, funcVA: varargs[float],

how to make a dll in nim-lang?

2023-06-19 Thread pietroppeter
you could use genny to generate a c dll (will not support GC):

how to make a dll in nim-lang?

2023-06-19 Thread ploxotnuj1
I have a problem with dll files, I noticed one oddity if I compile this code proc helloWorld(): string {.exportc, dynlib.} = return "Hello World Run and compile and then try to run the dll in python or another programming language, then everything is fine, but as

error: could not load:(libcrypto-1_1-x64|libeay64).dll

2023-06-19 Thread ploxotnuj1
need to puppy