00:06:11 | * | gangstacat quit (Ping timeout: 246 seconds) |
00:06:30 | FromDiscord | <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:46 | FromDiscord | <KingDarBoja> https://play.nim-lang.org/#ix=2fhP |
00:08:34 | * | dadada quit (Ping timeout: 240 seconds) |
00:42:49 | FromDiscord | <KingDarBoja> I found the answer at some post -> https://forum.nim-lang.org/t/4406#27516 |
00:50:23 | * | gangstacat joined #nim |
00:54:30 | FromGitter | <alehander92> Yardanico ! |
00:54:39 | FromGitter | <alehander92> so basically |
00:54:51 | FromGitter | <alehander92> krux02's gdb script works good in vscode |
00:56:00 | FromGitter | <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:11 | FromDiscord | <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:45 | FromGitter | <zetashift> yeah I had that too, I ended up renaming stuff |
01:27:49 | FromDiscord | <KingDarBoja> I will get "Error: attempt to redefine: 'myTypeVar'" |
01:28:48 | FromDiscord | <KingDarBoja> Really zetashift? There is no way to use the sum types approach (case kind) with the same variables for some cases? |
01:29:03 | leorize | it's a known limitation |
01:29:18 | FromDiscord | <KingDarBoja> Oh god! |
01:32:05 | leorize | the issue was brought up for quite sometime |
01:32:14 | leorize | then just die out because no one cared enough :P |
01:32:46 | leorize | https://github.com/nim-lang/RFCs/issues/19 |
01:32:46 | disbot | ➥ Allow usage of the same attribute name in different branches within variant types |
01:33:06 | FromDiscord | <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:08 | FromDiscord | <KingDarBoja> I will stick with inheritance approach as it seems to work for me |
01:35:12 | FromGitter | <zetashift> oh from that issue |
01:35:16 | FromGitter | <zetashift> you might be able to use https://github.com/andreaferretti/patty#constructing-variant-objects |
01:35:46 | FromGitter | <zetashift> nope nvm has the same issue |
01:35:54 | FromDiscord | <KingDarBoja> https://github.com/nim-lang/RFCs/issues/19#issuecomment-173529871 I love this suggestion |
01:35:56 | disbot | ➥ Allow usage of the same attribute name in different branches within variant types |
01:36:05 | FromDiscord | <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:40 | FromGitter | <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:17 | disruptek | there's an async ssh lib iirc. |
02:53:23 | disruptek | !repo ssh |
02:53:25 | disbot | https://github.com/treeform/ssh -- 9ssh: 11Connect to machines over SSH and run commands there from nim. 15 4⭐ 1🍴 7& 6 more... |
02:54:24 | FromGitter | <Knaque> Treeform saves the day yet again. Thanks Disruptek. |
02:55:39 | * | zacharycarter quit (Ping timeout: 265 seconds) |
02:58:09 | disruptek | sure, let us know what you make. |
03:17:43 | * | endragor joined #nim |
03:28:16 | axion | Is 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:00 | disruptek | sounds slow to me. |
03:29:34 | disruptek | does skip omit codegen at ct? |
03:30:18 | axion | doesnt matter if i use skip or discard. and I literally have 50 empty `test: discard` within a single suite in 1 file |
03:30:39 | disruptek | weird. |
03:30:54 | axion | I had double that and improved it significantly by removing half, but still seems slow to me |
03:32:38 | disruptek | removing half improved it significantly? |
03:32:50 | axion | yeah |
03:34:50 | disruptek | i would expandMacros and throw some timestamps in there. seems nuts that unittest would take much time at all to compile that. |
03:35:08 | axion | it just pauses at CC: test_foo.nim for about 20s |
03:35:20 | axion | and `top` shows it is compiling something like crazy |
03:35:36 | disruptek | openapi generates >1000 loc/s on a 140,000loc file. |
03:36:16 | disruptek | that'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:03 | axion | removing my import shaves of a couple seconds. not much |
03:39:31 | disruptek | how many lines is the c file? |
03:41:35 | axion | about 20k |
03:42:13 | disruptek | my guess is that it's some sorta anomaly with empty tests. |
03:44:10 | disruptek | bump'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:04 | disruptek | oh nevermind, i'm using a nutty compiler. |
03:45:13 | axion | well 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:16 | disruptek | or, i might be. but still. |
03:47:10 | axion | decided to switch to unittests because my runnableExamples were distracting from the actual code with like 90% of the file not actually code :) |
03:47:32 | disruptek | yeah, 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:57 | FromGitter | <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:35 | FromGitter | <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:03 | FromDiscord | <Recruit_main707> You probably don't have .dll in your PATHEXT variable |
05:44:09 | FromGitter | <Knaque> The funny thing is, though, I'm on Linux. |
05:45:35 | FromDiscord | <Recruit_main707> But winlean is for Windows |
05:45:59 | FromGitter | <Knaque> Yes, I know. I'm using Treeform's ssh module, which imports winlean. |
05:46:52 | FromDiscord | <Recruit_main707> You can substitute the types used by their primitives |
05:50:52 | FromGitter | <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:51 | FromGitter | <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:06 | FromGitter | <Knaque> `Error: unhandled exception: Additional info: "Could not find command: \'ssh\'. OS error: No such file or directory" [OSError]` |
05:54:09 | FromGitter | <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:29 | FromDiscord | <Rika> why would you need the ssh in nim if you already have the actual ssh comand |
05:54:30 | FromDiscord | <Rika> command |
05:56:19 | FromGitter | <Knaque> I'm trying to use ssh to automate some stuff on another device. |
05:56:54 | FromDiscord | <Rika> i see |
05:57:04 | FromGitter | <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:15 | FromGitter | <sheerluck> @Knaque sounds like http://www.fabfile.org |
06:50:49 | * | solitudesf joined #nim |
07:04:47 | * | gmpreussner joined #nim |
07:05:40 | FromDiscord | <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:08 | FromDiscord | <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:28 | FromDiscord | <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:47 | FromDiscord | <Rika> is there an issue with your current implementation |
07:20:34 | FromDiscord | <Benumbed> If I try to map methods to IDs in the table, I get type errors |
07:21:50 | FromDiscord | <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:16 | FromDiscord | <Benumbed> because the return values are technically different types, despite having the same base type |
07:22:43 | FromDiscord | <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:07 | FromDiscord | <Benumbed> it is a ref of RootObj |
07:23:13 | FromDiscord | <Benumbed> (see inheritence) |
07:23:23 | FromDiscord | <Rika> so its a double ref on the return type |
07:23:33 | FromDiscord | <Benumbed> *thinks* |
07:23:52 | FromDiscord | <Rika> also you can have an `object of RootObj` afaik |
07:23:54 | FromDiscord | <Benumbed> Hmm yeah, it's technically a ref type |
07:23:54 | FromDiscord | <Rika> and itll work |
07:23:58 | FromDiscord | <Benumbed> Still getting used to that |
07:24:04 | FromDiscord | <Rika> so it ***is*** a double |
07:24:09 | FromDiscord | <Rika> double ref* |
07:24:56 | FromDiscord | <Benumbed> yeah, refs still get me a bit turned around |
07:25:17 | FromDiscord | <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:34 | FromDiscord | <Benumbed> Also trying not to climb walls from the COVID lockdown... not a great time to be learning a new language |
07:29:45 | FromDiscord | <Rika> dont double ref its useless haha |
07:29:56 | FromDiscord | <Rika> well, very specific use case needed for double ref |
07:31:23 | * | rnrwashere quit (Remote host closed the connection) |
07:31:36 | FromDiscord | <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:41 | FromDiscord | <Varriount> @𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭 You could always join disruptek's Mumble server and chat |
08:38:49 | FromDiscord | <Varriount> I've become completely unmoored from my usual sleep cycle. It's 4 in the morning right now |
08:39:42 | FromDiscord | <Benumbed> I don't even have a mic on my dev box haha |
08:40:35 | FromDiscord | <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:48 | FromDiscord | <Varriount> Nah, they're fine. |
08:41:02 | FromDiscord | <Varriount> I'm just bored. |
08:41:16 | FromDiscord | <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:08 | clyybber | Araq: Hey, ok to merge #13741 ? |
10:04:09 | disbot | https://github.com/nim-lang/Nim/pull/13741 -- 3Fix vm.nim for --gc:arc |
10:16:54 | Araq | too risky for 1.2 |
10:17:00 | Araq | but apart from that it's fine |
10:19:00 | clyybber | k |
10:24:57 | clyybber | Araq: 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:56 | Araq | sounds worth it, it's what Rust does |
10:30:41 | clyybber | oh, I wasn't aware |
10:30:44 | clyybber | nice! |
10:33:17 | federico3 | any way to escape HTML/XML in a string? |
10:38:00 | * | liblq-dev joined #nim |
10:45:09 | FromGitter | <matrixbot> `gphykos` federico3: ⏎ `r"yourstring"` |
10:45:25 | FromGitter | <matrixbot> `gphykos` That should work |
10:45:56 | federico3 | ?? |
10:52:41 | FromGitter | <matrixbot> `gphykos` That is a so called raw string |
10:52:58 | FromGitter | <matrixbot> `gphykos` It doesn't allow any escape |
10:53:21 | federico3 | I'm asking for a proc that escapes or removes HTML from a string |
10:53:43 | PMunch | Is this a bit much? "FromGitter> <matrixbot> `gphykos`" |
10:54:02 | FromGitter | <matrixbot> `gphykos` Uhh Idk then, that is an hard thing to do |
10:54:40 | PMunch | Escapes or removes? |
10:55:17 | federico3 | either - removes would be even preferred |
10:56:07 | PMunch | Hmm, xmltree has en "escape" procedure |
10:57:05 | FromDiscord | <Recruit_main707> deleting all the keywords of html? |
10:57:54 | PMunch | To 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:50 | federico3 | the stdlib should really provide sanitization procs |
11:04:58 | narimiran | @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:51 | PMunch | Ugh, 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:15 | PMunch | I'm pretty sure my entire Linux distro with everything I've got installed is smaller than that.. |
11:24:21 | liblq-dev | @gphykos please join the channel #freenode_#nim:matrix.org on matrix, thanks in advance |
11:24:42 | liblq-dev | because right now you go through 3 bridges (matrix→gitter→IRC) |
11:24:49 | liblq-dev | and it makes your messages hard to read |
11:33:28 | * | silvernode joined #nim |
11:34:14 | silvernode | What 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:33 | FromGitter | <sheerluck> silvernode maybe https://github.com/unicredit/neo (I didn't try it myself) |
11:38:04 | FromDiscord | <Recruit_main707> as a type: `array[m, array[n, int]]` |
11:38:38 | FromDiscord | <Recruit_main707> (without initialising it) ^ |
11:40:22 | FromDiscord | <flywind> import sequtils;newSeqWith(5, newSeq[int](3)) |
11:40:23 | silvernode | I just want to initialize it at the beginning of the program and use it throughout the entire program |
11:41:07 | dadada | Araq commented that we apparently want cmake integration in Nim https://github.com/nim-lang/RFCs/issues/185#issuecomment-585140925 |
11:41:08 | disbot | ➥ deprecate macros.expectLen, expectKind, expectMinLen in favor of something generic or doAssert ; snippet at 12https://play.nim-lang.org/#ix=2bqJ |
11:42:10 | dadada | can 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:16 | FromDiscord | <Recruit_main707> silvernode, then what i told you will work |
11:45:46 | * | Kaivo joined #nim |
11:50:06 | dadada | PMunch: did you start to work on the expectIfgracefulfailingfeature? I might give it another shot now, and send a patch your way. |
11:50:40 | Araq | dadada, 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:11 | Araq | the point is more general better integration with other build tools though |
11:51:12 | PMunch | dadada, 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:15 | dadada | Araq: 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:21 | dadada | that 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:43 | dadada | -1 s/it's// |
12:01:34 | dadada | s/should support/might want to |
12:03:29 | dadada | PMunch: what do you use for your VM? KVM? |
12:03:40 | PMunch | VirtualBox |
12:03:51 | dadada | may I ask why not kvm? |
12:05:12 | PMunch | First 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:04 | dadada | then what's the problem you're having with running the VM? |
12:07:21 | * | endragor quit (Remote host closed the connection) |
12:07:32 | PMunch | My disk is full |
12:07:37 | PMunch | And my RAM is struggling |
12:09:04 | PMunch | So probably nothing switching to KVM would fix :P |
12:09:13 | PMunch | Unless it can download more RAM for me |
12:09:51 | dadada | lol, 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:17 | dadada | PMunch: 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:23 | dadada | like 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:16 | PMunch | Oh trust me, that package cache is already trimmed :P |
12:19:44 | PMunch | I'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:28 | liblq-dev | PMunch: how much RAM do you have in your machine? |
12:26:39 | liblq-dev | also it's possible to thin down windows to only the basic features |
12:26:49 | PMunch | 8.. |
12:26:50 | liblq-dev | also use windows 7 because it's way lighter |
12:26:59 | liblq-dev | oof |
12:27:00 | PMunch | I have to test on 10.. |
12:27:05 | liblq-dev | why though? |
12:27:10 | PMunch | Yeah, this is an old machine.. |
12:27:13 | liblq-dev | is there any software that requires windows 10? |
12:27:24 | PMunch | Last upgraded while I was a student, on a tight budget |
12:27:36 | PMunch | Well it's our main deploy target.. |
12:27:50 | liblq-dev | hmm |
12:28:08 | liblq-dev | have you tried https://github.com/Sycnex/Windows10Debloater? |
12:28:51 | PMunch | Nope.. |
12:28:57 | PMunch | I haven't had a need for this until today |
12:29:15 | PMunch | My machine at work could probably run this entire machine with the VM running in a VM.. |
12:29:17 | liblq-dev | you 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:36 | PMunch | Well, if I remove those then it's not really our deploy target any longer.. |
12:29:52 | PMunch | What if it works because I removed defender for example |
12:29:52 | liblq-dev | it is, as long as you're not using those services |
12:29:56 | liblq-dev | oof |
12:29:58 | liblq-dev | well |
12:30:06 | liblq-dev | you have a point |
12:30:26 | liblq-dev | if you remove those it's almost like microsoft's new way of testing windows 10, how ironic. |
12:30:48 | leorize[m] | well use windows 10 ltsc |
12:30:53 | leorize[m] | you can't get it "legally" but that doesn't really matter |
12:31:33 | PMunch | It's not that big of an issue though.. I just moved some files to an external drive and now it runs fine |
12:31:55 | PMunch | *he said, just as the entire machine froze* |
12:36:36 | FromGitter | <alehander92> PMunch do you need help |
12:37:00 | PMunch | Not with this VM issue |
12:37:22 | FromDiscord | <kodkuce> win sux |
12:37:22 | FromGitter | <alehander92> ok |
12:37:26 | FromGitter | <alehander92> i need some help |
12:37:30 | FromGitter | <alehander92> with some async ideas: |
12:38:24 | FromGitter | <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:04 | FromGitter | <alehander92> i need to make sure each async "action" of it is run serially |
12:42:47 | FromGitter | <alehander92> as gdb itself needs to run them serially (well .. it can do the queueing itself..) |
12:42:58 | FromGitter | <alehander92> so probably i need to have an internal lock in the lib |
12:43:37 | * | dsrw quit (Ping timeout: 258 seconds) |
12:44:39 | FromGitter | <alehander92> and a queue: but then basically there is the question: and all of this |
12:44:43 | FromGitter | <alehander92> seems like a common async pattern |
12:45:01 | FromGitter | <alehander92> so i wonder if this should be something that uses an standartized interface/lib or not |
12:46:19 | PMunch | Uhm, that doesn't make much sense |
12:46:23 | PMunch | You want to use async |
12:46:26 | PMunch | But run them serially |
12:46:29 | FromGitter | <alehander92> yes yes |
12:46:33 | FromGitter | <alehander92> well it does make sense |
12:46:43 | FromGitter | <alehander92> because i still might wait a lot for each action |
12:46:46 | * | endragor joined #nim |
12:46:55 | FromGitter | <alehander92> and want to be able to let the main program does stuff in this time |
12:47:07 | FromGitter | <alehander92> especially if it talks with several gdb processes in the same time |
12:49:17 | FromGitter | <alehander92> so e.g.`await gdb.next()` in `a` and then `await gdb.exec..` in `b` which interleave |
12:50:01 | FromGitter | <alehander92> the second one should check like `await asyncQueue.push_or_run("exec .. ")` |
12:50:42 | FromGitter | <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:44 | FromGitter | <alehander92> do we have something like this "queue" thing standardly |
12:53:09 | PMunch | Well you can do that with async callbacks |
12:53:13 | PMunch | And a deque |
12:53:24 | PMunch | dequeue? |
12:53:29 | FromGitter | <alehander92> hm, why a deque |
12:53:42 | PMunch | Just to have a queue |
12:54:02 | FromGitter | <alehander92> hm yeah and just do the `push_or_run` |
12:54:05 | FromGitter | <alehander92> but i dont imagine callbacks |
12:54:14 | FromGitter | <alehander92> but more like a queue of `Future`-s |
12:54:24 | FromGitter | <alehander92> and `input commands` |
12:54:30 | PMunch | Erm |
12:54:37 | FromGitter | <alehander92> i'll write it down |
12:55:01 | PMunch | What 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:07 | FromGitter | <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:07 | liblq-dev | @kodkuce well it's not our fault that it pretty much owns the market… |
13:16:55 | PMunch | I'm doing my best to convert people to Linux :P |
13:17:54 | dadada | why is $setting echoing false inside submac in? It's true, when inside a proc. https://play.nim-lang.org/#ix=2fyC |
13:18:02 | dadada | -in |
13:18:08 | clyybber | Araq: Does DrNim prove assinging or passimg range parameters yet? |
13:19:32 | FromGitter | <alehander92> PMunch |
13:19:35 | clyybber | dadada: Thats a bug I think |
13:19:41 | FromGitter | <alehander92> i wonder whats the difference with callbacks and futures |
13:20:04 | PMunch | Huh? |
13:20:25 | PMunch | Oh, well a Future can have a callback |
13:20:30 | dadada | clyybber: oh man... |
13:20:32 | PMunch | That's what I meant |
13:20:33 | FromGitter | <alehander92> yeah yeah |
13:20:39 | FromGitter | <alehander92> but what i mean is that i just use complete |
13:20:41 | FromGitter | <alehander92> isnt that simpler |
13:20:48 | PMunch | complete? |
13:20:56 | * | nsf quit (Quit: WeeChat 2.7) |
13:21:05 | FromGitter | <alehander92> i'll show it |
13:21:24 | dadada | clyybber: thanks for looking at it ... any idea how to get around this bug |
13:22:36 | clyybber | Nope :/ |
13:22:56 | clyybber | IMO this change that {.compileTime.} vars are accessible at runtime should really be reverted |
13:23:25 | clyybber | it'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:48 | Araq | clyybber, yeah it does (DrNim) |
13:24:43 | FromGitter | <alehander92> hm, so if i want to an additional thing: |
13:24:54 | FromGitter | <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:15 | dadada | deech: why was it rejected? |
13:25:20 | leorize | that's just a workaround |
13:25:33 | leorize | it should be accessible in runtime without having to do all that |
13:25:54 | leorize | but then due to how the compiler is architectured, you can't without exposing a heap of bugs |
13:25:58 | FromGitter | <alehander92> `await CancellableAction[T].pushOrCall()` # where this calls a long async function but it checks constantly if a new "task" has arrived |
13:26:18 | FromGitter | <alehander92> and cancels/returns early from the previous one, does this work only with a token |
13:26:38 | FromGitter | <deech> I don't see it as a workaround. It makes reasoning about communication between stages a lot easier. |
13:26:48 | clyybber | Araq: Nice! |
13:26:53 | FromGitter | <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:15 | Araq | clyybber, dadada every 'macro' gets a fresh set of .global vars or something like that is going on |
13:27:33 | clyybber | Huh |
13:28:10 | clyybber | Araq: 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:50 | Araq | deech: iirc it wasn't rejected but progress has stalled because I don't know a good solution |
13:29:22 | clyybber | I think the best solution is to make compileTime vars only accessible at compileTime and use const as a bridge between the stages |
13:29:30 | shashlick | Araq what do you mean by cmake integration |
13:29:35 | dadada | it 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:49 | FromGitter | <deech> clyybber, that's exactly what the PR did! |
13:29:50 | shashlick | Build Nim with cmake? |
13:30:19 | clyybber | deech: Yeah, I know \o Its the best way IMO |
13:30:37 | * | endragor joined #nim |
13:30:40 | leorize | isn't koch our "universal" build system? :P |
13:30:53 | clyybber | dadada: Other than waiting for a fix.. maybe passing setting as an arg to your other macro if you can |
13:31:12 | Araq | shashlick, teach cmake about projects written in Nim that produce C code "over there" |
13:31:19 | silvernode | trying to create a grid in one shot: https://play.nim-lang.org/#ix=2fyJ |
13:31:24 | Araq | that is to be compiled too |
13:31:32 | dadada | clyybber: well, I thought about it, but I tried to avoid it, hence the global/compileTime var :D |
13:31:57 | FromGitter | <deech> idk, *maybe* a compromise for now is to add that restriction only to compile time `var`s only. |
13:32:53 | clyybber | deech: Can you rebase your PR? |
13:33:16 | Araq | my 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:16 | shashlick | Hmm 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:18 | FromGitter | <deech> I also don't like the compiler tries to evaluate runtime function arguments at compile time. |
13:33:24 | PMunch | silvernode: https://play.nim-lang.org/#ix=2fyL |
13:33:45 | Araq | shashlick, I mean so that you can add some code written in Nim more easily to an existing C/C++ project |
13:33:59 | FromGitter | <deech> clyybber, I can try. It's like 6 months old or something now. |
13:34:26 | dadada | clyybber: 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:28 | leorize | Araq: so kinda like Pascal's const-but-not-really idea? |
13:34:35 | clyybber | deech: nice, thank you |
13:35:05 | leorize | some context: https://freepascal.org/docs-html/current/prog/progsu42.html#x49-480001.2.42 |
13:35:06 | clyybber | Araq: Yeah, that makes sense, but I think its best to make it explicit, so to use consts as bridges |
13:35:15 | Araq | leorize, 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:27 | Araq | would be appreciated. |
13:35:52 | silvernode | thank you PMunch |
13:36:02 | PMunch | No problem |
13:37:09 | Araq | proc r(x: Natural) = echo x |
13:37:10 | Araq | proc sum(a: openArray[int]) = |
13:37:10 | Araq | if a.len >= 4: |
13:37:10 | Araq | let chunk = a.len div 4 |
13:37:10 | Araq | r chunk |
13:37:26 | Araq | nice huh? it understands that chunk >= 0 |
13:37:42 | clyybber | nice |
13:37:55 | PMunch | nice |
13:38:06 | * | endragor quit (Remote host closed the connection) |
13:40:07 | clyybber | deech: Hmm, thinking a bit more about it, we already "promote" static values to runtime when needed. |
13:40:23 | dadada | nice |
13:40:25 | clyybber | So I'm not sure if prohibiting passing {.compileTime.} vars to runtime functions makes sense |
13:40:51 | clyybber | Since we could just work around it by doing `f(static: someCompileTimeVar)` |
13:41:21 | leorize | fun 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:36 | FromGitter | <deech> How is that different from `const x = someCompileTimeVar; f x`? |
13:41:47 | FromGitter | <alehander92> hey |
13:42:05 | clyybber | leorize: Oh |
13:42:12 | clyybber | deech: It isn't |
13:42:31 | FromGitter | <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:45 | leorize | clyybber: 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:49 | clyybber | But it makes sense to do it automatically I guess. Since I can just do `f(1)` too |
13:42:58 | clyybber | leorize: Ah okay |
13:43:01 | FromGitter | <deech> Not worth adding complication to the compiler to save typing IMO. |
13:43:28 | leorize | @alehander92: wdym? |
13:43:35 | leorize | waitFor? |
13:43:39 | FromGitter | <alehander92> no no no |
13:43:57 | clyybber | deech: Its already doing that. I just think that maybe its more consistent this way |
13:44:01 | FromGitter | <alehander92> https://gist.github.com/alehander92/09d1698dd615794f0450e3cdaa9fb8c1 |
13:44:34 | dadada | I 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:40 | FromGitter | <alehander92> i guess `futureToBeAwaited() and future` |
13:44:46 | FromGitter | <alehander92> might work |
13:46:05 | leorize | dadada: it's probably due to order of evaluation |
13:46:27 | * | dwdv joined #nim |
13:46:27 | leorize | the two inner macro call must expands before the outer can evaluate |
13:46:51 | Araq | ah leorize's explanation makes more sense :-) |
13:47:02 | Araq | true macro calls are expanded before any code runs |
13:47:11 | dadada | yeah, that makes total sense |
13:47:26 | FromGitter | <alehander92> this is the reason we can't do `return` in `{.async.}` from templates right? |
13:47:33 | clyybber | deech: 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:10 | dadada | well, great I think I have a workaround now :-) will you even fix this, or this the official but not well documented behaviour? |
13:49:12 | FromGitter | <Clyybber> s/consistency/inconsistency |
13:51:05 | leorize | dadada: I will assume that it's the official behavior :P |
13:51:07 | dadada | here 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:50 | leorize | just change those inner macros into procs :) |
13:52:57 | dadada | I'm beginning to feel like nimmer now that I know quirks like that |
13:53:03 | dadada | a nimmer |
13:53:43 | PMunch | A nimrod |
13:54:54 | PMunch | dadada, is this what you expect to happen: https://play.nim-lang.org/#ix=2fyX |
13:55:00 | FromGitter | <alehander92> noo just a programmer |
13:55:19 | FromGitter | <alehander92> otherwise i had to just return await futureObject from `{.async.}` ! |
13:55:51 | leorize | alehander92: I believe you can't await from a proc :) |
13:56:08 | leorize | await assumes that you're using a closure iterator |
13:56:22 | leorize | since that's the only way for it to resume the function |
13:57:18 | leorize | waitFor/asyncCheck is the only way to do it from a regular function |
13:57:44 | FromGitter | <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:32 | dadada | PMunch: 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:45 | FromGitter | <alehander92> leorize yes |
13:58:46 | FromGitter | <alehander92> sorry |
13:59:05 | FromGitter | <alehander92> i meant that i turned it to async and then you can return a normal future object |
13:59:12 | dadada | PMunch: sorry , wrong link https://play.nim-lang.org/#ix=2fyY |
13:59:12 | PMunch | dadada, wrong link? |
13:59:16 | dadada | yeeah |
13:59:20 | dadada | the other one works |
14:00:27 | FromGitter | <Clyybber> @deech Not sure if it really does, maybe a deferCompileTimeEvaluation magic is enough |
14:00:36 | FromGitter | <Clyybber> Obviously with some better name :D |
14:00:53 | PMunch | Huh, that is strange indeed |
14:03:46 | dadada | PMunch: 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:23 | FromGitter | <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:54 | FromGitter | <Clyybber> And let {.compileTime.} should probably be purged as it doesn't really serve a purpose |
14:08:20 | * | zacharycarter joined #nim |
14:08:54 | FromGitter | <deech> @Clyybber But "current value" has no meaning when compile/runtime are strictly separate stages. |
14:09:15 | FromGitter | <Clyybber> It has, by current value I mean current value during compile time |
14:09:35 | FromGitter | <Clyybber> And to get the value that it will have at the end of the compilation stage you would use deferCompileTimeEval |
14:09:54 | FromGitter | <deech> What is a use case for the former? |
14:10:52 | * | endragor joined #nim |
14:11:30 | dadada | I 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:36 | dadada | var 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:46 | leorize | it's not a macro btw |
14:13:29 | FromGitter | <deech> araq, is there a way to see how 'arc' is tracking ownership? |
14:14:46 | FromGitter | <Clyybber> @deech This for example `echo "before some static calc", a; static: a += someCompileTimeCalculation; echo "after", a` |
14:16:10 | FromGitter | <awr1> does NLVM still work? |
14:16:35 | FromGitter | <deech> How is that different from `static: echo "before"; static: a += ...; static: echo "after"; a`? |
14:16:48 | leorize | awr1: yes, though it tracks stable versions instead of development |
14:16:56 | FromGitter | <awr1> hm |
14:17:14 | FromGitter | <awr1> it would be awesome if NLVM had mcJIT support |
14:17:30 | FromGitter | <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:54 | silvernode | Finally created what I wanted partially thanks to PMunch https://play.nim-lang.org/#ix=2fzk |
14:36:27 | silvernode | I am sure there are much easier ways to do it, but my brain works the way I wrote it |
14:37:34 | silvernode | ended up needing to not initialize the seq right away so I went back to the previous method |
14:41:38 | clyybber | silvernode: Here it is, but blursed: https://play.nim-lang.org/#ix=2fzp |
14:45:22 | Araq | deech: there is 'koch temp -d:toDebug=interestingProc --gc:arc temp.nim' |
14:45:37 | Araq | it 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:06 | silvernode | clyybber: trying to understand your version, I understand most of it, but I didn't know there was a keyword 'inc' |
14:54:22 | leorize | it's not a keyword |
14:54:26 | leorize | it's a function |
14:54:33 | dadada | well, 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:35 | silvernode | leorize: right |
14:54:38 | dadada | is building up |
14:54:40 | dadada | :-) |
14:55:15 | Araq | dadada, no need for workarounds, use .compileTime procs inside macros and not macros inside macros |
14:55:20 | clyybber | silvernode: Oh its just the same as x += 1 |
14:56:27 | * | dsrw joined #nim |
14:56:33 | dadada | Araq: 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:47 | silvernode | clyybber: I thought so, and I imagine the inc function has all the iteration and loops going on inside of it? |
14:57:07 | clyybber | silvernode: Nope |
14:57:35 | silvernode | trying to figure out what makes it continue iterating |
14:57:46 | clyybber | silvernode: Its relying on the fact that newSeqWith is a template that will evaluate its second argument N times |
14:57:57 | clyybber | where N is the first arg of newSeqWith |
14:58:36 | clyybber | It is like that so that you can do `newSeqWith(n, rand())` and have a seq with random data |
14:58:46 | silvernode | clyybber: so it's all part of newSeqWith? |
15:00:08 | clyybber | yeah |
15:00:29 | liblq-dev | shashlick: you here? |
15:00:40 | silvernode | clyybber: this makes so much sense now although pretty obscure when you don't know about it |
15:00:53 | clyybber | yeah, I just did it for fun |
15:00:58 | clyybber | its not really readable |
15:01:34 | silvernode | clyybber: I still think it's neat though |
15:03:03 | clyybber | silvernode: This is faster: https://play.nim-lang.org/#ix=2fzy |
15:03:56 | dadada | has 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:10 | leorize | dadada: a table? |
15:05:10 | dadada | leorize: 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:24 | leorize | don't do submacros tbh |
15:05:55 | leorize | if someone is using submacro, well force it to not be one |
15:06:02 | dadada | again, 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:58 | leorize | due to how macros work, it's not possible... |
15:07:06 | leorize | better rework the code instead |
15:07:21 | clyybber | Couldn't it be made possible? |
15:07:47 | clyybber | dadada: For now use compile time procs instead |
15:07:59 | dadada | hmm, 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:13 | leorize | compile time procs can do that too |
15:09:24 | leorize | compile time procs can do literally anything that a macro can do :P |
15:09:48 | clyybber | yeah, so the reverse should be possible too |
15:09:54 | clyybber | right? |
15:10:20 | dadada | I believe you, though my instinct is that I want to remove limitations, because why not? |
15:11:01 | leorize | well I think the limitation is unavoidable |
15:11:27 | leorize | the inner macros have to evaluate or else you can't get the AST needed to run the outer |
15:11:47 | clyybber | Couldn't we delay the evaluation? |
15:12:44 | leorize | wouldn't that open the doors for incorrectly typed calls? |
15:13:01 | shashlick | liblq-dev - here |
15:13:14 | clyybber | I mean delay until we actually come across the macro "call" |
15:13:30 | Araq | dadada, PMunch's code is an exception |
15:13:40 | Araq | where it makes sense to use macros inside macros |
15:14:40 | leorize | clyybber: so imagine something like this: |
15:14:46 | liblq-dev | shashlick: 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:54 | dadada | hmm, 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:11 | liblq-dev | shashlick: see http://ix.io/2fzG |
15:18:06 | leorize | clyybber: https://play.nim-lang.org/#ix=2fzJ |
15:19:36 | shashlick | how are you checking that it doesn't use the cache |
15:20:42 | clyybber | leorize: I'd say thats a good thing :D, as its consistent with https://play.nim-lang.org/#ix=2fzM |
15:20:54 | clyybber | with templates and compileTime procs |
15:21:16 | shashlick | also did you patch build.nim for that - issue |
15:24:03 | clyybber | Araq: 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:10 | clyybber | s/after/until after |
15:26:33 | clyybber | I 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:36 | liblq-dev | shashlick: yea, I patched build.nim |
15:26:44 | liblq-dev | and I don't know if it uses the cache or not |
15:26:51 | liblq-dev | but I built the file once with nim c |
15:26:55 | * | Jjp137 quit (Ping timeout: 258 seconds) |
15:27:12 | shashlick | okay for whatever reason, it is not finding the header |
15:30:35 | shashlick | what is the library so name |
15:31:42 | shashlick | okay had to add altnames = "wayland-server" |
15:34:03 | Araq | clyybber, ok |
15:35:44 | FromGitter | <alehander92> https://gist.github.com/alehander92/f456c84c745b59c6e8a0b1e267840376/ |
15:35:51 | FromGitter | <alehander92> leorize PMunch |
15:35:58 | PMunch | Huh? |
15:36:32 | FromGitter | <alehander92> this is the thing i wanted to do |
15:36:34 | FromGitter | <alehander92> back then |
15:36:38 | FromGitter | <alehander92> with the queue + futures |
15:37:07 | FromGitter | <alehander92> i only thing the `run` thing might look a bit hacky |
15:37:16 | FromGitter | <alehander92> but i didnt realize how people use callbacks |
15:37:29 | PMunch | Yeah, that's what I wanted to avoid by using callbacks.. |
15:37:36 | FromGitter | <alehander92> but i like it |
15:37:41 | FromGitter | <alehander92> are callbacks simpler |
15:37:45 | Araq | can't figure out how Z3 bitvectors work |
15:37:58 | Araq | Argument ((_ int2bv 32) #x0000000a) at position 1 does not match declaration (declare-fun bvsle ((_ BitVec 64) (_ BitVec 64)) Bool) |
15:38:24 | liblq-dev | shashlick: wayland-server.h, libwayland-server.so |
15:38:29 | liblq-dev | as you'd expect |
15:38:31 | PMunch | Well callbacks would make it so that futures are automatically run one after the other |
15:39:27 | FromGitter | <alehander92> so you put the "new" future as a callback to the previous one |
15:39:38 | FromGitter | <alehander92> and `complete` is called before callbacks? |
15:39:47 | FromGitter | <alehander92> oh useful, i'd keep it in mind |
15:39:57 | FromGitter | <alehander92> i like manual queues :( :D |
15:40:09 | FromDiscord | <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:31 | Araq | discard fun() |
15:40:41 | FromDiscord | <Prodigle> ty 🙂 |
15:41:35 | clyybber | Is it still true that newSeqUninitialized only works for number types? |
15:41:45 | clyybber | I don't see a reason for that |
15:43:16 | * | PMunch quit (Quit: leaving) |
15:43:20 | FromGitter | <alehander92> Araq hm, why do you need z3 bitvectos |
15:43:44 | Araq | because unsigned numbers are really bitvectors |
15:44:30 | FromGitter | <alehander92> hm, ok |
15:45:19 | shashlick | liblq-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:35 | shashlick | so nim check doesn't work at all |
15:45:38 | liblq-dev | oh crap |
15:45:53 | liblq-dev | why does it return a non-0 exit code |
15:45:55 | liblq-dev | ? |
15:49:45 | clyybber | Oh, 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:23 | disruptek | !last zevv |
16:12:24 | disbot | Zevv spoke in 12#nim 18 hours ago |
16:12:43 | * | opal quit (Ping timeout: 240 seconds) |
16:21:05 | clyybber | Araq: Maybe cyclic groups? Afaik z3 has support for those |
16:21:47 | clyybber | s/groups/arithmetic, whatever the correct term is :p |
16:25:41 | * | Guest72037 is now known as dadada |
16:25:50 | clyybber | hmm, nevermind, bitvectors really are the right tool here |
16:28:06 | Zevv | disruptek: oi, how's life |
16:31:20 | dadada | this 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:26 | dadada | don'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:33 | dadada | what happened? why is it this quiet all of a sudden? |
17:36:36 | livcd | uhmmm |
17:36:41 | livcd | drinking time! |
17:36:54 | ksandvik | 1.20 is not yet out, right? |
17:37:21 | narimiran | ksandvik: right |
17:37:53 | dadada | ksandvik: https://github.com/nim-lang/Nim/releases this is where I look for releases |
17:37:59 | dadada | don't know if there's a better place |
17:38:59 | ksandvik | Releases 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:24 | axion | Is 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:20 | FromDiscord | <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:13 | FromGitter | <alehander92> dadada hey, we are working on a sort of more "advanced" debugger environment in one project |
18:27:11 | FromGitter | <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:33 | FromGitter | <alehander92> are you imagining any of those flows , or something more like automatically detecting an issue |
18:28:13 | FromGitter | <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:55 | rayman22201 | alehander92 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:49 | rayman22201 | and "await" multiple promises in sequence, causes them to run sequentially anyway |
18:44:05 | * | sagax quit (Read error: Connection reset by peer) |
18:46:21 | axion | anyone 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:54 | FromGitter | <alehander92> rayman22201 |
18:52:00 | FromGitter | <alehander92> sorry :D |
18:52:11 | FromGitter | <alehander92> yes, i realized that |
18:52:16 | FromGitter | <alehander92> see the last link |
18:52:30 | FromGitter | <alehander92> it's not so simple |
18:53:52 | FromGitter | <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:13 | FromGitter | <alehander92> https://gist.github.com/alehander92/f456c84c745b59c6e8a0b1e267840376 |
18:55:46 | * | shadowbane quit (Client Quit) |
19:00:51 | rayman22201 | what is `execMI`? I don't see that in your gist? |
19:01:23 | rayman22201 | it just looks like you are re-implementing what async event loop already does? |
19:02:23 | FromGitter | <alehander92> sorry |
19:02:25 | FromGitter | <alehander92> i explained it bad |
19:02:35 | rayman22201 | why 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:25 | FromGitter | <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:33 | FromGitter | <alehander92> so the problem is between those write and read |
19:03:50 | FromGitter | <alehander92> the event loop might run another function which calls again `execMI` |
19:04:40 | FromGitter | <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:07 | FromGitter | <alehander92> so the point is that each next execMI actual logic should be called only after the previous one has finished |
19:05:10 | rayman22201 | you have `await gdb_read; await gdb_write`and you want them to be atomic |
19:05:17 | rayman22201 | ? |
19:05:36 | FromGitter | <alehander92> the combination of them |
19:05:56 | FromGitter | <alehander92> i want only zero or one `execMI`to be executed at each time |
19:06:49 | rayman22201 | the naive thing should just work. |
19:06:53 | FromGitter | <alehander92> i was generating an error before if execMI is busy |
19:06:56 | FromGitter | <alehander92> well it doesnt |
19:07:01 | FromGitter | <alehander92> i was getting into cases |
19:07:22 | FromGitter | <alehander92> where it was getting into that case that i described |
19:07:40 | FromGitter | <alehander92> so now i want if execMI is busy, to just wait for the previous ones and then for my op |
19:07:45 | FromGitter | <alehander92> and thats why the queue of futures |
19:08:09 | FromGitter | <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:46 | rayman22201 | some psuedocode, but this should work: https://play.nim-lang.org/#ix=2fAV |
19:10:23 | disruptek | come scheme about nim coronavirus detecting badges for fosdem 2021. |
19:10:26 | disruptek | ~stream |
19:10:27 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
19:11:03 | FromGitter | <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:10 | rayman22201 | https://play.nim-lang.org/#ix=2fAW |
19:11:25 | FromGitter | <alehander92> but this is the simple case |
19:11:34 | FromGitter | <alehander92> execMI is called from various places all around the codebase |
19:11:42 | FromGitter | <alehander92> its not just a simple list in the same function |
19:11:54 | rayman22201 | shouldn't matter |
19:12:05 | FromGitter | <alehander92> but i saw that it does :D |
19:12:19 | rayman22201 | as long as you await it. It will not complete until all internal await complete |
19:12:27 | * | shadowbane quit (Client Quit) |
19:12:47 | FromGitter | <alehander92> but rayman, while one of those has yielded, from other place another execMI can be started |
19:13:33 | rayman22201 | sure |
19:13:46 | * | rnrwashere quit (Remote host closed the connection) |
19:15:19 | FromGitter | <alehander92> so gdb_write .. gdb_read waiting yield => loop => another call => execMI => gdb_write => breaking invariant |
19:15:32 | rayman22201 | ah ok. you need this: https://github.com/cheatfate/asynctools/blob/master/asynctools/asyncsync.nim#L60 |
19:16:00 | Araq | er ... did Nim just bootstrap with --gc:arc? |
19:16:15 | FromGitter | <alehander92> hm, ok it seems like a similar thing |
19:16:15 | * | shadowbane joined #nim |
19:16:16 | rayman22201 | 🎉 awesome! |
19:16:19 | FromGitter | <alehander92> it uses a deque |
19:16:38 | FromGitter | <alehander92> ah ok he also creates an AsyncQueue |
19:16:45 | rayman22201 | well yeah, but you don't need a queue |
19:16:50 | rayman22201 | you just need the lock |
19:17:16 | FromGitter | <alehander92> but i can have 5 of them |
19:17:27 | FromGitter | <alehander92> i have to preserve somewhere the inputs/other waiting futures |
19:17:58 | rayman22201 | the calling procs save it? |
19:18:04 | FromGitter | <alehander92> ah yeah i see what you're saying |
19:18:05 | rayman22201 | they just wait until the the lock is free |
19:18:17 | * | ksandvik quit (Quit: Leaving.) |
19:18:52 | FromGitter | <alehander92> ok makes sense, thanks !! |
19:18:57 | rayman22201 | 👍 |
19:19:13 | FromGitter | <alehander92> i still like my queue as it seems to work but i'll keep it in mind |
19:19:38 | rayman22201 | well, your queue is basically a lock. As you can see, that's how locks are implemented. |
19:20:01 | rayman22201 | just a matter of maintaining your own vs. relying on someone else. |
19:20:41 | rayman22201 | cheatfate wrote chronos and was a big contributor to stdlib async, so I trust his code |
19:21:36 | * | rnrwashere joined #nim |
19:22:12 | FromGitter | <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:22 | FromGitter | <alehander92> otherwise i use asynctools as well, so i know his good work :) |
19:22:44 | rayman22201 | :-) 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:33 | FromGitter | <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:54 | Yardanico | You should add that .dll either to any folder in your windows PATH, or to the same folder with the .exe |
20:10:07 | Yardanico | also check the bitness of the .dll, maybe you compiled for 64-bit but DLL is 32-bit, or vise-versa |
20:10:11 | Yardanico | or that DLL depends on other DLLs too |
20:11:11 | * | shadowbane quit (Remote host closed the connection) |
20:11:16 | FromGitter | <Lecale> Same directory as the .exe fails :/ okay I will try the others too |
20:11:33 | Yardanico | what are the nimble libraries you've used in your snippet? |
20:11:36 | Yardanico | is it gintro by any chance? |
20:11:38 | * | shadowbane joined #nim |
20:12:01 | FromGitter | <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:30 | FromGitter | <pmamatsis> Hi everyone! |
20:26:51 | * | shadowbane joined #nim |
20:27:13 | * | Guest58547 quit (Ping timeout: 250 seconds) |
20:27:22 | Yardanico | hi |
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:59 | FromGitter | <zetashift> hiya |
20:52:09 | liblq-dev | hi |
20:53:46 | * | sagax joined #nim |
20:55:41 | leorize | sr.ht seems to be really buggy... |
20:56:15 | * | Guest28504 quit (Ping timeout: 250 seconds) |
20:58:18 | FromGitter | <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:08 | FromGitter | <zetashift> Nim playground `latest` Nim version means Nim devel right? |
21:16:27 | Yardanico | check "echo NimVersion", it's just latest stable IIRC |
21:18:26 | FromGitter | <zetashift> ah yeah latest stable |
21:18:35 | * | rnrwashere joined #nim |
21:21:53 | Yardanico | godbolt.org has nim trunk, but not sure how fast they update it |
21:21:56 | Yardanico | it 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:48 | euantor | I'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:38 | leorize | they really have to host their own package server somewhere... |
22:28:50 | leorize | this kind of downtime is not really welcoming |
22:31:01 | euantor | That wouldn't help unfortunately. It's due to the unique way pkg works |
22:31:29 | euantor | They could alter the steps so that freebsd runs a `pkg update` before installing, but that would be a bit wasteful |
22:31:45 | euantor | Or have a cron job update the image after running `pkg update` daily or something |
22:33:03 | leorize | well it still have to get the packages somewhere, right? |
22:33:21 | leorize | they can mirror the package server at a given point in time, then update it weekly or something |
22:35:04 | euantor | I suppose so |
22:37:43 | euantor | Probably easiest to have a caching proxy for packages, as they fetch over HTTP |
22:38:05 | euantor | I'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:45 | FromDiscord | <KingDarBoja> How I can get the enum item from a Enum slice? |
23:38:34 | FromDiscord | <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:10 | FromDiscord | <KingDarBoja> MyEnum is a HSlice btw |
23:41:24 | Yardanico | you can convert numbers to enums |
23:41:43 | Yardanico | let 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:01 | FromDiscord | <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) |