<< 20-05-2021 >>

00:00:04FromDiscord<brainproxy> I need to do a `newCall("foo", ...)`, but I need it to support specifying generic, e.g. `foo[bar]`
00:00:23FromDiscord<brainproxy> reading the manual, googl'ing, etc., but I'm scratching around again
00:00:54FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=3nlt
00:01:20FromDiscord<ElegantBeef> Take a read of my macro tutorial to see how i write macros https://dev.to/beef331/demystification-of-macros-in-nim-13n8
00:02:11FromDiscord<ElegantBeef> Basically write the code you want inside a dumptree, then write what you want to do, then take from the input and convert to the desired output
00:08:40ForumUpdaterBotNew thread by Elcritch: Show Nim: Tiny program to reset USB ports on Linux, see https://forum.nim-lang.org/t/8004
00:38:16*JStoker quit (Quit: JStoker is gone :()
00:39:14*JStoker joined #nim
00:44:43*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
00:45:09*njoseph joined #nim
00:45:59*Figworm joined #nim
00:52:19FromDiscord<reilly> In reply to @geekrelief "Also I have my": It took some fiddling, but it looks like it's working. I understand it's not production-ready, so let's see how nice it plays as I continue to work.
00:54:33*thomasross quit (Quit: Leaving)
00:55:16FromDiscord<geekrelief> Cool. It's built on top of godot-nim. So if you use it like godot-nim, it's production-ready.
00:55:25*nphg joined #nim
00:56:18FromDiscord<geekrelief> I basically added that warning because of the hot reloading implementation. Early on I was getting a lot of crashy behavior with ORC
00:57:00FromDiscord<geekrelief> but after tweaking some settings and rewriting the hot reloading, I think you'll find it pretty stable. I haven't made anything serious with it yet though.
00:57:11*nphg1 quit (Ping timeout: 240 seconds)
00:57:39*Tlangir joined #nim
00:59:08FromDiscord<geekrelief> But I'm interested in how hot reloading works out for you.
01:04:44*arecaceae quit (Remote host closed the connection)
01:08:03*arecaceae joined #nim
01:11:52FromDiscord<reilly> I think something has gone slightly wrong. https://media.discordapp.net/attachments/371759389889003532/844744199295467560/unknown.png
01:20:34FromDiscord<Rika> nah looks normal to me xdd
01:20:46FromDiscord<Rika> in all seriousness im betting its nimsuggest
01:21:40FromDiscord<reilly> In reply to @Rika "in all seriousness im": I should have taken a better mental note of exactly what it was, but I'm 99% sure it was endless generic terminal instances.
01:22:33FromDiscord<Rika> its usually nimsuggest that causes high memory or high cpu usage from what ive seen and experienced
01:23:20FromDiscord<reilly> I know the Nim extension has a tendency to leak instances of Nimsuggest, but not 1070 of them.
01:25:33leorize[m]are you using the nimsaem extension?
01:26:33FromDiscord<reilly> In reply to @leorize "are you using the": Yes.
01:26:52leorize[m]@saem ^
01:26:56FromDiscord<reilly> It has to be a problem with GDNim though, this has never happened before now and it's the only thing that's changed.
01:27:02FromDiscord<reilly> @geekrelief
01:28:13FromDiscord<reilly> Nope, nevermind, it's Nimsuggest. Last time it looked like it was "Console Window Host" (but to be fair, I didn't look too hard) but this time it is, without a doubt, Nimsuggest.
01:28:15FromDiscord<ElegantBeef> Well it probably is spooling up a nimsuggest instance per file since it's not a typical nim project
01:28:53FromDiscord<reilly> Beef is probably right, cause there's a hell of a lot of files in this project.
01:29:11FromDiscord<reilly> GDScript it is, I guess 🙃
01:29:18FromDiscord<geekrelief> In reply to @reilly "It has to be": Yeah, I disable nimsuggest. Sometimes it works fine, then all of a sudden my system goes to a crawl
01:29:34FromDiscord<ElegantBeef> You can tell nimsuggest the project file using the config
01:29:47FromDiscord<ElegantBeef> It's in the nim extensions settings
01:30:03FromDiscord<reilly> I force-closed VSCode and it gave me this doozy: https://media.discordapp.net/attachments/371759389889003532/844748769961443388/unknown.png
01:30:12FromDiscord<reilly> So many error windows that the shadow is practically an outline.
01:31:30FromDiscord<Rika> the operation could not be completed
01:33:14FromDiscord<Rika> anyway its probably best to turn nimsuggest off
01:33:22FromDiscord<Rika> how often do you guys use it? i barely do
01:33:46FromDiscord<ElegantBeef> I always have it on
01:34:02FromDiscord<reilly> I'd rather know where my problems are before compiling.
01:34:07FromDiscord<Rika> i mean i have it on but not for suggestions
01:34:54FromDiscord<ElegantBeef> Yea i use it for suggestions
01:36:35FromDiscord<reilly> In reply to @ElegantBeef "You can tell nimsuggest": Could you elaborate on this? Does it prevent Nimsuggest from checking files outside of a certain directory?
01:37:00FromDiscord<ElegantBeef> It just tells it where the root file is so you can properly use nim suggest instead of once per file
01:38:14FromDiscord<reilly> So does that mean it checks one file or what? The only files that should ever need checking will exist in one directory, so if I can limit Nimsuggest to just that folder, I'm golden.
01:38:50FromDiscord<Rika> nimsuggest needs a project root file
01:39:01FromDiscord<Rika> otherwise it will check all files in the project folder
01:39:58FromDiscord<geekrelief> That might be incompatible with the way hot reloading is setup to work with gdnim. Each `component` is a root file since they each produce a dll.
01:40:11FromDiscord<reilly> I was about to say ^
01:40:18FromDiscord<geekrelief> If you don't want to use hot reloading you can turn it off
01:40:26FromDiscord<geekrelief> there's a switch in build.ini
01:40:52FromDiscord<geekrelief> then you can create one component file and a nim.cfg and use that as the root for the rest of your project
01:42:08FromDiscord<geekrelief> Something like `components/myproject.nim` `components/nim.cfg` the nim.cfg has `--path:"myproject_src"` and then you create a `myproject_src` directory and put your nim files in there
01:42:19FromDiscord<reilly> I could just use an empty Node2D as my root, since I have to have a main scene anyway.
01:42:53FromDiscord<geekrelief> you could just create your root as a the only component in the project
01:42:59*krux02 quit (Remote host closed the connection)
01:43:00FromDiscord<geekrelief> actually you could still get hot reloading that way
01:43:10FromDiscord<reilly> I don
01:43:25FromDiscord<reilly> I don't really care about hot reloading anyway; I just want it to work.
01:44:11FromDiscord<geekrelief> ok, turn off hot reloading in build.ini, create your root component like I said above
01:44:56FromDiscord<reilly> I'm going to start from scratch just to make sure I don't have any other funky things going on, so bear with me.
01:45:24FromDiscord<geekrelief> you can run the `./build init` command to create a clean branch
01:45:53FromDiscord<reilly> You're right! I was going to do that process all over again like a doofus.
01:46:54FromDiscord<reilly> Nope, nevermind, I removed all the git stuff after I initialized it since I didn't want that link. I'll be quick.
01:50:52*^GaveUp^ joined #nim
01:51:53FromDiscord<reilly> In reply to @ElegantBeef "It just tells it": Does the nim.cfg have to contain anything, or is it just the existence of the file that matters?
01:52:39FromDiscord<ElegantBeef> Should just need to exist so it can reason where the root is i believe, saem can probably give more help when he's about
01:53:10*GaveUp quit (Ping timeout: 258 seconds)
01:53:10*^GaveUp^ is now known as GaveUp
01:59:22*arkurious quit (Quit: Leaving)
02:09:34FromDiscord<reilly> Looking good right now... Got a basic FPS counter going, VSCode isn't exploding.
02:20:07FromDiscord<geekrelief> In reply to @reilly "Looking good right now...": Cool, btw. Are you familiar with how gdnative works? If you're going to create 1 file to import all your classes, you'll have to generate `gdns` files for each class you create and have it point to the `gdnlib`. You probably need to edit `tasks.nim` to disable the file modification time check, or compile with the `--nc` flag.
02:21:06*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
02:21:10FromDiscord<reilly> In reply to @geekrelief "Cool, btw. Are you": I'll cross that bridge when I come to it.
02:28:16FromDiscord<reilly> Worst-case scenario, I hit a roadblock and have to use GDScript. Oh well.
02:30:53*GaveUp quit (Ping timeout: 246 seconds)
02:33:35*GaveUp joined #nim
02:38:04FromDiscord<Rika> is there a "runForever" proc in asyncdispatch that doesnt crash when all async procs scheduled are finished
02:38:12FromDiscord<Rika> "crash" more of raise
02:44:02FromDiscord<reilly> In reply to @Rika "is there a "runForever"": Why can't you just catch it?
02:45:13FromDiscord<Rika> i can, i ask for better solutions
02:46:51*^GaveUp^ joined #nim
02:47:15FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=3nlZ
02:49:11*GaveUp quit (Ping timeout: 240 seconds)
02:49:11*^GaveUp^ is now known as GaveUp
03:03:33*motersen_ quit (Ping timeout: 240 seconds)
03:04:52*motersen joined #nim
03:06:52*azed joined #nim
03:14:34*nisstyre quit (Quit: WeeChat 3.1)
03:20:21*motersen quit (Ping timeout: 240 seconds)
03:22:09*motersen joined #nim
03:28:51*spiderstew_ joined #nim
03:29:57*bozaloshtsh_ quit (Quit: ZNC 1.7.5 - https://znc.in)
03:31:41*spiderstew quit (Ping timeout: 258 seconds)
03:31:47*bozaloshtsh joined #nim
03:31:48*bozaloshtsh quit (Changing host)
03:31:48*bozaloshtsh joined #nim
04:06:05FromDiscord<garett> Thinking of refactoring glm to use clang’s `ext_vector_type`. Maybe possible with `{.emit.}`?
04:08:45FromDiscord<garett> Not sure how to define a Nim type with emit pragma
04:09:47FromDiscord<garett> Had my 2nd shot today, so not thinking clearly
04:12:45FromDiscord<garett> I see the manual has a type emit example 😎
04:21:12*fantis quit (Remote host closed the connection)
04:24:43*snowolf joined #nim
05:12:19*NimBot joined #nim
05:14:53*narimiran joined #nim
05:18:43*azed quit (Quit: WeeChat 3.1)
05:42:29*stisa quit (Ping timeout: 245 seconds)
05:42:29*reversem3 quit (Ping timeout: 245 seconds)
05:43:14*reversem3 joined #nim
05:43:16*stisa joined #nim
05:46:30saemLooks like people figured it out, neat.
05:58:35FromDiscord<ElegantBeef> Yea your saviour was here
05:59:44saemThanks
06:00:06saemYou're my beefy jebus
06:02:38FromDiscord<ElegantBeef> Way to call me fat
06:06:47*Vladar joined #nim
06:16:11*rockcavera quit (Remote host closed the connection)
06:27:58ForumUpdaterBotNew Nimble package! tm_client - TwineMedia API client library for Nim, see https://github.com/termermc/nim-tm-client
06:48:02*al1ranger joined #nim
07:05:53*al1ranger left #nim ("Leaving")
07:07:34*al1ranger joined #nim
07:07:56*al1ranger quit (Quit: Leaving)
07:30:25*koltrast joined #nim
07:35:00*hoek quit (Read error: Connection reset by peer)
07:35:01*ormiret quit (Ping timeout: 250 seconds)
07:35:24*Adeon quit (Ping timeout: 245 seconds)
07:35:31*d10n-work quit (Ping timeout: 260 seconds)
07:36:49*npgm quit (Ping timeout: 276 seconds)
07:37:47*ormiret joined #nim
07:37:58*kinkinkijkin quit ()
07:38:15*hoek joined #nim
07:38:25*Adeon joined #nim
07:38:38*d10n-work joined #nim
07:38:39*npgm joined #nim
07:41:59*npgm quit (Max SendQ exceeded)
07:46:31*npgm joined #nim
08:10:45*hendursaga quit (Ping timeout: 240 seconds)
08:16:13*hendursaga joined #nim
08:49:22*pbb joined #nim
09:10:41*Arrrrrrrr joined #nim
09:22:58*krux02 joined #nim
09:26:51*PMunch joined #nim
09:58:32ForumUpdaterBotNew thread by Jasonfi: Transpile Nim to Dart/Flutter?, see https://forum.nim-lang.org/t/8005
10:17:48*Hasnep[m] joined #nim
10:18:05FromDiscord<jake᲼> @d4rckh shut up
10:18:30FromDiscord<jake᲼> anyone know a good library for parsing binaries?
10:20:39PMunchDid you just tell someone who hasn't spoken all day to shut up?
10:20:53PMunchbinaryparse/binarylang might be what you're looking for
10:21:03PMunchDepends on what you mean by "binaries"
10:21:58FromDiscord<jake᲼> In reply to @PMunch "Did you just tell": hes my friend its a joke
10:22:10FromDiscord<jake᲼> he is romanian
10:22:33PMunchHaha, is there some Romanian stereotype about not shutting up?
10:22:45FromDiscord<jake᲼> nah
10:22:49FromDiscord<jake᲼> i dont think so
10:23:05FromDiscord<jake᲼> they have a stereotype for trolling though
10:24:39PMunchAah, I see
10:25:14FromDiscord<jake᲼> with binarylang do you think I would be able to check for mitigations?
10:25:23*wanr[m] joined #nim
10:25:23FromDiscord<jake᲼> or would I need to use something like readelf
10:25:28*fifth quit (Quit: WeeChat 3.1)
10:25:47*fifth joined #nim
10:26:03PMunchmitigations?
10:26:13FromDiscord<jake᲼> yes
10:26:16PMunchI mean with binarylang you would have to write your own ELF parser
10:26:26FromDiscord<jake᲼> right
10:26:28PMunchIt's just a language for parsing binary objects
10:26:40PMunchOr for writing parsers to parse binary objects rather
10:27:01FromDiscord<jake᲼> https://media.discordapp.net/attachments/371759389889003532/844883905545764885/unknown.png
10:27:01FromDiscord<jake᲼> like this
10:27:15FromDiscord<jake᲼> I wanted to write something like that in nim
10:27:17PMunchI mean ELF files aren't the most complicated things to parse though
10:27:23FromDiscord<jake᲼> ye
10:31:53*MarderIII joined #nim
10:52:56*krux02 quit (Remote host closed the connection)
11:10:56*aeverr quit ()
11:11:51*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
11:17:33*pbb joined #nim
11:17:49*pbb quit (Client Quit)
11:18:39*pbb joined #nim
11:47:21*xet7 quit (Quit: Leaving)
11:47:42Hasnep[m]Can someone help explain what megatest is in testament? Thanks :)
11:47:43*xet7 joined #nim
12:03:17*Cadey left #nim ("WeeChat 3.1")
12:25:29*xet7 quit (Quit: Leaving)
12:25:47*xet7 joined #nim
12:27:04*Kumool quit (Ping timeout: 245 seconds)
12:27:37*xet7 quit (Remote host closed the connection)
12:27:39FromDiscord<ajusa> Anyone know if I can limit the maximum size of a hash table? Use case is a caching mechanism that shouldn't run out of memory, so I don't want the table to grow unbounded
12:27:58*xet7 joined #nim
12:28:10FromDiscord<ajusa> (edit) "unbounded" => "unbounded. I don't mind if random keys are removed to make that happen"
12:32:30FromDiscord<dp> sent a long message, see http://ix.io/3nnE
12:32:33*rockcavera joined #nim
12:37:51*arkurious joined #nim
12:43:45PMunchajusa, maybe this will be helpful to you: https://github.com/PMunch/nim-cache
12:50:24*Vladar quit (Remote host closed the connection)
12:54:35*Vladar joined #nim
13:00:04*hendursaga quit (Write error: Connection reset by peer)
13:00:41*hendursaga joined #nim
13:10:27FromDiscord<Rika> In reply to @dp "Hello! I just tried": you are compiling in debug, which contains stack traces
13:10:34FromDiscord<Rika> well rather line information
13:10:40FromDiscord<Rika> the var F is the line info
13:13:36*tane joined #nim
13:15:44FromDiscord<dp> In reply to @Rika "well rather line information": Thanks for the answer. Adding -d:release removes all the lines
13:16:08FromDiscord<Rika> 👍
13:18:33FromDiscord<ajusa> Thanks PMunch, I'll check that out
13:24:54*fantis joined #nim
13:32:36*Arrrrrrrr quit (Quit: Arrrrrrrr)
13:39:53*hyiltiz quit (Ping timeout: 240 seconds)
13:40:33*hyiltiz joined #nim
13:40:33*hyiltiz quit (Changing host)
13:40:33*hyiltiz joined #nim
13:46:21Clonkk[m]What do you do when the compiler throws an excpetion :D ?
13:48:54*whaletechno joined #nim
13:49:34PMunchBuild a debug build of the compiler and submit an issue
13:49:55PMunchOr better yet fix it and submit a PR
13:56:34*PMunch quit (Quit: leaving)
13:58:02Clonkk[m]Sure, whenever I got time to reproduce it and open an issue. But how do you debug it when the compiler gives you nothing
14:03:31*rockcavera quit (Remote host closed the connection)
14:04:56*narimiran quit (Ping timeout: 260 seconds)
14:06:00PrestigeDoes it give anything if you build the compiler in debug mode first?
14:06:14*MarderIII quit (Ping timeout: 245 seconds)
14:06:20*noeontheend quit (Ping timeout: 246 seconds)
14:07:42FromDiscord<mischa_u> https://nim-lang.org/docs/intern.html#debugging-the-compiler
14:17:58*rockcavera joined #nim
14:23:40Clonkk[m]Got a wonderful stacktrace
14:23:49*Clonkk[m] < https://matrix.org/_matrix/media/r0/download/matrix.org/SkkluaXfMTYcFWzmaKxyPbQE/message.txt >
14:23:59Clonkk[m]I still have no clue what part of my code fails :D
14:26:02FromDiscord<Goat> Is it possible to turn your custom type into an iterator?
14:27:51Clonkk[m]You can implement ``items`` iterator for any type. It's in the manual
14:30:23leorize[m]Clonkk: are you using a typed macro by any chance?
14:30:38*arecaceae quit (Remote host closed the connection)
14:30:42Clonkk[m]Yup
14:31:11Clonkk[m]Am I not supposed to 😛 ?
14:31:45Clonkk[m]Macro with typed parameters are supposed to be allowed I thought ?
14:32:20leorize[m]do you perform any modification in the macro to call nodes?
14:36:18*arecaceae joined #nim
14:36:18Clonkk[m]I call proc & template in my macro, yes
14:39:14Clonkk[m]It seems the error is linked to the presence of an iterator
14:39:25Clonkk[m]Removing my macors code actually doesn't change anything
14:41:22leorize[m]congrats, you hit the most annoying typed macro bug :)
14:41:23leorize[m]see here for a workaround: https://github.com/disruptek/cps/blob/master/cps/spec.nim#L436
14:41:23leorize[m]you can try copying that workaroundRewrites into your macro
14:41:23leorize[m]then run it on the result ast before returning
14:41:23leorize[m]usually that would fix it
14:41:23leorize[m]in the same file linked we also have `normalizingRewrites` that turn typed ast into something that you can modify without the compiler puking on the result
14:41:24leorize[m]could be useful too
14:42:44*ehmry left #nim ("leaving freenode")
14:42:52Clonkk[m]Well, that'll teach me to play with @mratsim's code 😆
14:44:25Clonkk[m]This is still very weird because the code I have to remove to make it compile again is iterators implementation
14:44:56leorize[m]if typed macro is not weird I don't know what is
14:45:34leorize[m]we documented this stuff a lot in cps, so you can read the procs I told you
14:46:00leorize[m]the gist of it is typed macros contains many stupid nodes that you can't modify or the compiler will die in very creative ways
14:46:21leorize[m]like `the first parameter is of type void` for a string literal :)
14:46:39Clonkk[m]Hmm
14:47:08leorize[m]and sigmatch crashes is a very frequent sight
14:48:08Clonkk[m]So it's possible I had the issue. But it's not the only thing that goes wrong. Commenting all of my macros (and generally speaking, not compiling them) still gets me the same errors
14:48:11FromDiscord<kodkuce> totaly late response, but first thing that killed me for python was that global kayword but i guess you have to have it
14:52:18FromDiscord<mratsim> In reply to @Clonkk "Well, that'll teach me": what code?
14:53:34Clonkk[m]<FromDiscord "<mratsim> In reply to @Clonkk "W"> I was playing with Arraymancer slicing code (desugar proc)
14:53:50Clonkk[m]But actually y he error was un-related
14:54:04Clonkk[m]It's caused by a weird interaction of template`.` and varargs
14:58:14federico3is this channel moving away from freenode?
14:58:29*noeontheend joined #nim
14:58:31*rockcavera quit (Remote host closed the connection)
15:00:23*MarderIII joined #nim
15:03:00PrestigeHope not
15:04:13FromDiscord<Rika> Why
15:04:24Clonkk[m]I'll check it out, thanks for your help leorize
15:05:22leorize[m]Clonkk: here is how we use it in cps: normalizingRewrites before touching the ast, workaroundRewrites before returning
15:05:22federico3Freenode has been victim of a takeover and the whole historical staff left to create libera.chat https://fuchsnet.ch/freenode-resign-letter.txt
15:05:23leorize[m]hope that helps
15:05:31*kaliy quit (Remote host closed the connection)
15:06:09PrestigeI'm skeptical about the whole "takeover" and I think moving some people to another server would just fragment the users
15:06:28*kaliy joined #nim
15:06:34Clonkk[m]<leorize[m] "hope that helps"> Well, it helped me understood the issue so yes :). For my specific use case, I can have a workaround by using a ``template`` and ``varargs[untyped]`` instead of a ``proc`` and it seems to do the trick
15:07:01Clonkk[m]I'll see if it still holds true when I'll use it in more complex macros
15:07:09*kaliy quit (Client Quit)
15:07:53*kaliy joined #nim
15:08:40*kaliy quit (Client Quit)
15:09:04fantisI'm passing a nim callback to a C fn where one of the cb params is a pointer to `struct { char* text; unsigned int length; }`, which I've wrapped nim side as `object text: cstring length: uint`.
15:09:17fantisIn the cb, I receive the struct as `ptr arg` (`sometype* arg` in the C signature) and do `arg[].text = cstring("balls")` and `args[].length = 5` and it will crash because the C code attempts to free it and fails. I've tried other things besides `cstring()` too without luck. Should I be able to use the arg in a way that allows the C code to free it, specifically the `.text`?
15:09:19*kaliy joined #nim
15:11:40*Xe joined #nim
15:12:39Clonkk[m]<fantis "In the cb, I receive the struct "> If your C library calls ``free`` on the ``char *`` pointer you passed, it means you need to pass a ``char *`` that has been allocated using ``malloc``
15:13:00fantisso I need to alloc() it nim side?
15:13:14Clonkk[m]But are you sure this is what's happening ? I would find very un-common (and bad) to have a C library that frees something is hasn't allocated
15:14:28fantisI'm pretty sure. It doesn't use `free()` it uses a library specific free function on the `args.text`
15:14:50fantisI should probably come back to this with some code snippets I think
15:15:00Clonkk[m]So in this case
15:15:04Clonkk[m]Try to make a working C examples
15:15:09Clonkk[m]Then bind it
15:15:22Clonkk[m] * Then convert it
15:15:37fantisalright, yea, good idea. I'll try that
15:15:53Clonkk[m]You need to understand how your C library handles memory
15:16:01Clonkk[m]How it allocate, how it frees, and when
15:17:42fantisin general though, if I do `alloc()` in nim and then pass the pointer to a C fn, should I be able to free it C side?
15:18:31Clonkk[m]No, ``alloc`` and ``dealloc`` are not necessarily mapped to ``malloc`` and ``free``
15:18:54Clonkk[m]If you specifically want ``malloc`` and ``free`` I would ``importc`` them
15:19:40Clonkk[m]I think ``alloc`` and ``dealloc`` only correspond to their C counterpart if you compile with ``-d:useMalloc`` (to be confirmed, I'm not 100% sure)
15:20:00fantisah, I thought I could so I used it as sort of sanity check which drove me further into despair when it didn't work
15:20:26fantisthanks. I'll try to implement the callback in C and see if I get there
15:21:04Clonkk[m]It's usually easier to go from C to Nim than the opposite
15:30:11*Xe quit (Quit: WeeChat 3.1)
15:32:29fantisalright, started working when I `importc`'ed `malloc()` and replaced `alloc()` with it. thanks Clonkk :)
16:00:13*ligist[m] quit (Quit: Idle for 30+ days)
16:08:45*whaletechno quit (Quit: ha det bra)
16:10:04*qwr quit (Quit: leaving)
16:12:31FromDiscord<inv> Hi, I was trying to check if I need new PC or mac or something like this and created the repo with scripts which do nim-build-benchmark: https://github.com/inv2004/bench_nim_build/
16:13:07FromDiscord<inv> Because, I suppose it is the only interesting thing for me on laptop/pc 🙂
16:13:21FromDiscord<inv> You can find some stats here: https://github.com/inv2004/bench_nim_build/issues
16:14:20FromDiscord<inv> And, if you would like, you can run the scripts from README and they will automatically create PR's into the repo
16:15:09FromDiscord<inv> Probably it would help to find good/bad cpu to someone else too, or, at least to keep some statistics
16:16:11FromDiscord<inv> The interesting thing I found: that my 150$ i5-7500 builds Nim faster in WSL2 that macmini M1
16:16:18FromDiscord<inv> (edit) "that" => "than"
16:16:39FromDiscord<inv> (edit) "in WSL2" => "(in WSL2)"
16:22:22*vicfred joined #nim
16:38:16*acidx left #nim (#nim)
16:53:17*jxy quit (Quit: leaving)
17:15:22*Vladar quit (Remote host closed the connection)
17:36:49*l1x joined #nim
18:05:38*superbia joined #nim
18:07:53*jjido joined #nim
18:31:46reversem3Does nim have bin to hex to hex to bin ? or do I need to calculate by hand ?
18:32:35FromDiscord<ElegantBeef> strutils has `toHex` and `fromHex`
18:33:34reversem3sorry I mean bin to dec or dec to bin
18:36:55FromDiscord<ElegantBeef> there is `toBin` and `fromBin` aswell there
18:37:04FromDiscord<ElegantBeef> Only for ints though
18:43:19reversem3yeah i see you have to use a string also , ok cool thanks
18:58:04*federico3 left #nim ("http://quassel-irc.org - Chat comfortably. Anywhere.")
18:59:33*narimiran joined #nim
19:02:14*rockcavera joined #nim
19:12:51*sysadmin joined #nim
19:41:41*superbia quit (Quit: WeeChat 3.1)
19:49:56*aenesidemus joined #nim
19:55:37*l1x quit (Quit: Connection closed for inactivity)
19:57:23*noeontheend quit (Ping timeout: 246 seconds)
20:42:58*narimiran quit (Ping timeout: 265 seconds)
20:49:19*tane quit (Quit: Leaving)
20:58:27*gangstacat quit (Quit: Ĝis!)
21:23:10*MarderIII quit (Quit: Leaving)
21:23:52FromGitter<bung87> Error: cannot instantiate: 'Table[A, B]'; Maybe generic arguments are missing?
21:24:10FromGitter<bung87> `connectAttrs:Table[string,string] = default(Table[string,string])` my proc defines like this
21:30:44FromGitter<bung87> hmm define alias type for now
21:47:06*sagax quit (Ping timeout: 240 seconds)
21:57:18*jjido quit (Quit: Connection closed for inactivity)
22:12:57*aenesidemus quit (Quit: Leaving)
22:13:18FromDiscord<reilly> I think I might just use a pure Nim engine instead. yglukhov/rod doesn't list its features, so how does it compare to liquidev/rapid? (Besides Rod having 3D and Rapid not.)
22:14:46FromDiscord<reilly> And on that note, if you have any recommendations for Nim game engines that aren't listen on https://github.com/nim-lang/Nim/wiki/Curated-Packages#games, I'm listening.
22:14:53FromDiscord<reilly> (edit) "listen" => "listed"
22:17:12*D_ quit (Quit: No Ping reply in 180 seconds.)
22:18:18*D_ joined #nim
22:18:42*D_ is now known as Guest26540
22:18:58FromDiscord<reilly> I think I may have to use Rapid since the documentation for Rod seems to be... Less than ideal.
22:20:24*Guest26540 is now known as D_
22:22:10Zoom[m]How can I output an array of char all at once?
22:24:28FromDiscord<reilly> Do you not just mean `echo x`?
22:25:25FromDiscord<reilly> If you want to print it without the brackets, you can `import strutils` then do something like `echo x.join(", ")`
22:26:06Zoom[m]Nope, just as a string but skipping the convertion to a seq
22:30:51Zoom[m]Can't think of anything besides either resorting to stdout.write char by char, or `@` it and then `cast[string](seq)`
22:32:50FromDiscord<reilly> Maybe I don't understand what you're really asking here, but couldn't you do `x.join("")` to join every item without any spacing between them?
22:33:45FromDiscord<reilly> The implementation of `join` doesn't use a seq, which seems like what you want.
22:35:57FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=3nq5
22:36:30FromDiscord<reilly> Oops, forgot to edit the arguments, and since you're on Matrix you won't see an edit 😛
22:36:37*abm joined #nim
22:36:37Zoom[m]reilly it uses a string, which is a seq, so it's not better than what I already do, except without a cast
22:38:00FromDiscord<reilly> I have to ask, what are you working on where it makes a difference?
22:38:35Zoom[m]It doesn't, I just wanted to know how I would do it if it did
22:39:56Zoom[m]Something like making a cstring of array.len + 1 for a zero char and copymem data from array to it?
22:40:15FromDiscord<reilly> If all you want to do is print an array of chars to look like a string, with absolutely nothing else happening behind the scenes, then `for char in x: stdout.write(char)` seems like your best bet.
22:40:35FromDiscord<reilly> To me though, it seems like you're over-engineering the problem.
22:41:31Zoom[m]I'm just wondering, sorry for taking your time. Thought maybe there's an obvious way to do it
22:43:26FromDiscord<reilly> Don't apologize, it's not like I have anything better to do. It is an interesting question, I guess, cause `for char in x: stdout.write(char)` isn't exactly "all at once..."
22:44:22Zoom[m]The thing is, you could in theory do it without a heap, as the length is known. cstring is just a zero-terminated array, so we're almost there.
22:44:52Zoom[m]If I understand it all correctly
22:45:56FromDiscord<reilly> Maybe someone else knows a hacky way of getting what you want done, but I wouldn't know since, in my eyes, it's just not a practical thing to worry about.
22:47:26FromDiscord<reilly> Good luck with figuring out something better, if that's what you want to do. Since you're getting really down-to-the-metal here, maybe some inline assembly or C might be what you need.
22:49:16Zoom[m]Also, it's probably not the right place, but anyway. If I'm polling getch() in a loop in a thread. Is there a risk it affects outputting to a terminal from another? Do I need to lock stdout?
22:51:47FromDiscord<reilly> On that note, I was just thinking: Using a for loop to print your char array may not play nice if things are asynchronous or multithreaded.
22:52:31FromDiscord<reilly> Granted, depending on the size of your array, it should finish so fast that the odds of your echo getting interrupted are tiny, but it's not impossible.
22:53:14FromDiscord<reilly> I don't know how nice `getch()` plays with threads... I'd just create a little test file to see what happens if I were you.
22:53:47*abm quit (Read error: Connection reset by peer)
22:57:57Zoom[m]I don't know. I'd like it to not screw the layout on an occasion, since I actually echo only when the buffer with the data changes, to not burn the cycles
22:58:36Zoom[m]But seems it works even with the loop for now. I don't trust it, though.
23:55:41*noeontheend joined #nim
23:57:47*evan joined #nim
23:58:11*evan is now known as Guest41628
23:59:23ForumUpdaterBotNew thread by Fire: Is it possible to get a linux distro to include Nim?, see https://forum.nim-lang.org/t/8007
23:59:37*Guest41628 left #nim (#nim)