<< 18-12-2020 >>

00:00:00FromDiscord<Clyybber> the compiler should compile
00:00:05FromDiscord<Clyybber> its in the name
00:00:10disruptekhow can it do so without packages?
00:00:18FromDiscord<Clyybber> it operates on files
00:00:21FromDiscord<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:33FromDiscord<Recruit_main707> don’t
00:00:46disruptekwell, i'd rather take a leak than debate this.
00:01:12leorizemy main technical reason against this is because of openssl
00:01:35leorizenon-native deps are a pita to manage rn
00:02:16*mfiano joined #nim
00:02:21FromDiscord<dom96> Not aware of any language pm that handles those well, or at all really
00:02:54leorizewe should all just switch to nix :P
00:02:54FromDiscord<dom96> Our ability to specify which OS packages to install is actually pretty nice and unique AFAIK
00:03:23disruptekpackage management is a stupid problem that shouldn't exist.
00:03:37disruptekit's dumb to let to consume any more oxygen than is strictly required.
00:03:49FromDiscord<Clyybber> disruptek: no moduleA.someType != moduleB.someType
00:04:01FromDiscord<Clyybber> even if they are structurally the same
00:04:02disrupteknot in the backend.
00:04:12FromDiscord<Clyybber> the backend doesn't fucking matter here
00:04:17disruptekof course it does.
00:04:21FromDiscord<Clyybber> no?
00:04:36FromDiscord<Clyybber> wether the types look the same in the C code is unimportant
00:05:02disruptekit matters because the FFI won't survive.
00:05:19FromDiscord<Clyybber> where does the FFI come from suddenly?
00:05:30FromDiscord<Clyybber> I'm talking about multiple versions of a package
00:05:38FromDiscord<dom96> What about tuples?
00:05:41disruptekbut whatever. i don't care. it's not a problem i expect to solve, ever, let alone today.
00:05:53disrupteki hope i'm dead before it fucking matters.
00:06:13disruptektuples, procs, c++... so much fun for your snowflake types.
00:06:16FromDiscord<Clyybber> @dom96 talking only about nominal types
00:06:27FromDiscord<dom96> But anyway, cool down guys.
00:06:41FromDiscord<Clyybber> eh, my cursing wasn't meant to be offensive
00:06:46FromDiscord<Clyybber> I think disruptek understands
00:06:48disrupteknor is mine.
00:07:11disrupteki did the "multiple versions of a package" once, early in my nimph days.
00:07:37disrupteki don't mind telling people it's not supported.
00:09:17FromDiscord<Clyybber> it already works
00:09:19disruptekleorize: openssl is a problem we will need to solve relatively soon.
00:09:21FromDiscord<Clyybber> I just tested it
00:09:33disruptekyes, but /it should not exist/.
00:09:34FromDiscord<Clyybber> the type mismatch errors could be improved
00:09:36FromDiscord<Clyybber> but it works
00:10:03FromDiscord<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:43disruptekwe support recursive hierarchies of packages and dependencies and even those should not be encouraged.
00:10:45FromDiscord<Clyybber> thanks, I'm not frustrated :)
00:11:16disrupteki mean, c'mon, are you really satisfied with the state-of-the-art here?
00:11:20disrupteki think it's dogshit.
00:11:21FromDiscord<Clyybber> Yeah
00:11:30FromDiscord<Clyybber> Tell me what should be better
00:11:35FromDiscord<Clyybber> You just said you don't care
00:11:36leorizedisruptek: please write an rfc for all of this too, like the one you wrote for cps
00:11:49disruptekc'mon, for what?
00:11:56FromDiscord<Clyybber> disruptek: Or were you talking to leorize?
00:12:01FromDiscord<Clyybber> aaah, can't tell anymore
00:12:03FromDiscord<Clyybber> :D
00:12:10disrupteki don't want another npm.
00:12:21disruptekyou shouldn't, either.
00:12:55leorizedisruptek: how package management sucks?
00:13:18disrupteki mean, have some ambition. we have a very fine language and we're reproducing shitty designs from lesser tools.
00:13:46FromDiscord<Clyybber> all talk no concrete
00:14:12FromDiscord<Clyybber> even the mafia needs concrete
00:14:12FromDiscord<sealmove> What's wrong with nimble? :<
00:14:16disruptekyeah, yeah. you have push rights to nimph last i checked.
00:14:24disruptekwait, don't you?
00:14:29FromDiscord<Clyybber> yeah, I don't know what to fix
00:14:37FromDiscord<Clyybber> you just said theres something wron
00:14:51FromDiscord<Clyybber> with concrete I didn't mean concrete commits, but concrete problems
00:14:54disruptekwhat's wrong is that package management shouldn't even be a thing. 😁
00:15:05FromDiscord<Clyybber> because you aren't specific enough for me to get an idea what you are talking about
00:15:34disrupteka 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:42disrupteki've mentioned this to you.
00:15:46disrupteki've supplied tests for you.
00:15:53disruptekyes, we have a new concepts impl.
00:16:02FromDiscord<Clyybber> it doesn't solve those issues
00:16:02disrupteki don't personally require it.
00:16:20FromDiscord<Clyybber> I mean dig into it; you know the compiler too by now
00:16:27disruptekyeah, that's the problem.
00:16:36FromDiscord<Clyybber> I was in that phase too
00:17:03disruptekthe homeless-they-are-about-to-repossess-all-my-worldly-possessions phase?
00:17:27FromDiscord<Clyybber> no :/
00:17:59FromDiscord<Clyybber> I mean the compiler code stinks phase
00:18:40disruptekconsider nimph-1 to be my rfc on the subject.
00:19:07disrupteki've barely modified it in the last, i dunno, 8-10 months.
00:19:15disruptekif you think it's a step in the right direction, say so.
00:19:26disruptekif you think it's a 👎, that's valuable feedback, too.
00:19:30FromDiscord<Clyybber> haven't tried it
00:19:39FromDiscord<dom96> Maybe a worthwhile endeavour would be to create an alternative implementation of the Nim compiler?
00:19:44FromDiscord<Clyybber> the thing about package management is that you decide if its a thing
00:19:45disruptekwell then don't ask me to wax philosophical on the subject.
00:19:59FromDiscord<Clyybber> @dom96 I don't think so, its not that bad
00:20:14FromDiscord<Clyybber> some parts are worse than others but all in all its pretty good
00:20:25leorizeit will only be worth it if you pay :P
00:20:34disrupteki agree that the compiler largely works.
00:22:12FromDiscord<sealmove> What would be the benefit of building it from scratch?
00:22:19FromDiscord<Clyybber> nothing
00:22:26disrupteki can't think of a single thing.
00:22:57FromDiscord<sealmove> I wonder if dom is trolling
00:23:03FromDiscord<Clyybber> no he's not
00:23:10disruptekif i were going to change something, i'd make the compiler more of a test-bed for new code.
00:23:30FromDiscord<Clyybber> thats what csourcesv2 should do
00:23:31FromDiscord<Clyybber> in some way
00:23:40disruptekit'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:55disruptekit's a fucking nightmare trying to deal with circular deps, for example.
00:24:08FromDiscord<Clyybber> never for me :D
00:24:10FromDiscord<dom96> I’m not trolling. It only makes sense if you’re interested and passionate about compiler dev
00:24:10disruptekthe documentation could be vastly improved.
00:24:28disrupteki don't think the compiler is holding us back.
00:24:29FromDiscord<dom96> It would be a good test of the Nim specification.
00:24:43FromDiscord<Clyybber> its not; its still relatively small
00:24:46leorizewe all know that the spec still have plenty of holes
00:24:52FromDiscord<Clyybber> it can be reworked quite easily
00:25:49FromDiscord<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:08FromDiscord<dom96> But likely not worth the effort anyway
00:26:09disruptekyou can have that now: just submit a PR.
00:26:20FromDiscord<dom96> Unless you’re really really into this type of work
00:26:23FromDiscord<Clyybber> Yeah, the current codebase is fine
00:26:31*rockcavera joined #nim
00:28:47Zoom[m]Someone said disruptek is "in the mood" but he's actually more on point today than I usually catch him here.
00:29:17mipris/point/topic/
00:29:48Zoom[m]right
00:33:14disruptekfrosty's api should change to better support `with`, reordering arguments.
00:34:23Zoom[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:33disruptek!repo nlvm
00:34:34disbothttps://github.com/arnetheduck/nlvm -- 9nlvm: 11LLVM-based compiler for the Nim language 15 358⭐ 26🍴 7& 1 more...
00:34:44Zoom[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:23FromDiscord<Ricky Spanish> sent a code paste, see https://play.nim-lang.org/#ix=2Iun
01:39:56mipriyes, you want a Table[string, Something]
01:40:31FromDiscord<Ricky Spanish> ok thank you mipri
01:49:34FromDiscord<JSONBash> Do i remember someone saying that they were writing an alpaca library for nim?
01:50:38mipria wrapper. said not too long ago.
01:51:53FromDiscord<JSONBash> what i meant yeah, would be interested in that
01:52:00FromDiscord<JSONBash> thanks ill go looking for it
01:56:01*klaufir_ quit (Ping timeout: 268 seconds)
02:01:06FromDiscord<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:16FromDiscord<ElegantBeef> "for 3"?
02:01:44mipriwhat part do you think is weird?
02:01:53FromDiscord<juan_carlos> error makes sense.
02:02:05FromDiscord<juan_carlos> error very grammar.
02:02:12mipriis 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:22mipriit's not interpreting it as a string
02:02:35FromDiscord<ElegantBeef> No it's not dropping
02:02:50disruptekit's probably just a bug in the error message format string.
02:02:51FromDiscord<ElegantBeef> I was just curious what it meant by `for 3`, and you've explained it
02:02:54FromDiscord<ajusa> to rephrase the error, `understood 3 to be an int literal(3), but expected a string`
02:03:15FromDiscord<ElegantBeef> It's just weird phrasing imo
02:03:25miprithe 'for' there is just English prose. the '3' is text from your program
02:03:42disruptekshould be `for 's'`, though, most likely.
02:03:52miprino, no problem with 's'
02:03:58FromDiscord<Rika> what?
02:04:11FromDiscord<Rika> its more like "interpreted 3 as int literal(3)"
02:04:24FromDiscord<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:34FromDiscord<Rika> for (something), i got[interpreted it as] 3
02:05:08FromDiscord<Rika> i guess it can be worded better
02:05:17miprithere'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:41miprilike the theory above: you're reading the 'for' as Nim syntax rather than the English word
02:09:17FromDiscord<ElegantBeef> i think `got '3' as 'int literal(3)', but expected string` reads better, but meh i'm just silly i guess 😄
02:10:28FromDiscord<Rika> that makes no sense to me
02:10:55FromDiscord<ElegantBeef> I mean in the case of literals i dont even see why this is even invoked
02:11:15mipriwhat is 'this' that's getting invoked?
02:11:16*abm quit (Read error: Connection reset by peer)
02:11:23FromDiscord<Rika> got means interpreted ? as (the next word), so it makes no sense that you'd interpret something as a raw "3"
02:11:25FromDiscord<ElegantBeef> The non legacy type mismatch
02:12:50FromDiscord<ElegantBeef> before devel it'd be `type mismatch: got <int literal(3)> but expected 'string'`
02:13:41mipriyeah, I prefer that version
02:13:49FromDiscord<Rika> maybe `parsed 'x' as <> but expected ''` is better no/
02:13:50FromDiscord<ElegantBeef> When using variables though this isnt annoying `type mismatch: got 'int' for 'b' but expected 'string'`
02:14:04FromDiscord<ElegantBeef> It's just literals that it reads weird for me
02:14:27disruptekthat's how i feel about greek.
02:14:53mipriok, the error reads fine to me, but I guess I don't like that it repeats the literal
02:14:53FromDiscord<ElegantBeef> but eh, i'm just colouring errors, i'll revisit this after 😄
02:15:24FromDiscord<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:58FromDiscord<Rika> well it could be 0b01010100101010
02:16:01FromDiscord<Rika> or whatever
02:16:17FromDiscord<ElegantBeef> and then it'd still be an `int literal(3)`
02:16:30FromDiscord<Rika> yes but its not obvious what the value is
02:16:46FromDiscord<Rika> it might be needed to fit into an int16 but its one byte too much or w/e
02:16:51FromDiscord<Rika> bit too much
02:16:53FromDiscord<ElegantBeef> Well then for decimal values we dont show it 😄
02:16:59mipriI suppose it's for type mismatch: got 'int literal(-1)' for '0b1111111111111111111111111111111111111111111111111111111111111111' but expected 'string'
02:17:20FromDiscord<Rika> expected 'int32' or something xd
02:17:23FromDiscord<ElegantBeef> Yea tested with hex`'type mismatch: got 'int literal(255)' for '0x000000FF' but expected 'string''`
02:18:34FromDiscord<juan_carlos> It should use roman numerals for clarity.
02:18:42*mbomba quit (Quit: WeeChat 3.0)
02:18:43FromDiscord<ElegantBeef> lol
02:24:29FromDiscord<Rika> lmao
02:24:47FromDiscord<Rika> what if we had roman numeral literals
02:25:19FromDiscord<ElegantBeef> We'd be dumb
02:25:25FromDiscord<windowsboy111> does nimx have a webview widget?
02:25:33FromDiscord<windowsboy111> currently cannot find it
02:25:38FromDiscord<ElegantBeef> Probably doesnt
02:25:52FromDiscord<windowsboy111> 😩
02:26:00FromDiscord<windowsboy111> (edit) "😩" => "sigh"
02:26:17FromDiscord<windowsboy111> (edit) "sigh ... " added "(heard that IRC has no emojis so)"
02:26:54FromDiscord<ElegantBeef> No but they do get multiple messages for edits
02:27:09disruptekwe have emojis, chucklehead.
02:27:22disruptekand, i've already pointed you at like four different web-views for nim.
02:27:48FromDiscord<ElegantBeef> As have I
02:28:08FromDiscord<windowsboy111> but those four either↵- webview only↵or↵- no webview
02:28:51FromDiscord<ElegantBeef> Use gtk
02:28:53FromDiscord<windowsboy111> Tried neel, gtk, nimx, wx
02:29:12FromDiscord<ElegantBeef> Are you even asking for software that exists?
02:30:02FromDiscord<windowsboy111> at least once I tried gtk in C++ but I'm bad at it
02:30:17disruptekso?
02:30:46disruptekjust think of all the software you don't have to write once you limit yourself to nim.
02:30:49disruptekit's liberating.
03:03:17FromDiscord<Avatarfighter> does anyone have any recommendations on a library for graph data structures?\
03:03:20FromDiscord<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:03FromDiscord<speckledlemon> I've used grim a little bit, seems fine
03:18:21FromDiscord<Rika> theres also gram
03:22:20disrupteki found grim's api pretty tough to tolerate; hence gram.
03:30:16FromDiscord<speckledlemon> cool, I'll try it
03:46:08FromGitter<iffy> Can I safely pass a Stream to a thread to be read from? Specifically an `outputStream` from `startProcess`.
03:47:31FromGitter<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:44EvolverIn 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:07FromDiscord<ElegantBeef> `from system import nil`, and all other imported modules
04:10:42FromDiscord<ElegantBeef> And have fun with `system.int` and `system.````(10, 20)`
04:11:26EvolverI wouldn't do it for `system`.
04:11:32Evolvernow that you mention it
04:11:59EvolverElegantBeef: I'm coming from Python and I like my imports qualified so I know where they're coming from.
04:12:36FromDiscord<ElegantBeef> I know, but Nim doesnt have python syntax so using qualified imports breaks part of Nim's syntax
04:13:20FromDiscord<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:30FromDiscord<Rika> Nim doesn't import like python does
04:13:38FromDiscord<Rika> Nim doesn't have magic methods
04:13:42FromDiscord<ElegantBeef> so instead of `seq.add(b)` you get `add(seq, b)`
04:13:45EvolverThe code is just more readable for me with imports qualified.
04:13:47FromDiscord<Rika> So all your operators will need to be qualified
04:14:00FromDiscord<Rika> Then qualify if needed
04:14:12EvolverI don't need to qualify the common stuff, just everything else.
04:14:17FromDiscord<Rika> You don't need to force qualifying to qualify stuff
04:14:26*vicfred joined #nim
04:14:30FromDiscord<Rika> Import normally and qualify when needed
04:14:43FromDiscord<ElegantBeef> In nim qualified imports is only when there is an overlap
04:14:59FromDiscord<Rika> There is no "everything else", many modules define custom operators
04:15:25FromDiscord<Rika> If you force qualification operators will be included no matter what
04:15:26FromDiscord<Ricky Spanish> sent a code paste, see https://play.nim-lang.org/#ix=2Iv1
04:15:32FromDiscord<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:42FromDiscord<ElegantBeef> what's `max` do?
04:16:00FromDiscord<Ricky Spanish> returns the largest value in the range afaik
04:16:01FromDiscord<Rika> Get the max of a sequence
04:16:34FromDiscord<Rika> Just `foldl` the sequence to a max
04:16:39FromDiscord<ElegantBeef> ok so then `algorithm.sorted(seq)[^1]` or ^
04:16:46FromDiscord<Rika> That's slow lol
04:16:52FromDiscord<ElegantBeef> Yea
04:17:08FromDiscord<Ricky Spanish> ok will look up both ways, regardless, thank you both
04:17:13FromDiscord<ElegantBeef> `sequtils` for `foldl`
04:17:37ForumUpdaterBotNew thread by Juancarlospaco: NodeJS for Nim, see https://forum.nim-lang.org/t/7266
04:17:37FromDiscord<Rika> Yeah sorry I'm on mobile and typing with one habd
04:17:58FromDiscord<ElegantBeef> Well quit playing with yourself and type with two 😛
04:18:10FromDiscord<Rika> I'm eating smh
04:19:40EvolverIs there a ##nim-news channel like say ##aws-news ?
04:20:06Evolverwith new links and news
04:20:10FromDiscord<ElegantBeef> The nim discord has github events,community events, and announcements. No clue if they're bridged
04:20:24FromDiscord<ElegantBeef> Ah #nim-news is
04:20:37Evolverthank you
04:22:03FromDiscord<ElegantBeef> @Ricky Spanish you could always make a `min` and `max` and throw them in sequtils 😄
04:22:31FromDiscord<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:46FromDiscord<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:41FromDiscord<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:01FromDiscord<Ricky Spanish> i agree there, it helps this type of copy and paste task for sure
04:27:15FromDiscord<ElegantBeef> Well it's not just about that
04:27:30FromDiscord<ElegantBeef> It's about having these procedures people want and to prevent people from having to write them
04:28:32FromDiscord<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:28FromDiscord<Ricky Spanish> yeh youre correct
04:30:02FromDiscord<Ricky Spanish> i expected to find it in the math module when i started looking
04:30:38FromDiscord<Ricky Spanish> also google didnt help, really throughs some curve-balls when you lookup nim followed by anything really
04:30:51FromDiscord<ElegantBeef> https://nim-lang.org/docs/theindex.html better than google
04:32:47FromDiscord<ElegantBeef> Wait
04:32:53FromDiscord<ElegantBeef> min/max are in system 😄
04:33:20FromDiscord<ElegantBeef> I didnt check since i expected you to, but they're there 😄
04:33:26FromDiscord<ElegantBeef> https://nim-lang.org/docs/system.html#min%2CopenArray%5BT%5D
04:36:34*narimiran joined #nim
04:36:52FromDiscord<Ricky Spanish> i didnt expect them to be in system lol as i said i expected theyd be in math or sequtils
04:37:31FromDiscord<Ricky Spanish> ok thanks anyway 😄
04:39:03*rockcavera quit (Remote host closed the connection)
04:45:20FromDiscord<ElegantBeef> @juan_carlos are your code examples on nodejs release builds?
04:46:46FromDiscord<juan_carlos> danger
04:47:08FromDiscord<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:51FromGitter<awr1> oh my god
07:35:22FromGitter<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:49FromGitter<awr1> https://github.com/awr1/aoc/blob/main/2020/day_18.nim
07:37:46narimiranomg, nice
07:38:04narimirani'm still struggling with pt.2 without this black magic
07:39:30narimiranbut we don't have `-`, just `+` and `*` :/
07:52:25disruptekface it, `-` just isn't that great.
07:57:22Zevvwhat's part 2
07:58:16FromGitter<awr1> part 2 is standard precedence, but with +/- and */div flipped
07:58:42FromGitter<awr1> i assume you're using your peg library?
08:01:38ZevvI dropped out a week ago
08:01:51Zevvbut otherwise, probably, because it's just a basic example from the manual :)
08:04:10FromGitter<awr1> yeah im getting tired of doing these problems
08:04:19FromGitter<awr1> first year doing this - probably last year lol
08:04:58Zevvi used to do these in my morning commute, but since there's no communting it doesn't really fit my schedule
08:05:22Zevvthe quickies are ok, but if I need some more time it's a hassle
08:05:32FromGitter<awr1> i'm going for relative conciseness
08:05:36Zevvalso, I have enough problems as I am :)
08:05:52FromGitter<awr1> `cloc` says in total for all problems i have 411 sloc
08:06:02FromDiscord<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:47FromGitter<awr1> it took some mucking about with the compiler but i got it to work lol
08:07:38Zevvawr1: you and I have similar style it seems. narimiran would call it "you and your cryptic stuff" :)
08:07:45narimiran:)
08:07:51FromGitter<awr1> lol
08:09:45FromGitter<awr1> is there a reason nim defines `div` for ints instead of `/`
08:10:18FromDiscord<ElegantBeef> Pascal?
08:10:34FromGitter<awr1> hm i see
08:10:46FromGitter<awr1> `/` does work for ints by default but it returns a float
08:10:47FromGitter<awr1> blegh
08:28:42FromDiscord<Rika> well that is what most people expect
08:29:31FromDiscord<Rika> see what / does for python
08:29:51FromDiscord<Rika> and js too (but thats kinda cheating since js doesnt have integers)
08:30:16disruptekman, i am really fucking tired of this.
08:30:57disruptekD:\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:48ForumUpdaterBotNew 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:34FromDiscord<Rika> i wanna answer that but i dont wanna make an account
08:59:42PMunchI'm about to answer
08:59:49FromDiscord<Rika> nice
08:59:59PMunchBut I ran into a weird SIGSEGV when trying some stuff
09:00:13FromDiscord<Rika> how
09:00:22PMunch!eval import macros; echo static(parseStmt("1+2"))
09:00:23NimBotCompile failed: <no output>
09:00:29PMunchThat SIGSEGVs
09:00:46FromDiscord<Rika> but this doesnt?
09:00:54FromDiscord<Rika> !eval import macros; echo static: parseStmt("1+2")
09:00:56NimBotCompile failed: /playground/nim/lib/system.nim(1983, 32) Error: request to generate code for .compileTime proc: $
09:01:03FromDiscord<Rika> :ThonkDumb:
09:01:15FromDiscord<Rika> but the issue is that parsestmt returns ast
09:01:24FromDiscord<Rika> so it has to be used in a macro
09:01:25PMunchYeah
09:13:13FromGitter<awr1> yes, macros allow NimNodes to be injected into your program's AST
09:15:45*regreg joined #nim
09:19:12FromDiscord<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:56PMunchI didn't have time to look at yesterdays AoC :(
09:20:32PMunchAnd 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:12Araqawr1: 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:30Araqsee also Python 3, where they had to fix this misdesign
09:21:45FromDiscord<lqdev> @Rika did so for you
09:22:18FromDiscord<lqdev> this is why i hate newcomers from python >_<
09:22:40AraqI take great pride in the fact that Nim's mistakes are all novel :-)
09:23:06disrupteknovelty will only get you so far.
09:23:08*mbomba joined #nim
09:23:18Araqfixed all old mistakes. And then added my own
09:28:41disruptekhmm, this tuple renderer in jason is stupid.
09:29:00*Tanger quit (Remote host closed the connection)
09:29:19disrupteki guess i still have a bunch of shit to optimize in here.
09:35:36PMunch@lqdev, I mean, you can have runtime evaluation in Nim :P
09:35:43PMunchIt's just a bit trickier than `eval`
09:35:57FromDiscord<lqdev> but that doesn't mean you should
09:36:21FromDiscord<sealmove> runtime evaluation of what?
09:39:12FromDiscord<Rika> strings
09:39:19FromDiscord<Rika> evaluating strings as code
09:40:19FromDiscord<sealmove> without "compiler as api"?
09:41:53*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:44:19PMunchNo
09:44:32PMunchBut you can import the Nim compiler and run NimScript in your project :)
09:46:34FromDiscord<lqdev> but as i said - that doesn't mean you should
09:48:26PMunchWell, not for 1+2 at least
09:50:52FromDiscord<Vindaar> did my duty and finished the survey 🙂
10:00:32FromDiscord<lqdev> is there some easy way to see whether a float represents an integer exactly>?
10:01:07disruptekyes.
10:01:27FromDiscord<lqdev> show me the way.
10:02:20disruptekteenagers.
10:02:39FromDiscord<lqdev> best i could come up with is `x - trunc(x) == 0`
10:02:47PMunchsplitDecimal?
10:03:05disrupteki don't see what's wrong with that.
10:03:24PMunchmyFloat.splitDecimal.floatpart == 0.0
10:03:35disruptektoo hard to read.
10:05:35disruptekx == trunc(x) is literally what you're asking for, right?
10:05:47disruptekhow could you say that more simply?
10:07:15FromDiscord<lqdev> i guess that could work, was just asking if there's a more "correct" way
10:08:23disruptekwhat matters is that your intent is clear. anything else is a waste of effort.
10:11:15FromDiscord<lqdev> yeah, but floats are quite hairy
10:11:43disruptekwhat?
10:12:01FromDiscord<lqdev> imprecise.
10:12:28FromDiscord<lqdev> but i guess there isn't much you can screw up with a simple expression like `x == trunc(x)`
10:13:03disruptekyou can template it if it helps readability.
10:13:51FromGitter<ynfle> Can someone help me with this ambiguos error https://play.nim-lang.org/#ix=2Iwo?
10:13:56PMunchHmm, is there a regex search and replace in Vim that handles casing?
10:14:13PMunchI often find myself wanting to replace something like x and minX with y and minY
10:14:43PMunch@ynfle, you didn't wrap your tuple in a seq
10:14:48disruptekthis.
10:15:09PMunch@ynfle: https://play.nim-lang.org/#ix=2Iwq
10:15:19FromGitter<ynfle> Thanks
10:15:37FromDiscord<Rika> pmunch `:s/.../.../i` doesnt work ?
10:15:37FromGitter<ynfle> Should the typing say that the issue is in the 3rd type not the first?
10:15:43FromDiscord<Rika> or you mean changing case?
10:16:11disruptekhe wants to change case, i think.
10:16:12FromGitter<ynfle> @PMunch https://vim.fandom.com/wiki/Changing_case_with_regular_expressions
10:16:29PMunch@Rika, I want it to preserve the case
10:16:58PMunchTake this line "for x in minX..maxX" I want to transform that into "for y in minY..maxY"
10:17:19FromDiscord<Rika> oh i believe thats not in vim
10:18:01PMunchBummer
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:46disruptekbilly joel had some choice words on the subject.
10:28:02disruptek"get it right the first time," i believe he said.
10:29:03disruptekwait, not billy joel. ezra pound.
10:29:06disrupteki was way off.
10:35:27*haxscramper joined #nim
10:36:04FromGitter<awr1> you have two options for runtime eval - import compiler nimble package as PMunch said or you, well, shell out to compiler
10:36:30FromGitter<awr1> dunno if nim compiler can take files from stdin
10:36:36haxscramperIt can
10:36:47FromGitter<awr1> is it the same way as gcc where it's just -
10:37:02haxscramper`echo "echo 1 + 2" | nim r -`
10:37:21FromGitter<awr1> yeah that's what gcc does too
10:37:28FromGitter<awr1> neat
10:37:36haxscramperThis one also runs code
10:37:45FromGitter<awr1> yeah i use nim r too
10:38:54*klaufir_ joined #nim
11:05:05FromDiscord<Rika> That was introduced by 1.4 right
11:26:16Araqhttps://techxplore.com/news/2020-12-brain-code-language.html
11:27:41FromDiscord<dom96> good morning
11:32:16FromDiscord<mratsim> only 11:30AM in the UK, still morning? 😉
11:33:30haxscramperhttps://play.nim-lang.org/#ix=2IwV - I'm thinking about implementing something along these lines for C++ deriving from C++ classes
11:33:32FromDiscord<dom96> Yes. What else would it be? 🙂
11:33:50haxscramperThis is just how generated part might look like
11:35:29haxscramperIf 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:33FromDiscord<mratsim> oh, signatureHash is new?
12:01:11FromDiscord<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:16PMunchJust did day 17, that was pretty simple
12:06:33*supakeen joined #nim
12:06:47narimiranPMunch: day 18 will be interesting for you, i imagine
12:07:11*rockcavera joined #nim
12:07:24PMunchUnfortunately I won't be able to stream today :(
12:08:38FromDiscord<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:09FromDiscord<sealmove> too bad
12:16:58FromDiscord<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:04FromDiscord<sealmove> strings are terminated by next field by default. Only if you use assertion or size this changes.
12:19:10FromDiscord<sealmove> `+1,484 −859` that's a huge diff >_<
12:19:33FromDiscord<sealmove> I doupt there is any code left unchanged
12:19:44FromDiscord<sealmove> doubt
12:22:18FromDiscord<sealmove> After we merge this I can start working on the plugin API
12:22:30PMunchSo `s: myString` is no longer NULL terminated?
12:22:34FromDiscord<sealmove> The code is modular enough for it now
12:22:52FromDiscord<sealmove> yeah right, `s: myString` will error if next field doesn't use assertion
12:23:01FromDiscord<sealmove> if you want null terminated you can do it explicitely
12:23:46FromDiscord<sealmove> I thought about all the different senarios and I think this is the least confusing way to do it
12:24:03FromDiscord<sealmove> but!
12:24:17FromDiscord<sealmove> seq of null terminated strings is simply `s: mySeq[10]`
12:24:36FromDiscord<sealmove> and a single string of length 10 is `s: myString(10)`
12:26:53PMunchHmm
12:27:41FromDiscord<sealmove> in current implementation how do you do a single single that is terminated by next field?
12:27:48FromDiscord<sealmove> single string
12:28:23PMunchSimply `s: myString; s: magic = "STOP"` IIRC
12:28:55FromDiscord<sealmove> ok, so same as with new. so if next field doesn't use assertion then it's null-terminated?
12:29:50FromDiscord<sealmove> i prefer producing an error in this case, but whatever you prefer
12:30:36PMunchYeah that's pretty much the current rule
12:30:51PMunchI mean optimally the new version should be backwards compatible
12:32:00FromDiscord<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:25FromDiscord<sealmove> `a[]` should be `{a}`. this way you can do `{a[5]}`
12:32:37*oprypin quit (Client Quit)
12:33:10FromDiscord<sealmove> (magic-terminated seq of seq)
12:33:33*oprypin joined #nim
12:37:54FromDiscord<sealmove> and `a` can be of any type 😉 you can terminated any sequence with magic, it doesn't have to be `s`
12:39:02FromDiscord<bark> also, in nim-lsp setups you can rename variables and it'll find them for you
12:39:10FromDiscord<bark> (edit) "also, in nim-lsp setups you can rename variables and it'll find them ... for" added "and rename them"
12:39:47FromDiscord<bark> although my setup has been acting out lately
12:41:26FromDiscord<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:59PMunchnarimiran, why did you think day 18 would be particularly interesting to me?
12:43:07narimiranPMunch: npeg stuff
12:43:12PMunchOh :P
12:43:16PMunchI solved it without npeg
12:43:34PMunchhttps://github.com/PMunch/aoc2020/blob/master/day18/part2.nim
12:46:25Zevv"awaitingMul"
12:47:05PMunchYeah with only two opts I just await multiplying until I see another multiplication or I reach the end of an expression
12:48:33Zevvyou didn't even *try*
12:48:49PMunchEy, I'm just solving the task at hand!
12:49:13Zevvoh wait, I ment "*I* didn't even try"
12:49:20Zevvbecause I am solving other puzzles today
12:49:22Zevvfor hard money
12:49:39Zevvmua ha ha
12:49:50PMunchWell, I'm currently at work..
12:50:01narimiranPMunch: on a quick glance, that looks cleaner than my semi-recursive stuff
12:50:04Zevvooh for 50 euros I will not tell your boss
12:50:08Zevvyou're playing at work time
12:50:23PMunchEverybody needs a break once in a while ;)
12:51:03PMunchAnd 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:17PMunchC# is like the worst parts of Java combined with the worst parts of Ruby..
12:51:30narimiranPMunch: oh, yours is also recursive, just cleaner :D
12:51:33PMunchWell, Ruby on Rails at least
12:51:53FromDiscord<bark> guys guys i have finally solved day 1 of aoc :D
12:51:54PMunchnarimiran, what did you do to end up with something messier than that?
12:52:01PMunch@bark, congrats :)
12:52:15PMunchDo you want comments on it?
12:54:08*dddddd quit (Ping timeout: 256 seconds)
12:55:27FromDiscord<bark> me? not really, it's so inefficient I am even reading the file 3x...
12:55:37narimiranPMunch: 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:41FromDiscord<bark> it'd burn your eyes
12:56:38PMunchnarimiran, ah right, yeah I tend to put stuff in templates as soon as I use it twice
12:56:54PMunch@bark, haha it's a nice way to learn though :)
12:56:57narimiranPMunch: i'll probably refactor mine to something like that
12:57:58*JochenSchroeder[ joined #nim
12:58:37*superbia joined #nim
12:58:53FromDiscord<sealmove> @PMunch fixed, strings are now null-terminated by default
12:58:58*dddddd joined #nim
12:59:20narimiran(and i'll steal this string stream stuff)
12:59:24FromDiscord<bark> sent a code paste, see https://play.nim-lang.org/#ix=2Ixd
12:59:44FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=2Ixe
12:59:46FromDiscord<bark> (edit) "https://play.nim-lang.org/#ix=2Ixd" => "https://play.nim-lang.org/#ix=2Ixf"
12:59:46superbianarimiran: pozdrav
12:59:52narimiransuperbia: pozdrav
12:59:57superbianarimiran: kako je u fiume
13:00:26narimiransuperbia: "lepo, znas kako. ima zenski, ima sve" :P
13:00:44supakeenpivo
13:00:46superbianarimiran: :DDDDDDD
13:01:09JochenSchroeder[Hi I'm just teaching myself nim for trying it out for some of my scientific code
13:01:13PMunchnarimiran, haha steal away :P
13:01:31JochenSchroeder[I"m encountering an precedence order issue that I find highly unexpected
13:01:56JochenSchroeder[-x^2 != -(x^2)
13:02:01JochenSchroeder[is that expected?
13:02:23JochenSchroeder[it's also not the same as -x.pow(2)
13:02:34PMunch@bark, it's not that bad, apart from the reading the input thrice part :P
13:02:47PMunch@JochenSchroeder[, yes that is expected
13:02:49*regreg quit (Ping timeout: 272 seconds)
13:03:19JochenSchroeder[ok, that's going to screw up a load of people if they try to convert scientic code
13:03:21PMunch-x.pow(2) == -(x^2)
13:03:43FromDiscord<bark> wait, you can do ^ to calculate the power in nim?
13:04:03JochenSchroeder[@PMunch yes but -x^2 == (-x)^2
13:04:10JochenSchroeder[that's what I find confusing
13:04:43superbiayou can write macros that convert your math logic to computer logic
13:04:55PMunch@bark, apparently :P I've been using `pow` until now
13:05:06PMunchJochenSchroeder[, I agree that it's a bit confusing
13:06:16JochenSchroeder[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:13FromDiscord<sealmove> really? unary operator has high precedence
13:07:36FromDiscord<sealmove> i expect most languages to work like this
13:07:37PMunchI think it's because ^ is a custom operator in Nim, which isn't allowed in most languages
13:08:02FromDiscord<sealmove> (i mean assuming they allow `^` operator)
13:08:09JochenSchroeder[ok, I should qualify, for languages used in scientific context
13:08:26superbiaany language can and is used in scientific context
13:08:39JochenSchroeder[yes
13:08:55FromDiscord<sealmove> if it's a domain specific lang then sure
13:09:09JochenSchroeder[sorry aimed at
13:09:21FromDiscord<sealmove> julia should get this right 😛
13:09:27JochenSchroeder[julia, matlab, python I can think of the top of my head
13:09:32superbiai don't think nim is aimed at scientific use
13:10:05FromDiscord<sealmove> python uses `` no?
13:10:08*Q-Master quit (Ping timeout: 260 seconds)
13:10:10FromDiscord<bark> yeah python uses
13:10:15JochenSchroeder[python uses **
13:10:25FromDiscord<bark> but -52 is -25
13:11:10FromDiscord<sealmove> apparently they gave `` a higher precedence than unary ops
13:12:07FromDiscord<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:36ForumUpdaterBotNew thread by Sdmcallister: Jjson or json for Karax?, see https://forum.nim-lang.org/t/7267
13:14:33FromDiscord<bark> would it be possible to change the precedence with macros?
13:15:45narimiranPMunch: if you make your line12: `awaitingMul *= result`, you don't need line 11 ;)
13:17:02PMunchThat wouldn't update result though..
13:17:12narimiranthat's why you have line 13
13:17:16PMunchOh wait, I reset it afterwards :P
13:17:18PMunchYeah
13:19:06JochenSchroeder[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:48JochenSchroeder[I think I'll stick to x.pow() for now, less likely to trip me up
13:20:17FromDiscord<sealmove> yes, maybe `^` shouldn't even be defined for exponentiation by default
13:20:28FromDiscord<sealmove> pow() avoids pitfalls
13:24:42FromDiscord<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:00FromDiscord<haxscramper> E.g. you can write macro that adds braces to change precedence
13:25:26FromDiscord<sealmove> yes exactly, so it would be bad if Nim had defined `^` to have higher precedence than unary
13:26:53FromDiscord<sealmove> "Unary operators always bind stronger than any binary operator" this is a good rule
13:31:44FromDiscord<lqdev> ^
13:32:00FromDiscord<lqdev> makes reading a lot easier as you don't have to jump between operators as much
13:33:26JochenSchroeder[I guess the confusion is that ^ is used both as a binary and a mathematical operator
13:33:48*regreg joined #nim
13:33:52FromGitter<awr1> nim doesn't use any of the C-ish logical operators though
13:34:20FromGitter<awr1> or bitwise ones
13:35:25FromGitter<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:43FromGitter<awr1> *used for anything in nim
13:36:22FromGitter<awr1> i mean nim uses `&` frequently and that has a different meaning in C too
13:41:04Fish-FaceIs there an example of using pegs to parse text into a tree?
13:41:19narimirani've seen `^` used for BackwardsIndex, for example :P
13:41:22PMunchFish-Face, see npeg
13:41:25PMunch!repo npeg
13:41:25disbothttps://github.com/zevv/npeg -- 9npeg: 11PEGs for Nim, another take 15 140⭐ 7🍴
13:41:55Fish-FaceI also didn't find documentation for doing tree-structure captures in npeg yet
13:43:02Fish-Facethere's plenty of writing the grammars
13:43:05Fish-Facejust not doing the captures
13:43:17PMunchWell the captures are given to you in a code block
13:43:30PMunchSo you can do whatever you want with them there
13:48:27Fish-FaceI 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:19FromGitter<awr1> npeg used to have AST generation but looks like its deprecated
13:50:26Fish-FaceIf 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:54Fish-FaceI feel like I just need to see one example of this and someone else must have done it already :P
13:51:30FromGitter<awr1> there are some examples of captures in the readme
13:53:00FromGitter<awr1> but yes an external stack would likely be helpful
13:57:35Fish-Facethe npeg readme refers to a `push` template available in capture blocks but I don't see any explanation
13:58:48Fish-Faceif 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:24FromDiscord<bark> there are also other libraries that do parsers for you in nim
14:11:41FromDiscord<bark> https://gist.github.com/haxscramper/3562fa8fee4726d7a30a013a37977df6
14:11:45*Vladar joined #nim
14:12:00FromDiscord<bark> @Fish-Face if you're still online
14:13:09Zevvawr1: that was silly and mostly useless
14:13:12Zevvso I threw it out
14:13:30Zevvso indeed, use an external stack and some code blocks, it's the most flexible
14:13:42PMunchZevv, but an example with a tree structure would be nice
14:13:54Zevvhttps://github.com/zevv/mathpipe/blob/master/mp.nim
14:14:18PMunchOh, and getting the captures for a sub-capture of course. But you already know that that is on my wishlist :P
14:14:20FromDiscord<shadow.> speaking of operator precedence
14:14:22FromDiscord<shadow.> time for aoc
14:14:31ZevvI'm waiting for npeg to become mainstream and popular enough so that /someone else then me/ will start writing a tutorial
14:14:34FromDiscord<bark> does today's aoc feature op precedence
14:14:40FromDiscord<shadow.> yes
14:14:45FromDiscord<bark> nice
14:14:51FromDiscord<shadow.> https://media.discordapp.net/attachments/371759389889003532/789495893693956116/unknown.png
14:14:53FromDiscord<shadow.> indeed
14:14:59PMunchPretty sure that's what Fish-Face was doing as well :)
14:15:02FromDiscord<shadow.> hmm
14:15:04FromDiscord<bark> oh that's pretty easy
14:15:16*regreg joined #nim
14:15:27FromDiscord<shadow.> python has eval() but in nim you can just make `macro eval(body: string): untyped = body.parseExpr`, no?
14:15:27PMunchI 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:08FromDiscord<shadow.> oh wait it wouldn't be able to be evaluated at compile time tho prolly
14:16:11Fish-FacePMunch: shhhhh!
14:16:15PMunchOh 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:33PMunchNo need to write a new parser :D
14:16:37FromDiscord<shadow.> lmaoo
14:16:49PMunchWould require you to parse your input on compile time though
14:16:50FromDiscord<shadow.> tho you still needa account for parenthesses
14:16:53Fish-FaceHaha
14:17:03PMunchParentheses are valid Nim as well
14:17:05FromDiscord<shadow.> im guessing that's gonna need some sort of recursive eval function
14:17:08FromDiscord<shadow.> to do the parentheses
14:17:13FromDiscord<shadow.> yes but they need to be evaluated first
14:17:21FromDiscord<bark> wouldn't be it possible to write a super fast bf-like interpreter?
14:17:23PMunchOh yeah, I just meant the parsing
14:17:30FromDiscord<shadow.> yup that's what im doing @bark
14:17:34*Q-Master joined #nim
14:17:41FromDiscord<shadow.> using a recursive loop opener
14:17:43PMunchbf-like?
14:17:51FromDiscord<bark> character by character iteration
14:17:52FromDiscord<shadow.> brainfuck has simple loops kinda like parentheses
14:17:54FromDiscord<shadow.> brainfuck - like
14:17:59PMunchI was considering to write a rewrite-engine to output RPN notation statements
14:18:02FromDiscord<shadow.> tho in bf its `[]`
14:18:02FromDiscord<bark> and on parentheses recursion
14:18:18FromDiscord<shadow.> what if i just pass the text to a python script to do all my evaluations LMAO
14:18:27FromDiscord<shadow.> once i have them inside of the parentheses
14:18:31FromGitter<awr1> @shadow. yup, that's what I did earlier
14:18:32FromGitter<awr1> https://github.com/awr1/aoc/blob/main/2020/day_18.nim
14:18:40FromDiscord<shadow.> nice.
14:18:43FromDiscord<shadow.> very nice
14:19:03PMunchHaha, that is brilliant :P
14:19:13FromDiscord<shadow.> https://github.com/Yardanico/nim-mathexpr
14:19:15FromDiscord<shadow.> is this a math eval?
14:19:22FromDiscord<shadow.> hmm
14:19:33PMunchLooks like it
14:19:40FromDiscord<shadow.> not many examplesd
14:19:55FromDiscord<shadow.> lemme try it
14:19:57PMunchBut really, once you have to write your own precedence rules it's just easier to write the whole thing yourself :P
14:20:35FromDiscord<shadow.> wdym?
14:20:53FromDiscord<shadow.> just recursively open into parentheses blocks
14:20:57FromDiscord<shadow.> and then just evaluate operators one by one
14:20:58ZevvPMunch: the thing is, this day is abolutely trivial if you did this before. If not, it's a head scratcher.
14:21:02FromDiscord<shadow.> once there are no parentheses in the expr
14:21:24FromDiscord<shadow.> i think having made a brainfuck interpreter makes this easier to visualize lol
14:21:28PMunchZevv, yeah I guess having written a literal calculator programming language thingy was a benefit for this one :P
14:21:35Zevvright
14:21:39PMunchAlthough that is RPN, so no silly things like precedence rules
14:21:58PMunch@shadow. I mean I don't want to spoil it for you
14:22:04ZevvI spent too much time on this shit anyway, with pratt parsers, left and right precedence, all that stuff.
14:22:06FromDiscord<shadow.> rip
14:22:16PMunchBut my solution just reads a string stream and recursion
14:22:17FromDiscord<shadow.> i think i have a way to do at least part one quite easily
14:22:18FromGitter<awr1> you can also use shunting yard algorithm if you're a masochist
14:22:25FromDiscord<shadow.> lol
14:22:58PMunchI just didn't think of it as math and just looked at what rules I actually had to implement
14:24:10FromDiscord<shadow.> hmm
14:24:29FromGitter<awr1> https://twitter.com/saji8k/status/1339709691564179464
14:24:31FromGitter<awr1> This is interesting
14:24:57FromDiscord<shadow.> hmm wait a minute
14:25:01FromDiscord<shadow.> it's only addition and multiplication
14:25:29PMunch@shadow. exactly ;)
14:25:46FromDiscord<shadow.> OHH
14:25:49FromDiscord<shadow.> WAIT A MINUTE
14:26:04PMunch@awr1, that is interesting. Or rather, why they felt the need to write another language is interesting
14:26:12FromDiscord<mratsim> If the playground crashes/is frozen, it's my fault.
14:26:33FromDiscord<shadow.> lol
14:26:36PMunchIt has been pretty well torture-tested, so hopefully it shouldn't break
14:26:55PMunchWorks fine for me still :)
14:27:04FromDiscord<shadow.> tbh
14:27:06FromDiscord<shadow.> i might do this one in python
14:27:09FromDiscord<shadow.> it'd be so easy...
14:27:20PMunchNot exactly hard in Nim either..
14:27:23FromDiscord<shadow.> just replace all with + and all + with then flip the operators in a custom number override class
14:27:29FromDiscord<shadow.> with operator overload
14:27:31PMunchI think my solution for day 2 is like 38 lines
14:27:33FromDiscord<shadow.> and then use eval()
14:27:40FromDiscord<shadow.> it'd be like 10 in py heck
14:27:43FromDiscord<shadow.> alr ill figure this out
14:28:15Fish-FaceI was considering doing this with a hand written parser but want to learn a bit about writing grammars etc
14:30:42FromDiscord<shadow.> WAIT A MINUTE
14:30:47FromDiscord<shadow.> I THINK I KNOW HOW TO DO THIS
14:30:51FromDiscord<shadow.> LOL
14:31:01FromDiscord<shadow.> YES
14:31:17PrestigeWho was working on the new implementation for concepts? Is the design still in the works, or just the implementation?
14:31:36leorizeAraq is working on it
14:31:49FromDiscord<shadow.> is expr something special? it's syntax highlighted for me https://media.discordapp.net/attachments/371759389889003532/789500168935309352/unknown.png
14:32:02FromDiscord<shadow.> same thing with `stmt` lol
14:32:04PMunchIt used to be typed or untyped
14:32:16PMunchstmt and expr are the old names for typed and untyped
14:32:16FromDiscord<shadow.> hm?
14:32:21PMunchBut I can't remember which was which
14:32:28FromDiscord<shadow.> ohhh
14:32:42PMunchIn like pre 0.20.0 I think
14:32:42leorizeit didn't map directly afaik
14:32:59PMunchOh really? I thought it was just a rename
14:33:03FromDiscord<shadow.> i have an idea
14:33:05Prestigeleorize: ah ty. I'm excited for concepts
14:33:44Fish-FaceThen ownership and borrow checks, and Nim can be rust with better syntax
14:34:23FromDiscord<lqdev> @shadow. the vscode extension needs some serious renovation :p
14:34:39FromDiscord<lqdev> lots of non-keywords that are highlighted for no good reason
14:34:47FromDiscord<lqdev> like `echo`, `expr`, `stmt`
14:35:03FromDiscord<lqdev> and the highlighting is quite inconsistent, why treat `seq` different from `MyType`?
14:35:14PMunchWell echo is a pretty common procedure
14:35:17FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Iy5
14:35:27leorizeit's the only way to highlight more things without having to use nimsuggest semantic highlighter
14:35:30PrestigeWe need some treesitter for highlighting imo
14:35:31PMunch@lqdev, because we don't have semantic highlighting yet
14:35:34FromDiscord<shadow.> ohh is it because it's not in a static context
14:35:58FromDiscord<lqdev> PMunch: that doesn't mean that the vscode extension shouldn't be at least a little bit consistent
14:36:41FromDiscord<lqdev> fortunately my lite plugin does things the mostly right way 😎
14:36:51FromDiscord<bark> wait this is e
14:36:57FromDiscord<bark> i think i got it
14:37:13FromDiscord<bark> since 15:18 to 15:37
14:37:14FromDiscord<shadow.> pmunch what if i make custom operators and then just eval it
14:37:16FromDiscord<shadow.> ;)
14:38:02FromDiscord<bark> sent a code paste, see https://play.nim-lang.org/#ix=2Iy7
14:38:03FromDiscord<bark> but still testing it
14:38:03*mfiano quit (Ping timeout: 256 seconds)
14:38:06PMunchThat's basically what awr1 did
14:38:10FromDiscord<bark> uh should i not have pasted this her
14:38:57FromDiscord<shadow.> holy thats long
14:39:13FromDiscord<shadow.> hmm i think i know a way to eval it as janky as possible
14:39:28PMunch@bark, it's fine for us IRC people now. The Discord bot has saved the day :)
14:39:31FromDiscord<bark> it's the bf-style solution i mean
14:39:41FromDiscord<shadow.> write the code into a new nim file, compile that, and then run from the main program LOL
14:39:42FromDiscord<bark> does it create a link
14:40:15FromDiscord<shadow.> hmmm how can i use parseExpr on a slurp splitLine
14:40:23PMunch@bark, yes
14:40:48PMunch@shadow, by staticRead in a static: block or {.compileTime.} proc
14:41:08PMunch@bark: https://irclogs.nim-lang.org/18-12-2020.html#14:38:02
14:42:06FromDiscord<shadow.> hmm
14:42:19FromDiscord<bark> https://play.nim-lang.org/#ix=2Iyd is my sol. for part 1
14:42:33FromDiscord<bark> it took me 19 minutes 😭 way too long
14:42:53*mfiano joined #nim
14:43:02FromDiscord<shadow.> says the string isn't static
14:43:09FromDiscord<shadow.> sent a code paste, see https://paste.rs/GbG
14:43:12PMunch@bark, this is my part1: https://github.com/PMunch/aoc2020/blob/master/day18/part1.nim
14:43:29FromDiscord<shadow.> what if i do the janky compiler way LMAO
14:44:37FromDiscord<bark> wait is it always 1 long numbers
14:44:41FromDiscord<shadow.> im doing it
14:44:46PMunchYes
14:44:46FromDiscord<shadow.> yup
14:44:47FromDiscord<shadow.> it is
14:44:48FromDiscord<shadow.> rip ur parser
14:45:01PMunchhttps://play.nim-lang.org/#ix=2Iyk < not sure what you're doing wrong @shadow.
14:45:02FromDiscord<bark> wow, it's beautiful
14:45:06FromDiscord<bark> the streams really saved it
14:45:12FromDiscord<bark> (edit) "it" => "a lot of space"
14:45:21PMunchYeah, those take care of a lot of the logic
14:45:44FromDiscord<shadow.> bc eval is a macro in my example
14:45:48FromDiscord<shadow.> and needs static[string]
14:45:48FromDiscord<shadow.> lmao
14:45:52PMunchI mean to make it support multiple character ints wouldn't be super hard
14:45:59PMunchOh right
14:46:03FromDiscord<shadow.> so even in a static block im guessing macros dont work?
14:46:03PMunchYes that makes sense
14:46:04FromDiscord<shadow.> like that?
14:46:07FromDiscord<shadow.> ah
14:46:14FromDiscord<shadow.> i guess ill just compile another file LMAO
14:46:20FromDiscord<shadow.> defo best way to do it trust me
14:46:21PMunchNo they work just fine
14:46:26FromDiscord<shadow.> hm?
14:46:40PMunchMacros work just fine in a static block
14:47:01FromDiscord<shadow.> https://play.nim-lang.org/#ix=2Iyq
14:47:04FromDiscord<shadow.> what's the issue here
14:47:17FromDiscord<shadow.> im guessing it's because the string can be anything
14:47:22FromDiscord<shadow.> but technically it "can be determined compile time"
14:47:24FromDiscord<shadow.> since it's static
14:47:24FromDiscord<shadow.> lmao
14:47:35PMunchYeah it's a bit weird
14:47:44FromDiscord<shadow.> ill just compile another file LOL
14:48:06PMunchparseExpr doesn't return an int though by the way
14:48:13PMunchIt returns the statements as a parsed thing
14:48:42FromDiscord<shadow.> yeah but
14:48:45FromDiscord<shadow.> the result would always be an int, no?
14:48:59FromDiscord<shadow.> like an integer nimnode
14:49:00FromDiscord<shadow.> of some sort
14:49:03PMunchYes, but += eval wouldn't work
14:49:05FromDiscord<shadow.> oh wait
14:49:07FromDiscord<shadow.> rightt
14:49:17FromDiscord<shadow.> well the string thing didnt work either so
14:49:23FromDiscord<shadow.> ill figure this out w compiling lmfao
14:49:28FromDiscord<shadow.> this is such a scuffed way to do it
14:49:30FromDiscord<shadow.> but i love it
14:49:43FromDiscord<shadow.> also, i switched to using 2 spaces finally i love it
14:49:55PMunchIt's pretty nice when you get used to it
14:49:59FromDiscord<shadow.> yeye
14:50:11FromDiscord<shadow.> idk yesterday's quintuple nested loops rly showed me that 20 spaces in is bad
14:50:12PMunchNow I feel all other code is just whitespace
14:50:19FromDiscord<shadow.> ye
14:50:19PMunchHaha, exactly
14:50:24FromDiscord<shadow.> lol
14:50:29FromDiscord<shadow.> my solution was so bad yesterday
14:50:46FromDiscord<shadow.> oh lord
14:50:47FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Iyw
14:50:57PMunchAnd you got away with 5 loops?
14:51:00PMunchI had 9 :P https://github.com/PMunch/aoc2020/blob/master/day17/part2.nim
14:51:04FromDiscord<shadow.> LMAO
14:51:04FromDiscord<shadow.> RIP
14:51:54FromDiscord<shadow.> if you open in write mode
14:51:58FromDiscord<shadow.> it just truncates to 0
14:52:03FromDiscord<shadow.> but when you do subsequent writes before closing
14:52:05FromDiscord<shadow.> they still append
14:52:06FromDiscord<shadow.> right?
14:52:21FromDiscord<shadow.> like f.write("hello\n"); f.write("world") will work as intended, or will it say world
14:52:31PMunchNo that'll work
14:52:35FromDiscord<shadow.> whew
14:54:00*waleee-cl joined #nim
14:55:21PMunchOh well, I'm off
14:55:34PMunchAs I said, no stream today (already solved todays one anyways)
14:55:42*PMunch quit (Quit: Leaving)
14:57:44narimiranno *stream* today, wink wink
14:58:28narimiran(now i see this could be understood differently than what i meant)
14:59:31narimiranCtrl+Z
14:59:36FromDiscord<shadow.> its erroring but i have an answer hm
15:01:51*superbia quit (Quit: WeeChat 2.9)
15:02:22FromDiscord<Kami> you guys need to shill more often this lang looks kinda epic
15:02:58FromDiscord<shadow.> LOL MY COMPILER KINDA WORKED
15:03:02FromDiscord<shadow.> https://media.discordapp.net/attachments/371759389889003532/789508026838024232/eval.nim
15:03:07FromDiscord<shadow.> THIS IS THE JANKIEST SOLUTION EVER I LOVE IT
15:04:35FromDiscord<shadow.> HOLY SHIT IT WORKED
15:05:32FromDiscord<shadow.> https://play.nim-lang.org/#ix=2IyU
15:05:38FromDiscord<shadow.> THIS HAS TO BE MY WORST SOLUTION YET IM CRYING ASHJDOASJDOASG
15:06:06FromDiscord<shadow.> @bark this is so bad it makes me wanna vomit but i love it
15:07:01FromDiscord<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:11FromDiscord<shadow.> this code compiles another script and runs it
15:07:18FromDiscord<shadow.> you're telling me people do that
15:07:28FromDiscord<mratsim> sure
15:07:39FromDiscord<mratsim> I can show you plenty of repo
15:07:46FromDiscord<shadow.> lmao damn
15:08:11Zevvyoung punks think they come by and invent stuff
15:08:12Zevvha
15:08:18ZevvI have seen /some shit/
15:08:23FromDiscord<shadow.> OOH WAIT THIS SHOULD BE EASY TOO LETS GO
15:08:25FromDiscord<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:32FromDiscord<mratsim> and it's clean code
15:09:14FromDiscord<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:23FromDiscord<mratsim> it's used in a core Intel machine learning product
15:09:35FromDiscord<mratsim> now if we skip JIT and emulation
15:10:43FromDiscord<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:13FromDiscord<shadow.> HAHAA PART TWO WORKED TOO
15:11:15FromDiscord<shadow.> THIS IS SO FUNNY
15:11:42FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Iz5
15:11:46FromDiscord<shadow.> this has to be the worst code i've ever written tho.
15:11:57FromDiscord<shadow.> it could break so easily lmfao
15:12:17FromDiscord<bark> here's my 25 minute recursive descent for part two https://play.nim-lang.org/#ix=2Iz6
15:12:32Fish-FaceZevv: 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:47FromDiscord<shadow.> lol https://media.discordapp.net/attachments/371759389889003532/789510476652478554/unknown.png
15:12:49FromDiscord<mratsim> Go code that generates go code: https://github.com/ConsenSys/goff/blob/master/internal/templates/element/mul_cios.go#L3-L65
15:12:52Fish-Facethis seems to preclude the use of external data structures
15:12:57FromDiscord<mratsim> also Vue.JS and Angular all work like that
15:13:04FromDiscord<shadow.> holy shit u put in so much work
15:13:08FromDiscord<shadow.> i feel bad i just said "eval go brr"
15:13:11FromDiscord<bark> how did you
15:13:12ZevvFish-Face: that's something you're not supposed to bring up
15:13:21FromDiscord<shadow.> DONT QUESTION IT
15:13:22FromDiscord<shadow.> IT WORKS
15:13:30Fish-FaceZevv: :(
15:13:52Zevvit's my biggest thing on the list
15:14:08Zevvthe problem is creating a proper API for this, without giving up too much performance
15:14:18*oddp joined #nim
15:14:29ZevvIn /practice/ though, it's usually not an issue, since the majority of the grammars don't seem to need major backtracking
15:14:37Zevvbut it's true, it's the one big problem still in npeg
15:14:46Zevvand the only open github issue, for a long time
15:15:06*klaufir_ joined #nim
15:15:13Fish-Facedoes it mean that in fact there is no way to parse (as opposed to match) recursive structures at the moment
15:17:39FromDiscord<bark> is it possible to give a custom proc precedence in nim?
15:17:43FromDiscord<shadow.> custom op?
15:17:57FromDiscord<bark> yes
15:18:08FromDiscord<bark> a custom op
15:18:14FromDiscord<shadow.> hm idk
15:18:15FromDiscord<bark> like a custom + override
15:18:28FromDiscord<shadow.> luckily i didnt need to do that today lol
15:18:39FromDiscord<shadow.> i just overrided both for part one, then only override mult for part tow
15:18:40FromDiscord<shadow.> (edit) "tow" => "two"
15:20:16FromGitter<awr1> For Day 17 i avoided going with a 4-deep for loop, instead I used set intersections and cartesian products
15:20:18FromGitter<awr1> https://github.com/awr1/aoc/blob/main/2020/day_17.nim
15:21:05FromDiscord<shadow.> that is uh
15:21:07FromDiscord<shadow.> a lot smarter lmfao
15:21:09FromDiscord<shadow.> how fast does it run?
15:21:13FromDiscord<shadow.> mine is 250ms for both parts
15:21:26FromGitter<awr1> takes a minute or so to run without optimizations
15:21:29FromDiscord<lqdev> @bark yeah
15:21:43FromGitter<awr1> i'm going for shortness instead of runtime speed
15:22:12FromDiscord<shadow.> damn
15:22:18FromDiscord<shadow.> i wonder why it's slower than a for loop
15:22:31FromDiscord<shadow.> have you tried like
15:22:38FromDiscord<shadow.> `-d:danger --gc:arc` etc?
15:22:54FromGitter<awr1> it's probably because it allocates a lot
15:23:07FromDiscord<bark> also, running them on a different computer will already yield massively different numbers, not just different flags
15:23:18FromDiscord<shadow.> fair
15:23:37FromGitter<awr1> there are some technically different things I could do to fix that
15:23:57FromGitter<awr1> instead of using sequences, use arrays and pass in static[int]
15:24:24FromGitter<awr1> this would also mean I can't use zip()
15:24:35FromDiscord<shadow.> rip
15:25:17FromDiscord<bark> i wonder if they are doing aoc in bf discord/irc guilds/channels
15:25:25FromDiscord<bark> must be a pain
15:26:06FromGitter<awr1> probably less so if you used a language that compiled to BF
15:26:44FromDiscord<bark> if that counts, my nim solutions count as writing them in x86-64 machine code
15:30:05FromGitter<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:22FromDiscord<Rika> we need better iterators imo 😛
15:34:57*regreg quit (Ping timeout: 268 seconds)
15:35:59disrupteknah, dom96 will give you better iterators via async/await.
15:36:52disrupteki 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:10FromDiscord<Rika> hella passive aggressive
15:37:23disruptekyeah, it's fucking ridiculous.
15:38:17supakeenCan 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:46disrupteknot really. when people are assholes, i call them out on that shit. just as you are.
15:39:04disruptekit has nothing to do with incompetence.
15:39:12disruptekwe're talking about pure bullshit.
15:40:07disruptekwhat'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:32FromDiscord<Kami> cring
15:40:35disruptekeven dom96 missed it. because people cannot be bothered to even open their minds to learning a thing.
15:40:35FromDiscord<Rika> sorry, i havent been programming in nim for a while because im in the process of moving still
15:40:50FromDiscord<Kami> @disruptek shut up bigot
15:41:05disruptekyeah, okay, buddy.
15:41:13*habamax quit (Ping timeout: 260 seconds)
15:41:35*supakeen left #nim ("WeeChat 2.9")
15:42:00FromDiscord<Rika> the fuck are you
15:42:08disruptekwell, maybe dom96 does get it. i can't really tell. there's a lot of smoke here but no fire.
15:42:43FromDiscord<Rika> man disruptek might be too aggressive rn but where the fuck did bigot come from
15:42:47FromDiscord<Rika> and who the hell are you
15:43:54FromDiscord<ache of head> they left 🤔
15:44:34disrupteksupakeen: if you want to have a technical discussion, i'm all ears.
15:44:49disruptekactually, if you want to show me how i'm wrong about dom96's response, i'll listen.
15:44:56disruptekbut don't tell me that i cannot read.
15:45:10disrupteki've been doing this from a very young age...
15:47:03FromDiscord<Rika> man randos are weird
15:47:09disruptekalrighty then.
15:47:45leorizedom's lack of response is just him being busy i think
15:48:02leorizelike how he still haven't reviewed my tls pr...
15:48:11disruptekyeah, i don't think there's any point to talking to dom anymore.
15:48:25disruptekthis is a person that really doesn't seem to have anything useful to contribute.
15:48:45disruptekbut i'm in the mood to debate with supakeen, if s/he can grow some balls.
15:49:00disrupteklet's fucking talk about this stuff.
15:50:23leorizeam I missing something? suprakeen hasn't said anything
15:51:04disruptekthey think i'm shitting on someone for being incompetent.
15:51:34leorizehmm?
15:51:47disruptekwhen i'm really just shitting on them for not engaging sincerely with the community and the topic at hand.
15:54:52Fish-FaceZezz: (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:23FromGitter<awr1> You can parse using captures and a stack
15:58:22FromGitter<awr1> as for failures...hm
16:01:16FromGitter<awr1> maybe check `capture.len`
16:02:37FromGitter<awr1> capture block should run only if pattern is ok I think
16:05:03*Avahe[m] joined #nim
16:05:47Avahe[m]Anyone else unable to do the survey on mobile?
16:07:16Araqdisruptek, once again I'm telling you to cut down the number of swearwords
16:07:33Araqif you want to discuss things with dom, hightlight him and wait for his replies
16:08:03Araqif 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:58Araqand since it seems to be about his latest RFC, you can raise your voice in the particular RFC
16:16:05Fish-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:21Fish-FaceI was going to try that later with the event parser
16:18:00*a_chou joined #nim
16:18:48leorizeNim ARM CI PoC: https://cloud.drone.io/alaviss/Nim/5/1/2
16:20:13Fish-Face@awr1 but the built-in pegs has limited number of captures so it seems like it won't work either
16:22:18ForumUpdaterBotNew 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:23disruptekthere's nothing to say. i've already made my point.
16:26:50Zevvarw1: "normal" captures which are grabbed by npeg and returned at the end are guarenteed to be valid
16:27:01Zevvbut code block captures will run at match time, and might potentially get backtracked
16:27:32Fish-FaceMaybe it's back to writing my own parser
16:31:18Zevvsure, npeg is not your golden hammer
16:32:58Fish-Face*sniff*
16:33:14disruptekhe's not being rude;
16:33:19disrupteknpeg is /my/ golden hammer.
16:33:29ZevvAnd I'm your THOR!
16:33:57disrupteknot unless you've grown a beard to rival pmunch's.
16:34:15ZevvI took it off last week
16:34:18Zevvthe itch was unbearable
16:34:22disruptekliar.
16:34:43Zevvnot lying. I'm a poor groomer. I never shave, I just take it all of 5 or 6 times a year.
16:34:51Zevvs/off/
16:35:21disruptekreally? i probably shear it about twice as often.
16:35:28disruptekjust to keep the lice down, really.
16:36:44Zevvyou need those, take care of the leftovers
16:36:55disruptekthey /are/ the leftovers.
16:37:14disruptekbut, having them fall into food you're preparing for someone else is kinda iffy.
16:37:37disruptekit doesn't happen often, but when it does, it kinda ruins the mood, y'know?
16:38:23ZevvI know right
16:38:36disruptekso clybber supposedly fixed a bug, but all i can see is a red CI that was green yesterday.
16:39:21disrupteki guess i will let carnac be the canary.
16:39:32FromDiscord<Clyybber> I didn't even make a PR
16:39:43disruptekaww, and i tried not to ping you.
16:39:57FromDiscord<Clyybber> you didn't :)
16:40:04disruptekwhat, because simply rm'ing typ didn't fix it?
16:40:18disruptekit needs a full sem, doesn't it?
16:40:21FromDiscord<Clyybber> yeah, but I think I now the issue
16:40:36disruptekwhat is it?
16:40:43FromDiscord<Clyybber> disruptek: Yeah; remove nfSem and .typ
16:41:03FromDiscord<Clyybber> but the issue is that we need to resem nodes introduced by the previous sem pass
16:41:08FromDiscord<Clyybber> nodes that weren't accounted for yet
16:41:12FromDiscord<Clyybber> like nkHiddenAddr
16:41:18disruptekyeah.
16:41:20FromDiscord<Clyybber> but this should be easy
16:42:14disruptekwhy doesn't the code already do that?
16:42:42FromDiscord<Clyybber> because it never occurred probably
16:42:57disruptekZevv: i think we have to wait for CPS to settle in mratsim's brain, and then we can make progress.
16:43:21disruptekclyybber: so not doing it was an optimization? or an oversight?
16:43:32FromDiscord<Clyybber> not any of the two
16:43:47FromDiscord<Clyybber> since typed macros only recently have started to really work
16:44:11FromDiscord<Clyybber> or rather; it only is a problem if you strip the typ field
16:44:45disrupteki really had no idea typed macros weren't a thing.
16:44:57FromDiscord<Clyybber> I mean they were, but not fleshed out
16:45:13disruptekjust like i remember reading that i could query effects via macros but now i can't find any way to do that.
16:45:29FromDiscord<Clyybber> there is an api
16:45:43disrupteksure.
16:46:28leorizenim 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:33FromDiscord<Clyybber> but I think we are getting into the make a spec for typed AST territory Araq was speaking of
16:46:36disruptek\o/
16:46:49leorizethat's faster than any other ci platform that we're using
16:46:53FromDiscord<Clyybber> because we have to ask ourselves if nkHiddenAddr should end up in semmed ast
16:47:03disruptekleorize: not surprised.
16:47:08FromDiscord<Clyybber> leorize: Hey, thats cool
16:47:23disrupteki need nkHiddenAddr for CPS, so... yes.
16:47:42FromDiscord<Clyybber> Oh, ok.
16:47:57FromDiscord<Clyybber> What for?
16:48:21disruptekbecause we need to be able to identify uses that we cannot sym-substitute.
16:48:47disruptekaddr x != addr otherx
16:49:19FromDiscord<Clyybber> but why do you need to see nkHiddenAddr for that
16:49:48disruptekwell, it's for var/mutable params, right?
16:49:52FromDiscord<Clyybber> yeah
16:50:04disruptekso how else can i determine that something is var/mutable?
16:50:40FromDiscord<Clyybber> looking at the type
16:50:52disruptekyou mean the param type?
16:51:02FromDiscord<Clyybber> yeah
16:51:18FromDiscord<Clyybber> or look at the symbol kind
16:51:37haxscramperZevv: 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:54disruptekmaybe if i have another pass just to "clarify" after i've already processed the ast.
16:52:20haxscramperOr I should just raise my own exception if I need anything beyond simple string errors?
16:52:38disruptekraise your own.
16:52:55FromDiscord<Clyybber> disruptek: Dunno what you mean
16:53:36disruptekthere are some addr uses that are fine, but i won't know until i've examined the entire tree.
16:54:04disruptekbut let's ignore it for now. no reason to make the spec looser than it absolutely needs to be.
16:57:16FromDiscord<Clyybber> looks like semExpr does actually already handle nkHiddenAddr, but it doesn't set the .typ of the nkHiddenAddr node
16:58:35FromDiscord<Clyybber> because thats context dependent; could be lent/var/ref
16:59:17FromDiscord<Clyybber> eh var/ptr
17:00:27FromGitter<awr1> is windows on ARM a workable target for nim
17:07:21disruptekclyybber: any idea about #16389 ?
17:07:24disbothttps://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:21FromDiscord<Clyybber> haven't looked at it yet
17:09:19disruptekwell, the only significant merge is araq's ic patch.
17:09:22FromDiscord<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:30FromDiscord<mratsim> but should not be THE scheduler for IO
17:09:50FromDiscord<Clyybber> disruptek: Yeah, look at the conversation on that PR; afair planetis[m] also had a regression
17:09:57FromDiscord<Clyybber> that just happened to be working in devel
17:10:10FromDiscord<mratsim> i.e. we need to write something from scratch or emulate/reimplement closure iterators on top of async
17:13:11disruptekreimplementing closure iterators isn't a problem, but it's out of scope to use the async dispatcher for CPS continuations.
17:14:38disruptekwhat 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:49FromDiscord<dom96> disruptek: I'm sorry you have a problem with me. But there's no excuse for abuse here.
17:14:51disrupteki mean the entry proc.
17:15:06disruptekdom96: no one is abusing you by calling you out for your lack of sincerity.
17:15:17FromDiscord<mratsim> it's for a transition period, from either asyncdispatch or chronos
17:15:32FromDiscord<ElegantBeef> Hey dom, when do we get images for the nim subreddit? 😄
17:15:32disruptekwhy do i care about async?
17:15:44disruptekjust keep using it if you like it. cps doesn't need to replace it.
17:15:56FromDiscord<dom96> Also, for some reason the discord bridge bot no longer highlights people when mentioned on IRC
17:16:09FromDiscord<mratsim> I don't care about async, I care about existing code
17:16:26FromDiscord<ElegantBeef> I believe yard made it so you have to do `@dom96`
17:16:33disruptekwell, my life looks to be too short to worry about other people's existing code that doesn't use cps.
17:16:44disrupteki'm more interested in new code.
17:16:53FromDiscord<Clyybber> @ElegantBeef No, I changed it
17:16:58FromDiscord<Clyybber> Not sure why it failed just now
17:17:01FromDiscord<ElegantBeef> Ah
17:17:09FromDiscord<mratsim> New code won't get written if Nim advances alone without the devs that supported it from the start.
17:17:11FromDiscord<Clyybber> Maybe it doesn't catch numbers
17:17:15disruptekmaybe it only pings people that have something useful to say?
17:17:25FromDiscord<ElegantBeef> But i've been pinged before
17:17:43FromDiscord<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:46disrupteksomehow i've gotten by writing new nim code without dom96's help.
17:17:46FromDiscord<Clyybber> dom has a number in his nick; you don't
17:18:00FromDiscord<ElegantBeef> Clyybber i was responding to disruptek's comment
17:18:08FromDiscord<Clyybber> oh
17:18:19FromDiscord<ElegantBeef> I'm not that dumb
17:18:21disruptekhey where did your space go, beef?
17:18:37disruptek!last Elegant Beef
17:18:37FromDiscord<ElegantBeef> In the trash heap so your numpties could ping me
17:18:38disbotElegant Beef spoke in 12#nim 8 weeks ago 12https://irclogs.nim-lang.org/19-10-2020.html#08:29:25
17:18:38FromDiscord<Clyybber> disruptek: can you please test something write "clyybber: test"
17:18:46disruptekdamn i'm out of the loop.
17:18:55disruptekclyybber: sup schnookums
17:19:00FromDiscord<Clyybber> oh, it broke
17:19:09FromDiscord<Clyybber> can you try with the C capitalized?
17:19:16disruptekClyybber: sup schnookums
17:19:41FromDiscord<Clyybber> damn, it dun goofed
17:19:49FromDiscord<ElegantBeef> Look what you've done
17:20:01disruptekmratsim: 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:33disruptekthe only reason i'd do it is to remove closure iterators from the compiler.
17:20:55disrupteki think async is better served by replacement with chronos, first.
17:21:15FromDiscord<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:19FromDiscord<ElegantBeef> (edit) "o" => "out"
17:21:57FromDiscord<Clyybber> ok; I guess just post the examples here for discussion
17:22:11FromDiscord<Clyybber> (edit) "examples" => "errors"
17:22:38FromDiscord<Clyybber> or we could also discuss it on github
17:22:58disruptekleorize: 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:08FromDiscord<dom96> Images of what?
17:23:19FromDiscord<ElegantBeef> The nim logo and a non blue header
17:23:42FromDiscord<dom96> oh, for the stylesheet. Good question
17:23:44FromDiscord<ElegantBeef> We're looking worse than Zig there 😄
17:23:49leorizedisruptek: just a bunch of regex fed to github
17:24:00FromDiscord<dom96> Anyone with good CSS skills that knows how to cook up a nice Reddit style?
17:24:21FromDiscord<Clyybber> I don't have good CSS skills but it shouldn't be too hard to adapt something
17:24:29leorizemratsim: cloud.drone.io is providing free arm/arm64 build machines
17:24:38FromDiscord<Clyybber> there are very nice easy to chagne prebuilt CSS
17:25:17Zevvhaxscramper: 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:23Zevvso just ignore the messageitself
17:25:53FromDiscord<ElegantBeef> Arent the reddit CSS days deprecated?
17:25:59FromDiscord<ElegantBeef> Isnt it now just upload an image/banner
17:26:11FromDiscord<Clyybber> oh; yeah CSS doesn't display on the new reddit
17:26:12FromDiscord<dom96> I'm stuck in the past, I still use old reddit
17:26:49FromDiscord<Clyybber> @dom96 I'm u/clyybber if you want to mod me
17:26:59FromDiscord<ElegantBeef> Well throw the logo and nim purple image for the header on new reddit
17:27:06FromDiscord<ElegantBeef> Ziglang has their logo and yellow
17:27:09federico3dom96: stuck in the past? I miss usenet
17:27:33disrupteki miss the technical challenges of usenet.
17:27:48FromDiscord<ElegantBeef> Fuck you guys are probably old enough you remember social media when it was called "Stand up Philosphy"
17:27:50FromDiscord<dom96> looks like Reddit ain't having fun today https://media.discordapp.net/attachments/371759389889003532/789544462397079592/unknown.png
17:28:19FromDiscord<dom96> federico3: missed usenet completely unfortunately
17:28:40FromDiscord<dom96> @Clyybber added
17:28:58FromDiscord<Clyybber> cool; thanks
17:30:56FromDiscord<mratsim> @leorize, yes I've seen drone
17:31:13FromDiscord<mratsim> But I don't want to spend my weekend dealing with CI :p
17:31:26disruptekhey, it's friday here.
17:33:02FromDiscord<dom96> @mratsim maybe there is room for a machine learning solution to CI? 😛
17:33:15FromDiscord<dom96> I bet there is a startup for this out there already
17:33:21FromDiscord<mratsim> when CI gives you 2 cores?
17:33:51FromDiscord<mratsim> there was this startup at Fosdem 2018 that used ML (well they said so) to autotag issues on Github
17:33:56disrupteknigel does 4,000 compilations/second. i don't care.
17:33:56FromDiscord<mratsim> or something in that vein
17:34:19FromDiscord<dom96> oh yeah, I remember. They used our repo as an example lol
17:34:46FromDiscord<ElegantBeef> What error highlighting are we talking about anywho
17:35:02disrupteksome magic leorize sprinkled in setup-nim.
17:47:11*klaufir_ quit (Remote host closed the connection)
17:47:37*klaufir_ joined #nim
17:53:38FromDiscord<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:27FromDiscord<shadow.> khchen_
17:55:31FromDiscord<shadow.> (edit) "khchen_" => "khchen?"
17:56:05FromDiscord<shadow.> doesnt seem like it
17:59:03FromDiscord<juliuskiesian> what is the replacement for NimIdent since it's deprecated?
17:59:34disruptekident"myIdentifier" is idiomatic.
18:01:52FromDiscord<juliuskiesian> ok. what if i want to use it as a type, as in x: NimIdent?
18:01:57leorizemratsim: 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:58disbotARM-based CI for Linux [ci skip]
18:02:02disruptekx: NimNode
18:03:05*carthia joined #nim
18:03:11*carthia left #nim (#nim)
18:04:28FromDiscord<juliuskiesian> newIdentNode is not usable with NimNode though.
18:04:47leorizeident(string) is the way to go now
18:06:35disruptekshadow.: you gonna finish that deques PR?
18:06:56*abm joined #nim
18:08:34*natrys joined #nim
18:08:54FromDiscord<juliuskiesian> sent a code paste, see https://play.nim-lang.org/#ix=2IAx
18:09:31disruptekpro tip:
18:09:39disruptekresult = nnkTypeSection.newTree: ...
18:09:52disruptekprobably should go into my style guide.
18:10:41FromDiscord<juliuskiesian> that would look better indeed.
18:10:47FromDiscord<juliuskiesian> otherwise the code is ok?
18:11:19disruptekit's useful for `result.add:`, too. what's the problem that i'm supposed to be looking at?
18:15:24FromDiscord<juliuskiesian> sent a code paste, see https://play.nim-lang.org/#ix=2IAC
18:15:30FromDiscord<juliuskiesian> Error: undeclared identifier: 'AppConfig'
18:15:31haxscrampernarimiran: 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:01haxscramperAs API is not going to be changed, so subsequent fixups won't introduce breakages
18:17:26narimiranhaxscramper: i lost the link, but - 4raq said he will review it
18:19:03narimiran(found the link)
18:26:41FromDiscord<Clyybber> @dom96 do you think we should have "we are the knights who say nim" on the banner?
18:28:22FromDiscord<dom96> Dunno, Monty Python is more Python's thing.
18:28:32FromDiscord<Clyybber> heh
18:28:43FromDiscord<dom96> it is a cool pun though
18:29:04FromDiscord<Clyybber> yeah; have to get zevv to give me the file tho
18:29:12FromDiscord<Clyybber> Zevv: ^
18:30:01Zevvthink my original was in /tmp
18:30:40FromDiscord<shadow.> uhh disruptek shoot
18:30:48FromDiscord<shadow.> completely forgot that timothee wanted me to like
18:30:52FromDiscord<shadow.> fix the algorithm
18:31:03FromDiscord<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:29disruptektell him that a performance improvement can be made in a subsequent PR.
18:31:32FromDiscord<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:43FromDiscord<shadow.> fair enough
18:31:54FromDiscord<shadow.> i still needa fix the negative version, apparently it's buggy
18:32:18disruptekare you gonna complete `testes.expect`? it needs a rebase now.
18:33:10FromDiscord<shadow.> did we figure out why it failed 1-1.2?
18:33:11FromDiscord<shadow.> lmao
18:34:27disruptekyou will need to bindSym"ExpectExceptionDefect" for one thing.
18:34:36disruptek(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:38disruptekmaybe 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:31disruptekhasDefects 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:10FromDiscord<shadow.> ahh i see
18:52:26FromDiscord<shadow.> kk gimme a bi
18:52:27FromDiscord<shadow.> (edit) "bi" => "bit"
18:52:54disrupteksure. this only applies to the testes master, of course.
18:57:09Fish-FaceI 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:09Fish-FaceIs 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:38FromDiscord<dom96> Fish-Face: what's the package?
18:57:42Fish-Facelilt
18:58:04Fish-Faceoh, I notice it is archived and old
18:59:09Fish-FaceI guess it's not compatible with current nimble
18:59:28FromDiscord<dom96> It does some magic to get the version https://github.com/Quelklef/lilt/blob/master/lilt.nimble#L14
18:59:32FromDiscord<dom96> looks like this is broken for some reason
19:00:12Fish-Faceyes I saw that line but didn't know what to make of it :P
19:03:26FromDiscord<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:28haxscramperIs 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:27FromDiscord<exelotl> > result = nnkTypeSection.newTree: ...↵dumpAstGen will give it to you in that style too, it's nice :D
19:28:53FromDiscord<SirJosh> anybody got a guess as to what the most similar thing to a nim iterator is in c++?
19:30:43haxscramperThere are no inline iterators, but you can get pretty fancy API with regular C++ iterators
19:31:06FromDiscord<SirJosh> regular c++ iterators don't look as clean as nim iterators though :(((
19:31:26FromDiscord<SirJosh> oh well ¯\_(ツ)_/¯
19:31:28haxscramperWell, with range loops and C++17 unpacking you can get pretty close
19:31:38FromDiscord<SirJosh> oh?
19:31:47haxscramper> C++17 though
19:32:09FromDiscord<SirJosh> modern c++ is fine, was primarily just curious anyways
19:32:18haxscramperFor unpacking, but range loops has been available since C++11
19:32:39haxscramperBut /implementing/ iterators is a very depressing thing in C++
19:34:11FromDiscord<nikki> you can make an iterator that wraps a stateful lambda; it's still not in the "yield" form but maybe closer
19:34:49FromDiscord<nikki> idk if more possible with co_yield in c++20
19:37:40*Q-Master quit (Ping timeout: 256 seconds)
19:43:04FromDiscord<shadow.> i mean yeah you have like
19:43:12FromDiscord<shadow.> `for (auto n : a)`
19:43:14FromDiscord<shadow.> or like
19:43:21FromDiscord<shadow.> `for (auto [n, m] : a)`
19:43:25FromDiscord<shadow.> but it's still not easy to implement
19:43:27FromDiscord<shadow.> or as clean
19:44:20FromDiscord<Quibono> Sooo installing Nim on one of the M1 ARM macs...
19:44:25FromDiscord<Quibono> Choosenim doesn't support it
19:44:42FromDiscord<JSONBash> Quibono you the alpaca guy?
19:44:45FromDiscord<Quibono> Da
19:45:14FromDiscord<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:20FromDiscord<dom96> (edit) "MBP's" => "MBP"
19:45:48FromDiscord<JSONBash> im interested in an alpaca wrapper too
19:46:46FromDiscord<Quibono> It's not done yet, about halfway?
19:47:08FromDiscord<Quibono> https://github.com/QuixoticValentine/Nimpaca
19:47:25FromDiscord<Quibono> @dom96 The mini is crazy performance for the price
19:47:52FromDiscord<JSONBash> thats awsome, thamks for that
19:48:02FromDiscord<JSONBash> ill keep in touch about it 🙂
19:48:54FromDiscord<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:03FromDiscord<dom96> yeah, I would buy the mini but I have far too many desktop PCs already heh
19:51:21FromDiscord<dom96> and I need a laptop... the only thing is that I bet Apple will release something even better next year
19:51:30FromDiscord<dom96> i.e. a pro machine that actually has a different chip
19:51:55FromDiscord<Quibono> Yeah, although the current air is pretty damn sweet
19:52:06FromDiscord<Quibono> Maybe get one then trade for a pro next year?
19:52:36FromDiscord<dom96> hmm, I'm not much to do that sort of thing. I've had this MBP since 2015
19:53:10FromDiscord<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:01FromDiscord<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:14Fish-Faceholy crap does nimly's templating prevent you from defining two parsers in the same scope??
20:06:18giacohello! 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:31FromDiscord<dom96> I would just define an object modelled after the UDP packet structure
20:07:37FromDiscord<dom96> in a similar way to a struct in C
20:08:41giacodom96: 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:25FromDiscord<InventorMatt> you can also check out the binaryparse library https://github.com/PMunch/binaryparse
20:13:26FromDiscord<Quibono> Okay, enjoying the early adopter pain, I can't use Brew to install nim
20:13:55giacoInventorMatt, interesting, but I'd like to avoid external libraries now, as I perfer to learn oh its done
20:14:04FromDiscord<dom96> giaco: pretty much yeah, there might be better solutions out there but I'm not aware of them.
20:14:34disruptekquibono: just fork gitnim.
20:14:36disruptek~gitnim
20:14:36disbotgitnim: 11https://gitnim.com/ -- choosenim for choosey nimions -- disruptek
20:15:03*oddp quit (Quit: quit)
20:15:11FromDiscord<Quibono> It'll work on arm?
20:15:19disruptekof course. you can supply our first arm distro.
20:15:43Fish-Facegitnim seems horrifying
20:16:09disruptekyeah, it's pretty scary stuff.
20:16:45FromDiscord<Quibono> So just to clarify since I'm slow, I can install it, build it, and then use it to install nim?
20:16:45leorizeQuibono: 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:12Fish-FaceI think most people use choosenim, Quibono
20:17:28FromDiscord<Quibono> Fish it doesn't support arm
20:17:49disruptekyou 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:19disruptekname the branch according to the version, as i have. add tags as you please.
20:18:42disruptekit's exactly as simple as it looks.
20:18:51Fish-FaceOic
20:18:58FromDiscord<Quibono> _Is still newb so not simple_
20:20:52FromDiscord<Quibono> There is a linux arm nightly but IDK if it'd work
20:22:07FromDiscord<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:09ForumUpdaterBotNew thread by Buster_blue: One line comprehension equivalence, see https://forum.nim-lang.org/t/7269
20:57:26*superbia joined #nim
21:00:59disrupteka linux arm won't work.
21:02:20*Jesin quit (Quit: Leaving)
21:06:49FromDiscord<Quibono> So I'm SOL for now
21:07:49FromDiscord<mratsim> building Nim on arm from source is not really difficult
21:08:04FromDiscord<mratsim> git clone the github repo
21:08:07FromDiscord<mratsim> cd into it
21:08:15FromDiscord<mratsim> and sh build_all.sh
21:08:36FromDiscord<mratsim> add Nim/bin to your ./bash_profile
21:08:53FromDiscord<mratsim> $PATH=$HOME/Nim/bin:$PATH
21:08:56FromDiscord<mratsim> done
21:10:02FromDiscord<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:58FromDiscord<Quibono> @mratsim
21:17:06FromDiscord<Quibono> sent a code paste, see https://play.nim-lang.org/#ix=2IBO
21:19:10*Jesin joined #nim
21:19:35FromDiscord<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:11FromDiscord<Quibono> Apparently not?
21:23:11FromDiscord<Quibono> Should I add the error to the nightlies issue?
21:24:12FromDiscord<Quibono> Oh looks like there is already an issue
21:24:19FromDiscord<Quibono> https://github.com/nim-lang/Nim/issues/16211
21:24:21disbotSupport for Apple Silicon / M1 ; snippet at 12https://play.nim-lang.org/#ix=2IBQ
21:29:47FromDiscord<dom96> Linux arm is not the same as macOS arm
21:29:58FromDiscord<dom96> We haven’t traditionally built for that combination
21:30:15FromDiscord<dom96> But you can build it yourself until a new version gets released
21:30:33FromDiscord<Quibono> By editing build.sh?
21:31:13*clemens3_ quit (Ping timeout: 260 seconds)
21:31:29FromDiscord<dom96> You’ll need a non arm Mac or other PC
21:32:11FromDiscord<Quibono> So you're saying no macOS arm support until like 1.5?
21:32:23FromDiscord<Quibono> Like how long are we talking
21:32:36*clemens3_ joined #nim
21:32:40FromDiscord<dom96> It’ll hopefully get back ported.
21:34:18FromDiscord<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:09FromDiscord<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:23FromDiscord<Quibono> Yeah right now i can't, I'll just wait.
21:37:57FromDiscord<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:38FromDiscord<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:54FromDiscord<tiatomee> Could I write `a, b: string, c: string` too or is a `;` required after multiple parameters with the same type?
21:39:05FromDiscord<Recruit_main707> @exelotl iirc there are other cases, but yeah, using is the usual one
21:39:17FromDiscord<exelotl> yeah you can do that, and most people do :)
21:39:35FromDiscord<ElegantBeef> It's not required to use `;` it's just more ensured and typically iirc what macros tend to output afaik
21:39:45FromDiscord<Recruit_main707> yep
21:39:50FromDiscord<tiatomee> That's very nice to know, thanks y'all!
21:40:10FromDiscord<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:17FromDiscord<Recruit_main707> np
21:55:54*haxscramper quit (Remote host closed the connection)
22:01:46FromDiscord<Recruit_main707> did we have something like requests for nim?
22:02:40FromDiscord<ElegantBeef> Isnt the httpclient that?
22:04:14FromGitter<bung87> https://github.com/hapijs/accept/blob/4f5e3a1a7bd387fc5a908ad993b353a08946a5ab/test/mediatype.js#L144 why this order ? 'image/*','text/html','text/plain;format=flowed',
22:05:18FromGitter<bung87> most specific is text/plain;format=flowed and text/plain;level=
22:06:16FromDiscord<Recruit_main707> @ElegantBeef it seems so, yeah
22:08:39FromDiscord<shadow.> yeah httpclient works pretty well
22:27:46*krux02 joined #nim
22:33:59*Vladar quit (Quit: Leaving)
22:37:23FromDiscord<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:46FromDiscord<shadow.> wow
22:59:47FromDiscord<shadow.> LOL
22:59:55FromDiscord<shadow.> hows the
22:59:58FromDiscord<shadow.> arm mac coming along
23:01:25disruptekslowly. 😁
23:01:33disruptekyou said you're using jason, right?
23:03:05FromDiscord<shadow.> i've used it before ye
23:04:15*superbia quit (Quit: WeeChat 2.9)
23:04:40disrupteki spent a few hours making it faster.
23:04:47FromDiscord<shadow.> oh nice
23:04:54FromDiscord<shadow.> i haven't really used it in like
23:04:59FromDiscord<shadow.> high pressure circumstances lol
23:05:10FromDiscord<shadow.> i like it bc it's simple to use
23:05:17FromDiscord<shadow.> but speed is always nice
23:05:25FromDiscord<shadow.> now you can beat the other libs by even more
23:05:33FromDiscord<Quibono> Disruptek is Jason the fastest now?
23:05:38FromDiscord<shadow.> wasnt it already?
23:05:40FromDiscord<Quibono> I wants fast jason pls.
23:06:19disruptek0.4.0 is significantly faster. more optimization remains.
23:07:33disruptekthere isn't a faster serializer, no. but enimemememem or whatever the fsck it's called is a more complete solution.
23:08:09disrupteki will eventually merge in the deserializer in there, assuming it's fast enough.
23:08:15disruptekor vice-versa.
23:11:14FromDiscord<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:02disruptekjason doesn't deserialize. like, at all.
23:28:20disruptekuse planetis-m's macro if you want that.
23:28:46disruptekor treeform's new json lib.
23:30:39disruptekpackedjson 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:19FromDiscord<Quibono> Gotcha gotcha
23:31:45disruptekmight be time to bite the bullet and learn ggplotnim.
23:32:20FromDiscord<Quibono> Oh?
23:32:54disruptekit supports svg, and svg can embed in front-page READMEs nicely, so it's rather handy.
23:33:31disruptekbtw, i wrote a little shim that generates, like, the cli output you see on some of my projects. it's in xs.
23:33:35disruptek!repo disruptek/xs
23:33:36disbothttps://github.com/disruptek/xs -- 9xs: 11xstreamstartup.com 15 3⭐ 0🍴
23:33:58disruptekdemo.nim. it uses termtosvg, which is archived but still available.
23:34:32disrupteki don't know a more foolproof way to embed such content in markdown.
23:34:49disrupteki don't really want to get into cheerio type stuff.
23:38:59*tane quit (Quit: Leaving)
23:50:54giaconewbie 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:15disruptekappend a : and try again.
23:51:30giacoI don't xee any example of custom proc based parser in official docs "https://github.com/PMunch/binaryparse"
23:51:40disruptekcan we see your code?
23:52:28giacosure. I'm just playing around by writing an rtp and ogg protocol reader
23:52:54disruptek~paste
23:52:55disbotpaste: 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:04disruptekrika will help you. 👍
23:54:37giacodisruptek: https://termbin.com/5yfw
23:55:24giacoI'm trying to write oggSegmentParser, as custom proc based parser, but it doesn't like it
23:57:50FromDiscord<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:08FromDiscord<ElegantBeef> `nosideeffect` i'd imagine
23:58:36FromDiscord<tiatomee> I think the order is important: I have a tuple type that expects `{.closure.}`
23:58:47FromDiscord<tiatomee> and the first thing is what is passed, which does not match
23:58:59FromDiscord<tiatomee> and no side effects should be just fine for closures, no?
23:59:17FromDiscord<nikki> if you change the .closure. to .nimcall. does it work just to check
23:59:23FromDiscord<ElegantBeef> I was uncertain and just took a stab 😄
23:59:25FromDiscord<nikki> may break other calls tho
23:59:40FromDiscord<tiatomee> That seems to work better
23:59:45FromDiscord<nikki> how so?