<< 29-10-2021 >>

00:27:03tkWhy does from std/enumerate import enumerate not work?
00:27:18tkusing the enumerate macro results in: Error: undeclared identifier: 'enumerate'
00:27:27tksimply replacing the line with "import std/enumerate" fixes the issue
00:28:23FromDiscord<Elegantbeef> It might be a product of module name == symname or the for loop macro
00:28:35FromDiscord<Elegantbeef> Eitherway it literally has a single macro in it πŸ˜›
00:29:14tkI am aware, but confusing language behaviour does not make me happy. Which is why I want to understand exactly what happened.
00:29:56FromDiscord<Elegantbeef> Well give it a whirl with another macro with the same name as the module if that works make it a for loop macro, if that works the end is upon us
00:30:50tkokay, fair idea, I will try that tomorrow
00:47:00*arkurious quit (Quit: Leaving)
01:14:27*neurocyte0132889 quit (Ping timeout: 260 seconds)
01:30:13*lively_s1 joined #nim
01:39:00*lively_s1 quit (Ping timeout: 260 seconds)
02:19:04FromDiscord<reilly> Is it documented anywhere what operating systems are available to the `defined()` proc?
02:22:29FromDiscord<leorize> it's not documented but it's the same as the possible names for `hostOS` constant, which is documented
02:48:34NimEventerNew thread by Oden: Sequitls documentation outdated?, see https://forum.nim-lang.org/t/8556
02:48:49FromDiscord<geekrelief> is it possible to assign a returned `var T` to a variable? https://play.nim-lang.org/#ix=3Dek after I assign increment `bar`, I expect `val` to be 2, but it's 1.
02:50:52FromDiscord<Elegantbeef> Without experimental views nope, but you can use `std/decls` to get it as long as you know it doesnt escape
02:50:59FromDiscord<geekrelief> Strangely, things kinda work with var return type for iterators
02:51:39FromDiscord<geekrelief> Hey beef, would you mind taking a look at this? https://play.nim-lang.org/#ix=3Dem
02:52:34FromDiscord<geekrelief> I'm trying define an iterator that returns a mutable value over `UncheckedArray[T]| ptr T`
02:52:51FromDiscord<geekrelief> They work separately, but not when the type is or'ed. And I don't understand why.
02:53:28FromDiscord<Elegantbeef> does using `ptr` change anything
02:54:04FromDiscord<geekrelief> well I have two `mitems` in the sample
02:54:13FromDiscord<geekrelief> one takes `ptr T`
02:54:46FromDiscord<Elegantbeef> Well you're using ptr math so this makes it more annoying to test
02:55:00FromDiscord<geekrelief> I'm cleaning up the sameple https://play.nim-lang.org/#ix=3Den
02:55:14FromDiscord<geekrelief> yeah, I've include the `ptr` math ops I'm using
02:55:19FromDiscord<geekrelief> (edit) "include" => "included"
02:55:32FromDiscord<geekrelief> those work for sure
02:55:44FromDiscord<Elegantbeef> that's cause it fits both definitions
02:55:57FromDiscord<Elegantbeef> It's a `ptr T` and an `var UncheckedArray`
02:56:57FromDiscord<geekrelief> oh you're saying `var UncheckedArray[T] | ptr T` is redudant?
02:58:29FromDiscord<geekrelief> if I uncomment `iterator mitems[T](a: var UncheckedArray[T] | ptr T, len: SomeInteger): var T =` and comment out the ones above I get an error: `expression has no address`
02:58:48FromDiscord<geekrelief> on the `yield a[i]`
02:59:35FromDiscord<geekrelief> It doesn't like the UncheckedArray but if pass the ptr T for `var UncheckedArray[T] | ptr T` it works
03:01:55FromDiscord<Elegantbeef> being tired is not helping this πŸ˜€
03:02:07FromDiscord<geekrelief> don't worry, thanks for taking a look
03:02:24FromDiscord<Elegantbeef> I'll try to get it working, but i'm not seeing the connections
03:03:27FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3Der
03:03:47FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3Des
03:04:57FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3Det
03:04:59FromDiscord<Elegantbeef> I wonder if mitems even works with an ord typedesc
03:05:10FromDiscord<Elegantbeef> or'd\
03:06:42FromDiscord<geekrelief> I still get the same result
03:06:42FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3Deu
03:07:10FromDiscord<geekrelief> don't worry about it, I'll post to the forum
03:15:23FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3Dez
03:17:13FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3DeA
03:17:41FromDiscord<Elegantbeef> That'd be enough if it's enough for you
03:18:12FromDiscord<ajusa> I guess what I'm asking is what's the most "nim-like" way of doing it. Are pragmas/macros my only option?
03:18:46FromDiscord<Elegantbeef> I mean you of course can do it N-zillion ways, pragmas/macros are probably the most sensible
03:19:07FromDiscord<ajusa> In reply to @Elegantbeef "I mean you of": Alright, that's basically what I was trying to confirm. Thanks!
03:22:37NimEventerNew thread by Geekrelief: Trouble with or'ed type and var return type., see https://forum.nim-lang.org/t/8557
03:23:04FromDiscord<Elegantbeef> Will say you have the two options of doing the pragmas like that or doing `SignupForm.name.setLabel"First and Last Name"`
03:24:13FromDiscord<Elegantbeef> The latter might be nice as it could allow possibly allow for localization
03:24:20FromDiscord<Elegantbeef> Though i might be wrong on that front
03:32:18FromDiscord<ajusa> In reply to @Elegantbeef "Will say you have": How does that option work exactly? Does it need dotOperators?
03:34:57FromDiscord<Elegantbeef> `setLabel` would be a macro which would add it to a list which you could refer to later, you could either do `setLocale` or include a locale flag into the macro
03:35:38FromDiscord<ajusa> ah so it figures out the parent type and then the nested field then, got it
03:35:53*lively_s1 joined #nim
03:36:08FromDiscord<Elegantbeef> Yea you should get the entire dot expression
03:56:02FromDiscord<Elegantbeef> @ajusa\: here is my idea half implemented https://play.nim-lang.org/#ix=3DeG
03:58:19FromDiscord<ajusa> In reply to @Elegantbeef "<@102899813149855744>\: here is my": Thanks, I'll try working off of this!
03:59:04FromDiscord<Elegantbeef> To actually support local you'll want to output a table instead since this is all CT
04:04:14FromDiscord<ajusa> Oh hey I got a codegen crash on Nim 1.6
04:06:02*supakeen quit (Quit: WeeChat 3.3)
04:06:31*supakeen joined #nim
04:08:16FromDiscord<ajusa> In reply to @ajusa "Oh hey I got": turns out you can't use fieldPairs with Karax's DSL
04:08:38FromDiscord<ajusa> (edit) "In reply to @ajusa "Oh hey I got": turns out you can't use fieldPairs with Karax's DSL ... " added "- I think it is still an issue with Nim though since it crashes in codegen"
04:09:30*lively_s1 quit (Ping timeout: 260 seconds)
04:12:49*rockcavera quit (Remote host closed the connection)
04:46:19FromDiscord<Elegantbeef> @ajusa\: shouldnt you be compiling for JS anyway?
05:18:01*vicecea quit (Remote host closed the connection)
05:18:29*vicecea joined #nim
05:45:51*lively_s1 joined #nim
06:11:19*sagax joined #nim
06:22:54NimEventerNew Nimble package! riff - RIFF file handling for Nim , see https://github.com/johnnovak/nim-riff
06:44:14*PMunch_ is now known as PMunch
06:49:35*lively_s1 quit (Ping timeout: 264 seconds)
06:57:53*neurocyte0132889 joined #nim
06:57:53*neurocyte0132889 quit (Changing host)
06:57:53*neurocyte0132889 joined #nim
07:18:18Amun-RaI know it works but is it save to copy to string with copyMem(addr s[0], …)?
07:18:22Amun-Rasafe*
08:18:00PMunchHmm, I have a weird bug. Something causes a segfault in a shared library I've written in Nim. It only happens in our production environment and I'm not even 100% sure it is caused by my code. I tried to build a debug version of Nim but that just yielded the line "No stack trace available" before the segfault message. What would be my best steps to further debug this issue..
08:18:05PMunchs/../?
08:24:38FromDiscord<leorize> if you can get it to segfault on nim \>= 1.6.0, it should create a coredump that you can use to investigate
08:26:40PMunchOh really?
08:26:48PMunchWhere does it store that?
08:27:35FromDiscord<Imperatorn> What OS?
08:28:03PMunchUbuntu in a Docker container
08:28:22FromDiscord<leorize> is this a bug with that unbound plugin you wrote a while back?
08:28:35PMunchYup
08:28:44PMunchIt's been running in production ever since I wrote it
08:28:52PMunchHandling about 100M DNS queries a day
08:29:43FromDiscord<leorize> https://le.qun.ch/en/blog/core-dump-file-in-docker/ \<- this might work
08:30:27FromDiscord<leorize> and that's some nice stats
08:31:04PMunchYeah it works pretty well and has been fairly problem free
08:31:30FromDiscord<leorize> also, make sure that your nim library\: does not use dlopen via dynlib and is compiled with nim \>= 1.4.0
08:33:17FromDiscord<leorize> make sure that you don't deallocate any memory coming from unbound using Nim's `dealloc`
08:33:28FromDiscord<leorize> or send any Nim's memory to `unbound`, for that matter
08:33:50PMunchYeah I've taken all the normal steps
08:33:56FromDiscord<leorize> `-d:noSignalHandler` might come in handy to not overrides unbound's signal handlers by accident
08:34:24PMunchI mean I was running it on my machine just blasting it with queries and I wasn't able to crash it
08:34:38PMunchSo there is some edge-case scenario when hit with the real world
08:35:33FromDiscord<leorize> run it with coredump enabled and hope that you can catch it then
08:36:27PMunchStarting with 1.6.0 I get a lot of CStringConv warnings by the way
08:37:07PMunchI had a version that didn't crash before, but it had some performance issues. Slight refactor and update the versions of different things and now it crashes sometimes
08:37:37FromDiscord<leorize> just remember to replace the convs with addr I guess
08:37:47FromDiscord<leorize> hmm, it wasn't mentioned on 1.6.0 release note at all
08:37:57PMunchHmm, what do you mean?
08:38:54FromDiscord<leorize> to silence those warnings, that is
08:39:13FromDiscord<leorize> I think now `addr` must be used to signify those conversions since they are dangerous
08:39:18FromDiscord<leorize> (rightfully so)
08:44:05PMunchI use it to convert C library error strings into Nim strings
08:44:30PMunchOh wait, I convert Nim strings to C strings..
08:44:31PMunchHmm
08:45:57*lively_s1 joined #nim
08:47:20PMunchI call the Unbound log_* functions which obviously take a cstring. And I do things like `log_err("Unable to get key: " & getCurrentExceptionMsg())`.
08:47:33PMunchWhat is the lifetime of that string actually?
09:00:13PMunchSeems to all be freed right after the log statement, which should be fine
09:02:14PMunchHmm, by explicitly converting it to cstring it works just fine..
09:09:27*lively_s1 quit (Ping timeout: 265 seconds)
09:15:09FromDiscord<leorize> i think you're fine on that front
09:16:36FromDiscord<leorize> there's always --gc\:orc -d\:useMalloc to debug the harder cases
09:17:47FromDiscord<leorize> and if the memory corruption is too hard to track with the coredump then sanitizers are an option, but it might create too much of a performance hit
09:58:29*lively_s1 joined #nim
10:24:17FromDiscord<Arend | α›—α›Ÿαš’αš±α›α›–α›Š> <@&371760044473319454> any here that I could talk to?
10:24:28*lively_sparkle joined #nim
10:24:33PMunchFire away
10:24:54FromDiscord<Arend | α›—α›Ÿαš’αš±α›α›–α›Š> I got banned from nim's forum on my 1st comment lmao
10:25:11PMunchHow'd you manage that?
10:25:25FromDiscord<Arend | α›—α›Ÿαš’αš±α›α›–α›Š> well thats what I need a moderator for
10:26:27PMunchOh that's what your @ was
10:26:40PMunchOn IRC they just come through as a bunch of numbers
10:26:47*lively_s1 quit (Ping timeout: 264 seconds)
10:27:02FromDiscord<Arend | α›—α›Ÿαš’αš±α›α›–α›Š> apologies
10:27:17supakeenNot like you could know :)
10:28:19PMunchWhat was your post though? Now I'm curious
10:28:29FromDiscord<impbox [ftsf]> i am a mod, you can message me
10:29:00FromDiscord<impbox [ftsf]> though i am not a forum mod, so i can't help with that
10:29:13FromDiscord<Arend | α›—α›Ÿαš’αš±α›α›–α›Š> I simply posted in the nim 2.0 thread and got banhammered straight away hehe
10:29:29FromDiscord<impbox [ftsf]> were you deserving?
10:30:14FromDiscord<Arend | α›—α›Ÿαš’αš±α›α›–α›Š> I dont think so, it's not like I was saying to get rid of signifcant whitespace or case insensitivity
10:30:19FromDiscord<Arend | α›—α›Ÿαš’αš±α›α›–α›Š> in that case, ban away
10:30:22FromDiscord<Arend | α›—α›Ÿαš’αš±α›α›–α›Š> hah
10:30:46PMunchSo what did you post?
10:30:52FromDiscord<xflywind> New users are moderated at the beginning. It needs a moderator to unlock.
10:31:05FromDiscord<xflywind> no related to banning
10:31:09FromDiscord<xflywind> (edit) "no" => "not"
10:31:10PMunchI think few things should be instantly banable
10:31:41FromDiscord<impbox [ftsf]> unless you were spamming or phishing it's unlikely you'd be banned for a first post
10:31:48FromDiscord<Arend | α›—α›Ÿαš’αš±α›α›–α›Š> just that I didnt like try/catch blocks as error handling and preferred something like Zig
10:31:57FromDiscord<impbox [ftsf]> so It's likely just moderated until it's approved
10:31:59FromDiscord<Arend | α›—α›Ÿαš’αš±α›α›–α›Š> apparently that's a few bridges to far
10:32:04FromDiscord<Arend | α›—α›Ÿαš’αš±α›α›–α›Š> no, my acount is literally banned
10:32:11FromDiscord<impbox [ftsf]> does it say you're banned?
10:32:27FromDiscord<Arend | α›—α›Ÿαš’αš±α›α›–α›Š> "Your account was banned."
10:32:34FromDiscord<Arend | α›—α›Ÿαš’αš±α›α›–α›Š> Rank Troll
10:33:00PMunchHuh, that's odd
10:33:03FromDiscord<impbox [ftsf]> hmm mod in a bad mood perhaps. seems overkill
10:33:13PMunchHow does Zig handle errors by the way?
10:33:25PMunchSome kind of optional return system?
10:34:26FromDiscord<Arend | α›—α›Ÿαš’αš±α›α›–α›Š> well, they switch over errors rather than try blocks, makes it look less cluttered
10:35:53PMunchSo you get something like a (error: Option[Defect], result: Option[T]) as a return?
10:38:15FromDiscord<haxscramper> You can do it already to an extent - disable all raises, and use Result or leorize union
10:38:23FromDiscord<haxscramper> And switch over errors
10:38:54FromDiscord<haxscramper> I need to try out union, certainly worth adding somewhere in the code
11:15:55*lively_sparkle quit (Ping timeout: 260 seconds)
11:16:40PMunchHuh union looks pretty neat
11:21:57FromDiscord<haxscramper> I think it would also be possible to wrap procedure call into union automatically - check for possible exceptions with `std/effecttraits`, generate `try/except` and make it return `union(Ok | Error1 | Error2 | Error3)` etc)
11:26:46PMunchOoh, that would probably be possible
11:27:07PMunchA simple pragma that took all the possible exceptions and instead returned a union with the original return type and all the exceptions
11:36:35FromDiscord<hmmm> hi lovelies
11:36:47FromDiscord<hmmm> how does the magic thingy "items" work
11:36:49FromDiscord<haxscramper> `Error: invalid package name: /mnt/workspace/clean-clone/hack/nimdeps/pkgs/union`
11:36:53FromDiscord<haxscramper> nim can't handle dash in absolute package name?
11:37:41FromDiscord<haxscramper> you mean `for a in MyObject` calls `items()`?
11:38:09FromDiscord<hmmm> yes
11:38:12FromDiscord<haxscramper> `/hm+/`
11:38:53FromDiscord<haxscramper> you can define `iterator items(arg: SomeType)` and it will be called in the `for a in <expr of SomeType>` implicitly
11:39:08FromDiscord<haxscramper> `for a` calls `items()`, `for a, b` calls `pairs()`
11:39:41*lively_sparkle joined #nim
11:40:28FromDiscord<hmmm> so it works on objects like "for in in myseq" does for seqs
11:40:51FromDiscord<hmmm> for x in myseq
11:41:53FromDiscord<haxscramper> yes, `seq` also implements `items` iterator
11:42:12FromDiscord<hmmm> this is quite comfy
11:42:28FromDiscord<hmmm> how do I know if an object supports items?
11:43:08FromDiscord<haxscramper> you can calls `items()` explicitly
11:43:14FromDiscord<haxscramper> `for a in items(Object())`
11:43:20FromDiscord<haxscramper> compiler will tell you if something is missing
11:43:58FromDiscord<hmmm> perfect
11:44:19FromDiscord<hmmm> the relevant section of the manual is where it talks about iterators?
11:45:23*lively_sparkle quit (Ping timeout: 264 seconds)
11:45:54FromDiscord<haxscramper> yes
11:46:48FromDiscord<hmmm> ty hexxy πŸ‘‘
11:53:46FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3DgD
11:54:14FromDiscord<haxscramper> `union(int | ref Exc2:ObjectType | ref Exc:ObjectType)`
11:55:15FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3DgF
11:55:34FromDiscord<haxscramper> no syntax sugar for matching union, but this can be implemented as
11:55:43FromDiscord<haxscramper> hm, actually I think it will work
11:56:34PMunchPretty neat actually
11:58:28PMunchAnd since == automatically unpacks you can do `someWrappedProc() == 42` and if it threw something it would fall into an else branch
11:59:36FromDiscord<haxscramper> It almost worked
11:59:37FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3DgH
12:00:12FromDiscord<haxscramper> fusion/matching can work with derived objects using `of` check, and union implements `of` operator to check, so I though I might merge these two together
12:00:28FromDiscord<haxscramper> But I got `/tmp/union/raiseunion.nim(42, 30) Error: there is only one type <A> in the typeclass <A | B>`
12:00:43FromDiscord<haxscramper> ο»Ώleorize\: maybe you have an idea what might be wrong here?
12:01:03FromDiscord<haxscramper> It complains about `func isNil[A, B](u: union(A | B)): bool = false`
12:02:36FromDiscord<haxscramper> "got error"
12:02:40FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3DgL
12:03:52PMunchof of?
12:04:00FromDiscord<haxscramper> I know `of of` looks weird - first one is a part of `case/of` syntax, second is a part of the DSL so I can figure whether you want to match for `Kind()` or `of DerivedSubtype()`
12:04:21PMunchAh I see
12:05:04FromDiscord<tandy> [impbox](https://matrix.to/#/@impbox:matrix.org)\: do you have an example for nico that uses oolib?
12:06:01*supakeen quit (Quit: WeeChat 3.3)
12:06:32*supakeen joined #nim
12:11:32FromDiscord<Rika> Maybe name it β€œsub kind” or something instead of β€œif”
12:11:34FromDiscord<Rika> β€œOf”
12:14:40FromDiscord<haxscramper> how it would look?
12:14:46FromDiscord<haxscramper> `of sub Exc()`?
12:15:38PMunch`of subKind Exc()` looks pretty neat
12:15:40FromDiscord<haxscramper> there is a built-in `of` operator for checking if type is a subtype of another one, so I used it here as well
12:15:53PMunchMaybe have both?
12:16:14FromDiscord<haxscramper> it is not a subkind, it is a subtype
12:16:55FromDiscord<haxscramper> having both is undeirable, I would prefer to have one way of writing things in the same DSl
12:17:11FromDiscord<Arend | α›—α›Ÿαš’αš±α›α›–α›Š> I love how this code experimentation started because I got hammered on my first post πŸ˜†
12:17:33FromDiscord<haxscramper> I might consider something different than `of`, though probably not `subtype`
12:17:45FromDiscord<haxscramper> I really wonder what happened there↡(@Arend | α›—α›Ÿαš’αš±α›α›–α›Š)
12:18:01FromDiscord<xflywind> In reply to @Arend | α›—α›Ÿαš’αš±α›α›–α›Š "I love how this": what's your forum username?
12:18:06PMunchOh by the way @Arend_|_α›—α›Ÿαš’αš±α›α›–α›Š, why have you written the name of a French place in runes at the end of your nick?
12:18:35PMunchI mean this is like 50% of my weird code experiments
12:19:05FromDiscord<Arend | α›—α›Ÿαš’αš±α›α›–α›Š> @xflywind just Arend; PMunch, a French place? It says Maurice
12:19:35FromDiscord<Arend | α›—α›Ÿαš’αš±α›α›–α›Š> in Dutch phonetics
12:20:05PMunchOh I thought it said Mouries
12:20:10FromDiscord<xflywind> In reply to @Arend | α›—α›Ÿαš’αš±α›α›–α›Š "@xflywind just Arend; PMunch,": @dom96 @Araq @narimiran are there something wrong with the forum post?
12:20:44PMunchI mean phonetically I guess those are the same :P
12:21:08*Vladar joined #nim
12:23:50FromDiscord<Arend | α›—α›Ÿαš’αš±α›α›–α›Š> PMunch, it does say that if you transliterate it into Latin but I was working on a Runic alphabet for the Modern Dutch language and I yeeted some letters; the letters x,c,q,v are useless phonetically in effect so they got removed.
12:23:59FromDiscord<haxscramper> also "rank - troll"
12:24:06FromDiscord<haxscramper> lmao, who came up with this
12:24:44FromDiscord<haxscramper> I know that araq is not a big fan of union/result/option fp things, so there might be a chance
12:25:32PMunchBut still, we shouldn't ban people just because we disagree with them..
12:25:40FromDiscord<Rika> I doubt he did it
12:25:50PMunch@Arend_|_α›—α›Ÿαš’αš±α›α›–α›Š, ah I see
12:31:02FromDiscord<ajusa> In reply to @Elegantbeef "<@102899813149855744>\: shouldnt you be": Nah this is server side generated HTML
12:51:19NimEventerNew thread by Didlybom: Nimsuggest issue with the (nim-based) VS Code extension and nim 1.6.0, see https://forum.nim-lang.org/t/8559
12:53:19NimEventerNew thread by Didlybom: Nimsuggest issue with the VS Code extension and nim 1.6.0, see https://forum.nim-lang.org/t/8560
13:12:21*arkurious joined #nim
13:14:34*rockcavera joined #nim
13:14:34*rockcavera quit (Changing host)
13:14:34*rockcavera joined #nim
13:16:51*lively_sparkle joined #nim
13:34:43*lively_sparkle quit (Quit: WeeChat 3.3)
13:39:32FromDiscord<galen> Hi! I'm trying to make a small program which is opened when clicking on a certain kind of file, like a .log for example. How would I go about finding out which file the program just got "opened" on?
13:39:59PMunchDepends on how your file manager passes files to programs
13:40:12FromDiscord<galen> In reply to @PMunch "Depends on how your": its on windows only
13:41:03PMunchProbably it is some kind of parameter passing, so need paramCount and paramStr to find the name of the file
13:42:16FromDiscord<galen> Thank you! Will start there πŸ™‚
13:43:45PMunchAt least that's the way it'd be done on Linux. But since it's Windows it might be a five word system call to get a wide string with BOM markers or something equally silly
13:44:02nixfreak_nim[m]This is weird , this simple program works fine on playgound but gives me error on emacs and nvim (neovim) https://play.nim-lang.org/. I get the error Error: missing closing ' for character literal
13:44:02FromDiscord<galen> πŸ˜‚ damn hahah
13:44:28nixfreak_nim[m]I am using 1.4.8 on emacs and neovim
13:44:32PMunchWhat small program nixfreak_nim[m]
13:44:53PMunch@galen, try the paramStr route first, I think it works
13:45:34nixfreak_nim[m]var s: set[char] = {'d' .. 'f', '!'}... (full message at https://libera.ems.host/_matrix/media/r0/download/libera.chat/5a3d28bd29d50acd8039de1e66e9485daeead978)
13:46:30PMunchWorks fine for me running it locally
13:46:50nixfreak_nim[m]and running 1.4.8 ?
13:47:04PMunch2.6.0
13:47:07PMunch1.6.0*
13:47:26NimEventerNew thread by Didlybom: Error: type mismatch: got <End>, see https://forum.nim-lang.org/t/8561
13:47:26nixfreak_nim[m]let me try 1.6.0
13:47:28PMunchJust tested with 1.4.8 as well, and it works fine there as well
13:47:38nixfreak_nim[m]I don't get it then
13:48:20PMunchMaybe you've added some hidden characters in your file by accident?
13:48:58PMunchI get sha256 4a1142b3360227f0a8246cb81dae73da2e072d870f788b6f984bcb06c6bd8d4e on the file with the content copied from the playground
13:49:26NimEventerNew thread by Didlybom: Forum issue when creating a thread, see https://forum.nim-lang.org/t/8562
13:51:44*nixfreak_nim[m] uploaded an image: (154KiB) < https://libera.ems.host/_matrix/media/r0/download/matrix.org/PUUKeRSDJzhNZGwUGtoBayvv/image.png >
13:51:57FromDiscord<galen> In reply to @PMunch "<@121291582367334400>, try the paramStr": Only returns the name of the executable 🀷
13:52:49PMunchWith a `for i in 0..paramCount: echo paramStr(i)` loop?
13:53:10*nixfreak_nim[m] uploaded an image: (250KiB) < https://libera.ems.host/_matrix/media/r0/download/matrix.org/HrbfZxhBBIGgRbCRRDkoOgFB/image.png >
13:54:11FromDiscord<galen> In reply to @PMunch "With a `for i": πŸ™ πŸ™ the paramCount was 1 so I figured paramStr(0) would be the only valid thing to do, I do get the file now, thank you!
13:54:37nixfreak_nim[m]is it nim-suggest having issues , but then why won't it compile ?
13:55:42PMunch@galen, yeah this is a bit goofy. You have 1 extra parameter in addition to your filename which is always included
13:55:57nixfreak_nim[m]I need to get ready for work , bbl
13:57:00FromDiscord<galen> In reply to @PMunch "<@121291582367334400>, yeah this is": Ah, the more I know! Thanks again stranger!!!!!!
13:57:53PMunchNo problem :)
13:57:55FromDiscord<Illusive> So
13:58:18FromDiscord<Illusive> I am currently writing a discord bot with usage of dimscmd and dimscord.
13:58:26FromDiscord<Illusive> I would like to let the user fill some varitables
13:58:36FromDiscord<Illusive> and then program will run with his varitables
13:58:58PMunchSo a configuration file?
13:59:05FromDiscord<hmmm> hi boyz
13:59:16FromDiscord<Illusive> In reply to @PMunch "So a configuration file?": Not really a best choice
13:59:25FromDiscord<hmmm> how do I append elements to a seq of seq matrix thingie
13:59:40FromDiscord<Rika> I made something like that but you still need an evaluator for your β€œscript”
13:59:48FromDiscord<hmmm> let's say that every seq must have 5 elements
13:59:51FromDiscord<Rika> What are you thinking of running? Math? Full script?
14:00:07FromDiscord<Rika> Sequences cannot be given a size invariant easily
14:00:31FromDiscord<Rika> You must check yourself (with a macro or manually or whatever)
14:00:35FromDiscord<hmmm> rika sama don't talk difficoult to me
14:00:52FromDiscord<Illusive> sent a code paste, see https://play.nim-lang.org/#ix=3Dhc
14:05:55*PMunch quit (Quit: Leaving)
14:07:01FromDiscord<hmmm> ah it was simple, I just x.add(seq) to the seq[seq] thingie
14:08:29FromDiscord<Illusive> tbh i am not sure how to figure out about my problem i have in my case
14:09:22FromDiscord<Rika> I have no idea what you mean
14:09:48FromDiscord<Rika> You want to concatenate strings to create a command?
14:10:21FromDiscord<Illusive> Yeah
14:19:18FromDiscord<hmmm> with the new imports like std/strutils can I still do something like from strutils import parsefloat
14:20:10FromDiscord<enthus1ast> @Illusive\:https://nim-lang.org/docs/strformat.html
14:28:11FromDiscord<Illusive> thanks, but s1 and d1 variatble should be defined by the user who uses the bot
14:29:00FromDiscord<enthus1ast> so they're unknown on compiletime?
14:32:21FromDiscord<Illusive> we can say yes
14:32:29FromDiscord<enthus1ast> then\: ↡https://nim-lang.org/docs/strutils.html#%25%2Cstring%2CopenArray%5Bstring%5D
14:34:19FromDiscord<Illusive> and by idea dimscord will let user fill the variatble right?
14:34:56FromDiscord<enthus1ast> i do not understand
14:37:28FromDiscord<Illusive> When the bot is deployed, and user uses the command `/copy` it should tell the user to fill `s1` varitable then after user filled it it will ask to fill the variatble `d1` . After user filled all variatbles it will execute the command which is specified in python code by `proc` variatble.
14:37:51FromDiscord<enthus1ast> ok so only the value is not known at compile time.
14:38:10FromDiscord<enthus1ast> the user is not able to define a `z4` variable right?
14:38:15FromDiscord<Illusive> Yeah
14:38:23FromDiscord<enthus1ast> ok then you can go with strformat
14:38:59FromDiscord<Illusive> about filling the variatbles the discord bot will ask to do that in discord itself
14:40:06FromDiscord<enthus1ast> so discord gives you a string ala\:↡↡/copy foo baa d1=baa zaa s1=traa
14:40:08FromDiscord<enthus1ast> ?
14:41:04FromDiscord<Illusive> `/copy s1:"foo" d2:"bar"`
14:41:19FromDiscord<enthus1ast> and this you will get as a string?
14:41:57FromDiscord<Illusive> It will get the string and then pass it to the `proc` variatble which has the specified command
14:43:02FromDiscord<enthus1ast> yes so then you must tokenize and parse the string that discord gives you and fill the desired variables and call you run process code
14:47:07FromDiscord<Illusive> any idea how?
14:47:39FromDiscord<Illusive> apart from strutils and strformat docs
14:48:40FromDiscord<enthus1ast> Are " allowed inside the strings you pass to the variables?
14:49:56FromDiscord<enthus1ast> Well you could do it with the strscan or the parseutils or the various regex modules
14:50:10FromDiscord<enthus1ast> Or even a split could be enough
14:56:15FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3Dho
14:56:29FromDiscord<enthus1ast> outputs\:↡`my s1:foo my d2:bar`
14:58:39FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3Dhp
15:00:12FromDiscord<Rika> you cant receive the raw message with slash commands
15:02:52FromDiscord<Illusive> https://bin.snopyta.org/?f05e0415667f80b2#F3AgY2B59KwrphHzs8hknJ8gFVwmdtoXRwmYK2Tuk5HU
15:02:57FromDiscord<Illusive> here is the whole thing
15:03:45FromDiscord<Rika> can you define the variable name? i assume not?
15:06:36FromDiscord<Illusive> ?
15:07:35FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3DhK
15:08:27FromDiscord<enthus1ast> so i guess a`md.addSlash("copy") do (s1: string, d2: string)`should do it?
15:08:49FromDiscord<enthus1ast> cmd
15:08:56FromDiscord<Rika> yes
15:17:36FromDiscord<Illusive> Damn
15:17:42FromDiscord<Illusive> Now my code screams with lots of errors
15:17:52FromDiscord<Rika> which is
15:19:28FromDiscord<Illusive> https://bin.snopyta.org/?432f7050dcc4f385#AUYzp1Qqq9QbjPxoMLsaVENpxf8PfB5bpjnrVNkJFeKB
15:21:37FromDiscord<Rika> `"GC:{$s1}"` should be `&"GC:{s1}"` same with the other one
15:21:40NimEventerNew thread by Vsajip: Trying to unify an object model, see https://forum.nim-lang.org/t/8563
15:22:13FromDiscord<tandy> https://github.com/drellem/bitboard
15:22:16FromDiscord<tandy> this is cool
15:22:44FromDiscord<Rika> what is that
15:23:19FromDiscord<tandy> a nice way for storing checkers board represenation
15:23:22FromDiscord<Illusive> sent a code paste, see https://play.nim-lang.org/#ix=3DhP
15:23:38FromDiscord<tandy> https://www.3dkingdoms.com/checkers/bitboards.htm
15:23:53FromDiscord<Rika> i guess its cool
15:23:55FromDiscord<tandy> i dont think u can do padded arrays in nim
15:24:05FromDiscord<tandy> so il try make this work for my checkers game
15:24:38FromDiscord<Rika> wdym?
15:24:45FromDiscord<Rika> you can align types in nim
15:26:16FromDiscord<tandy> huh how
15:27:13FromDiscord<tandy> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-align-pragma
15:33:52FromDiscord<hmmm> hoy doods is there a version of strutils find that is case insensitive
15:34:00FromDiscord<Rika> ?
15:34:03FromDiscord<Rika> example
15:35:02FromDiscord<hmmm> From the manual: "Searching is case-sensitive. If sub is not in s, -1 is returned. Otherwise the index returned is relative to s[0], not start. Use s[start..last].find for a start-origin index."
15:37:16FromDiscord<Rika> no
15:37:26FromDiscord<Rika> convert everything to lowercase then search is the easy way out
15:38:36FromDiscord<hmmm> wot
15:38:57FromDiscord<hmmm> is this the official way people do things when searching for case insensitive stuff?
15:39:01FromDiscord<Rika> no
15:39:12FromDiscord<Rika> i said its the easy way not the common way
15:39:15FromDiscord<haxscramper> there is no "official way people do things when searching for case insensitive stuff"
15:39:19FromDiscord<hmmm> what is the common way :3
15:39:24FromDiscord<Rika> i dont know
15:39:52FromDiscord<hmmm> Rika sometimes I love you but sometimes I love you a bit less
15:40:01FromDiscord<Rika> thanks, i dont care
15:40:04FromDiscord<haxscramper> `let start = sentence.toLowerAscii().find("word".toLowerAscii()); sentence[start .. <something>]`
15:40:16FromDiscord<haxscramper> done
15:40:38FromDiscord<hmmm> hmm
15:40:40FromDiscord<haxscramper> well, I haven't compiled it, but anyway there is no "official" way for writing 1-2 lines of code
15:40:44FromDiscord<Rika> (if you still need a disclaimer, i am joking)
15:40:46FromDiscord<hmmm> ok I'll try lowering the cases
15:44:38nixfreak_nim[m]Ok I figured it out , you can't use single quotes , you have to use double quotes for echo " "
15:45:10nixfreak_nim[m]but still doesn't make sense why it worked on playground and not emacs and nvim
15:45:50FromDiscord<haxscramper> how it worked on playground?
15:45:58FromDiscord<haxscramper> `echo ' '` is valid though
15:45:58FromDiscord<enthus1ast> Maybe a different nim version? ↡echo a char should work afaik
15:46:17nixfreak_nim[m]I used both versions 1.4.8 and 1.6.0
15:46:44FromDiscord<Rika> can you send the playground link or have you sent it before
15:46:47FromDiscord<enthus1ast> What you mean not emacs and nim?
15:46:58FromDiscord<enthus1ast> Nvim
15:47:06nixfreak_nim[m]neovim and Emacs
15:47:11nixfreak_nim[m]I used both IDE
15:47:43nixfreak_nim[m]* both IDE's to and used emcas plugin to compile
15:48:45FromDiscord<enthus1ast> Yes, so it does not compile when you write this code in emacs or nvim?
15:49:10nixfreak_nim[m]it errors out yes , unless I change the single quotes or double
15:49:15nixfreak_nim[m]s/or/to/
15:49:31nixfreak_nim[m]brb need to update element
15:49:44FromDiscord<Rika> is whats inside the quotes one character or more
15:49:51FromDiscord<haxscramper> what is the error
15:49:59FromDiscord<Rika> the whole error
15:55:17FromDiscord<hmmm> yea rika it works, also the python dudes do the same
15:55:25FromDiscord<hmmm> so we can say now it's the official way
15:56:29FromDiscord<enthus1ast> No this will be totally unperformant
15:56:38FromDiscord<enthus1ast> For larger datasets
15:56:48FromDiscord<hmmm> they have the prettier lower instead of the toLowerAscii monstrosity tho
15:57:00FromDiscord<haxscramper> you need to do what exactly? Find word in a sentence in case-insensetive way?
15:57:24nixfreak_nim[m]Since deleting the whole line I can't recreate it, sorry. There must of been something there I couldn't see
15:57:25FromDiscord<hmmm> I have a dataset and I want to search a column for substrings
15:57:56FromDiscord<enthus1ast> And how bis is the dataset?
15:58:08FromDiscord<hmmm> absolutely tiny lol
15:58:12FromDiscord<haxscramper> I wanted to suggest just copying `find` from stdlib and then replacing `str[idx] == word[idx2]` with case-insensetive compare
15:58:16FromDiscord<enthus1ast> Big
15:58:19FromDiscord<haxscramper> but then I looked into implementaiton of find
15:58:42FromDiscord<haxscramper> and holy shit I do not recommend to even look at it
15:58:55FromDiscord<enthus1ast> Then it's fine I guess πŸ˜β†΅(@hmmm)
15:58:56FromDiscord<haxscramper> what in the world is `hasCStringBuiltin` even
15:59:55FromDiscord<hmmm> I trust our find is on par with python find or I will personally call the manager and they will hear me
16:01:41FromDiscord<haxscramper> https://forum.nim-lang.org/t/447
16:01:53FromDiscord<haxscramper> https://forum.nim-lang.org/t/1730
16:09:44FromDiscord<Rika> In reply to @hmmm "they have the prettier": theres a reason its named like that
16:12:59FromDiscord<hmmm> the reason would be they like aesthetics and we like monsters and vampires?
16:17:28FromDiscord<Rika> no, its more explicit that it doesnt handle unicode (obviously) and that it is not inplace
16:33:42*mahlon quit (Read error: Connection reset by peer)
16:34:24*mahlon joined #nim
16:39:20*[R] quit (Quit: No Ping reply in 180 seconds.)
16:39:27*[R] joined #nim
16:48:59FromDiscord<Bung> hi I'v written a mysql driver in nim , there's problem when handle concurrent requests , the driver need increase squence number one send and receive round , when two pendding requests it becoming a problem , any suggestion ?
17:07:50FromDiscord<saviorcyberteam> Everybody Can Obtain The New Trillion Dollar Crypto Coin Whitepapers To Become A Millionaire Easily↡https://saviorsfromcyber.com/economy/2021/everybody-can-obtain-the-new-trillion-dollar-crypto-coin-whitepapers-to-become-millionaire-easily/
17:08:17FromDiscord<Rika> lol
17:08:29FromDiscord<Rika> <@&371760044473319454> do you think you can do anything about this? i dont know
17:08:46FromDiscord<dom96> lol, gotta love these bridges
17:08:55FromDiscord<Rika> triple the spam
17:08:59FromDiscord<dom96> !ban saviorcyberteam
17:09:19FromDiscord<dom96> !matrix
17:09:21FromDiscord<matrix-appservice-discord-t2bot> sent a long message, see http://ix.io/3qay
17:09:29FromDiscord<dom96> !matrix ban saviorcyberteam
17:09:39FromDiscord<matrix-appservice-discord-t2bot> sent a long message, see http://ix.io/3Din
17:09:43FromDiscord<Rika> bruh
17:09:58FromDiscord<dom96> well, it gave an error, so... I dunno if it worked
17:13:19*Ekho quit (*.net *.split)
17:15:30*Ekho- joined #nim
17:23:41*Ekho- is now known as Ekho
17:59:24*PMunch joined #nim
18:03:17FromDiscord<leorize> it didn't↡(@dom96)
18:03:47FromDiscord<dom96> yeah, I still need to give the bridge mod perms I guess
18:04:48FromDiscord<dom96> but I still get this error... https://media.discordapp.net/attachments/371759389889003532/903705942200303756/unknown.png
18:17:08FromDiscord<leorize> it means that A and B was the same type, I'll look into it in a bit
18:17:35FromDiscord<leorize> the error was intended to catch early bugs but it might be causing problem
18:48:27*anjovi joined #nim
18:50:11anjovianyone played with httpclient.AsyncHTTPClient recently? how do I access the response body that came after 30x? body() always gives me the body that from before the redirect
18:50:49FromDiscord<Rika> set redirects to 0 and read the body
18:50:56FromDiscord<Rika> `newHttpClient(maxRedirects = 0)`
18:51:46anjoviand then what? req the Location myself?
18:52:07FromDiscord<Rika> oh
18:52:08FromDiscord<Rika> misread
18:52:10FromDiscord<Rika> or misunderstood
18:52:14anjoviah
18:52:21FromDiscord<Rika> how many redirects does it do
18:52:33anjovione
18:52:48anjoviwell, I'm assuming. wait, I'll check for sure quick
18:53:12FromDiscord<Rika> i think i know whats wrong
18:53:37FromDiscord<Rika> do `await response.bodyStream.readAll` instead i guess
18:53:44anjoviok, yes, a single redirect. http://blah.tld gets 301 to https://blah.tld
18:53:52anjoviI'll try that
18:54:01FromDiscord<Rika> needs `import streams` afaik
18:54:02FromDiscord<Rika> sorry
19:01:43*vicfred joined #nim
19:04:48anjovi(taking awhile (FutureStream giving me all sorts of trouble))
19:14:19anjoviRika: how sure are you about that? streams.readAll() wont accept FutureStream[string], which AsyncResponse.bodyStream is
19:14:42FromDiscord<Rika> bodyStream is not a string
19:14:45FromDiscord<Rika> its in the name
19:18:51anjoviI meant it wont compile because readAll() expects Stream and bodyStream isn't (of Stream type)
19:22:56NimEventerNew thread by Wwderw: Linking on Linux and Windows, see https://forum.nim-lang.org/t/8564
19:25:38FromDiscord<Rika> ah
19:25:46FromDiscord<Rika> anjovi: asyncstreams not streams mb i didnt realise
19:30:01anjoviRika np
20:11:06FromDiscord<dom96> wow, https://github.com/dom96/httpbeast/pull/63
20:11:50FromDiscord<dom96> Just benchmarked it. It sends httpbeast from 870k QPS to 1.2 million QPS!
20:13:03FromDiscord<Recruit_main707> with just that?
20:13:05FromDiscord<Recruit_main707> damn
20:13:38FromDiscord<dom96> yeah, crazy
20:14:17FromDiscord<dom96> but not altogether unexpected, I haven't done any profiling of it so not surprising there are low hanging fruit here
20:18:18FromDiscord<Elegantbeef> The nice part is seeing my porting effort of hottie getting use πŸ˜€
20:19:55FromDiscord<Rika> now does &"" look better + work just as fast i do wonder
20:19:57FromDiscord<Imperatorn> Ppl sat I should write Rust instead. Please convince me why Nim is better
20:20:08FromDiscord<Imperatorn> (edit) "sat" => "say"
20:20:32FromDiscord<Rika> did they convince you why rust is better?
20:20:36FromDiscord<Rika> if not why should we
20:21:03FromDiscord<Imperatorn> Hmm, because they might be lying
20:21:14FromDiscord<Imperatorn> Rust is "hyped"
20:21:23FromDiscord<Imperatorn> They might be high and blinded
20:22:09FromDiscord<Imperatorn> Seems like ppl say "use Rust" whatever you say.↡↡"Need to fix your marriage? Use Rust"
20:22:41FromDiscord<Elegantbeef> There is the misconception Rust makes it impossible to write bugs
20:22:52FromDiscord<Elegantbeef> It makes it harder but it's still possible
20:23:00FromDiscord<Imperatorn> Yeah
20:23:11FromDiscord<Imperatorn> Like I took a look at the cves lol
20:23:42FromDiscord<Rika> it makes it harder to write anything
20:23:43FromDiscord<Imperatorn> https://www.cvedetails.com/vulnerability-list.php?vendor_id=19029&product_id=48677&version_id=0&page=1&hasexp=0&opdos=0&opec=0&opov=0&opcsrf=0&opgpriv=0&opsqli=0&opxss=0&opdirt=0&opmemc=0&ophttprs=0&opbyp=0&opfileinc=0&opginf=0&cvssscoremin=0&cvssscoremax=0&year=0&month=0&cweid=0&order=1&trc=19&sha=95e4d3703da65f4f319b5bfa6167ff26c6a83c13
20:23:51FromDiscord<Elegantbeef> Personally i prefer the terseness of the language over Rust, it's easier to read and understand
20:24:50FromDiscord<Imperatorn> Yes
20:25:01FromDiscord<Rika> how did they convince you to use rust
20:25:10FromDiscord<Imperatorn> They did not
20:25:31FromDiscord<Rika> then why did you as
20:25:33FromDiscord<Rika> (edit) "as" => "ask"
20:26:33FromDiscord<Imperatorn> I'm just saying they want me to write Rust instead. I'm on the fence. Half-sensible ppl. But the syntax is pain
20:26:56FromDiscord<Imperatorn> Nim seems to me like a productive language
20:27:02FromDiscord<Rika> well why are you sold on rust
20:27:50FromDiscord<Rika> and why are you not sold on nim
20:28:03FromDiscord<Imperatorn> I'm not really. It's just a general question. Why would an unspecified individual choose Nim over Rust in general
20:28:28FromDiscord<Imperatorn> I'm not sold on Rust
20:28:48FromDiscord<Rika> there are many reasons which depend on the individual
20:29:23FromDiscord<Imperatorn> Ok, let's take it like this
20:29:30FromDiscord<Imperatorn> Memory management
20:29:37FromDiscord<Rika> i guess the general consensus is if you value your time, use nim, if its absolutely imperative to have no bugs, use rust
20:30:07FromDiscord<Imperatorn> That's a good decision model
20:30:22*PMunch quit (Quit: leaving)
20:30:24FromDiscord<Rika> that isnt to say that nim can get really close to rust wrt bugs but its not there yet
20:30:25FromDiscord<Elegantbeef> Nim is memory safe, though has nil, which requires either `wrapnils` `option` or memory that things are nilable πŸ˜€
20:30:29FromDiscord<Rika> (edit) "can" => "cant"
20:30:45FromDiscord<Imperatorn> In general I value time over safety
20:30:54FromDiscord<Elegantbeef> Yea i mean we have subrange types which allow you to catch other bugs
20:30:57FromDiscord<Imperatorn> I'm used to null so no biggie
20:31:11FromDiscord<Imperatorn> What safety features does Nim have?
20:31:27FromDiscord<Imperatorn> Like for example in D there's the @safe attribute
20:31:32FromDiscord<Rika> im still waiting on defaults+init fixes
20:31:40FromDiscord<Rika> In reply to @Imperatorn "Like for example in": which does what
20:32:48FromDiscord<Imperatorn> sent a long message, see http://ix.io/3DiY
20:33:04FromDiscord<Rika> let me see
20:33:45FromDiscord<Rika> nim unsafe features are basically just `cast` and `addr`/`unsafeAddr` (both are unsafe even if one doesnt say it is)
20:33:56FromDiscord<Rika> i guess also `ptr`/`pointer` of course
20:34:30FromDiscord<Rika> so no matter what, you can consider any usage of cast and others as unsafe
20:34:41FromDiscord<Rika> so its really simple to disallow it
20:34:56FromDiscord<Imperatorn> gshared means traditional global basically
20:35:13FromDiscord<Elegantbeef> Yea that keyword really just seems to be "our semantics are difficult to follow, so we need a keyword"
20:35:17FromDiscord<Rika> globals arent considered "unsafe" but they are considered "gc unsafe"
20:35:33FromDiscord<Rika> what is a void initialiser
20:35:34FromDiscord<Imperatorn> The weird name is because you shouldn't use it basically πŸ˜…
20:35:38FromDiscord<Rika> oh yeah
20:35:55FromDiscord<Imperatorn> void init is uninitialized memory
20:35:57FromDiscord<Rika> okay six unsafe stuff, the ones listed above PLUS `emit` i guess
20:36:10FromDiscord<Imperatorn> By default all variables in D has default values
20:36:25FromDiscord<Rika> same with nim, but currently it is just zeroed memory]
20:36:34FromDiscord<Rika> waiting on the RFCs for default
20:36:40FromDiscord<Imperatorn> πŸ‘Œ
20:36:56FromDiscord<Rika> `When indexing or slicing an array, an out of bounds access will cause a runtime error.` is default on -d:release
20:37:21FromDiscord<Rika> `No inline assembler` can be grepped with `asm`
20:37:36FromDiscord<Rika> `No catching of exceptions that are not derived from class Exception.` completely impossible in nim afaik?
20:37:43FromDiscord<Imperatorn> So, Nim is a bit "safe" by default?
20:37:46FromDiscord<Rika> `Calling any System Functions.` what does this even mean?
20:38:06FromDiscord<Elegantbeef> Yea rika i dont think s
20:38:08FromDiscord<Rika> `No pointer arithmetic (including pointer indexing).` impossible by default in nim without importing a (third party afaik) module
20:38:37FromDiscord<Rika> unions are still unsafe in nim so eh
20:38:49FromDiscord<Rika> i guess theres a lot to grep to check for unsafe features in nim
20:38:52FromDiscord<Elegantbeef> Well unions are inherently unsafe
20:38:57FromDiscord<Rika> but its not "we need a new keyword" level
20:39:00FromDiscord<Elegantbeef> So dont use unions, use tagged unions
20:39:22FromDiscord<Imperatorn> Sorry, safe is an attribute as well
20:39:34FromDiscord<Imperatorn> sent a long message, see http://ix.io/3DiZ
20:40:39FromDiscord<Imperatorn> (edit) "safe" => "system"
20:41:53FromDiscord<Rika> i still have no idea what those are
20:41:59FromDiscord<Rika> is that like
20:42:09FromDiscord<Rika> poor mans effect tracking
20:42:30FromDiscord<Elegantbeef> It seems like it, poormans strict effects/funcs
20:42:34FromDiscord<Imperatorn> https://dlang.org/spec/function.html#system-functions
20:42:37FromDiscord<Rika> nim has effect tracking so you can check if it raises
20:42:45FromDiscord<Rika> or if it uses stdout/in/err
20:42:59FromDiscord<Rika> (well not precisely, that was just an example)
20:44:07FromDiscord<Rika> i guess there should be an effect for unsafe stuff like `cast` `asm` `emit` etc
20:44:13FromDiscord<Rika> might be nice
20:44:17FromDiscord<Rika> or useful too
20:44:25FromDiscord<Rika> i have to go, its like 6 am right now
20:44:29FromDiscord<Imperatorn> PR coming 😍
20:44:33FromDiscord<Imperatorn> Oh damn
20:44:34FromDiscord<Imperatorn> Sleep
20:44:49FromDiscord<Imperatorn> Thanks for your time!
20:45:45FromDiscord<Rika> beef go take over
20:46:08FromDiscord<Elegantbeef> Uhh Rust bad, use Nim
20:46:12FromDiscord<Elegantbeef> Did i do it right?
20:46:47FromDiscord<Recruit_main707> nailed it
20:47:38FromDiscord<Imperatorn> Just a quick anecdote.↡↡Some time ago I tried like 50 languages. Wanted to do a simple rest-client thing. Json. It was the only language of those about 40-50 that just worked tm. And I actually understood what I was doing. And was fast
20:48:28FromDiscord<Imperatorn> So my and Nim already have a past. But I need to go from friends with benefits to something more
20:50:30FromDiscord<Imperatorn> I don't know where I should start. Is there a "Nim tour" or something?↡↡I want to skip the most basic stuff, but not jump right into thousand-dimensional self-modifying metamorphic self healing code
20:51:28mstI read through the language spec (because I like doing that) and my next step is probably going to be reading the source code to nitter since I probably understand the domain decently
20:53:52FromDiscord<Rika> Reading source code is okay until you read the fucked ones
20:54:00FromDiscord<Rika> Not gonna name any names
20:54:06FromDiscord<Imperatorn> Lol, yeah
20:54:24FromDiscord<Imperatorn> I want to learn right from the beginning
20:54:26FromDiscord<Rika> Not just because rude but also because I don’t know who the fuck I would name either
20:54:32FromDiscord<Rika> There’s a book
20:54:36FromDiscord<Rika> It’s on manning
20:54:38FromDiscord<Rika> I think
20:54:56FromDiscord<Imperatorn> I'll take a look, thanks
20:55:12mstRika, I do a lot of reading source code to learn stuff and I can absolutely confirm that sometimes what I learn from a given thing's source code is a whole list of things to never inflict on other developers ever :D
20:55:42FromDiscord<Imperatorn> Let's put it like this
20:56:16FromDiscord<Imperatorn> Can you point me to some well written medium-sized Nim project(s)?
20:56:52FromDiscord<Rika> Anything with a few tens of stars should do
20:57:41nrds<Prestige99> not sure if it would help but have you seen nep1?
21:10:11*stkrdknmibalz joined #nim
21:18:17FromDiscord<exelotl> In reply to @Imperatorn "I don't know where": personally I like Nim By Example the most: https://nim-by-example.github.io/getting_started/
21:23:15FromDiscord<exelotl> on the flipside, I absolutely hate Learn Nim in Y Minutes xD
21:23:48FromDiscord<Recruit_main707> sent a code paste, see https://play.nim-lang.org/#ix=3Djj
21:25:20FromDiscord<Elegantbeef> No it cannot tried solving that for prestige and just ended up making a proc that unpacks it to the type
21:25:33FromDiscord<Elegantbeef> Cant even cast it to work afaik
21:26:35FromDiscord<Recruit_main707> that sucks :(↡↡i guess methods would do for most cases, but i am passing the function pointers to c++ and i dont even want to get into that hole
21:27:14FromDiscord<Elegantbeef> So the best thing to do is just make a template to make a lambda that unpacks it
21:27:55FromDiscord<Recruit_main707> im sorry but im gonna need an example to understand that πŸ˜…
21:31:35FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3Djm
21:31:43FromDiscord<exelotl> it seems I never run into this issue with my vtable system because I {.exportc.} the procs and {.emit.} the tables containing the procs, and C just allows it.
21:31:48FromDiscord<Elegantbeef> Prestige you might want to look at that aswell, might be a cleaner solution to your problem
21:32:42FromDiscord<Recruit_main707> does that work when you are doing it in different files?
21:33:00FromDiscord<Elegantbeef> I dont see why it wouldnt
21:33:07FromDiscord<Elegantbeef> templates are pasted at their callsite
21:33:21FromDiscord<Recruit_main707> i meant exelotl's solution
21:33:42FromDiscord<Elegantbeef> Remember C/C++ is just making one long file
21:34:20FromDiscord<exelotl> oh, mine is a pain to make work across files, but I got there eventually
21:34:31FromDiscord<Recruit_main707> the problem with what i did before was that certain types were defined in one file, and then even though i import them on the nim side, the c++ side doesnt (or something like that i am going crazy of staring at the generated code)
21:34:37FromDiscord<exelotl> https://forum.nim-lang.org/t/7827
21:35:24FromDiscord<Elegantbeef> You can still use the macro cache to get around it i think exelotl πŸ˜€
21:36:46FromDiscord<exelotl> I don't think macrocache can solve this, right? https://media.discordapp.net/attachments/371759389889003532/903759289208934410/unknown.png
21:37:22FromDiscord<Elegantbeef> Well you add the symbols to the table and access them from other modules, so as long as they're added first it doesnt matter since the symbols are looked up
21:37:36nrds<Prestige99> I missed it, what beef?
21:37:47FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3Djm this solution
21:37:57FromDiscord<Elegantbeef> I might misunderstand the issue and like using macro cache for all my solutions πŸ˜€
21:40:45nrds<Prestige99> ah yes, interesting
21:40:49nrds<Prestige99> that looks like it'll work
21:41:00FromDiscord<Elegantbeef> Less macro heavy and more auditable
21:42:01nrds<Prestige99> Thanks for keeping an eye out, this looks nice
21:43:49FromDiscord<Elegantbeef> Yea it's better than what i had πŸ˜›
21:44:33FromDiscord<Recruit_main707> thanks for the help btw beef, looking into it rn
22:01:05FromDiscord<leorize> [haxscramper](https://matrix.to/#/@haxscramper:matrix.org)\: I found the issue with union, `A` and `B` have `sameType()` evaluated to true
22:02:01FromDiscord<leorize> so I'm just gonna add a hack by evaluating deduplication of generic params by comparing symbols
22:02:21FromDiscord<leorize> just another day with Nim's typed macros
22:09:05FromDiscord<Elegantbeef> Yea macrocache does not help that issue exelotl πŸ˜€
22:16:10FromDiscord<Recruit_main707> xd made the compiler segfault
22:18:33FromDiscord<Recruit_main707> oh, made it compile, now pray it works
22:20:48FromDiscord<Recruit_main707> nvm im so dumb lol
22:32:57*Vladar quit (Quit: Leaving)
23:31:27*stkrdknmibalz quit (Ping timeout: 260 seconds)
23:32:35FromDiscord<no name fits> In reply to @Rika "Reading source code is": I felt a disturbance
23:32:57FromDiscord<no name fits> My excuse right now is, it's for a gamejam