00:00:10 | rayman22201 | ryukoposting, how are you doing the codegen now? are you using the compiler api or just handwritten generator? I've been silently watching with great curiosity lol. |
00:06:26 | ryukoposting | handwritten generator now. There's just a lot of packaging issues that would arise from doing it all with macros |
00:06:44 | ryukoposting | it most certainly can be done though, and surprisingly fast when the devel compiler cooperates lol |
00:07:19 | ryukoposting | sadly, AWS is just too large for it to handle, and distributing the JSON spec files with any degree of portability would be a mess |
00:08:22 | * | solitudesf quit (Ping timeout: 245 seconds) |
00:09:11 | ryukoposting | however, the new codegen approach is going great. I'm using ec2 and s3 as my guinea pig APIs to test things. codegen's output is (mostly) NEP-1 compliant, includes a ton of doc comments too |
00:10:21 | ryukoposting | ec2 is enormously complicated and the output code is about 33,000 lines, but it still compiles in under 4 seconds |
00:14:08 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
00:14:30 | ryukoposting | I'm a complete newbie when it comes to AWS, thankfully I've got a very experienced person working with me on this thing |
00:17:17 | rayman22201 | I'm familiar with the AWS api shenanigans. I think it's a cool project. |
00:18:06 | ryukoposting | holy moly dude, their API is a mess |
00:18:32 | ryukoposting | even their spec makes it pretty clear that the entire thing is based on some kind of enormous Java hackjob |
00:19:25 | rayman22201 | oh gawd yeah.... I used to have huge discussions with the Amazon support people over this at a previous job. |
00:19:30 | rayman22201 | I've always been quite impressed with nims compile speed considering all it does. That's why Araqs incremental compilation project always seemed cool but unnecessary to me lol. I'm kind of glad that he decided to do destructors first. |
00:20:14 | ryukoposting | LaunchTemplateInstanceNetworkInterfaceSpecificationRequestList |
00:20:22 | * | rnrwashere joined #nim |
00:20:23 | ryukoposting | this is an actual type in the output codegen |
00:20:41 | ryukoposting | thankfully, users will never have to actually type that abomination out |
00:20:46 | rayman22201 | lol |
00:21:24 | rayman22201 | Neither do they... Eclipse autocomplete does it for them.... *vomit* |
00:21:39 | * | ryukoposting pukes |
00:22:54 | ryukoposting | I have strayed so far from that kind of workflow, I don't even know what I'd do if I had to use eclipse or something like it |
00:23:42 | rayman22201 | The really have no incentive to fix it either. People will still keep using AWS |
00:23:53 | rayman22201 | hey, it creates an opportunity for you :-P |
00:25:04 | ryukoposting | any change they make to that API has the potential to knock out half the WWW, I can hardly blame them |
00:26:37 | rayman22201 | monopoly power at work :-P |
00:26:58 | * | leorize joined #nim |
00:27:09 | ryukoposting | there's not a lot of companies who can use that as an excuse lol |
00:27:27 | ryukoposting | "if we change this, half the internet goes down for at least a week or two" |
00:27:29 | * | chimez joined #nim |
00:27:52 | * | chimez quit (Client Quit) |
00:29:02 | rayman22201 | lol. meh |
00:29:26 | rayman22201 | The only sad part about handwritten codegen to me is the "stringification" of types that happens. It has to typecheck eventually, when you use the generated code, but there is that in-between place, where you have generated source code that could be complete garbage and you have no real way to check it. |
00:29:52 | ryukoposting | yeah, that's the challenge |
00:30:49 | ryukoposting | my approach to it is to manipulate the data as little as possible, just spit out procs that all call a single common one that does the real heavy lifting |
00:32:50 | rayman22201 | That's a very lisp way to go about it. Not a half bad plan :-P |
00:34:52 | * | couven92 quit (Ping timeout: 246 seconds) |
00:37:42 | rayman22201 | The reason I asked about the compiler api, is that in theory, you could do something that acts like you are writing macros (as in you are generating a nim AST), but it generates nim source code as the end result (at runtime). |
00:39:16 | rayman22201 | The compiler api is this super under-documented thing that lets you use the compiler itself as a library. I think it's a cool idea and I have all this interesting ideas about it, but I haven't had time to really play with it all. |
00:40:25 | rayman22201 | idk if that made any sense. I'm rambling. You are doing cool stuff ryukoposting, carry on :-P |
00:40:28 | * | abm quit (Ping timeout: 246 seconds) |
00:41:02 | ryukoposting | wat |
00:41:08 | ryukoposting | I didn't know that was even a thing |
00:41:08 | rayman22201 | hahahaha |
00:41:11 | ryukoposting | that's neat |
00:41:51 | rayman22201 | This is the only docs for it: https://github.com/nim-lang/Nim/tree/devel/tests/compilerapi |
00:43:00 | ryukoposting | myscript.nim |
00:43:54 | rayman22201 | I use the term "docs" loosely lol |
00:44:26 | * | theelous3_ quit (Ping timeout: 268 seconds) |
00:44:56 | ryukoposting | lmao |
00:45:01 | ryukoposting | interesting nonetheless |
00:46:26 | rayman22201 | yup.... |
00:54:16 | * | stefanos82 quit (Remote host closed the connection) |
00:59:55 | * | rnrwashere quit (Remote host closed the connection) |
01:01:10 | * | rnrwashere joined #nim |
01:01:34 | rayman22201 | it also lets you use the nim vm as a scripting language, but that's so much more boring lol :-P |
01:13:14 | * | rnrwashere quit (Remote host closed the connection) |
01:13:37 | * | rnrwashere joined #nim |
01:56:48 | * | lritter quit (Ping timeout: 244 seconds) |
02:14:23 | * | rnrwashere quit (Remote host closed the connection) |
02:16:11 | * | rnrwashere joined #nim |
02:17:09 | * | vlad1777d quit (Remote host closed the connection) |
02:18:07 | * | vlad1777d joined #nim |
02:18:55 | * | rnrwashere quit (Remote host closed the connection) |
02:22:37 | * | rnrwashere joined #nim |
02:28:13 | * | rnrwashere quit (Remote host closed the connection) |
02:29:21 | * | vlad1777d quit (Ping timeout: 244 seconds) |
02:29:39 | * | rnrwashere joined #nim |
02:35:59 | * | rnrwashere quit (Remote host closed the connection) |
02:37:24 | * | rnrwashere joined #nim |
02:38:51 | * | rnrwashere quit (Remote host closed the connection) |
02:42:52 | * | rnrwashere joined #nim |
02:47:10 | * | rnrwashere quit (Ping timeout: 252 seconds) |
02:55:48 | * | dddddd quit (Read error: Connection reset by peer) |
03:05:54 | * | banc quit (Quit: Bye) |
03:26:42 | * | banc joined #nim |
03:47:42 | * | shashlick joined #nim |
04:17:44 | * | chemist69 quit (Ping timeout: 252 seconds) |
04:19:44 | * | chemist69 joined #nim |
04:24:12 | * | nsf joined #nim |
04:25:15 | FromGitter | <kayabaNerve> I found... something |
04:25:18 | FromGitter | <kayabaNerve> I ran the Nim compiler |
04:25:29 | FromGitter | <kayabaNerve> And it crashed |
04:25:31 | FromGitter | <kayabaNerve> With no error |
04:26:20 | FromGitter | <kayabaNerve> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c9463ec5547f77448454017] |
04:28:47 | FromGitter | <kayabaNerve> I forgot how to debug these |
04:31:33 | * | msmorgan quit (Ping timeout: 250 seconds) |
04:33:17 | * | zielmicha__ quit (Ping timeout: 250 seconds) |
04:33:17 | * | nimblepoultry quit (Ping timeout: 250 seconds) |
04:33:45 | * | enigmeta quit (Ping timeout: 268 seconds) |
04:33:58 | * | enigmeta joined #nim |
04:35:00 | FromGitter | <Varriount> @kayabaNerve run a debug version of the compiler |
04:35:07 | * | uptime quit (Ping timeout: 240 seconds) |
04:35:17 | FromGitter | <Varriount> One that wasn't built with -d:release |
04:36:07 | FromGitter | <Varriount> Alternately, build with `-d:release --stacktrace:on --linetrace:on` |
04:36:09 | * | nimblepoultry joined #nim |
04:37:21 | * | lritter joined #nim |
04:37:51 | FromGitter | <kayabaNerve> I did try verbosity three, but that didn't do much. The last file is a new file, but I do anything... hyper-quirky. The last bits mentioned in verbosity 3 are in a different file, which while related to the new file, compiled fine previously. |
04:38:14 | FromGitter | <kayabaNerve> I currently build the project as debug with stack and linetrace on |
04:38:42 | * | zielmicha__ joined #nim |
04:38:43 | * | Senketsu quit (Quit: WeeChat 2.4) |
04:38:54 | * | msmorgan joined #nim |
04:39:02 | FromGitter | <kayabaNerve> As for a debug version of the compiler, if I'm Ubuntu using choosenim, what's the best way to grab one? |
04:41:28 | FromGitter | <kayabaNerve> No difference under release. |
04:42:29 | FromGitter | <kayabaNerve> Looks like I have to build a debug compiler... |
04:42:54 | FromGitter | <kayabaNerve> Grabbing devel first to see if this was already fixed. |
04:46:02 | * | uptime joined #nim |
04:47:18 | * | lritter quit (Ping timeout: 244 seconds) |
04:55:39 | * | noeontheend quit (Read error: Connection reset by peer) |
04:56:48 | * | noeontheend joined #nim |
05:10:18 | * | I_Right_I quit (Remote host closed the connection) |
05:23:07 | * | leorize quit (Quit: WeeChat 2.3) |
05:53:16 | FromGitter | <kayabaNerve> Sorry for the delay; it didn't work on devel but devel debug at least gave me a... report. |
05:53:32 | FromGitter | <kayabaNerve> @Varriount Are you still available or did you head off? |
05:55:30 | FromGitter | <kayabaNerve> https://gist.github.com/kayabaNerve/4660b199c6ac133afdec52f10e1c1d21 |
06:01:03 | FromGitter | <kayabaNerve> Working on a MWE... |
06:01:23 | * | narimiran joined #nim |
06:24:12 | * | noeontheend quit (Ping timeout: 252 seconds) |
06:47:08 | FromGitter | <Varriount> @kayabaNerve I'm here |
06:47:20 | FromGitter | <Varriount> For at least another half hour |
06:47:51 | FromGitter | <kayabaNerve> I filed a bug report. |
06:47:54 | FromGitter | <kayabaNerve> It's messy as hell. |
06:47:59 | FromGitter | <kayabaNerve> https://github.com/nim-lang/Nim/issues/10884 |
06:48:34 | FromGitter | <kayabaNerve> It has to deal with chaining two funcs together in a default argument, but it's only a crash if it's right after a multi-type argument. |
06:48:42 | FromGitter | <kayabaNerve> I wish I was joking... |
06:55:17 | * | jjido joined #nim |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:04:46 | * | gmpreussner joined #nim |
07:07:19 | * | krux02 joined #nim |
07:16:05 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
07:20:47 | * | solitudesf joined #nim |
07:20:57 | * | jjido joined #nim |
07:34:36 | FromGitter | <Varriount> @kayabaNerve Wow. I can't recall the last time there was an infinite loop bug |
07:35:09 | FromGitter | <Varriount> I congratulate you on being able to reduce that down to a minimal example. |
07:38:20 | * | PMunch joined #nim |
07:50:52 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
07:57:51 | * | cyraxjoe quit (Ping timeout: 246 seconds) |
07:58:30 | * | cyraxjoe joined #nim |
08:01:44 | * | noeontheend joined #nim |
08:02:20 | FromGitter | <kayabaNerve> I haven't found any crashes like this for months. 0.19 has truly been a great release for stability. I've done some things which don't print a clean error, but it prints an error. |
08:03:20 | FromGitter | <kayabaNerve> Happy to have another badge of honor :P Thankfully, this was a test based on one of the lowest parts of my codebase, and not an actual part of it. |
08:04:14 | FromGitter | <kayabaNerve> That said, I have no idea how to fix it. I hope I've provided enough info/context around it that you don't have to spend too long figuring what the actual bug is. |
08:11:32 | Araq | I'm working on it |
08:17:40 | * | leorize joined #nim |
08:19:21 | * | solitudesf quit (Quit: Leaving) |
08:19:37 | * | solitudesf joined #nim |
08:20:07 | * | solitudesf quit (Remote host closed the connection) |
08:20:27 | * | solitudesf joined #nim |
08:20:59 | * | chimez joined #nim |
08:32:30 | FromGitter | <kayabaNerve> Oh sweet. I wasn't expecting a bug this specific/weird to be fixed for weeks. Thanks. |
08:33:09 | Araq | it's an embarrassing oversight |
08:33:26 | Araq | the compiler only checks for 'proc' in default arguments to prevent this endless recursion |
08:33:34 | Araq | and you wrote 'func' |
08:37:54 | FromGitter | <kayabaNerve> So would proc pad {.noSideEffect.} work? |
08:38:13 | Araq | the .noSideEffect is inferred for you anyway, but yes |
08:38:37 | Araq | interesting to see how popular 'func' has become |
08:38:37 | FromGitter | <kayabaNerve> Good to know. I'm building devel now to test it and then will close the issue. |
08:39:01 | Araq | the fix is not on devel, it's in a branch that is being tested |
08:39:08 | Araq | leave the closing to me please |
08:43:36 | FromGitter | <kayabaNerve> I realized; I moved over to your branch and it's finishing building now. |
08:43:40 | FromGitter | <kayabaNerve> Alrighty. |
08:44:06 | PMunch | Araq, yeah func is great :) I've been waiting for it ever since I read that it was a planned feature |
08:45:13 | FromGitter | <kayabaNerve> I use it everywhere possible. Better to have than not have, AND it will help me when I'm working on upgrades in the future. |
08:45:30 | FromGitter | <kayabaNerve> I can swap out any func function with one that generates the same output from the same input... |
08:45:50 | FromGitter | <kayabaNerve> I mean, sure, I can write procs like that, but the Nim's compiler badge of... sameness is great |
08:46:46 | PMunch | The nice thing about func is that you make it explicit that it should be a function and not a procedure. If I want to change your code I need to make sure that this holds |
08:47:03 | PMunch | It's such a subtle thing, but really nice to have |
08:49:31 | FromGitter | <kayabaNerve> My main annoyance is echo |
08:49:47 | narimiran | there's `debugEcho` |
08:49:53 | FromGitter | <kayabaNerve> Part of me feels func should automatically replace all `echo` with `debugEcho` |
08:50:10 | * | chimez quit (Quit: chimez) |
08:50:10 | FromGitter | <kayabaNerve> I know. I just don't like forgetting I can't use echo, failing to compile, and then going back. |
08:50:29 | FromGitter | <kayabaNerve> My project is 7k lines. |
08:50:44 | FromGitter | <kayabaNerve> Not the worst, of course, but there's a noticeable compilation time. |
08:53:44 | FromGitter | <kayabaNerve> Araq Works for me. Thank you |
08:55:11 | * | abm joined #nim |
09:33:15 | * | dddddd joined #nim |
09:54:14 | * | shashlick_ joined #nim |
09:54:33 | Araq | yeah, IMO 'echo' should be noSideEffect |
09:54:42 | * | shashlick quit (Ping timeout: 252 seconds) |
09:55:56 | * | shashlick_ quit (Remote host closed the connection) |
10:02:33 | FromGitter | <mratsim> so stdout is not a side-effect? |
10:03:05 | PMunch | Yeah that's not right |
10:03:58 | FromGitter | <mratsim> I think that's exactly the kind of bug the compiler should catch |
10:04:28 | FromGitter | <mratsim> same vein as cast and unsafeAddr, make the opt out explicit |
10:05:41 | Araq | 'echo' is special. |
10:06:07 | Araq | echo doesn't touch 'stdout', that's an implementation detail, on JS it outputs to the browser's console |
10:07:28 | FromGitter | <mratsim> seems like high priority to me: https://github.com/nim-lang/Nim/issues/10886 |
10:07:43 | narimiran | i was about to post it here |
10:07:44 | FromGitter | <mratsim> I certainly don't want to hunt this kind of bugs |
10:08:52 | narimiran | don't know if you saw my edit? `result = result or false` works |
10:09:28 | Araq | debugEcho vs echo is simply sophistry, 'echo' is what everybody likes for debugging |
10:09:52 | Araq | but whatever, I'm not gonna change it |
10:10:52 | FromGitter | <mratsim> yeah I saw miran |
10:11:27 | PMunch | Araq, well a terminal utility would use "echo" as its main output. |
10:12:31 | Araq | a terminal utility should use stdout.write() |
10:19:30 | Calinou | there's also styledWriteLine so using stdout.write() for non-colored lines makes sense |
10:25:30 | narimiran | mratsim: `result = true and result` is also wrong |
10:25:46 | Araq | fix it |
10:26:32 | Araq | it's not hard, in the vmgen for mOr and mAnd you need to enforce a temp and move the temp to 'dest' after the evaluation |
10:26:57 | narimiran | ok |
10:27:02 | Araq | the C codegen used to have exactly the same bug :-) |
10:27:13 | Araq | it's the number one codegen bug in Nim. |
10:28:27 | Araq | because the codegens are overly aggressive and ignore aliasing problems :P |
10:32:33 | * | rnrwashere joined #nim |
10:34:16 | FromGitter | <mratsim> I would love if GCC and CLang were a bit more aggressive and I didn't have to decorate my pointers with restrict everywhere on the other hand ;) |
10:34:49 | Araq | how do you get this annotation with Nim? |
10:35:02 | Araq | it needs codegen support IMO |
10:35:33 | FromGitter | <mratsim> https://github.com/numforge/laser/blob/master/laser/compiler_optim_hints.nim#L23-L26 |
10:35:48 | FromGitter | <mratsim> I can't use it for function parameters but I can use it for variables |
10:36:38 | Araq | that sucks, we need restrict support |
10:36:47 | FromGitter | <mratsim> and then I use it like this: https://github.com/numforge/laser/blob/e0eaf2e7f6e10756156e7bec6afd6cbc06ab19b3/benchmarks/transpose/transpose_bench.nim#L84-L89 |
10:37:12 | * | rnrwashere quit (Ping timeout: 252 seconds) |
10:37:38 | FromGitter | <mratsim> well restrict is pointer only, and we want to make sure that we only need those in very specific cases |
10:37:38 | Araq | we have aliasing rules in Nim btw, in the compiler |
10:38:44 | Araq | proc foo(x: var openArray[int]; y: openArray[int]) # x can be 'restrict'. Why? Because we need to have aliasing control at the callsite anyway in order to prove programs correct |
10:43:06 | FromGitter | <mratsim> btw, would you be open to an overload of `||`: https://nim-lang.org/docs/system.html#||.i%2CS%2CT%2Cstring with a "step" parameter? ⏎ ⏎ Currently I have to revert to C if I want to do loop tiling/blocking: https://github.com/numforge/laser/blob/e0eaf2e7f6e10756156e7bec6afd6cbc06ab19b3/laser/primitives/swapaxes.nim#L48-L49 |
10:43:36 | Araq | yup, please add it |
10:44:26 | FromGitter | <mratsim> or do a division first and recompute the index: https://github.com/numforge/laser/blob/master/laser/primitives/matrix_multiplication/gemm.nim#L164-L168 |
10:52:02 | * | ng0 joined #nim |
10:52:29 | * | stefanos82 joined #nim |
10:59:14 | * | enigmeta quit (Ping timeout: 252 seconds) |
10:59:26 | * | enigmeta joined #nim |
10:59:58 | * | zielmicha__ quit (Ping timeout: 252 seconds) |
10:59:58 | * | nimblepoultry quit (Ping timeout: 252 seconds) |
11:00:17 | * | zielmicha__ joined #nim |
11:00:20 | * | msmorgan quit (Ping timeout: 252 seconds) |
11:00:56 | * | nimblepoultry joined #nim |
11:03:21 | * | msmorgan joined #nim |
11:08:13 | * | seni quit (Quit: Leaving) |
11:16:13 | * | couven92 joined #nim |
11:32:28 | * | seni joined #nim |
12:04:52 | * | vlad1777d joined #nim |
12:07:13 | * | MD87_ joined #nim |
12:08:59 | * | a_chou joined #nim |
12:09:08 | * | a_chou quit (Client Quit) |
12:10:57 | * | MD87 quit (Disconnected by services) |
12:10:58 | * | MD87_ is now known as MD87 |
12:14:33 | * | zielmicha[m] quit (*.net *.split) |
12:14:33 | * | TheManiac[m] quit (*.net *.split) |
12:14:33 | * | junk[m] quit (*.net *.split) |
12:14:34 | * | GitterIntegratio quit (*.net *.split) |
12:22:41 | * | GitterIntegratio joined #nim |
12:22:47 | * | zielmicha[m] joined #nim |
12:22:48 | * | junk[m] joined #nim |
12:22:51 | * | TheManiac[m] joined #nim |
12:24:48 | FromGitter | <kayabaNerve> I was trying to rename an Exception |
12:25:21 | FromGitter | <kayabaNerve> ```code paste, see link``` ⏎ ⏎ Neither B, C, or D work with newException(). Is this my fault or no? [https://gitter.im/nim-lang/Nim?at=5c94d4313dd8171149322937] |
12:40:51 | * | neceve joined #nim |
12:42:12 | Araq | sounds like a compiler bug |
13:02:18 | FromGitter | <kayabaNerve> I assumed B would work, but figured it may be D due to the language spec. |
13:02:28 | FromGitter | <kayabaNerve> I'll create an issue |
13:02:32 | Araq | ty |
13:03:07 | FromGitter | <kayabaNerve> Happy to help. It makes life better for all of us ;) |
13:03:19 | FromGitter | <kayabaNerve> Well. I mean you do have one more thing to fix... |
13:03:55 | Araq | wait |
13:03:57 | Araq | raised object of type $1 does not inherit from Exception |
13:04:04 | Araq | is an intended error |
13:04:10 | Araq | what is your error message? |
13:05:31 | FromGitter | <kayabaNerve> `A.nim(6, 1) Error: only a 'ref object' can be raised` |
13:05:34 | FromGitter | <kayabaNerve> I'm on stable. |
13:05:48 | Araq | well that's correct |
13:06:08 | FromGitter | <kayabaNerve> I get your error when I switch to devel. |
13:06:29 | FromGitter | <kayabaNerve> If I define B = A, shouldn't B = ref object of Exception? |
13:07:17 | Araq | yes that's a type alias |
13:07:23 | Araq | type aliases should be allowed |
13:07:58 | FromGitter | <kayabaNerve> So I should create an issue for B? |
13:10:00 | Araq | yes |
13:10:38 | FromGitter | <alehander42> if i |
13:10:41 | FromGitter | <alehander42> compile A |
13:10:51 | FromGitter | <alehander42> and i have nim.cfg path:".." in B/ |
13:11:00 | FromGitter | <alehander42> and B/C.nim imports A |
13:11:04 | FromGitter | <alehander42> should this work? |
13:11:16 | FromGitter | <alehander42> (it's /A.nim /B/C.nim) |
13:11:55 | FromGitter | <alehander42> basically A.nim imports B/C.nim and B/C imports A_sibling (which is in the root dir) |
13:13:00 | FromGitter | <alehander42> hm it seems it works only if i compile B/C |
13:13:20 | FromGitter | <kayabaNerve> Done |
13:15:51 | Araq | the config system doesn't care about configs not part of the project.nim file |
13:20:04 | FromGitter | <alehander42> about .cfg? |
13:22:04 | Araq | if you have module.nim and module.nim.cfg and then main.nim and you compile 'nim c main.nim' |
13:22:13 | Araq | and main.nim imports module.nim |
13:22:21 | FromGitter | <alehander42> ah so i just need a nim.cfg in the root folder |
13:22:22 | Araq | then module.nim.cfg is NOT used. |
13:22:41 | FromGitter | <alehander42> but what can i do there ? path:"." ? |
13:22:50 | FromGitter | <alehander42> would this make child folders import parent files |
13:23:17 | Araq | it would add the current working directory to your --path |
13:23:52 | Araq | in general you're much better off with import ".." / [foo, bar, baz] and no config whatsoever |
13:23:56 | FromGitter | <alehander42> awesome thanks |
13:24:01 | FromGitter | <alehander42> well i am autogenerating nim code |
13:24:03 | FromGitter | <alehander42> so this would be hard |
13:24:28 | FromGitter | <alehander42> i mean it can work, but it's ok this way |
13:27:43 | Araq | nim c src/foo.nim vs cd src && nim c foo.nim |
13:28:11 | Araq | both should work IMO, with '.' in your --path you break this |
13:28:48 | * | sealmove joined #nim |
13:29:03 | Araq | it's better to not use --path, less complexity |
13:29:51 | FromGitter | <alehander42> yeah but in this case it doesn't make too much sense to be able to run the second one |
13:30:31 | FromGitter | <alehander42> in principle i like the ability to refactor: you can move a component or a directory without changing the import paths |
13:31:23 | Araq | I disagree, if you want to ignore the subdirs in your import statement, why even have them |
13:32:28 | FromGitter | <alehander42> well, you can have different kinds of modules |
13:32:31 | FromGitter | <alehander42> which you want to group |
13:32:37 | FromGitter | <alehander42> e.g. if i have 100 plugins |
13:32:40 | FromGitter | <alehander42> i dont want them all in my root |
13:32:46 | Araq | grouping is allowed in 'import' too |
13:33:27 | FromGitter | <alehander42> yes, but why would i want to have the ../ everywhere in the plugin import lines |
13:33:34 | FromGitter | <alehander42> and what happens if i decide to add subgrouping |
13:33:47 | FromGitter | <alehander42> e.g. plugins/a/ plugins/b/ |
13:33:51 | Araq | because it keeps you honest about your subdir structure |
13:34:31 | Araq | look, I know subdirs are super annoying. The solution is to not use them. The solution is not to pretend they are awesome and then ignore them. |
13:34:50 | FromGitter | <alehander42> you mean more than 1 nester dir |
13:35:12 | Araq | I mean directories. They are a productivity killer. |
13:35:19 | FromGitter | <alehander42> well eh |
13:35:32 | FromGitter | <alehander42> if you have 500 files, you need some kind of hierarchy |
13:35:33 | Araq | but I know nobody agrees with me, so whatever. |
13:35:41 | FromGitter | <alehander42> the stdlib also have it |
13:35:59 | FromGitter | <alehander42> i kinda agree with many nested dirs, but at least 1 level is ok |
13:36:27 | FromGitter | <alehander42> or if you have "swappable" parts, its convenient to be able to replace a folder and be good to go |
13:36:42 | FromGitter | <alehander42> e.g. themes/configs |
13:36:53 | Araq | the stdlib tries to not to piss off too many people. What I do in nim doesn't always reflect my personal opinions. |
13:37:55 | FromGitter | <alehander42> my perfect ide would have different "views", so one would be able to just have a single list of files and define different hierarchies |
13:38:15 | FromGitter | <alehander42> and one to use the view he wants |
13:38:25 | Araq | but what's the point of these hierarchies. it is nimsuggest/tests or tests/nimsuggest |
13:38:25 | FromGitter | <alehander42> i think this could be a cool compromise |
13:38:55 | FromGitter | <alehander42> well, you can have e.g. web apps with hierarchies based on components / on features / on something else |
13:39:05 | FromGitter | <alehander42> or just a flat list like you want |
13:39:08 | FromGitter | <alehander42> thats the point |
13:39:39 | FromGitter | <alehander42> and the import mechanism will be independent and just import flatly |
13:39:46 | Araq | ok. but everybody should want the flat list. |
13:40:04 | Araq | ;-) |
13:40:06 | solitudesf | true |
13:40:09 | FromGitter | <alehander42> but whats the point of having images, css files and nim files all in one list :) |
13:40:50 | Araq | I press control+P, type in 'tester.nim' and pick the wrong one because we have 4 of these |
13:41:09 | FromGitter | <alehander42> well now you'd just move the directory name in the filename |
13:41:15 | FromGitter | <alehander42> this is like E_F instead of E::F |
13:41:21 | * | rnrwashere joined #nim |
13:41:33 | Araq | yes, it's "Just a move", but it helps in practice |
13:42:03 | FromGitter | <alehander42> it depends |
13:42:07 | FromGitter | <alehander42> but in my case i still disagree |
13:42:15 | FromGitter | <alehander42> i have a dir with e.g. 100 plugins |
13:42:19 | FromGitter | <alehander42> i dont want it to pollute the root |
13:43:07 | FromGitter | <liquid600pgm> is there any way of debugging segfaults on -d:release? |
13:43:39 | FromGitter | <mratsim> Anyone with better links to explain how to start with nim macros? https://www.reddit.com/r/programming/comments/b38o8c/lisp_macros_delayed_evaluation_and_the_evolution/ej0glml?utm_source=share&utm_medium=web2x |
13:44:06 | FromGitter | <alehander42> btw i wanted to ask: how optimized are single dispatch methods |
13:44:07 | FromGitter | <mratsim> @lqdev import segfaults and also do not turn stacktraces off |
13:44:25 | Araq | liquid600pgm: compile with --debugger:native and run it in gdb |
13:44:35 | narimiran | mratsim i don't see the macro tutorial there: https://nim-lang.github.io/Nim/tut3.html |
13:44:36 | FromGitter | <alehander42> i feel that in some cases they should be as cheap as normal calls, but maybe i am missing something: i wonder about the case when |
13:44:39 | Araq | debuginfo is independent of -d:release |
13:44:52 | FromGitter | <alehander42> hm, i should be wrong |
13:44:56 | FromGitter | <mratsim> @alehander42: fast and slow :P. In the ideal case they are only 3x more expensive than proc calls |
13:45:15 | FromGitter | <alehander42> i have the case where i have many types that are final |
13:45:17 | FromGitter | <mratsim> but when you have inherited objects of inherited objects it's slow |
13:45:27 | FromGitter | <alehander42> so i think that if the compiler knows |
13:45:40 | Araq | if you don't override them there is no overhead but usually you use method because you wanna override them |
13:45:46 | FromGitter | <mratsim> For example: only 3x slower than proc: https://github.com/mratsim/Arraymancer/blob/master/benchmarks/implementation/proc_method_closure_bench.nim |
13:45:51 | * | rnrwashere quit (Ping timeout: 252 seconds) |
13:45:52 | FromGitter | <alehander42> yeah i wonder about when |
13:45:54 | * | cgfuh joined #nim |
13:45:57 | FromGitter | <alehander42> a and b are both overriden |
13:46:06 | FromGitter | <alehander42> and child a calls child b |
13:46:27 | FromGitter | <mratsim> and super slow methods for VM dispatch: https://github.com/status-im/nimbus/wiki/Interpreter-optimization-resources#nim-implementation-benchmark |
13:46:29 | FromGitter | <alehander42> if the compiler knows they're final, so it's exactly Child#b |
13:46:46 | FromGitter | <alehander42> would this help to skip a step |
13:47:04 | Araq | usually .final really helps, yes |
13:47:25 | FromGitter | <alehander42> huh, so we already have final |
13:47:40 | Araq | it refers to object types, not to methods |
13:47:50 | FromGitter | <alehander42> yes |
13:48:49 | FromGitter | <alehander42> so in this case is a direct call generated? |
13:48:52 | FromGitter | <alehander42> i can look at the code |
13:49:12 | FromGitter | <mratsim> it creates a proc with a tree of if |
13:49:28 | FromGitter | <mratsim> you can inline your methods in that tree if you want |
13:49:30 | FromGitter | <alehander42> thanks for the links @mratsim |
13:49:44 | Araq | the 'tree of ifs' can be empty |
13:49:56 | FromGitter | <alehander42> yes, but i wondered if this is optimized for the final calling the same final |
13:50:09 | Araq | I don't remember, probably not |
13:50:28 | * | Senketsu joined #nim |
13:53:18 | FromGitter | <alehander42> final => parent its the same right |
13:53:24 | FromGitter | <alehander42> yeah it makes sense |
13:57:33 | * | sz0 joined #nim |
14:02:06 | FromGitter | <liquid600pgm> Araq: how could a segfault occur within a thread? |
14:02:32 | FromGitter | <liquid600pgm> I'm not trying to access any GC'd memory, just doing some computations and sending the results through a Channel |
14:05:25 | FromGitter | <liquid600pgm> it seems my program runs so fast under `-d:release` some kind of race condition (?) occurs and the GC tries to deallocate some memory that's already deallocated |
14:07:08 | FromGitter | <liquid600pgm> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c94ec0b8126720abc25c289] |
14:10:23 | FromGitter | <liquid600pgm> I'm using the low-level API by the way, as I'm writing a benchmark and need full control over the threads' affinities |
14:11:47 | Araq | maybe you use the low level API incorrectly? |
14:12:30 | FromGitter | <liquid600pgm> is there a tutorial covering it? I couldn't find that much info in Nim's docs |
14:13:28 | Araq | don't use ptr/cast/addr and then it's safe |
14:14:03 | Araq | oh and use Thread and Channel only as global variables |
14:14:47 | FromGitter | <alehander42> hm so there is one redirect with finals |
14:14:56 | FromGitter | <liquid600pgm> so I can't create a `Thread` in a proc, and then receive events from the thread in that proc? |
14:16:36 | FromGitter | <alehander42> so yeah its not optimized: but i dont know how hard would it be |
14:16:53 | FromGitter | <alehander42> but this is not last devel (but i guess this hasnt changed) |
14:17:17 | FromGitter | <liquid600pgm> making threads globals fixed the problem, thanks |
14:19:15 | Araq | threads are too heavy to allocate in a proc anyway |
14:27:50 | sealmove | guys, simple question: when I pass a `typed` symbol in a macro, how do I get the symbol's identifier and type? |
14:32:37 | FromGitter | <alehander42> hm how is untyped working with class types Araq |
14:32:44 | FromGitter | <alehander42> it seems if i have a template |
14:32:50 | FromGitter | <alehander42> and i pass a child type |
14:32:57 | FromGitter | <alehander42> nim automatically does ->Sup it |
14:33:01 | FromGitter | <alehander42> to pass the parent |
14:33:09 | FromGitter | <alehander42> i am not sure why |
14:33:48 | Araq | because C lacks inheritance? |
14:34:02 | Araq | sealmove: macro.getType, getTypeInst, getTypeImpl |
14:34:12 | Araq | macros.getType, getTypeInst, getTypeImpl |
14:34:37 | sealmove | I saw these, but documentation doesn't explain what exactly they return |
14:34:51 | FromGitter | <alehander42> hm then would generics work |
14:35:24 | sealmove | if you pass a `x: int` then getType gives you `int` and getTypeInst gives you `x`? |
14:37:34 | Araq | in what world is 'x: int' a type? |
14:37:49 | Araq | looks like a declaration with a type part to me. |
14:38:31 | sealmove | but I need both the type and the symbol `x`, seperately |
14:39:03 | FromGitter | <alehander42> but then this seems to happen with method calls too |
14:39:11 | sealmove | so these 3 procs are for retrieving the type, what about the identifier? |
14:39:41 | FromGitter | <alehander42> ahh this is because of alias |
14:39:48 | FromGitter | <alehander42> so basically if i have A = B |
14:39:54 | FromGitter | <alehander42> and i override with A instead of B |
14:39:58 | Araq | sealmove: the identifier is not part of the type |
14:39:59 | FromGitter | <alehander42> it seems nim doesnt recognize this |
14:40:02 | FromGitter | <alehander42> is this a bug Araq? |
14:40:04 | FromGitter | <alehander42> or intended |
14:40:28 | sealmove | ohh, so if you pass `typed` then you lose that info? |
14:40:32 | Araq | type aliases shouldn't influence method bindings |
14:40:48 | Araq | how can you even pass 'x: int' to a 'typed' macro? |
14:41:09 | Araq | it doesn't type check. |
14:41:21 | Araq | (undeclared identifier: 'x' ) |
14:43:28 | FromGitter | <alehander42> yeah Araq i was wrong, my macro was doing another thing |
14:44:04 | sealmove | hmm, https://termbin.com/pu1x |
14:45:53 | sealmove | is there a way to pass both the identifier's name and the type to a macro? but user is only required to write the identifier? |
14:48:34 | Araq | mymacro(identifier, typeHere) |
14:49:01 | Araq | mymacro: identifier: typeHere # requires a staging approach |
14:52:18 | * | lritter joined #nim |
14:52:34 | * | Vladar joined #nim |
14:54:31 | * | PMunch quit (Remote host closed the connection) |
14:56:18 | FromGitter | <arnetheduck> what's the latest on pattern matching in nim? I remember someone was playing with some macros for that? |
14:57:26 | * | stefanos82 quit (Remote host closed the connection) |
14:58:41 | FromGitter | <alehander42> i have a lib called gara |
14:58:48 | FromGitter | <alehander42> but i dont know if anybody uses it |
15:00:00 | FromGitter | <alehander42> https://github.com/alehander42/gara |
15:00:07 | FromGitter | <alehander42> it should be extendable |
15:00:20 | FromGitter | <alehander42> but its still not stable |
15:01:27 | FromGitter | <alehander42> @krux02's ast_pattern_matching is the one for macros and andreaferretti's patty is also general purpose(but we planned to combine our efforts with him maybe) |
15:02:22 | FromGitter | <arnetheduck> mm.. I'm looking for something where I can match over object variants (ie objects with `case kind` in them), and pick out the fields conditionally |
15:02:43 | FromGitter | <alehander42> for what |
15:02:50 | FromGitter | <alehander42> yes, this should be possible |
15:03:14 | FromGitter | <alehander42> variant objects are one of the main usecases: but maybe its not very optimized yet(it doesnt generate a `case`) |
15:03:37 | * | arecacea1 quit (Remote host closed the connection) |
15:03:56 | * | arecacea1 joined #nim |
15:07:56 | FromGitter | <arnetheduck> for example: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ doing it this way, the construct *should* be guaranteed to never trigger FieldError or whatever it's called, so in the generated code there should be no exceptions / cost.. and ideally, it would also report any cases that were not covered [https://gitter.im/nim-lang/Nim?at=5c94fa4c6a3d2e230d090203] |
15:08:37 | FromGitter | <arnetheduck> (syntax doesn't matter, just typing out an example) |
15:09:48 | FromGitter | <alehander42> the first part should be possible now |
15:10:01 | FromGitter | <alehander42> the second part isnt happening yet |
15:10:17 | Araq | there is also nim c --warning:ProveField:on temp4.nim |
15:10:20 | FromGitter | <alehander42> (finding out if there are not-covered cases) |
15:10:34 | Araq | to enforce you got your case object fields right |
15:11:35 | FromGitter | <arnetheduck> oh, there's a field prover? what does it support? both case and if? |
15:11:39 | FromGitter | <alehander42> actually yeah, i dont think the lib checks for correct fields: it expects the generated code to eventually compiletime check |
15:11:56 | FromGitter | <alehander42> (the provefield thing) |
15:12:19 | Araq | arnetheduck: I don't remember, I think both |
15:12:37 | Araq | there is also a branch with a better prover somewhere |
15:12:51 | Araq | (yay, working with branches) |
15:14:54 | * | lf-araujo joined #nim |
15:15:21 | FromGitter | <arnetheduck> interesting. |
15:15:38 | Araq | and before you bring it up. Yes this ProveField:on should be the default and disabled for the compiler. |
15:16:59 | * | rnrwashere joined #nim |
15:27:10 | FromGitter | <arnetheduck> me? arguing for safe defaults and clean compiler code? where did you ever get that idea? :) |
15:30:52 | * | Trustable joined #nim |
15:37:30 | * | noeontheend quit (Ping timeout: 252 seconds) |
15:38:25 | Araq | maybe I confused you with arnetheturtle |
15:38:53 | FromGitter | <mratsim> > _> |
15:39:03 | * | krux02 quit (Remote host closed the connection) |
15:41:20 | * | krux02 joined #nim |
15:45:37 | sealmove | hahahaha |
15:46:32 | sealmove | (sorry, for some reason I laughed xD) |
15:58:12 | sealmove | Araq, I found the solution! passedArgument.repr |
15:58:53 | sealmove | so if I pass `x: int` as `typed`, x.repr gives me `x` and getType(x) give me `int` |
16:02:47 | sealmove | (I mean, pass `x` which is of type int) |
16:07:30 | FromGitter | <mratsim> but it will always give you x I think |
16:07:44 | FromGitter | <mratsim> or I missed something. |
16:08:24 | FromGitter | <mratsim> it's only with untyped that you can get the proper identifiers, with anything else you only get the new identifier associated for the template/macro call. |
16:08:37 | FromGitter | <mratsim> had this issue a lot with astToStr function |
16:10:52 | * | abm quit (Ping timeout: 245 seconds) |
16:12:44 | sealmove | mratsim: what do you mean "proper identifiers"? |
16:13:30 | sealmove | I only need it as string actually, don't need other metadata |
16:13:49 | sealmove | but still curious about what more you get with untyped |
16:14:48 | FromGitter | <mratsim> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c9509f7d0133e21e5f97a83] |
16:15:07 | FromGitter | <mratsim> and let me try with macros now |
16:15:40 | * | lf-araujo quit (Ping timeout: 250 seconds) |
16:16:22 | FromGitter | <mratsim> mmh seems you get a in both case. weird, I'm pretty sure I remember a case where I had the local identifier bound |
16:16:46 | FromGitter | <mratsim> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c950a6e3dd817114933bdd4] |
16:22:10 | sealmove | yeah, it works |
16:22:48 | sealmove | maybe you did astToStr instead of repr, in the macrto |
16:22:49 | sealmove | macro* |
16:23:29 | sealmove | dunno |
16:23:32 | FromGitter | <liquid600pgm> how do I add conditional flags to `nim.cfg`? more specifically, I want to create a `-d:windows` flag which makes Nim use the MinGW toolchain |
16:24:17 | * | gh0st[m] joined #nim |
16:24:28 | Araq | you write '-d:windows' in your nim.cfg |
16:25:00 | Araq | but keep in mind that the global nim.cfg is processed before your local nim.cfg and so doesn't pick up the -d:windows switch |
16:25:56 | FromGitter | <liquid600pgm> that's not what I want, I want nim.cfg to trigger some extra flags when I pass `-d:windows` to `nim c` |
16:26:41 | Araq | @if windows: ... |
16:26:53 | Araq | but it's probably better to define -d:mingw instead |
16:27:08 | FromGitter | <liquid600pgm> yeah, but I wanted that feature on stable |
16:29:01 | FromGitter | <mratsim> I think I have most of the nim.cfg magic in Arraymancer: https://github.com/mratsim/Arraymancer/blob/master/nim.cfg and laser: https://github.com/numforge/laser/blob/master/nim.cfg |
16:30:05 | FromGitter | <mratsim> but I need a way to have projects that use Arraymancer or laser inherits my nim.cfg @Araq, it would be very annoying for people to maintain my compile flags for say AVX, SSE and such |
16:30:50 | FromGitter | <mratsim> alternatively file specific passC or passL pragma would work |
16:31:27 | Araq | don't they work as pragmas? |
16:31:33 | Araq | {.passC: "".} |
16:31:53 | Araq | the config system is inferior to the pragma system for these reasons. |
16:33:04 | Araq | liquid600pgm @if inside nim.cfg is part of stable |
16:34:23 | FromGitter | <mratsim> the passC will apply to all files |
16:35:02 | FromGitter | <mratsim> I want certain files to have {.passC:"-mavx".} and others {.passC:"-mavx512".} |
16:53:03 | * | I_Right_I joined #nim |
17:05:10 | FromGitter | <liquid600pgm> Araq: I was talking about `-d:mingw`, which has been introduced in devel |
17:06:36 | FromGitter | <mratsim> you'll haave to wait for 1.0 like everyone :P |
17:06:57 | * | rnrwashere quit (Remote host closed the connection) |
17:10:18 | * | rnrwashere joined #nim |
17:14:09 | I_Right_I | anyone here have much experience using nim on Arduino? |
17:15:09 | ryukoposting | I don't, but there's some arduino nim stuff out there |
17:15:11 | ryukoposting | https://github.com/gokr/ardunimo |
17:15:25 | ryukoposting | https://gitlab.com/NetaLabTek/Arduimesp |
17:16:05 | ryukoposting | I think the project in the second link can be used to convert Nim code into arduino projects that you can run through the arduino IDE to deploy code |
17:18:57 | sealmove | not sure if intended but my macro is not expanded before `echo`'s arguments are checked. |
17:19:26 | sealmove | (I tried to use a macro as an expression) |
17:19:27 | * | rnrwashere quit (Remote host closed the connection) |
17:21:19 | * | rnrwashere joined #nim |
17:21:34 | I_Right_I | ryukoposting: thanks |
17:21:38 | I_Right_I | portability and easily meshing with c are some of the things that drew me to nim |
17:22:37 | I_Right_I | plus its nice to write a GC'd app where the binary is under 200k |
17:24:07 | FromGitter | <liquid600pgm> I just made a performance benchmark in Nim: https://github.com/liquid600pgm/pibench2 |
17:27:04 | BaldEagleX02 | @I_Right_I: I am writing a Nim library to use Arduino boards easily |
17:27:40 | BaldEagleX02 | (I am trying to wrap Arduino AVR Core libraries from C++ to Nim) |
17:35:26 | * | neceve quit (Read error: Connection reset by peer) |
17:36:04 | FromGitter | <mratsim> someone posted and arduino lib recently in the forum |
17:36:09 | FromGitter | <mratsim> an* |
17:37:55 | FromGitter | <mratsim> looks nice @lqdev |
17:38:31 | FromGitter | <mratsim> a nim progressbar package would super useful by the way |
17:39:23 | I_Right_I | baldEagleX02: :) awesome! I am just now getting my feet wet in nim, love it so far! And using to to write for Arduino I strongly look forward too! |
17:41:31 | * | abm joined #nim |
17:43:11 | * | fanta7531 joined #nim |
17:45:29 | I_Right_I | right now I am trying to write a library in nim similar to the enet library(UDP only). It uses thread pool and will hopefully be thread safe. |
17:45:59 | ryukoposting | hot |
17:46:29 | ryukoposting | best of luck, man. does arduino have actual threading? seems really heavy for an 8-bit uC |
17:47:12 | ryukoposting | I've made preemptive kernels for Cortex-M0 but I can't recall ever seeing anything like that for arduino |
17:47:13 | I_Right_I | oh not for ardunio |
17:47:17 | ryukoposting | ooooooh okay lol |
17:47:23 | ryukoposting | I was concerned |
17:47:24 | * | stefanos82 joined #nim |
17:50:00 | I_Right_I | but even a single threaded networking interface on arduino would be fun to play with. |
17:50:15 | * | Trustable quit (Remote host closed the connection) |
17:59:36 | xace | any recommedations for releasing binaries? atm i use nim c -d:release main.nim && strip main.exe # are there more things I can do? |
18:01:15 | I_Right_I | xace: maybe --opt:speed |
18:02:36 | solitudesf | opt:speed is implied with-d:release |
18:02:59 | * | rnrwashere quit (Remote host closed the connection) |
18:04:37 | xace | yeah my main concern was with things that shouldn't be in the final release of the executable, in this case if I don't `strip` the binary it leaves symbols that reveals information that shouldn't be presented to the end user |
18:05:28 | * | nsf quit (Quit: WeeChat 2.4) |
18:06:00 | I_Right_I | does nim have name mangling? |
18:06:06 | FromGitter | <liquid600pgm> yes |
18:07:54 | ryukoposting | there's a pragma that turns it off though |
18:08:05 | ryukoposting | and iirc, if you use the C++ backend, it just uses C++'s name mangling |
18:31:27 | sealmove | (for anyone interested) I published a macro I've been working on https://github.com/sealmove/ease |
18:31:30 | * | rnrwashere joined #nim |
18:32:25 | * | Cthalupa quit (Ping timeout: 244 seconds) |
18:32:48 | * | noeontheend joined #nim |
18:33:30 | * | Cthalupa joined #nim |
18:39:16 | * | rnrwashere quit (Remote host closed the connection) |
18:39:30 | * | sealmove quit (Quit: WeeChat 2.4) |
18:46:12 | * | sealmove joined #nim |
19:25:34 | sealmove | does n.expectKind(this|that) work? |
19:27:27 | FromDiscord | <Generic> expectKind has an overload which accepts a set |
19:27:50 | FromDiscord | <Generic> so you can use n.expectKind({nnkThis, nnkThat}) |
19:27:56 | sealmove | oh nice, thx |
19:28:18 | sealmove | didn't notice :| |
19:36:24 | * | theelous3_ joined #nim |
19:46:37 | * | rnrwashere joined #nim |
19:46:39 | * | rnrwashere quit (Remote host closed the connection) |
19:50:04 | * | sz0 quit (Quit: Connection closed for inactivity) |
19:59:29 | * | sealmove quit (Quit: WeeChat 2.4) |
20:07:26 | * | fanta7531 quit (Quit: fanta7531) |
20:11:15 | * | hoijui joined #nim |
20:30:29 | * | rnrwashere joined #nim |
20:33:39 | * | Vladar quit (Remote host closed the connection) |
20:34:56 | * | rnrwashere quit (Ping timeout: 250 seconds) |
20:41:42 | * | rnrwashere joined #nim |
20:43:18 | * | lf-araujo joined #nim |
20:43:25 | * | hoijui quit (Remote host closed the connection) |
20:46:04 | * | rnrwashere quit (Ping timeout: 250 seconds) |
20:47:52 | * | rnrwashere joined #nim |
20:49:19 | * | vegax87 quit (Changing host) |
20:49:19 | * | vegax87 joined #nim |
20:49:19 | * | vegax87 quit (Changing host) |
20:49:19 | * | vegax87 joined #nim |
20:58:11 | * | Trustable joined #nim |
21:02:17 | * | lf-araujo quit (Ping timeout: 250 seconds) |
21:03:39 | * | rnrwashere quit (Remote host closed the connection) |
21:03:40 | ryukoposting | hot take: save the new runtime for Nim 2.0 and keep the current GC |
21:14:01 | * | rnrwashere joined #nim |
21:14:33 | * | jxy quit (Quit: leaving) |
21:18:16 | * | vlad1777d quit (Ping timeout: 244 seconds) |
21:18:25 | * | rnrwashere quit (Ping timeout: 246 seconds) |
21:21:17 | Zevv | sealmove: I like anonymous, thanks |
21:21:41 | FromGitter | <iffy> I'm calling a C function that expects me to pass in a cstring, which it will write a string to. I know the length and am trying this: `var s = newStringOfCap(size + 1); napi_get_value_string_utf8(ign1, ign2, s[0].unsafeAddr, size)` but I get the error: Error: unhandled exception: index 0 not in 0 .. -1 [IndexError] |
21:22:12 | FromGitter | <iffy> oh brother; just use newString :) |
21:27:46 | * | rnrwashere joined #nim |
21:31:57 | * | rnrwashere quit (Ping timeout: 246 seconds) |
21:33:03 | * | jxy joined #nim |
21:48:43 | Araq | ryukoposting: why? |
21:49:03 | * | rnrwashere joined #nim |
21:51:09 | I_Right_I | so I found a bug, while using thread pools. iterating a 'for loop' on the main thread outside of a function(in global scope only) the 'for loop' exits early. I'll try to reproduce this with a proof case if this isn't a know issue. |
21:53:25 | * | rnrwashere quit (Ping timeout: 246 seconds) |
21:55:40 | Araq | nah, it's something else |
21:56:08 | Araq | but sure, report it. thread pools suck though and need to be rewritten |
21:57:52 | I_Right_I | Araq: I had seen you had a few comments on thread pool issues |
22:00:14 | I_Right_I | all i know is when i wrapped the code in a function I lost the bug. |
22:06:08 | * | jjido joined #nim |
22:06:54 | * | rnrwashere joined #nim |
22:09:11 | * | rnrwashere quit (Read error: Connection reset by peer) |
22:09:24 | * | rnrwashere joined #nim |
22:17:27 | * | Trustable quit (Remote host closed the connection) |
22:34:32 | federico3 | https://github.com/nim-lang/Nim/issues/5626 any hint on this threading/channel issue? |
22:37:10 | * | I_Right_I quit (Remote host closed the connection) |
22:53:06 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
22:53:58 | * | I_Right_I joined #nim |
23:01:36 | I_Right_I | Araq: To my sadness you are correct, Sir! Thread pools are as buggy as a rotted stump in the rain forest. |
23:05:07 | * | rnrwashere quit (Remote host closed the connection) |
23:05:21 | I_Right_I | I don't know how I got this thread pool based UDP socket library working at all! |
23:06:32 | Araq | I_Right_I: try yglokhov's threadpool package |
23:13:41 | federico3 | Araq: should people be warned not to use threadpool in the module docs? |
23:25:24 | * | solitudesf quit (Ping timeout: 252 seconds) |
23:26:24 | * | narimiran quit (Ping timeout: 244 seconds) |
23:44:24 | * | rnrwashere joined #nim |
23:48:38 | * | rnrwashere quit (Ping timeout: 250 seconds) |
23:58:22 | FromGitter | <mratsim> @lqdev used them successfully in his pibench though on my computer it's quite slow due to pthread_mutex_lock: https://forum.nim-lang.org/t/4732 |
23:58:37 | * | a_b_m joined #nim |