<< 06-08-2020 >>

00:06:46*maier joined #nim
00:07:28FromDiscord<Varriount> shashlick: The only features that I think Nimterop could benefit from would be the ability to force-include headers
00:07:47FromDiscord<Varriount> (feature from my wrapper)
00:08:42FromDiscord<Varriount> Yes, you could use passc, but I'm not sure if Nimterop would be able to separate the specified header from the main file after preprocessing.
00:11:10*maier quit (Ping timeout: 246 seconds)
00:12:45*sekao quit (Remote host closed the connection)
00:15:50*endragor joined #nim
00:18:17shashlickYou already have cExclude
00:18:59shashlickAlso you can specify multiple headers to cimport or on the command line if that's relevant
00:40:20Yardanicobtw, seems like AFL is quite outdated now
00:40:31Yardanicothere's a new fork of it with good support for persistent mode for much faster fuzzing
00:40:33YardanicoAFL++
00:43:19Yardanicohttps://aflplus.plus/
00:44:23disruptekdat domain.
00:53:14*Tlanger quit (Ping timeout: 265 seconds)
01:01:08FromDiscord<creatable> i'm trying to port this function to a nim proc but am having issues:↵```py↵def xor(string: str, key: int) -> str:↵ return ("").join(chr(ord(char) ^ key) for char in string)```
01:01:21FromDiscord<creatable> i do not at all have any idea how i'd even start
01:05:20FromDiscord<Elegant Beef> What does it do, xor between each char and return the string?
01:05:43FromDiscord<creatable> yes
01:07:25*apahl quit (Ping timeout: 244 seconds)
01:07:56FromDiscord<Elegant Beef> I think this works? https://play.nim-lang.org/#ix=2tlx
01:08:34FromDiscord<Elegant Beef> I passed it in as a char, but i suppose could be a byte or uint8
01:09:41*apahl joined #nim
01:14:05*Kaivo quit (Quit: WeeChat 2.9)
01:19:16*endragor quit (Ping timeout: 256 seconds)
01:34:53FromDiscord<creatable> i'm getting↵`unknown named parameter: safe`↵when trying to decode some base64 with urlsafe on↵`decode(saveData, safe = true)`
01:35:06FromDiscord<creatable> (edit) 'i'm getting↵`unknown named parameter: safe`↵when trying to decode some base64 with urlsafe on↵`decode(saveData, safe = true)`' => 'sent a code paste, see https://play.nim-lang.org/#ix=2tlA'
01:35:18FromDiscord<creatable> (edit) 'https://play.nim-lang.org/#ix=2tlA' => 'https://play.nim-lang.org/#ix=2tlB'
01:35:26FromDiscord<creatable> not sure why safe wouldn't be the parameter considering it's in the docs
01:35:50FromDiscord<creatable> update: i'm dumb, that's for encoding
01:36:05FromDiscord<Elegant Beef> Was going to say :d
01:45:48FromDiscord<creatable> ugh, ```nim↵ Invalid base64 format character ```
01:45:57FromDiscord<creatable> (edit) '```nim↵' => '```Error: unhandled exception:' | '```' => '`=` (ord 61) at location 1505695. [ValueError]```'
01:46:09FromDiscord<creatable> while python seems to handle it pretty well :^)
01:54:42*Tlongir joined #nim
02:07:06*maier joined #nim
02:11:45*maier quit (Ping timeout: 240 seconds)
02:19:30FromDiscord<creatable> how would i strip newlines?
02:19:52FromDiscord<creatable> \r is present in my save file string and i want to strip it out
02:28:49Prestigestrutils.replace maybe? @creatable
02:28:54*krux02_ quit (Remote host closed the connection)
02:30:17FromDiscord<creatable> ended up fixing it, normal .strip worked for my case
02:37:20ForumUpdaterBotNew thread by Skaruts: How to compile a dll that I can call from lua or luaJIT's ffi?, see https://forum.nim-lang.org/t/6642
02:55:37*muffindrake quit (Ping timeout: 260 seconds)
02:57:41*muffindrake joined #nim
03:00:32*vicfred joined #nim
03:06:36*waleee-cl quit (Quit: Connection closed for inactivity)
03:07:11*endragor joined #nim
03:11:09*endragor quit (Remote host closed the connection)
03:11:36*endragor joined #nim
03:19:30*endragor quit (Ping timeout: 260 seconds)
03:33:48FromDiscord<treeform> @Yardanico I am back at trying to debug this --arc issue. So the problem is that "cannot convert argument 1 from 'NI' to 'HANDLE'" was fixed as --gc:arc problem was introduced. There are many unworking commits, its not a single "break".
03:40:15*endragor joined #nim
03:45:20FromDiscord<treeform> So my thing compiles after #bb1adf6a706190883fa57a0208ba8e3118235256 but crashes to due arc issue. I think arc was always an issue?
03:45:57FromDiscord<treeform> I don't think its change in the nim's github caused this. But some thing on my machine. Now it crashes every time.
03:53:19FromDiscord<treeform> pff, I found a simple repro case even with GCC. I should have done that.
03:53:25FromDiscord<treeform> Why do I keep doing things the hard way!
04:01:17FromDiscord<treeform> @Yardanico here is my --gc:arc issue: https://github.com/nim-lang/Nim/issues/15162 "Initializing an empty threadvar by adding elements to it segfaults when compiled using C++ mode."
04:01:19disbotGC:Arc and {.threadsvar.} don't work in c++ mode. ; snippet at 12https://play.nim-lang.org/#ix=2tnH
04:02:43*opal quit (Ping timeout: 240 seconds)
04:06:01*supakeen quit (Quit: WeeChat 2.8)
04:06:38*supakeen joined #nim
04:08:26*maier joined #nim
04:08:59*opal joined #nim
04:12:45*maier quit (Ping timeout: 240 seconds)
04:23:01*narimiran joined #nim
04:42:06FromDiscord<Varriount> Yardanico: What do you mean by persistent mode?
04:55:23*opal quit (Ping timeout: 240 seconds)
05:13:54*Guest10225 is now known as dadada
05:24:24*lritter joined #nim
05:34:15*maier joined #nim
05:40:04*opal joined #nim
05:48:35*rockcavera is now known as Guest16830
05:48:35*tiorock joined #nim
05:48:36*Guest16830 quit (Killed (tolkien.freenode.net (Nickname regained by services)))
05:48:36*tiorock is now known as rockcavera
05:56:51*solitudesf joined #nim
06:06:42FromDiscord<Varriount> @Yardanico How is CPS coming along?
06:17:08*PMunch joined #nim
07:01:37Oddmongerhello nimmers
07:05:01Prestigehello Oddmonger
07:11:50FromDiscord<Elegant Beef> Im an nimdiot thank you very much
07:16:25*moerm joined #nim
07:16:38moermHello everybody ;)
07:17:26PMunchHello :)
07:20:21*NimBot joined #nim
07:27:29superbiaGuten Morgen
07:30:42ForumUpdaterBotNew thread by Aviator: What ever happened to vtrefs?, see https://forum.nim-lang.org/t/6643
07:40:34FromDiscord<Varriount> Ah, vtrefs. It would have been wonderful to have those
07:41:57FromDiscord<Varriount> I feel that an idiom like Go's interfaces suits Nim far better than methods (especially since Nim doesn't have multiple inheritance)
08:04:27PMunchHi superbia, how are you finding Nim so far?
08:04:54moerm(Great, of course *g)
08:06:36narimiranPMunch: he's finding nim to be......... superb!
08:16:15*waleee-cl joined #nim
08:19:17*Trustable joined #nim
08:19:42*Zectbumo quit (Remote host closed the connection)
08:34:51*lritter quit (Quit: Leaving)
08:38:58moermnarimiran Well spoken (and funnier than me too)
08:40:09moermbut obviously superbia is *so fascinated* by Nim that (s)he doesn't even respond
08:44:04*Vladar joined #nim
08:45:28FromGitter<alehander92> what is this!
08:45:31FromGitter<alehander92> ops
08:45:59moermAn exclamation mark *helpful
08:46:42FromGitter<alehander92> i like those
08:48:20moermLet me sweeten your day '!!!!!!!!!!'
08:48:56FromGitter<alehander92> man what a morning
08:50:10*lritter joined #nim
08:56:54superbiamoerm: (s)he is working, but to anwser PMunch question: I like it, a lot of new concepts, but I have not written any mission critical code (or large project) to give my final verdict
08:56:54*Tlongir quit (Quit: Leaving)
08:59:01PMunchCool, just let us know if you need help with anything :)
09:01:29*oneark quit (Quit: Idle for 30+ days)
09:02:00moermsuperbia sure, take your time. That's just healthy and reasonable.
09:04:37*neceve left #nim ("Kicked by @appservice-irc:matrix.org : Idle for 30+ days")
09:04:37*sendell left #nim ("Kicked by @appservice-irc:matrix.org : Idle for 30+ days")
09:04:37*slackytude[m] quit (Quit: Idle for 30+ days)
09:04:38*xicheng[m] left #nim ("Kicked by @appservice-irc:matrix.org : Idle for 30+ days")
09:18:57*krux02 joined #nim
09:32:31FromDiscord<jasonfi> does Nim have any good caching library?
09:40:46*dddddd quit (Ping timeout: 256 seconds)
09:47:53*opi joined #nim
09:48:46Zevvfor caching what
09:49:11*nc-x joined #nim
09:49:35FromDiscord<tomck> Hello! couple questions about macros - Can nim macros be stateful? e.g. write to some compile-time state which is read by another macro at compile-time?
09:49:36Zevvsomething like https://github.com/abbeymart/mccache ?
09:49:46Zevvtomck: yes, you can do that
09:50:01FromDiscord<tomck> cool - what order to macros expand in?
09:50:08Zevvuse {.compileTime.} variables for that
09:50:15FromDiscord<tomck> same as evaluation order? (e.g. backwards for func parameters, i assume?)
09:50:30Zevvyou can make a global `var something {.compileTime.}: MyThing`, and access that from your macros
09:50:39Zevvorder is as expected
09:50:53FromDiscord<tomck> That's super cool!
09:51:00Zevvit is! :)
09:51:20ZevvIt took me a while to figure out the .compileTime. part though, when I needed that myself
09:51:27FromDiscord<tomck> Are there any tools for writing complex macros? I vaguely remember reading something about a pattern matching macro for writing macros, but i could be misremembering?
09:51:42*nc-x quit (Remote host closed the connection)
09:51:42FromDiscord<jasonfi> for caching strings
09:52:27Zevvjasonfi: Search nimble for 'cache', there's a handful of hits, https://github.com/abbeymart/mccache seems most recent
09:52:38Zevvnever used any of those myself, I usually implement things ad-hoc
09:52:53Zevvbecause bascially it's often just a Table[] with some cleanup strategy
09:52:56FromDiscord<jasonfi> thanks, mccache looks like what I want
09:54:33FromDiscord<jasonfi> actually maybe not, it needs to limit the amount of memory used, I don't want it to cache everything
09:54:40FromDiscord<jasonfi> I may implement something specific to my needs
09:54:46FromDiscord<flywind> !repo macroutils
09:54:46disbothttps://github.com/PMunch/macroutils -- 9macroutils: 11A package that makes creating macros easier 15 11⭐ 1🍴
09:57:12*dddddd joined #nim
09:58:00FromDiscord<tomck> brilliant! Is this commonly used? or a kind of fringe project? I don't want to write a weird macro that's even weirder b/c it's using a basically unused library
10:00:35ZevvPMunch is your man
10:01:09ZevvI wish that package would make it in the stdlib
10:01:17Zevvor integrate with the default macros
10:03:48FromDiscord<gokr> Hey guys, so... I got Android going and... started to wonder about Makefile vs bash scripts vs nake vs Nimscript. What's the recommended Nim way these days?
10:06:28Zevvnimble?
10:07:10moermHave a nice day everyone
10:07:13FromDiscord<gokr> Sure, I use nimble but... does it use nimscript for tasks or?
10:07:23*moerm quit (Quit: Leaving)
10:07:28Zevv.nimble files are actually nimscript, so you can do "stuff" there
10:07:47Zevvfor me, I'm usually pretty pragmatic, I use whatever tools are native to the environment and just nim from there
10:07:56Zevvso Makefiles or Android.mk, I don't really care. Nim is just a compiler
10:08:25FromDiscord<gokr> Yeah, so... I tend to whip up bash scripts - but... felt perhaps I should try something else 😉
10:09:17FromDiscord<gokr> In this case I am doing stuff before the whole ndk-build/gradle yaddayadda.
10:09:29ZevvI'd say, at least use something with kind of dependency tracking, so you don't need to move stuff through the compiler if your source did not change. OTOH, nim detects this and caches, so it shouldn't hurt that much
10:10:54FromDiscord<gokr> Mmmm, in this setup I use compileOnly - then copy C files into the Android tree (jni directory) and go ndk-build/gradle from there.
10:11:31FromDiscord<exelotl> I switched from makefiles to nimscript last year for my project and it worked out great
10:11:34FromDiscord<gokr> I know one can also make a static lib directly with Nim, but... I have spent TONS of hours getting through this setup so I am sticking with the "Android ways" for now.
10:11:35ZevvI guess just use whatever works for you
10:12:17ZevvNim doesn't force anything on you. It's one of the strengths IMHO, although it might be source for cofusion sometimes because there is no "right way" to do things
10:12:25ZevvNim itself uses a nim tool for building nim
10:12:31Zevvnot a great example, is it
10:12:37FromDiscord<gokr> I am quite aware
10:13:07FromDiscord<gokr> Just wondered what the recommended "Nim way" was these days, I presume nake isn't official, but nimscript is.
10:13:21Zevvpick your poison :)
10:13:48ZevvI still love Make, I know its ins and outs, it does one thing and it does it well
10:14:16FromDiscord<gokr> I agree, and people often tend to know how to use make.
10:14:33Zevvlots of people don't, so they use CMake because they think it is better or simpler
10:14:55ZevvI just ignore these people or leave a turd on their doorstep, depending on how close they are
10:15:17FromDiscord<gokr> With "use" I meant more "how to invoke it". Not write Makefiles.
10:15:31Zevvah :)
10:15:33FromDiscord<exelotl> The makefile I replaced was some horrible beast that calls itself and does different things depending on which directory it's called from :(
10:15:41FromDiscord<gokr> Ouch
10:16:14FromDiscord<gokr> @exelotl Is there good examples for Nimscript? Do you use it inside nimble or?
10:17:07FromDiscord<exelotl> Nah, I just use it with the nim compiler
10:17:42FromDiscord<exelotl> I have a config.nims in my project and I can do thinks like `nim build` and `nim clean`
10:19:00FromDiscord<gokr> Mmmm
10:19:20FromDiscord<exelotl> I don't know any simple examples but here's how I'm using it in my projects: https://github.com/exelotl/natu/blob/master/examples/hello_world/config.nims
10:19:50FromDiscord<gokr> Ah, awesome.
10:20:08FromDiscord<gokr> I just got our Norx based game running on Android 😉
10:20:38FromDiscord<exelotl> I'm actually not convinced that the `when not defined(nimsuggest)` is correct. I commented those asserts out in my project to stop it from breaking the vscode hinting
10:25:00*Trustable quit (Remote host closed the connection)
10:25:27*leorize_ joined #nim
10:26:43*leorize quit (Ping timeout: 240 seconds)
10:26:49*oddp joined #nim
10:46:49PMunchtomck, not sure how many people uses macroutils, but it's pretty good and I'm maintaining it so it's not too "fringe"
10:48:17PMunchZevv, totally agree with Make over CMake :)
10:52:39ZevvI'd even prefer a stapler to my forehead over CMake
10:58:43alehander92zevv please live!
10:58:52alehander92what about nix
10:59:16alehander92(my usual response when i want to show i know about build stuff)
11:06:21ZevvNee, dat vind ik echt helemaal niks
11:08:55PMunchOh shit, looks like he took the stapler to his head already!
11:11:11alehander92we need to call the raise exception polic
11:11:31FromDiscord<Technisha (LGBTQIAP+)> Anyone know why discordnim stopped receiving updates?
11:11:35FromDiscord<Technisha (LGBTQIAP+)> !repo discordnim
11:11:35disbothttps://github.com/Krognol/discordnim -- 9discordnim: 11Discord library for nim 15 52⭐ 8🍴
11:11:47alehander92are there downdates
11:11:51alehander92i guess downgrade it is
11:16:29*esthromeris joined #nim
11:16:45PMunchWhat do you mean stopped receiving updates?
11:16:54FromDiscord<Technisha (LGBTQIAP+)> Anyone know what the globalSymbols option is for? https://nim-lang.org/docs/dynlib.html#loadLib%2Cstring
11:17:28FromDiscord<Technisha (LGBTQIAP+)> > What do you mean stopped receiving updates?↵It hasn't been updated in a long time and it's very unstable and iirc it doesn't compile anymore
11:17:52esthromerisHello, I wrote a little snake game here http://0x0.st/i3Sd.nim it is actually my first Nim program, can anyone review it so I can know if I did something wrong ?
11:18:53FromDiscord<Technisha (LGBTQIAP+)> I would but I'm not at my pc, sorry
11:19:23esthromerisNo problem
11:19:34esthromerisOh and forgot to say that it is terminal-based
11:19:48PMunchTechnisha, I think its used by the new Discord bot, so a bit weird if it doesn't compile..
11:19:52FromDiscord<Technisha (LGBTQIAP+)> Oh okay
11:20:19FromDiscord<Technisha (LGBTQIAP+)> > Technisha, I think its used by the new Discord bot, so a bit weird if it doesn't compile..↵By the irc discord bridge?
11:20:43PMunchglobalSymbols adds RLTD_GLOBAL to the flags passed to dlopen on Linux at least: https://www.man7.org/linux/man-pages/man3/dlopen.3.html
11:20:48PMunchNot quite sure what it does on Windows
11:20:57PMunchYes
11:21:03FromDiscord<Technisha (LGBTQIAP+)> Oh thanks
11:21:18FromDiscord<Technisha (LGBTQIAP+)> The new discord bridge uses Dimscord
11:21:36FromDiscord<Technisha (LGBTQIAP+)> Because Dimscord is da best Nim lib-
11:22:54PMunchAha
11:25:35FromDiscord<Yardanico> well, discordnim stopped receiving updates even before dimscord was there if you didn't know
11:25:48*waleee-cl quit (Quit: Connection closed for inactivity)
11:26:01FromDiscord<Yardanico> Not sure why'd you want discordnim specifically
11:45:08*sekao joined #nim
11:48:50sekaois it possible to catch errors gracefully when using `nimeval.evalScript`? wrapping it in a `try` doesn't seem to work: the program still exits. i'm hoping to use it for live coding, so i want it to print the error and continue running.
11:49:21PMunchGood question actually
11:49:33PMunchI think you need to set a custom error hook
11:49:38PMunchIIRC
11:50:01sekaois that part of the compiler API? never heard of an error hook
11:52:09PMunchYeah it should be part of the API
11:52:19PMunchI remember messing about with it at some point
11:53:24FromDiscord<haxscramper> There is direct `quit 1` trigger on most errors in compiler - https://github.com/nim-lang/Nim/blob/devel/compiler/msgs.nim#L408 , maybe it can be mitigated using https://nim-lang.org/docs/system.html#addQuitProc%2Cproc%29 but I"m not sure about that
11:54:47FromDiscord<Rika> quit proc cannot cancel the quit
12:04:03FromDiscord<jasonfi> if I want a table that any thread can access, what's the best way to do this? a global?
12:04:09*esthromeris quit (Quit: leaving)
12:04:39PMunchRead only?
12:04:43FromDiscord<jasonfi> no
12:05:03FromDiscord<jasonfi> I would use a lock to restrict access
12:05:52PMunchWhat data types?
12:06:02*supakeen quit (Quit: WeeChat 2.8)
12:06:17FromDiscord<jasonfi> just a table[string, string]
12:06:19PMunchThere is: https://nim-lang.org/docs/sharedtables.html
12:06:27PMunchAh, strings are GCed though
12:06:38*supakeen joined #nim
12:08:02FromDiscord<jasonfi> if I have one thread that owns the table, how can I let other threads know where to find it?
12:08:19*FromDiscord quit (Remote host closed the connection)
12:08:33*FromDiscord joined #nim
12:08:51*FromDiscord quit (Remote host closed the connection)
12:09:22*FromDiscord joined #nim
12:10:23FromDiscord<jasonfi> I found something: https://simpletutorials.com/c/nim/vz4pqar9/how-to-read-global-data-from-a-thread-in-nim
12:18:12PMunchWell, there is a problem with that
12:19:32PMunchThe heap in Nim is thread-local, so one thread can allocate a string and put it in a table, but another thread can then end up free-ing it incorrectly..
12:19:44PMunchYou can use one of the garbage collectors that handle this though
12:24:40*Kaivo joined #nim
12:27:25*FromDiscord quit (Remote host closed the connection)
12:27:40*FromDiscord joined #nim
12:42:31FromDiscord<jasonfi> ok, I'm going to try it... hopefully the GC can figure it out
12:46:02PMunchThe default one won't be able to
12:46:19PMunchIt might appear fine during testing, but then just completely fall apart
12:47:01FromDiscord<jasonfi> not great..
12:47:20FromDiscord<jasonfi> I'll post this on the forum as well, to try and get more input
12:47:22FromDiscord<jasonfi> but thanks
12:54:25ForumUpdaterBotNew thread by Jasonfi: How to implement a single table that all threads can access?, see https://forum.nim-lang.org/t/6645
12:55:47Zevvhttps://nim-lang.org/docs/sharedtables.html?
12:55:52*sekao quit (Remote host closed the connection)
12:56:40*abm joined #nim
13:01:54*mbuchel quit (Quit: WeeChat 2.8)
13:05:37*esthromeris joined #nim
13:05:56*rockcavera quit (Remote host closed the connection)
13:06:18*esthromeris quit (Client Quit)
13:08:09PMunchZevv, the data in a sharedtable still needs to be GC safe
13:08:16PMunchHe wanted string -> string mapping
13:08:20YardanicoPMunch: you can make an object
13:08:42PMunchHow would that help?
13:08:57Yardanicowell, check the sharedtable examples
13:09:28*rockcavera joined #nim
13:09:37PMunchWhat examples?
13:09:51Yardanicosorry, it was the value, not the key
13:11:18*esthromeris joined #nim
13:12:01*esthromeris quit (Client Quit)
13:13:37PMunchWell they both have the same problem I think
13:14:23PMunchI guess you could try to make a table of cstrings
13:14:29PMunchNot sure if that'd work though
13:28:01PMunchHmm, I want to implement a history system similar to what the shall has for my calculator
13:28:31PMunchI'm thinking of re-using the ! syntax for the things you've input
13:28:56PMunchBut I've also got previous stacks, it would be cool if I could pick stuff from one of those as well
13:29:06PMunchBut what syntax should I use for that?
13:29:57FromDiscord<Rika> $ for special variables like env vars?
13:30:05FromDiscord<Rika> similar to*
13:30:20PMunchHmm, that could work
13:30:28PMunchThey're not named though
13:31:21PMunchOkay, here's a simple example usage: http://ix.io/2tq2
13:36:07PMunchSo to get the 200 you could do !1:2 (first command, second part), or to get the entire first command simply !1. But if I want to get the 300 from either of the two stacks containing it, what should be the syntax for that?
13:36:21Oddmongeris it possible to get a bool with and operation ?
13:36:34PMunchHuh?
13:36:35Oddmongeri mean, for the moment, i must do: (1 and 2) > 0, to get the bool
13:36:51FromDiscord<Rika> `1 and 2` is bitwise and
13:36:52narimiranhuh?
13:36:59FromDiscord<Rika> not boolean and
13:37:18Oddmongeri must said i have tried && , too
13:37:25narimiranOddmonger: tell us what you really want to do
13:37:28FromDiscord<Rika> you must make `1` and `2` bools
13:37:38narimiran(feels like a classic XY problem)
13:38:01FromDiscord<Rika> himehiyo
13:38:02PMunchYeah 1 and 2 creates an int 3 (0010 & 0001 = 0011) which you're then checking if is larger than 0. Which it will always be
13:38:05FromDiscord<Rika> oops
13:38:07FromDiscord<Rika> wrong server lol
13:38:19narimiranand yes, it is possible to get `bool` with `and`, but you need `bool and bool`, not `int and int`
13:38:49FromDiscord<Rika> pmunch: that's or lol, it produces 0
13:38:51Oddmongeri want to return true or false, when two numericals are resisting to a logical and
13:38:59narimiranso i'm thinking the problem is at a previous step (that's why i'm asking what you really want to do)
13:39:11FromDiscord<Rika> integers will always do bitwise and, not logical and
13:39:22FromDiscord<Rika> you must make them booleans to use boolean and
13:39:25narimiranOddmonger: let's make one step back: what are those two numbers?
13:39:46narimiranare they a length of something?
13:40:08Oddmongerone is an enum value (power of two) , the other is a value (sum of power of two)
13:40:35narimirando you want: `a > 0 and b > 0`?
13:40:38Oddmongerif the enum value is part of the value , it's ok
13:40:49Oddmongerno, i want: a && b
13:41:06narimiranoh, ok
13:41:07Oddmongerso seems the only way is : (a and b)>0
13:41:15narimiranthen it might be the case of precedence
13:41:30FromDiscord<Rika> isnt && boolean?
13:41:32narimiranwithout parentheses it is `a and (b > 0)`
13:41:53narimiranit expects a to be a bool
13:41:57narimiran(that's my guess)
13:42:11PMunchOh woops, you're right of course Rika
13:42:38narimirannow i'm completely confused :D time to grab something to eat to clear my mind :)
13:43:12PMunchAh, yes in that case you need the check Oddmonger
13:43:24OddmongerRika: yes && is boolean, but works (in C) with integers
13:43:27FromDiscord<Rika> Oddmonger: so you want to check if a is not 0 and if b is not 0?
13:43:30PMunchThat's simply because Nim doesn't auto-convert ints to bools like many other languages
13:43:32FromDiscord<Rika> yes but this is not C
13:43:54FromDiscord<Rika> so you want `a > 0 and b > 0`
13:43:59PMunchIt's not bool in C either, it just creates a non-zero number which is considered true in a boolean case in C
13:44:16PMunchRika, no he wants to do it like he did initially
13:44:25FromDiscord<Rika> ?
13:44:29PMunchBasically it's a bitmask and he wants to check if a bit is set in the mask
13:44:30OddmongerRika: no , because a==2 and b==4 would be ok in that case
13:44:36Oddmongeryes bitmask
13:44:48FromDiscord<Rika> okay
13:44:53PMunch(a and b) != 0 is what you want
13:44:58Oddmongeryes
13:44:58FromDiscord<Rika> then what you send (a and b) > 0 is correct
13:45:07FromDiscord<Rika> or rather that
13:45:15Oddmonger!= 0 is better, though (no ambiguity)
13:45:19Oddmongerthank you
13:45:30PMunchSame result, bitmasks typically are stored as unsigned
13:45:58PMunchOr at least you should, in case it suddenly is treated as a negative integer which would mess up the > 0 check
13:46:28PMunchIf this is pure Nim code not interacting with C you could of course use the built-in set type
13:46:52PMunch(Not the hashsets in the sets module)
13:47:00PMunchThis thing: https://nim-lang.github.io/Nim/manual.html#types-set-type
13:47:19PMunchThen you could do `if a in b:`
13:47:31OddmongerPMunch: yes, i know :) (it's me: https://forum.nim-lang.org/t/6640 )
14:11:01*opi quit (Remote host closed the connection)
14:11:25*PMunch quit (Quit: Leaving)
14:20:28*FromDiscord quit (Remote host closed the connection)
14:20:42*FromDiscord joined #nim
14:28:50ForumUpdaterBotNew thread by Sekao: Sandboxing untrusted Nimscript code, see https://forum.nim-lang.org/t/6646
14:33:06*narimiran quit (Ping timeout: 256 seconds)
14:36:11*dadada quit (Ping timeout: 240 seconds)
14:37:39*dadada joined #nim
14:38:04*dadada is now known as Guest53507
14:47:07FromDiscord<Varriount> Good morning ladies and gentlemen and disruptek
14:53:37*drewr quit (Read error: Connection reset by peer)
14:55:41*opi joined #nim
14:57:05*drewr joined #nim
15:03:56FromDiscord<Zachary Carter> what is disruptek?
15:05:21FromDiscord<Rika> some mysterious ai
15:05:25Oddmongerundefined ?
15:07:31disruptekunbounded shitposting.
15:09:36Zevvour local excrementiminished inordinidiot
15:13:00ForumUpdaterBotNew thread by Sschwarzer: How to instantiate custom `TableRef` without repeating individual types?, see https://forum.nim-lang.org/t/6647
15:14:59FromDiscord<Zachary Carter> solid answers
15:15:49*FromDiscord quit (Remote host closed the connection)
15:15:56ZevvaRGh I hate the formatting at the nimforum
15:16:03*FromDiscord joined #nim
15:16:56disruptekdo i need to work on generics or do they work?
15:17:28Zevvalmost
15:17:32Zevvthe BracketExpr is ok
15:17:39Zevvit's just that env needs to go [T] as well
15:17:46Zevvor [T, U, V]
15:17:58ZevvI tried but I failed
15:18:00Zevvalso due to beer
15:18:36disruptektrying to decide which to upgrade first: scopes or typed.
15:19:24disruptektyped would be better for you, i guess, since the syntax can stabilize sooner.
15:20:31ZevvIf I could choose, I'd say typed, generics, scopes
15:20:59Zevvif typed can be done, we should do it. The `var a: int = 3` just kind of sucks because we can't type Normal Nim in cps procs
15:21:43Yardanicooh nice
15:21:49YardanicoI'll try to repro it @treeform
15:21:53YardanicoI mean git bisect and stuff
15:22:10Yardanicofunny thing
15:22:12Yardanicoit works on linux
15:22:13disruptekgenerics are only a tweak to the concept, afaik.
15:24:14disruptekwould be good to have a couple new tests, too.
15:24:58disruptekmaybe have a client talk to the http server in a single run().
15:27:16Zevvdisruptek: need to take a drive and other stuff, will report back in a few hours probably
15:29:48disrupteksounds like laziness to me.
15:38:47*esthromeris joined #nim
15:40:57*esthromeris quit (Client Quit)
15:57:04Oddmongerouchhhh finished the exercism involving set
16:00:36opiOddmonger: there are Nim exercisms?
16:01:31Oddmongeryes: https://exercism.io/my/tracks/nim
16:02:12Oddmongeri guess it's for beginners, but i have difficult to get «optimal» resolution, and i'm not even sure to have reachen it
16:03:00opiOddmonger: I'm like beginner * -1, wrote maybe few kilobytes of junk Nim code, would probably do me good
16:03:18opithank you hinting me at it
16:03:36Oddmongerhappy to have helped someone here
16:03:44Oddmongeri was desperate at this
16:07:49disruptekwhat did you learn?
16:12:38disrupteki'm known to rarely employ sarcasm.
16:15:57*opi quit (Quit: Leaving)
16:21:37alehander92disruptek
16:21:43disruptekspeak
16:21:55alehander92i tried elm man
16:22:00alehander92errors good
16:22:10disrupteki know, right?
16:22:17alehander92very help for the small man
16:22:27disruptekwe could learn a thing from them.
16:22:33alehander92i had a more grand idea
16:22:36disruptekoh?
16:23:53alehander92good to talk to you
16:24:00alehander92my idea is to do it for popular languages
16:24:01disruptekyeah, cya aroun'.
16:24:23alehander92writing a custom frontend
16:24:27alehander92for stuff like C
16:24:38alehander92which goes into much more hint/suggestion detail
16:24:46disruptekeh.. fuck'em.
16:24:54alehander92i mean as an example
16:25:18alehander92there is a need of more suggestion tooling in my world
16:25:34disruptekbut i think what we /could/ do is to run our semcheck in a special mode where we accumulate hints, and then play it back to "explain" the compiler's thought process.
16:25:34Zevv"make pretend"
16:25:39alehander92but the good way for this to happen is to make it easy to build this kind of suggestions
16:25:49alehander92yeah exactly
16:25:59disrupteki don't want it to accumulate mere strings, though.
16:26:00alehander92elm's messages sound like thought process
16:26:03alehander92and it makes sense
16:26:06disruptekright.
16:26:17disruptekwe teach the user how the compiler thinks. everyone wins.
16:26:32alehander92the only thing i wonder is about hints
16:27:17alehander92but if it's easy to just link common examples / resolutions for common cases
16:27:22alehander92this is probably enough
16:27:27disruptekhave you seen my testes?
16:27:33disruptek!repo testes
16:27:36disbothttps://github.com/jyapayne/einheit -- 9einheit: 11Nim unit test library 15 40⭐ 4🍴 7& 29 more...
16:27:37alehander92what i wonder is how to make my own compilers do this easily
16:27:41disruptek!repo disruptek/testes
16:27:43disbothttps://github.com/disruptek/testes -- 9testes: 11a small unittest framework with decent support 🔴🟡🟢 15 1⭐ 0🍴
16:28:18Zevvexplain "have a client talk to the http server in a single run()"
16:28:19alehander92maybe on some boundaries the error mechanism should expect
16:28:22alehander92a suggest type
16:28:57disruptekZevv: spawn a server and a client. issue a single run(). the two talk until they run out of things to say.
16:29:04alehander92`individual tests don't even have to compile` huh
16:29:17alehander92`show the test code as we run it, unless no` sounds cool!
16:29:19Zevvdisruptek: well, that is happening already, it's using HTTP keepalive
16:29:31disruptekdon't fsck with me, zevv.
16:29:38Zevvoh you want a server and a client in the same app
16:29:40Zevvright'o
16:29:54disruptekyes yes.
16:29:56alehander92disruptek this looks cool dude
16:29:58Zevvoh oh
16:30:05alehander92what does testes mean
16:30:07disruptekwell, i am worried that stash/ stuff isn't being tested.
16:30:07alehander92it's spanish right
16:30:13Zevvalehander92: don't go there dude
16:30:14disruptekit's some of the most sophisticated cps code we have.
16:30:15Zevvdon't
16:30:20alehander92oh no
16:30:23alehander92i googled it
16:30:40disruptek🏀⚽
16:30:43alehander92i wish i knew dutch now
16:30:46Zevvdoesn't happen often that I'm really grinning behind my keyboard, but this was one of those moments
16:30:52alehander92yeah me too
16:31:02alehander92i feel like a teenager in 7th grade
16:31:04alehander92and i dont like it!
16:31:12disruptekoh 🦌
16:31:40alehander92zevv i am an ocaml-er today
16:31:49alehander92my haskell phase is on pause
16:31:55disruptekAAAIAIIEEIEIEEE
16:32:09disruptekthose are two cool languages.
16:32:16alehander92i managed to use a lib in haskell: it was so hard man, i really felt as a beginner
16:32:50alehander92now i can print without `IO` what a life
16:33:21alehander92how far is the cps stuff
16:33:31disruptek--> <---
16:35:01alehander92is this how code
16:35:05alehander92works today
16:35:15alehander92i miss the time when there were words and numbers in nim
16:35:20Yardanicowhat
16:35:22alehander92now it's all arrows to arrows
16:35:37disruptekyou've been writing too much haskell.
16:35:39alehander92^ -> ? -> ~
16:35:51Yardanicono
16:35:57disrupteknim is all about emojis.
16:36:42alehander92i wonder if we can add
16:36:45disruptekyou really have to play with my testes locally. pretty suite, if i do say so myself.
16:36:48alehander92a cyrillic function to the stdlib
16:37:00Yardanicoпочему бы и нет
16:37:03alehander92it would be very culturally significant
16:37:17alehander92maybe deprecated functions can be renamed to cyrillic
16:37:22alehander92to make it hard to use but possible
16:37:55alehander92disruptek hire zevv to think of good name dude
16:38:16alehander92he told me once he can even manage windows for hire
16:38:22disruptekgtfo
16:38:54disruptekif i ever had a window, /maybe/, just /maybe/, i'd hire zevv.
16:39:03disruptekhave to win the lottery first.
16:40:11alehander92dude
16:40:17disruptektestes will support sub-tests soon. so you can shrink testes by default and then when you need better access to the testes, they will expand.
16:40:18alehander92did you just maybe as a pun
16:40:28alehander92my haskell flashbacks
16:40:30alehander92are coming back
16:40:32alehander92JUST do it
16:40:33YardanicoPTSD
16:40:35YardanicoJUST
16:40:36YardanicoMAYBE
16:40:49alehander92Just a -> live Nothing -> survive
16:40:55Yardanicoa -> a -> Bool
16:41:10Yardanico(Read, Show, Eq, Ord, Enum, Bounded)
16:41:19alehander92*clapping*
16:41:42alehander92it was cool
16:41:46disruptekassert ("hello" -> c <- toUpperAscii)() == "HELLO"
16:41:51alehander92but i couldn't quickly get stuff like distinct string
16:41:54Yardanicodont disruptek
16:41:55alehander92which surprised me
16:41:58Yardanicothis is cursewd
16:41:59Yardanicocursed\
16:42:00Yardanicocursed
16:42:13alehander92disruptek
16:42:17alehander92it's not
16:42:23alehander92we can do it 2d
16:43:03alehander92no 2d is too much
16:43:14alehander92going to my toy no
16:43:32Yardanicoyou mean https://esolangs.org/wiki/Spleenmap ?
16:43:34Yardanico2d language
16:44:58*opi joined #nim
16:46:06disruptekit's already done in cps.
16:46:44disruptekshit i missed another court date in new york.
16:46:54alehander92are you ok
16:47:01disruptekof course not.
16:47:40alehander92you have a lawyer
16:48:01alehander92you're not going to present them a defense-dsl library
16:48:17disruptekonly the innocent need lawyers.
16:49:37alehander92not going to jail right
16:49:47disruptekthey have to catch me, first.
16:49:52alehander92let it be a freebsd idea
16:50:32alehander92did you write a lexer with `split`
16:50:44alehander92no wonder Araq sent the special forces
16:52:16disruptekif `split` is a crime, i am a criminal.
16:55:45*maier quit (Ping timeout: 240 seconds)
16:59:17*superbia1 joined #nim
17:01:25*superbia quit (Ping timeout: 240 seconds)
17:23:26opiOddmonger: looking into those exercism was a good idea, I'm fun-struggling right now
17:24:53disruptekhow do i tell the compiler not to bother with js tests?
17:25:29alehander92calmly
17:25:50disrupteknot my strong suit, if i'm being honest.
17:25:57*Jesin quit (Quit: Leaving)
17:31:29disruptekalehander92: btw, testes only works in cpp iirc.
17:40:12alehander92huh why
17:40:53disruptek!issue author:disruptek
17:40:54disbothttps://github.com/nim-lang/Nim/issues/15160 -- 3exceptions codegen broken inside macros 7& 27 more...
17:50:24*Jesin joined #nim
17:59:53opiI just got stuck trying to figure why pow tries to do BackwardsIndex for good 10 minutes… just to realize I didn't import math, so the operator didn't got overloaded… I want to die
18:01:10Zevvdisruptek: fwiw: https://github.com/disruptek/cps/blob/master/stash/echo_server_client.nim
18:02:11Zevvone tcp echo server, 100 clients, and a timer with reporting
18:03:13*leorize_ is now known as leorize
18:04:17*muffindrake quit (Quit: muffindrake)
18:06:57disruptekany reason i cannot put it into tests?
18:07:09Zevvtests should go *poof* fast
18:07:12disruptekopi: i don't want you to die.
18:07:36disruptekhave you run the tests recently?
18:07:46disruptekthe yield test is pretty ridiculous.
18:08:13opidisruptek: well, then I'm going to soildier on with those code exercises, thank you for believing in me :-)
18:08:19Zevvdisruptek: which one is that?
18:08:38disruptekrun the taste test.
18:09:03disruptekwe should have a test to assert that we're not leaking memory, too.
18:09:13disruptekof course, what with arc not working... 🤷
18:09:19ZevvOk, I'll bite
18:09:43Zevvyour testes are missing
18:09:50disruptekdamnit.
18:09:59*lritter quit (Ping timeout: 265 seconds)
18:10:14disruptektestes management is harder than it looks.
18:10:23disrupteki mean, package management.
18:11:41disruptekeh it should exit with zero clients and 10MM messages, right?
18:11:47disruptekor even 1/10th of that.
18:13:54Zevvrigh
18:14:02ZevvI've added a stop condition and made it shorter
18:14:19Zevvnow its 200k and stops when everyone is gone
18:14:33Zevvfeel free to move to test
18:14:40disrupteknice, thanks.
18:14:43Zevvso, talking about typed
18:14:49Zevvwill this or will this not fly, you think
18:15:04disruptekis it a volvo?
18:15:13Zevvbecause I think it will help a few things. User code is more normal, and you have better type knowledge to build the env
18:15:30disrupteki mean, it's fine typed. it's just that we need to fixup syntax.
18:15:50Zevvyou but semantics of your AST is different when typed, so It
18:15:55disruptekalso, magic goes away and magical procs are just procs that take a continuation of the type the user expects to use...
18:15:56Zevvit's quite some refactoring I guess
18:16:07disruptekjust yield and continue, right?
18:16:15Zevvno, I mean make .cps. macro typed
18:16:21disruptekme too.
18:16:23Zevvok
18:16:34Zevvoh the syntax, yield and continue
18:16:44disruptekyield foo() -> it.foo()
18:16:45Zevvhm I'm not sure. What if I want to do normal iterator things in cps one day
18:16:52Zevvjust don't use Nim keywords I say
18:16:55Zevvit's baaad mkay
18:17:04disruptekmy latest comment.
18:17:19Zevvdont understand your last comment
18:17:38disruptekunless we build cps into nim, it won't be a problem.
18:17:44Zevvok, but that's for later
18:17:46disruptekalso, if we build cps into nim, it won't be a problem.
18:17:55Zevvsure, but for now, just dont do it
18:18:01ZevvI'd rather have operators
18:18:03Zevvlets do arrows
18:18:10Zevv===>===>>
18:18:13Zevvand <<===<===
18:18:20skrylar[m]so i have received some message from this entity called stale[bot]
18:18:36skrylar[m]i see we are now being retards and adopting inbox zero systems that fix no problems but make the ticket counter look better
18:18:36disruptek!issue rfc stale author:mratsim
18:18:37disbothttps://github.com/nim-lang/Nim/issues/15159 -- 3[RFC] Stale bot
18:18:39skrylar[m]i am gravelydisappointed
18:18:48Zevvwe use ➭
18:18:48Zevv➭ Heavy Lower Right-Shadowed White Rightwards Arrow
18:19:02Zevvfor yield. Maybe you can find a colorful one, with animations
18:19:05disruptekZevv: would rather use ascii with a pleasant ligature.
18:19:14disruptek... is good, no?
18:19:19Zevvsays the man who puts circus tents in his tests
18:19:30disruptekmy testes belong in a circus.
18:19:35Zevvfreak show
18:20:00Zevvanyway, feel free to use what you want, I just think that using existing keywords is confusing
18:20:20Zevvbut if you must, I'm not stopping you
18:20:20disruptekit's not a thing if we're typed, so don't worry about it.
18:20:28Zevvtrue.
18:20:53Zevvso, with typed. We lose the 'give foo a type' as the user benefit. How does it help your implementation?
18:21:18disruptek.cps. will just wrap your proc to define a local `cps` or `continuation` value.
18:21:20Zevvyou can just do getTypeImpl() to fill your env
18:21:34Zevvright
18:21:54disruptekit helps the impl because we lose the limitations of untyped values in the continuation types.
18:22:27disruptekit know the syntax is valid and we're just transitioning code from implicit to explicit control-flow.
18:22:34disrupteks/^it/we/
18:22:40Zevvright
18:23:10ZevvI feel that stuff is basically functional now, I can mostly type what I want without running into surprises
18:23:34Zevvthe euphory is less then I had expected it to be, however
18:23:54disruptekalso, we want to be able to inspect other calls to handle them as cps (or not).
18:24:03disruptekand we want () to work.
18:24:26Zevvok, could you take a snipped from the echo test, and rewrite it as you think it would look by then
18:24:49Zevvtake doEchoClient()
18:25:01disrupteksure, but probably this will all happen easily.
18:25:03skrylar[m]hah. the stalebot wnet on about a three year old bug with a provided test case that was never fixed and actually is broken worse by the newer compiler
18:25:19Zevvdisruptek: just show me, because I'm not sure how the () comes in yet
18:25:32disruptekkk
18:28:09skrylar[m]anyway. you guys keep adopting useless features, i'll go back to trying to get us a ui system that actually works
18:28:15*skrylar[m] poofs
18:29:28shashlick@mratsim - have you tried weave with -d:mingw cross compiling?
18:32:23disruptek() just means "trampoline here". when we sink a continuation and return nil, it's a noop. but it solves the problem that if we are just doing some simple control flow, we don't necessarily want to pass it all to the event handler. if we're going to make trampolining a requirement, we should also include it as a built-in semantic to every continuation so that they are usable without extra machinery.
18:32:56Zevvah right
18:33:02disruptekso instead of `cps foo(fd, POLLOUT)` you're `foo(fd, POLLOUT)()` and that's it.
18:33:04Zevvso `()` is basically c = c.fn(c)
18:33:16disruptekin a while loop, yes.
18:33:29ZevvI want `foo(fd, POLLOUT)`
18:33:32Zevvbut that's not gonna happen
18:33:39disruptekwell, it can.
18:34:04Zevvbtw, you did see that I now do `cps evq.io(fd, POLLIN)`
18:34:05disruptek/actually/ --> so instead of `cps foo(fd, POLLOUT)` you're `cps.foo(fd, POLLOUT)()` and that's it.
18:35:01disruptekso just cps.foo() returns a continuation. now we get to figure out how to handle that...
18:35:20Zevvok let's see how that will go
18:37:16Zevvoh and this might be handy, should be fairly trivial: http://ix.io/2trv/nim
18:38:03Zevvso if the inner nimnode is not a RoutineNode but a StmtList, just go through that and convert all RoutineNodes
18:38:50Zevvif cps then ever get smarts enough *not* to transform procs that don't do cps things, we can just put the cps: at the top of a file and code as if everything is just normal
18:39:07disruptekrude.
18:39:18Zevvit'll be big fun. It starts to look more like magic
18:39:28disrupteki added a missing test for while, so you can easily fix that behavior.
18:39:55Zevvhow does one apply a macro to a complete source file?
18:40:06disruptekre-include it?
18:40:27Zevvnah, that'll have to wait until someone ports this to a compiler plugin
18:40:32Zevvsounds like a jobs for germans
18:40:40ZevvDeutche Gruntligkeit
18:40:48disrupteklol
18:43:25disrupteki told araq i would do mangling while he was gone.
18:44:14disrupteki cannot reproduce this bug in tmath though. it's some kinda weird name/type clash that might require interaction with unittest.
18:44:21disruptekeven so, i cannot repro it.
18:44:35Zevvif you cant repro it you cant fix it
18:44:38Zevvnoting you c
18:44:48alehander92disruptek
18:44:49Zevvan do about it, except moving on to cps
18:44:55alehander92are you the president of nim
18:45:00alehander92while he is far away
18:45:04disrupteknope.
18:45:35alehander92it's narimiran
18:45:43disruptekmust be.
18:46:08alehander92i am just a sheep in the local east
18:46:33*endragor quit (Remote host closed the connection)
18:47:09*endragor joined #nim
18:51:30*endragor quit (Ping timeout: 256 seconds)
18:52:34*maier joined #nim
18:56:36*narimiran joined #nim
18:57:23*maier quit (Ping timeout: 240 seconds)
18:59:38*Zectbumo joined #nim
19:19:48disruptekso how should mangling handle the fact that there are symbols defined in stdlib.h which may clash with your vars?
19:22:35Zevvneed mor context
19:22:49Zevvdoes my mangeled var clash with something in stdlib.h?
19:23:03Zevvbecause my vars are mangled, right
19:23:06disruptekN_LIB_PRIVATE NI rand = ((NI) 3);
19:23:09disruptekusr/include/stdlib.h:453:12: note: previous definition is here
19:23:10disruptekextern int rand (void) __THROW;
19:23:21Zevvbuy why is rand just rand. It's always rand_423r98230r983928374u
19:23:28disrupteknot anymore.
19:23:38Zevvoh right. Well *that* is pretty tricky
19:23:45Zevvyou can not avoid that at all, nor handle it
19:23:55disruptekmy testes are throbbing.
19:24:16disruptekironically, testes is fine with it. it's unittest that pukes.
19:24:28Zevvyes but it can happen anywhere on anything
19:24:38disruptektruth.
19:24:50Zevvand my stdlib.h might have different stuff then yours
19:25:10Zevvalso, Nim pulls in more C headers when you use nim libs, so whatever can clash will clash
19:26:13disruptekokay, i can break it in testes. weirdly, i cannot break against **free**.
19:26:18disruptekso odd.
19:29:49disruptekmodule-level identifiers will just have to get mangled like the punks they are.
19:31:45disruptekah, and this is the problem. that code already exists, but i guess macros obscure this info.
19:32:01Zevvoo nifty
19:43:13*NimBot joined #nim
19:45:52*FromDiscord quit (Remote host closed the connection)
19:46:08*FromDiscord joined #nim
19:48:56disruptekah, actually the problem is that skLocalVars includes globals. go figure.
19:50:16FromDiscord<Clyybber> doesn't do for me
19:50:31disruptekskVar, skLet.
19:50:35FromDiscord<Clyybber> oh eh, yeah
19:50:38Yardanicodiscord bridge wasn't working for a while :P
19:50:39FromDiscord<Clyybber> sorry :p
19:50:46Yardanicohad to manually restart
19:50:52FromDiscord<Clyybber> Yardanico: Updates or crash?
19:51:02Yardanicono, just it just froze for some reason
19:51:08YardanicoI really need to update it to latest ircord
19:51:27YardanicoI'm just slightly worried my irc/markdown formatters can result in endless while loops, so I'm gonna add some safeguards
19:52:16FromDiscord<Danny Hpy> oh it was my fault? sorry :x
19:52:29FromDiscord<Yardanico> no 🙂
19:52:34FromDiscord<Yardanico> it was frozen before you messaged
20:00:04*Trustable joined #nim
20:04:39*Jjp137 quit (Read error: Connection reset by peer)
20:05:00*tane joined #nim
20:05:11FromDiscord<Elegant Beef> Yard, possibly dumb idea, but have you looked into rendering the codeblocks into images? Would work well for the bridge, although cant copy paste the code.
20:05:23disrupteksounds super fun for irc users.
20:05:35FromDiscord<Elegant Beef> Hey get a client that embeds images
20:05:40FromDiscord<Elegant Beef> This is multimedia baby!
20:05:46*Jjp137 joined #nim
20:05:46disruptekuh, no, it's not.
20:05:58FromDiscord<Elegant Beef> Doesnt glitter require you to open the link anyway
20:06:11disruptekglitter? i only use it on my face.
20:06:33FromDiscord<Elegant Beef> I mean if someone from glitter posts a code block, atleast on discord it was linking to their post
20:07:00ZevvI prefer my chrome mono
20:07:23FromDiscord<Yardanico> it's gitter
20:07:27FromDiscord<Yardanico> and almost no one uses gitter nowadays
20:07:30FromDiscord<Yardanico> except bung 🙂
20:07:47FromDiscord<Yardanico> and yes, images would be worse than just linking code
20:07:59disrupteki'm happier not knowing what code you chuckleheads are writing.
20:08:24YardanicoZevv: can I use BackwardsIndex on `capture` in npeg?
20:08:27disrupteknow mangling breaks inexplicably on cpp exitprocs.
20:08:43Yardanicoseems like I can't :P
20:08:46Yardanicoguess it's capture[capture.len - 1] time
20:08:55disruptekdo you have git?
20:08:58Yardanicoi do
20:09:07Yardanicoi also have hub
20:09:08Yardanicogit hub
20:09:11disruptekwhat's stopping you from submitting a pr?
20:09:14FromDiscord<Elegant Beef> disruptek, you'd atleast get 30% dumber reading my code
20:09:16Yardanicoto what?
20:09:19disruptekbackwardsindex is hardly magical.
20:09:25YardanicoI know
20:09:28YardanicoI know it isn't hard :P
20:09:35disrupteki'm old. i cannot afford any further cognitive decline.
20:09:48YardanicoI need to make the mess of this ircord modified parser stuff to work again
20:10:57FromDiscord<Recruit_main707> @creatable yes, nim works for trainers, I recently did a small bhop internal cheat for csgo
20:12:43FromDiscord<Recruit_main707> However, it was a pain to cross compile it to be 32bit, but if you target a 64bit game (or you are in a 32bit system) that won’t be an issue
20:13:02FromDiscord<creatable> shouldn't be, yeah
20:13:10*endragor joined #nim
20:13:46ZevvYardanico: euh to do what?
20:13:54YardanicoZevv: to get the last capture?
20:13:58Yardanicoin nim code under some pattern
20:14:09FromDiscord<Recruit_main707> Ping me if you have questions, I just went out for 6 days, so I can’t show you the code, but I’ll try to help
20:14:18ZevvOoh ^ that one
20:14:22Zevvehm let me see
20:14:40FromDiscord<creatable> gotcha
20:17:47*endragor quit (Ping timeout: 240 seconds)
20:19:37ZevvYardanico: is ^1 the last one or ^0 ?
20:19:40Yardanico^1
20:20:17Zevvmaster. You want a release?
20:20:23Yardanicono lol
20:20:26Yardanicoit's just a small feature :)
20:20:49ZevvI can make sub-minor version
20:20:56Yardanicodon't worry, it's okay
20:21:00Zevv0.22.0.0.0.0.0.0.0.0.1
20:27:26Zevv!eval echo 0.10 + 1e15 - 1e15
20:27:28NimBot0.125
20:29:02FromDiscord<Danny Hpy> Warning: 'cbIter' is not GC-safe as it accesses 'text' which is a global using GC'ed memory [GcUnsafe2]
20:29:08FromDiscord<Danny Hpy> Is there anything I can do to supress that warning?
20:29:21FromDiscord<Yardanico> silence it
20:29:28FromDiscord<Yardanico> --warning[GcUnsafe2]:off
20:29:36disrupteklook at your phone while compiling.
20:29:41Yardanicohoho
20:29:58Zevvso. no hints of figuring out why he gets the warning and fixing the issue?
20:30:09YardanicoI can say
20:30:20disruptekZevv: you know as well as i.
20:30:22Yardanico"it's because you're probably accessing a global but it won't matter if you're not using multithreading"
20:30:48disruptekit's there to dull your instrument.
20:30:57ZevvNo I mean, fixing the issue: https://github.com/dom96/nim-in-action-code/issues/6
20:30:58disbotnot GC-safe ; snippet at 12https://play.nim-lang.org/#ix=26qK
20:31:04disruptekdon't do it.
20:32:05Yardanicobut really there was an accepted RFC (but no progress really) about making --threads:on default
20:32:08Yardanicowhich I actually agree with
20:32:11FromDiscord<creatable> @Recruit_main707 `FindWindow(nil, L"Game")` returns something but I'm not sure how to derive the process ID from the HWND that returns
20:32:17Yardanicobut now it can't be really done since nim is past 1.x
20:32:26Zevvno, which is silly indeed
20:32:38YardanicoZevv: --threads:on is good, why would it be bad?
20:32:41Zevvbut I bet 2.0 will not take another 15 years
20:32:45Yardanicoyeash
20:32:46disruptekthere's a new rust release right around the corner.
20:32:50Yardanicoit's just a full rewrite of the compiler
20:32:51Yardanicopfft
20:32:51Zevvno i mean it's silly that it wasn't done for 1.0
20:32:59*narimiran quit (Ping timeout: 240 seconds)
20:33:05Zevvbut fair enough. Nim has not a good story to tell, when it comes to threading
20:33:06Zevvstill not
20:33:06Yardanicoah yes
20:33:17Zevvtried to get that async+thread marriage to happen somwehre last year
20:33:19Zevvmiserable failed
20:34:49FromDiscord<Danny Hpy> Yeah I could ignore that warning, but if it's there, it's for a reason :x I would like to fix it 'correctly'
20:35:46*waleee-cl joined #nim
20:36:13*easyAnalyst joined #nim
20:36:24*easyAnalyst quit (Quit: Leaving)
20:36:58Yardanicoanyway time to roll these new ircord changes
20:37:01YardanicoI hope it won't break too much
20:43:17*FromDiscord quit (Remote host closed the connection)
20:43:33*FromDiscord joined #nim
20:43:34Yardanicojust restarted it
20:43:45Yardanicofeels good to be a nim user
20:44:35FromDiscord<Yardanico> bold underscore
20:44:48opiYardanico: what's the best markdown library for Nim anyway?
20:44:56Yardanicothere's only one I know
20:44:58Yardanicoand I didn't use any
20:45:06Yardanicosince IRC only supports some simple formatting options
20:45:09YardanicoI just made two procs on my own
20:45:12YardanicoircToMd and mdToIrc
20:45:22YardanicoThere seems to be https://github.com/soasme/nim-markdown but I've never used it
20:45:28Yardanicobut it seems a little bit overengineered IMO :)
20:45:42FromDiscord<Yardanico> @Yardanico reply test to IRC
20:45:52FromDiscord<Yardanico> #announcements channel test
20:46:31disruptekZevv: http://ix.io/2ts7/c
20:46:44opiYardanico: weh, reimplementing Markdown with it quirks has to be a PITA
20:46:56Yardanicobut not enough PITA to use doubly-linked lists?: )
20:47:37Zevvdisruptek: amazing
20:49:05FromDiscord<Clyybber> Yardanisco: Wait, you are still using ircord? not dimscord?
20:49:11FromDiscord<Yardanico> ??????????
20:49:15FromDiscord<Yardanico> ircord is the name of my bridge lol
20:49:25FromDiscord<Yardanico> https://github.com/Yardanico/ircord/
20:49:29opiYardanico: Dunno, I'd probably try to use regexp, fail at it, then iterate char by char and try to hammer parsing into a christmas tree of case…of
20:49:59disruptekZevv: my testes cannot be mangled, though.
20:50:04disruptekprobably for the best.
20:50:34Zevvand all those colon objects
20:53:23disrupteknext we need a pull that substitutes unique emojis instead of type ids.
20:53:29*maier joined #nim
20:55:08Yardanicodisruptek: now your disbot will have it's formatting (more or less) correctly displayed on discord
20:55:13Yardanicowithout the fancy colors though
20:55:20Yardanicozoomer discord doesn't even have color support smh
20:55:31FromDiscord<Elegant Beef> I mean discord is shit, so yes
20:56:37FromDiscord<Elegant Beef> Discord still doesnt have a proper reply system which is absurd
20:56:49FromDiscord<Yardanico> yeah I had to parse it manually
20:56:52FromDiscord<Yardanico> so it doesn't look ugly on IRC
20:56:58FromDiscord<Yardanico> @Yardanico 123123
20:57:03FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/741037139151552533/unknown.png
20:57:05FromDiscord<Yardanico> yeah I just strip it
20:57:40FromDiscord<Elegant Beef> Like it annoys me to no end that discord lacks features, considering there is the API for it, dont show message links just rerender the message there and add text after it
20:59:01*maier quit (Ping timeout: 264 seconds)
21:02:22FromDiscord<Elegant Beef> I have been thinking about trying to make a p2p voice chat to embed into element as a alternative to jitsi, for a channel based voip solution, but no clue the feasibillity of it
21:05:03disruptekyou're telling me that discord can't handle irc's 40yo "color technology"?
21:05:09Yardanicoyes
21:05:12Yardanicothey use "markdown"
21:05:30disruptekis color a security risk or something?
21:05:33FromDiscord<Clyybber> @Yardanico oh eh, braim was afk
21:05:37Yardanico?
21:06:00FromDiscord<Clyybber> brain
21:06:13FromDiscord<Elegant Beef> Nah disruptek you might abuse colour font to insult people using light mode
21:06:38disruptekdo we have a neckbeard emoji yet?
21:06:49FromDiscord<Clyybber> the workaround is to abuse code block highlughting but its rarted
21:07:29FromDiscord<Elegant Beef> Yea we do, it's called disruptek
21:09:31FromDiscord<--HA--> sent a code paste, see https://play.nim-lang.org/#ix=2tsj
21:09:35FromDiscord<Clyybber> :disruptek:
21:09:53disruptek🏀⚽ my left ball is bigger than my right ball.
21:10:03*dulsi_ joined #nim
21:10:22FromDiscord<Yardanico> @--HA-- because you're capturing the url 🙂
21:10:59FromDiscord<Yardanico> in the callback you should read from the future itself
21:11:00FromDiscord<Yardanico> (edit) "in the callback you should read from the future itself ... " added "usually"
21:11:15disruptekthat looks good.
21:11:53FromDiscord<Yardanico> @--HA-- in your case something like this will work:
21:11:57FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2tsk
21:12:00FromDiscord<Yardanico> but I'd suggest you to not do that 😛
21:12:02disruptek(edit) should be recolored and maybe the the quote should simply be italicized.
21:12:09Yardanicohm
21:12:10disruptekjust to irritate zevv.
21:12:50*dulsi quit (Ping timeout: 260 seconds)
21:12:57disruptekZevv: btw, should we remove _stdlib_ in the mangle?
21:13:37disruptekit's there for correctness. 🤷
21:17:08*solitudesf quit (Ping timeout: 246 seconds)
21:18:08FromDiscord<--HA--> @Yardanico Thank you. I was not aware of capture. This is a minimal example, I read from the future in the real code. But I also would like to have some additional values in the callback, like the url. So I can write the content returned from the url into a file with a fitting filename. What would be the way to do that if not with capture.
21:18:44FromDiscord<Yardanico> store it in the object
21:18:51FromDiscord<Yardanico> you can encapsulate any type in the future
21:22:01FromDiscord<--HA--> getContent returns a Future[String]. I don't know how I would change that without changing the proc. Or maybe I don't understand what you mean.
21:23:56FromDiscord<Yardanico> you would write your own proc which would add a callback for that getContent procedure to complete your own future
21:24:00FromDiscord<Yardanico> or just restructure your code 😛
21:25:23FromDiscord<Yardanico> also you know you can just write your own async procs?
21:26:11FromDiscord<Yardanico> ah btw
21:26:17FromDiscord<Yardanico> in your code you also didn't handle error checking
21:26:26FromDiscord<Yardanico> I mean something like:
21:26:32FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2tsn
21:26:42FromDiscord<Yardanico> all 3 urls will be fetched asynchronously
21:27:01*Vladar quit (Quit: Leaving)
21:27:36FromDiscord<--HA--> I knew about async procs but apparently I'm having trouble putting it together. That looks exactly what I need!
21:27:52disruptekyou're in good company.
21:27:57disrupteki cannot figure that shit out, either.
21:28:12FromDiscord<--HA--> Coming from other programming languages I was expecting to have a closure "automatically". What is the issue with that by the way, why do you not recommend it?
21:28:14FromDiscord<Yardanico> also yeah, -d:ssl because most websites nowadays redirect from http to https
21:28:31FromDiscord<Yardanico> @--HA-- it was a "closure" automatically, it just captured the loop variable
21:28:34FromDiscord<Yardanico> not it's state
21:28:36FromDiscord<Yardanico> the variable itself
21:28:46FromDiscord<Yardanico> so all 3 callbacks used the last state of the loop variable
21:28:51FromDiscord<Yardanico> which was firefox.com
21:29:13FromDiscord<Yardanico> a closure is basically a pointer to the environment (with all captured variables) and the procedure itself
21:29:31*stefantalpalaru quit (Ping timeout: 244 seconds)
21:29:44FromDiscord<Yardanico> I mean you can use that first style, but I would prefer the asyncCheck one since IMO it's cleaner 🙂
21:29:58disruptekasyncCheck is for chumps.
21:30:02FromDiscord<Yardanico> it uses closure iterators under the hood anyway (nim async is based on closure iterators)
21:30:18*stefantalpalaru joined #nim
21:36:00FromDiscord<--HA--> Yes I quite like your asyncCheck version now that I see it. Thanks for the explanations.
21:36:44YardanicoasyncCheck basically only does the minimum stuff
21:36:58Yardanico"starts" the future and sets a callback to raise an exception if future completed with an error
21:37:11Yardanicoin your code you didn't handle exceptions
21:37:24disruptekand asyncCheck makes that even more challenging.
21:37:25YardanicoFuture can either complete (and contain the result) or fail
21:37:34Yardanicodisruptek: i'm still waiting for my {.cpsAsync.} :P
21:37:46disruptekwell, grow a pair and get your hands dirty.
21:37:58disruptekit's not like it doesn't work.
21:38:21disruptekdon't tell people to use asyncCheck, please.
21:38:33Yardanicowell, that's an okay thing to use
21:38:35Yardanicowith _current_ nim async
21:38:39disruptekit causes code to raise in the dispatcher, which means they are basically fucked as far as catching it.
21:38:48disruptekyou can check for errors instead.
21:38:51Yardanicohttps://nim-lang.org/docs/asyncdispatch.html#discarding-futures
21:39:07disrupteki'll deliver the lectures aroun' here.
21:39:12disruptekyou just take notes.
21:39:33Yardanicooh shoot im sleepy
21:42:13Yardanicohope you don't break the bridge too much while im asleep
21:42:15Yardanicogn
21:42:19disruptekpeace
21:42:24FromDiscord<--HA--> good night
21:45:06FromDiscord<Clyybber> gn
21:45:25FromDiscord<Clyybber> disruptek: damn bro mine too, guess we are ball bros now
21:51:56*Jjp137 quit (Ping timeout: 256 seconds)
21:55:31disruptekclyybber: i thought you fixed that tmplate().tmplate() thing.
21:55:56*dulsi_ is now known as dulsi
21:58:02disruptekhttp://ix.io/2tsy/nim
21:58:20*Jjp137 joined #nim
22:00:28*Zectbumo quit (Remote host closed the connection)
22:01:50*stefantalpalaru quit (Changing host)
22:01:50*stefantalpalaru joined #nim
22:02:20*tane quit (Quit: Leaving)
22:23:28FromDiscord<Clyybber> nah, the pr is not finished
22:27:21*Trustable quit (Remote host closed the connection)
22:30:18*opi quit (Quit: Leaving)
22:38:57*krux02 quit (Remote host closed the connection)
22:54:21*maier joined #nim
22:59:37*maier quit (Ping timeout: 264 seconds)
23:28:33disruptekbummer.
23:35:21disruptekvan morrison can kiss my ass.
23:40:11*oddp quit (Ping timeout: 240 seconds)
23:45:50*abm quit (Read error: Connection reset by peer)
23:46:45disrupteki need leorize.
23:51:23disruptekor someone that knows something about cpp symbol signatures.