00:00:00 | FromDiscord | <Clyybber> the compiler should compile |
00:00:05 | FromDiscord | <Clyybber> its in the name |
00:00:10 | disruptek | how can it do so without packages? |
00:00:18 | FromDiscord | <Clyybber> it operates on files |
00:00:21 | FromDiscord | <Recruit_main707> I so t think it’s an important feature, people will really not give a shit wether the pm is in the same ese or a different one |
00:00:33 | FromDiscord | <Recruit_main707> don’t |
00:00:46 | disruptek | well, i'd rather take a leak than debate this. |
00:01:12 | leorize | my main technical reason against this is because of openssl |
00:01:35 | leorize | non-native deps are a pita to manage rn |
00:02:16 | * | mfiano joined #nim |
00:02:21 | FromDiscord | <dom96> Not aware of any language pm that handles those well, or at all really |
00:02:54 | leorize | we should all just switch to nix :P |
00:02:54 | FromDiscord | <dom96> Our ability to specify which OS packages to install is actually pretty nice and unique AFAIK |
00:03:23 | disruptek | package management is a stupid problem that shouldn't exist. |
00:03:37 | disruptek | it's dumb to let to consume any more oxygen than is strictly required. |
00:03:49 | FromDiscord | <Clyybber> disruptek: no moduleA.someType != moduleB.someType |
00:04:01 | FromDiscord | <Clyybber> even if they are structurally the same |
00:04:02 | disruptek | not in the backend. |
00:04:12 | FromDiscord | <Clyybber> the backend doesn't fucking matter here |
00:04:17 | disruptek | of course it does. |
00:04:21 | FromDiscord | <Clyybber> no? |
00:04:36 | FromDiscord | <Clyybber> wether the types look the same in the C code is unimportant |
00:05:02 | disruptek | it matters because the FFI won't survive. |
00:05:19 | FromDiscord | <Clyybber> where does the FFI come from suddenly? |
00:05:30 | FromDiscord | <Clyybber> I'm talking about multiple versions of a package |
00:05:38 | FromDiscord | <dom96> What about tuples? |
00:05:41 | disruptek | but whatever. i don't care. it's not a problem i expect to solve, ever, let alone today. |
00:05:53 | disruptek | i hope i'm dead before it fucking matters. |
00:06:13 | disruptek | tuples, procs, c++... so much fun for your snowflake types. |
00:06:16 | FromDiscord | <Clyybber> @dom96 talking only about nominal types |
00:06:27 | FromDiscord | <dom96> But anyway, cool down guys. |
00:06:41 | FromDiscord | <Clyybber> eh, my cursing wasn't meant to be offensive |
00:06:46 | FromDiscord | <Clyybber> I think disruptek understands |
00:06:48 | disruptek | nor is mine. |
00:07:11 | disruptek | i did the "multiple versions of a package" once, early in my nimph days. |
00:07:37 | disruptek | i don't mind telling people it's not supported. |
00:09:17 | FromDiscord | <Clyybber> it already works |
00:09:19 | disruptek | leorize: openssl is a problem we will need to solve relatively soon. |
00:09:21 | FromDiscord | <Clyybber> I just tested it |
00:09:33 | disruptek | yes, but /it should not exist/. |
00:09:34 | FromDiscord | <Clyybber> the type mismatch errors could be improved |
00:09:36 | FromDiscord | <Clyybber> but it works |
00:10:03 | FromDiscord | <dom96> I’m not saying you were offensive. Just felt like frustrations were rising too far for what this topic of discussion deserved 🙂 |
00:10:43 | disruptek | we support recursive hierarchies of packages and dependencies and even those should not be encouraged. |
00:10:45 | FromDiscord | <Clyybber> thanks, I'm not frustrated :) |
00:11:16 | disruptek | i mean, c'mon, are you really satisfied with the state-of-the-art here? |
00:11:20 | disruptek | i think it's dogshit. |
00:11:21 | FromDiscord | <Clyybber> Yeah |
00:11:30 | FromDiscord | <Clyybber> Tell me what should be better |
00:11:35 | FromDiscord | <Clyybber> You just said you don't care |
00:11:36 | leorize | disruptek: please write an rfc for all of this too, like the one you wrote for cps |
00:11:49 | disruptek | c'mon, for what? |
00:11:56 | FromDiscord | <Clyybber> disruptek: Or were you talking to leorize? |
00:12:01 | FromDiscord | <Clyybber> aaah, can't tell anymore |
00:12:03 | FromDiscord | <Clyybber> :D |
00:12:10 | disruptek | i don't want another npm. |
00:12:21 | disruptek | you shouldn't, either. |
00:12:55 | leorize | disruptek: how package management sucks? |
00:13:18 | disruptek | i mean, have some ambition. we have a very fine language and we're reproducing shitty designs from lesser tools. |
00:13:46 | FromDiscord | <Clyybber> all talk no concrete |
00:14:12 | FromDiscord | <Clyybber> even the mafia needs concrete |
00:14:12 | FromDiscord | <sealmove> What's wrong with nimble? :< |
00:14:16 | disruptek | yeah, yeah. you have push rights to nimph last i checked. |
00:14:24 | disruptek | wait, don't you? |
00:14:29 | FromDiscord | <Clyybber> yeah, I don't know what to fix |
00:14:37 | FromDiscord | <Clyybber> you just said theres something wron |
00:14:51 | FromDiscord | <Clyybber> with concrete I didn't mean concrete commits, but concrete problems |
00:14:54 | disruptek | what's wrong is that package management shouldn't even be a thing. 😁 |
00:15:05 | FromDiscord | <Clyybber> because you aren't specific enough for me to get an idea what you are talking about |
00:15:34 | disruptek | a concrete problem is that concepts are too broken for me to move forward with deleting code from nimph-1 for the nimph-2 branch. |
00:15:42 | disruptek | i've mentioned this to you. |
00:15:46 | disruptek | i've supplied tests for you. |
00:15:53 | disruptek | yes, we have a new concepts impl. |
00:16:02 | FromDiscord | <Clyybber> it doesn't solve those issues |
00:16:02 | disruptek | i don't personally require it. |
00:16:20 | FromDiscord | <Clyybber> I mean dig into it; you know the compiler too by now |
00:16:27 | disruptek | yeah, that's the problem. |
00:16:36 | FromDiscord | <Clyybber> I was in that phase too |
00:17:03 | disruptek | the homeless-they-are-about-to-repossess-all-my-worldly-possessions phase? |
00:17:27 | FromDiscord | <Clyybber> no :/ |
00:17:59 | FromDiscord | <Clyybber> I mean the compiler code stinks phase |
00:18:40 | disruptek | consider nimph-1 to be my rfc on the subject. |
00:19:07 | disruptek | i've barely modified it in the last, i dunno, 8-10 months. |
00:19:15 | disruptek | if you think it's a step in the right direction, say so. |
00:19:26 | disruptek | if you think it's a 👎, that's valuable feedback, too. |
00:19:30 | FromDiscord | <Clyybber> haven't tried it |
00:19:39 | FromDiscord | <dom96> Maybe a worthwhile endeavour would be to create an alternative implementation of the Nim compiler? |
00:19:44 | FromDiscord | <Clyybber> the thing about package management is that you decide if its a thing |
00:19:45 | disruptek | well then don't ask me to wax philosophical on the subject. |
00:19:59 | FromDiscord | <Clyybber> @dom96 I don't think so, its not that bad |
00:20:14 | FromDiscord | <Clyybber> some parts are worse than others but all in all its pretty good |
00:20:25 | leorize | it will only be worth it if you pay :P |
00:20:34 | disruptek | i agree that the compiler largely works. |
00:22:12 | FromDiscord | <sealmove> What would be the benefit of building it from scratch? |
00:22:19 | FromDiscord | <Clyybber> nothing |
00:22:26 | disruptek | i can't think of a single thing. |
00:22:57 | FromDiscord | <sealmove> I wonder if dom is trolling |
00:23:03 | FromDiscord | <Clyybber> no he's not |
00:23:10 | disruptek | if i were going to change something, i'd make the compiler more of a test-bed for new code. |
00:23:30 | FromDiscord | <Clyybber> thats what csourcesv2 should do |
00:23:31 | FromDiscord | <Clyybber> in some way |
00:23:40 | disruptek | it's the largest nim project i've worked on. i'd use it to research problems with large projects and actually fix them. |
00:23:55 | disruptek | it's a fucking nightmare trying to deal with circular deps, for example. |
00:24:08 | FromDiscord | <Clyybber> never for me :D |
00:24:10 | FromDiscord | <dom96> I’m not trolling. It only makes sense if you’re interested and passionate about compiler dev |
00:24:10 | disruptek | the documentation could be vastly improved. |
00:24:28 | disruptek | i don't think the compiler is holding us back. |
00:24:29 | FromDiscord | <dom96> It would be a good test of the Nim specification. |
00:24:43 | FromDiscord | <Clyybber> its not; its still relatively small |
00:24:46 | leorize | we all know that the spec still have plenty of holes |
00:24:52 | FromDiscord | <Clyybber> it can be reworked quite easily |
00:25:49 | FromDiscord | <dom96> A better codebase. The current codebase has gone through at least one translation from another language. |
00:26:00 | * | rockcavera quit (Read error: Connection reset by peer) |
00:26:08 | FromDiscord | <dom96> But likely not worth the effort anyway |
00:26:09 | disruptek | you can have that now: just submit a PR. |
00:26:20 | FromDiscord | <dom96> Unless you’re really really into this type of work |
00:26:23 | FromDiscord | <Clyybber> Yeah, the current codebase is fine |
00:26:31 | * | rockcavera joined #nim |
00:28:47 | Zoom[m] | Someone said disruptek is "in the mood" but he's actually more on point today than I usually catch him here. |
00:29:17 | mipri | s/point/topic/ |
00:29:48 | Zoom[m] | right |
00:33:14 | disruptek | frosty's api should change to better support `with`, reordering arguments. |
00:34:23 | Zoom[m] | What's with the alternative compiler implementation? There should probably be some requirements which the current impl doesn't meet and which prohibit moving forward in some specific direction. B9esides being one huge test of a language specification, of course) |
00:34:33 | disruptek | !repo nlvm |
00:34:34 | disbot | https://github.com/arnetheduck/nlvm -- 9nlvm: 11LLVM-based compiler for the Nim language 15 358⭐ 26🍴 7& 1 more... |
00:34:44 | Zoom[m] | * What's with the alternative compiler implementation? There should probably be some requirements which the current impl doesn't meet and which prohibit moving forward in some specific direction. (Besides being one huge test of a language specification, of course) |
01:22:02 | * | Tanger joined #nim |
01:38:23 | FromDiscord | <Ricky Spanish> sent a code paste, see https://play.nim-lang.org/#ix=2Iun |
01:39:56 | mipri | yes, you want a Table[string, Something] |
01:40:31 | FromDiscord | <Ricky Spanish> ok thank you mipri |
01:49:34 | FromDiscord | <JSONBash> Do i remember someone saying that they were writing an alpaca library for nim? |
01:50:38 | mipri | a wrapper. said not too long ago. |
01:51:53 | FromDiscord | <JSONBash> what i meant yeah, would be interested in that |
01:52:00 | FromDiscord | <JSONBash> thanks ill go looking for it |
01:56:01 | * | klaufir_ quit (Ping timeout: 268 seconds) |
02:01:06 | FromDiscord | <ElegantBeef> What's with `var s: string = 3` giving this weird error message `type mismatch: got 'int literal(3)' for '3' but expected 'string'` |
02:01:16 | FromDiscord | <ElegantBeef> "for 3"? |
02:01:44 | mipri | what part do you think is weird? |
02:01:53 | FromDiscord | <juan_carlos> error makes sense. |
02:02:05 | FromDiscord | <juan_carlos> error very grammar. |
02:02:12 | mipri | is the bot dropping characters here? That makes complete sense to me. It's telling you how it's interpreting the integer literal there. |
02:02:22 | mipri | it's not interpreting it as a string |
02:02:35 | FromDiscord | <ElegantBeef> No it's not dropping |
02:02:50 | disruptek | it's probably just a bug in the error message format string. |
02:02:51 | FromDiscord | <ElegantBeef> I was just curious what it meant by `for 3`, and you've explained it |
02:02:54 | FromDiscord | <ajusa> to rephrase the error, `understood 3 to be an int literal(3), but expected a string` |
02:03:15 | FromDiscord | <ElegantBeef> It's just weird phrasing imo |
02:03:25 | mipri | the 'for' there is just English prose. the '3' is text from your program |
02:03:42 | disruptek | should be `for 's'`, though, most likely. |
02:03:52 | mipri | no, no problem with 's' |
02:03:58 | FromDiscord | <Rika> what? |
02:04:11 | FromDiscord | <Rika> its more like "interpreted 3 as int literal(3)" |
02:04:24 | FromDiscord | <ElegantBeef> the code is `var a:string = 3` so i get that it's saying that it takes 3 as an int literal, but it's still fairly weird to read |
02:04:34 | FromDiscord | <Rika> for (something), i got[interpreted it as] 3 |
02:05:08 | FromDiscord | <Rika> i guess it can be worded better |
02:05:17 | mipri | there's no weirdness there to me, to the point that I have try and guess at why it might be weird to you |
02:05:41 | mipri | like the theory above: you're reading the 'for' as Nim syntax rather than the English word |
02:09:17 | FromDiscord | <ElegantBeef> i think `got '3' as 'int literal(3)', but expected string` reads better, but meh i'm just silly i guess 😄 |
02:10:28 | FromDiscord | <Rika> that makes no sense to me |
02:10:55 | FromDiscord | <ElegantBeef> I mean in the case of literals i dont even see why this is even invoked |
02:11:15 | mipri | what is 'this' that's getting invoked? |
02:11:16 | * | abm quit (Read error: Connection reset by peer) |
02:11:23 | FromDiscord | <Rika> got means interpreted ? as (the next word), so it makes no sense that you'd interpret something as a raw "3" |
02:11:25 | FromDiscord | <ElegantBeef> The non legacy type mismatch |
02:12:50 | FromDiscord | <ElegantBeef> before devel it'd be `type mismatch: got <int literal(3)> but expected 'string'` |
02:13:41 | mipri | yeah, I prefer that version |
02:13:49 | FromDiscord | <Rika> maybe `parsed 'x' as <> but expected ''` is better no/ |
02:13:50 | FromDiscord | <ElegantBeef> When using variables though this isnt annoying `type mismatch: got 'int' for 'b' but expected 'string'` |
02:14:04 | FromDiscord | <ElegantBeef> It's just literals that it reads weird for me |
02:14:27 | disruptek | that's how i feel about greek. |
02:14:53 | mipri | ok, the error reads fine to me, but I guess I don't like that it repeats the literal |
02:14:53 | FromDiscord | <ElegantBeef> but eh, i'm just colouring errors, i'll revisit this after 😄 |
02:15:24 | FromDiscord | <ElegantBeef> Well for the literal version i dont get why it needs to say it's '3' like yea it's a literal |
02:15:58 | FromDiscord | <Rika> well it could be 0b01010100101010 |
02:16:01 | FromDiscord | <Rika> or whatever |
02:16:17 | FromDiscord | <ElegantBeef> and then it'd still be an `int literal(3)` |
02:16:30 | FromDiscord | <Rika> yes but its not obvious what the value is |
02:16:46 | FromDiscord | <Rika> it might be needed to fit into an int16 but its one byte too much or w/e |
02:16:51 | FromDiscord | <Rika> bit too much |
02:16:53 | FromDiscord | <ElegantBeef> Well then for decimal values we dont show it 😄 |
02:16:59 | mipri | I suppose it's for type mismatch: got 'int literal(-1)' for '0b1111111111111111111111111111111111111111111111111111111111111111' but expected 'string' |
02:17:20 | FromDiscord | <Rika> expected 'int32' or something xd |
02:17:23 | FromDiscord | <ElegantBeef> Yea tested with hex`'type mismatch: got 'int literal(255)' for '0x000000FF' but expected 'string''` |
02:18:34 | FromDiscord | <juan_carlos> It should use roman numerals for clarity. |
02:18:42 | * | mbomba quit (Quit: WeeChat 3.0) |
02:18:43 | FromDiscord | <ElegantBeef> lol |
02:24:29 | FromDiscord | <Rika> lmao |
02:24:47 | FromDiscord | <Rika> what if we had roman numeral literals |
02:25:19 | FromDiscord | <ElegantBeef> We'd be dumb |
02:25:25 | FromDiscord | <windowsboy111> does nimx have a webview widget? |
02:25:33 | FromDiscord | <windowsboy111> currently cannot find it |
02:25:38 | FromDiscord | <ElegantBeef> Probably doesnt |
02:25:52 | FromDiscord | <windowsboy111> 😩 |
02:26:00 | FromDiscord | <windowsboy111> (edit) "😩" => "sigh" |
02:26:17 | FromDiscord | <windowsboy111> (edit) "sigh ... " added "(heard that IRC has no emojis so)" |
02:26:54 | FromDiscord | <ElegantBeef> No but they do get multiple messages for edits |
02:27:09 | disruptek | we have emojis, chucklehead. |
02:27:22 | disruptek | and, i've already pointed you at like four different web-views for nim. |
02:27:48 | FromDiscord | <ElegantBeef> As have I |
02:28:08 | FromDiscord | <windowsboy111> but those four either↵- webview only↵or↵- no webview |
02:28:51 | FromDiscord | <ElegantBeef> Use gtk |
02:28:53 | FromDiscord | <windowsboy111> Tried neel, gtk, nimx, wx |
02:29:12 | FromDiscord | <ElegantBeef> Are you even asking for software that exists? |
02:30:02 | FromDiscord | <windowsboy111> at least once I tried gtk in C++ but I'm bad at it |
02:30:17 | disruptek | so? |
02:30:46 | disruptek | just think of all the software you don't have to write once you limit yourself to nim. |
02:30:49 | disruptek | it's liberating. |
03:03:17 | FromDiscord | <Avatarfighter> does anyone have any recommendations on a library for graph data structures?\ |
03:03:20 | FromDiscord | <Avatarfighter> (edit) "structures?\" => "structures?" |
03:05:42 | * | muffindrake quit (Ping timeout: 268 seconds) |
03:07:46 | * | muffindrake joined #nim |
03:09:29 | * | NimBot joined #nim |
03:18:03 | FromDiscord | <speckledlemon> I've used grim a little bit, seems fine |
03:18:21 | FromDiscord | <Rika> theres also gram |
03:22:20 | disruptek | i found grim's api pretty tough to tolerate; hence gram. |
03:30:16 | FromDiscord | <speckledlemon> cool, I'll try it |
03:46:08 | FromGitter | <iffy> Can I safely pass a Stream to a thread to be read from? Specifically an `outputStream` from `startProcess`. |
03:47:31 | FromGitter | <iffy> Currently, it sometimes hangs. It could be the process, of course, but I'm trying to diagnose. |
04:04:17 | * | muffindrake quit (Ping timeout: 268 seconds) |
04:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
04:06:02 | * | muffindrake joined #nim |
04:06:37 | * | supakeen joined #nim |
04:06:44 | Evolver | In a project, how do I force all imports to always be qualified, as in `from x import nil`, but applicable to all modules? |
04:10:07 | FromDiscord | <ElegantBeef> `from system import nil`, and all other imported modules |
04:10:42 | FromDiscord | <ElegantBeef> And have fun with `system.int` and `system.````(10, 20)` |
04:11:26 | Evolver | I wouldn't do it for `system`. |
04:11:32 | Evolver | now that you mention it |
04:11:59 | Evolver | ElegantBeef: I'm coming from Python and I like my imports qualified so I know where they're coming from. |
04:12:36 | FromDiscord | <ElegantBeef> I know, but Nim doesnt have python syntax so using qualified imports breaks part of Nim's syntax |
04:13:20 | FromDiscord | <ElegantBeef> Like Nim doesnt have classes, so with all qualified imports you have to invoke procCalls qualified and like C where all the arguments are nside |
04:13:30 | FromDiscord | <Rika> Nim doesn't import like python does |
04:13:38 | FromDiscord | <Rika> Nim doesn't have magic methods |
04:13:42 | FromDiscord | <ElegantBeef> so instead of `seq.add(b)` you get `add(seq, b)` |
04:13:45 | Evolver | The code is just more readable for me with imports qualified. |
04:13:47 | FromDiscord | <Rika> So all your operators will need to be qualified |
04:14:00 | FromDiscord | <Rika> Then qualify if needed |
04:14:12 | Evolver | I don't need to qualify the common stuff, just everything else. |
04:14:17 | FromDiscord | <Rika> You don't need to force qualifying to qualify stuff |
04:14:26 | * | vicfred joined #nim |
04:14:30 | FromDiscord | <Rika> Import normally and qualify when needed |
04:14:43 | FromDiscord | <ElegantBeef> In nim qualified imports is only when there is an overlap |
04:14:59 | FromDiscord | <Rika> There is no "everything else", many modules define custom operators |
04:15:25 | FromDiscord | <Rika> If you force qualification operators will be included no matter what |
04:15:26 | FromDiscord | <Ricky Spanish> sent a code paste, see https://play.nim-lang.org/#ix=2Iv1 |
04:15:32 | FromDiscord | <ElegantBeef> It will be weird at first, hell i came from C# it was really weird at first, but you can get used to it 😄 |
04:15:42 | FromDiscord | <ElegantBeef> what's `max` do? |
04:16:00 | FromDiscord | <Ricky Spanish> returns the largest value in the range afaik |
04:16:01 | FromDiscord | <Rika> Get the max of a sequence |
04:16:34 | FromDiscord | <Rika> Just `foldl` the sequence to a max |
04:16:39 | FromDiscord | <ElegantBeef> ok so then `algorithm.sorted(seq)[^1]` or ^ |
04:16:46 | FromDiscord | <Rika> That's slow lol |
04:16:52 | FromDiscord | <ElegantBeef> Yea |
04:17:08 | FromDiscord | <Ricky Spanish> ok will look up both ways, regardless, thank you both |
04:17:13 | FromDiscord | <ElegantBeef> `sequtils` for `foldl` |
04:17:37 | ForumUpdaterBot | New thread by Juancarlospaco: NodeJS for Nim, see https://forum.nim-lang.org/t/7266 |
04:17:37 | FromDiscord | <Rika> Yeah sorry I'm on mobile and typing with one habd |
04:17:58 | FromDiscord | <ElegantBeef> Well quit playing with yourself and type with two 😛 |
04:18:10 | FromDiscord | <Rika> I'm eating smh |
04:19:40 | Evolver | Is there a ##nim-news channel like say ##aws-news ? |
04:20:06 | Evolver | with new links and news |
04:20:10 | FromDiscord | <ElegantBeef> The nim discord has github events,community events, and announcements. No clue if they're bridged |
04:20:24 | FromDiscord | <ElegantBeef> Ah #nim-news is |
04:20:37 | Evolver | thank you |
04:22:03 | FromDiscord | <ElegantBeef> @Ricky Spanish you could always make a `min` and `max` and throw them in sequtils 😄 |
04:22:31 | FromDiscord | <ElegantBeef> ~~I may or may not suggest making PRs for any thing people want since if you want them someone else is bound to want them~~ |
04:25:46 | FromDiscord | <Ricky Spanish> yeh if i get to a point where i see it often enough in what im doing ill consider it, im just not a fan morally of mimicking python...i have opinions but wont state them for risk of a flame war |
04:26:41 | FromDiscord | <ElegantBeef> I just think that if it's something that isnt that obscure it should be in the stdlib, especially if people want it |
04:27:01 | FromDiscord | <Ricky Spanish> i agree there, it helps this type of copy and paste task for sure |
04:27:15 | FromDiscord | <ElegantBeef> Well it's not just about that |
04:27:30 | FromDiscord | <ElegantBeef> It's about having these procedures people want and to prevent people from having to write them |
04:28:32 | FromDiscord | <ElegantBeef> Like really something this simple should be fine for the stdlib, although probably can be done smarter idk 😄 https://play.nim-lang.org/#ix=2Iv7 |
04:29:28 | FromDiscord | <Ricky Spanish> yeh youre correct |
04:30:02 | FromDiscord | <Ricky Spanish> i expected to find it in the math module when i started looking |
04:30:38 | FromDiscord | <Ricky Spanish> also google didnt help, really throughs some curve-balls when you lookup nim followed by anything really |
04:30:51 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/theindex.html better than google |
04:32:47 | FromDiscord | <ElegantBeef> Wait |
04:32:53 | FromDiscord | <ElegantBeef> min/max are in system 😄 |
04:33:20 | FromDiscord | <ElegantBeef> I didnt check since i expected you to, but they're there 😄 |
04:33:26 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/system.html#min%2CopenArray%5BT%5D |
04:36:34 | * | narimiran joined #nim |
04:36:52 | FromDiscord | <Ricky Spanish> i didnt expect them to be in system lol as i said i expected theyd be in math or sequtils |
04:37:31 | FromDiscord | <Ricky Spanish> ok thanks anyway 😄 |
04:39:03 | * | rockcavera quit (Remote host closed the connection) |
04:45:20 | FromDiscord | <ElegantBeef> @juan_carlos are your code examples on nodejs release builds? |
04:46:46 | FromDiscord | <juan_carlos> danger |
04:47:08 | FromDiscord | <ElegantBeef> Ah so yes |
04:53:08 | * | e joined #nim |
04:53:31 | * | e is now known as Guest6581 |
04:55:22 | * | spiderstew joined #nim |
04:56:42 | * | spiderstew_ quit (Ping timeout: 268 seconds) |
04:57:05 | * | Guest6581 quit (Ping timeout: 240 seconds) |
05:35:02 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
06:11:21 | * | habamax joined #nim |
06:38:03 | * | lbart quit (Ping timeout: 265 seconds) |
07:04:12 | * | fanta1 joined #nim |
07:33:51 | FromGitter | <awr1> oh my god |
07:35:22 | FromGitter | <awr1> I saw the latest Advent of Code day problems and I started doing it a 'normal' way but as I was doing it I thought of something much more cursed which I had to implement instead |
07:35:49 | FromGitter | <awr1> https://github.com/awr1/aoc/blob/main/2020/day_18.nim |
07:37:46 | narimiran | omg, nice |
07:38:04 | narimiran | i'm still struggling with pt.2 without this black magic |
07:39:30 | narimiran | but we don't have `-`, just `+` and `*` :/ |
07:52:25 | disruptek | face it, `-` just isn't that great. |
07:57:22 | Zevv | what's part 2 |
07:58:16 | FromGitter | <awr1> part 2 is standard precedence, but with +/- and */div flipped |
07:58:42 | FromGitter | <awr1> i assume you're using your peg library? |
08:01:38 | Zevv | I dropped out a week ago |
08:01:51 | Zevv | but otherwise, probably, because it's just a basic example from the manual :) |
08:04:10 | FromGitter | <awr1> yeah im getting tired of doing these problems |
08:04:19 | FromGitter | <awr1> first year doing this - probably last year lol |
08:04:58 | Zevv | i used to do these in my morning commute, but since there's no communting it doesn't really fit my schedule |
08:05:22 | Zevv | the quickies are ok, but if I need some more time it's a hassle |
08:05:32 | FromGitter | <awr1> i'm going for relative conciseness |
08:05:36 | Zevv | also, I have enough problems as I am :) |
08:05:52 | FromGitter | <awr1> `cloc` says in total for all problems i have 411 sloc |
08:06:02 | FromDiscord | <tomjw> I was just trying to do that exact implementation, using macros. But I was going to ask if it's possible as I couldn't get it to work. |
08:06:47 | FromGitter | <awr1> it took some mucking about with the compiler but i got it to work lol |
08:07:38 | Zevv | awr1: you and I have similar style it seems. narimiran would call it "you and your cryptic stuff" :) |
08:07:45 | narimiran | :) |
08:07:51 | FromGitter | <awr1> lol |
08:09:45 | FromGitter | <awr1> is there a reason nim defines `div` for ints instead of `/` |
08:10:18 | FromDiscord | <ElegantBeef> Pascal? |
08:10:34 | FromGitter | <awr1> hm i see |
08:10:46 | FromGitter | <awr1> `/` does work for ints by default but it returns a float |
08:10:47 | FromGitter | <awr1> blegh |
08:28:42 | FromDiscord | <Rika> well that is what most people expect |
08:29:31 | FromDiscord | <Rika> see what / does for python |
08:29:51 | FromDiscord | <Rika> and js too (but thats kinda cheating since js doesnt have integers) |
08:30:16 | disruptek | man, i am really fucking tired of this. |
08:30:57 | disruptek | D:\a\gittyup\gittyup\nim\lib\system\fatal.nim(49, 5) Error: unhandled exception: C:\Users\runneradmin\.nimble\pkgs\nimterop-0.6.11\nimterop\build\tools.nim(198, 12) `findFile(check, path, regex = regex).len != 0` make failed [AssertionDefect] |
08:56:16 | * | PMunch joined #nim |
08:56:48 | ForumUpdaterBot | New question by Benjamin Audren: How to evaluate an expression in nim?, see https://stackoverflow.com/questions/65354096/how-to-evaluate-an-expression-in-nim |
08:59:34 | FromDiscord | <Rika> i wanna answer that but i dont wanna make an account |
08:59:42 | PMunch | I'm about to answer |
08:59:49 | FromDiscord | <Rika> nice |
08:59:59 | PMunch | But I ran into a weird SIGSEGV when trying some stuff |
09:00:13 | FromDiscord | <Rika> how |
09:00:22 | PMunch | !eval import macros; echo static(parseStmt("1+2")) |
09:00:23 | NimBot | Compile failed: <no output> |
09:00:29 | PMunch | That SIGSEGVs |
09:00:46 | FromDiscord | <Rika> but this doesnt? |
09:00:54 | FromDiscord | <Rika> !eval import macros; echo static: parseStmt("1+2") |
09:00:56 | NimBot | Compile failed: /playground/nim/lib/system.nim(1983, 32) Error: request to generate code for .compileTime proc: $ |
09:01:03 | FromDiscord | <Rika> :ThonkDumb: |
09:01:15 | FromDiscord | <Rika> but the issue is that parsestmt returns ast |
09:01:24 | FromDiscord | <Rika> so it has to be used in a macro |
09:01:25 | PMunch | Yeah |
09:13:13 | FromGitter | <awr1> yes, macros allow NimNodes to be injected into your program's AST |
09:15:45 | * | regreg joined #nim |
09:19:12 | FromDiscord | <ElegantBeef> I've got a feeling this is for AOC so they're not going to be able to do what they want 😄 |
09:19:56 | PMunch | I didn't have time to look at yesterdays AoC :( |
09:20:32 | PMunch | And I don't think I will have time to look at this one either, at least not until after a Christmas beer tasting, which will probably leave me incapable of finishing it :P |
09:21:12 | Araq | awr1: while Pascal does it this way, that's not the reason. The reason is that Pascal does it *better* than C as 'div' is very different from / |
09:21:30 | Araq | see also Python 3, where they had to fix this misdesign |
09:21:45 | FromDiscord | <lqdev> @Rika did so for you |
09:22:18 | FromDiscord | <lqdev> this is why i hate newcomers from python >_< |
09:22:40 | Araq | I take great pride in the fact that Nim's mistakes are all novel :-) |
09:23:06 | disruptek | novelty will only get you so far. |
09:23:08 | * | mbomba joined #nim |
09:23:18 | Araq | fixed all old mistakes. And then added my own |
09:28:41 | disruptek | hmm, this tuple renderer in jason is stupid. |
09:29:00 | * | Tanger quit (Remote host closed the connection) |
09:29:19 | disruptek | i guess i still have a bunch of shit to optimize in here. |
09:35:36 | PMunch | @lqdev, I mean, you can have runtime evaluation in Nim :P |
09:35:43 | PMunch | It's just a bit trickier than `eval` |
09:35:57 | FromDiscord | <lqdev> but that doesn't mean you should |
09:36:21 | FromDiscord | <sealmove> runtime evaluation of what? |
09:39:12 | FromDiscord | <Rika> strings |
09:39:19 | FromDiscord | <Rika> evaluating strings as code |
09:40:19 | FromDiscord | <sealmove> without "compiler as api"? |
09:41:53 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
09:44:19 | PMunch | No |
09:44:32 | PMunch | But you can import the Nim compiler and run NimScript in your project :) |
09:46:34 | FromDiscord | <lqdev> but as i said - that doesn't mean you should |
09:48:26 | PMunch | Well, not for 1+2 at least |
09:50:52 | FromDiscord | <Vindaar> did my duty and finished the survey 🙂 |
10:00:32 | FromDiscord | <lqdev> is there some easy way to see whether a float represents an integer exactly>? |
10:01:07 | disruptek | yes. |
10:01:27 | FromDiscord | <lqdev> show me the way. |
10:02:20 | disruptek | teenagers. |
10:02:39 | FromDiscord | <lqdev> best i could come up with is `x - trunc(x) == 0` |
10:02:47 | PMunch | splitDecimal? |
10:03:05 | disruptek | i don't see what's wrong with that. |
10:03:24 | PMunch | myFloat.splitDecimal.floatpart == 0.0 |
10:03:35 | disruptek | too hard to read. |
10:05:35 | disruptek | x == trunc(x) is literally what you're asking for, right? |
10:05:47 | disruptek | how could you say that more simply? |
10:07:15 | FromDiscord | <lqdev> i guess that could work, was just asking if there's a more "correct" way |
10:08:23 | disruptek | what matters is that your intent is clear. anything else is a waste of effort. |
10:11:15 | FromDiscord | <lqdev> yeah, but floats are quite hairy |
10:11:43 | disruptek | what? |
10:12:01 | FromDiscord | <lqdev> imprecise. |
10:12:28 | FromDiscord | <lqdev> but i guess there isn't much you can screw up with a simple expression like `x == trunc(x)` |
10:13:03 | disruptek | you can template it if it helps readability. |
10:13:51 | FromGitter | <ynfle> Can someone help me with this ambiguos error https://play.nim-lang.org/#ix=2Iwo? |
10:13:56 | PMunch | Hmm, is there a regex search and replace in Vim that handles casing? |
10:14:13 | PMunch | I often find myself wanting to replace something like x and minX with y and minY |
10:14:43 | PMunch | @ynfle, you didn't wrap your tuple in a seq |
10:14:48 | disruptek | this. |
10:15:09 | PMunch | @ynfle: https://play.nim-lang.org/#ix=2Iwq |
10:15:19 | FromGitter | <ynfle> Thanks |
10:15:37 | FromDiscord | <Rika> pmunch `:s/.../.../i` doesnt work ? |
10:15:37 | FromGitter | <ynfle> Should the typing say that the issue is in the 3rd type not the first? |
10:15:43 | FromDiscord | <Rika> or you mean changing case? |
10:16:11 | disruptek | he wants to change case, i think. |
10:16:12 | FromGitter | <ynfle> @PMunch https://vim.fandom.com/wiki/Changing_case_with_regular_expressions |
10:16:29 | PMunch | @Rika, I want it to preserve the case |
10:16:58 | PMunch | Take this line "for x in minX..maxX" I want to transform that into "for y in minY..maxY" |
10:17:19 | FromDiscord | <Rika> oh i believe thats not in vim |
10:18:01 | PMunch | Bummer |
10:19:00 | * | letto quit (Quit: Konversation terminated!) |
10:20:52 | * | letto joined #nim |
10:23:53 | * | clemens3_ quit (Ping timeout: 260 seconds) |
10:25:45 | * | clemens3_ joined #nim |
10:27:46 | disruptek | billy joel had some choice words on the subject. |
10:28:02 | disruptek | "get it right the first time," i believe he said. |
10:29:03 | disruptek | wait, not billy joel. ezra pound. |
10:29:06 | disruptek | i was way off. |
10:35:27 | * | haxscramper joined #nim |
10:36:04 | FromGitter | <awr1> you have two options for runtime eval - import compiler nimble package as PMunch said or you, well, shell out to compiler |
10:36:30 | FromGitter | <awr1> dunno if nim compiler can take files from stdin |
10:36:36 | haxscramper | It can |
10:36:47 | FromGitter | <awr1> is it the same way as gcc where it's just - |
10:37:02 | haxscramper | `echo "echo 1 + 2" | nim r -` |
10:37:21 | FromGitter | <awr1> yeah that's what gcc does too |
10:37:28 | FromGitter | <awr1> neat |
10:37:36 | haxscramper | This one also runs code |
10:37:45 | FromGitter | <awr1> yeah i use nim r too |
10:38:54 | * | klaufir_ joined #nim |
11:05:05 | FromDiscord | <Rika> That was introduced by 1.4 right |
11:26:16 | Araq | https://techxplore.com/news/2020-12-brain-code-language.html |
11:27:41 | FromDiscord | <dom96> good morning |
11:32:16 | FromDiscord | <mratsim> only 11:30AM in the UK, still morning? 😉 |
11:33:30 | haxscramper | https://play.nim-lang.org/#ix=2IwV - I'm thinking about implementing something along these lines for C++ deriving from C++ classes |
11:33:32 | FromDiscord | <dom96> Yes. What else would it be? 🙂 |
11:33:50 | haxscramper | This is just how generated part might look like |
11:35:29 | haxscramper | If I understand correctly https://nim-lang.org/docs/macros.html#signatureHash%2CNimNode can be used to return identifiers for nim types, and only few built-in ones are defined via macros like `NI` |
11:42:15 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
11:43:13 | * | pbb joined #nim |
11:51:52 | * | klaufir_ quit (Ping timeout: 256 seconds) |
11:59:33 | FromDiscord | <mratsim> oh, signatureHash is new? |
12:01:11 | FromDiscord | <mratsim> @haxscramper, this might be useful: https://github.com/nim-lang/Nim/wiki/Playing-with-CPP--VTABLE-from-Nim |
12:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
12:06:16 | PMunch | Just did day 17, that was pretty simple |
12:06:33 | * | supakeen joined #nim |
12:06:47 | narimiran | PMunch: day 18 will be interesting for you, i imagine |
12:07:11 | * | rockcavera joined #nim |
12:07:24 | PMunch | Unfortunately I won't be able to stream today :( |
12:08:38 | FromDiscord | <haxscramper> @mratsim I've seen this one, but it is probably even more unstable compared to codegen |
12:12:34 | * | mbomba quit (Quit: WeeChat 3.0) |
12:16:09 | FromDiscord | <sealmove> too bad |
12:16:58 | FromDiscord | <sealmove> @PMunch I am finally finished with binaryparse. It's ready for another review and potentially a merge. I implemented magic the way you like it, though it's only ready for strings for now. |
12:18:04 | FromDiscord | <sealmove> strings are terminated by next field by default. Only if you use assertion or size this changes. |
12:19:10 | FromDiscord | <sealmove> `+1,484 −859` that's a huge diff >_< |
12:19:33 | FromDiscord | <sealmove> I doupt there is any code left unchanged |
12:19:44 | FromDiscord | <sealmove> doubt |
12:22:18 | FromDiscord | <sealmove> After we merge this I can start working on the plugin API |
12:22:30 | PMunch | So `s: myString` is no longer NULL terminated? |
12:22:34 | FromDiscord | <sealmove> The code is modular enough for it now |
12:22:52 | FromDiscord | <sealmove> yeah right, `s: myString` will error if next field doesn't use assertion |
12:23:01 | FromDiscord | <sealmove> if you want null terminated you can do it explicitely |
12:23:46 | FromDiscord | <sealmove> I thought about all the different senarios and I think this is the least confusing way to do it |
12:24:03 | FromDiscord | <sealmove> but! |
12:24:17 | FromDiscord | <sealmove> seq of null terminated strings is simply `s: mySeq[10]` |
12:24:36 | FromDiscord | <sealmove> and a single string of length 10 is `s: myString(10)` |
12:26:53 | PMunch | Hmm |
12:27:41 | FromDiscord | <sealmove> in current implementation how do you do a single single that is terminated by next field? |
12:27:48 | FromDiscord | <sealmove> single string |
12:28:23 | PMunch | Simply `s: myString; s: magic = "STOP"` IIRC |
12:28:55 | FromDiscord | <sealmove> ok, so same as with new. so if next field doesn't use assertion then it's null-terminated? |
12:29:50 | FromDiscord | <sealmove> i prefer producing an error in this case, but whatever you prefer |
12:30:36 | PMunch | Yeah that's pretty much the current rule |
12:30:51 | PMunch | I mean optimally the new version should be backwards compatible |
12:32:00 | FromDiscord | <sealmove> fine. but i want to change empty brackets because it's the wrong syntax. |
12:32:12 | * | oprypin quit (Quit: Bye) |
12:32:20 | * | oprypin joined #nim |
12:32:25 | FromDiscord | <sealmove> `a[]` should be `{a}`. this way you can do `{a[5]}` |
12:32:37 | * | oprypin quit (Client Quit) |
12:33:10 | FromDiscord | <sealmove> (magic-terminated seq of seq) |
12:33:33 | * | oprypin joined #nim |
12:37:54 | FromDiscord | <sealmove> and `a` can be of any type 😉 you can terminated any sequence with magic, it doesn't have to be `s` |
12:39:02 | FromDiscord | <bark> also, in nim-lsp setups you can rename variables and it'll find them for you |
12:39:10 | FromDiscord | <bark> (edit) "also, in nim-lsp setups you can rename variables and it'll find them ... for" added "and rename them" |
12:39:47 | FromDiscord | <bark> although my setup has been acting out lately |
12:41:26 | FromDiscord | <bark> (edit) "although my setup has been acting out lately ... " added "and i've lost the ability to rename 😢" |
12:41:38 | * | oprypin quit (Quit: Bye) |
12:42:39 | * | oprypin joined #nim |
12:42:59 | PMunch | narimiran, why did you think day 18 would be particularly interesting to me? |
12:43:07 | narimiran | PMunch: npeg stuff |
12:43:12 | PMunch | Oh :P |
12:43:16 | PMunch | I solved it without npeg |
12:43:34 | PMunch | https://github.com/PMunch/aoc2020/blob/master/day18/part2.nim |
12:46:25 | Zevv | "awaitingMul" |
12:47:05 | PMunch | Yeah with only two opts I just await multiplying until I see another multiplication or I reach the end of an expression |
12:48:33 | Zevv | you didn't even *try* |
12:48:49 | PMunch | Ey, I'm just solving the task at hand! |
12:49:13 | Zevv | oh wait, I ment "*I* didn't even try" |
12:49:20 | Zevv | because I am solving other puzzles today |
12:49:22 | Zevv | for hard money |
12:49:39 | Zevv | mua ha ha |
12:49:50 | PMunch | Well, I'm currently at work.. |
12:50:01 | narimiran | PMunch: on a quick glance, that looks cleaner than my semi-recursive stuff |
12:50:04 | Zevv | ooh for 50 euros I will not tell your boss |
12:50:08 | Zevv | you're playing at work time |
12:50:23 | PMunch | Everybody needs a break once in a while ;) |
12:51:03 | PMunch | And forcing this C# into my brain feels like torture. Trying to re-learn the stuff from Java I've been trying to de-learn for the past couple of years.. |
12:51:17 | PMunch | C# is like the worst parts of Java combined with the worst parts of Ruby.. |
12:51:30 | narimiran | PMunch: oh, yours is also recursive, just cleaner :D |
12:51:33 | PMunch | Well, Ruby on Rails at least |
12:51:53 | FromDiscord | <bark> guys guys i have finally solved day 1 of aoc :D |
12:51:54 | PMunch | narimiran, what did you do to end up with something messier than that? |
12:52:01 | PMunch | @bark, congrats :) |
12:52:15 | PMunch | Do you want comments on it? |
12:54:08 | * | dddddd quit (Ping timeout: 256 seconds) |
12:55:27 | FromDiscord | <bark> me? not really, it's so inefficient I am even reading the file 3x... |
12:55:37 | narimiran | PMunch: ah, upon further reading, it is just that i didn't have a template so i do basically the same stuff for a digit and `(`. but you do too :) |
12:55:41 | FromDiscord | <bark> it'd burn your eyes |
12:56:38 | PMunch | narimiran, ah right, yeah I tend to put stuff in templates as soon as I use it twice |
12:56:54 | PMunch | @bark, haha it's a nice way to learn though :) |
12:56:57 | narimiran | PMunch: i'll probably refactor mine to something like that |
12:57:58 | * | JochenSchroeder[ joined #nim |
12:58:37 | * | superbia joined #nim |
12:58:53 | FromDiscord | <sealmove> @PMunch fixed, strings are now null-terminated by default |
12:58:58 | * | dddddd joined #nim |
12:59:20 | narimiran | (and i'll steal this string stream stuff) |
12:59:24 | FromDiscord | <bark> sent a code paste, see https://play.nim-lang.org/#ix=2Ixd |
12:59:44 | FromDiscord | <sealmove> sent a code paste, see https://play.nim-lang.org/#ix=2Ixe |
12:59:46 | FromDiscord | <bark> (edit) "https://play.nim-lang.org/#ix=2Ixd" => "https://play.nim-lang.org/#ix=2Ixf" |
12:59:46 | superbia | narimiran: pozdrav |
12:59:52 | narimiran | superbia: pozdrav |
12:59:57 | superbia | narimiran: kako je u fiume |
13:00:26 | narimiran | superbia: "lepo, znas kako. ima zenski, ima sve" :P |
13:00:44 | supakeen | pivo |
13:00:46 | superbia | narimiran: :DDDDDDD |
13:01:09 | JochenSchroeder[ | Hi I'm just teaching myself nim for trying it out for some of my scientific code |
13:01:13 | PMunch | narimiran, haha steal away :P |
13:01:31 | JochenSchroeder[ | I"m encountering an precedence order issue that I find highly unexpected |
13:01:56 | JochenSchroeder[ | -x^2 != -(x^2) |
13:02:01 | JochenSchroeder[ | is that expected? |
13:02:23 | JochenSchroeder[ | it's also not the same as -x.pow(2) |
13:02:34 | PMunch | @bark, it's not that bad, apart from the reading the input thrice part :P |
13:02:47 | PMunch | @JochenSchroeder[, yes that is expected |
13:02:49 | * | regreg quit (Ping timeout: 272 seconds) |
13:03:19 | JochenSchroeder[ | ok, that's going to screw up a load of people if they try to convert scientic code |
13:03:21 | PMunch | -x.pow(2) == -(x^2) |
13:03:43 | FromDiscord | <bark> wait, you can do ^ to calculate the power in nim? |
13:04:03 | JochenSchroeder[ | @PMunch yes but -x^2 == (-x)^2 |
13:04:10 | JochenSchroeder[ | that's what I find confusing |
13:04:43 | superbia | you can write macros that convert your math logic to computer logic |
13:04:55 | PMunch | @bark, apparently :P I've been using `pow` until now |
13:05:06 | PMunch | JochenSchroeder[, I agree that it's a bit confusing |
13:06:16 | JochenSchroeder[ | I'm not aware of any other language that does -x^2 == (-x)^2, took me quite a bit of debugging to find why my code wasn't working |
13:07:13 | FromDiscord | <sealmove> really? unary operator has high precedence |
13:07:36 | FromDiscord | <sealmove> i expect most languages to work like this |
13:07:37 | PMunch | I think it's because ^ is a custom operator in Nim, which isn't allowed in most languages |
13:08:02 | FromDiscord | <sealmove> (i mean assuming they allow `^` operator) |
13:08:09 | JochenSchroeder[ | ok, I should qualify, for languages used in scientific context |
13:08:26 | superbia | any language can and is used in scientific context |
13:08:39 | JochenSchroeder[ | yes |
13:08:55 | FromDiscord | <sealmove> if it's a domain specific lang then sure |
13:09:09 | JochenSchroeder[ | sorry aimed at |
13:09:21 | FromDiscord | <sealmove> julia should get this right 😛 |
13:09:27 | JochenSchroeder[ | julia, matlab, python I can think of the top of my head |
13:09:32 | superbia | i don't think nim is aimed at scientific use |
13:10:05 | FromDiscord | <sealmove> python uses `` no? |
13:10:08 | * | Q-Master quit (Ping timeout: 260 seconds) |
13:10:10 | FromDiscord | <bark> yeah python uses |
13:10:15 | JochenSchroeder[ | python uses ** |
13:10:25 | FromDiscord | <bark> but -52 is -25 |
13:11:10 | FromDiscord | <sealmove> apparently they gave `` a higher precedence than unary ops |
13:12:07 | FromDiscord | <sealmove> but I think it's the right call to not do this with `^` in nim, because `^` can be used for other stuff too. as PMunch said it's a custom operator. |
13:13:36 | ForumUpdaterBot | New thread by Sdmcallister: Jjson or json for Karax?, see https://forum.nim-lang.org/t/7267 |
13:14:33 | FromDiscord | <bark> would it be possible to change the precedence with macros? |
13:15:45 | narimiran | PMunch: if you make your line12: `awaitingMul *= result`, you don't need line 11 ;) |
13:17:02 | PMunch | That wouldn't update result though.. |
13:17:12 | narimiran | that's why you have line 13 |
13:17:16 | PMunch | Oh wait, I reset it afterwards :P |
13:17:18 | PMunch | Yeah |
13:19:06 | JochenSchroeder[ | I think a note in the docs for ^ might be a good idea, because I know many people who do scientific work, typically think math logic for their code |
13:19:48 | JochenSchroeder[ | I think I'll stick to x.pow() for now, less likely to trip me up |
13:20:17 | FromDiscord | <sealmove> yes, maybe `^` shouldn't even be defined for exponentiation by default |
13:20:28 | FromDiscord | <sealmove> pow() avoids pitfalls |
13:24:42 | FromDiscord | <haxscramper> No, precedence is controlled by https://nim-lang.org/docs/manual.html#syntax-precedence and cannot be changed |
13:24:54 | * | Kaivo joined #nim |
13:25:00 | FromDiscord | <haxscramper> E.g. you can write macro that adds braces to change precedence |
13:25:26 | FromDiscord | <sealmove> yes exactly, so it would be bad if Nim had defined `^` to have higher precedence than unary |
13:26:53 | FromDiscord | <sealmove> "Unary operators always bind stronger than any binary operator" this is a good rule |
13:31:44 | FromDiscord | <lqdev> ^ |
13:32:00 | FromDiscord | <lqdev> makes reading a lot easier as you don't have to jump between operators as much |
13:33:26 | JochenSchroeder[ | I guess the confusion is that ^ is used both as a binary and a mathematical operator |
13:33:48 | * | regreg joined #nim |
13:33:52 | FromGitter | <awr1> nim doesn't use any of the C-ish logical operators though |
13:34:20 | FromGitter | <awr1> or bitwise ones |
13:35:25 | FromGitter | <awr1> `^` is fine. i don't think i've ever seen it used for anything besides exponentiation, and even if it were i doubt it would be defined on numeric types anyway |
13:35:43 | FromGitter | <awr1> *used for anything in nim |
13:36:22 | FromGitter | <awr1> i mean nim uses `&` frequently and that has a different meaning in C too |
13:41:04 | Fish-Face | Is there an example of using pegs to parse text into a tree? |
13:41:19 | narimiran | i've seen `^` used for BackwardsIndex, for example :P |
13:41:22 | PMunch | Fish-Face, see npeg |
13:41:25 | PMunch | !repo npeg |
13:41:25 | disbot | https://github.com/zevv/npeg -- 9npeg: 11PEGs for Nim, another take 15 140⭐ 7🍴 |
13:41:55 | Fish-Face | I also didn't find documentation for doing tree-structure captures in npeg yet |
13:43:02 | Fish-Face | there's plenty of writing the grammars |
13:43:05 | Fish-Face | just not doing the captures |
13:43:17 | PMunch | Well the captures are given to you in a code block |
13:43:30 | PMunch | So you can do whatever you want with them there |
13:48:27 | Fish-Face | I mean I'm probably just new to this (I have only written simple parsers, and then by hand :P) but I expected there to be some way of referring to the context in these blocks so that when parsing, say, 1 + 2 with rules E <- N (+ E)*; N <- [0-9]+, you when you encounter the 1 you have a reference to the "parent" match of the E rule, and hence add the 1 to as a child of it. |
13:48:38 | * | regreg quit (Ping timeout: 264 seconds) |
13:50:19 | FromGitter | <awr1> npeg used to have AST generation but looks like its deprecated |
13:50:26 | Fish-Face | If you create an external tree structure to hold this and build it up by hand, do you have to also maintain a stack by hand to tell you what the current parent node should be, or something like that? (How do you pop stuff off that stack?) |
13:50:54 | Fish-Face | I feel like I just need to see one example of this and someone else must have done it already :P |
13:51:30 | FromGitter | <awr1> there are some examples of captures in the readme |
13:53:00 | FromGitter | <awr1> but yes an external stack would likely be helpful |
13:57:35 | Fish-Face | the npeg readme refers to a `push` template available in capture blocks but I don't see any explanation |
13:58:48 | Fish-Face | if I understand the source right it just pushes stuff to some stack created by npeg, but I don't yet see how to interact with it other than pushing stuff onto it, heh |
14:11:24 | FromDiscord | <bark> there are also other libraries that do parsers for you in nim |
14:11:41 | FromDiscord | <bark> https://gist.github.com/haxscramper/3562fa8fee4726d7a30a013a37977df6 |
14:11:45 | * | Vladar joined #nim |
14:12:00 | FromDiscord | <bark> @Fish-Face if you're still online |
14:13:09 | Zevv | awr1: that was silly and mostly useless |
14:13:12 | Zevv | so I threw it out |
14:13:30 | Zevv | so indeed, use an external stack and some code blocks, it's the most flexible |
14:13:42 | PMunch | Zevv, but an example with a tree structure would be nice |
14:13:54 | Zevv | https://github.com/zevv/mathpipe/blob/master/mp.nim |
14:14:18 | PMunch | Oh, and getting the captures for a sub-capture of course. But you already know that that is on my wishlist :P |
14:14:20 | FromDiscord | <shadow.> speaking of operator precedence |
14:14:22 | FromDiscord | <shadow.> time for aoc |
14:14:31 | Zevv | I'm waiting for npeg to become mainstream and popular enough so that /someone else then me/ will start writing a tutorial |
14:14:34 | FromDiscord | <bark> does today's aoc feature op precedence |
14:14:40 | FromDiscord | <shadow.> yes |
14:14:45 | FromDiscord | <bark> nice |
14:14:51 | FromDiscord | <shadow.> https://media.discordapp.net/attachments/371759389889003532/789495893693956116/unknown.png |
14:14:53 | FromDiscord | <shadow.> indeed |
14:14:59 | PMunch | Pretty sure that's what Fish-Face was doing as well :) |
14:15:02 | FromDiscord | <shadow.> hmm |
14:15:04 | FromDiscord | <bark> oh that's pretty easy |
14:15:16 | * | regreg joined #nim |
14:15:27 | FromDiscord | <shadow.> python has eval() but in nim you can just make `macro eval(body: string): untyped = body.parseExpr`, no? |
14:15:27 | PMunch | I like how they have switched stuff up so that e.g. Python people can't simply use `eval` and be done with it |
14:16:08 | FromDiscord | <shadow.> oh wait it wouldn't be able to be evaluated at compile time tho prolly |
14:16:11 | Fish-Face | PMunch: shhhhh! |
14:16:15 | PMunch | Oh shit, didn't even think of that. Since that is valid Nim you can just do parseExpr and then traverse the NimNodes :P |
14:16:33 | PMunch | No need to write a new parser :D |
14:16:37 | FromDiscord | <shadow.> lmaoo |
14:16:49 | PMunch | Would require you to parse your input on compile time though |
14:16:50 | FromDiscord | <shadow.> tho you still needa account for parenthesses |
14:16:53 | Fish-Face | Haha |
14:17:03 | PMunch | Parentheses are valid Nim as well |
14:17:05 | FromDiscord | <shadow.> im guessing that's gonna need some sort of recursive eval function |
14:17:08 | FromDiscord | <shadow.> to do the parentheses |
14:17:13 | FromDiscord | <shadow.> yes but they need to be evaluated first |
14:17:21 | FromDiscord | <bark> wouldn't be it possible to write a super fast bf-like interpreter? |
14:17:23 | PMunch | Oh yeah, I just meant the parsing |
14:17:30 | FromDiscord | <shadow.> yup that's what im doing @bark |
14:17:34 | * | Q-Master joined #nim |
14:17:41 | FromDiscord | <shadow.> using a recursive loop opener |
14:17:43 | PMunch | bf-like? |
14:17:51 | FromDiscord | <bark> character by character iteration |
14:17:52 | FromDiscord | <shadow.> brainfuck has simple loops kinda like parentheses |
14:17:54 | FromDiscord | <shadow.> brainfuck - like |
14:17:59 | PMunch | I was considering to write a rewrite-engine to output RPN notation statements |
14:18:02 | FromDiscord | <shadow.> tho in bf its `[]` |
14:18:02 | FromDiscord | <bark> and on parentheses recursion |
14:18:18 | FromDiscord | <shadow.> what if i just pass the text to a python script to do all my evaluations LMAO |
14:18:27 | FromDiscord | <shadow.> once i have them inside of the parentheses |
14:18:31 | FromGitter | <awr1> @shadow. yup, that's what I did earlier |
14:18:32 | FromGitter | <awr1> https://github.com/awr1/aoc/blob/main/2020/day_18.nim |
14:18:40 | FromDiscord | <shadow.> nice. |
14:18:43 | FromDiscord | <shadow.> very nice |
14:19:03 | PMunch | Haha, that is brilliant :P |
14:19:13 | FromDiscord | <shadow.> https://github.com/Yardanico/nim-mathexpr |
14:19:15 | FromDiscord | <shadow.> is this a math eval? |
14:19:22 | FromDiscord | <shadow.> hmm |
14:19:33 | PMunch | Looks like it |
14:19:40 | FromDiscord | <shadow.> not many examplesd |
14:19:55 | FromDiscord | <shadow.> lemme try it |
14:19:57 | PMunch | But really, once you have to write your own precedence rules it's just easier to write the whole thing yourself :P |
14:20:35 | FromDiscord | <shadow.> wdym? |
14:20:53 | FromDiscord | <shadow.> just recursively open into parentheses blocks |
14:20:57 | FromDiscord | <shadow.> and then just evaluate operators one by one |
14:20:58 | Zevv | PMunch: the thing is, this day is abolutely trivial if you did this before. If not, it's a head scratcher. |
14:21:02 | FromDiscord | <shadow.> once there are no parentheses in the expr |
14:21:24 | FromDiscord | <shadow.> i think having made a brainfuck interpreter makes this easier to visualize lol |
14:21:28 | PMunch | Zevv, yeah I guess having written a literal calculator programming language thingy was a benefit for this one :P |
14:21:35 | Zevv | right |
14:21:39 | PMunch | Although that is RPN, so no silly things like precedence rules |
14:21:58 | PMunch | @shadow. I mean I don't want to spoil it for you |
14:22:04 | Zevv | I spent too much time on this shit anyway, with pratt parsers, left and right precedence, all that stuff. |
14:22:06 | FromDiscord | <shadow.> rip |
14:22:16 | PMunch | But my solution just reads a string stream and recursion |
14:22:17 | FromDiscord | <shadow.> i think i have a way to do at least part one quite easily |
14:22:18 | FromGitter | <awr1> you can also use shunting yard algorithm if you're a masochist |
14:22:25 | FromDiscord | <shadow.> lol |
14:22:58 | PMunch | I just didn't think of it as math and just looked at what rules I actually had to implement |
14:24:10 | FromDiscord | <shadow.> hmm |
14:24:29 | FromGitter | <awr1> https://twitter.com/saji8k/status/1339709691564179464 |
14:24:31 | FromGitter | <awr1> This is interesting |
14:24:57 | FromDiscord | <shadow.> hmm wait a minute |
14:25:01 | FromDiscord | <shadow.> it's only addition and multiplication |
14:25:29 | PMunch | @shadow. exactly ;) |
14:25:46 | FromDiscord | <shadow.> OHH |
14:25:49 | FromDiscord | <shadow.> WAIT A MINUTE |
14:26:04 | PMunch | @awr1, that is interesting. Or rather, why they felt the need to write another language is interesting |
14:26:12 | FromDiscord | <mratsim> If the playground crashes/is frozen, it's my fault. |
14:26:33 | FromDiscord | <shadow.> lol |
14:26:36 | PMunch | It has been pretty well torture-tested, so hopefully it shouldn't break |
14:26:55 | PMunch | Works fine for me still :) |
14:27:04 | FromDiscord | <shadow.> tbh |
14:27:06 | FromDiscord | <shadow.> i might do this one in python |
14:27:09 | FromDiscord | <shadow.> it'd be so easy... |
14:27:20 | PMunch | Not exactly hard in Nim either.. |
14:27:23 | FromDiscord | <shadow.> just replace all with + and all + with then flip the operators in a custom number override class |
14:27:29 | FromDiscord | <shadow.> with operator overload |
14:27:31 | PMunch | I think my solution for day 2 is like 38 lines |
14:27:33 | FromDiscord | <shadow.> and then use eval() |
14:27:40 | FromDiscord | <shadow.> it'd be like 10 in py heck |
14:27:43 | FromDiscord | <shadow.> alr ill figure this out |
14:28:15 | Fish-Face | I was considering doing this with a hand written parser but want to learn a bit about writing grammars etc |
14:30:42 | FromDiscord | <shadow.> WAIT A MINUTE |
14:30:47 | FromDiscord | <shadow.> I THINK I KNOW HOW TO DO THIS |
14:30:51 | FromDiscord | <shadow.> LOL |
14:31:01 | FromDiscord | <shadow.> YES |
14:31:17 | Prestige | Who was working on the new implementation for concepts? Is the design still in the works, or just the implementation? |
14:31:36 | leorize | Araq is working on it |
14:31:49 | FromDiscord | <shadow.> is expr something special? it's syntax highlighted for me https://media.discordapp.net/attachments/371759389889003532/789500168935309352/unknown.png |
14:32:02 | FromDiscord | <shadow.> same thing with `stmt` lol |
14:32:04 | PMunch | It used to be typed or untyped |
14:32:16 | PMunch | stmt and expr are the old names for typed and untyped |
14:32:16 | FromDiscord | <shadow.> hm? |
14:32:21 | PMunch | But I can't remember which was which |
14:32:28 | FromDiscord | <shadow.> ohhh |
14:32:42 | PMunch | In like pre 0.20.0 I think |
14:32:42 | leorize | it didn't map directly afaik |
14:32:59 | PMunch | Oh really? I thought it was just a rename |
14:33:03 | FromDiscord | <shadow.> i have an idea |
14:33:05 | Prestige | leorize: ah ty. I'm excited for concepts |
14:33:44 | Fish-Face | Then ownership and borrow checks, and Nim can be rust with better syntax |
14:34:23 | FromDiscord | <lqdev> @shadow. the vscode extension needs some serious renovation :p |
14:34:39 | FromDiscord | <lqdev> lots of non-keywords that are highlighted for no good reason |
14:34:47 | FromDiscord | <lqdev> like `echo`, `expr`, `stmt` |
14:35:03 | FromDiscord | <lqdev> and the highlighting is quite inconsistent, why treat `seq` different from `MyType`? |
14:35:14 | PMunch | Well echo is a pretty common procedure |
14:35:17 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Iy5 |
14:35:27 | leorize | it's the only way to highlight more things without having to use nimsuggest semantic highlighter |
14:35:30 | Prestige | We need some treesitter for highlighting imo |
14:35:31 | PMunch | @lqdev, because we don't have semantic highlighting yet |
14:35:34 | FromDiscord | <shadow.> ohh is it because it's not in a static context |
14:35:58 | FromDiscord | <lqdev> PMunch: that doesn't mean that the vscode extension shouldn't be at least a little bit consistent |
14:36:41 | FromDiscord | <lqdev> fortunately my lite plugin does things the mostly right way 😎 |
14:36:51 | FromDiscord | <bark> wait this is e |
14:36:57 | FromDiscord | <bark> i think i got it |
14:37:13 | FromDiscord | <bark> since 15:18 to 15:37 |
14:37:14 | FromDiscord | <shadow.> pmunch what if i make custom operators and then just eval it |
14:37:16 | FromDiscord | <shadow.> ;) |
14:38:02 | FromDiscord | <bark> sent a code paste, see https://play.nim-lang.org/#ix=2Iy7 |
14:38:03 | FromDiscord | <bark> but still testing it |
14:38:03 | * | mfiano quit (Ping timeout: 256 seconds) |
14:38:06 | PMunch | That's basically what awr1 did |
14:38:10 | FromDiscord | <bark> uh should i not have pasted this her |
14:38:57 | FromDiscord | <shadow.> holy thats long |
14:39:13 | FromDiscord | <shadow.> hmm i think i know a way to eval it as janky as possible |
14:39:28 | PMunch | @bark, it's fine for us IRC people now. The Discord bot has saved the day :) |
14:39:31 | FromDiscord | <bark> it's the bf-style solution i mean |
14:39:41 | FromDiscord | <shadow.> write the code into a new nim file, compile that, and then run from the main program LOL |
14:39:42 | FromDiscord | <bark> does it create a link |
14:40:15 | FromDiscord | <shadow.> hmmm how can i use parseExpr on a slurp splitLine |
14:40:23 | PMunch | @bark, yes |
14:40:48 | PMunch | @shadow, by staticRead in a static: block or {.compileTime.} proc |
14:41:08 | PMunch | @bark: https://irclogs.nim-lang.org/18-12-2020.html#14:38:02 |
14:42:06 | FromDiscord | <shadow.> hmm |
14:42:19 | FromDiscord | <bark> https://play.nim-lang.org/#ix=2Iyd is my sol. for part 1 |
14:42:33 | FromDiscord | <bark> it took me 19 minutes 😭 way too long |
14:42:53 | * | mfiano joined #nim |
14:43:02 | FromDiscord | <shadow.> says the string isn't static |
14:43:09 | FromDiscord | <shadow.> sent a code paste, see https://paste.rs/GbG |
14:43:12 | PMunch | @bark, this is my part1: https://github.com/PMunch/aoc2020/blob/master/day18/part1.nim |
14:43:29 | FromDiscord | <shadow.> what if i do the janky compiler way LMAO |
14:44:37 | FromDiscord | <bark> wait is it always 1 long numbers |
14:44:41 | FromDiscord | <shadow.> im doing it |
14:44:46 | PMunch | Yes |
14:44:46 | FromDiscord | <shadow.> yup |
14:44:47 | FromDiscord | <shadow.> it is |
14:44:48 | FromDiscord | <shadow.> rip ur parser |
14:45:01 | PMunch | https://play.nim-lang.org/#ix=2Iyk < not sure what you're doing wrong @shadow. |
14:45:02 | FromDiscord | <bark> wow, it's beautiful |
14:45:06 | FromDiscord | <bark> the streams really saved it |
14:45:12 | FromDiscord | <bark> (edit) "it" => "a lot of space" |
14:45:21 | PMunch | Yeah, those take care of a lot of the logic |
14:45:44 | FromDiscord | <shadow.> bc eval is a macro in my example |
14:45:48 | FromDiscord | <shadow.> and needs static[string] |
14:45:48 | FromDiscord | <shadow.> lmao |
14:45:52 | PMunch | I mean to make it support multiple character ints wouldn't be super hard |
14:45:59 | PMunch | Oh right |
14:46:03 | FromDiscord | <shadow.> so even in a static block im guessing macros dont work? |
14:46:03 | PMunch | Yes that makes sense |
14:46:04 | FromDiscord | <shadow.> like that? |
14:46:07 | FromDiscord | <shadow.> ah |
14:46:14 | FromDiscord | <shadow.> i guess ill just compile another file LMAO |
14:46:20 | FromDiscord | <shadow.> defo best way to do it trust me |
14:46:21 | PMunch | No they work just fine |
14:46:26 | FromDiscord | <shadow.> hm? |
14:46:40 | PMunch | Macros work just fine in a static block |
14:47:01 | FromDiscord | <shadow.> https://play.nim-lang.org/#ix=2Iyq |
14:47:04 | FromDiscord | <shadow.> what's the issue here |
14:47:17 | FromDiscord | <shadow.> im guessing it's because the string can be anything |
14:47:22 | FromDiscord | <shadow.> but technically it "can be determined compile time" |
14:47:24 | FromDiscord | <shadow.> since it's static |
14:47:24 | FromDiscord | <shadow.> lmao |
14:47:35 | PMunch | Yeah it's a bit weird |
14:47:44 | FromDiscord | <shadow.> ill just compile another file LOL |
14:48:06 | PMunch | parseExpr doesn't return an int though by the way |
14:48:13 | PMunch | It returns the statements as a parsed thing |
14:48:42 | FromDiscord | <shadow.> yeah but |
14:48:45 | FromDiscord | <shadow.> the result would always be an int, no? |
14:48:59 | FromDiscord | <shadow.> like an integer nimnode |
14:49:00 | FromDiscord | <shadow.> of some sort |
14:49:03 | PMunch | Yes, but += eval wouldn't work |
14:49:05 | FromDiscord | <shadow.> oh wait |
14:49:07 | FromDiscord | <shadow.> rightt |
14:49:17 | FromDiscord | <shadow.> well the string thing didnt work either so |
14:49:23 | FromDiscord | <shadow.> ill figure this out w compiling lmfao |
14:49:28 | FromDiscord | <shadow.> this is such a scuffed way to do it |
14:49:30 | FromDiscord | <shadow.> but i love it |
14:49:43 | FromDiscord | <shadow.> also, i switched to using 2 spaces finally i love it |
14:49:55 | PMunch | It's pretty nice when you get used to it |
14:49:59 | FromDiscord | <shadow.> yeye |
14:50:11 | FromDiscord | <shadow.> idk yesterday's quintuple nested loops rly showed me that 20 spaces in is bad |
14:50:12 | PMunch | Now I feel all other code is just whitespace |
14:50:19 | FromDiscord | <shadow.> ye |
14:50:19 | PMunch | Haha, exactly |
14:50:24 | FromDiscord | <shadow.> lol |
14:50:29 | FromDiscord | <shadow.> my solution was so bad yesterday |
14:50:46 | FromDiscord | <shadow.> oh lord |
14:50:47 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Iyw |
14:50:57 | PMunch | And you got away with 5 loops? |
14:51:00 | PMunch | I had 9 :P https://github.com/PMunch/aoc2020/blob/master/day17/part2.nim |
14:51:04 | FromDiscord | <shadow.> LMAO |
14:51:04 | FromDiscord | <shadow.> RIP |
14:51:54 | FromDiscord | <shadow.> if you open in write mode |
14:51:58 | FromDiscord | <shadow.> it just truncates to 0 |
14:52:03 | FromDiscord | <shadow.> but when you do subsequent writes before closing |
14:52:05 | FromDiscord | <shadow.> they still append |
14:52:06 | FromDiscord | <shadow.> right? |
14:52:21 | FromDiscord | <shadow.> like f.write("hello\n"); f.write("world") will work as intended, or will it say world |
14:52:31 | PMunch | No that'll work |
14:52:35 | FromDiscord | <shadow.> whew |
14:54:00 | * | waleee-cl joined #nim |
14:55:21 | PMunch | Oh well, I'm off |
14:55:34 | PMunch | As I said, no stream today (already solved todays one anyways) |
14:55:42 | * | PMunch quit (Quit: Leaving) |
14:57:44 | narimiran | no *stream* today, wink wink |
14:58:28 | narimiran | (now i see this could be understood differently than what i meant) |
14:59:31 | narimiran | Ctrl+Z |
14:59:36 | FromDiscord | <shadow.> its erroring but i have an answer hm |
15:01:51 | * | superbia quit (Quit: WeeChat 2.9) |
15:02:22 | FromDiscord | <Kami> you guys need to shill more often this lang looks kinda epic |
15:02:58 | FromDiscord | <shadow.> LOL MY COMPILER KINDA WORKED |
15:03:02 | FromDiscord | <shadow.> https://media.discordapp.net/attachments/371759389889003532/789508026838024232/eval.nim |
15:03:07 | FromDiscord | <shadow.> THIS IS THE JANKIEST SOLUTION EVER I LOVE IT |
15:04:35 | FromDiscord | <shadow.> HOLY SHIT IT WORKED |
15:05:32 | FromDiscord | <shadow.> https://play.nim-lang.org/#ix=2IyU |
15:05:38 | FromDiscord | <shadow.> THIS HAS TO BE MY WORST SOLUTION YET IM CRYING ASHJDOASJDOASG |
15:06:06 | FromDiscord | <shadow.> @bark this is so bad it makes me wanna vomit but i love it |
15:07:01 | FromDiscord | <mratsim> Well, when you start programming professionally, you will see that "temporary" solutions that are hacky as hell tend to end up as permanent fixtures. |
15:07:11 | FromDiscord | <shadow.> this code compiles another script and runs it |
15:07:18 | FromDiscord | <shadow.> you're telling me people do that |
15:07:28 | FromDiscord | <mratsim> sure |
15:07:39 | FromDiscord | <mratsim> I can show you plenty of repo |
15:07:46 | FromDiscord | <shadow.> lmao damn |
15:08:11 | Zevv | young punks think they come by and invent stuff |
15:08:12 | Zevv | ha |
15:08:18 | Zevv | I have seen /some shit/ |
15:08:23 | FromDiscord | <shadow.> OOH WAIT THIS SHOULD BE EASY TOO LETS GO |
15:08:25 | FromDiscord | <mratsim> https://github.com/asmjit/asmjit/blob/master/tools/tablegen-x86.js↵↵This is a JIT assembler, it scans the Intel manual for opcode with javascript code that generates a C++ code thtat is then compiled |
15:08:32 | FromDiscord | <mratsim> and it's clean code |
15:09:14 | FromDiscord | <mratsim> This C++ code generates C++ code for another JIT assembler: https://github.com/herumi/xbyak/blob/master/gen/gen_code.cpp#L1207-L1211 |
15:09:23 | FromDiscord | <mratsim> it's used in a core Intel machine learning product |
15:09:35 | FromDiscord | <mratsim> now if we skip JIT and emulation |
15:10:43 | FromDiscord | <mratsim> This works like Nim, a deep learning compiler: it's a python script that generates C++/Cuda code that is then compiled, transformed into a dll and linked to your python code: https://github.com/spcl/dace/blob/master/dace/codegen/cppunparse.py#L901-L911 |
15:11:13 | FromDiscord | <shadow.> HAHAA PART TWO WORKED TOO |
15:11:15 | FromDiscord | <shadow.> THIS IS SO FUNNY |
15:11:42 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Iz5 |
15:11:46 | FromDiscord | <shadow.> this has to be the worst code i've ever written tho. |
15:11:57 | FromDiscord | <shadow.> it could break so easily lmfao |
15:12:17 | FromDiscord | <bark> here's my 25 minute recursive descent for part two https://play.nim-lang.org/#ix=2Iz6 |
15:12:32 | Fish-Face | Zevv: I started doing what we mentioned above with an external stack, but how do you deal with the fact that capture blocks are executed even when the match fails |
15:12:47 | FromDiscord | <shadow.> lol https://media.discordapp.net/attachments/371759389889003532/789510476652478554/unknown.png |
15:12:49 | FromDiscord | <mratsim> Go code that generates go code: https://github.com/ConsenSys/goff/blob/master/internal/templates/element/mul_cios.go#L3-L65 |
15:12:52 | Fish-Face | this seems to preclude the use of external data structures |
15:12:57 | FromDiscord | <mratsim> also Vue.JS and Angular all work like that |
15:13:04 | FromDiscord | <shadow.> holy shit u put in so much work |
15:13:08 | FromDiscord | <shadow.> i feel bad i just said "eval go brr" |
15:13:11 | FromDiscord | <bark> how did you |
15:13:12 | Zevv | Fish-Face: that's something you're not supposed to bring up |
15:13:21 | FromDiscord | <shadow.> DONT QUESTION IT |
15:13:22 | FromDiscord | <shadow.> IT WORKS |
15:13:30 | Fish-Face | Zevv: :( |
15:13:52 | Zevv | it's my biggest thing on the list |
15:14:08 | Zevv | the problem is creating a proper API for this, without giving up too much performance |
15:14:18 | * | oddp joined #nim |
15:14:29 | Zevv | In /practice/ though, it's usually not an issue, since the majority of the grammars don't seem to need major backtracking |
15:14:37 | Zevv | but it's true, it's the one big problem still in npeg |
15:14:46 | Zevv | and the only open github issue, for a long time |
15:15:06 | * | klaufir_ joined #nim |
15:15:13 | Fish-Face | does it mean that in fact there is no way to parse (as opposed to match) recursive structures at the moment |
15:17:39 | FromDiscord | <bark> is it possible to give a custom proc precedence in nim? |
15:17:43 | FromDiscord | <shadow.> custom op? |
15:17:57 | FromDiscord | <bark> yes |
15:18:08 | FromDiscord | <bark> a custom op |
15:18:14 | FromDiscord | <shadow.> hm idk |
15:18:15 | FromDiscord | <bark> like a custom + override |
15:18:28 | FromDiscord | <shadow.> luckily i didnt need to do that today lol |
15:18:39 | FromDiscord | <shadow.> i just overrided both for part one, then only override mult for part tow |
15:18:40 | FromDiscord | <shadow.> (edit) "tow" => "two" |
15:20:16 | FromGitter | <awr1> For Day 17 i avoided going with a 4-deep for loop, instead I used set intersections and cartesian products |
15:20:18 | FromGitter | <awr1> https://github.com/awr1/aoc/blob/main/2020/day_17.nim |
15:21:05 | FromDiscord | <shadow.> that is uh |
15:21:07 | FromDiscord | <shadow.> a lot smarter lmfao |
15:21:09 | FromDiscord | <shadow.> how fast does it run? |
15:21:13 | FromDiscord | <shadow.> mine is 250ms for both parts |
15:21:26 | FromGitter | <awr1> takes a minute or so to run without optimizations |
15:21:29 | FromDiscord | <lqdev> @bark yeah |
15:21:43 | FromGitter | <awr1> i'm going for shortness instead of runtime speed |
15:22:12 | FromDiscord | <shadow.> damn |
15:22:18 | FromDiscord | <shadow.> i wonder why it's slower than a for loop |
15:22:31 | FromDiscord | <shadow.> have you tried like |
15:22:38 | FromDiscord | <shadow.> `-d:danger --gc:arc` etc? |
15:22:54 | FromGitter | <awr1> it's probably because it allocates a lot |
15:23:07 | FromDiscord | <bark> also, running them on a different computer will already yield massively different numbers, not just different flags |
15:23:18 | FromDiscord | <shadow.> fair |
15:23:37 | FromGitter | <awr1> there are some technically different things I could do to fix that |
15:23:57 | FromGitter | <awr1> instead of using sequences, use arrays and pass in static[int] |
15:24:24 | FromGitter | <awr1> this would also mean I can't use zip() |
15:24:35 | FromDiscord | <shadow.> rip |
15:25:17 | FromDiscord | <bark> i wonder if they are doing aoc in bf discord/irc guilds/channels |
15:25:25 | FromDiscord | <bark> must be a pain |
15:26:06 | FromGitter | <awr1> probably less so if you used a language that compiled to BF |
15:26:44 | FromDiscord | <bark> if that counts, my nim solutions count as writing them in x86-64 machine code |
15:30:05 | FromGitter | <awr1> also in general sequtils allocates so much, if you're using higher orders in nim use zero-functional instead |
15:30:26 | * | regreg_ joined #nim |
15:31:22 | FromDiscord | <Rika> we need better iterators imo 😛 |
15:34:57 | * | regreg quit (Ping timeout: 268 seconds) |
15:35:59 | disruptek | nah, dom96 will give you better iterators via async/await. |
15:36:52 | disruptek | i mean, he may not be able to tell you what's in Chronos. he may not be qualified to evaluate a competiting async/await implementation. but that doesn't mean async/await isn't the solution. |
15:37:10 | FromDiscord | <Rika> hella passive aggressive |
15:37:23 | disruptek | yeah, it's fucking ridiculous. |
15:38:17 | supakeen | Can you like be a little bit less of a twat about it, there isn't a day I look in this channel and it isn't you saying people are incompetent. |
15:38:46 | disruptek | not really. when people are assholes, i call them out on that shit. just as you are. |
15:39:04 | disruptek | it has nothing to do with incompetence. |
15:39:12 | disruptek | we're talking about pure bullshit. |
15:40:07 | disruptek | what's really irritating is that i carefully engineered the demo to give people something to pick at and literally zero comments even address it. |
15:40:32 | FromDiscord | <Kami> cring |
15:40:35 | disruptek | even dom96 missed it. because people cannot be bothered to even open their minds to learning a thing. |
15:40:35 | FromDiscord | <Rika> sorry, i havent been programming in nim for a while because im in the process of moving still |
15:40:50 | FromDiscord | <Kami> @disruptek shut up bigot |
15:41:05 | disruptek | yeah, okay, buddy. |
15:41:13 | * | habamax quit (Ping timeout: 260 seconds) |
15:41:35 | * | supakeen left #nim ("WeeChat 2.9") |
15:42:00 | FromDiscord | <Rika> the fuck are you |
15:42:08 | disruptek | well, maybe dom96 does get it. i can't really tell. there's a lot of smoke here but no fire. |
15:42:43 | FromDiscord | <Rika> man disruptek might be too aggressive rn but where the fuck did bigot come from |
15:42:47 | FromDiscord | <Rika> and who the hell are you |
15:43:54 | FromDiscord | <ache of head> they left 🤔 |
15:44:34 | disruptek | supakeen: if you want to have a technical discussion, i'm all ears. |
15:44:49 | disruptek | actually, if you want to show me how i'm wrong about dom96's response, i'll listen. |
15:44:56 | disruptek | but don't tell me that i cannot read. |
15:45:10 | disruptek | i've been doing this from a very young age... |
15:47:03 | FromDiscord | <Rika> man randos are weird |
15:47:09 | disruptek | alrighty then. |
15:47:45 | leorize | dom's lack of response is just him being busy i think |
15:48:02 | leorize | like how he still haven't reviewed my tls pr... |
15:48:11 | disruptek | yeah, i don't think there's any point to talking to dom anymore. |
15:48:25 | disruptek | this is a person that really doesn't seem to have anything useful to contribute. |
15:48:45 | disruptek | but i'm in the mood to debate with supakeen, if s/he can grow some balls. |
15:49:00 | disruptek | let's fucking talk about this stuff. |
15:50:23 | leorize | am I missing something? suprakeen hasn't said anything |
15:51:04 | disruptek | they think i'm shitting on someone for being incompetent. |
15:51:34 | leorize | hmm? |
15:51:47 | disruptek | when i'm really just shitting on them for not engaging sincerely with the community and the topic at hand. |
15:54:52 | Fish-Face | Zezz: (copying earlier message where I didn't highlight) does it mean that in fact there is no way to parse (as opposed to match) recursive structures at the moment |
15:57:23 | FromGitter | <awr1> You can parse using captures and a stack |
15:58:22 | FromGitter | <awr1> as for failures...hm |
16:01:16 | FromGitter | <awr1> maybe check `capture.len` |
16:02:37 | FromGitter | <awr1> capture block should run only if pattern is ok I think |
16:05:03 | * | Avahe[m] joined #nim |
16:05:47 | Avahe[m] | Anyone else unable to do the survey on mobile? |
16:07:16 | Araq | disruptek, once again I'm telling you to cut down the number of swearwords |
16:07:33 | Araq | if you want to discuss things with dom, hightlight him and wait for his replies |
16:08:03 | Araq | if you don't want to discuss things, also fine, we know by now that you don't like him, no need to repeat it |
16:08:58 | Araq | and since it seems to be about his latest RFC, you can raise your voice in the particular RFC |
16:16:05 | Fish-Face | @awr1 that's what I was trying to do but zezz implied that this didn't work with npeg. Do you mean with the built-in pegs module? |
16:16:21 | Fish-Face | I was going to try that later with the event parser |
16:18:00 | * | a_chou joined #nim |
16:18:48 | leorize | Nim ARM CI PoC: https://cloud.drone.io/alaviss/Nim/5/1/2 |
16:20:13 | Fish-Face | @awr1 but the built-in pegs has limited number of captures so it seems like it won't work either |
16:22:18 | ForumUpdaterBot | New thread by Gcao: Is this a supported usecase: update global variables from a dynamic library?, see https://forum.nim-lang.org/t/7268 |
16:22:23 | disruptek | there's nothing to say. i've already made my point. |
16:26:50 | Zevv | arw1: "normal" captures which are grabbed by npeg and returned at the end are guarenteed to be valid |
16:27:01 | Zevv | but code block captures will run at match time, and might potentially get backtracked |
16:27:32 | Fish-Face | Maybe it's back to writing my own parser |
16:31:18 | Zevv | sure, npeg is not your golden hammer |
16:32:58 | Fish-Face | *sniff* |
16:33:14 | disruptek | he's not being rude; |
16:33:19 | disruptek | npeg is /my/ golden hammer. |
16:33:29 | Zevv | And I'm your THOR! |
16:33:57 | disruptek | not unless you've grown a beard to rival pmunch's. |
16:34:15 | Zevv | I took it off last week |
16:34:18 | Zevv | the itch was unbearable |
16:34:22 | disruptek | liar. |
16:34:43 | Zevv | not lying. I'm a poor groomer. I never shave, I just take it all of 5 or 6 times a year. |
16:34:51 | Zevv | s/off/ |
16:35:21 | disruptek | really? i probably shear it about twice as often. |
16:35:28 | disruptek | just to keep the lice down, really. |
16:36:44 | Zevv | you need those, take care of the leftovers |
16:36:55 | disruptek | they /are/ the leftovers. |
16:37:14 | disruptek | but, having them fall into food you're preparing for someone else is kinda iffy. |
16:37:37 | disruptek | it doesn't happen often, but when it does, it kinda ruins the mood, y'know? |
16:38:23 | Zevv | I know right |
16:38:36 | disruptek | so clybber supposedly fixed a bug, but all i can see is a red CI that was green yesterday. |
16:39:21 | disruptek | i guess i will let carnac be the canary. |
16:39:32 | FromDiscord | <Clyybber> I didn't even make a PR |
16:39:43 | disruptek | aww, and i tried not to ping you. |
16:39:57 | FromDiscord | <Clyybber> you didn't :) |
16:40:04 | disruptek | what, because simply rm'ing typ didn't fix it? |
16:40:18 | disruptek | it needs a full sem, doesn't it? |
16:40:21 | FromDiscord | <Clyybber> yeah, but I think I now the issue |
16:40:36 | disruptek | what is it? |
16:40:43 | FromDiscord | <Clyybber> disruptek: Yeah; remove nfSem and .typ |
16:41:03 | FromDiscord | <Clyybber> but the issue is that we need to resem nodes introduced by the previous sem pass |
16:41:08 | FromDiscord | <Clyybber> nodes that weren't accounted for yet |
16:41:12 | FromDiscord | <Clyybber> like nkHiddenAddr |
16:41:18 | disruptek | yeah. |
16:41:20 | FromDiscord | <Clyybber> but this should be easy |
16:42:14 | disruptek | why doesn't the code already do that? |
16:42:42 | FromDiscord | <Clyybber> because it never occurred probably |
16:42:57 | disruptek | Zevv: i think we have to wait for CPS to settle in mratsim's brain, and then we can make progress. |
16:43:21 | disruptek | clyybber: so not doing it was an optimization? or an oversight? |
16:43:32 | FromDiscord | <Clyybber> not any of the two |
16:43:47 | FromDiscord | <Clyybber> since typed macros only recently have started to really work |
16:44:11 | FromDiscord | <Clyybber> or rather; it only is a problem if you strip the typ field |
16:44:45 | disruptek | i really had no idea typed macros weren't a thing. |
16:44:57 | FromDiscord | <Clyybber> I mean they were, but not fleshed out |
16:45:13 | disruptek | just like i remember reading that i could query effects via macros but now i can't find any way to do that. |
16:45:29 | FromDiscord | <Clyybber> there is an api |
16:45:43 | disruptek | sure. |
16:46:28 | leorize | nim ci ran on arm in 12mins... https://cloud.drone.io/alaviss/Nim/7/1/2 |
16:46:29 | * | a_chou quit (Remote host closed the connection) |
16:46:33 | FromDiscord | <Clyybber> but I think we are getting into the make a spec for typed AST territory Araq was speaking of |
16:46:36 | disruptek | \o/ |
16:46:49 | leorize | that's faster than any other ci platform that we're using |
16:46:53 | FromDiscord | <Clyybber> because we have to ask ourselves if nkHiddenAddr should end up in semmed ast |
16:47:03 | disruptek | leorize: not surprised. |
16:47:08 | FromDiscord | <Clyybber> leorize: Hey, thats cool |
16:47:23 | disruptek | i need nkHiddenAddr for CPS, so... yes. |
16:47:42 | FromDiscord | <Clyybber> Oh, ok. |
16:47:57 | FromDiscord | <Clyybber> What for? |
16:48:21 | disruptek | because we need to be able to identify uses that we cannot sym-substitute. |
16:48:47 | disruptek | addr x != addr otherx |
16:49:19 | FromDiscord | <Clyybber> but why do you need to see nkHiddenAddr for that |
16:49:48 | disruptek | well, it's for var/mutable params, right? |
16:49:52 | FromDiscord | <Clyybber> yeah |
16:50:04 | disruptek | so how else can i determine that something is var/mutable? |
16:50:40 | FromDiscord | <Clyybber> looking at the type |
16:50:52 | disruptek | you mean the param type? |
16:51:02 | FromDiscord | <Clyybber> yeah |
16:51:18 | FromDiscord | <Clyybber> or look at the symbol kind |
16:51:37 | haxscramper | Zevv: is there a way to disable 'Parsing error at #9...' prefix in exception message, or I just need to remove it myself to get string I raised? |
16:51:54 | disruptek | maybe if i have another pass just to "clarify" after i've already processed the ast. |
16:52:20 | haxscramper | Or I should just raise my own exception if I need anything beyond simple string errors? |
16:52:38 | disruptek | raise your own. |
16:52:55 | FromDiscord | <Clyybber> disruptek: Dunno what you mean |
16:53:36 | disruptek | there are some addr uses that are fine, but i won't know until i've examined the entire tree. |
16:54:04 | disruptek | but let's ignore it for now. no reason to make the spec looser than it absolutely needs to be. |
16:57:16 | FromDiscord | <Clyybber> looks like semExpr does actually already handle nkHiddenAddr, but it doesn't set the .typ of the nkHiddenAddr node |
16:58:35 | FromDiscord | <Clyybber> because thats context dependent; could be lent/var/ref |
16:59:17 | FromDiscord | <Clyybber> eh var/ptr |
17:00:27 | FromGitter | <awr1> is windows on ARM a workable target for nim |
17:07:21 | disruptek | clyybber: any idea about #16389 ? |
17:07:24 | disbot | https://github.com/nim-lang/Nim/issues/16389 -- 3overnight regression in generics as demo'd by jason package ; snippet at 12https://play.nim-lang.org/#ix=2IA6 |
17:08:21 | FromDiscord | <Clyybber> haven't looked at it yet |
17:09:19 | disruptek | well, the only significant merge is araq's ic patch. |
17:09:22 | FromDiscord | <mratsim> @Zevv, I need to first write my article about IO task vs CPU tasks and explain that provided some common closures/continuations/callback+env concept Weave can serve as a scheduler |
17:09:30 | FromDiscord | <mratsim> but should not be THE scheduler for IO |
17:09:50 | FromDiscord | <Clyybber> disruptek: Yeah, look at the conversation on that PR; afair planetis[m] also had a regression |
17:09:57 | FromDiscord | <Clyybber> that just happened to be working in devel |
17:10:10 | FromDiscord | <mratsim> i.e. we need to write something from scratch or emulate/reimplement closure iterators on top of async |
17:13:11 | disruptek | reimplementing closure iterators isn't a problem, but it's out of scope to use the async dispatcher for CPS continuations. |
17:14:38 | disruptek | what we will probably end up doing is requiring a `func` for cps, to start, and then relaxing that once we can reimpl it using compiler code. |
17:14:49 | FromDiscord | <dom96> disruptek: I'm sorry you have a problem with me. But there's no excuse for abuse here. |
17:14:51 | disruptek | i mean the entry proc. |
17:15:06 | disruptek | dom96: no one is abusing you by calling you out for your lack of sincerity. |
17:15:17 | FromDiscord | <mratsim> it's for a transition period, from either asyncdispatch or chronos |
17:15:32 | FromDiscord | <ElegantBeef> Hey dom, when do we get images for the nim subreddit? 😄 |
17:15:32 | disruptek | why do i care about async? |
17:15:44 | disruptek | just keep using it if you like it. cps doesn't need to replace it. |
17:15:56 | FromDiscord | <dom96> Also, for some reason the discord bridge bot no longer highlights people when mentioned on IRC |
17:16:09 | FromDiscord | <mratsim> I don't care about async, I care about existing code |
17:16:26 | FromDiscord | <ElegantBeef> I believe yard made it so you have to do `@dom96` |
17:16:33 | disruptek | well, my life looks to be too short to worry about other people's existing code that doesn't use cps. |
17:16:44 | disruptek | i'm more interested in new code. |
17:16:53 | FromDiscord | <Clyybber> @ElegantBeef No, I changed it |
17:16:58 | FromDiscord | <Clyybber> Not sure why it failed just now |
17:17:01 | FromDiscord | <ElegantBeef> Ah |
17:17:09 | FromDiscord | <mratsim> New code won't get written if Nim advances alone without the devs that supported it from the start. |
17:17:11 | FromDiscord | <Clyybber> Maybe it doesn't catch numbers |
17:17:15 | disruptek | maybe it only pings people that have something useful to say? |
17:17:25 | FromDiscord | <ElegantBeef> But i've been pinged before |
17:17:43 | FromDiscord | <mratsim> and I'm the first to say that the standard library should be refactor and part of it should go collect dust |
17:17:46 | disruptek | somehow i've gotten by writing new nim code without dom96's help. |
17:17:46 | FromDiscord | <Clyybber> dom has a number in his nick; you don't |
17:18:00 | FromDiscord | <ElegantBeef> Clyybber i was responding to disruptek's comment |
17:18:08 | FromDiscord | <Clyybber> oh |
17:18:19 | FromDiscord | <ElegantBeef> I'm not that dumb |
17:18:21 | disruptek | hey where did your space go, beef? |
17:18:37 | disruptek | !last Elegant Beef |
17:18:37 | FromDiscord | <ElegantBeef> In the trash heap so your numpties could ping me |
17:18:38 | disbot | Elegant Beef spoke in 12#nim 8 weeks ago 12https://irclogs.nim-lang.org/19-10-2020.html#08:29:25 |
17:18:38 | FromDiscord | <Clyybber> disruptek: can you please test something write "clyybber: test" |
17:18:46 | disruptek | damn i'm out of the loop. |
17:18:55 | disruptek | clyybber: sup schnookums |
17:19:00 | FromDiscord | <Clyybber> oh, it broke |
17:19:09 | FromDiscord | <Clyybber> can you try with the C capitalized? |
17:19:16 | disruptek | Clyybber: sup schnookums |
17:19:41 | FromDiscord | <Clyybber> damn, it dun goofed |
17:19:49 | FromDiscord | <ElegantBeef> Look what you've done |
17:20:01 | disruptek | mratsim: if you want to port async to CPS, be my guest, but i think it's a waste of time and i don't relish the debate with dom. |
17:20:33 | disruptek | the only reason i'd do it is to remove closure iterators from the compiler. |
17:20:55 | disruptek | i think async is better served by replacement with chronos, first. |
17:21:15 | FromDiscord | <ElegantBeef> So clyybber i've got a fair bit of errors colourized, but it's now just me not knowing what errors are what and what's "important" about the print o |
17:21:19 | FromDiscord | <ElegantBeef> (edit) "o" => "out" |
17:21:57 | FromDiscord | <Clyybber> ok; I guess just post the examples here for discussion |
17:22:11 | FromDiscord | <Clyybber> (edit) "examples" => "errors" |
17:22:38 | FromDiscord | <Clyybber> or we could also discuss it on github |
17:22:58 | disruptek | leorize: what's involved in creating your nifty github CI warning/error highlights? should i put it in a library? i might want to add it to my testes, if there's room. |
17:23:08 | FromDiscord | <dom96> Images of what? |
17:23:19 | FromDiscord | <ElegantBeef> The nim logo and a non blue header |
17:23:42 | FromDiscord | <dom96> oh, for the stylesheet. Good question |
17:23:44 | FromDiscord | <ElegantBeef> We're looking worse than Zig there 😄 |
17:23:49 | leorize | disruptek: just a bunch of regex fed to github |
17:24:00 | FromDiscord | <dom96> Anyone with good CSS skills that knows how to cook up a nice Reddit style? |
17:24:21 | FromDiscord | <Clyybber> I don't have good CSS skills but it shouldn't be too hard to adapt something |
17:24:29 | leorize | mratsim: cloud.drone.io is providing free arm/arm64 build machines |
17:24:38 | FromDiscord | <Clyybber> there are very nice easy to chagne prebuilt CSS |
17:25:17 | Zevv | haxscramper: it's a fixed string at this time. The exception also has the `matchLen` and `matchMax` fields available, which have the same info for you |
17:25:23 | Zevv | so just ignore the messageitself |
17:25:53 | FromDiscord | <ElegantBeef> Arent the reddit CSS days deprecated? |
17:25:59 | FromDiscord | <ElegantBeef> Isnt it now just upload an image/banner |
17:26:11 | FromDiscord | <Clyybber> oh; yeah CSS doesn't display on the new reddit |
17:26:12 | FromDiscord | <dom96> I'm stuck in the past, I still use old reddit |
17:26:49 | FromDiscord | <Clyybber> @dom96 I'm u/clyybber if you want to mod me |
17:26:59 | FromDiscord | <ElegantBeef> Well throw the logo and nim purple image for the header on new reddit |
17:27:06 | FromDiscord | <ElegantBeef> Ziglang has their logo and yellow |
17:27:09 | federico3 | dom96: stuck in the past? I miss usenet |
17:27:33 | disruptek | i miss the technical challenges of usenet. |
17:27:48 | FromDiscord | <ElegantBeef> Fuck you guys are probably old enough you remember social media when it was called "Stand up Philosphy" |
17:27:50 | FromDiscord | <dom96> looks like Reddit ain't having fun today https://media.discordapp.net/attachments/371759389889003532/789544462397079592/unknown.png |
17:28:19 | FromDiscord | <dom96> federico3: missed usenet completely unfortunately |
17:28:40 | FromDiscord | <dom96> @Clyybber added |
17:28:58 | FromDiscord | <Clyybber> cool; thanks |
17:30:56 | FromDiscord | <mratsim> @leorize, yes I've seen drone |
17:31:13 | FromDiscord | <mratsim> But I don't want to spend my weekend dealing with CI :p |
17:31:26 | disruptek | hey, it's friday here. |
17:33:02 | FromDiscord | <dom96> @mratsim maybe there is room for a machine learning solution to CI? 😛 |
17:33:15 | FromDiscord | <dom96> I bet there is a startup for this out there already |
17:33:21 | FromDiscord | <mratsim> when CI gives you 2 cores? |
17:33:51 | FromDiscord | <mratsim> there was this startup at Fosdem 2018 that used ML (well they said so) to autotag issues on Github |
17:33:56 | disruptek | nigel does 4,000 compilations/second. i don't care. |
17:33:56 | FromDiscord | <mratsim> or something in that vein |
17:34:19 | FromDiscord | <dom96> oh yeah, I remember. They used our repo as an example lol |
17:34:46 | FromDiscord | <ElegantBeef> What error highlighting are we talking about anywho |
17:35:02 | disruptek | some magic leorize sprinkled in setup-nim. |
17:47:11 | * | klaufir_ quit (Remote host closed the connection) |
17:47:37 | * | klaufir_ joined #nim |
17:53:38 | FromDiscord | <Rebel> Is the person who made winim in this discord? They are a wizard and that new CLR module is 🔥 can't wait to use it 😈 |
17:55:27 | FromDiscord | <shadow.> khchen_ |
17:55:31 | FromDiscord | <shadow.> (edit) "khchen_" => "khchen?" |
17:56:05 | FromDiscord | <shadow.> doesnt seem like it |
17:59:03 | FromDiscord | <juliuskiesian> what is the replacement for NimIdent since it's deprecated? |
17:59:34 | disruptek | ident"myIdentifier" is idiomatic. |
18:01:52 | FromDiscord | <juliuskiesian> ok. what if i want to use it as a type, as in x: NimIdent? |
18:01:57 | leorize | mratsim: got a PoC for Nim main repo: https://github.com/nim-lang/Nim/pull/16396. Should be easily adapted to whatever status uses |
18:01:58 | disbot | ➥ ARM-based CI for Linux [ci skip] |
18:02:02 | disruptek | x: NimNode |
18:03:05 | * | carthia joined #nim |
18:03:11 | * | carthia left #nim (#nim) |
18:04:28 | FromDiscord | <juliuskiesian> newIdentNode is not usable with NimNode though. |
18:04:47 | leorize | ident(string) is the way to go now |
18:06:35 | disruptek | shadow.: you gonna finish that deques PR? |
18:06:56 | * | abm joined #nim |
18:08:34 | * | natrys joined #nim |
18:08:54 | FromDiscord | <juliuskiesian> sent a code paste, see https://play.nim-lang.org/#ix=2IAx |
18:09:31 | disruptek | pro tip: |
18:09:39 | disruptek | result = nnkTypeSection.newTree: ... |
18:09:52 | disruptek | probably should go into my style guide. |
18:10:41 | FromDiscord | <juliuskiesian> that would look better indeed. |
18:10:47 | FromDiscord | <juliuskiesian> otherwise the code is ok? |
18:11:19 | disruptek | it's useful for `result.add:`, too. what's the problem that i'm supposed to be looking at? |
18:15:24 | FromDiscord | <juliuskiesian> sent a code paste, see https://play.nim-lang.org/#ix=2IAC |
18:15:30 | FromDiscord | <juliuskiesian> Error: undeclared identifier: 'AppConfig' |
18:15:31 | haxscramper | narimiran: can you please take a look at pattern matching PR - it has already been reviewed, and I've made some additional improvements to it, and I think it is ready to be merged and I can then fix all remaining issues if someone finds any |
18:16:01 | haxscramper | As API is not going to be changed, so subsequent fixups won't introduce breakages |
18:17:26 | narimiran | haxscramper: i lost the link, but - 4raq said he will review it |
18:19:03 | narimiran | (found the link) |
18:26:41 | FromDiscord | <Clyybber> @dom96 do you think we should have "we are the knights who say nim" on the banner? |
18:28:22 | FromDiscord | <dom96> Dunno, Monty Python is more Python's thing. |
18:28:32 | FromDiscord | <Clyybber> heh |
18:28:43 | FromDiscord | <dom96> it is a cool pun though |
18:29:04 | FromDiscord | <Clyybber> yeah; have to get zevv to give me the file tho |
18:29:12 | FromDiscord | <Clyybber> Zevv: ^ |
18:30:01 | Zevv | think my original was in /tmp |
18:30:40 | FromDiscord | <shadow.> uhh disruptek shoot |
18:30:48 | FromDiscord | <shadow.> completely forgot that timothee wanted me to like |
18:30:52 | FromDiscord | <shadow.> fix the algorithm |
18:31:03 | FromDiscord | <shadow.> i still don't entirely know what he wanted me to do other than like changing head and tail in one go |
18:31:29 | disruptek | tell him that a performance improvement can be made in a subsequent PR. |
18:31:32 | FromDiscord | <shadow.> i dont see how using moveRange() is any more efficient than individually indexing bc it's not like slice assignment is any faster? and since w deques you have wraparound that wouldn't work |
18:31:43 | FromDiscord | <shadow.> fair enough |
18:31:54 | FromDiscord | <shadow.> i still needa fix the negative version, apparently it's buggy |
18:32:18 | disruptek | are you gonna complete `testes.expect`? it needs a rebase now. |
18:33:10 | FromDiscord | <shadow.> did we figure out why it failed 1-1.2? |
18:33:11 | FromDiscord | <shadow.> lmao |
18:34:27 | disruptek | you will need to bindSym"ExpectExceptionDefect" for one thing. |
18:34:36 | disruptek | (as it's not exported) |
18:35:00 | * | tiorock joined #nim |
18:35:00 | * | rockcavera quit (Killed (barjavel.freenode.net (Nickname regained by services))) |
18:35:00 | * | tiorock is now known as rockcavera |
18:36:42 | * | giaco joined #nim |
18:37:38 | disruptek | maybe it should just be a macro and take an optional message like `check` now does. i think it might need a similar `hasDefects` if you care about it working on earlier nims. |
18:38:31 | disruptek | hasDefects is a constant that you can check to see if we're in a version of nim that has had the exception behavior/naming shuffled around. |
18:40:10 | * | tane joined #nim |
18:51:40 | * | natrys quit (Quit: natrys) |
18:52:10 | FromDiscord | <shadow.> ahh i see |
18:52:26 | FromDiscord | <shadow.> kk gimme a bi |
18:52:27 | FromDiscord | <shadow.> (edit) "bi" => "bit" |
18:52:54 | disruptek | sure. this only applies to the testes master, of course. |
18:57:09 | Fish-Face | I am trying to install a package with nimble but get, the error: Version may only consist of numbers and the '.' character but found ''. |
18:57:09 | Fish-Face | Is this an issue with the package I'm trying to install? I am not trying to create a package myself so there is no nimble config in the cwd |
18:57:38 | FromDiscord | <dom96> Fish-Face: what's the package? |
18:57:42 | Fish-Face | lilt |
18:58:04 | Fish-Face | oh, I notice it is archived and old |
18:59:09 | Fish-Face | I guess it's not compatible with current nimble |
18:59:28 | FromDiscord | <dom96> It does some magic to get the version https://github.com/Quelklef/lilt/blob/master/lilt.nimble#L14 |
18:59:32 | FromDiscord | <dom96> looks like this is broken for some reason |
19:00:12 | Fish-Face | yes I saw that line but didn't know what to make of it :P |
19:03:26 | FromDiscord | <dom96> (edit) It does some magic to get the version https://github.com/Quelklef/lilt/blob/master/lilt.nimble#L14 |
19:03:28 | * | FromDiscord quit (Remote host closed the connection) |
19:03:45 | * | FromDiscord joined #nim |
19:06:21 | * | regreg_ quit (Ping timeout: 272 seconds) |
19:08:31 | * | Kaivo quit (Quit: WeeChat 2.9) |
19:21:03 | * | natrys joined #nim |
19:22:28 | haxscramper | Is it possible to check if particular objects is a `case` or not, using some built-on functions from stdlib, or I'm in `getImpl()` land again? |
19:24:39 | * | regreg_ joined #nim |
19:25:27 | FromDiscord | <exelotl> > result = nnkTypeSection.newTree: ...↵dumpAstGen will give it to you in that style too, it's nice :D |
19:28:53 | FromDiscord | <SirJosh> anybody got a guess as to what the most similar thing to a nim iterator is in c++? |
19:30:43 | haxscramper | There are no inline iterators, but you can get pretty fancy API with regular C++ iterators |
19:31:06 | FromDiscord | <SirJosh> regular c++ iterators don't look as clean as nim iterators though :((( |
19:31:26 | FromDiscord | <SirJosh> oh well ¯\_(ツ)_/¯ |
19:31:28 | haxscramper | Well, with range loops and C++17 unpacking you can get pretty close |
19:31:38 | FromDiscord | <SirJosh> oh? |
19:31:47 | haxscramper | > C++17 though |
19:32:09 | FromDiscord | <SirJosh> modern c++ is fine, was primarily just curious anyways |
19:32:18 | haxscramper | For unpacking, but range loops has been available since C++11 |
19:32:39 | haxscramper | But /implementing/ iterators is a very depressing thing in C++ |
19:34:11 | FromDiscord | <nikki> you can make an iterator that wraps a stateful lambda; it's still not in the "yield" form but maybe closer |
19:34:49 | FromDiscord | <nikki> idk if more possible with co_yield in c++20 |
19:37:40 | * | Q-Master quit (Ping timeout: 256 seconds) |
19:43:04 | FromDiscord | <shadow.> i mean yeah you have like |
19:43:12 | FromDiscord | <shadow.> `for (auto n : a)` |
19:43:14 | FromDiscord | <shadow.> or like |
19:43:21 | FromDiscord | <shadow.> `for (auto [n, m] : a)` |
19:43:25 | FromDiscord | <shadow.> but it's still not easy to implement |
19:43:27 | FromDiscord | <shadow.> or as clean |
19:44:20 | FromDiscord | <Quibono> Sooo installing Nim on one of the M1 ARM macs... |
19:44:25 | FromDiscord | <Quibono> Choosenim doesn't support it |
19:44:42 | FromDiscord | <JSONBash> Quibono you the alpaca guy? |
19:44:45 | FromDiscord | <Quibono> Da |
19:45:14 | FromDiscord | <dom96> Yeah, I'm almost tempted to buy one of these M1 bad boys, my current MBP's appears to have a bulging battery :/ |
19:45:20 | FromDiscord | <dom96> (edit) "MBP's" => "MBP" |
19:45:48 | FromDiscord | <JSONBash> im interested in an alpaca wrapper too |
19:46:46 | FromDiscord | <Quibono> It's not done yet, about halfway? |
19:47:08 | FromDiscord | <Quibono> https://github.com/QuixoticValentine/Nimpaca |
19:47:25 | FromDiscord | <Quibono> @dom96 The mini is crazy performance for the price |
19:47:52 | FromDiscord | <JSONBash> thats awsome, thamks for that |
19:48:02 | FromDiscord | <JSONBash> ill keep in touch about it 🙂 |
19:48:54 | FromDiscord | <Quibono> Now that I have my computer it's probably like... a couple days from being done |
19:49:32 | * | Kaivo joined #nim |
19:49:48 | * | Kaivo quit (Client Quit) |
19:50:12 | * | Kaivo joined #nim |
19:51:03 | FromDiscord | <dom96> yeah, I would buy the mini but I have far too many desktop PCs already heh |
19:51:21 | FromDiscord | <dom96> and I need a laptop... the only thing is that I bet Apple will release something even better next year |
19:51:30 | FromDiscord | <dom96> i.e. a pro machine that actually has a different chip |
19:51:55 | FromDiscord | <Quibono> Yeah, although the current air is pretty damn sweet |
19:52:06 | FromDiscord | <Quibono> Maybe get one then trade for a pro next year? |
19:52:36 | FromDiscord | <dom96> hmm, I'm not much to do that sort of thing. I've had this MBP since 2015 |
19:53:10 | FromDiscord | <dom96> if I started trading things in it would feel like a waste of money, but maybe Apple would give more for a newer model trade in |
19:54:01 | FromDiscord | <Quibono> Yeah |
19:59:54 | * | idf quit (Ping timeout: 265 seconds) |
20:00:35 | * | idf joined #nim |
20:02:43 | * | idf quit (Read error: Connection reset by peer) |
20:03:14 | Fish-Face | holy crap does nimly's templating prevent you from defining two parsers in the same scope?? |
20:06:18 | giaco | hello! I'm very new to nim and I've just started writing my first lines, but I've been reading the docs/tutorials (well, hopefully enough). How would you define the structure of a defined udp packet with fixed boundaries in nim? I just want to say: first two bits are X, third is Y, next 4 is Z and so on |
20:07:31 | FromDiscord | <dom96> I would just define an object modelled after the UDP packet structure |
20:07:37 | FromDiscord | <dom96> in a similar way to a struct in C |
20:08:41 | giaco | dom96: yes, but what about smaller than byte attributes? Would you just use byte as smaller data and then mask it? Or is there a better solution to avoid masking |
20:09:25 | * | Q-Master joined #nim |
20:11:25 | FromDiscord | <InventorMatt> you can also check out the binaryparse library https://github.com/PMunch/binaryparse |
20:13:26 | FromDiscord | <Quibono> Okay, enjoying the early adopter pain, I can't use Brew to install nim |
20:13:55 | giaco | InventorMatt, interesting, but I'd like to avoid external libraries now, as I perfer to learn oh its done |
20:14:04 | FromDiscord | <dom96> giaco: pretty much yeah, there might be better solutions out there but I'm not aware of them. |
20:14:34 | disruptek | quibono: just fork gitnim. |
20:14:36 | disruptek | ~gitnim |
20:14:36 | disbot | gitnim: 11https://gitnim.com/ -- choosenim for choosey nimions -- disruptek |
20:15:03 | * | oddp quit (Quit: quit) |
20:15:11 | FromDiscord | <Quibono> It'll work on arm? |
20:15:19 | disruptek | of course. you can supply our first arm distro. |
20:15:43 | Fish-Face | gitnim seems horrifying |
20:16:09 | disruptek | yeah, it's pretty scary stuff. |
20:16:45 | FromDiscord | <Quibono> So just to clarify since I'm slow, I can install it, build it, and then use it to install nim? |
20:16:45 | leorize | Quibono: make an issue on nim-lang/nightlies and ask for arm macos builds |
20:16:46 | * | Q-Master quit (Ping timeout: 268 seconds) |
20:17:12 | Fish-Face | I think most people use choosenim, Quibono |
20:17:28 | FromDiscord | <Quibono> Fish it doesn't support arm |
20:17:49 | disruptek | you just download an arm nightly and put it in a directory. drop gitnim in there. build it. init your repo and publish it. that's it. |
20:18:19 | disruptek | name the branch according to the version, as i have. add tags as you please. |
20:18:42 | disruptek | it's exactly as simple as it looks. |
20:18:51 | Fish-Face | Oic |
20:18:58 | FromDiscord | <Quibono> _Is still newb so not simple_ |
20:20:52 | FromDiscord | <Quibono> There is a linux arm nightly but IDK if it'd work |
20:22:07 | FromDiscord | <Quibono> Brand new computer and no Nim to christen it |
20:22:35 | * | narimiran quit (Ping timeout: 256 seconds) |
20:22:48 | * | hnOsmium0001 joined #nim |
20:34:46 | * | lbart joined #nim |
20:34:46 | * | lbart quit (Changing host) |
20:34:46 | * | lbart joined #nim |
20:35:07 | * | lbart quit (Client Quit) |
20:41:32 | * | lbart joined #nim |
20:41:32 | * | lbart quit (Changing host) |
20:41:32 | * | lbart joined #nim |
20:48:33 | * | Q-Master joined #nim |
20:55:09 | ForumUpdaterBot | New thread by Buster_blue: One line comprehension equivalence, see https://forum.nim-lang.org/t/7269 |
20:57:26 | * | superbia joined #nim |
21:00:59 | disruptek | a linux arm won't work. |
21:02:20 | * | Jesin quit (Quit: Leaving) |
21:06:49 | FromDiscord | <Quibono> So I'm SOL for now |
21:07:49 | FromDiscord | <mratsim> building Nim on arm from source is not really difficult |
21:08:04 | FromDiscord | <mratsim> git clone the github repo |
21:08:07 | FromDiscord | <mratsim> cd into it |
21:08:15 | FromDiscord | <mratsim> and sh build_all.sh |
21:08:36 | FromDiscord | <mratsim> add Nim/bin to your ./bash_profile |
21:08:53 | FromDiscord | <mratsim> $PATH=$HOME/Nim/bin:$PATH |
21:08:56 | FromDiscord | <mratsim> done |
21:10:02 | FromDiscord | <Quibono> Okay |
21:10:32 | * | regreg_ quit (Ping timeout: 260 seconds) |
21:16:38 | * | tiorock joined #nim |
21:16:38 | * | tiorock quit (Changing host) |
21:16:38 | * | tiorock joined #nim |
21:16:38 | * | rockcavera quit (Killed (verne.freenode.net (Nickname regained by services))) |
21:16:38 | * | tiorock is now known as rockcavera |
21:16:58 | FromDiscord | <Quibono> @mratsim |
21:17:06 | FromDiscord | <Quibono> sent a code paste, see https://play.nim-lang.org/#ix=2IBO |
21:19:10 | * | Jesin joined #nim |
21:19:35 | FromDiscord | <mratsim> well I built Nim on a Raspberry Pi this week so I assume Csources must b eupdated for Apple M1. |
21:20:43 | * | rockcavera is now known as Guest53773 |
21:20:43 | * | tiorock joined #nim |
21:20:43 | * | Guest53773 quit (Killed (card.freenode.net (Nickname regained by services))) |
21:20:43 | * | tiorock is now known as rockcavera |
21:22:11 | FromDiscord | <Quibono> Apparently not? |
21:23:11 | FromDiscord | <Quibono> Should I add the error to the nightlies issue? |
21:24:12 | FromDiscord | <Quibono> Oh looks like there is already an issue |
21:24:19 | FromDiscord | <Quibono> https://github.com/nim-lang/Nim/issues/16211 |
21:24:21 | disbot | ➥ Support for Apple Silicon / M1 ; snippet at 12https://play.nim-lang.org/#ix=2IBQ |
21:29:47 | FromDiscord | <dom96> Linux arm is not the same as macOS arm |
21:29:58 | FromDiscord | <dom96> We haven’t traditionally built for that combination |
21:30:15 | FromDiscord | <dom96> But you can build it yourself until a new version gets released |
21:30:33 | FromDiscord | <Quibono> By editing build.sh? |
21:31:13 | * | clemens3_ quit (Ping timeout: 260 seconds) |
21:31:29 | FromDiscord | <dom96> You’ll need a non arm Mac or other PC |
21:32:11 | FromDiscord | <Quibono> So you're saying no macOS arm support until like 1.5? |
21:32:23 | FromDiscord | <Quibono> Like how long are we talking |
21:32:36 | * | clemens3_ joined #nim |
21:32:40 | FromDiscord | <dom96> It’ll hopefully get back ported. |
21:34:18 | FromDiscord | <dom96> But if you grab latest devel Nim on a different PC. You can run ‘koch csources’ and should get Mac arm c sources in the resulting csources directory. |
21:35:58 | * | vicfred quit (Quit: Leaving) |
21:36:09 | FromDiscord | <tiatomee> Hey! I'm going through the tutorial and I'm wondering why sometimes in the parameter list of a procedure `;` is used to separate parameters. Does somebody know? |
21:37:23 | FromDiscord | <Quibono> Yeah right now i can't, I'll just wait. |
21:37:57 | FromDiscord | <Recruit_main707> yes, its used to emphasise a clear separation between arguments, for example:↵`(a: string, b: string)` == `(a, b: string)` != `(a; b: string)` the last one wont work |
21:38:38 | FromDiscord | <exelotl> the only time when it's really important is with the `using` statement: https://nim-lang.org/docs/manual.html#statements-and-expressions-using-statement |
21:38:54 | FromDiscord | <tiatomee> Could I write `a, b: string, c: string` too or is a `;` required after multiple parameters with the same type? |
21:39:05 | FromDiscord | <Recruit_main707> @exelotl iirc there are other cases, but yeah, using is the usual one |
21:39:17 | FromDiscord | <exelotl> yeah you can do that, and most people do :) |
21:39:35 | FromDiscord | <ElegantBeef> It's not required to use `;` it's just more ensured and typically iirc what macros tend to output afaik |
21:39:45 | FromDiscord | <Recruit_main707> yep |
21:39:50 | FromDiscord | <tiatomee> That's very nice to know, thanks y'all! |
21:40:10 | FromDiscord | <Recruit_main707> im not sure if its the nim way of writing functions, but if macros output it, i guess so |
21:40:11 | * | vicfred joined #nim |
21:40:17 | FromDiscord | <Recruit_main707> np |
21:55:54 | * | haxscramper quit (Remote host closed the connection) |
22:01:46 | FromDiscord | <Recruit_main707> did we have something like requests for nim? |
22:02:40 | FromDiscord | <ElegantBeef> Isnt the httpclient that? |
22:04:14 | FromGitter | <bung87> https://github.com/hapijs/accept/blob/4f5e3a1a7bd387fc5a908ad993b353a08946a5ab/test/mediatype.js#L144 why this order ? 'image/*','text/html','text/plain;format=flowed', |
22:05:18 | FromGitter | <bung87> most specific is text/plain;format=flowed and text/plain;level= |
22:06:16 | FromDiscord | <Recruit_main707> @ElegantBeef it seems so, yeah |
22:08:39 | FromDiscord | <shadow.> yeah httpclient works pretty well |
22:27:46 | * | krux02 joined #nim |
22:33:59 | * | Vladar quit (Quit: Leaving) |
22:37:23 | FromDiscord | <Quibono> If you're part of the intel/amd proletariat. |
22:39:18 | * | NimBot joined #nim |
22:41:47 | * | natrys quit (Quit: natrys) |
22:59:46 | FromDiscord | <shadow.> wow |
22:59:47 | FromDiscord | <shadow.> LOL |
22:59:55 | FromDiscord | <shadow.> hows the |
22:59:58 | FromDiscord | <shadow.> arm mac coming along |
23:01:25 | disruptek | slowly. 😁 |
23:01:33 | disruptek | you said you're using jason, right? |
23:03:05 | FromDiscord | <shadow.> i've used it before ye |
23:04:15 | * | superbia quit (Quit: WeeChat 2.9) |
23:04:40 | disruptek | i spent a few hours making it faster. |
23:04:47 | FromDiscord | <shadow.> oh nice |
23:04:54 | FromDiscord | <shadow.> i haven't really used it in like |
23:04:59 | FromDiscord | <shadow.> high pressure circumstances lol |
23:05:10 | FromDiscord | <shadow.> i like it bc it's simple to use |
23:05:17 | FromDiscord | <shadow.> but speed is always nice |
23:05:25 | FromDiscord | <shadow.> now you can beat the other libs by even more |
23:05:33 | FromDiscord | <Quibono> Disruptek is Jason the fastest now? |
23:05:38 | FromDiscord | <shadow.> wasnt it already? |
23:05:40 | FromDiscord | <Quibono> I wants fast jason pls. |
23:06:19 | disruptek | 0.4.0 is significantly faster. more optimization remains. |
23:07:33 | disruptek | there isn't a faster serializer, no. but enimemememem or whatever the fsck it's called is a more complete solution. |
23:08:09 | disruptek | i will eventually merge in the deserializer in there, assuming it's fast enough. |
23:08:15 | disruptek | or vice-versa. |
23:11:14 | FromDiscord | <Quibono> So json-> object and back It'll be faster with Jason than the stdlib json? |
23:27:17 | * | Fish-Face quit (Ping timeout: 260 seconds) |
23:28:02 | disruptek | jason doesn't deserialize. like, at all. |
23:28:20 | disruptek | use planetis-m's macro if you want that. |
23:28:46 | disruptek | or treeform's new json lib. |
23:30:39 | disruptek | packedjson is good for memory but it's not very fast. i haven't benchmarked planetis-m's macro yet. maybe i'll add it this evening. |
23:31:19 | FromDiscord | <Quibono> Gotcha gotcha |
23:31:45 | disruptek | might be time to bite the bullet and learn ggplotnim. |
23:32:20 | FromDiscord | <Quibono> Oh? |
23:32:54 | disruptek | it supports svg, and svg can embed in front-page READMEs nicely, so it's rather handy. |
23:33:31 | disruptek | btw, i wrote a little shim that generates, like, the cli output you see on some of my projects. it's in xs. |
23:33:35 | disruptek | !repo disruptek/xs |
23:33:36 | disbot | https://github.com/disruptek/xs -- 9xs: 11xstreamstartup.com 15 3⭐ 0🍴 |
23:33:58 | disruptek | demo.nim. it uses termtosvg, which is archived but still available. |
23:34:32 | disruptek | i don't know a more foolproof way to embed such content in markdown. |
23:34:49 | disruptek | i don't really want to get into cheerio type stuff. |
23:38:59 | * | tane quit (Quit: Leaving) |
23:50:54 | giaco | newbie here. I'm using binaryparser and I'm trying to use custom proc based parser, but I'm getting ".nimble/pkgs/binaryparse-0.2.3/binaryparse.nim(115, 28) Error: cannot get child of node kind: nnkSym" |
23:51:15 | disruptek | append a : and try again. |
23:51:30 | giaco | I don't xee any example of custom proc based parser in official docs "https://github.com/PMunch/binaryparse" |
23:51:40 | disruptek | can we see your code? |
23:52:28 | giaco | sure. I'm just playing around by writing an rtp and ogg protocol reader |
23:52:54 | disruptek | ~paste |
23:52:55 | disbot | paste: 11a frowned-upon behavior in chat; please use a service such as https://play.nim-lang.org/ or http://ix.io/ or https://gist.github.com/ and supply us a URL instead. -- disruptek |
23:53:04 | disruptek | rika will help you. 👍 |
23:54:37 | giaco | disruptek: https://termbin.com/5yfw |
23:55:24 | giaco | I'm trying to write oggSegmentParser, as custom proc based parser, but it doesn't like it |
23:57:50 | FromDiscord | <tiatomee> Why would a `proc (input'gensym308557: string): string{.noSideEffect, gcsafe, locks: 0.}` not be compatible with a `proc (input: string): string{.closure.}`? |
23:58:08 | FromDiscord | <ElegantBeef> `nosideeffect` i'd imagine |
23:58:36 | FromDiscord | <tiatomee> I think the order is important: I have a tuple type that expects `{.closure.}` |
23:58:47 | FromDiscord | <tiatomee> and the first thing is what is passed, which does not match |
23:58:59 | FromDiscord | <tiatomee> and no side effects should be just fine for closures, no? |
23:59:17 | FromDiscord | <nikki> if you change the .closure. to .nimcall. does it work just to check |
23:59:23 | FromDiscord | <ElegantBeef> I was uncertain and just took a stab 😄 |
23:59:25 | FromDiscord | <nikki> may break other calls tho |
23:59:40 | FromDiscord | <tiatomee> That seems to work better |
23:59:45 | FromDiscord | <nikki> how so? |