00:39:39 | * | pbottle quit (Quit: WeeChat 3.7.1) |
00:41:34 | * | dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
00:42:31 | * | dnh joined #nim |
00:45:24 | FromDiscord | <b1rdf00d> XmlNode question, I've got the following XmlNode and I'm trying to get the data for `src`? I've been reading the docs but can't work it out↵↵`<img src="https://t6.rbxcdn.com/b7104ffe13f1d6b3f74191d2b4640765" class="" />` |
00:45:59 | FromDiscord | <Elegantbeef> `myXml.attr("src")`? |
00:47:31 | FromDiscord | <b1rdf00d> 🤦♂️ I'm _sure_ I tried that. Thanks Beef |
00:48:01 | FromDiscord | <Elegantbeef> I'm not sure you did 😛 |
00:48:02 | FromDiscord | <b1rdf00d> Must have been trying to use attr for something else and remembered wrong |
00:55:28 | NimEventer | New thread by oldMan: Noob: getch giving AssertionDefect etc, see https://forum.nim-lang.org/t/9702 |
01:15:29 | FromDiscord | <albassort> i have an idea for a new lang |
01:16:44 | * | xaltsc quit (Ping timeout: 260 seconds) |
01:18:41 | * | xaltsc joined #nim |
01:48:04 | * | ltriant quit (Ping timeout: 248 seconds) |
02:27:14 | * | ltriant joined #nim |
02:37:41 | NimEventer | New thread by Ward: NimPk, see https://forum.nim-lang.org/t/9703 |
02:38:17 | FromDiscord | <Elegantbeef> @Horizon [She/Her]\: here you go got your python https://github.com/khchen/nimpk 😄 |
02:39:50 | FromDiscord | <Elegantbeef> Of course i'm mostly joking |
02:46:40 | FromDiscord | <! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4i1X |
02:49:05 | FromDiscord | <Elegantbeef> I really should learn npeg's syntax given how much i promote it 😄 |
03:13:06 | * | derpydoo quit (Ping timeout: 256 seconds) |
04:41:26 | * | arkurious quit (Quit: Leaving) |
04:44:39 | FromDiscord | <jtv> I just checked out npeg, and I will never ever use it. I could always hand-write the equivalent parser faster than figuring out their syntax :). is both concatenation AND a kleene closure?? And that's prefix? |
04:44:43 | FromDiscord | <jtv> Wow |
04:45:11 | FromDiscord | <jtv> Clearly I have too much grey in my beard 🙂 |
04:46:35 | FromDiscord | <jtv> Generally, I have always thought any time people get beyond the simplest of regexps (glob-like), they are sacrificing both clarity and almost always accuracy, and should just learn how to write parsers, it's not that hard 🙂 |
04:57:10 | FromDiscord | <voidwalker> seq[seq[T]] to seq[0] & seq[1] & .. seq[n] ? concat needs varargs |
05:00:35 | FromDiscord | <voidwalker> lol I guess foldl could work, a & b |
05:11:19 | FromDiscord | <sexnine> play.nim-lang.org down? |
05:25:43 | Zevv | jtv: I couldn't agree more. Unfortunately, what it can do is limited by what Nim can parse, and the Nim author states that "Macros cannot change Nim's syntax because there is no need for it — the syntax is flexible enough" |
05:25:46 | Zevv | There you have it. |
05:26:11 | Zevv | I even got a PR through to take that particular scentence of the Nim site front page, but they put it back. |
06:40:17 | * | rockcavera quit (Remote host closed the connection) |
06:44:19 | FromDiscord | <Horizon [She/Her]> In reply to @Elegantbeef "<@909883978717204561>\: here you go": PocketLang actually looks quite nice haha |
06:47:29 | * | jmdaemon quit (Ping timeout: 260 seconds) |
07:45:05 | FromDiscord | <jtv> In reply to @Zevv "I even got a": I mean, write a recursive descent parser, or use a parser generator |
07:46:16 | FromDiscord | <jtv> Haven't used this, but it looks decent syntactically anyway: https://github.com/loloicci/nimly |
07:47:49 | * | xet7 quit (Remote host closed the connection) |
07:49:49 | * | xet7 joined #nim |
08:03:15 | Zevv | jtv: sure, you can write your parsers however you like to write them. |
08:07:14 | * | kenran joined #nim |
08:11:55 | * | kenran quit (Ping timeout: 252 seconds) |
08:16:47 | FromDiscord | <scruz> does nim use `=>` anywhere? |
08:17:03 | FromDiscord | <scruz> https://media.discordapp.net/attachments/371759389889003532/1050325119874113596/image.png |
08:17:27 | FromDiscord | <Bung> it's from sugar module |
08:18:47 | Zevv | https://nim-lang.github.io/Nim/sugar.html#%3D%3E.m%2Cuntyped%2Cuntyped |
08:19:33 | FromDiscord | <scruz> thanks, ↵i asked the question on chatgpt and got the answer |
08:19:40 | FromDiscord | <scruz> https://media.discordapp.net/attachments/371759389889003532/1050325777364815872/image.png |
08:19:48 | FromDiscord | <scruz> lol |
08:28:16 | FromDiscord | <Slava0135> In reply to @Bung "it's from sugar module": ~~that's why it didn't work when i tried it in aoc~~ |
09:15:28 | FromDiscord | <j-james> does there exist some syntax sugar along the lines of `bluh = for k in l: if cond: result += 1`? |
09:17:08 | FromDiscord | <j-james> `collect` _almost_ does this but not quite |
09:21:03 | FromDiscord | <j-james> like immediately running an anonymous function ig |
09:28:04 | * | PMunch joined #nim |
09:31:29 | FromDiscord | <Rika> i dont understand what this is supposed to do |
09:32:14 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=4i2P |
09:33:20 | FromDiscord | <j-james> kind of a bad example |
09:33:29 | FromDiscord | <Rika> its hard to understand, sorry |
09:33:30 | FromDiscord | <Elegantbeef> someone is doing aoc? 😄 |
09:33:49 | FromDiscord | <Elegantbeef> `result += ord(cond)` |
09:35:36 | FromDiscord | <j-james> sent a code paste, see https://play.nim-lang.org/#ix=4i2R |
09:35:40 | FromDiscord | <j-james> In reply to @Elegantbeef "someone is doing aoc?": perhaps 👀 |
09:36:00 | FromDiscord | <j-james> it's a bit of a painful one today |
09:36:26 | FromDiscord | <Elegantbeef> It's not too bad imo, though i havent done part 2 yet |
09:38:52 | FromDiscord | <j-james> yea just prickly |
09:38:56 | FromDiscord | <j-james> lots of places to mess up |
09:39:31 | FromDiscord | <Rika> In reply to @apropos "i got it working": looks cursed |
09:41:08 | FromDiscord | <j-james> yup |
09:41:42 | FromDiscord | <j-james> i do wish sequtils had `take`, `takeWhile`, `takeUntil` functions |
09:41:53 | FromDiscord | <j-james> i should write some 🤔 |
09:45:18 | FromDiscord | <Rika> the keep functions? |
09:45:54 | FromDiscord | <Rika> what would take do? |
09:51:13 | FromDiscord | <j-james> terminate early |
09:52:02 | FromDiscord | <j-james> In reply to @apropos "i got it working": like the `if cond: break` portion here |
09:54:10 | FromDiscord | <Rika> i see |
10:47:24 | FromDiscord | <bren> sent a code paste, see https://play.nim-lang.org/#ix=4i3f |
10:52:06 | FromDiscord | <amadan> sent a code paste, see https://play.nim-lang.org/#ix=4i3h |
10:58:42 | * | junaid_ joined #nim |
11:05:34 | NimEventer | New thread by Siltaar: A new way for Nim to shine ? Faster than NodeJS interpreted Nim, taking advantage of declared types, see https://forum.nim-lang.org/t/9704 |
11:05:47 | FromDiscord | <bren> sent a code paste, see https://play.nim-lang.org/#ix=4i3l |
11:10:10 | * | junaid_ quit (Quit: leaving) |
11:10:53 | * | junaid_ joined #nim |
11:12:07 | * | Guest20 joined #nim |
11:12:35 | * | Guest20 quit (Client Quit) |
11:13:29 | * | junaid_ quit (Client Quit) |
11:13:54 | * | junaid_ joined #nim |
11:14:13 | * | junaid_ quit (Client Quit) |
11:14:36 | * | junaid_ joined #nim |
11:19:52 | * | ltriant quit (Ping timeout: 256 seconds) |
11:26:58 | FromDiscord | <amadan> That splits into groups properly for me |
11:29:27 | FromDiscord | <amadan> Though tbh I'm kinda confused as to why it does instead of joining it all into one list |
11:30:38 | * | junaid_ quit (Remote host closed the connection) |
11:55:21 | FromDiscord | <wiga> I found a weird thing idk if its an external cause. Whenever i execute a powershell command with osproc it gives me a weird output. It gives me the actual output that i want and some xml things |
11:56:07 | FromDiscord | <wiga> I tried digging out the potential causes so i tried running the same thing but with python, nodejs, java, C#, etc |
11:56:37 | FromDiscord | <wiga> But gives me the actual output i am looking for |
11:57:24 | FromDiscord | <wiga> So it maybe has something to do with osproc idk |
11:58:29 | FromDiscord | <wiga> (i cannot show the code cuz i am not at home rn) |
11:59:45 | FromDiscord | <ghkdgfs> is there a way to zip n openArray at runtime?↵e.g. @[@[4,5],@[9,3]] to @[@[4,9],@[5,3]] |
12:03:04 | * | ltriant joined #nim |
12:15:32 | * | ltriant quit (Ping timeout: 260 seconds) |
12:40:47 | FromDiscord | <bren> In reply to @amadan "That splits into groups": Oh, I just tried it, and you're right. But what's different from the previous example? It's weird |
12:44:51 | * | ltriant joined #nim |
12:49:30 | * | pro joined #nim |
12:49:37 | * | pro left #nim (#nim) |
12:49:40 | * | ltriant quit (Ping timeout: 252 seconds) |
13:11:39 | FromDiscord | <Require Support> sent a code paste, see https://play.nim-lang.org/#ix=4i3T |
13:12:25 | FromDiscord | <scruz> show the Fetch proc |
13:13:42 | FromDiscord | <Require Support> just trying to understand what the error means |
13:14:20 | * | TakinOver quit (Ping timeout: 256 seconds) |
13:15:29 | FromDiscord | <scruz> maybe you're using Fetch before defining it |
13:16:05 | FromDiscord | <scruz> (edit) "it" => "it?" |
13:16:44 | FromDiscord | <Require Support> weird that it errors out on the linker and nim compiler doesn't saying anything |
13:22:23 | FromDiscord | <scruz> https://nim-lang.org/docs/tut1.html#procedures-forward-declarations |
13:38:32 | * | TakinOver joined #nim |
13:40:51 | FromDiscord | <Require Support> hmmm checked for it but it's not the problem |
13:43:37 | FromDiscord | <juelix> What is the best library to connect with MySQL? I am using windows 11/64bit. |
13:50:41 | FromDiscord | <ambient> sent a code paste, see https://play.nim-lang.org/#ix=4i41 |
13:54:16 | FromDiscord | <ambient> sent a code paste, see https://play.nim-lang.org/#ix= |
13:58:05 | FromDiscord | <auxym> yeah it's a special "table constructor syntax", it creates an array of tuples IIRC, which you can then pass to `toTable` (if you import std/tables) |
13:58:49 | * | Phytolizer joined #nim |
14:03:09 | FromDiscord | <ambient> I find reasoning around the types of these things quite challenging |
14:04:05 | FromDiscord | <ambient> because you need matching types and if there's any non-matching types it breaks the entire program |
14:04:55 | FromDiscord | <jtv> That's how you dramatically decrease the number of bugs that show up at runtime, by not allowing type errors in :). So it might be a transition to learn, but worth it |
14:05:33 | FromDiscord | <ambient> It's not that I'm against types, but I'm against lack of documentation, lack of examples, lack of tooling support, lack of good error messages |
14:05:53 | FromDiscord | <ambient> I'm shooting blind here |
14:07:18 | FromDiscord | <starch> In reply to @auxym "(if it's a nim": nim source file...? |
14:07:24 | FromDiscord | <jtv> I just started using Nim a few weeks ago; I agree the error messages can be a bit arcane, and not everything that should be well documented is :). But I think when you could use some clarity just ask and will try to help |
14:12:23 | * | Phytolizer quit (Remote host closed the connection) |
14:12:40 | FromDiscord | <ambient> here's an example where I can't figure out the type (AoC 2022 spoiler): https://github.com/amb/aoc2022/blob/master/8/s.nim#L50 keyWarpWorks works, keyWarpBroken can't figure it out |
14:12:59 | FromDiscord | <auxym> In reply to @starch "nim source file...?": source code. code. programming language |
14:14:58 | FromDiscord | <jtv> Well, tell me what's "not working", what error do you get?? That one function looks syntactically fine |
14:14:59 | FromDiscord | <auxym> In reply to @ambient "It's not that I'm": I agree tooling isn't nim's strong point, but the docs specify the types for all procs in the standard library. Table constructor syntax is documented here: https://nim-lang.org/docs/manual.html#statements-and-expressions-table-constructor |
14:15:44 | FromDiscord | <ambient> In reply to @jtv "Well, tell me what's": Type mismatch |
14:16:48 | FromDiscord | <jtv> Well, I don't see the function warp you're calling there, so hard to say without more info |
14:16:54 | FromDiscord | <starch> In reply to @auxym "source code. code. programming": yeah but subprocess wont run as nim source code? |
14:17:12 | FromDiscord | <ambient> In reply to @jtv "Well, I don't see": The entire source is there, you just need to run the file |
14:18:54 | FromDiscord | <! Nilts> In reply to @jtv "Generally, I have always": Like standard peg or raw? I chose npeg because i can put code to manage values in the parser |
14:21:17 | FromDiscord | <jtv> You've got a dependency on zero_functional in there, I don't know what that is. You also import sugar in aoc.nim but sure aren't using it |
14:24:32 | FromDiscord | <jtv> sent a long message, see http://ix.io/4i4a |
14:25:28 | FromDiscord | <jtv> But again, that's why you can just write a spec and let a generator give you a full parser for your spec. Easy to build, easy to debug, and can accept any context-free language and many context-sensitive ones |
14:27:20 | FromDiscord | <! Nilts> I know EBNF is a parsing thing and that's all i know |
14:28:20 | FromDiscord | <ambient> I guess the point here is that tables are just not something Nim natively supports, and at best it's syntactic sugar for arrays and tuples |
14:28:24 | FromDiscord | <jtv> On a quick google search, this looks like a reasonable intro to ebnf: https://matt.might.net/articles/grammars-bnf-ebnf/ |
14:28:28 | FromDiscord | <ambient> so I have to work around it |
14:29:41 | FromDiscord | <jtv> "work around it"? I use tables extensively, a lot of people do. The implementation is just in a library so that you can choose not to pull it in. |
14:30:04 | FromDiscord | <ambient> there seem to be gotchas, like collect doesn't recognize a table element coming from a function |
14:30:19 | FromDiscord | <ambient> it creates a seq instead of a table |
14:31:15 | FromDiscord | <jtv> What language are you coming from? |
14:31:18 | * | PMunch quit (Quit: Leaving) |
14:35:40 | FromDiscord | <ambient> sent a code paste, see https://play.nim-lang.org/#ix=4i4c |
14:35:52 | FromDiscord | <ambient> sent a code paste, see https://play.nim-lang.org/#ix=4i4d |
14:36:50 | * | Phytolizer joined #nim |
14:36:53 | FromDiscord | <jtv> sent a long message, see http://ix.io/4i4e |
14:37:06 | FromDiscord | <ambient> @jtv that's completely tangential and irrelevant to the problem |
14:37:12 | FromDiscord | <jtv> The second is that dictionaries live in a library, they have NO special treatment in the language |
14:37:21 | FromDiscord | <jtv> So you need to "import tables" there |
14:38:14 | FromDiscord | <jtv> {x : a, y : b} in Nim is the same as writing [(x, a), (y, b)] |
14:38:21 | FromDiscord | <jtv> It is not special to dictionaries |
14:38:50 | FromDiscord | <jtv> The dictionary constructor functions take your array and hash it all for you |
14:40:17 | FromDiscord | <jtv> The reason for that, it gives you the option to use an implementation that doesn't hash, so you can use an "associative array" implementation, ie one that doesn't hash |
14:40:18 | FromDiscord | <ambient> Is there a way to define a return type as a part of a table or is there not? |
14:40:26 | FromDiscord | <jtv> Which can be faster when you have small tables |
14:40:36 | FromDiscord | <jtv> Yes, of course |
14:40:53 | FromDiscord | <jtv> x: Table[string, int] |
14:41:05 | FromDiscord | <jtv> That declares x as a table with strings for keys, ints for values |
14:42:21 | FromDiscord | <ambient> I think the point here is that I'm trying to collect items from a function and make a table out of that |
14:43:59 | FromDiscord | <ambient> how would you write function foo to make the results match? https://github.com/amb/aoc2022/blob/master/8/problem.nim |
14:44:26 | * | kenran joined #nim |
14:45:37 | FromDiscord | <ambient> either you can or I have to figure out another way of doing it |
14:46:59 | * | kenran quit (Remote host closed the connection) |
14:48:21 | FromDiscord | <jtv> Well, I'm not here to do your work for you, I'm here to try to help you understand the language. If you want foo to return a dictionary, why are you specifying that it returns an array? |
14:49:05 | FromDiscord | <ambient> because type of {'a':1} is array[0..0, (char, int)] |
14:49:28 | FromDiscord | <jtv> No, it's whatever the language infers, which it infers from your return type here |
14:50:04 | FromDiscord | <ambient> Setting it to auto changes nothing |
14:50:29 | FromDiscord | <jtv> Well, you're not calling toTable actually |
14:51:39 | FromDiscord | <jtv> Something like this: |
14:51:40 | FromDiscord | <jtv> proc bar(k : char, v : int): Table[char, int] =↵ {k : v+1}.toTable() |
14:52:20 | FromDiscord | <ambient> that just gives me seq[Table[char, int]] |
14:52:24 | FromDiscord | <ambient> instead of Table[char,int] |
14:52:28 | FromDiscord | <jtv> Because like I said, the literal does NOT create a dictionary behind your back, dictionaries get no special treatment |
14:53:03 | FromDiscord | <jtv> I assume you're trying to merge a bunch of dictionaries of the same type here? |
14:53:07 | * | ltriant joined #nim |
14:53:08 | FromDiscord | <ambient> Look, I'm just looking for a simple answer if this is possible to do and I'm assuming the answer is no so I'm just going to try something else |
14:53:27 | FromDiscord | <ambient> I'm trying to transform a table |
14:53:37 | FromDiscord | <ambient> with a function |
14:53:41 | FromDiscord | <jtv> In what way? |
14:54:01 | FromDiscord | <jtv> You want to change the values in the table you created? |
14:54:06 | FromDiscord | <ambient> pseudo: table.map(x => {x.key: x.value+1}) |
14:54:55 | FromDiscord | <ambient> or pseudo: table.makeNew(x => {(-x.key[1], x.key[0]): x.value}) |
14:56:00 | FromDiscord | <jtv> And you want to change the table or just yield another table? |
14:56:10 | FromDiscord | <ambient> either would work |
14:56:14 | FromDiscord | <jtv> And is the type of the inputs important?? |
14:57:19 | FromDiscord | <ambient> I don't think I'm going to get any answers here so I'll get back to hacking 🫡 |
14:57:54 | FromDiscord | <jtv> I'm about to write it for you |
14:58:10 | FromDiscord | <jtv> Just waiting for you to answer my question 🙂 |
14:58:59 | * | ltriant quit (Ping timeout: 256 seconds) |
15:07:56 | FromDiscord | <jtv> Okay, I'll just assume then |
15:08:08 | FromDiscord | <jtv> 2 mins |
15:09:35 | FromDiscord | <jtv> Okay, this assumes you just want char mapped to int only, and is thus a little simpler: |
15:09:53 | FromDiscord | <jtv> sent a code paste, see https://play.nim-lang.org/#ix=4i4o |
15:10:42 | FromDiscord | <jtv> And if you'd rather it work generically, like a good map function should, change the mapTable function to this: |
15:10:49 | FromDiscord | <jtv> sent a code paste, see https://play.nim-lang.org/#ix=4i4p |
15:11:09 | * | dtomato4 is now known as dtomato |
15:12:04 | FromDiscord | <jtv> @ambient I am sorry if you feel like I wasn't being helpful, I felt like you weren't being clear about what you didn't understand and was trying to help you understand, not just give you an answer |
15:14:21 | * | dtomato quit (Quit: The Lounge - https://thelounge.chat) |
15:14:46 | * | dtomato joined #nim |
15:15:01 | FromDiscord | <kots> sent a code paste, see https://play.nim-lang.org/#ix=4i4r |
15:30:08 | * | Phytolizer quit (Ping timeout: 260 seconds) |
15:40:49 | FromDiscord | <Require Support> i wish async errors weren't riddles 😦 |
15:45:01 | * | dnh quit (Ping timeout: 265 seconds) |
15:47:22 | FromDiscord | <auxym> In reply to @starch "yeah but subprocess wont": as i said, you can use subprocess to first run the nim compiler to compile the file |
15:51:55 | FromDiscord | <Require Support> sent a code paste, see https://play.nim-lang.org/#ix=4i4A |
15:54:05 | FromDiscord | <jtv> The C function _setjmp only takes a jmpbuf as an argument |
15:54:11 | FromDiscord | <jtv> I don't know what that second argument is |
15:57:57 | FromDiscord | <ringabout> In reply to @Require Support "can someone translate this": Did you use 1.6.8? |
15:58:06 | FromDiscord | <ringabout> (edit) "1.6.8?" => "1.6.8 or 1.6.6?" |
16:01:28 | FromDiscord | <ringabout> In reply to @Require Support "can someone translate this": Use 1.6.10 or a C compiler supports `_setjmp` extension (e.g. the officially recommended C compiler). |
16:23:10 | * | Phytolizer joined #nim |
16:23:38 | Phytolizer | https://pasteboard.co/pyDZPljn3Uan.png what is being destroyed here? it is taking a lot of my runtime |
16:25:50 | FromDiscord | <guttural666> how do I do dis? https://media.discordapp.net/attachments/371759389889003532/1050448124109393990/image.png |
16:56:05 | FromDiscord | <guttural666> In reply to @guttural666 "how do I do": https://stackoverflow.com/questions/72406736/using-mutable-varargs-doesnt-work-as-expected-in-nim↵seems to be the answer, sad face |
16:56:12 | NimEventer | New post on r/nim by pentothal: typetraits and inheritance, see https://reddit.com/r/nim/comments/zg4itc/typetraits_and_inheritance/ |
17:01:54 | * | pro joined #nim |
17:02:00 | * | pro left #nim (#nim) |
17:05:35 | FromDiscord | <Require Support> In reply to @ringabout "Did you use 1.6.8": im on devel, and im cross compiling using mingw |
17:12:24 | FromDiscord | <ambient> sent a code paste, see https://play.nim-lang.org/#ix=4i4U |
17:13:14 | FromDiscord | <ambient> The collect macro needs the {} to work, as @kots said |
17:13:38 | * | ltriant joined #nim |
17:15:34 | FromDiscord | <jtv> Yes, sure. I didn't even bother with it, yYou seemed to be asking about dictionary type semantics, and I gave you much clearer code that does exactly what you were asking for, you didn't say you had to use the collect macro. |
17:16:00 | FromDiscord | <ambient> well if I had all the puzzle pieces I would not have to ask questions 🤔 |
17:16:32 | FromDiscord | <jtv> I'm saying you need to be more specific with your questions, it was very hard to figure out what you were really trying to accomplish, what you didn't understand, etc. |
17:16:48 | FromDiscord | <ambient> noted |
17:17:59 | FromDiscord | <jtv> You seemed to be not understanding the type system, and the examples I gave were meant to show some of the optionality you have there |
17:18:45 | * | ltriant quit (Ping timeout: 260 seconds) |
17:37:52 | arkanoid | in unittest, check foo = 42 returns nice output, showing the value of foo when it doesn't match. I need to perform same test but on floats using almostEqual, but check math.almostEqual(foo, 42.1275368121) returns just test passed or not without showing value |
17:38:05 | arkanoid | is there a "checkAlmostEqual"? |
17:43:52 | Phytolizer | is there a way to *not* zero out memory constantly? it is taking over 13% on my runtime |
17:46:55 | FromDiscord | <planetis> Yes compile with -d:release. It lts not an issue with optimized builds |
17:47:08 | FromDiscord | <guttural666> In reply to @Phytolizer "is there a way": wtf are you programming haha |
17:47:21 | Phytolizer | advent of code |
17:47:39 | FromDiscord | <guttural666> In reply to @Phytolizer "advent of code": ah nice |
17:47:52 | Phytolizer | @planetis: is there a way to keep line number info etc in optimized builds? i want to profile my code |
17:48:19 | FromDiscord | <planetis> Yes -g |
17:48:36 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4i4X |
17:49:35 | FromDiscord | <planetis> Better? |
17:50:07 | FromDiscord | <sOkam!> i've never stored an array of arrays or arrays, so might be missing something |
17:50:10 | Phytolizer | omg how did i miss that, thanks |
17:50:25 | Phytolizer | now i have to figure out why `eqcopy` is being called 200k times... |
17:51:06 | FromDiscord | <sOkam!> (edit) "or" => "of" |
17:53:36 | Phytolizer | https://pasteboard.co/87aBm3OJbcYM.png what is happening here? |
17:55:30 | FromDiscord | <planetis> What's the signature of this eqcopy, what type does it copy,? |
17:56:28 | FromDiscord | <Phytolizer> I'm not really sure how to tell |
17:56:51 | Phytolizer | this is kcachegrind |
17:57:09 | FromDiscord | <planetis> Try to make dir a template instaed of let |
17:57:51 | FromDiscord | <planetis> template dir: untyped = t.fs.child[] |
17:58:22 | FromDiscord | <planetis> (edit) "t.fs.child[]" => "t.fs[child.int]" |
17:58:35 | FromDiscord | <planetis> (edit) "instaed" => "instead" |
17:59:29 | Phytolizer | the copies are still present but they moved |
18:00:05 | Phytolizer | to some `==` proc in system.comparisons |
18:00:14 | Phytolizer | which i assume is *the* `==` proc |
18:01:07 | FromDiscord | <planetis> Screen? |
18:02:01 | Phytolizer | https://pasteboard.co/xIp31EOkwE3L.png doesn't make much sense here and im not sure where it's called from |
18:02:43 | FromDiscord | <planetis> Weird... |
18:03:20 | FromDiscord | <planetis> You need to open the .c file in nimcache and find out what that proc copies |
18:05:38 | FromDiscord | <planetis> In Linux it's ~/.cache/nim/filename_r/@mfilename.c |
18:05:43 | Phytolizer | i found it |
18:05:46 | Phytolizer | it copies the FsTree |
18:07:02 | Phytolizer | no, sorry |
18:07:03 | Phytolizer | FsNode |
18:07:08 | Phytolizer | i was looking at the wrong one |
18:07:54 | FromDiscord | <planetis> So it copies the whole subtrees! |
18:07:57 | Phytolizer | oh dammit it's the childNode |
18:08:19 | Phytolizer | no this is a linear DS, it is just copying one node an inordinate number of times |
18:08:55 | Phytolizer | i got rid of it by making childNode a template yay! |
18:09:23 | Phytolizer | i'm going to look for these random copies elsewhere in my code |
18:10:03 | Phytolizer | thanks for showing me how to figure this stuff out, i didnt know the C code was cached |
18:10:18 | Phytolizer | that literally halved my solve time for day 7 btw |
18:12:07 | FromDiscord | <planetis> Happy to help! |
18:52:26 | * | hochata joined #nim |
18:54:37 | * | hochata quit (Client Quit) |
18:55:28 | * | hochata joined #nim |
19:01:16 | * | rockcavera joined #nim |
19:24:38 | * | Phytolizer quit (Ping timeout: 260 seconds) |
19:31:11 | FromDiscord | <@thatrandomperson5-6310e3b26da03> `nim doc --project --index:on --git.url:https://github.com/zevv/npeg --outdir:htmldocs npeg.nim` gives OsError file not found |
19:31:23 | FromDiscord | <@thatrandomperson5-6310e3b26da03> I need some docs for npeg |
19:33:46 | Zevv | npeg.nim should be src/npeg.nim |
19:34:17 | FromDiscord | <@thatrandomperson5-6310e3b26da03> Now im getting getDocHackJs errrors |
19:34:48 | Zevv | also, the embedded docs is not the main documentation, check the github README, it's all there |
19:36:17 | FromDiscord | <@thatrandomperson5-6310e3b26da03> > also, the embedded docs is not the main documentation, check the github README, it's all there↵Ok then how do i get a seq of all the “$” captures inside a code capture handler |
19:37:14 | Zevv | they are available in @capture[].s $n is sugar for capture[n].s |
19:37:36 | Zevv | https://github.com/zevv/npeg#code-block-captures |
19:55:40 | FromDiscord | <Michal Maršálek> https://github.com/MichalMarsalek/Advent-of-code/blob/master/2022/Nim/day8.nim |
19:56:20 | FromDiscord | <Michal Maršálek> finally I could utilize the Grid ops and the Vector ops I have in my aoc library |
19:58:40 | FromDiscord | <Horizon [She/Her]> https://github.com/nim-lang/Nim/issues/21052 broken essentially for a year, fun xD |
20:12:56 | * | hochata quit (Remote host closed the connection) |
20:22:34 | * | Phytolizer joined #nim |
20:26:24 | FromDiscord | <ShalokShalom> 🥳 |
20:27:10 | arkanoid | if my project uses C as backend, but requires a package that wants C++ as backend in it's nimble file, what's the backend used when I "nimble run" my project? |
20:29:51 | FromDiscord | <Horizon [She/Her]> It'll use the C++ backend, i assume |
20:37:39 | * | Phytolizer quit (Remote host closed the connection) |
20:38:47 | * | Phytolizer joined #nim |
20:40:06 | * | neceve joined #nim |
20:44:34 | * | arkurious joined #nim |
20:45:03 | FromDiscord | <@thatrandomperson5-6310e3b26da03> I get type mistmatch for @ and []↵(<@709044657232936960_=5aevv=5b=49=52=43=5d>) |
20:57:39 | FromDiscord | <MetuMortis> I can't use nim playground, can you? |
20:59:20 | * | jmdaemon joined #nim |
21:02:07 | * | neceve quit (Quit: ZNC - https://znc.in) |
21:05:02 | FromDiscord | <demotomohiro> When Nim playground go down, https://wandbox.org/ |
21:05:40 | FromDiscord | <demotomohiro> !eval echo "Working?" |
21:05:55 | * | neceve joined #nim |
21:06:40 | NimBot | Compile failed: <no output> |
21:10:41 | Phytolizer | @MetuMortis it's been down since at least a couple of days, it's annoying on IRC because code snippets get auto-redirected there and i can't see them at all |
21:14:17 | FromDiscord | <MetuMortis> !eval echo "Hi!" |
21:14:32 | FromDiscord | <MetuMortis> :d |
21:15:18 | NimBot | Compile failed: <no output> |
21:15:31 | * | ltriant joined #nim |
21:15:31 | arkanoid | Horizon, thanks |
21:20:19 | * | ltriant quit (Ping timeout: 252 seconds) |
21:35:16 | * | ltriant joined #nim |
21:43:45 | * | v28p joined #nim |
21:58:13 | FromDiscord | <Horizon [She/Her]> Np ^^ |
22:15:27 | FromDiscord | <MetuMortis> sent a code paste, see https://play.nim-lang.org/#ix=4i64 |
22:15:37 | FromDiscord | <MetuMortis> (edit) "https://play.nim-lang.org/#ix=4i64" => "https://play.nim-lang.org/#ix=4i65" |
22:33:22 | * | TakinOver quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
22:46:13 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4i6a |
22:46:30 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4i6b |
22:46:59 | FromDiscord | <voidwalker> I am having trouble understanding why the expression with the mapIt doesn't return the same thing as the first one :\ |
22:50:23 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4i6d |
22:53:12 | FromDiscord | <voidwalker> `seq[seq[PeerAddr]]` as expected |
22:54:58 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4i6e |
22:55:10 | FromDiscord | <voidwalker> (edit) "https://play.nim-lang.org/#ix=4i6e" => "https://play.nim-lang.org/#ix=4i6f" |
22:55:11 | FromDiscord | <voidwalker> (edit) "https://play.nim-lang.org/#ix=4i6f" => "https://play.nim-lang.org/#ix=4i6g" |
22:55:24 | FromDiscord | <Elegantbeef> Now that i realise what you're doing |
22:56:01 | FromDiscord | <Elegantbeef> Isnt there a template or procedure for this |
22:56:06 | FromDiscord | <voidwalker> I have no idea what I am doing tbh, I only know what I want to do |
22:56:57 | FromDiscord | <Elegantbeef> Yea there is `all` |
22:56:58 | FromDiscord | <voidwalker> I am trying to launch requests to all the torrent trackers concurrently, and then combine/deduplicate the results |
22:57:54 | FromDiscord | <voidwalker> this all ? `proc all[T](s: openArray[T]; pred: proc (x: T): bool {.closure.}): bool {.↵ effectsOf: pred.}` |
22:58:14 | FromDiscord | <Elegantbeef> No |
22:58:17 | FromDiscord | <Elegantbeef> Inside asyncfutures |
22:58:19 | FromDiscord | <Elegantbeef> There is an all |
22:58:40 | FromDiscord | <voidwalker> oh I kinda remembered about that, but couldn't find it in index google : ) |
22:59:04 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/theindex.html |
22:59:04 | FromDiscord | <Elegantbeef> That's the index you use |
22:59:06 | FromDiscord | <Elegantbeef> Dont use google when you have that |
22:59:56 | FromDiscord | <voidwalker> yeah I bookmarked that |
23:00:50 | FromDiscord | <voidwalker> oh i had to search for `add:` |
23:00:55 | FromDiscord | <voidwalker> (edit) "`add:`" => "`all:`" |
23:01:18 | FromDiscord | <voidwalker> good to know, cause I had a ` waitFor (futs[0] and futs[1] and futs[2] and futs[3] and futs[4] and futs[5])` : S |
23:02:12 | FromDiscord | <voidwalker> still, how does this answer my question, what is wrong with that mapIt expression ? |
23:02:15 | FromDiscord | <! Nilts> Anyone have any idea how i would make a ast gen in npeg, i'm having trouble finding out how to get the children / parents and whatnot |
23:07:14 | * | Phytolizer quit (Remote host closed the connection) |
23:14:30 | arkanoid | I'm fighting "arraymancer-0.7.17/arraymancer/laser/private/memory.nim(9, 23) Error: undeclared identifier: 'KnownSupportsCopyMem'", any idea what could cause this? |
23:16:51 | arkanoid | if I change Tensor[uint16] to Tensor[int], I get different error: arraymancer-0.7.17/arraymancer/laser/strided_iteration/foreach_common.nim(69, 44) Error: attempting to call undeclared routine: 'unsafe_raw_offset' |
23:29:32 | FromDiscord | <! Nilts> sent a code paste, see https://paste.rs/7rR |
23:31:57 | FromDiscord | <Elegantbeef> `ref` alone is a generic |
23:32:51 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4i6n |
23:35:44 | FromDiscord | <! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4i6o |
23:36:18 | FromDiscord | <Elegantbeef> I dont even know what you mean |
23:38:12 | FromDiscord | <! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4i6p |
23:38:41 | FromDiscord | <Elegantbeef> You're not elaborating |
23:39:44 | FromDiscord | <! Nilts> In reply to @Elegantbeef "You're not elaborating": ????? I mean i cannot do the above, i can only define MyType not othertype |
23:40:35 | FromDiscord | <Elegantbeef> What you're after makes no sense presently |
23:41:36 | FromDiscord | <! Nilts> i have this issue with giving people what they want when they don't specify, so don't say "you're not elaborating" say what you want me to elaborate on |
23:41:46 | arkanoid | nevermind, solved |
23:42:13 | FromDiscord | <b1rdf00d> In reply to @not logged in "i have this issue": why can't you define 2 types? |
23:42:42 | FromDiscord | <! Nilts> In reply to @b1rdf00d "why can't you define": because im using some macro to define one of the macros |
23:42:47 | FromDiscord | <! Nilts> (edit) "macros" => "types" |
23:43:15 | FromDiscord | <ShalokShalom> @! Nilts i would suggest to show us more of your code 🙂 |
23:45:08 | FromDiscord | <! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4i6w |
23:48:00 | FromDiscord | <Elegantbeef> replace `OrlNode` with `ref ObjNodeObj` |
23:48:10 | FromDiscord | <Elegantbeef> then do `type OrlNode = ref ObjNodeObj` |
23:52:47 | FromDiscord | <! Nilts> In reply to @Elegantbeef "replace `OrlNode` with ": that works, i don't event need orlNodeObj, thanks! |
23:53:12 | * | v28p quit (Remote host closed the connection) |