00:03:16 | disruptek | leorize: should testes have a secret "arc tests matter" option? |
00:17:33 | leorize | not sure, depends on how you want your testes to be |
00:18:27 | * | hmmm quit (Quit: WeeChat 3.0) |
00:19:54 | * | Jesin quit (Remote host closed the connection) |
00:20:04 | * | hmmm joined #nim |
00:20:07 | * | hmmm quit (Client Quit) |
00:21:09 | * | Jesin joined #nim |
00:23:46 | disruptek | i want them to reflect the goals of important_packages, but that's pointless while #16447 remains open. |
00:23:55 | disbot | https://github.com/nim-lang/Nim/issues/16447 -- 3testament fails for packages that require $NIMBLE_DIR/bin in PATH ; snippet at 12https://play.nim-lang.org/#ix=2LQ3 |
00:33:24 | leorize | disruptek: does `expect(exception)` let me access the exception? |
00:49:38 | disruptek | what? |
00:51:34 | disruptek | you use it to verify that an exception of the proper type is thrown and may be caught; if you want to catch it yourself, use a try/except block. |
00:51:53 | disruptek | you can reraise with `raise` if it helps. |
00:52:32 | leorize | I want to make sure that it's in the right format |
00:52:40 | leorize | the raise trick sounds like it would do |
01:18:51 | * | Tanger joined #nim |
01:42:44 | * | Prestige quit (Quit: Prestige) |
01:44:27 | * | Prestige joined #nim |
02:05:41 | * | lritter quit (Quit: Leaving) |
02:20:18 | disruptek | yeah, that should work. |
02:25:08 | leorize | disruptek: not sure if its testes or my tests... https://github.com/alaviss/nim-sys/runs/1692136925?check_suite_focus=true#step:7:16 |
02:27:46 | leorize | wdyt about making testes re-run failed -d:release tests with -d:release --stacktrace:on just to catch stuff like this |
02:28:32 | leorize | and the most stupid part of this is that only the release build crashes |
02:33:44 | disruptek | that /is/ pretty stupid. we already run a debug build to try to tease out answers to a release/danger crash. |
02:34:31 | disruptek | why not just use stacktrace:on for all release builds? performance metrics can be measured in danger, right? |
02:37:57 | leorize | > proceeds to generate even more bugs on -d:danger |
02:38:49 | disruptek | that error looks exactly like the bug i see sporadically with arc. |
02:38:55 | disruptek | but, only arc. |
02:40:20 | disruptek | maybe it /is/ testes. |
02:40:49 | leorize | I find it weird though |
02:41:19 | leorize | what kind of bug due to out-of-bound access would only show up on 32 bit Windows, of all things |
02:41:38 | disruptek | for me it was only macos 😆 |
02:41:59 | leorize | and it doesn't bug out when you do debug build |
02:42:05 | disruptek | at first it seemed like it was only cpp/arc. |
02:42:30 | disruptek | so there are some extra code paths for testes in release builds (as a library) because it does the timing stuff. |
02:42:39 | disruptek | should we just do those in danger only? |
02:44:50 | leorize | probably, if it can pass on release it should pass on danger, right? |
02:45:04 | disruptek | you might think so. |
02:45:20 | disruptek | maybe danger should omit testes' checks, too? |
02:45:51 | disruptek | another possibility is that it's a bug in jc's bytes2human thing. |
02:46:15 | leorize | not that we can find out without a windows computer |
02:46:29 | leorize | I'll borrow one later |
02:46:58 | disruptek | eh we can just force it, too. |
02:47:25 | disruptek | you know, any cli args you pass to testes get passed to the compiler. |
02:51:41 | disruptek | i don't ever reproduce these defects locally, either. |
02:52:06 | disruptek | not sure what that means. maybe it's not something that happens on linux. |
02:52:26 | leorize | pushed a commit that enable stacktrace |
02:52:35 | leorize | let's see what went wrong |
02:52:48 | disruptek | so, only timing numbers in danger, right? |
02:52:58 | disruptek | ima push a patch to testes. |
02:53:22 | disruptek | also this will let us weed out bytes2human from the problem. |
02:58:23 | disruptek | gah i should reimpl this bytes2human thing. 🤭 |
02:58:26 | leorize[m] | looks like stacktrace was the reason why the bug didn't show up... |
02:58:38 | disruptek | what is it? |
02:58:47 | leorize[m] | https://github.com/alaviss/nim-sys/actions/runs/481768307 |
02:58:51 | leorize[m] | I don't know |
02:59:07 | leorize[m] | it passed |
02:59:09 | disruptek | is that testes 1.1.2? |
02:59:41 | * | Tlangir joined #nim |
03:00:08 | leorize[m] | no that's 1.1.1 |
03:00:09 | disruptek | it's in repr. |
03:00:16 | disruptek | from testes. 🤦 |
03:00:24 | leorize[m] | https://github.com/alaviss/nim-sys/runs/1692434924?check_suite_focus=true#step:6:12 |
03:00:36 | * | Tanger quit (Ping timeout: 240 seconds) |
03:01:01 | leorize[m] | oh lol |
03:01:14 | disruptek | that is /so/ not the same IndexDefect though. |
03:02:08 | leorize[m] | you fixed it now? so I can try to re-run the branch |
03:02:59 | disruptek | 1.1.2 is just tweaked to have stacktrace on release and some other shit. |
03:03:08 | disruptek | do you have push on testes? |
03:03:38 | disruptek | sent invite. |
03:04:36 | FromDiscord | <shadow.> where's the best guide on ffi? starting from ground 0, but with some knowledge of c / c++ |
03:04:58 | FromDiscord | <shadow.> im guessing nim in action is a good place to start? |
03:05:08 | disruptek | dunno. |
03:05:25 | disruptek | i had to learn a thing to make an OBS module. |
03:05:48 | disruptek | by which i mean i had to ask araq about something. |
03:05:54 | disruptek | otherwise, i think i just rtfm. |
03:06:24 | disruptek | it's pretty damned easy, honestly. |
03:07:15 | disruptek | ~kaushalmodi |
03:07:16 | disbot | kaushalmodi: 11a badass coder with a wealth of useful Nim articles on his blog, at https://scripter.co/ -- disruptek |
03:07:33 | disruptek | probably has done some of the most complex ffi stuff. |
03:08:57 | disruptek | leorize: but is that your bug? that shows up on linux, too. |
03:22:11 | * | muffindrake quit (Ping timeout: 272 seconds) |
03:23:28 | * | muffindrake joined #nim |
03:34:33 | * | Tlanger joined #nim |
03:34:46 | * | adnan338 joined #nim |
03:36:28 | * | Tlanger is now known as Tanger |
03:36:31 | adnan338 | Hello I am parsing a large file. For convenience, I want to set the read cursor to update every time I call writeLine. For example, if I set up a stream from a file, if I call readLine once, next time when I call readLine, it should start from the second line. Is there any such API? |
03:37:00 | * | Tlangir quit (Ping timeout: 256 seconds) |
03:37:50 | FromDiscord | <shadow.> isnt that default |
03:38:16 | FromDiscord | <Rika> its what it should do yes |
03:38:19 | FromDiscord | <shadow.> for open(string, fmRead) or whatever |
03:38:28 | FromDiscord | <shadow.> then just .readLine() |
03:38:30 | FromDiscord | <ElegantBeef> yea `readline` will capture the next line until `\n` |
03:38:35 | FromDiscord | <shadow.> ye |
03:38:39 | FromDiscord | <ElegantBeef> Or a newline character |
03:38:48 | FromDiscord | <shadow.> prolly \p idk |
03:38:53 | adnan338 | https://nim-lang.org/docs/io.html#readLine%2CFile didn't seem to mention that. thank you. |
03:39:05 | FromDiscord | <shadow.> 👍 |
03:39:20 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
03:47:03 | * | abm quit (Read error: Connection reset by peer) |
04:08:05 | FromDiscord | <William_CTO> sent a code paste, see https://play.nim-lang.org/#ix=2LRd |
04:19:13 | adnan338 | Noticed that there's no parseInt64(). How do I go about parsing a string to int64? (instead of doing it manually) |
04:20:40 | * | sagax quit (Quit: Konversation terminated!) |
04:21:47 | FromDiscord | <Rika> parseBiggestInt |
04:22:12 | FromDiscord | <Rika> note that there isnt a parseInt32 either |
04:22:13 | * | spiderstew_ joined #nim |
04:23:01 | * | spiderstew quit (Ping timeout: 264 seconds) |
04:23:13 | disruptek | haxscramper: you up? |
04:24:56 | * | bacterio quit (Ping timeout: 240 seconds) |
04:47:01 | * | bacterio joined #nim |
04:48:05 | disruptek | haxscramper: anyway; a good reason to use nimph: i could install your package as a dependency (`nimph doctor`), roll it backwards to try an earlier version (`nimph downgrade`), look at the git history to see if there was any version that would work (cd `nimph path hmisc`; tig), `nimph fork` your repo, make my changes, push them, and use hub to open a PR from the cli. |
05:02:36 | * | bacterio quit (Ping timeout: 240 seconds) |
05:22:02 | * | bacterio joined #nim |
05:33:24 | * | WilhelmVonWeiner quit (K-Lined) |
05:42:50 | adnan338 | Hi, could anybody help me understand the error here? https://play.nim-lang.org/#ix=2LRt |
06:05:07 | saem | quick look, I think what's going on is that you created a var OrderedTable, then tried to assign it to a non var field |
06:05:15 | saem | rather it's not a gc tracked ref |
06:06:05 | FromDiscord | <Rika> it should just copy tho right? |
06:06:18 | saem | I guess so, but when I rearrange the code it works |
06:06:33 | disruptek | it's a compiler bug. |
06:08:40 | FromDiscord | <flywind> It works with `--gc:arc`. |
06:09:10 | adnan338 | Oh, arc fixes it |
06:09:19 | adnan338 | Weird error |
06:09:47 | disruptek | beginner's luck. |
06:12:31 | adnan338 | Is it possible to describe --gc:arc and --threads:on in the project .nimble file, so a user doesn't have to manually set these flags? |
06:13:02 | disruptek | please use a .cfg file named project.nim.cfg where project is the name of your program's entry point. |
06:13:14 | disruptek | ~disrupstyle |
06:13:16 | disbot | disrupstyle: 11tips for writing code that won't provoke 😠 rants 🤬 on irc: https://gist.github.com/disruptek/6d0cd6774d05adaa894db4deb646fc1d -- disruptek |
06:20:53 | * | habamax joined #nim |
06:25:06 | * | NimBot joined #nim |
06:33:43 | * | Jjp137 quit (Read error: No route to host) |
06:34:16 | * | Jjp137 joined #nim |
06:45:46 | * | narimiran joined #nim |
06:50:03 | * | krux02 joined #nim |
06:51:39 | FromDiscord | <Ardek> stylish |
06:53:43 | * | my_dude joined #nim |
06:57:25 | * | my_dude quit (Client Quit) |
07:05:54 | FromDiscord | <GreenFork> disruptek, "where project is the name of your program's entry point." what if I don't have a specific "entry point", it's just a set of files? is this recommendation still same when I need to put it into directory like tests/ ? |
07:07:49 | disruptek | you can always use a nim.cfg, but at the root of your project, you don't want to commit it. |
07:08:01 | disruptek | in your tests directory, you can use nim.cfg. |
07:08:09 | disruptek | you can commit it there, if you must. |
07:08:35 | disruptek | the point is that the package manager should be able to blow away the .cfg in your project on every alternate site where the project is installed. |
07:09:07 | disruptek | each of these sentences has some amount of ambiguity. i hope you can parse it out. |
07:09:59 | FromDiscord | <GreenFork> yeah, that makes sense, thanks |
07:10:01 | FromGitter | <gogolxdong> Made a workaround of createAsyncPipe to migrate to --gc:arc, everything works fine by far, and I won't care possible memory leak unless it crashes too soon. |
07:10:04 | disruptek | cool. |
07:34:01 | * | bacterio quit (Ping timeout: 246 seconds) |
07:39:16 | * | bacterio joined #nim |
08:02:31 | FromDiscord | <mattrb> I was being stupid the other day and couldn't seem to get staticFor to work. All good now and working as intended! Thanks again for the help 🙂 |
08:32:36 | * | fputs quit (Ping timeout: 240 seconds) |
08:40:46 | * | u0_a2161 joined #nim |
08:42:23 | * | hoijui joined #nim |
08:44:50 | * | Clonkk[m] joined #nim |
08:48:30 | * | Tanger quit (Remote host closed the connection) |
09:30:31 | * | Tanger joined #nim |
09:31:37 | * | Torro joined #nim |
09:42:39 | * | sagax joined #nim |
09:45:49 | * | u0_a2161 quit (Ping timeout: 264 seconds) |
09:49:35 | FromGitter | <gogolxdong> Does https://github.com/snej/nimdbx support windows? |
09:51:15 | FromDiscord | <ElegantBeef> https://github.com/snej/nimdbx/issues/4 possibly? |
09:51:16 | disbot | ➥ CI failure on Windows, libmdbx doesn't build in Github Actions |
09:58:13 | * | piron_ quit (Ping timeout: 246 seconds) |
09:58:38 | * | vicfred quit (Quit: Leaving) |
10:00:41 | * | piron joined #nim |
10:02:52 | adnan338 | Ok my hobby project is coming along nicely. Now comes the part where I start shipping it with Flatpak. But I noticed that installing nimph is still giving me issues :( |
10:12:09 | * | haxscramper joined #nim |
10:13:42 | giaco | is there any nim module that would help me mapping the settings of my application with a web panel, beside jester? |
10:17:33 | * | Q-Master quit (Ping timeout: 260 seconds) |
10:18:25 | haxscramper | `--panics:on` makes `raiseAssert` a side effect - is this an expected behavior and if so, what are recomended ways of fixing this? I would prefer to leave `.noSideEffect.` annotation when possible, because I raise assertions in a lot of places, and converting all of them to `proc` would be quite tedious process. |
10:20:18 | * | xace quit (Ping timeout: 272 seconds) |
10:25:12 | FromDiscord | <GreenFork> haxscramper, you can probably wrap all raiseAssert into {.cast(noSideEffect).} https://nim-lang.org/docs/manual.html#pragmas-nosideeffect-pragma but not sure if it is less tedious |
10:26:11 | FromDiscord | <GreenFork> maybe defining a new wrapper with `cast` around single raiseAssert proc is okay too. then just rename every raiseAssert to newly defined func |
10:28:08 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
10:33:09 | * | xace joined #nim |
10:34:57 | * | PMunch joined #nim |
10:39:01 | * | xace quit (Read error: Connection reset by peer) |
10:39:03 | haxscramper | I'm more concerned with how 'idiomatic' this apporach is - if I understand correctly `--panics:on` makes it possible for a compiler to convert `raiseaAssert()` into program termination (because assertion error is a defect) |
10:39:48 | haxscramper | I'm using assertions to show that something went wrong, but maybe I should derive my own exception from `CatchableError` and use it everywhere? |
10:40:42 | haxscramper | `.cast(noSideEffect).` is a possibility, yes, but doing this systematically is a clear sign of using language feature wrong |
10:43:56 | haxscramper | But maybe using custom exception is also bad, because `raiseAssert` is *exactly* the thing I need, and reimplementing it in different way only to mitigate compilation errors might mean I'm sacrificing something else |
10:46:59 | * | Q-Master joined #nim |
10:51:16 | * | Q-Master quit (Ping timeout: 240 seconds) |
10:56:11 | Oddmonger | holy sh*t , we can declare objects not defined :( |
10:56:53 | Oddmonger | var world:World didn't raise any error (i could even use it as a parameter for a function) until i've tried to access its members |
10:57:32 | haxscramper | !eval var world: World |
10:57:34 | NimBot | Compile failed: /usercode/in.nim(1, 12) Error: undeclared identifier: 'World' |
11:00:01 | Oddmonger | i think it's because it's defined in a submodule (with an include) |
11:00:05 | Oddmonger | my bad |
11:02:53 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
11:03:40 | * | pbb joined #nim |
11:04:56 | Araq | haxscramper, if they are Catchable, don't use 'assert' |
11:08:12 | haxscramper | Araq: you mean 'if I expect user to be able to catch them'? E.g. assert is a defect, so in the end I'd better derive custom exception |
11:08:17 | haxscramper | And use it instead? |
11:24:41 | * | Vladar joined #nim |
11:26:06 | * | Q-Master joined #nim |
11:35:13 | * | xace joined #nim |
11:45:17 | * | abm joined #nim |
11:55:38 | Araq | yes |
11:56:38 | * | Vladar quit (Quit: Leaving) |
12:18:38 | FromDiscord | <tomck> Any way to access private fields? |
12:18:53 | FromDiscord | <tomck> found this; https://github.com/nim-lang/Nim/pull/11865 but it's not merged yet |
12:18:56 | disbot | ➥ `import foo {.all.}` ; snippet at 12https://play.nim-lang.org/#ix=2iAE |
12:19:27 | PMunch | @tomck, you can always include instead of import |
12:19:31 | FromDiscord | <tomck> any good way to just say 'fuck it let me get this value'? debugging some c ffi stuff |
12:19:35 | PMunch | With all the caveats that has |
12:19:35 | FromDiscord | <tomck> won't that break everything? |
12:19:55 | PMunch | Well you can "include" in a separate file and write exporters |
12:19:55 | FromDiscord | <tomck> can confirm it breaks everything |
12:23:55 | FromDiscord | <tomck> eh? |
12:23:58 | FromDiscord | <tomck> how does that work |
12:24:57 | PMunch | Basically you extend the module |
12:25:20 | PMunch | But it does become a new module, so if you import both the old and the new then you will have trouble |
12:25:58 | FromDiscord | <shadow.> if i have a c++ library that basically just acts as all headers to a `.lib` file, can i still ffi that in nim or na |
12:26:57 | FromDiscord | <tomck> yeah the module's imported everywhere, it's from a different library |
12:27:01 | FromDiscord | <tomck> i'll just do some pointer bullshit |
12:28:02 | PMunch | @shadow, sure |
12:53:39 | FromDiscord | <shadow.> hmm ok |
12:59:11 | * | Vladar joined #nim |
14:01:16 | * | Jehan_ joined #nim |
14:08:58 | * | Jehan_ quit (Quit: Leaving) |
14:20:13 | * | cgfuh joined #nim |
14:24:11 | FromDiscord | <apollo> not sure if i've asked this before but how can i make nim work in neovim? |
14:28:27 | PMunch | Hmm, I've started getting "could not import: BIO_new_mem_buf" with the new ssl libraries in windeps.zip |
14:28:37 | FromDiscord | <Rika> there is a plugin `nim.nvim` |
14:33:57 | FromDiscord | <flywind> !eval static: echo "1234"↵import sets↵static: echo "3456" |
14:33:58 | NimBot | Compile failed: /usercode/in.nim(1, 20) Error: undeclared identifier: '↵import' |
14:34:04 | FromDiscord | <apollo> thank you is it available on github? |
14:34:31 | * | fputs joined #nim |
14:34:45 | FromDiscord | <flywind> dots are very annoying |
14:35:06 | FromDiscord | <flywind> sent a code paste, see https://paste.rs/UUk |
14:35:23 | FromDiscord | <flywind> sent a code paste, see https://paste.rs/BKl |
14:36:22 | FromDiscord | <flywind> which are keeping causing problems. |
14:36:27 | PMunch | Araq, the ssl/crypto DLLs in windeps.zip are not the same as the ones in dlls.zip and they don't work with the SSL wrapper in Nim |
14:37:04 | FromDiscord | <flywind> https://play.nim-lang.org/#ix=2LU4 |
14:37:08 | PMunch | I get the error "could not import: BIO_new_mem_buf" which in the SSL wrapper is said to be in the SSL dll but it is in the crypto DLL |
14:39:08 | FromDiscord | <flywind> https://github.com/nim-lang/Nim/pull/16648/files |
14:39:08 | disbot | ➥ revive PR #16320 (CRLF fix); fix #16308; Update openssl.nim |
14:39:18 | FromDiscord | <flywind> could this PR solve your problem? |
14:39:36 | FromDiscord | <flywind> @PMunch |
14:40:16 | PMunch | That would indeed fix it |
14:42:59 | FromDiscord | <flywind> I file a new issue: https://github.com/nim-lang/Nim/issues/16707 |
14:57:53 | * | Tanger quit (Quit: Leaving) |
15:03:04 | Araq | PMunch, huh... |
15:03:16 | FromDiscord | <notchris> Morning friends! |
15:05:17 | PMunch | Apparently the PR @flywind sent would work, but it's still a bit odd |
15:06:18 | * | habamax quit (Ping timeout: 260 seconds) |
15:09:56 | Oddmonger | if i have an object defined like this: Rect(x,y,w,h:int) , can i fill the w,h part with a tuple returned by a function ? |
15:10:07 | Oddmonger | without using intermediate values |
15:10:28 | Oddmonger | my function is returning (x,y) |
15:11:03 | Oddmonger | so i thought i could write: (rect.x,rect.y) = myfunction(…) |
15:12:43 | * | tane joined #nim |
15:14:10 | Oddmonger | ah i've made a template, may transforming it to function would help debugging |
15:19:41 | Araq | so ... they replaced Rick with his 10 year old daughter?! |
15:20:18 | Araq | most ridiculous, why would I watch this... |
15:20:37 | FromDiscord | <dk> What does `!` do in karaxdsl? |
15:21:16 | mipri | Oddmonger: you can define `xy=` to get rect.xy = myfunction(...) |
15:21:48 | Oddmonger | ah yes good idea |
15:25:19 | disruptek | adnan338: run nimph's bootstrap.sh or bootstrap-nonimble.sh; your nimble is already too confused to be able to install nimph itself. |
15:32:01 | * | joast quit (Quit: Leaving.) |
15:36:32 | disruptek | ~gitnim |
15:36:33 | disbot | gitnim: 11https://gitnim.com/ -- choosenim for choosey nimions -- disruptek |
15:36:57 | disruptek | if anyone is on linux and wants to test gitnim+dist, please tell me what sucks. |
15:38:37 | FromDiscord | <andeee> If anyone is interested in writing native extensions to node js, I've made a library for making them in Nim https://github.com/andi23rosca/napi-nim |
15:38:55 | * | fputs quit (Ping timeout: 256 seconds) |
15:40:52 | * | fputs joined #nim |
15:41:37 | ForumUpdaterBot | New thread by Vinyll: Admin for web app, see https://forum.nim-lang.org/t/7380 |
15:55:10 | haxscramper | disruptek: I pushed new hmisc version with 'some' fixes, it should now correctly work with panics |
15:55:24 | disruptek | nice, thanks. |
15:55:29 | haxscramper | Because I was so stupid and just used `asert` everywhere |
15:55:50 | disruptek | i wasn't sure how you'd want to solve it... |
15:56:05 | haxscramper | Well, neither was I at the start |
15:56:37 | haxscramper | I'm still not sure that is the right approach - see https://irclogs.nim-lang.org/13-01-2021.html#10:18:25 |
15:57:18 | haxscramper | But I think that 4raq's solution is probably the best option, so I decided to go with it |
15:57:41 | * | anthonyy joined #nim |
15:58:56 | * | anthonyy quit (Client Quit) |
15:59:41 | * | anthonyy joined #nim |
16:04:41 | * | waleee-cl joined #nim |
16:08:55 | ForumUpdaterBot | New question by Alex Craft: How to cache value of a function with different arguments in Nim, see https://stackoverflow.com/questions/65705598/how-to-cache-value-of-a-function-with-different-arguments-in-nim |
16:41:22 | * | hoijui quit (Ping timeout: 260 seconds) |
16:44:00 | * | a_chou joined #nim |
16:47:50 | * | Torro quit (Quit: bye) |
16:50:14 | haxscramper | Is there a separate list of various papers used for compiler implementation - I found one in documentation control flow graph `dfa.nim` ("A Graph–Free Approach to Data–Flow Analysis"), but maybe there is something else (aside from several datastructure and memory/allocation-related)? |
16:55:09 | Araq | haxscramper, no but I read the Dragon book, Wirth's compiler construction and Modern Compiler Implementation in ML when I started |
16:58:16 | Zoom[m] | Araq: how {en,dis}couraged is using Options in potential std|fusion code? It's not used much ATM. |
16:59:35 | * | hoijui joined #nim |
16:59:43 | * | hnOsmium0001 joined #nim |
17:00:09 | * | hoijui quit (Remote host closed the connection) |
17:03:20 | Araq | I don't like Options and prevend them when I can. But I'm pretty lonely |
17:03:27 | Araq | *prevent |
17:03:45 | ForumUpdaterBot | New thread by Chaemon: MemberProc macro, see https://forum.nim-lang.org/t/7381 |
17:04:40 | FromDiscord | <Rika> why dont you like options? |
17:04:56 | Araq | for me Option[T] is usually better done via an exception. Yeah, yeah, so sue me I don't like manual error propagation until the applayer can finally say 'quit "Error"' |
17:05:47 | disruptek | there are so many cases where an option is the right abstraction: if it's there, give it to me; else, don't. |
17:06:36 | haxscramper | I think options should be acceptable closer to leafs of the calltree (like when you have something like `parseInt()` or something, and encouraged for arguments and fields |
17:06:57 | haxscramper | E.g. when `None()` means something |
17:07:06 | haxscramper | Or when you don't have enough context anyway |
17:07:11 | disruptek | i've never used an option in an argument. |
17:07:23 | haxscramper | Well, yes, it is a questionable thing to do |
17:09:31 | haxscramper | So field values, //maybe// arguments (only because it doesn't matter that much), and return value only close to calltree leaves |
17:11:38 | disruptek | i guess it composes a little more easily for arguments; i wonder if the runtime cost is negligible. |
17:12:46 | haxscramper | For arguments - I think explitly using `Option[string] = none(string)` is better than some magic value (like empty string, negative integer and so on) |
17:13:03 | disruptek | that's what i'm saying. |
17:13:08 | FromDiscord | <dk> Any clue what this error by ormin could mean: `ormin/queries.nim(146, 17) Error: undeclared identifier: 'datetimeType'`? |
17:13:26 | disruptek | also, it's easier to foment an option in unrelated code prior to passing it to the call. |
17:14:13 | disruptek | haxscramper: was my description of nimph workflow compelling? |
17:14:32 | * | PMunch quit (Quit: leaving) |
17:15:22 | haxscramper | yes |
17:16:09 | disruptek | when nimph was created, there was no nimbledeps (local deps) support. |
17:16:44 | * | Jesin quit (Ping timeout: 256 seconds) |
17:16:53 | FromDiscord | <dk> Examples use timestamp instead so I guess I'll just use timestamps instead of datetimes 🥴 |
17:17:01 | disruptek | it doesn't just let you use local deps, it lets you perform your work in them, too. |
17:17:38 | disruptek | so if you need to update a dependency that you do or don't maintain, you can do that work in-situ without affecting other projects. |
17:17:44 | disruptek | test it in place, etc. |
17:18:23 | disruptek | when it works, cut a new version, release it, and move on. nimph will pick it up in other projects as necessary, etc. |
17:24:01 | haxscramper | Well, to be honest the only reason I haven't switched to it yet, is because I'm working with what is basically monorepo with almost no external dependencies (I think only cligen and several similar libraries). But considering just how /annoying/ some things are it is only a matter of time |
17:24:29 | haxscramper | I will certainly do this when I get to it when writing dist support for docgen |
17:26:26 | FromDiscord | <rinfz> whats the equivalent of the python `xs[1:]`? and are all the indexing/slicing methods documented anywhere? |
17:26:37 | haxscramper | `[1..^1]` |
17:26:45 | disruptek | scramper: i do a lot of `--nimblePath="$config/deps/pkgs/"` and then `--path="$config/../foo"`; it's easy to mix and match local deps where it makes sense. |
17:28:05 | disruptek | just running `nimph` and seeing which versions of stuff my code is pulling in is hard to live without. |
17:28:08 | FromDiscord | <rinfz> thanks |
17:33:46 | * | a_chou quit (Quit: a_chou) |
17:39:57 | * | fputs quit (Quit: WeeChat 3.0) |
17:45:44 | leorize[m] | disruptek: you manage to reproduce it on linux? |
17:45:59 | disruptek | remind me... |
17:46:35 | leorize[m] | testes dying on release build but not debug |
17:47:03 | disruptek | yes. your ci demonstrate it on linux. |
17:47:22 | leorize[m] | huh? my ci passes for linux? |
17:47:33 | disruptek | but, re-run it. i made a lot of testes changes tracking down these issues. |
17:47:40 | leorize[m] | except arc but that's just arc being shit |
17:48:08 | leorize[m] | sure |
17:48:16 | disruptek | yes; testes won't trigger that arc bug now. |
17:49:20 | leorize[m] | got any projects doing parsing that you would like to see fuzzed? I'm thinking of looking into fuzz testing Nim software |
17:50:01 | disruptek | that might be a really neat way to improve dust. |
17:50:42 | leorize[m] | if it imports the compiler I would hold that off a bit |
17:51:19 | leorize[m] | the compiler already crashes by just using it so I'm not sure if fuzzing it gets you anywhere :p |
17:51:20 | disruptek | not sure what else would be relevant. |
17:51:38 | disruptek | i only parse using npeg these days. |
17:52:26 | disruptek | !repo gully |
17:52:27 | disbot | https://github.com/disruptek/gully -- 9gully: 11a code comment formatter 15 3⭐ 0🍴 |
17:52:30 | leorize | maybe I can try fuzzing nim-regex |
17:52:31 | disruptek | what do you think of this project? |
17:53:19 | disruptek | for that matter, nimsuggest still crashes often enough that it's probably a better place to invest time. |
17:54:16 | leorize | looks neat |
17:54:56 | disruptek | it doesn't work, but there are a lot of bones. |
17:55:29 | disruptek | i got bored after building the structure, basically. |
17:55:33 | leorize | I'm holding off looking into nimsuggest since 4raq's IC is gonna rip out all the hacks nimsuggest use to speed itself up |
17:56:45 | leorize | either IC will fix all nimsuggest bugs or it would just replace one set of bugs with another |
17:57:10 | disruptek | will you mess with gitnim for me? |
17:57:40 | leorize | later, I want nim-sys to work first |
17:57:48 | disruptek | fair enough. |
18:13:44 | * | koltrast quit (Ping timeout: 246 seconds) |
18:33:53 | * | Jesin joined #nim |
18:44:45 | Araq | hmm I'm loading an ID that never was created... |
18:45:00 | * | NimBot joined #nim |
18:45:16 | Araq | and the ID is 0 |
18:53:54 | * | lritter joined #nim |
18:53:58 | ForumUpdaterBot | New thread by Alexeypetrushin: How to understand nimprof report?, see https://forum.nim-lang.org/t/7382 |
18:54:05 | * | koltrast joined #nim |
19:01:31 | * | Vladar quit (Remote host closed the connection) |
19:03:40 | * | Vladar joined #nim |
19:10:22 | FromGitter | <StefanSalewski> That is really funny: https://github.com/StefanSalewski/gintro/issues/108#issuecomment-759657050 |
19:10:29 | disbot | ➥ Gstreamer, appsink element new-sample signal seems missing ; snippet at 12https://play.nim-lang.org/#ix=2LW2 |
19:11:51 | disruptek | use -d:useMalloc |
19:12:33 | FromGitter | <StefanSalewski> Ah yes, forgot about -d:usemalloc. will test, thanks. |
19:15:06 | * | vicfred joined #nim |
19:15:35 | FromGitter | <StefanSalewski> No, -d:useMalloc does not really help. Get a crash after 5 tests. But will test with -d:useMalloc and valgrind now. |
19:16:52 | * | xet7 quit (Quit: Leaving) |
19:16:55 | FromGitter | <StefanSalewski> nim c --gc:arc -d:useMalloc -d:danger appsink_src.nim |
19:17:10 | FromGitter | <StefanSalewski> ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) |
19:17:23 | FromGitter | <StefanSalewski> So all is fine with -d:danger |
19:18:42 | * | xet7 joined #nim |
19:18:54 | * | xet7 quit (Remote host closed the connection) |
19:21:30 | FromGitter | <StefanSalewski> Well I don't know much about gstreamer, I wrote this example for Mr. arkanoid87. Conversion from C example. |
19:21:36 | FromGitter | <StefanSalewski> Bye. |
19:23:06 | * | xet7 joined #nim |
19:34:46 | * | cadmium[m] joined #nim |
19:36:45 | * | hmmm joined #nim |
19:37:11 | hmmm | hay beautifuls |
19:37:16 | hmmm | back to some nim! |
19:37:28 | hmmm | how do I tokenize word/sentences in nim? |
19:37:49 | haxscramper | https://narimiran.github.io/2021/01/11/nim-parsing.html |
19:38:02 | haxscramper | Or for simple things just `strutuils.split()` |
19:38:15 | hmmm | our boi nami is a true scholar |
19:38:22 | hmmm | I'll look into the blog |
19:40:00 | leorize[m] | Nim performs memory allocation within the default signal handers 🤦♂️ |
19:40:04 | FromGitter | <StefanSalewski> iterator tokenize in strutils. |
19:40:13 | leorize[m] | well luckily we always crash after a signal |
19:40:16 | FromDiscord | <Meowz> sent a code paste, see https://play.nim-lang.org/#ix=2LWf |
19:41:06 | FromDiscord | <Meowz> Anything wrong with that if I want to read a sequence of a specific type on a internal process? |
19:47:28 | FromGitter | <StefanSalewski> Logout |
19:59:36 | FromGitter | <StefanSalewski> With nim c --opt:speed appsink_src.nim it works fine too! |
19:59:52 | FromGitter | <StefanSalewski> So it is not a real Nim issue. |
20:00:39 | FromGitter | <StefanSalewski> So I guess memory corruption when gcc does not optimize. Will be some work to debug. |
20:04:56 | FromDiscord | <~leoi> Hello everybody! I was trying to figure out how to iterate over multiple tuples at once, to implement a Vector add function |
20:05:33 | FromDiscord | <~leoi> but tuples only accept indexes that can be evaluated at compile time |
20:06:08 | FromDiscord | <~leoi> should I just use arrays of size 3 instead? or is there a nicier solution? |
20:06:18 | mipri | I'd go with the arrays, yeah |
20:08:06 | mipri | if you want to see if what you're trying to do is possible though, try showing your attempt |
20:08:08 | * | vicfred quit (Read error: Connection reset by peer) |
20:09:26 | * | Kaivo joined #nim |
20:10:51 | hmmm | jeez |
20:11:01 | hmmm | who decided that defer can't work at top level |
20:11:20 | * | l1x joined #nim |
20:13:08 | FromDiscord | <InventorMatt> @~leoi if you want to statically unroll the loop so it can work you can do this https://play.nim-lang.org/#ix=2LWu |
20:16:28 | leorize | hmmm: it's like that for good reasons |
20:19:19 | hmmm | hmm I think the powers at the top are just oppressing us defer users |
20:19:36 | hmmm | but ok I'll .close my file like a good boy |
20:20:40 | FromGitter | <StefanSalewski> May it be a problem when echo is executed from within a different thread? |
20:22:23 | leorize | hmmm: it's mainly because "top-level" has special semantics |
20:22:38 | FromGitter | <StefanSalewski> I have replaced g_print() with echo(), and assume that gstreamer is using multiple threads. |
20:24:01 | leorize | @StefanSalewski no, currently we use the C library to do IO, which is thread-safe |
20:24:45 | FromGitter | <StefanSalewski> At least increasing the number of echo statements seems to increase the chance for a crash. |
20:25:24 | FromGitter | <StefanSalewski> Without many echo() I can not get a crash when executed by valgrind. |
20:25:35 | leorize | echo do use the GC though |
20:26:07 | leorize | if you're not using ARC/ORC and your code is in a foreign (non-Nim) thread, you need to setup the GC |
20:26:41 | FromGitter | <StefanSalewski> Yes, good point. But refc, arc, orc and none makes not a very big difference. |
20:26:41 | leorize | the function is called `setupForeignThreadGc()` iirc |
20:27:12 | leorize | was the nim code compiled with --threads:on? |
20:27:26 | leorize | the memory allocator does not employ locks unless threads are enabled |
20:27:26 | FromGitter | <StefanSalewski> No. |
20:27:48 | FromGitter | <StefanSalewski> Will try --threads:on, thanks. |
20:30:39 | FromGitter | <StefanSalewski> nim c --threads:on appsink_src.nim gives nice valgrind errors, fine. That may help by debugging. |
20:30:54 | FromGitter | <StefanSalewski> Will continue tomorrow, bye. |
20:30:57 | FromGitter | <StefanSalewski> Logout |
20:43:59 | FromDiscord | <~leoi> Thanks man, that is exactly what I was thinking about. Before trying macros I was tweaking an iterator to see if it worked, but it didn't (iterators generate code at compile time, don't they?) |
20:44:46 | FromDiscord | <tomck> sent a code paste, see https://play.nim-lang.org/#ix=2LWD |
20:46:46 | FromDiscord | <InventorMatt> I don't believe they do. although my implementation isn't the best it should probably be rewritten as a forloop macro |
20:47:59 | FromDiscord | <haxscramper> Iterators inline code during compilation, but that is an implementation detail |
20:50:27 | FromDiscord | <haxscramper> IIRC that is how it should work technically, see for example https://github.com/haxscramper/hax-nim/blob/master/hack-test/static_when_type.nim |
20:50:32 | FromDiscord | <haxscramper> But this is a road to madness |
20:51:00 | * | narimiran quit (Ping timeout: 256 seconds) |
20:51:15 | disruptek | opengl here? |
20:51:25 | FromGitter | <StefanSalewski> Maybe leorize has solved the problem. |
20:51:29 | FromGitter | <StefanSalewski> nim c --threads:on --gc:arc -d:useMalloc appsink_src.nim |
20:51:35 | FromDiscord | <haxscramper> At least that's what I remember from the time I tried to do something with `static` and generics and `when` with types |
20:51:41 | FromDiscord | <haxscramper> !repo gram |
20:51:42 | disbot | https://github.com/disruptek/gram -- 9gram: 11generic graphs in Nim 🕸 15 13⭐ 1🍴 7& 4 more... |
20:51:49 | FromGitter | <StefanSalewski> seems to work fine. Not one crash for 50 tests. |
20:51:55 | FromDiscord | <haxscramper> Also has some use of `static` if you are interested |
20:52:49 | FromDiscord | <haxscramper> @tomck Everything but first message was for your question |
20:53:47 | FromDiscord | <tomck> @haxscramper hmm thanks, maybe it just doesn't work with static[int] and static[bool] |
20:54:11 | FromDiscord | <tomck> (I also tried `dynamic: static[bool]` as a type param, that didn't work, same error) |
20:54:27 | FromDiscord | <tomck> hmmm how tf is it working for a set but not a bool |
20:55:36 | FromDiscord | <haxscramper> I'm curious if it is possible to do something like `case kind: static[int]` or similar |
20:58:00 | FromDiscord | <tomck> nope, `selector must be of an ordinal type, float` |
21:07:34 | FromDiscord | <Mango> :PikaPika: |
21:10:09 | * | anthonyy quit (Remote host closed the connection) |
21:11:21 | leorize | @tomck iirc arraymancer do this kind of static specialization, maybe you can take a look there? |
21:14:35 | FromDiscord | <tomck> wait, i only get the error if i'm instantiating the type in a separate module |
21:14:42 | FromDiscord | <tomck> leorize: i'll take a look, thanks |
21:25:06 | FromDiscord | <tomck> Ok i figured it out |
21:25:14 | FromDiscord | <tomck> https://play.nim-lang.org/#ix=2LWN |
21:25:24 | FromDiscord | <tomck> I can have a `when` inside an object just find |
21:25:39 | FromDiscord | <tomck> BUT, when I have a proc that takes a `var Grid[...]`, then it shits the bed for whatever reason |
21:26:19 | FromDiscord | <tomck> I'm guessing because for whatever reason the types don't unify anymore, so it doesn't recognise that `Flags` should be `{isSingle}` |
21:26:42 | FromDiscord | <tomck> I'm pretty sure this is a compiler bug (?), should I add this to the github issues? |
21:27:01 | disruptek | just pr a fix; it's fine. |
21:27:08 | * | Etothepiiminus1 joined #nim |
21:29:00 | FromDiscord | <tomck> lol ok, it's on my todo list |
21:31:27 | * | abm quit (Read error: Connection reset by peer) |
21:33:45 | FromDiscord | <haxscramper> Also see https://irclogs.nim-lang.org/05-11-2020.html#22:27:17 |
21:34:34 | * | Etothepiiminus1 quit (Remote host closed the connection) |
21:36:40 | FromDiscord | <tomck> lol |
21:37:03 | FromDiscord | <tomck> Stuff like generics always feels like there should be a really nice, easy solution - like a 20 line recursive function & it all just works, boom |
21:37:28 | FromDiscord | <tomck> but then you're 4 weeks of work deep & nothing works at all |
21:37:33 | disruptek | i didn't even look at the code. |
21:38:11 | FromDiscord | <tomck> is nim a context sensitive grammar? I feel like there has to be some weird requirement on the parser what with UFCS & all the compile time stuff |
21:38:27 | FromDiscord | <haxscramper> No, grammar is not context sensetive IIRC |
21:38:48 | FromDiscord | <haxscramper> Well, indentation /could/ be considered one, because you might need context-sensetive lexer |
21:38:53 | FromDiscord | <haxscramper> ~manual |
21:38:53 | disbot | manual: 11the Nim Manual is https://nim-lang.org/docs/manual.html |
21:38:53 | disbot | manual: 11just good to Ctrl+F in cases like this -- haxscramper |
21:39:09 | FromDiscord | <haxscramper> Has BNF grammar specifiaction at the start if you are interested |
21:40:03 | FromDiscord | <tomck> ta |
21:53:54 | FromDiscord | <Mango> sent a code paste, see https://play.nim-lang.org/#ix=2LWZ |
21:54:15 | FromDiscord | <dom96> it looks like it succeeded |
21:54:32 | FromDiscord | <Mango> How can I fix it? |
21:58:34 | * | vicfred joined #nim |
22:05:43 | * | krux02 quit (Quit: Leaving) |
22:10:48 | * | abm joined #nim |
22:11:03 | * | zahary joined #nim |
22:17:38 | * | haxscramper quit (Remote host closed the connection) |
22:18:04 | FromDiscord | <rinfz> anyone tried using the nim github action nim-lang-alpine? nimble is whining at me that there are no packages |
22:31:32 | FromDiscord | <rinfz> never mind i figured it out |
22:34:13 | * | xace quit (Ping timeout: 246 seconds) |
22:34:16 | * | xace_ joined #nim |
22:34:42 | FromDiscord | <Mango> nimble↵-bash: nimble: command not found |
22:36:40 | * | xace_ quit (Client Quit) |
22:42:20 | * | xace joined #nim |
22:42:50 | FromDiscord | <bark> add /root/nim-1.4.2/bin/ to your path? |
22:43:05 | FromDiscord | <bark> also idk if this is part of choosenim or whatnot |
22:43:10 | FromDiscord | <Mango> How should this work on Linux? ^^ |
22:44:01 | FromDiscord | <bark> add the line `PATH=$PATH":/root/nim-1.4.2/bin"` to your .bashrc in your home dir |
22:44:16 | FromDiscord | <Mango> I'll try |
22:44:23 | FromDiscord | <bark> then type `source ~/.bashrc` |
22:44:48 | FromDiscord | <bark> but did you compile nimble from source |
22:44:57 | FromDiscord | <bark> or is it part of something like choosenim |
22:45:06 | FromDiscord | <Mango> I tried to install it from koch |
22:45:25 | FromDiscord | <bark> oh okay i was just wondering why put it in such a specific dir |
22:45:29 | leorize | if you're on debian enable backports and install nim from apt |
22:45:51 | FromDiscord | <Mango> That is because I downloaded the tarball |
22:46:23 | FromDiscord | <bark> oh i completely forgot |
22:46:30 | FromDiscord | <bark> you also need the line export PATH |
22:46:42 | FromDiscord | <bark> below the path setting |
22:47:04 | FromDiscord | <dom96> have you tried just using choosenim? It tells you how to do these PATH changes |
22:47:12 | leorize | just install Nim via apt-get, it works very well for Debian |
22:47:28 | FromDiscord | <Mango> Uhh, thanks! That worked! |
22:47:43 | leorize | federico3 keeps them up-to-date at all time and even make sure that tests passes |
22:47:58 | FromDiscord | <Mango> I just had to add the folder to Path |
22:48:13 | FromDiscord | <bark> well the compilation did succeed |
22:48:20 | FromDiscord | <bark> ^ |
22:49:03 | * | bacterio quit (Quit: bacterio) |
22:49:23 | FromDiscord | <bark> but if you just type a command in bash, it will only look for matching executables (any file with execute permission) in directories in the PATH environment variable |
22:49:38 | FromDiscord | <bark> which is a list of paths to directories split by : |
22:50:23 | FromDiscord | <bark> idk maybe you already know this |
22:50:33 | FromDiscord | <bark> im just explaining why i said everything |
22:51:01 | leorize | disruptek: my nim-sys passes now :D thanks for the fix |
22:51:03 | FromDiscord | <bark> but it's probably indeed easier to use some more automated solution be it apt or choosenim |
22:57:33 | * | hmmm quit (Quit: WeeChat 3.0) |
23:01:09 | * | tane quit (Quit: Leaving) |
23:17:53 | FromDiscord | <Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2LXk |
23:18:21 | FromDiscord | <Anonymous Poet> @dom96 ^ |
23:19:18 | FromDiscord | <Anonymous Poet> I thought maybe the template was doing something funny, but it seems to work fine if the code is only called once. I tried using a macro instead of a template, still doesnt work. Then I tried getting rid of the template and copy-pasting the code for each test. It works fine as long as only one test is not commented out ... |
23:19:39 | FromDiscord | <Anonymous Poet> I dont understand why replacing the `asyncCheck` with `discard` makes everything Just Work TM |
23:20:32 | disruptek | leorize: nice. |
23:21:08 | FromDiscord | <dom96> @Anonymous Poet because by using `discard` you are discarding the exception 🙂 |
23:21:20 | FromDiscord | <Anonymous Poet> ooooh |
23:21:22 | FromDiscord | <dom96> The exception still happens, you just don't see it |
23:21:52 | FromDiscord | <Anonymous Poet> i didnt realize it worked that way ... i thought i was discarding the future, which i was fine with because i didnt need |
23:22:03 | FromDiscord | <dom96> the future contains the exception |
23:22:04 | FromDiscord | <Anonymous Poet> that seems like ... not obvious behaviour? |
23:22:18 | * | piron quit (Ping timeout: 256 seconds) |
23:22:45 | FromDiscord | <Anonymous Poet> but ok, setting that aside, how do i fix the actual issue, which is the exception itself? |
23:23:29 | FromDiscord | <dom96> Can you paste the stack trace? (possibly in a pastebin/gist to not spam this channel) |
23:25:26 | FromDiscord | <Anonymous Poet> https://pastebin.com/L5cUpnEQ |
23:26:51 | FromDiscord | <Anonymous Poet> sorry for the highlighting, i saw the option and i was like "Nim, please!" and i was happy they had the option so i didnt stop to think that i was pasting a trace and not code... oh well |
23:28:01 | FromDiscord | <dom96> I guess line 61 is the `serve`? |
23:28:29 | * | abm quit (Quit: Leaving) |
23:29:03 | FromDiscord | <Anonymous Poet> no, its `waitFor sleepAsync(10)` |
23:29:47 | FromDiscord | <Anonymous Poet> https://pastebin.com/QhdNgKbR |
23:31:17 | FromDiscord | <dom96> I see. Well, that stack trace is pretty useless. I think we should start reporting these as bugs 🙂 |
23:32:46 | FromDiscord | <Anonymous Poet> i dont disagree |
23:32:48 | FromDiscord | <Anonymous Poet> but what is the bug? |
23:33:59 | FromDiscord | <dom96> I'm not sure, but one thing that looks wrong is that you're using `newSocket` |
23:34:12 | FromDiscord | <dom96> you're mixing synchronous and asynchronous code |
23:34:56 | FromDiscord | <dom96> I would expect `socket.connect` to block because the async http server never gets a chance to accept it |
23:35:54 | FromDiscord | <Anonymous Poet> in my experience, the issue has always been `.serve`, because either it serves and loops forever, or theres usually a compile error |
23:36:07 | * | spiderstew_ quit (Ping timeout: 260 seconds) |
23:36:18 | FromDiscord | <dom96> `waitFor sleepAsync(10)` is also wrong |
23:36:23 | FromDiscord | <Anonymous Poet> i agree that this use case is wonky (trying to have the server and client be the same program to one another) |
23:36:27 | * | spiderstew joined #nim |
23:36:33 | FromDiscord | <dom96> because there is no guarantee every async operation will complete in 10 ms |
23:36:52 | FromDiscord | <Anonymous Poet> true, but i just need it to context switch so the server can process |
23:37:05 | FromDiscord | <Anonymous Poet> idk if thats a hard cutoff at 10 ms, or if it just gets added to the ready queue at that point |
23:37:16 | FromDiscord | <Anonymous Poet> in either case, 10ms is more than long enough for these tests |
23:37:22 | FromDiscord | <Anonymous Poet> and maybe what we're trying to do shouldnt even be possible |
23:37:38 | FromDiscord | <Anonymous Poet> but idk if theres a way to have two binaries running with the current test suites |
23:38:06 | FromDiscord | <dom96> no, don't go down that route |
23:38:21 | FromDiscord | <dom96> What you need to do is the following: |
23:39:06 | * | Vladar quit (Quit: Leaving) |
23:39:16 | FromDiscord | <dom96> remove `await request.respond(Http200, "Good")` with `request.client.close()` (not sure about that `client` field name, but AFAIK there is a way to do this) |
23:39:21 | FromDiscord | <dom96> (edit) "remove" => "replace" |
23:40:03 | FromDiscord | <dom96> replace `block:` with proc runTest(expected, input: string) {.async.} = |
23:40:29 | leorize | disruptek: is cps usable yet? I'm thinking of using it to create reentrant procs |
23:41:18 | FromDiscord | <dom96> and use `newAsyncSocket` instead of `newSocket` |
23:42:04 | FromDiscord | <dom96> That being said, I just realised why you're getting this crash: asynchttpserver doesn't like being `close`d (seems like a bug :/) |
23:43:00 | FromDiscord | <dom96> so instead of creating and closing a new instance in each test, just have a global instance for all tests |
23:43:17 | * | jmiven left #nim ("bye") |
23:43:47 | FromDiscord | <Anonymous Poet> part of the problem is that the handler has the asserts; can i replace that at runtime? |
23:44:23 | leorize | disruptek: and the links to the docs are broken... |
23:47:33 | FromDiscord | <dom96> @Anonymous Poet just set a global var with the expected values 🙂 |
23:48:06 | FromDiscord | <dom96> replacing the handler shouldn't fail, but not sure you can do that |
23:50:34 | FromDiscord | <Anonymous Poet> so are you saying i should use `expected` as a global? that might work actually |
23:55:28 | * | abm joined #nim |
23:57:15 | * | piron joined #nim |