<< 31-08-2021 >>

00:16:26FromDiscord<Alea> sent a code paste, see https://play.nim-lang.org/#ix=3xuE
00:18:59FromDiscord<RattleyCooper> Can you escape the quotes? `"\"src/nanovg.c\""`
00:20:55FromDiscord<Alea> no that seems to cause some other issue https://media.discordapp.net/attachments/371759389889003532/882057322816503848/unknown.png
00:24:40*watzon1 joined #nim
00:24:58FromDiscord<RattleyCooper> Escapes and `strformat` don't like to play together
00:25:14FromDiscord<RattleyCooper> You may need to escape the quotes outside the `fmt`
00:25:51FromDiscord<RattleyCooper> Beyond that I'm not sure how to do it
00:28:46FromDiscord<impbox [ftsf]> try using & instead of fmt
00:28:47FromDiscord<Alea> sent a code paste, see https://play.nim-lang.org/#ix=
00:29:34FromDiscord<Alea> do I need the c lib installed for this?
00:29:51FromDiscord<Alea> It kind of seemed like the nim version came with the c version packaged
00:30:56FromDiscord<impbox [ftsf]> how did you install nim?
00:31:26FromDiscord<impbox [ftsf]> if you can build with nim you've probably got a c build environment set up
00:32:26FromDiscord<Alea> sent a code paste, see https://play.nim-lang.org/#ix=3xuF
00:32:35FromDiscord<Alea> which makes it seem like something on the c side is missing
00:33:25FromDiscord<impbox [ftsf]> it is, the linker can't find that function
00:33:49FromDiscord<impbox [ftsf]> could be you're not linking to the library that contains it
00:34:45*watzon1 quit (Quit: watzon1)
00:35:05*watzon joined #nim
00:35:51FromDiscord<Alea> The function seems to be defined in one of the packaged .h files
00:36:09FromDiscord<Alea> is there something specific I need to compile with to link it?
00:37:19FromDiscord<impbox [ftsf]> i'm not familiar with that library, are you using nim-nanovg?
00:37:37FromDiscord<Alea> yeah
00:39:40FromDiscord<impbox [ftsf]> can you build the demo?
00:40:44FromDiscord<Alea> installed through nimble, so I haven't got the whole repo cloned
00:41:12FromDiscord<Alea> but I'll say no because I just copied out a section of the demo to test
00:41:23FromDiscord<Alea> so if that doesn't work...
00:42:18FromDiscord<impbox [ftsf]> i'd clone the repo and try running `nimble examples` as suggested and see if that works
00:42:57FromDiscord<Bren> What is the simplest way to use regex in a conditional?
00:43:26FromDiscord<impbox [ftsf]> (edit) "i'd clone the repo and try running `nimble examples` as suggested and see if that works ... " added "(looks like it's `nimble examplesGL3` now"
00:44:13FromDiscord<impbox [ftsf]> @bren what is the condition you want to check?
00:44:46FromDiscord<Elegantbeef> as someone that avoids regex, what's the pattern?
00:44:47FromDiscord<Elegantbeef> Also which regex
00:47:11FromDiscord<Bren> sent a code paste, see https://play.nim-lang.org/#ix=3xuJ
00:47:30FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3xuK
00:48:41FromDiscord<impbox [ftsf]> `if "ABCD1234".match(re"[a-zA-Z0-9]{8}").isSome:`
00:49:19FromDiscord<Bren> what about false
00:49:24FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3xuM
00:49:28FromDiscord<Elegantbeef> Atleast i think `{8}` is length
00:49:42FromDiscord<impbox [ftsf]> @bren `if not ...`
00:49:48FromDiscord<impbox [ftsf]> or `.isNone`
00:49:55FromDiscord<Bren> cool sorry
00:50:02FromDiscord<Elegantbeef> `isNone` is the better way
00:50:24FromDiscord<impbox [ftsf]> or add an else section
00:50:40FromDiscord<Bren> That is why I asked
00:50:40FromDiscord<Bren> thank you
00:51:56FromDiscord<impbox [ftsf]> hmm are static res compiled at compiletime i wonder?
00:52:08FromDiscord<Elegantbeef> I'm going to go find duct tape so i can prevent myself insulting regex for a bit 😀
00:52:23FromDiscord<Elegantbeef> `re` cannot be used at CT
00:52:54FromDiscord<Elegantbeef> nim regex is what you'd use for compile time
00:53:42FromDiscord<impbox [ftsf]> i mean, compiling the re at compile time to use at runtime
00:54:08FromDiscord<impbox [ftsf]> _doesn't really care since they don't use re much_
00:54:18FromDiscord<Elegantbeef> !eval import std/nre; const match = re"Hello"
00:54:20NimBotCompile failed: /playground/nim/lib/impure/nre.nim(280, 25) Error: cannot 'importc' variable at compile time; compile
00:54:31FromDiscord<impbox [ftsf]> but i imagine it'd be handy if you used regular expressions a lot for say a webserver or something
01:15:14FromDiscord<RattleyCooper> Ok, so my Rpi4 version of Nim throws this error when I try to use `netty`. The conversion of a `uint32` to `int` is invalid for some reason?
01:15:23FromDiscord<RattleyCooper> `Error: conversion from uint32 to int is invalid`
01:15:51FromDiscord<Elegantbeef> is the rpi4 64 bit?
01:15:56FromDiscord<RattleyCooper> sent a code paste, see https://play.nim-lang.org/#ix=3xuS
01:16:28FromDiscord<RattleyCooper> The chip is but I have 32bit os installed bc apparently the official 64bit os isn't really working well
01:16:48FromDiscord<Elegantbeef> Well then there is your issue uint32.high \> int32.high
01:17:07FromDiscord<RattleyCooper> Ah, is there a way to update the code so it can work on 32bit and 64bit?
01:17:30FromDiscord<Elegantbeef> `.int64` instead of `int32`
01:17:45*neurocyte3 joined #nim
01:17:45*neurocyte3 quit (Changing host)
01:17:45*neurocyte3 joined #nim
01:17:54FromDiscord<RattleyCooper> instead of `uint32` or in place of the `int`?
01:19:57*neurocyte quit (Ping timeout: 250 seconds)
01:19:57*neurocyte3 is now known as neurocyte
01:21:53FromDiscord<Elegantbeef> in place of `int`
01:25:14FromDiscord<RattleyCooper> `reactor.r.rand(uint32.high.int64).uint32` now throws `conversion from int64 to Natural is invalid`
01:26:53FromDiscord<impbox [ftsf]> use int32 instead of int64
01:27:17FromDiscord<impbox [ftsf]> does `reactor.r.rand(uint32.high).uint32` work?
01:27:22FromDiscord<RattleyCooper> It's weird bc that throws the same error
01:27:24FromDiscord<RattleyCooper> `conversion from uint32 to int32 is invalid`
01:27:26FromDiscord<RattleyCooper> Let me see
01:27:30FromDiscord<impbox [ftsf]> sorry yes my mistake
01:28:10FromDiscord<RattleyCooper> Conversion to Natural is invalid. wth? lol
01:28:39FromDiscord<impbox [ftsf]> what's the full error?
01:28:51FromDiscord<Elegantbeef> natural is `high(int)`
01:29:05FromDiscord<RattleyCooper> /home/pi/.nimble/pkgs/netty-0.2.0/netty.nim(108, 24) Error: conversion from uint32 to Natural is invalid
01:29:15FromDiscord<Elegantbeef> do yourself a favour and do `rand(0u32..uint32.high)`
01:30:11FromDiscord<RattleyCooper> Hey, that worked!
01:31:26FromDiscord<RattleyCooper> Thanks for the help guys!
01:31:36FromDiscord<Elegantbeef> you also could do `rand(uint32)`
01:34:05*Pyautogui joined #nim
01:38:17FromDiscord<Bren> Whats a way I can get a random string of `[a-zA-Z0-9]` chars should I have some runes and select them with random until I get the length or is there a better way?
01:41:34FromDiscord<Elegantbeef> Here you go https://play.nim-lang.org/#ix=3xuX
01:41:56FromDiscord<impbox [ftsf]> https://play.nim-lang.org/#ix=3xuY
01:42:02FromDiscord<Elegantbeef> That uses the global state of course
01:42:35FromDiscord<Elegantbeef> Cmon impbox be quicker/cooler 😛
01:42:46FromDiscord<impbox [ftsf]> at least mine gives different results each time =p
01:43:07FromDiscord<Elegantbeef> Hey i'm not going to call randomize unless it's needed 😛
01:44:03*arkurious quit (Quit: Leaving)
01:53:23*Pyautogui quit (Quit: Connection closed)
01:55:20FromDiscord<RattleyCooper> Is there a big performance impact of setting the seed the random number generator?
01:56:09FromDiscord<impbox [ftsf]> no, but you should probably do it just once at the start of your app
01:57:20FromDiscord<RattleyCooper> Well in my procedural generation stuff I hash the coordinates of a tile and use it as an rng seed then roll a number between 0 and 1
01:57:30FromDiscord<RattleyCooper> For choosing tiles to spawn trees
01:57:45FromDiscord<RattleyCooper> That way it's always the same 😛
01:57:54FromDiscord<RattleyCooper> and I don't have to save the coordinates to a file
01:58:04FromDiscord<impbox [ftsf]> you could just do it once at the start of your procgen
01:58:10FromDiscord<impbox [ftsf]> with the procgen seed
01:58:12FromDiscord<impbox [ftsf]> rather than per tile
01:58:15FromDiscord<RattleyCooper> No, because if you wander back into the area
01:58:20FromDiscord<impbox [ftsf]> as long as you do each tile in the same order
01:58:21FromDiscord<cabboose> oh god I scrolled up too far and saw some python code
01:58:21FromDiscord<RattleyCooper> It will be different then the initial load
01:58:22FromDiscord<cabboose> vomit
01:58:24*auxym_ quit (Ping timeout: 244 seconds)
02:00:15FromDiscord<impbox [ftsf]> yeah that works, for that kind of thing i'd probably use a noise algorithm that takes a coordinate as input and returns a float
02:00:47FromDiscord<impbox [ftsf]> you set the seed for the noise once, then you can sample it at any point to get your output
02:00:52FromDiscord<RattleyCooper> In reply to @impbox "as long as you": Yeah, when I did my version I only had simplex noise to work with
02:01:18FromDiscord<RattleyCooper> So I either had to calculate a bunch of distances to keep the trees separated or just set the rng seed
02:02:33FromDiscord<RattleyCooper> but that was in godot. I want to try again with different noise algorithms bc I know they exist for placing trees.
02:03:01FromDiscord<impbox [ftsf]> for placing things like that check out possion disc sampling
02:03:19FromDiscord<impbox [ftsf]> (edit) "possion" => "poisson"
02:03:20FromDiscord<RattleyCooper> Gotcha!
02:04:09FromDiscord<impbox [ftsf]> combine that with simplex or perlin noise
02:04:37FromDiscord<RattleyCooper> Yeah, get some biome action going.
02:05:39FromDiscord<impbox [ftsf]> could do voronoi regions to define biome boundaries
02:05:48FromDiscord<impbox [ftsf]> lots of cool tools to play with in procgen
02:06:34FromDiscord<RattleyCooper> Never heard of that
02:06:52FromDiscord<RattleyCooper> I found poisson disk implementation in nim
02:06:53FromDiscord<RattleyCooper> https://github.com/nonvirtualthunk/nledgine/blob/f6329e8727864715dedc0b9256c81a4685b18cea/src/core/poisson_disk.nim
02:10:40FromDiscord<impbox [ftsf]> http://www-cs-students.stanford.edu/~amitp/game-programming/polygon-map-generation/
02:13:46FromDiscord<RattleyCooper> Oh nice, I am going to check this out right now 😄
02:45:40FromDiscord<retkid> anyway to send and receive without hosting 2 servers?
02:50:03FromDiscord<impbox [ftsf]> you only need one server and one client?
02:50:07FromDiscord<impbox [ftsf]> or just two clients peer to peer
02:53:37FromDiscord<retkid> I've been running a server on bothsides and encountering kernel issues
02:53:38FromDiscord<retkid> :\
02:54:35*sagax quit (Excess Flood)
02:54:36FromDiscord<impbox [ftsf]> which issues?
02:55:05FromDiscord<Elegantbeef> I'd wager trying to listen on the same socket as they're hosting on
02:55:16FromDiscord<retkid> its not a same socket issue
02:55:29FromDiscord<retkid> running multiple servers on the same IP in the same process
02:55:36FromDiscord<retkid> either way it wasn't needed
02:55:50FromDiscord<impbox [ftsf]> by server do you mean listening socket?
02:56:13FromDiscord<retkid> is there 1 socket per process
02:56:15FromDiscord<retkid> if so, yes
02:56:39FromDiscord<impbox [ftsf]> i don't know what you've done so i can't say, "server" is very vague
02:56:48FromDiscord<retkid> just socket listening
02:56:59FromDiscord<retkid> basic stuff just trying to get stuff to wkork
02:57:04FromDiscord<impbox [ftsf]> you can create many sockets on the same process
02:57:23FromDiscord<impbox [ftsf]> you'd only be limited by number of open files i guess which should be in the thousands
02:57:25FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=3xv9
02:57:28FromDiscord<retkid> (edit) "https://play.nim-lang.org/#ix=3xv9" => "https://paste.rs/e7S"
02:57:38FromDiscord<retkid> thats all i really got
02:57:52FromDiscord<impbox [ftsf]> ok, so you're using unix sockets?
02:58:05FromDiscord<impbox [ftsf]> and the socket file you're trying to open doesn't exist?
02:58:15FromDiscord<impbox [ftsf]> you'd need to create that socket file first
02:58:31FromDiscord<retkid> well, this problem only happens when i have the 2 servers running at the same time
02:58:36FromDiscord<impbox [ftsf]> or maybe you don't have permission to access it, not sure if that gets its own error
02:58:43FromDiscord<retkid> either way
02:58:46FromDiscord<retkid> im doing it the wrong way
02:59:08FromDiscord<impbox [ftsf]> `/var/run/nscd/socket` is this something you created?
02:59:19FromDiscord<retkid> no
02:59:41FromDiscord<impbox [ftsf]> "Nscd is a daemon that provides a cache for the most common name service requests"
02:59:48FromDiscord<impbox [ftsf]> are you doing domain name lookups?
03:00:28FromDiscord<impbox [ftsf]> also, what's the actual problem that happens when you do what?
03:02:35FromDiscord<retkid> In reply to @impbox "are you doing domain": something to do with threading and spamming connecting but i'm looking into doing a P2P and if not i'll do threading with stdin and stdout
03:15:33*rockcavera quit (Remote host closed the connection)
03:23:53*Guest19 joined #nim
03:24:09*Guest19 quit (Client Quit)
04:01:47FromDiscord<SandwichBop> Nim looks really comfy and want to get into it, but I'm curious to why you all use it?
04:01:56FromDiscord<SandwichBop> (edit) "it?" => "it/what projects do u often use it for?"
04:02:35FromDiscord<SandwichBop> (edit) "it/what" => "over other langs in the first place? what"
04:06:01*supakeen quit (Quit: WeeChat 3.2)
04:06:30*supakeen joined #nim
04:08:19FromDiscord<Rika> everything, because its one of the only languages i seriously enjoy writing stuff in
04:09:20FromDiscord<SandwichBop> that's great to hear, I plan on doing the same
04:09:28FromDiscord<SandwichBop> it looks so neat, just wish it were more popular
04:09:43FromDiscord<SandwichBop> don't know anyone at University that has even heard of the language 😢
04:09:52FromDiscord<RattleyCooper> Spread the word
04:10:01FromDiscord<InventorMatt> that is why we must evangelize to everyone we meet
04:10:01FromDiscord<SandwichBop> lol imma try as soon as I get a good grasp of it first
04:10:32FromDiscord<RattleyCooper> Show them how to interop with python using nimpy
04:10:40FromDiscord<SandwichBop> I love that u can do that with nim
04:10:55FromDiscord<SandwichBop> lots of the data science peeps would use that
04:11:12FromDiscord<RattleyCooper> Yeah, everyone knows python so it should be easy to show them the benefits
04:13:18FromDiscord<Arathanis> Yeah I came to Nim because of its syntactical similarity to python.
04:13:24FromDiscord<Arathanis> That definitely helps to get people to look at it.
04:14:02FromDiscord<Rika> theres a lot of differences
04:14:25FromDiscord<RattleyCooper> And even though it's not as popular it's so much easier to read. You can look at most nim source code and figure out how to do what you need to do.
04:15:07FromDiscord<Arathanis> There are always differences but in this case its similar enough. The syntax they chose is, imo, very inspired from python and I can appreciate that.
04:15:25FromDiscord<Arathanis> In reply to @RattleyCooper "And even though it's": I think its pretty easy to read Python source code and figure out what the business is tbh.
04:15:28FromDiscord<Rika> imo its not as "python like" as you think, theres plenty of differences
04:15:35FromDiscord<Arathanis> Nim is nice cause its similar.
04:15:40FromDiscord<Rika> and many similarities are likely coincidental
04:16:02FromDiscord<RattleyCooper> Not when there are 50 classes in 15 files
04:16:31FromDiscord<RattleyCooper> It really depends on who wrote it, like in most cases..
04:16:48FromDiscord<Arathanis> That's true of every language.
04:17:32FromDiscord<Arathanis> I don't think the similarities are coincidental at all.
04:17:38FromDiscord<Arathanis> I see them as very much intential
04:17:45FromDiscord<Arathanis> and then branching in its own direction
04:17:48FromDiscord<Arathanis> which I always think is best
04:17:55FromDiscord<Arathanis> i think its good that they took it in their own direction.
04:18:09FromDiscord<Rika> no, nim is mostly influenced by pascal and its ancestors and successors
04:18:27FromDiscord<Rika> i would be led to believe that python only influenced the indentation style blocks
04:18:31FromDiscord<Arathanis> And I like a lot of the alternative choices they made.
04:19:41FromDiscord<ElegantBeef> Cursory they look a lot a like but the overall image is two vastly different languages
04:19:49FromDiscord<Arathanis> Oh yes.
04:20:07FromDiscord<Arathanis> If they weren't wildly different there would be no point.
04:20:08FromDiscord<Arathanis> :]
04:22:00FromDiscord<Rika> there can be a point in a "new" language that isnt wildly differeent
04:22:10FromDiscord<Rika> as long as the primary change is substantial
04:22:17FromDiscord<Rika> eg. typescript
04:23:15FromDiscord<Arathanis> Sure. Though I am not sure i think that typescript is a great example. I see typescript as someone trying to add typing to JS not trying to be adjacent to JS.
04:24:01FromDiscord<Rika> well its a superset
04:24:03FromDiscord<Arathanis> Either way, love the pythonic syntax inspiration. Keeps the language expressive, and free of "character noise"
04:24:10FromDiscord<Rika> not as much as C++ is to C but it is a superset
04:24:33FromDiscord<Arathanis> C++ makes it harder to shoot yourself in the foot than C, but when you do it blow the whole leg off.
04:24:49FromDiscord<Rika> harder is debatable
04:25:00FromDiscord<impbox [ftsf]> new exciting ways to shoot yourself in the foot
04:25:02FromDiscord<Arathanis> also true, im not sure who the quote is attributed to
04:25:08FromDiscord<Arathanis> still humorous lol
04:25:32FromDiscord<SandwichBop> haven't check myself yet, but does Nim have good support on any of the JetBrain IDEs?
04:25:37FromDiscord<Rika> no
04:25:37FromDiscord<impbox [ftsf]> currently writing C and i have no idea where all these bullets are coming from, but there's not much foot left
04:25:40FromDiscord<SandwichBop> rip
04:25:43FromDiscord<Rika> support? yes
04:25:45FromDiscord<Rika> good? no
04:26:10madpropsvscode support is not too bad
04:26:26madpropsi'd even say it's good
04:26:35FromDiscord<SandwichBop> o that's nice to know
04:26:46FromDiscord<SandwichBop> https://plugins.jetbrains.com/plugin/15128-nim↵seems like JetBrains has their own plugin for nim, that's a good sign ig
04:26:50FromDiscord<Rika> i cannot comment on that because it has been a few months since i seriously used vsc
04:27:06FromDiscord<Rika> In reply to @SandwichBop "https://plugins.jetbrains.com/plugin/15128-nim seem": as i said, support exists but it is not good
04:27:17FromDiscord<SandwichBop> what do you use Rika?
04:27:21FromDiscord<Rika> neovim
04:27:30FromDiscord<SandwichBop> lol should had remembered, vim prolly best bet
04:31:03FromDiscord<SandwichBop> sorry, last dumb question, anyone know how well nim runs on apple sillicon? (if it doesn't, I'll just dev on windows)
04:32:17FromDiscord<SandwichBop> (edit) "sillicon?" => "sillicon (seems like based the github only x86, x86_64 and ppc64 work on mac but maybe people have tried apple silicon)?"
04:37:17FromDiscord<xflywind> > Just like our devel branch, v1.4.8 is built using csources_v1, which means you can use it on Apple M1 chips.
04:37:21FromDiscord<xflywind> https://forum.nim-lang.org/t/8031
04:37:55FromDiscord<xflywind> see also https://github.com/nim-lang/Nim/issues/16211
04:38:47FromDiscord<SandwichBop> awesome, that's so great to know :nim1:
04:57:40FromDiscord<garett> Is there a convenient way to infer the type of a proc or var? Something akin to gcc/clang typeof()?
04:58:27FromDiscord<impbox [ftsf]> `typeof`
04:58:40FromDiscord<impbox [ftsf]> https://nim-lang.org/docs/manual.html#special-types-typeof-operator
05:00:21FromDiscord<impbox [ftsf]> sent a code paste, see https://paste.rs/7U5
05:09:53*watzon quit (Remote host closed the connection)
05:09:58FromDiscord<garett> Thank you, impbox!
05:10:12*watzon joined #nim
05:10:58NimEventerNew thread by Puruneko: Can't run on UNC path, see https://forum.nim-lang.org/t/8383
05:11:00FromDiscord<impbox [ftsf]> np, keep in mind typeof gives the _compile time type_, not the runtime type
05:12:55*ozzz joined #nim
05:25:17*stkrdknmibalz quit (Quit: WeeChat 3.0.1)
06:14:46Gustavo6046Is there composition without the concept type?
06:16:55FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3xvx
06:18:11FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3xvy
06:19:34FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3xvA
06:38:17*max22- joined #nim
06:43:23*PMunch joined #nim
07:46:00FromDiscord<enthus1ast> does one have a good idea how to detect/guess an unknown source encoding of a dataset?↵I already tried to loop through all encodings in "encodings" and convert from every to ut-8 to maybe identify the source encoding, but yeah, no sucess.↵↵Bia\\u00c5\\u0082ystok-Krywlany Airport -\> Białystok-Krywlany Airport
07:46:45FromDiscord<enthus1ast> and i do not know unicode enough to make a more educated guess
07:55:09FromDiscord<enthus1ast> it is oc. possible that the source dataset is rubbish...
08:00:08PMunchWell it's hard to just detect
08:01:19PMunchBut that encoding seems to be UTF-8
08:01:35PMunchł is 0xC5 0x81 in UTF-8
08:04:03PMunch@enthus1ast
08:06:11FromDiscord<enthus1ast> mhh
08:17:03FromDiscord<enthus1ast> it seems this is the solution\:↵`echo convert(ss, "iso-8859-1", "utf-8")`
08:18:25FromDiscord<enthus1ast> it is indeed utf-8 but somehow wrongly encoded
08:20:46PMunchIs it actually 0x00 0xC5 0x00 0x82?
08:24:03FromDiscord<enthus1ast> this gives the wrong result
08:27:15FromDiscord<enthus1ast> another option would be to replace `\u00` with `\x` but convert from "utf-8" to "iso-8859-1" result in correct utf-8
08:28:54FromDiscord<enthus1ast> encodings are shi□
08:29:43PMunchHaha :P
08:36:01PMunchHmm, as a function argument is `proc` and `ptr proc` the same?
08:37:18FromDiscord<Elegantbeef> Can you even get a proc's address?
08:37:39PMunchSure
08:37:51PMunchHow else do you think it's passed as an argument?
08:38:17FromDiscord<Elegantbeef> That's not what i meant
08:38:38FromDiscord<Elegantbeef> I mean in Nim can you explictly get a proc as a `ptr proc` without casting
08:38:49PMunchI think so?
08:39:21FromDiscord<Elegantbeef> How both `addr` and `unsafeaddr` cannot be used
08:39:24PMunchHmm, seems you can't
08:39:26FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3xw0
08:39:52FromDiscord<Elegantbeef> Yes you can cast anything to anything, but that wasnt the question 😀
08:39:53FromDiscord<enthus1ast> then i guess a proc is a ptr
08:40:23FromDiscord<enthus1ast> a pointer not ptr
08:40:56PMunchThe question really is what do I convert `void lruhash_traverse(struct lruhash* h, int wr, void (*func)(struct lruhash_entry*, void*), void* arg);` to in Nim
08:42:04PMunchproc lruhash_traverse(h: ptr lruhash, wr: cint, func: proc(a0: ptr lruhash_entry, a0: pointer) {.cdecl.}, arg: pointer)` I guess
08:42:20PMunchWell, `func` would have to be a different name
08:42:21FromDiscord<Elegantbeef> Yea that's what i'd go with
08:43:29FromDiscord<Elegantbeef> Wonder if the first arg could be `var lruhash`
08:44:15PMunchHmm, possibly..
08:44:31FromDiscord<Elegantbeef> I know it works in many cases but dont know if it's "proper"
08:45:49PMunchWould be interesting to know
08:46:01PMunchCertainly more idiomatic Nim to use var if it works
08:53:46PMunchHmm, how do I handle a typedef to a procedure that isn't a pointer then though?
08:54:37PMunchIt's obviously only ever used as a pointer type..
08:57:37*Vladar joined #nim
09:04:41PMunchHmm, can you do inline unions in a type definitions in Nim?
09:05:05PMunchie: http://ix.io/3xw7/c
09:05:45FromDiscord<Elegantbeef> The union would need it's own typedef
09:17:08*flynn quit (Read error: Connection reset by peer)
09:18:15*flynn joined #nim
09:21:37FromDiscord<impbox [ftsf]> yay! I got my weird dither generator working just how i wanted
09:22:15FromDiscord<Elegantbeef> Congrats
09:23:02FromDiscord<impbox [ftsf]> horribly inefficient but it can be cached
09:23:06FromDiscord<impbox [ftsf]> https://play.nim-lang.org/#ix=3xwd
09:23:34FromDiscord<Elegantbeef> Kashae, kashae!
09:24:14FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3xwe
09:25:19FromDiscord<Rika> What does it either
09:25:25FromDiscord<Elegantbeef> Imp i will get your code snippets to have `std/` eventually
09:25:30FromDiscord<Elegantbeef> Yes rika but english
09:25:44FromDiscord<Rika> I didn’t realise I miswrote
09:25:46FromDiscord<Rika> Dither
09:25:51FromDiscord<impbox [ftsf]> the new version is more balanced =)
09:25:52FromDiscord<Rika> What does it dither
09:26:04FromDiscord<impbox [ftsf]> it's how many pixels a thing should move per frame
09:27:38FromDiscord<Elegantbeef> I'll make an issue tomorrow impbox but nico doesnt like this palette https://lospec.com/palette-list/aurora png fails for an index reason, and gpl fails due to it not using consistent seperators between numbers
09:27:50FromDiscord<Elegantbeef> "Tomorrow" is what i should've said
09:28:10FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3xwh
09:28:55FromDiscord<impbox [ftsf]> which png are you using? 1x?
09:29:01FromDiscord<impbox [ftsf]> i'll see if i can repro
09:29:10FromDiscord<Elegantbeef> 1x yea
09:29:30*max22- quit (Ping timeout: 250 seconds)
09:29:36FromDiscord<Elegantbeef> It worked previously so i imagine something changed recently to cause it but didnt hunt it down
09:30:01arkanoidis it possible with a proc pragma to generate AST or 2 procs instead of one?
09:31:16FromDiscord<Elegantbeef> You can use a pragma on a proc to do anything
09:31:26arkanoidlong story short, I have tons of importc procs that all have C format "int f(arg1,arg2,return)", and I want to turn them in more idiomatic nim format
09:31:46FromDiscord<Elegantbeef> You want to make it a type definition feel free to
09:32:15FromDiscord<Rika> In reply to @arkanoid "is it possible with": I don’t think it can make two
09:32:26FromDiscord<Rika> Or can it? I forget
09:32:30FromDiscord<Rika> I recall not being able to
09:32:38arkanoidone possibility was to use proc pragma on them and use the macro to returns 2 procs: the unmodified c style importc version, and the new one with proper nim idiomatic syntax that calls the first one
09:32:40FromDiscord<Elegantbeef> a proc pragma gets the proc definition so can emit code outside of a proc statement
09:34:13FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3xwj
09:34:33FromDiscord<Rika> Has anyone tried integrating Nim with an existing Android application code base? Would there be any different procedures to do for such a case versus a from-scratch application?
09:34:56arkanoidyeah! thanks Elegantbeef
09:35:07FromDiscord<Rika> And what resources do you refer to when doing so, I’ve never tried compiling Nim code for Android
09:35:19FromDiscord<Elegantbeef> Arkanoid taking the tedious route of writing my entire name
09:35:31FromDiscord<Elegantbeef> Impbox might be able to help with the latter part
09:36:00FromDiscord<Rika> Are there Android SDK requirements since I have a hard minimum of Android 6
09:36:31FromDiscord<Rika> Thanks in advance lol
09:37:50arkanoidwhat is impbox?
09:41:25FromDiscord<Rika> Person
09:41:31FromDiscord<Rika> He is a person
09:42:16arkanoidoh! Very toolish name
10:05:44FromDiscord<impbox [ftsf]> @Rika i've made nim+android applications using the SDL2 Android base
10:06:20FromDiscord<Rika> I don’t remember if your projects are open source, if they are, are they easy to dissect for me to understand how they’re built ?
10:15:13FromDiscord<impbox [ftsf]> you can try doing a nico android build
10:16:01FromDiscord<Rika> I’m already lost lol what do you mean by such
10:18:01FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3xwu
10:18:37FromDiscord<Rika> Okay I’ll look at such
10:18:47FromDiscord<impbox [ftsf]> if the stars align maybe you'll end up with an apk
10:19:02PMunch@Elegant, that's what I feared..
10:19:20PMunch@impbox, ooh do you have an image of the dithering? I need to implement a ditherer soon myself
10:19:50FromDiscord<impbox [ftsf]> @PMunch it's dithering in time, so not great for an image
10:20:02FromDiscord<impbox [ftsf]> though i've done bayer dithering in nico
10:20:18PMunchDithering in time?
10:21:00FromDiscord<impbox [ftsf]> how many pixels something should move each frame
10:21:39FromDiscord<Rika> In reply to @impbox "if the stars align": 😓
10:22:02FromDiscord<impbox [ftsf]> @Rika i just ran it on my machine and it gave me an apk, so it's looking good
10:22:09FromDiscord<Rika> In reply to @impbox "<@392962235737047041> it's dithering in": Ah that’s cool, temporal dithering is difficult
10:22:22FromDiscord<Rika> In reply to @impbox "<@!259277943275126785> i just ran": Windows or Linux ?
10:22:26FromDiscord<impbox [ftsf]> Windows
10:23:03FromDiscord<Rika> Hmm I’m on Linux though, let’s see once I can use my desktop
10:30:22FromDiscord<linux user> rikea use linox :o
10:32:42PMunchAah similar to the stuff I used for my masters to implement some machine-learning without floating point support
10:34:19FromDiscord<Rika> Huh? What topic are we on right now??
10:34:46FromDiscord<Rika> Oh the temporal dithering
10:35:08FromDiscord<Rika> How the hell do you start with implementing machine learning given no floating points what the hell
10:37:18FromDiscord<impbox [ftsf]> dithering? i guess
10:43:39*max22- joined #nim
10:43:54PMunchIt was a very simple kind of machine learning, nothing with neural nets or anything like that
10:44:35PMunchBasically the way I did dithering was that instead of subtracting 0.5 I subtracted 1 with 50% probability
10:44:43PMunchAnd similar for other fractions
10:45:12PMunchAnd for the random chance I basically just masked of bits of a nanoscale time
10:48:51FromDiscord<Rika> Ah I see
10:48:55FromDiscord<Rika> How well did it work
10:49:09PMunchPretty well actually
10:49:40PMunchI used it to classify whether internet traffic was good or bad
10:49:47FromDiscord<Rika> Actually I just realised that this Android project thing I was going to do is also related to dithering but just image dithering
10:49:53PMunchOr rather normal or abnormal
10:50:05PMunchI'm going to need image dithering soon
10:50:10PMunchProbably
10:50:14FromDiscord<Rika> Normal as in not malicious?
10:50:32PMunchNormal as in whatever the network was used to seeing
10:50:48FromDiscord<Rika> In reply to @PMunch "I'm going to need": Then I should upload that program I made that dithers images to GitHub then
10:51:03PMunchDefinitely
10:51:12PMunchI mean implementing one in OpenGL isn't exactly hard
10:51:59FromDiscord<Rika> Ah in my case it was implemented as a read in PNG write out PNG
10:52:09FromDiscord<Rika> But it should be easier to port given existing code lol
10:54:09PMunchWhat kind of dithering did you do?
10:54:18FromDiscord<Rika> All sorts of them
10:54:37FromDiscord<Rika> The ones listed on Wikipedia lol
10:54:37PMunchAll sorts?
10:55:33FromDiscord<Rika> Floyd-Steinberg and Sierra are the ones I remember
10:57:13PMunchHmm, problem is that I need to be able to dither parts of the image
10:57:26PMunchSo I can't use most of the error-diffusion ones..
10:57:45FromDiscord<Rika> Hmm what method would that use them
10:57:47FromDiscord<Rika> Then
10:58:29PMunchThat's what I'm trying to figure out :P
10:58:38PMunchI mean the obvious one is a basic ordered approach
10:59:17*arkurious joined #nim
10:59:48FromDiscord<Rika> Was gonna say but that doesn’t provide good quality IMO
11:00:00PMunchYeah quality is poor
11:00:12FromDiscord<Rika> Oh wait there’s the noise ordered one
11:00:26FromDiscord<Rika> http://cv.ulichney.com/papers/1993-void-cluster.pdf
11:25:42*flynn quit (Read error: Connection reset by peer)
11:26:50*flynn joined #nim
11:42:24PMunchHmm, I think a little cleanup now and my clang auto-wrapping thing should be useable
11:46:42*rockcavera joined #nim
11:46:42*rockcavera quit (Changing host)
11:46:42*rockcavera joined #nim
11:46:54PMunchIs it possible to read passC and passL?
11:47:39FromDiscord<haxscramper> What do you mean "read"?
11:47:56PMunchGet the value of
11:48:02PMunchFrom inside my Nim program
11:49:24FromDiscord<haxscramper> No, without parsing whole module. `std/compilesettings` might have access to this, in theory https://nim-lang.org/docs/compilesettings.html
11:49:32FromDiscord<haxscramper> ` linkOptions, ## additional options passed to the linker`
11:56:21FromDiscord<trenta3> In reply to @Elegantbeef "It's simply writing code": Hi! I started trying to build some macros, but I'm having a bit of problems in understanding the error message "expression '...' has no type (or is ambiguous)".↵What does that mean? What could the problem be?↵The macro code itself is a bit long and has some context as well, but I will post it.
11:56:55PMunchHmm, doesn't seem to give me passL or passC
11:58:27FromDiscord<trenta3> sent a code paste, see https://play.nim-lang.org/#ix=3xwW
11:59:30FromDiscord<haxscramper> PMunch\: then it only gives direct arguments to `nim --passl/passc`
12:03:55FromDiscord<Cark> hum so let's say i have an object type A and its ref counterpart ARef. now I have an instance of A on the stack, but i need to call a proc which requires an ARef, is there a way to do it ?
12:04:37FromDiscord<Cark> or should i go with pointers ?
12:05:17FromDiscord<Rika> In reply to @Cark "hum so let's say": Yes, make a new ref and copy the contents into it and pass to the function
12:05:32FromDiscord<Rika> Don’t go with a pointer unless you know why you need it
12:05:56FromDiscord<Rika> There’s likely a reason it takes a ref, the proc
12:05:56FromDiscord<Cark> ah but the whole point was to avoid copying
12:06:01*supakeen quit (Quit: WeeChat 3.2)
12:06:04FromDiscord<Rika> There is no other way
12:06:07FromDiscord<Cark> i control the proc
12:06:19FromDiscord<Rika> Then why do you need a ref?
12:06:30*supakeen joined #nim
12:06:56FromDiscord<Cark> it made sense to use refs in order to avoid copying, but i can start from refs on the stack or just use ptr
12:07:17FromDiscord<Cark> i can see how making a ref out of a stack object is dangerous
12:07:32FromDiscord<Rika> You shouldn’t avoid copying unless you can measurably see there is a difference, and even then you shouldn’t change to ref just because of that…
12:07:46FromDiscord<Rika> Nim already automatically passes via pointer if it is faster for the size of the object
12:08:18FromDiscord<Cark> but if the semantics is to pass by value, there surely has some copying going on ?
12:08:28FromDiscord<Cark> (edit) "has some" => "issome"
12:08:33FromDiscord<Cark> (edit) "issome" => "is some"
12:08:37FromDiscord<Rika> Yes, but so what if there is?
12:08:51FromDiscord<Rika> Pass by reference is not always significantly faster than pass by value
12:09:31FromDiscord<Cark> ok i get that, but what if the passed object has some state that might change, and i need it reflected in the copies ?
12:09:34FromDiscord<Rika> Do you observably see the difference in speed if using one or the otherV
12:09:43FromDiscord<Rika> In reply to @Cark "ok i get that,": Use var
12:09:44FromDiscord<Cark> i'm not arguing about speed
12:09:50*max22- quit (Ping timeout: 250 seconds)
12:10:03FromDiscord<Rika> In reply to @Cark "i'm not arguing about": Yes I just sent that before I read the newest message
12:10:11FromDiscord<Cark> =)
12:10:20FromDiscord<Cark> my problem statement is ill specified
12:10:35FromDiscord<Cark> what i want is to model my application state
12:10:49FromDiscord<Rika> Okay
12:11:13FromDiscord<Cark> but i have already writen a bunch of procs that are using values rather than refs
12:11:41FromDiscord<Rika> Yeah and you can use var for mutability of regular object parameters
12:11:42FromDiscord<Cark> now it looks like one of my substates would be better specified with refs
12:12:35FromDiscord<Cark> ok i need to think a bit on that, thanks for your help
12:12:39FromDiscord<Rika> Okay
12:13:29FromDiscord<Cark> var can be seen as passing the address of the object
12:13:34FromDiscord<Cark> just like in c
12:30:59FromDiscord<Rika> Yes but you don’t need to manage it yourself
12:42:04*Helios quit (Quit: Bridge terminating on SIGTERM)
12:42:05*nixfreak_nim[m] quit (Quit: Bridge terminating on SIGTERM)
12:42:09*happycorsair[m]1 quit (Quit: Bridge terminating on SIGTERM)
12:45:31*nixfreak_nim[m] joined #nim
12:47:28*lain quit (Ping timeout: 252 seconds)
12:48:24*lain joined #nim
12:56:34FromDiscord<Rika> this is a kind of strange question
12:56:35*Helios joined #nim
12:56:35*happycorsair[m] joined #nim
12:56:47FromDiscord<Rika> are there libraries that can produce both a parser and a generator
12:57:26FromDiscord<Rika> eg. parse this format, then also write out this format
12:57:51*max22- joined #nim
13:03:13PMunchLike what binaryparse does?
13:04:06*max22- quit (Ping timeout: 256 seconds)
13:05:06FromDiscord<Rika> i guess? but text
13:13:33PMunchNone that I know of
13:14:52FromDiscord<Rika> not a problem, the generation part is much easier to make i guess
13:36:28*krux02 quit (Ping timeout: 252 seconds)
13:45:09FromDiscord<pietroppeter> https://github.com/sealmove/binarylang
13:45:12nrds<R2D299> itHub: 7"Binary parser/encoder DSL"
13:45:34FromDiscord<pietroppeter> it says binary but it actually works fine with text (see tutorials by Ajusa)
13:56:37*krux02 joined #nim
14:04:55*PMunch quit (Quit: Leaving)
14:07:58*max22- joined #nim
14:16:41NimEventerNew thread by Enthus1ast: Nimja; compiled and statically typed template engine (like twig or jinja2), see https://forum.nim-lang.org/t/8384
14:45:48FromDiscord<trenta3> Sorry for insisting, can someone explain to me what does the error "expression '...' has no type (or is ambiguous)" mean? How can I diagnose the problem when the exact same printed content seems correct to me?
14:52:20FromDiscord<haxscramper> It means that expression ... has no type. Usually? Like `let varname = echo 123`
14:52:25FromDiscord<haxscramper> In your particular case you just defined a function
14:52:33FromDiscord<haxscramper> Not assigned it, and it is not written in expression form
14:52:40FromDiscord<haxscramper> `proc name()` is a declaration
14:53:02FromDiscord<haxscramper> `let callback = proc() = ...` is an expression, specifically `proc() = ...` part of it
14:53:33FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3xxV
14:53:59FromDiscord<haxscramper> Or construct proc via `nkLambda`, or `nnkProcDef` without arguments
14:54:07FromDiscord<haxscramper> I don't remember which one it is exactly, so you need to look at treeDump for expression specifically
14:54:12FromDiscord<haxscramper> @trenta3\:
14:55:52*flynn quit (Read error: Connection reset by peer)
14:56:57FromDiscord<trenta3> sent a code paste, see https://play.nim-lang.org/#ix=3xxW
14:56:59*flynn joined #nim
14:57:18FromDiscord<trenta3> I honestly cannot understand exactly what you mean
14:57:22FromDiscord<haxscramper> Your macro generates statement not an expression
14:57:30FromDiscord<haxscramper> try pasting echoed code
14:57:50FromDiscord<trenta3> sent a code paste, see https://play.nim-lang.org/#ix=3xxX
14:58:02FromDiscord<trenta3> This is the code echoed at the end of the macro for a specific case
14:58:18FromDiscord<Rika> that is a statement
14:58:58FromDiscord<trenta3> Ouch, what would an equivalent expression be like?↵Can't I just assign a proc to a variable?
14:59:04FromDiscord<Rika> you can
14:59:20FromDiscord<Rika> what is the typedef of `Parser`?
14:59:27FromDiscord<Rika> i assume parseApply is your macro
14:59:49FromDiscord<Rika> a proc expression has the same syntax as a proc statement, just without the proc name
15:00:08FromDiscord<trenta3> sent a code paste, see https://play.nim-lang.org/#ix=3xy0
15:00:12FromDiscord<Rika> remove the proc name
15:00:22FromDiscord<haxscramper> Should be sufficieng
15:00:22FromDiscord<haxscramper> Should be sufficient
15:00:23FromDiscord<haxscramper> I just provided two examples↵(@trenta3)
15:00:31FromDiscord<Rika> oh yes that works too
15:00:42FromDiscord<haxscramper> Sometimes this errors out on parsing↵(@Rika)
15:00:44FromDiscord<Rika> (hax your messages just got here now)
15:01:00FromDiscord<haxscramper> sent a code paste, see https://paste.rs/eeD
15:01:12FromDiscord<haxscramper> No, I re-send it↵(@Rika)
15:01:13FromDiscord<trenta3> In reply to @Rika "remove the proc name": Thanks a lot
15:01:21FromDiscord<haxscramper> sent a code paste, see https://paste.rs/8Yl
15:01:48FromDiscord<trenta3> sent a code paste, see https://paste.rs/RWE
15:02:10FromDiscord<trenta3> sent a code paste, see https://play.nim-lang.org/#ix=3xyf
15:02:14FromDiscord<haxscramper> At least that's a simplest fix, though it produces rather ugly `.repr()` when used
15:02:24FromDiscord<haxscramper> So I usually try to actually generate closure expression
15:02:36FromDiscord<haxscramper> But that needs more `.newTree()`,
15:02:39FromDiscord<trenta3> When removing the proc name from the quote do I get ` Error: identifier expected, but got '('`
15:02:53FromDiscord<haxscramper> Can you try the code I sent?
15:03:20FromDiscord<haxscramper> I mean the one which simply adds `parse` at the end
15:03:43FromDiscord<trenta3> sent a code paste, see https://paste.rs/ryE
15:03:50FromDiscord<trenta3> Thank! I initially did not notice the name at the end
15:05:39FromDiscord<trenta3> Now I can try to continue writing the macro.↵And I will probably have to look more carefully at the difference between statements and expressions in nim, which I find extremely different from other languages.
15:06:37FromDiscord<haxscramper> No, it is not really different, we just allow more in expressions
15:06:52FromDiscord<haxscramper> Just C-style langs don't do `if/case` expressions
15:07:09FromDiscord<haxscramper> And `block` expressions
15:07:40FromDiscord<haxscramper> Lisp/\<insert FP lang\>/Rust/ etc. have almost the same expression concepts, for `if/match/for`
15:08:02FromDiscord<haxscramper> lisp especially
15:09:49FromDiscord<trenta3> sent a code paste, see https://play.nim-lang.org/#ix=3xyp
15:10:06FromDiscord<trenta3> Ok, so maybe I get it: the inner `proc` is a statement.
15:10:19FromDiscord<trenta3> But then what would be an equivalent expression to return a function/proc?
15:10:48FromDiscord<trenta3> sent a code paste, see https://play.nim-lang.org/#ix=3xyq
15:10:53FromDiscord<haxscramper> Yes, procedure block is a statement, and if the last entry in block is an expression than it is returned
15:11:19FromDiscord<haxscramper> Remove `proc inc`, just `return proc()` is enoug↵(@trenta3)
15:11:58FromDiscord<trenta3> Ok thanks, this clarification was really useful
15:12:27FromDiscord<haxscramper> So the error about `(` that you got earlier was just because we can't easily determine whether random `proc` in the midle of nowhere is an expression
15:12:49FromDiscord<haxscramper> So when used in places that are clearly not expressions
15:13:24FromDiscord<haxscramper> E.g. `return, let, var, const` assign to any kind ... basically anything that is not a standalone statement
15:13:31FromDiscord<haxscramper> THen you can easily do `let a = proc()`
15:13:45FromDiscord<haxscramper> But when you do `proc()` without anything else nim tries to parse it as statement
15:13:51FromDiscord<haxscramper> Probably the only caveat
15:14:02FromDiscord<haxscramper> Python has explicit `lambda`
15:14:03FromDiscord<haxscramper> Rust has `||` for closures
15:14:24FromDiscord<haxscramper> But we reuse the same `proc()` for all encounters, which leads to this difference
15:14:39FromDiscord<trenta3> Ok, but then the error I got before was that I was returning a block generated by `quote do`?
15:15:11FromDiscord<haxscramper> You generated statemetn that was basically `StmtList[ProcDeclaration]`, and `ProcDeclaration` cannot be an expression
15:15:33FromDiscord<haxscramper> After you added `parse` at the end it became `StmtList[ProcDef, Ident]` and `Ident` can be an expression
15:15:51FromDiscord<haxscramper> So "block expression" triggers
15:16:13FromDiscord<haxscramper> https://nim-lang.org/docs/manual.html#statements-and-expressions-block-expression
15:16:38FromDiscord<trenta3> Ok, now I get it. So I could also take my `result` and extract just the ProcDeclaration using `result = result[0]` and return that?
15:16:43FromDiscord<haxscramper> The manual is a bit to dry on examples in this case, but basically `Stmt[ ????, Ident/Lit/Other-Expr]` can be expr
15:17:00FromDiscord<haxscramper> No, the ast is more involved, and proc declaration cannot be split↵(@trenta3)
15:17:23FromDiscord<haxscramper> Because again, `ProcDef` (I used wrong name the first time) is not an expression
15:17:38FromDiscord<haxscramper> Proc/Iterator/Macro/Type/Const/Let/Var declarations are not expressions
15:17:48FromDiscord<trenta3> In reply to @haxscramper "The manual is a": Yes I totally agree on this, resources on the web are scarce too for a language that is around by such a long time (compare it to the number of examples for Golang e.g.)
15:17:52FromDiscord<haxscramper> While/For statements are not expressions either
15:18:13FromDiscord<haxscramper> If/Try/Case/Block can be an expression dependoning on context
15:18:30FromDiscord<haxscramper> The context is - is it a part of bigger expression or not?
15:18:55FromDiscord<haxscramper> Enumerating all combinations will take some time but I hope you get general idea
15:19:03FromDiscord<haxscramper> @trenta3)
15:19:20FromDiscord<haxscramper> No the language to compare anything to
15:19:26FromDiscord<haxscramper> Except maybe ruse
15:19:27FromDiscord<haxscramper> rust
15:19:28FromDiscord<trenta3> In reply to @haxscramper "Enumerating all combinations will": Yes, I definitely get it
15:20:03FromDiscord<trenta3> In reply to @haxscramper "No the language to": Agree, I'm definitely not comparing the languages, just the number of examples that one can find on the web.
15:22:19FromDiscord<trenta3> But then thanks again, having places to ask for help is great
15:26:07FromDiscord<Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=3xyw
15:29:18FromDiscord<Rika> `...[T: AnyVector3](a: T): T`?
15:29:49FromDiscord<Rika> or what you just wrote, does it not work?
15:34:33FromDiscord<Ayy Lmao> In reply to @Rika "`...[T: AnyVector3](a: T): T`?": That seems to make `V` as the value type become undeclared.
15:34:53FromDiscord<Ayy Lmao> In reply to @Rika "or what you just": When I do `typeof(a)` it's apparently `void`
15:35:06FromDiscord<Rika> concepts spicy
15:35:43FromDiscord<Ayy Lmao> Yeah I'm finding them hard to wrap my head around but I like the idea. Is anyone using them extensively?
15:37:04FromDiscord<Rika> i bet this is a bug of some sorts
15:54:40FromDiscord<Cark> sent a code paste, see https://play.nim-lang.org/#ix=3xyF
15:54:58FromDiscord<Cark> there is no r =)
15:55:17FromDiscord<Rika> look at the filename
15:55:22FromDiscord<Rika> its not your module
15:55:53FromDiscord<Cark> yeah but ".nim(32, 18) template/generic instantiation of `new` from here" which is the line with nex(ImageDataRef)
15:56:04FromDiscord<Cark> (edit) "nex(ImageDataRef)" => "new(ImageDataRef)"
15:56:55FromDiscord<Cark> what i'm trying to achieve : those init functions are returning regulare objects
15:57:13FromDiscord<Cark> and i want these to be in those refs
15:57:29FromDiscord<Cark> (edit) "regulare" => "regular"
15:58:48FromDiscord<Cark> the program works correctly despite the warning, but i can't leave a warning dangling there, there must be a correct way to do this
16:04:48FromDiscord<Rika> pmunch: I forgot, i also implemented a dither https://pippin.gimp.org/a_dither/
16:05:46FromDiscord<Rika> actually it still recommends void and cluster for speed
16:13:34FromDiscord<Cark> from the height of my ignorance i'll call this a compiler bug and disable the warning there
16:14:23FromDiscord<gerwy> How can i read some specific place in file?
16:14:40FromDiscord<gerwy> without looping over every line
16:16:43FromDiscord<Rika> specific place as in specific byte? setposition
16:19:35FromDiscord<gerwy> i mean like, i know the line, and how many characters i want to get from it
16:19:56FromDiscord<gerwy> ah in streams?
16:21:15FromDiscord<Cark> there is no getting to a line in a text file without scanning for it, unless you have an index of some sort
16:21:50*xet7 quit (Remote host closed the connection)
16:22:34*xet7 joined #nim
16:23:26FromDiscord<Rika> "lines" do not exist in files
16:23:33FromDiscord<Rika> you need to know the exact byte
16:23:39FromDiscord<Rika> and if you dont then you need to scan the whole file
16:23:58FromDiscord<Rika> well, the file until the specific line more accurately
16:24:05FromDiscord<gerwy> and it works Thanks<3
16:24:27FromDiscord<gerwy> In reply to @Rika "you need to know": and i know it so its working
16:48:15*Vladar quit (Quit: Leaving)
16:50:39FromDiscord<tandy> I have overloaded a function from a library i have `include`d and i get this warning `overloaded '' leads to ambiguous calls`, anything i could do to stop it?
16:53:05FromDiscord<haxscramper> Use import
16:53:09FromDiscord<Rika> are you sure what you wrote is an overload? check the types and if they are aliases
16:53:31FromDiscord<haxscramper> First solution, otherwise what is the problem you are trying to solve with `include` specifically?
16:57:46FromDiscord<tandy> i have tried another solution for now, but im using that to import types, etc
16:59:43FromDiscord<haxscramper> Using `include` is highly discoraged unless you want it's specific functionality. `import` is preferred in almost all use cases
17:00:28FromDiscord<haxscramper> And unconstrained use of `include` can easily lead to this specific error you are getting (overloaded function and ambiguous calls)
17:00:51*flynn quit (Read error: Connection reset by peer)
17:01:59*flynn joined #nim
17:02:04FromDiscord<tandy> what is its specific functionality?
17:02:15FromDiscord<haxscramper> include does dumb copy-paste of the code
17:03:00FromDiscord<haxscramper> thus you can split file into multiple small ones without need to import-export "internal" things
17:03:26FromDiscord<haxscramper> compiler uses this for `sem` implementation that would otherwise be around 15k SLOC total (\~)
17:03:26FromDiscord<tandy> oh interesting
17:03:34FromDiscord<haxscramper> Also `system` does `include` for certain parts
17:03:49FromDiscord<haxscramper> But if you do `include` anything twice it would declare it's contents twice as well
17:03:58FromDiscord<haxscramper> Because it is a dumb copy-paste
17:05:42FromDiscord<haxscramper> And if you have copy-pasted things twice, it naturally leads to ambiguous overloads, because there is actually multiple identical implementations in the same scope
17:05:43FromDiscord<haxscramper> So try `import` first, if it fails somewhere else check whether you have appropriate export markers in place
17:07:36FromDiscord<tandy> im just using it so i dont have to import something multiple times across a large codebase
17:07:43FromDiscord<tandy> so i just include it in a file where its always needed
17:07:53FromDiscord<haxscramper> Yes, that's the wrong usage
17:07:54FromDiscord<tandy> then i import that file and i can access its stuff
17:08:08FromDiscord<haxscramper> We have `import`/`export` pair for that
17:08:53FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3xz2
17:09:41FromDiscord<haxscramper> A little more tedious to write, but you control what is being exported etc. But mostly you need to use `import-export` because `include` is just was not meant for that
17:13:44FromDiscord<tandy> i see
17:18:59FromDiscord<tandy> i dont really know how to fix that atm, but il add it to my todo
17:21:20FromDiscord<Clonkk> What would be the "best" way to get a typedesc based on an enum value ?
17:22:09FromDiscord<haxscramper> as in `nnkSym` with `skEnumField` to `typedesc[EnumType]`?
17:22:39FromDiscord<haxscramper> Probably `getType()`, `getImpl()`, `getTypeImpl()` in random combinations will get you there after some tries
17:22:56FromDiscord<Clonkk> As in, I have a runtime integer -\> enum vamue and ideally I'd like to use a typedesc
17:24:02FromDiscord<haxscramper> I don't exactly understand what exactly you want to use typedesc for
17:24:16FromDiscord<haxscramper> Automate writing of `int -> enum` mapping?
17:24:31FromDiscord<haxscramper> Or map `int` to typedesc
17:24:46FromDiscord<deech> How do I set the Nim C++ compiler? I have both `clang` and `gcc` and want to switch between them.
17:25:12FromDiscord<Clonkk> I have a numpy array obtained from a big Nimpy black box (that can't easily be ported to Nim for now) that I convert to `pt UncheckedArray[T]` for some supported types.
17:26:12FromDiscord<Clonkk> So from a PyObject (in Nim) I can access the attributes `num` of the dtypes (which is an integer); and this enum would ideally be converted to a typedesc to be used for type dispatch / generic obect creation (if possible)
17:26:24FromDiscord<Clonkk> `when defined(cpp):`↵(@deech)
17:26:43FromDiscord<Yardanico> gcc.cpp.exe
17:26:43FromDiscord<Clonkk> To check if it exists
17:26:44FromDiscord<Clonkk> -b\:cpp for backend switch
17:26:48FromDiscord<Yardanico> and gcc.cpp.linkerexer
17:26:49FromDiscord<Yardanico> (edit) "gcc.cpp.linkerexer" => "gcc.cpp.linkerexe"
17:27:07FromDiscord<Yardanico> ah right
17:27:10FromDiscord<deech> So something like `switch("gcc.cpp.exe", "clang")`?
17:27:11FromDiscord<Yardanico> you just want to switch between clang and gcc right?
17:27:16FromDiscord<Yardanico> In reply to @deech "So something like `switch("gcc.cpp.exe",": nonono, it's not needed in your case
17:27:25FromDiscord<Yardanico> just do nim cpp --cc:clang to use clang++
17:27:31FromDiscord<Yardanico> and nim cpp --gcc:gcc to use g++ (default)
17:27:39FromDiscord<Yardanico> (edit) "--gcc:gcc" => "--cc:gcc"
17:28:04FromDiscord<deech> Nice! Thanks!
17:29:03FromDiscord<haxscramper> In that case, you need some form of reverse mapping for enum values via manual annotations. If I understand correctly, you basically need to get "type id to typedesc"
17:29:14FromDiscord<Clonkk> Yup
17:29:16FromDiscord<Clonkk> Basically
17:30:30FromDiscord<haxscramper> In cases like these, the simplest form would be to just declare `func as(npBox: NumpyBox, target: typedesc[T]): T = npBox.unpackForTypeT(T)`. SO you can write `np[0, 2] as float`
17:30:44FromDiscord<haxscramper> But some form of manual wrapping has to be done
17:30:59FromDiscord<haxscramper> You can automate construction of the `as` using templates for example
17:31:23FromDiscord<RattleyCooper> Are the nightly builds fairly stable? Not exactly sure what to expect but want to give it a shot so I can use a couple libraries that require nim >= 1.5 .
17:31:24FromDiscord<haxscramper> And do runtime validation of the input data, to make sure it matches ID
17:32:46FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3xz6
17:33:22FromDiscord<haxscramper> Or `float from <numpy box>` if you want it differently
17:34:03FromDiscord<haxscramper> Usually stuff either builds and runs correctly or does not even compile↵(@RattleyCooper)
17:34:12FromDiscord<haxscramper> So there are not hidden unstable runtime footguns
17:34:14FromDiscord<Clonkk> Yeah, okay I get the gist
17:34:59FromDiscord<RattleyCooper> In reply to @haxscramper "So there are not": Thanks!
17:35:28FromDiscord<Clonkk> I was hoping I could construct something like `nnkBrakcetExpr(eqIdent "typedesc", eqIdent "int8") inside a big `case of\`\` but I can't use that as a generic
17:45:21*euantorano quit (Ping timeout: 250 seconds)
17:45:30*euantorano joined #nim
18:07:56*watzon quit (Quit: watzon)
18:14:42*watzon joined #nim
18:15:18arkanoidIs it possible to have an inner "aux" proc that is a importc?
18:16:59arkanoidI mean proc foo() =proc aux() {.importc: "foo".} aux()
18:29:06FromDiscord<haxscramper> yes, the only limitation on inner procs it that they can't be exported
18:31:22*watzon quit (Quit: WeeChat 3.2)
18:42:08FromDiscord<tandy> can you parse an int64 from a string?
18:47:34*watzon joined #nim
18:47:50FromDiscord<haxscramper> `std/strutils.parseInt()`
18:56:09FromDiscord<RattleyCooper> What's the deal with custom pragmas on a type def? If I try to turn a TypeSection/TypeDef into a statement list I get an illformed AST error even though it appears to be valid?
18:56:15FromDiscord<RattleyCooper> sent a code paste, see https://paste.rs/EjM
18:56:59FromDiscord<RattleyCooper> This works, but if you try to apply `{.t.}` to the `Bob` typeDef it errors out
18:57:13FromDiscord<RattleyCooper> `type Bob {.t.} = ref object of RootObj`
18:57:37arkanoidThanks!
18:58:25FromDiscord<RattleyCooper> Am I missing something here? I thought that it was having issues with the pragma details not existing but even if I modify the AST to add the pragma details and make sure the type is in a `typeSection`, it still says it's illformed AST
18:59:28FromDiscord<RattleyCooper> I need to add some boilerplate code after my `typeDef`s
19:00:04FromDiscord<RattleyCooper> I'm not actually declaring types in a proc, was just doing that so I could get the full AST with the pragma in the treeRepr
19:01:32*PMunch joined #nim
19:24:49*flynn quit (Read error: Connection reset by peer)
19:26:04*flynn joined #nim
19:59:45FromDiscord<tandy> `Exception message: invalid integer: "1630429373"`
19:59:47FromDiscord<tandy> when using regular `int`
20:00:52FromDiscord<tandy> `getBiggestInt` works tho
20:01:19FromDiscord<tandy> oh it runs but it just returns 0
20:10:23*PMunch quit (Quit: leaving)
20:21:47*watzon quit (Quit: WeeChat 3.2)
20:38:35*watzon joined #nim
20:48:27*auxym_ joined #nim
20:51:54*max22- quit (Remote host closed the connection)
20:52:19*max22- joined #nim
20:53:26*max22- quit (Remote host closed the connection)
20:53:48*max22- joined #nim
20:56:28NimEventerNew thread by Oden: An equivalent to JAI's "use"?, see https://forum.nim-lang.org/t/8385
21:04:37*auxym_ quit (Ping timeout: 245 seconds)
21:14:27*supakeen quit (Remote host closed the connection)
21:14:50*supakeen joined #nim
21:20:10nixfreak_nim[m]The files I am greping out are too large and kill my memory , I actually have to split them up then run a loop to compare them. How would I write a grep -f file file2 program like that?
21:22:13FromDiscord<Elegantbeef> iterate over each line and do it line by line instead of loading the entire file into memory
21:25:15FromDiscord<SandwichBop> is it unorthodox to use Nim for GUI work? (I can see SDL wrapper going well with Nim tho don't want to go against the grain)
21:25:30FromDiscord<SandwichBop> (edit) "grain)" => "grain, maybe there's something like Electron for Nim)"
21:26:21FromDiscord<Elegantbeef> Unorthodox? It's a programming language so i'd hope GUI isnt against the grain \:D
21:27:22FromDiscord<Elegantbeef> There are bindings for gtk, qml, webview. Then also pure nim solutions/multiplatform stuff like Nimx, Fidget, nigui(might be best to look at if you want to use windows native gui, but also want gtk on unix)
21:27:30FromDiscord<kaushalmodi> Hello, I have no background in socket or TCP/IP programming. If I want to convert this code to Nim ( https://github.com/amiq-consulting/amiq_blog/blob/master/amiq_sv_python_non_blocking_socket_communication_in_systemverilog_using_dpi_c/client.cc ), which Nim library should I start looking at? Would it be the `net` library?
21:28:10FromDiscord<kaushalmodi> Once I tackle that, I would like to also convert this Python code ( https://github.com/amiq-consulting/amiq_blog/blob/master/amiq_sv_python_non_blocking_socket_communication_in_systemverilog_using_dpi_c/server.py ) to Nim as well.
21:29:51FromDiscord<SandwichBop> In reply to @Elegantbeef "There are bindings for": Never knew there were so many solutions, thank you Elegantbeef 🙏 ↵Going to check out Nimx/Fidget/Nigui, never heard of em before but sound worth reading into
21:31:40FromDiscord<Elegantbeef> Yea kaushal seems like the `net` module would be the best, unless you want lower level stuff
21:31:56FromDiscord<Elegantbeef> There is also asyncnet if that ticles your fancy
21:34:20FromDiscord<kaushalmodi> In reply to @Elegantbeef "Yea kaushal seems like": Thanks, I will start reading the `net` doc then.
21:35:08FromDiscord<kaushalmodi> > unless you want lower level stuff↵I just want to receive data over a socket and pass it on to another system via a C API function
21:35:22FromDiscord<Elegantbeef> Then yea net should be fine
21:41:41NimEventerNew post on r/nim by wrestlingwithbadgers: Problem with dom.EmbedElement, see https://reddit.com/r/nim/comments/pffjky/problem_with_domembedelement/
21:43:50FromDiscord<RattleyCooper> Is it possible to define a template within a template so that the nested template only "exists" if the outer templates conditions are met?
21:44:16FromDiscord<RattleyCooper> sent a code paste, see https://play.nim-lang.org/#ix=3xA8
21:44:49FromDiscord<RattleyCooper> I'm trying to recreate the pandas dataframe filter syntax: `df[df.someCol == 5]` to filter values
21:44:52FromDiscord<Elegantbeef> when statements
21:45:39FromDiscord<RattleyCooper> Ok, I will look into it
21:45:41FromDiscord<RattleyCooper> Thanks!
21:46:35FromDiscord<kaushalmodi> I think I will need to start with `asyncnet` as I need "non-blocking socket communication".
21:46:39FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3xA9
21:46:52FromDiscord<Elegantbeef> Notice where the error is in that example rattley
21:47:06FromDiscord<Elegantbeef> It's in the second block due to passing false
21:47:30FromDiscord<RattleyCooper> Gotcha
21:48:45FromDiscord<RattleyCooper> The issue is that `e` should end up equating to the AST for `df.someCol == 5]` but the template that handles `==` doesn't exist
21:48:56FromDiscord<RattleyCooper> (edit) "5]`" => "5`"
21:49:11FromDiscord<RattleyCooper> (edit) "exist" => "exist, even though I defined it within the outer template"
21:53:03FromDiscord<RattleyCooper> I can link to the playground but for some reason the playground doesn't display the error (or anything)
21:54:06FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/cB5
21:54:10FromDiscord<RattleyCooper> Oh wow, I'm a fool lol. I had another code snippet that was interfering..
21:54:38FromDiscord<RattleyCooper> sent a code paste, see https://play.nim-lang.org/#ix=3xAb
21:59:26*max22- quit (Quit: Leaving)
22:26:44FromDiscord<RattleyCooper> Do templates have their own scope?
22:37:02FromDiscord<RattleyCooper> not exactly sure how to apply `when` to my problem. Right now I have:
22:37:14FromDiscord<RattleyCooper> sent a code paste, see https://paste.rs/3kp
22:37:56FromDiscord<RattleyCooper> to stop the template from redefining that `==` proc in the global scope. But it's just redefining that proc into a new block every time...
22:40:03FromDiscord<Recruit_main707> templates are basically copying that code and pasting it wherever you use it, so it will be defined in that scope afaik
22:40:41*oprypin quit (Quit: Bye)
22:40:52*oprypin joined #nim
22:41:45FromDiscord<RattleyCooper> Yeah, I'm just trying to figure out how I can get this syntax to work, while only defining that `==` proc once. The issue is that if I define it outside the `[]` template it can run anywhere
22:41:52FromDiscord<RattleyCooper> not just in the `[]`
22:43:24FromDiscord<Recruit_main707> what are you trying to acomplish with this?
22:46:13FromDiscord<RattleyCooper> In reply to @Recruit_main707 "what are you trying": I want to make a pandas dataframe filter syntax for an object. Mostly just learning more about templates/macros
22:46:57FromDiscord<RattleyCooper> in pandas you can do `d[d.someColumn == 5]` to get filtered data where any value in the column is equal to 5
22:47:24FromDiscord<RattleyCooper> and I just want to see if it's possible in nim. It totally is, I just want to figure out how to do it better.
22:49:13FromDiscord<RattleyCooper> What's odd though is the nim playground doesn't like to show any output, even though it works locally with the same version of nim
22:50:43FromDiscord<RattleyCooper> oh wow, nvm the playground just decided to tab all my echos over XD
22:50:59FromDiscord<rb3.nim> Is there a way to disable constructor calls (`Object(a: 1, b: 2)`), using term-rewriting macros for example? I want to enforce usage of init functions, for my c++-interop library
22:51:44FromDiscord<Elegantbeef> do not export the type but it's not a great way
22:52:02FromDiscord<rb3.nim> The old trick doesn't seem to work anymore https://forum.nim-lang.org/t/3445
22:52:19FromDiscord<Elegantbeef> @RattleyCooper\: https://play.nim-lang.org/#ix=3xAn
22:52:35FromDiscord<rb3.nim> Ah ya, but my init functions look like `Object.init(1, 2)`
22:52:48FromDiscord<rb3.nim> So they take a type 😱
22:53:00FromDiscord<Elegantbeef> So rewrite them as `initObject`
22:53:53FromDiscord<Elegantbeef> But yea not overly nice
22:53:57FromDiscord<rb3.nim> The `init` function is actually generated by a separate library I wrote, and is meant to be reusable everywhere, so thats not an option
22:54:08FromDiscord<rb3.nim> (edit) "library" => "macro"
22:54:35FromDiscord<rb3.nim> there must be a way with term rewriting macros...
22:55:13FromDiscord<Elegantbeef> I think there is
22:55:25FromDiscord<Elegantbeef> I recall doing something similar before
22:56:25FromDiscord<rb3.nim> sent a code paste, see https://play.nim-lang.org/#ix=3xAo
22:57:44FromDiscord<RattleyCooper> In reply to @Elegantbeef "<@408056314342932491>\: https://play.nim-lang.org/": Wow, that is freaking sweet
23:02:28FromDiscord<RattleyCooper> I feel like that should be in sequtils if there isn't something similar
23:02:39FromDiscord<Elegantbeef> it's already in called `filterit`
23:02:46FromDiscord<RattleyCooper> Ah, perfect 😄
23:03:45FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3xAt
23:04:30FromDiscord<Elegantbeef> As long as you move your `constDestr` to after all your init procs you'll be fine to prevent the user from doing such
23:07:07*arkurious quit (Quit: Leaving)
23:09:03FromDiscord<Recruit_main707> In reply to @Elegantbeef "<@408056314342932491>\: https://play.nim-lang.org/": Are you forced to use `{}` instead of `[]`?
23:09:14FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/d34
23:09:40FromDiscord<RattleyCooper> In reply to @Recruit_main707 "Are you forced to": I think if the base type is a seq
23:09:40FromDiscord<Elegantbeef> I think the `[]` is reasoned to be the generic accessing proc and as such it complains about `it`
23:10:28FromDiscord<Elegantbeef> Since `proc [](s: seq, index: IndexType)` is more specific than `template [](s: seq, index: untyped)`
23:10:45FromDiscord<Elegantbeef> Remember untyped/typed do not support overloading
23:10:46FromDiscord<RattleyCooper> Doesn't proc overloading not work super well with untyped?
23:10:52FromDiscord<RattleyCooper> Oh lol guess so
23:11:09FromDiscord<Recruit_main707> the answer before the question xd
23:11:19FromDiscord<Elegantbeef> I'm just that good 😛
23:11:46FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#overloading-resolution-lazy-type-resolution-for-untyped
23:12:26FromDiscord<tandy> when using karax + prologue i cant get css / assets to work when using a route like /home
23:12:42FromDiscord<Recruit_main707> sent a code paste, see https://play.nim-lang.org/#ix=3xAx
23:12:45FromDiscord<tandy> anyone know how to fix that?
23:13:15FromDiscord<Elegantbeef> TRM are post semantic checking so the code has to be valid before it gets to them↵(@Recruit_main707)
23:14:48FromDiscord<Recruit_main707> and where is it invalid, at `[bool]`?
23:15:11FromDiscord<Elegantbeef> `it` isnt valid in the context of `seq[it > 20]`
23:15:22FromDiscord<Elegantbeef> there is no `it` variable declared
23:16:57FromDiscord<Recruit_main707> ah right mb, and despite using a trm, `[]` as a function is considered more specific and we get to the same problem?
23:17:28FromDiscord<Elegantbeef> Well like i said `trm` is post semantic checking, so the code underneath needs to be valid
23:17:29FromDiscord<Recruit_main707> Of not being able to inject `it`?
23:18:02FromDiscord<Elegantbeef> So if the code cannot be compiled before the trm it cannot get to the point to apply the trm
23:18:47FromDiscord<Elegantbeef> > ↵> Term rewriting macros are macros or templates that have not only a name but also a pattern that is searched for after the semantic checking phase of the compiler\: This means they provide an easy way to enhance the compilation pipeline with user defined optimizations\:↵>
23:19:35FromDiscord<Recruit_main707> and since the injection happens within the template it cannot reach it before being invalid (?)
23:19:52FromDiscord<Elegantbeef> Well the template is never chosen in the semantic check
23:20:10FromDiscord<Elegantbeef> So it choses the procedure and then checks the expression inside `[]`
23:20:24FromDiscord<Elegantbeef> That expression is `it > 20` which cannot be resolved since `it` isnt known
23:20:50FromDiscord<Elegantbeef> It then throws a compiler error there and you have to fix the code or use a different indexing method
23:21:34FromDiscord<Elegantbeef> Once you have a procedure that matches your template/macro that takes an untyped you need to use a different index method or a more specific procedure
23:21:39FromDiscord<Recruit_main707> so this happens:↵> [] as a function is considered more specific
23:21:55FromDiscord<Recruit_main707> right?
23:22:01FromDiscord<Elegantbeef> Yes
23:22:34FromDiscord<Elegantbeef> It doesnt know which `[]` you're using so it attempts to sem the `it > 20`, but then hits a wall of `it` being undefined
23:23:22FromDiscord<Elegantbeef> So in this case you could actually do `[proc(a: T): bool = a > 20]`
23:23:26FromDiscord<Elegantbeef> Not overly nice
23:24:31FromDiscord<Recruit_main707> alright, its just that trm are not able to be prioritised over previously defined functions, thanks for answering my doubts :)
23:25:03FromDiscord<Elegantbeef> Not that it's fucking clean
23:25:09FromDiscord<Elegantbeef> But that's not the point of this excersize
23:25:09FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3xAz
23:25:25FromDiscord<Elegantbeef> Maybe i'll spell that word right eventually, where is rika to spell it for me
23:27:12FromDiscord<Elegantbeef> Arent you glad you asked rattley ?
23:27:21FromDiscord<Elegantbeef> We're now in the deepend of procedure resolution
23:27:30FromDiscord<RattleyCooper> Hehehe
23:27:39FromDiscord<RattleyCooper> I'm learning a lot so I'm happy
23:28:11FromDiscord<Elegantbeef> Do wonder if my solution for the object constructor actually helped them
23:28:23FromDiscord<Elegantbeef> Radio silence after my solution makes me sad
23:28:46*luis_ joined #nim
23:29:30FromDiscord<RattleyCooper> Oh it definitely did. I haven't gotten it done yet but I can see how to actually do it now..
23:29:49FromDiscord<Elegantbeef> But you werent the one with a problem
23:30:18FromDiscord<RattleyCooper> Oh lol I forgot you're helping everyone and mine isn't an object constructor 👀
23:37:32*luis_ quit (Ping timeout: 245 seconds)
23:42:05*auxym_ joined #nim
23:45:46*flynn quit (Read error: Connection reset by peer)
23:46:52*flynn joined #nim
23:54:25*luis_ joined #nim