<< 11-11-2019 >>

00:05:02*krux02_ joined #nim
00:08:36*krux02 quit (Ping timeout: 240 seconds)
00:48:05*krux02_ quit (Remote host closed the connection)
00:52:09*luis_ quit (Quit: luis_)
00:52:37*luis_ joined #nim
01:00:19FromGitter<zetashift> Qaaaq
01:05:40*uu91 quit (Read error: Connection reset by peer)
01:06:00*uu91 joined #nim
01:14:48*kevin joined #nim
01:15:04*kevin is now known as Guest73682
01:15:17*Guest73682 is now known as Kevin5
01:28:56*couven92 quit (Ping timeout: 240 seconds)
01:37:05*couven92 joined #nim
01:40:38*rockcavera joined #nim
01:44:10*sz0 quit (Quit: Connection closed for inactivity)
01:52:13*luis_ quit (Quit: luis_)
02:01:44nisstyreNim has Option[T], but is there an Either[T1, T2] sort of thing? I googled and found some third party stuff, but nothing baked in
02:02:20nisstyreI know you could easily roll your own, but it's nice to have something standard for obvious reasons
02:09:22*ng0 quit (Quit: Alexa, when is the end of world?)
02:21:02*couven92 quit (Read error: Connection reset by peer)
02:21:20*couven92 joined #nim
02:22:26*couven92 quit (Client Quit)
02:28:45*endragor joined #nim
02:50:24*rockcavera quit (Remote host closed the connection)
02:54:05*theelous3 quit (Read error: Connection reset by peer)
02:54:35*lritter quit (Ping timeout: 265 seconds)
02:55:08*lritter joined #nim
02:56:08*exelotl quit (Ping timeout: 245 seconds)
03:31:18*uu91 quit (Read error: Connection reset by peer)
03:31:34*uu91 joined #nim
03:32:35*uu91 quit (Read error: Connection reset by peer)
03:32:53*uu91 joined #nim
03:35:12*uu91 quit (Read error: Connection reset by peer)
03:35:29*uu91 joined #nim
03:37:39*uu91 quit (Read error: Connection reset by peer)
03:38:05*uu91 joined #nim
04:01:59*nif quit (Quit: ...)
04:02:09*nif joined #nim
04:04:24*fredrik92 quit (Ping timeout: 246 seconds)
04:09:04*couven92 joined #nim
04:09:40*uu91 quit (Read error: Connection reset by peer)
04:09:54*uu91 joined #nim
04:11:05*uu91 quit (Read error: Connection reset by peer)
04:12:00*uu91 joined #nim
04:22:53*Kevin5 quit (Ping timeout: 276 seconds)
04:33:09*nsf joined #nim
04:33:44*GordonBGood joined #nim
04:48:01*chemist69 quit (Ping timeout: 250 seconds)
04:50:13*chemist69 joined #nim
05:00:23*uu91 quit (Read error: Connection reset by peer)
05:00:35*uu91 joined #nim
05:01:32*uu91 quit (Read error: Connection reset by peer)
05:01:48*uu91 joined #nim
05:36:59*lritter quit (Ping timeout: 265 seconds)
05:47:17skrylar[m]saltstack clones in nim? hmm
06:06:05*dddddd quit (Read error: Connection reset by peer)
06:15:09*narimiran joined #nim
06:20:30*uu91 quit (Read error: Connection reset by peer)
06:20:55*uu91 joined #nim
06:23:55Araqnisstyre: I agree, it should be part of the stdlib
06:47:47FromDiscord<ZeeQyu> @krab4t Oh, you mean the naive, language-agnostic indexing of the open file like that. Nah, I won't stop before languages-awareness.
07:13:58Araqis it too late to rename --gc:destructors to --gc:arc?
07:16:18*kevin joined #nim
07:16:42*kevin is now known as Guest82331
07:16:50*Guest82331 is now known as Kevin5
07:17:08Kevin5👑
07:17:56*PMunch joined #nim
07:28:07FromDiscord<kodkuce> this vscode is going crazy, now it tells me i am not using procs and gives warning and i am using them
07:28:59FromGitter<zacharycarter> I think if --gc:arc is more descriptive
07:29:06FromGitter<zacharycarter> it's better to do it now rather than later
07:30:21FromGitter<zacharycarter> none of the Nim serialization libraries (nesm / nim-serialization) seem to be able to do what I need, so I guess I'm writing custom serialization code myself
07:30:56Zevvzacharycarter: what *is* it that you need then?
07:31:47FromGitter<zacharycarter> nesm fails hard on generics it seems
07:32:28FromGitter<zacharycarter> like trying to add a serializer for the Vec3f type in GLM fails - so does explicitly passing in Vec3[float32] or Vec[3, float32]
07:32:59FromGitter<zacharycarter> nim-serialization has features described in the readme which I don't think are implemented yet - mainly adding a serializer to an already defined type
07:33:07FromGitter<zacharycarter> one whose type definition you don't want to change
07:34:33Zevvand you dont care what you serialize to/from?
07:35:19FromGitter<zacharycarter> I'd prefer it to be some format that's human editible
07:35:23FromGitter<zacharycarter> otherwise I'd just do binary
07:35:41Zevvright, thats what I ment :)
07:35:47FromGitter<zacharycarter> it's map data for a game, so editing by hand is something users might want to do
07:35:49FromGitter<zacharycarter> yeah :/
07:35:50Zevvand json doesnt cut it probably
07:35:57Zevvtoo lossy
07:36:00FromGitter<zacharycarter> I haven't tried, but I doubt it
07:36:01FromGitter<zacharycarter> yeah
07:36:12Zevvrepr it :)
07:36:47Zevvyou'll only need to ship the compiler to parse it back in
07:36:54FromGitter<zacharycarter> :P
07:37:03FromGitter<zacharycarter> it's not the worst idea in the world lol
07:37:22Zevvi got tons of ideas that are *just not* the worst ideas in the world
07:37:32Zevvit doesn't bring me anywhere still, though
07:38:00FromGitter<zacharycarter> better than no ideas though
07:38:14Zevvtrue, true
07:40:56Araquse binary
07:41:41FromGitter<zacharycarter> will probably just end up doing that
07:41:56FromGitter<zacharycarter> I'm shipping a map editor with the game anyway, so it's not like users need to manually edit
07:42:07FromGitter<zacharycarter> and it's probably safer as it prevents them from making edits that break things
07:42:28Araqyup
07:42:28Zevvwhat about portablility over architectures?
07:42:42*solitudesf joined #nim
07:42:47Araqlittle endian has won anyway
07:45:35FromGitter<zacharycarter> got a bunch of network code written over the weekend - have players connecting and seeding their RNGs with a common value - starting to work on game state code now
07:46:12FromGitter<zacharycarter> so making good progress on that side of things anyway, but it's time to start rendering stuff, thankfully I already did map rendering previously so I should be able to get something working quickly, and soon hopefully have units moving around on multiple clients
07:47:09GordonBGoodAraq: renaming --gc:destructors to --gc:arc works for me as it is certainly more accurate as the current evolving implementations doesn't ahve so much to do with destructors
07:47:43AraqGordonBGood: got doubly linked lists to work, see
07:47:44Zevv'--gc:arc' sounds just like '--gc:araq'
07:47:51GordonBGoodI doubt --gc:destructors has been used much other than to check it out up to now as it hasn't worked consistently
07:47:54Araqhttps://github.com/nim-lang/Nim/pull/12637
07:48:18Araqand async compiles!
07:48:31Zevvif it compiles, ship it!
07:48:40Araqbut crashes, now I am investigating
07:48:47*jjido joined #nim
07:49:40GordonBGoodAraq: Yes, I've been folloiwng you --gc:destructors and glad you seem to be getting close to something generally usable...
07:51:00GordonBGoodI've been writing tests to compare its performance with --gc:boehm and find that its about the same speed except for cases where there are a lot of "owner" references to the same heap object...
07:51:14GordonBGoodbut of course less and consistent latency
07:51:54Araqany chance you can publish these tests?
07:51:58GordonBGoodI want to see the new --gc stable and then will really press moving seqsv2 across all
07:52:16GordonBGoodYou bet I will once I've got them resentable
07:52:31Araqseqsv2 is only important for --gc:boehm
07:52:57Araq--gc:arc already has them and the other GCs are scheduled for deprecation anyway, see my RFC
07:52:57GordonBGoodYes, I know, but if it works for --gc:boehm, it likely will for the others with little extra effort
07:53:10Araqok
07:53:12GordonBGoodYes, I now follow your NFC's
07:54:27GordonBGoodMy biggest concern that I'm trying to test quite thouroughly is that the new GC implmentations work with the environment ref inside closures; that was one of the biggest uglinesses before
07:54:27*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
07:55:03*sagax quit (Quit: Konversation terminated!)
07:55:09GordonBGoodOnce my tests are finished, I think I should likely PR them into thest standard tests
07:55:28GordonBGood^into the standard
07:55:57GordonBGoodBut I'll likely post a gist here first to see if anybody has any suggestions
07:56:48*sagax joined #nim
07:57:46Araq"about the same speed as boehm" would be excellent btw, in theory it's slower
07:58:24Araqas an RC algorithm trades everything for "prompt reclamation"
07:59:40GordonBGoodI'm about half a step from being able to post some exact results; it is slower when there are lots of atomic ref counts, but when there aren't too many, critical sectioned allocations/deallocations are the same... and the garbage collection takes about the same amount of them
08:00:00*gmpreussner quit (Quit: kthxbye)
08:00:03GordonBGoodand the GC takes about the same amount of extra time as the atomic ref counts
08:01:01GordonBGoodI'm looking for a realistic benchmark that is less alloc/dealloc based and which requires more references to the same data to test a "worst case" for arc
08:05:06*gmpreussner joined #nim
08:24:01Araq"a realistic benchmark" doesn't cut it, we need a suite of benchmarks
08:27:56GordonBGoodYes, what I've done so far is just a start; we need some benchmarks to test what I don't so far
08:29:30GordonBGoodI mean, it's easy to find some latency benchmarks to make boehm look worse, but throughput benchmarks will certainly be worse for arc
08:29:53GordonBGoodif the benchmark uses lots of references to the same heap data
08:30:45GordonBGoodI guess just some worst case representations either way might have to do
08:31:28*floppydh joined #nim
08:45:27*solitudesf quit (Ping timeout: 246 seconds)
08:45:27Araqlatency is more important though for Nim, given its focus
08:46:01Araqand considering the competition, C# is not a slug, for example
08:47:26Araqas is memory overhead, people want Nim for embedded device
08:47:29Araqs
08:48:42GordonBGoodYes, it's not a problem for many, and as an alternate when latency doesn't matter, we can offer boehm
08:49:19GordonBGoodYour NFC even includes possible avenues to investigate about alternative solutions to cyclic data
08:49:40Araqyeah, =trace is likely coming
08:49:54GordonBGoodYeah, I see the stub for it in the code
08:50:02Araqand then we have a pretty unique design too
08:50:27GordonBGoodI like it, as =trace follows along the design of the other "hooks"
08:50:32Araqschedule the expensive local cycle collection on your own if you create cycles, it's still memory safe
08:51:04GordonBGoodYeah, I'm starting to like it a lot, if it all works out as we see it now
08:51:34Araqalso what I noticed: inside objects 'owned ref' should be the default
08:51:48Araqand also for return types
08:52:16Araqwith .cursor these are owned refs and only the weak pointers are annotated, the right defaults
08:52:17GordonBGoodYes, that's the way I see it, too, once we start to combine the ideas of arc and `owned`
08:52:33Araqno, I mean this bothered me about B/D
08:52:59GordonBGoodI still have to think more about how .cursor is applied, but I'm starting to see it
08:53:02Araqit claims unowned refs should be the default, but it's actually close to 50%
08:53:34Araqor maybe to 30%, 'owned' sneaks into quite a bit
08:53:44GordonBGoodYeah, I think we are moving well beyond the basic ideas of B/D
08:54:00GordonBGoodbut the basic `owned` idea still applies
08:55:15Araqhow so?
08:55:41AraqI mean, I hope we can combine it somehow but so far I'm not seeing it
08:56:38GordonBGoodYou still apply the `owned` idea where it can help inside objects, maybe we can think of another way of containing it, with an "escape" method when it doesn't really work?
08:56:45*nif quit (Quit: ...)
08:56:54*nif joined #nim
08:57:52GordonBGoodAnyway, we have time for those considerations, make arc with the =trace or whatever extensions work first; I think many will be happy with just that, as they shouldn't have to change their library code maybe at all
08:59:59GordonBGoodSo far, our arc seems to be better than Swift's and easier to use than Rust's, I think that is our customers biggest concern
09:01:21GordonBGoodOur destructors are maybe the very best way of including move/copy/destroy and now trace sematics - fairly concise, yet very powerful
09:02:00GordonBGood^our "hooks" we should likely say
09:03:07Araqtoday I learned Swift actually distinguishes between @escaping and not escaping closures
09:03:32Araqnon-escaping closures are even the default, helps them optimize FP code
09:03:35Araqvery interesting
09:03:53Araqit's a bit like 'sink proc' vs 'proc'
09:04:02GordonBGoodYeah, it won't work without it, and one has to help it distiquish when one needs the escaping ones manually
09:04:39GordonBGoodYes, it could be considered somehitng lsimilar to when want to use `sink`
09:06:07GordonBGoodTo use either properly, one has to be knowledgeable about how they are used
09:07:22GordonBGoodNim compiler is much smarter about figuring out when closure environments need to be lifted to the heap
09:17:07*Kevin5 quit (Remote host closed the connection)
09:18:51*Vladar joined #nim
09:23:27*letto quit (Quit: Konversation terminated!)
09:25:01*letto joined #nim
09:31:21*clyybber joined #nim
09:36:58Araqclyybber: er, stupid question: did we ever ensure object constructors work with '=' and '=sink' ?
09:37:41*Jesin quit (Ping timeout: 265 seconds)
09:43:07FromGitter<mratsim> btw, is it intentional that we can do "result = move foo" but not "result = sink foo"
09:44:26FromGitter<mratsim> Also regarding gc:arc I don't see an issue, but we might want a Rc / Arc distinction so that when we switch to --threads:on by default we can choose which types pay the Atomic tax
09:44:49FromGitter<mratsim> and ref would be default GC
09:45:15Araqwhat is 'result = sink foo'?
09:45:19FromGitter<mratsim> that complexify a bit stuff but the default is good enough and it doesn't prevent finding more perf
09:45:34FromGitter<mratsim> when you append to a collection
09:45:35Araqyou are supposed to use 'result = move foo'
09:45:50FromGitter<mratsim> but foo needs to be var in that case
09:45:55Araqand a move is not a =sink, a move is a =sink + wasMoved
09:45:56FromGitter<mratsim> and my foo is sink
09:46:13Araqthen you should use plain assignment
09:46:25Araqresult = foo # moved for 'foo: sink T'
09:49:57FromGitter<mratsim> Also currently with have supportsCopyMem(T) that can be used for types that are thread-safe i.e. we can copy them and send them to a channel. ⏎ ⏎ We might need a tag for types that are thread-safe in the sense that we can pass ownership or a pointer to them through a channel
09:50:15FromGitter<mratsim> or a concept or something.
09:50:43FromGitter<mratsim> I really don't understand the magic in channels.nim that sends seq and strings though :p
09:53:17clyybberAraq: Yeah, afaik
09:53:41clyybberI mean we treat the arguments like sink args
09:56:17*krux02 joined #nim
10:11:58FromDiscord<kodkuce> how to use run forwer, i dont wnat to block thread , https://play.nim-lang.org/#ix=21s5
10:13:32FromDiscord<kodkuce> wait for works np but duno how to use runforewer
10:13:51Araqclyybber: but Obj(field: x) doesn't call '=sink', does it? it copyMem's foo into 'field' and does 'wasMoved(x)'
10:14:10Araqit's not transformed into 'o.field = x'
10:14:45Araqnot that it's bad, it's good but the spec must reflect it
10:17:06FromDiscord<kodkuce> give me power
10:17:22AraqrunForever is for you main program
10:17:29Araqwhen you write a server
10:17:47Araqsince it runs forever there are no other places where you can call it...
10:18:35FromDiscord<kodkuce> so thats is my main program
10:18:41FromDiscord<kodkuce> but how to call it
10:18:49FromDiscord<kodkuce> i dident get what you wanted to say at all
10:19:16AraqI didn't understand your question either
10:19:30AraqrunForever() # how to call it.
10:19:32FromDiscord<kodkuce> my question is how to execute run forewer
10:19:48FromDiscord<kodkuce> yes how to use runForever()
10:19:56FromDiscord<kodkuce> it runs some proc forewer right?
10:20:49FromDiscord<kodkuce> there is server.serve and i will need to run gamelogic in async too for gamelogic, my plan was to put it in runforewer
10:21:48FromDiscord<kodkuce> oh i think i got what you wanted to say i just call runForewer() whitout any proc as argument
10:24:03FromDiscord<kodkuce> tough hmm still dont get how to make 2 async procs run forewer, guess need to read up more
10:25:15clyybberAraq: It all goes through destructiveMoveVar when possible, so yeah.
10:26:18Araqso it does call '=sink'?
10:26:23clyybberNope
10:26:31clyybberBut neither do other sink args
10:26:43clyybberBut yeah, the spec should be more clear on that part.
10:27:01Araqhmm ok
10:27:12FromDiscord<itmuckel> Hey. I wanted to look into https://github.com/PMunch/nimlsp. It doesn't work on Windows, so I created a small fix like this:
10:27:12FromDiscord<itmuckel> ```nim
10:27:12FromDiscord<itmuckel> when system.hostOS == "windows":
10:27:12FromDiscord<itmuckel> storage = getEnv("TEMP")
10:27:12FromDiscord<itmuckel> else:
10:27:13FromDiscord<itmuckel> storage = "/tmp/nimlsp"
10:27:13FromDiscord<itmuckel> ```
10:27:14FromDiscord<itmuckel>
10:27:17FromDiscord<itmuckel> Now, when I compile it with `nim c nimlsp.nim` it runs fine, but when I use `nimble build` I end up with the wrong path. How can that be?
10:27:20clyybberBtw, it has worked like that forever, at least at the time where I first looked at injectdestructors
10:27:43clyybberAraq: Though I think we could replace the copyMem with a =sink call if you want?
10:27:59Araqwhy would we do that?
10:28:12clyybberI don't know :D
10:28:17Araqlets update the spec instead
10:28:22clyybberYeah
10:30:19*solitudesf joined #nim
10:30:46FromGitter<mratsim> I put my thoughts on a threading API in a gist so that I don't forget them and we can tackle that after async + destructors is solved: https://gist.github.com/mratsim/cb088bed2d69aa691c87360472e4bd7f
10:39:39PMunchitmuckel, could you try to add a `static: echo system.hostOS` and then run nimble build with the verbose flag?
10:39:58PMunchJust to see what it is set to
10:45:23FromDiscord<itmuckel> @PMunch `nimble --verbose build` shows now output 🤔
10:46:18PMunchTry nimble build --verbose
10:47:36PMunchOh wait, `nimble build --debug`
10:50:07FromDiscord<itmuckel> system.hostOS is windows
10:51:11PMunchThat's strance
10:52:37PMunchIs your "TEMP" variable set to /tmp/nimlsp? :P
10:52:50FromDiscord<itmuckel> 😅
10:53:20FromDiscord<itmuckel> Also checked that in the static output, it's AppData/Local or somethin similar
10:54:41PMunchBy the way, for future reference, please don't paste code into Discord
10:54:56PMunchIt comes through as a long multiline message on IRC
10:55:21FromDiscord<itmuckel> But it is a multiline message 😄
10:57:01PMunchYeah, but on IRC we prefer paste-site links
10:57:20FromDiscord<itmuckel> What is that?
10:57:27narimiranon irc is not "a long multiline message", it is multiple single line messages
10:57:29PMunchix.io/pastebin/hastebin/etc.
10:57:37FromDiscord<itmuckel> ah
10:57:37PMunchnarimiran, true
10:57:59FromDiscord<itmuckel> Oh that sucks of course
11:01:26FromDiscord<itmuckel> Okay, I had changed `storage` back from a variable to a compile time constant. Now it does, what it should. 🙂
11:01:47FromDiscord<itmuckel> Why are you using IRC instead of Discord?
11:07:25Araqwe have neckbeards, never had a single unique creative thought ever and don't use anything invented after 1970
11:08:34clyybberitmuckel: like the simplicity
11:09:14Araq"await (or fetch or sync) is better than ^" ... blasphemy!
11:09:25clyybberalso I'm getting "ELEVATED API ERRORS" when trying to log into discord
11:09:58clyybberAraq: Is ^ a syntactic sugar for await?
11:11:08FromDiscord<Clyybber> @itmuckel now it works..
11:12:07FromDiscord<itmuckel> 😄
11:28:59Araqclyybber, it's future.read
11:29:29FromGitter<mratsim> @Araq, I think I am missing something with destructors, how do you enforce transfer of ownership for a proc? it seems like "sink" discourages but may copy. Will it be enforced in the future (so we need a warning) or do we need a new "take" keyword?
11:29:58Araqto enforce moving you have to mark your '=' operator as .error
11:30:00FromGitter<mratsim> and maybe a give in that case for return values :P
11:30:46FromGitter<mratsim> that doesn't really work for collections that would take a hint for example
11:30:50FromGitter<mratsim> int*
11:31:35Araqit does really work.
11:32:07Araqthe existing collections need to be patched to use 'sink' parameters
11:32:19Araqwe haven't done this yet :-(
11:32:58FromGitter<mratsim> ```code paste, see link``` ⏎ ⏎ ^ this compiles [https://gitter.im/nim-lang/Nim?at=5dc946eaeeb63e1a839306a6]
11:33:33FromGitter<mratsim> I want to ensure statically that it's an error
11:33:45FromGitter<mratsim> sink/move/take/give keywords are fine by me ;)
11:36:50Araqcreate a type where = is .error
11:37:08Araqno idea why it has to work with 'int'.
11:39:28PMunchitmuckel, you can assign storage within the same const block as those other variables by the way. Just do `storage = when hostOS == "windows": getEnv("TEMP") else: "/tmp/nimlsp"`
11:39:51FromGitter<mratsim> also unrelated but for documentation having move in either the return type or the tags (maybe tags, less noisy) would be useful. ⏎ ⏎ This library (used in LLVM Polly) use isl_give isl_take isl_keep macros as annotation about ownership for high-level wrappers ⏎ ⏎ https://github.com/Meinersbur/isl/blob/master/isl_schedule_tree.c#L47-L71 [https://gitter.im/nim-lang/Nim?at=5dc94887c26e8923c404fa41]
11:40:08*nif quit (Quit: ...)
11:40:17*nif joined #nim
11:43:30*nif quit (Client Quit)
11:43:39*nif joined #nim
11:46:49Araqmratsim: the design has been through 3 iterations and the last thing we need is even more annotations
11:48:01Araqwe already have var/sink/lent to express every property of a container's operations with the exception of 'kill T' parameters that we don't know how to design
11:48:29*rockcavera joined #nim
11:52:37FromGitter<mratsim> also it seems like the following compiles with or without gc:destructors
11:52:48FromGitter<mratsim> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dc94b9050010612b29b03cf]
11:54:05clyybbermratsim: WHy should it not?
11:54:11clyybberEvery assignment is made a sink
11:54:14clyybber=sink
11:54:24FromGitter<mratsim> ah I see
11:55:03FromGitter<mratsim> yes it works fine then
11:58:21clyybberhmm, your mutating int issue is weird
11:58:52clyybberAraq: Correct me if I'm wrong, but didn't we say that sink params don't have to be passed by ref?
11:59:29*endragor quit (Remote host closed the connection)
12:02:03PMunchHmm, interesting issue
12:02:56PMunchI'm writing a DLL for a C program. It supports multi-threading, and it will call procedures from the DLL in random threads.
12:03:50PMunchI tried with --gc:boehm and I get "Collecting from unknown thread" and with --threads:on and setupForeignThreadGC() and tearDownForeignThreadGC() it gets random segfaults and such
12:05:38PMunchAha, it seems like there is a combination of using async..
12:12:42*ng0 joined #nim
12:15:36clyybbernarimiran: My PR isn't ready yet, need to fix some error msgs
12:15:48Araqclyybber, yup, they are not
12:15:59narimiranclyybber: ah, i've restarted the CI :)
12:16:10clyybbernarimiran: I noticed :)
12:16:28clyybberAraq: Hmm, I'll go inspect the C code
12:16:39narimiranat least one test should now be green (the one in packages) :)
12:17:05PMunchHmm, I can't use a regular HttpClient with threads on either?
12:17:15clyybbernarimiran: treeform/ws?
12:17:18narimiranyep
12:17:39clyybbernice
12:17:58narimirani'll leave the rest of failing tests to you :)
12:18:07FromDiscord<itmuckel> @PMunch awesome, thank you!
12:18:20clyybbernarimiran: I'm on it :)
12:18:55PMunchitmuckel, there's a lot you can do like that: https://peterme.net/tips-and-tricks-with-implicit-return-in-nim.html
12:20:54clyybbermratsim: Hah, I was misreading your snippet, thought the echo was outside of foo, and was like wtf
12:26:56PMunchHmm, can I run an asyncdispatcher in a thread and pass tasks to it over a channel?
12:32:11livcddoes anyone have some complex scraper in Nim ? I only saw mashingan's manga scraper
12:57:19*endragor joined #nim
13:01:39*endragor quit (Ping timeout: 246 seconds)
13:02:57AraqPMunch, I think so but the tasks are deepcopied
13:04:03PMunchWell I just need to send some HTTP requests, so I can pass the data I need to send over a channel and just keep everything on the thread
13:10:55PMunchUgh, I get random segfaults..
13:12:33PMunchHow can I check which GC is being used in a `when` check?
13:12:57Araqwhen compileOption("gc", "refc")
13:12:59AraqI think
13:14:55PMunchHmm, so with boehm it now just randomly freezes..
13:15:04PMunchAnd with the default GC I get random segfaults..
13:19:30*tklohna joined #nim
13:20:21Araqdo you cast to pointer?
13:20:48PMunchPass what to pointer?
13:20:58FromGitter<kaushalmodi> Araq: PMunch's case seems similar to my case?
13:21:21FromGitter<kaushalmodi> PMunch: Do you exportc Nim procs to C side?
13:21:33FromGitter<kaushalmodi> and have the proc take inputs via ptrs from C side, etc?
13:21:42PMunchYup
13:22:17FromGitter<kaushalmodi> In my case, --gc:none is the only option until --gc:destructors is ready
13:23:13PMunchHmm wait, now I get segfaults in my non-threaded version as well..
13:23:18PMunchMust've messed something up
13:23:29PMunchIt of course doesn't always happen either
13:24:03PMunchOh wait, nvm I had --threads:on in my .cfg file
13:25:04FromGitter<kaushalmodi> PMunch: I do not have threads enabled but the C app that uses the Nim exported procs is threaded and also does some "non-C-style stack switching"
13:25:15PMunchHmm
13:25:37PMunchNot really sure what the host program here uses TBH
13:25:49PMunchWhich application is it that you're interfacing with?
13:25:59FromGitter<kaushalmodi> it's a SystemVerilog compiler
13:26:12FromGitter<kaushalmodi> I can point you to earlier valgrind logs to you
13:26:37PMunchHmm, I think disabling the GC would be a massive pain for me though..
13:26:52PMunchSince I have to read some config files and send HTTP requests..
13:27:22FromGitter<kaushalmodi> one of such valgrind logs from my experiements: http://ix.io/216J/text
13:28:43FromGitter<kaushalmodi> , and http://ix.io/216M/text
13:30:11PMunchHmm, the program I work with can disable threads. And that seems to work well with async
13:33:16*Kaivo joined #nim
13:33:39*tklohna quit (Ping timeout: 268 seconds)
13:33:47FromGitter<kaushalmodi> PMunch: For GC support in threaded apps, have you tried what nimpy does? https://irclogs.nim-lang.org/07-11-2019.html#03:30:51
13:34:05FromGitter<kaushalmodi> i.e. use `setupForeignThreadGC()`
13:34:53*tane_ joined #nim
13:35:54PMunchYes
13:36:20PMunchI have setup/teardown in all the procs that might get called by the random threads
13:36:54PMunch--gc:none and just ignoring all the warnings made it stop crashing
13:37:03PMunchSo at least I know that it's the GC that causes this..
13:37:20FromGitter<kaushalmodi> PMunch: That was the limit of all GC knowledge I gained in past week :D
13:37:31FromGitter<kaushalmodi> I ended with with --gc:none and ignoring the GC warns too
13:38:08PMunchI can't do that though..
13:39:00FromGitter<kaushalmodi> PMunch: Here's a minimal example to create the crash in my case: https://github.com/kaushalmodi/nim-systemverilog-dpic/blob/master/gc_crash_debug/libdpi.nim
13:40:25PMunchHmm, I guess I could create my own thread, then just pass on the pointer to the C data to that single thread as the only thing I do in the C code
13:40:45PMunchSo I essentially make my code single-threaded, but allows the host program to be multi-threaded
13:41:00Araq"--gc:none so at least I know that it's the GC causing it"
13:41:00shashlick@kaushalmodi are you able to create a simple example for the crash
13:41:08Araqthat's not how it works...
13:41:29shashlickThis is just the callback, your caller is sv so it isn't easy to reproduce
13:41:31FromGitter<kaushalmodi> shashlick: that's what I linked in the last link
13:41:38FromGitter<kaushalmodi> shashlick: yes
13:42:01shashlickIf you can create a C or Nim caller to repro it will help make progress
13:42:32FromGitter<kaushalmodi> shashlick: if I do all the groundwork of setting up a way to get you the SV compiler, would it help?
13:42:49FromGitter<kaushalmodi> Araq: I talked to the SV compiler vendors and they will give away a license to help debug this GC issue
13:42:55PMunchAraq, no? If the GC is not running and that makes the program stable (although leaking memory) isn't that an indicator that the GC is causing the crashes?
13:43:20Araqit's a good indicator but since you're in memory unsafety land you can never be sure
13:43:22shashlickI'm no expert but having a simple way will definitely eliminate a lot of complexity
13:43:28PMunchMy issue is with Unbound, an open source DNS server, that might be easier?
13:43:42Araqthe bugs might still be there but now you get away with them
13:44:02shashlickFurther, can you try older versions of Nim to see if something broke recently
13:44:12PMunchhttp://ix.io/21sN
13:44:13disbot^ play at https://play.nim-lang.org/#ix=21sN 😏
13:44:29PMunchHmm, that seems, odd
13:44:55PMunchIt is consistent though..
13:44:55FromGitter<kaushalmodi> shashlick: This GC issue had always been there for me.. just that I found some time to dive into it
13:45:07shashlickAnother thing, both of you are using nimterop - I'm betting it has something to do with the wrappers
13:45:09FromGitter<kaushalmodi> I was holding off earlier as I had never used gdb and valgrind
13:45:24FromGitter<kaushalmodi> shashlick: that example I linked above does not use nimterop
13:45:38FromGitter<kaushalmodi> it's a plain Nim exportc proc doing just string echoes
13:45:41PMunchshashlick, I'm not
13:45:43shashlickNo where in the app?
13:46:00shashlickWell maybe that makes me feel better :p
13:46:04FromGitter<kaushalmodi> :)
13:46:34shashlickTry 0.19.6
13:46:51*tklohna joined #nim
13:47:20FromGitter<kaushalmodi> shashlick: I have been experimenting with Nim/SV interface since 0.18.x.. never had success
13:47:28FromGitter<kaushalmodi> i.e. never had success with GC enabled
13:48:35shashlickOk I understand how frustrating it is
13:48:50shashlickTook me months to fix my editor crash
13:48:59shashlickBut it was worth it since it made Nim better
13:49:06FromGitter<kaushalmodi> but I am glad that --gc:none works fine
13:52:32*nsf quit (Quit: WeeChat 2.6)
14:02:06PMunchHmm, I seem to have been able to get it working now
14:02:13PMunchWith the garbage collector
14:03:15*GordonBGood quit (Ping timeout: 268 seconds)
14:05:16PMunchOf course actually verifying that it will never crash is a whole different beast entirely..
14:23:59*kungtotte joined #nim
14:25:20shashlick@kaushalmodi
14:25:36FromGitter<kaushalmodi> yes?
14:25:43shashlicki just tried with a minimal main function and with useNimRtl, it works fine
14:25:53shashlickdo you have any other nim components in your test
14:26:00FromGitter<kaushalmodi> I have tried that too; didn't work
14:26:12FromGitter<kaushalmodi> no, that's the only .so from Nim that links with the C app
14:26:26Araqshashlick, kaushalmodi's problem is unfixable without --gc:destructors as far as I can tell
14:26:58shashlickit's just a standard dll scenario - what's the need for destrutors?
14:27:06shashlickthis means you cannot use a nim dll with anything?
14:27:40PMunchwell I got it working
14:27:42clyybbershashlick: No, the code he embedds it in does stack switching
14:27:42Araqkaushalmodi uses C code that does wild and crazy stack switching
14:27:45PMunchAt least it seems to be working
14:28:04FromGitter<kaushalmodi> shashlick: same crash when using libnimrtl: https://gitter.im/nim-lang/Nim?at=5dc38ff83f4ea333f2c531c8
14:28:04Araqstack switching is not even support by the otherwise really conservative Boehm GC.
14:28:21Araqit's fair to assume that PMunch has a different problem
14:28:50PMunchYeah, mine seems to have been with getEnv and some other "regular" threading issues
14:29:03FromGitter<kaushalmodi> yes, to what Araq said
14:29:06shashlickokay well then beyond my pay grade
14:29:28PMunchJust using GDB to see where it crashed I was able to move everything to the initialiser or into a background thread :)
14:30:11PMunchThe AsyncHttpClient running in the background thread seems to do some really odd things though
14:31:17PMunchIt's almost like it ends up sending garbled requests..
14:33:29PMunchAh switching a poll for a drain fixed it
14:37:35disruptekPMunch: i wasn't able to reproduce your problem with defer inside a template.
14:39:03PMunchWhat do you mean?
14:39:14PMunchI solved that in a better way by the way
14:39:42disruptekwhat'd you come up with?
14:39:43Araqso ... my valgrind doesn't support --exit-on-first-error and apparently I cannot update my version without an OS update. in what universe is this distribution thing a good idea?
14:40:31disruptekhttp://ix.io/21sW/nim
14:40:32disbot^ play at https://play.nim-lang.org/#ix=21sW 😏
14:40:40PMunchdisruptek, http://ix.io/21sX/nim
14:40:41disbot^ play at https://play.nim-lang.org/#ix=21sX 😏
14:40:41clyybberAraq: What OS?
14:40:58AraqUbuntu
14:41:00FromGitter<Vindaar> ... rolling release distros ftw ...
14:41:22disruptekAraq: says the guy who wanted nim distributions...
14:41:27Araq"rolling release" == "how it always worked anywhere else"
14:41:35clyybberAraq: Ugh, yeah. It beats me how someone once thought that it would be a good idea to tie package updates to the os.
14:41:37Araqdisruptek, I'm aware :P
14:42:43Araqok I give up, you tell me which Linux to use
14:42:55clyybbervoid linux
14:42:59disruptekgentoo
14:43:01FromGitter<Vindaar> +1 for void
14:43:11clyybbervoid is simple straight forward no bs
14:43:12Araqcondition: it must run my VirtualBox
14:43:19Araq*in my
14:43:44disruptekvoid also apparently swaps dash for sh, so have fun with that.
14:43:50solitudesfim void shill too
14:43:54disruptekor, sh for dash.
14:44:17clyybberxbps-install bash
14:44:20solitudesfwhy is that a problem?
14:44:22clyybberchsh
14:44:24clyybberproblem solved
14:44:31solitudesfbash is installed by default anyway
14:44:34disrupteki'm just questioning the wisdom.
14:44:34clyybberAraq: It does
14:44:49disruptekwe had a user here yesterday who couldn't make nimble work because ~ != $HOME
14:44:58clyybberdisruptek: You surely want to have it boot fast right?
14:45:07disruptekhow fast is fast?
14:45:19clyybberfaster than arch, if thats a metric
14:45:26disrupteknot to this gentoo user.
14:45:29clyybberand arch switched to systemd for "faster booting"
14:45:40clyybberdisruptek: gentoo: boot fast, get nothing done anyways
14:45:54solitudesfuh oh
14:46:10Araqhttps://a-hel-fi.m.voidlinux.org/live/current/ wtf man, no way I'll eat this
14:46:11disrupteki mean, you brought up boot speeds. 🤷
14:46:40clyybberdisruptek: Are you using gentoo?
14:46:52disruptekyeah. it's probably not the right choice for araq.
14:47:08clyybberdisruptek: I assume you have a build server?
14:47:46disruptekfor what?
14:47:55clyybbercompiling?
14:48:05disrupteklike, windows apps?
14:48:06solitudesfaraq, go for manjaro is you want rolling release but with non-autistic installer
14:48:09PMunchManjaro might work well. Simple install, rolling release
14:48:14PMunchHaha, yeah
14:48:32clyybberyeah, manjaro is great too
14:48:39disrupteki think arch is kinda the default dev os these days, isn't it?
14:48:54shashlick@Araq - am looking at https://github.com/nim-lang/nim/issues/12612
14:49:02shashlickeven if you remove async, it fails
14:49:10clyybberdisruptek: compiling the programs you use?
14:49:44disruptekin what universe does it matter? also, i have a decently fast machine and a program called `ccache`.
14:50:11disruptekthere's this new thing where you can run jobs in the background...
14:50:42clyybberoh well, my PC struggles just doing ./koch temp in the background
14:51:52clyybberwith void I can compile from src and have binaries, and also I found it a lot easiert to get into than gentoo
14:52:02disrupteki guess i'm of the opinion that hardware is much cheaper to improve than software.
14:52:42disruptekif i hadn't been running gentoo for like 15 years, i probably wouldn't be running it now.
14:52:57*dddddd joined #nim
14:53:54disruptekalthough until this year, i hadn't run it on the desktop in a decade or so.
14:54:17clyybberhardware requires money, software doesnt :p
14:54:30clyybbers/^/improving
14:54:37*Vladar quit (Quit: Leaving)
14:54:49disrupteki guess if your time is free, sure.
14:55:29clyybberthe nice thing is that software doesn't have to get improved by you
14:55:48disruptekbelieve me, you don't want me improving your software.
14:55:50PMunchHmm, is there a package like getmac for Python in Nim?
14:56:09clyybberdisruptek: I dunno, nimph looks pretty awesome
14:56:24disruptekget outta my private repos!
14:56:49PMunchnimph?
14:57:14disruptekpackage manager i'm building.
14:57:19PMunchAh
14:57:53FromDiscord<kodkuce> its heppening https://my.pcloud.com/publink/show?code=XZ5qgQkZPJWaJplhfBFBCBGI5pRkaV9N2bP7 nim + Godot
14:58:37FromDiscord<kodkuce> just a test ofc , long way too magic
14:58:52Araqdisruptek, can nimph run .nimble files?
14:59:08disruptekit has seamless co-operation with nimble.
14:59:24Araqha
14:59:27disruptekdon't bother looking at the readme though.
15:00:04clyybberAraq: Why wont you "eat" void?
15:00:09Araqso does it run .nimble files or not?
15:00:21disrupteknope.
15:00:45disruptekit just runs `nimble dump` to interpret them because making .nimble code was a stupid idea.
15:01:10Araqit really wasn't.
15:01:53AraqI've seen enough "declarative" TOML and cmake files to want something more flexible
15:02:24disruptekseparation of concerns.
15:02:40federico3any tutorial on compiling to js?
15:02:42Araqbuzzwords.
15:02:46PMunchWhat, .nimble as code is brilliant :)
15:02:59disrupteki'm using toml. if you want to run nimscript as part of your build stuff, you can do that with nimble.
15:03:03PMunchfederico3, `nim js -o:myoutput.js myinput.nim`
15:03:48*PMunch quit (Quit: Leaving)
15:03:56Araqin fact, this whole idea of crippled, declarative code is a deadend. CSS is getting support for variables, SQL is now Turing complete and regexes became NP complete with backreferences.
15:04:23shashlicki ran into the same thing with nimgen which was an ini file
15:04:46federico3any flag to minify and clean up the output?
15:04:57disruptekif what you want is dynamic, then you can use a dynamic language to specify it.
15:05:27disrupteki refuse to run nimble except as needed for interop.
15:05:48Araqso run 'nim e' on the .nimble file, nimble does nothing else anyway
15:06:17Araqfederico3, not really except for all the existing JS tools that give you that.
15:06:28disrupteki might, but tell me again why i should use a full pl to store declarative data?
15:06:41disruptekwe're talking about manifests, lockfiles.
15:07:00disrupteki would rather use dhall.
15:07:18Araqwell lockfiles are different I guess but a .nimble file is not a lockfile
15:07:28disruptekno it is not.
15:07:33AraqI don't know what dhall is.
15:07:43FromGitter<iffy> disruptek: I like Python's syntax: ⏎ ⏎ ```@deco1 ⏎ @deco2 ⏎ proc something() = ⏎ echo "foo"``` [https://gitter.im/nim-lang/Nim?at=5dc9793eeeb63e1a839490e4]
15:08:03disruptekiffy: yes, but it must be parseable (not semantically valid, but parsed) by nim.
15:08:11disruptekAraq: https://dhall-lang.org/
15:08:37FromGitter<iffy> Well, that's what I meant when I asked if anyone had considered adding it to Nim (I meant adding the syntax to the parser so that it was valid)
15:09:01disruptekiffy: the syntax isn't a constraint; show us what you want it to look like.
15:09:34FromGitter<alehander92> oh God, new week!
15:09:39FromGitter<alehander92> i also like the decorator syntax
15:09:59disrupteki mean, i'm pretty sure you'd be satisfied with something parseable -- the question is, does it speak to the user?
15:10:10FromGitter<alehander92> i think one can kinda still do it with a macro
15:10:35FromGitter<iffy> Yes, you can definitely achieve the same effect with macros; it's the syntax of Python that's nice
15:10:36*adeohluwa joined #nim
15:10:38shashlick@Araq - nim e won't work on a .nimble file
15:11:28FromGitter<iffy> disruptek: I don't think I understand what you mean
15:12:03disruptekiffy: show use some uses in nim to get us excited about the feature.
15:12:18*tane_ quit (Quit: Leaving)
15:12:39FromGitter<alehander92> i think just using it instead of the pragma syntax is something that might look ok
15:12:45FromGitter<alehander92> but its subjective
15:13:01Araq"Dhall is programmable, but NOT Turing-complete." more like "we don't understand Turing completeness and confused it with sandboxing"
15:13:38FromGitter<iffy> oh; how I'd use it? Well, to make something like the Python click library: https://click.palletsprojects.com/en/7.x/ is one example
15:13:48clyybberalehander92, iffy: I like that @ is usable as an operator
15:14:13FromGitter<alehander92> but it would be still usable
15:14:14disruptekAraq: you're right; `nim e` is better. 🙄
15:14:45disruptekiffy: you really have to come up with a new example.
15:14:47FromGitter<alehander92> sorry clyybber you're right it would be less usable
15:14:56FromGitter<alehander92> but at least as infix
15:15:03FromGitter<alehander92> or @[] i imagine it would be still ok
15:15:09clyybbercat buildscript | sed 's/while/don'tusewhile/g'
15:15:10FromGitter<iffy> The problem that first made me consider it was, tagging procs to be associated with one kind of "build" or another so that when I ran "build A" it would run all the procs marked with @buildA; and likewise with buildB
15:15:18disruptekalehander: pragmas already support that.
15:15:21clyybbercat buildscript | sed 's/while/don'tusewhile/g' | nim e /dev/stdin
15:15:22FromGitter<alehander92> disruptek exactly
15:15:25clyybberThere you go
15:15:28clyybberNot turing complete
15:15:34FromGitter<alehander92> i think the usecase is "decorator-like syntax for pragmas"
15:15:49disruptekright.
15:15:53FromGitter<iffy> I'm not advocating using @ necessarily; I just like that Python's decorators live on a line by themselves above the func they mutate
15:15:55clyybber(and set the max_recusrions to very low)
15:16:15clyybberiffy: They are basically java annotation
15:16:17clyybbers
15:16:34clyybberI think java had them longer, not sure though
15:19:03Araqclyybber, Nim's VM has an instruction count limit anyway :P
15:19:27Araqcannot run more than 10 million loop iterations
15:19:53clyybberAh right :)
15:19:56disruptekor 40,000,000 if you're using my compiler, because it's the only way to build large apis. so, that makes sense.
15:26:48*narimiran quit (Read error: Connection reset by peer)
15:27:03disruptekAraq: https://github.com/dhall-lang/dhall-lang/wiki/Safety-guarantees
15:27:43disruptekdoesn't appear to be turing complete to me.
15:28:11*narimiran joined #nim
15:29:37FromGitter<alehander92> @iffy one option is to do something like ⏎ ⏎ ```@count(..): ⏎ func e(..)``` [https://gitter.im/nim-lang/Nim?at=5dc97e61bbdf5f17b420be55]
15:30:26FromGitter<alehander92> where count is a simple macro, but not sure if one can make `@` noop
15:31:05FromGitter<alehander92> this gets messy with many decorators
15:32:48FromGitter<alehander92> so you can have ⏎ ⏎ ```@(count(2), ⏎ other(4)): ⏎ func e ``` [https://gitter.im/nim-lang/Nim?at=5dc97f20bbdf5f17b420be5c]
15:33:01FromGitter<alehander92> which expands to a serie of count(2): other(4): func
15:33:03Araqdisruptek, and why does this matter for anything?
15:33:26Araqthey argue they have restricted access to the environment (good!)
15:33:27disruptekhey, i have to take my wins where i can get them.
15:33:56Araq:-)
15:34:37Araqthis year I learned Nim's biggest mistake
15:34:40disruptektoday i can't install a nimble package without running nimscript.
15:35:00Araqwant to know what it is?
15:35:14disruptekversion 1.0?
15:35:22disruptekopen-sourcing the compiler?
15:35:32Araqinsufficient problem analysis.
15:35:45disruptekdamn, i was way off.
15:35:54Araqand I figured I'm in good company, everybody else does it too
15:36:30shashlickplease illustrate
15:36:39Araqlike claiming "we are not TC" and then not going on how *precisely* this helps in analysing anything
15:37:01Araqinstead they quickly change the topic to sandboxing.
15:37:28disruptekpapers have been written, but instead you're ranting about a language you just discovered as if you'd read on the subject.
15:37:35disruptekinsufficient problem analysis.
15:37:58Araqwhich papers have been written about the language?
15:38:28disruptekdo i have to do your research for you?
15:38:40*nsf joined #nim
15:40:05Araqyup
15:40:26disrupteki think i'd rather accept your ignorance.
15:41:50AraqI read https://github.com/dhall-lang/dhall-lang/wiki/Safety-guarantees#turing-completeness fwiw
15:42:28Araqand it's as unconvincing as it always is. So yeah, great instead of an "arbitrary amount of time" it can only take 1000 years to evaluate
15:42:48disrupteklook, you brought up "turing complete".
15:42:56disrupteki'm just informing you of your error.
15:43:05disrupteki never claimed that TC was important to me.
15:43:34disrupteki'm claiming that i don't want to give unfettered access to nimscript to my source code retrieval system.
15:43:34Araqyeah because it triggers me, almost always when TC comes up it's because of a deep misunderstanding about it
15:43:45disrupteki'm sorry about that.
15:44:15FromGitter<kaushalmodi> I've a question about converting a string to a "symbol" or identifier
15:44:18FromGitter<kaushalmodi> this works: https://play.nim-lang.org/#ix=21t9
15:44:47FromGitter<kaushalmodi> but how do I have the `getProcPointer` accept a string arg that gets converted to the `adder` proc identifier?
15:45:16Araqdisruptek, it's ok, I'm annoyed by my own bugs
15:45:22FromGitter<deech> Araq, langs like ATS have things like termination metrics on recursive functions. No absolute guarantees but you have some assurance that it converges.
15:46:08Araqah and now I'm the bad ignorant guy.
15:47:17clyybberdeech: ATS is such a weird lang
15:47:19Araqyeah, sure, prove that stuff terminates, I don't mind. But don't sell it to me as a "security" feature, I prefer "you can cancel it after X minutes".
15:47:22FromGitter<deech> The problem is that currently lang. ergonomics drops steeply as you add what you call problem analysis.
15:47:41clyybberdeech: ATS3 has some nice syntax planned afaik
15:47:44disruptekjust add tc to the list of araq triggers, right after symlinks.
15:47:49clyybberWhich should help ergonomics
15:48:31FromGitter<deech> clyybber: I worked with ATS3, there's some cleanup like t@ype -> viewtype but it's still kind of a nightmare to use.
15:48:39clyybberOh :(
15:48:55clyybberI love the commit messages though: Updated very very minorly...
15:49:00clyybberOr something along that line
15:49:31clyybberdeech: I only discovered ATS because of your talk :)
15:49:33FromGitter<deech> But as Araq mentioned I think runtime analysis is completely ignored nowadays.
15:50:18*nif quit (Quit: ...)
15:50:28*nif joined #nim
15:52:19Araqgotta go, see you later
15:52:42FromGitter<kaushalmodi> Can someone help with https://gitter.im/nim-lang/Nim?at=5dc981cf6570b076740f7b5f ?
15:54:12FromGitter<Vindaar> @kaushalmodi one way: https://play.nim-lang.org/#ix=21tc
15:55:46shashlick@disruptek - i tagged irc by the way
15:56:23FromGitter<Vindaar> @kaushalmodi called via `getProcPointer(int, "adder")` then of course. Forgot to copy that line
15:56:39disruptekshashlick: huh?
15:56:50shashlickto 0.2.1 since it had your fixes
15:57:04shashlickcreated a tag so you don't need to install #head
15:58:04FromGitter<kaushalmodi> @Vindaar Yes, got that. thanks!
15:58:16FromGitter<kaushalmodi> This works
15:58:31disruptekshashlick: i don't get it... the bot is pointing at 0.2.1 and there's a tag for that. was there no 0.2.1 before?
15:58:43FromGitter<kaushalmodi> I'll tinker with how to get generics work with that
15:58:55FromGitter<kaushalmodi> may be create a generic proc wrapper around that?
15:59:17shashlickwell, when i `nimble install irc`, it didn't work since it pulled 0.2.0 which was tagged in July or something
15:59:25shashlickso your fixes weren't in it and it didn't work with devel
15:59:41shashlickwhen i pulled #head it worked, so i created a 0.2.1 tag
15:59:43disruptekoh, there's a 0.2.1 tag but it's not marked as a release on github.
15:59:54shashlicki just created that today
16:00:00FromGitter<kaushalmodi> @Vindaar Actually I cannot have that string arg as static
16:00:07disruptekweird. i've been pointing at 0.2.1 since the 3rd of november.
16:00:31shashlickso since you installed it locally and the nimble file says 0.2.1, you were okay
16:00:57disruptekaha
16:01:18disruptekthanks 😊
16:01:59shashlickokay back to working on my bot cause i have nothing else to do
16:02:24FromGitter<Vindaar> @kaushalmodi oh. I feared as much :P Do you have a finite list of procs?
16:02:52FromGitter<Vindaar> then you could always do: https://play.nim-lang.org/#ix=21td
16:03:13FromGitter<kaushalmodi> yes! That might work
16:03:18*tklohna quit (Ping timeout: 246 seconds)
16:03:41shashlick@disruptek - have you gotten it to work with ssl?
16:03:50FromGitter<kaushalmodi> @Vindaar: sorry, no :/
16:03:53disrupteksure.
16:03:59FromGitter<kaushalmodi> SV is passing the string to Nim at run time
16:04:11FromGitter<Vindaar> and where do the procs being called come from?
16:04:13disruptekat least, iirc it does.
16:04:31FromGitter<kaushalmodi> @Vindaar I am trying to optimize this: https://github.com/kaushalmodi/nim-systemverilog-dpic/blob/master/chandle/libdpi.nim
16:04:34shashlickso i just pass -d:ssl and it works or some hoops?
16:04:44disruptekjust pass -d:ssl.
16:04:56FromGitter<kaushalmodi> so that I do not need to hardcode "adder" in `getAdderProcHandle` and `callProc`
16:05:17FromGitter<iffy> Should the mingw64 from https://nim-lang.org/install_windows.html be able to compile 32bit executables? I'm having trouble, and will just switch to mingw32 if that's the recommended path. (I want to compile both 32 and 64 on the same machine)
16:06:42FromGitter<kaushalmodi> @Vindaar But your last example of that case statement should help optimize that code quite a bit
16:07:36shashlick@disruptek - no luck
16:08:06FromGitter<Vindaar> @kaushalmodi hmm. If you're worried about having to write too many of those lines one could always generate the case stmt from a macro. But I'm not quite following what it is you want / need to avoid
16:09:14*floppydh quit (Quit: WeeChat 2.6)
16:09:21FromGitter<kaushalmodi> @Vindaar May be I need a template too that auto-generates those .exportc. procs
16:09:27*narimiran_ joined #nim
16:09:37FromGitter<kaushalmodi> I am just brain storming on how I can generalize the code on Nim side
16:10:17*narimiran quit (Ping timeout: 268 seconds)
16:12:12*abm joined #nim
16:12:36FromGitter<Vindaar> plenty of ways, but I usually try not to generalize too early. Rather wait until a pattern emerges and then simplify that. The exceptions are the cases where I know exactly what I need
16:15:09FromGitter<kaushalmodi> @Vindaar Right.. this was born more out of curiosity if I can do that in Nim, and if so how
16:15:38FromGitter<kaushalmodi> I am thinking how I can make the SV/Nim API unchanged as more procs are added on the Nim side
16:16:37shashlicki don't think the nim irc package supports ssl
16:16:48shashlickeven with -d:ssl, it doesn't compile any ssl related files
16:17:00shashlickokay maybe not, it does
16:17:40disruptekhow do i repro? port/host?
16:17:51disrupteki'm using a bouncer iirc.
16:17:53FromGitter<Vindaar> @kaushalmodi then I suggest you add a few more procs and then think about it again, because by then you understand the constraints better. But I understand what you mean
16:18:01shashlicki am also connecting to znc in ssl mode
16:18:20FromGitter<kaushalmodi> @Vindaar yes, I am doing exactly that
16:19:58*disruptek waves at disbot.
16:20:10*disruptek whispers to disbot.
16:20:12*disbot quit (Remote host closed the connection)
16:20:19FromGitter<Vindaar> :)
16:22:22shashlickyep, -d:ssl does nothing really
16:22:32disruptekyou're right.
16:22:33shashlickif i connect to freenode on 6667, it works fine
16:23:18clyybber!eval echo"HELLO DISBOT. HOW ARE YOU?"
16:23:20NimBotHELLO DISBOT. HOW ARE YOU?
16:24:11disruptekodd; i've been building with ssl and i guess i just have it pointing at a non-ssl port.
16:24:29disruptekthe bouncer is local, so it doesn't matter.
16:27:38FromDiscord<krab4t> !eval rm -rf
16:27:40NimBotCompile failed: /usercode/in.nim(1, 1) Error: undeclared identifier: 'rm'
16:27:42FromDiscord<krab4t> hmm
16:28:22disruptekwhere did this bot come from? did i write it?
16:28:32disrupteki mean, the one you're using, shashlick.
16:28:47shashlickya, i just removed your freedesktop portions
16:28:58shashlickbut the nimble irc module doesn't wrap the socket or anything
16:29:02disrupteki wrote it from scratch?
16:29:06shashlickso it has no ssl support
16:29:42shashlickwho knows, you probably started from one of the tests
16:29:54disruptekhmm.
16:30:00*adeohluwa quit (Remote host closed the connection)
16:34:05shashlickhave to port from httpclient, bore
16:37:17clyybber!eval type E = enum a=1, b=high(int32)\ntype C = object case a: E\n of a: b: bool\n of b: i: int\nvar t=C(a: E.a);t.b=true;echo "did I crash?"
16:37:19NimBotCompile failed: /usercode/in.nim(1, 42) Error: identifier expected, but got '='
16:38:27clyybber!eval type E = enum a=1, b=high(int32)\ntype C = object\n case a: E\n of a: b: bool\n of b: i: int\nvar t=C(a: E.a);t.b=true;echo "did I crash?"
16:38:29NimBotCompile failed: /usercode/in.nim(1, 42) Error: identifier expected, but got '='
16:40:08*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
16:40:22*pbb joined #nim
16:42:59shashlickfew lines of code and i'm connected now
16:43:50*pbb quit (Remote host closed the connection)
16:44:54clyybber!eval type E=enum a,b=int32.high\ntype C=object\n case a:E\n of a:b:E\n of b:i:E\nvar t=C(a:a);t.b=a;echo"did I crash?"
16:44:56NimBotCompile failed: /usercode/in.nim(1, 35) Error: identifier expected, but got '='
16:45:02*pbb joined #nim
16:45:43clyybber!eval type E=enum a,b=int32.high\ntype C = object\n case a:E\n of a:b:E\n of b:i:E\nvar t=C(a:a);t.b=a;echo"did I crash?"
16:45:45NimBotCompile failed: /usercode/in.nim(1, 36) Error: identifier expected, but got '='
16:45:56clyybberI don't get it.
16:46:29clyybber!eval type E=enum a,b=int32.high\n type C=object\n case a:E\n of a:b:E\n of b:i:E\nvar t=C(a:a);t.b=a;echo"did I crash?"
16:46:31NimBotCompile failed: /usercode/in.nim(1, 36) Error: identifier expected, but got '='
16:46:39clyybberOk, sry, Im gonna stop now
16:56:31*tane joined #nim
16:57:06*jxy quit (Quit: leaving)
16:59:41*Trustable joined #nim
16:59:50FromGitter<kaushalmodi> Is there a way to mark a proc type to expect to have side effects?
17:00:01FromGitter<kaushalmodi> I ended up with an issue similar to this: https://stackoverflow.com/questions/53726458/nim-aliasing-procedures-with-side-effects
17:01:15FromGitter<kaushalmodi> In that stackoverflow example, I am looking for a way to pre-declare `procPtr` var to contain procs with side effects
17:03:13*Vladar joined #nim
17:14:45shashlick@disruptek - https://github.com/nim-lang/irc/pull/16
17:18:40*narimiran_ is now known as narimiran
17:19:00FromDiscord<treeform> Hey, so my library `ws` is on the list of "important nim libraries" so when I breaks some thing people get notified and open PR. ( https://github.com/treeform/ws/issues/10 ) How do I get notified of this first?
17:22:37narimiranby being faster than me at looking what failed this time in some nim commit/pr :P
17:23:09FromDiscord<kodkuce> oh so this better then niv ws
17:23:23narimiranother than that, you create your own CI where you test your changes before merging them into master
17:23:37FromDiscord<treeform> hmm
17:24:45FromDiscord<treeform> @kodkuce The niv ws had a bug in that it could not send packets over 16k... I started to fix it. And fix it. And fix it. Then decide to just write my own.
17:25:03FromDiscord<treeform> I already red the websocket spec a couple of times to fix the 16k issue.
17:25:10FromDiscord<treeform> might as well do my own take...
17:25:43FromDiscord<kodkuce> :), np will switch to your magic
17:25:49FromDiscord<treeform> Mine also supports SSL, keep alive and other features...
17:26:29FromDiscord<treeform> I love websockets and don't like REST.
17:26:31FromDiscord<kodkuce> today i first time connected godot client and nim ws and pushed postions bewin
17:26:43FromDiscord<treeform> So all my JS apps open a single websocket and do all request/response that way.
17:27:27FromDiscord<treeform> So I use them heavy at work so for me is a critical piece of infrastructure.
17:27:33FromDiscord<kodkuce> depedns on work i guess, Rest is good if you just doing some API for info
17:27:51FromDiscord<treeform> Yeah I love other peoples rest 🙂
17:28:04FromDiscord<kodkuce> xD
17:28:24FromDiscord<treeform> godot? for games I don't recommend websockets.
17:28:32FromDiscord<treeform> well I don't recommend TCP which websockets use.
17:28:39FromDiscord<treeform> UDP for games!
17:28:59FromDiscord<treeform> See here: https://github.com/treeform/netpipe
17:29:02FromDiscord<kodkuce> ye i just wanted ws for stupit games like poker and other card gaems
17:29:19FromDiscord<kodkuce> udp dosent work in browser as i know, tough there is that webRTC
17:29:41clyybberwhile you should better use UDP for games, minecraft uses TCP too and is "the" multiplayer game
17:29:58clyybberbut its also quite laggy at times..
17:30:35FromDiscord<kodkuce> tcp for realtime shooteg game and similar sux
17:30:47FromDiscord<treeform> Yeah all said and done, using UDP over TCP is probably a 0% - 20% improvement. Minecraft has other big performance problems.
17:30:48FromDiscord<kodkuce> but for slow games and turn based it should work np
17:31:17FromDiscord<treeform> yes you would get almost 0 improvement for turn based and slow games.
17:31:25*disruptek_ joined #nim
17:31:39FromDiscord<treeform> well with UDP you can have clients connect to each other.
17:31:42livcddoes anyone have some complex scraper in Nim ? I only saw mashingan's manga scraper
17:31:49FromDiscord<treeform> which might be big for pear to pear games.
17:31:52livcdsorry i really missed the answer
17:32:12FromDiscord<treeform> like HTML website scraper?
17:33:07FromDiscord<treeform> Man I have done so much scraping in my life.... I should write a blog about how I do scraping.
17:34:11FromDiscord<kodkuce> this netpipe , does it lose perf cuz ordering or it just has timestamp and if older recived just drop
17:34:38FromDiscord<treeform> no it will do the right thing
17:34:44FromDiscord<treeform> it would wait to give you the out of order packet
17:35:05FromDiscord<treeform> so if you set A B C packets, but you get C B A...
17:35:12FromDiscord<treeform> it would give you them in the A B C order always
17:35:13FromDiscord<kodkuce> hmm but if its older packet whoudet i just discard it
17:35:24rayman22201@clyybber and araq : I would like formally announce that I am an idiot.... There was never any leak in my dispose async implementation. I forgot to dispose the final result variable...
17:35:25FromDiscord<kodkuce> oh
17:35:27FromDiscord<treeform> that was a feature request
17:35:32FromDiscord<treeform> for my game I need all packets
17:35:47FromDiscord<treeform> as they are DIFFs of the previous state
17:35:53clyybberrayman22201: Wait...
17:36:13FromDiscord<kodkuce> for shooter game if you recive older position you just discard it from what i read cuz you dont need it anyway
17:36:26FromDiscord<treeform> yes that was 1 feature request
17:36:31rayman22201but, it appears that `=destroy` for strings and seqs is not working
17:36:34FromDiscord<treeform> have packets that can be discarded
17:36:55FromDiscord<treeform> but even for shooter games you want some packets to come in order like "change level", "game over", "chat" etc...
17:37:00clyybberrayman22201: How do you dispose the result variable now? Do you have a commit?
17:37:14rayman22201I will show you a gist. hold on
17:37:27clyybbercool, thanks
17:37:45FromDiscord<kodkuce> so when future request done it will support both
17:37:59FromDiscord<kodkuce> ?
17:38:14FromDiscord<treeform> @kodkuce another way where UDP wins for games is the with TCP you need to select and block or using async to work. With UDP you just read or don't read. It integrates with game loop much better.
17:38:59FromDiscord<treeform> @kodkuce yes adding safe to drop packets is easy to add. I have not done that yet.
17:39:40rayman22201http://ix.io/21tG
17:40:01clyybberdisbot: Where are you when I need you?
17:40:09rayman22201I couldn't see the forest through the trees here. I'm feeling pretty silly
17:40:19FromDiscord<treeform> @kodkuce the main way where NetPipe over TCP is in acks. TCP waits a while to ack the packets. But with NetPipe you can choose to set your ack timing way shorter. So there isn't as much delay for non ack'ed packets.
17:40:23rayman22201lol. copy paste is still an option :-P
17:40:56rayman22201https://play.nim-lang.org/#ix=21tG
17:41:02rayman22201let me help you with that :-P
17:41:12clyybberrayman22201: Haha, I was mostly joking, it wouldn't run anyways
17:41:25rayman22201true.
17:41:31clyybberbesides, one can add /nim to the ix.io link and it will syntax highlight it
17:41:52clyybberwaddabout =destroy not working for seqs/strings?
17:44:44rayman22201http://ix.io/21tK
17:45:11FromGitter<Willyboar> RIP disbot :(
17:45:32disruptekyeah, i'm messing with it. broke my bouncer.
17:45:49clyybberI can be your bouncer
17:46:32rayman22201@clyybber, it doesn't error, but it appears to be a noop
17:46:35FromGitter<Willyboar> Ohhh. Can we have disbot2?
17:46:48clyybberrayman22201: With --gc:what?
17:46:57clyybbermarkandsweep?
17:47:00rayman22201yup
17:47:25clyybberhmm, ping Araq pong
17:48:20*disbot joined #nim
17:48:46clyybberhttp://ix.io/invalid
17:48:47disbot^ play at https://play.nim-lang.org/#ix=inval 😏
17:49:12clyybberhttp://ix.io/dumb
17:49:12disbot^ play at https://play.nim-lang.org/#ix=dumb 😏
17:49:29disruptekwell, how should it know?
17:49:49*NimBot joined #nim
17:50:09clyybbernvrmnd
17:50:28rayman22201at least I feel vindicated. I thought I was losing my mind. I stared at the code waaayyyy tooo loooonggg before I figured out the issue.
17:51:14rayman22201thanks for your help @clyybber
17:51:28clyybberwhen eyes don't do their work, I have found hitting them to be a good way to get them back on track
17:51:43clyybberrayman22201: np :)
17:51:48rayman22201stabbing them with tiny knives or staring directly into the sun :-P
17:51:56clyybberstabbing them with carrots
17:55:49disruptekshashlick: now i can't even get nim irc to talk to my bouncer.
17:58:08FromGitter<deech> So currently when a proc like `proc p(f : Foo) = echo type(f)` will type information if passed a subtype of `Foo`, eg, `Bar` and will always print `Foo`. But type information is not lost if passed as a generic parameter `proc p[T](f:T) = echo type(f)`. To fix this I've been toying around with possibly having the compiler rewrite the first to something like `proc p[T subtype Foo](f:T) = echo type(f)` ( I guess this could
17:58:08FromGitter... be a generated concept?). Anyone have any thoughts?
17:59:39FromGitter<deech> But I guess this would break overload resolution. :(
18:00:04*disbot quit (Remote host closed the connection)
18:01:15*disbot joined #nim
18:02:01clyybberdeech: Hmm, it kinda makes sense the way its working now
18:02:15disrupteki don't get it. how is this different from 1) generics, or 2) methods?
18:02:49clyybberdisruptek: deech is talking about ct dispatch here
18:02:54clyybberso no methods
18:03:17FromGitter<deech> clyybber, I can see why both make sense.
18:04:06disruptekwhy not fix having to cast a type like bif.Foo when passing it to p()?
18:04:08clyybberdeech: What happens when you write `proc p[T: Foo](f: T)` ?
18:04:43clyybberdisruptek: Huh, is this needed rn?
18:06:02FromGitter<deech> clyybber, it does print `Bar` in this case ... nice.
18:06:41clyybberdisruptek: Seems to work: https://play.nim-lang.org/#ix=21tX
18:07:03clyybberdeech: Thats what I feared it would :)
18:08:36disruptekhmm, it was something with having to procCall a cast in order to invoke a super ... can't find where i actually ran into it.
18:08:40FromGitter<deech> Unfortunately it shadows any other proc, eg. `proc p(f: Foo) = ....`
18:08:48clyybberdisruptek: Maybe involving var?
18:09:09clyybberBecause you have to do it with var afaik
18:09:42clyybberI fixed it in my =move PR I think
18:09:49clyybbershould cherrypick that maybe
18:10:21disrupteki guess i eliminated that code.
18:10:27clyybberdeech: Hmm. It shouldn't shadow it
18:10:34clyybberAt least not for p(Foo())
18:11:48FromGitter<deech> https://play.nim-lang.org/#ix=21u3
18:12:38clyybberdeech: Yeah that makes sense
18:13:06clyybberdeech: https://nim-lang.github.io/Nim/manual.html#overloading-resolution
18:13:14clyybberSubtypes are matched after generics
18:14:19FromGitter<zacharycarter> PMunch: question about binaryparse if you have a moment... do I need to worry about endianness or does the library take care of that for me?
18:34:28*uu91 quit (Ping timeout: 245 seconds)
18:35:21*uu91 joined #nim
18:43:40*sagax quit (Read error: Connection reset by peer)
18:46:34*ldlework_ is now known as ldlework
18:51:23FromDiscord<Avatarfighter> has anyone here used https://ultralig.ht/ by chance? I'm wondering if its worth making bindings for it or not but I've never used it so idk if its considered "good"
18:54:06FromDiscord<Generic> I am a bit confused, about the current state of refs with the new runtime
18:54:31FromDiscord<Generic> owned refs are postponed
18:54:44FromDiscord<Generic> but what are they currently, if I enable the new runtime
18:54:52yumaikaso/
18:55:37FromDiscord<Generic> I'm at the beginning of a new project, where being gc less would be great
18:56:11FromDiscord<Generic> and I wonder if switching to the new runtime is a good idea
18:56:26FromDiscord<Generic> and if I should already adopt owned refs or not
18:56:56FromDiscord<Generic> it's just a hobbiest project, so 100% stability isn't a concern
18:58:43FromDiscord<kodkuce> i think newruntime stable is postponed to nim version 2, atm there is work on some shared memory threding , but its possible i am 200% wrong wo better w8 for some pro answer
18:59:17clyybberGeneric: Owned refs are enabled with --newruntime
18:59:28clyybberAnd they are already implemented
18:59:41FromDiscord<Generic> ok, good
19:00:01FromDiscord<Generic> https://github.com/nim-lang/RFCs/issues/177
19:00:28FromDiscord<Generic> "The reason for this is that owned is quite a breaking change and we're better served with stability now that version 1 is out and with us for the years to come."
19:00:38FromDiscord<Generic> that made me think they're shelved for now
19:00:51FromDiscord<Generic> but ok, I'll use them
19:00:53*sagax joined #nim
19:00:54FromDiscord<Generic> thanks
19:00:58clyybbernp :)
19:03:47*solitudesf- joined #nim
19:06:00*tklohna joined #nim
19:06:02*solitudesf quit (Ping timeout: 268 seconds)
19:06:51shashlick@disruptek - did i break irc?
19:08:37disruptekdisbot: did he?
19:08:38disbotyep. 😊
19:08:43disruptekchrist.
19:09:06FromGitter<Willyboar> dispot: do you like Nim?
19:09:15disruptekactually, i think i screwed my bouncer up.
19:09:38*lritter joined #nim
19:09:39disruptekdisbot: ignore Willyboar
19:09:40disboton it. 👍
19:09:54FromGitter<Willyboar> :(
19:10:14*a_b_m joined #nim
19:14:13FromDiscord<treeform> tried for like 10 minutes to update a packdage in nimble. I can't figure it out. I think its still an open problem? https://github.com/nim-lang/nimble/issues/169
19:14:17clyybberdespot: Hi
19:14:41*abm quit (Ping timeout: 276 seconds)
19:15:40FromDiscord<Lantos> hmmm I've installed llvm-9 and clan-9 but can't --cc:llvm_gcc
19:15:40FromDiscord<Lantos> E: Unable to locate package "llvm-gxx"
19:17:26disrupteknim devel broke terminaltables.
19:18:06shashlick@disruptek - what do I need to change in the PR
19:18:17disruptekshashlick: nothing, it's not you.
19:18:53disruptekwait, what pr?
19:21:52Araqrayman22201: does that mean 'owned' works with async?
19:22:56shashlick@disruptek - i sent you a PR which added SSL support to irc
19:25:18disrupteknice, but that was against Nim/irc (which is ideal).
19:25:43shashlickya, what are you using then?
19:26:14disruptekan older znc running on a netapp.
19:29:10shashlickokay, not sure i understand - i added ssl support so that i could connect to my znc which only works in ssl mode
19:29:16shashlickbut i was able to connect to freenode as well with ssl
19:29:25disruptekdoes it work against znc+ssl?
19:29:37shashlickya
19:30:11disrupteksweet.
19:32:08rayman22201@araq 'dispose' works with async. If you can make that a dual of 'owned' then yes :-P
19:32:31Araqsure, it's not hard
19:32:33rayman22201but what about my `=destroy` bug?
19:32:51Araqyou lose the ownership and then you add it back somehow...
19:33:00Araqwhat =destroy bug?
19:33:06Araqprobably already reported
19:33:26rayman22201http://ix.io/21tK
19:33:27disbot^ play at https://play.nim-lang.org/#ix=21tK 😏
19:35:32rayman22201is that already reported? does it look familiar?
19:42:11Araqyou don't have =destroy with --gc:markAndSweep
19:43:13rayman22201then how do I free a string or seq?
19:43:38rayman22201this is what I asked you last week. I asked, "how do you dispose a string?" and you said use "destroy"
19:44:33AraqI'm sorry, 'dispose' does it for you
19:45:02Araqexcept that I probably didn't create a dispose proc that takes strings/seqs
19:46:14rayman22201ah hah! That explains it :-)
19:47:22rayman22201cool. can I have such a proc? please :-D
19:48:06Araqadd it
19:48:25Araqyou know how to add it, use the other 'dispose' procs as an example
19:49:54Araqbtw according to GordonBGood our ARC implementation is on par with Boehm...
19:50:02rayman22201I will try
19:50:12rayman22201hrmm. Well that's a good result
19:51:30Araqyep. 'owned' is still slightly more elegant
19:52:06Araqbut not by much if you look at 'let x = unown(root)' stuff
20:01:22*solitudesf-- joined #nim
20:04:04*solitudesf- quit (Ping timeout: 245 seconds)
20:05:23Araqhhhmmmm
20:05:28*Trustable quit (Remote host closed the connection)
20:06:46rayman22201dispose sets the value to nil, but you can't do that for a string/seq. What should I do instead?
20:07:00rayman22201what represents a "nil" string?
20:07:05clyybber""
20:07:15rayman22201fair enough
20:07:25clyybberbut it is ambiguous
20:07:30rayman22201what about a seq?
20:07:59clyybber@[], but I think it won't work
20:08:51*nsf quit (Quit: WeeChat 2.6)
20:11:18rayman22201wow. actually it seems to work lol
20:11:59rayman22201hmmmm indeed araq :-P
20:13:10clyybberrayman22201: Oh, really? Nice
20:13:29rayman22201I'm surprised too, but I'm not complaining :-D
20:13:48rayman22201Now to try this with some more complicated async tests
20:14:04clyybberbetter check the generated C code that it really is nil
20:14:18clyybberand not a ref to an empty seq :)
20:14:27*GordonBGood joined #nim
20:14:56rayman22201hrmmm. good point.
20:16:11rayman22201I'm thinking about what this dispose async research means in the context of ARC
20:16:49rayman22201It results in more deterministic memory usage for async, which I think is still valuable.
20:18:43FromDiscord<Generic> now with --newruntime I'm getting this error:
20:18:46FromDiscord<Generic> C:\Nim\lib\core\seqs.nim(144, 3) Error: VM is only allowed to 'cast' between integers and/or floats of same size
20:19:25*GordonBGood quit (Ping timeout: 268 seconds)
20:20:11FromDiscord<Generic> this is the relevant piece of code: cast[ptr NimSeqV2[T]](addr x).len = newLen
20:20:13FromDiscord<Generic> is this my fault?
20:20:43*FromGitter quit (Remote host closed the connection)
20:20:54*PrimHelios joined #nim
20:21:01*FromGitter joined #nim
20:21:11clyybberGeneric: What are you trying to do??
20:21:16PrimHeliosIs there a way to specify the `styleCheck` option for nimble?
20:21:33rayman22201@clyybber looking at C code verifies that the the value is set to Nil :-)
20:21:34clyybberGenerics: You shouldn't need to cast to NimSeqV2
20:21:41clyybberrayman22201: Nice :D
20:21:47FromDiscord<Generic> that's not my code
20:22:02FromDiscord<Generic> it's compiler code which is failing
20:22:11krux02I am looking for "compile time define pragma", but I am drunk and I can't find it.
20:22:24disruptekstrdefine ?
20:22:37PrimHeliosah, config.nims
20:23:28krux02what i am talking about is passing the value of constants as a compiler argument.
20:23:51krux02I am on vacation and I can't stop working anyway.
20:23:54FromGitter<deech> The Windows binary install archive contains a lot of DLLs in it's `bin` directory. Are any of these dependencies of `nim.exe` or `nimble.exe`?
20:24:12disruptek--define:someconst="hello" now works.
20:24:40*PrimHelios quit (Client Quit)
20:24:47FromDiscord<Generic> deech: I think nimble relies on atleast some of them
20:26:15FromDiscord<Avatarfighter> Has anyone here used nimterop by chance and would be willing to help a lost soul like me? I'm having trouble figuring out wtf I'm supposed to do when wrapping a c lib, I usually wrap it manually but this lib is a bit more complex than what I'm used to lol
20:26:22krux02disruptek: I am looking for the documentation of that behavior because I would like to reference it in my PR
20:26:44disruptekkrux02: i don't believe it exists. i just added it last week.
20:27:00disruptekkrux02: or, it exists somewhere, but it wasn't implemented. 🙁
20:27:08krux02what?
20:27:16krux02do I have false memories?
20:27:31disruptekexactly. it makes no sense.
20:27:48krux02when I call nim --fullhelp
20:28:12krux02it says in --define:SYMBOL(:VAL) see: "compile time define pragmas"
20:28:16krux02but I can't find that part
20:28:30disruptekyeah, and it won't work in 1.0.2. go figure.
20:29:59rayman22201and now I found a bug in the async macro that results in a string leak :-/
20:30:28krux02I do remember that there was a feature in Nim that made this explicitly working
20:31:07disruptekyeah, using config.nims and switch() was the work-around.
20:31:29disruptekbut it probably did work once and then was broken by some other update and no one noticed.
20:32:31krux02well, yea, I finish my Pr without a link to a usable documentation about that: https://github.com/nim-lang/Nim/pull/12643
20:32:37krux02thanks for your help
20:34:22disruptekcool. hey, --fullhelp ain't nothin', at least.
20:34:40AraqGeneric: known bug, I have a fix for this that I need to push...
20:34:57shashlick@Avatarfighter - what are you trying with nimterop
20:36:22clyybberrayman22201: Finally /s
20:36:35Araqdeech: SSL and regexes need the DLLs, the compiler uses neither, not sure about Nimble
20:38:22FromDiscord<Avatarfighter> shashlick: I'm trying to make a wrapper for https://ultralig.ht/ currently but the headers are a bit too complex for me to do it manually
20:38:57FromGitter<alehander92> krux02 dont make our mistake, use your vacation
20:41:26FromDiscord<Avatarfighter> shashlick: to be honest I don't really know where to start to use nimterop to wrap a library, I looked at the template but im even more lost
20:43:28shashlickwell http://ultralig.ht looks like C++ so might be challenging regardless
20:43:41shashlickwin or lin
20:44:42FromDiscord<Avatarfighter> Well currently I'm on mac but I'm targeting for win support mostly
20:45:06shashlickyou can try running c2nim on some of the headers and see how it fares
20:45:26FromDiscord<Avatarfighter> I'll try that 😄
20:45:58shashlickbut it has some complex stuff so i won't be too confident 😞
20:46:08FromDiscord<Avatarfighter> yeah 😦
20:46:13shashlickideally you pick which specific things you need and just wrap those declarations
20:46:30FromDiscord<Avatarfighter> I would definitely do that except i'm trying to use the whole library haha
20:47:46FromDiscord<Avatarfighter> Whatever, I'll try c2nim and I'll try to fix the files it generates if I can't I guess I'll be back here 😄
20:51:16*madprops joined #nim
20:51:32madpropshi. is there some sort of guided book, apart from the manual?
20:53:11madpropsoh there are some tutorials
20:57:08solitudesf--https://nim-lang.org/learn.html
20:57:26*solitudesf-- quit (Quit: Leaving)
20:57:49*solitudesf joined #nim
21:05:02*nif quit (Quit: ...)
21:05:12*nif joined #nim
21:05:40*narimiran quit (Ping timeout: 268 seconds)
21:09:08FromDiscord<Generic> I managed to isolate it
21:09:09FromDiscord<Generic> https://play.nim-lang.org/#ix=21uU
21:09:19FromDiscord<Generic> this doesn't work with --newruntime
21:10:46FromDiscord<Generic> seems like it, doesn't even need to be that complex
21:10:57madpropsis there a design reason for `echo "Hi, ", name` vs `echo "Hi, ${name}"` or similar?
21:11:07FromDiscord<Generic> this is enough https://play.nim-lang.org/#ix=21uV
21:12:18FromDiscord<Generic> madprops: nim only recently gained a inline string formatter (strformat) in the std library
21:12:47FromDiscord<Generic> *string interpolation
21:13:13FromDiscord<Generic> the former is just easier to implement, I think
21:14:17FromGitter<Vindaar> "recently" being: Sun Dec 17 13:58:40 2017 +0100
21:14:52FromDiscord<Generic> well compared to echo
21:15:01madpropshmm weird. im using a compiler from 2018. and i can't import strformat
21:15:18madpropsbtw is this a trusted source? https://launchpad.net/~jonathonf/+archive/ubuntu/nimlang
21:16:10FromGitter<Vindaar> @Generic: well, ok :P
21:16:32FromGitter<kaushalmodi> madprops: few ways to do the same thing: https://play.nim-lang.org/#ix=21uX
21:16:45*krux02 quit (Remote host closed the connection)
21:17:43FromGitter<kaushalmodi> madprops: https://nim-lang.org/install_unix.html
21:22:13madpropsam i supposed to download strutils and strformat?
21:23:00madpropsbecause right now the compiler is not finding them
21:23:59FromDiscord<Generic> they should come shipped with your compiler
21:24:16FromDiscord<Generic> if they're missing, you're nim installation incomplete
21:24:38madpropsi just installed it with ubuntu snaps
21:24:57FromGitter<kaushalmodi> madprops: I have no idea about ubuntu snaps
21:25:17madpropsthe version in the package manager is too old
21:25:26FromGitter<kaushalmodi> > To install the latest stable release of Nim using choosenim, just run the following in your terminal, then follow the onscreen instructions: ⏎ > curl https://nim-lang.org/choosenim/init.sh -sSf | sh
21:25:58FromGitter<kaushalmodi> or just download/extract this: https://nim-lang.org/download/nim-1.0.2-linux_x64.tar.xz
21:26:15FromGitter<kaushalmodi> it contains statically built nim binary + other binaries + libs for Nim 1.0.2
21:31:43madpropsworks now. thank you
21:50:07*cwaydt joined #nim
21:51:27madpropswhat's the reason that the discard keyword is needed? is there a problem in not using returned values?
21:52:02disruptekit's so that you don't accidentally ignore a return value.
21:52:27disruptekyou can disable this behavior, but most come to value it.
21:55:38*tane quit (Quit: Leaving)
21:56:20zedeusis there a way to disable it besides .discardable? for the redis client you very often don't care about the return values, and having "discard await" in many places gets ugly quickly
21:57:37disruptekunlikely.
21:57:46disruptekjust write a template.
21:59:12zedeusdoesn't work, you can't use await from templates
21:59:23zedeusthere is a pr to rewrite await as a template though
21:59:53disruptekoh right.
22:00:14zedeusbefore you mention it, doesn't work as a macro either
22:00:27disrupteklol
22:00:37disruptekyou're really making this difficult, huh?
22:01:18zedeusnot by choice
22:02:01disruptekif you can make the case for not needing the return values, maybe you can get a PR against the client accepted.
22:03:35zedeusthey are needed in some cases, but not always
22:05:31madpropsis this a complete example? http://i.imgur.com/KdElZmg.png
22:06:04shashlick@zedeus - don't you need asyncCheck isntead of discard await
22:06:05disruptekthe first proc is unimplemented.
22:06:27zedeusshashlick: no they do very different things
22:06:38zedeusdiscard await still awaits the future, asyncCheck doesn't
22:06:49disruptekasyncCheck is for when you prefer your futures to crash.
22:07:12*Vladar quit (Quit: Leaving)
22:08:51FromGitter<Vindaar> @madprop: aside from the "..." in the first line, sure: https://play.nim-lang.org/#ix=21vg
22:09:03shashlick- This should be used instead of discard to discard void futures, or use waitFor
22:10:28madpropsim confused about how assigning to result seems to be the same as retrun
22:10:31madpropsreturn
22:10:46madpropswhy not just return "true" ?
22:10:48disruptekit's kinda like setting what the return value will be whenever the proc returns.
22:11:04madpropsok now that i think about it it makes some sense
22:11:13disruptekit's pretty handy.
22:11:25Araq"return" is (unstructured) control flow
22:11:27madpropslike, i can do some checks near the end of the proc with the current result
22:11:49Araqpost conditions? yep
22:12:37shashlickAraq - sometimes you need a variable that needs a few lines of code to set and then it doesn't change
22:12:42shashlickis it possible to demote a var to a let
22:14:02FromGitter<alehander92> you're just in time for the shadowing discussion
22:17:55zedeusshashlick: it's about "discard <future>" not "discard await <future>", discarding futures vs their return values
22:18:29FromGitter<alehander92> about the pr
22:18:35disrupteki've never had a use for asyncCheck.
22:18:42FromGitter<alehander92> its just a port of the chronos await as template PR
22:19:01FromGitter<alehander92> sorry i have to fix it eventually
22:19:10FromGitter<alehander92> there was an issue with the port
22:19:12shashlickok
22:19:19FromGitter<alehander92> asyncCheck is useful
22:19:30FromGitter<alehander92> often you want to just start some future
22:19:38FromGitter<alehander92> and do something with a callback
22:20:02FromGitter<alehander92> maybe i just cant think of a better pattern
22:20:34disruptekyes, but i wouldn't use it there, either.
22:25:18*solitudesf quit (Ping timeout: 245 seconds)
22:26:12FromGitter<alehander92> but what do you do if you dont want to await
22:26:38disruptekstore the future in a variable and move on with my life.
22:27:33disruptekasync exceptions are such a dumpsterfire that in my opinion there's no scenario in which an async exception makes sense.
22:28:27disruptekjust ask zedeus.
22:28:37disruptekhttps://github.com/nim-lang/Nim/issues/12526
22:29:44zedeuswell to be fair, catching this exception would not actually fix the problem
22:30:18disruptekmaybe not, but the point remains.
22:31:05disruptekto restate, the exception shouldn't be /thrown/; it's not an issue of catching it.
22:32:06disruptekdisbot: you there, buddy?
22:32:07disbotyep. 😊
22:32:17disruptekwhy no issue display, then?
22:32:23*disruptek pokes disbot.
22:32:56disruptekdisbot: tell shashlick his ssl broke my github api.
22:32:57disboton it. 👍
22:38:37*bobbert2 joined #nim
22:39:17*bobbert2 quit (Remote host closed the connection)
22:40:37*disbot quit (Remote host closed the connection)
22:41:05*disbot joined #nim
23:05:00*krux02 joined #nim
23:05:04*jjido joined #nim
23:05:19shashlick?
23:06:20disruptekjust messing with ya.
23:07:08*ng0 quit (Ping timeout: 260 seconds)
23:09:38shashlickbad disbot
23:10:10shashlickthis irc bot is working well - already PMs go to slack
23:10:15shashlicknow working on sending replies from slack
23:10:27disruptekawesome.
23:11:37*ng0 joined #nim
23:11:46FromGitter<Willyboar> how disbot doing with nimbot?
23:12:22disruptekdisbot pissed in nimbot's sandbox, am i right, disbot?
23:12:34disruptekdisbot: hello?
23:12:35disbotyep. 😊
23:12:46disruptekdamn he's worse than my dog.
23:13:16FromGitter<Willyboar> disbot: who is your boss?
23:13:29disrupteki tol' him to ignore you.
23:13:55FromGitter<Willyboar> i know but i have to give it a try
23:16:03FromGitter<alehander92> do we have a slack
23:16:18shashlickno, i use slack as my irc frontend
23:24:18clyybberdisbot: tell everyone a good night from me
23:24:43*clyybber *disappointment*
23:25:05disruptekgn8 clyybber
23:25:06FromGitter<alehander92> interesting
23:25:25FromGitter<alehander92> disbot help
23:25:25*clyybber quit (Quit: WeeChat 2.6)
23:25:33FromGitter<alehander92> disbot: tell a b
23:26:07FromGitter<alehander92> nimbot disbot
23:26:18FromGitter<alehander92> !eval i dont know
23:26:21NimBotCompile failed: /usercode/in.nim(1, 1) Error: undeclared identifier: 'i'
23:26:43FromGitter<Willyboar> !eval echo "Disbot this is my channel"
23:26:46NimBotDisbot this is my channel
23:26:57FromGitter<alehander92> !eval "я"
23:26:59NimBotCompile failed: /usercode/in.nim(1, 1) Error: expression '"я"' is of type 'string' and has to be discarded
23:27:05FromGitter<alehander92> sorry
23:27:11disruptekhmm.
23:28:00disbot!eval echo "bots running code run by bots"
23:28:03NimBotbots running code run by bots
23:28:21FromGitter<alehander92> disruptek run 2 + 2
23:28:50disbot!eval echo "!echo \"bots running code run by bots\""
23:28:52NimBot!echo "bots running code run by bots"
23:29:03disrupteklol
23:29:05*seni joined #nim
23:29:14disbot!eval echo "!eval \"bots running code run by bots\""
23:29:16NimBot!eval "bots running code run by bots"
23:29:22FromGitter<alehander92> you should make nimbot
23:29:27*tklohna quit (Remote host closed the connection)
23:29:32FromGitter<alehander92> call a !run by disbot
23:29:36FromGitter<alehander92> which calls a !eval
23:29:40FromGitter<alehander92> so they get in a loop
23:29:42FromGitter<Willyboar> !eval echo "!eval echo ''"
23:29:43disrupteki'm listening to Quantic's Infinite Regression right now.
23:29:44*tklohna joined #nim
23:29:45NimBot!eval echo ''
23:29:51FromGitter<alehander92> wow yeah
23:30:09FromGitter<alehander92> !eval echo ""
23:30:11NimBot<no output>
23:30:29FromGitter<alehander92> it needs to be a quine
23:31:12FromGitter<alehander92> we can make #nim-bots
23:31:15FromGitter<alehander92> and leave them there
23:31:20FromGitter<alehander92> anyway , no loops
23:31:23FromGitter<alehander92> good night
23:31:27FromGitter<alehander92> people
23:31:34disruptekpeace
23:34:52*mipri left #nim (#nim)
23:35:42shashlickit works!
23:36:05disruptekwoohoo
23:39:33FromGitter<Willyboar> what works?
23:41:28shashlickmy irc <=> slack bot for handling private messages
23:50:58FromGitter<Willyboar> I thought you are talking about the nimble thing