00:25:09 | * | SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev) |
00:38:20 | * | SchweinDeBurg joined #nim |
01:14:11 | FromDiscord | <Elegantbeef> It should be bound inside `bar` as that's there is `newTensor` in scope |
01:14:29 | FromDiscord | <Elegantbeef> But one can always `mixin` or `bind` inside `bar` |
01:18:20 | arkanoid | Elegantbeef, mixin is doing nothing inside bar, but bind does work |
01:18:39 | arkanoid | but I'm failing to understand what's going on |
01:18:55 | FromDiscord | <Elegantbeef> This is a bug in binding |
01:19:10 | arkanoid | I'm adding one by one the required "binds", trying if "mixin" can be used instead (but none so far) |
01:19:34 | FromDiscord | <Elegantbeef> I mean you don't need mixin since you never want to use a user's `newTensor` |
01:20:35 | arkanoid | to let it compile, I'm using mixin/bind in a proc where I never use the argument of them |
01:20:50 | arkanoid | at least not directly |
01:21:00 | arkanoid | it's quite impossible to use generics like this |
01:21:25 | FromDiscord | <Elegantbeef> I don't know what you mean |
01:22:28 | FromDiscord | <Elegantbeef> In this case the `newTensor[float32](0)` can be fully resolved inside `bar` but it does not make `newTensor` a closed symbol so this is very much a binding symbol bug |
01:22:28 | arkanoid | look at this proc. To make it compile, I have to "bind newTensor" https://play.nim-lang.org/#pasty=siNYZqcsJTXc |
01:22:44 | arkanoid | but I never call directly "newTensor" inside that module |
01:22:55 | arkanoid | and the called this is a proc, not a template or a macro |
01:22:58 | FromDiscord | <Elegantbeef> This is how generics work |
01:23:30 | FromDiscord | <Elegantbeef> `bind newTensor` forces `newTensor` to be a 'closed symbol' which means it stores all instances of `newTensor` at the declaration |
01:23:51 | FromDiscord | <girvo> sent a long message, see https://pasty.ee/qONeZrIMRklg |
01:23:57 | FromDiscord | <Elegantbeef> Otherwise it's supposed to be a 'open symbol' which means it stores all instances of `newTensor` at instantiation, but also gets them at user scope |
01:25:29 | arkanoid | there's some in depth compiler knowledge needed here |
01:25:50 | FromDiscord | <Elegantbeef> I mean that's how generics work and you are expected to understand that |
01:25:59 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#generics |
01:26:17 | FromDiscord | <Elegantbeef> Specifically https://nim-lang.org/docs/manual.html#generics-symbol-lookup-in-generics |
01:26:29 | FromDiscord | <Elegantbeef> This does seem to be a bug but you really need to know about open/closed symbols |
01:27:14 | FromDiscord | <Elegantbeef> hmph girvo the double destroy is interesting |
01:27:40 | FromDiscord | <Elegantbeef> You have two destructors for a single constructor |
01:29:17 | arkanoid | in that example, I don't even get why `proc `==` (a, b: Index): bool {.borrow.}` is a generic |
01:30:25 | FromDiscord | <Elegantbeef> It's not |
01:30:34 | FromDiscord | <Elegantbeef> There is a `==` for tuples defined that uses `mixin` so you can use the `Index`'s `==` |
01:30:48 | FromDiscord | <Elegantbeef> If it was a closed symbol you'd never be able to use your own `==`s |
01:31:25 | FromDiscord | <Elegantbeef> The point is to show "Look at what open symbols do you can make generics that expect an interface" |
01:32:17 | arkanoid | do you mean that that exaples uses a `==` generic proc that is not shown nor linked in the example itself? |
01:33:49 | * | lucasta quit (Quit: Leaving) |
01:34:30 | arkanoid | maybe this? https://nim-lang.org/docs/system.html#%3D%3D%2CT%2CT_2 |
01:35:02 | * | lucasta joined #nim |
01:35:59 | FromDiscord | <Elegantbeef> It directly mentions that it uses the `==` defined in system for tuples |
01:36:01 | FromDiscord | <Elegantbeef> Yes |
01:36:54 | arkanoid | my chance to improve the docs! |
01:42:25 | FromDiscord | <Elegantbeef> @girvo this is a value type so it's making copies all over the place 😄 |
01:43:36 | arkanoid | Elegantbeef, when you say that this specific case is a bug, do you mean a bug in arraymancer implementation code, or a bug in nim compiler |
01:43:45 | FromDiscord | <Elegantbeef> The latter |
01:44:02 | FromDiscord | <Elegantbeef> Nim should properly bind that to a `opensymchoice` and as such it should always remember `newTensor` |
01:44:42 | arkanoid | ok. I'll try to understand open and closed symbols first |
01:45:57 | arkanoid | btw this experience drives me off the use of generics/concept and all those stuff. I got a really bad adventure refactoring my code, and most of the time it was due to import order, and now mixin and binds. I was not ready for this |
01:46:24 | arkanoid | in particural when it ends with a possible compiler bug |
01:46:26 | FromDiscord | <Elegantbeef> If it's any consolation I heavily use generics and have never seen this bug 😄 |
01:48:38 | arkanoid | lucky you |
01:50:19 | arkanoid | I'm stuck at the fouth `bind` I have to chain to let my code compile |
01:50:40 | arkanoid | I think I should stop using modules and put all my code into a single huge nim file |
01:55:01 | arkanoid | that's what I tend to do with my types anyway |
02:02:03 | FromDiscord | <Elegantbeef> I'm sorry for your loss |
02:09:20 | FromDiscord | <Elegantbeef> @girvo it was your `uart = Uart[Init](other)` |
02:09:26 | FromDiscord | <Elegantbeef> Atleast in one part |
02:14:25 | FromDiscord | <Elegantbeef> I think Nim is broken with typestates and destructors though |
02:17:30 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#pasty=MYKhunBHbjgi works for context |
02:17:59 | FromDiscord | <Elegantbeef> I think Nim's hook logic does not understand `Uart[Init] isnot Uart[Uninit]` |
02:19:25 | FromDiscord | <Elegantbeef> Yep that's the issue https://play.nim-lang.org/#pasty=ddpCsaKMTasr |
02:45:58 | * | SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev) |
02:52:05 | * | lucasta quit (Remote host closed the connection) |
03:06:13 | NimEventer | New Nimble package! umriss - Extract syscall stats from strace output files, see https://github.com/tdely/umriss |
03:16:06 | FromDiscord | <dedraiaken> Is it possible to store a typedesc in an object such that you can store it as RootObj and cast back to the original object type based on that field? I'm trying to create a generic linked list that can store variable object types. |
03:16:54 | FromDiscord | <dedraiaken> sent a code paste, see https://play.nim-lang.org/#pasty=bTJTerhUoJqi |
03:20:11 | FromDiscord | <Elegantbeef> Nope |
03:20:30 | FromDiscord | <Elegantbeef> typedesc are compiletime only |
03:20:48 | FromDiscord | <Elegantbeef> Use an object variant or something like jsonnode to get type erasure like you want |
03:30:39 | FromDiscord | <demotomohiro> In reply to @dedraiaken "Is it possible to": That is almost same to trying to store different types in a seq:↵https://internet-of-tomohiro.netlify.app/nim/faq.en.html#type-how-to-store-different-types-in-seqqmark |
03:33:51 | FromDiscord | <dedraiaken> In reply to @demotomohiro "That is almost same": Hmm maybe I could do it that way. Thanks! |
04:12:36 | arkanoid | how can I disambiguate malebolgia -> and sugar -> ? https://github.com/Araq/malebolgia/blob/32fd877d46478735f1dbe9c937bddcff9255b3e0/src/malebolgia.nim#L183 |
04:12:56 | FromDiscord | <Elegantbeef> use backticks |
04:13:05 | FromDiscord | <Elegantbeef> Oh wait |
04:13:12 | arkanoid | https://nim-lang.org/docs/sugar.html#-%3E.m%2Cuntyped%2Cuntyped |
04:13:15 | FromDiscord | <Elegantbeef> In there you'd do `b[0] == bindSym"->"` |
04:13:50 | FromDiscord | <Elegantbeef> Though there is no malebolgia `->` |
04:14:17 | FromDiscord | <Elegantbeef> So in summary you don't as sugar is an untyped macro |
04:14:33 | FromDiscord | <Elegantbeef> As is malebolgia |
04:14:34 | arkanoid | import std/sugar except `->` |
04:15:05 | arkanoid | I know how to circument sugar, but not how to circumvent malebolgia |
04:15:35 | FromDiscord | <Elegantbeef> You cannot as it's a DSL |
04:15:45 | FromDiscord | <Elegantbeef> There is no `->` symbol you can disregard |
04:15:58 | arkanoid | it works |
04:15:59 | FromDiscord | <Elegantbeef> If you want to use sugar's `->` you cannot use it inside malebolgia |
04:16:10 | FromDiscord | <Elegantbeef> What? |
04:16:21 | arkanoid | import std/sugar except `->` |
04:17:54 | FromDiscord | <Elegantbeef> I'm so confused |
04:18:40 | arkanoid | prolly because I went from how to disambiguate to "remove sugar side" as soon as I saw your beautiful contraption |
04:19:10 | arkanoid | which I appreciate, much gratitude |
04:19:25 | FromDiscord | <Elegantbeef> malebolgia is untyped so it's odd that sugar interferes 😄 |
04:24:54 | arkanoid | sugar does interferes. Here's an example where you have to remove sugar from imports to compile https://play.nim-lang.org/#pasty=ESFIjQrsgeMw |
04:27:57 | FromDiscord | <Elegantbeef> So odd given that malebolgia is an untyped DSL |
04:30:02 | arkanoid | why stopping at 1 bug per day |
04:30:16 | FromDiscord | <Elegantbeef> This is atleast a bug inside of a DSL |
04:30:58 | arkanoid | yes, I was not serious. I also think this is a not so good design decision inside malebolgia |
04:38:29 | arkanoid | and now I'm getting "lib/std/tasks.nim(98, 70) Error: undeclared identifier: 'isolate'" |
04:40:56 | arkanoid | I already know that by the time I'll get at the end of this major refactory of my project to use compile time unit of measures, I will have reached the idea to rollback to pre-generic era to never have to deal it again |
04:42:09 | arkanoid | all the problems I'm facing are external to the logic of the problem I'm trying to solve |
05:01:08 | FromDiscord | <dedraiaken> sent a code paste, see https://play.nim-lang.org/#pasty=vaOINoqKysSS |
05:01:57 | FromDiscord | <girvo> In reply to @Elegantbeef "I think Nim's hook": yeah damn |
05:02:34 | FromDiscord | <Elegantbeef> Is your dumphook defined before or after this procedure |
05:04:20 | FromDiscord | <dedraiaken> In reply to @Elegantbeef "Is your dumphook defined": after |
05:04:28 | FromDiscord | <Elegantbeef> Put it before |
05:06:30 | FromDiscord | <dedraiaken> In reply to @Elegantbeef "Put it before": It works! 😵💫 |
05:09:42 | FromDiscord | <dedraiaken> In reply to @Elegantbeef "Put it before": I owe you like 10 coffees. 🙃 |
05:10:22 | * | krux02 quit (Remote host closed the connection) |
05:13:12 | FromDiscord | <Elegantbeef> Also that cast is dirty |
05:13:29 | FromDiscord | <Elegantbeef> if this is a `ref RootObj` you can just do `MyType(...)` assuming those are `ref object of X` |
05:14:29 | * | SchweinDeBurg joined #nim |
05:17:06 | FromDiscord | <dedraiaken> In reply to @Elegantbeef "if this is a": They are indeed. 11. |
05:23:11 | FromDiscord | <Elegantbeef> @girvo atleast you can do manual typestates it's not as nice but it does work 😄 |
06:10:35 | FromDiscord | <morgan> so im getting a crash somewhere in this function, i think it's a null pointer deref. i tried checking if the input host pointer is nil (by having it write a file) but that didn't trigger so im guessing something else isn't working https://media.discordapp.net/attachments/371759389889003532/1216991711323099147/image.png?ex=660266da&is=65eff1da&hm=6b94bbb31519e5cbdf9000e0ae710b3036bf510430bd91bf12a46baaaa8393b4& |
06:10:56 | FromDiscord | <morgan> and it's a dynamic library, nim isn't complaining |
06:12:47 | FromDiscord | <odexine> What are the types of your global |
06:12:51 | FromDiscord | <Elegantbeef> `myPlug.plugin` is a `ptr` but you do not allocate it |
06:13:14 | FromDiscord | <morgan> oh right |
06:13:44 | FromDiscord | <morgan> huh |
06:13:48 | FromDiscord | <Elegantbeef> I don't imagine `myPlug.plugin` needs to be `ptr T` |
06:14:10 | FromDiscord | <Elegantbeef> It probably should be `T` and then you do `myPlug.addr` as the return expression |
06:14:18 | FromDiscord | <morgan> i was copying from c code for all this example plugin code, and they didn't there, but i never tried compiling the example |
06:14:18 | FromDiscord | <Elegantbeef> `myPlug.plugin.addr` \ |
06:14:41 | FromDiscord | <Elegantbeef> If the C code uses a pointer as the field it's probably wrong |
06:15:26 | FromDiscord | <Elegantbeef> Cause if you lose the `myPlug` pointer you need to be able to get that pointer back to free memory |
06:15:55 | FromDiscord | <Elegantbeef> Which is done like `dealloc(cast[pointer](cast[uint](thePtrClapPlugin) - MyType.offsetOf(plugin))` |
06:18:23 | FromDiscord | <morgan> In reply to @Elegantbeef "If the C code": it's possible its a value type there, nearly everything in here is pointers so i might've made one more thing a pointer |
06:18:39 | FromDiscord | <morgan> anyways adding that allocation fixed that issue |
06:18:45 | FromDiscord | <Elegantbeef> It almost certainly is given that otherwise you lose that pointer and cannot get it back |
06:20:01 | FromDiscord | <morgan> huh wow that got a lot further than i expected, it's processing the sound even |
06:20:24 | FromDiscord | <morgan> oh yeah that isn't a pointer |
06:20:27 | FromDiscord | <morgan> huh |
06:22:40 | FromDiscord | <Elegantbeef> Apparently I have a skill for guessing field types in some shitty C hellscape |
06:30:28 | * | advesperacit joined #nim |
06:35:45 | FromDiscord | <girvo> In reply to @Elegantbeef "<@823468778704076810> atleast you can": Yeah that's basically what I'm doing haha. I'm curious how C++ RAII works wrt. destructors/sink/`init()` being run before the previous destroy |
06:37:48 | FromDiscord | <Elegantbeef> Who knows I doubt any C++ programmer could tell you 😛 |
06:38:30 | FromDiscord | <girvo> haha I distinctly remember that a book I have behind me explains it, but I immediately discarded that information 😄 |
06:41:47 | FromDiscord | <girvo> Ah, right, it seems to be (basically) the same as Nim's; except `example& operator=(const example& other)` instead of `=sink` -- I'd need to define it, etc. |
06:42:10 | FromDiscord | <girvo> I have another book that explains RAII for this kind of work. I might check it, see if there are any patterns I can steal |
06:46:34 | NimEventer | New Nimble package! vqsort - A vectorized Quicksort (AVX2-only), see https://github.com/Asc2011/vqsort |
07:06:25 | * | om3ga joined #nim |
08:03:37 | * | PMunch joined #nim |
09:27:40 | PMunch | Oh no, it seems like 2.0.0 broke Protobuf :( Error: invalid order of case branches |
10:03:44 | * | tc424 joined #nim |
10:17:36 | FromDiscord | <vindaar> at least the tests and examples seem to work fine on devel |
10:23:03 | PMunch | Hmm, strange |
10:54:32 | Zevv | PMunch: so how are you doing with your CPS adventures. Did you set out on your kwest yet? |
11:04:33 | PMunch | Ah, not yet. I just got back from back-to-back vacation and army stuff |
11:04:57 | Zevv | army stuff. dude. |
11:05:02 | Zevv | how does that work out for oyu |
11:06:12 | PMunch | What do you mean? In Norway we have one year of mandatory military service, then each year about a week of repetition exercise |
11:06:14 | FromDiscord | <nnsee> Norway has conscription, iirc it even applies to women |
11:06:27 | PMunch | Yes, now it applies to women as well |
11:06:40 | FromDiscord | <nnsee> after conscription you're put into reserve and occasionally called back for exercises |
11:06:45 | PMunch | Exactly |
11:07:20 | PMunch | Fail to show up and the police will come to your house and you risk some hefty fines AFAIK |
11:07:43 | FromDiscord | <nnsee> how much notice do they give you? |
11:10:07 | PMunch | 3-4 months I think |
11:11:05 | FromDiscord | <nnsee> oh, that's quite a lot |
11:12:34 | FromDiscord | <nnsee> or, well, I say that, but it's 120 days here too |
11:12:48 | FromDiscord | <nnsee> occasionally we have 24-hour ones... |
11:12:58 | FromDiscord | <nnsee> to test readiness |
11:13:58 | PMunch | I sometimes get an SMS asking how fast I would be able to meet at the rendevouz point |
11:14:11 | PMunch | rendezvous* |
11:14:45 | PMunch | You actually have to show up in 24 hours? |
11:17:14 | Zevv | i'd hate that all so much |
11:17:37 | Zevv | i know the reasons and all but not sure if i could do that |
11:18:17 | Zevv | we used to have conscription in .nl, but just when I turned 18 it got abandoned, so I got away with that |
11:18:30 | PMunch | Eh, it's not that bad. Actually quite fun to do something so different to what I normally do (although I did get to code some Excel macros this year :P) |
11:19:23 | PMunch | And they of course do an evaluation of you before you do your mandatory service, and if you can't handle it they send you home |
11:34:11 | FromDiscord | <nnsee> In reply to @PMunch "You actually have to": yup |
11:35:29 | FromDiscord | <nnsee> In reply to @Zevv "i'd hate that all": 1. we live right next to a certain country with a reputation for randomly invading democratic european countries↵2. it's low key fun |
11:36:46 | PMunch | Huh, I don't think that would go down very well in Norway :P |
11:37:17 | PMunch | I typically get my messages at times where it might be expected that a lot of people are away |
11:44:44 | FromDiscord | <djazz> Me, a Swede: War? What is that? Oh we are in Nato now, what happens next? |
11:45:27 | PMunch | You get to come and exercise with us :P |
11:45:50 | FromDiscord | <odexine> ~~imagine being in europe~~ |
11:46:10 | FromDiscord | <nnsee> i don't need to imagine 💀 |
11:46:16 | Zevv | low key fun sounds like a good reason :) |
11:52:08 | PMunch | I guess it's kinda like LARPing Modern Warfare edition with an extreme budget and crazy high attendance |
12:00:31 | Zevv | but still. i'm not sure if i'm a pacifist or just a coward. |
12:17:04 | PMunch | I'm terrified of actually ending up in a war, that would be horrible. The Norwegian defense ran a campaign fairly recently which was very powerful, it is basically a reel of shots of fighter planes, tanks, submarines, and soldiers. During these clips the narrator voice asks why do we upgrade our fighter planes, why do people have to repeat the same tasks over and over again, why are we a part of NATO, etc. At the end he asks "What do we as a nation want to |
12:17:04 | PMunch | achieve with this? What are we hoping will happen?" Then it cuts to a couple on a mountaintop while the narrator says "Absolutely nothing, fantastic nothing" |
12:17:26 | PMunch | The goal is not to end up actually using all this knowledge, the goal is to avoid it |
12:17:50 | Zevv | right. sure. i know. |
12:17:51 | Zevv | but still |
12:17:54 | Zevv | man |
12:18:18 | Zevv | we've grown up in this hiatus of violence. total absence of anything really threatening in my life at all |
12:18:32 | Zevv | stories of grandparents is the closest it got |
12:19:40 | Zevv | i have this ukraenian friend |
12:19:55 | Zevv | as a kid they used to climb the fences and go into russia for the weekend |
12:20:06 | Zevv | putting trains on fire, that kind of shit |
12:20:27 | Zevv | all the while i was just hanging around at parties smoking weed and listining to terrible music |
12:20:44 | PMunch | Wait what? |
12:20:50 | PMunch | They were torching trains? |
12:20:54 | Zevv | freight trains |
12:21:02 | FromDiscord | <nnsee> ... but why |
12:21:22 | Zevv | because they have always been at war, from their perspective |
12:21:30 | PMunch | I guess some people really want to watch the world burn, at least very specific parts of it |
12:21:33 | PMunch | Ah right |
12:21:51 | Zevv | it's just how they grow up. he lost two good friend over the last year |
12:21:55 | Zevv | and proud of it |
12:21:56 | Zevv | but man. |
12:22:01 | PMunch | That's rough |
12:22:11 | Zevv | i know right. but still, he's not even blusing when talking about it |
12:22:22 | Zevv | it's such a different perspective. that nationalism. |
12:23:55 | PMunch | For me it's about protecting peoples ability to be able to smoke weed and listen to terrible music. (except that weed isn't really legal here, but you get the point) |
12:26:55 | Zevv | sure. i get you. |
12:28:02 | Zevv | i guess conscription is actually a very good thing. I think I wish they would bring that back in nl |
12:28:13 | Zevv | it just makes you realize some of this shit is, like, real |
12:28:24 | Zevv | it's not movies and newspapers |
12:28:58 | PMunch | Yeah, I think a lot fewer people would call for war if you knew that your name was on the list of people who would have to participate in said war.. |
12:29:57 | Zevv | right |
12:56:27 | * | def- quit (Quit: -) |
12:57:01 | * | def- joined #nim |
13:22:41 | * | krux02 joined #nim |
13:30:42 | FromDiscord | <lyhokia> Hello, any one knows how to solve the issue "error: request for member ‘facedetect_cnn’ in ‘(NU8)resultBuffer’, which is of non-class type "? |
13:30:58 | FromDiscord | <lyhokia> so here I am writing a binding to some c functions and nim assumes the first parameter is a class when it isn't |
13:31:14 | FromDiscord | <lyhokia> here's the generated code: "void)(((NU8) (resultBuffer))->facedetect_cnn(((NU8) ((&data.p->data[((NI)0)]))), ((int) (width)), ((int) (height)), ((int) (((NI)100)))));" |
13:31:23 | FromDiscord | <lyhokia> (edit) ""void)(((NU8)" => ""(void)(((NU8)" |
13:34:42 | FromDiscord | <nnsee> In reply to @lyhokia "Hello, any one knows": can you post your nim code? https://play.nim-lang.org |
13:39:33 | FromDiscord | <lyhokia> https://play.nim-lang.org/#pasty=pNCansTNZKWn |
13:40:13 | FromDiscord | <lyhokia> I tried to replace importcpp with importc and then it tells me the function is not found |
13:40:55 | FromDiscord | <lyhokia> there's so many libs on the market to tell you how to wrap a C lib yet I found them still hard to grasp lol |
13:42:04 | FromDiscord | <lyhokia> Sorry here's the full code https://play.nim-lang.org/#pasty=uhzjimbmyqNM |
13:42:43 | PMunch | If you're wrapping C and not C++ then I'd highly recommend Futhark |
13:42:53 | PMunch | And you definitely shouldn't use importcpp |
13:43:59 | FromDiscord | <lyhokia> both won't work in my case |
13:44:06 | FromDiscord | <lyhokia> the library itself is written in cpp |
13:45:49 | FromDiscord | <lyhokia> importc now says I don't have <vector> |
13:46:14 | FromDiscord | <lyhokia> so I guess importc is not the way to go either, they have some codes in the header file which is annoying |
13:46:24 | PMunch | Yeah I'm looking at the code and it's definitely C++ and not C |
13:46:27 | FromDiscord | <lyhokia> (edit) "codes" => "codes(definitions) as well " |
13:46:46 | FromDiscord | <lyhokia> here's the libraryhttps://github.com/ShiqiYu/libfacedetection/tree/master |
13:46:55 | PMunch | I already found it :P |
13:47:09 | FromDiscord | <lyhokia> lol |
13:47:23 | PMunch | Just to make sure, you are compiling your program with `nim cpp someproject.nim`? |
13:47:28 | FromDiscord | <lyhokia> this lib has 0-dependency itself, I managed to get it work with stb_image but not for nim |
13:47:34 | PMunch | And not the normal `c` switch |
13:47:46 | PMunch | Or mode rathe |
13:48:20 | FromDiscord | <lyhokia> looks like it is using nim c |
13:48:25 | FromDiscord | <lyhokia> I'm calling nimble test |
13:48:56 | PMunch | You have to use `cpp` when linking to C++ libraries |
13:49:13 | FromDiscord | <lyhokia> how should I config nimble to do that? |
13:49:32 | FromDiscord | <lyhokia> I mean obviously I can't expect end user to use nim cpp to compile the library |
13:49:45 | PMunch | Why is that obvious? |
13:50:17 | FromDiscord | <lyhokia> .. |
13:50:24 | FromDiscord | <lyhokia> okay probably it's up to argue |
13:50:36 | FromDiscord | <lyhokia> then how should I config nimble to use cpp instead? |
13:50:57 | FromDiscord | <lyhokia> here's the nimble test log I got: https://pastebin.ubuntu.com/p/RYTJfxjqm3/ |
13:52:12 | PMunch | Add a `backend = "cpp"` option in your package element |
13:52:44 | FromDiscord | <lyhokia> Let me see |
13:53:57 | FromDiscord | <lyhokia> It still has the same issue |
13:54:16 | FromDiscord | <lyhokia> And I don't know if it's already using cpp backend because the error message is from *.cpp |
13:55:29 | PMunch | Sounds like it if it is from a .cpp file |
13:56:01 | FromDiscord | <lyhokia> it is, I checked the genreated file by nim |
13:57:52 | FromDiscord | <lyhokia> okay looks like I need to rtfm |
13:57:59 | PMunch | Hmm, strange.. |
13:58:09 | PMunch | Did you find anything? |
13:58:25 | FromDiscord | <lyhokia> https://nim-lang.org/docs/manual.html#importcpp-pragma-importcpp-for-procs |
13:59:01 | PMunch | Aah, right |
13:59:49 | FromDiscord | <lyhokia> now I have some omp errors, let me see if I can fix them lol |
14:02:10 | FromDiscord | <lyhokia> yeah it compiles now with another -fopenmp |
14:02:11 | FromDiscord | <lyhokia> thanks |
14:22:20 | * | xet7 joined #nim |
14:36:35 | FromDiscord | <treeform> In reply to @arkanoid "is "import vmath except": Why don't you want isNaN? |
14:37:17 | FromDiscord | <treeform> Oh math has isNaN now? |
14:38:13 | FromDiscord | <treeform> I should fix my lib. |
15:13:51 | NimEventer | New thread by pixel: Gc/malebolgia bug?, see https://forum.nim-lang.org/t/11203 |
15:19:41 | * | ntat joined #nim |
15:20:47 | * | PMunch quit (Quit: Leaving) |
16:07:23 | FromDiscord | <ricky._.spanish> is it possible in a nimble definition to pull required precompiled binaries from a external url and include either architecture headers/params in the request? |
16:18:24 | FromDiscord | <lyhokia> Hello, I got libfacedetect working when using `nim cpp` but it won't work when I run nimble test, any idea how to fix? |
16:18:25 | FromDiscord | <lyhokia> https://github.com/glyh/facedetection/blob/master/src/facedetection.nim |
16:19:37 | FromDiscord | <lyhokia> (edit) "nimble test," => "`nimble test`," |
16:20:22 | FromDiscord | <lyhokia> It's kinda annoying that the author write cpp code in the header so I can't use futhark |
16:21:20 | FromDiscord | <lyhokia> like, is it possible to config include dir with nimble? |
16:24:17 | FromDiscord | <lyhokia> here's the log: https://pastebin.ubuntu.com/p/fjgtmBkC2p/ |
16:35:29 | * | SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev) |
16:44:43 | * | def- quit (Quit: -) |
16:50:38 | * | def- joined #nim |
17:19:59 | arkanoid | treeform exactly, I have to disambiguate |
17:20:46 | arkanoid | treeform: I've been crying in vmath + unchained recently. I've opened an issue about it |
17:22:06 | FromDiscord | <demotomohiro> In reply to @lyhokia "Hello, I got libfacedetect": It seems your nimble doesn't use cpp backend but uses c backend.↵Did you set backend to use cpp in nimble?↵https://github.com/nim-lang/nimble?tab=readme-ov-file#optional |
17:22:55 | arkanoid | I'm using Malebolgia and I'm calling `spawn` from a generic proc. I'm dealing with "nim-2.0.2/lib/std/tasks.nim(97, 39) Error: undeclared identifier: 'isolate'" and I'm failing to understand why this happens. I'm trying using mixins and binds but I fail to understand what's wrong here. If I try to replicate same context outside of my project it compiles successfully |
17:27:25 | arkanoid | I'm trying to reproduce the issue, but so far I keep getting working code. Still working on it https://play.nim-lang.org/#pasty=QOkvxZsCKcpw |
17:42:58 | FromDiscord | <treeform> In reply to @arkanoid "I'm using Malebolgia and": Oh math.isNan and vmath.isNan have different behaviors |
17:43:40 | FromDiscord | <treeform> my isNan also does isInf while Nim's does not. |
17:44:13 | FromDiscord | <treeform> But it looks like GLSL does the same thing. I want vmath to follow GLSL as much as possible. So i'll probably change it but its more complex then I thought. |
17:46:48 | * | def- quit (Quit: -) |
17:47:06 | * | def- joined #nim |
17:52:41 | arkanoid | I managed to reproduce the issue. It is again an import vs include issue https://play.nim-lang.org/#pasty=tJMEolVplpNf |
18:03:48 | * | Guest87 joined #nim |
18:04:08 | * | Guest87 quit (Client Quit) |
18:04:23 | arkanoid | treeform, keeping GLSL compat is important. I also used shady to write and run compute shaders, worlked out flawlessly |
18:27:33 | arkanoid | is limiting the generic type via typeclasses/concepts a proc thing, or is it usabe in type declaration also? |
18:28:14 | arkanoid | is `type Point[T: Length] = array[2, T]` something I can rely on? |
18:33:33 | arkanoid | if I try to use that on types, I have errors like "got: <typedesc[Meter], typedesc[DecaMeter], typedesc[Minute]> but expected: <D: Length, LD: Length, T: Time>" |
18:33:53 | arkanoid | if I remove that on types but I keep it on procs, it compiles and run |
18:47:51 | FromDiscord | <treeform> Are you asking me? vmath's Vec2 are not array[2, T] they are an object that holds array[2, T] because its faster due to some C aliasing rules. https://github.com/treeform/vmath?tab=readme-ov-file#vector-and-matrix-representation-and-benchmarks |
18:49:06 | arkanoid | no, I'm not asking you. It's a generic question about limiting the [T] in type declarations, as I successfully do it for procs, but get compile time error if I add them to type declarations |
18:50:08 | arkanoid | treeform, I know, I also tried vmathArrayBased actually, but then I reverted to default object |
18:50:22 | arkanoid | my actual type is `Point*[D: Length] = GVec2[D]` |
18:50:37 | arkanoid | or better `Point*[D] = GVec2[D]`, I'd like to use :Length |
19:22:15 | * | cnx quit (Remote host closed the connection) |
19:23:05 | * | cnx joined #nim |
20:22:05 | FromDiscord | <Elegantbeef> Arkanoid you can use typeclasses for aliases, but that makes no sense |
20:26:25 | * | ntat quit (Quit: Leaving) |
20:35:40 | * | Jhonny2x4 quit (Quit: Jhonny2x4) |
21:32:34 | * | advesperacit quit () |
21:41:54 | * | Jhonny2x4 joined #nim |
21:57:41 | NimEventer | New thread by walkr: -d:thanks, see https://forum.nim-lang.org/t/11206 |
22:15:54 | FromDiscord | <Robyn [She/Her]> I wonder... Would it be better to fork Mummy or to make my own HTTP library, since I'm wondering rn how hard it'd be to make it so Mummy uses cps under the hood |
22:16:27 | FromDiscord | <Robyn [She/Her]> I haven't read much of Mummy's code though, so maybe it's a much harder task then I'm assuming it to be |
22:16:36 | FromDiscord | <Robyn [She/Her]> Time to read |
22:17:14 | FromDiscord | <Robyn [She/Her]> And I'd need to actually see if there's any reason why I should fork it in the first place instead of just, using it |
22:19:17 | arkanoid | Elegantbeef: why that would not make sense? `Point*[D: Length] = array[2, D]` seems perfectly reasonable to me |
22:21:06 | FromDiscord | <Robyn [She/Her]> Honestly think I'd probably be better off using Mummy, and then just making a cps HTTP server as a tinkering project at some point |
22:43:56 | FromDiscord | <Robyn [She/Her]> Anyone able to recommend a library that has query builders for SQL (preferably supporting PostgreSQL and SQLite) that doesn't rely on async? |
22:49:58 | FromDiscord | <Robyn [She/Her]> Oh looks like I can just grab the query string from allographer then pass it into a separate lib |
22:52:00 | FromDiscord | <Robyn [She/Her]> Seems hacky though |
23:00:50 | * | jmdaemon joined #nim |
23:01:22 | FromDiscord | <dedraiaken> In reply to @chronos.vitaqua "Oh looks like I": Looked at Norm? |
23:02:04 | FromDiscord | <Robyn [She/Her]> I'm looking at that now, actually! Thanks though! |
23:13:14 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=nHJpMbekcHMb |
23:13:32 | FromDiscord | <Robyn [She/Her]> Oh wait |
23:13:38 | FromDiscord | <Robyn [She/Her]> Just missed something in the docs |
23:14:06 | FromDiscord | <Robyn [She/Her]> `uniqueGroup` has no examples though, so still a tad confused |
23:14:12 | FromDiscord | <ricky._.spanish> @treeform your websocket library is a beast i love it |
23:16:28 | FromDiscord | <Robyn [She/Her]> Ah okay, looked at a test and it makes sense now |
23:17:25 | FromDiscord | <Robyn [She/Her]> Though, seems like a small oversight to not allow for multiple column combinations to be unique |
23:17:40 | FromDiscord | <Robyn [She/Her]> So `a,b` could be unique and `c,d` |
23:17:54 | FromDiscord | <Robyn [She/Her]> Not doing that in my usecase but just something I'm mentioning |
23:22:54 | FromDiscord | <someone.one> Quick question, is there any other way to initialise a multi dimensional array except just looping over the values? |
23:23:32 | FromDiscord | <Elegantbeef> Manually declaring all the elements 😄 |
23:26:01 | FromDiscord | <someone.one> Can't really do that for something like a 100x100x100 array 😢 |
23:26:16 | FromDiscord | <Elegantbeef> Are you just trying to init them to the same value? |
23:26:55 | FromDiscord | <someone.one> Yes, the same value for all the elements |
23:28:55 | FromDiscord | <Robyn [She/Her]> Aaaand PostgreSQL doesn't support blob data still :| |
23:29:07 | FromDiscord | <Robyn [She/Her]> (With Norm) |
23:29:17 | FromDiscord | <Robyn [She/Her]> Not hard to do that but again, a small oversight :P |
23:29:33 | FromDiscord | <Elegantbeef> Yea you have to iterate over them or make a nice proc that does |
23:29:37 | FromDiscord | <Robyn [She/Her]> Probably because PostgreSQL requires you to input the binary data as hex |
23:31:29 | FromDiscord | <someone.one> In reply to @Elegantbeef "Yea you have to": Cool, thanks 👍 |
23:31:33 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=XfknvMuELepf |
23:31:35 | FromDiscord | <Elegantbeef> A fun solution |
23:32:01 | FromDiscord | <.bobbbob> In reply to @Elegantbeef "Yea you have to": I made just that https://codeberg.org/bobbbob/generate |
23:32:28 | FromDiscord | <Elegantbeef> I see nested sequences so I'll just pretend I didn't see anything 😄 |
23:33:03 | FromDiscord | <.bobbbob> ah he wants array |
23:33:38 | FromDiscord | <Elegantbeef> Would be cooler if you did `proc generate(_: typedesc[T], range: Slice[T], fn: ...): T` |
23:33:50 | FromDiscord | <Elegantbeef> I guess `range` should be `openArray[T]` |
23:34:11 | FromDiscord | <Elegantbeef> then you could do like `Table[string, int].generate(someCollection, ...)` |
23:34:27 | FromDiscord | <Elegantbeef> You get a nice general purpose API that can be extended for anything |
23:35:22 | FromDiscord | <Elegantbeef> A more compelling example is you could do `array[10, bool].generate(true)` |
23:35:49 | FromDiscord | <Elegantbeef> Though this is hard to generalise in a useful way I guess |
23:37:13 | FromDiscord | <.bobbbob> yeah I only made it to solve project euler questions lol |
23:37:43 | FromDiscord | <Elegantbeef> I dumbly attempt to extract everything i write to the most general purpose solution |
23:39:36 | FromDiscord | <.bobbbob> hey that's the dont repeat yourself principle |
23:42:33 | arkanoid | just realised that arraymancer has no inner logic to never print something that would crash the program https://play.nim-lang.org/#pasty=bxdeVaKUTanf |