<< 26-03-2020 >>

00:06:11*gangstacat quit (Ping timeout: 246 seconds)
00:06:30FromDiscord<KingDarBoja> The kind field plus case switch doesn't work as I wanted the "type" prop of "AnotherType" to be either "ChildTypeA" or "ChildTypeB"
00:06:46FromDiscord<KingDarBoja> https://play.nim-lang.org/#ix=2fhP
00:08:34*dadada quit (Ping timeout: 240 seconds)
00:42:49FromDiscord<KingDarBoja> I found the answer at some post -> https://forum.nim-lang.org/t/4406#27516
00:50:23*gangstacat joined #nim
00:54:30FromGitter<alehander92> Yardanico !
00:54:39FromGitter<alehander92> so basically
00:54:51FromGitter<alehander92> krux02's gdb script works good in vscode
00:56:00FromGitter<alehander92> you just need to test: tables and seq are shown correctly even inline after they have values, problem is if its on top level , then variables are mangled and you see those results, so please try to debug your code in functions
00:56:41*couven92 quit (Quit: Client Disconnecting)
01:04:29*dwdv quit (Ping timeout: 265 seconds)
01:07:42*zahary quit (Quit: Leaving.)
01:08:03*zahary joined #nim
01:08:29*zahary quit (Client Quit)
01:27:11FromDiscord<KingDarBoja> Well, I tried both approach from the above link on the nim forum but the "sum types" does not let me redefine the same variable for several cases while the inheritance approach does.
01:27:45FromGitter<zetashift> yeah I had that too, I ended up renaming stuff
01:27:49FromDiscord<KingDarBoja> I will get "Error: attempt to redefine: 'myTypeVar'"
01:28:48FromDiscord<KingDarBoja> Really zetashift? There is no way to use the sum types approach (case kind) with the same variables for some cases?
01:29:03leorizeit's a known limitation
01:29:18FromDiscord<KingDarBoja> Oh god!
01:32:05leorizethe issue was brought up for quite sometime
01:32:14leorizethen just die out because no one cared enough :P
01:32:46leorizehttps://github.com/nim-lang/RFCs/issues/19
01:32:46disbotAllow usage of the same attribute name in different branches within variant types
01:33:06FromDiscord<KingDarBoja> Well looks like this GraphQL Port from JS is going to take a while, need to think about how to handle AST
01:34:08FromDiscord<KingDarBoja> I will stick with inheritance approach as it seems to work for me
01:35:12FromGitter<zetashift> oh from that issue
01:35:16FromGitter<zetashift> you might be able to use https://github.com/andreaferretti/patty#constructing-variant-objects
01:35:46FromGitter<zetashift> nope nvm has the same issue
01:35:54FromDiscord<KingDarBoja> https://github.com/nim-lang/RFCs/issues/19#issuecomment-173529871 I love this suggestion
01:35:56disbotAllow usage of the same attribute name in different branches within variant types
01:36:05FromDiscord<KingDarBoja> Which I tried and ofc doesn't work
02:07:23*ksandvik joined #nim
02:07:52*ksandvik quit (Client Quit)
02:11:55*ksandvik joined #nim
02:12:45*ksandvik quit (Client Quit)
02:13:09*ksandvik joined #nim
02:13:32*ksandvik quit (Client Quit)
02:34:14*chemist69 quit (Ping timeout: 246 seconds)
02:36:23*chemist69 joined #nim
02:51:40FromGitter<Knaque> I'm trying to make a little CLI tool for myself, and the easiest way of doing what I'd like is through SSH. Is there a good module for this? / Does Nim support SSH on its own?
02:53:17disruptekthere's an async ssh lib iirc.
02:53:23disruptek!repo ssh
02:53:25disbothttps://github.com/treeform/ssh -- 9ssh: 11Connect to machines over SSH and run commands there from nim. 15 4⭐ 1🍴 7& 6 more...
02:54:24FromGitter<Knaque> Treeform saves the day yet again. Thanks Disruptek.
02:55:39*zacharycarter quit (Ping timeout: 265 seconds)
02:58:09disrupteksure, let us know what you make.
03:17:43*endragor joined #nim
03:28:16axionIs it normal that a single unittest module/suite with 50 empty tests (using skip or discard) takes 20 seconds to compile on a modern machine? I'd hate to see what this scales to when I port all ~1000 tests
03:29:00disrupteksounds slow to me.
03:29:34disruptekdoes skip omit codegen at ct?
03:30:18axiondoesnt matter if i use skip or discard. and I literally have 50 empty `test: discard` within a single suite in 1 file
03:30:39disruptekweird.
03:30:54axionI had double that and improved it significantly by removing half, but still seems slow to me
03:32:38disruptekremoving half improved it significantly?
03:32:50axionyeah
03:34:50disrupteki would expandMacros and throw some timestamps in there. seems nuts that unittest would take much time at all to compile that.
03:35:08axionit just pauses at CC: test_foo.nim for about 20s
03:35:20axionand `top` shows it is compiling something like crazy
03:35:36disruptekopenapi generates >1000 loc/s on a 140,000loc file.
03:36:16disruptekthat's obviously c compilation. if you're importing your module, all the nim goes into one file.
03:37:13*rockcavera quit (Remote host closed the connection)
03:38:03axionremoving my import shaves of a couple seconds. not much
03:39:31disruptekhow many lines is the c file?
03:41:35axionabout 20k
03:42:13disruptekmy guess is that it's some sorta anomaly with empty tests.
03:44:10disruptekbump's small test suite is like 15 tests and 50 checks and produces only 3k lines. takes 1.2s to build the tests and indeed the whole project from scratch.
03:45:04disruptekoh nevermind, i'm using a nutty compiler.
03:45:13axionwell i'm not too worried. it's only a hassle when iteratively writing tests. when it's done, it's not very often i'll be running the tests in such rapid succession
03:45:16disruptekor, i might be. but still.
03:47:10axiondecided to switch to unittests because my runnableExamples were distracting from the actual code with like 90% of the file not actually code :)
03:47:32disruptekyeah, i expect it's some sorta edge case. i'd switch to compiling real tests.
03:52:25*muffindrake quit (Ping timeout: 240 seconds)
03:55:00*muffindrake joined #nim
04:26:03*NimBot joined #nim
04:28:50*ksandvik joined #nim
04:33:53*ksandvik quit (Quit: Leaving.)
04:35:09*catmind joined #nim
04:35:30*catmind left #nim (#nim)
04:37:03*CatMind joined #nim
04:39:06*CatMind left #nim (#nim)
04:39:13*CatMind joined #nim
04:44:58*waleee-cl quit (Quit: Connection closed for inactivity)
04:46:55*nsf joined #nim
04:56:12*CatMind quit (Quit: Leaving.)
04:56:43*ksandvik joined #nim
04:57:41*ksandvik left #nim (#nim)
04:57:48*ksandvik joined #nim
04:58:33*ksandvik left #nim (#nim)
04:59:05*ksandvik joined #nim
05:00:19*ksandvik quit (Client Quit)
05:15:13*gangstacat quit (Ping timeout: 272 seconds)
05:28:12*dddddd quit (Remote host closed the connection)
05:32:57FromGitter<Knaque> Getting the following runtime error: `kernel32: cannot open shared object file: No such file or directory`. I honestly have no idea what to do about this, or where it's even coming from.
05:34:35FromGitter<Knaque> No, wait, it looks like it's a winlean thing. I'm gonna try to see if I can just cut out the need for that module, but if anyone has a better solution, let me know.
05:39:42*gangstacat joined #nim
05:43:03FromDiscord<Recruit_main707> You probably don't have .dll in your PATHEXT variable
05:44:09FromGitter<Knaque> The funny thing is, though, I'm on Linux.
05:45:35FromDiscord<Recruit_main707> But winlean is for Windows
05:45:59FromGitter<Knaque> Yes, I know. I'm using Treeform's ssh module, which imports winlean.
05:46:52FromDiscord<Recruit_main707> You can substitute the types used by their primitives
05:50:52FromGitter<Knaque> Well, I just got rid of `import winlean` and replaced it with `import os`, leaving only one proc that doesn't *seem* to serve any purpose, so I've just cut that out and am going to see if it works now.
05:52:51FromGitter<Knaque> Well, different error, so that's something. Seems to me like the ssh module is built pretty exclusively for Windows, at least based on my interpretation of this error message.
05:53:06FromGitter<Knaque> `Error: unhandled exception: Additional info: "Could not find command: \'ssh\'. OS error: No such file or directory" [OSError]`
05:54:09FromGitter<Knaque> As someone who knows nothing about anything, my best guess is that it's just using a different command syntax that doesn't work properly on Unix.
05:54:29FromDiscord<Rika> why would you need the ssh in nim if you already have the actual ssh comand
05:54:30FromDiscord<Rika> command
05:56:19FromGitter<Knaque> I'm trying to use ssh to automate some stuff on another device.
05:56:54FromDiscord<Rika> i see
05:57:04FromGitter<Knaque> So, instead of having so ssh into the other device, run the commands, `exit`, then finish the process on the client, you just run one command and it does the whole thing.
05:57:59*narimiran joined #nim
06:08:57*rnrwashere joined #nim
06:46:15FromGitter<sheerluck> @Knaque sounds like http://www.fabfile.org
06:50:49*solitudesf joined #nim
07:04:47*gmpreussner joined #nim
07:05:40FromDiscord<Benumbed> Question... how would y'all go about implementing a dispatch table which has the same proc argument(s) but the return type is different (however the return types do have the same parent object type)
07:08:08FromDiscord<Benumbed> What I have so far: `type methodMap* = Table[int, Table[int, proc (meth: AMQPMethod): ref AMQPMethod]]` Where AMQPMethod is the base type of all return types
07:08:28FromDiscord<Benumbed> (yes, nested tables :/)
07:08:54*rnrwashere quit (Remote host closed the connection)
07:09:23*rnrwashere joined #nim
07:19:22*rnrwashere quit (Remote host closed the connection)
07:19:47FromDiscord<Rika> is there an issue with your current implementation
07:20:34FromDiscord<Benumbed> If I try to map methods to IDs in the table, I get type errors
07:21:50FromDiscord<Benumbed> Basically, the methods will create something like `AMQPConnectionStart` which is a object that inherits from `AMQPMethod` and then I don't know how to pass a reference to that data back through that procedural type
07:22:16FromDiscord<Benumbed> because the return values are technically different types, despite having the same base type
07:22:43FromDiscord<Rika> can you make `AMQPMethod` into a `ref object of RootObj` instead of what it is now, then remove the `ref` in the proc return? or does it need to be non-ref?
07:23:07FromDiscord<Benumbed> it is a ref of RootObj
07:23:13FromDiscord<Benumbed> (see inheritence)
07:23:23FromDiscord<Rika> so its a double ref on the return type
07:23:33FromDiscord<Benumbed> *thinks*
07:23:52FromDiscord<Rika> also you can have an `object of RootObj` afaik
07:23:54FromDiscord<Benumbed> Hmm yeah, it's technically a ref type
07:23:54FromDiscord<Rika> and itll work
07:23:58FromDiscord<Benumbed> Still getting used to that
07:24:04FromDiscord<Rika> so it ***is*** a double
07:24:09FromDiscord<Rika> double ref*
07:24:56FromDiscord<Benumbed> yeah, refs still get me a bit turned around
07:25:17FromDiscord<Benumbed> Doesn't help that every time I'm trying to write Nim it's right before bed haha
07:25:18*rnrwashere joined #nim
07:26:34FromDiscord<Benumbed> Also trying not to climb walls from the COVID lockdown... not a great time to be learning a new language
07:29:45FromDiscord<Rika> dont double ref its useless haha
07:29:56FromDiscord<Rika> well, very specific use case needed for double ref
07:31:23*rnrwashere quit (Remote host closed the connection)
07:31:36FromDiscord<Benumbed> Oh I know, I didn't realize I was double reffing
07:32:54*rnrwashere joined #nim
08:06:25*zyklon quit (*.net *.split)
08:06:25*jwm224 quit (*.net *.split)
08:06:26*vqrs quit (*.net *.split)
08:06:26*k0mpjut0r quit (*.net *.split)
08:06:26*sz0 quit (*.net *.split)
08:06:26*nikita` quit (*.net *.split)
08:06:51*zyklon joined #nim
08:06:53*jwm224 joined #nim
08:06:57*vqrs joined #nim
08:07:01*nikita` joined #nim
08:07:10*nikita` quit (Changing host)
08:07:10*nikita` joined #nim
08:07:44*sz0 joined #nim
08:07:57*sleepyqt joined #nim
08:09:06*k0mpjut0r joined #nim
08:09:10*jjido joined #nim
08:11:40*defection joined #nim
08:13:44*PMunch joined #nim
08:21:02*dadada joined #nim
08:21:25*dadada is now known as Guest15251
08:31:17*natrys joined #nim
08:37:41FromDiscord<Varriount> @𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭 You could always join disruptek's Mumble server and chat
08:38:49FromDiscord<Varriount> I've become completely unmoored from my usual sleep cycle. It's 4 in the morning right now
08:39:42FromDiscord<Benumbed> I don't even have a mic on my dev box haha
08:40:35FromDiscord<Benumbed> If my questions aren't a good fit this this channel, pls let me know though, I'm still new here and figuring out where the lines are drawn 🙂
08:40:48FromDiscord<Varriount> Nah, they're fine.
08:41:02FromDiscord<Varriount> I'm just bored.
08:41:16FromDiscord<Benumbed> haha ok
08:59:05*xet7 quit (Read error: Connection reset by peer)
08:59:41*xet7 joined #nim
09:04:50*rnrwashere quit (Remote host closed the connection)
09:07:12*dwdv joined #nim
09:16:36*Asgaroth_ joined #nim
09:17:09*Guest15251 is now known as dadada
09:24:45*Vladar joined #nim
09:27:52*sleepyqt quit (Quit: Leaving)
09:36:03*sleepyqt joined #nim
09:40:22*clyybber joined #nim
10:04:08clyybberAraq: Hey, ok to merge #13741 ?
10:04:09disbothttps://github.com/nim-lang/Nim/pull/13741 -- 3Fix vm.nim for --gc:arc
10:16:54Araqtoo risky for 1.2
10:17:00Araqbut apart from that it's fine
10:19:00clyybberk
10:24:57clyybberAraq: Regarding scope based destruction, do you think it'd be a good idea to try branch based destruction? The advantage would be that we could eliminate much more wasMoved; destroy pairs, but the disadvantage would be that its a bit more oblivious to the user
10:29:56Araqsounds worth it, it's what Rust does
10:30:41clyybberoh, I wasn't aware
10:30:44clyybbernice!
10:33:17federico3any way to escape HTML/XML in a string?
10:38:00*liblq-dev joined #nim
10:45:09FromGitter<matrixbot> `gphykos` federico3: ⏎ `r"yourstring"`
10:45:25FromGitter<matrixbot> `gphykos` That should work
10:45:56federico3??
10:52:41FromGitter<matrixbot> `gphykos` That is a so called raw string
10:52:58FromGitter<matrixbot> `gphykos` It doesn't allow any escape
10:53:21federico3I'm asking for a proc that escapes or removes HTML from a string
10:53:43PMunchIs this a bit much? "FromGitter> <matrixbot> `gphykos`"
10:54:02FromGitter<matrixbot> `gphykos` Uhh Idk then, that is an hard thing to do
10:54:40PMunchEscapes or removes?
10:55:17federico3either - removes would be even preferred
10:56:07PMunchHmm, xmltree has en "escape" procedure
10:57:05FromDiscord<Recruit_main707> deleting all the keywords of html?
10:57:54PMunchTo remove all the tags (but keeping their contents) I guess you'd have to use parsexml: https://nim-lang.org/docs/parsexml.html and get all the charData nodes
11:03:25*filcuc joined #nim
11:04:21*leorize quit (Remote host closed the connection)
11:04:21*opal quit (Remote host closed the connection)
11:04:50federico3the stdlib should really provide sanitization procs
11:04:58narimiran@gphykos you can connect to irc directly via matrix, no need for gitter-middleman
11:05:20*leorize joined #nim
11:06:47*opal joined #nim
11:08:09*filcuc quit (Remote host closed the connection)
11:11:51PMunchUgh, one more reason to not like Windows. I'm debugging an issue on a Windows machine. And to download the VM I use for testing is a solid 17Gb..
11:12:15PMunchI'm pretty sure my entire Linux distro with everything I've got installed is smaller than that..
11:24:21liblq-dev@gphykos please join the channel #freenode_#nim:matrix.org on matrix, thanks in advance
11:24:42liblq-devbecause right now you go through 3 bridges (matrix→gitter→IRC)
11:24:49liblq-devand it makes your messages hard to read
11:33:28*silvernode joined #nim
11:34:14silvernodeWhat is the most simple way to write a 2 dimensional array in Nim? I find a lot of examples that I think could be simplified.
11:35:51*defection quit (Quit: defection)
11:35:55*krux02 joined #nim
11:37:33FromGitter<sheerluck> silvernode maybe https://github.com/unicredit/neo (I didn't try it myself)
11:38:04FromDiscord<Recruit_main707> as a type: `array[m, array[n, int]]`
11:38:38FromDiscord<Recruit_main707> (without initialising it) ^
11:40:22FromDiscord<flywind> import sequtils;newSeqWith(5, newSeq[int](3))
11:40:23silvernodeI just want to initialize it at the beginning of the program and use it throughout the entire program
11:41:07dadadaAraq commented that we apparently want cmake integration in Nim https://github.com/nim-lang/RFCs/issues/185#issuecomment-585140925
11:41:08disbotdeprecate macros.expectLen, expectKind, expectMinLen in favor of something generic or doAssert ; snippet at 12https://play.nim-lang.org/#ix=2bqJ
11:42:10dadadacan someone explain to me why this is a good idea? I didn't particularly like cmake when I had to use it, and if there's really a need for something like that I'd go with something more modern and pleasant like mesonbuild
11:44:16FromDiscord<Recruit_main707> silvernode, then what i told you will work
11:45:46*Kaivo joined #nim
11:50:06dadadaPMunch: did you start to work on the expectIfgracefulfailingfeature? I might give it another shot now, and send a patch your way.
11:50:40Araqdadada, cmake is a common build tool, doesn't imply the Python 2 vs 3 fiasco, doesn't depends on the JVM and is of a medium size
11:51:11Araqthe point is more general better integration with other build tools though
11:51:12PMunchdadada, nah I went to bed. And so far today I've been struggling to make my home PC run a VM so I can debug some stupid Windows-only bug..
11:59:15dadadaAraq: I'm not saying it's cmake is bad, but it's usability is pales in comparison to mesonbuild, I used both, thankfully the python2v3 fiasco is nearing its end with python2 not being supported any longer and python3 being used almost universally now, I see python in the same light as perl, only that python surpassed it, ..., and mesonbuild is a nice DSL that could be implemented in any language, it's just
11:59:21dadadathat they chose python because today there's practically no developer who doesn't run it any in some form, I'm also not arguing against offering cmake support, but as you may have figured out I'm a fan of mesonbuild since the day I've used it and therefore I think we should support it, too.
11:59:43dadada-1 s/it's//
12:01:34dadadas/should support/might want to
12:03:29dadadaPMunch: what do you use for your VM? KVM?
12:03:40PMunchVirtualBox
12:03:51dadadamay I ask why not kvm?
12:05:12PMunchFirst time I needed a VM I probably Googled "howto vm" and it was on the top of the list. I haven't had any major complaints seeing how I only use it as a last resort, so I've never had a reason to look for something else
12:06:04dadadathen what's the problem you're having with running the VM?
12:07:21*endragor quit (Remote host closed the connection)
12:07:32PMunchMy disk is full
12:07:37PMunchAnd my RAM is struggling
12:09:04PMunchSo probably nothing switching to KVM would fix :P
12:09:13PMunchUnless it can download more RAM for me
12:09:51dadadalol, using VMs was a motivation for me to get more RAM, and it was a good choice :P
12:11:39*rockcavera joined #nim
12:15:17dadadaPMunch: as for disk space, if I'm in dire need for space I sometimes go as far as doing ugly stuff like rm -rf /usr/share/doc , none of the stuff there should be essential , and if you need sth for some reason, you can simply reinstall their packages from your distribution , there's also a cache for package downloads depending on your distribution that can grow into multiple GB, there're lots of small tricks
12:15:23dadadalike that that can add up to a lot, maybe I should publish a script that contains my best tricks for freeing disk space
12:16:36*dddddd joined #nim
12:17:58*lritter joined #nim
12:19:16PMunchOh trust me, that package cache is already trimmed :P
12:19:44PMunchI'm now copying some (completely legal) movies and shows off to an external drive, that frees up a nice chunk of space :)
12:24:17*leorize quit (Remote host closed the connection)
12:24:47*leorize joined #nim
12:26:28liblq-devPMunch: how much RAM do you have in your machine?
12:26:39liblq-devalso it's possible to thin down windows to only the basic features
12:26:49PMunch8..
12:26:50liblq-devalso use windows 7 because it's way lighter
12:26:59liblq-devoof
12:27:00PMunchI have to test on 10..
12:27:05liblq-devwhy though?
12:27:10PMunchYeah, this is an old machine..
12:27:13liblq-devis there any software that requires windows 10?
12:27:24PMunchLast upgraded while I was a student, on a tight budget
12:27:36PMunchWell it's our main deploy target..
12:27:50liblq-devhmm
12:28:08liblq-devhave you tried https://github.com/Sycnex/Windows10Debloater?
12:28:51PMunchNope..
12:28:57PMunchI haven't had a need for this until today
12:29:15PMunchMy machine at work could probably run this entire machine with the VM running in a VM..
12:29:17liblq-devyou can also do some messing around to see if you can remove the windows store, defender, and other crap that noone with common sense needs
12:29:36PMunchWell, if I remove those then it's not really our deploy target any longer..
12:29:52PMunchWhat if it works because I removed defender for example
12:29:52liblq-devit is, as long as you're not using those services
12:29:56liblq-devoof
12:29:58liblq-devwell
12:30:06liblq-devyou have a point
12:30:26liblq-devif you remove those it's almost like microsoft's new way of testing windows 10, how ironic.
12:30:48leorize[m]well use windows 10 ltsc
12:30:53leorize[m]you can't get it "legally" but that doesn't really matter
12:31:33PMunchIt's not that big of an issue though.. I just moved some files to an external drive and now it runs fine
12:31:55PMunch*he said, just as the entire machine froze*
12:36:36FromGitter<alehander92> PMunch do you need help
12:37:00PMunchNot with this VM issue
12:37:22FromDiscord<kodkuce> win sux
12:37:22FromGitter<alehander92> ok
12:37:26FromGitter<alehander92> i need some help
12:37:30FromGitter<alehander92> with some async ideas:
12:38:24FromGitter<alehander92> so i am fixing a nim-gdb library (its a part of a proprietary project, so not sure if i'll open source it: its just not very robust yet :D)
12:39:11*dsrw joined #nim
12:42:04FromGitter<alehander92> i need to make sure each async "action" of it is run serially
12:42:47FromGitter<alehander92> as gdb itself needs to run them serially (well .. it can do the queueing itself..)
12:42:58FromGitter<alehander92> so probably i need to have an internal lock in the lib
12:43:37*dsrw quit (Ping timeout: 258 seconds)
12:44:39FromGitter<alehander92> and a queue: but then basically there is the question: and all of this
12:44:43FromGitter<alehander92> seems like a common async pattern
12:45:01FromGitter<alehander92> so i wonder if this should be something that uses an standartized interface/lib or not
12:46:19PMunchUhm, that doesn't make much sense
12:46:23PMunchYou want to use async
12:46:26PMunchBut run them serially
12:46:29FromGitter<alehander92> yes yes
12:46:33FromGitter<alehander92> well it does make sense
12:46:43FromGitter<alehander92> because i still might wait a lot for each action
12:46:46*endragor joined #nim
12:46:55FromGitter<alehander92> and want to be able to let the main program does stuff in this time
12:47:07FromGitter<alehander92> especially if it talks with several gdb processes in the same time
12:49:17FromGitter<alehander92> so e.g.`await gdb.next()` in `a` and then `await gdb.exec..` in `b` which interleave
12:50:01FromGitter<alehander92> the second one should check like `await asyncQueue.push_or_run("exec .. ")`
12:50:42FromGitter<alehander92> where `asyncQueue` waits for each successive command and runs the next async call only after it
12:51:13*endragor quit (Ping timeout: 264 seconds)
12:51:44FromGitter<alehander92> do we have something like this "queue" thing standardly
12:53:09PMunchWell you can do that with async callbacks
12:53:13PMunchAnd a deque
12:53:24PMunchdequeue?
12:53:29FromGitter<alehander92> hm, why a deque
12:53:42PMunchJust to have a queue
12:54:02FromGitter<alehander92> hm yeah and just do the `push_or_run`
12:54:05FromGitter<alehander92> but i dont imagine callbacks
12:54:14FromGitter<alehander92> but more like a queue of `Future`-s
12:54:24FromGitter<alehander92> and `input commands`
12:54:30PMunchErm
12:54:37FromGitter<alehander92> i'll write it down
12:55:01PMunchWhat you want is a queue of things to run, and when you run something you attach a callback that runs the next thing
12:58:07FromGitter<alehander92> hmm, i imagine
13:01:03*tane joined #nim
13:01:27*drewr quit (Ping timeout: 260 seconds)
13:08:36*endragor joined #nim
13:15:21*drewr joined #nim
13:16:07liblq-dev@kodkuce well it's not our fault that it pretty much owns the market…
13:16:55PMunchI'm doing my best to convert people to Linux :P
13:17:54dadadawhy is $setting echoing false inside submac in? It's true, when inside a proc. https://play.nim-lang.org/#ix=2fyC
13:18:02dadada-in
13:18:08clyybberAraq: Does DrNim prove assinging or passimg range parameters yet?
13:19:32FromGitter<alehander92> PMunch
13:19:35clyybberdadada: Thats a bug I think
13:19:41FromGitter<alehander92> i wonder whats the difference with callbacks and futures
13:20:04PMunchHuh?
13:20:25PMunchOh, well a Future can have a callback
13:20:30dadadaclyybber: oh man...
13:20:32PMunchThat's what I meant
13:20:33FromGitter<alehander92> yeah yeah
13:20:39FromGitter<alehander92> but what i mean is that i just use complete
13:20:41FromGitter<alehander92> isnt that simpler
13:20:48PMunchcomplete?
13:20:56*nsf quit (Quit: WeeChat 2.7)
13:21:05FromGitter<alehander92> i'll show it
13:21:24dadadaclyybber: thanks for looking at it ... any idea how to get around this bug
13:22:36clyybberNope :/
13:22:56clyybberIMO this change that {.compileTime.} vars are accessible at runtime should really be reverted
13:23:25clyybberit's not directly related to this bug, but I wouldn't be surprised if it is in some subtle way
13:23:31*endragor quit (Remote host closed the connection)
13:23:48Araqclyybber, yeah it does (DrNim)
13:24:43FromGitter<alehander92> hm, so if i want to an additional thing:
13:24:54FromGitter<deech> I had a PR that tried to address that a while ago where compile time vars have to be assigned to a const before accesssing at runtime but it was rejected.
13:25:15dadadadeech: why was it rejected?
13:25:20leorizethat's just a workaround
13:25:33leorizeit should be accessible in runtime without having to do all that
13:25:54leorizebut then due to how the compiler is architectured, you can't without exposing a heap of bugs
13:25:58FromGitter<alehander92> `await CancellableAction[T].pushOrCall()` # where this calls a long async function but it checks constantly if a new "task" has arrived
13:26:18FromGitter<alehander92> and cancels/returns early from the previous one, does this work only with a token
13:26:38FromGitter<deech> I don't see it as a workaround. It makes reasoning about communication between stages a lot easier.
13:26:48clyybberAraq: Nice!
13:26:53FromGitter<alehander92> like, i imagine i'd want my internal async function to constantly check manually if its being cancelled, but maybe one can just insert "checkIfCancelled()" after each await with a pragma?
13:27:15Araqclyybber, dadada every 'macro' gets a fresh set of .global vars or something like that is going on
13:27:33clyybberHuh
13:28:10clyybberAraq: So not related: Was the {.compiletime.} vars being accessible at runtime in 1.0 ?
13:28:48*jjido quit (Quit: Connection closed for inactivity)
13:28:50Araqdeech: iirc it wasn't rejected but progress has stalled because I don't know a good solution
13:29:22clyybberI think the best solution is to make compileTime vars only accessible at compileTime and use const as a bridge between the stages
13:29:30shashlickAraq what do you mean by cmake integration
13:29:35dadadait doesn't help to define the submacro inside the macro, same result https://play.nim-lang.org/#ix=2fyI ... don't know what else to try
13:29:49FromGitter<deech> clyybber, that's exactly what the PR did!
13:29:50shashlickBuild Nim with cmake?
13:30:19clyybberdeech: Yeah, I know \o Its the best way IMO
13:30:37*endragor joined #nim
13:30:40leorizeisn't koch our "universal" build system? :P
13:30:53clyybberdadada: Other than waiting for a fix.. maybe passing setting as an arg to your other macro if you can
13:31:12Araqshashlick, teach cmake about projects written in Nim that produce C code "over there"
13:31:19silvernodetrying to create a grid in one shot: https://play.nim-lang.org/#ix=2fyJ
13:31:24Araqthat is to be compiled too
13:31:32dadadaclyybber: well, I thought about it, but I tried to avoid it, hence the global/compileTime var :D
13:31:57FromGitter<deech> idk, *maybe* a compromise for now is to add that restriction only to compile time `var`s only.
13:32:53clyybberdeech: Can you rebase your PR?
13:33:16Araqmy ideal is basically: CT code mutates global vars, the final state of the global vars is avaiable at runtime as the initial value
13:33:16shashlickHmm I don't get it - building Nim projects is so easy - do you mean being able to build the generated C files without Nim
13:33:18FromGitter<deech> I also don't like the compiler tries to evaluate runtime function arguments at compile time.
13:33:24PMunchsilvernode: https://play.nim-lang.org/#ix=2fyL
13:33:45Araqshashlick, I mean so that you can add some code written in Nim more easily to an existing C/C++ project
13:33:59FromGitter<deech> clyybber, I can try. It's like 6 months old or something now.
13:34:26dadadaclyybber: since macros can call external commands, I could read/write the setting to the linux clipboard, ..., although that'd be too ugly to ship
13:34:28leorizeAraq: so kinda like Pascal's const-but-not-really idea?
13:34:35clyybberdeech: nice, thank you
13:35:05leorizesome context: https://freepascal.org/docs-html/current/prog/progsu42.html#x49-480001.2.42
13:35:06clyybberAraq: Yeah, that makes sense, but I think its best to make it explicit, so to use consts as bridges
13:35:15Araqleorize, yes but by now I noticed it's the viewpoint of a minority. anyhow writing an RFC first how this all should work
13:35:27Araqwould be appreciated.
13:35:52silvernodethank you PMunch
13:36:02PMunchNo problem
13:37:09Araqproc r(x: Natural) = echo x
13:37:10Araqproc sum(a: openArray[int]) =
13:37:10Araq if a.len >= 4:
13:37:10Araq let chunk = a.len div 4
13:37:10Araq r chunk
13:37:26Araqnice huh? it understands that chunk >= 0
13:37:42clyybbernice
13:37:55PMunchnice
13:38:06*endragor quit (Remote host closed the connection)
13:40:07clyybberdeech: Hmm, thinking a bit more about it, we already "promote" static values to runtime when needed.
13:40:23dadadanice
13:40:25clyybberSo I'm not sure if prohibiting passing {.compileTime.} vars to runtime functions makes sense
13:40:51clyybberSince we could just work around it by doing `f(static: someCompileTimeVar)`
13:41:21leorizefun fact, static expressions are still unimplemented
13:41:21*dwdv quit (Read error: Connection reset by peer)
13:41:28*waleee-cl joined #nim
13:41:36FromGitter<deech> How is that different from `const x = someCompileTimeVar; f x`?
13:41:47FromGitter<alehander92> hey
13:42:05clyybberleorize: Oh
13:42:12clyybberdeech: It isn't
13:42:31FromGitter<alehander92> what's the best way to `await` when in not `{.async.}` (i construct a future and return it directly): i had a workaround i think but what's the idiomatic thing
13:42:45leorizeclyybber: the kind of static you're using is implemented I think, but the static(expr) form is not, even though it's in the manual
13:42:49clyybberBut it makes sense to do it automatically I guess. Since I can just do `f(1)` too
13:42:58clyybberleorize: Ah okay
13:43:01FromGitter<deech> Not worth adding complication to the compiler to save typing IMO.
13:43:28leorize@alehander92: wdym?
13:43:35leorizewaitFor?
13:43:39FromGitter<alehander92> no no no
13:43:57clyybberdeech: Its already doing that. I just think that maybe its more consistent this way
13:44:01FromGitter<alehander92> https://gist.github.com/alehander92/09d1698dd615794f0450e3cdaa9fb8c1
13:44:34dadadaI think the result of this testcase is really interesting https://play.nim-lang.org/#ix=2fyR so if you set the setting to true a second time in the submac (first time is in demo), then it will have the correct value in submac2 (so it will be true)
13:44:40FromGitter<alehander92> i guess `futureToBeAwaited() and future`
13:44:46FromGitter<alehander92> might work
13:46:05leorizedadada: it's probably due to order of evaluation
13:46:27*dwdv joined #nim
13:46:27leorizethe two inner macro call must expands before the outer can evaluate
13:46:51Araqah leorize's explanation makes more sense :-)
13:47:02Araqtrue macro calls are expanded before any code runs
13:47:11dadadayeah, that makes total sense
13:47:26FromGitter<alehander92> this is the reason we can't do `return` in `{.async.}` from templates right?
13:47:33clyybberdeech: The "inconsistency" I see is that `f(1)` would work, but `var c {.compileTime.} = 1; f(c)` would not. But its not that much of a consistency as the literal 1 is much closer to a const rather than to a compileTime var
13:49:10dadadawell, great I think I have a workaround now :-) will you even fix this, or this the official but not well documented behaviour?
13:49:12FromGitter<Clyybber> s/consistency/inconsistency
13:51:05leorizedadada: I will assume that it's the official behavior :P
13:51:07dadadahere is my finale testcase that shows the situation, https://play.nim-lang.org/#ix=2fyV ... I only added a submac3 that's not embedded in demo to prove that it works in that case too
13:51:50leorizejust change those inner macros into procs :)
13:52:57dadadaI'm beginning to feel like nimmer now that I know quirks like that
13:53:03dadadaa nimmer
13:53:43PMunchA nimrod
13:54:54PMunchdadada, is this what you expect to happen: https://play.nim-lang.org/#ix=2fyX
13:55:00FromGitter<alehander92> noo just a programmer
13:55:19FromGitter<alehander92> otherwise i had to just return await futureObject from `{.async.}` !
13:55:51leorizealehander92: I believe you can't await from a proc :)
13:56:08leorizeawait assumes that you're using a closure iterator
13:56:22leorizesince that's the only way for it to resume the function
13:57:18leorizewaitFor/asyncCheck is the only way to do it from a regular function
13:57:44FromGitter<deech> clyybber, I also agree with what araq said that the runtime should only ever see the final version of any compile time artifact but that would require re-engineering the compiler.
13:58:32dadadaPMunch: I also tried to solve it using static, but then another behaviour popped up, that I didn't intend/want, see this https://play.nim-lang.org/#ix=2fyX in demo2 (running before demo, bad naming, I know) I want setting to be false, yet due to static, it already is true!
13:58:45FromGitter<alehander92> leorize yes
13:58:46FromGitter<alehander92> sorry
13:59:05FromGitter<alehander92> i meant that i turned it to async and then you can return a normal future object
13:59:12dadadaPMunch: sorry , wrong link https://play.nim-lang.org/#ix=2fyY
13:59:12PMunchdadada, wrong link?
13:59:16dadadayeeah
13:59:20dadadathe other one works
14:00:27FromGitter<Clyybber> @deech Not sure if it really does, maybe a deferCompileTimeEvaluation magic is enough
14:00:36FromGitter<Clyybber> Obviously with some better name :D
14:00:53PMunchHuh, that is strange indeed
14:03:46dadadaPMunch: I want setting to be true from the point where the line appears and forward, not backward, the only solution that works is to use a submacro and let it do the setting for me, so I'll do just that, it's not even that ugly :-)
14:05:23FromGitter<Clyybber> @deech What do you think about this: compileTime vars are treated like literals/consts with their current value if inserted into runtime expressions. For delayed evaluation we provide the aforementioned deferCompileTimeEval magic
14:05:54FromGitter<Clyybber> And let {.compileTime.} should probably be purged as it doesn't really serve a purpose
14:08:20*zacharycarter joined #nim
14:08:54FromGitter<deech> @Clyybber But "current value" has no meaning when compile/runtime are strictly separate stages.
14:09:15FromGitter<Clyybber> It has, by current value I mean current value during compile time
14:09:35FromGitter<Clyybber> And to get the value that it will have at the end of the compilation stage you would use deferCompileTimeEval
14:09:54FromGitter<deech> What is a use case for the former?
14:10:52*endragor joined #nim
14:11:30dadadaI never particularly liked the length of the {.compileTime.} macro, compileTime is the time when nim is running, the nimTime, so to speak, as clyybber said let {.compileTime.} is a bit superflous, we also have const, so we could theoretically introduce a new keyword that replaces var myVar {.compileTime.} = true ... with ...: nim myVar = true <- the logic that variables declared with nim, are always
14:11:36dadadavar and always only run on compileTime, this would enable a clear distinction and also be more concise code. Even though it's my idea I'm too not 100% sold on this and I'm not a long time nimrodist, so you may as well dismiss it.
14:12:46leorizeit's not a macro btw
14:13:29FromGitter<deech> araq, is there a way to see how 'arc' is tracking ownership?
14:14:46FromGitter<Clyybber> @deech This for example `echo "before some static calc", a; static: a += someCompileTimeCalculation; echo "after", a`
14:16:10FromGitter<awr1> does NLVM still work?
14:16:35FromGitter<deech> How is that different from `static: echo "before"; static: a += ...; static: echo "after"; a`?
14:16:48leorizeawr1: yes, though it tracks stable versions instead of development
14:16:56FromGitter<awr1> hm
14:17:14FromGitter<awr1> it would be awesome if NLVM had mcJIT support
14:17:30FromGitter<Clyybber> @deech The echos would happen at runtime
14:29:39*cornfeedhobo quit (Ping timeout: 240 seconds)
14:29:47*MightyJoe quit (Read error: Connection reset by peer)
14:31:17*cyraxjoe joined #nim
14:35:43*endragor quit (Remote host closed the connection)
14:35:54silvernodeFinally created what I wanted partially thanks to PMunch https://play.nim-lang.org/#ix=2fzk
14:36:27silvernodeI am sure there are much easier ways to do it, but my brain works the way I wrote it
14:37:34silvernodeended up needing to not initialize the seq right away so I went back to the previous method
14:41:38clyybbersilvernode: Here it is, but blursed: https://play.nim-lang.org/#ix=2fzp
14:45:22Araqdeech: there is 'koch temp -d:toDebug=interestingProc --gc:arc temp.nim'
14:45:37Araqit outputs the transformed Nim code and the CFG
14:46:36*endragor joined #nim
14:50:36*endragor quit (Read error: Connection reset by peer)
14:51:03*endragor joined #nim
14:51:16*endragor quit (Remote host closed the connection)
14:51:55*natrys quit (Quit: natrys)
14:53:27*cornfeedhobo joined #nim
14:54:06silvernodeclyybber: trying to understand your version, I understand most of it, but I didn't know there was a keyword 'inc'
14:54:22leorizeit's not a keyword
14:54:26leorizeit's a function
14:54:33dadadawell, the workaround for setting a global compile time var inside macros works even less well than I thought, in sub macros of sub macros it gets lost again ... frustration
14:54:35silvernodeleorize: right
14:54:38dadadais building up
14:54:40dadada:-)
14:55:15Araqdadada, no need for workarounds, use .compileTime procs inside macros and not macros inside macros
14:55:20clyybbersilvernode: Oh its just the same as x += 1
14:56:27*dsrw joined #nim
14:56:33dadadaAraq: I'm working on PMunch's code and I did want to write a minimally invasive patch, so when he's using a macro inside a macro, I didn't want to rewrite his whole code
14:56:47silvernodeclyybber: I thought so, and I imagine the inc function has all the iteration and loops going on inside of it?
14:57:07clyybbersilvernode: Nope
14:57:35silvernodetrying to figure out what makes it continue iterating
14:57:46clyybbersilvernode: Its relying on the fact that newSeqWith is a template that will evaluate its second argument N times
14:57:57clyybberwhere N is the first arg of newSeqWith
14:58:36clyybberIt is like that so that you can do `newSeqWith(n, rand())` and have a seq with random data
14:58:46silvernodeclyybber: so it's all part of newSeqWith?
15:00:08clyybberyeah
15:00:29liblq-devshashlick: you here?
15:00:40silvernodeclyybber: this makes so much sense now although pretty obscure when you don't know about it
15:00:53clyybberyeah, I just did it for fun
15:00:58clyybberits not really readable
15:01:34silvernodeclyybber: I still think it's neat though
15:03:03clyybbersilvernode: This is faster: https://play.nim-lang.org/#ix=2fzy
15:03:56dadadahas anyone developed a simple compiletime/macrotime key-value-store/database that could be used as an alternative in situations such as the one I'm in to not have to deal with the limitations of global compile time variables in macros? While it might seem like overkill for dealing with the value of a single variable, I also do have bigger macros in mind that would need to store more
15:04:10leorizedadada: a table?
15:05:10dadadaleorize: wouldn't a table have the same issues? it would allow me to store key-value pairs, but wouldn't they also disappear in submacros and so forth?
15:05:24leorizedon't do submacros tbh
15:05:55leorizeif someone is using submacro, well force it to not be one
15:06:02dadadaagain, I'm working on someone else's code, I didn't put the submacros in there, all I want is to add a feature
15:06:58leorizedue to how macros work, it's not possible...
15:07:06leorizebetter rework the code instead
15:07:21clyybberCouldn't it be made possible?
15:07:47clyybberdadada: For now use compile time procs instead
15:07:59dadadahmm, seems a strange answer to simply give up macros inside macros because of one compiler limitation, I'd rather remove this limitation, btw. it's definitely possible, since macros can call external commands, one could read/write from an ini file or the like to pass on values
15:08:13leorizecompile time procs can do that too
15:09:24leorizecompile time procs can do literally anything that a macro can do :P
15:09:48clyybberyeah, so the reverse should be possible too
15:09:54clyybberright?
15:10:20dadadaI believe you, though my instinct is that I want to remove limitations, because why not?
15:11:01leorizewell I think the limitation is unavoidable
15:11:27leorizethe inner macros have to evaluate or else you can't get the AST needed to run the outer
15:11:47clyybberCouldn't we delay the evaluation?
15:12:44leorizewouldn't that open the doors for incorrectly typed calls?
15:13:01shashlickliblq-dev - here
15:13:14clyybberI mean delay until we actually come across the macro "call"
15:13:30Araqdadada, PMunch's code is an exception
15:13:40Araqwhere it makes sense to use macros inside macros
15:14:40leorizeclyybber: so imagine something like this:
15:14:46liblq-devshashlick: I think I found a bug with getHeader and `nim check`. when I try to run the command on a wrapper it tries to build the library from scratch, no matter the defines
15:14:54dadadahmm, I also used macros inside macros a few times (btw. mostly without any issues), so even if it is an exception, it's not a rare exception
15:15:11liblq-devshashlick: see http://ix.io/2fzG
15:18:06leorizeclyybber: https://play.nim-lang.org/#ix=2fzJ
15:19:36shashlickhow are you checking that it doesn't use the cache
15:20:42clyybberleorize: I'd say thats a good thing :D, as its consistent with https://play.nim-lang.org/#ix=2fzM
15:20:54clyybberwith templates and compileTime procs
15:21:16shashlickalso did you patch build.nim for that - issue
15:24:03clyybberAraq: FYI my vm.nim pr has been merged, but by cooldome, I don't think he was aware that you wanted to delay it after 1.2
15:24:10clyybbers/after/until after
15:26:33clyybberI think its fine tho, in my limited experience any breakage there is pretty obvious/catched by the CI and the tests because it breaks literally everything :D
15:26:36liblq-devshashlick: yea, I patched build.nim
15:26:44liblq-devand I don't know if it uses the cache or not
15:26:51liblq-devbut I built the file once with nim c
15:26:55*Jjp137 quit (Ping timeout: 258 seconds)
15:27:12shashlickokay for whatever reason, it is not finding the header
15:30:35shashlickwhat is the library so name
15:31:42shashlickokay had to add altnames = "wayland-server"
15:34:03Araqclyybber, ok
15:35:44FromGitter<alehander92> https://gist.github.com/alehander92/f456c84c745b59c6e8a0b1e267840376/
15:35:51FromGitter<alehander92> leorize PMunch
15:35:58PMunchHuh?
15:36:32FromGitter<alehander92> this is the thing i wanted to do
15:36:34FromGitter<alehander92> back then
15:36:38FromGitter<alehander92> with the queue + futures
15:37:07FromGitter<alehander92> i only thing the `run` thing might look a bit hacky
15:37:16FromGitter<alehander92> but i didnt realize how people use callbacks
15:37:29PMunchYeah, that's what I wanted to avoid by using callbacks..
15:37:36FromGitter<alehander92> but i like it
15:37:41FromGitter<alehander92> are callbacks simpler
15:37:45Araqcan't figure out how Z3 bitvectors work
15:37:58AraqArgument ((_ int2bv 32) #x0000000a) at position 1 does not match declaration (declare-fun bvsle ((_ BitVec 64) (_ BitVec 64)) Bool)
15:38:24liblq-devshashlick: wayland-server.h, libwayland-server.so
15:38:29liblq-devas you'd expect
15:38:31PMunchWell callbacks would make it so that futures are automatically run one after the other
15:39:27FromGitter<alehander92> so you put the "new" future as a callback to the previous one
15:39:38FromGitter<alehander92> and `complete` is called before callbacks?
15:39:47FromGitter<alehander92> oh useful, i'd keep it in mind
15:39:57FromGitter<alehander92> i like manual queues :( :D
15:40:09FromDiscord<Prodigle> Is there a way to ignore a return variable from a function? would like to run it without having to store the return var
15:40:31Araqdiscard fun()
15:40:41FromDiscord<Prodigle> ty 🙂
15:41:35clyybberIs it still true that newSeqUninitialized only works for number types?
15:41:45clyybberI don't see a reason for that
15:43:16*PMunch quit (Quit: leaving)
15:43:20FromGitter<alehander92> Araq hm, why do you need z3 bitvectos
15:43:44Araqbecause unsigned numbers are really bitvectors
15:44:30FromGitter<alehander92> hm, ok
15:45:19shashlickliblq-dev - figured out the bug - when i get std header paths with gcc, it returns a non-zero return code so the data doesn't get cached
15:45:35shashlickso nim check doesn't work at all
15:45:38liblq-devoh crap
15:45:53liblq-devwhy does it return a non-0 exit code
15:45:55liblq-dev?
15:49:45clyybberOh, god clicking on githubs checklist checkers actually checks them
15:52:03*dadada quit (Ping timeout: 250 seconds)
16:02:21*dadada joined #nim
16:02:46*dadada is now known as Guest72037
16:04:59*dddddd quit (Remote host closed the connection)
16:10:49*Jjp137 joined #nim
16:12:23disruptek!last zevv
16:12:24disbotZevv spoke in 12#nim 18 hours ago
16:12:43*opal quit (Ping timeout: 240 seconds)
16:21:05clyybberAraq: Maybe cyclic groups? Afaik z3 has support for those
16:21:47clyybbers/groups/arithmetic, whatever the correct term is :p
16:25:41*Guest72037 is now known as dadada
16:25:50clyybberhmm, nevermind, bitvectors really are the right tool here
16:28:06Zevvdisruptek: oi, how's life
16:31:20dadadathis may be crazy talk, but could z3 be useful for step-by-step debugging? bear with me because I only know rudimentary things about it, but obviously it's able to figure out what happens inside procedures, so couldn't there be an introspective z3 mode, where you would set a breakpoint like marker, and then you could follow everything that happens in a procedure (or possibly even multiple procedures, but I
16:31:26dadadadon't know if it can do that) in a special z3 console, of course we have debuggers like gdb, but I just think it's fun to explore new alternatives
16:47:05*rnrwashere joined #nim
16:57:04*koltrast quit (Quit: ZNC - http://znc.in)
16:59:06*koltrast joined #nim
17:02:14*PMunch joined #nim
17:05:06*ksandvik joined #nim
17:06:50*ksandvik left #nim (#nim)
17:06:57*ksandvik joined #nim
17:08:23*ksandvik left #nim (#nim)
17:08:30*ksandvik joined #nim
17:10:18*rnrwashere quit (Remote host closed the connection)
17:10:36*rnrwashere joined #nim
17:13:32*xet7 quit (Read error: Connection reset by peer)
17:14:29*xet7 joined #nim
17:24:44*xet7 quit (Read error: Connection reset by peer)
17:25:15*xet7 joined #nim
17:33:33dadadawhat happened? why is it this quiet all of a sudden?
17:36:36livcduhmmm
17:36:41livcddrinking time!
17:36:54ksandvik1.20 is not yet out, right?
17:37:21narimiranksandvik: right
17:37:53dadadaksandvik: https://github.com/nim-lang/Nim/releases this is where I look for releases
17:37:59dadadadon't know if there's a better place
17:38:59ksandvikReleases are not timed unlike some 'other' language platform I assume.
17:39:37*xet7 quit (Read error: Connection reset by peer)
17:48:12*xet7 joined #nim
17:55:44*sammich_ joined #nim
17:56:30*sammich_ quit (Client Quit)
17:59:01*xet7 quit (Ping timeout: 250 seconds)
18:04:52*sammich_ joined #nim
18:05:13*jjido joined #nim
18:09:46*sammich_ quit (Remote host closed the connection)
18:15:24axionIs there a way to have `nimble test` put the compiled code in the build dir without nimscript? It doesn't seem like it honors any flags at all, such as --outdir:build
18:20:20FromDiscord<Varriount> dadada: z3 is very mathematical. While it's possible to achieve that, ordinary conditions would be sufficient
18:21:23*rnrwashere quit (Remote host closed the connection)
18:21:58*rnrwashere joined #nim
18:21:59*rnrwashere quit (Read error: Connection reset by peer)
18:22:16*rnrwashere joined #nim
18:25:22*shadowbane quit (Quit: Konversation terminated!)
18:26:13FromGitter<alehander92> dadada hey, we are working on a sort of more "advanced" debugger environment in one project
18:27:11FromGitter<alehander92> hm, but as an example i'd give you a different, existing one actually : https://pernos.co/about/overview/ (by some previous rr developers)
18:27:33FromGitter<alehander92> are you imagining any of those flows , or something more like automatically detecting an issue
18:28:13FromGitter<alehander92> (sorry, giving you this context to help explain where i am coming from imagining possible step-by-step ideas)
18:28:22*shadowbane joined #nim
18:36:08*shadowbane quit (Remote host closed the connection)
18:39:45*shadowbane joined #nim
18:40:15*Trustable joined #nim
18:41:55rayman22201alehander92 what async madness are you doing? first of all, await works on any promise. If a function returns a promise, you can await it
18:42:49rayman22201and "await" multiple promises in sequence, causes them to run sequentially anyway
18:44:05*sagax quit (Read error: Connection reset by peer)
18:46:21axionanyone know? I'm trying to make run `nimble test` with a key binding in my editor that will work for any project without a project configuration
18:47:10*shadowbane quit (Quit: Konversation terminated!)
18:47:36*clyybber quit (Quit: WeeChat 2.7.1)
18:48:03*shadowbane joined #nim
18:48:13*Cthalupa quit (Ping timeout: 264 seconds)
18:48:16*Cthalupa- joined #nim
18:51:54FromGitter<alehander92> rayman22201
18:52:00FromGitter<alehander92> sorry :D
18:52:11FromGitter<alehander92> yes, i realized that
18:52:16FromGitter<alehander92> see the last link
18:52:30FromGitter<alehander92> it's not so simple
18:53:52FromGitter<alehander92> i wanted to be able to do `await myOp()` from various places in the same codebase (some might interleave) and ensure `execMI` called internally inside/explicitly is always only one at a time
18:54:12*shadowbane quit (Quit: Konversation terminated!)
18:54:38*shadowbane joined #nim
18:55:13FromGitter<alehander92> https://gist.github.com/alehander92/f456c84c745b59c6e8a0b1e267840376
18:55:46*shadowbane quit (Client Quit)
19:00:51rayman22201what is `execMI`? I don't see that in your gist?
19:01:23rayman22201it just looks like you are re-implementing what async event loop already does?
19:02:23FromGitter<alehander92> sorry
19:02:25FromGitter<alehander92> i explained it bad
19:02:35rayman22201why this line? `future.complete(await queue.handler(next))` Does the value of the current future need to be fed into the next one?
19:03:25FromGitter<alehander92> `execMI` was a function which does many things but it awaits a `write` to gdb and then later awaits one or more `reads` from it
19:03:33FromGitter<alehander92> so the problem is between those write and read
19:03:50FromGitter<alehander92> the event loop might run another function which calls again `execMI`
19:04:40FromGitter<alehander92> and it gets to `write` again before the previous command has finished (which might be like ok, because gdb is supposed to be able to deal with this, but i didnt want that)
19:05:07FromGitter<alehander92> so the point is that each next execMI actual logic should be called only after the previous one has finished
19:05:10rayman22201you have `await gdb_read; await gdb_write`and you want them to be atomic
19:05:17rayman22201?
19:05:36FromGitter<alehander92> the combination of them
19:05:56FromGitter<alehander92> i want only zero or one `execMI`to be executed at each time
19:06:49rayman22201the naive thing should just work.
19:06:53FromGitter<alehander92> i was generating an error before if execMI is busy
19:06:56FromGitter<alehander92> well it doesnt
19:07:01FromGitter<alehander92> i was getting into cases
19:07:22FromGitter<alehander92> where it was getting into that case that i described
19:07:40FromGitter<alehander92> so now i want if execMI is busy, to just wait for the previous ones and then for my op
19:07:45FromGitter<alehander92> and thats why the queue of futures
19:08:09FromGitter<alehander92> so i just call it `return await pushOrSend[(string, bool, bool), string](gdb.asyncQueue, (command, ret, isCommand))`
19:09:27*shadowbane joined #nim
19:09:46rayman22201some psuedocode, but this should work: https://play.nim-lang.org/#ix=2fAV
19:10:23disruptekcome scheme about nim coronavirus detecting badges for fosdem 2021.
19:10:26disruptek~stream
19:10:27disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
19:11:03FromGitter<alehander92> nope, you first call write, then you start awaiting reads .. and reads can take time so the event loop can call other stuff..
19:11:10rayman22201https://play.nim-lang.org/#ix=2fAW
19:11:25FromGitter<alehander92> but this is the simple case
19:11:34FromGitter<alehander92> execMI is called from various places all around the codebase
19:11:42FromGitter<alehander92> its not just a simple list in the same function
19:11:54rayman22201shouldn't matter
19:12:05FromGitter<alehander92> but i saw that it does :D
19:12:19rayman22201as long as you await it. It will not complete until all internal await complete
19:12:27*shadowbane quit (Client Quit)
19:12:47FromGitter<alehander92> but rayman, while one of those has yielded, from other place another execMI can be started
19:13:33rayman22201sure
19:13:46*rnrwashere quit (Remote host closed the connection)
19:15:19FromGitter<alehander92> so gdb_write .. gdb_read waiting yield => loop => another call => execMI => gdb_write => breaking invariant
19:15:32rayman22201ah ok. you need this: https://github.com/cheatfate/asynctools/blob/master/asynctools/asyncsync.nim#L60
19:16:00Araqer ... did Nim just bootstrap with --gc:arc?
19:16:15FromGitter<alehander92> hm, ok it seems like a similar thing
19:16:15*shadowbane joined #nim
19:16:16rayman22201🎉 awesome!
19:16:19FromGitter<alehander92> it uses a deque
19:16:38FromGitter<alehander92> ah ok he also creates an AsyncQueue
19:16:45rayman22201well yeah, but you don't need a queue
19:16:50rayman22201you just need the lock
19:17:16FromGitter<alehander92> but i can have 5 of them
19:17:27FromGitter<alehander92> i have to preserve somewhere the inputs/other waiting futures
19:17:58rayman22201the calling procs save it?
19:18:04FromGitter<alehander92> ah yeah i see what you're saying
19:18:05rayman22201they just wait until the the lock is free
19:18:17*ksandvik quit (Quit: Leaving.)
19:18:52FromGitter<alehander92> ok makes sense, thanks !!
19:18:57rayman22201👍
19:19:13FromGitter<alehander92> i still like my queue as it seems to work but i'll keep it in mind
19:19:38rayman22201well, your queue is basically a lock. As you can see, that's how locks are implemented.
19:20:01rayman22201just a matter of maintaining your own vs. relying on someone else.
19:20:41rayman22201cheatfate wrote chronos and was a big contributor to stdlib async, so I trust his code
19:21:36*rnrwashere joined #nim
19:22:12FromGitter<alehander92> you're right, sorry! but i still want to maintain this one for now as i can tweak it , its not so big
19:22:22FromGitter<alehander92> otherwise i use asynctools as well, so i know his good work :)
19:22:44rayman22201:-) cool
19:29:30*shadowbane quit (Remote host closed the connection)
19:34:40*Asgaroth joined #nim
19:35:46*rnrwashere quit (Remote host closed the connection)
19:36:57*Asgaroth_ quit (Ping timeout: 250 seconds)
19:38:15*rnrwashere joined #nim
19:51:48*dadada quit (Ping timeout: 258 seconds)
19:53:25*dadada joined #nim
19:53:48*dadada is now known as Guest58547
19:55:37*dsrw quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:59:50*dddddd joined #nim
19:59:55*narimiran quit (Ping timeout: 250 seconds)
20:03:30*jjido quit (Quit: Textual IRC Client: www.textualapp.com)
20:03:37*abm joined #nim
20:04:07*jjido joined #nim
20:08:33FromGitter<Lecale> Beginner question. I compiled my little nim snippet ok. When I run the executable I have "could not load: libcairo-2.dll" So I installed msys in order to get my hands on that dll, but every location I've tried to add it to hasn't cleared that message.
20:08:39*shadowbane joined #nim
20:09:54YardanicoYou should add that .dll either to any folder in your windows PATH, or to the same folder with the .exe
20:10:07Yardanicoalso check the bitness of the .dll, maybe you compiled for 64-bit but DLL is 32-bit, or vise-versa
20:10:11Yardanicoor that DLL depends on other DLLs too
20:11:11*shadowbane quit (Remote host closed the connection)
20:11:16FromGitter<Lecale> Same directory as the .exe fails :/ okay I will try the others too
20:11:33Yardanicowhat are the nimble libraries you've used in your snippet?
20:11:36Yardanicois it gintro by any chance?
20:11:38*shadowbane joined #nim
20:12:01FromGitter<Lecale> ggplotnim aack have to run. time up for today
20:15:26*xet7 joined #nim
20:15:55*ksandvik joined #nim
20:23:24*shadowbane quit (Remote host closed the connection)
20:26:30FromGitter<pmamatsis> Hi everyone!
20:26:51*shadowbane joined #nim
20:27:13*Guest58547 quit (Ping timeout: 250 seconds)
20:27:22Yardanicohi
20:27:40*NimBot joined #nim
20:32:25*dadada joined #nim
20:32:38*shadowbane quit (Remote host closed the connection)
20:32:49*dadada is now known as Guest28504
20:34:14*rnrwashere quit (Remote host closed the connection)
20:34:47*shadowbane joined #nim
20:34:47*rnrwashere joined #nim
20:39:49*rnrwashere quit (Ping timeout: 264 seconds)
20:47:54*shadowbane quit (Remote host closed the connection)
20:49:42*shadowbane joined #nim
20:49:59FromGitter<zetashift> hiya
20:52:09liblq-devhi
20:53:46*sagax joined #nim
20:55:41leorizesr.ht seems to be really buggy...
20:56:15*Guest28504 quit (Ping timeout: 250 seconds)
20:58:18FromGitter<zetashift> Well they do advertise it as alpha
21:02:28*dadada_ joined #nim
21:10:17*filcuc joined #nim
21:11:33*uvegbot joined #nim
21:13:26*zyklon quit (Ping timeout: 240 seconds)
21:14:08FromGitter<zetashift> Nim playground `latest` Nim version means Nim devel right?
21:16:27Yardanicocheck "echo NimVersion", it's just latest stable IIRC
21:18:26FromGitter<zetashift> ah yeah latest stable
21:18:35*rnrwashere joined #nim
21:21:53Yardanicogodbolt.org has nim trunk, but not sure how fast they update it
21:21:56Yardanicoit reports 1.1.1 as of now
21:25:52*dadada_ quit (Ping timeout: 265 seconds)
21:28:16*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:30:41*jjido joined #nim
21:31:21*dadada joined #nim
21:31:44*dadada is now known as Guest6183
21:31:51*liblq-dev quit (Ping timeout: 258 seconds)
21:33:35*liblq-dev joined #nim
21:33:56*lritter quit (Quit: Leaving)
21:41:49*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:43:02*ksandvik quit (Quit: Leaving.)
21:46:25*ksandvik joined #nim
21:53:34*filcuc quit (Ping timeout: 240 seconds)
22:02:08*silvernode quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
22:04:36*filcuc joined #nim
22:09:51*jjido joined #nim
22:15:16*abm quit (Quit: Leaving)
22:18:02*sleepyqt quit (Ping timeout: 256 seconds)
22:25:48euantorI've reported the broken freebsd builds.sr.ht builds, I believe the problem is an out of date pkg database. Hopefully it will be fixed soon
22:28:38leorizethey really have to host their own package server somewhere...
22:28:50leorizethis kind of downtime is not really welcoming
22:31:01euantorThat wouldn't help unfortunately. It's due to the unique way pkg works
22:31:29euantorThey could alter the steps so that freebsd runs a `pkg update` before installing, but that would be a bit wasteful
22:31:45euantorOr have a cron job update the image after running `pkg update` daily or something
22:33:03leorizewell it still have to get the packages somewhere, right?
22:33:21leorizethey can mirror the package server at a given point in time, then update it weekly or something
22:35:04euantorI suppose so
22:37:43euantorProbably easiest to have a caching proxy for packages, as they fetch over HTTP
22:38:05euantorI've never altered freebsd mirrors before, but it looks like it's super easy
22:39:23*solitudesf quit (Ping timeout: 250 seconds)
22:41:51*Zevv left #nim (#nim)
22:48:55*filcuc quit (Ping timeout: 250 seconds)
22:55:57*rnrwashere quit (Remote host closed the connection)
22:56:14*ksandvik quit (Quit: Leaving.)
22:56:50*Vladar quit (Quit: Leaving)
23:00:10*ksandvik joined #nim
23:02:32*dwdv quit (Ping timeout: 265 seconds)
23:04:23*rnrwashere joined #nim
23:04:32*rnrwashere quit (Client Quit)
23:11:50*liblq-dev quit (Quit: WeeChat 2.7.1)
23:12:35*tane quit (Quit: Leaving)
23:13:59*PMunch quit (Quit: leaving)
23:15:52*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:21:18*jjido joined #nim
23:21:43*dwdv joined #nim
23:28:22*dwdv quit (Ping timeout: 256 seconds)
23:32:57*dwdv joined #nim
23:37:45FromDiscord<KingDarBoja> How I can get the enum item from a Enum slice?
23:38:34FromDiscord<KingDarBoja> Like "let item = find($MyEnum, key)" leads to the integer value but I want the Enum value
23:40:55*Guest6183 quit (Ping timeout: 250 seconds)
23:41:10FromDiscord<KingDarBoja> MyEnum is a HSlice btw
23:41:24Yardanicoyou can convert numbers to enums
23:41:43Yardanicolet item = YourEnumType(find($MyEnum, key)) if I understood you correctly
23:43:13*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:47:01FromDiscord<KingDarBoja> Ah, it doesn't use the Enum HSlice but the original Enum I see
23:47:34*dadada joined #nim
23:47:58*dadada is now known as Guest13532
23:50:34*FromDiscord <KingDarBoja> gives a coin to yardanico
23:54:27*dwdv quit (Ping timeout: 256 seconds)