<< 25-02-2025 >>

00:19:32FromDiscord<Elegantbeef> Oh noes an array syntax that lets you... make your code statically typed!
00:22:35FromDiscord<threefour> sent a code paste, see https://play.nim-lang.org/#pasty=Ttrksdzn
00:23:02FromDiscord<threefour> I'm trying to understand concepts, and it's giving me a type mismatch on the last line. But this seems correct to me. What am I missing?
00:23:38FromDiscord<threefour> (Yes it's dumb code -- just experimenting)
00:34:24FromDiscord<Elegantbeef> `a, b: Being` binds both to `Being`
00:34:46FromDiscord<Elegantbeef> `a, b: distinct Being` is what you want
00:34:56FromDiscord<Elegantbeef> or `[A, B: Being](a: A, b: B)`
00:44:17FromDiscord<threefour> I guess I'm confused on why I can't simply put `Being`, because according to the concept's definition, they _are_ `Being`s.
00:45:19FromDiscord<Elegantbeef> Right, but it's a generic which means when it matches `a` it binds `Being` to `Animal`
00:45:36FromDiscord<Elegantbeef> Now you have the proc as `<(Animal, Animal)` but are passing `Animal, Person)`
00:46:25FromDiscord<fluff.goose> i must be the worlds worst programmer, because i do not know how, but my code says the same number is not equal to that same number
00:46:40FromDiscord<Elegantbeef> Good job that takes skill
00:47:29FromDiscord<fluff.goose> im not even joking either, it literally made something that should be impossible
00:48:11FromDiscord<Elegantbeef> How big is this code?
00:54:31FromDiscord<threefour> In reply to @Elegantbeef "Now you have the": Okay that clears it up a lot actually. Thank you.
00:55:17FromDiscord<Elegantbeef> Nim also has this tedious antifeature that it binds typeclasses once
00:55:23FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=hmSqzHBD
00:56:02FromDiscord<Robyn [She/Her]> In reply to @fluff.goose "im not even joking": is it a float?
00:56:28FromDiscord<fluff.goose> int
00:56:41FromDiscord<Elegantbeef> I chose the one example that passes 😄
00:56:43FromDiscord<Elegantbeef> `doThing 0d, 1.int` fails
00:59:34*m5zs7k quit (Quit: m5zs7k)
01:00:50FromDiscord<threefour> I feel like I'm using concepts in the wrong way then, because it seems clunky to have to tack `distinct` onto all my proc signatures.
01:03:31*m5zs7k joined #nim
01:13:38FromDiscord<.tokyovigilante> Hey, I'm trying to wrap libwayland-client with Futhark, there are a number of `static inline` functions in the header which don't seeem to be wrapped, is there any way to get these in?
01:14:10FromDiscord<leorize> I think you gotta translate those yourself
01:15:00FromDiscord<leorize> you don't wrap static inline functions, since they're meant to be "copied" verbatim to your binary
01:15:11FromDiscord<leorize> it's best that you reimplement them in nim
01:16:50FromDiscord<.tokyovigilante> Ah right, makes sense
01:16:52FromDiscord<.tokyovigilante> thanks
02:19:07FromDiscord<spider7124> Hello, I am a complete beginner and did not find anything online to fix this. Not sure exactly what is happening here, any insights would be helpful https://media.discordapp.net/attachments/371759389889003532/1343769212539240531/image.png?ex=67be7a1a&is=67bd289a&hm=f5d39a7dceb2beab48353ea3ddf0620cbf456ac89f18c16d80a96d26ba35b613&
02:19:47FromDiscord<Elegantbeef> Heh mjolnir claims another
03:57:05FromDiscord<mustacheman> Any interest in starting a nim squad on daily.dev ?
04:01:52*ehmry quit (Ping timeout: 244 seconds)
04:08:32FromDiscord<Elegantbeef> Is this just a weird developer centric link aggegator
04:14:29FromDiscord<lainlaylie> ugh, is daily dev really a thing now
04:18:18*ehmry joined #nim
04:21:27FromDiscord<Elegantbeef> It is if you make it!
06:03:59*ensyde joined #nim
07:28:01FromDiscord<user2m> I'm using prologue how do I get the ip address of a request??
07:32:52*ntat joined #nim
07:33:50FromDiscord<Elegantbeef> @saemideluxe well I mentioned it was untested before, but now that I wrote a type fuzzer my VSBF has some amount of testing, although now someone has to test the fuzzer.... 😄
07:34:25FromDiscord<Elegantbeef> Have thrown like 1000+ randomly generate data types and nothing has exploded....yet
07:38:16FromDiscord<Elegantbeef> @user2m probably the `nativeRequest` field
07:42:16FromDiscord<user2m> In reply to @Elegantbeef "<@419925691832991754> probably the `nativeRequest`": Thats where I looked first but I can't seem to find it? can you link me to any documentation? I'm searching through https://nim-lang.org/docs/asynchttpserver.html#Request rn
07:42:26FromDiscord<Elegantbeef> `url`
07:42:32FromDiscord<Elegantbeef> `hostname`
07:51:04FromDiscord<entropydev> sent a code paste, see https://play.nim-lang.org/#pasty=FyebSUCX
07:51:46FromDiscord<entropydev> sent a code paste, see https://play.nim-lang.org/#pasty=oDwaJIeX
07:51:51FromDiscord<entropydev> line
07:52:32FromDiscord<entropydev> here are the imported cpp functions:
07:53:44FromDiscord<entropydev> sent a code paste, see https://play.nim-lang.org/#pasty=nfDMgfTn
07:54:28FromDiscord<entropydev> here is the tutorial I'm trying to replicate: https://docs.opencv.org/4.x/d5/dae/tutorial_aruco_detection.html
07:59:39FromDiscord<entropydev> This is my first time using the C++ foreign function interface, so I suspect I did something wrong in how I import the detectMarkers function, or in how I am using the Vector type
08:00:37FromDiscord<entropydev> I can provide the whole file if that would help
08:20:29FromDiscord<saemideluxe> In reply to @Elegantbeef "<@765602578792054845> well I mentioned": can you post the link again?
09:28:49*ntat quit (Quit: Leaving)
10:21:08FromDiscord<entropydev> here is the full file if that is helpfull https://media.discordapp.net/attachments/371759389889003532/1343890519671046185/blockchain_architecture.nim?ex=67beeb14&is=67bd9994&hm=9c6b5a76b1e1bb0c35950a962807497b2f223fb9eed89556a3c7495a7f698d14&
10:41:13*anddam quit (Quit: WeeChat 4.5.1)
11:30:46*anddam joined #nim
12:44:12FromDiscord<janakali> sent a code paste, see https://play.nim-lang.org/#pasty=XKIgINDy
13:26:09FromDiscord<jabuci> sent a code paste, see https://play.nim-lang.org/#pasty=UbDgASxf
13:28:23FromDiscord<janakali> @jabuci splitWhitespace https://nim-lang.org/docs/strutils.html#splitWhitespace%2Cstring%2Cint
13:31:18FromDiscord<jabuci> Thanks! I didn't know about it.
13:34:58*ntat joined #nim
14:05:51*ensyde quit (Ping timeout: 244 seconds)
16:32:37*pmp-p quit (Quit: No Ping reply in 180 seconds.)
16:32:49*pmp-p joined #nim
17:10:06*halloy2785 joined #nim
17:12:02*halloy2785 is now known as MauGal
17:17:41FromDiscord<xtrayambak> sent a code paste, see https://play.nim-lang.org/#pasty=BjtStKTs
17:18:16*MauGal quit (Ping timeout: 252 seconds)
17:18:52FromDiscord<Elegantbeef> sugar.capture
17:18:59FromDiscord<xtrayambak> In reply to @Elegantbeef "sugar.capture": Ah, thanks
17:19:33FromDiscord<Elegantbeef> @saemideluxe https://github.com/beef331/vsbf
17:21:19FromDiscord<xtrayambak> Oh my god it works, thank you so much :^)
17:21:28FromDiscord<xtrayambak> I've been scratching my head over this for like 3 days
17:22:07FromDiscord<Elegantbeef> Yea when a proc captures a symbol it raises the symbol so in the above they're all the same
17:22:17FromDiscord<Elegantbeef> This is a common gotcha in captures
17:44:47*vsantana joined #nim
17:46:04*icebattle joined #nim
18:04:30*Jjp137 quit (Ping timeout: 260 seconds)
18:04:48*Jjp137 joined #nim
18:11:00FromDiscord<entropydev> In reply to @janakali "<@409153462324953099> try other exception": Great! that helps a lot, my original problem was that I wasn't passing in the image. However I'm still running into another error on the same function which I don't get when I run what I think should be the exact same code in C++, can you tell if I've correctly imported the detectMarkers function?
18:12:33*icebattle quit (Quit: Client closed)
18:14:30*ensyde joined #nim
18:18:34FromDiscord<Elegantbeef> I've not done C++ interop, but I imagine that if a C++ function raises and you do not have the exception imported and handled it'll explode in this way
18:18:35FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#exception-handling-imported-exceptions
18:19:26*ensyde quit (Ping timeout: 272 seconds)
18:21:18FromDiscord<entropydev> sent a code paste, see https://play.nim-lang.org/#pasty=sRRBUxIJ
18:21:33FromDiscord<entropydev> which appears to be calling the correct C++ code
18:21:43FromDiscord<Elegantbeef> Well that's an assertion
18:22:08FromDiscord<Elegantbeef> So you need to provide all of those arguments properly
18:22:34FromDiscord<blashyrk> Hi. Does anyone have an example of creating a generic func/proc from a macro? I don't see `newProc` API supporting that unless it has to do with pragmas somehow
18:22:54FromDiscord<Elegantbeef> You get to manually walk the tree
18:23:38FromDiscord<Elegantbeef> https://github.com/beef331/micros/blob/master/src/micros/definitions/routines.nim#L132
18:23:42FromDiscord<entropydev> In reply to @Elegantbeef "So you need to": yes, and as far as I can tell I am doing it, I can run what should be the exact same code in C++ and it functions correctly
18:24:13FromDiscord<entropydev> also, though there are 4 arguments, the only one that really seems to matter is the image, as the rest are just empty vectors
18:24:31FromDiscord<Elegantbeef> I don't know what to say the assert is failing due to either `markerSize` or `sizeWithBorders`
18:25:01FromDiscord<Elegantbeef> what is `markerSize` `bits.cols` and `bit.rows`
18:25:21FromDiscord<blashyrk> In reply to @Elegantbeef "You get to manually": Thanks!
18:25:30FromDiscord<entropydev> I don't really know, those are being used internally in the function
18:26:04FromDiscord<Elegantbeef> Make sure your types match the C++ types
18:26:08FromDiscord<entropydev> And I've tested that the image is loading correctly as I can output it
18:26:11FromDiscord<Elegantbeef> I do not know what else to say
18:27:07FromDiscord<entropydev> could something be off with the Vector type? It has a generic [T] but I don't really understand how that interacts with the C++ side
18:27:31FromDiscord<entropydev> sent a code paste, see https://play.nim-lang.org/#pasty=YOWBLRIG
18:27:32FromDiscord<Elegantbeef> It will emit a `vector<T>` on the C++ side
18:28:56FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#importcpp-pragma-importcpp-for-objects well this does just that for maps
18:42:04FromDiscord<entropydev> Ok, so I've found one issue, the markerSize of dictionary of the detector is 0, which would trigger the assert, so since I pass the dictionary into the detector when I call its constructor, maybe I'm doing the constructor wrong
18:42:50FromDiscord<entropydev> because I know I'm creating the dictionary correctly
18:58:23FromDiscord<entropydev> ok, I've narrowed down the issue, it is really weird
18:59:12FromDiscord<entropydev> Something is wrong with this function:
18:59:26FromDiscord<entropydev> sent a code paste, see https://play.nim-lang.org/#pasty=jctCuSyP
18:59:39FromDiscord<entropydev> the defauly parameter for dictionary is working
19:00:03FromDiscord<entropydev> sent a code paste, see https://play.nim-lang.org/#pasty=uSLLCyZS
19:00:09FromDiscord<entropydev> outputs 4 as it should
19:00:48FromDiscord<entropydev> (edit) "https://play.nim-lang.org/#pasty=RhJYGmto" => "https://play.nim-lang.org/#pasty=DRzKHCEB"
19:01:19FromDiscord<entropydev> sent a code paste, see https://play.nim-lang.org/#pasty=mIcdepkS
19:01:43FromDiscord<entropydev> (edit) "https://play.nim-lang.org/#pasty=RpbsVfJt" => "https://play.nim-lang.org/#pasty=PERMwfxV"
19:02:12FromDiscord<entropydev> even though the only difference that I can tell is that in one the parameter is passed in, and in the other one it is using the default
19:03:41FromDiscord<entropydev> and if I chage the default from DICT_4X4_50 to another value like DICT_6X6_250 it is properly sending this to the C++ code
19:04:09FromDiscord<entropydev> so the only issue is passing in the value as a parameter, what could be going wrong here?
19:04:22FromDiscord<entropydev> (edit) "parameter, what" => "parameter. What"
19:37:11FromDiscord<konan_5> hello, here↵is there any development task?
19:37:58*vsantana left #nim (#nim)
20:23:10*ntat quit (Quit: Leaving)
22:08:56*rockcavera joined #nim