<< 13-01-2022 >>

00:00:54FromDiscord<Elegantbeef> The fact you get the `when` branches on introspection without introspecting `Attestiation` is odd
00:01:06FromDiscord<Elegantbeef> So yea this is a mess
00:01:42FromDiscord<Patitotective> In reply to @Zevv "as you want this": When you say _stack_ do you mean a sequence or?
00:02:23FromDiscord<mratsim> a stack can be backed by a sequence but it's just a data structure with push/pop from thr end only
00:02:48FromDiscord<mratsim> no lookup in arbitrary places for example, no iteration
00:02:55FromDiscord<Elegantbeef> In Nim atleast sequences are generally used as a stack since they have `pop`
00:03:07FromDiscord<mratsim> (edit) "thr" => "the"
00:03:29FromDiscord<Elegantbeef> It's an `O(1)` insertion at the tail and a `O(1)` removal
00:03:39FromDiscord<Patitotective> Ok thanks 🙃
00:03:54FromDiscord<Elegantbeef> unless you need to grow the collection
00:04:18FromDiscord<Elegantbeef> That's so odd that you do not get the instantiated AST
00:04:27FromDiscord<Elegantbeef> still amazed by that
00:05:53FromDiscord<Elegantbeef> Oh right you're getting a bracket expression
00:08:30FromDiscord<Elegantbeef> Mratsim do you know the hack for the https://github.com/nim-lang/Nim/issues/16639 of assigning the type to a variable and passing the variable to an actual macro?
00:08:31FromDiscord<mratsim> I get nodes with just "Type" as well
00:09:30FromDiscord<mratsim> I know that hack and I know the hack of not assigning a type to a variable and passing it directly as well
00:09:58FromDiscord<Elegantbeef> What's the latter hack look like?
00:10:20FromDiscord<mratsim> sent a long message, see http://ix.io/3M1V
00:10:45FromDiscord<mratsim> https://github.com/status-im/nimbus-eth2/commit/ce0f7af862a5319a49e74ef3539d9ad8016e181d
00:10:59*krux02 quit (Remote host closed the connection)
00:11:11FromDiscord<mratsim> L219 for the storing, and L114 for the unstoring
00:15:51FromDiscord<Elegantbeef> Yea this stuff is silly
00:15:59FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3M1W isnt a good solution 😀
00:17:26FromDiscord<Elegantbeef> I just had to make 100% certain i wasnt crazy
00:17:55FromDiscord<Elegantbeef> I guess the issue is that passing a generic typedesc doesnt mean instantiation ever occured
00:18:06FromDiscord<Elegantbeef> Whereas assigning it a variable means it occurs
00:27:52arkanoidbeen wasting a lot of time on a weird futhark/clang SIGSEGV that I've reproduced in a minimal example case in docker
00:28:03arkanoidI'm not sure what's going on here
00:31:41FromDiscord<Patitotective> Is there a `parseSeq` procedure?
00:33:43*koltrast joined #nim
00:34:14FromDiscord<Elegantbeef> There is not
00:34:29FromDiscord<Elegantbeef> `parseSeq` is ambiguous there is no common seq format
00:35:11FromDiscord<Patitotective> so?
00:35:31FromDiscord<Elegantbeef> So what?
00:56:56FromDiscord<tsoj> How can I remove every last bit of choosenim and nimble from my machine (Manjro Linux)?
01:01:21FromDiscord<Patitotective> In reply to @Elegantbeef "So what?": so how do i parse a sequence that's represented in a string?
01:02:05FromDiscord<Elegantbeef> Depends on the string
01:02:33FromDiscord<Elegantbeef> Assuming it's `[]` you iterate over it parsing each element internally
01:02:52FromDiscord<Patitotective> `"@[1, "a"]"`↵And I need to convert each element to a `PrefsNode`
01:02:55FromDiscord<Elegantbeef> Then nested collections require you counting open/closed\`
01:03:15FromDiscord<Patitotective> In reply to @Elegantbeef "Assuming it's `[]` you": do i need to parse the sequence manually? like split the elements manually?
01:03:19FromDiscord<Rika> Yes
01:03:23FromDiscord<Elegantbeef> Dont split it
01:03:41FromDiscord<Patitotective> In reply to @Elegantbeef "Dont split it": then?
01:03:42FromDiscord<Rika> You can use parse utils for that
01:03:48FromDiscord<Rika> No splitting needed
01:03:49FromDiscord<Elegantbeef> iterate over it
01:04:07FromDiscord<Elegantbeef> parseutils is a nice API to iterate over it
01:04:14FromDiscord<evoalg> `@[1, "a"]` is not a valid seq
01:04:27FromDiscord<Elegantbeef> Eh they're using object variants so it's a representatiion
01:04:52FromDiscord<Elegantbeef> Either way you need to identify the type, if it doesnt start with a `"` you know it's an int or float
01:04:59FromDiscord<Elegantbeef> if it doesnt have a `.` you know it's an int
01:04:59FromDiscord<Patitotective> In reply to @Elegantbeef "parseutils is a nice": could you give me an example?
01:05:10FromDiscord<Elegantbeef> Fine
01:05:16FromDiscord<Patitotective> yea, i already have the types defined in my parser grammar
01:05:20FromDiscord<Elegantbeef> Lazy bums! 😛
01:05:21FromDiscord<Rika> Beef you are weak smh
01:05:44FromDiscord<Elegantbeef> I'm not going to do it nicely
01:06:42FromDiscord<Patitotective> In reply to @Elegantbeef "Lazy bums! 😛": hey, at least i dont have a dog in my pfp lmao
01:06:52FromDiscord<Elegantbeef> The fuck does that mean
01:06:55FromDiscord<Elegantbeef> Leave my dog out of this
01:09:32FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3M26
01:10:34FromDiscord<Elegantbeef> ` assert s.toOpenArray(0, 1) == ['@', '[']` better
01:10:46FromDiscord<Patitotective> Thanks 😺
01:11:12FromDiscord<Elegantbeef> See rika it's a really shitty impl that assumes 900 things
01:12:06FromDiscord<Rika> Why don’t you use skip while?
01:12:51FromDiscord<Elegantbeef> Instead of the setting to `2`?
01:13:01FromDiscord<Rika> No instead of skipping until
01:13:11FromDiscord<Elegantbeef> It's the same thing
01:13:22FromDiscord<Rika> Not if you want to expand out of integers
01:14:03FromDiscord<Elegantbeef> If you want to support {float, string, int} all you have to do is `skipUntil(Digits + {'.', '"'})`
01:14:47FromDiscord<Elegantbeef> skipWhile is afterall just the opposite of skipuntil
01:14:54FromDiscord<Elegantbeef> They do the same thing you just pass the opposite flags
01:15:09FromDiscord<Rika> I know, you don’t need the digits set of you use skip while though
01:15:18FromDiscord<Rika> You don’t need to even use the opposite set
01:15:33FromDiscord<Rika> Just pass the same set as the last one
01:15:39FromDiscord<Elegantbeef> `Skips all characters while one char from the set token is found.`?
01:16:30arkanoidI have a minimal C example and a minimal Nim example calling the same C functions, the C one works, the Nim SIGSEGV. I'm trying to track down the issue, but I'm failing. The testcase is very small: Nim -> https://github.com/arkanoid87/futhest/blob/master/src/futhest.nim , C -> https://github.com/arkanoid87/futhest/blob/master/csrc/futhest.c
01:17:14FromDiscord<Elegantbeef> Rika I'm probably just misunderstanding what you mean
01:17:19FromDiscord<Rika> Likely
01:17:25FromDiscord<Rika> I don’t know how
01:17:46FromDiscord<Elegantbeef> Well i'm an idiot
01:17:47FromDiscord<Elegantbeef> So that doesnt help
01:26:43*noeontheend joined #nim
01:42:34FromDiscord<auxym> Hey @ElegantBeef my nim tinyusb stuff is compiling. Not doing anything useful yet, but at least correctly showing up as hid+cdc under linux
01:42:57FromDiscord<Elegantbeef> Nice!
01:47:38FromDiscord<Elegantbeef> @mratsim\: after looking at what's going on I do think not being able to get the instantiated type information makes sense for `A[int]` but there should be a VM operation like `instantiateType` which takes a `nnkBracketExpr` and instantiates it returning a `sym` to it
01:52:08NimEventerNew thread by Giaco: Tracking down SIGSEGV. What's the difference between this Nim and C code?, see https://forum.nim-lang.org/t/8796
01:54:29arkanoidyup, that's me, if you have some FFI knowledge should be easy to track down. I just can't see where the problem is
01:58:09FromDiscord<Patitotective> How can I ignore some rule in _npeg_? Like ignore a comment, or match something but not include it
01:59:06FromDiscord<Rika> just parse it and do nothing with it
02:05:55FromDiscord<Patitotective> In reply to @Rika "just parse it and": LOL it worked, hehe i was thinking on other parser
02:08:03FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3M2l
02:26:31*neurocyte091705 joined #nim
02:28:48*neurocyte09170 quit (Ping timeout: 250 seconds)
02:28:48*neurocyte091705 is now known as neurocyte09170
02:52:51*adigitoleo quit (Quit: adigitoleo)
03:13:52*adigitoleo joined #nim
03:41:09*arkurious quit (Quit: Leaving)
04:08:47NimEventerNew thread by Xioren: Thoughts on error vs fatal log levels?, see https://forum.nim-lang.org/t/8797
04:51:23arkanoidYardanico: you got it, it is a regression
04:51:33arkanoiddamn I've wasted so many hours on this
05:18:49*vicfred quit (Quit: Leaving)
05:26:13*kayabaNerve_ quit (Ping timeout: 240 seconds)
05:28:32*kayabaNerve joined #nim
05:36:03*rockcavera quit (Remote host closed the connection)
05:43:00FromDiscord<blans> sent a code paste, see https://play.nim-lang.org/#ix=3M2M
05:43:10FromDiscord<Elegantbeef> it's for generics
05:43:16arkanoiddo you know why querySetting(nimcacheDir) has suffix _check when executed by nimsuggest?
05:43:17FromDiscord<Rika> Here is beef
05:43:26FromDiscord<Rika> About to write an essay on this
05:43:30FromDiscord<blans> what does it do?
05:43:51FromDiscord<Elegantbeef> when used in a generic `bind` says "Hey only use procedures declared above named `x`" in the case you did `bind x`
05:44:08FromDiscord<Elegantbeef> It closes the symbol's resolution to the generic's declaration
05:44:18FromDiscord<Elegantbeef> So it only looks at what is available
05:44:30FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#generics-bind-statement
05:44:31FromDiscord<blans> why can you set it to a type then
05:44:38FromDiscord<Rika> Mixin is the reverse if you wonder
05:44:44FromDiscord<Elegantbeef> Why would you be able to
05:44:49FromDiscord<blans> see the syntax above
05:44:51FromDiscord<blans> it compiles for some reason
05:44:53FromDiscord<Elegantbeef> `type A = bind int` makes no sense
05:45:01FromDiscord<Elegantbeef> dumptree isnt typed
05:45:03FromDiscord<blans> it uses `nnkBind` instead of `nnkBindStmt`
05:45:05FromDiscord<Elegantbeef> It's not semantically checked
05:45:32FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3M2N
05:45:34FromDiscord<Elegantbeef> Untyped code does not have to be semantically checked
05:45:36FromDiscord<blans> why would it have its own node then
05:45:38FromDiscord<Elegantbeef> It just has to parse
05:45:41FromDiscord<blans> why is it parsing
05:45:51FromDiscord<Rika> Because that’s syntax not semantically checked yet
05:45:52FromDiscord<Elegantbeef> Cause it's written Nim code?
05:46:04FromDiscord<blans> no other statement works
05:46:11FromDiscord<blans> how do I say this
05:46:20FromDiscord<blans> it looks like there is supposed to be some use of `bind` for types specifically
05:46:22FromDiscord<Rika> There needs to be a representation for code that has been checked in syntax but not in semantics
05:46:29FromDiscord<blans> and there is specific parser behavior for it
05:46:35FromDiscord<Rika> Again it makes no sense semantically but it does syntactically
05:46:41FromDiscord<Elegantbeef> There isnt↵(@blans)
05:46:44FromDiscord<Rika> That is probably reserved for future use
05:47:02FromDiscord<Elegantbeef> that works aswell
05:47:07FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/Ncz
05:47:10FromDiscord<blans> that could work
05:47:29FromDiscord<blans> sent a code paste, see https://play.nim-lang.org/#ix=3M2O
05:47:31FromDiscord<Rika> sent a code paste, see https://paste.rs/Twz
05:47:38FromDiscord<Rika> In reply to @blans "that could work": But it doesn’t, because that isn’t there
05:47:48FromDiscord<Rika> You could say bind could work too if you made the template for it…
05:48:01FromDiscord<blans> I have no gripes with you guys' point of what dumpTree does
05:48:02FromDiscord<Rika> Though actually
05:48:05FromDiscord<Rika> I think it’s a keyword
05:48:16FromDiscord<blans> I was just confused by why it's parsed specifically and differently than the regular bind statement and for types only
05:48:20FromDiscord<blans> it also works in generic constraints
05:48:27FromDiscord<Rika> Not for types only I assume
05:48:37FromDiscord<Rika> Try assigning a var to “bind something”
05:48:40FromDiscord<Rika> Prolly has the same node
05:48:45FromDiscord<Elegantbeef> If bind is on the right side of any `=` it turns into `nnkBind`
05:48:51FromDiscord<Rika> Yup
05:48:53FromDiscord<Elegantbeef> For instance
05:48:55FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3M2P
05:49:08FromDiscord<Rika> Beef ignored my insult lmfao
05:49:08FromDiscord<blans> that is weird
05:49:11FromDiscord<Rika> Not really
05:49:12FromDiscord<Elegantbeef> nnkBindStmt doesnt make sense when it's returned
05:49:17FromDiscord<Rika> Expression and statement distinction
05:49:26FromDiscord<Elegantbeef> Indeed
05:49:32FromDiscord<Elegantbeef> I seen it rika
05:49:38FromDiscord<blans> yes I am just confused by whether or not there is supposed to be an actual bind expression
05:49:40FromDiscord<blans> sorry
05:49:48FromDiscord<Elegantbeef> Well then ask that question 😛
05:49:51FromDiscord<Rika> There could be in the future
05:49:58FromDiscord<Rika> Now there is not
05:50:01FromDiscord<Elegantbeef> The answer is presently there is not, but there could be in the future not that it makes sense
05:50:26arkanoidis it normal that querySetting(nimcacheDir) ends with "_d" or "_r" for my project, but for "_check" for nimsuggest and code completion?
05:50:27FromDiscord<Rika> It’s just an “in case someone changes their mind and thinks it’s a good idea we at least have it reserved”
05:50:31FromDiscord<Elegantbeef> Nim generally implicitly adds to scope, so a bind expression would be an oddity
05:50:43FromDiscord<Rika> In reply to @arkanoid "is it normal that": D and r means debug and release no?
05:50:52FromDiscord<Rika> I assumed it’s what it meant
05:51:34arkanoidyes, and I'm ok with it, but I'm fighting with nimsuggest not working because he it's looking for files in ~/.cache/nim/myproject_check, that does not exist
05:52:05FromDiscord<Rika> It probably does for a brief moment when it runs then gets deleted? Not sure, Nim suggest is a nightmare I’d say
05:52:41arkanoidoh :( ok
05:53:08arkanoidso it must be a bug in futhark
05:53:10FromDiscord<Rika> I’m just guessing here
05:55:17*Gustavo6046 quit (Remote host closed the connection)
05:57:36arkanoidapparently it is like you said. You can't use querySetting(nimcacheDir) in macros otherwise nimsuggest would error out
05:57:46arkanoidrelevant issue https://github.com/PMunch/futhark/issues/12
05:57:58*rb quit (Quit: ZNC - https://znc.in)
05:58:16*Gustavo6046 joined #nim
05:59:10*rwb joined #nim
06:02:54arkanoidis nimsuggest code all here? https://github.com/nim-lang/nimsuggest? If I search for "cache" or "check" I'm getting zero result. I want to understand when querySetting(nimcacheDir) results in suffix "_check" and when not
06:05:23FromDiscord<xflywind> In reply to @arkanoid "is nimsuggest code all": https://github.com/nim-lang/Nim/tree/devel/nimsuggest
06:05:58FromDiscord<xflywind> here you are
06:27:56*Lord_Nightmare quit (Read error: Connection reset by peer)
06:29:22*Lord_Nightmare joined #nim
06:37:03*Onionhammer quit (Quit: Ping timeout (120 seconds))
06:37:17*rwb is now known as rb
06:37:21*Onionhammer joined #nim
06:44:42*Lord_Nightmare quit (Read error: Connection reset by peer)
06:47:18*Lord_Nightmare joined #nim
06:56:16*vicfred joined #nim
06:58:03*Lord_Nightmare quit (Read error: Connection reset by peer)
06:58:43*Lord_Nightmare joined #nim
07:03:04*vicecea quit (Remote host closed the connection)
07:03:32*vicecea joined #nim
07:06:09*PMunch joined #nim
07:12:08*jjido joined #nim
07:36:46*mahlon quit (Ping timeout: 260 seconds)
08:24:58*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
09:19:02*jjido joined #nim
09:25:56*vicfred quit (Quit: Leaving)
09:34:07*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
10:16:36FromDiscord<hmmm> sent a code paste, see https://play.nim-lang.org/#ix=3M3H
10:18:41FromDiscord<hmmm> I'm possibly missing a return / result somewhere lol
10:21:09FromDiscord<Hamid_Bluri> sent a code paste, see https://play.nim-lang.org/#ix=3M3I
10:21:32FromDiscord<hmmm> 👀
10:21:54FromDiscord<hmmm> b-b-ut I want to do it with the nnks
10:22:11FromDiscord<Tanguy> sent a code paste, see https://play.nim-lang.org/#ix=3M3J
10:23:01FromDiscord<Tanguy> `nnkEmpty.newNimNode` could also be `newEmptyNode` if that's your jam
10:23:48FromDiscord<hmmm> I was missing a bunch of trees lol 😃
10:26:09*Gustavo6046 quit (Quit: Leaving)
10:26:21FromDiscord<Elegantbeef> `newVarStmt` 😛
10:27:19FromDiscord<hmmm> beef you still around! go sleep man, by the time you wake up I will have a non working version of for i in seq: echo i macro to submit to you
10:27:53FromDiscord<Rika> Just use quote…
10:28:11FromDiscord<Elegantbeef> I mean i think they're attempting to learn the AST
10:28:13FromDiscord<Elegantbeef> So the answer is "just use dumptree\`
10:28:24FromDiscord<hmmm> heh I'm still in the part of the manual in which quote is not introduced so I can't use it
10:28:52FromDiscord<Elegantbeef> use dumptree and you'll learn AST faster
10:29:05FromDiscord<hmmm> make example on how to use dumptree
10:29:08FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3M3K
10:29:08FromDiscord<hmmm> ah ok
10:29:20FromDiscord<hmmm> I see!
10:29:22FromDiscord<hmmm> very comfy
10:29:24FromDiscord<Elegantbeef> Have you not read my macros tutorial?
10:29:47FromDiscord<Elegantbeef> Also dont use quote, `std/genasts` is nicer!
10:29:49FromDiscord<hmmm> nu beef they are 2 or 3 orders of magnitude harder than I can grok, the thing that for now it's working is the manual lol
10:30:06FromDiscord<Elegantbeef> I mean it shows dumptree
10:30:13FromDiscord<hmmm> link!
10:30:17NimEventerNew thread by Trisub: Get formatted SQL query, see https://forum.nim-lang.org/t/8799
10:30:18FromDiscord<Elegantbeef> https://dev.to/beef331/demystification-of-macros-in-nim-13n8
10:30:35FromDiscord<hmmm> ok I'll read it 🥳
10:38:12FromDiscord<Elegantbeef> And now to take your advice and to go to sleep
10:54:18FromDiscord<Rika> In reply to @Elegantbeef "Also dont use quote,": Sell me on it later when you wake
11:00:48*jjido joined #nim
11:09:02*dtomato quit (Ping timeout: 240 seconds)
11:11:35*oprypin quit (Remote host closed the connection)
11:19:39*Vladar joined #nim
11:35:25*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
11:37:38*oprypin joined #nim
11:43:22*oprypin quit (Quit: Bye)
11:44:27PMunchgenast just looks like quote with extra steps
12:22:04*rockcavera joined #nim
12:22:04*rockcavera quit (Changing host)
12:22:04*rockcavera joined #nim
12:30:12*oddish quit (Quit: oddish)
12:48:13*yann-kaelig joined #nim
12:48:23*yann-kaelig left #nim (#nim)
12:55:26*jjido joined #nim
13:03:40FromDiscord<eyecon> In reply to @Elegantbeef "https://dev.to/beef331/demystification-of-macros-in": Ah, you wrote that - that was a nice article indeed
13:03:43FromDiscord<eyecon> Thanks
13:04:37*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
13:14:58PMuncharkanoid, you around?
13:19:00PMunchHmm, it's a shame that nimble doesn't have any kind of hooking infrastructure..
13:23:15FromDiscord<Bung> @PMunch https://github.com/PMunch/nimlsp/pull/109 could this be merged so that I can split rest part of my big PR
13:23:53PMunchThat is still a massive PR to go through, haven't had time for it
13:24:13PMunchProbably won't have time for it until after the FOSDEM video recording deadline, possibly not until after FOSDEM itself
13:26:23PMunchYou should still be able to split it up
13:55:09FromDiscord<Patitotective> does _npeg_ has an example of parsing nim?
13:55:14FromDiscord<Patitotective> (edit) "has" => "have"
13:55:42FromDiscord<Patitotective> (edit) "does _npeg_ have an example of parsing nim? ... " added "i'm trying to parse a string but i'm not sure how"
13:55:53*jjido joined #nim
13:56:03FromDiscord<Patitotective> (edit) "how" => "how↵are java strings similar to nim? (because there's a java example)"
13:57:03PMunchYou want to parse the same kind of strings that Nim can parse?
13:57:10FromDiscord<Patitotective> yea
13:57:14PMunchI.e. "Something \t with escapes" etc
13:57:32FromDiscord<Patitotective> yes
13:57:37PMunchDo you also want to support """ and things like r"raw string"
13:57:47FromDiscord<Patitotective> just raw strings
13:57:54PMunchJust raw strings?
13:58:07FromDiscord<Patitotective> i dont want multiline strings
13:58:10FromDiscord<Patitotective> (edit) "multiline" => "multi-line"
13:58:17FromDiscord<Patitotective> (edit) "i dont want ... multi-line" added "to parse"
13:58:36PMunchRaw strings don't have any escaping
13:59:05PMunchWell apart from double "" to mean one "
14:00:07FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3M4t
14:00:48FromDiscord<Patitotective> So I don't have to say which characters are valid and which are not (?)
14:00:59FromDiscord<Patitotective> Just take everything in quotes
14:01:06FromDiscord<Rosen> Won't 1 be greedy? I feel like that will gobble 2 strings on one line into 1 string
14:01:24FromDiscord<Rosen> Should do a character class of everything but " I feel for that 1 term
14:01:42FromDiscord<Patitotective> my syntax only allows one string per line
14:02:06FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3M4w
14:02:14PMunchIt should be starts with ", followed by "" or !", ending with "
14:02:22Zevv'"' * >*(1-'"') * '"'
14:02:44Zevvif you want to handle escapes, look at the json parser
14:02:53Zevvlike "this\"contains a quote"
14:03:44FromDiscord<Patitotective> In reply to @Zevv "like "this\"contains a quote"": but in nim that's not valid, isn't it?
14:03:51Zevvsure it is
14:03:55FromDiscord<Patitotective> you should `\"`
14:05:24ZevvI did, didn't I?
14:05:35FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3M4z
14:06:00Zevvthe unicode escape is not nim
14:06:10FromDiscord<Patitotective> ok
14:06:22Zevvhttps://nim-lang.org/docs/manual.html#lexical-analysis-string-literals
14:06:54Zevvthere is also a complete valid java parser in misc/java.nim
14:07:05Zevvbut it's huge and nasty to understand all of it
14:07:20Zevvyou can steal StringLiteral from there I guess
14:10:33FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3M4A
14:10:38FromDiscord<Patitotective> or `OctalEscape` too?
14:10:48FromDiscord<Patitotective> (edit) "or `OctalEscape` too?" => "and `OctalEscape`?"
14:19:54FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3M4C
14:20:03FromDiscord<Patitotective> (edit) "https://paste.rs/Q2D" => "https://play.nim-lang.org/#ix=3M4D"
14:20:13FromDiscord<Patitotective> In reply to @Zevv "https://nim-lang.org/docs/manual.html#lexical-analy": According to that
14:21:26FromDiscord<Patitotective> But I'm not sure about the `escape | 1` part
14:22:02FromDiscord<Patitotective> If It's not an escaped character, what it should be? alphanum characters? printable characters?
14:24:47FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3M4G
14:24:54FromDiscord<Patitotective> (edit) "https://play.nim-lang.org/#ix=3M4G" => "https://play.nim-lang.org/#ix=3M4H"
14:36:13FromDiscord<Patitotective> Is there a parse string procedure? I have a raw string `"\asd"` and I want to parse it into `"\7sd"`
14:51:18*arkurious joined #nim
14:56:29FromDiscord<Patitotective> I was https://nim-lang.org/docs/strutils.html#unescape%2Cstring%2Cstring%2Cstring
14:56:38*cuibonobo quit (Quit: Leaving)
15:07:56FromDiscord<Michal Maršálek> Hi, how can I make the following code work? Thank you. https://play.nim-lang.org/#ix=3LOC
15:18:19*PMunch quit (Quit: leaving)
15:31:06termer_what's it supposed to do?
15:31:09termer_you have to give some details
15:40:24FromDiscord<Patitotective> Hey @PMunch, I'm having a problem with the _npeg_ stuff↵I did use a stack, as you said, to save the key and the value and at the end I converted that stack into a table but the thing is that when it matches a sequence (`?"@" "[" ( val (',' ?S val) ?',' ) "]"`) it matches `val` first and I'm not able to add them to the sequence because I capture the sequence after the values were captured
15:40:32FromDiscord<Patitotective> What should I do?
15:41:12FromDiscord<Patitotective> (edit) "converted" => "convert"
15:42:03FromDiscord<Michal Maršálek> In reply to @termer_ "what's it supposed to": Ok, consider this simpler case: https://play.nim-lang.org/#ix=3M52
15:42:06FromDiscord<Michal Maršálek> This works
15:45:59FromDiscord<Michal Maršálek> And I just need to change it so that the type of the result of `f ` is parametrized by a field of `M` rather than `M` itself.
15:47:52FromDiscord<Isofruit> Curious question: I have a proc that throws a FieldDefect-Exception at compile time when you do sth wrong (looks if a field pointing to model A is on model B. Since model definitions are known at compile time, this proc can work at compile time). I wanted to unittest that proc, ala "if you use this proc with the wrong models then this shall throw an error"... how do I test if a proc breaks the compiler if it is used wrongly when the co
15:48:37termer_I'm honestly not sure, I'm not very advanced with that sort of thing in Nim Michal
15:50:40FromDiscord<Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3M55
16:29:02FromDiscord<mratsim> In reply to @Isofruit "Curious question: I have": `when compiles(something)` is the ultimate hack
16:29:33FromDiscord<Isofruit> No way
16:29:41FromDiscord<mratsim> yesway
16:29:42FromDiscord<Isofruit> there's a proc, macro or whatever it is that checks if a piece of code compiles?
16:29:47FromDiscord<mratsim> yes
16:30:01FromDiscord<Isofruit> You can't hear it, but dear god am I laughing
16:30:34FromDiscord<Isofruit> Is that std lib?
16:31:00FromDiscord<mratsim> in system
16:31:05FromDiscord<mratsim> no need to import anything
16:31:12FromDiscord<mratsim> Ultimate hack I tell you: https://github.com/numforge/loop-fusion/blob/master/loopfusion.nim#L38-L41
16:33:11FromDiscord<Isofruit> I just tested it in my test, it works
16:33:16FromDiscord<Isofruit> I am legitimately impressed and amused
16:34:06FromDiscord<Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3M5i
16:36:25NimEventerNew thread by Prestige: Editor issues, nimsuggest reporting false errors?, see https://forum.nim-lang.org/t/8800
16:58:27FromDiscord<TurtleP> hey, so I've been trying to use <https://github.com/Yardanico/nim-taglib> library, but taglib fails to read some of my files due to accented/other chars being in the path or filename. anyone know how I might be able to fix it?
17:01:53FromDiscord<Yardanico> oh, totally forgot about this repo
17:02:04FromDiscord<Yardanico> In reply to @TurtleP "hey, so I've been": can you show how you're using the lib?
17:02:50FromDiscord<TurtleP> sure
17:03:11FromDiscord<TurtleP> let me throw this on GitHub reaaaal quick
17:05:31FromDiscord<TurtleP> <https://github.com/TurtleP/MusicScraper/tree/dev/nim>
17:06:07FromDiscord<Yardanico> also how you installed taglib?
17:06:10FromDiscord<TurtleP> basically: <https://github.com/TurtleP/MusicScraper/blob/dev/nim/src/tagscraper.nim#L71>
17:06:24FromDiscord<TurtleP> used my existing msys2 to install that and then copied it over
17:06:34FromDiscord<Yardanico> no, i mean what repo specifically
17:06:38FromDiscord<Yardanico> mine or the original?
17:06:50FromDiscord<TurtleP> oh, your repo, the fork version
17:07:16FromDiscord<TurtleP> the original repo doesn't even work on latest nim 😅
17:07:32*oddish joined #nim
17:07:35FromDiscord<Yardanico> also btw, you don't need those hacks to get the nimble package version from the nimble package - you can just use NimblePkgVersion strdefine :) but that's another thing
17:07:46FromDiscord<TurtleP> TIL
17:08:32FromDiscord<Yardanico> and what is the exact issue?
17:08:44FromDiscord<Yardanico> i just checked and it worked first try on my music folder with some songs having japanese or similar utf characters
17:08:51FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/931233340500095056/unknown.png
17:09:08FromDiscord<TurtleP> is that on Windows or Linux?
17:09:10FromDiscord<Yardanico> linux
17:09:14FromDiscord<TurtleP> yeah I'm on Windows
17:09:23FromDiscord<TurtleP> sent a code paste, see https://play.nim-lang.org/#ix=3M5y
17:09:39FromDiscord<TurtleP> paths/filenames with these chars don't open
17:10:39FromDiscord<TurtleP> the lib I used for python, pytaglib, that uses wchar for the path on Windows
17:10:49FromDiscord<TurtleP> idk if that's helpful to know or not
17:10:53FromDiscord<TurtleP> and that one works
17:11:02FromDiscord<TurtleP> but I want to switch to nim for performance reasons
17:11:46FromDiscord<Yardanico> also just saying - taglib_set_strings_unicode is not needed if you import `taglib` as it does that by itself
17:12:01FromDiscord<TurtleP> hm, that's what I figured
17:12:18FromDiscord<TurtleP> I tried setting that to false too, but that didn't fix it
17:12:19FromDiscord<Yardanico> i can try running with `wine` to see if i can get an error
17:16:06*mahlon joined #nim
17:17:38FromDiscord<Ksr> sent a code paste, see https://play.nim-lang.org/#ix=3M5B
17:17:47FromDiscord<Rika> you read the expectations
17:17:58FromDiscord<Yardanico> In reply to @Ksr "How exactly should I": this is not a full error
17:18:09FromDiscord<Yardanico> most lines after `:` also belong to it
17:18:18FromDiscord<xx_ns> In reply to @TurtleP "hm, that's what I": try converting strings to utf-16 with https://nim-lang.org/docs/encodings.html#convert%2Cstring%2Cstring%2Cstring
17:18:26FromDiscord<Ksr> Yes. I mean the expectation are clear. I wonder how to interpret the part between < >
17:18:36FromDiscord<Yardanico> it shows the argument types that you got
17:18:38FromDiscord<TurtleP> In reply to @xx_ns "try converting strings to": I believe I tried doing that already
17:18:41FromDiscord<Yardanico> it's hard to say without code
17:18:48FromDiscord<TurtleP> oh, maybe not that
17:18:50FromDiscord<TurtleP> I tried runes
17:19:06FromDiscord<Yardanico> In reply to @xx_ns "try converting strings to": i don't think it's needed here as nim stdlib already does all needed stuff for supporting unicode filenames on windows
17:20:18FromDiscord<Ksr> (edit) "expectation are" => "expected list is"
17:22:34NimEventerNew thread by Fzrg: Why don't build Nim libraries ecosystem on Rust ecosystem?, see https://forum.nim-lang.org/t/8801
17:22:52FromDiscord<Yardanico> "Rust is safer and faster than Nim, and has a bigger community." instant classic
17:23:14FromDiscord<Yardanico> ok finally mingw boost built
17:23:58FromDiscord<Yardanico> "So a Rust libraries is better than a Nim library (safer,faster,more actively maintened,..)"
17:24:24*vicfred joined #nim
17:24:35FromDiscord<Rika> cant tell if theyre just trying to get a reaction out of us\
17:24:40FromDiscord<Yardanico> maybe
17:25:02FromDiscord<TurtleP> I've tried rust and it's .. not fun tbh
17:25:09FromDiscord<Yardanico> @TurtleP where did you get libtag_c.dll ?
17:25:24FromDiscord<TurtleP> it's from msys2's packages
17:25:25FromDiscord<Isofruit> I'm... confused how Rust is supposedly safer, is that about the match operator and how Rust forces you to cover all possible outcomes of your program with Option and Result?
17:25:26FromDiscord<Yardanico> ah nvm i have it too now yeah
17:25:27FromDiscord<TurtleP> I copied it over
17:25:29FromDiscord<Yardanico> just not the correct folder
17:25:57FromDiscord<Yardanico> In reply to @Isofruit "I'm... confused how Rust": they probably talk about memory safety, but memory safety is just one of the many aspects of safety
17:26:05FromDiscord<Yardanico> and nim isn't really "memory unsafe" either
17:26:11FromDiscord<Yardanico> if you don't use the unsafe features
17:26:17FromDiscord<Isofruit> But your beginners default on nim is GC'ed
17:26:28FromDiscord<Isofruit> that is literally the most memory safe you can be I'd argue
17:27:00FromDiscord<hmmm> well for the libs we should concede at least the actively mantained and less buggier statement by virtue of raw number headcount. The average rust lib has 100 contributors lol
17:27:53FromDiscord<Yardanico> "average" rust lib has 1 contributor, just like with nim
17:28:10FromDiscord<Yardanico> maybe 2 at most
17:28:11FromDiscord<hmmm> really?
17:28:19FromDiscord<Yardanico> do you know what "average" is?
17:28:27FromDiscord<hmmm> yea ok but you know what I mean lol
17:28:30FromDiscord<Rika> its not that the average is higher
17:28:38FromDiscord<Rika> its more like there are more high-contrib libs
17:29:12FromDiscord<Rika> it is true maybe a rust wrapping system would be nice
17:29:30FromDiscord<Rika> the op is just being a shithead expressing it, i guess
17:29:35FromDiscord<Yardanico> In reply to @Rika "it is true maybe": that already exists
17:29:41FromDiscord<Rika> it does?
17:29:43FromDiscord<Rika> 👀
17:29:47FromDiscord<Yardanico> but he also does some bold claims like rust is safer, faster, etc
17:29:52FromDiscord<Yardanico> and we should all just use rust libs instead of making nim ones
17:29:56FromDiscord<Yardanico> In reply to @Rika "it does?": yes
17:30:12FromDiscord<Yardanico> https://forum.nim-lang.org/t/5816
17:30:40FromDiscord<Rika> dope
17:30:53FromDiscord<Rika> do people still say dope
17:30:55*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
17:31:49FromDiscord<Isofruit> I do, I am people, so yes
17:32:15FromDiscord<hmmm> I mean the bold claim is thinking sane people that have nim would ever write a line of rust in their life
17:32:28FromDiscord<Yardanico> @TurtleP yeah i can kind of get the same errors, i'll try to see if i can do anything about that https://media.discordapp.net/attachments/371759389889003532/931239286303490068/unknown.png
17:32:36FromDiscord<Yardanico> maybe taglib behaves different under windows or something (this is with wine)
17:38:00FromDiscord<Yardanico> ill see
17:38:38FromDiscord<Isofruit> @Yardanico A lot more diplomatically put than I'd have felt responding, kudos (to the forum post)
17:39:21FromDiscord<Yardanico> well i just responded how i felt in the moment, didn't think a lot about the post :P
17:39:49FromDiscord<Yardanico> ah right @TurtleP you said that there's a python binding, right?
17:39:52FromDiscord<TurtleP> mhm
17:40:01FromDiscord<Yardanico> i wonder how they handle that
17:40:10FromDiscord<TurtleP> using wchar iirc
17:40:12FromDiscord<Isofruit> The post just smelled a bit like dishonest discourse to me
17:40:13FromDiscord<Yardanico> what C function do they call specifically, because taglib_file_new only takes `const char filename`
17:40:17FromDiscord<Yardanico> there's no overload for wchar with it
17:40:22FromDiscord<TurtleP> hmm
17:40:25FromDiscord<Isofruit> (edit) "The post just smelled a bit like dishonest discourse to me ... " added "(from the OP)"
17:40:27FromDiscord<Yardanico> i'll check the source
17:40:51FromDiscord<TurtleP> <https://github.com/supermihi/pytaglib/blob/main/src/taglib.pyx#L84>
17:40:54FromDiscord<Yardanico> oh yeah, just like I suspected, pytaglib wraps taglib's C++ API, not the C API
17:41:10FromDiscord<TurtleP> ah
17:41:45FromDiscord<Yardanico> and tagpy wraps the C++ api too
17:42:09FromDiscord<Yardanico> i'll check other bindings too
17:42:49FromDiscord<TurtleP> btw is there any way to make nim see taglib? apparently it suddenly stopped compiling with it..
17:43:00FromDiscord<Yardanico> not sure what you mean by "see"
17:43:09FromDiscord<TurtleP> I had it copied to the mingw folder under lib
17:43:37FromDiscord<Yardanico> windows needs the .dlls to be present in the same folder as the binary
17:43:39FromDiscord<Yardanico> or in $PATH
17:43:45FromDiscord<TurtleP> it is in path, iirc
17:44:03FromDiscord<TurtleP> well, not the path that nimble can see I guess
17:44:40FromDiscord<Yardanico> if you mean the nim library itself - nimble will ensure all paths are correct with `nimble build` or `nimble run` or similar commands
17:44:48FromDiscord<Yardanico> and $PATH is a system variable
17:45:43FromDiscord<TurtleP> oh, not user
17:49:55FromDiscord<Yardanico> yeah @TurtleP i think there are two ways - either write a more complete taglib C api wrapper and use it with nim, or write a C++ binding to TagLib and use it with Nim (then you'll have to always compile with the C++ backend)
17:50:28FromDiscord<Yardanico> it seems that the C wrapper of the taglib is not really maintained and only has a few most common functions, and even maintainers said that it only has the most basic stuff wrapped
17:51:10FromDiscord<TurtleP> welp
17:51:26FromDiscord<TurtleP> yeah nim doesn't even want to compile with taglib here now.. not sure why
17:51:48FromDiscord<Yardanico> well if it was compiling before then you changed something that made it stop compiling?
17:51:52FromDiscord<TurtleP> nope
17:51:56FromDiscord<Yardanico> huh
17:52:05FromDiscord<Yardanico> maybe you opened a different terminal window without msys or something
17:52:16FromDiscord<TurtleP> both msys and pwsh fail to build
17:52:26FromDiscord<Yardanico> changed the environment somehow (build variables, etc)
17:52:34FromDiscord<Yardanico> it can't magically stop compiling by itself really
17:52:39FromDiscord<TurtleP> ¯\_(ツ)_/¯
17:53:19FromDiscord<TurtleP> might just stick with the python version then, idk what's going on
17:55:21FromDiscord<Yardanico> well I can't help you much here sadly, I'm not really interested in wrapping TagLib's C++ API :( maybe someone else is
17:56:18FromDiscord<TurtleP> getting taglib compiled n stuff alone is a pain tbf haha
17:56:56FromDiscord<Yardanico> well it's very easy on linux and was a littler harder for wine with mingw, luckily someone already added mingw taglib to AUR so I just built it from here
17:57:23FromDiscord<TurtleP> which is what I did.. so like idk what's going on why nim can't find it ¯\_(ツ)_/¯
17:57:29FromDiscord<Yardanico> what exactly can't it find?
17:57:35FromDiscord<Yardanico> the C library? the nim library? the dll?
17:57:45FromDiscord<TurtleP> The dll
17:58:39FromDiscord<Yardanico> have you tried copying the taglib DLL to the folder with the .exe?
17:58:45FromDiscord<Yardanico> you'll also need to copy all DLLs that are dependencies of that DLL
17:58:49FromDiscord<Yardanico> (excluding system ones)
17:59:47FromDiscord<TurtleP> Hmm I haven’t. Though with it refusing to build I dunno what to do.
17:59:54FromDiscord<Yardanico> and why does it refuse to build?
18:00:02FromDiscord<Yardanico> it doesn't need the dll to build, dll is only needed for runtime
18:00:05FromDiscord<TurtleP> Linking issues finding some other stuff
18:00:14FromDiscord<TurtleP> I’ll check in a few
18:00:20FromDiscord<TurtleP> Currently doing work things
18:29:55FromDiscord<konsumlamm> In reply to @hmmm "I mean the bold": the bold claim is thinking that this is true
18:34:52FromDiscord<Yardanico> https://forum.nim-lang.org/t/8801#57363
18:35:09FromDiscord<Isofruit> Yeh, I think shoving rust off does a disservice to the very real discussion that can be had there... but chances are, that has already been had a dozen times. ↵↵Rust has stuff going for it, but also a learning curve that is effectively a wall at a 90° angle that forces you to re-learn how to do everything the "right" way(s) in rust. ↵Same for nim, whose learning curve is much gentler, yet punches in the same weight class.
18:38:53FromDiscord<Isofruit> (That's from a webdev perspective, not systems programming, as I realize I should really prefix that because boy does mratsim's reply there open up a ton of topics I have no connection to)
18:42:33FromDiscord<konsumlamm> half the points aren't really relevant though...
18:43:04FromDiscord<konsumlamm> Nim does have a borrow checker but it's far less strict than Rust's (and it's not like Rust's borrow checker is unnecessarily strict for no reason), so you can't really say "this isn't an advantage of Rust because Nim has it too"
18:43:19FromDiscord<konsumlamm> DrNim isn't worked on currently
18:44:08FromDiscord<konsumlamm> comparing it to Ada SPARK (which is designed for formal verifying) is a bit disgenious as well
18:45:20FromDiscord<hmmm> hmm ye but I mean the point isn't about who is better, the point is that a random dude not nim user comes to nim forum asking to rewrite all in rust because rust is the best of the best. Obv people will contest that
18:47:00FromDiscord<konsumlamm> as for Rust being safer, i don't know why there's even discussion about that, it clearly is safer, it's pretty easy to invoke UB in Nim (since many things just compile to C without additional checks), whereas it's impossible in Rust without `unsafe` (unless there's a bug, and it's not like people regularly use `unsafe`)
18:47:45FromDiscord<konsumlamm> In reply to @hmmm "hmm ye but I": your point was that "no sane Nim programmer would touch Rust"
18:47:56FromDiscord<konsumlamm> which i heavily disagree with
18:48:08FromDiscord<konsumlamm> obviously it's a dumb idea to rewrite the Nim ecosystem in Rust
18:49:11FromDiscord<hmmm> that's because if you write in nim you appreciate what nim has to offer and probably you wouldn't exchange nim for rust better safety or whatever else rust might be better at
18:49:37FromDiscord<leorize> I might exchange nim for a working compiler, though \:p
18:50:42FromDiscord<Isofruit> a working compiler of... rust?
18:52:14FromDiscord<leorize> yea, rust biggest advantage is that your code tends to explode less
18:55:36*vicecea quit (Remote host closed the connection)
18:56:04*vicecea joined #nim
18:56:34FromDiscord<Isofruit> I don't have enough experience with either language to say much about that.↵I'd have gladly taken a longer look at rust if there were better learning material out there given how harsh the language's learning curve is. The frustration levels in it just made it a not all that attractive choice to learn in my spare time where I'd actually like to enjoy coding.
18:56:50FromDiscord<Isofruit> (edit) "I don't have enough experience with either language to say much about that.↵I'd have gladly taken a longer look at rust if there were better learning material out there given how harsh the language's learning curve is. The frustration levels in it just made it a not all that ... attractive" added "an"
18:57:42FromDiscord<Isofruit> Nim is just an order of magnitude more accessible to me which makes it actually fun to code in it, even to touch dark magic like macros
19:00:59FromDiscord<konsumlamm> honestly the official rust book is pretty good imo
19:01:18FromDiscord<konsumlamm> while i find the Nim tutorials ok
19:02:44FromDiscord<Isofruit> The rust book is a good introduction to get you introduced to the concepts
19:03:25FromDiscord<Isofruit> You learn to consciously understand them in a broad way, though not massively in-depth to the point you feel very confident in applying it
19:03:41FromDiscord<Isofruit> (edit) "You learn to consciously understand them in a broad way, though not massively in-depth to the point you feel very confident in applying it ... " added "with only few issues"
19:04:49FromDiscord<Isofruit> You can get to understand borrow checking in rust on a superficial level and still be frustrated for hours on how on earth you're supposed to set up config files with that concept in a framework that supposedly supports it but whose documentation in that regard is very hard to understand unless you already have the concept that the rust book merely introduces ingrained into your mind
19:05:35FromDiscord<Isofruit> The middle step from "introduction" to "becoming an expert" is something I've missed a lot in Rust, often hunting down solutions for the issues you stumble into when "exploring" the language and writing code in it took way longer than it should have.
19:05:56FromDiscord<mratsim> In reply to @konsumlamm "comparing it to Ada": The underlying question is, if you want safety, why aren't you writing Ada sparks
19:05:57FromDiscord<leorize> eventually you will also have to
19:05:59FromDiscord<leorize> fight nim
19:06:10FromDiscord<mratsim> (edit) "sparks" => "spark"
19:06:13FromDiscord<leorize> but the bar of entry is much lower, thankfully
19:06:26FromDiscord<Isofruit> Yeah, but by the time I have to fight nim I'm pretty sure I'll have understand a lot more aspects around the language
19:06:31FromDiscord<mratsim> Yeah you only need to use converters, static and generics ....
19:06:46FromDiscord<leorize> destructors, concepts, etc.
19:06:53FromDiscord<leorize> basically half of the language features
19:07:01FromDiscord<mratsim> destructors works for me (TM)
19:07:09FromDiscord<Isofruit> I use static, generics and macros and while yes, it's hard, it's also not unmanageable like it often felt in rust
19:07:17FromDiscord<Isofruit> (edit) "it" => "topics"
19:07:27FromDiscord<mratsim> concepts do work as well nowadays.
19:07:44FromDiscord<Isofruit> though I guess macros would be still a sealed book if I had never had chats with you guys
19:07:56FromDiscord<leorize> my concept 🥪 is not fixed so I still can't use them
19:08:08FromDiscord<konsumlamm> In reply to @mratsim "The underlying question is,": because you also want other things beside safety :P
19:08:27FromDiscord<konsumlamm> ~~like pattern matching with exhaustiveness checks~~
19:08:29FromDiscord<mratsim> if you want Evangelism sure use Rust 😉
19:08:42FromDiscord<Isofruit> Pattern matching is the one thing I really, really liked in rust
19:08:56FromDiscord<mratsim> ah yes pattern matching. I'd like something like in Haskell
19:08:57FromDiscord<Isofruit> It made me actually start consider using switch case with enums in java
19:08:58FromDiscord<leorize> I spent too much time chasing out destructors interaction bugs \:p
19:09:12FromDiscord<Isofruit> (edit) "It made me actually start consider using switch case with enums in java ... " added "(I use java at work for context)"
19:09:22FromDiscord<mratsim> you're a webdev that use Java?
19:09:25FromDiscord<mratsim> oh my
19:09:30FromDiscord<Isofruit> I live in germany
19:09:46FromDiscord<Isofruit> German software development, particularly webdev, is almost all java
19:09:50FromDiscord<Isofruit> It's insane
19:10:08FromDiscord<Isofruit> I literally have to pick that language up on the job because I hadn't written it before, merely some groovy scripting
19:10:44FromDiscord<Isofruit> Spring or custom REST backend, Angular frontend
19:10:45FromDiscord<leorize> btw @mratsim, are you gonna look at cps anytime soon? \:p
19:10:51FromDiscord<Isofruit> Tends to be a pretty popular combo
19:29:39*arkanoid quit (Ping timeout: 256 seconds)
19:31:41*arkanoid joined #nim
19:33:09FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3M69
19:33:17FromDiscord<Patitotective> (edit) "https://play.nim-lang.org/#ix=3M69" => "https://play.nim-lang.org/#ix=3M6a"
19:33:33nrds<Prestige99> I do not miss the days of spring, spring boot, etc
19:33:38FromDiscord<Yardanico> Node(node)
19:33:42FromDiscord<Yardanico> why are you trying to convert the type
19:33:46FromDiscord<Yardanico> you have to convert the variable, right?
19:33:51FromDiscord<Yardanico> `var newNode = Node(node)`
19:33:55FromDiscord<Patitotective> 😐
19:33:56FromDiscord<Patitotective> LOL
19:34:02FromDiscord<Patitotective> thanks
19:34:29FromDiscord<Patitotective> anyways, doesn't work
19:34:49FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3M6c
19:36:06FromDiscord<Patitotective> https://play.nim-lang.org/#ix=3M6d
19:37:54FromDiscord<leorize> sounds like a bug to me
19:38:05FromDiscord<huantian> hm it works on my system 😛
19:38:29FromDiscord<Patitotective> should I report it?
19:38:39FromDiscord<Yardanico> what's your nim version?
19:40:06FromDiscord<demotomohiro> `newNode` copys only`val`, not `age`. Doesn't Nim compiler print that error because it is partial copy?
19:40:08FromDiscord<Yardanico> ah yeah it fails on 1.6.2
19:40:21FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3M6f
19:41:14FromDiscord<Yardanico> i don't remember if it's supposed to work without `ref
19:41:18FromDiscord<Yardanico> this works
19:41:22FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3M6g
19:42:25FromDiscord<Patitotective> why `ref`?
19:42:39FromDiscord<Patitotective> (edit) "why `ref`? ... " added "i mean, is that documented?"
19:43:34FromDiscord<Yardanico> https://github.com/nim-lang/Nim/issues/17602
19:49:08FromDiscord<demotomohiro> Araq says: https://github.com/nim-lang/Nim/issues/11592#issuecomment-506363819
19:57:47FromDiscord<ajusa> how can I export just a single type? and I mean `export` keyword, I'm trying to just export the `VNode` definition from karax
19:59:17FromDiscord<Yardanico> In reply to @ajusa "how can I export": just use `` on that type?
19:59:29FromDiscord<Yardanico> and what do you mean by "definition"? just the type itself or all fields too?
20:00:28FromDiscord<Yardanico> isn't it already exported? https://github.com/karaxnim/karax/blob/master/karax/vdom.nim#L151
20:00:35FromDiscord<ajusa> sent a code paste, see https://paste.rs/ili
20:01:11FromDiscord<ajusa> eg I just want to do `export VNode` or `export karax.VNode`. The actual type is defined in `karax/vdom` but I'm trying to keep it simple ehre
20:01:14FromDiscord<ajusa> (edit) "ehre" => "here"
20:02:13FromDiscord<Yardanico> so what's the issue?
20:02:23FromDiscord<Yardanico> that just works
20:02:26FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3M6q
20:03:54FromDiscord<ajusa> huh, must be a bug elsewhere in my code then, I'm probably forgetting to export a related field. Thanks!
20:04:13FromDiscord<Yardanico> i tried writing this in a file and importing it from another file and I can use VNode
20:04:48FromDiscord<ajusa> yup, I also verified it worked with a similar example. Part of my issue is that I'm using the experimental dotOperators which just destroys pretty much all error messages
20:07:45FromDiscord<exelotl> In reply to @Isofruit "German software development, particularly": on the bright side, at least it's not PHP 😅
20:12:01FromDiscord<Yardanico> that fzrg guy is still going strong on the forum
20:24:38FromDiscord<xx_ns> In reply to @exelotl "on the bright side,": hot take: PHP in 2022 is _not bad_
20:24:58FromDiscord<Yardanico> PHP 8 is not as bad as it was before, yes
20:25:02FromDiscord<Yardanico> but IMO it's already too late
20:25:19FromDiscord<exelotl> I used it for the last 2 years in my day job, it's awful
20:25:25FromDiscord<Isofruit> I've not tried PHP yet but have heard not too many great things about it
20:25:26FromDiscord<Yardanico> most big companies like facebook or VK who used PHP made their own versions
20:25:37FromDiscord<Yardanico> VK made kPHP which compiles a subset of PHP to C++, Facebook made Hack and HHVM
20:25:46FromDiscord<ajusa> In reply to @Yardanico "that fzrg guy is": To be fair, tapping into an existing ecosystem is hardly the worst idea for Nim. c2nim, futhark, Nimpy, etc are all projects trying to use existing code in other languages
20:26:13FromDiscord<Isofruit> fzrg I'm still on a coin flip in terms of if he's trolling or not
20:26:53FromDiscord<Isofruit> At best he doesn't know what he's talking about. I mean, I don't either for that matter, I'm just aware that language performance matters tend to be fairly complicated discussions
20:27:18FromDiscord<Isofruit> We have debates to this day whether Java is a very performant language on par with C/C++ after all
20:28:13FromDiscord<Isofruit> (edit) "We have debates to this day whether Java is a very performant language ... onwith" added "that can be" | "that can beon par with C/C++ ... after" added "with proper optimizations"
20:28:28FromDiscord<exelotl> In reply to @Yardanico "PHP 8 is not": pretty much this - they have been adding nice features like arrow functions and enum types, but the foundations are so poor that it's basically polishing a turd at this point
20:28:33FromDiscord<Isofruit> (edit) "We have debates to this day whether Java is a very performant language that can be on par with C/C++ with proper optimizations after all ... " added "(at which point you go down the rabbit hole of how much optimization is fair to assume yada yada yada)"
20:32:39FromDiscord<iffy (Matt Haggard)> Why is libpcre not listed as a dynamic library when I compile a program using it. https://play.nim-lang.org/#ix=3M6w If I pass `--passL:-lpcre`, then it is listed. But the program runs anyway -- what's going on?
20:33:41FromDiscord<exelotl> if you're doing anything advanced you still have to internalise all the "stringly typed" nonsense, the pitfalls like how redeclaring a class will just overwrite the old one, all the ridiculous function names, the only good debugger is a 3rd-party extension that crashes all the time, the major libraries are OOP monstrosities, the only good tooling is jetbrain's commercial stuff... I could go on 😅
20:34:11FromDiscord<exelotl> (edit) "jetbrain's" => "jetbrains'"
20:34:24FromDiscord<Yardanico> In reply to @iffy (Matt Haggard) "Why is libpcre not": because Nim doesn't link to dynamic libraries at the C stage
20:34:35FromDiscord<Yardanico> if you use `dynlib` (which pcre module does) it loads the dynamic library at runtime
20:41:47FromDiscord<iffy (Matt Haggard)> Oh, okay. That makes sense. I'm trying to cross-compile from macos to linux and use libpcre. It compiles fine, but running it on the linux machine I get `could not load: libpcre.so(.3|.1|)` even though `ldconfig -p | grep libpcre` shows that it's installed. How does Nim know what directory to look for dynlibs?
20:42:34FromDiscord<Yardanico> In reply to @iffy (Matt Haggard) "Oh, okay. That makes": it uses normal OS paths
20:42:42FromDiscord<Yardanico> what linux distro are you checking it on?
20:44:27FromDiscord<iffy (Matt Haggard)> docker ubuntu.. whatever version that gives me
20:44:27FromDiscord<iffy (Matt Haggard)> When I compile with `-d:nimDebugDlOpen` as the error message suggests, I then get\: `Dynamic loading not supported↵could not load: libpcre.so(.3|.1|)`
20:45:02FromDiscord<Yardanico> so you're compiling statically
20:45:09FromDiscord<Yardanico> if you compile statically you can't use dynamic libraries
20:46:21FromDiscord<Yardanico> if you want to statically link pcre you can do --dynlibOverride:pcre --passL:"-lpcre"
20:46:22FromDiscord<Yardanico> i think
20:46:43FromDiscord<Yardanico> dynlibOverride tells Nim that you don't want to load that dynlib library from runtime and will instead link it yourself
20:47:02FromDiscord<iffy (Matt Haggard)> I'm not doing anything special to say "be static." If I compile for macOS on macOS, it works fine and I don't do anything to say "be dynamic"
20:47:54FromDiscord<iffy (Matt Haggard)> I'll try that to see if it works. I'd rather dynamically link if that's possible. How do I tell it to dynamically link?
20:48:15FromDiscord<hmmm> jeez the guy is still going, at this point we should just find a 10 lines rust lib, wrap it, and make him happy
20:48:49FromDiscord<iffy (Matt Haggard)> "link it yourself" statically or dynamically?
20:49:45FromDiscord<Yardanico> so basically, the error tells you that you compiled your nim binary statically
20:49:59FromDiscord<Yardanico> if you compile a binary statically you can't load dynamic libraries, so you also have to compile pcre statically
20:50:21FromDiscord<Yardanico> not sure why it's compiled statically, that's quite weird, maybe the toolchain you're doing does that?
20:50:24FromDiscord<leorize> depends on the linker flags
20:50:30FromDiscord<Yardanico> can you show how you're crosscompiling from macos to linux?
20:50:30FromDiscord<leorize> default is dynamic
20:50:41FromDiscord<Yardanico> maybe the toolchain you're using statically links the binaries with musl
20:50:45FromDiscord<iffy (Matt Haggard)> Yeah, but don't run away\:
20:51:40FromDiscord<iffy (Matt Haggard)> https://github.com/iffy/nimxc/ then `nimxc c --target linux-amd64 -f --verbosity:3 samp.nim`
20:52:27FromDiscord<iffy (Matt Haggard)> I don't think it's using musl unless I specify a musl target, but I could be wrong
20:53:34FromDiscord<Yardanico> just `cat binary | grep "musl"` ?
20:53:59FromDiscord<iffy (Matt Haggard)> Nothing
20:54:19FromDiscord<iffy (Matt Haggard)> Does `-ldl` mean dynamic linking? I see that in the `clang` command when compiling macos-\>macos
20:54:56FromDiscord<iffy (Matt Haggard)> Ah nevermind, I see that in the macos-\>linux output, too
20:57:38FromDiscord<iffy (Matt Haggard)> Adding `--passC:-v --passL:-v` shows more of the commands being run and I do indeed see `"/Users/matt/zig/zig" -cc1 -triple x86_64-unknown-linux-musl`
20:57:48FromDiscord<Yardanico> yep, so as I said
20:57:57FromDiscord<Yardanico> if you want glibc you'll have to specifically mention that to zig cc
20:58:18FromDiscord<Yardanico> https://github.com/Yardanico/ircord/blob/master/zig-compile-vps.sh this is for the nim vps that runs nimbot and ircord
20:58:28FromDiscord<Yardanico> it's ubuntu 16.04 so i compile for glibc 2.24
21:00:52FromDiscord<iffy (Matt Haggard)> oh, nice! Okay, let me try some things. Thank you Yardanico!
21:03:42FromDiscord<iffy (Matt Haggard)> Success! Thank you!
21:06:24*adigitoleo_ joined #nim
21:07:19*adigitoleo quit (Ping timeout: 250 seconds)
21:08:01FromDiscord<Yardanico> also @iffy you need to put -fno-sanitize=undefined too
21:08:11FromDiscord<Yardanico> if you compile with -d:release or -d:danger zig by default has UBSAN enabled
21:08:25FromDiscord<Yardanico> and UBSAN really doesn't like refc or some other nim stuff so your programs can crash at runtime
21:08:34FromDiscord<iffy (Matt Haggard)> Oh, lame
21:08:47FromDiscord<iffy (Matt Haggard)> Would that apply to macOS and Windows as well, or just Linux targets?
21:08:56FromDiscord<Yardanico> https://github.com/ziglang/zig/wiki/FAQ#why-do-i-get-illegal-instruction-when-using-with-zig-cc-to-build-c-code
21:09:05FromDiscord<Yardanico> In reply to @iffy (Matt Haggard) "Would that apply to": i think for all targets
21:09:24FromDiscord<Yardanico> so `-fno-sanitize=undefined` to make it not do that
21:12:58*ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
21:14:04*ehmry joined #nim
21:16:49*ehmry quit (Client Quit)
21:17:26*ehmry joined #nim
21:24:30*Gustavo6046 joined #nim
22:06:44FromDiscord<Elegantbeef> @hmmm\: did the writeup help any?
22:08:21FromDiscord<Elegantbeef> Nim's non ref inheritance for some reason relies on runtime information on conversion so often errors when it should convert↵(@Patitotective)
22:14:31NimEventerNew thread by Evoalg: Profiler for mac?, see https://forum.nim-lang.org/t/8802
22:20:15FromDiscord<Elegantbeef> It seems callgrind works on mac @evoalg use it with https://profilingviewer.com/ and you've got a good profiler
22:20:36FromDiscord<evoalg> ohhh!
22:21:56FromDiscord<evoalg> $42.99 for the viewer
22:22:05*Vladar quit (Quit: Leaving)
22:22:49FromDiscord<Elegantbeef> Lol
22:22:50FromDiscord<Elegantbeef> uhh
22:23:09nrds<Prestige99> kcachegrind on linux
22:23:24FromDiscord<Elegantbeef> You could also get qchachegrind
22:23:35FromDiscord<Elegantbeef> it's in brew
22:24:28FromDiscord<evoalg> ahhh good because "brew install valgrind" says "valgrind: Linux is required for this software." (and I'm on a mac) ... I'll try qchachegrind
22:24:44FromDiscord<Elegantbeef> qcachegrind even
22:24:55FromDiscord<Elegantbeef> Wait valgrind doesnt work on mac
22:25:00FromDiscord<Elegantbeef> Jeez life sucks there
22:25:01nrds<Prestige99> rip really?
22:25:43FromDiscord<evoalg> well that's what it says, and I've never used a profiler before
22:25:52FromDiscord<Elegantbeef> Evoalg when do you move to elementary OS so you can atleast pretend you're running mac, but have good dev tools 😛
22:26:10FromDiscord<evoalg> 😉
22:26:29FromDiscord<Elegantbeef> It seems there is a valgrind port of questionable quality
22:26:38FromDiscord<Elegantbeef> https://github.com/LouisBrunner/valgrind-macos/ for instance
22:26:40nrds<Prestige99> sad apple noises
22:28:28FromDiscord<Elegantbeef> If you add that repository it seems you can get valgrind running there
22:31:52FromDiscord<hmmm> In reply to @Elegantbeef "<@887269570765791243>\: did the writeup": yo welcome back beef. I'm still not done with it, but I'm solidly on top of dumptree, quote do new, newvarstmt and result.repr. I've grokked the general sense of the if case but I'm missing many details and not even started on the construction 👍
22:32:24FromDiscord<hmmm> constructor lol
22:33:35arkanoidquick question, how to include a string of nim code at compile time or a file from custom path?
22:39:15arkanoidotherwise, is the cache folder supposed to be in path by default?
22:40:28FromDiscord<Elegantbeef> `const a = staticRead("path")`
22:40:42FromDiscord<Elegantbeef> If i get what you mean right
22:40:54FromDiscord<Elegantbeef> Oh you mean like that
22:41:05FromDiscord<Elegantbeef> I dont think the cache is supposed to be in path, i could be wrong
22:46:03FromDiscord<hmmm> oh noes araq locked the rust wrapper forum thread, it was so enjoyable 😩
22:48:31arkanoidElegantbeef, sure that's how to read a file into stirng, but I want to import that nim code
22:48:57*hexeme is now known as ldlework
22:48:58arkanoidI mean, I want to "include constAbsolutePath"
22:51:13FromDiscord<planetis> Damn I missed all the fun
22:54:45FromDiscord<planetis> Reminded me of the RS raylib wrapper
22:54:50FromDiscord<planetis> Omg so safe
22:55:06FromDiscord<planetis> 💩
23:00:52FromDiscord<planetis> Let's all wrap our pointer ops in unsafe blocks because then we will have a safer Nim
23:01:02nrds<Prestige99> hm can an iterator not recurse?
23:03:28nrds<Prestige99> e.g. https://play.nim-lang.org/#ix=3M6Y the error here
23:03:36nrds<Prestige99> I may be missing something obvious
23:08:12FromDiscord<Elegantbeef> Inline iterators are templates
23:08:20FromDiscord<planetis> No they don't google it
23:08:27FromDiscord<Elegantbeef> Recursive iterators would never end
23:08:39nrds<Prestige99> ah they're templates? Damn
23:09:14nrds<Prestige99> @planetis haven't found anything useful
23:13:56nrds<Prestige99> @Elegantbeef are closure iterators as well? Seems to have the same issue
23:14:05nrds<Prestige99> would suck if I couldn't do this, lol
23:17:29FromDiscord<planetis> https://forum.nim-lang.org/t/7156
23:18:08FromDiscord<planetis> You can easily create a for loop macro
23:18:17nrds<Prestige99> cool, thanks
23:18:59FromDiscord<planetis> It was funny at first but that troll is so repetitive, it became boring
23:20:29FromDiscord<planetis> Like all rust fanboys there complete idiots writing dogmatic comments on HN and reddit all day
23:20:54FromDiscord<planetis> As if Mozilla pays them
23:21:29FromDiscord<Yardanico> In reply to @planetis "It was funny at": https://media.discordapp.net/attachments/371759389889003532/931327121777913936/unknown.png
23:23:27FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/931327613438402590/unknown.png
23:36:08FromDiscord<Yardanico> is this some advanced form of SEO optimization for rust maybe
23:38:01arkanoidwhat's the meaning of "MyType[T; X: static T]"?
23:39:40FromDiscord<Elegantbeef> `X` is a value constrained to type `T`
23:40:04FromDiscord<Elegantbeef> `static T` in Nim means "generic delimited by value"
23:41:06FromDiscord<Elegantbeef> Think about `array[10, int]`
23:41:32FromDiscord<Elegantbeef> the first parameter of that is a static value that changes the type `assert array[10, int] isnot array[9, int]`
23:42:04FromDiscord<evoalg> In reply to @Elegantbeef "If you add that": When I install that valgrind port, is says it's only supported on older versions on mac os ... I have the latest mac os version
23:42:50FromDiscord<Elegantbeef> Ah that sucks
23:43:01FromDiscord<evoalg> (so is says that and bails on the install)
23:43:21FromDiscord<evoalg> Maybe Rika is right, I should install linux
23:43:25arkanoidElegantbeef, ok! so X is a value of type T, not a type. This makes sense
23:43:27arkanoidthanks
23:43:28FromDiscord<Yardanico> doesn't macOS have profilers in xcode
23:43:40FromDiscord<Yardanico> In reply to @Yardanico "doesn't macOS have profilers": they should be decent enough
23:45:04FromDiscord<Yardanico> https://stackoverflow.com/questions/13554995/profiling-c-program-in-xcode for example
23:45:23FromDiscord<Yardanico> https://gist.github.com/loderunner/36724cc9ee8db66db305
23:45:25FromDiscord<evoalg> In reply to @Yardanico "doesn't macOS have profilers": There's "Instruments" ... it's used for all sort of things like iphone apps ... I looked at it but I guess I just don't know enough as I couldn't get it going, but I can take another look
23:47:47FromDiscord<Elegantbeef> Just making sure you built the program with `--debugger:native`
23:47:49FromDiscord<evoalg> Thanks for the links Yards
23:48:00FromDiscord<evoalg> ahhh true thanks beefy
23:49:38FromDiscord<planetis> > is this some advanced form of SEO optimization for rust maybe↵he can copy paste, we know he's not a plant
23:49:49FromDiscord<planetis> Turing complete reference
23:50:16FromDiscord<Yardanico> In reply to @planetis "> is this some": markov chain
23:50:31FromDiscord<ajusa> Was that rust guy really suggesting that Nim users add the entire rust toolchain to use a Nim library?
23:51:05FromDiscord<Yardanico> yes
23:51:14FromDiscord<Yardanico> i think his main question was something like "why no one writes nim wrappers for rust libraries?"
23:51:15FromDiscord<Yardanico> i sure wonder why
23:53:15FromDiscord<planetis> All this made me want to ask for a -keepBody switch for nbindgen
23:54:36FromDiscord<planetis> c2nim spoils me
23:55:37*vicfred quit (Ping timeout: 240 seconds)