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