00:00:02 | * | junland quit (Quit: %ZNC Disconnected%) |
00:00:22 | * | apahl joined #nim |
00:03:20 | * | junland joined #nim |
00:18:38 | * | vicfred joined #nim |
00:28:49 | Prestige | I'm having some trouble figuring out why this isn't compiling https://github.com/avahe-kellenberger/astroships/blob/2-Architecture/tests/api/tlayer.nim#L10 "Unhandled exception: invalid object conversion [ObjectConversionError]" |
00:29:22 | Prestige | TestEntity is an extension of Entitiy, so I thought I could cast it. Is there a way to do this? |
00:32:25 | Prestige | Or do I need to implement a new proc to create an instance of a "subclass", even though I just want to execute to behavior of the super class |
00:35:48 | jonjitsu[m] | What IDE+plugins gives the best intellisense? |
00:38:38 | Prestige | vscode and vim both have decent plugins |
00:42:50 | FromDiscord | <Yardanico> neovim |
00:42:52 | * | opal joined #nim |
00:42:58 | FromDiscord | <Yardanico> (adding to the above ( |
00:43:21 | FromDiscord | <Yardanico> @jonjitsu most plugins rely on nimlsp or nimsuggest, so the quality of autocompletion will mostly be the same |
00:44:04 | FromDiscord | <nikki> working through dom's book and am at the twitter one now. just to check -- do other people also have nimlsp have trouble in jester route macros? |
00:51:53 | * | mbomba quit (Quit: WeeChat 2.9) |
01:01:05 | * | Axiomatic quit (Remote host closed the connection) |
01:06:32 | * | krux02 quit (Remote host closed the connection) |
01:23:13 | * | abm quit (Quit: Leaving) |
01:46:04 | leorize[m]1 | Prestige: sadly, yes, you need a new proc for the subclass |
01:51:10 | Prestige | leorize[m]1: dang, okay |
01:56:15 | * | maxrazer joined #nim |
01:56:17 | * | maxrazer left #nim ("Leaving") |
02:12:20 | disruptek | gyllou: pretty sure weave's channels are custom. |
02:12:34 | disruptek | ping @gyllou |
02:12:41 | disruptek | our channels are simple memcpy. |
02:13:37 | disruptek | which is to say, the buffer may be shared, but it requires a copy to move stuff from one thread to another via the channel. |
02:21:57 | * | apahl quit (Ping timeout: 260 seconds) |
02:23:37 | * | apahl joined #nim |
03:06:23 | * | opal quit (Ping timeout: 240 seconds) |
03:06:38 | * | bung quit (Read error: Connection reset by peer) |
03:10:16 | * | opal joined #nim |
03:23:12 | * | muffindrake quit (Ping timeout: 260 seconds) |
03:25:01 | * | muffindrake joined #nim |
03:35:53 | FromDiscord | <nikki> is there some template / macro to embed the bytes of a file as a string at compile time |
03:36:11 | FromDiscord | <nikki> eg. to embed a '.png' file that you're gonna display. obv. you can have the file nearby at runtime and read it. but embedding is kinda nice some times. |
03:45:47 | FromGitter | <iffy> I'm trying to use asyncdispatch stuff on Android. https://nim-lang.org/docs/selectors.html says that Android isn't fully supported. This issue https://github.com/nim-lang/Nim/issues/5094 makes me think that modern versions of Android (i.e. those with `signalfd.h`) should work fine. And in fact, when I compile my Nim-generated C with Android NDK, Android v14 fails to build for lack of epoll, but Android v21 builds fine. |
03:45:48 | FromGitter | ... Does the "(except for Android)" part on the selectors docs need to be clarified? |
03:45:48 | disbot | โฅ Android support for upcoming/asyncdispatch |
03:46:29 | FromGitter | <iffy> And should this line change? https://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/selectors.nim#L37 |
03:49:21 | FromDiscord | <hobbledehoy> @nikki I've always used readFile with a const variableโตdon't know how well it would work for image files though since readFile only returns a string |
03:49:57 | Prestige | wa |
03:50:00 | Prestige | woops |
04:04:01 | FromDiscord | <hobbledehoy> (edit) @nikki I've always used readFile with a const variable (you could just use a static block instead I think)โตdon't know how well it would work for image files though since readFile only returns a string |
04:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
04:06:34 | * | supakeen joined #nim |
04:12:03 | FromDiscord | <ElegantBeef> @nikki `staticRead` or `slurp` |
04:14:28 | FromDiscord | <ElegantBeef> @hobbledehoy it works completely fine as strings are afterall just fancy byte sequences |
04:21:49 | FromDiscord | <hobbledehoy> Ah okโตWhat does slurp do that's different to readFile? Is it the checking that it ran at compile time only? |
04:22:04 | FromDiscord | <ElegantBeef> It's a staticRead alias |
04:22:22 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
04:23:58 | FromDiscord | <hobbledehoy> Misread the docs, thought it was the other way around |
05:10:54 | FromDiscord | <nikki> nice, thanks folks ๐ฎ |
05:19:59 | FromDiscord | <ElegantBeef> Damn hitting VM iteration limits ๐ฆ |
05:20:42 | * | mbomba joined #nim |
05:24:07 | * | vicfred quit (Ping timeout: 246 seconds) |
05:24:40 | leorize[m]1 | disruptek: I got this working if you wanna try: https://github.com/alaviss/setup-nim |
05:25:03 | leorize[m]1 | my test matrix is somehow even bigger than nightlies build matrix :P |
05:26:45 | FromDiscord | <flywind> I find `Karax` is not as flexible as `React` when constructing UI library, |
05:27:22 | FromDiscord | <flywind> But it is acceptable I guess. |
05:27:30 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=2BUs |
05:29:39 | FromDiscord | <shashlick> @leorize I might be your first user |
05:32:34 | leorize[m]1 | I would appreciate it :) |
05:33:41 | leorize[m]1 | fun fact, I build nimterop as part of the test suite |
05:47:18 | * | oculuxe joined #nim |
05:48:22 | * | oculux quit (Ping timeout: 256 seconds) |
05:56:00 | Prestige | I'm looking at examples of concepts, curious about how this example works witih generics https://gist.github.com/honewatson/583135c1b191119a3b3be3fdbfe8607b |
05:56:23 | Prestige | Why doesn't toString[T] complain about data.name and data.kind? |
05:59:48 | * | solitudesf joined #nim |
05:59:51 | mipri | it doesn't know anything about data except that it's some kind of type, so it accepts it |
06:00:11 | Prestige | Interesting. I thought it would be more strict |
06:00:25 | mipri | no, concepts are about adding that strictness |
06:01:15 | Prestige | I mean, it seems you could compile toString on any object with that generic proc, but would just fail at runtime. Is that right? |
06:01:40 | mipri | no, it still fails at compile time |
06:02:08 | FromDiscord | <ElegantBeef> Generics only generate code when they're called, so when you call it it'll error |
06:02:27 | Prestige | Hm, cool |
06:02:58 | FromDiscord | <ElegantBeef> It's ducktyping in action where you can use any kind that has name/kind |
06:03:24 | Prestige | I need to start using concepts |
06:03:39 | FromDiscord | <ElegantBeef> Yea generics/concepts are nice |
06:08:06 | Yardanico | !status |
06:08:08 | FromDiscord | Uptime - 4 days, 10 hours, and 31 minutes |
06:12:51 | Prestige | Hm okay maybe they are more limited than I had hoped |
06:13:40 | FromDiscord | <ElegantBeef> What's your issue? |
06:15:18 | Prestige | I created an `Entity` concept with a few procs, then tried using a seq[Entity] to iterate over them and invoke their procs |
06:15:34 | Prestige | getting type mismatch: got <Entity> but expected 'Entity' |
06:15:55 | FromDiscord | <ElegantBeef> Is entity a concept? |
06:15:59 | Prestige | Yes |
06:16:05 | FromDiscord | <ElegantBeef> Concepts cannot be used at runtime |
06:16:17 | FromDiscord | <ElegantBeef> They're a compiletime construct |
06:16:18 | Prestige | ah |
06:17:15 | mipri | say you write `proc foo[T](n: T): T = n + n`, and you also define + over strings. then you can call this proc with a string. But if the proc accepts a concept instead of anything, then the concept can require other operations than + so you get a compile error even though string addition works |
06:17:49 | mipri | or even just `NotString = concept x`, `x is not string` |
06:18:03 | FromDiscord | <ElegantBeef> Yea concepts are fantastic tools to abstract across multiple objects dynamically |
06:18:24 | mipri | they're additional checks. and one benefit is that you get a failure earlier than later. It's not the C++ sprawl of "something very deep inside this rat's nest of templates didn't like that" |
06:19:55 | mipri | and maybe the name of the concept is a better hint than "something couldn't eventually couldn't add these two things" |
06:21:47 | FromDiscord | <ElegantBeef> Prestige i assume you trying to get interfaces? |
06:22:41 | Prestige | Yeah pretty much. It's fine though, I have another way I was going to use anyway |
06:22:51 | Prestige | just wondered if concepts would work |
06:22:59 | FromDiscord | <ElegantBeef> There is the streams way |
06:23:10 | Prestige | Streams? |
06:23:52 | FromDiscord | <ElegantBeef> The way that streams makes an interface is having `readDataImpl` and `setDataImpl` which are assigned when you call `newStringStream` or any other constructor to the one they're supposed to be |
06:24:25 | Prestige | That's interesting |
06:24:28 | FromDiscord | <ElegantBeef> A quick visible example is this lotsa boilerplate but a macro could make it nicer https://play.nim-lang.org/#ix=2BxR |
06:24:43 | FromDiscord | <ElegantBeef> Also there are modules for quick interfaces |
06:24:48 | FromDiscord | <ElegantBeef> Interfaced is one i know of |
06:25:11 | FromDiscord | <ElegantBeef> https://github.com/slangmgh/interfaced |
06:25:35 | Prestige | If I get the time I really want to try creating my implementation of MI with macros. I don't even know if it's possible though |
06:26:37 | FromDiscord | <ElegantBeef> I dont think you can due to the branches converging and you can only have a single parent, although you can just make a new object of that parent so instead of a diamond you get sibling of the two you want to inherit from |
06:28:17 | Prestige | Have you read the paper 4raq linked on my RFC? I think most of it could be implemented, but having to read the code that's already written as a "method", idk if you can do that |
06:28:35 | Prestige | Haven't looked into it |
06:28:36 | FromDiscord | <ElegantBeef> I've not |
06:28:56 | Prestige | It's only 6 pages I think, was a good read |
06:32:31 | * | mal`` quit (Quit: Leaving) |
06:34:31 | FromDiscord | <ElegantBeef> Ah the twin objects is sorta what i was describing |
06:35:13 | FromDiscord | <ElegantBeef> I said make it a single container which wouldnt work, but shhhh ๐ |
06:39:57 | Prestige | Hehe |
06:40:16 | Prestige | Cool idea though, I think this implementation would be great |
06:40:35 | Prestige | We'd get pretty cheap & useful MI |
06:41:06 | Prestige | I just have almost no experience with macros, is the problem |
06:41:55 | FromDiscord | <ElegantBeef> I do have experience with them... but do i really want to make MI |
06:43:59 | * | Prestige says yes |
06:44:02 | * | mal`` joined #nim |
06:44:13 | Prestige | If only my jedi mind tricks worked on beef |
06:44:17 | FromDiscord | <ElegantBeef> I mean it's evil incarnate |
06:44:56 | Prestige | I think it's great in the right application. It would be very powerful |
06:45:12 | FromDiscord | <ElegantBeef> So is a tank |
06:45:22 | FromDiscord | <ElegantBeef> Doesnt mean i'm going to code using a tank |
06:46:11 | FromDiscord | <ElegantBeef> Also we create so many objects really quickly if i understand it properly |
06:46:40 | Prestige | Yeah that seems to be the premise of that implementation |
06:47:20 | FromDiscord | <ElegantBeef> Cause if you have A, B ,C and you have D = B | C you now hoave DB DC, then if you do E = D | A you have EDCA, EDBA |
06:50:06 | Prestige | wait but don't B and C extend A |
06:50:16 | FromDiscord | <ElegantBeef> Not in my example |
06:50:23 | Prestige | oh ok |
06:52:29 | * | Axiomatic joined #nim |
06:52:33 | * | Axi0matic joined #nim |
06:52:37 | * | Axi0matic quit (Remote host closed the connection) |
06:54:42 | FromDiscord | <ElegantBeef> Using an object variant is the least objectionable imo |
06:55:24 | Prestige | for an implementation of MI? |
06:55:32 | FromDiscord | <ElegantBeef> Yes |
06:55:49 | Prestige | How would that work? |
06:55:59 | FromDiscord | <ElegantBeef> It means you have to define the entire inheritance structure inside a single DSL ๐ |
06:57:41 | FromDiscord | <ElegantBeef> In essence it's not 100% MI ๐ |
06:58:26 | Prestige | I think the implementation described in the paper would be fine tbh |
06:58:42 | FromDiscord | <ElegantBeef> I really dont like the absurd amount of types generated |
06:59:39 | FromDiscord | <ElegantBeef> Can you represent it with 3 types in nim code? |
07:00:20 | FromDiscord | <ElegantBeef> IE C = A | b |
07:00:45 | Prestige | oh, hm well mostly. I can created a representation but not a working example |
07:00:51 | Prestige | create* |
07:01:02 | FromDiscord | <ElegantBeef> Quickly throw it together |
07:02:28 | Prestige | I mean what do you want to see? It would just be a recreation of the examples in the paper |
07:02:51 | FromDiscord | <ElegantBeef> Just the type definition of an C inheritance A and B |
07:03:01 | FromDiscord | <ElegantBeef> "a C" even ๐ |
07:03:49 | Prestige | ..just the type definition? like, type C = ref object of A, B? |
07:04:56 | FromDiscord | <ElegantBeef> I mean the implementation that the MI would require |
07:05:07 | FromDiscord | <ElegantBeef> Just curious of this is it https://play.nim-lang.org/#ix=2BUK |
07:05:16 | FromDiscord | <ElegantBeef> Guess i could've wrote that out ๐ |
07:05:41 | FromDiscord | <ElegantBeef> Forgot the important part actualy https://play.nim-lang.org/#ix=2BUL |
07:07:03 | Prestige | another thing mentioned in the paper is that you don't need CA and CB, you can have A or B hold the reference to C |
07:07:26 | FromDiscord | <ElegantBeef> Doesnt that mean you're adding noise to the Typdefs? |
07:07:43 | Prestige | nah just one less object |
07:08:04 | FromDiscord | <ElegantBeef> Uhh |
07:08:06 | Prestige | that's what this is about https://i.imgur.com/17sUUu8.png |
07:08:28 | FromDiscord | <ElegantBeef> How does removing the CA/CB work though? |
07:09:08 | Prestige | You don't need CA since CB has a reference to A, which has a reference to C |
07:09:52 | Prestige | I fucking love water |
07:09:54 | FromDiscord | <ElegantBeef> "is that you don't need CA and CB, you can have A or B hold the reference to C"โตMade it sound like you were suggesting to add a `c:C` field to the parent classes |
07:10:13 | * | Axiomatic quit (Remote host closed the connection) |
07:10:31 | Prestige | I just meant what that diagram is showing, how A has a ref to C |
07:10:46 | FromDiscord | <ElegantBeef> Yea i see how CA is redundant |
07:10:52 | FromDiscord | <ElegantBeef> Just that phrasing was confusing |
07:11:50 | Prestige | sorry haha. It's late |
07:23:10 | * | arecacea1 quit (Remote host closed the connection) |
07:24:01 | * | arecacea1 joined #nim |
07:30:28 | * | mbomba quit (Quit: WeeChat 2.9) |
07:36:11 | * | NimBot joined #nim |
07:41:54 | * | natrys joined #nim |
07:43:15 | * | xet7 quit (Remote host closed the connection) |
07:43:17 | * | mfiano joined #nim |
07:44:28 | * | xet7 joined #nim |
07:52:59 | FromDiscord | <ElegantBeef> There prestige i've implemented the basis ๐ https://play.nim-lang.org/#ix=2BUS |
07:55:58 | Prestige | interesting |
07:56:07 | Prestige | I'll need to look over this when I'm more awake haha |
08:01:02 | FromDiscord | <ElegantBeef> Still need a bunch of things though, like being able to do `CB.a` to get a value from it, which can just be a proc |
08:01:15 | FromDiscord | <ElegantBeef> But ehh it's not too hard to do imo |
08:02:34 | Prestige | The hard part is implementing the section I explained about the diamond |
08:06:46 | FromDiscord | <ElegantBeef> Uncertan what that is ๐ |
08:07:21 | FromDiscord | <ElegantBeef> Reading is for peopl that actually...want to learn |
08:10:05 | Prestige | haha. well it's the part I'm worried about implementing in macros |
08:12:45 | * | tane joined #nim |
08:26:28 | * | lritter joined #nim |
08:32:03 | * | Vladar joined #nim |
08:57:23 | lbart | hey... why can't I build csource? |
08:57:23 | lbart | ./koch csource |
08:57:23 | lbart | > .../Nim/compiler/msgs.nim(13, 19) Error: cannot open file: std/private/miscdollars |
08:57:23 | lbart | Error: call to nim compiler failed |
08:57:33 | lbart | (on mac and freebsd) |
08:57:43 | lbart | devel and 1.4 |
09:09:45 | Yardanico | well csource building is not really tested I think |
09:09:49 | Yardanico | because they're frozen at 0.20 in the repo |
09:10:00 | Yardanico | you can open an issue |
09:10:59 | lbart | ok, I'm trying to add more platform for netbsd and openbsd so I need to regenerate csource |
09:14:25 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
09:19:41 | * | mfiano quit (Quit: WeeChat 2.9) |
09:19:57 | * | mfiano joined #nim |
09:19:59 | * | mfiano quit (Client Quit) |
09:21:42 | * | mfiano joined #nim |
09:23:26 | leorize[m]1 | Yardanico: it's always tested, nightlies bundles the csources of the same conpiler version |
09:23:34 | Yardanico | oh right |
09:23:36 | leorize[m]1 | compiler* |
09:28:44 | * | mfiano quit (Quit: WeeChat 2.9) |
09:29:30 | lbart | Yardanico: I found the problem... |
09:29:48 | lbart | koch used nim installed |
09:30:29 | lbart | if I remove nim package, I can generate the source with the nim version compiled from scratch |
09:31:58 | Zevv | Is this a bug, and if yes, how can something like this creep in? https://play.nim-lang.org/#ix=2BVK |
09:33:11 | Zevv | Or this one, annotated: https://play.nim-lang.org/#ix=2BVM |
09:33:20 | * | mfiano joined #nim |
09:35:16 | Yardanico | Zevv: weird bug indeed |
09:35:22 | Yardanico | but you can workaround it relatively easily |
09:35:28 | Yardanico | proc foo[A: SomeNumber, B: SomeNumber](a: A, b: B) = |
09:37:17 | Zevv | yeah but it is really nasty because it is so obviously wrong |
09:37:36 | Zevv | and has been since ever |
09:39:12 | Zevv | I'm not even sure what to put in the title for the issue |
09:52:30 | Zevv | Oh wait it is in the manual, dang |
09:53:16 | Zevv | I did not expect this behaviour |
09:53:43 | Zevv | also `proc foo(a: int|float, b: int|float)` is just fine |
09:55:32 | FromDiscord | <lqdev> imagine not using type propagation |
09:56:08 | Yardanico | thanks for using italics |
09:56:34 | FromDiscord | <lqdev> yard did you add formatting support to the bridge? |
09:56:35 | Yardanico | imagine imagining |
09:56:40 | Yardanico | yes but it's a bit buggy |
09:56:46 | Yardanico | but it can convert irc->md and md->irc |
09:56:54 | FromDiscord | <lqdev> cool |
09:56:55 | Yardanico | but buggy |
10:04:49 | FromDiscord | <tomck> sent a long message, see https://paste.rs/lhO |
10:09:31 | FromDiscord | <lqdev> which lib do you want to load? |
10:09:37 | FromDiscord | <lqdev> glfw? cimgui? |
10:09:53 | FromDiscord | <lqdev> the DLLs are defined here https://github.com/nimgl/nimgl/blob/master/src/nimgl/glfw.nim#L16 |
10:11:53 | FromDiscord | <tomck> glfw - so how do i point it to a specific dll? |
10:12:00 | FromDiscord | <tomck> Or do i just need a dll with that name in the root dir? |
10:12:19 | Yardanico | well you can see the code |
10:12:30 | Yardanico | -d:glfwDLL and then just put the dll into the same dir as the binary on windows |
10:12:36 | Yardanico | if you're on windows* |
10:13:24 | Yardanico | and the dll should be named glfw3.dll |
10:15:33 | FromDiscord | <tomck> I can pass that -d:glfwDLL flag to `nimble run` right? Or do i need to target defines to a specific package? |
10:16:44 | ee7[m] | I'm about to create an issue for this: https://play.nim-lang.org/#ix=2BVU . (And I know it works with `newSeq` rather than `newSeqOfCap`). Can somebody give me a nice issue title? |
10:21:58 | FromDiscord | <tomck> sent a code paste, see https://play.nim-lang.org/#ix=2BW8 |
10:22:12 | FromDiscord | <tomck> (edit) "https://play.nim-lang.org/#ix=2BW8" => "https://play.nim-lang.org/#ix=2BW9" |
10:22:48 | FromDiscord | <tomck> other than that it's working, picking up the right dll too |
10:23:13 | FromDiscord | <tomck> i'm on linux with a master build of glfw |
10:23:47 | FromDiscord | <dom96> @tomck that should work fine |
10:23:51 | FromDiscord | <Recruit_main707> nimgl uses an specific glfw version |
10:24:04 | FromDiscord | <Recruit_main707> i guess thats why it errors |
10:24:13 | FromDiscord | <dom96> it sounds like you need a newer glfw dll |
10:24:28 | FromDiscord | <Recruit_main707> wrappers wont magically update by using the latest dll |
10:24:38 | FromDiscord | <tomck> I don't think it's possible to go newer, this is the latest glfw build |
10:24:54 | FromDiscord | <Recruit_main707> you have to go with an older afaik |
10:25:26 | FromDiscord | <tomck> i see - could i just import the C header & get rid of nimgl for glfw altogether? |
10:25:46 | FromDiscord | <Recruit_main707> not really |
10:27:07 | FromDiscord | <Recruit_main707> if you really need to use the latest glfw version, you can try updating the things that changed locally |
10:27:46 | FromDiscord | <Recruit_main707> but thats gonna be more painful than just using whatever version it is supposed to use |
10:28:10 | FromDiscord | <Recruit_main707> there was a nimterop wrapper though |
10:28:33 | FromDiscord | <Recruit_main707> it might use the latest version of glfw |
10:31:31 | FromDiscord | <Recruit_main707> https://github.com/jyapayne/nim-glfw |
10:31:37 | FromDiscord | <Recruit_main707> i think it does |
10:33:22 | FromDiscord | <tomck> So what's the issue with updating the wrapper? I thought nim had some cool c -> nim translation capability for C headers? |
10:33:33 | FromDiscord | <tomck> is glfw just a special case where that doesn't work? |
10:33:58 | FromDiscord | <Recruit_main707> its not a capability, its an external tool |
10:34:23 | FromDiscord | <Recruit_main707> its called c2nim, but it doesnt usually work magically first try and you will need to do some work |
10:34:37 | FromDiscord | <dom96> the code also needs to be changed not to use `glfwRawMouseMotionSupported` |
10:34:53 | FromDiscord | <Recruit_main707> nimterop is similar to c2nim, and seems to have potential to substitute it |
10:35:22 | FromDiscord | <Recruit_main707> (if only i could install it, but it should work fine in your pc) |
10:35:44 | FromDiscord | <tomck> i'm testing out the nimterop version now, why can't you install? |
10:35:53 | FromDiscord | <tomck> @dom96 what do you mean? |
10:36:06 | FromDiscord | <dom96> I guess something in nimgl is trying to use that function? |
10:36:07 | FromDiscord | <Recruit_main707> i get weird errors because something is fucked up in mu computer apparently |
10:36:16 | FromDiscord | <dom96> you could probably get away with avoiding it if possible |
10:36:23 | FromDiscord | <dom96> unless it's necessary and the new glfw has an alternative |
10:36:24 | FromDiscord | <tomck> no i'm trying to use that function |
10:36:35 | FromDiscord | <dom96> tbh it's pretty weird that a newer version would just remove a function like that |
10:36:35 | FromDiscord | <tomck> i think nimgl is out of date |
10:36:41 | FromDiscord | <Recruit_main707> a bit, yeah |
10:36:55 | FromDiscord | <Recruit_main707> i told you it uses an specific glfw version |
10:37:13 | FromDiscord | <dom96> does every glfw version break everything? lol |
10:37:23 | FromDiscord | <tomck> so you're saying the newer glfw DLL i have removes the rawmousesupport function? |
10:37:33 | FromDiscord | <tomck> i'm 99% sure that's not the case |
10:38:02 | FromDiscord | <dom96> Yeah, actually that error may be misleading |
10:38:05 | FromDiscord | <Recruit_main707> no, but either it is renamed, or the parameters change or something esle |
10:38:26 | FromDiscord | <dom96> Nim might just be failing to load the DLL and that is the first function it happens to try loading |
10:38:38 | FromDiscord | <dom96> Are you sure the DLL you have matches the arch of your exe? |
10:38:41 | FromDiscord | <dom96> i.e. both 64bit? |
10:38:48 | FromDiscord | <tomck> no, the program loads when i remove that function |
10:38:48 | FromDiscord | <Recruit_main707> try the nimterop wrapper, it will even install the latest glfw version for you |
10:38:55 | FromDiscord | <tomck> yeah i just compiled it |
10:39:18 | FromDiscord | <tomck> Can i make the nimterop version use a specific glfw? I have a forked version |
10:39:31 | FromDiscord | <Recruit_main707> maybe |
10:40:19 | FromDiscord | <dom96> @tomck are you using other functions from glfw in your program though? |
10:40:26 | FromDiscord | <dom96> if not then the DLL won't even get loaded |
10:40:37 | FromDiscord | <Recruit_main707> i dont know how, you will have to mess with the source code of the wrapper |
10:40:39 | FromDiscord | <dom96> so certainly it'll load |
10:41:40 | FromDiscord | <tomck> Yes, i'm using a bunch of glfw stuff |
10:42:22 | FromDiscord | <tomck> when i comment out thecall to the rawmousesupported stuff, it loads, BUT the constant 'GLFW_RAW_MOUSE_MOTION' is an incorrect value [since glfw errors at runtime & whines about the value] |
10:42:35 | FromDiscord | <tomck> so i'm guessing the glfw header changed? not sure why that causes the function to fail to import |
10:42:52 | FromDiscord | <tomck> As in, i'm guessing the RAW_MOUSE_MOTION constant value changed in the header |
10:43:01 | FromDiscord | <tomck> All this stuff WAS working before i swapped out the DLL |
10:43:12 | FromDiscord | <Recruit_main707> @tomck do you have a released dll in your glfw fork? |
10:43:19 | FromDiscord | <tomck> a released dll? |
10:43:54 | FromDiscord | <tomck> what like an officially built one? No i'm building it, i didn't even realise they distributed prebuilt binaries |
10:44:57 | FromDiscord | <Recruit_main707> if you want to use your fork, you will have to change this urls:โตtry changing this url to yours, but |
10:45:08 | FromDiscord | <Recruit_main707> thats not the right paste :P |
10:45:12 | FromDiscord | <Recruit_main707> https://github.com/jyapayne/nim-glfw/blob/master/src/glfw/glfw.nim#L30-L45 |
10:46:18 | FromDiscord | <tomck> oh so i'll need to fork the nimterop stuff too? |
10:46:27 | FromDiscord | <tomck> then point that to my custom glfw version |
10:46:39 | FromDiscord | <Recruit_main707> nononono |
10:46:49 | FromDiscord | <Recruit_main707> change it locally |
10:47:00 | FromDiscord | <Recruit_main707> in your .nimble directory |
10:47:04 | FromDiscord | <tomck> what in the cached packages? or clone it? |
10:47:12 | FromDiscord | <Recruit_main707> i mean, you can fork it if you want to |
10:47:13 | FromDiscord | <dom96> pretty sure that shouldn't be necessary |
10:47:18 | FromDiscord | <tomck> right okay |
10:47:30 | FromDiscord | <dom96> nimterop will load the DLL too, no? |
10:48:02 | FromDiscord | <dom96> or does your glfw fork have some changes to the header files? (If so, why would you need that?) |
10:48:53 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=2BWj |
10:49:18 | FromDiscord | <tomck> No i just have a new DLL build @dom96 |
10:49:19 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=2BWk |
10:49:44 | FromDiscord | <dom96> @enthus1ast Does SOCKS_VERSION(bt) not work? |
10:49:55 | FromDiscord | <enthus1ast> lemme try @dom96 |
10:50:24 | * | solitudesf- joined #nim |
10:50:34 | * | tane quit (Ping timeout: 260 seconds) |
10:50:53 | * | solitudesf quit (Read error: Connection reset by peer) |
10:51:36 | FromDiscord | <enthus1ast> yes that errors out on invalid value |
10:51:45 | FromDiscord | <enthus1ast> thank you @dom96 |
10:59:24 | * | solitudesf joined #nim |
10:59:25 | * | solitudesf- quit (Ping timeout: 260 seconds) |
11:10:01 | * | h14u joined #nim |
11:23:47 | FromDiscord | <tomck> My GLFW is in /usr/local/XXX rather than /usr/XXX, I'm trying to use the -d:glfwStd define with nimterop to make it fetch my local copy of glfw, but it's still downloading from git every time - do i need to install glfw into usr/XX rather than usr/local/XXX? |
11:33:14 | * | Jesin quit (Ping timeout: 260 seconds) |
11:39:32 | * | shad0w_ joined #nim |
11:40:01 | * | NimBot joined #nim |
11:42:31 | * | krux02 joined #nim |
11:56:11 | FromDiscord | <tomck> aaargh i don't understand, can i not just point a nimterop wrapper to a dll to use?? |
11:57:07 | FromDiscord | <tomck> Even after using a custom nim-glfw nimterop where i remove the glfw3Git define in setDefines, then use -d:glfw3Std, it seems to complain about no build files being found in ~/.cache/nim/nimterop/... |
12:01:00 | FromDiscord | <lqdev> just opened my first ever RFC, thoughts? https://github.com/nim-lang/RFCs/issues/277 |
12:01:03 | disbot | โฅ Extend call-with-block syntax to allow for passing more than one argument to procedures ; snippet at 12https://play.nim-lang.org/#ix=2BWr |
12:05:53 | * | opposite228 joined #nim |
12:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
12:06:46 | * | supakeen joined #nim |
12:07:01 | opposite228 | hi |
12:07:30 | opposite228 | HI |
12:07:45 | opposite228 | !!!! |
12:07:57 | FromDiscord | <Yardanico> hello |
12:08:04 | opposite228 | hi |
12:09:56 | opposite228 | who am i |
12:10:39 | opposite228 | ?? |
12:10:53 | mipri | you're either 822 or -228, depending on what you mean by 'opposite' |
12:11:25 | Yardanico | He's at least a web chat user |
12:11:37 | opposite228 | yes |
12:11:37 | Yardanico | Which is already pretty rare and rings some bells ;) |
12:12:14 | opposite228 | is there any good Windows irc clients? |
12:12:42 | opposite228 | and how to connect to Nim's discord server |
12:12:50 | Yardanico | no, it's fine to use web chat, just ignore what I said |
12:13:00 | Yardanico | https://discord.gg/nim |
12:13:05 | opposite228 | thx |
12:13:29 | * | opposite228 quit (Quit: opposite228) |
12:13:42 | FromDiscord | <ITR> so far my only runtime bugs have been because i check one variable, but modify a different one than the one i checked |
12:14:22 | FromDiscord | <ITR> is there some kind of template i could use to stop me from doing that? i prefer static testing, lol |
12:15:56 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2BWx |
12:15:58 | FromDiscord | <haxscramper> Something like that might work |
12:17:17 | FromDiscord | <haxscramper> Well, actually it does copy, so you probably want to annotate things with `{.bycopy.}` |
12:17:54 | * | shad0w_ quit (Remote host closed the connection) |
12:18:01 | FromDiscord | <ITR> oo, there's a body parameter |
12:18:13 | FromDiscord | <Yardanico> It's not a special construct |
12:18:21 | FromDiscord | <Yardanico> You can name it anything else |
12:18:56 | FromDiscord | <Yardanico> @haxscramper it probably wouldn't make a copy with arc/orc because of cursor inference |
12:19:04 | FromDiscord | <Yardanico> and maybe you can use view types on 1.4 too |
12:20:47 | FromDiscord | <haxscramper> https://play.nim-lang.org/#ix=2BWA |
12:21:28 | FromDiscord | <Yardanico> Yeah byaddr is good too |
12:21:43 | FromDiscord | <Yardanico> Why a macro though? |
12:21:46 | FromDiscord | <haxscramper> Yeah, maybe that will work too, I just haven't touched view types except for single bug report with `Option[]` |
12:22:24 | FromDiscord | <haxscramper> @Yardanico There is some weird interaction with `byaddr` inside of template/`quote do` without interpolation that makes it "undeclared identifier" |
12:22:49 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2BWB |
12:23:11 | FromDiscord | <haxscramper> Probably because of identifier mangling or something like that, I'm not sure if this is a bug |
12:23:23 | FromDiscord | <alehander42> how |
12:23:25 | FromDiscord | <alehander42> are you guyss |
12:23:32 | FromDiscord | <alehander42> blessed day! |
12:24:10 | FromDiscord | <alehander42> today i have to work a bit on non nil |
12:24:16 | FromDiscord | <haxscramper> @Yardanico And I just wanted to ask - do you think view types are stable enough so that I used pattern them in pattern matching? To completely avoid copies (or at least reduce to necessary minimum)? |
12:24:32 | FromDiscord | <haxscramper> When I tried I stubmled upon bug with `Option[lent int]` & codegen |
12:24:33 | FromDiscord | <alehander42> sounds as a good idea! |
12:24:35 | FromDiscord | <Yardanico> I'm not sure, I haven't had enough experience with them either :) |
12:25:39 | mipri | alt: https://play.nim-lang.org/#ix=2BWD |
12:26:31 | FromDiscord | <haxscramper> Alright, I made a PR with whatever garbage I wrote - https://github.com/nim-lang/fusion/pull/33 . @alehander42 I added test suite from gara to pattern matching, I hope this is okay? Just some syntax modifications, but otherwise most of your tests passed with minor changes |
12:26:32 | disbot | โฅ Pattern matching implementation |
12:26:42 | FromDiscord | <alehander42> no problme |
12:26:46 | FromDiscord | <alehander42> coool |
12:28:56 | FromDiscord | <alehander42> i lik `:=` ๐ |
12:33:58 | federico3 | aargh |
12:34:41 | FromDiscord | <Yardanico> rghaa? |
12:34:44 | federico3 | nim doc is trying to do network traffic due to a runnable example inlib/pure/httpclient.nim |
12:35:31 | federico3 | having this kind of side effects while generating docs is quite bad |
12:40:57 | FromDiscord | <haxscramper> Now, just general question on life, universe and everyting: any recommendations of debugging codegen errors? matching test suite passes for nim 1.2.0+ but fails with 1.0.0 on C compilation |
12:43:06 | FromDiscord | <tomck> printf & prayers, same as all bugs |
12:46:14 | FromDiscord | <alehander42> @haxscramper hmm |
12:46:20 | FromDiscord | <alehander42> btw there was |
12:46:26 | FromDiscord | <alehander42> a nimscript debugger attmept |
12:46:27 | FromDiscord | <alehander42> i started |
12:46:32 | FromDiscord | <alehander42> i have it in some branch |
12:46:37 | FromDiscord | <alehander42> very basic |
12:46:53 | FromDiscord | <alehander42> but print and debugging should also work |
12:47:02 | FromDiscord | <alehander42> prayers are generally useful in life โค๏ธ |
13:08:13 | * | tane joined #nim |
13:11:22 | FromDiscord | <LordPoseidon> They aren't but atleast they'll help your conscience |
13:13:42 | FromDiscord | <Rika> theyre useful to certain people |
13:14:39 | FromDiscord | <ITR> sent a code paste, see https://play.nim-lang.org/#ix=2BWP |
13:14:50 | FromDiscord | <Yardanico> no, macros can't change Nim syntax |
13:15:00 | FromDiscord | <Rika> not unless you wrap it in a macro |
13:15:03 | FromDiscord | <Yardanico> although people can misunderstand this statement |
13:15:10 | FromDiscord | <Rika> that doesnt seem to change anything about nims syntax i dont think |
13:15:18 | FromDiscord | <Yardanico> it does |
13:15:18 | FromDiscord | <Rika> but you have to wrap it in a macro call |
13:15:41 | FromDiscord | <Yardanico> well I mean if you wanted it to correctly parse, you would have to modify Nim syntax |
13:15:54 | FromDiscord | <Yardanico> But I'm not sure exactly |
13:16:11 | FromDiscord | <haxscramper> Well, I think you can /technically/ write this as a macro, but it will be just unholy mess of term rewriting crap piled on top of each other |
13:16:24 | FromDiscord | <ITR> so not worth it then, lol |
13:16:45 | FromDiscord | <Rika> you're gonna spend more time on the macro than needed |
13:19:29 | FromDiscord | <ITR> I assume it's gonna be slower compile time too |
13:19:43 | FromDiscord | <ITR> spending longer on the macro doesn't really matter if I can save hours of debugging with it, lol |
13:20:28 | FromDiscord | <alehander42> @LordPoseidon welcome to the channel! if prayers don't get anywhere, conscience wouldn't really matter |
13:20:37 | FromDiscord | <alehander42> yeah |
13:20:52 | FromDiscord | <alehander42> reader macros are not really idiomatic |
13:20:55 | FromDiscord | <alehander42> i think |
13:24:08 | FromDiscord | <ITR> sent a code paste, see https://play.nim-lang.org/#ix=2BWT |
13:24:22 | FromDiscord | <ITR> IMO at least |
13:24:23 | FromDiscord | <Rika> well you don tneed to do that |
13:25:09 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=2BWU |
13:26:44 | FromDiscord | <haxscramper> Another alternative to `{.byaddr.}` and view types is to rewrite body/expression and substitute all ocurrencies of `it` with variable name |
13:26:54 | FromDiscord | <19> hello, i get these [GcMem] warnings with --gc:none but it's hard to detect where in my code they are referring to: https://i.imgur.com/9oYqLls.png |
13:27:07 | FromDiscord | <ITR> oh, interesting, that works |
13:27:16 | FromDiscord | <Recruit_main707> whats because gc:none cant use most of the stdlib |
13:27:24 | FromDiscord | <ITR> nim never fails to surprise me with delightful features |
13:28:43 | FromDiscord | <ITR> hmm, if I use the macro twice in the same scope it complains about it being redefined |
13:28:56 | FromDiscord | <19> oh okay, imma stick to arc |
13:29:21 | FromDiscord | <19> just wanted to see exactly where it was to learn more |
13:30:05 | FromDiscord | <Recruit_main707> what are you trying to do? |
13:30:46 | FromDiscord | <Rika> the (ref exceptn)(msg: ...) stuff seems to be from `newException()` calls or so |
13:30:59 | FromDiscord | <19> nothing, just want to see where those points are to read the std lib and learn more how it works |
13:32:09 | FromDiscord | <Rika> maybe uise --exceptions:quirky or smth |
13:32:53 | FromDiscord | <ITR> sent a code paste, see https://play.nim-lang.org/#ix=2BWW |
13:33:37 | FromDiscord | <Rika> needs a separate macro call i assume |
13:34:21 | FromDiscord | <ITR> what do you mean? |
13:36:58 | FromDiscord | <LordPoseidon> @alehander42 thank you! I didn't get started quite yet with nim, but loving the concept. Will do soon |
13:37:02 | * | Jesin joined #nim |
13:37:33 | mipri | ITR: https://play.nim-lang.org/#ix=2BX0 |
13:37:37 | FromDiscord | <LordPoseidon> As for conscience mattering, nothing does. |
13:38:23 | FromDiscord | <alehander42> nothing does matter? |
13:39:13 | FromDiscord | <ITR> ahh, block there, thank you very much mipri ^^ |
13:40:07 | FromDiscord | <LordPoseidon> Well, on the scale of the universe, does human life mean anything |
13:41:21 | FromDiscord | <LordPoseidon> I'm pretty nihilistic yeah |
13:41:25 | FromDiscord | <LordPoseidon> nvm me |
13:41:38 | FromDiscord | <alehander42> so Ecclesiastes |
13:41:48 | FromDiscord | <alehander42> nihilism is an interesting phase |
13:42:10 | FromDiscord | <alehander42> lacks a lot, tho |
13:42:30 | FromDiscord | <Rika> ~~nihilism isnt a phase just like christianity isnt~~ |
13:47:58 | FromDiscord | <alehander42> apples and oranges |
13:48:03 | mipri | here you go, in Nim: https://play.nim-lang.org/#ix=2BX3 |
13:48:57 | FromDiscord | <Yardanico> You can just write x isnot x |
13:49:04 | FromDiscord | <alehander42> the Bible literally has nihilistic literature inside |
13:49:37 | mipri | Yardanico: Meaning: type expected, but got symbol 'x' of kind 'Var' |
13:49:45 | FromDiscord | <Yardanico> I know |
13:49:53 | FromDiscord | <Yardanico> but no need for typeog |
13:49:55 | FromDiscord | <Yardanico> typeof |
13:50:12 | mipri | with typeof, I get a concept fail error instead of an unrelated error |
13:51:28 | FromDiscord | <Rika> > the Bible literally has nihilistic literature insideโตi know, i wasnt serious about my statement |
13:51:40 | FromDiscord | <Rika> i tend to cross out stuff im not serious about |
13:53:43 | FromDiscord | <alehander42> ๐ |
13:53:47 | FromDiscord | <alehander42> i plan on streaming a bit |
13:55:58 | FromDiscord | <ITR> ah, if I use byaddr I can't use it on immutable values, hmm |
13:56:18 | mipri | when are you going to .inc one of those though? |
13:57:46 | FromDiscord | <ITR> sent a code paste, see https://play.nim-lang.org/#ix=2BX5 |
13:58:10 | FromDiscord | <ITR> but accidentally use the wrong variable instead of pos |
13:58:52 | FromDiscord | <ITR> I guess I could have two different macros for when the argument I don't want to be wrong is supposed to be mutated or not |
14:00:10 | FromDiscord | <LordPoseidon> Ehh |
14:00:26 | FromDiscord | <LordPoseidon> I'm not even sure what's a phase and what's not anymore |
14:01:28 | FromDiscord | <LordPoseidon> @alehander42 doubt |
14:01:53 | FromDiscord | <Rika> lets move that discussion to #offtopic |
14:01:56 | FromDiscord | <LordPoseidon> It's the book literally claiming the universe has been created for man |
14:01:58 | FromDiscord | <LordPoseidon> Thanks |
14:02:03 | FromDiscord | <LordPoseidon> Was about to suggest that |
14:03:00 | FromDiscord | <haxscramper> @ITR you can try to use `typed` argument for macro, then `getType` on it to maybe determine whether or not variable is mutable, or wrap everything in `when compiles(myVar = myVar)` (can only assign to mutable variables) etc. |
14:03:29 | FromDiscord | <haxscramper> Or have to different macros - one for mutable and other for immutable |
14:03:42 | FromDiscord | <alehander42> read Ecclesiastes and some other : it's a collction of at least 66 books, mate, so don't oversimpify it |
14:04:55 | FromDiscord | <alehander42> (continued) |
14:06:43 | FromDiscord | <ITR> when compiles works perfectly, now to finally use this macro x D |
14:06:51 | FromDiscord | <ITR> thanks for all the help everyone ^^ |
14:29:45 | FromDiscord | <Chaz Ashley> sent a code paste, see https://play.nim-lang.org/#ix=2BXd |
14:36:28 | ForumUpdaterBot | New thread by Ggibson: ListFiles() at compile time?, see https://forum.nim-lang.org/t/6984 |
14:38:33 | FromDiscord | <enthus1ast> @Chaz Ashley can you also try with `--danger` |
14:38:38 | FromDiscord | <Rika> d:danger |
14:38:51 | FromDiscord | <enthus1ast> (edit) "`--danger`" => "`-d:danger`" |
14:39:03 | FromDiscord | <Rika> i assume its just JITs being good at this kinda stuff again though |
14:39:15 | FromDiscord | <Rika> (thouugh i dont have much experience on this kinda stuff so eh)\ |
14:39:28 | FromDiscord | <Chaz Ashley> with danger it took 25 seconds |
14:39:54 | FromDiscord | <enthus1ast> are both outputs correct? |
14:40:12 | FromDiscord | <Chaz Ashley> yep, the number of items is the same |
14:41:03 | FromDiscord | <Rika> if we're gonna be kinda pedantic use `import std/monotimes`, keep `import times`, and replace `now()` with `getMonoTime()` |
14:41:36 | FromDiscord | <Chaz Ashley> oh come on, it can't add so many seconds |
14:41:49 | FromDiscord | <enthus1ast> yeah now() is not in hot loop |
14:41:58 | FromDiscord | <Rika> did yall not read the start of the sentence |
14:42:00 | FromDiscord | <Rika> sm |
14:42:01 | FromDiscord | <Rika> h' |
14:42:06 | FromDiscord | <Chaz Ashley> it's probably because of the sequence thing |
14:42:16 | FromDiscord | <Chaz Ashley> my eng is just bad sry lol @Rika |
14:43:14 | FromDiscord | <Rika> `var simples = newSeqOfCap[int](upperlimit div 2); simples.add(2)` then |
14:44:36 | FromDiscord | <Chaz Ashley> same ~25sec |
14:45:23 | FromDiscord | <Rika> then analyze the binary with amd's uprof or intel's v something i dont remember |
14:45:38 | FromDiscord | <Rika> see what actually is bottlenecking you or so |
14:45:50 | FromDiscord | <Chaz Ashley> maybe one day ๐ |
14:49:45 | FromDiscord | <alehander42> can you paste the js one |
14:50:02 | FromDiscord | <alehander42> otherwise, it's hard to compare ๐ |
14:51:04 | FromDiscord | <enthus1ast> int32 |
14:51:08 | FromDiscord | <enthus1ast> gave me 6 seconds |
14:51:12 | FromDiscord | <enthus1ast> from 25 seconds |
14:51:36 | FromDiscord | <alehander42> huh |
14:51:47 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=2BXk |
14:51:50 | FromDiscord | <Rika> did not change much for me |
14:52:36 | FromDiscord | <alehander42> wait, you have a newSeq with initial capacity as well |
14:52:42 | FromDiscord | <alehander42> but also cant be that much |
14:52:55 | FromDiscord | <alehander42> but @Chaz Ashley node code |
14:53:01 | FromDiscord | <alehander42> is what is need to find out any differencees |
14:53:03 | FromDiscord | <alehander42> (edit) "differencees" => "differences" |
14:53:11 | FromDiscord | <alehander42> (edit) "is what is need to find out any differences ... " added "(javascript code) ๐" |
14:55:04 | FromDiscord | <enthus1ast> (edit) sent a code paste, see https://play.nim-lang.org/#ix=2BXn |
14:55:47 | FromDiscord | <enthus1ast> (edit) sent a code paste, see https://play.nim-lang.org/#ix=2BXo |
14:56:58 | FromDiscord | <Rika> uprof is pointing me to the `if (i mod simples[j]) == 0:` line being a hot spot |
14:57:10 | FromDiscord | <Rika> makes sense, this is in the double loop |
14:59:10 | * | arecacea1 quit (Remote host closed the connection) |
15:00:25 | FromDiscord | <Rika> though its probably a different story on your machine |
15:00:53 | * | arecacea1 joined #nim |
15:12:46 | FromDiscord | <Chaz Ashley> sent a code paste, see https://play.nim-lang.org/#ix=2BXs |
15:15:45 | * | npgm_ quit (Ping timeout: 240 seconds) |
15:16:12 | FromDiscord | <Chaz Ashley> it's 7sec for me, still twice as fast, but how does it work? doesn't int32 just mean that each number takes up less space? |
15:16:24 | FromDiscord | <Chaz Ashley> @enthus1ast |
15:16:39 | * | d10n-work quit (Read error: Connection reset by peer) |
15:17:09 | * | npgm_ joined #nim |
15:17:15 | * | d10n-work joined #nim |
15:17:41 | FromDiscord | <Chaz Ashley> (edit) sent a code paste, see https://play.nim-lang.org/#ix=2BXv |
15:18:09 | FromDiscord | <Rika> yes and potentially is faster if you're on 32 bit but i believe there is no benefit for 64 bit machines |
15:18:43 | FromDiscord | <Chaz Ashley> i'm on 64 bit machine |
15:18:51 | FromDiscord | <Rika> node takes the same amount of time (roughly, +-200 ms) as nim for me |
15:18:53 | FromDiscord | <Rika> 10 seconds each |
15:19:06 | FromDiscord | <Chaz Ashley> sent a code paste, see https://play.nim-lang.org/#ix=2BXx |
15:20:59 | FromDiscord | <Rika> yeah i dont know how you're getting so much slower on your laptop |
15:23:46 | FromDiscord | <alehander42> huh for me |
15:23:50 | FromDiscord | <alehander42> the node version is slower |
15:24:28 | FromDiscord | <alehander42> it's like 19 seconds |
15:25:27 | FromDiscord | <Rika> basically: consistency is hard |
15:26:53 | FromDiscord | <alehander42> to 14-17 secs |
15:26:54 | FromDiscord | <alehander42> for nim |
15:28:07 | FromGitter | <timotheecour> ok to merge https://github.com/nim-lang/Nim/pull/15718 to unbreak CI ? |
15:28:08 | disbot | โฅ workaround #15713 disable freebsd tssl.nim |
15:28:59 | FromDiscord | <alehander42> ~12 secs with danger |
15:29:00 | disbot | no footnotes for `12`. ๐ |
15:29:07 | FromDiscord | <alehander42> i think |
15:29:16 | FromDiscord | <alehander42> jit-ing such code is not hard |
15:29:23 | FromDiscord | <alehander42> so probably v8 does it very well |
15:29:27 | FromDiscord | <alehander42> (if node uses v8) |
15:29:34 | FromDiscord | <Chaz Ashley> it does |
15:29:35 | FromDiscord | <alehander42> and in those cases the algo is what matters |
15:29:48 | FromDiscord | <alehander42> and nim with danger/release seems a bit faster |
15:29:52 | FromDiscord | <alehander42> which is probably expected |
15:31:33 | FromDiscord | <alehander42> but indeed int64 version is dramatically slower |
15:31:39 | FromDiscord | <alehander42> so int32 vs int64 matters |
15:34:09 | FromDiscord | <Rika> for me neither was significantly slower or faster |
15:42:07 | disruptek | lqdev: maybe the style guide needs to be updated. |
15:42:43 | disruptek | Zevv: i don't want to talk about poontang right now. |
15:44:10 | FromDiscord | <Chaz Ashley> do you have a 32bit machine? @Rika |
15:45:26 | FromDiscord | <Rika> no |
15:45:35 | FromDiscord | <Chaz Ashley> ok, ty for the info |
15:58:52 | FromDiscord | <enthus1ast> i can only guess @Chaz Ashley but it could be that the cpu can vectorize 2x32 bit values (or even more depending on the instruction set) into their register and do more operations per cylce |
16:00:15 | FromDiscord | <enthus1ast> or its something else completely ๐ |
16:00:16 | * | guelosk[m] quit (Quit: Idle for 30+ days) |
16:01:11 | * | xet7 quit (Quit: Leaving) |
16:01:15 | FromDiscord | <enthus1ast> the best way to find out, i guess, is to profile the code and run gcc with the "optimization miss" logs enabled, to see where cache misses are etc.. |
16:01:57 | FromDiscord | <Chaz Ashley> Ok, Iโm gonna ask some guys who do asm and other low lvl stuff, Iโll let you know if they know the answer |
16:03:24 | FromDiscord | <enthus1ast> (i mean this and friends `gcc -O3 -fopt-info-missed=missed.all` ) |
16:06:35 | * | hnOsmium0001 joined #nim |
16:10:47 | * | hecanjog quit (Quit: WeeChat 1.9.1) |
16:35:01 | FromDiscord | <Chaz Ashley> it seems to be connected to the cache of the processor, it can store more int32 than int64 or something like thisโตso it means if we want to achieve the best results we should check for processor's cache, I think we have kinda similar CPUs while Rika has something else |
16:39:33 | FromDiscord | <Rika> i got a ryxen 7 2700x |
16:39:37 | FromDiscord | <Rika> ryzen |
16:47:57 | FromDiscord | <Chaz Ashley> sent a long message, see http://ix.io/2BXZ |
16:50:28 | * | natrys quit (Ping timeout: 246 seconds) |
16:52:12 | * | junland quit (Quit: %ZNC Disconnected%) |
16:53:14 | * | tefter quit (Quit: WeeChat 2.9) |
16:54:22 | Zevv | disruptek: i dont know what that is |
16:54:29 | Zevv | and im too lazy to look it up |
16:54:43 | disruptek | aight. |
16:55:00 | * | junland joined #nim |
16:55:32 | * | lritter quit (Ping timeout: 260 seconds) |
16:56:47 | * | TomDotTom joined #nim |
17:12:02 | FromGitter | <deech> Is there a way to make a set of `proc`'s or `func`'s that cannot be overloaded? While overloading is useful it's sometimes nice to have globally unique implementations like Haskell typeclasses. |
17:14:13 | FromDiscord | <haxscramper> You mean globally unique by name? E.g. there can be only one `implementationProcForThisType` regardless of what signature it has? |
17:17:46 | * | natrys joined #nim |
17:19:48 | FromGitter | <deech> Right, for example, `matrix1.mul(matrix2)` has a unique `mul` so there you can't do `matrix1.mul(matrix2, 1, 2, "hello world")`, if you want a different semantics you have have `distinct` matrices and implement `mul` on those. |
17:21:54 | FromDiscord | <haxscramper> No, that is not possible to do AFAIK. You might try to get creative and just make overloads for all other functions, likeโต`proc mul[T1, T2, T3](m: Matrix, t1: T1, t2: T2, t3: T3) = {.error: "Only one overload for mul can exist".}` |
17:22:07 | FromDiscord | <haxscramper> But that is just a hack |
17:22:56 | FromDiscord | <haxscramper> And repeat this for function with 2-20 parameters |
17:24:49 | FromGitter | <deech> Wonder if I could mask it off with `template mul(m1:Matrix,m2:Matrix,rest: varargs[untyped]): untyped = {.error "...".}`. |
17:25:41 | FromDiscord | <haxscramper> You can probably write macro for that |
17:34:10 | FromDiscord | <haxscramper> ~macro |
17:34:10 | disbot | no footnotes for `macro`. ๐ |
17:42:33 | * | gmaggior joined #nim |
17:45:13 | * | bozaloshtsh quit (Quit: ZNC 1.7.5 - https://znc.in) |
17:45:31 | * | bozaloshtsh joined #nim |
17:45:31 | * | bozaloshtsh quit (Changing host) |
17:45:31 | * | bozaloshtsh joined #nim |
17:49:58 | * | natrys quit (Ping timeout: 246 seconds) |
17:51:00 | * | TomDotTom quit (Ping timeout: 258 seconds) |
17:52:49 | * | xet7 joined #nim |
18:01:01 | Zevv | About this latest forum post |
18:01:15 | leorize[m]1 | turns out you can use Nim to bootstrap Nim as long as you compile the entire thing to JS: https://github.com/alaviss/setup-nim/tree/ng |
18:01:50 | leorize[m]1 | shashlick: ^ |
18:01:54 | Zevv | wait what |
18:02:09 | leorize[m]1 | so... should I rewrite the rest of my github actions to Nim? |
18:04:10 | leorize | apparently nodejs can be treated like python nowadays |
18:16:50 | * | h14u quit (Quit: Leaving) |
18:17:11 | * | natrys joined #nim |
18:21:55 | * | waleee-cl joined #nim |
18:22:52 | * | nyaayaya joined #nim |
18:25:24 | * | abm joined #nim |
18:34:39 | ForumUpdaterBot | New post on r/nim by skoink: How do I install the included nim tools from source?, see https://www.reddit.com/r/nim/comments/jhyey0/how_do_i_install_the_included_nim_tools_from/ |
18:40:36 | FromDiscord | <shashlick> @leorize nice idea - where are you going to store the precompiled code |
18:41:43 | leorize[m]1 | @shashlick it's in the 'dist' folder. Apparently that's standard practice so that you got all dependency inlined |
18:41:53 | FromDiscord | <shashlick> We could also consider shipping a distro that doesn't need to compile Nim at all - nodejs would be the only dep |
18:42:42 | leorize[m]1 | if you wanna play with that just clone it, `npm install` and `npm run build` |
18:46:43 | disruptek | shh, we don't support nodejs. |
18:48:02 | disruptek | deech: you could probably do it with term rewriting macros, but this is pretty gnarly. |
18:55:07 | FromDiscord | <shashlick> npm install nim will be fun |
18:55:25 | FromDiscord | <shashlick> Will it create binaries and call gcc as expected |
19:00:02 | FromDiscord | <Rika> cursed |
19:12:24 | FromDiscord | <neow> any update on the 48h nim jam? |
19:14:00 | disruptek | it's an idea i've been kicking around for months; you won't miss it when it goes off. |
19:14:12 | FromDiscord | <neow> oh okay thanks |
19:14:44 | disruptek | we will probably need to do a fair amount of experimentation before we ask people to invest a couple days on it. |
19:14:55 | supakeen | what are you organising? |
19:15:30 | disruptek | i wanted to develop a jam format where we remotely coordinate rapid nim development of stuff. |
19:15:48 | disruptek | and lately i'm thinking about screen sharing, or really, terminal sharing. |
19:15:56 | disruptek | but we stream the shared terminals. |
19:16:22 | disruptek | so it's, like, live pair programming with 4-6 people at a time. |
19:16:34 | supakeen | oh interesting idea sure |
19:16:41 | supakeen | i thought you were talking more along the lines of sprints :) |
19:17:01 | disruptek | well, that might happen, too. we'll see how it works. |
19:17:16 | supakeen | i have some experience from volunteering at europython for the sprints parts |
19:17:19 | supakeen | they're always fun :) |
19:17:25 | supakeen | (we did them online last edition as well) |
19:17:35 | disruptek | nice, you should be in charge. |
19:17:40 | supakeen | lolno |
19:17:44 | disruptek | why not? |
19:18:02 | supakeen | because i'm not much of an organiser but pretty good at doing what other people tell me so i usually just help :) |
19:18:12 | disruptek | maybe you just need practice. |
19:18:31 | disruptek | i, for one, have no experience, so i'd just be asking you all the itme. |
19:18:33 | disruptek | time, too. |
19:18:40 | supakeen | heh i guess that's true too |
19:18:53 | disruptek | so what do we need to do first? |
19:19:32 | supakeen | if you are to do sprints you need a bunch of project maintainers who setup their projects for easy contribution (so some text on how to make a pr/etc and a bunch of tickets that can be done in < a few hours) |
19:19:43 | supakeen | though the same applies if you want to sprint on nim itself :) |
19:21:03 | supakeen | you provide some sort of video chatting/voice chatting thing (discord works fine, we used that as well) and if you wish you do like an introduction and a lunch/end-of-day recap with everyone there so everyone can present what they've done |
19:21:29 | supakeen | i know for me personally i like to go to the sprints after conferences because there's always some tickets i'm good at! |
19:22:03 | supakeen | last europython i implemented map scrolling and collissions for a little game someone was making and i made configuration file logic for some api tester |
19:24:02 | disruptek | right, but think "pair programming". |
19:24:12 | disruptek | that's the twist we want to play with. |
19:24:24 | supakeen | yea i think that's a cool idea too |
19:31:49 | * | Cthalupa quit (Ping timeout: 260 seconds) |
19:32:31 | * | Cthalupa joined #nim |
19:35:50 | FromDiscord | <krisppurg> what does `block:` do in Nim? |
19:36:25 | FromDiscord | <krisppurg> (edit) "do in Nim?" => "do?" |
19:37:24 | FromDiscord | <haxscramper> Creates new lexical scope. With `block someName:` you can also break iteration from particular block, like `break someName` |
19:38:02 | FromDiscord | <haxscramper> Can also be used to convert list of statements into expression |
19:38:17 | FromDiscord | <krisppurg> example? |
19:38:36 | * | Guest94576 joined #nim |
19:38:42 | * | Guest94576 quit (Read error: Connection reset by peer) |
19:38:50 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2BYY |
19:39:05 | FromDiscord | <krisppurg> ah |
19:39:19 | FromDiscord | <krisppurg> thank you. |
19:45:20 | federico3 | "Warning: Package 'compiler' has an incorrect structure." |
19:45:52 | federico3 | sigh, nimble complains even about the compiler |
19:45:57 | Zevv | "Do as I say, not as I do" |
19:48:51 | disruptek | the compiler package should be removed, imo. |
19:49:07 | federico3 | this is not a package but the compiler itself |
19:49:19 | disruptek | i know. |
19:56:37 | * | Vladar quit (Quit: Leaving) |
19:58:48 | disruptek | ~disruptek is unsafe at any speed. |
19:58:49 | disbot | disruptek: 11unsafe at any speed. |
19:58:49 | disbot | disruptek: 11:disruptek: |
19:58:49 | disbot | disruptek: 11an unsafe nil deref |
20:01:38 | Avatarfighter[m] | :disruptek: moment |
20:07:25 | disruptek | finished the bot, fighter? |
20:16:09 | * | luis_ joined #nim |
20:18:26 | * | luis_ quit (Client Quit) |
20:20:25 | FromDiscord | <neow> perhaps a lot of new documentation could be added in those 2 days |
20:21:00 | disruptek | i dunno if anyone wants to watch 6 people write documentation, though. |
20:21:41 | FromDiscord | <neow> I see |
20:22:57 | disruptek | shashlick always has tickets ready for fixing. maybe he can recommend a list or even outline getting nimterop to wrap c++. that would be a huge feat. |
20:24:00 | FromDiscord | <haxscramper> The problem with documentation is that everyone says it is bad, but does not point things like "std/macros might need more documentation for mixin statement limitations" or the like |
20:24:58 | FromDiscord | <haxscramper> Because it is really easy to fix docs actually - this channel is basically 24/7 support for this - asking questions is just filling in lacking parts in documentation |
20:25:02 | FromDiscord | <haxscramper> Generally speaking |
20:25:12 | mipri | except that the answers don't get written down. |
20:25:17 | disruptek | scramper where are you located? |
20:25:53 | disruptek | the answers are written down, but it needs to be easier to search the irc logs for questions. |
20:25:54 | FromDiscord | <Avatarfighter> disruptek: i am working on supporting half the fucking internet with this bot |
20:26:00 | FromDiscord | <haxscramper> chuckles im in danger |
20:26:07 | disruptek | you said it would take a day, tops. |
20:26:19 | FromDiscord | <Avatarfighter> yes |
20:26:23 | disruptek | well. |
20:26:23 | FromDiscord | <Avatarfighter> For 1 site |
20:26:24 | * | ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
20:26:36 | disruptek | only 1 site matters for launch. |
20:26:37 | FromDiscord | <Avatarfighter> i am almost done which is nice |
20:26:37 | FromDiscord | <haxscramper> What bot are you talking about? |
20:26:46 | disruptek | sexbot. |
20:26:51 | FromDiscord | <Avatarfighter> Im making a bot to buy stuff for someone |
20:26:54 | FromDiscord | <Avatarfighter> yes |
20:26:56 | FromDiscord | <Avatarfighter> sexbot |
20:27:10 | disruptek | disbot: want sex? |
20:27:11 | disbot | yep. ๐ |
20:27:21 | disruptek | aight, brb. |
20:27:21 | FromDiscord | <Avatarfighter> oh wow |
20:27:33 | FromDiscord | <haxscramper> ~macro is "Are you really sure you need this?" |
20:27:34 | disbot | macro: 11"Are you really sure you need this?" |
20:28:00 | FromDiscord | <Avatarfighter> hate to say guys but my programming hoodie and socks are on, you all better watch out >:) https://media.discordapp.net/attachments/371759389889003532/770020858470596658/image0.jpg |
20:28:42 | FromDiscord | <Avatarfighter> wow i look ugly actually |
20:29:03 | FromDiscord | <ElegantBeef> Python hoodies make you look atleast 80% uglier, statistically proven |
20:29:08 | FromDiscord | <Avatarfighter> wow |
20:29:15 | disruptek | i see dead people. |
20:29:33 | FromDiscord | <Avatarfighter> as a certified Pythonista I take that as an attack to my religion @ElegantBeef |
20:29:42 | * | luis_ joined #nim |
20:30:07 | FromDiscord | <lqdev> sir this is the nim channel |
20:30:16 | FromDiscord | <Avatarfighter> lmao |
20:30:19 | FromDiscord | <lqdev> we throw python off the cliff here |
20:30:38 | FromDiscord | <ElegantBeef> I throw all dynamically typed langauges off the cliff regardless of where i am |
20:32:18 | FromDiscord | <Avatarfighter> When is the Nimion merch available on nim-lang.org ๐ค |
20:33:22 | * | hyiltiz quit (Quit: hyiltiz) |
20:43:23 | * | natrys quit (Quit: natrys) |
20:43:26 | * | ConfuzzledPython joined #nim |
20:44:06 | ConfuzzledPython | Anyone know how to handle sockets in Nim? I'm coming from python and bashing my head into a wall a wee bit. |
20:44:27 | supakeen | The BSD socket API is about the same between Python and Nim, which bits are confusing? |
20:45:33 | ConfuzzledPython | (Note I'm not super familiar with sockets in python either) I've got a socket address to connect to at wss://socket.polygon.io/stocks but when I pass that into the socket.connect funct I get an error. |
20:45:56 | ConfuzzledPython | "nodename nor servname provided, or not known" [OSError] |
20:46:09 | * | ehmry joined #nim |
20:46:11 | disruptek | compile with ssl. |
20:46:28 | ConfuzzledPython | It is compiled with ssl. |
20:46:57 | FromDiscord | <Avatarfighter> are you passing the wss address to the connect proc? |
20:47:21 | supakeen | Specifically, wss indicates that it's a websocket; these are not normal BSD sockets. |
20:47:24 | disruptek | you're writing a ws driver? |
20:47:35 | supakeen | You'd be looking for a way to use *web*sockets :) |
20:47:48 | FromDiscord | <Avatarfighter> if youโre trying to do websocket stuff have you considered using a websocket library |
20:47:51 | FromDiscord | <Avatarfighter> !repo ws |
20:47:52 | disbot | https://github.com/treeform/ws -- 9ws: 11Simple WebSocket library for nim. 15 110โญ 10๐ด 7& 6 more... |
20:48:02 | disruptek | !repo goatlicker |
20:48:03 | disbot | https://github.com/Goatlicker690/Goatlicker690.github.io -- 9Goatlicker690.github.io: 11 15 0โญ 0๐ด & 1 more... |
20:48:13 | ConfuzzledPython | Okay thank god. |
20:48:15 | FromDiscord | <Avatarfighter> ๐ |
20:48:20 | ConfuzzledPython | I didn't realize there were libraries for it. |
20:48:28 | Prestige | goatlicker.. lol |
20:48:32 | ConfuzzledPython | I was looking at the stdlib and dying inside trying to figure it out lol. |
20:48:38 | supakeen | Sure but also don't confuse *web*sockets with sockets (they're like java and javascript) :) |
20:48:39 | FromDiscord | <Avatarfighter> Ahaha |
20:49:06 | FromDiscord | <Avatarfighter> Welcome to nim ๐ ConfuzzledPython |
20:49:16 | ConfuzzledPython | Okay for a relative programming newb, I know what websockets are kinda, but what are sockets? |
20:49:25 | * | hyiltiz joined #nim |
20:49:25 | * | hyiltiz quit (Client Quit) |
20:49:31 | ConfuzzledPython | Lol thank you, I enjoy it a lot better than Python, but still getting used to the landscape. |
20:49:41 | * | hyiltiz joined #nim |
20:49:42 | * | hyiltiz quit (Changing host) |
20:49:42 | * | hyiltiz joined #nim |
20:49:42 | * | hyiltiz quit (Client Quit) |
20:50:36 | supakeen | `sockets` usually refer to BSD sockets which is a sort of standardized API to do network communications. |
20:50:50 | supakeen | websockets are a higher protocol that is implemented over http which are implemented on top of sockets. |
20:51:20 | supakeen | You tend to not want to muck with such low level primitives (same in Python tbh) because then you need to handle all the implementation tidbits yourself :) |
20:51:41 | * | bung joined #nim |
20:52:50 | FromDiscord | <dom96> It depends what your goals are |
20:53:27 | supakeen | If your goal is to send data back and forth reliably it's not a good plan, if your goal is to learn how to write a reliable library for that then maybe. |
20:53:37 | FromDiscord | <dom96> If you want to learn and like learning the hard way, then trying to create an implementation from scratch is a great learning experience ๐ |
20:54:14 | supakeen | But networking is like crypto in a sense of 'I cant break it!' because something doesn't occur on your network! |
20:54:52 | supakeen | You could likely write your entire library without ever running into a short send. |
20:56:07 | FromDiscord | <dom96> What's a short send? |
20:56:21 | FromGitter | <jrfondren> try to send 10 bytes, only send 8 |
20:56:47 | supakeen | A common thing is for `send()` to not be able to copy all data into the sndbuf so it copies less bytes and you need to handle copying the rest. |
20:56:57 | supakeen | If your network is all fast enough you ain't going to run into it (probably). |
20:57:26 | supakeen | My most important argument is always that you're going to implement a protocol on top of your `sockets` *anyways* might as well work on that part :) |
20:57:37 | * | hyiltiz joined #nim |
20:57:37 | * | hyiltiz quit (Changing host) |
20:57:37 | * | hyiltiz joined #nim |
20:57:43 | * | arecacea1 quit (Remote host closed the connection) |
20:57:59 | FromDiscord | <dom96> I mean.. there are different levels here |
20:58:16 | FromDiscord | <dom96> You don't have to write a whole sockets library to get a good learning experience |
20:58:19 | * | luis_ quit (Quit: luis_) |
20:58:40 | FromDiscord | <dom96> Either your sockets block or the async library takes care of the sends for you |
20:58:44 | supakeen | Sure but you also don't need to write a sockets library to learn a bit about sockets. |
20:58:47 | * | solitudesf quit (Ping timeout: 260 seconds) |
20:59:07 | * | hyiltiz quit (Client Quit) |
20:59:17 | * | hyiltiz joined #nim |
20:59:17 | * | hyiltiz quit (Changing host) |
20:59:18 | * | hyiltiz joined #nim |
20:59:28 | * | arecacea1 joined #nim |
20:59:50 | * | sschwarzer joined #nim |
21:00:08 | supakeen | Having done loads of it I don't feel like I'm better at higher level networking because I think I understand BSD sockets at least! |
21:00:56 | FromDiscord | <Avatarfighter> ConfuzzledPython: I hope you got the answer you were looking for and are enjoying the history of sockets ๐ |
21:01:07 | supakeen | Sorry yea, tangent. |
21:01:12 | FromDiscord | <Avatarfighter> hahaa |
21:01:29 | ConfuzzledPython | Lol no I did enjoy that, now just trying to get ws to work for me. : |
21:01:50 | sschwarzer | Hi, I have a problem with creating a (part of a) macro with `quote do:`. Some code is here: https://play.nim-lang.org/#ix=2BZk . I suspect I use the backticks wrong. In the proc definition I want to use the same names as in the tuple in the for loop (before the "in") |
21:02:19 | sschwarzer | I wonder how I need to write this instead. |
21:03:13 | sschwarzer | Of course, an alternative would be to create the `proc` tree as an AST (nested nodes), but I wonder if this can be done in a simpler way. |
21:05:40 | sschwarzer | (The actual body in the usage example shouldn't be relevant.) |
21:10:30 | sschwarzer | Ouch, I think the macro actually works. The error was in the compilation of the return value of the macro (tree is undefined). |
21:10:59 | sschwarzer | Let me try the macro in some real code (unit tests) ... |
21:11:38 | ConfuzzledPython | Kind of annoying that I'm getting an error from the WS library while following the code. |
21:11:52 | * | kinkinkijkin quit (Ping timeout: 260 seconds) |
21:12:33 | ConfuzzledPython | var ws = await newWebSocket(url)echo await ws.receiveStrPacket()socket.close() |
21:13:01 | ConfuzzledPython | That code gets me an error for await being undeclared. |
21:13:37 | supakeen | ConfuzzledPython: Make sure you `import asyncdispatch` |
21:14:15 | sschwarzer | Yes, seems to work. Sorry for the confusion. |
21:14:16 | ConfuzzledPython | Yep I checked that. |
21:14:26 | FromDiscord | <dom96> your code needs to be in an async proc |
21:16:02 | ConfuzzledPython | Thank you. |
21:17:11 | * | ConfuzzledPython quit (Remote host closed the connection) |
21:19:33 | FromDiscord | <Gyllou> does anyone have any experience dealing with SVE2 |
21:29:58 | sschwarzer | Is there a way to dump a tree (AST) if I already have a node object? (`dumpTree` prints the tree for a Nim code block, but I already have a node.) |
21:30:40 | FromDiscord | <haxscramper> `treeRepr()`, `lispRepr()` or `astGenRepr()` |
21:31:20 | sschwarzer | haxscramper: thanks! :-) |
21:34:06 | * | tane quit (Quit: Leaving) |
21:44:08 | * | arecacea1 quit (Remote host closed the connection) |
21:44:48 | * | arecacea1 joined #nim |
21:45:06 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
21:46:49 | * | pbb joined #nim |
21:47:03 | bung | https://github.com/bung87/amysql/issues/8 anyone could give some clues? |
21:47:04 | disbot | โฅ buffered connection |
21:51:26 | sschwarzer | I'm trying to do some error checking in the macro and want to print an {.error ... .} . Here's an example, https://play.nim-lang.org/#ix=2BZL . However, although I can evaluate the tuple length in line 21 and 24, I get a compiler error in line 28: "Error: cannot evaluate at compile time: varTupleLen" . |
21:51:53 | * | liblq-dev joined #nim |
21:52:07 | * | liblq-dev quit (Client Quit) |
21:52:38 | * | liblq-dev joined #nim |
21:53:08 | * | liblq-dev quit (Client Quit) |
21:53:46 | FromDiscord | <lqdev> just use `error("message")` or `error("message", node)` |
21:54:41 | bung | you should turn your if branch to generated code, .len is computed on runtime right ? |
21:56:15 | bung | in your macro you can get nimnode length but not tuple's length |
21:57:07 | sschwarzer | bung: My understanding is that the `len` in the macro is computed at compile time. The `echo` after `let varTupleLen = varTuple.len()` works and is executed for every place where the macro is used. |
21:58:08 | sschwarzer | bung: Getting the Nim node length is almost as good. It's only different by one and _if_ I can subtract one, I'd have the tuple length. |
21:59:15 | bung | get nim node length then you code will work as you expected |
21:59:56 | sschwarzer | lqdev: That's odd, when I use {.error: "invalid tuple length ", varTuple .} , it only prints the string "invalid tuple length", but nothing about the node. |
22:00:51 | sschwarzer | bung: But isn't that what I'm doing in line 21 ? (For clarification, varTuple is the node for the tuple.) |
22:02:29 | bung | dont know if the tuple's length match the tuple's node length |
22:02:31 | * | vicfred joined #nim |
22:02:34 | sschwarzer | Anyway, I wonder how to go about error checking in macros. For example, if I write `for (node, level, order, nonsense) in processXml(tree)` instead of `for (node, level, order) in processXml(tree)`, the code still compiles; it just ignores the extra tuple item (which is no surprise from the current macro implementation) |
22:03:26 | sschwarzer | bung: The node has a length 4, the tuple in the code (where the macro is used) has length 3. There's an extra node `Empty` in the tuple node. |
22:03:39 | * | vicfred quit (Max SendQ exceeded) |
22:03:55 | sschwarzer | With tuple length in the code I mean the `for (node, level, order) ...` |
22:03:59 | bung | define the tuple as a cutstom type would be simpler I guess |
22:04:17 | FromDiscord | <lqdev> sschwarzer: `error("invalid tuple length: " & varTuple.repr, varTuple)` |
22:04:19 | FromDiscord | <lqdev> or somethin |
22:04:26 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
22:05:17 | sschwarzer | bung: may be a good idea. That would prevent mistakes because the user gets the order in the tuple wrong. |
22:05:34 | * | pbb joined #nim |
22:06:27 | sschwarzer | bung: may be a good idea. That would prevent mistakes because the user gets the order in the tuple wrong. |
22:06:32 | sschwarzer | oops |
22:07:55 | sschwarzer | lqdev: "Error: string literal expected |
22:07:57 | sschwarzer | " |
22:08:01 | sschwarzer | *sigh* ;-) |
22:09:54 | sschwarzer | lqdev: it seems {.error: ... .} accepts only string constants |
22:10:31 | sschwarzer | That would explain the error message I got before even though I could calculate the node length during compilation |
22:14:14 | sschwarzer | I think there's some confusing between "compile time" as in "during macro expansion" and some other concept of "compile time". :-D I'm not sure. |
22:15:19 | sschwarzer | I saw that I _can_ use {.error: "foo " & $3 .} , so it seems {.error.} works with a constant expression. |
22:16:04 | sschwarzer | However, the tuple length is potentially different for every macro expansion. |
22:17:01 | sschwarzer | Although the macro expansion happens at compile time, that's not what {.error.} wants. ;-) |
22:17:38 | sschwarzer | {.error.} wants something that could be a `const` (my interpretation at least) |
22:18:45 | Prestige | tut2 says --multimethods:on is required for compilation when using them, but I've been compiling without that and it's been working. Is this expected? |
22:19:12 | FromDiscord | <shashlick> @disruptek I've tabled c++ support since @haxscramper has been working on his clang based stuff |
22:19:42 | sschwarzer | bung: I'm actually a bit torn about the macro usage here. On the one hand, it's super nice that it looks like a regular iteration. On the other hand, it does something completely different behind the scenes, which makes me slightly uneasy. |
22:21:45 | sschwarzer | bung: Regarding that, I also wonder if using the object will make the macro much more complicated, but I'll think about it and make experiments. |
22:22:30 | sschwarzer | It's now too late for me to think about this. :) |
22:22:49 | sschwarzer | Thanks for your help anyway, and lqdev, too. |
22:23:03 | FromDiscord | <alehander42> disruptek sharing sounds good |
22:24:58 | * | sschwarzer quit (Quit: leaving) |
22:28:41 | * | hyiltiz quit (Ping timeout: 260 seconds) |
22:30:37 | disruptek | sharon's alright, but her sister susan is incredible. |
22:33:02 | * | xet7 quit (Quit: Leaving) |
22:37:03 | * | xet7 joined #nim |
22:57:00 | * | hyiltiz joined #nim |
22:57:00 | * | hyiltiz quit (Changing host) |
22:57:00 | * | hyiltiz joined #nim |
23:10:45 | * | hyiltiz quit (Ping timeout: 240 seconds) |
23:12:44 | * | hyiltiz joined #nim |
23:12:44 | * | hyiltiz quit (Changing host) |
23:12:44 | * | hyiltiz joined #nim |
23:30:27 | * | gmaggior quit (Quit: Leaving) |
23:40:25 | FromGitter | <timotheecour> any objection to me merging https://github.com/nim-lang/Nim/pull/15718 to unbreak nim CI ? |
23:40:26 | disbot | โฅ workaround #15713 disable freebsd tssl.nim |