<< 15-07-2020 >>

00:14:29*oddp_ quit (Ping timeout: 265 seconds)
00:19:40*Cthalupa quit (Ping timeout: 246 seconds)
00:25:30*Cthalupa joined #nim
00:36:04FromGitter<deech> Is there `importc`/`importcpp` syntax that splices in the proc name as well? eg. `proc cppFunction(a:cint,b:cint):cint {.importc: "Namespace::<sub-in-cppFunction>(@)".}`?
00:37:56FromGitter<deech> I can write a macro to support this but just wanted to make sure I wasn't missing something.
00:43:48FromDiscord<impbox> deech does $1 work?
00:44:15FromDiscord<impbox> it's not clear from the docs but `$1` seems to be the proc name in importc, maybe also for importcpp?
00:45:48FromDiscord<Yardanico> oh found an interesting arc codegen bug
00:47:21FromDiscord<Yardanico> I'm not even sure how this is valid Nim, but
00:47:29FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2rEV
00:48:02FromGitter<deech> impbox: oh hoh ... that's interesting.
00:51:54*NimBot joined #nim
00:59:40FromDiscord<Rika> how is that valid nim what
01:00:24leorizeit's valid enough :P
01:01:12PrestigeIs that supposed to compile?
01:01:38FromDiscord<Yardanico> exactly
01:01:41FromDiscord<Yardanico> that's what I'm wondering
01:01:47FromDiscord<Yardanico> found it in Moe
01:01:53FromDiscord<Yardanico> https://github.com/nim-lang/Nim/issues/14985
01:01:55disbot[ARC] proc with both explicit and implicit return results in a C compiler error ; snippet at 12https://play.nim-lang.org/#ix=2rEX
01:09:15shashlick@Yardanico - can you please use your arc chops to create a reduced version of the segfault with my plugins package?
01:09:30FromDiscord<Yardanico> I'll try 😛
01:09:40FromDiscord<Yardanico> what branch?
01:09:59shashlickgood you asked
01:10:13shashlickactually master should be fine
01:10:15shashlickuses channels now
01:10:25FromDiscord<Yardanico> ah okay I'll try
01:10:31shashlickpeace
01:12:44FromDiscord<Yardanico> so the error you're getting is /home/dian/Projects/stuff/plugins/src/plugins/api.nim(150) onLoad ?
01:12:55FromDiscord<Yardanico> key not found: callCommand or something else?
01:12:55shashlicksegfaults
01:13:13FromDiscord<Yardanico> well it segfaults after that, yes
01:13:19FromDiscord<Yardanico> but it says key not found: callCommand first for me
01:13:26FromDiscord<Yardanico> I'm compiling tests/tmain
01:13:36shashlicklet me check again
01:14:29shashlickfirst off, just updating boehm to arc in the config.nims is not sufficient
01:14:34shashlickcause the plugins don't compile
01:15:10FromDiscord<Yardanico> yeah I changed arc there too
01:15:16shashlickhttps://github.com/nim-lang/Nim/issues/14813 had to be changed
01:15:18disbotError compiling with gc:orc and a config.nims file: "system module needs: nimDestroyAndDispose" ; snippet at 12https://play.nim-lang.org/#ix=2rF1
01:15:27shashlickhave to add --gc:arc to plugin.nim
01:15:27FromDiscord<Yardanico> I'm passing it explicitly 😛
01:15:31FromDiscord<Yardanico> yes
01:15:35shashlickpeace
01:15:35FromDiscord<Yardanico> line 176
01:15:45FromDiscord<Yardanico> so what's the error you're getting after that?
01:16:18shashlickI get the segfault straight, no callCommand issue
01:16:52FromDiscord<Yardanico> hrm
01:16:56*Shucks quit (Quit: Leaving)
01:16:58FromDiscord<Yardanico> I'm on the very latest devel
01:17:13shashlicklet me update
01:17:22FromDiscord<Yardanico> Clyybber's PR was merged 13 hours ago
01:17:34FromDiscord<Yardanico> about some arc fixes
01:17:44shashlickokay rebuilding
01:18:15FromDiscord<Yardanico> ah wait actually
01:18:20FromDiscord<Yardanico> it was probably my fault, now I get a segfault too
01:18:25FromDiscord<Yardanico> after Plugin1: test2return right?
01:18:30shashlickyes
01:18:34shashlickno change
01:18:38shashlickafter updating
01:18:38FromDiscord<Yardanico> yeah okay
01:20:40FromDiscord<Yardanico> if I compile with -d:useMalloc, I get "free(): invalid pointer"
01:20:56FromDiscord<Yardanico> I'll try to minimize
01:21:08shashlickthanks man
01:21:12shashlickif I can move to arc, will be awesome
01:31:57*chemist69 quit (Ping timeout: 260 seconds)
01:33:59*chemist69 joined #nim
01:39:50FromDiscord<Yardanico> @shashlick well it's certainly related to destructors, but I think it might not exactly be ARC's fault
01:40:03FromDiscord<Yardanico> you can get much further if you add GC_ref(cmd) as the last line in pluginLoad
01:40:20FromDiscord<Yardanico> in plg1.nim
01:43:31FromDiscord<Yardanico> I think if you're passing something to another library or to the host app you should GC_ref it because otherwise the refcount will be 0 and it will be destroyed
01:43:36FromDiscord<Yardanico> and in this case maybe something else happens:
01:43:40FromDiscord<Yardanico> (my speculation)
01:43:48FromDiscord<Yardanico> you pass cmd from the plugin to the host, and it gets destroyed there
01:43:54FromDiscord<Yardanico> but it also gets destroyed in the plugin itself
01:43:59FromDiscord<Yardanico> so we get a classical double free
01:44:03FromDiscord<Varriount> @reilly I'm here. If you want to control the mouse/keyboard, Nim can use Windows API.
01:44:32shashlickbut its all happening in the same thread
01:44:42FromDiscord<Yardanico> well but it's different libraries
01:44:46FromDiscord<Yardanico> it's not about threads really
01:44:47shashlickand callCommand is in sequence - how is adding a line at the end helping
01:45:03FromDiscord<Yardanico> it's about destroy calls being injected by the compiler
01:45:35FromDiscord<Varriount> @reilly I was actually working to wrap the UI automation API, which allows for some more advanced automation constructs than what movemouse and sendkey do, but it's COM based, and I've gone down the rabbit hole of writing a tool to allow more easy generation of Nim wrappers for Windows APIs.
01:48:59FromDiscord<Yardanico> @shashlick onLoad for plg1 after ARC transformations looks like that:
01:49:19FromDiscord<Yardanico> https://gist.github.com/Yardanico/5cdd8f3965bc06a8584b0f8221737508
01:49:22FromDiscord<Yardanico> with my added GC_ref()
01:49:29FromDiscord<Yardanico> you can see it destroying cmd
01:49:45FromDiscord<Yardanico> and now
01:49:48FromDiscord<Yardanico> for plg2test
01:50:12FromDiscord<Yardanico> ah, sorry, for callCommand
01:50:55FromDiscord<Yardanico> hm actually no, I need to find where it is getting destroyed
01:50:57FromDiscord<Varriount> sent a long message, see http://ix.io/2rF5
01:53:18FromDiscord<reilly> That's exactly what I need, thank you very much!
01:54:51FromDiscord<Varriount> reilly: A big thing to keep in mind is that in Nim, an integer is the size of a pointer. In Windows, it is typically always 32-bit integer
01:55:16FromDiscord<Varriount> @reilly You might also look at https://github.com/khchen/winim
01:55:29FromDiscord<reilly> Already installed it 😉
01:55:31FromDiscord<Varriount> It may or may not have those functions already wrapped.
01:57:13shashlick@Yardanico - so is it a bug with my program or arc
01:57:18FromDiscord<Yardanico> i don't know 😄
01:57:38FromDiscord<Yardanico> but yeah, dealing with library boundaries isn't easy
02:00:33FromDiscord<Yardanico> we'll need to ask 4raq or Clyybber when they go online 😛
02:00:59shashlickdo you think a minimal example is possible?
02:01:05FromDiscord<Yardanico> well yeah I can make one
02:01:15FromDiscord<Yardanico> related to the first issue, not the current crash, I didn't solve it yet
02:02:40FromGitter<deech> Is it a bug that `expandMacros` doesn't show the `*` after the proc name? eg. `expandMacros newProc(name=nnkPostfix.newTree(ident("*"),ident("myProc")) ...)` prints as `proc myProc(...)` instead of `proc myProc*(...)`.
02:10:08FromGitter<iffy> @leorize: That's great! I didn't realize you could just change a file descriptor to an AsyncFD like that. I'll play with it and see how it works (because me code currently only includes `--threads:on` for my stdin reading and I'd love to get rid of it)
02:11:33leorize@iffy here's the only rule that you have to obey: never read from stdin using any stdlib functions
02:12:21leorizethis is because they might buffer and eats up data before the callback can access it
02:12:51leorizeyou might be able to walkaround that by disabling the builtin buffers for stdin, but there aren't any cross platform methods afaik
02:12:55FromGitter<iffy> I do call `setStdIoUnbuffered()` before doing anything; does that mitigate what you're saying?
02:13:02leorizemaybe
02:13:06leorizeI haven't tried :P
02:13:17FromGitter<iffy> k, I'll test; thanks a bunch!
02:13:55leorizenp, remember to test on windows
02:14:43*opal quit (Ping timeout: 240 seconds)
02:16:17*opal joined #nim
02:16:19leorizethis code is not compatible with threading due to the potential of something slurping stdin before or in-between the check and the consumption site
02:16:44leorizeso if you want to use threading then you should spin up a dedicated thread, but since you don't you should be fine :)
02:17:23FromGitter<ynfle> @Varriount, wanna take a look at my `SIGSEGV` error?
02:17:48FromDiscord<reilly> So, `GetAsyncKeyState()` basically returns an int16, and I need to check the most significant bit... How? I've never done anything bitwise before.
02:17:51FromGitter<ynfle> Only because you offered before. If you don't have a chance/don't want to, no worries
02:19:53leorize@reilly `int16 and 0x8000 != 0`
02:20:35FromDiscord<reilly> Thank you!
02:21:43*muffindrake quit (Ping timeout: 272 seconds)
02:22:18FromDiscord<reilly> Er, actually, that doesn't seem quite right as-is. What is `and` meant to do?
02:23:05leorize[m]0x8000 is a 16bit value with the most significant bit set (I might be wrong)
02:23:19*muffindrake joined #nim
02:23:48leorize[m]`and` turns off any bits that's not set in both values
02:24:23FromDiscord<Yardanico> @reilly in nim and/or/not/xor can be used for both booleans and bit operations
02:24:58leorize[m]you might need to put that in paren
02:25:20FromDiscord<Yardanico> oh yeah
02:25:37FromDiscord<Yardanico> well actually not
02:25:42FromDiscord<Yardanico> ah sorry, yes
02:25:48FromDiscord<Yardanico> and has lower precedence than !=
02:26:10leorize[m]!eval let i = 0xffffu16; echo (i and 0x8000) != 0
02:26:12NimBottrue
02:26:41FromDiscord<reilly> `if bitand(GetAsyncKeyState(VK_SHIFT).int, 0x8000) != 0:` seems to be correct.
02:27:04leorize[m]that works too :)
02:28:00leorize[m]!eval let i = 0xffffu16; echo bool(i shr 15)
02:28:02NimBottrue
02:28:21mbuchelhey did anyone implement DEFLATE algorithm in nim-lang yet?
02:28:41leorize[m]!repo deflate
02:28:42disbothttps://github.com/jangko/nimz -- 9nimz: 11Modular Deflate Algorithm Implementation 15 4⭐ 0🍴
02:29:25leorize[m]and of course it have zero docs :p
02:29:28mbuchelthank you
02:29:38mbuchelyep i figured i would have to make my own
02:29:44FromDiscord<Rika> it has 4 bytes of docs ("nimz"
02:29:46FromDiscord<Rika> )
02:30:01mbuchelhopefully this will help me a bit
02:30:23leorize[m]or you can see if someone already wrapped a C deflate implementation
02:30:46FromDiscord<Rika> isnt zlib deflate?
02:30:49mbuchelchecked for that
02:30:52mbuchelzlib did not work
02:30:57FromDiscord<Rika> zlibstatic
02:31:05leorize[m]!repo miniz
02:31:08disbothttps://github.com/richgel999/miniz -- 9miniz: 11miniz: Single C source file zlib-replacement library, originally from code.google.com/p/miniz 15 928⭐ 149🍴 7& 29 more...
02:31:10FromDiscord<Rika> ive found zlibstatic to work more than zlib lol
02:31:26*bung joined #nim
02:32:08mbuchelthank you for the miniz
02:32:10mbuchelthat works
02:32:18mbuchelhopefully
02:32:23leorize[m]!repo treeform/miniz
02:32:23disbothttps://github.com/treeform/miniz -- 9miniz: 11Miniz wrapper for nim. 15 10⭐ 1🍴
02:33:17leorize[m]disruptek: disbot seems to be getting priorities wrong :p it should pick nim projects first, no?
02:33:18disruptekiiuc, the nim-lang zlib wrapper is crufty.
02:33:54disruptekblame github.
02:34:31disruptektreeform's miniz is 99.2% C and only 0.8% Nim.
02:36:19FromDiscord<Rika> why not submodules
02:36:24mbuchelis there a wrapper for the deflate portion? i think this miniz one by treeform skips on that part
02:36:52disruptekwell, we should add it.
02:37:29mbucheli likely will have to later today/tomorrow
02:38:25disruptekit should be pretty copy+paste.
02:38:33disruptekrika: did you look at gram?
02:38:58disruptekmbuchel: you should look at the nim-lang zlib, too; it might work fine, i really dunno.
02:39:15mbuchelit did not
02:39:19FromDiscord<Rika> yeah but what should i say about it lol i havent used it yet
02:39:29disruptekaraq mentioned to me that it needs attention.
02:39:30mbucheli am working on modifying the treeform/ws library to support compression rfc
02:39:41disruptekyeah, i remember you mentioning that.
02:39:52disruptekshould be pretty straightforward.
02:40:09disruptekrika: i'm not using it yet myself, hence my interest.
02:40:13mbuchelthe zlib one does not want to work with the test server i wrote
02:40:41*waleee-cl quit (Quit: Connection closed for inactivity)
02:41:10FromDiscord<Rika> ah i see, i'm not sure when i'll start using it since i'm still fixing up a CBOR library and i kinda need that first so *shrug*
02:41:20disruptekokay.
02:41:46disruptekactually, i do use it in poison.
02:42:28disrupteki made skiplists for use in gram, too.
02:42:34disruptekbut haven't added them yet.
02:42:49bunghow to provide default value to openarray ? I have `headers: openarray[(cstring, cstring)] = []`
02:42:59*audiophile quit (Ping timeout: 272 seconds)
02:43:06bungwhile inside the proc `for a, b in items(headers):` I got `Error: internal error: genTypeInfo(tyOpenArray)`
02:44:17disruptekopenArray is like a converting typeclass; it's not something you specify for a variable.
02:44:29leorize[m]bung: any internal error is a bug, please report
02:44:32FromDiscord<Yardanico> @disruptek bung is specifying it in a argument list
02:45:03disruptekif that's in a proc() then it's definitely a bug.
02:45:04FromDiscord<Yardanico> or maybe not
02:45:10FromDiscord<Yardanico> @Bung can you show proc definition?
02:45:43FromDiscord<Yardanico> maybei t got fixed in devel
02:45:44FromDiscord<Yardanico> it *
02:46:15disrupteki would s/[]/@[]/
02:46:27FromDiscord<Yardanico> it doesn't really matter anyway
02:46:50FromDiscord<Yardanico> !eval let test = (proc(headers: openarray[(string, string)] = [("lol", "yes")]) = echo @headers); test()
02:46:52NimBot@[("lol", "yes")]
02:46:54bunghttps://github.com/bung87/nimvideo/blob/master/src/nimvideo/najax.nim#L130
02:47:08FromDiscord<Yardanico> @Bung are you on devel or not?
02:47:10FromDiscord<Yardanico> what nim version
02:47:19FromDiscord<Yardanico> or maybe it's only in the JS backend
02:47:27bungNim Compiler Version 1.3.5 [MacOSX: amd64]
02:47:28bungCompiled at 2020-07-07
02:47:34FromDiscord<Yardanico> huh
02:47:54bungso maybe only in js backend
02:48:35FromDiscord<Yardanico> nah, it works with the JS backend for me too
02:49:10disruptekdid you try @[] instead of []?
02:49:33FromDiscord<Yardanico> ah nvm I can replicate it
02:49:36FromDiscord<Yardanico> with nimvideo src 😄
02:49:45FromDiscord<Yardanico> @disruptek doesn't fix it
02:50:14FromDiscord<Yardanico> actually I know why
02:50:38FromDiscord<Yardanico> or not
02:50:45bungshould I update nim to devel to confirm ?
02:50:59FromDiscord<Yardanico> no it's okay
02:51:01FromDiscord<Yardanico> I said i replicated it
02:52:03FromDiscord<Yardanico> oh I know
02:52:37FromDiscord<Yardanico> @Bung your code is invalid nim
02:52:44bungdisruptek tried doest avoiding this problem
02:52:50FromDiscord<Yardanico> it wouldn't compile with the C backend with proper error "Error: 'data' is of type <openArray[(string, string)]> which cannot be captured as it would violate memory safety, declared here: /home/dian/Projects/stuff/ba.nim(1, 9); using '-d:nimWorkaround14447' helps in some cases"
02:53:02FromDiscord<Yardanico> to replicate - https://gist.github.com/Yardanico/c5a34d6921696fa8e5370ac5578e3068
02:53:20FromDiscord<Yardanico> it's easy to fix though
02:53:34FromDiscord<Yardanico> add as a first line in your najax
02:53:58FromDiscord<Yardanico> let headers = @headers
02:54:06FromDiscord<Yardanico> that way you'll convert an openarray to a seq locally in your proc
02:54:23FromDiscord<Yardanico> like this - https://gist.github.com/Yardanico/3806cf326214e058c24264d53f4f90d8
02:56:22bungyeah, it fix, ah, I got the point, the params around headers also cstring
02:57:08FromDiscord<Yardanico> well it doesn't matter if it's cstring or not
02:57:13bungor not, it is array of tuple
02:57:43FromDiscord<Yardanico> that doesn't matter either 🙂
02:58:09FromDiscord<Yardanico> same error
02:58:10FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2rFi
02:58:27FromDiscord<Yardanico> so yeah, it's about capturing openArray in a closure
02:59:19bungok, then I guess you can create PR fix it
03:00:39FromDiscord<Yardanico> to show an error instead? yeah
03:01:58bungthe second problem I found for js backend.
03:02:19FromDiscord<Yardanico> well it's not really specific to JS as I already said, it's just a compiler crash instead of an error message 🙂
03:03:36bungoh, alright
03:21:55FromGitter<iffy> leorize: I see how it works now (at least on posix). There's a few edge cases it's getting tripped up on (e.g. readFromStdin(5) then type "a" enter -- it will complete with "a\10" instead of waiting for more). I'm trying to adjust it to keep reading until the buffer is full.
03:22:22leorizethat's by design
03:22:35leorizeall i/o interface works like so
03:22:51FromGitter<iffy> It's also behaving strangely with this input: `(sleep 1;echo a;sleep 1;echo b;sleep 1;echo c) | nim c -r ~/tmp/leorize.nim` when `isMainModule` contains `readFromStdin(3); readFromStdin(2); readFromStdin(1)`
03:23:36FromGitter<iffy> @leorize: that first one is fine -- I can work with that. The second problem, though, the readFromStdin(1) call never gets any data before the program exits
03:24:52FromGitter<iffy> https://play.nim-lang.org/#ix=2rFp anyway, sleep if you need to -- you've already helped me a ton! I'm off to bed
03:31:00disruptekwho wants to fix an easy macros bug?
03:40:59shashlickNothing is easy, stuff I figured out last week is also brand new today
03:41:31FromDiscord<reilly> I'm probably gonna be asking lots of questions tonight. Yet another not-really-Nim-related one: What does the second half of `PMSLLHOOKSTRUCT pMouse = (PMSLLHOOKSTRUCT)lParam;` do? This is C, and `lParam` is of type `LPARAM`.
03:42:17FromDiscord<Yardanico> casts lParam to PMSLLHOOKSTRUCT type
03:42:28FromDiscord<Yardanico> it's like cast[PMSLLHOOKSTRUCT](lParam) in Nim
03:42:36FromDiscord<Yardanico> reinterprets the same memory as if it was of other type
03:43:07leorizenote that C conversion convention is weird, not all types follow that pattern
03:43:39*maier joined #nim
03:44:16FromDiscord<reilly> That's what I thought, but I wasn't sure since I've never seen syntax like that before. Also didn't even know that Nim had a `cast[]()` thing. Gonna look into that.
03:47:22FromDiscord<reilly> For context, I'm rewriting some C code in Nim to figure out how it works. The next line is `if ( NULL != pMouse )`. Is it possible for that last line to return `nil`? I don't really know off the top of my head how Nim handles nil values.
03:47:55*maier quit (Ping timeout: 246 seconds)
03:48:43FromDiscord<Yardanico> well not "return nil"
03:48:46FromDiscord<reilly> Again, sorry for all the questions, I just genuinely don't know what I'm doing.
03:48:47FromDiscord<Yardanico> but it might be a null pointer
03:48:51FromDiscord<Yardanico> so in nim you can just do the same
03:48:55FromDiscord<Yardanico> if pMouse != nil
03:49:06FromDiscord<Yardanico> or nil != pMouse if you like that style (I don't)
03:49:33FromDiscord<reilly> Oh, dope. I was worried it might behave differently in Nim. And yes, `pMouse != nil` is *so* much better.
03:49:45FromDiscord<Yardanico> well you can do if (pMouse != NULL) in C too
03:51:25FromDiscord<reilly> I know, of course you can.
03:51:25FromDiscord<Varriount> ynfle: Sure
03:51:32leorizesome C style guide use `NULL != <var>` for some reason
03:51:37FromDiscord<Varriount> @reilly: Need any help?
03:52:00disruptekleorize: because <var> = NULL is an easy typo bug.
03:52:08FromDiscord<reilly> Basically just figuring out some C syntax/symbols I don't know at the moment.
03:52:24leorizedisruptek: ah the good ol' assignment is an expression
03:52:54disrupteki have nim code where i write 0 == foo: out of habit.
03:54:06FromDiscord<reilly> Here's yet another symbol I don't recognize: the `->` in `if ( 0 == pMouse->flags )`. Maybe at this point I should just learn C.
03:54:10leorizeI came from pascal where `=` is the comparison op and `:=` is the assignment :P
03:54:24disruptekreilly: ptr deref.
03:54:26FromDiscord<Varriount> reilly: That's a dereference + member access
03:54:31leorize@reilly it's shorthand for `(*pMouse).flags`
03:54:39FromDiscord<Elegant Beef> It's atrocious 😄
03:54:49leorizein Nim you write it as `pMouse[].flags` or `pMouse.flags` (both works iirc)
03:54:55FromDiscord<Yardanico> yeah, but second is preferred
03:54:56FromDiscord<Elegant Beef> Yea both do
03:55:01FromDiscord<Elegant Beef> We automagically dereference
03:55:08FromDiscord<Yardanico> btw
03:55:18FromDiscord<Yardanico> didn't know it's possible to specify default value for multiple arguments
03:55:37FromDiscord<reilly> I'm a big fan of automagically doing things, so that works out.
03:55:42FromDiscord<Yardanico> !eval let test = (proc (a, b, c = false) = echo b); test()
03:55:45NimBotfalse
03:55:54leorizeI abused that so much that I got bit when I write C++ :P
03:56:22leorizeesp when C++ require that all arguments with defaults have to be the last
03:56:53FromDiscord<Elegant Beef> i really like the tuple unpacking
03:57:06disruptekdon't get used to it.
03:57:14FromDiscord<Yardanico> why? it's nice
03:57:22FromDiscord<Elegant Beef> What is it getting removed?
03:57:26FromDiscord<Yardanico> ?
03:57:35disrupteki've said too much.
03:57:38FromDiscord<Yardanico> why would it 😛
03:57:42FromDiscord<Elegant Beef> Yea that's my point
04:00:04FromDiscord<reilly> Tuple unpacking is a godsend, honestly.
04:03:02FromDiscord<Yardanico> just FYI there's also https://github.com/technicallyagd/unpack
04:04:45FromDiscord<reilly> This one is just weird. `PKBDLLHOOKSTRUCT keyStruct = lParam;` (`lParam` still being of type `LPARAM`) seems like it would cause a type mismatch, and of course Nim is complaining about it. That's what it says, though.
04:05:07*leorize quit (Remote host closed the connection)
04:05:31leorize[m]welcome to C, where pointers are interchangable
04:05:38*leorize joined #nim
04:05:41leorize[m]well actually most types are interchangable, not just pointers
04:05:59FromDiscord<Elegant Beef> Well C is weakly typed
04:06:02*supakeen quit (Quit: WeeChat 2.8)
04:06:24FromDiscord<Yardanico> @reilly just use cast again 🙂
04:06:41*supakeen joined #nim
04:06:46FromDiscord<Elegant Beef> And weakly typed sucks! 😄
04:07:18leorizeeven python knows that :P
04:08:21FromDiscord<reilly> At this point, it's not even figuring out the Nim equivalent, it's just figuring out C's nonsense. Statically typed or bust.
04:08:32FromDiscord<reilly> *Strongly, I should say.
04:08:34FromDiscord<Elegant Beef> What're you doing anywho?
04:08:49FromDiscord<reilly> Basically rewriting some C in Nim.
04:08:55FromDiscord<Varriount> reilly: Do you know the type definition of PKBDLLHOOKSTRUCT or LPARAM?
04:09:01FromDiscord<Elegant Beef> Ah RRIN doesnt have the same ring to it 😄
04:09:13FromDiscord<Elegant Beef> I mean RIIN
04:09:17FromDiscord<Elegant Beef> I cant spell
04:10:29FromDiscord<reilly> `PKBDLLHOOKSTRUCT` is a `ptr KBDLLHOOKSTRUCT`, which in turn is an `object` containing four `DWORD`s and one `ULONG_PTR`.
04:11:06FromDiscord<reilly> `LPARAM` is a `LONG_PTR`, which is just an `int32`.
04:11:32FromDiscord<Elegant Beef> Ah yes nice clear and linear
04:11:45FromDiscord<Elegant Beef> why is longptr 32 bit?
04:11:49FromDiscord<Elegant Beef> That's fucking weird
04:11:56FromDiscord<Yardanico> @reilly that's a poor's main alternative to object inheritance or object variants
04:12:13FromDiscord<reilly> Well that's the Windows API 🤷
04:12:27FromDiscord<Elegant Beef> poor man's* 😛
04:12:34FromDiscord<Varriount> @Elegant Beef Pointer to a long
04:12:48FromDiscord<Yardanico> (edit) 'main' => 'man'
04:12:48FromDiscord<reilly> I'm using Winim for this, but I'm assuming it's basically just as close to a copy of the original as possible.
04:12:52FromDiscord<impbox> It's longer than a short
04:12:58FromDiscord<Elegant Beef> Lol impbox
04:13:04FromDiscord<Varriount> Keep in mind, the Windows API has been around since the 16-bit era
04:13:11FromDiscord<Elegant Beef> I guess
04:13:20FromDiscord<reilly> 32-bit is the FUTURE™️
04:13:28FromDiscord<Elegant Beef> cant wait for the 48bit future
04:14:01FromDiscord<reilly> Get this: the Atari Jaguar has a whole *64 bits*.
04:14:11FromDiscord<reilly> Surely it'll be a great success!
04:14:14FromDiscord<Elegant Beef> Not possible
04:14:21FromDiscord<Yardanico> ?
04:14:36FromDiscord<impbox> Yeah, long is defined to be at least 32 bits
04:14:57FromDiscord<Yardanico> Atari Jaguar's 64-bit claim is a bit stupid though
04:15:09FromDiscord<Yardanico> sent a long message, see http://ix.io/2rFy
04:15:09FromDiscord<reilly> 64 bits != good
04:15:30FromDiscord<Elegant Beef> Impossible it's twice as good as 32bit
04:16:21leorizelong is defined to be at least 32bit
04:16:30leorizehowever if you're on x86_64 it's 64bit :)
04:16:38FromDiscord<Elegant Beef> Yea
04:16:56FromDiscord<Elegant Beef> Time to deprecate all old software, let's make a new OS, so we can use.... and we're on 128bit
04:16:59leorizelong is roughly the size of a machine word in practice
04:17:29FromDiscord<Varriount> @reilly Anyway, `PKBDLLHOOKSTRUCT keyStruct = lParam;` doesn't seem like good code to me. Yes, C allows it, but I'm not sure it isn't undefined behavior somehow.
04:18:04FromDiscord<Varriount> Anyway, is this what you're copying? https://gist.github.com/Yannicked/23919888d759876221c3
04:18:06FromDiscord<reilly> Per @Yardanico you can just cast it.
04:18:18FromDiscord<Yardanico> I mean it'll probably work
04:18:20FromDiscord<Yardanico> I'm not sure 😛
04:18:29leorizeit's not undefined behavior
04:18:40leorizesince those are pointers C will just silently convert it over
04:18:43leorizejust C things
04:18:51FromDiscord<reilly> That's not it, but it's close enough.
04:19:12FromDiscord<reilly> Same general idea: Windows API keyboard and mouse stuff.
04:19:19FromDiscord<Varriount> leorize: It doesn't hit aliasing rules?
04:20:53FromDiscord<reilly> Somehow we went from the Windows API to the Atari Jaguar
04:22:16FromDiscord<Yardanico> and all in on-topic :nimrawr:
04:22:35FromDiscord<Yardanico> good thing there are no moderators online
04:22:45FromDiscord<reilly> I haven't been able to stop thinking about how the Nim mascot might have been a badger of all things.
04:22:46FromDiscord<Elegant Beef> Just a server owner
04:23:31FromDiscord<Yardanico> @reilly well we don't have a mascot at all, yeah that badger was one of the proposed ones I think
04:23:41FromDiscord<Yardanico> I use it as my github profile picture
04:23:43FromDiscord<Yardanico> :nimrawr:
04:23:52FromDiscord<Yardanico> https://avatars3.githubusercontent.com/u/21169548?s=460&u=361f5e29fc762f2e80e69b5f7330ccecfc26d0f3&v=4
04:24:18FromDiscord<reilly> I know, you actually told me exactly that just a few days ago.
04:24:40FromDiscord<reilly> By the way, endless thanks for the contribution.
04:24:53FromDiscord<Yardanico> ah lol, np 😛
04:25:15leorize@Varriount it's casted from a generic pointer (a void*), so it should be fine
04:25:27FromDiscord<Yardanico> sometimes I just turn into a "nim inspector mode" and find small simple projects to contribute a single PR 😄
04:25:38FromDiscord<Yardanico> from github nim repos sorted by when they were last updated
04:26:35Yardanico!status
04:26:37FromDiscordUptime - 6 days, 19 hours, and 32 minutes
04:26:52FromDiscord<reilly> I'm guessing `toggled = !toggled` would be the same as `toggled = not toggled`? Not sure what else ! would do.
04:27:03FromDiscord<Yardanico> yeah
04:27:19leorize@Yardanico are you interested in testing if Nim generates any code with undefined behavior? all the sanitizers stuff are kinda cool if they work :P
04:27:42Yardanicowell I know for sure Clang things (not sure if true) that Nim's default GC does UB
04:27:46Yardanicothinks*
04:27:58FromDiscord<Varriount> @reilly `and`, `or`, and `not` are all bit-operators for integers.
04:28:11leorizegcc got sanitizers too
04:28:15FromDiscord<Yardanico> i know
04:28:23FromDiscord<Yardanico> but they're much better in clang AFAIK
04:28:42leorizenot sure, google maintains both iirc
04:28:44FromDiscord<Varriount> I know that Nim turns off strict aliasing rules
04:29:19FromDiscord<reilly> As far as I can tell it's actually `bitops.bitand()`, etc.
04:29:19FromDiscord<Varriount> Yardanico: That's because it scans the stack, I think.
04:29:47FromDiscord<reilly> That's that threw me off originally, since `and` is for conditions.
04:30:08FromDiscord<Varriount> reilly: Huh.
04:30:43FromDiscord<Yardanico> @reilly not really, you don't need bitops
04:31:02FromDiscord<reilly> Really? Nim complained when I just used `and`.
04:31:06FromDiscord<Yardanico> bitops is only needed for optimizations 🙂
04:31:22FromDiscord<Yardanico> yeah
04:31:59FromDiscord<Yardanico> !eval echo 0b11111111 and 0b01010101
04:32:01NimBot85
04:32:15FromDiscord<Yardanico> 1 + 4 + 16 + 64
04:32:19FromDiscord<reilly> Maybe it's because it was part of a condition?
04:32:29FromDiscord<Yardanico> well maybe, you need to watch out for precedence
04:32:32FromDiscord<reilly> I mean, whatever the case, I found something that works.
04:33:30leorizemaybe we can try to generate code that uses type punning and remove -fno-strict-aliasing, though I'm not sure if that can give us more performance
04:34:44FromDiscord<Yardanico> @Varriount @leorize the one I was talking about - https://forum.nim-lang.org/t/6362#39481
04:41:22FromDiscord<reilly> sent a long message, see http://ix.io/2rFK
04:42:41FromDiscord<Yardanico> first one - it's probably a C macro
04:42:51FromDiscord<Yardanico> second - it takes an address of some value
04:42:57FromDiscord<Yardanico> "addr val" in Nim
04:43:06FromDiscord<Varriount> @reilly ↵ - `CALLBACK` is a macro for `__stdcall`, it marks the function as using the stdcall calling convention. If you don't know what a calling convention is, look [here](https://en.wikipedia.org/wiki/Calling_convention).↵ - Creates an address of the MouseeCallback value.
04:44:15FromDiscord<Varriount> (edit) '[here](https://en.wikipedia.org/wiki/Calling_convention).↵' => 'here: https://en.wikipedia.org/wiki/Calling_convention.↵' | 'Creates an' => 'Gets the' | 'MouseeCallback' => 'MouseCallback'
04:45:06FromDiscord<Varriount> If you need a Nim procedure that uses the `stdcall` calling convention, use the `stdcall` pragma: https://nim-lang.org/docs/manual.html#types-procedural-type
04:49:02FromDiscord<reilly> Okay, so I've done the `{.stdcall.}` thing. Don't know if that will actually make a difference.
04:49:21FromDiscord<Varriount> Well, it should prevent the program from crashing.
04:49:55FromDiscord<Varriount> Bad things happen when a procedure gets called using an incorrect calling convention. Baaaad things
04:50:21FromDiscord<Yardanico> @reilly for nim - yes
04:50:32FromDiscord<Yardanico> it uses fastcall convention on all platforms where it can be used
04:50:34FromDiscord<Yardanico> by default
04:50:52FromDiscord<reilly> Fair enough. Don't know what these words mean, but if it works, it works.
04:50:58FromDiscord<Yardanico> "nimcall is the default convention used for a Nim proc. It is the same as fastcall, but only for C compilers that support fastcall."
04:51:28FromDiscord<reilly> There's also this other bit: `DWORD WINAPI HookThread(...` where it uses `WINAPI` like it did `CALLBACK`.
04:51:49FromDiscord<Varriount> Off the stop of my head, that's also __stdcall, but I would have to double-check
04:52:21FromDiscord<Varriount> @Yardanico That's not necessarily true. A more accurate statement would be "but only for environments that support it"
04:52:21FromDiscord<Yardanico> isn't that what I said?
04:52:31FromDiscord<Yardanico> I mean platforms = environments
04:52:44FromDiscord<Varriount> reilly: Yeah, it's also stdcall
04:52:49FromDiscord<Yardanico> I know different C compilers can possibly not support fastcall
04:53:02FromDiscord<reilly> Yay, two different names for the same thing!
04:54:40FromDiscord<reilly> Back to that `&MouseCallback` thing, Nim's complaining.
04:55:04FromDiscord<Yardanico> you just pass the nim proc as-is
04:55:14FromDiscord<Yardanico> or addr myProc if it really wants a pointer
04:55:17FromGitter<ynfle> @Varriount, if you're still here, the SIGSEGV issue ynfle/nim-test-runner@6cbe299 & https://github.com/ynfle/nim-test-runner/runs/871136877
04:55:46FromDiscord<Yardanico> @reilly just pass your nim proc without any symbols
04:56:05FromDiscord<reilly> Ah, you said to use `addr` earlier and that seems to have been the issue. Now it's complaining about something else. though.
04:56:20FromDiscord<Yardanico> yeah, you probably don't need addr
04:56:37FromDiscord<reilly> The exact original call is `SetWindowsHookEx( WH_MOUSE_LL, &MouseCallBack, NULL, NULL );`, but Nim doesn't like that I'm using `nil`.
04:56:44FromDiscord<Yardanico> nim will auto-convert a proc to a pointer
04:57:44FromDiscord<Yardanico> @reilly well the definition for it in winim is @reilly you want either SetWindowsHookEx
04:57:46FromDiscord<Yardanico> sorry
04:57:55FromDiscord<Yardanico> wrong ctrl+c ctrl+v
04:57:55FromDiscord<Yardanico> proc SetWindowsHookEx*(idHook: int32, lpfn: HOOKPROC, hmod: HINSTANCE, dwThreadId: DWORD): HHOOK
04:57:58FromDiscord<Yardanico> that's the nim definition
04:58:03FromDiscord<Yardanico> and show us the error message 🙂
04:58:17FromDiscord<Yardanico> your hook proc must be HOOKPROC* = proc (code: int32, wParam: WPARAM, lParam: LPARAM): LRESULT {.stdcall.}
04:58:39FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=2rFQ
04:59:40FromDiscord<reilly> I knew it was a type mismatch thing, but I'm not really sure what else I would put there. My only reference is this one C file.
05:01:14FromDiscord<Yardanico> it should work
05:01:24FromDiscord<Yardanico> ah wait nvm
05:01:31*maier joined #nim
05:01:35FromDiscord<Yardanico> so just try do 0 instead of NULL
05:01:38FromDiscord<Yardanico> (edit) 'so just try ... do' => 'so just tryto'
05:01:50FromDiscord<Yardanico> yeah HANDLE is `int`
05:01:57FromDiscord<Yardanico> HINSTANCE is HANDLE
05:02:10FromDiscord<Yardanico> and I got all that from winim source code 🙂
05:03:13FromDiscord<Yardanico> same for dwThreadId - use 0 insteado f nil
05:03:17FromDiscord<Yardanico> (edit) 'insteado f' => 'instead of'
05:05:33FromDiscord<reilly> That did it. That's good to take note of, I expect that'll probably show up again later.
05:05:46FromDiscord<reilly> And yeah, in retrospect I should've just checked Winim.
05:06:10FromDiscord<Yardanico> Just search for "SymbolName* = "
05:06:14*marnix joined #nim
05:06:29FromDiscord<Yardanico> that's for constants/types
05:06:54FromDiscord<Yardanico> for procs just "proc procName" for example
05:06:54*marnix quit (Read error: Connection reset by peer)
05:07:00FromDiscord<Yardanico> or use goto definition in an editor 🙂
05:07:45*marnix joined #nim
05:07:56*rockcavera quit (Remote host closed the connection)
05:10:11*Cthalupa quit (Ping timeout: 240 seconds)
05:12:05FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=2rFS
05:14:06FromDiscord<Varriount> @reilly I believe LPMESSAGE equals a pointer to MSG
05:14:38FromDiscord<reilly> Now that I've checked, you're exactly right. I can't help but wonder why.
05:14:51FromDiscord<Varriount> try `while GetMessage(addr msg, <something casted to 0>, 0, 0):`
05:15:02*Cthalupa joined #nim
05:15:17FromDiscord<Rika> cant you just use `nil`
05:15:24FromDiscord<Rika> instead of "something casted to 0"
05:15:31FromDiscord<Varriount> Not if the parameter type is an integeer
05:15:37FromDiscord<Varriount> (edit) 'integeer' => 'integer'
05:15:39FromDiscord<reilly> We just had this issue, nil != 0
05:15:44FromDiscord<Rika> i see
05:15:55FromDiscord<Rika> i'm not following the conversation
05:16:24FromDiscord<reilly> There's not a whole lot to see. Just questions about C/WinAPI, and a single Atari Jaguar reference.
05:18:01FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=2rFU
05:18:28FromDiscord<reilly> I have to cast it to a bool cause it returns a `WINBOOL`. Why? The world may never know.
05:18:41FromDiscord<Varriount> sent a code paste, see https://play.nim-lang.org/#ix=2rFV
05:19:22FromDiscord<Varriount> Actually, that would be a good contribution to winim, considering the amount of C type conversions the Windows API leverages.
05:20:01FromDiscord<reilly> That's a really good idea, actually. You're welcome to add that to Winim yourself, I wouldn't want to take credit.
05:21:08FromGitter<ynfle> Why would I get a `SIGSEGV` at different lines when I run a file again after already being compiled and run?
05:21:27FromDiscord<Varriount> ynfle: Memory corruption.
05:22:11FromGitter<ynfle> I don't modify memory directly?
05:22:34FromGitter<ynfle> How much C would I have to know to properly debug that with gdb?
05:22:34*marnix quit (Ping timeout: 240 seconds)
05:22:41FromDiscord<Varriount> ynfle: Can you show me your code?
05:23:08*letto quit (Quit: Konversation terminated!)
05:23:18FromGitter<ynfle> Do you want the commit?
05:23:24FromDiscord<Varriount> ynfle: Not too much. If you compile Nim with `--debugger:native --linedir:on`
05:24:00FromDiscord<Varriount> ynfle: Sure, although I don't know if LLDB was installed along with Clang on my laptop
05:24:03FromGitter<ynfle> I just did -g
05:24:07FromGitter<ynfle> Is that the same?
05:24:27FromDiscord<Varriount> The Nim compiler accepts `-g`?
05:24:33FromGitter<ynfle> Yup
05:24:44FromGitter<ynfle> Produces .dSYM
05:25:09FromDiscord<Varriount> I guess so? You might also want to add linedir:on though
05:25:18FromGitter<ynfle> Ok
05:25:24FromDiscord<Varriount> I don't know if the native debugging flag sets that automatically.
05:25:41FromGitter<ynfle> Ok thx
05:26:06FromGitter<ynfle> https://github.com/ynfle/nim-test-runner/commit/6cbe299 is the commit where `nimble test` gives memory corruption
05:27:10FromDiscord<Varriount> @reilly: Can you do me a favor? For one of the parameters that uses NULL in C, can you try using the `default` procedure: https://nim-lang.org/docs/system.html#default%2Ctypedesc
05:27:23FromDiscord<Varriount> And see if the compiler accepts that?
05:28:56FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=2rFW
05:29:16FromDiscord<Varriount> @reilly Yeah, you have to supply the type
05:29:30FromDiscord<reilly> Oh, duh, I don't know why I thought it would do that for me.
05:29:39FromDiscord<Varriount> Nim doesn't have return-based type inference
05:31:10FromDiscord<reilly> You know, I thinkI. I saw an error and just assumed it was a type mismatch in `SetWindowsHookEx()` without even consciously thinking about it. Clearly I'm not thinking straight.
05:31:23FromDiscord<reilly> Welp, hit the enter key prematurely.
05:31:35FromDiscord<reilly> *You know, I think I'm getting exhausted at this point.
05:31:56*Cthalupa quit (Ping timeout: 256 seconds)
05:32:56FromDiscord<reilly> And yes, that does work, now that I've actually put in the cognitive effort to do it properly.
05:33:10FromDiscord<reilly> With that said, I clearly need to sleep.
05:33:18FromDiscord<Varriount> As do I
05:34:38FromDiscord<Yardanico> me too
05:34:56FromDiscord<Elegant Beef> Not I
05:38:17*narimiran joined #nim
05:39:05bungI got the idea, I can cache karax component myself.
05:41:17FromDiscord<reilly> Last question of the night, what would be the Nim equivalent of `clock()` in `if ( ( clock() - lastClick ) > randomWaitDelay )`?
05:42:13FromDiscord<Varriount> Some function in the time module
05:42:28FromDiscord<reilly> `times`?
05:43:53FromDiscord<Varriount> https://nim-lang.org/docs/times.html
05:45:23FromDiscord<Elegant Beef> `cpuTime()` probably
05:45:34FromDiscord<Rika> best if you use getMonoTime in std/monotimes
05:46:15FromDiscord<reilly> I was actually looking at monotimes. Does the time start at the moment the program begins?
05:46:22FromDiscord<Yardanico> no
05:46:32FromDiscord<Yardanico> monotimes should be used when you want to capture monotonic timestamps
05:46:43FromDiscord<Yardanico> e.g. how much real-world time passed between two getMonoTime() points
05:46:55FromDiscord<Elegant Beef> Use `cpuTime()` from `times`
05:47:15FromDiscord<Yardanico> but yeah, for that code it's enough to use cpuTime
05:52:40FromDiscord<reilly> Okay, evidently I lied about it being the last question, but this is actually legitimately the last question, for reals.
05:52:46FromDiscord<Elegant Beef> Suuuure
05:52:51FromDiscord<impbox> are you sure?
05:53:00FromDiscord<reilly> I'm sure.
05:53:19FromDiscord<reilly> This is the last bit of code in the whole thing.
05:53:28FromDiscord<Rika> if its not, what do we do with you?
05:53:36FromDiscord<Elegant Beef> I vote ban
05:54:14FromDiscord<Yardanico> 🤔
05:54:17FromDiscord<reilly> Add a feature to Nim where it deletes system32 if I'm the one using it.
05:54:28FromDiscord<Rika> then you use linux
05:54:33FromDiscord<Rika> in which case it deletes usr instead
05:54:39FromDiscord<reilly> `sudo rm -rf /`
05:54:48FromDiscord<Yardanico> @Rika jokes on you I'm on NixOS /s
05:54:58FromDiscord<Yardanico> @reilly forgot the *
05:55:01FromDiscord<Rika> gotta use --no-preserve-root now
05:55:01FromDiscord<Yardanico> `sudo rm -rf /*`
05:55:03FromDiscord<Rika> or that yes
05:55:14FromDiscord<Yardanico> --no-preserve-root is much longer
05:55:38FromDiscord<reilly> Frankly, I'm glad I can't remember. Means it's not an issue for me.
05:56:03FromDiscord<reilly> So, the final question: How do I make a new thread out of a proc?
05:56:25FromDiscord<Elegant Beef> https://nim-lang.org/docs/threads.html
05:56:43*letto joined #nim
05:56:50FromDiscord<reilly> I know, and I've tried using `var hook = createThread(HookThread())`, but as usual, Nim is complaining about it.
05:57:05FromDiscord<Yardanico> well you gotta share the error message with us if you don't understand it yourself 😛
05:57:15FromDiscord<Elegant Beef> `createThread(varThread,proc,vars)`
05:57:16FromDiscord<Elegant Beef> no?
05:57:51FromDiscord<Yardanico> @reilly 1) compile with --threads:on
05:58:04FromDiscord<Yardanico> 2) createThread(yourVariable, HookThread)
05:58:09FromDiscord<Elegant Beef> Yea i was right↵https://nim-lang.org/docs/threads.html#createThread%2CThread%5Bvoid%5D%2Cproc%29
05:58:13FromDiscord<Yardanico> var yourVariable: Thread[void]
05:58:40FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=2rFZ
05:58:41FromDiscord<Yardanico> --threads:on
05:58:52FromDiscord<Elegant Beef> > Note: This is part of the system module. Do not import it directly. To activate thread support you need to compile with the --threads:on command line switch.
05:59:06FromDiscord<Yardanico> and since HookThread as an argument
05:59:15FromDiscord<Yardanico> createThread(myVariable, HookThread, myParam)
05:59:21FromDiscord<reilly> I would've forgotten about the --threads thing, thanks. And no, I have not done `import threads`.
05:59:34FromDiscord<Yardanico> myParam being LPVOID or compatible with it
06:00:17FromDiscord<Elegant Beef> I encourage RTFM too much methinks 😄
06:00:21FromDiscord<Varriount> @reilly did the `default` thing work?
06:00:30FromDiscord<reilly> Yes, the default thing did work.
06:00:33FromDiscord<Yardanico> yeah nim docs are more useful than some people think they are 🙂
06:00:33*Vladar joined #nim
06:00:46FromDiscord<Elegant Beef> Yea the docs are very helpful imo
06:00:54FromDiscord<Elegant Beef> I mean they're shittly organized
06:01:04FromDiscord<Elegant Beef> *looking at this*↵https://nim-lang.org/docs/theindex.html
06:01:51FromDiscord<Yardanico> I never used index
06:02:03FromDiscord<reilly> `var hook: Thread[void]` throws `undeclared identifier: 'Thread'` and `no generic parameters allowed for Thread`.
06:02:10FromDiscord<Yardanico> --threads:on
06:02:29FromDiscord<Yardanico> if you want your IDE to not show errors, add that to the config
06:02:37FromDiscord<Elegant Beef> make a `name.nim.cfg` and add it
06:02:43FromDiscord<Yardanico> e.g. create a config.nims file with "switch("threads", "on")" in it
06:02:50FromDiscord<Elegant Beef> Or that
06:03:06FromDiscord<Elegant Beef> Either one will be used to tell your nimsuggest that module is in use
06:03:21FromDiscord<Elegant Beef> *and compile with it*
06:03:26FromDiscord<Yardanico> YESS
06:03:28FromDiscord<Yardanico> I got the zen.su domain
06:03:40FromDiscord<Elegant Beef> What's so special about that name?
06:03:46FromDiscord<Yardanico> 3-letter, cool name
06:03:49*solitudesf joined #nim
06:03:51FromDiscord<Yardanico> for $9 btw
06:04:08FromDiscord<Yardanico> it was registered by someone else since long ago but was expiring today
06:04:15FromDiscord<Yardanico> but there were no websites on it really
06:04:31supakeenHola and good morning, I have an "object constructor needs object type" error on this bit of code: https://bpa.st/CG6Q and I'm a bit at a loss as I instantiate objects the same way in other places, can someone explain what's going on (do you need to see the type itself as well?).
06:04:41FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=2rG0
06:04:44supakeenYardanico: I think .su still requires a Russian citizenship to register it doesn't it?
06:04:47FromDiscord<Yardanico> @supakeen generics?
06:04:52FromDiscord<Yardanico> @supakeen well I'm Russian 😛
06:05:06FromDiscord<Yardanico> @reilly nim has case/of, not switch/case
06:05:24FromDiscord<reilly> Oh, no, this is the `config.nims`.
06:05:31FromDiscord<Yardanico> yeah ignore it
06:05:39FromDiscord<Yardanico> the default vscode extension incorrectly uses nimsuggest on it too
06:05:50FromDiscord<reilly> The only thing I can say to that is, bruh.
06:05:51FromDiscord<Elegant Beef> Also runs it 😄
06:06:11FromDiscord<Elegant Beef> Could've used the `name.nim.cfg` and wouldnt have it complaining 😛
06:06:13FromDiscord<reilly> Well, at the very least, it doesn't seem to be complaining about the threads thing anymore.
06:06:15supakeenYardanico: Here's the types involved: https://bpa.st/YXKQ
06:06:21supakeenDon't think that has generics? :)
06:06:39FromDiscord<Elegant Beef> Nah that's inheritance
06:07:06FromDiscord<Elegant Beef> What is going to be the difference between these
06:07:12FromDiscord<Elegant Beef> you might be able to use object variants
06:07:28supakeenNow that you say the other objects I'm implementing are inheriting from RootObj, not my own Object.
06:07:31FromDiscord<Yardanico> @supakeen works for me
06:07:35supakeenSo it must be around that thing.
06:07:37FromDiscord<reilly> `nim.cfg` works without complaining, although I will note that it doesn't run nimsuggest when saving it.
06:07:55FromDiscord<Yardanico> @supakeen your issue must be somewhere else
06:07:57FromDiscord<Elegant Beef> nim.cfg requires it to be `--threads:on` afaik
06:08:01supakeenYardanico: Thank you, then I must be doing something else wrong, I'll try to reduce the code to a small example and probably find out what I'm doing wrong that way.
06:08:03FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2rG1
06:08:03FromDiscord<Yardanico> @Elegant Beef doesn't have to
06:08:06FromDiscord<Elegant Beef> Ah
06:08:09FromDiscord<Yardanico> threads = on will work too
06:08:26FromDiscord<Elegant Beef> The nimscript version wont will it?
06:08:38FromDiscord<Yardanico> no, but --threads:on in .nims config will work
06:08:59FromDiscord<Elegant Beef> We really need to end the multiple config methods 😄
06:09:37FromDiscord<Yardanico> then we also need to end UFCS I guess, because "everyone should write in the One True Way ™️ "
06:10:09FromDiscord<Elegant Beef> Well no, Uniform is in UFCS 😛
06:10:24FromDiscord<Yardanico> but it's still "multiple ways to write the same thing"
06:10:32FromDiscord<Varriount> 2 ways
06:10:44FromDiscord<Elegant Beef> To me less about multiple ways, and more multiple files to do the same thing
06:10:59FromDiscord<impbox> UfCs
06:11:01FromDiscord<Elegant Beef> Like a single file would be fine if all these were acceptable in it
06:11:05FromDiscord<Yardanico> @impbox nice
06:11:09FromDiscord<Yardanico> U_f_C_s
06:11:10FromDiscord<Yardanico> that's even nicer
06:11:25FromDiscord<Yardanico> (self promotion - https://forum.nim-lang.org/t/6497)
06:11:35*marnix joined #nim
06:12:49FromDiscord<reilly> Well, it's still complaining.
06:12:58FromDiscord<Elegant Beef> Aboot?
06:13:58FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=2rG2
06:14:14FromDiscord<Elegant Beef> you didnt pass arguments
06:14:26FromDiscord<reilly> To `HookThread()`?
06:14:29FromDiscord<Elegant Beef> Wait
06:14:30FromDiscord<Elegant Beef> Im daft
06:14:31FromDiscord<Elegant Beef> 😄
06:14:37FromDiscord<reilly> Welcome to the club.
06:14:45FromDiscord<Elegant Beef> What's the proc signature of HookThread
06:14:57supakeenWell that was dumb, Position was a tuple ... more coffee necessary.
06:15:01supakeenThanks for rubber ducking.
06:15:03FromDiscord<reilly> I have no idea what that means.
06:15:12FromDiscord<reilly> Is it just the definition?
06:15:17FromDiscord<Elegant Beef> `proc HookThread(args):returnType=`
06:15:27FromDiscord<reilly> `proc HookThread(): DWORD {.stdcall.} = ...`
06:15:42FromDiscord<Elegant Beef> oh
06:15:49FromDiscord<Elegant Beef> Im too tired
06:15:49FromDiscord<reilly> It originally had an argument, per the C I'm referencing, but it's not actually used anywhere, so 🤷
06:15:56FromDiscord<Elegant Beef> I keep having "ooh, wait no"
06:16:19FromDiscord<Elegant Beef> you're calling the proc
06:16:21FromDiscord<Elegant Beef> dont call it
06:16:49FromDiscord<reilly> Uh... How?
06:17:03FromDiscord<Elegant Beef> `hook.createThread(HookThread)`
06:17:07FromDiscord<Yardanico> just don't call it
06:17:11FromDiscord<Elegant Beef> By calling it you're passing the return type
06:17:17FromDiscord<Yardanico> procedures are first-class citizens in Nim
06:17:18FromDiscord<Elegant Beef> You want a pass the proc not the return type
06:17:26FromDiscord<reilly> Okay, well, it's *still* complaining.
06:17:29FromDiscord<Yardanico> (procvar is default for quite a few years now)
06:17:53FromDiscord<Yardanico> @reilly well no one's to blame 😛 just don't say "it's complaining"
06:17:58FromDiscord<Yardanico> post the error message/question
06:17:59FromDiscord<Yardanico> (edit) 'post the error message/question ... ' => 'post the error message/questionright away'
06:18:08FromDiscord<Elegant Beef> Yea this is getting annoying imo
06:18:26FromDiscord<Elegant Beef> Without the error we can only say "RTFM please" 😛
06:18:47FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=2rG3
06:19:04FromDiscord<Yardanico> well yes
06:19:08FromDiscord<reilly> I tried changing the stuff in brackets for `var hook: Thread[void]`, but that changed nothing.
06:19:08FromDiscord<Yardanico> a thread proc shouldn't have a return type
06:19:17FromDiscord<Yardanico> proc HookThread() = # body
06:19:45FromDiscord<Yardanico> if you want to communicate between threads, you either use channels or raw pointers
06:20:28FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=2rG4
06:20:45FromDiscord<Yardanico> it's a nim proc
06:20:50FromDiscord<Yardanico> it shouldn't have stdcall convention 🙂
06:20:54FromDiscord<Yardanico> it's clear from the error
06:21:08FromDiscord<Yardanico> so just remove {.stdcall.}
06:22:09FromDiscord<reilly> That first one was my own fault, the second one makes sense I guess, but is a bit contradictory from earlier discussion. I think it should be fine, though.
06:22:22FromDiscord<Yardanico> It's not really contradictory
06:22:33FromDiscord<Yardanico> {.stdcall.} should be only for procedures you want to pass as callbacks to the winapi side
06:22:49FromDiscord<Yardanico> you're still calling this proc from Nim code itself, so it shouldn't really have {.stdcall.}
06:23:43FromDiscord<reilly> Fair enough. Perhaps I was relying a bit too hard on the reference C code; I mean, some of the functions have arguments that aren't even used in the functions themselves.
06:24:18*marnix_ joined #nim
06:24:27*marnix quit (Read error: Connection reset by peer)
06:30:33FromDiscord<reilly> Thank you all very much for your help.
06:33:50*marnix joined #nim
06:33:51*marnix_ quit (Read error: Connection reset by peer)
06:35:55*Cthalupa joined #nim
06:36:25*marnix_ joined #nim
06:38:20*marnix quit (Ping timeout: 258 seconds)
06:38:51FromDiscord<Elegant Beef> No problem
06:39:01FromDiscord<Elegant Beef> Although i didnt do much other than sass
06:44:18*marnix joined #nim
06:44:18*marnix_ quit (Read error: Connection reset by peer)
06:49:10*endragor quit (Remote host closed the connection)
06:49:38*endragor joined #nim
06:49:44*marnix_ joined #nim
06:50:14*marnix quit (Read error: Connection reset by peer)
06:51:22*Cthalupa quit (Ping timeout: 258 seconds)
06:53:45*Cthalupa joined #nim
06:54:13*endragor quit (Ping timeout: 264 seconds)
06:55:09*marnix joined #nim
06:56:17*endragor joined #nim
06:58:48*marnix_ quit (Ping timeout: 256 seconds)
06:58:48*marnix quit (Read error: Connection reset by peer)
06:59:02*marnix joined #nim
07:01:58*endragor quit (Ping timeout: 260 seconds)
07:03:24*marnix quit (Read error: Connection reset by peer)
07:03:27*endragor joined #nim
07:05:49FromDiscord<Varriount> @reilly Perhaps, one day, we can make bindings to the Nim API that are actually usable, without being painful.
07:05:58FromDiscord<Varriount> *Windows API
07:06:09FromDiscord<Varriount> (edit) 'Nim' => 'Windows'
07:09:24*marnix joined #nim
08:08:57*fredrikhr joined #nim
08:16:42*oddp_ joined #nim
08:22:21*marnix quit (Read error: Connection reset by peer)
08:52:06*Shucks joined #nim
09:09:00FromDiscord<impbox> So I just want a cross platform way to extract a zip file to a directory from my nim app (or nimble script ideally), seems https://nim-lang.org/0.11.0/zipfiles.html is no longer part of stdlib, there's "zip" which seems to require a separate dll, anything that doesn't add a new big dep? native nim would be nice
09:26:01ForumUpdaterBotNew thread by Levlan: (Nimpy) code compiles with no nimpy pragma but doesn't with the pragma, see https://forum.nim-lang.org/t/6544
09:27:30Araqimpbox: iirc zipfiles also requires a DLL
09:27:51Araqand you shouldn't mind Nimble package dependencies
09:28:20FromDiscord<impbox> i don't mind nimble package dependencies
09:28:28FromDiscord<impbox> but i'd prefer my users don't need to install dlls
09:28:55Araqwell it's Windows, put the DLL next to your .exe and stuff works
09:29:38FromDiscord<impbox> for windows, but i'd like this to be crossplatform
09:29:57*Tongir joined #nim
09:30:05FromDiscord<impbox> i just want people to be able to nimble install
09:31:13AraqI understand but I think it's hard. On the plus side, Unix users are used to the fact that nothing ever installs nor works so it's ok
09:31:55Araqnimble can finish with the lovely "to complete the installation run sudo apt-get zlib-dev"
09:32:30FromDiscord<impbox> for context, my `nico` nim lib has a tool to setup a new directory for their game with a nimble file ready to go to build it, but if they want to do an android build it needs a pretty hefty chunk of files (18MB) which i want to zip and have a tool to download and extract it into their game directory
09:32:44*Tlanger quit (Ping timeout: 272 seconds)
09:33:40FromDiscord<impbox> I guess so, i was just hoping there'd be a nice native nim way to do it, but all good if not, i'll find a way =)
09:34:37*waleee-cl joined #nim
09:36:45FromDiscord<impbox> interesting, binaries installed by nimble work, but don't seem to be in PATH
09:37:27FromDiscord<Varriount> @impbox you could write a native zip implementation
09:37:36FromDiscord<impbox> sent a code paste, see https://play.nim-lang.org/#ix=2rGD
09:37:55FromDiscord<impbox> @Varriount yeah I could.. I'd prefer not to =) but if someone's gotta do it...
09:38:47FromDiscord<Varriount> From what I've heard, it's not a terribly hard format to parse. Compression/decompression is the tricky bit.
09:39:06FromDiscord<impbox> I figure the work has been done, it's just translating it to nim
09:39:13FromDiscord<exelotl> @impbox lol reminds me of this nightmare i had once https://twitter.com/exelotl/status/641414796546560000/photo/1
09:39:48Araq<exelotl> well it's the MingW shell
09:40:02Araqyou deserve to be punished a little :P
09:40:18FromDiscord<impbox> @exelotl looks like the opposite!
09:40:35Araqdamn. my cursor inference would be better if scope based
09:40:42Araqoh well
09:40:58FromDiscord<impbox> the issue I'm actually having is nimble can't exec my nimble installed binary
09:40:58*Shucks quit (Ping timeout: 272 seconds)
09:41:34Araqdon't write pointer soups, Nim's optimizer will say "yeah, you're on your own"
09:42:34*debased joined #nim
09:42:48*debased quit (Client Quit)
09:43:06FromDiscord<flywind> I remember that I just pass the flags to make zip work in windows.
09:43:10FromDiscord<flywind> when defined(windows):↵ {.passl: "-lz".}
09:44:08*Shucks joined #nim
09:46:36FromDiscord<impbox> flywind, ooh that seems to work even with no .dll
09:46:38FromDiscord<impbox> awesome
09:47:10Araqthat's a static build against z then or something
09:47:27FromDiscord<impbox> seems like it
09:47:32FromDiscord<impbox> close enough ( '')b
10:01:11*Shucks quit (Quit: Leaving)
10:10:11*B4s1l3 joined #nim
10:10:12*B4s1l3 is now known as opDispatch
10:19:14*sagax quit (Quit: Konversation terminated!)
10:22:37*nikita` joined #nim
10:26:17*sagax joined #nim
10:29:35FromDiscord<Varriount> Araq: What do you think of the PR for detecting stack-escapes?
10:30:02FromDiscord<impbox> so if i tell nimble `exec "nicoboot.cmd"` it works, but not `exec "nicoboot"` even though both exist in `~/.nimble/bin`
10:30:28FromDiscord<Varriount> @impbox I would use process monitor to figure out what's going on.
10:31:00FromDiscord<impbox> hmm never tried that, is it like strace or something?
10:32:30FromDiscord<Varriount> Pretty much.
10:33:09FromDiscord<Varriount> It won't trace internal calls (like memcpy, etc) however it does log things like filesystem access, windows API calls, etc.
10:33:18FromDiscord<impbox> mmm cool, yeah
10:33:37FromDiscord<impbox> sounds like strace
10:38:43FromDiscord<dom96> @impbox regarding unzipping, choosenim used to use `unzip` on Linux/macOS and some Windows API on Windows. It worked well.
10:39:14FromDiscord<dom96> Now it uses nimarchive which statically links against an archive library. You can give it a try if you'd like (but I personally am not fond of it)
10:39:49FromDiscord<impbox> @dom96 thanks for the info, i'll check those out
10:40:08FromDiscord<impbox> though currently using "zip" and it seems to work if i tell it to passL:-lz
10:40:19FromDiscord<impbox> only tested on windows though
10:41:48FromDiscord<impbox> aha `try: exec fmt"nicoboot installAndroid" except: exec fmt"nicoboot.cmd installAndroid"`
10:42:02FromDiscord<impbox> dirty but it seems to work
10:43:49FromDiscord<Varriount> impbox: That's horrible and you should be ashamed. 😛
10:46:32FromDiscord<impbox> i am
10:46:44FromDiscord<impbox> but really want to just get this nico android build support out
10:52:28*couven92 joined #nim
10:55:30*fredrikhr quit (Ping timeout: 256 seconds)
10:57:32FromGitter<tim-st> is there a concept of Reader and Writer in nim like in Go or Rust, or is it planned?
11:02:39FromDiscord<Varriount> tim-st: You mean, like for a stream?
11:03:37FromDiscord<impbox> @dom96 is there a way to exec in a subdir in nimble?
11:03:44FromDiscord<impbox> doesn't seem like setCurrentDir is available
11:04:03FromGitter<tim-st> Varriount: yes, in this context, but also to allow creating generic Readers and Writers that can be easily replaced in a code based
11:05:20FromGitter<tim-st> *code base
11:05:43FromGitter<tim-st> and also chained
11:09:42FromDiscord<Varriount> tim-st: There is the functionality in the streams module, but unfortunately that is it.
11:10:38FromDiscord<Varriount> The design of the streams module has merit, but I think it could be revisited and improved, especially with the introduction of concepts and destructors.
11:11:26FromGitter<tim-st> yes, I hop the concept of Readers and Writers will be introduced or at least like in rust, that's one thing I think is missing in nim
11:11:45FromDiscord<impbox> tim-st, how do you use it? how does it differ from streams?
11:11:51FromDiscord<impbox> what advantages does it give?
11:12:32FromGitter<tim-st> can streams be used to chain multiple streams?
11:12:46FromGitter<tim-st> uncompress a stream buffered in chunks?
11:13:30FromGitter<tim-st> and define a common signature that everyone knows and uses to create new Readers in their libraries?
11:14:08FromDiscord<Varriount> Streams can technically be used in that way, yes.
11:14:11FromDiscord<impbox> I haven't tried, but you could inherit from `Stream` right?
11:14:36FromDiscord<impbox> and implement whatever underlying system
11:14:53FromDiscord<impbox> and anyeone can use the standard stream interface
11:15:25FromDiscord<impbox> https://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/streams.nim#L109 you just need to implement those procs?
11:15:51FromGitter<tim-st> for me it's not immediately clear, how this works
11:15:54FromDiscord<Varriount> The biggest deficiency I see with the streams module is that it combines multiple concepts - such as seekability, etc.
11:16:05FromGitter<tim-st> in Go it's immediately clear to me, e.g.: https://godoc.org/github.com/tim-st/go-zim#File.BlobReader
11:16:58FromDiscord<impbox> tim-st look at FileStream's implementation https://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/streams.nim#L1188 you could do something like that for whatever you're interfacing with
11:16:58FromDiscord<Varriount> Here, let me write up an example.
11:17:46FromDiscord<impbox> in `newFileStream` they assign the implementation procs (basically function pointers)
11:18:11*Cthalupa quit (Ping timeout: 240 seconds)
11:18:14FromGitter<tim-st> Yes, that sounds quite difficult instead of justing passing Reader(otherReader)
11:18:42FromDiscord<impbox> tim-st i'm talking about creating the other reader, not using it
11:19:15FromDiscord<impbox> to use it you just call `var foo = newFooStream(pathOrWhatever)`
11:19:19FromDiscord<impbox> then use foo like any other stream
11:19:53FromDiscord<impbox> what kind of Reader are you trying to make?
11:20:15FromGitter<tim-st> ok, that could work, but then there are examples missing that propagate that technique
11:21:05FromGitter<tim-st> I think a buffered reader would be a good first step
11:21:23FromDiscord<Varriount> tim-st: Yes, the streams module isn't polished or as built up as Go, Rust, or many other languages.
11:21:37FromGitter<tim-st> yes
11:22:17FromDiscord<Varriount> The reality is that, unlike those languages, Nim has very few developers (and even fewer paid developers). Most of the development time is spent focusing on the language.
11:23:27*Cthalupa joined #nim
11:23:43FromDiscord<Varriount> If you want to improve the streams module, or write a better replacement, it would be very much welcome. Personally, I dislike the fact that the `streams` type assumes that a stream will support certain features (seekability, etc.), so if that could become a compile-time guarantee, that's one improvement.
11:24:59FromGitter<tim-st> ok, when I have time the next week, I will try to copy the Go buffered reader with nim's style
11:25:49FromDiscord<Varriount> Another big improvement would be some way of wrapping a stream object, rather than a stream reference. All the other languages I'm familiar with that have a reader/writer/bufferedstream/etc model require that streams are pointers/references. This is rather inefficient memory-wise, since it means that quite a bit of pointer-chasing is required.
11:28:30FromDiscord<Varriount> @tim-st : If you do go with the Go model, you will likely need to use the same pattern as seen in the streams module - a structure with a number of procedure values. Nim doesn't have the kind of interface abstraction that Go does (as to why, mainly because such an abstraction costs quite a lot in terms of performance, if the compiler isn't specifically written to optimize it)
11:29:34FromDiscord<impbox> Couldn't you use a Concept?
11:29:46FromDiscord<impbox> That seems like the ideal use case
11:30:16FromGitter<tim-st> concept would work like rust read-trait I think
11:30:19*vicfred_ joined #nim
11:30:41FromGitter<tim-st> I think I tried to implement it one time, and it didnt really work
11:30:49FromDiscord<Rika> Why so?
11:31:08FromGitter<tim-st> I think it was because the concept wasnt stable enough
11:31:44FromDiscord<Clyybber> do you want runtime dispatch?
11:31:51FromDiscord<Clyybber> if not a simple concept should do all the tricks
11:31:57FromDiscord<Clyybber> simply check for the presence of read
11:31:59FromDiscord<Clyybber> or write
11:32:15FromGitter<tim-st> runtime dispatch wouldnt be needed for the read-trait approach, I think
11:32:30FromGitter<tim-st> yes, this was my idea
11:32:35*vicfred quit (Ping timeout: 240 seconds)
11:32:35FromDiscord<Clyybber> That would require inheritance then I think
11:32:53FromGitter<tim-st> define a nim stdlib concept that is the normal concept everyone should use
11:33:31FromDiscord<Rika> ? What do you mean
11:34:37FromGitter<tim-st> like this: https://doc.rust-lang.org/std/io/trait.Read.html
11:35:13FromGitter<tim-st> clearly defined and everyone uses it in their own reader libraries -> other can easily implement it without researching one week the idea behind it
11:36:11FromDiscord<Clyybber> seems simple enough. I guess the tricky part is how we define that errors should be handled
11:36:40FromGitter<tim-st> yes, error handling was the other thing that is currently not perfect in nim, imo
11:37:01FromGitter<tim-st> but at least it is easy to use
11:37:23FromDiscord<dawmarkir> bruh, how do you encode binary to text to store it using db_sqlite?
11:38:16FromDiscord<Clyybber> tim-st: WDYM, how could it be better?
11:38:33FromGitter<tim-st> you mean exceptions?
11:38:45FromDiscord<Clyybber> yeah, whatever you use for error handling
11:39:07FromGitter<tim-st> like java does it: guarantee at each call that there could be an exception
11:39:39FromGitter<tim-st> or introduce the "error or" like in `v` but that would make nim too different
11:39:48FromDiscord<Rika> there's the {.raises.} pragma though?
11:40:00FromGitter<tim-st> yes, but it is optional afaik
11:40:08FromDiscord<Clyybber> > guarantee at each call that there could be an exception↵wdym?
11:40:10FromDiscord<Rika> and is that bad?
11:41:12FromGitter<tim-st> I mean that the user can ignore procs that raise exceptions without showing that it is known to the user
11:41:18FromDiscord<Rika> its optional, but if you use procs w/o raises in a proc w/ `raises: []` then it still ensures that you catch all exceptions
11:41:26FromDiscord<Clyybber> what rika said :D
11:41:29FromDiscord<Rika> yeah, and?
11:41:36FromDiscord<Rika> you can choose to care or not
11:41:52FromDiscord<Rika> even if someone who made a library didnt care, you can still choose to care
11:41:55FromDiscord<Rika> and it will still work
11:42:11FromGitter<tim-st> yes, but maybe I dont always remember it
11:42:21FromDiscord<Clyybber> then {.push: raises[].}
11:42:21FromGitter<tim-st> and then it will crash unexpected
11:42:55FromDiscord<Clyybber> tim-st: Theres always the tradeoff of actually writing code that handles the cases its designed for or spending hours explicitly handling all failure/unexpected cases
11:43:00FromDiscord<Clyybber> exceptions allow you to choose
11:43:23FromDiscord<Clyybber> languages that return error codes and have macros just build exceptions around that
11:43:28FromDiscord<Clyybber> but then there is no difference
11:43:30FromDiscord<Rika> you can always push the pragma at the top of your file and it will retain that until you pop
11:43:48FromDiscord<Clyybber> for example OOM could be an exception
11:43:59FromDiscord<Clyybber> but would be extremely annoying to be return error
11:45:21*j4nvkvc joined #nim
11:48:30FromGitter<tim-st> maybe the error of the concept could be modelled an an optional, I think nim has this type
11:48:51FromGitter<tim-st> https://nim-lang.org/docs/options.html#Option
11:49:35FromGitter<tim-st> but this then likely is not compile time anymore
11:50:58FromDiscord<Clyybber> wdym is not compile time anymore?
11:51:08FromDiscord<Clyybber> using Options is fine, but they don't have an error field
11:52:00FromDiscord<Clyybber> What you want is https://github.com/arnetheduck/nim-result
11:54:47FromGitter<tim-st> yes, this could work, but sounds like chaining wouldnt be that easy
11:56:28shashlick@impbox you have withDir to exec inside a directory
11:56:39*rockcavera joined #nim
11:59:38shashlickAlso, nimterop makes it easy to download binaries of zlib with minimal effort, let me know if you want details
12:03:47bungcan I use niv
12:04:03bungsame port as http server
12:04:10bunghttps://github.com/niv/websocket.nim
12:05:18*krux02 joined #nim
12:06:01*supakeen quit (Quit: WeeChat 2.8)
12:06:38*supakeen joined #nim
12:10:40*haxscramper joined #nim
12:17:45*Trustable joined #nim
12:19:15haxscramperI have template which uses `deques` interally - in order for it to compile correctly user either has to `import deques` in their code or I need to `export deques` from module where template is defined.
12:19:16haxscramperSecond approach only works once - e.g if someone uses my template in
12:19:16haxscrampertheir template it is still necessary to `export deques` again. This is
12:19:16haxscramperan easy solution but it will cause deques to be imported whenewher I
12:19:18haxscramperuse my module.
12:19:21haxscramperIs there some way to fix this or I just have to document this as
12:19:25haxscramperrequirement for template?
12:21:02FromDiscord<Rika> I think mixins have to do with it or something but I don't know how to precisely describe kt
12:21:02FromDiscord<Rika> It
12:21:02FromDiscord<Varriount> haxscramper: https://nim-lang.org/docs/manual.html#generics-bind-statement
12:21:06FromDiscord<Varriount> That might work, although it's more for generics, so I don't know if it will work with templates.
12:23:02haxscramperNo, does not work with templates.
12:24:00haxscramperNeed to test ho much does `export <module>` affects compilation time then
12:24:54FromDiscord<lqdev> `mixin` works in templates
12:28:05haxscramperOh, yes it does. Very strange though - from documentation it seems like they have opposite behaviour and `bind` is what I need here.
12:49:56FromDiscord<Clyybber> bind statement works in templates
12:53:35FromDiscord<Clyybber> but maybe not the way you expect it to
12:53:38narimiranGuido van Rossum has just made Araq's day 1000x better: https://lwn.net/Articles/823292/ :)
12:54:58FromDiscord<Clyybber> lol, why?
12:55:17FromDiscord<Clyybber> because it got rejected?
12:55:37narimirannah, because he even considered it
12:55:46narimiran"nim was right. again"
12:56:10FromDiscord<Clyybber> nim was right.
12:56:14FromDiscord<Clyybber> and with the rejection
12:56:20FromDiscord<Clyybber> nim will be the only one right.
12:56:42narimiranfor those that just skimmed through the article, i'm talking specifically about the "Really, *any* method" part
12:56:47Oddmongeri always type «print» instead of «echo» in nim
12:57:14Oddmongerbecause i have fought on the «echo» reflex for years, outside of the shell, and won at the end
12:57:14FromDiscord<Clyybber> heh, just alias it
12:57:55Oddmongeris it permit ? Won't you find me at night with torches, ropes and so ?
12:58:02narimiranwe will
12:59:04FromDiscord<Clyybber> you will hear the echo of your screams
12:59:14narimiran:)
12:59:56FromDiscord<KingDarBoja> Lmao, that Python post is sooo Nim
13:02:08*chemist69 quit (Ping timeout: 256 seconds)
13:03:02*chemist69 joined #nim
13:03:12*couven92 is now known as fredrikhr
13:10:27bunghttps://github.com/pragmagic/karax/pull/149 I create static server and websocket reload for karax
13:10:27disbotadd static server,websocket refresh watching mode
13:18:10*NimBot joined #nim
13:22:18*waleee-cl quit (Quit: Connection closed for inactivity)
13:24:33*fredrikhr quit (Read error: Connection reset by peer)
13:24:57*fredrikhr joined #nim
13:46:19*vicfred_ quit (Quit: Leaving)
13:46:38*vicfred joined #nim
13:47:23Araqnarimiran, not sure I get the point
13:47:38Araqthe reaction was predictably silly
13:59:03FromDiscord<Clyybber> Araq: Should tyAlias be removed?
13:59:22FromDiscord<Clyybber> So that `type A = B` is internally `type A[] = B[]`
14:00:13FromDiscord<Clyybber> (edit) 'A[]' => 'A[T]' | 'B[]`' => 'B[T]`'
14:00:30Araqwell tyAlias was introduced as a bugfix
14:00:46Araqusually things start out as simple and bugfixes introduce the complexity
14:01:27FromDiscord<Shucks> Im getting crazy with vscode again
14:01:36FromDiscord<Shucks> gosh
14:02:02FromDiscord<Clyybber> Araq: Yeah, I'm wondering if theres advantages to treating `type A = B` as an tyAlias instead of a generic
14:02:27FromDiscord<Clyybber> Or if it was just because generics were too buggy at the time it was introduced
14:10:21*abm joined #nim
14:19:30*narimiran quit (Ping timeout: 256 seconds)
14:20:29*drewr quit (Quit: brb)
14:24:53*marnix joined #nim
14:25:05*bung quit (Quit: Lost terminal)
14:25:34*marnix_ joined #nim
14:25:42*marnix quit (Read error: Connection reset by peer)
14:25:54*sentreen quit (Ping timeout: 240 seconds)
14:29:43*marnix joined #nim
14:29:59Araqit never occured to me to treat them as generic
14:30:38AraqtyAlias reflects what's really going on, however. ideally we would eliminate type aliases early
14:31:01Araqso that type Alias = int; seq[Alias] is always constructed as seq[int]
14:32:32*drewr joined #nim
14:32:32*marnix_ quit (Ping timeout: 256 seconds)
14:36:13*marnix_ joined #nim
14:38:46*marnix quit (Ping timeout: 256 seconds)
14:39:36Araqalso, a generic type has parameters, an alias does not
14:43:37*waleee-cl joined #nim
14:45:20FromDiscord<Clyybber> Yeah, my idea was to replace alias by generic type without parameters
14:46:37FromDiscord<Clyybber> But I'm not if its a good idea
14:46:51*chemist69 quit (Quit: WeeChat 2.7)
14:47:23Araqlol
14:47:27*chemist69 joined #nim
14:47:29Araqwhile line != "":
14:47:41Araq match(line) # wasMoved(line) ?!
14:47:50Araq return # DFA rules...
14:48:16Araqthe compiler is getting smarter than me
14:48:39*chemist69 is now known as apahl
14:49:27*apahl quit (Client Quit)
14:50:35FromDiscord<Shucks> 😮
14:52:57*maier quit (Ping timeout: 256 seconds)
14:56:20*sentreen joined #nim
14:58:49*apahl joined #nim
14:59:15Araqhttps://github.com/nim-lang/Nim/issues/14971 *sighs*
14:59:16disbotOrderedTable del and pop are slow ; snippet at 12https://play.nim-lang.org/#ix=2ryn
14:59:48Araqam I the only one who doesn't fill tables with millions of entries?
15:00:29Araqif you have millions of entries chances are getting high the data is valuable. valuable enough for a database.
15:01:23PrestigeSlightly off topic looking at the issue, does github not have nim syntax highlighting or did they just not format the post correctly?
15:01:55Araqscroll down and see proper highlighting
15:02:05Prestigeah, good
15:02:05Araqit's just that the OP couldn't use ```nim
15:03:02PrestigeI guess there could be use cases for large tables, but there are likely better data structures to use if you have so many entries
15:06:06leorize[m]guess someone have to implement a SQLite table module that use an in-memory table :P
15:07:08*Prestige posts a link to Redis
15:08:30leorize[m]@iffy I think there's an issue with asyncdispatch, I added an `echo` into the callback and it appears to me that it's only called for the first two times
15:09:07*rockcavera quit (Read error: Connection reset by peer)
15:09:33*rockcavera joined #nim
15:10:27FromGitter<iffy> That's what I was seeing, too. I wondered if the callbacks returning `true` cause more than just that callback to be removed from the prior addRead
15:10:50planetis[m]Would it be an "easy" pr to adapt tables.nim to use sparse list of indeces (like python's dictionaries), or it doesn't fit their implementation?
15:11:28leorize[m]probably wouldn't fit their implementation, since they require traversal to get to an index iirc
15:11:34planetis[m]*indices
15:11:41Araqplanetis[m], I would love to see such a PR but beware that Python's impl is suboptimal too
15:12:03leorize[m]it might be better to name that `get` just so it signify the potential cost
15:12:18leorize[m]@iffy you might want to try adding some debugging lines into asyncdispatch
15:12:34planetis[m]I tried to figure it out myself, but there're so many templates, i always give up
15:12:51leorize[m]the code responsible should be `asyncdispatch.processBasicCallbacks`
15:12:51Araqyeah I know
15:13:04FromGitter<iffy> @leorize: good idea -- I'll probably get some time today to test that some more
15:13:04Araqwe can start with a refactoring and remove some templates
15:13:43Araqhowever, it might result in code duplication which is almost always worse
15:14:17Araqsee Miran's recent work on "parsePercent" which exists twice in the stdlib, yay
15:14:25Araqtwo locations where to fix the bug
15:14:37planetis[m]But there seems strtabs have survived without all these templates and could be a good place to start
15:15:53Araqstrtabs is so weird
15:15:55planetis[m]If their implementation is in sync with tables, or they have diversed?
15:16:07AraqI dunno, strtabs is a zombie
15:16:21Araqunkillable, it predates Nim's generics
15:16:55FromDiscord<Clyybber> Araq: https://github.com/nim-lang/Nim/issues/14990 fails as an alias works as an explicit generic
15:16:57disbotAlias type forgets implicit generic params depending on order ; snippet at 12https://play.nim-lang.org/#ix=2rHC
15:18:17FromDiscord<Yardanico> @Clyybber looks a bit similar to my issue
15:18:27FromDiscord<Yardanico> Where changing the order fixes it too
15:18:39FromDiscord<Clyybber> oh? which one?
15:18:48leorizeAraq: iirc you have an idea on how concepts should be done, right? any rfc coming from that? :P
15:19:14FromDiscord<Yardanico> https://github.com/nim-lang/Nim/issues/14758
15:19:15disbotC compiler error with inline and a proc field in an object ; snippet at 12https://play.nim-lang.org/#ix=2qz4
15:19:38planetis[m]One more question, compactdict (and python) change the type of the indices depending of the size of the hashtable. I think from int16 up to int64). Do we want to keep this logic, or always use int type? (Since its not idiomatic nim)
15:20:16FromDiscord<Clyybber> @Yardanico Thanks, I don't think its related, since mine fails in semcheck
15:20:18Araqalways use int, Python only gets away with it since it already pays the heavy price of indirections
15:20:41Araqwell "heavy", Intel moved into the unmeasurable noise level
15:20:51Araqbut I heard ARM is becoming big
15:22:29Araqproc matchImpl(str: string, pattern: Regex, start, endpos: int, flags: int): Option[RegexMatch] =
15:22:29Araq var myResult = RegexMatch(pattern : pattern, str : str)
15:23:04Araq^ sure, we should always return everything the callee already knows by construction.
15:23:31Araqobjects should always contain everything some fool might need later on, nobody minds bloated code
15:24:05Araqoh and ':' is an infix operator so we use wrong spacing around it
15:24:11*Araq sighs
15:25:48FromDiscord<Yardanico> By the way, is it safe to create a string with newString(64) for example, and pass it to a POSIX call which expects a cstring? Like gethostname(cstring(mystr), 64)
15:25:49*marnix_ quit (Read error: Connection reset by peer)
15:26:20FromDiscord<Yardanico> And it'll modify mystr directly (it seems to work, so just asking to be sure)
15:26:43leorize[m]yes it's safe
15:26:54leorize[m]the same pattern is used in the stdlib
15:27:08FromDiscord<Yardanico> Ah okay then
15:27:14*marnix joined #nim
15:27:22shashlick@Yardanico - were you able to create a minimal example of the plugins failure with arc?
15:27:34FromDiscord<Yardanico> Not yet, no :(
15:27:56FromDiscord<Yardanico> I couldn't find the second place where CMD was getting destroyed yet
15:28:01FromDiscord<Yardanico> cmd*
15:28:03shashlickokay but might be able to describe the issue to araq and clyybber and see if it is an issue they will entertain
15:29:43shashlickAraq / Clyybber if you are around - file in question is https://github.com/genotrance/plugins/blob/master/tests/test1/plg1.nim#L11 - this is compiled with --app:lib and callCommand() is a proc in the main executable that loads the dll
15:30:03shashlickissue is that cmd gets destroyed and segfaults
15:30:46FromDiscord<Yardanico> But if we add GC_ref(cmd) it goes further
15:30:54FromDiscord<Yardanico> So it's getting destroyed here and somewhere else
15:30:59FromDiscord<Yardanico> Which is weird
15:34:22FromDiscord<Yardanico> Well actually it's not weird if I'm thinking correctly
15:34:59FromDiscord<Yardanico> So we pass cmd from a library to the host, and maybe we still use cmd after pluginLoad ended
15:37:46FromDiscord<Yardanico> @shashlick it's just that it was a bit hard for me to understand how plugins call each other in the example, order and stuff
15:37:52FromDiscord<Yardanico> Maybe I should just remove unused code first
15:38:04shashlicksounds fair
15:38:51shashlickcmd is created in pluginLoad, passed to main exe which modifies it, then returns to pluginLoad where it is printed
15:39:24shashlickcmd is a ref object and contents are modified in callCommand
15:43:43FromDiscord<Yardanico> By the way, is it possible to print the refcount of a ref object? I tried with copying stuff from refs_v2 and modifying it to return head(p).rc, but it seems to be some mask rather than just a count
15:45:00FromDiscord<Clyybber> shashlick: Can you just gc_ref it from the loaded library?
15:45:16FromDiscord<Clyybber> @Yardanico Hmm it should be possible
15:45:27FromDiscord<Yardanico> I know about nimArcDebug and traceArc but they didn't help in that case
15:45:58FromDiscord<Clyybber> @Yardanico you ahve to shift by rcShift
15:46:02FromDiscord<Clyybber> which is 4
15:46:13FromDiscord<Clyybber> or 3 on gc:arc
15:46:13FromDiscord<Yardanico> Oh okay
15:46:19FromDiscord<Yardanico> I'll try soon
15:46:28FromDiscord<Clyybber> head(pc).rc shr rcShift
15:48:06shashlickClyybber: i can but users of plugins won't know to call GC_ref like this
15:48:24shashlicksimply interacting between main executable and dlls
15:48:30FromDiscord<Clyybber> hmm, do you compile with sinkInference on?
15:48:43shashlickhaven't tried
15:48:56FromDiscord<Clyybber> try with --sinkInference:off and GC_ref from the main executable
15:49:45FromDiscord<Clyybber> and if that works try removing the sinkInference:off switch again
15:50:10FromDiscord<Yardanico> I tried without sink inference, but before I found out that GC_ref helps it get further
15:50:22FromDiscord<Yardanico> So I'll try
15:52:31FromDiscord<Yardanico> So this is valid Nim in the end https://github.com/nim-lang/Nim/issues/14985 ?
15:52:33disbot[ARC] proc with both explicit and implicit return results in a C compiler error ; snippet at 12https://play.nim-lang.org/#ix=2rEX
15:55:07FromDiscord<Clyybber> sure
15:58:08FromDiscord<Yardanico> what's interesting is that it seems to free the "cmd" from a library in the main binary
15:58:27FromDiscord<Yardanico> if I compile libraries without useMalloc, but the main binary with it - it crashes with "free(): invalid pointer" which comes from libc
16:00:16FromDiscord<Yardanico> but yeah @Clyybber , if I add GC_ref in callCommand it crashes later
16:00:21FromDiscord<Yardanico> although in same place with/without sinkInference
16:00:58FromDiscord<Clyybber> hmm ok, weird
16:01:05FromDiscord<Clyybber> add GC_ref twice :p
16:01:12FromDiscord<Yardanico> I already debugged a bit, and it crashes in a very different places
16:01:14FromDiscord<Yardanico> (edit) 'places' => 'place'
16:01:16FromDiscord<Clyybber> actually, maybe thats not that stupid
16:01:44FromDiscord<Clyybber> because if its getting sinked into loadPlugin
16:01:45FromDiscord<Yardanico> it crashes when it tries to access a table with plugins (with their handles and callbacks)
16:01:52FromDiscord<Clyybber> when you gc_ref it twice?
16:02:01FromDiscord<Yardanico> doesn't matter
16:02:04FromDiscord<Clyybber> ok
16:02:07FromDiscord<Yardanico> it's not related to cmd, that cmd seems to work fine
16:02:10FromDiscord<Clyybber> ok
16:02:31FromDiscord<Yardanico> it crashes on this line https://media.discordapp.net/attachments/371759389889003532/732990487379836938/unknown.png
16:02:50*lritter joined #nim
16:03:32FromDiscord<Yardanico> that manager.plugins[name] is not nil, but when accessing "depends" it crashes
16:03:42FromDiscord<Yardanico> depends is a seq[string] though
16:03:49FromDiscord<Yardanico> so maybe need another GC_ref
16:03:59FromDiscord<Yardanico> ah actually might be true
16:04:07FromDiscord<Yardanico> or not 😦
16:07:51FromDiscord<Yardanico> also repr for arc can't print closures
16:16:23disruptekplanetis, araq: you should consider using skiplists for the tables optimization.
16:16:50FromDiscord<Clyybber> hmm? but skiplists are good for ordered datastructores with fast insertion
16:17:04leorizeidk why but writing C++ is making me hates programming
16:17:05FromDiscord<Clyybber> not necessarily tables where order doesn't matter I think
16:17:10disruptekyes, but you can define the order any way you want.
16:17:11leorizewhen will nim go mainstream to save me
16:17:25FromDiscord<lqdev> leorize: compile times?
16:17:35leorizeheaders
16:17:39FromDiscord<lqdev> ah.
16:17:41leorizeand the fact that I have to write C++98
16:17:42FromDiscord<lqdev> yeah, that's a PITA.
16:17:57FromDiscord<lqdev> why?
16:18:02leorizeand that templates are pure shit here
16:18:10FromDiscord<lqdev> oof
16:18:18leorizethe code has to compile on GCC < 3 :)
16:18:24FromDiscord<lqdev> but templates always were pure shit in c++
16:18:47disruptek!repo skiplists
16:18:47disbothttps://github.com/disruptek/skiplists -- 9skiplists: 11generic skip list implementations 15 1⭐ 0🍴
16:18:50FromDiscord<Yardanico> @leorize what cursed hardware are you using it for
16:18:59disruptekit's not done yet, but it's pretty memory-efficient.
16:19:09leorizeI have to write a class/struct to use a conditional expression as a template parameter
16:19:27leorize@Yardanico x86
16:19:30FromDiscord<Clyybber> disruptek: I used skiplists for drawing order in my game
16:19:44leorizebut Haiku's x86, aka BePC
16:19:45FromDiscord<Clyybber> but that was in lua :d
16:19:49FromDiscord<Clyybber> (edit) ':d' => ':D'
16:19:58FromDiscord<Yardanico> @leorize but Haiku supports modern GCC too, doesn't it?
16:19:59FromDiscord<Yardanico> at least latest betas
16:20:47leorizeofc it does, but system libraries have to be compatible with GCC 2 for x86 32bit support
16:20:54FromDiscord<Yardanico> ohh
16:21:05FromDiscord<Yardanico> so you're working on haiku then? 😛
16:21:41leorizeyep, I'm fixing their network stack
16:22:21leorizethe api is terrible and I'm juggling with locks because they decided to persue threaded everything
16:22:53FromDiscord<Yardanico> at least it's better than global kernel lock like in some *BSDs 😛
16:22:59disruptekit's annoying that i cannot work with pragmas on anything but procs within our macro system.
16:23:10disruptekor at least, the interface is different.
16:23:30leorizeyea, proc pragmas remain the most straight forward one
16:24:16leorizeall other forms are weird and practically useless
16:24:26FromDiscord<Yardanico> wdym
16:24:33FromDiscord<Yardanico> pragmas for object fields can be very useful
16:24:52FromDiscord<Yardanico> easiest example being serialization
16:24:52leorizeexcept that type section pragma is broken :)
16:25:08FromDiscord<Stuffe> lol i just got geohotz to try Nim live on twitch
16:25:29FromDiscord<Clyybber> disruptek: Eh, whats the down pointer do?
16:25:37FromDiscord<Clyybber> Does it point to the same element but in a lower level?
16:25:40FromDiscord<Yardanico> @Stuffe why brew
16:25:41FromDiscord<Yardanico> nOOO
16:25:55FromDiscord<Recruit_main707> > lol i just got geohotz to try Nim live on twitch↵@Stuffe link?
16:26:00FromDiscord<Yardanico> https://www.twitch.tv/georgehotz seems like
16:26:01leorize[m]oi, brew got one of the best nim setup
16:26:07FromDiscord<Stuffe> https://www.twitch.tv/georgehotz
16:26:08FromDiscord<Stuffe> yeah
16:26:10leorize[m]it actually works, unlike choosenim
16:26:25disruptekclyybber: it points to a new element at a lower level that may share the same value.
16:26:41leorize[m](actually don't quote me on choosenim, I've only heard people and haven't tried it) :P
16:27:05FromDiscord<Yardanico> copy-pasting commands 😄
16:27:10FromDiscord<Clyybber> disruptek: But it will always share the same value no?
16:27:15leorize[m]but the brew package is pretty well made
16:27:40disruptekclyybber: the idea is to "waste" the value but gain the elegance that every skiplist is a skiplist of a skiplist.
16:28:08FromDiscord<Clyybber> @Stuffe tell him to use https://github.com/alaviss/nim.nvim/ pls
16:28:31disruptekyou could convince me to do it with "tall" elements, or submit a pr that adds them adjacently.
16:28:46FromDiscord<Stuffe> pasted it
16:28:53FromDiscord<Yardanico> @Clyybber that's not for vim
16:28:57FromDiscord<Yardanico> it's for neovim
16:29:22disrupteki use pragmas to pass information between parts of my cps macro.
16:29:31FromDiscord<Clyybber> @Yardanico figured he'd use nvim
16:29:34FromDiscord<Clyybber> neovim
16:29:36FromDiscord<Yardanico> seems to be plain vim
16:29:52FromDiscord<Clyybber> disruptek: Theres no elegance in wasting memory :p
16:29:57FromDiscord<Yardanico> inb4 crash
16:30:00FromDiscord<Yardanico> compiler crash 😛
16:30:05FromDiscord<Clyybber> just use a seq to store the pointers for each level
16:30:13disrupteki think you'll find it wastes much less memory than a seq.
16:30:19FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/732997482312630403/unknown.png
16:30:19FromDiscord<Yardanico> 😛
16:30:28haxscramperIf generic in other module does not have `mixin` statement on some symbol I have to import that module in caller? For example `sets.difference` internally uses `items` - it is not possible to write generic proc that uses `difference` and use it [proc] without importing `sets`. Or I'm missing something again? Example code: https://play.nim-lang.org/#ix=2rI0
16:30:28haxscramperIt also works If I add `mixin items` *AND* edit stdlib source code to call `items` explicitly (e.g `for item in items(s1)`). When used implicitly (`for item in s1`) it does not work.
16:30:41FromDiscord<treeform> mbuchel, thank you for doing the compression part for ws.
16:30:49FromDiscord<Clyybber> disruptek: No. It wastes O(n) memory
16:31:06leorizeoh hey someone just said they use Nim in production :P
16:31:19FromDiscord<treeform> I use nim in production?
16:31:23disruptekno, because it costs no memory at the bottom and only 1-3 ptrs per extra level.
16:31:28leorizeon twitch I mean
16:31:47FromDiscord<Recruit_main707> someone tell him how to use arrays pls
16:31:53FromDiscord<Yardanico> to use sequences*
16:31:56FromDiscord<Stuffe> lol its painful to watch
16:32:01FromDiscord<Stuffe> ah he found out
16:32:23FromDiscord<Clyybber> disruptek: Eh, you waste sizeof(value) * levels
16:32:32FromDiscord<Clyybber> Just store the value once
16:32:44FromDiscord<Clyybber> And use a seq for the leveled pointers
16:32:49disruptekyes, but the value is just a ptr.
16:33:05FromDiscord<Clyybber> How do you know?
16:33:14disruptekbecause i'm the one impl it.
16:33:21FromDiscord<Clyybber> but then its not generic?
16:33:39disrupteksure it is. the word is "implementations". this is the impl i needed.
16:33:43disruptekmore will follow.
16:33:56disruptekit's like you guys forget that you can pr projects other than the compiler.
16:34:14FromDiscord<Clyybber> sent a code paste, see https://play.nim-lang.org/#ix=2rI5
16:34:15FromDiscord<Clyybber> Use this ^
16:34:25disruptekno.
16:34:41FromDiscord<Yardanico> @Stuffe he thinks that nim is python
16:34:42FromDiscord<Clyybber> ¯\_(ツ)_/¯
16:34:47disrupteksubmit a pr.
16:35:20FromDiscord<Stuffe> he knows it compiled though obviously
16:35:40FromDiscord<Yardanico> but he thinks it's a python clone or something 😛
16:35:56FromDiscord<Stuffe> true
16:36:03FromDiscord<Yardanico> also len(a) is incorrect
16:36:05FromDiscord<Yardanico> p ..< len(a)
16:37:04leorizeor `[p..^1]` like a sane person :P
16:38:08FromDiscord<Yardanico> he doesn't like inclusive slices
16:38:11FromDiscord<Stuffe> haha
16:38:14FromDiscord<Yardanico> see
16:38:19FromDiscord<Yardanico> he thinks nim is python
16:38:30leorize> "that doesn't match python" lmao
16:38:49FromDiscord<Yardanico> "let var" 😄
16:38:52leorize> `let var` rust confirmed
16:38:55FromDiscord<Yardanico> i'm waiting for a compiler crash
16:39:10leorize!eval let var a = 0
16:39:12NimBotCompile failed: /usercode/in.nim(1, 5) Error: identifier expected, but got 'keyword var'
16:39:18leorizenah won't crash
16:39:35FromDiscord<treeform> why georgehotz has so many viewers?
16:39:42FromDiscord<Stuffe> All I told him was "nim is so good I can't use python anymore"
16:39:52*fredrikhr quit (Quit: Client Disconnecting)
16:39:57FromDiscord<Yardanico> he thinks nim is python and rust ??
16:40:05FromDiscord<Clyybber> really annoying when you can't write because paywall
16:40:08leorizeok I'm not looking at that stream anymore for my sanity :P
16:40:13FromDiscord<Yardanico> @Clyybber it's not
16:40:15FromDiscord<Yardanico> follow is free
16:40:17FromDiscord<Stuffe> he jail broke the first iphone and the playstation
16:40:19FromDiscord<Clyybber> oh
16:40:20FromDiscord<Yardanico> but you need to wait 10 minutes after that
16:40:30FromDiscord<Stuffe> i think thats mainly why he is known
16:40:41FromDiscord<Yardanico> he could've ported the python impl easily
16:41:25FromDiscord<Yardanico> well he's having progress 😛
16:41:26leorize[m]well don't blame him too much, performing on stream isn't easy :P
16:41:37FromDiscord<Yardanico> what memory leak?
16:41:38FromDiscord<Yardanico> LMAO
16:41:46FromDiscord<Yardanico> he doesn't know about the gc 😛
16:42:31FromDiscord<Yardanico> he's done @Shucks
16:42:44FromDiscord<Yardanico> @Stuffe *
16:42:46FromDiscord<Shucks> huh
16:43:52FromDiscord<Yardanico> well there was a person in chat using Nim
16:43:55FromDiscord<Yardanico> so we're not *that* unpopular 🙂
16:44:53FromDiscord<Yardanico> That's this person - https://www.youtube.com/watch?v=jr3W2NCR0AM
16:44:53disruptektake some notes on what trips up a newbie.
16:45:14FromDiscord<Yardanico> @disruptek well georgehotz seems to be pretty experienced in programming
16:45:16FromDiscord<Yardanico> and googled fast
16:45:23FromDiscord<Stuffe> yeah array vs sequence and the inclusive indexing thing
16:45:30FromDiscord<Yardanico> but really he tripped on some stuff because he assumed nim to be python and rust
16:45:32FromDiscord<Stuffe> tripped me up too once I think
16:45:43disruptektake some notes, please.
16:45:47FromDiscord<Yardanico> saying "looks like python" is a double-edged sword
16:45:47FromGitter<alehander92> ohh
16:45:51disrupteki don't have the bandwidth for video.
16:46:02FromGitter<alehander92> yeah
16:46:06FromGitter<alehander92> lisp + python + c++
16:46:12leorizewe really need to fix our pr material :P
16:46:12FromGitter<alehander92> seems a bit better to me
16:46:15FromDiscord<Yardanico> e.g. he used "let var a = 5"
16:46:20FromDiscord<Yardanico> because he assumed "let" to be "like in rust"
16:46:26FromDiscord<Yardanico> even though nim had it before rust even existed 😛
16:46:39FromGitter<alehander92> but it's very old
16:46:44FromGitter<alehander92> i think it's lisp
16:46:52FromGitter<alehander92> the idea of `let` as naming a name
16:46:56FromDiscord<Yardanico> nonono
16:47:00FromDiscord<Yardanico> ah well yeah if you mean let
16:47:07FromGitter<alehander92> we can
16:47:07FromDiscord<Yardanico> but well, people don't know that usually
16:47:11FromGitter<alehander92> make a site where
16:47:11FromDiscord<Yardanico> but it's okay
16:47:18FromGitter<alehander92> we compare features and their history
16:47:21FromDiscord<Yardanico> We already have Nim for Python programmers for example
16:47:26FromGitter<alehander92> i saw a guy comparing cast syntaxes across the languages
16:47:30FromDiscord<Yardanico> but I don't like the design of that wiki page
16:47:37FromGitter<alehander92> nah i am interested in more general kind of gallery
16:47:54leorizewe should've make asciidoc the default for those wiki pages
16:47:57FromGitter<alehander92> like having 30 features and having history for each of them
16:48:05leorizethen you get a free TOC generator
16:48:06FromDiscord<Yardanico> @leorize I mean this -
16:48:07FromGitter<alehander92> lang design thing, not only nim
16:48:11FromDiscord<Yardanico> https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers
16:48:13FromDiscord<Yardanico> emojis, etc
16:48:17FromDiscord<SirJosh> sent a code paste, see https://play.nim-lang.org/#ix=2rI6
16:48:31FromDiscord<Yardanico> include
16:48:40FromDiscord<Yardanico> wait, wdym "exists in memory"?
16:48:43FromDiscord<Yardanico> just save it to a file and compile
16:48:53FromDiscord<Yardanico> and your boilerplate should be before the actual transpiled code
16:48:56FromDiscord<SirJosh> sounds yucky
16:48:59FromDiscord<Yardanico> why? no
16:49:02FromDiscord<SirJosh> hmm lemme try explain better
16:49:03FromDiscord<Yardanico> /tmp and friends exist
16:49:14FromDiscord<SirJosh> eck temp dirs yeah
16:49:16FromDiscord<SirJosh> i guess that'd work
16:49:17FromDiscord<Yardanico> and for boilerplate itself you can even use normal imports where possible
16:49:21FromDiscord<Yardanico> like https://github.com/Yardanico/nimpylib for example
16:49:28FromDiscord<Yardanico> (the screenshot here is outdated, don't check it)
16:50:10FromDiscord<Yardanico> so you can just write normal nim modules
16:50:14FromDiscord<Yardanico> which implement the boilerplate you need
16:50:22disruptekif it exists in memory, just output it. this makes no sense to me.
16:50:31FromDiscord<Yardanico> also what's the source language?
16:50:46FromDiscord<Shucks> I finally got the pluginmanager for neovim running on windows. Did anyone ever tried the nim plugin for neovim on windows?
16:50:50FromDiscord<SirJosh> you don't want to know :^) (javascript)
16:51:05FromDiscord<Yardanico> @Bung did some progress on transpiling TypeScript fwiw
16:51:13FromDiscord<SirJosh> oh neat
16:51:14FromDiscord<Yardanico> but it was for specific projects I think
16:51:23disruptekyou want to convert javascript to c?
16:51:23FromDiscord<SirJosh> would be interested to hear
16:51:36FromDiscord<SirJosh> that'd work sure
16:51:43FromDiscord<Clyybber> @SirJosh Just put your boilerplate into a file and include it at the top
16:51:45disruptekwhat's the actual goal?
16:51:56disruptekyou have some js. what are you trying to do with it? why?
16:51:58FromDiscord<Clyybber> disruptek: To Nim obviously :p
16:52:03FromDiscord<Yardanico> yeah, transpiling JS wouldn't be so easy because of the dynamic nature
16:52:05FromDiscord<Yardanico> just like with Python
16:52:11FromDiscord<Yardanico> unless you wrap everything in some special "JsObject"
16:52:18disruptekyou can just interop with js.
16:52:18FromDiscord<lqdev> @Shucks yeah I got it to run
16:52:26FromDiscord<Yardanico> if you compile to js - sure
16:52:40FromDiscord<SirJosh> reducing startup overhead of `node script.js` by converting it to native code, and then abandoning some ECMA script compliance through flags for performance reasons
16:52:44disruptekor use quickjs wrapper.
16:52:48FromDiscord<SirJosh> so that build tools can be faster
16:52:51FromDiscord<SirJosh> (edit) 'faster' => 'faster, or whatever else'
16:52:54FromDiscord<Yardanico> @SirJosh oh I think i saw your repo
16:52:58disruptekhave you looked at quickjs?
16:53:01FromDiscord<Yardanico> parsing package.json in Nim or something
16:53:02disruptek!repo quickjs
16:53:04disbothttps://github.com/horhof/quickjs -- 9quickjs: 11Unpacked tarball of Fabrice Bellard's QuickJS Javascript engine 15 1277⭐ 128🍴 7& 29 more...
16:53:08disruptek!repo quick
16:53:09disbothttps://github.com/alehander92/nim-quicktest -- 9nim-quicktest: 11A quickcheck library for Nim 15 18⭐ 1🍴 7& 21 more...
16:53:15FromDiscord<Yardanico> fix disbot 😛
16:53:19disruptek!repo author:genotrance quick
16:53:20disbotno results 😢
16:53:22FromDiscord<SirJosh> don't think that was me, i only reallly started using nim today
16:53:25FromDiscord<SirJosh> (edit) 'reallly' => 'really'
16:53:28FromDiscord<Yardanico> ah okay
16:53:36leorize@Shucks I got that to work, but iirc you need nvim >= 0.5.0 on windows for stability
16:53:39FromDiscord<Yardanico> but really node is not the only JS engine out there 🙂
16:53:40leorizemight be wrong though
16:53:44FromDiscord<Shucks> @lqdev anything special to do to get code suggestions/completions running? Seems like I even rarely get code highlighting yet. Nimsuggest is in path
16:53:55FromDiscord<Yardanico> and you can always write run some JS parts in quickjs/dukpate
16:53:58FromDiscord<Yardanico> and others in native nim code
16:53:58FromDiscord<SirJosh> also no i haven't seen quickjs
16:53:58disruptekwell, we have a quickjs wrapper somewhere.
16:54:09disrupteki might have it in a gist.
16:54:17FromDiscord<Yardanico> https://github.com/ImVexed/quickjs4nim ?
16:54:23FromDiscord<lqdev> @Shucks you need to set up asyncomplete.vim for completions to work
16:54:24FromDiscord<Yardanico> updated year ago though
16:54:32disruptekyep.
16:54:39FromDiscord<lqdev> https://github.com/alaviss/nim.nvim#auto-completion
16:54:47disruptekwrappers often don't need often updates.
16:54:54disruptekwrappers often don't need updates often.
16:55:19FromDiscord<Yardanico> depends on what you're wrapping really
16:55:28FromDiscord<Yardanico> it might need an update because nimterop changed itself
16:55:33disruptekwhy?
16:55:35FromDiscord<lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2rI7
16:55:41FromDiscord<Shucks> Yea thats what i did ;o
16:55:44FromDiscord<lqdev> hm
16:55:56*theelous3 joined #nim
16:56:31FromDiscord<lqdev> did you save the file to disk?
16:57:03shashlickhere's the quickjs nimterop wrapper - https://gist.github.com/genotrance/4869d1feb53c7ec7be806a2f225d07ab
16:57:12FromDiscord<Shucks> yup
16:57:21Araqdisruptek, skiplists? when I looked at them benchmarks said they are slower than hash tables
16:57:33FromDiscord<SirJosh> i'll take a look into the quickjs and nimterop things, thx for the references
16:57:33FromDiscord<lqdev> hm
16:57:36AraqI didn't benchmark them myself but still
16:57:47FromDiscord<lqdev> leorize might be able to help you more with debugging this
16:57:47disruptekit's just an optimization to trade mem for speed in singly-linked-lists.
16:57:59disruptekdon't think of it as a separate data-type.
16:58:06FromDiscord<Yardanico> @SirJosh for some real transpilation you would want some JS runtime analyzer (to find out types) or TypeScript type definitions
16:58:11FromDiscord<Shucks> Alright, thanks
16:58:15FromDiscord<Yardanico> or wrap everything in some JsObject 😄
16:58:32leorize@Shucks can I see some screen cap?
16:59:01FromDiscord<SirJosh> yeah i've chosen the jsobject approach and figured i could code in edgecases or something weird, not entirely sure yet but it's a \/\/ TODO
16:59:06FromDiscord<SirJosh> (edit) 'it's' => 'it'll be'
17:00:19FromDiscord<Shucks> https://prnt.sc/tiejkr
17:00:23FromDiscord<Shucks> Nothing fancy there
17:01:18FromDiscord<Shucks> Wait, do I need the qt one
17:01:58*skrzyp1 is now known as skrzyp
17:02:06FromDiscord<Shucks> oh yea. that looks better. Gosh thats ugly
17:02:54Araqwho can fix VSCode highlighting?
17:03:03disrupteknew guy.
17:03:26shashlickGary M
17:03:31Araq""""xyz"""" (4 quotes) are allowed
17:03:31FromDiscord<lqdev> @Shucks also I don't recommend using nvim in windows console, it doesn't have things like mouse support
17:03:41leorize@Shucks file saved?
17:03:52leorizeand what version of neovim are you on?
17:04:10leorize`:ver` will tell you
17:04:15FromDiscord<Shucks> ```nvim --version↵NVIM v0.5.0-593-g1ca67a73c```
17:04:44FromDiscord<Shucks> Code suggestions causes a crash atm
17:04:56leorizeso it's working then
17:05:15FromDiscord<Shucks> more or less ;D
17:05:41leorizehttps://github.com/alaviss/nim.nvim/wiki/Support-for-other-completion-plugins#ncm2-ncm2ncm2
17:05:53leorizeyou can try that
17:06:24*abm quit (Quit: Leaving)
17:06:30FromDiscord<Shucks> gonna try it. Thanks
17:06:41disruptekAraq: for orderedtable, why don't we just keep a seq as an index?
17:07:58FromDiscord<SirJosh> sent a long message, see http://ix.io/2rI9
17:08:09FromDiscord<SirJosh> (edit) 'http://ix.io/2rI9' => 'http://ix.io/2rIa'
17:08:58FromDiscord<SirJosh> (edit) 'http://ix.io/2rIa' => 'http://ix.io/2rIb'
17:09:10FromDiscord<Yardanico> https://nim-by-example.github.io/ is sadly outdated and not maintained
17:09:21FromDiscord<Yardanico> "no tool for hierarcy" - "nimble init"
17:09:41FromDiscord<SirJosh> aww that by example thing is so good
17:09:49FromDiscord<Yardanico> "+=" - there's no + operator for strings
17:09:55FromDiscord<Yardanico> you can do s = s & "a"
17:09:57FromDiscord<Yardanico> or s &= "a"
17:10:12FromDiscord<Yardanico> - string interpolation requires a package import and function call (fmt("things {yeah}")) - because it would be a bit of bloat to include it by default 🙂
17:10:33FromDiscord<Yardanico> "- can all objects just implement like a toString for me or something" well yes, there's a common operator for converting to string - $
17:10:43FromDiscord<Yardanico> most libraries and stdlib modules implement it for their types
17:10:45leorizeand there's a default implementation for it
17:10:45FromDiscord<SirJosh> couldn't you make string interpolation easily accessible and not include it if you realize the user didn't use it
17:10:58FromDiscord<SirJosh> yeah i saw the `$()` thing but it didn't work for my types so idk if i'm doing things wrong
17:11:08FromDiscord<Yardanico> if your types are "ref object", you need to dereference
17:11:10FromDiscord<Yardanico> echo myobj[]
17:11:16FromDiscord<Yardanico> @SirJosh well nim always has dead code elimination, but that's not the problem
17:11:27FromDiscord<Yardanico> if you always include strformat the compiler will always need to *process* the source code of strformat
17:11:28FromDiscord<lqdev> generics being [] is actually a good thing, it prevents ambiguities that occur with <>
17:11:29FromDiscord<SirJosh> ah yeah they were ref objects
17:11:37FromDiscord<SirJosh> (edit) 'were' => 'are'
17:11:40FromGitter<ynfle> use `obj.repr`
17:11:46FromDiscord<Yardanico> "- * to export things instead of referring to pointers/references really got me at first" - this is not really a problem IMO, same for [] for generics
17:12:03leorize@ynfle repr is for debugging
17:12:05FromDiscord<Yardanico> @ynfle no
17:12:16FromDiscord<lqdev> > no tool like cargo or dotnet to new up a project hierarchy
17:12:20FromDiscord<lqdev> there's nimble
17:12:28FromDiscord<lqdev> `nimble init your_project`
17:12:37FromDiscord<lqdev> koch is used for compiler development
17:12:43FromDiscord<SirJosh> yeah i just listed my initial experiences
17:12:47FromDiscord<SirJosh> apparently i found koch before nimble somehow lol
17:12:53FromDiscord<SirJosh> but good to know it exists
17:13:08FromDiscord<Yardanico> koch is not for end users
17:13:14FromDiscord<Yardanico> it's for compiler-related development and debugging
17:13:23FromGitter<Kvothe87> hi
17:13:36leorize`do`-notation aside, the chosen syntax makes a lot of sense once you got used to nim
17:13:47FromGitter<Kvothe87> i have an issue understanding something that i believe should be quite easy
17:13:49FromGitter<Kvothe87> https://play.nim-lang.org/#ix=2rIc
17:14:28leorizeso what's the issue? :P
17:14:55FromDiscord<Yardanico> @Kvothe87 on line 16 you're creating a copy
17:15:16FromGitter<Kvothe87> why is the global variable inputDrivers the same as the local?
17:15:26FromDiscord<Yardanico> it's not?
17:15:28FromDiscord<Clyybber> disruptek: WDYM seq as an index?
17:15:38FromDiscord<Clyybber> Using a literal seq as an index?
17:15:57FromDiscord<Yardanico> @Kvothe87 ah wait you're right
17:15:58leorize@Kvothe87 JsonNode is a reference type
17:16:04FromDiscord<Clyybber> Or do you mean like combined hashes of its elements?
17:16:08FromGitter<Kvothe87> i create the copy and modify the copy, then why is it changing also the original
17:16:10FromDiscord<Yardanico> well jsonnode is reference, sorry, I forgot
17:16:14FromDiscord<Yardanico> yeah you're not creating a copy
17:16:44FromGitter<Kvothe87> how can i make a copy then? instead of modifying the original?
17:16:54*Cthalupa quit (Ping timeout: 240 seconds)
17:16:56leorizehttps://play.nim-lang.org/#ix=2rIe
17:17:33FromDiscord<Clyybber> Araq: Whats tyForward?
17:17:42leorizeforward declared
17:17:45FromDiscord<Yardanico> forward declaration?
17:17:50FromDiscord<Clyybber> Thats my guess too
17:17:52FromDiscord<Zachary Carter> https://imgur.com/a/Him6p1L
17:18:05FromDiscord<Clyybber> But I encounter it in a situation where I wouldn't expect it
17:18:18FromDiscord<Clyybber> @Zachary Carter nice!
17:18:28leorizejust `git grep tyForward`
17:18:33FromDiscord<Zachary Carter> thanks!
17:18:58leorize@Zachary that's cool, generated in nim? :)
17:19:52FromGitter<Kvothe87> @leorize thanks. It worked also in the more real case
17:20:36Yardanico!status
17:20:38FromDiscordUptime - 1 week, 8 hours, and 26 minutes
17:20:39Yardanicoyay
17:20:45*Cthalupa joined #nim
17:20:48FromDiscord<Yardanico> <FromDiscord> Uptime - 1 week, 8 hours, and 26 minutes
17:20:48FromGitter<Kvothe87> why is it implemented this way? For sure it is present in the documentation, but it was quite unexpected
17:20:56FromDiscord<Yardanico> because all ref types are like this 🙂
17:21:04FromDiscord<Yardanico> so there's much less copies
17:21:18FromDiscord<Yardanico> and really in most cases when working with json you don't need to do stuff you did in the playground
17:21:51FromGitter<Kvothe87> probably there was a better way to do it than how i did it.
17:21:56FromGitter<Kvothe87> thanks
17:24:55*Trustable quit (Remote host closed the connection)
17:27:30FromDiscord<Zachary Carter> leorize: I'm using https://github.com/septag/rizz and https://github.com/guillaumeblanc/ozz-animation
17:27:50Oddmongerwhat is it, when you call a function with « discard » before ?
17:28:00disruptekit's nothing.
17:28:12Oddmongerit ignores result ?
17:28:16leorizeit means you discard the result
17:28:18leorizeyea
17:28:33FromDiscord<Yardanico> yes, but the code will still be there if there are side effects
17:28:34Oddmongerbut why is it mandatory sometimes, in api ?
17:28:46FromDiscord<Yardanico> because if you're e.g. interfacing with C libraries
17:28:49FromDiscord<Yardanico> they usually return an error code
17:28:57FromDiscord<Yardanico> and you don't always want it, especially when prototyping
17:29:07Oddmongerah
17:29:20Oddmongerok, thank you
17:29:31FromDiscord<Yardanico> discard actually still generates code, but the C compiler might just optimize the call with "discard" away if there are no side effects
17:36:10*tane joined #nim
17:36:23disrupteki'm going to organize a nim event.
17:36:28disruptekit works like this:
17:36:38disruptekwe come up with an idea. then we code it together.
17:36:46disruptekover 48hrs.
17:37:00FromDiscord<lqdev> cool
17:37:01disruptekvery rapid development.
17:37:15FromDiscord<lqdev> so it's like a game jam but everyone works on the same thing
17:37:19disruptekyeah.
17:39:32shashlickhow about focusing on existing packages and fixing bugs, improving them
17:39:54disruptekit's not fun enough.
17:40:44disruptekeveryone submits ideas and we pick them out of a hat entire majority accepts the mission.
17:40:52disrupteks/entire/until/
17:42:17disruptekthis could be really useful to get a sense for how nim scales in larger projects.
17:44:14FromDiscord<Yardanico> btw, https://github.com/fox0430/moe seems to work with arc and most tests pass
17:44:28FromDiscord<Yardanico> except two small tests in one file 😛
17:44:32FromDiscord<Yardanico> which I'm investigating
17:47:17FromDiscord<Clyybber> nice!
17:51:13shashlickby the way, anyone wants to install zlib on any OS, static or shared, here's how you do it with nimterop - http://ix.io/2rIk - cc @impbox
17:51:53disruptek!last shashlick
17:51:54disbotshashlick spoke in 12#nim 40 seconds ago 12https://irclogs.nim-lang.org/15-07-2020.html#17:51:13
17:52:05disruptek~zlib is https://irclogs.nim-lang.org/15-07-2020.html#17:51:13
17:52:05disbotzlib: 11https://irclogs.nim-lang.org/15-07-2020.html#17:51:13
17:55:18FromDiscord<Yardanico> also another problem with arc repr - it doesn't properly repr strings 😦
17:55:45FromDiscord<Yardanico> !eval echo repr "\r\n"
17:55:47NimBot0x5612c32fe2a0"\13\10"↵""
17:56:08FromDiscord<Yardanico> with arc that's "<newline>"
17:56:10disruptekhow is that wrong?
17:56:16FromDiscord<Yardanico> the default is right
17:56:19FromDiscord<Yardanico> the arc one is wrong
17:56:22leorizearc doesn't do escaping
17:56:22FromDiscord<Yardanico> or at least much less useful
17:56:23disruptekgotcha.
17:56:41leorizeit's in repr_v2 if you want to do a fix
17:56:49FromDiscord<Yardanico> yeah I know 😛
17:56:58FromDiscord<Yardanico> also ping @Clyybber since he did some repr_v2 fixes 😛
17:57:33FromDiscord<Clyybber> oh, it doesn't?
17:57:38FromDiscord<Yardanico> it doesn't 😦
17:57:52FromDiscord<Clyybber> ah, yeah we don't escape that I think
17:57:55FromDiscord<Yardanico> also can't repr procedures themselves
17:57:57FromDiscord<Clyybber> I guess we could
17:58:00FromDiscord<Yardanico> e.g. when you store them in an object
17:58:17FromDiscord<Clyybber> What does old repr do for procedures?
17:58:21FromDiscord<Yardanico> address
17:58:24FromDiscord<Clyybber> I see
18:03:02Araqwhen I wrote repr_v2 I wasn't really aware how the old repr does things :P
18:03:08Araqas I never use 'repr'
18:04:03*endragor quit (Remote host closed the connection)
18:04:16leorizerepr can also traverse RTTI to figure out the real type
18:04:22leorizenot sure if repr_v2 supports this
18:04:30*endragor joined #nim
18:05:39Araqit doesn't
18:05:48FromDiscord<Yardanico> there's no rtti with arc
18:05:50FromDiscord<Yardanico> so it doesn't 😛
18:06:13leorizethere's still a limited form for methods to work
18:07:02FromDiscord<Yardanico> well yes
18:07:05FromDiscord<Yardanico> which uses string comparisons 😄
18:07:06FromDiscord<Clyybber> @Yardanico escape chars too?
18:07:13FromDiscord<Yardanico> @Clyybber well yes, special ones
18:07:19FromDiscord<Yardanico> e.g. \13\10
18:07:39ForumUpdaterBotNew thread by Salient: What are Nim programmers called?, see https://forum.nim-lang.org/t/6545
18:08:51leorizeI guess we gotta figure a name out for marketing purposes too :P
18:08:57FromDiscord<Clyybber> nimmers
18:09:02FromDiscord<Clyybber> was one I heard
18:09:16disrupteknimions, what else?
18:09:16leorizeshould organize a vote somewhere :P
18:09:43FromDiscord<Clyybber> nimions is nice too
18:09:51FromDiscord<Clyybber> but who cares, call yourself what you want
18:09:56FromDiscord<Clyybber> why should there be an official one
18:10:07Prestigenimgineers
18:10:23disrupteknimineers is good.
18:10:25*endragor quit (Ping timeout: 264 seconds)
18:10:45leorizeit gives people a sense of community I suppose
18:11:24FromDiscord<lqdev> nimions is perfect.
18:11:41FromDiscord<Zachary Carter> oh this conversation again lol?
18:12:10FromDiscord<Zachary Carter> it's like the mascot discussion
18:12:33FromDiscord<Zachary Carter> I agree with clybber - people can call themselves whatever they want and Nim's mascot can be whatever an individual wants it to be
18:13:02FromDiscord<Zachary Carter> we don't need to be like rust and tell everyone they have crabs
18:13:33FromDiscord<lqdev> the only good Nim mascot is :nimrawr:
18:13:37FromDiscord<Clyybber> @Yardanico I'm gonna leave the string/char escaping to you since you might better know what you want :p (I don't use repr too often)↵The old implementation is in lib/system/repr reprStrAux and reprChar are the interesting ones.
18:13:47Araqthe crabs are the best thing about Rust though
18:13:58FromDiscord<Clyybber> One question for example is wether we want to print empty strings that are nil internally as nil
18:14:04Prestigerusty crabs
18:14:28leorize[m]planetis[m]: how is the matrix.org irc bridge nowadays? do you still experience lag?
18:15:21FromDiscord<lqdev> crabs are similar to crayfish, and it just so happens that crayfish and cancer share the same word in polish. how peculiar.
18:15:38FromDiscord<Clyybber> so they do in german
18:15:39AraqClyybber: check out my branch and look at this code please
18:15:41Araqhttps://gist.github.com/Araq/551262b4ab33630a21b8cd65d944da81
18:15:52FromDiscord<Zachary Carter> I was thinking of the vd
18:15:53leorize[m]I'm gonna create a community on matrix to group our IRC rooms into one place, hopefully lures people away from joining the matrix->gitter bridge all the time :P
18:16:08AraqI'm too tired to see the issue
18:16:18Araqit infers the hidden temporaries as cursors
18:16:32Araqbut then it copies from them so that should be fine
18:17:34Araqit also not an optimization this way but a pessimization :-(
18:19:54Araqoh never mind it does move
18:19:57Araqand shouldn't
18:20:13FromDiscord<Clyybber> heh, just when I was koch temping :p
18:20:33Araqstill. cursors and moving bite
18:20:43FromDiscord<Clyybber> yeah
18:20:48FromDiscord<Clyybber> one lets ownership sit
18:20:51FromDiscord<Clyybber> the other steals it
18:20:53leorizeanyone got a high-resolution image of the nim crown on white bg?
18:20:55*noonien joined #nim
18:21:09disruptekleorize: it's svg, isn't it?
18:21:11FromDiscord<Clyybber> leorize: Maybe theres a vector version in that one repo
18:21:58leorizeI don't have inkscape to render it so was wondering if anyone got one already
18:22:20FromDiscord<Shucks> So seems like I've found the perfect solution to use nvim with plugins on windows. https://prnt.sc/tig24s
18:22:38leorize@Yardanico do you have some Nim crown logo samples? iirc you added a few of them to discord
18:22:58leorize@Shucks: nice
18:23:35FromDiscord<Shucks> Actually pretty cool. I didn't knew windows has that subsystem linux stuff
18:24:02FromDiscord<Yardanico> @leorize sadly no
18:24:05FromDiscord<Yardanico> but yeah, I used the svg
18:25:50planetis[m]leorize: there was the double posts issue (not sure if related to matrix-irc bridge) but nowdays its kind of okay, fingers crossed...
18:26:38*arecaceae joined #nim
18:27:48*marnix quit (Read error: Connection reset by peer)
18:28:18*marnix joined #nim
18:31:10*endragor joined #nim
18:36:16*marnix_ joined #nim
18:36:22*endragor quit (Ping timeout: 256 seconds)
18:37:23*marnix quit (Ping timeout: 240 seconds)
18:39:15*marnix_ quit (Read error: Connection reset by peer)
18:39:39*leorize[m]1 joined #nim
18:41:15leorize[m]1let's see if it's still laggy
18:41:32leorize[m]seems reasonably fast I'd say
18:42:08leorize[m]1around 12s delay :P
18:43:43FromDiscord<Yardanico> even ircord has less delay ;P
18:44:23leorizethe matrix-irc bridge is never known for good connection :P
18:45:29*solitudesf quit (Read error: Connection reset by peer)
18:47:47ForumUpdaterBotNew thread by ShalokShalom: Link to documentation in homepage examples, see https://forum.nim-lang.org/t/6546
18:48:32PrestigeHas there been any discussion on implementing multiple inheritance?
18:48:39leorize[m]yes iirc
18:48:44leorize[m]verdict: we won't support it :P
18:48:58*marnix joined #nim
18:49:05*solitudesf joined #nim
18:49:07PrestigeAh, that sucks
18:49:41FromDiscord<dom96> > @dom96 is there a way to exec in a subdir in nimble?↵@impbox there is a `withDir` IIRC
18:50:13leorizethe matrix.org-irc bridge is so slow that I feel bad for referring people to it :P
18:51:06FromDiscord<Yardanico> but it's still better than then people connect via matrix - gitter bridge
18:52:27leorize[m]1WIP if anyone wanted to help: https://matrix.to/#/+nim:asra.gr
18:52:48leorizeyou can join the community then add nim-related channels in I think
18:52:53leorizefirst time creating one of those
18:52:55planetis[m]Prestige: what for would you need multiple inheritance? Don't you experiment with ECS design?
18:54:00leorize@Yardanico if you add t2bot discord-matrix bridge into discord then I can bridge some discord rooms over too :P
18:54:10PrestigeThere's generally a use case for it, which is why interfaces exist in a lot of languages. It's just a cheap partial implementation of multiple inheritance (interfaces are just classes with only abstract functions)
18:54:44leorizeinterfaces are different from multiple inheritance
18:54:54PrestigeI'm experimenting with ECS because of the lack of multiple inheritance
18:54:55leorizeit's just how it's done in OOP languages
18:55:08PrestigeNot all
18:55:18leorizeI'd say Go got interfaces done well
18:55:20*nikita` quit (Ping timeout: 265 seconds)
18:55:23PrestigeInterfaces exist because the creators of the language didn't implement multiple inheritance
18:55:42leorizeI disagree
18:55:44PrestigeThen you have languages like c++ that allow multiple inheritance
18:56:26PrestigeA lot of it is stemming from the creation of java, where the creator didn't implement multiple inheritance, and created interfaces instead. It's pretty much just a work around
18:56:36leorizeinterfaces are much simpler than multiple inheritance
18:56:47PrestigeThis is also why C# follows the same paradigm, it's just a copy of java
18:56:54PrestigeYes exactly
18:57:21PrestigeThey didn't take the time to implement multiple inheritance, so now we have interfaces
18:57:34leorizeand imo interfaces solves problems better than multiple inheritance
18:57:39leorizeit's too easy to misuse multiple inheritance
18:58:11PrestigeInterfaces don't give you the same capabilities as multiple inheritance
18:58:25leorizethat's why they're better :P
18:58:35PrestigeNo, they're limiting
18:59:11leorizewhy?
18:59:18leorizewhat's the problem that you're trying to solve?
19:01:08PrestigeOne case could be creating a game engine with multiple inheritance, just as an example. A number of languages allow for multiple inheritance, I don't know why people would try to avoid it other than it's hard to implement into the language
19:01:43disruptekit's a constraint that serves no purpose.
19:02:15PrestigeWhat is, not having MI?
19:02:36disruptekno, having it.
19:02:39*narimiran joined #nim
19:03:58PrestigeFrom a language design perspective? I could see it being difficult to implement, but that doesn't mean multiple inheritance doesn't have its use cases or isn't nice for the programmer to be able to use
19:04:10PrestigeIf nobody wanted it, it wouldn't be in multiple languages
19:04:56leorizewell you need to pitch in some use case for them :P
19:05:04*endragor joined #nim
19:05:06leorizewe won't have those stuff unless there are really good reasons
19:06:27leorizethe potential of ambiguity caused by multiple inheritance (the infamous diamond problem) is usually why they're not welcome
19:06:41PrestigeOOP in Nim seems pretty minimal at the moment, interfaces would be a nice step forward but I would be ecstatic if we had multiple inheritance
19:07:02PrestigeYou could even just disallow the diamond unless it's the root object
19:07:11PrestigeLike, just have it be a compiler error
19:07:38planetis[m]game developers in talks I have seen discourage the use of multiple inheritance
19:07:38disruptekoop isn't really in favor here.
19:07:39FromDiscord<Yardanico> we might have vtable concepts, but not multiple inheritance 😛
19:07:59disruptekmost of us aren't compelled by the oop story, you might say.
19:08:08leorizewell there are also alternatives to multiple inheritance too: rust's traits and interfaces
19:08:17leorizewe really need to weigh these things
19:08:36planetis[m]because it has issues, like the diamond problem
19:08:36PrestigeI haven't looked into that, I should read up
19:08:58FromDiscord<Recruit_main707> i think oop should only be accesible for interoping with cpp
19:09:33leorizedesigners don't refuse multiple inheritance because it's hard to implement, but because of the issues it might bring
19:10:04PrestigeI can understand individuals not personally caring about OOP, but I think it will affect adoption to some level if we don't have interfaces or some sort of multiple inheritance
19:10:25disruptekwe have concepts.
19:10:31leorizeunless you can write a comprehensive documentation highlighting the ups and downs of MI comparing to other solution, I don't think we will have that anytime soon
19:11:15leorizeappease to the OOP crowd has never been something Nim focus on
19:11:17Prestigedisruptek: concepts?
19:11:39planetis[m]ECS its own problems like correct ordering, creation and deletion of entities, etc
19:11:50FromDiscord<Recruit_main707> either to import, export or overload other cpp classes
19:12:10FromDiscord<Clyybber> Araq: How does your optimizer make sure escaping variables are not cursorified?
19:12:25PrestigeLet's say for a small game, you have a number of objects which all need a location. how do you go about ensuring that these are created with the needed location without rewriting the same code for every type and method?
19:12:52FromDiscord<Clyybber> Araq: Does it simply look if they are used after a sink or destroy of their source?
19:14:22leorizePrestige: composition exists for that
19:14:38FromDiscord<Elegant Beef> Aw shit interfaces
19:14:39leorizeyou just add the location object in and initialize it as usual?
19:14:59FromDiscord<Elegant Beef> They exist to abstract away logic in an easily usable context
19:15:10PrestigeBut what about polymorphic methods to perform actions like translating the object?
19:15:11FromDiscord<Elegant Beef> IE you can have all your IClickable in a list, and just click them
19:15:57FromDiscord<Elegant Beef> Unity's EC system is a compositional system like you've described
19:16:03FromDiscord<Elegant Beef> You have an entity and components
19:16:11FromDiscord<Elegant Beef> All gameobjects have a transform component
19:16:24Prestigethis is the problem I've been trying to solve in writing a game engine in Nim, it seems I'm going to have to develop an entire ECS framework to do so first
19:16:40FromDiscord<Recruit_main707> arent interfaces the same as our using T bu iwth an extra level of identation?
19:16:43FromDiscord<Elegant Beef> I mean you really dont need an ECS unless you're having thousands of entities
19:17:03kungtottePrestige: There have been previous efforts of writing ECSes in Nim, you might not have to roll your own
19:17:10*nikita` joined #nim
19:17:13FromDiscord<Elegant Beef> Nah interfaces in C# atleast let you store all the values that implement it in a single collection
19:17:19FromDiscord<Elegant Beef> so imagine if concepts worked at runtime
19:17:40kungtotteYou can do that with object variants or type erasure in Nim
19:17:43leorizePrestige: are you in nim-gamedev? (if that's even bridged to irc, ping @Yardanico)
19:17:48FromDiscord<Elegant Beef> It is
19:17:49FromDiscord<Elegant Beef> he is
19:17:50PrestigeYeah
19:17:56FromDiscord<Yardanico> @leorize is of course
19:18:01FromDiscord<Elegant Beef> and no you cant do that with object variants
19:18:12FromDiscord<Elegant Beef> Object variants can "emulate" a bit of it
19:18:35FromDiscord<Yardanico> #nim-gamedev on irc
19:18:42FromDiscord<Elegant Beef> But for the most part you do not get the same behaviour
19:18:48leorizewell I'm certain that many of our members might have figured your problem out Prestige
19:18:52PrestigeSo basically my point is, this would be a really simple implementation if we had MI. I know not everybody needs this use case, but it is helpful
19:18:56*endragor quit (Ping timeout: 246 seconds)
19:19:00FromDiscord<Elegant Beef> MI?
19:19:04FromDiscord<Elegant Beef> Fuck inheritance
19:19:06PrestigeMultiple inheritance
19:19:14FromDiscord<Elegant Beef> Just use↵https://github.com/slangmgh/interfaced
19:19:18FromDiscord<Elegant Beef> Runtime interfaces
19:19:18disruptekthe problem is that it is arguably bad design.
19:19:35PrestigeHow so? I don't know what's bad about it
19:19:54FromDiscord<Elegant Beef> https://media.discordapp.net/attachments/371759389889003532/733040157116072047/800px-Diamond_inheritance.png
19:19:54FromDiscord<Elegant Beef> This
19:19:55disrupteki know, but you should be able to find plenty of arguments against it.
19:20:13disruptekbe open to the idea that there are reasons to shun oop.
19:20:30FromDiscord<Elegant Beef> I dont think OOP is bad, more just over using inheritance
19:20:31PrestigeI've been working with OOP languages for years, I'm open to the idea of but I haven't heard arguments against it
19:20:57disrupteki suspected as much.
19:21:12leorizePrestige: you can restart the discussion on MI by opening an RFC
19:21:23*nikita` quit (Read error: Connection reset by peer)
19:21:27FromDiscord<Elegant Beef> See interfaces are nicer than inheritance
19:21:48FromDiscord<Elegant Beef> Cause you only share what's common and implement what's not
19:22:05leorizePrestige: an RFC will be a more organized debating ground than IRC, and we can share more details there too
19:22:12FromDiscord<Elegant Beef> So in a EC system you might have an ID in your base Component and then all the rest can implement any of your interfaces
19:22:20FromDiscord<Elegant Beef> all without having weird and wacky trees
19:22:31FromDiscord<Clyybber> eh, IMO OOP needs to be moved *out* of the compiler
19:22:37FromDiscord<Clyybber> and into library territory
19:22:49FromDiscord<Clyybber> you can implement your OOP systems on top of case objects
19:22:51FromDiscord<Clyybber> or unions
19:22:58PrestigeI'd rather have multiple inheritance than interfaces. Good idea leorize, I'd at least like to hear some arguments against oop and other ways this could be implemented
19:22:59FromDiscord<Clyybber> or ref objects
19:23:00FromDiscord<Elegant Beef> I mean i think OOP has it's place but without interfaces it will get wacky
19:23:12FromDiscord<Elegant Beef> Why would you rather have multiple inheritance over interfaces?
19:23:58PrestigeMultiple inheritance gives you the same capability as interfaces (if you can have abstract functions) and more
19:24:13FromDiscord<Elegant Beef> What's the more
19:24:13FromDiscord<Clyybber> @Prestige You can implement multiple inheritance like interfaced does interfaces
19:24:27FromDiscord<Clyybber> I think its best to adopt library OOP solutions for nim if you can
19:24:28kungtottePrestige: https://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html < here's a good start for why OOP isn't the be-all, end-all of paradigms (it doesn't touch on MI though, just OOP in general)
19:24:32PrestigeThat would be cool, I need to read the library
19:24:44leorizeI'd say we need proper type section macros first
19:24:48FromDiscord<Elegant Beef> I think MI is just dumb, as it creates even more complex trees
19:24:52leorizethe current implementation isn't really optimal
19:25:21FromDiscord<Clyybber> @Prestige https://github.com/bluenote10/oop_utils should already have all you want
19:25:22FromDiscord<Elegant Beef> The entire goal of OOP is composition
19:25:27FromDiscord<Clyybber> leorize: Yeah, thats true
19:25:29leorizealso there are checks that only the compiler can do
19:25:37FromDiscord<Clyybber> Which ones?
19:26:03FromDiscord<Elegant Beef> I'd honestly probably be happy with concepts at runtime, although i doubt that'd be easy to do 😄
19:26:09FromDiscord<Recruit_main707> thats fake oop, my idea around oop is maintaining nim's procedural style, while actually emitting classes, kind of what kurx suggested in an rfc
19:26:14leorize@Clyybber: check against a generic constraints for example
19:26:30FromDiscord<Clyybber> They would be generic case objects internally
19:27:11FromDiscord<Recruit_main707> https://github.com/nim-lang/RFCs/issues/174↵id only like to see oop like this in nim, anything else would be unecesary
19:27:12disbotC++ interop: cppMethod/cppVirtual/cppOverride ; snippet at 12https://play.nim-lang.org/#ix=2rh9
19:27:48FromDiscord<Shucks> I could cry. I finally have some good nim ide...
19:27:57FromDiscord<Recruit_main707> which is...
19:28:06FromDiscord<Shucks> vim
19:28:12FromDiscord<Recruit_main707> """"ide""""
19:28:15FromDiscord<Shucks> ;D
19:28:36FromDiscord<Shucks> Well it makes the job much better than vscode imo
19:28:37FromDiscord<lqdev> it does very well for me as an ide ;)
19:29:07FromDiscord<Shucks> and its leightweight and sexy aswell
19:29:09FromDiscord<Shucks> https://prnt.sc/tih9ne
19:29:17FromDiscord<Elegant Beef> winblows? 😛
19:29:20FromDiscord<Shucks> yea ;D
19:29:37*haxscramper quit (Remote host closed the connection)
19:29:57FromDiscord<Elegant Beef> The only RFC that matters is the object variants one 😄
19:30:03FromDiscord<Shucks> (edit) 'leightweight' => 'lightweight'
19:30:11FromDiscord<Elegant Beef> Reduce redundancy, reduce redundancy
19:30:21leorizewelcome to proper semantic highlighting :)
19:30:48FromDiscord<Elegant Beef> Nim-alt does pretty good for highlighting
19:31:09leorizeyou can never beat the compiler in correctness though :)
19:31:58FromDiscord<Elegant Beef> I asssume the vim highlighting doesnt use regex then? 😄
19:32:15leorizea combination of nimsuggest and regex
19:32:35leorizevim regex is much more powerful than regular regex though :P
19:34:24FromDiscord<Rika> how tho
19:35:35Prestige@Clyybber doesn't seem to have MI?
19:36:15*planetis[m] sobs in the rain, screaming: MI!
19:46:58leorize[m]@Rika vim regex is slightly context-aware
19:51:25*opal quit (Remote host closed the connection)
19:53:02*opal joined #nim
19:57:00FromDiscord<Yardanico> @Clyybber you're still around?
19:57:07FromDiscord<Yardanico> So basically I think I understood the moe arc-related test failure
19:58:24FromDiscord<Yardanico> it's related to sequtils and insert
20:00:15FromDiscord<Yardanico> sent a code paste, see https://paste.rs/E6y
20:00:22FromDiscord<Yardanico> I'll open an issue, but I don't know which one is correct here - refc or arc
20:00:46FromDiscord<Yardanico> basically inserting an empty sequence with sequtils.insert
20:01:04FromDiscord<Yardanico> with arc it overwrites the old value even if the source sequence is empty
20:01:36FromDiscord<Clyybber> @Prestige Hmm, I think it should be fairly easy to extend it to support MI
20:01:44FromDiscord<Clyybber> @Yardanico Huh, interesting
20:04:05FromDiscord<Yardanico> https://github.com/nim-lang/Nim/issues/14994
20:04:07disbot[ARC} sequtils.insert different behaviour between ARC/refc ; snippet at 12https://play.nim-lang.org/#ix=2rIV
20:07:50*Senketsu joined #nim
20:09:22FromDiscord<Yardanico> basically it's self-move vs self-shallow copy
20:09:26FromDiscord<Clyybber> Yeah
20:09:31FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2rIY
20:09:33FromDiscord<Clyybber> self-moves are destructive
20:09:45FromDiscord<Yardanico> so need to fix sequtils insert then?
20:09:48FromDiscord<Clyybber> yeah
20:09:58FromDiscord<Clyybber> either remove the move, since its wrong
20:10:19FromDiscord<Clyybber> or don't do it if i == j
20:10:39FromDiscord<Yardanico> we have shallowCopy for arc
20:10:42FromDiscord<Clyybber> no
20:10:44FromDiscord<Yardanico> yes
20:10:46FromDiscord<Yardanico> 😄
20:10:54FromDiscord<Clyybber> pretty sure we don't
20:10:57FromDiscord<Clyybber> if we do its a fake
20:10:58FromDiscord<Clyybber> :p
20:10:59FromDiscord<Yardanico> I just checked
20:11:38FromDiscord<Clyybber> I'm pretty sure its fake
20:11:50FromDiscord<Yardanico> well but it yields expected results in this case
20:11:59FromDiscord<Clyybber> yeah, because its an assign probably
20:14:18FromDiscord<Yardanico> i guess we can even do something like
20:14:23FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2rJ1
20:14:38FromDiscord<Clyybber> yep, thats the fix I have just commited :D
20:14:39FromDiscord<Yardanico> LOL
20:14:50FromDiscord<Clyybber> well, I put the if inside the when defined
20:14:58FromDiscord<Yardanico> well I did first too
20:15:06FromDiscord<Clyybber> but it doesn't matter
20:15:06FromDiscord<Yardanico> but maybe we should protect for refc? even if it doesn't matter, idk
20:15:14FromDiscord<Clyybber> yeah, doesn't matter
20:15:23FromDiscord<Clyybber> I wonder whats faster though
20:15:27FromDiscord<Clyybber> for refc
20:16:11FromDiscord<Clyybber> and yeah, shallowCopy is just asgn in arc
20:16:18FromDiscord<Clyybber> to make it easier to transition
20:16:18FromDiscord<Yardanico> heh
20:16:35FromDiscord<Yardanico> ah yeah I remember having test failures in some libs using shallowCopy in tests
20:16:49FromDiscord<Clyybber> :D
20:17:53FromDiscord<Yardanico> ok, feel free to close the issue when you push then 🙂
20:18:00FromDiscord<Clyybber> will do
20:19:39FromDiscord<Yardanico> oh hmm, another test in moe is still failing
20:20:04FromDiscord<Yardanico> ah nvm no
20:20:10FromDiscord<Yardanico> I just modified moe when testing, it's all fine now
20:20:12FromDiscord<Yardanico> all tests pass
20:20:17FromDiscord<Clyybber> nice \o/
20:22:20FromDiscord<Clyybber> hmm, seems like it has an impact on performance on refc
20:22:23FromDiscord<Clyybber> due to the branching
20:22:30FromDiscord<Clyybber> I'll only enable it for arc then
20:24:00*oriba joined #nim
20:25:52FromDiscord<Yardanico> maybe it only can happen if src seq is empty?
20:25:59FromDiscord<Yardanico> so we can check for that eariler and just return, idk
20:26:04FromDiscord<Clyybber> yeah, I thought about that too
20:26:19FromDiscord<Clyybber> I think thats true
20:26:47FromDiscord<Clyybber> i and j will be the same if len(src) == 0
20:27:06*marnix quit (Ping timeout: 258 seconds)
20:31:43FromDiscord<Clyybber> heh, I'm sneaking some optimizations in there
20:33:44FromDiscord<Yardanico> https://github.com/h3rald/min seems to *mostly* work fine (all tests except one pass), but that one is one of the http json tests
20:33:51FromDiscord<Clyybber> nice
20:34:31FromDiscord<Yardanico> it either shows bad file descriptor (without sink inference) or ```tests/http.min(20,25) `from-json`: input(1, 1) Error: { expected``` and then the bad file descriptor error
20:34:43FromDiscord<Clyybber> yeah that error
20:34:43FromDiscord<Yardanico> ah right, also two fails in [sys] category
20:34:49FromDiscord<Clyybber> I've seen it in the tests too
20:35:00FromDiscord<Clyybber> it's very rare
20:35:26FromDiscord<Clyybber> I'm not sure what actually causes it
20:35:52FromDiscord<Yardanico> well here it seems to be reproducible every time
20:35:58FromDiscord<Clyybber> oh, nice
20:36:03FromDiscord<Clyybber> is it async related?
20:36:08FromDiscord<Yardanico> ah actually not every time 😦
20:36:11FromDiscord<Clyybber> :D
20:36:16FromDiscord<Yardanico> ah no wait, every time, BUT
20:36:19FromDiscord<Yardanico> only if you do all tests
20:36:23FromDiscord<Yardanico> if you only test http - it doesn't happen 😄
20:36:24FromDiscord<Clyybber> haha
20:36:32FromDiscord<Yardanico> well, the json error is still here, but no bad file descriptor
20:37:07FromDiscord<Yardanico> I don't think it's async related
20:37:13FromDiscord<Yardanico> that test doesn't use asynchttpclient functionality
20:37:15FromDiscord<Yardanico> only httpclient
20:38:13FromDiscord<Yardanico> ```("dir2/test.txt" "dir1" cp "dir1/test.txt" file?) assert``` this one fails from sys
20:39:12FromDiscord<Yardanico> it copies dir2/test.txt into dir1
20:41:34FromDiscord<Yardanico> oh this one seems to be something related to invalid sink
20:41:38FromDiscord<Yardanico> works with --sinkInference:off
20:42:27FromDiscord<Rika> for some reason, nim doesnt want to acknowledge that my == function exists or something; i'm getting no print (my == has it) when i try `hasKey`ing a table w/ the correct types
20:42:52FromDiscord<Yardanico> tables don't use equality
20:42:54FromDiscord<Yardanico> they use hashes
20:43:02FromDiscord<Rika> they do in hashcommon
20:43:03FromDiscord<Yardanico> I mean they don't compare objects, they compare hashes of them
20:43:20FromDiscord<Clyybber> surely they must be using both?
20:43:23FromDiscord<Rika> `if t.data[h].hcode == hc and t.data[h].key == key:`
20:43:33FromDiscord<Clyybber> yeah
20:43:48FromDiscord<Yardanico> isn't that short-circuited
20:43:50FromDiscord<Clyybber> hmm, Rika can you try to extract a reproducable example?
20:44:09FromDiscord<Rika> it's not an `or` though? my hash function works
20:44:14FromDiscord<Yardanico> ah
20:44:47FromDiscord<Clyybber> @Rika kind of a sledgehammer method, but you could try looking at the c code
20:44:56FromDiscord<Clyybber> if it calls the correct == function
20:45:12FromDiscord<Clyybber> or better
20:45:17FromDiscord<Clyybber> make yours {.error.}
20:45:27FromDiscord<Clyybber> if it errors it uses it
20:45:51FromDiscord<Rika> but i have an echo in it and it doesnt fire
20:46:05FromDiscord<Yardanico> ```↵@['t', 'e', 's', 't', '.', 't', 'x', 't', '', '.', 't', 'x', 't']↵```↵oh yeah this looks wrong
20:46:06FromDiscord<Clyybber> a static: echo ?
20:46:09FromDiscord<Rika> ah
20:46:10FromDiscord<Rika> okay
20:46:20FromDiscord<Rika> no not a static error
20:46:29FromDiscord<Yardanico> that empty character there is null terminator lol
20:46:34FromDiscord<Clyybber> hmm, then it doesn't get chosen at compile time
20:46:42FromDiscord<Rika> ah wait
20:46:45FromDiscord<Rika> no it does error
20:46:45FromDiscord<Clyybber> :D
20:46:47FromDiscord<Rika> i miswrotre
20:46:48FromDiscord<Clyybber> nice
20:46:55FromDiscord<Clyybber> then its your hash probably :p
20:46:58FromDiscord<Rika> but the echos dont fire
20:47:07FromDiscord<Rika> i checked the hash already >_<
20:48:13FromDiscord<Clyybber> insert an echo into the hash function
20:48:27FromDiscord<Clyybber> or make a custom == for the hash
20:52:10FromDiscord<Rika> i checked what `==` does in hashcommon (inserted an echo) and it says false and no prints (my function still has prints)
20:52:20FromDiscord<Rika> when i do it outside, it prints and says true
20:52:51FromDiscord<Clyybber> which == ?
20:52:58FromDiscord<Clyybber> the == for hashes returns false?
20:53:31FromDiscord<Rika> for the type
20:53:33FromDiscord<Rika> not the hashes
20:53:34*narimiran quit (Ping timeout: 240 seconds)
20:53:37FromDiscord<Rika> the hashes are equal
20:53:50FromDiscord<Clyybber> now its getting weird
20:53:56FromDiscord<Clyybber> do you have some code?
20:54:04FromDiscord<Rika> no i cant actually seem to reproduce it ._.
20:55:35*fredrikhr joined #nim
20:55:58Araqit's green! https://github.com/nim-lang/Nim/pull/14962
20:55:59disbotAn optimizer for ARC
20:56:19FromDiscord<Clyybber> Araq: Nice!
20:56:28FromDiscord<Clyybber> Did you see my previous questions?
20:56:32Araqno
20:56:55FromDiscord<Clyybber> How do you determine that a cursor can't escape their sources lifetime?
20:57:26FromDiscord<Clyybber> Do you simply not allow the cursor to exist after the source is sinked or destroyed?
20:58:11FromDiscord<Clyybber> Rika: You mean not at all anymore?
20:58:23Araqif a cursor candidate's dependency is passed to a sink/var T we assume mutation/destruction and this invalidates the cursor candidate
20:58:29FromDiscord<Rika> i still can with the code i have right now but its not minimal
20:58:46Araqbut currently it's not scope based. it should be.
20:58:55FromDiscord<Clyybber> ah
20:59:10Araqmight do scope based cursors tomorrow, time to merge and sleep
20:59:25FromDiscord<Clyybber> heh, is there a switch to turn it off?
20:59:42FromDiscord<Clyybber> @Rika Is it opensource?
20:59:59FromDiscord<Rika> not right now since i was preparing it for that lol
21:00:04FromDiscord<Clyybber> oh :D
21:00:40FromDiscord<Yardanico> time to find optimizer regressions 😄
21:00:59AraqYardanico: yeah :-)
21:01:37FromDiscord<Yardanico> also you forgot to remove debug output 🙂
21:01:50FromDiscord<Yardanico> well, or make it into a proper hint message I guess
21:02:22FromDiscord<Clyybber> Araq: Should there be a switch for cursorinference?
21:02:26*solitudesf quit (Remote host closed the connection)
21:02:47*solitudesf joined #nim
21:03:34FromDiscord<Clyybber> Araq: Oh and one last question, why is the #sysAssert in lib/systems/seqs_v2.nim:85 commented out?
21:03:59*oriba quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
21:04:32FromDiscord<Rika> if i comment out the value `==` in hashcommon it works...
21:04:51FromDiscord<Rika> what the heck is happening
21:05:11Araqcursorinference should always be active and is less dangerous than sink inference which influence proc type compatibility
21:05:51FromDiscord<Yardanico> well moe tests seem to be fine, will check projects in my "compatible arc projects" list
21:06:00AraqsysAssert doesn't work in seqs_v2 because of include order problems and stuff
21:06:05FromDiscord<Yardanico> computed as a cursor bufStatus@20945307 {20937058} /home/dian/Projects/stuff/moe/src/moepkg/tabline.nim(31, 16)
21:06:05FromDiscord<Yardanico> computed as a cursor bufStatus@20955217 {20937058} /home/dian/Projects/stuff/moe/src/moepkg/tabline.nim(51, 9)
21:06:06FromDiscord<Yardanico> etc
21:06:09FromDiscord<Yardanico> seems to do stuff 😛
21:06:25Araqwell check my tests, it's awesome
21:06:27FromDiscord<Clyybber> :D
21:06:37FromDiscord<Yardanico> yeah I've seen the test with traverse
21:06:40FromDiscord<Yardanico> I still don't understand how
21:06:44FromDiscord<Yardanico> it fully eliminated ref object or what?
21:07:35AraqI'm not sure it's 100% sound but the compiler does what I would do manually otherwise
21:08:03FromDiscord<Clyybber> Araq: Are the cursors copy on write?
21:08:26FromDiscord<Clyybber> Oh, of course they are, disregard that
21:08:38FromDiscord<Clyybber> Araq: Do cursors of cursors work?
21:09:04FromDiscord<Clyybber> As in `let a = x #cursor \n let b = a #also cursor` ?
21:09:07Araqcursors of cursors are a natural outcome of the algorithm
21:09:10FromDiscord<Clyybber> nice!
21:09:18Araqbut I disabled it for most cases
21:09:23*Vladar quit (Quit: Leaving)
21:09:24FromDiscord<Clyybber> oh, why?
21:09:43Araqbecause they can make moves less effective
21:09:59FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=2rJ9
21:10:08FromDiscord<Rika> still about the weird == hashcommon thing
21:10:26FromDiscord<Clyybber> Araq: But cursors can't be move anyways, right?
21:10:42Araqyeah but that's bad
21:10:56Araqwe like moves more than '='
21:11:03FromDiscord<Clyybber> Yeah
21:11:38disruptekbase64 benchmark now 1.83s versus refc at 1.33
21:11:41FromDiscord<Clyybber> cursors are the anti-copy initiative of the non-last-reads
21:11:49FromDiscord<Clyybber> disruptek: With cursorinference?
21:12:01FromDiscord<Yardanico> nah, it changed after nimStrv2 mutate optimization
21:12:07FromDiscord<Yardanico> before it was like 3x slower
21:13:30FromDiscord<Clyybber> I've never seen the benchmark code, but maybe its gotten faster with cursorinference
21:13:39FromDiscord<Yardanico> lemme check
21:13:53FromDiscord<Yardanico> it's basically this https://github.com/kostya/benchmarks/blob/master/base64/test.nim
21:14:57Araqbase64 should be updated to use 'var openArray[char]'
21:15:10Araqthis would move the prepareMutation out of the hot loop naturally
21:15:23Araqand has nothing to do with cursors and moves etc.
21:16:23FromDiscord<Clyybber> Araq: This prepareMutation exists because of the string literal optimization right?
21:16:50FromDiscord<Yardanico> so I get 1.45s with refc (8mb peak mem) and ~2.1s with latest arc (2.7mb)
21:16:59FromDiscord<Yardanico> and yes, it only inferred 1 cursor in strformat 😄
21:17:14AraqClyybber: correct
21:17:15FromDiscord<Yardanico> for some reason in var xx = "" it inferred xx as a cursor, not sure what that means
21:17:28Araqit means it works
21:18:17disruptekno, this is nightly from 15th.
21:19:03disrupteki'm trying to remember to run it because i cannot be bothered to cron it.
21:19:04FromDiscord<Clyybber> Araq: Hmm, maybe a stupid idea, but if we can infer something as a cursor, shouldn't we be able to replace the symbol itself?
21:19:43Araqno.
21:20:34FromDiscord<Yardanico> well at least kostya/benchmarks default json benchmark is faster with arc (same for refc/arc in packedjson)
21:20:40FromDiscord<Yardanico> but yeah, time to test real projects
21:21:22AraqI should sleep now. for the first time this is beginning to feel complete. all big optimizations are implemented.
21:21:46FromDiscord<Yardanico> congrats 🙂
21:21:51Araqcursor inference is totally awesome for ORC btw
21:22:10Araqno cycle candidates just because you traverse a graph
21:22:51*leorize[m] left #nim ("User left")
21:30:25FromDiscord<Shucks> I don't have a clue what happens. But it sounds like my code will be faster in the future. Thanks.
21:30:41FromDiscord<Yardanico> in short: use arc/orc 😛
21:30:47FromDiscord<Shucks> perfect ;D
21:31:55leorize[m]1https://matrix.to/#/+nim:asra.gr <- feedback wanted from matrix users
21:33:19*leorize[m]1 is now known as leorize[m]
21:39:14*Senketsu quit (Read error: Connection reset by peer)
21:44:49*tane quit (Quit: Leaving)
21:48:45FromDiscord<Rika> ok so the issue was something with the devel commit i was at @Clyybber T_T
21:48:59FromDiscord<Rika> i was using an outdated devel anyway so that's ok
21:52:39FromGitter<ynfle> @Rika, did you implement `hash` and `==` for you own type? I had a similar issue and had to make it disctinct
21:52:59FromDiscord<Rika> yes it was a regular `object` and i did implement for both
21:53:05FromDiscord<Rika> its fixed now
21:53:13FromDiscord<--HA--> Can I pass an anonymous proc (returning Future[void]) to asyncdispatch.waitFor and how would that look like if so?
21:53:17FromDiscord<Rika> was on a bad devel commit or something i guess
21:56:12FromDiscord<Yardanico> @--HA--
21:56:21FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2rJi
21:56:22FromDiscord<Yardanico> for simplest example, but why?
21:56:30FromDiscord<Yardanico> and you're not passing the proc itself anyway
21:56:36FromDiscord<Yardanico> you're passing the result of it (the future)
22:00:01FromDiscord<--HA--> Ah that explains a lot. I didn't get that waitFor needs the Future and I have to execure the proc
22:00:35*noonien quit (Quit: Connection closed for inactivity)
22:00:39FromDiscord<Yardanico> well it says that it accepts a future
22:02:12FromDiscord<--HA--> sent a code paste, see https://play.nim-lang.org/#ix=2rJm
22:02:44FromDiscord<Yardanico> let rc = waitFor redis.openAsync(port = redisPort)
22:03:16FromDiscord<Rika> waitFor is the sync version of await
22:03:20FromDiscord<Rika> basically
22:03:25FromDiscord<--HA--> that will only work in a proc that is async itself though? and im on the top level
22:03:29FromDiscord<Yardanico> no
22:03:34FromDiscord<Yardanico> waitFor doesn't require async context
22:03:36FromDiscord<Rika> so if you have a sync proc and want to use an async proc you waitFor it
22:03:38FromDiscord<Yardanico> it'll work at global level just fine
22:03:44FromDiscord<Yardanico> that's the top place where it's used usually
22:03:50FromDiscord<--HA--> a i thought it was await, waitFor can be used like that too, nice
22:04:02FromDiscord<Yardanico> it's 3 lines of code by the way 😛
22:04:23FromDiscord<Yardanico> https://github.com/nim-lang/Nim/blob/devel/lib/pure/asyncdispatch.nim#L1924
22:05:03*NimBot joined #nim
22:05:49FromDiscord<--HA--> I feel like I understood a lot in a few minutes, thanks
22:08:43*leorize quit (Ping timeout: 240 seconds)
22:11:30*leorize joined #nim
22:14:36*sschwarzer joined #nim
22:18:13FromDiscord<Varriount> @Clyybber: Do you know how the recent optimizations relate to orc?
22:18:41FromDiscord<Yardanico> @Varriount 4raq told just above 🙂
22:18:53FromDiscord<Yardanico> > https://discordapp.com/channels/371759389889003530/371759389889003532/733070852547149933
22:19:16FromDiscord<Yardanico> but really most arc optimizations = orc optimizations as I see it
22:21:12FromDiscord<Varriount> @Yardanico I read that, however I'm still in the dark. What exactly is a cursor?
22:22:16*endragor joined #nim
22:22:48FromDiscord<--HA--> With HttpClient can I (and should I) keep reusing one client for all my requests or create new clients for new requests?
22:24:27FromGitter<sealmove> Guys for the 1 hundred time I started writing nimitai from scratch. This time use json (by converting yaml to it) and it works wonders. Should have done it from the beginning instead of trying to parse the stupid yaml. And if we ever get a compile-time yaml parser it should output JsonNode anyway, so it shouldn't be a problem.
22:26:35*endragor quit (Ping timeout: 240 seconds)
22:27:37FromDiscord<Yardanico> I told you before that you should do it 😛
22:27:49FromDiscord<Yardanico> but yeah, nice 🙂
22:27:59FromDiscord<Yardanico> @Varriount it's like an alias
22:28:05FromDiscord<Yardanico> it doesn't make a copy
22:28:13FromDiscord<Recruit_main707> nimitai?
22:28:18FromDiscord<Yardanico> Kaitai for Nim
22:28:20FromDiscord<Yardanico> @Varriount
22:28:25FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2rJu
22:28:27FromDiscord<Yardanico> here the compiler will infer that a is a cursor
22:29:20FromDiscord<Recruit_main707> cursor? 😅
22:29:23FromDiscord<Yardanico> yes
22:30:04FromDiscord<Recruit_main707> In what way
22:30:09FromDiscord<Yardanico> in "pointing" way
22:30:17sschwarzerRecruit: Araq talked about it in his NimConf talk
22:30:27FromDiscord<Yardanico> yes, but this cursor inference is a bit different I think
22:30:47FromDiscord<Recruit_main707> > in "pointing" way↵Ah, ok
22:30:50FromDiscord<lqdev> can't use `pointer` as a pragma because it's a keyword, what's closest to that? `cursor`.
22:31:00FromDiscord<Yardanico> ez
22:31:01FromDiscord<Varriount> Ah, I see.
22:31:06FromDiscord<lqdev> at least, that's where i think that came from.
22:31:30FromDiscord<Yardanico> right now it's not documented, but will be 😛
22:31:40FromDiscord<Yardanico> and it can actually be dangerous when applied manually
22:31:44FromDiscord<XxDiCaprioxX> type is used to define a new class, correct?
22:31:49FromDiscord<Varriount> yes
22:31:53FromDiscord<Yardanico> not "class" really, but yes
22:31:58FromDiscord<Yardanico> nim doesn't have "classes" in the traditional sense
22:31:59FromDiscord<Recruit_main707> structure rather
22:32:02FromDiscord<lqdev> just a new type
22:32:05FromDiscord<XxDiCaprioxX> So a type
22:32:27FromDiscord<lqdev> you can also do `type Number = float64` and it will work
22:32:46sschwarzerXxDiCaprioxX: type is a simpler concept :-)
22:33:11FromDiscord<XxDiCaprioxX> And if I want to instantiate a type do I write "var x = typename"
22:33:13FromDiscord<XxDiCaprioxX> ?
22:33:15FromDiscord<Yardanico> no
22:33:23FromDiscord<Yardanico> var x = TypeName() or var x: TypeName
22:33:27FromDiscord<Varriount> Hm, I wonder if it's possible for the compiler to detect acyclic references at compile-time
22:33:27FromDiscord<Yardanico> better use the first
22:33:36FromDiscord<Yardanico> well not really
22:33:40FromDiscord<Yardanico> otherwise orc wouldn't need to exist
22:33:56FromDiscord<Yardanico> compiler can show a warning if it detects a cyclic structure in simple cases
22:34:02FromDiscord<Varriount> Yardanico: Perhaps not for all references, but could a subset be suitably optimized?
22:34:03FromDiscord<Yardanico> (I mean it already does)
22:35:14FromDiscord<XxDiCaprioxX> Okay, so the concept is similar to other languages
22:35:20FromDiscord<XxDiCaprioxX> Thanks to y'all
22:40:21FromDiscord<Clyybber> @Varriount yeah, what yard said, its views. its similar to lent/view
22:42:12FromDiscord<Clyybber> there are some cases where we can determine at compile time that something will be acyclic
22:56:43*endragor joined #nim
22:56:52*solitudesf quit (Ping timeout: 256 seconds)
22:57:10shashlick@leorize - do you think it's time they reverted this - https://github.com/lz4/lz4/issues/53
22:57:10disbotCan't compile with PIE on 64bit linux
23:03:00ForumUpdaterBotNew thread by Snej: AsyncSocket seems to be dropping data, see https://forum.nim-lang.org/t/6548
23:03:14leorizeshashlick: not sure
23:04:15*endragor quit (Ping timeout: 256 seconds)
23:06:33leorizethis new optimization thingy looks cool
23:06:41leorizeany benchmarks done?
23:07:09FromDiscord<Yardanico> no 😄
23:07:13FromDiscord<Yardanico> well, some smol ones
23:07:24FromDiscord<Yardanico> from https://github.com/kostya/benchmarks not a lot changed
23:09:05leorizehave you tried the brainfuck bench?
23:09:29FromDiscord<Yardanico> benchmarks there are not really idiomatic though :9
23:09:30FromDiscord<Yardanico> 😦
23:09:41FromDiscord<Yardanico> the bf one uses a closure (!) iterator for iterating over the code lol
23:09:49FromDiscord<Yardanico> and it's roughly the same in most implementations
23:09:59leorizeyep, I wrote that part lol
23:10:15FromDiscord<Yardanico> but yeah with arc it's a bit slower for bench.b
23:10:31leorizeit's actually faster than storing string + position
23:10:40leorizefor default gc at least
23:11:17FromDiscord<Yardanico> mandel.b with arc is faster though
23:11:45FromDiscord<Yardanico> but I don't think the ARC optimizer PR will affect microbenchmarks a lot
23:12:22FromDiscord<Rika> man ARC is magic
23:12:36leorizehave you tested havlak? that one should benefit :P
23:12:46leorizeprobably will need orc
23:12:50FromDiscord<Yardanico> yes I just did
23:13:01FromDiscord<Yardanico> 1) we have our own havlak implementation in test suite
23:13:14FromDiscord<Yardanico> 2) the one from kostya benchmarks is faster with orc anyway
23:13:16FromDiscord<Yardanico> but uses more memory
23:13:22FromDiscord<Yardanico> ~12s vs ~8s for me
23:13:23disbotno footnotes for `12s`. 🙁
23:13:40leorizemore memory probably a side effect of the tslf allocator
23:13:53FromDiscord<Yardanico> ?
23:14:00FromDiscord<Yardanico> it's used for all refc/arc/orc, no?
23:14:24leorizea side effect of the realloc issue
23:14:36leorizewe really need to wire up the reallocator for tslf :P
23:14:42leorizeand fix the deallocator
23:15:33FromDiscord<Yardanico> ah this regression, I remember 4raq talking about it
23:16:58leorizeif you ever feel like diving in memory management you can try to tackle #14811
23:17:00disbothttps://github.com/nim-lang/Nim/issues/14811 -- 3Excess memory use for `string` with gc:arc ; snippet at 12https://play.nim-lang.org/#ix=2rJD
23:17:28leorizeI've linked the relevant resources
23:20:00*krux02_ joined #nim
23:22:38*krux02 quit (Ping timeout: 256 seconds)
23:27:22leorizeYardanico are you an IRC OP?
23:31:24FromDiscord<Yardanico> no
23:31:35FromDiscord<Yardanico> you can check the list yourself
23:33:09FromDiscord<Yardanico> "4raq", "d0m96", "def+", "fla viu", "Varri ount", "reactor monk", "PMu nch", "Xe", "ldle work" are OPs
23:33:13FromDiscord<Yardanico> replaced nicknames to not ping 😛
23:33:59leorizeI'll need an op to publish the IRC bridge on the matrix.org directory :P
23:34:02FromDiscord<Rika> "reactor monk"???
23:34:19leorizejust so people stop using the gitter bridge since that one is published by default
23:34:38FromDiscord<Yardanico> @Rika yes
23:35:10*sschwarzer quit (Quit: leaving)
23:37:34*leorize[m] left #nim ("User left")
23:37:51*leorize[m] joined #nim
23:41:22*krux02_ quit (Ping timeout: 260 seconds)
23:41:59FromDiscord<impbox> @dom96 thanks! withDir works \o/
23:53:50FromGitter<sealmove> if I have a macro that produces a unittest suite, can I run the suite without writing it to a file?
23:55:04FromDiscord<Yardanico> yes, just invoke it?
23:55:08FromDiscord<Yardanico> call the macro that is
23:55:22FromGitter<sealmove> oh this would work?
23:56:02FromDiscord<Yardanico> why wouldn't it? 😛
23:56:34FromGitter<sealmove> I don't know, does invoking a macro do the same thing as compiling a module?
23:57:18FromDiscord<Yardanico> well, the results of a macro get placed in the scope where you called it
23:57:21FromDiscord<Yardanico> that's how macros work 😄
23:57:23*tinandi joined #nim
23:57:49FromGitter<sealmove> Hmm true, it should work, you are right. That's awesome =)