00:19:59 | FromDiscord | <auxym> IIRC it's supposed to come at the same time as incremental compilation |
00:24:00 | FromDiscord | <Elegantbeef> It's likely built ontop of ic |
00:24:13 | FromDiscord | <Elegantbeef> So yea it'll be here after IC is usable |
00:35:16 | FromDiscord | <Nilts> How would i check if a filepath is a dynamic library? |
00:37:32 | FromDiscord | <Elegantbeef> Attempt to load it and if it fails it's not a dynamic library |
00:38:21 | FromDiscord | <Nilts> In reply to @Elegantbeef "Attempt to load it": does `std/dynlib` work with `--app:lib`? |
00:43:05 | FromDiscord | <Nilts> also, your soliton seems like it would slow things down |
00:43:45 | FromDiscord | <Elegantbeef> Well that's how you know afaik |
00:44:51 | FromDiscord | <Nilts> would it be better to check file extensions? |
00:45:46 | FromDiscord | <Elegantbeef> A dynamic library can be any extension |
00:47:00 | FromDiscord | <huantian> Time to name my Linux dynamic library dll instead of so |
00:48:05 | FromDiscord | <Elegantbeef> You could check extension, but it's all meaningless really |
00:48:06 | FromDiscord | <Elegantbeef> I can have a dynamic library inside a .png if i wanted to |
00:54:50 | * | dropkick quit (Ping timeout: 255 seconds) |
00:55:52 | FromDiscord | <Nilts> In reply to @Elegantbeef "You could check extension,": I will just enforce a naming convention for nim lib interaction |
00:59:23 | FromDiscord | <MetuMortis> In reply to @not logged in "How would i check": Isn't there any way to load a library? IDK but I believe you can except etc |
01:06:04 | FromDiscord | <demotomohiro> How about to learn file formats of dynamic library and check a content of given file?↵Or use some tools in binutils? |
01:09:06 | FromDiscord | <Elegantbeef> Loadlib returns nil if the library cannot be loaded↵(@MetuMortis) |
01:09:23 | FromDiscord | <Elegantbeef> So it's as simple as call loadlib if it returns nil you carry on however you want |
01:27:00 | FromDiscord | <Dudugz> In reply to @demotomohiro "How about to learn": DLLs and other formats usually have headers, which are information at the beginning of the file to validate them. PNG files work like this, not sure about DLLs |
01:30:12 | FromDiscord | <auxym> https://en.wikipedia.org/wiki/Portable_Executable |
01:30:54 | FromDiscord | <auxym> we even have https://github.com/srozb/peni |
01:33:29 | FromDiscord | <auxym> on linux for ELF you can use binutils stuff or https://www.man7.org/linux/man-pages/man5/elf.5.html |
01:47:20 | FromDiscord | <T0lk1en> yo can someone help me out with nimcrypto. Having a hard time understanding it and cant wrap me head around the examples |
02:13:26 | * | beholders_eye quit (Ping timeout: 246 seconds) |
02:13:36 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4nI8 |
02:14:54 | FromDiscord | <T0lk1en> In reply to @T0lk1en "yo can someone help": Please |
02:27:32 | FromDiscord | <Require Support> sent a code paste, see https://play.nim-lang.org/#ix=4nIb |
02:28:40 | FromDiscord | <Require Support> (edit) "https://play.nim-lang.org/#ix=4nIb" => "https://play.nim-lang.org/#ix=4nIc" |
02:47:59 | FromDiscord | <kots> sent a code paste, see https://play.nim-lang.org/#ix=4nIg |
02:58:07 | FromDiscord | <kots> sent a code paste, see https://play.nim-lang.org/#ix=4nIi |
03:02:24 | * | dropkick joined #nim |
03:27:38 | * | arkurious quit (Quit: Leaving) |
03:32:56 | FromDiscord | <Require Support> much appreciated kind soul |
03:55:30 | * | azimut joined #nim |
04:16:16 | * | pbsds quit (Quit: The Lounge - https://thelounge.chat) |
04:16:58 | * | pbsds joined #nim |
04:30:23 | * | LyndsySimon quit (Ping timeout: 283 seconds) |
04:30:35 | * | LyndsySimon joined #nim |
05:02:01 | * | azimut quit (Remote host closed the connection) |
05:02:42 | * | azimut joined #nim |
05:52:17 | * | dropkick quit (Ping timeout: 255 seconds) |
05:52:27 | FromDiscord | <ringabout> https://media.discordapp.net/attachments/371759389889003532/1073843939452407818/image.png |
05:53:08 | FromDiscord | <ringabout> https://media.discordapp.net/attachments/371759389889003532/1073844114010935318/image.png |
05:56:06 | FromDiscord | <ringabout> `opcNodeToReg` looks quite heavy. |
06:06:09 | FromDiscord | <ringabout> It seems globals are quite slow in the nimscript, but when I put them to a function, it is faster than Python https://media.discordapp.net/attachments/371759389889003532/1073847387367419945/image.png |
06:10:05 | FromDiscord | <ringabout> It seems to apply to Python as well |
06:10:11 | FromDiscord | <ringabout> https://media.discordapp.net/attachments/371759389889003532/1073848403785687080/image.png |
06:16:38 | FromDiscord | <ringabout> https://media.discordapp.net/attachments/371759389889003532/1073850029611155456/image.png |
06:17:12 | FromDiscord | <ringabout> https://media.discordapp.net/attachments/371759389889003532/1073850168203550780/image.png |
06:41:19 | * | GreaseMonkey quit (Remote host closed the connection) |
07:52:50 | FromDiscord | <BobBBob> Is there a way to us nim without the system module? Kind of like rust no_std. Seems like no because there's a lot of fundamental stuff for the language in there. |
07:53:24 | FromDiscord | <BobBBob> (edit) "us" => "use" |
07:53:31 | FromDiscord | <Elegantbeef> Nope 2.0 will have a 'slim' mode that reduces imports |
07:56:56 | FromDiscord | <BobBBob> So what if Im doing code for an embedded thing that doesnt have a c library? |
07:57:53 | FromDiscord | <BobBBob> hypothetically speaking |
07:58:10 | FromDiscord | <Elegantbeef> I do not do stuff that wacky so i cannot say much |
07:59:01 | FromDiscord | <Elegantbeef> https://forum.nim-lang.org/t/9399#61785 |
07:59:39 | FromDiscord | <Elegantbeef> You do not need much of glibc really for basic Nim |
07:59:39 | FromDiscord | <Elegantbeef> Well i guess libc 😄 |
08:01:31 | FromDiscord | <BobBBob> cool |
08:02:56 | FromDiscord | <lantos> sent a code paste, see https://play.nim-lang.org/#ix=4nIP |
08:27:45 | FromDiscord | <ringabout> Seems to be low-hanging fruits => https://github.com/nim-lang/Nim/pull/21351 |
08:30:33 | FromDiscord | <ringabout> if not consideing potential performance downgrades |
08:30:56 | FromDiscord | <ringabout> (edit) "consideing" => "consider" |
08:46:15 | * | Goodbye_Vincent quit (Read error: Connection reset by peer) |
08:46:56 | * | Goodbye_Vincent joined #nim |
08:48:07 | FromDiscord | <System64 ~ Flandre Scarlet> Does the C++ backend work well? |
09:28:25 | FromDiscord | <Phil> Hmmm simple way to transform a seq I know is of length 3 into an array of length 3? |
09:28:39 | FromDiscord | <Phil> Or do I have to do it by hand? |
09:29:57 | FromDiscord | <Rika> you can prolly copymem |
09:31:31 | FromDiscord | <Elegantbeef> `myArr[0..2] = mySeq.toOpenArray(0,2)` |
09:31:56 | FromDiscord | <Elegantbeef> Actually you probably can do `mySeq` without `toOpenArray` |
09:41:05 | FromDiscord | <Phil> Ohhh I tried the range thing the other way around |
09:41:07 | FromDiscord | <Phil> Yeah that one works |
09:47:54 | FromDiscord | <tf00> sent a code paste, see https://play.nim-lang.org/#ix=4nJ9 |
09:48:08 | FromDiscord | <Elegantbeef> Nim doesnt have unions |
09:48:10 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/tut2.html#object-oriented-programming-object-variants\ |
09:48:38 | FromDiscord | <Elegantbeef> https://github.com/alaviss/union or if you really want that type of data |
09:49:36 | FromDiscord | <tf00> Thanks Elegantbeef 🙏! I'll read both resources. Does https://nim-lang.org/docs/tut2.html#object-oriented-programming-object-variants show any idiomatic Nim ways of achieving more or less the same result? |
09:50:07 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4nJa |
09:50:26 | FromDiscord | <tf00> Oops, I see that after you fixed the link, it sends me to the correct section 👌 |
09:50:38 | FromDiscord | <Elegantbeef> Wow a matrix thread, the future is now |
09:50:46 | FromDiscord | <Elegantbeef> God i hate this thread already |
09:51:04 | FromDiscord | <tf00> Haha, it is! |
09:51:14 | FromDiscord | <tf00> Thanks!! Makes sense! |
09:51:42 | FromDiscord | <Elegantbeef> Due to how Nim doesnt force unpacking types inside of a pattern match you cannot share fields |
09:51:48 | FromDiscord | <Elegantbeef> Well field names |
09:52:26 | FromDiscord | <tf00> Yeah, it looks like a bit of extra work to test for the type and then read the correct property but it's not the end of the world |
09:52:40 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/devel/compiler/ast.nim#L780-L800 might be some source of inspiration |
09:53:04 | FromDiscord | <Elegantbeef> I know it's a token vs ast, but it's in the ballpark atleast |
09:53:24 | FromDiscord | <tf00> True, cheers! |
09:53:53 | FromDiscord | <Phil> Next, do we have an Error type that is intended to cover "Shell command returned with exit code 0, some process issue happened" ? |
09:54:11 | FromDiscord | <Phil> Because that ain't a ValueError and skimming through everything else that I get suggested doesn't really seem to fit |
09:54:25 | FromDiscord | <Elegantbeef> OSError? |
09:54:50 | FromDiscord | <Phil> I didn't even get OSError suggested, yeah that fits, good to know that's a thing |
09:56:00 | FromDiscord | <Elegantbeef> But do think whether you need to raise an exception or want to block there |
09:56:31 | FromDiscord | <Phil> Define "block" |
09:56:50 | FromDiscord | <Elegantbeef> I assume you're using execShellCmd or similar |
09:56:53 | FromDiscord | <Phil> Because this is basically "Ma man, you want me to add this nim project to my overview but I can't read a nimble file from there |
09:56:55 | FromDiscord | <Phil> (edit) "there" => "there"" |
09:57:03 | FromDiscord | <Phil> Aye, execCmdEx |
09:57:15 | FromDiscord | <Elegantbeef> Yea that's blocking 😄 |
09:57:28 | FromDiscord | <Phil> "Blocking" as in "Blocking the process"? |
09:57:34 | FromDiscord | <Elegantbeef> Yes |
09:57:55 | FromDiscord | <Elegantbeef> My sentence was worded badly |
09:58:03 | FromDiscord | <Phil> I mean, it is an exceptional circumstance that requires exceptional intervention, so an exception seems valid |
09:58:11 | FromDiscord | <Elegantbeef> "Whether you want to raise an exception and whether you want to block there" 😄 |
09:58:23 | FromDiscord | <Phil> I'm not sure what "blocking" there would look like |
09:58:50 | FromDiscord | <Elegantbeef> I was basically warning that execCmdEx is a blocking operation, so be catious |
09:59:17 | FromDiscord | <Phil> But this time blocking is meant as in "it blocks the entire thread, so gui might hang" ? |
09:59:24 | FromDiscord | <Elegantbeef> Yes |
10:01:43 | FromDiscord | <Phil> `execCmdEx("nimble dump", {poStdErrToStdOut, poUsePath}, nil, projectPath, "") can raise an unlisted exception: Exception` ↵Excuse me what? |
10:02:21 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4nJd |
10:02:30 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4nJd" => "https://play.nim-lang.org/#ix=4nJe" |
10:02:36 | FromDiscord | <Elegantbeef> `raises: [OSError, Exception, ValueError, IOError].}` |
10:02:45 | FromDiscord | <Elegantbeef> You can handle the other ones yourself or throw them all |
10:05:28 | FromDiscord | <Phil> I'll do a CatchableError one because it doesn't matter why that parsing failed, all that matters is that it failed, reraising as OSError |
10:05:45 | FromDiscord | <Phil> (edit) "CatchableError one" => "`etry-catch-CatchableError` block" |
10:05:47 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4nJf |
10:06:01 | FromDiscord | <Elegantbeef> Or whatever error you want to use |
10:06:03 | FromDiscord | <Phil> You read my mind |
10:06:08 | FromDiscord | <Elegantbeef> Making your own error is always better |
10:06:23 | FromDiscord | <Phil> Fair |
10:06:51 | FromDiscord | <Phil> How did nim distinguish between "error" and "exception" again? |
10:06:53 | FromDiscord | <Elegantbeef> Unless the exceptions fit your purpose, it's better to be able to handle or not handle specific exceptions without overlap |
10:07:24 | FromDiscord | <Elegantbeef> A unrecoverable error should be a defect if that's what you mean |
10:07:35 | FromDiscord | <Phil> Nah, nim has as suffix exception, error and defect |
10:07:45 | FromDiscord | <Phil> Defect is error that should break the program |
10:07:46 | FromDiscord | <Rika> exception is deprecated |
10:07:49 | FromDiscord | <Rika> iirc |
10:07:55 | FromDiscord | <Rika> as in the suffix |
10:07:59 | FromDiscord | <Elegantbeef> No one should inherit from exception |
10:08:01 | FromDiscord | <Phil> So custom stuff should be suffixed as error |
10:08:05 | FromDiscord | <Rika> you should either use error or defect as a suffix |
10:08:21 | FromDiscord | <Elegantbeef> One should suffix it and inherit from the proper error |
10:11:40 | FromDiscord | <Phil> ` Error: object constructor needs an object type [object declared in /home/philipp/dev/playground/src/playground.nim(3, 6)]`↵Time to dive into the docs as apparently I need to define an error constructor |
10:11:56 | FromDiscord | <Elegantbeef> No you're just doing the inheritance wrong |
10:12:02 | FromDiscord | <Elegantbeef> How are you calling the raise? |
10:12:07 | FromDiscord | <Elegantbeef> How did you define the type? |
10:13:00 | FromDiscord | <Phil> as a ref-type, that might've been my error |
10:13:05 | FromDiscord | <Elegantbeef> Yep |
10:13:27 | FromDiscord | <Elegantbeef> You do not use `ref` if you're doing `newException` |
10:13:43 | FromDiscord | <Elegantbeef> if you do not use new exception you can since you'd do `raise myException(msg: bleh, ...)` |
10:14:13 | FromDiscord | <Elegantbeef> newException is just a bit of sugar since raising an exception that is typed with a message is most common |
10:14:46 | FromDiscord | <Phil> Dangit, CatchableError doesn't catch raw "Exception" |
10:15:07 | FromDiscord | <Elegantbeef> Of course not |
10:15:07 | FromDiscord | <Elegantbeef> `Exception` should never be raised |
10:15:09 | FromDiscord | <Elegantbeef> Cause it covers all including defects |
10:15:36 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4nJg |
10:15:40 | FromDiscord | <Phil> Then why force me to add it to my raises when Iit should never be raised? |
10:15:43 | FromDiscord | <Elegantbeef> Just to show what newException is really hiding |
10:15:48 | FromDiscord | <Elegantbeef> Cause it's raised inside the proc |
10:16:00 | FromDiscord | <Elegantbeef> Nim tracked it so now you need to use a try except to remove it from being tracked |
10:16:24 | FromDiscord | <Elegantbeef> Nim unlike java automatically annotates what a procedure raises |
10:16:39 | FromDiscord | <Elegantbeef> Somewhere inside that proc it raises a `Exception` |
10:16:51 | FromDiscord | <Elegantbeef> But anyway i now sleep |
10:40:01 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef "https://github.com/alaviss/union or if you": Does it work like C unions? Does it support bitpacking? And can it be used for C interop? |
10:57:45 | FromDiscord | <Phil> Yeah so far I'm convinced that using nimble dump is the only sane way to parse nimble data on your own |
11:36:46 | FromDiscord | <Phil> Actually, scratch that, maybe I can use nimble as a library |
11:50:29 | * | jmdaemon quit (Ping timeout: 255 seconds) |
12:28:54 | FromDiscord | <planetis> In reply to @System64 "Does it work like": there is .union and .bitsize for that |
12:29:03 | FromDiscord | <turbo> What's the name for object type defs with `case` statements in them? |
12:30:18 | FromDiscord | <auxym> object variants |
12:39:28 | * | beholders_eye joined #nim |
12:50:09 | * | dnh joined #nim |
13:04:55 | FromDiscord | <auxym> sent a code paste, see https://play.nim-lang.org/#ix=4nJR |
13:10:30 | * | beholders_eye quit (Ping timeout: 268 seconds) |
13:11:25 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4nJT |
13:24:58 | FromDiscord | <🍵camellia🍵> sent a code paste, see https://play.nim-lang.org/#ix=4nJZ |
13:28:20 | * | xet7 joined #nim |
13:44:29 | FromDiscord | <tf00> sent a code paste, see https://play.nim-lang.org/#ix=4nK4 |
13:49:34 | FromDiscord | <Rika> nim does not have this for enums, we emulate it with object variants |
13:49:47 | FromDiscord | <Rika> see options module for the equivalent implementation |
13:53:23 | FromDiscord | <tf00> Thanks a ton! |
14:10:32 | FromDiscord | <🍵camellia🍵> i feel like a colossal clown finally realising futhark (c wrapper) is not the same as futhark (language)↵i was like "why do i need to use cuda and haskell just to import c libs" |
14:11:10 | FromDiscord | <🍵camellia🍵> not knowing about the nim project |
14:16:57 | FromDiscord | <🍵camellia🍵> sent a code paste, see https://play.nim-lang.org/#ix=4nKi |
14:35:32 | FromDiscord | <ringabout> closure types are reaaaly weird in the VM 😦 |
14:36:35 | FromDiscord | <ringabout> !eval static: (var s: proc (); doAssert s == nil) |
14:36:40 | NimBot | <no output> |
14:37:25 | FromDiscord | <ringabout> !eval static: (var s: proc () = default(proc ()); doAssert s == nil) |
14:37:28 | NimBot | Compile failed: /playground/nim/lib/system/fatal.nim(54, 5) Error: unhandled exception: /usercode/in.nim(1, 54) `s == nil` [AssertionDefect] |
14:38:55 | FromDiscord | <ringabout> How should I handle closure types in the VM? |
14:40:56 | FromDiscord | <ringabout> https://media.discordapp.net/attachments/371759389889003532/1073976936449187872/image.png |
14:56:32 | FromDiscord | <enthus1ast> @treeform\: you where working on an browser \<-\> server based gui framework right? I do not find it anyhwere online, Is it somewhat usable? |
14:56:46 | FromDiscord | <enthus1ast> and is it public? |
15:03:00 | FromDiscord | <iencec> something similar to neel? |
15:04:05 | FromDiscord | <enthus1ast> i think yes |
15:04:33 | FromDiscord | <enthus1ast> but i do not remember 100% |
15:08:27 | FromDiscord | <iencec> I see. well, neel does not seem very active these days. (though they have a PR for switching jester for mummy - interesting.. 😄 ) |
15:17:02 | * | arkurious joined #nim |
15:34:44 | FromDiscord | <Phil> Okay, @ringabout nimble question.↵I have come to the realization I can actually access nimble modules in my project, so I don't have to do the nimble parsing myself!↵The question is, what is the "correct" proc to hand a path to a nimble file and receive parsed output from?↵All the ones I've found want an Option object which seems incorrect to me |
15:35:49 | FromDiscord | <Phil> (edit) "Okay, @ringabout nimble question.↵I have come to the realization I can actually access nimble modules in my project, so I don't have to do the nimble parsing myself!↵The question is, what is the "correct" proc to hand a path to a nimble file and receive parsed output from?↵All the ones I've found want an Option object which seems incorrect to me ... " added "because that one's created in the CLI context" |
15:36:21 | FromDiscord | <ringabout> I know a little about nimble. What info do you want to get? |
15:36:22 | FromDiscord | <Phil> (edit) "nimble" => ".nimble-file " |
15:37:22 | FromDiscord | <ringabout> You might create a fake Option object like Option() |
15:37:24 | FromDiscord | <Phil> Basically everything written in a nimble file:↵Author, version, description, project name, dependencies and ideally also their repo-URLs etc. |
15:37:44 | FromDiscord | <Phil> Playing around with a nimble gui written in owlkettle, thus I basically need all the info |
15:41:23 | FromDiscord | <Phil> Just blank instantiating Options() sadly throws nil access issue |
15:41:25 | FromDiscord | <Phil> (edit) "issue" => "issues" |
15:41:30 | FromDiscord | <ringabout> `getPkgInfo`? |
15:41:36 | * | dnh quit (Quit: Textual IRC Client: www.textualapp.com) |
15:42:11 | FromDiscord | <Phil> Hmm was using `getPkgInfoFromFile` |
15:42:59 | FromDiscord | <Phil> Same for `getPkgInfo` |
15:50:54 | FromDiscord | <System64 ~ Flandre Scarlet> https://github.com/treeform/netty↵If I use that for the client, do I need the same thing for the server? |
15:52:24 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4nKU |
15:52:26 | FromDiscord | <Phil> I'm not sure of the context, initially: What the browser is based on and what the server is based on should be independent, assuming you're not having a framework somewhere |
15:52:58 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4nKV |
15:54:00 | FromDiscord | <enthus1ast> @System64 ~ Flandre Scarlet\: yeah |
15:54:27 | FromDiscord | <enthus1ast> or you speek the protocol netty uses by yourself |
15:54:54 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4nKW |
15:55:04 | FromDiscord | <ringabout> Looks right to me |
15:55:18 | FromDiscord | <auxym> In reply to @System64 "https://github.com/treeform/netty If I use": yes, its using its own protocol |
15:55:34 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @auxym "yes, its using its": Ah alright↵So if I use that, the server is Nim too? |
15:55:38 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4nKZ |
15:56:00 | FromDiscord | <ringabout> You can use absolute path for it. |
15:56:23 | FromDiscord | <ringabout> Then `expandFilename` is not needed. |
15:56:38 | FromDiscord | <ringabout> (edit) "You can use ... absolute" added "an" |
15:57:55 | FromDiscord | <auxym> In reply to @System64 "Ah alright So if": yes? I'm not sure I understand. The server would be a nim program also running netty. |
15:58:26 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright, good to know↵Seems it's optimized for games |
15:59:49 | FromDiscord | <auxym> @ringabout that seems pretty useful. Could we maybe export a single easy-to-use proc from nimble's toplevel that does this work? If needed I can make the PR (copy pasting your code though haha) |
16:00:08 | FromDiscord | <enthus1ast> yes! +1 |
16:00:38 | FromDiscord | <auxym> In reply to @System64 "Oh alright, good to": yes. Treeform has a recent talk on YT on how all his packages can be integrated together to makes games from scratch in nim |
16:01:19 | FromDiscord | <ringabout> In reply to @auxym "<@658563905425244160> that seems pretty": Yeah, I fully agree with you. |
16:01:34 | FromDiscord | <ringabout> PR is appreciated! |
16:01:56 | FromDiscord | <Phil> In reply to @auxym "<@658563905425244160> that seems pretty": Please, I'm trying to replicate that example and struggling |
16:02:08 | FromDiscord | <Phil> It keeps complaining that the file doesn't exist |
16:02:45 | FromDiscord | <ringabout> In reply to @Isofruit "It keeps complaining that": Did you use a full path? |
16:02:49 | FromDiscord | <ringabout> what's your code? |
16:02:51 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4nL4 |
16:04:15 | FromDiscord | <ringabout> In reply to @Isofruit "It keeps complaining that": Let me try out Linux |
16:04:48 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @auxym "yes. Treeform has a": Can be interesting hummm↵Oh god, that's complex, no idea for what language for my backend for my final school project↵I will use Nim for the frond for sure, but what for the back??↵I'm hesiting between NodeJS, Python, Go and Nim |
16:05:23 | FromDiscord | <Phil> In reply to @System64 "Can be interesting hummm": I have only cursory glanced, is this about webdev? Webpages? |
16:05:31 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Isofruit "I have only cursory": Video Game |
16:05:37 | FromDiscord | <ringabout> @Phil hi, btw what's your OS? |
16:05:41 | FromDiscord | <Phil> Arch |
16:06:04 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4nL5 |
16:06:20 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4nL5" => "https://play.nim-lang.org/#ix=4nL6" |
16:08:47 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4nL8 |
16:09:09 | FromDiscord | <Phil> Just removed the author field earlier, you can add it back in |
16:09:18 | FromDiscord | <Phil> (edit) "earlier," => "earlier when posting to here," |
16:09:20 | FromDiscord | <ringabout> I added it back, it works for me |
16:09:34 | FromDiscord | <Phil> when running nimble play? |
16:09:38 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4nL9 |
16:09:53 | FromDiscord | <ringabout> Btw, I use cloned nimb;e |
16:10:01 | FromDiscord | <ringabout> (edit) "Btw, I use ... clonednimble," added "latest" | "nimb;e" => "nimble," |
16:11:39 | FromDiscord | <Phil> Meanwhile for me it created a new random error |
16:11:50 | FromDiscord | <Phil> `/home/philipp/.nimble/pkgs/nimble-0.14.1/nimblepkg/tools.nim(11, 14) Error: cannot open file: compiler/nimblecmd` when running nimble play |
16:12:03 | FromDiscord | <ringabout> `nimble install nimble` works for me too, |
16:12:19 | FromDiscord | <ringabout> In reply to @Isofruit "`/home/philipp/.nimble/pkgs/nimble-0.14.1/nimblepkg": You need to install the Nim compiler as a library. |
16:12:22 | FromDiscord | <Phil> Doesn't work for me either |
16:12:23 | FromDiscord | <ringabout> `nimble install nim` |
16:13:30 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4nLb |
16:13:57 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4nLc |
16:14:17 | FromDiscord | <Phil> Maybe I just already have it installed |
16:14:20 | FromDiscord | <Phil> Hopefully that's the reason |
16:14:50 | FromDiscord | <ringabout> What's your Nim version? |
16:15:09 | FromDiscord | <Phil> 1.9.1 |
16:15:45 | FromDiscord | <ringabout> https://media.discordapp.net/attachments/371759389889003532/1074000796976435300/image.png |
16:16:01 | FromDiscord | <ringabout> I encouter the same problem, but `nimble install compiler` or `nimble install nim` works for me. |
16:16:06 | FromDiscord | <ringabout> (edit) "encouter" => "encoutered" |
16:16:24 | FromDiscord | <ringabout> You might try `nimble install nim --debug`. |
16:18:48 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4nLe |
16:22:46 | FromDiscord | <Phil> I straight up don't understand what's wrong on my end.↵`echo expandFilename("playground.nimble").readFile()` this works.↵`echo getPkgInfoFromFile(expandFilename("playground.nimble"), opt)` this breaks |
16:23:09 | FromDiscord | <ringabout> Are there any stacktraces? |
16:23:52 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4nLg |
16:24:11 | FromDiscord | <Phil> I don't regard a line that doesn't even tell me what it can't find a stacktrace |
16:24:42 | FromDiscord | <ringabout> remove `-d:release` |
16:25:37 | FromDiscord | <ringabout> There are no stacktraces if that switch is enabled., |
16:27:27 | FromDiscord | <Phil> That one I wasn't aware of, huh |
16:27:36 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4nLj |
16:28:09 | FromDiscord | <ringabout> Btw, it is better to remove other options like `--outdir:.` for debugging purposes. |
16:28:34 | FromDiscord | <ringabout> Which might cause troubles |
16:28:56 | FromDiscord | <ringabout> (edit) "Btw, it is better to remove other options like `--outdir:.` ... for" added "etc." |
16:30:44 | FromDiscord | <ringabout> > 0.14.1/nimblepkg/packageinfo.nim(488) iterInstallFiles |
16:30:55 | FromDiscord | <Phil> I inserted an echo before the line inside of `iterInstallFiles` that breaks:↵` echo "Bad evil file: ", file.repr`↵Lead to:↵`Bad evil file: 0x7f5f32af94c0"/home/philipp/dev/playground/src/resources"` |
16:31:17 | FromDiscord | <Phil> I don't quite get where it's getting that dir from |
16:32:15 | FromDiscord | <Phil> ... its the fact I have subfolders that is breaking me |
16:32:47 | FromDiscord | <Phil> so I have a folder `src/resources` or `src/whatever` and somehow it is passing that on ? |
16:33:34 | FromDiscord | <Phil> Ohhhhhhhhhh the binary is under src/ |
16:33:42 | FromDiscord | <Phil> Wait but that shouldn't change things |
16:37:08 | FromDiscord | <ringabout> Probably try with `setNimbleDir(opt)`? |
16:38:12 | FromDiscord | <Phil> That did it.↵The error was likely because nimble transforming the `.nimble` filepath in an unexpected way to me |
16:39:01 | FromDiscord | <ringabout> In reply to @Isofruit "That did it. The": Nice, it is definitelt deserves an API or a nimble package or a post on the stackflow/forum/ |
16:39:01 | FromDiscord | <Phil> But dang it is slow |
16:39:10 | FromDiscord | <ringabout> (edit) "definitelt" => "definitely" | "stackflow/forum/" => "stackflow/forum." |
16:39:58 | FromDiscord | <ringabout> release? |
16:41:05 | FromDiscord | <Phil> Yeah, that makes it bearable, goes down from like 5+ seconds to 1-2 |
16:41:09 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4nLq |
16:41:35 | FromDiscord | <Phil> (edit) "1-2" => "1" |
16:41:43 | FromDiscord | <ringabout> My benchmark shows that in my case, it uses 42ms to parse the nimble file. |
16:42:30 | FromDiscord | <Phil> I think for me it was from compiling to echo with a rate-limited CPU and no --define:release, all of those made it take like 5 secs# |
16:42:48 | FromDiscord | <Phil> Removing the limiter (which I had there to save power) and with the release flag made it useable |
16:43:32 | FromDiscord | <ringabout> I use `echo` too. Today I found `hyperfine` is really handy. |
16:46:36 | FromDiscord | <ringabout> There is probably a nimble package for reading info, irrc |
16:48:09 | FromDiscord | <ringabout> https://github.com/openpeep/pkginfo |
16:48:28 | FromDiscord | <ringabout> It doesn't seem to use nimble API, though. |
16:48:45 | FromDiscord | <Phil> I had looked before, but apparently I did it incorrectly |
16:49:02 | FromDiscord | <Phil> Yeah given I want to make a frontend for nimble I think it makes sense to couple myself to nimble directly |
17:01:10 | * | xet7 quit (Remote host closed the connection) |
17:03:24 | * | PMunch joined #nim |
17:03:46 | FromDiscord | <Phil> Okay, another thing that gets confusing is when your vscode tasks that execute on save literally just use nim 1.6.10 when your CLI version is 1.9.1 |
17:09:28 | FromDiscord | <ringabout> That's weird. |
17:11:41 | FromDiscord | <Phil> I assume it's vscode doing some assumption somewhere |
17:15:00 | PMunch | Maybe it's chosen on install-time of the plugin? |
17:15:34 | * | onetwo joined #nim |
17:16:41 | FromDiscord | <treeform> In reply to @lantos "Hey <@107140179025735680> ": I am not sure what you mean. You want obj to be in a seq when you parse even though its not in a seq but just a single item in the data json? Do you want it to optimally parse Cat some times but as seq[Cat] when data has it that way? Through hooks everything is totally possible. I just don't understand what you need. |
17:17:20 | FromDiscord | <treeform> In reply to @enthus1ast "<@107140179025735680>\: you where working": Sorry its not public, it was not very good and I want to take another stab at it. |
17:18:55 | FromDiscord | <treeform> In reply to @System64 "https://github.com/treeform/netty If I use": Yes, netty speaks its own protocol, both sides have to understand it. |
17:21:54 | PMunch | @camellia, yeah I tried to not conflict with anything relevant. Only after it was released was I made aware of the language.. |
17:34:01 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4nLC |
17:34:42 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4nLC" => "https://play.nim-lang.org/#ix=4nLE" |
17:35:31 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4nLE" => "https://play.nim-lang.org/#ix=4nLF" |
17:38:11 | FromDiscord | <lantos> sent a code paste, see https://play.nim-lang.org/#ix=4nLH |
17:38:31 | FromDiscord | <lantos> (edit) "https://play.nim-lang.org/#ix=4nLH" => "https://play.nim-lang.org/#ix=4nLI" |
17:40:41 | * | derpydoo quit (Quit: derpydoo) |
17:45:19 | * | derpydoo joined #nim |
18:01:32 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4nLO |
18:05:11 | FromDiscord | <Phil> Yeah I'm circumventing the problem by not serializing that data, I'll just serialize the nimble filepath |
18:07:51 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @treeform "Yes, netty speaks its": And I can embed binary data inside? |
18:10:36 | FromDiscord | <albassort> Does web ASM have a dichotomy between executables and library files like C |
18:10:53 | FromDiscord | <albassort> Do I need to make sure I'm compiling it to the library so I could use its functions in JS? |
18:11:05 | FromDiscord | <albassort> (edit) "the" => "a" |
18:13:45 | FromDiscord | <albassort> I made my functions public, hope that's enough |
18:18:01 | FromDiscord | <treeform> In reply to @lantos "Yeah the json response": Here you go, this should work: https://gist.github.com/treeform/4b1e85dab83217e3807315d64f3a5cd7 |
18:19:21 | FromDiscord | <treeform> In reply to @System64 "And I can embed": Yes, that is what I send. I most flatty to send packets with netty: https://github.com/treeform/flatty |
18:21:19 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @treeform "Yes, that is what": Oh god, that means it can take an object, turn it into binary and then I can send it? |
18:21:31 | FromDiscord | <treeform> In reply to @Isofruit "Okay this is weird": Can you make a simpler rero case and open up a jsony bug? |
18:21:51 | FromDiscord | <treeform> In reply to @System64 "Oh god, that means": yes, if its a big object i also compress it |
18:22:14 | FromDiscord | <System64 ~ Flandre Scarlet> wow! and it can restore the object on the client? |
18:22:22 | FromDiscord | <treeform> In reply to @System64 "wow! and it can": yes |
18:22:36 | FromDiscord | <System64 ~ Flandre Scarlet> Oh my god! |
18:22:48 | FromDiscord | <treeform> just toFlatty on server send, fromFlatty on client side |
18:22:50 | FromDiscord | <Phil> In reply to @treeform "Can you make a": I think this is the simplest I'm aware of. I'm also not certain it's a bug, it's just that this is an object within an object within an object and all of them have a fair amount of field and I don't know which things need hooks or what. At most the fault I see I think would be that the information what is missing could be more complete |
18:23:17 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @treeform "just toFlatty on server": This is incredible! it also supports inheritence too? |
18:23:43 | FromDiscord | <treeform> In reply to @Isofruit "I think this is": I don't remember seeing "The following fields must be initialized" is that a new Nim thing? |
18:23:50 | FromDiscord | <Phil> No clue |
18:24:01 | FromDiscord | <Phil> I thought it was a jsony error message up until 5 seconds ago |
18:24:49 | FromDiscord | <treeform> In reply to @System64 "This is incredible! it": I don't know, try it. I don't use classes or methods... so its probably untested. |
18:25:34 | FromDiscord | <System64 ~ Flandre Scarlet> might worth to try |
18:25:59 | FromDiscord | <System64 ~ Flandre Scarlet> But I think I'll go fully on Nim then |
18:27:19 | FromDiscord | <treeform> if it does not open up a Issue and I'll fix it. |
18:27:39 | FromDiscord | <System64 ~ Flandre Scarlet> Alright!↵I might use it for my school work |
18:31:43 | FromDiscord | <lantos> In reply to @treeform "Here you go, this": thanks ❤️ ↵↵I was just starting to make an xmly version of jsony better ask before diving into it, have you already got a jsony xml version? |
18:39:11 | FromDiscord | <treeform> I have started one, big problem is that XML maps poorly to data structures programmers like to use. |
18:42:33 | FromDiscord | <lantos> In reply to @treeform "I have started one,": Yeah haha, thats why I've done something like this xmlStr -parseXml-> json -xml2Json-> jsonStr -jsony-> nimObject |
18:42:59 | FromDiscord | <lantos> (edit) "nimObject" => "nimObject↵that way I get the nice jsony rename/parseHooks" |
18:43:04 | FromDiscord | <lantos> (edit) "rename/parseHooks" => "rename/parse Hooks" |
18:43:13 | FromDiscord | <lantos> (edit) "xmlStr -parseXml->" => "xmlStr-parseXml->" |
18:46:07 | FromDiscord | <lantos> wait are you referring to the xmlSchema or just xml?↵↵but also kind of left to the api response given. I did some CRS tax reporting xml thing that I ended up solving by converting the schema into json/yaml |
18:46:19 | FromDiscord | <lantos> (edit) "wait are you referring to the xmlSchema or just xml?↵↵but also kind of left ... to" added "up" |
19:18:13 | FromDiscord | <turbo> What's an easy way to split a sequence into smaller sequences (in order) of a defined length/stride or less (e.g. `[a, b, c, d, e] -> [[a, b], [c, d], [e]]` |
19:23:21 | * | xaltsc joined #nim |
19:27:16 | FromDiscord | <Phil> Okay, what is this error:↵`Error: The PackageInfo type requires the following fields to be initialized: metaData.`↵It's blocking me now in other matters as well |
19:39:46 | FromDiscord | <treeform> In reply to @lantos "Yeah haha, thats why": https://github.com/treeform/taggy not done yet though |
19:41:09 | FromDiscord | <lantos> In reply to @treeform "https://github.com/treeform/taggy not done yet": ooo |
19:41:32 | FromDiscord | <lantos> Ohhh I see, your doing metamagic |
19:44:40 | FromDiscord | <treeform> Yes |
20:01:17 | FromDiscord | <treeform> but I don't know, again XML just does not map well to programmer data structures |
20:27:38 | FromDiscord | <albassort> In reply to @turbo "What's an easy way": sequtils distirbuye |
20:27:43 | FromDiscord | <albassort> (edit) "distirbuye" => "distributive" |
20:29:01 | FromDiscord | <albassort> (edit) "distributive" => "distribute" |
20:36:43 | * | Zevv joined #nim |
20:43:45 | * | derpydoo quit (Quit: derpydoo) |
20:43:48 | FromDiscord | <Phil> Okay, vscode tasks randomly refusing to use packages from nim 2 when I'm running a `nim c` command is getting beyond annoying |
20:44:05 | FromDiscord | <Phil> (edit) "command" => "task" |
20:48:31 | FromDiscord | <albassort> vscode no longer works on nim |
20:48:32 | FromDiscord | <albassort> for me |
20:48:35 | FromDiscord | <albassort> i've accepted this |
20:49:15 | PMunch | Really? |
20:50:01 | FromDiscord | <albassort> im on #head |
20:50:20 | FromDiscord | <albassort> it the error highlighting barely functions |
20:50:24 | FromDiscord | <albassort> and y'know what? fuck it |
20:50:31 | FromDiscord | <albassort> i dont need it anyway |
20:51:11 | FromDiscord | <turbo> Works perfectly for me with Nim 2 |
20:52:02 | FromDiscord | <albassort> is nim 2 out |
20:52:03 | FromDiscord | <albassort> nannde |
20:52:39 | FromDiscord | <albassort> nim 2 not out |
20:52:39 | FromDiscord | <albassort> fuck iu |
20:55:08 | FromDiscord | <Goat> Nim 2: Electric Boogaloo |
20:59:04 | PMunch | Hmm, this is pretty serious |
20:59:13 | PMunch | VSCode has long been the best editor |
20:59:32 | PMunch | If that falters we don't really have any equally good option |
21:01:00 | om3ga | vscode eats a lot of cpu on both my computers |
21:01:18 | om3ga | and nimsuggest has latency issues with vscode |
21:02:16 | om3ga | why every microsoft product after couple of releases transforms to slow unresponsive software |
21:08:18 | Amun-Ra | given type Type, how can I get the sizeof one of it's members? (compile time) |
21:10:15 | PMunch | om3ga, I would guess corporate gets ahold of it and they start adding in tracking/telemetry, integrate with other MS features/tools, etc. |
21:10:22 | PMunch | And it just slowly bogs down |
21:11:26 | * | jmdaemon joined #nim |
21:11:27 | PMunch | Amun-Ra, `sizeof(MyType.member)` |
21:11:36 | om3ga | PMunch: this is the reason why I hate microsoft |
21:11:38 | PMunch | https://play.nim-lang.org/#ix=4nME |
21:11:39 | Amun-Ra | hmm, that simple? |
21:11:52 | PMunch | Why, you expect things to be hard in Nim? |
21:12:13 | Amun-Ra | right :) |
21:12:42 | om3ga | btw VScode is opensource? |
21:12:48 | Amun-Ra | PMunch: thanks, that was so obvious… |
21:12:54 | Amun-Ra | om3ga: yes |
21:13:20 | om3ga | Amun-Ra: yeah, I opened their git |
21:13:38 | Amun-Ra | om3ga: although VSCode includes some MS blobs, VSCodium is open source in 100% |
21:14:06 | om3ga | I like Geany, but code highlighting in VScode is better |
21:14:27 | Amun-Ra | I'm using vscode/nvim 60/40% of the time |
21:14:29 | om3ga | so in case if VSCodium is the same, I would try it |
21:14:31 | Amun-Ra | I use* |
21:14:33 | FromDiscord | <albassort> @Beef Broccoli https://media.discordapp.net/attachments/371759389889003532/1074075995281305640/image.png |
21:14:46 | FromDiscord | <albassort> how does one get emacsripten to export my functions |
21:15:04 | Amun-Ra | om3ga: I'm not aware if all plugins made by MS itself are available in codium |
21:15:21 | om3ga | Amun-Ra: that popup help annoys me little bit |
21:15:35 | Amun-Ra | om3ga: hmm, what popup? |
21:16:09 | om3ga | kinda help window that appears when you point the mouse arrow on object or the var |
21:17:37 | Amun-Ra | ah |
21:18:26 | Amun-Ra | you can change the delay |
21:19:14 | om3ga | yeah., I'm just too lazy for tweaking |
21:19:47 | Amun-Ra | same here |
21:19:51 | om3ga | also the place where it appears always hides what I type |
21:20:48 | Amun-Ra | for me the biggest con of vscode is lack of replace mode |
21:21:24 | om3ga | what is it? |
21:21:36 | FromDiscord | <Array in ∀ Matrix> i stopped hosting my projects on github and using github integration with vscode maybe i should give vscodium another try |
21:22:03 | Amun-Ra | om3ga: replace mode in vim replaces character under the cursor, does not shift characters on the right |
21:22:35 | om3ga | Amun-Ra: you mean like insert button does? |
21:22:54 | Amun-Ra | om3ga: are you familiar with vim? |
21:23:15 | om3ga | not really, but with vi- pretty familiar |
21:23:23 | om3ga | I understand what you mean |
21:23:50 | Amun-Ra | it works the same in vi, press insert once more to switch from insert mode to replace mode |
21:24:11 | om3ga | yeah, that's what I initially thought |
21:24:44 | Amun-Ra | there's vim plugin in vscode repo, I've never used it |
21:51:08 | FromDiscord | <emanresu3> sent a code paste, see https://play.nim-lang.org/#ix=4nMN |
21:51:45 | FromDiscord | <emanresu3> I don't think it should be Option[T] because it would require the user to pass optional types |
21:51:56 | FromDiscord | <emanresu3> but a lot of methods also seems weird |
21:52:32 | FromDiscord | <Elegantbeef> a `static set[RangeFlag]` or similar |
21:52:51 | FromDiscord | <Elegantbeef> Then either raise an error or return a bool or whatever yo uneed |
21:53:29 | FromDiscord | <emanresu3> how does that work? do you have the documentation? |
21:54:07 | FromDiscord | <Elegantbeef> static are known at compile time so you can check if there are three values |
21:54:12 | FromDiscord | <Elegantbeef> I do not know exactly what this is for |
21:55:37 | FromDiscord | <emanresu3> Is a helper function in Julia, when the function `range()` is specificed with less arguments |
21:57:01 | FromDiscord | <emanresu3> ok, but i'd like to have a boolean for each case if the arguments were passed or not so I can do that logic |
21:57:41 | FromDiscord | <emanresu3> But if that's not idiomic Nim, then what would be the alternative? |
22:02:20 | FromDiscord | <Elegantbeef> I mean why do you need runtime checks for parameters |
22:02:22 | * | greaser|q joined #nim |
22:03:38 | * | greaser|q quit (Changing host) |
22:03:38 | * | greaser|q joined #nim |
22:03:58 | * | greaser|q is now known as GreaseMonkey |
22:06:15 | PMunch | Is there a type in Nim which would better capture the concept of `or`-ing special values in C? |
22:09:49 | FromDiscord | <Elegantbeef> Bitset |
22:09:51 | FromDiscord | <Elegantbeef> 😄 |
22:10:05 | FromDiscord | <Elegantbeef> Otherwise distinct type for your types |
22:11:24 | FromDiscord | <emanresu3> sent a code paste, see https://paste.rs/V2L |
22:11:51 | FromDiscord | <emanresu3> but on that note, can I make named-only parameters in Nim? |
22:13:41 | FromDiscord | <emanresu3> I mean a parameter which you have to call with its name |
22:13:41 | FromDiscord | <Elegantbeef> I'm so confused what the purpose of this is |
22:16:31 | FromDiscord | <emanresu3> I'm trying to rewrite the range feature of Julia in Nim. It lets you create vector of a specific start step and length (1\:2\:10 -\> [1,3,5,7,9]), and on Range.jl there's this helper function that throws an error according to the arguments passed |
22:16:53 | FromDiscord | <albassort> is there anyway to compile nim to a JS library |
22:16:59 | FromDiscord | <albassort> i want my functions to be in there |
22:17:01 | PMunch | @Elegantbeef, for wrapping C libraries |
22:17:10 | FromDiscord | <albassort> without having messed up names |
22:18:18 | FromDiscord | <jmgomez> can you check from nim the length of an arbitrary array in c? Trying to see if I can get the length of a vtable |
22:19:14 | FromDiscord | <albassort> In reply to @jmgomez "can you check from": no because nim arrays become unchecked arrays |
22:19:24 | FromDiscord | <albassort> (edit) "nim" => "c" |
22:19:39 | FromDiscord | <jmgomez> In reply to @albassort "without having messed up": exportc? |
22:19:58 | FromDiscord | <albassort> is this what i've been missing |
22:19:59 | FromDiscord | <albassort> o.o |
22:20:07 | FromDiscord | <jmgomez> In reply to @albassort "no because c arrays": So I guess I need to traverse it and check for nullability hmm |
22:21:02 | FromDiscord | <albassort> be normal and do it the c way lol |
22:21:17 | FromDiscord | <albassort> like god intended |
22:22:31 | PMunch | Hmm, set isn't compatible |
22:24:13 | PMunch | Oh wait, it is |
22:24:14 | PMunch | Kinda |
22:24:52 | PMunch | Sizeof doesn't match |
22:25:34 | Amun-Ra | jmgomez: you can't do that in C, too |
22:26:15 | PMunch | And you can't go above the 16 bit limit |
22:27:03 | PMunch | No idea what C output it makes though |
22:27:16 | PMunch | It might have a type mismatch with a C int |
22:27:47 | PMunch | Oh wait, no it doesn't work |
22:27:52 | PMunch | Hmm, bummer |
22:27:59 | PMunch | The bits would be in the wrong places |
22:28:50 | PMunch | @jmgomez, how would you expect that to work? |
22:29:53 | Amun-Ra | the problem with arrays in C is you can't pass an array to function and retain the type, it becomes the pointer to the first element |
22:31:25 | Amun-Ra | int(*)[3] becomes int* |
22:32:07 | FromDiscord | <Elegantbeef> Distinct type and or the data pmunch |
22:32:51 | PMunch | @Elegantbeef, how would a distinct type help? |
22:33:05 | FromDiscord | <Elegantbeef> Yea this doesnt require runtime checks though |
22:33:17 | FromDiscord | <Elegantbeef> It's more sane than oring integers together |
22:33:43 | PMunch | Well if the C interface expects or'ed integers I kinda have to supply that |
22:34:02 | FromDiscord | <Elegantbeef> Distinct types are interopable with their base type |
22:34:08 | PMunch | I mean in Nim I'd use an enum and a set |
22:34:08 | FromDiscord | <Elegantbeef> It's just a bit of sanity |
22:34:24 | FromDiscord | <Elegantbeef> You can also just convert a nim set to a C set on call |
22:34:37 | PMunch | Sure an enum and a distinct int with procedures to generate it from those enum values would work |
22:34:43 | FromDiscord | <jmgomez> Im not verse in C, my subset of C++ doesnt really include C :P. Im getting the vtable like so: `proc getVTable(obj : UObjectPtr) : VTablePtr {. importcpp: "(void)#".}`↵I want to traverse and look for the address of the functions so on the next reload I can check if I need to replace it (I know the functions names and if the user modify it or not) |
22:34:50 | FromDiscord | <Elegantbeef> https://github.com/beef331/nimassimp/blob/master/src/assimp.nim#L232-L284 this mess |
22:35:11 | FromDiscord | <jmgomez> (edit) "Im not verse in C, my subset of C++ doesnt really include C :P. Im getting the vtable like so: `proc getVTable(obj : UObjectPtr) : VTablePtr {. importcpp: "(void)#".}`↵I want to traverse and look for the address of the functions so on the next reload I can check if I need to replace it (I know the functions names and if the user modify it or not)" => "sent a code paste, see https://play.nim-lang.org/#ix=4nMZ" |
22:35:11 | FromDiscord | <Elegantbeef> the vtable likely doesnt have a terminator |
22:35:16 | FromDiscord | <Elegantbeef> So there isnt any way of knowing whether you need to change it |
22:35:39 | FromDiscord | <Elegantbeef> Objects either point to their vtable or store the index of their element |
22:35:58 | PMunch | @Elegantbeef, why have the LUT instead of giving those values to the enum entries explicitly? |
22:36:13 | FromDiscord | <Elegantbeef> Cause there are overlapping bits |
22:36:22 | PMunch | Ah right |
22:36:25 | FromDiscord | <Elegantbeef> Atleast iirc there were |
22:36:52 | PMunch | Wait |
22:36:55 | PMunch | That shouldn't matter |
22:37:04 | FromDiscord | <Elegantbeef> For nim bitsets? |
22:37:11 | PMunch | A long as you don't have duplicate values |
22:37:12 | FromDiscord | <jmgomez> In reply to @Elegantbeef "the vtable likely doesnt": and there is no way to know when it finish? Even checking by the element? I tried to replace it all but was causing some issues. I think UE does it too when HR but I may be missing something |
22:37:23 | FromDiscord | <Elegantbeef> That's what i mean pmunch |
22:37:34 | PMunch | Ah, probably the issue you ran into is that your values are too big to fit in a Nim set |
22:37:49 | FromDiscord | <Elegantbeef> if you need `0b11` for one flag and `0b10` it's an issue iirc |
22:39:39 | PMunch | Apart from 0x00004000 missing you should be able to just convert the set to an int and pass it on |
22:40:09 | PMunch | And that's easy to get around by just assigning a number one higher that it's supposed to be to 0x00008000 |
22:40:32 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4nN0 |
22:40:56 | PMunch | Yeah |
22:47:44 | PMunch | @Elegantbeef, compare this: https://play.nim-lang.org/#ix=4nN4 |
22:47:52 | PMunch | To this: https://play.nim-lang.org/#ix=4nN3 |
22:49:00 | PMunch | But this only works because each value only sets a single bit |
22:49:15 | FromDiscord | <Phil> er.... do we actually have a preferred naming scheme for files in nim?↵Like prefer camelcase, snake-case or whatever? |
22:49:28 | FromDiscord | <Phil> I know for variables, just not sure for files |
22:49:37 | FromDiscord | <Phil> (edit) "I know ... for" added "we do" |
22:50:04 | PMunch | I guess you could have an enum of all the bits, and then sets with the sub-bits for each value, then you could add together the various sets |
22:50:20 | PMunch | @Phil, like source files? |
22:50:26 | FromDiscord | <Phil> Aye |
22:50:33 | PMunch | All lowercase is the norm |
22:50:39 | PMunch | As in strutils.nim |
22:50:42 | FromDiscord | <Phil> project_top_bar vs projecttopbar vs projectTopBar |
22:50:47 | PMunch | Not strUtils.nim |
22:52:13 | PMunch | Although now that imports are also style insensitive it doesn't matter as uch |
22:52:15 | PMunch | much* |
22:52:32 | FromDiscord | <Elegantbeef> Yea i know pmunch i think it might have been that i dislike not being able to make sensible arrays with it, do not recall |
22:52:43 | FromDiscord | <Elegantbeef> There was a reason i did it |
22:53:18 | PMunch | Sensible arrays? |
22:53:31 | FromDiscord | <Elegantbeef> Contiguous arrays |
22:54:41 | FromDiscord | <Elegantbeef> I do not recall at this moment so... yea 😄 |
23:15:59 | PMunch | Hmm, any way to get a good sloc count for .h files in a GitHub repo? |
23:28:35 | FromDiscord | <hotdog> In reply to @PMunch "Hmm, any way to": Clone the repo and run https://github.com/AlDanial/cloc |
23:29:06 | PMunch | @hotdog, thanks, but I already got a rough estimate with some bash magic |
23:29:38 | PMunch | A simple find with -exec cat and some sed statements to prune out comments and empty lines, passed through wc -l and voila |
23:30:27 | PMunch | Also did a test with `sort | uniq` and there was a surprising amount of equal lines, mostly end brackets I would guess, not sure if people normally count those or not. |
23:30:58 | FromDiscord | <turbo> GitHub uses Linguist, but we use code size, not lines to compute the language stats. For offline analysis, I recommend tokei, which is fast (the fastest) and accurate. |
23:42:59 | PMunch | Man GitHub search sucks.. |
23:43:18 | PMunch | Searched for `coap` amongst my existing repositories, no matches |
23:43:21 | FromDiscord | <System64 ~ Flandre Scarlet> @kraptor Hi! I saw you already ImGUI for Nim, do you know how can I draw a picture on a window please? (I have an array of uint8 that rapresents the picture) |
23:43:25 | PMunch | The repo is called libcoap.. |
23:45:34 | FromDiscord | <Yandall> Hello. Which library is good to |
23:46:17 | FromDiscord | <Yandall> Hello, which library is good to make CRUD actions to a postgres DB? |
23:47:00 | FromDiscord | <jmgomez> In reply to @jmgomez "and there is no": Turns out just replacing the vtable with the new one seems to work for most functions. UE must be doing something else on the ones that doesnt update but at least this seems to be the right direction |