<< 08-01-2022 >>

00:00:10FromDiscord<SirOlaf> Next question would be why that flag is there
00:05:07FromDiscord<Patitotective> In reply to @Patitotective "how did you made": nvm hehe
00:05:23FromDiscord<SirOlaf> In reply to @SirOlaf "Next question would be": Something inside result has it (searchForBorrowProc)
00:06:28FromDiscord<Elegantbeef> For generation later
00:06:30FromDiscord<Elegantbeef> Why that flag matters for type comparison doesnt make sense to me
00:08:25*vicfred quit (Quit: Leaving)
00:08:56FromDiscord<Elegantbeef> Perhaps it's best to ask inside the internals chat now 😀
00:09:30FromDiscord<SirOlaf> Yeah, but who knows when that tfVarIsPtr was declared essential
00:09:34FromDiscord<SirOlaf> Could have been a decade ago
00:11:21FromDiscord<Elegantbeef> Exactly why someone with more knowledge should comment on it
00:11:47FromDiscord<SirOlaf> It was done 7 years ago according to blame
00:11:59FromDiscord<SirOlaf> Is the real reason even in memory?
00:12:12FromDiscord<SirOlaf> But yeah, should ask
00:15:19*nac left #nim (The Lounge - https://thelounge.chat)
00:23:37*cyraxjoe quit (Ping timeout: 240 seconds)
00:26:27*cyraxjoe joined #nim
00:55:23*krux02_ quit (Remote host closed the connection)
01:00:22FromDiscord<Cx> I think I'm gonna suicide
01:06:27*noeontheend joined #nim
01:39:57*cyraxjoe quit (Ping timeout: 240 seconds)
01:40:30*cyraxjoe joined #nim
01:52:35*Figworm quit (Ping timeout: 256 seconds)
01:55:02*Figworm joined #nim
02:13:53*noeontheend quit (Remote host closed the connection)
02:29:37*Figworm quit (Ping timeout: 240 seconds)
02:30:19*neurocyte09174 joined #nim
02:31:55*perro_ quit (Read error: Connection reset by peer)
02:32:17*neurocyte0917 quit (Ping timeout: 240 seconds)
02:32:17*neurocyte09174 is now known as neurocyte0917
02:32:22*Figworm joined #nim
02:32:52*Figworm quit (Client Quit)
02:59:14*perro joined #nim
03:03:22FromDiscord<Revenant> hi, has anyone noticed problems /regressions in the C FFI in 1.6.2 compared to 1.6.0?
03:03:36FromDiscord<Elegantbeef> In what way?
03:03:53FromDiscord<Revenant> one of my projects that wraps a C library that has been working flawlessly for the past few years suddenly throws segfaults with 1.6.2
03:04:01FromDiscord<Revenant> with 1.6.0 and previous versions, zero issues
03:04:14FromDiscord<Revenant> happens in Win and Mac as well, and some of my users reported it as well
03:04:47FromDiscord<Revenant> i can't see anything wrong with the way i'm doing the wrapping, and i tried turning the gc off with `gc:none`, but the issue doesn't go away
03:04:58FromDiscord<Revenant> so i assume it's not a GC thing but a FFI problem?
03:06:42FromDiscord<Elegantbeef> I can only suggest trying commits in here https://github.com/nim-lang/Nim/commits/version-1-6
03:07:53FromDiscord<Shiba> I jusr diacouvered that nim compiles on one core only
03:09:00FromDiscord<Shiba> (edit) "jusr" => "just"
03:09:21FromDiscord<Shiba> Biut whatever
03:09:39FromDiscord<Shiba> (edit) "Biut" => "But"
03:21:38FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3Ls7
03:24:24FromDiscord<leorize> wrong channel? \:p
03:24:26FromDiscord<Rika> In reply to @Shiba "I just diacouvered that": i do not believe the kind of things the nim compiler does would benefit from multi core compilation
03:24:44FromDiscord<leorize> there are plenty of things the compiler does that would benefit from MC
03:25:52FromDiscord<leorize> tokenization, the part where the compiler assign basic meaning to the token, is trivially parallelizable
03:26:36FromDiscord<leorize> I'd say that sem is also parallelizable, though it is much harder (with the current design)
03:27:53FromDiscord<Rika> not as of now
03:27:57FromDiscord<Rika> would be nice to see in 2
03:28:39FromDiscord<leorize> it depends on whether IC will take off
03:30:29*noeontheend joined #nim
03:40:31nrds<Prestige99> I thought 1.6 was planned to have IC
03:42:28FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3Lsb
03:42:39FromDiscord<Rika> Overload it
03:42:44FromDiscord<Elegantbeef> Make an overload
03:42:57FromDiscord<Rika> I was first hehe
03:42:58FromDiscord<ajusa> ah derp I forget the simple stuff, thanks!
03:43:21FromDiscord<Elegantbeef> Not in matrix!
03:43:38FromDiscord<Rika> I was where it matters
03:44:01FromDiscord<that_dude> sent a code paste, see https://play.nim-lang.org/#ix=3Lsc
03:44:13FromDiscord<that_dude> (edit) "https://play.nim-lang.org/#ix=3Lsc" => "https://play.nim-lang.org/#ix=3Lsd"
03:44:23FromDiscord<Rika> Remove the last f, you have no return type
03:44:24FromDiscord<that_dude> mb
03:44:25FromDiscord<Rika> Okay
03:44:26FromDiscord<that_dude> (edit) "https://play.nim-lang.org/#ix=3Lsd" => "https://play.nim-lang.org/#ix=3Lse"
03:44:39FromDiscord<Rika> That’s not equal in behaviour though
03:44:41FromDiscord<ajusa> The issue I think I had with that is that it doesn't work on top of a variable assignment
03:44:41FromDiscord<that_dude> true
03:44:47FromDiscord<Rika> That also modifies the original value
03:44:49FromDiscord<that_dude> I'm a little tired lol
03:45:13FromDiscord<that_dude> Actually I can't think of a way to clean it up
03:45:21FromDiscord<Rika> There isn’t afaik
03:46:17FromDiscord<that_dude> sent a code paste, see https://play.nim-lang.org/#ix=3Lsf
03:46:21FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3Lsg
03:46:57*cyraxjoe quit (Ping timeout: 240 seconds)
03:47:15FromDiscord<ajusa> I get why it is ambiguous, but I'm also not sure what to do here other than just having two different procs
03:47:23FromDiscord<ajusa> (edit) "different" => "differently named"
03:47:30FromDiscord<ajusa> (edit) "procs" => "templates"
03:47:40FromDiscord<Elegantbeef> It's ambiguous cause you have a default
03:47:55FromDiscord<Rika> Yes but what’s the solution lol
03:48:10FromDiscord<Elegantbeef> Remove `[]` from the second one
03:48:22FromDiscord<that_dude> Can you give varargs a default?
03:48:23FromDiscord<Rika> Ah true
03:48:33FromDiscord<Rika> In reply to @that_dude "Can you give varargs": Not that I know of, no
03:48:51FromDiscord<that_dude> sad
03:49:07FromDiscord<Elegantbeef> There is no point
03:49:13FromDiscord<Rika> In reply to @Elegantbeef "Remove `[]` from the": Wait what if you have a string tuple but no options
03:49:24FromDiscord<Elegantbeef> Do `openarray[T] = [val]` for a default
03:49:37FromDiscord<Elegantbeef> Dont follow rika
03:49:40FromDiscord<ajusa> also removing the default doesn't seem to have helped
03:49:58FromDiscord<Rika> ah dumb
03:50:05FromDiscord<Rika> i swapped options and x around
03:50:21*cyraxjoe joined #nim
03:50:26FromDiscord<Rika> what does varargs untyped mean exactly? multiple bodies of code? why do you need suck
03:50:27FromDiscord<Rika> such\
03:50:35FromDiscord<ajusa> it's passed directly into karax
03:50:52FromDiscord<ajusa> which does fancy macro stuff to generate html with those properties
03:51:52FromDiscord<ajusa> sent a code paste, see https://paste.rs/lV9
03:51:57FromDiscord<Elegantbeef> untyped varargs means a bunch of things
03:52:05FromDiscord<Elegantbeef> Well its used for a bunch
03:52:33FromDiscord<Rika> i knwo
03:52:35FromDiscord<Rika> but in this case
03:52:46FromDiscord<Elegantbeef> Removing the defaults from the more elaborate should work afaik
03:53:24FromDiscord<Rika> In reply to @ajusa "Here's the (intended) usage": also you can use {"US": "United States", ...} syntax for the options lol
03:53:58FromDiscord<ajusa> sent a code paste, see https://paste.rs/OeB
03:54:22FromDiscord<ajusa> In reply to @Rika "also you can use": what syntax is that for? a table?
03:54:53FromDiscord<Elegantbeef> Just remove all defaults and have 3 templates
03:54:56FromDiscord<ajusa> (keys can be potentially repeated here without overriding so I stuck to list of tuples)
03:55:51FromDiscord<Rika> In reply to @ajusa "what syntax is that": no, array of 2-tuples
03:56:02FromDiscord<ajusa> oh shoot I gotta read docs more then, had no clue that existed
03:56:56FromDiscord<ajusa> Elegantbeef could you give me the signatures? I can't figure out the third template...↵Also even after removing the default from the first select I still get ambiguous error
03:58:56FromDiscord<ajusa> eh screw it I'll just break it into multiple procs that'll probably be cleaner and make it less likely to run into a Nim bug
03:59:16FromDiscord<ajusa> Like https://github.com/nim-lang/Nim/issues/14436
04:03:06FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Lsn
04:05:50FromDiscord<Elegantbeef> Varargs are funky though
04:06:33*dithpri quit (Remote host closed the connection)
04:06:55*dithpri joined #nim
04:08:13FromDiscord<ajusa> yeah they are
04:08:28FromDiscord<ajusa> gotcha though, that's a neat pattern
04:15:11*arkurious quit (Quit: Leaving)
04:34:50NimEventerNew thread by Oyster: Bug in strformat?, see https://forum.nim-lang.org/t/8783
04:47:09*noeontheend quit (Remote host closed the connection)
05:47:09*cyraxjoe quit (Ping timeout: 268 seconds)
05:47:26*cyraxjoe joined #nim
06:27:53*stkrdknmibalz quit (Quit: WeeChat 3.0.1)
06:45:26nrds<Prestige99> How do I compile a static binary?
07:01:30FromDiscord<Elegantbeef> `--app:staticlib`
07:01:38FromDiscord<Elegantbeef> Wait "static binary" what's that
07:01:38FromDiscord<Elegantbeef> The first result that is a tutorial comically is for nim https://scripter.co/nim-deploying-static-binaries/
07:06:36*dithpri quit (Ping timeout: 276 seconds)
07:08:15*dithpri joined #nim
07:22:51FromDiscord<Rika> a binary that only uses static libraries
07:51:56FromDiscord<Isofruit> Is there a way for me to tell my compile-time proc to throw a better error message if it fails to compile?
07:53:34FromDiscord<leorize> `{.error.}` is a good one
07:57:20FromDiscord<Isofruit> Doesn't the error pragma throw a message 100% of the time, even if it does compile?
07:57:45FromDiscord<Elegantbeef> You put it in the when branch
07:58:05FromDiscord<Elegantbeef> When branches only are semantically checked when they pass
07:58:26FromDiscord<Elegantbeef> Assuming this is related to your field issue
07:58:35FromDiscord<Isofruit> Ohh so I do when branches as guard clauses and if it does not pass the when check the thing in the when branch gets an error pragma
07:58:59FromDiscord<Isofruit> (edit) "gets" => "has" | "hasan error pragma ... " added "and thus throws a message"
07:59:20FromDiscord<Isofruit> Yeah, I was contemplating on how to give myself in the future meaningful error messages
08:02:42*Gustavo6046 quit (Quit: Leaving)
08:04:30FromDiscord<Isofruit> Oh
08:04:38FromDiscord<Isofruit> Oh dangit
08:04:55FromDiscord<Isofruit> I need to have an object type that has a `name` field.
08:05:20FromDiscord<Isofruit> But I also need to access `A.name` the proc that gives me the type-name as string
08:06:01FromDiscord<Isofruit> Oh, phew, false alarm, name(A) still does it
08:11:49FromDiscord<Isofruit> Time for the second round of "get related field names, electric boogaloo, now for many-to-many relationships"
08:46:19FromDiscord<Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3Ltl
08:46:27FromDiscord<Isofruit> (edit) "https://play.nim-lang.org/#ix=3Ltl" => "https://play.nim-lang.org/#ix=3Ltm"
08:47:48FromDiscord<Isofruit> I already have a way to figure out the field name at compile time, I just need a... wait, if I can figure out the field name at compile time I can also define at compile time to snatch the value and take that
08:49:11FromDiscord<Elegantbeef> `myASeq.mapit(it.otherModelId`
08:49:31FromDiscord<Elegantbeef> You can make it more generically solved
08:50:00FromDiscord<Isofruit> That spares me from defining a second `when` monstrosity
08:50:16FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/m4g
08:51:08FromDiscord<Elegantbeef> Guess it might need to be `mapModel[T: Model](mySeq: seq[T], field: untyped)....`
08:53:05FromDiscord<Elegantbeef> Or does that not work?
08:54:10FromDiscord<Isofruit> Slow your horses, I'm not that fast, I'm in the middle of implementing 😄
08:54:21FromDiscord<Isofruit> I need to slowly wrap my head around all of this
08:54:49FromDiscord<Elegantbeef> PS if you dont know `std/sequtils` has `map`
08:55:22FromDiscord<Isofruit> map I knew of, mapIt I... I think I skimmed over once and then forgot about
09:05:07FromDiscord<Isofruit> Huh, that works really well, code example incoming
09:07:11FromDiscord<Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3LtA
09:08:35FromDiscord<Elegantbeef> nice
09:09:52FromDiscord<Isofruit> Is there, for convenience reasons, a way to be able to have `mapModel(myDSeq, "myDA")` work as well?↵From the previous function I get the field name as a string, if I could just use that to get the field name and parse it somehow that it gets recognized as a field instead of a string that would make my life easier
09:10:08FromDiscord<Isofruit> (edit) "Is there, for convenience reasons, a way to be able to have `mapModel(myDSeq, "myDA")` work as well?↵From the previous function ... I" added "yesterday"
09:10:37FromDiscord<Isofruit> (edit) "field" => "field-identifier"
09:11:29FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3LtC
09:14:19FromDiscord<Isofruit> Oh lord, macro world. Here we go
09:14:35FromDiscord<Isofruit> That one appears to not compile, hmmm
09:15:17FromDiscord<Elegantbeef> If the compiler could talk i'd think it'd say the issue
09:15:45FromDiscord<Elegantbeef> Oh replace `seq[untyped` with `untyped`
09:16:07FromDiscord<Elegantbeef> Someone used untyped oddly which ruined my life
09:16:27FromDiscord<Isofruit> sent a long message, see http://ix.io/3LtG
09:16:35FromDiscord<Elegantbeef> Ah right
09:16:55FromDiscord<Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3LtH
09:16:56FromDiscord<stack.> +
09:16:57FromDiscord<Elegantbeef> `nnkDotExpr.newTree(ident"it", field)`
09:16:57FromDiscord<Isofruit> just imagine the imports are there, they're further up the scripts
09:16:59FromDiscord<Isofruit> (edit) "scripts" => "script"
09:17:14FromDiscord<Elegantbeef> `nnkDotExpr.newTree(ident"it", ident field)` sorry
09:17:17FromDiscord<Elegantbeef> I'll get it right eventually
09:17:31FromDiscord<Elegantbeef> Are we incrementing the stack stack?
09:18:17FromDiscord<Elegantbeef> that code goes in place of `ident field`
09:18:18FromDiscord<Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3LtI
09:18:24FromDiscord<Isofruit> ohh check
09:18:36FromDiscord<Elegantbeef> `newCall(bindSym"mapIt", mySeq, nnkDotExpr.newTree(ident"it", ident field))`
09:18:49FromDiscord<Elegantbeef> It's semantically `mapIt(mySeq, it.field)`
09:19:07FromDiscord<Isofruit> The black magic! It works!
09:19:24FromDiscord<Elegantbeef> Cmon it's not that dark!
09:19:35FromDiscord<Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3LtK
09:20:24FromDiscord<Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3LtL
09:20:57FromDiscord<Isofruit> In reply to @Elegantbeef "Cmon it's not that": It's morning where I am and coding this reduced the daylight!
09:21:42FromDiscord<Isofruit> Just joking, I'll take a stab at macros and co eventually, just that eventually is still a couple months out
09:22:00FromDiscord<Elegantbeef> They're quite fun
09:22:03FromDiscord<Isofruit> ~~maybe longer... most likely longer~~
09:22:05FromDiscord<Elegantbeef> You play pretend compiler dev
09:22:32FromDiscord<Isofruit> I am imagining myself as a baby in the body of an elephant within an antique shop
09:22:36*jjido joined #nim
09:22:44FromDiscord<Elegantbeef> That's... a sentence
09:23:13FromDiscord<Isofruit> In the scenario of play pretending compiler dev I mean, but man that makes for a great out of context quote+
09:23:16FromDiscord<Isofruit> (edit) "quote+" => "quote"
09:24:45FromDiscord<Elegantbeef> Macros are a fantastic answer for many questions though 😀
09:24:55FromDiscord<Elegantbeef> So you'll have a whole new world when you learn them
09:25:05FromDiscord<Elegantbeef> Though i know some dont overly use them
09:34:26FromDiscord<SirOlaf> With Araq's answer to the tfVarIsPtr question, it makes sense what went wrong with the generic problem
09:35:49FromDiscord<Elegantbeef> Do you have a solution?
09:35:58FromDiscord<Isofruit> sent a long message, see http://ix.io/3LtQ
09:36:15FromDiscord<Isofruit> (edit) "http://ix.io/3LtQ" => "http://ix.io/3LtS"
09:37:09FromDiscord<Elegantbeef> `ident`s are not symbols but for the most part sorta
09:38:18FromDiscord<Isofruit> So for field="la" --> `nnkDotExpr.newTree(ident"it", ident field)` == `it.la` ?
09:38:29FromDiscord<Elegantbeef> yep
09:39:59FromDiscord<Rika> Hello, is this just looking at how the AST works?
09:40:15FromDiscord<Elegantbeef> Indeed
09:41:02FromDiscord<Isofruit> I have no idea what this is called, I just wanted to somewhat comprehend the macro ElegantBeef wrote me (thanks for that btw!)
09:41:30FromDiscord<Elegantbeef> The abstract syntax tree is what you write when you write code, and it's all the compiler really knows
09:41:39FromDiscord<Elegantbeef> Macros are ways to programatically make them
09:41:48FromDiscord<Rika> The AST is the representation of code in terms of data and values
09:42:00FromDiscord<Elegantbeef> Yea i should say "indirectly write"
09:42:09FromDiscord<Rika> And a macro is just code that makes those values
09:42:15FromDiscord<Rika> (Code that makes code)
09:42:22FromDiscord<Rika> Hence metaprogramming
09:42:46FromDiscord<Elegantbeef> Macros operate with code at a compiler level pretty much, so you communicate to it with what it noes
09:42:53FromDiscord<Elegantbeef> knows
09:42:59FromDiscord<Elegantbeef> Jesus that was a terrible one
09:43:07FromDiscord<Rika> Nose
09:43:15FromDiscord<Elegantbeef> no's
09:48:03FromDiscord<Isofruit> I'll make a stackoverflow question out of this simply because I give myself about 24h to retain this knowledge
09:48:13FromDiscord<Isofruit> (edit) "I'll make a ... stackoverflow" added "self-answered"
09:48:38FromDiscord<Isofruit> Want a shoutout on it ElegantBeef?
09:48:49FromDiscord<Isofruit> (edit) "Want a shoutout on it ElegantBeef? ... " added "If yes, to a specific account or sth?"
09:49:05FromDiscord<Elegantbeef> People use stack overflow?
09:49:42FromDiscord<Isofruit> for nimrod almost nobody does, I like to use it as a sort of wiki for shit I know I solved once but forgot how
09:50:20FromDiscord<Elegantbeef> Heh you called it nimrod
09:50:48FromDiscord<Isofruit> it's the only tag available for the language on SO
09:50:51FromDiscord<Isofruit> Which is painful
09:51:01FromDiscord<Elegantbeef> It's `nim-lang`
09:51:28FromDiscord<Isofruit> When tf did that tag jump into existence
09:51:31FromDiscord<Rika> Lol
09:51:39FromDiscord<Isofruit> I#ve been looking for a nim tag for ages
09:51:44FromDiscord<Isofruit> Always only found nimrod
09:53:31NimEventerNew question by Philipp Doerner: Nim - Norm - How to get related fieldnames at compile time, see https://stackoverflow.com/questions/70628212/nim-norm-how-to-get-related-fieldnames-at-compile-time
09:54:10FromDiscord<Isofruit> ... is that going to happen every time now when I make a question for personal reference?
09:54:12FromDiscord<Rika> Howdy ho
09:54:15FromDiscord<Rika> Yes
09:54:25FromDiscord<Isofruit> ... should I apologize for the spam ahead of time?
09:54:29FromDiscord<Elegantbeef> It's after all how ... people answer these
09:54:30FromDiscord<Rika> No need
09:54:53FromDiscord<Rika> Only apologise if you create horrible incantations of macros
09:54:57FromDiscord<Elegantbeef> You act like this is an overly active community
09:55:02FromDiscord<Elegantbeef> there are like 10 active users
09:55:03FromDiscord<Rika> …eyes at a certain somebody…
09:55:11FromDiscord<Elegantbeef> Hey look the other way
09:55:19FromDiscord<Elegantbeef> They're each wonderful and like a child to me
09:55:31FromDiscord<Elegantbeef> You havent seen my abuse of closure iterators have oyu
09:55:39FromDiscord<Rika> Why do you abandon them in record time every time then
09:55:50FromDiscord<Elegantbeef> I said they're like a child
09:55:59FromDiscord<Rika> In reply to @Elegantbeef "You havent seen my": That slice library ?
09:56:09FromDiscord<Isofruit> ElegantBeef creating macros as anime-protagonists with daddy-issues in record time
09:56:26FromDiscord<Elegantbeef> "slice library" yea, i implemented a `zipiter` which captures the iterators as closures to make it so i can do the stepping
09:56:34FromDiscord<Elegantbeef> The most atrocious implementation
09:56:44FromDiscord<Rika> I mean
09:56:54FromDiscord<Rika> I think I’ve done that before not sure
09:57:18FromDiscord<Elegantbeef> Not any faster than `zip` but works on N number of iters and is negligably more memory efficient
09:57:45FromDiscord<Rika> Oh you mean that
09:57:45FromDiscord<evoalg> For me, if it works, and it's not inefficient then I don't have to know how it works
09:58:05FromDiscord<Rika> I think I can see how you did it with only your terse description
09:58:16FromDiscord<Elegantbeef> \It's faster if you need to do `.toSeq` though
09:58:18FromDiscord<Elegantbeef> I havent used closures much but now that i have a way to capture them easily i might
09:59:32FromDiscord<Rika> Closures nice
09:59:35FromDiscord<Elegantbeef> It's just converting inline iterators to closures then iterating over those until any one is empty
10:00:02FromDiscord<Rika> Yeah I can see
10:00:10FromDiscord<Elegantbeef> Evo sits in the shadows waiting to compliment slicerator
10:00:22FromDiscord<Elegantbeef> "It do the thing good i like it"
10:00:28FromDiscord<evoalg> that's my sole purpose
10:00:55FromDiscord<Elegantbeef> Change your name to SliceratorFan74
10:01:29FromDiscord<Elegantbeef> Not that there are 73 other fans just an random dart at your birth year
10:01:33FromDiscord<evoalg> Slicerator Fan sounds dangerous
10:01:34FromDiscord<Rika> evoiter
10:01:58FromDiscord<evoalg> I was born in '68
10:02:09FromDiscord<Rika> One year off from the funny number
10:02:11FromDiscord<Rika> That sucks
10:02:16FromDiscord<Elegantbeef> Hah 67
10:02:22FromDiscord<evoalg> My bro is funny then
10:02:37FromDiscord<Elegantbeef> that's a given he's a kiwi
10:02:40FromDiscord<evoalg> In reply to @Elegantbeef "Hah 67": lol
10:02:59madprops19 adds a 1 in gematria. 1 + 9 = 10 = 1 + 0 = 1
10:03:01FromDiscord<Rika> Didn’t know your brother was born 67
10:03:28FromDiscord<Elegantbeef> Any context there madprops?
10:03:38FromDiscord<Elegantbeef> Am I dumb?
10:03:41madpropsa = 1, b = 2, etc. silly thing
10:03:45FromDiscord<Elegantbeef> Or did madprops chat in the wrong irc room?
10:03:52madpropsim talking about 1968
10:04:46FromDiscord<Rika> What does gematria mean
10:04:50FromDiscord<Elegantbeef> I've never done drugs before, but you're really making me question if i should so i can understand this
10:05:06madpropsit's a thing where you count words by their alphabetical position
10:05:10madpropsabc = 1 + 2 + 3 = 6
10:05:17madpropsalso 12 = 1 + 2 = 3
10:05:34FromDiscord<Rika> So that’s the word for that huh
10:05:50FromDiscord<Elegantbeef> Comes from the hebrews apparently
10:06:14FromDiscord<evoalg> if you watch the movie Pi it has it in that
10:06:39FromDiscord<Elegantbeef> I'll only watch the Pi2 since that's clearly the better constant
10:06:45FromDiscord<Rika> Tau
10:08:09FromDiscord<Elegantbeef> Anywho
10:08:09FromDiscord<Elegantbeef> Where's all the Nim code
10:08:55FromDiscord<Rika> Not in your git repos
10:09:04FromDiscord<Elegantbeef> Damn you got me
10:09:06FromDiscord<Rika> Get to programming
10:09:15FromDiscord<Elegantbeef> But bed time
10:09:26FromDiscord<Rika> Programmers don’t sleep what the fuck do you mean
10:09:27FromDiscord<Elegantbeef> Where are all your Nim git repos?!
10:09:36FromDiscord<Rika> They’re local
10:09:56FromDiscord<Rika> (I’m honest here, most of my repos stay local…)
10:10:06madpropssince github copilot, they could be anywhere now
10:10:19FromDiscord<Rika> Scary
10:10:29FromDiscord<Elegantbeef> You win this time
10:10:55FromDiscord<Elegantbeef> IIRC github copilot doesnt work with Nim
10:10:56nrds<Prestige99> Wait, beef sleeps?
10:10:58FromDiscord<Rika> Cool, how much time do I win then
10:10:59FromDiscord<Elegantbeef> So checkmate
10:11:18FromDiscord<Elegantbeef> I've been known to sleep
10:11:27FromDiscord<Elegantbeef> And i can tell we've got some bridge troubles
10:11:29FromDiscord<Rika> In incredibly short periods
10:11:39FromDiscord<Elegantbeef> Nah i'm a long sleeper
10:11:43nrds<Prestige99> What bridge troubles
10:11:52FromDiscord<Elegantbeef> Matrix -\> discord
10:11:57FromDiscord<Rika> Of course you can, don’t you remember that time we implanted that BCI in you
10:12:19FromDiscord<Elegantbeef> Prestige did you get static binaries?
10:12:35nrds<Prestige99> nah will try again tomorrow
10:12:43FromDiscord<Rika> What issues did you get
10:12:44nrds<Prestige99> want a static binary for games
10:13:01FromDiscord<evoalg> In reply to @Elegantbeef "Where's all the Nim": Templates look cool, so could I use them all the time instead of proc's? ... or are they limited?
10:13:07FromDiscord<Elegantbeef> Do you mean statically linked or static libraries
10:13:20FromDiscord<Rika> Probably linked
10:13:32FromDiscord<Rika> In reply to @evoalg "Templates look cool, so": They’re limited
10:13:33FromDiscord<Elegantbeef> Templates are callable but they paste code inline so cannot be recursive
10:13:40FromDiscord<Rika> Use procs as much as possible until you cannot
10:13:50FromDiscord<Elegantbeef> Templates are not called at runtime, they're expanded at compiel time
10:13:57FromDiscord<Rika> In reply to @Elegantbeef "Templates are callable but": They can though?
10:14:51FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Lu3
10:15:07FromDiscord<Rika> That’s infinitely recursive, technically a proc would break on that as well
10:15:23FromDiscord<Rika> Just on runtime
10:15:54FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Lu4
10:16:06FromDiscord<Elegantbeef> The point is nested templates will crash if used like procedures
10:16:09FromDiscord<Rika> Ah I misread
10:16:14FromDiscord<Elegantbeef> You can do it recursive if it's constrained
10:16:50FromDiscord<evoalg> ok yea I heard: func's > proc's > template's > macro dark magic ... but if I can use a template that is expanded at compile time then isn't that a good thing? ... ie zero overhead?
10:17:01FromDiscord<Rika> You can recurse if the “limitation” can be computed on compile time I guess
10:17:12FromDiscord<Rika> In reply to @evoalg "ok yea I heard:": No, code size overhead
10:17:14FromDiscord<Elegantbeef> you can also do `proc() {.inline.}` to get similar to a templatee
10:17:24FromDiscord<Rika> Might be a downside if you want smaller binaries over faster code
10:17:39FromDiscord<Elegantbeef> But yes you can use templates where you want code to be 100% inlined
10:17:46FromDiscord<Elegantbeef> That's actually a very good use of them
10:18:08FromDiscord<Elegantbeef> In cases you want an abstraction but dont want a chance of proc call indirection you can use templates
10:18:19FromDiscord<Elegantbeef> Think about a vector library and `.x` for instance
10:18:27FromDiscord<Rika> Compile time I guess could be another overhead but I don’t think it’s significant
10:18:44FromDiscord<Rika> In reply to @Elegantbeef "Think about a vector": Twiddling would need a macro though 😉
10:18:50FromDiscord<Elegantbeef> Swizzling\
10:18:57FromDiscord<Rika> I’m no math person
10:19:26FromDiscord<evoalg> so if I'm not worried about binary size, there's not good reason to use a proc instead of a template (if I can do it in a template)?
10:19:36NimEventerNew question by Philipp Doerner: Nim - How to map seq[type] to seq[type.field] with a generic fieldname?, see https://stackoverflow.com/questions/70631397/nim-how-to-map-seqtype-to-seqtype-field-with-a-generic-fieldname
10:19:37FromDiscord<Rika> Eh
10:19:47FromDiscord<Rika> You might lose optimisations
10:19:50FromDiscord<Elegantbeef> The cost of a proc call is cheap and only really needed to be avoided in hot paths
10:19:54FromDiscord<Rika> That the C compiler could prolly do
10:19:57FromDiscord<Rika> From a proc
10:20:03FromDiscord<Elegantbeef> It's best to use procedures
10:20:13FromDiscord<Rika> Unless you know what you’re truly doing
10:20:20FromDiscord<evoalg> ok
10:20:35FromDiscord<Elegantbeef> Templates are either for when you're using them for code substitution or want to certainly avoid performance cost of procs
10:20:59FromDiscord<Rika> And you know that you’re not gonna introduce another cost by swapping…
10:21:10FromDiscord<Rika> (edit) "And ... you" added "if"
10:21:17FromDiscord<Elegantbeef> Like i said you can annotate a procedure with `inline` to do similar to a template
10:21:23FromDiscord<Rika> Probably better to
10:21:24FromDiscord<Rika> Too
10:21:31FromDiscord<Elegantbeef> It's only a compiler suggestion but it'll give a fair bit of performance
10:21:41FromDiscord<Rika> The compiler probably knows better when it comes to inlining
10:22:10FromDiscord<Rika> in a naive context
10:22:13FromDiscord<evoalg> might the compiler in-line even if I don't specify .inline. ?
10:22:18FromDiscord<Rika> Yes
10:22:21FromDiscord<Elegantbeef> Yes
10:22:29FromDiscord<evoalg> Rika wins again
10:22:33FromDiscord<Rika> No
10:22:34FromDiscord<Elegantbeef> The compiler is supposed to inline any statement it thinks is beneficial to do so
10:22:37FromDiscord<Rika> The bridge I assume is slow
10:22:48FromDiscord<Elegantbeef> Nah you won this time
10:22:53FromDiscord<Elegantbeef> Fair and square 😀
10:23:05FromDiscord<Rika> Fuck squares can’t I be a triangle
10:23:19FromDiscord<Elegantbeef> Worth noting that in `debug` it's not going to inline
10:23:23FromDiscord<Elegantbeef> Which will reduce compile time down slightly
10:23:38FromDiscord<Elegantbeef> But with `-d:release` or `-d:danger` it'll be more aggressive
10:23:45FromDiscord<Rika> Performance is a very tricky thing by the way
10:23:49FromDiscord<Elegantbeef> Since it flicks switches
10:24:06FromDiscord<Elegantbeef> We're in the age of "performance is only an issue when it's an issue"
10:24:22FromDiscord<Elegantbeef> Afterall evo came from python, so why's he worrying?!
10:24:47FromDiscord<Rika> Lol
10:24:50FromDiscord<Rika> I mean I did too
10:24:53FromDiscord<Elegantbeef> Naive Nim is more green than Professional Python
10:24:53FromDiscord<evoalg> you know how converts are, they're always over-zealous
10:25:20FromDiscord<Elegantbeef> Cant tell if that's a joke about converters or not
10:25:35FromDiscord<Rika> Converts expect things from the new place they couldn’t have ever gotten before
10:26:12FromDiscord<Elegantbeef> Evo have you profiled any code yet?
10:26:24FromDiscord<Elegantbeef> It's fun to see what the code is actually sitting in
10:26:38FromDiscord<evoalg> I haven't really no
10:27:11FromDiscord<Rika> Honestly don’t know of any times I’ve been very concerned about my run time other than when using seq utils
10:27:45FromDiscord<Elegantbeef> Most of when i profile it's for someone else based off an assumption or thing they said
10:28:26FromDiscord<Elegantbeef> Like that powerpc emulator that popped in here
10:28:32FromDiscord<Elegantbeef> Profiled it to find like 90% of their program was sitting in a hash function 😀
10:29:19FromDiscord<evoalg> I tried nimprof once ... lots of lines and I didn't really understand it
10:29:26FromDiscord<evoalg> but I didn't spend a lot of time with it
10:29:30FromDiscord<Elegantbeef> Yea i dont use nimprof
10:29:40FromDiscord<Elegantbeef> I use either hottie or callgrind
10:29:40FromDiscord<Rika> In reply to @evoalg "I tried nimprof once": Nim prof doesn’t give output that’s very usable
10:29:49FromDiscord<Rika> It gives “call counts” and not “time spent”
10:29:53FromDiscord<Elegantbeef> You're on mac so i dont know any good profiler to use
10:30:07FromDiscord<Elegantbeef> Dont think treeform got mac support on hottie
10:30:10FromDiscord<evoalg> ahh ok ... ahhh yea I can look into it
10:30:13FromDiscord<Elegantbeef> And dont know if callgrind runs there
10:30:29FromDiscord<evoalg> hottie ... such a funny name
10:30:34FromDiscord<Rika> Eh
10:30:38FromDiscord<Rika> It’s a name
10:30:41FromDiscord<Elegantbeef> Finds hot paths
10:30:50FromDiscord<Rika> Finds hotties in your area
10:30:58FromDiscord<Elegantbeef> Oh he got mac support it seems
10:31:01FromDiscord<evoalg> sounds like a dating app
10:31:11FromDiscord<Rika> In reply to @evoalg "sounds like a dating": It isn’t???
10:31:11FromDiscord<Elegantbeef> Wait nvm
10:33:49FromDiscord<evoalg> "hottie" is difficult to google
10:34:10FromDiscord<evoalg> my wife might walk in on me at any moment
10:34:35FromDiscord<Rika> I’m sure she won’t mind
10:35:14FromDiscord<Elegantbeef> If memes are any indication if you were looking for anything like that you'd use bing
10:35:52FromDiscord<Rika> Is that why DuckDuckGo is so good at finding stuff like that
10:36:36FromDiscord<Elegantbeef> DDG is good at finding profilers?
10:37:15FromDiscord<Elegantbeef> But yea evo hottie only supports linux/windows so no luck there
10:37:26FromDiscord<Elegantbeef> And with that dissapointment i sleep
10:37:46FromDiscord<evoalg> ok thank you and sleep well
10:38:11FromDiscord<Rika> Come to the Linux side smh
10:38:41FromDiscord<evoalg> so Rika you and beef use linux?
10:39:02FromDiscord<Rika> I do
10:39:05FromDiscord<Rika> Beef probably does
10:39:25FromDiscord<Isofruit> ... can you even on windows given antivirus autodeletes your ass away against you will?
10:39:43FromDiscord<Rika> Lol
10:39:49FromDiscord<Rika> You can probably disable the fuck out of it
10:40:02FromDiscord<Rika> Or nuke the shit out of the binaries in rescue mode
10:40:20FromDiscord<Isofruit> It's windows, I'm never too sure what they allow their users and what they make so obscure it's not worth the hassle figuring out how to do it
10:40:30FromDiscord<Rika> Why do you think I use Linux lol
10:41:21FromDiscord<Isofruit> So many reasons
10:41:23FromDiscord<Isofruit> So many reasons
10:41:33FromDiscord<Isofruit> I was about to list some of them, then I realized the list was about to get too long to type
10:41:49FromDiscord<Rika> Pretty much
10:42:18FromDiscord<Rika> The downsides of Linux don’t matter too much to me because I can fix them 97.5% of the time so
10:42:59FromDiscord<Isofruit> With Linux some stuff might feel jank, but I haven't had it feel like it's intentionally getting in my way around doing a specific thing
10:43:19FromDiscord<Isofruit> With windows, whenever the usecase is slightly off the normal user, you better get your boxing gloves out
10:43:27nrds<Prestige99> linux is great for software engineering
10:43:28FromDiscord<Rika> In reply to @Isofruit "With Linux some stuff": And when it is intentional it’s not fucking nigh impossible to bypass
10:43:57FromDiscord<enthus1ast> i fight the os all the time (every os)
10:44:07FromDiscord<enthus1ast> every os is shit
10:44:08FromDiscord<Isofruit> Dem's fighting words
10:44:09FromDiscord<Rika> Of course
10:44:09FromDiscord<Isofruit> Literally
10:44:11FromDiscord<Rika> Everyone does
10:44:16FromDiscord<Rika> It’s just a matter of how much
10:45:33FromDiscord<Isofruit> Fun fact sidenote
10:46:07FromDiscord<Isofruit> The last SO question I made around elegantbeef's solution with macros and templates was the exact 500'th question for the nim-lang tag
10:46:44FromDiscord<Rika> Congratulations
10:47:17FromDiscord<evoalg> would be nice if there was a prize
10:48:47FromDiscord<Rika> Why
10:49:20FromDiscord<Isofruit> My prize is not having to pay anyone to host stuff for my own wiki
10:50:03FromDiscord<Isofruit> That has the potential to help others or give me pointers by other people feeling bored and reading the questions
10:50:13FromDiscord<Isofruit> (edit) "That" => "With the added benefit that it"
10:50:22FromDiscord<Isofruit> (edit) "bored and" => "bored," | "bored,reading the questions ... " added "and commenting"
10:51:22FromDiscord<enthus1ast> you can always host from home
10:51:24FromDiscord<Isofruit> But honestly, I don't trust my harddrive and can't organize my way out of a paperbag if it's not a code project
10:51:34FromDiscord<Isofruit> So a googleable resource is always welcome
10:52:48FromDiscord<Isofruit> Ah yes, but I am also very lazy, I want to to these questions and then forget I ever wrote them and not have to care about hosting. Same reason my side project isn't self hosted and instead hosted on a potato server from Linode
10:52:59FromDiscord<Isofruit> (edit) "to" => "do"
10:53:20FromDiscord<enthus1ast> there also is github.io
10:53:42FromDiscord<Isofruit> Actually, that one's fair
11:03:34*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
11:24:00NimEventerNew thread by Enthus1ast: Simple event system, see https://forum.nim-lang.org/t/8784
12:10:17*vicecea quit (Remote host closed the connection)
12:10:49*vicecea joined #nim
12:40:59NimEventerNew post on r/nim by richardd08: Nim's while loops 7x slower than Python?, see https://reddit.com/r/nim/comments/ryyz3y/nims_while_loops_7x_slower_than_python/
12:46:22FromDiscord<Yardanico> Classic
12:48:05FromDiscord<Patitotective> lol
12:48:56FromDiscord<Solitude> nim dead and finished, python with types but slow.....
12:51:10FromDiscord<Yardanico> types slow it down...
12:52:31FromDiscord<enthus1ast> no no no its slower because it it transpiled
12:54:53FromDiscord<Isofruit> Man, that good feeling when your nim-prologue webproject was already 3+ times faster than its Django implementation
12:55:02FromDiscord<Isofruit> And that is before you use -d:release
12:55:20FromDiscord<enthus1ast> what template engine have you used? \:)
12:55:39FromDiscord<Isofruit> None, my side project's frontend is with a frontend framework, Angular in this case
12:55:47FromDiscord<enthus1ast> ah ok
12:56:01FromDiscord<Isofruit> So nim is pretty much just a REST Api (as is my django backend)
12:57:17FromDiscord<enthus1ast> i'm asking because i think my nimja template engine can easily beat jinja or django (in terms of speed), but its just a feeling overall
12:57:20FromDiscord<Isofruit> There's still tons of work to do since I'm building tooling as well (e.g. generic functions to fetch the many-side of a one-to-many relationship in norm, or one of the many-sides in a many-to-many relationship) but this does include the typical login performance drag
12:58:05FromDiscord<Isofruit> I'm really stocked to be finished with this in a couple months or so
12:58:10FromDiscord<Isofruit> And then update the backend
12:58:29FromDiscord<Isofruit> And be like "My pageloads are literally sub 50ms now"... and nobody will notice because they were sub 200 ms already before xD
12:58:37FromDiscord<Isofruit> (edit) "And be like "My pageloads are literally sub 50ms now"... and nobody will notice because they were sub 200 ms ... already" added "most of the time"
12:59:09FromDiscord<enthus1ast> that means 4 times more users on the same hardware i guess \:)
12:59:59FromDiscord<Isofruit> Could be, should I ever make it freely accessible. Right now it's a playground for me to do and learn stuff while it also hosts the wiki for my groups dndcampaign
13:00:12FromDiscord<Isofruit> My userbase is like 8 people
13:00:31FromDiscord<Isofruit> Maybe more if I ever shell out for more storage space to store all the recorded sessions
13:02:15FromDiscord<Isofruit> The main reason I locked it all behind a wall is that I allow image upload and I know I don't own 99% of the images on there
13:12:06FromDiscord<enthus1ast> yeah, imho the fear of legal consequences kill 99.9% of cool toy projects
13:12:15FromDiscord<enthus1ast> at least to make them publicly available
13:12:50FromDiscord<enthus1ast> in germany it even starts with a impressum ...
13:13:08FromDiscord<Isofruit> I'm so happy Impressum shit does not affect me as a very small private side
13:13:18FromDiscord<Isofruit> (edit) "side" => "site"
13:13:34FromDiscord<enthus1ast> does it? Know knows \:)
13:13:41FromDiscord<enthus1ast> who knows
13:14:42FromDiscord<Isofruit> > Von dieser Regelung ausgeschlossen sind nur Telemedien, die ausschließlich für private oder familiäre Zwecke genutzt werden. Wer beispielsweise eine Website betreibt, auf die nur Familienmitglieder und enge Freunde zugreifen können, braucht kein Impressum. Doch Vorsicht: Dies gilt wieder nur, solange der Betreiber auf der Seite keine Werbung schaltet!↵This works for me
13:15:42FromDiscord<enthus1ast> "zugreifen können" (CAN access)
13:15:58FromDiscord<enthus1ast> so put it behind basic auth ? \:D
13:16:25FromDiscord<Isofruit> Sort of, yeah you login via Username+PW, in my case the authentication is JWT though
13:16:47FromDiscord<Isofruit> Writing that middleware was easier than I had anticipated
13:16:57FromDiscord<enthus1ast> so this means i guess, that you need an impressum when a site is publicy available
13:17:31FromDiscord<Isofruit> Pretty much, at which point I'd also be a freely available hoster for images I don't own, at which point that's a big NOPE
13:39:28FromDiscord<baalajimaestro> Hi, I am building a simple script with nim to pull json from a site and convert the html content response into markdown and dump it to a file. I am not sure which library can help me with the conversion part. I did try checking out nim-markdown, but looks like its doing the opposite.
13:43:03FromDiscord<Isofruit> If you want to go json --> markdown I sadly am not aware of a library.↵If you want to go json --> nim object --> markdown I can highly recommend jsony for the conversion step of json --> nim object, though for the step nim object --> markdown I'm out of ideas once more
13:53:45FromDiscord<baalajimaestro> I want to go from a specific element in json (which is raw html) to md
13:55:42FromDiscord<Isofruit> So json --> HTML-string --> markdown is what I realistically see here.↵Step one should be easy enough to do with jsony (or the std json lib), I'm not 100% on HTML to Markdown
13:58:41FromDiscord<ajusa> In reply to @baalajimaestro "Hi, I am building": I just did html to md for a script, I recommend pandoc (cli tool)
13:59:46FromDiscord<Isofruit> So json --> HTML string , store as file, have nim call the cli tool to format to markdown?
14:00:21FromDiscord<Isofruit> (edit) "markdown?" => "markdown, delete now superfluous HTML file?"
14:03:13FromDiscord<ajusa> Pandoc supports stdin and stdout so I think I used execmdex or something
14:05:09FromDiscord<Isofruit> On another note, do we have a lib to manage database connection pools?
14:07:01FromDiscord<ajusa> Gatabase?
14:08:00FromDiscord<Isofruit> huh, I'll need to have a look on whether that plays nice with norm, which I also use
14:11:18FromDiscord<xflywind> In reply to @Isofruit "On another note, do": there are, and they only implement basic features
14:11:21FromDiscord<xflywind> https://github.com/itsumura-h/nim-allographer/tree/master/src/allographer/async
14:11:31FromDiscord<xflywind> https://github.com/bung87/amysql
14:11:36FromDiscord<xflywind> https://github.com/cheatfate/asyncpg
14:11:42FromDiscord<Isofruit> All I need is sth that gives me a DbConn object, norm does my queries
14:11:52FromDiscord<Isofruit> So that works out fine
14:12:57FromDiscord<xflywind> (edit) "are," => "are libs supporting connection pools,"
14:13:31FromDiscord<Isofruit> And oh hey flywind! Thanks for prologue
14:13:50FromDiscord<xflywind> you are welcome
14:14:20FromDiscord<dynamite> hello
14:14:48FromDiscord<Isofruit> cheers
14:15:59FromDiscord<baalajimaestro> Ah thanks a lot for the suggestion↵(@ajusa)
14:25:52*vsantana joined #nim
14:27:11*vsantana left #nim (Leaving)
14:29:34NimEventerNew post on r/nim by Familiar_Ad_8919: how does one split a string into 2 string long pieces, see https://reddit.com/r/nim/comments/rz123o/how_does_one_split_a_string_into_2_string_long/
14:35:44*pro joined #nim
14:49:06*jjido joined #nim
14:55:48*arkurious joined #nim
14:59:12FromDiscord<jmgomez> Hey guys, how difficult it would be to make nim to output into another lang (a very simple one, like AngelScript) with no interop at all. Just a as compilation target? Are there any resources to look up?
14:59:44FromDiscord<Rika> good luck, very hard if you dont know what youre doing already id say
15:00:34FromDiscord<Isofruit> erm... I might be doing a dumb dumb... does jsony expect a specific JSON object type to parse it into an option?
15:00:45FromDiscord<Shiba> Is there a guid on how to use the nim vm?
15:00:48FromDiscord<Yardanico> In reply to @jmgomez "Hey guys, how difficult": if you mean a backend - not easy
15:01:12FromDiscord<Yardanico> but maybe if you only need a few things you can just do string handling yourself
15:01:27FromDiscord<Yardanico> but if you need nim code compiled into angelscript the only way is to write an angelscript backend, yeah
15:01:49FromDiscord<Yardanico> any reason why you'd need angelscript target for nim?
15:03:29FromDiscord<Solitude> In reply to @jmgomez "Hey guys, how difficult": might not be that hard if nim features could easily map onto angelscript features, look at the js backend.
15:04:38FromDiscord<Rika> In reply to @Shiba "Someone help me, ": whats the issue exactly
15:05:26FromDiscord<Shiba> I actually don't have any idea on how to use it so?
15:06:03FromDiscord<Shiba> I can't find any instructions
15:06:03FromDiscord<Yardanico> you already use it every time you use `const`
15:06:15FromDiscord<Yardanico> it runs all nim code that is run at compile time (including macros)
15:06:22FromDiscord<Yardanico> also there's nimscript that allows you to use it separately
15:06:30FromDiscord<Yardanico> .nims files are nimscript too so they're executed by the nim vm as well
15:06:52FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/929390708408868914/unknown.png
15:07:01FromDiscord<Yardanico> https://nim-lang.org/docs/nims.html
15:07:05FromDiscord<Shiba> Wait what was that
15:07:11FromDiscord<Yardanico> there's also `nim e`
15:07:15FromDiscord<Yardanico> to execute nimscript standalone
15:07:44FromDiscord<Yardanico> there are not that many reasons to use nimscript as standalone, but if you want to use it as the scripting language for your nim program, take a loot at https://github.com/beef331/nimscripter
15:07:47FromDiscord<Yardanico> (edit) "loot" => "look"
15:07:53FromDiscord<Shiba> Can i think about like nim version of jar
15:08:30FromDiscord<Yardanico> ??
15:08:46FromDiscord<Yardanico> `.jar` is just a zip archive with some java-specific metadata that packs java classes into a single file
15:10:08FromDiscord<Rika> do you know lua
15:10:17FromDiscord<Rika> its close but not quite the same thing
15:10:32FromDiscord<Rika> but the idea is what i mean
15:10:51FromDiscord<Rika> you have some nim/lua code, you run it with `nim e`/`lua`, and you get results
15:11:01FromDiscord<Yardanico> without compilation, yeah
15:11:36FromDiscord<Yardanico> nim vm (together with parts of the nim compiler like parser) is something like cpython - a program that runs code "on the fly" without true "compilation"
15:11:48FromDiscord<Yardanico> so @Shiba any more concrete questions?
15:12:43FromDiscord<valerga> `Hint: used config file '/etc/nim/nim.cfg' [Conf]`
15:12:47FromDiscord<valerga> how to avoid this with .nims ?
15:12:55FromDiscord<Yardanico> In reply to @valerga "how to avoid this": wdym "avoid"
15:13:06FromDiscord<Yardanico> this is just a hint by the compiler that tells you that it used this config file for the compilation
15:13:06FromDiscord<valerga> silence that output
15:13:12FromDiscord<Yardanico> `--hint[Conf]:off`
15:13:37FromDiscord<Shiba> In reply to @Rika "do you know lua": Ah thanks, now i understands
15:14:22FromDiscord<valerga> @Yardanico what if I use the shebang to run the .nims . passing that flag does nothing
15:14:32FromDiscord<Yardanico> In reply to @valerga "<@!177365113899057152> what if I": what shebang specifically?
15:14:35FromDiscord<valerga> oh wait
15:14:47FromDiscord<Yardanico> also why run .nims file if you can compile-and-run .nim files just as well? :)
15:15:01FromDiscord<valerga> `#!/usr/bin/env nim`
15:15:10FromDiscord<Yardanico> yes, but what's the full line
15:15:17FromDiscord<Yardanico> just `nim` does nothing, you need a subcommand
15:15:17FromDiscord<valerga> I'm just learning a bit of nimscript so see how it is
15:15:36FromDiscord<Yardanico> In reply to @valerga "I'm just learning a": you don't need to learn it separately, it's just nim with a few limitations
15:15:49FromDiscord<valerga> `#!/usr/bin/env -S nim --hints:off`
15:15:50FromDiscord<valerga> this works
15:16:49FromDiscord<valerga> so what's the major use case for nimscript?
15:17:08FromDiscord<valerga> if it was trivial to launch commands i'd use it to replace bash
15:17:48FromDiscord<Yardanico> In reply to @valerga "so what's the major": embedding it in nim programs as a scripting language
15:17:59FromDiscord<Yardanico> i don't see any reason to use nimscript instead of nim if you want quick "scripts"
15:18:03FromDiscord<Yardanico> nim is already fast enough to compile for that
15:18:08FromDiscord<Yardanico> there was even a tool to make that easier
15:18:34FromDiscord<Yardanico> and IMO launching shell commands is already easy enough with osproc, but if you really want something even simpler there's https://github.com/Vindaar/shell
15:19:00FromDiscord<Yardanico> In reply to @Yardanico "there was even a": https://github.com/PMunch/nimcr
15:19:32FromDiscord<valerga> liking that shell macro
15:19:46FromDiscord<Solitude> In reply to @Yardanico "https://github.com/PMunch/nimcr": `nim r` kinda supersedes that
15:21:20FromDiscord<kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=3LvP
15:21:57FromDiscord<Rika> probably in a macro and not in that form, prolly in form `unpack(f, arg)`
15:22:06FromDiscord<Rika> or `unpack(f(arg))`
15:22:43FromDiscord<Isofruit> Ah man, unpacking and having macros
15:22:47FromDiscord<Yardanico> In reply to @Rika "or `unpack(f(arg))`": huh?
15:22:48FromDiscord<Isofruit> Maybe beef wants to have another child again
15:22:53FromDiscord<Yardanico> In reply to @Isofruit "Maybe beef wants to": https://github.com/technicallyagd/unpack
15:23:06FromDiscord<Rika> In reply to @Yardanico "huh?": what's "huh" about what i said
15:23:08FromDiscord<Rika> read his question
15:23:18FromDiscord<Yardanico> In reply to @Rika "what's "huh" about what": how is `unpack(f(arg))` related
15:23:23FromDiscord<Yardanico> you're calling f with a tuple and then unpack it ??
15:23:30FromDiscord<Rika> r e a d h i s q u e s t i o n
15:23:34FromDiscord<Yardanico> i did
15:23:53FromDiscord<Yardanico> he wants to unpack a tuple to pass its values as separate arguments to a proc
15:23:58FromDiscord<Rika> i KNOW
15:23:58FromDiscord<Yardanico> so how would `unpack(f(arg))` work there
15:24:13FromDiscord<Yardanico> this will call the proc with the tuple, not with the unpacked arguments
15:24:19FromDiscord<Rika> unpack would take in as untyped and transform f(arg)
15:24:25FromDiscord<Rika> the fuck
15:24:30FromDiscord<Rika> did you even read what i said
15:24:32FromDiscord<Yardanico> eh, you want to go that far
15:24:41FromDiscord<Solitude> yard is a resident troll, dont feed him
15:24:53FromDiscord<Yardanico> In reply to @Solitude "yard is a resident": :forsenAngry:
15:25:47FromDiscord<Isofruit> And thus the birth of another macro was prevented!
15:25:57FromDiscord<Rika> i dont see how this library helps
15:26:21FromDiscord<kaddkaka> o.O I didn't mean to start a fight
15:26:50FromDiscord<Rika> its whatever
15:26:51FromDiscord<Yardanico> idk, i wasn't trying to start a fight
15:27:11FromDiscord<Solitude> In reply to @kaddkaka "o.O I didn't mean": he had it coming 🤜
15:27:34FromDiscord<Rika> now im wondering if discord thinks one of my messages sent but didnt
15:27:51FromDiscord<Yardanico> In reply to @Rika "now im wondering if": no, i saw your message but it wasn't clear at all
15:27:54FromDiscord<Rika> because i cant see how you'd miss what i said other than actually just missing it or discord being a fuck
15:27:56FromDiscord<Yardanico> who though you were thinking of transforming the whole call
15:27:57FromDiscord<Rika> okay
15:28:01FromDiscord<Yardanico> @kaddkaka https://stackoverflow.com/questions/48418386/tuple-to-function-arguments-in-nim
15:28:12FromDiscord<Solitude> In reply to @Yardanico "who though you were": i thought
15:28:16FromDiscord<Yardanico> In reply to @Solitude "i thought": you can't
15:28:18FromDiscord<Solitude> that was immediately obvious
15:28:21FromDiscord<kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=3LvQ
15:28:38FromDiscord<Rika> i thought so too, i dont remember having a macro return a function arg list being valid
15:28:44FromDiscord<Rika> In reply to @kaddkaka "<@259277943275126785> I'm looking for": yes i know
15:33:10FromDiscord<Shiba> Also what is the most popular game made purely in nim? Vektor2089
15:33:43FromDiscord<Yardanico> "purely in nim" - not sure
15:33:44FromDiscord<Shiba> I really like that game
15:33:55FromDiscord<Yardanico> also what do you classify as "purely nim"
15:34:01FromDiscord<Yardanico> does using SDL count as pure nim or not?
15:34:06FromDiscord<Shiba> In reply to @Yardanico "also what do you": In pure nim
15:34:12FromDiscord<enthus1ast> the ones made with nico i guess↵(@Shiba)
15:34:20FromDiscord<Yardanico> In reply to @Shiba "In pure nim": that's a very ambiguous definition
15:34:28FromDiscord<enthus1ast> or this facebook game
15:34:37FromDiscord<Yardanico> opengl, sdl, a lot of other libraries are not nim
15:34:53FromDiscord<Shiba> Yes i know that doesn't count
15:34:54FromDiscord<Yardanico> does using system libraries count or not?
15:34:56FromDiscord<Yardanico> why?
15:35:01FromDiscord<Yardanico> why won't sdl count 🤔
15:35:05FromDiscord<Yardanico> glfw too
15:36:15FromDiscord<Rika> what doesnt count and what does?
15:36:28FromDiscord<Yardanico> that's the problem
15:36:34FromDiscord<Rika> yeah
15:36:42FromDiscord<Yardanico> so I think it's not a good idea to debate that question since it's ambiguous
15:36:54FromDiscord<Shiba> I cant think of sdl or open gl made with nim and the majority of game engines/frameworks use wrappers, so to be fair, graphics/audio libaries doesn't count
15:37:03FromDiscord<Yardanico> In reply to @Shiba "I cant think of": nico uses sdl
15:37:12FromDiscord<Shiba> I KNOW
15:37:20FromDiscord<Yardanico> ??
15:37:28FromDiscord<Shiba> (edit) "I KNOW" => "Ii know"
15:37:41FromDiscord<Shiba> Idk how caps was on
15:37:48FromDiscord<Yardanico> I DONT KNOW
15:37:58FromDiscord<Rika> ?
15:38:02FromDiscord<Rika> im so confused now
15:39:04FromDiscord<Shiba> Simply what is the best or weel known game made with nim
15:39:11FromDiscord<Shiba> (edit) "weel" => "well"
15:39:15FromDiscord<Yardanico> In reply to @Shiba "Simply what is the": turing complete
15:39:18FromDiscord<Yardanico> it's godot + nim
15:39:39FromDiscord<Solitude> In reply to @Shiba "Simply what is the": door-o-bot, only the real ones know
15:40:08FromDiscord<Yardanico> In reply to @Solitude "door-o-bot, only the real": wow
15:40:12FromDiscord<Shiba> In reply to @Yardanico "it's godot + nim": That why i lost 4 dollars on a random godot book
15:40:17FromDiscord<Yardanico> ?????
15:40:20FromDiscord<Isofruit> ?
15:40:27FromDiscord<Shiba> Sorry
15:40:46FromDiscord<Rika> im even more confused now
15:40:59FromDiscord<Isofruit> I'm not even part of the convo and even I'm getting confused
15:42:23FromDiscord<Yardanico> In reply to @Isofruit "I'm not even part": shiba said that he lost 4 dollars because he bought a book about godot (?)
15:42:30FromDiscord<Isofruit> We've got fizzbuzz implementations, either way the most important game is covered
15:43:22FromDiscord<Isofruit> (edit) "covered" => "covered↵Nothing else matters"
15:43:44FromDiscord<Isofruit> In reply to @Yardanico "shiba said that he": I think that was for a different server
15:43:55FromDiscord<Yardanico> i don't think so, I mentioned godot + nim above so it was probably related
15:46:24FromDiscord<Isofruit> I'll leave it be, saves me a bit of a headache trying to understand. Those headaches are better used when trying to do something silly myself. ↵↵Never heard of door o bot though,
15:46:43FromDiscord<Isofruit> (edit) "↵↵Never" => "↵On an unrelated note :↵Never"
15:46:49FromDiscord<Isofruit> Got to Google that one
15:47:07FromDiscord<Isofruit> (edit) removed "though,"
15:47:14FromDiscord<Shiba> Still vektor 2089 has better gameplay
15:47:46FromDiscord<Yardanico> In reply to @Shiba "Still vektor 2089 ": let's go to #offtopic to discuss games please :)
15:47:59FromDiscord<Yardanico> the discussion diverged too much to still be in #offtopic
15:48:01FromDiscord<Yardanico> (edit) "#offtopic" => "#main"
15:49:45FromDiscord<Isofruit> Fair. I have a json thingy but I'm on mobile now so can't post my code snippet, Dangit. Threats for later I suppose 😄
15:50:04FromDiscord<Isofruit> (edit) "Fair. I have a json thingy but I'm on mobile ... now" added "right"
15:55:38FromDiscord<Isofruit> Hmmm if I wanted to, could I compile sth in nim to work on Android easily (so is it just throwing in a flag into the compiler or are there more things to take into consideration?)
15:56:29FromDiscord<Isofruit> I only know that it works, not how well. It's not immediately relevant, I'm just toying around with some ideas
15:56:36FromDiscord<Yardanico> "work on android" as in?
15:56:40FromDiscord<Yardanico> you can already use nim easily with termux
15:58:25FromDiscord<Isofruit> Have a clickable icon that opens up a calendar gui or building a frontend client for my backend that I'm currently developing
15:59:19FromDiscord<Shiba> In reply to @Yardanico "you can already use": Using nim on phone?
15:59:20FromDiscord<Isofruit> Sth like that, though ternux sounds like something to do a Google of
15:59:24FromDiscord<Yardanico> In reply to @Shiba "Using nim on phone?": yes
15:59:33FromDiscord<Shiba> Compiler?
15:59:35FromDiscord<Yardanico> yes
15:59:40FromDiscord<Yardanico> https://termux.com/
16:01:11FromDiscord<Isofruit> Man, that would be massive overkill for my usecase, yet it does have appeal
16:02:56NimEventerNew thread by Enthus1ast: Field 'sym' is not accessible for type 'TNode' using 'kind = nkClosure' [FieldDefect], see https://forum.nim-lang.org/t/8785
16:08:21FromDiscord<planetis> is it recommended/faster to return lent even for small objects or a copy?
16:08:41FromDiscord<planetis> especially the array access operator `[]` should it return lent for int32?
16:09:31FromDiscord<planetis> it seems like it makes a (NI32\)0 temporary with lent
16:13:19FromDiscord<planetis> sorry that was for var, not sure what it produces for let container
16:16:39*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
16:17:43FromDiscord<planetis> nah same
16:51:52FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Lwm
16:52:08FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Lwn
16:53:24FromDiscord<Patitotective> (edit) "https://play.nim-lang.org/#ix=3Lwn" => "https://play.nim-lang.org/#ix=3Lwo"
16:53:50FromDiscord<Patitotective> (edit) "https://play.nim-lang.org/#ix=3Lwo" => "https://play.nim-lang.org/#ix=3Lwq"
16:54:01*crem quit (Quit: WeeChat 3.2)
16:54:10FromDiscord<Patitotective> How would I access to a `PContent` table's key?
16:54:18FromDiscord<Rika> you dont have a `[]` for the union?
16:55:59FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Lwr
16:58:02*crem joined #nim
17:00:42FromDiscord<Patitotective> Because Nim doesn't treat `PContentTypes` of `PContent` as an `OrderedTable[string, PContentTypes]`
17:00:51FromDiscord<Patitotective> (edit) "Because" => "But why" | "PContentTypes]`" => "PContentTypes]`?"
17:03:29FromDiscord<Patitotective> Can I convert an union to it's type?
17:06:03FromDiscord<Yardanico> you need to use `as`
17:06:15FromDiscord<Yardanico> https://github.com/alaviss/union did you maybe not read the example in readme?
17:06:45FromDiscord<Yardanico> but it'll look quite ugly in the proc itself i guess
17:07:32FromDiscord<Patitotective> sent a code paste, see https://paste.rs/lxf
17:08:27FromDiscord<Yardanico> (content as PContent)[key] might work
17:08:58FromDiscord<Patitotective> yey
17:08:59FromDiscord<Patitotective> thanks
17:09:00FromDiscord<Patitotective> 🙃
17:09:02*dv^_^ quit (Ping timeout: 252 seconds)
17:09:21*dv^_^ joined #nim
17:18:15FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Lwz
17:18:16FromDiscord<Patitotective> is that possible?
17:25:54*neurocyte0917 quit (Read error: Connection reset by peer)
17:26:55*neurocyte0917 joined #nim
17:30:21*pro quit (Quit: WeeChat 3.4)
17:33:14FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3LwE
17:33:15FromDiscord<Patitotective> sent a code paste, see https://paste.rs/Ah0
17:33:34FromDiscord<Patitotective> (edit) "https://play.nim-lang.org/#ix=3LwE" => "https://play.nim-lang.org/#ix=3LwF"
17:35:08FromDiscord<Rika> Not var
17:35:29FromDiscord<Patitotective> what do you mean?
17:36:07FromDiscord<Rika> The first type you pass in is not var
17:36:48FromDiscord<Patitotective> `my_prefs["theme"]`?
17:36:53*Guest55 joined #nim
17:37:12FromDiscord<Rika> Yes, [] returns a non var
17:37:48FromDiscord<Rika> Hopefully someone else continues to help, I need to sleep
17:37:54FromDiscord<Patitotective> no problem
17:37:56FromDiscord<Patitotective> thanks anyways
17:37:57FromDiscord<Patitotective> 🙃
17:38:10FromDiscord<Patitotective> should it be a reference? (dont answer, sleep rika)
17:38:10*jjido joined #nim
17:38:30FromDiscord<Solitude> no, change your `[]` to template for easy workaround
17:38:41FromDiscord<Solitude> or define separate `[]` for var overload
17:38:48*cyraxjoe quit (Quit: I'm out!)
17:39:28FromDiscord<Patitotective> huh? was it that easy?
17:39:31FromDiscord<Patitotective> thanks @Solitude
17:39:32FromDiscord<Patitotective> 🙃
17:40:42*cyraxjoe joined #nim
17:41:38FromDiscord<Solitude> In reply to @Patitotective "huh? was it that": it will break apart later, dont relax
17:41:56FromDiscord<Patitotective> https://c.tenor.com/fJAoBHWymY4AAAAM/do-not-touch-it-programmer.gif
17:42:02FromDiscord<Patitotective> huh?
17:42:11FromDiscord<Solitude> no inline gifs for you
17:42:28FromDiscord<Patitotective> can i have some?...
17:42:46FromDiscord<Solitude> no, we use imagination here
17:43:00FromDiscord<Patitotective> (edit) "https://c.tenor.com/fJAoBHWymY4AAAAM/do-not-touch-it-programmer.gif" => "https://c.tenor.com/fJAoBHWymY4AAAAM/do-not-touch-it-programmer.gif↵."
17:43:13FromDiscord<Patitotective> In reply to @Solitude "it will break apart": thanks for the reminder
17:43:27FromDiscord<Patitotective> but templates for now have fixed everything hehe
17:45:32FromDiscord<Patitotective> is this the official logo? https://raw.githubusercontent.com/nim-lang/assets/master/Art/logo-crown.png
17:45:46FromDiscord<Patitotective> or this https://forum.nim-lang.org/images/logo.png?
17:45:47FromDiscord<Patitotective> (edit) "https://forum.nim-lang.org/images/logo.png?" => "https://forum.nim-lang.org/images/logo.png ?"
18:03:08*Gustavo6046 joined #nim
18:13:39*Guest55 quit (Quit: Ping timeout (120 seconds))
18:18:12FromDiscord<valerga> nimagination
18:18:38FromDiscord<valerga> nim magi nation
18:22:44FromDiscord<Patitotective> sent a long message, see http://ix.io/3Lx5
18:24:16FromDiscord<Isofruit> Aren't you pretty likely to use your macros in your procs rather than the other way round? I would have inverted that list with types on top
18:24:23FromDiscord<haxscramper> sort by logical dependencies
18:24:48FromDiscord<haxscramper> Maybe types/procs makes sense, but everything else is bound to be intermixed with each other
18:25:17FromDiscord<haxscramper> but usually "meta" things appear on top, like macros and templates
18:25:24FromDiscord<haxscramper> and then used later in procs
18:26:02FromDiscord<Patitotective> sent a long message, see http://ix.io/3Lx7
18:27:13FromDiscord<haxscramper> types, minor getters/setters/predicates, macros/templates, iterators, procs
18:27:54FromDiscord<haxscramper> I don't like to put `isEnabled()` or `add()` billion lines away from the type, since it uses nothing and can be used by any piece of code
18:28:03FromDiscord<haxscramper> same for `items()/pairs()`
18:28:05FromDiscord<Patitotective> what are those getters, setters and predicates?
18:28:19FromDiscord<haxscramper> `setValue()`, `getValue()`, `isEnabled()`
18:28:20FromDiscord<haxscramper> etc.
18:28:30FromDiscord<Patitotective> ok
18:28:31FromDiscord<haxscramper> Maybe you don't have them, so it is purely optional
18:33:29NimEventerNew thread by Planetis: Is it correct to return var after casting an address, see https://forum.nim-lang.org/t/8786
18:47:13FromDiscord<Isofruit> Okay, so I'm definitely being dumb in jsony somewhere
18:47:31NimEventerNew thread by Hobbyman: Non unique / double keys in json, see https://forum.nim-lang.org/t/8787
18:47:47FromDiscord<Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3Lxd
18:48:49FromDiscord<Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3Lxe
18:49:17FromDiscord<Isofruit> I thought "Ah, the Option[string] must be fucky then"
18:49:24FromDiscord<Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3Lxf
18:50:24FromDiscord<Isofruit> (edit) "https://play.nim-lang.org/#ix=3Lxe" => "https://play.nim-lang.org/#ix=3Lxg"
18:52:08FromDiscord<Isofruit> I might make this in issue on the jsony github thingy, I'd just like to double check whether I'm being obviously wrong somewhere and I'm just blind or whether this is actually as confusing as it seems to me
19:04:09FromDiscord<planetis> there is also https://github.com/planetis-m/eminim using stdlib parsejson. try it and see if it works for you
19:05:58*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
19:47:36FromDiscord<Patitotective> sent a code paste, see https://paste.rs/5ga
19:47:43FromDiscord<Patitotective> (edit) "https://play.nim-lang.org/#ix=3LxL" => "https://play.nim-lang.org/#ix=3LxK"
19:48:26FromDiscord<Patitotective> what it does is that it checks if any of `INVALID_KEY_CHARS` are in `key` string
19:53:07FromDiscord<Isofruit> Nothing in sequtils that jumps out?
19:54:06FromDiscord<Isofruit> https://nim-lang.org/docs/sequtils.html#any%2CopenArray%5BT%5D%2Cproc%28T%29↵Has an any method, you can take your array, call any on it and feed it a lambda expression that evaluates any individual element of the array
19:54:18FromDiscord<huantian> https://nim-lang.org/docs/sequtils.html#anyIt.t,untyped,untyped↵you can also use anyIt if you prefer
19:56:03FromDiscord<Patitotective> Thanks
19:56:05FromDiscord<Patitotective> 🙃
19:57:26FromDiscord<planetis> you do like the upside down emojis
19:57:51FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3LxN
19:58:11FromDiscord<Patitotective> In reply to @planetis "you do like the": hehe, is the best
19:58:36FromDiscord<Patitotective> (edit) "https://play.nim-lang.org/#ix=3LxN" => "https://paste.rs/hyO"
19:59:28FromDiscord<planetis> you dont, its known at compile time better use proc overloads
20:00:31FromDiscord<Patitotective> oh yea, you're right, i forgot this was nim and not pyton hehe
20:00:34FromDiscord<Patitotective> thanks 🙃
20:04:23*noeontheend joined #nim
20:09:57*noeontheend quit (Remote host closed the connection)
20:11:21*noeontheend joined #nim
20:11:34FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3LxT
20:12:39FromDiscord<huantian> yes, len will return the number of keys in the table
20:12:52FromDiscord<Patitotective> but is there a better wa?
20:12:53*Gustavo6046_ joined #nim
20:12:53FromDiscord<Patitotective> (edit) "wa?" => "way?"
20:13:11FromDiscord<huantian> probably not
20:13:19FromDiscord<Patitotective> k thanks
20:13:26FromDiscord<Patitotective> (edit) "k thanks ... " added " upsidedown emoji "
20:13:28*Gustavo6046 quit (Remote host closed the connection)
20:15:07FromDiscord<haxscramper> `len() == 0` applies to almost all containers/json/ast/string/seq/set so it is kind of api-by-convention way of checking for empty
20:19:14*algae joined #nim
20:24:55FromDiscord<krisppurg> sent a code paste, see https://play.nim-lang.org/#ix=3LxW
20:27:20FromDiscord<Patitotective> Is there an equivalent to `repr` (from Python) in Nim? because Nim's `repr` seems to include the memory address i only want the object representation (strings with quotes basically)?
20:27:23FromDiscord<Patitotective> (edit) "basically)?" => "basically)"
20:33:50FromDiscord<Solitude> just echo the object
20:33:57FromDiscord<Solitude> `$` it
20:34:29FromDiscord<haxscramper> In reply to @krisppurg "Is there anyway in": with runtime strings - no, unless you overload `[]`, with compile-time strings you can write `[]` with `static[string]` argument and `when` over specific value
20:34:29*Gustavo6046_ quit (Quit: Leaving)
20:34:42FromDiscord<haxscramper> Pretty sure that's not what you need though
20:34:44*Gustavo6046 joined #nim
20:34:48FromDiscord<Patitotective> In reply to @Solitude "`$` it*": strings seems to be unquotes though
20:34:53FromDiscord<Patitotective> (edit) "unquotes" => "unquoted"
20:35:40FromDiscord<Solitude> !eval echo ("test",)
20:35:42NimBot("test",)
20:35:47FromDiscord<Solitude> zamn
20:36:14FromDiscord<Solitude> or do you mean you want to outputs the string itself quoted?
20:36:24FromDiscord<Patitotective> yes
20:36:28FromDiscord<Solitude> .
20:37:53FromDiscord<Solitude> there is addQuoted, which append to string
20:38:24FromDiscord<Solitude> i guess this works too https://nim-lang.org/docs/strutils.html#escape%2Cstring%2Cstring%2Cstring
20:40:34FromDiscord<Patitotective> doesn't work with all types like repr but i guess its enough
20:46:48*cyraxjoe quit (Quit: I'm out!)
20:48:43FromDiscord<krisppurg> In reply to @haxscramper "with runtime strings -": actually what about? https://play.nim-lang.org/#ix=3Ly1
20:48:50FromDiscord<krisppurg> (edit) "about?" => "about this?"
20:50:17FromDiscord<krisppurg> although I have no idea how to convert a string to untyped
20:52:02FromDiscord<haxscramper> `.strVal()`, but it is similar to `static[]`, in the end you still hardcode string value
20:52:19FromDiscord<haxscramper> you want to dynamically select field to set value to, right?
20:52:52FromDiscord<haxscramper> With compiler language it is harder, you need to have some sort of dispatching system that would give you access to different fields
20:55:06FromDiscord<krisppurg> I want `f["abcdefg"]` to be `f.abcdefg`
21:01:21FromDiscord<krisppurg> Actually is there a reverse of `astToStr`?
21:08:27FromDiscord<hugogranstrom> In reply to @krisppurg "Actually is there a": If you make a macro you can do `ident(static string)` to transform it into an identifier
21:09:50FromDiscord<huantian> https://play.nim-lang.org/#ix=3Ly8↵something like this works, just use ``[]``
21:09:56FromDiscord<huantian> (edit) "use" => "switch it to"
21:10:10FromDiscord<hugogranstrom> sent a code paste, see https://play.nim-lang.org/#ix=3Ly9
21:11:07FromDiscord<krisppurg> In reply to @huantian "https://play.nim-lang.org/#ix=3Ly8 something like t": ty
21:11:29FromDiscord<krisppurg> In reply to @hugogranstrom.nim "If you make a": isnt ident deprecated since 0.18.1?
21:11:54FromDiscord<krisppurg> https://media.discordapp.net/attachments/371759389889003532/929482569823682560/unknown.png
21:12:44FromDiscord<hugogranstrom> In reply to @krisppurg "isnt ident deprecated since": Don't think so https://nim-lang.org/docs/macros.html#ident%2Cstring
21:13:14FromDiscord<hugogranstrom> It's `ident=` which is depreacted
21:14:05FromDiscord<hugogranstrom> Because there was a special `NimIdent` type which they removed which was used in `ident=`
21:15:04FromDiscord<hugogranstrom> Nevermind, `ident(NimNode)` is depreacted
21:15:10FromDiscord<hugogranstrom> But not `ident(string)`
21:17:53FromDiscord<hugogranstrom> If you use `static string` instead of string as input you don't have to do `.strVal` to get the actual string
21:18:53FromDiscord<krisppurg> alright
21:19:06FromDiscord<krisppurg> In reply to @huantian "https://play.nim-lang.org/#ix=3Ly8 something like t": What about assigning?
21:19:10FromDiscord<huantian> on huh `newIdentNode(string)` is just the same as `ident(string)`
21:19:36FromDiscord<krisppurg> (edit) "In reply to @huantian "https://play.nim-lang.org/#ix=3Ly8 something like t": What about assigning? ... " added "with `[]=`"
21:19:42FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=3Lye
21:19:51FromDiscord<huantian> (edit) "https://play.nim-lang.org/#ix=3Lye" => "https://play.nim-lang.org/#ix=3Lyf"
21:19:52FromDiscord<huantian> (edit) "https://play.nim-lang.org/#ix=3Lyf" => "https://play.nim-lang.org/#ix=3Lyg"
21:32:01FromDiscord<krisppurg> sent a code paste, see https://play.nim-lang.org/#ix=3Lyk
21:32:25FromDiscord<krisppurg> @huantian
21:32:37*sagax joined #nim
21:32:45FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=3Lyl
21:32:50FromDiscord<huantian> it's not really possible since it's not known at compile time
21:33:01*noeontheend quit (Ping timeout: 240 seconds)
21:33:33FromDiscord<huantian> you can make your variable a `const`, but it's all done at compile time
21:34:01*lain quit (Ping timeout: 250 seconds)
21:34:25FromDiscord<krisppurg> still errors with `const`
21:34:52*lain joined #nim
21:35:29FromDiscord<huantian> working for me↵https://play.nim-lang.org/#ix=3Lyn
21:37:04FromDiscord<krisppurg> this was mine↵https://play.nim-lang.org/#ix=3Lyp
21:37:36FromDiscord<huantian> change the `[]=` macro to static string
21:38:56FromDiscord<krisppurg> ah i didnt notice lol
21:46:08*krux02 joined #nim
22:21:08FromDiscord<krisppurg> holy
22:21:09FromDiscord<krisppurg> sent a code paste, see https://play.nim-lang.org/#ix=3LyI
22:21:49FromDiscord<krisppurg> (edit) "sent a" => "I dont know why but when I write this" | "paste, see https://play.nim-lang.org/#ix=3LyI" => "(https://play.nim-lang.org/#ix=3LyH) I get this error https://play.nim-lang.org/#ix=3LyJ"
22:22:48FromDiscord<krisppurg> @huantian
22:25:10FromDiscord<Elegantbeef> The macro isnt going to work
22:25:28FromDiscord<Elegantbeef> You're attempting to assign fields at runtime using a macro it's not going to work
22:27:11FromDiscord<Elegantbeef> You need to make a case statement or nested if to set fields based off `$val`
22:27:23FromDiscord<Elegantbeef> sorry `n`
22:28:06FromDiscord<krisppurg> example?
22:29:14FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3LyN
22:29:34FromDiscord<Elegantbeef> That still will probably not work
22:29:52FromDiscord<Elegantbeef> Since the tree will not be contiguous
22:30:31FromDiscord<Elegantbeef> the `[]` isnt really implementable without using a union
22:30:52FromDiscord<Elegantbeef> Cause the return type can change based of the input string
22:31:11FromDiscord<Elegantbeef> In one case it could be a string in another it could be an int, so you either need to box it or have overloads
22:32:11FromDiscord<Elegantbeef> Atleast i assume this is for runtime logic
22:33:58FromDiscord<krisppurg> it does not work
22:34:37FromDiscord<Elegantbeef> Oh wait we can do this
22:34:53FromDiscord<krisppurg> (edit) "it does not work ... " added "- same error"
22:35:07FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/wox
22:35:37FromDiscord<Elegantbeef> Remove the `[]`
22:35:42FromDiscord<Elegantbeef> `[]` will not work
22:36:03FromDiscord<krisppurg> what about the other []=?
22:36:39FromDiscord<Elegantbeef> The other `[]=` will not work either
22:36:45FromDiscord<Elegantbeef> It's a macro it's expanded at compile time
22:36:55FromDiscord<Elegantbeef> `n` is got from runtime data
22:38:02FromDiscord<Elegantbeef> The one i just provided should work
22:38:48FromDiscord<Elegantbeef> Though i dont get why you have `($val).fromJson`
22:39:02FromDiscord<Elegantbeef> Isnt the json node going to be exactly what you need so `val.fromJson` should work
22:39:20FromDiscord<krisppurg> im using jsony to parse objects
22:39:41FromDiscord<krisppurg> and jsony doesnt support jsonnode in fromJson as first argument
22:39:46FromDiscord<Elegantbeef> I see
22:42:49FromDiscord<krisppurg> sent a code paste, see https://play.nim-lang.org/#ix=3LyP
22:44:43FromDiscord<Elegantbeef> What's Guild?
22:45:00FromDiscord<Elegantbeef> is it a `ref object`?
22:45:56FromDiscord<krisppurg> yes it is a ref object
22:46:17FromDiscord<Elegantbeef> `obj[].fieldPairs`
22:46:41FromDiscord<krisppurg> didnt know you could do that lol
22:46:52FromDiscord<Elegantbeef> Well `obj[]` is a lvalue
22:47:03FromDiscord<krisppurg> ik but didnt think of that
23:00:42*Bager170 joined #nim
23:01:11Bager170Can you mark individual fields in an object as acyclic instead of the whole object?
23:02:14FromDiscord<Elegantbeef> You cannot
23:03:05FromDiscord<Elegantbeef> Marking acyclic is just an optimization for Orc iirc so a single field being cyclical causes the same issue
23:04:26*Bager170 quit (Client Quit)
23:05:16FromDiscord<Schelz> Can somebody provide me a doc for how to wrap up a c++ file for nim ?
23:06:30FromDiscord<Elegantbeef> Have you seen everything below https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importcpp-pragma ?
23:52:16*krux02 quit (Remote host closed the connection)
23:56:22FromDiscord<enthus1ast> the case object semantic is nearly usesless \:/
23:56:32*joast joined #nim
23:59:34FromDiscord<enthus1ast> real bummer