Why nim discord library is slower than python's discord library?

2023-04-21 Thread Luethlee
Firstly, thank you, developers. I am not claiming, but just wondering from a technical point of view. Though Python is an interpreter language, its discord bot library always responds faster than Nim's discord library dimscord. ( the use of memory is much smaller than in Python) Why, even thou

Why nim discord library is slower than python's discord library?

2023-04-21 Thread Yardanico
Nim being a compiled language doesn't magically make things faster, it really depends on how the library was written. Just to make sure - are you compiling your program with `-d:release`? If it's still slow, then it probably means that the library is doing something in a slower way that's in Pyt

How to make os (e.g. ubuntu) interpret nimscript shebang

2023-04-21 Thread noah
if you end up using a shell to execute your nim tests (e.g. reusing a git workflow script) make sure to use bash so you can fail on pipe erorrs #!/usr/bin/env bash set -euo pipefail Run

Nim for mobile

2023-04-21 Thread cmc
> waiting for others to do things for you is usually a bad idea But we all try at least once, now don't we? 😉

Writing a wrapper for ML libraries how-to

2023-04-21 Thread StrDev
Thank you for all the answers. I already have the Nim in Action book, and ordered Araq’s book. I take a deeper look, how the dynamic linking is made (this is the better approach for this purpose, right?) and make some experiments. I guess the most important missing peace is sklearn, which is a

Nim for mobile

2023-04-21 Thread planetis
That's not a lot of progress? Multiple people have had their go, and their results are available for free. Man sometimes I get frustrated with open source. I understand that shipping an Android app to the Play Store requires an App Bundle But APK

Article on wrapping C libraries in Nim

2023-04-21 Thread PMunch
> That means that you need tooling support for generating the C(++) wrapper > code. Not sure what you mean by this. Isn't this exactly what Futhark does? There's a reason Futhark doesn't yet support C++, it's quite a bit more of a complex beast than C.

Nim for mobile

2023-04-21 Thread kragil
Thanks for the answers, so it might be possible, but it seems to be far from straight forward. So not a lot of progress from where I am standing. For example: APKs are fairly obsolete in Google land and the list goes on. I might have a look at the game engines, but dragging a big fat game engine

Article on wrapping C libraries in Nim

2023-04-21 Thread Araq
> I'd much rather spend my time building a Nim API on top of a C library in Nim > than having to build it in C. That means that you need tooling support for generating this C(++) wrapping code. Not a bad thing to have but regardless of whether you generate or hand-write the wrapper code it mean

Workaround for "cannot be captured as it would violate memory safety"

2023-04-21 Thread alexeypetrushin
He's just envious cause my code is better than his.

Hex to bytes - How to convert

2023-04-21 Thread Oecophylla
Wow, I just did not read the docs well ! Many thanks !

Hex to bytes - How to convert

2023-04-21 Thread shirleyquirk
the [manual](https://nim-lang.org/docs/strutils.html#toHex%2Cstring) provides this helpful link:| > See also: > >> [parseHexStr](https://nim-lang.org/docs/strutils.html#parseHexStr,string) >> func for the reverse operation

Hex to bytes - How to convert

2023-04-21 Thread Oecophylla
Hi, I would like to know the easiest (but also the cleaner) way to convert hex to bytes. My objective is to convert files to hex and those hex values to file again. Converting files to hex was pretty easy but I did not find any solution for converting hex values back to bytes. Any idea ?

Article on wrapping C libraries in Nim

2023-04-21 Thread PMunch
> Well the "editing" consists to 99% of "removing junk that won't result in Nim > code anyway" so there is hardly any "error risks" involved. This is fairly naïve. Sure if you're proficient in C and Nim then maybe you'd have a fairly good grasp of what can be removed without any issues. But hidi