00:00:11 | FromDiscord | <Rika> make a method for each object and call that instead of using nn of TT? |
00:02:06 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Rika "make a method for": I have this problem https://media.discordapp.net/attachments/371759389889003532/1109269782726983700/message.txt |
00:05:22 | FromDiscord | <System64 ~ Flandre Scarlet> https://github.com/nimgl/imgui↵I use that if it can help |
00:11:30 | FromDiscord | <@theperfectcomputer-628303036da0> does anybody here know how to use microparsec? |
00:11:38 | FromDiscord | <@theperfectcomputer-628303036da0> https://github.com/schneiderfelipe/microparsec |
00:14:09 | FromDiscord | <@theperfectcomputer-628303036da0> Can you install packages in nim playground? |
00:14:35 | FromDiscord | <Elegantbeef> Nope |
00:14:43 | FromDiscord | <Elegantbeef> It has a preset list of 'important' packages |
00:17:01 | FromDiscord | <Elegantbeef> @Prestige\: so I discovered that Nim does have a sort of multiple inheritance, though it presently falls apart if you add more generic parameters |
00:17:11 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4wdT |
00:17:52 | FromDiscord | <Elegantbeef> I've been using it for a sort of dependency injection in my GUI rewrite |
00:17:52 | FromDiscord | <@theperfectcomputer-628303036da0> Elegantbeef\: how come you're always online? |
00:17:57 | FromDiscord | <Elegantbeef> I have no life |
00:17:57 | FromDiscord | <@theperfectcomputer-628303036da0> Are you hUMan? |
00:18:10 | FromDiscord | <Elegantbeef> I have no life, so perhaps not |
00:18:27 | FromDiscord | <@theperfectcomputer-628303036da0> Well - I remember you being always online two years ago |
00:18:41 | FromDiscord | <@theperfectcomputer-628303036da0> and I came back in 2023 - you're still online |
00:19:33 | FromDiscord | <Elegantbeef> Yea I have not gained a life in that time |
00:19:38 | FromDiscord | <Elegantbeef> Thanks for calling me out! |
00:19:53 | FromDiscord | <@theperfectcomputer-628303036da0> Well - I didn't mean to call you out |
00:19:57 | FromDiscord | <@theperfectcomputer-628303036da0> I was just curious |
00:20:05 | FromDiscord | <Graveflo> To me, both of you have [BOT] next to your name so I find this convo sus |
00:20:14 | FromDiscord | <Elegantbeef> We're both on matrix |
00:20:25 | FromDiscord | <Graveflo> ye ik 😛 |
00:20:28 | FromDiscord | <Elegantbeef> Well they're on gitter, which uses matrix |
00:20:34 | FromDiscord | <Elegantbeef> Hey they have computer in their name |
00:20:44 | FromDiscord | <@theperfectcomputer-628303036da0> I am the perfect computer |
00:20:49 | FromDiscord | <Elegantbeef> Doubtful |
00:20:57 | FromDiscord | <@theperfectcomputer-628303036da0> Oh? |
00:20:59 | FromDiscord | <huantian> In reply to @@theperfectcomputer-628303036da0 "Well - I didn't": don't worry I don't think it's possible to offend beef |
00:21:01 | FromDiscord | <Elegantbeef> The perfect computer is shutoff |
00:21:08 | FromDiscord | <@theperfectcomputer-628303036da0> https://theperfect.computer/ |
00:21:18 | FromDiscord | <Elegantbeef> You cannot offend me with words, you can only offend me with horrendous code |
00:21:24 | FromDiscord | <@theperfectcomputer-628303036da0> oooh |
00:22:35 | FromDiscord | <@theperfectcomputer-628303036da0> Although I've since hopped of the Rust bandwagon |
00:22:38 | FromDiscord | <@theperfectcomputer-628303036da0> of -\> off |
00:23:01 | FromDiscord | <@theperfectcomputer-628303036da0> seL4 exists - also Rust foundation is cray cray |
00:23:07 | FromDiscord | <Elegantbeef> You really should just use matrix |
00:23:13 | FromDiscord | <Elegantbeef> It really is terrible on the bridge apparently |
00:48:37 | FromDiscord | <jmgomez> sent a code paste, see https://paste.rs/09sw1 |
00:51:43 | * | derpydoo joined #nim |
00:54:50 | FromDiscord | <Elegantbeef> No clue about C++ |
01:04:21 | * | krux02_ quit (Remote host closed the connection) |
01:10:25 | FromDiscord | <Prestige> @Elegantbeef#0000 woah that's awesome |
01:10:59 | FromDiscord | <Elegantbeef> Sadly like I said there are some compiler bugs around it |
01:11:09 | FromDiscord | <Elegantbeef> But i'm trying to fix them |
01:11:21 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/issues/21864 for instance fails |
01:18:24 | FromDiscord | <Nlits (Ping on reply)> How would I go about wrapping a C lib in nim? |
01:18:38 | FromDiscord | <Nlits (Ping on reply)> The makefile produces a .a file, but idk what to do with it |
01:19:03 | FromDiscord | <Elegantbeef> That's a static library, you statically link it and use `importc` to define the procedures you want to use |
01:19:44 | FromDiscord | <Nlits (Ping on reply)> In reply to @Elegantbeef "That's a static library,": So how would i link it? |
01:20:01 | FromDiscord | <Elegantbeef> The same way you would with C with `passL` to pass to the linker |
01:20:08 | FromDiscord | <Nlits (Ping on reply)> and does anyone who wants to use the wrapper have to get the .a file? |
01:20:19 | FromDiscord | <Elegantbeef> Yes |
01:20:49 | FromDiscord | <Nlits (Ping on reply)> In reply to @Elegantbeef "The same way you": I don't use C. So like `nim c --passL:theClib.a main ` |
01:20:52 | FromDiscord | <Nlits (Ping on reply)> (edit) "`" => "`?" |
01:21:09 | FromDiscord | <Elegantbeef> I said that so you'd look up how to statically link a file using C |
01:21:53 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4we0 |
01:23:04 | FromDiscord | <Nlits (Ping on reply)> In reply to @Elegantbeef "I said that so": oh, ok. I looked and up and it looks like i need to do this:↵`nim c --passL:libNameWithoutTheLibOrA main` |
01:26:04 | FromDiscord | <Nlits (Ping on reply)> Is it possible to make nim use a config.nims file inside a nimble package? |
01:26:16 | FromDiscord | <Nlits (Ping on reply)> Like, if the code imports the config file, use it |
01:26:32 | FromDiscord | <Elegantbeef> Nope `config.nims` is used regardless |
01:28:33 | FromDiscord | <Nlits (Ping on reply)> In reply to @Elegantbeef "Nope `config.nims` is used": ???↵So I stick it in my nimble pkg, and then even if someone is compiling something unrelated, they will have to use my package's config file? |
01:28:47 | FromDiscord | <Nlits (Ping on reply)> (edit) "unrelated," => "unrelated and has it installed," |
01:29:36 | FromDiscord | <Elegantbeef> No |
01:32:17 | FromDiscord | <demotomohiro> In reply to @not logged in "How would I go": I wrote an article about how to use C static library from Nim:↵https://internet-of-tomohiro.netlify.app/nim/gccguide.en.html↵https://internet-of-tomohiro.netlify.app/nim/clibrary.en.html |
01:33:36 | FromDiscord | <Nlits (Ping on reply)> In reply to @Elegantbeef "No": idk what you mean then |
01:34:20 | FromDiscord | <demotomohiro> You can put passL in nim code: https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-passl-pragma |
01:36:26 | FromDiscord | <Nlits (Ping on reply)> In reply to @demotomohiro "You can put passL": that is what i wanted, so the users don't have to worry about linking |
01:37:04 | FromDiscord | <Nlits (Ping on reply)> In reply to @demotomohiro "I wrote an article": I looked at one of those, and setup the static lib like you did. 1 problem, it compiled and ran even when the lib did not exist |
01:37:54 | FromDiscord | <enigma> sent a code paste, see https://play.nim-lang.org/#ix=4we1 |
01:38:12 | FromDiscord | <enigma> I do not understand how to pinpoint what said service does/doesnt exist |
01:38:24 | FromDiscord | <enigma> sent a code paste, see https://play.nim-lang.org/#ix=4we2 |
01:38:36 | FromDiscord | <enigma> version 1.6.12 |
01:38:38 | FromDiscord | <Rika> Means DNS failed for the domain name |
01:39:04 | FromDiscord | <enigma> ah, perfect. will try an alternate URL. thank you. |
01:39:10 | FromDiscord | <Nlits (Ping on reply)> In reply to @demotomohiro "I wrote an article": Also, does the .h file come from the .a file or do I need both |
01:39:14 | NimEventer | New question by still_dreaming_1: How to run (not igore) runnableExamples in nim, see https://stackoverflow.com/questions/76293220/how-to-run-not-igore-runnableexamples-in-nim |
01:39:57 | FromDiscord | <Rika> In reply to @not logged in "Also, does the .h": You need both to compile the source but neither once it’s compiled |
01:40:09 | FromDiscord | <Nlits (Ping on reply)> (edit) "both" => "both, in your thing it is linking to a .a file, but your code is using the .h file" |
01:40:39 | FromDiscord | <demotomohiro> In reply to @not logged in "Also, does the .h": .h file is usually distributed with c source code. |
01:42:14 | FromDiscord | <Nlits (Ping on reply)> In reply to @demotomohiro ".h file is usually": there are several .h files and idk which one to use |
01:42:56 | FromDiscord | <Rika> Usually the one with the same name |
01:44:47 | FromDiscord | <demotomohiro> In reply to @not logged in "there are several .h": Read the manual of the C library. Or run `make install` and see which .h file is installed. |
01:45:42 | FromDiscord | <Nlits (Ping on reply)> In reply to @demotomohiro "Read the manual of": I am 99% sure the makefile deleted itself after the build |
01:47:14 | FromDiscord | <demotomohiro> In reply to @not logged in "I am 99% sure": What kind of build system is it use?↵I have never saw makefile that delete itself. |
01:58:04 | * | rockcavera quit (Remote host closed the connection) |
02:07:20 | FromDiscord | <Nlits (Ping on reply)> sent a code paste, see https://play.nim-lang.org/#ix=4we8 |
02:16:51 | FromDiscord | <demotomohiro> In reply to @not logged in "idk, here is the": It doesn't have install target.↵I cannot tell which .h you need only from it. |
02:20:49 | FromDiscord | <demotomohiro> .h files that declares types, constants or functions that you want to use in Nim are what you need.↵And .h files that are included from these files. |
02:21:45 | * | lucasta quit (Quit: Leaving) |
02:30:00 | FromDiscord | <Nlits (Ping on reply)> In reply to @demotomohiro "It doesn't have install": here is the git repo:↵https://github.com/hhatto/peg-rst↵rst_lib.h seems most lekly |
03:33:15 | FromDiscord | <Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4weh |
03:50:31 | FromDiscord | <Elegantbeef> Quit using generics for overloads |
03:51:35 | FromDiscord | <Graveflo> yea I assume that Option is the way to go here.. but I also assume that the compiler shouldn't die trying to do this. Also the whole options solution is functional but very ugly, but thats just my opinion |
03:51:57 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4wej |
03:52:16 | FromDiscord | <Graveflo> oh right. overloads LOL i missed that somehow |
03:53:08 | FromDiscord | <Graveflo> Still though, the compiler should be able to compile that mess anyways right? Even if it's just a toy example |
03:54:32 | FromDiscord | <Elegantbeef> `int = nil` is just wrong |
03:55:16 | FromDiscord | <Graveflo> it looks wrong but this is not the only case where the pattern is used. Why have union types in the first place. I see it used in the std |
03:55:33 | FromDiscord | <Elegantbeef> They're typeclasses |
03:56:22 | FromDiscord | <Elegantbeef> Which is to say they're generic constraints |
03:56:27 | FromDiscord | <Elegantbeef> They're not like TS unions |
03:58:45 | FromDiscord | <Graveflo> Not sure I totally understand but I'm assuming you mean that int is a primitive and that pattern is meant for types that have are essentially "generically compatible with one another" ? |
03:58:54 | FromDiscord | <Rika> No |
03:59:14 | FromDiscord | <Rika> Basically the types will be chosen and the code within must be valid for the concrete type |
03:59:31 | FromDiscord | <Rika> (edit) "chosen" => "consolidated" |
04:00:12 | FromDiscord | <Rika> You cannot nil it no matter what constraints you put because it’ll resolve strongly |
04:00:15 | FromDiscord | <Graveflo> okay so all of the code must be generically compatible with all types in the union for it to make sense and "when" is used only when more fine grain logic is needed? |
04:01:02 | FromDiscord | <Rika> When can be used to choose the code that would be valid per the type |
04:01:20 | FromDiscord | <Rika> And by the way, nil doesn’t have a concrete type on its own |
04:01:49 | FromDiscord | <Graveflo> what is type(nil) then? |
04:02:25 | FromDiscord | <Elegantbeef> A hack to allow `nil` |
04:02:30 | FromDiscord | <Elegantbeef> `something(nil)` |
04:03:10 | FromDiscord | <Graveflo> So why does the first example compile and run as expected then given this information? |
04:03:32 | FromDiscord | <Graveflo> well, as might kinda expected |
04:04:05 | FromDiscord | <Elegantbeef> No clue it's mostly a hack so using it is just off |
04:04:13 | FromDiscord | <Rika> I think the hack using type nil is just too much of a hack for the default parameter to work |
04:04:28 | FromDiscord | <Rika> (edit) "using" => "(using" | "nil" => "nil)" |
04:04:43 | FromDiscord | <Graveflo> So I have hurt myself in confusion. Ideally I suppose this should be banned from compiling |
04:04:56 | FromDiscord | <Elegantbeef> Generic code isnt checked until instantiation |
04:04:59 | FromDiscord | <Rika> There are option types in the Nim standard library so maybe you can use that if you want |
04:05:51 | FromDiscord | <Graveflo> yea that's what I'll do. I was trying to worm my way around it but its nbd |
04:06:17 | FromDiscord | <Graveflo> or ill just overload like beef said and sac a stack frame |
04:13:06 | FromDiscord | <Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4wem |
04:15:25 | FromDiscord | <Rika> Well in this case it works due to the when statements distinguishing which block will be checked and compiled |
04:15:31 | FromDiscord | <Graveflo> I'm not trying to make this work btw more so just interested. I assume it is basically creating two different procs and linking to the appropriate one basic on their type at compile time, but if that is true, I dont understand why the original didnt work |
04:15:39 | FromDiscord | <Rika> Yes |
04:16:22 | FromDiscord | <Rika> I made a mistake above, the code with the default value doesn’t work likely just because the nil type is buggy and hacky |
04:17:18 | FromDiscord | <Graveflo> okay fair enough. I'm sure it's overly pedantic to criticize the correctness of the syntax knowing that type(nil) is just a weirdo. Thanks for the help guys |
04:20:13 | FromDiscord | <Rika> It would work otherwise I believe, as in had you used another type and value |
05:31:07 | FromDiscord | <enigma> https://media.discordapp.net/attachments/371759389889003532/1109352583933481001/image.png |
05:31:17 | FromDiscord | <enigma> is there not a way to know how many downloads per package there is |
05:31:23 | FromDiscord | <enigma> or which one is preferred |
05:34:18 | FromDiscord | <enigma> <https://github.com/nim-lang/nimble#readme> |
05:34:32 | FromDiscord | <enigma> how do I know if a package is authentic and not malicious o.O |
05:35:02 | FromDiscord | <enigma> sent a code paste, see https://play.nim-lang.org/#ix=4weB |
05:37:12 | FromDiscord | <Elegantbeef> You look at the code an validate it |
05:39:56 | FromDiscord | <enigma> so if a module has 1000+ files ill just look at the code and validate it |
05:40:06 | FromDiscord | <enigma> (edit) "1000+" => "1000000000000000000000000000+" |
05:40:18 | FromDiscord | <enigma> down bad replying to a bot |
05:40:28 | FromDiscord | <Elegantbeef> I mean how else do you ensure code is not malicious |
05:40:35 | FromDiscord | <enigma> reviews |
05:40:38 | FromDiscord | <Elegantbeef> You have to audit code to ensure it's not malicious |
05:40:48 | FromDiscord | <enigma> dont hurt the messenger please |
05:40:55 | FromDiscord | <Elegantbeef> What? |
05:40:59 | FromDiscord | <enigma> ever |
05:51:39 | FromDiscord | <Rika> In reply to @enigma "is there not a": No, downloads are decentralised |
05:51:52 | FromDiscord | <Rika> Aka via git or other SCMs |
05:52:02 | FromDiscord | <Rika> So there isn’t exactly a way to track it |
05:52:35 | FromDiscord | <Rika> In reply to @enigma "so if a module": How else should it be done? |
05:54:34 | FromDiscord | <Graveflo> You could always rely on anecdotal things like people referencing using it online .. in forums and stuff. Besides that beggars cant be choosers |
05:55:50 | FromDiscord | <Graveflo> or just code a code repo version of yelp. I think that might help some people vent their frustrations too |
05:55:53 | FromDiscord | <enigma> nobodys begging 🤔 |
05:55:58 | FromDiscord | <enigma> seems pretty standard to me though |
05:57:59 | FromDiscord | <enigma> https://media.discordapp.net/attachments/371759389889003532/1109359344321040484/image.png |
05:58:14 | FromDiscord | <enigma> by stars it is 🫡 |
06:02:24 | FromDiscord | <voidwalker> yeah it sucks that you can't sort by downloads/stars, trending etc. Also sucks that you don't have the repo link always on the main package page, sometime it links to docs hosted on another site |
06:02:46 | FromDiscord | <voidwalker> Also sucks that there's no active curation effort to remove lower quality duplicates |
06:04:24 | FromDiscord | <enigma> https://kerkour.com/rust-crate-backdoor#/typosquatting↵↵@Graveflo @Rika 👀 |
06:06:14 | FromDiscord | <enigma> although not rust obvs, a still good read |
06:11:55 | FromDiscord | <PunchCake> i love nim |
06:12:00 | FromDiscord | <PunchCake> who else loves nim here |
06:12:03 | * | Guest54 joined #nim |
06:12:44 | * | Guest54 quit (Client Quit) |
06:12:53 | FromDiscord | <Elegantbeef> I tolerate it |
06:13:51 | FromDiscord | <JJ> nim? oh sick, sometimes i write code in that |
06:14:01 | FromDiscord | <JJ> cool to see other nim fans |
06:14:05 | FromDiscord | <PunchCake> foreal |
06:14:11 | FromDiscord | <Rika> In reply to @voidwalker "Also sucks that there's": I think it would be unfair to do so, but I agree on the download count |
06:14:16 | FromDiscord | <PunchCake> i thought the rustacanes invaded |
06:14:59 | FromDiscord | <Elegantbeef> Yea as much as I think only quality software should be in a software registry, it's undemocratic to remove "lesser quality" |
06:15:02 | FromDiscord | <JJ> In reply to @voidwalker "yeah it sucks that": so this is because of the structure of nimble.directory |
06:16:43 | FromDiscord | <Rika> In reply to @apropos "so this is because": No, it’s because of how Nim does package distribution |
06:17:36 | FromDiscord | <JJ> it basically is a frontend to making requests to github. and iirc star counts are not provided by the github api in search results, so in order to get them you have to make an additional request for each repo |
06:18:48 | FromDiscord | <JJ> In reply to @Rika "No, it’s because of": yeah, i think totally revamping that would be a good idea but probably too much effort for too few benefits |
06:19:39 | FromDiscord | <JJ> In reply to @apropos "it basically is a": then that doesn't scale to searches with like 500 requests or what no so star counts are not included there. glad to see the redesign finally got merged though |
06:19:54 | FromDiscord | <Elegantbeef> I mean changing how Nim does packaging is pointles |
06:20:07 | FromDiscord | <Elegantbeef> A decentralised package management is nice imo |
06:22:44 | FromDiscord | <JJ> ah i should really fix readme generation also, i wasn't happy with how it turned out but then got busy |
06:26:18 | FromDiscord | <PunchCake> is nim fourms made with nim |
06:28:26 | FromDiscord | <michaelb.eth> In reply to @PunchCake "is nim fourms made": indeed |
06:29:12 | FromDiscord | <PunchCake> nice |
06:29:14 | FromDiscord | <PunchCake> feels fast |
06:29:32 | FromDiscord | <Rika> It’s an old version with a long-standing bug regarding registration |
06:30:01 | FromDiscord | <PunchCake> In reply to @Rika "It’s an old version": whats the bug |
06:33:38 | FromDiscord | <Rika> If the registration link sent in the email expires you cannot do anything other than ask an admin to override |
06:33:50 | FromDiscord | <Rika> I think that’s the bug but I don’t recall |
06:38:20 | FromDiscord | <JJ> yeah it's redeployed only for cves or something |
06:38:58 | FromDiscord | <JJ> i remember i had to wait about a year and a half to make an account after pr'ing support for my username (it previously contained a dash) |
06:41:35 | FromDiscord | <PunchCake> In reply to @apropos "i remember i had": lmao |
06:41:42 | FromDiscord | <PunchCake> i just made one in seconds |
06:45:44 | FromDiscord | <JJ> (dashs were previously prohibited because usernames were nim identifiers) |
06:46:42 | FromDiscord | <Elegantbeef> That's a funny thing |
06:46:56 | FromDiscord | <Elegantbeef> Were passwords also valid identifiers aswell? |
06:48:04 | FromDiscord | <JJ> your password is |
06:48:21 | FromDiscord | <JJ> ah, beef, do you know the current state of documentation projects? |
06:48:33 | FromDiscord | <Elegantbeef> nimib/book is good use that |
06:48:45 | FromDiscord | <Elegantbeef> https://www.jasonbeetham.com/codereuse.html i use it for my silly one off articles |
06:49:02 | FromDiscord | <JJ> i know treeform has his nimdocs but i don't know if he was planning on rolling it out to arbitrary repos, and i thought somebody else was also working on something similar |
06:49:11 | FromDiscord | <Elegantbeef> Oh right you mean that |
06:49:19 | FromDiscord | <Elegantbeef> nimble.directory should support it |
06:49:24 | FromDiscord | <Elegantbeef> There's a long standing bug that doesnt generate docs |
06:49:49 | FromDiscord | <Elegantbeef> I know nim.town exists and is in a similar vein but you request a url and host stuff there |
06:50:36 | FromDiscord | <Elegantbeef> Seems whoever was hosting that has gone radio silent |
06:50:46 | FromDiscord | <JJ> oh fun, that's very cute |
06:51:37 | FromDiscord | <JJ> i set up something similar with toki.la actually |
06:52:08 | FromDiscord | <JJ> for the toki pona community, in a similar fashion to sona.la (which actually has people using it) |
06:52:16 | FromDiscord | <JJ> (edit) "sona.la" => "pona.la" |
06:53:41 | FromDiscord | <Elegantbeef> Ugh I'm questioning using bindless textures for my GUI.... it prevents using render doc, and is an opengl extension which means it only has a subset of support(AMD and Nvidia certainly support it) |
06:54:00 | FromDiscord | <Elegantbeef> I wonder if Intel's Arc gpus support it 😄 |
06:54:06 | FromDiscord | <Elegantbeef> Probably explodes in a glorious inferno |
06:56:10 | FromDiscord | <Elegantbeef> I suppose given how I'm doing this I can technically make a SDL backend and use that for debugging.... hmmm |
06:57:59 | FromDiscord | <JJ> In reply to @Elegantbeef "Seems whoever was hosting": hopefully they'll come back, but it looks like they set it up in a remarkably bus-ready fashion |
06:58:21 | FromDiscord | <JJ> everything's just in a github repo |
07:03:14 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4weJ |
07:06:31 | FromDiscord | <JJ> `BitVecS or BitVec` looks like a boolean value |
07:06:34 | FromDiscord | <Rika> Can you give us the type definitions |
07:06:39 | FromDiscord | <Rika> In reply to @apropos "`BitVecS or BitVec` looks": It is valid |
07:07:11 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4weK |
07:07:17 | FromDiscord | <JJ> In reply to @Rika "It is valid": what? that's weird |
07:07:24 | FromDiscord | <Rika> In reply to @apropos "what? that's weird": It is a type class |
07:07:33 | FromDiscord | <JJ> oh i see |
07:08:00 | FromDiscord | <voidwalker> edited code above with proc definition |
07:08:02 | FromDiscord | <Rika> In reply to @voidwalker "I have two things": Is B restrained to only the three types? |
07:08:17 | FromDiscord | <Rika> What issues are you getting |
07:08:50 | FromDiscord | <voidwalker> well, it should be restrained, since I call the proc with "AnyBitVec" type var |
07:09:12 | FromDiscord | <voidwalker> As I said, I do not understand why those two are not equivalent. I get different error messages |
07:09:39 | FromDiscord | <Rika> Which are |
07:20:03 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4weL |
07:20:21 | FromDiscord | <voidwalker> If I do the `else` I get `Error: expression has no address` |
07:20:22 | FromDiscord | <Elegantbeef> In the case both whens fail you do not have a `w` |
07:21:37 | FromDiscord | <voidwalker> so they both fail, that's why I don't have w ? that was my second question, why is w out of scope |
07:21:46 | FromDiscord | <Elegantbeef> Did you read the rest of the message? |
07:22:12 | FromDiscord | <Elegantbeef> I assume `bv` is a parameter passed in without `var`? |
07:23:03 | FromDiscord | <Elegantbeef> If so pass in `bv` as a var |
07:23:07 | FromDiscord | <Elegantbeef> then you can use `addr` |
07:28:35 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4weO |
07:30:08 | NimEventer | New thread by Angluca: Teach you to write nim code comfortably use vim if you like vim you must try :), see https://forum.nim-lang.org/t/10206 |
07:33:53 | FromDiscord | <voidwalker> ok so can you explain again ? I am still as confused |
07:43:15 | FromDiscord | <least antisemitic pole> is {.push warning[UnusedImport]: off.}` supposed to work? it doesn't for me |
07:52:14 | NimEventer | New thread by domogled: I came across a strange behavior of httpClient with Uri type parameter, see https://forum.nim-lang.org/t/10207 |
07:52:50 | FromDiscord | <voidwalker> my bad, I used the wrong entity in when, B instead of the var bv |
08:19:44 | * | azimut quit (Ping timeout: 240 seconds) |
08:36:59 | * | Notxor joined #nim |
08:46:31 | * | derpydoo quit (Ping timeout: 268 seconds) |
09:00:45 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4wf7 |
09:01:41 | FromDiscord | <voidwalker> (edit) "https://play.nim-lang.org/#ix=4wf7" => "https://paste.rs/eQUUu" |
09:01:46 | FromDiscord | <mratsim> why `type T = B` |
09:02:01 | FromDiscord | <voidwalker> I changed the first template to use generic param instead of typedesc. But if I call the other template with `newVLA(B, blocks, init)` I get: |
09:02:15 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4wfa |
09:02:19 | FromDiscord | <voidwalker> If I do type T = B and then call it with T, it works |
09:02:29 | FromDiscord | <mratsim> ah |
09:03:14 | FromDiscord | <voidwalker> mratsim it's good that you are here, I wanted to ask you about your suggestion to use openArray |
09:04:30 | FromDiscord | <voidwalker> but first, do you have any idea what could be happening here ? I have no idea how to debug 'types' |
09:05:25 | FromDiscord | <mratsim> In reply to @voidwalker "but first, do you": you're encountering typesystem aliasing bugs, see item 5 of https://github.com/status-im/nimbus-eth2/issues/2219 https://media.discordapp.net/attachments/371759389889003532/1109406511895171132/image.png |
09:07:20 | FromDiscord | <mratsim> In reply to @voidwalker "but first, do you": basically, static + typedesc + generics can be very finicky, I'm sure I raised dozens of bugs maybe even a hundred with one or the other tag |
09:07:48 | FromDiscord | <voidwalker> ok. I am happy it works like this for the moment, not a big problem |
09:07:58 | FromDiscord | <voidwalker> https://play.nim-lang.org/#ix=4wfd - this is the code as I have it now |
09:08:04 | FromDiscord | <mratsim> I have a pretty good idea on what to try, but it's a bit hard to explain |
09:08:49 | FromDiscord | <voidwalker> how do you suggest I implement openArray ? Make the base type openArray ? |
09:10:37 | FromDiscord | <mratsim> no, have all your inner proc work on openArray[T] |
09:10:54 | FromDiscord | <mratsim> call them `fooImpl` for example |
09:11:23 | FromDiscord | <voidwalker> oh so they are more "basic", taking just the data type they operate on, not a higher one |
09:11:26 | FromDiscord | <mratsim> and then the outer public proc just call the inner proc. Make sure outer proc are inlined to avoid extra function calls |
09:11:28 | FromDiscord | <voidwalker> (edit) "oh so they are more "basic", taking just the data type they operate on, not a higher ... one" added "level" |
09:12:05 | FromDiscord | <voidwalker> less code generated this way since they are not duplicated with generics.. I see |
09:12:08 | FromDiscord | <mratsim> small inner procs can also be made inline so that if lengths are known at compile-time, compiler can do loop unrolling |
09:12:20 | FromDiscord | <mratsim> but it leaves the decision to the compiler. |
09:12:59 | FromDiscord | <voidwalker> you might be right, it's not a bad idea.. |
09:13:08 | FromDiscord | <voidwalker> it's more "correct" I guess |
09:13:31 | FromDiscord | <voidwalker> Although my rogue uncheckedArray will not fit in openArray, right ? |
09:13:39 | FromDiscord | <voidwalker> it's a lower level type I think |
09:14:07 | FromDiscord | <voidwalker> well it can be converted to openarray |
09:14:09 | FromDiscord | <mratsim> there is a toOpenArray(ptr UncheckedArray, low, high) |
09:14:12 | FromDiscord | <voidwalker> yeah |
09:14:21 | FromDiscord | <voidwalker> `template asOpenArray[T](a: VarLengthArray[T]): openarray[T] =↵ toOpenArray(addr a.data, 0, a.len)` |
09:14:29 | FromDiscord | <mratsim> the codegen is easily optimizable away, I looked at it the otherday |
09:14:57 | FromDiscord | <mratsim> https://github.com/mratsim/constantine/blob/1c5341fd7e8af9084223b5bce616b4a8262eab14/constantine/platforms/views.nim#L24-L30 |
10:15:04 | * | krux02_ joined #nim |
11:30:49 | * | krux02_ quit (Remote host closed the connection) |
12:49:17 | FromDiscord | <least antisemitic pole> is there any way to provide a jsdoc comment for an exported proc for js backend? |
12:49:33 | FromDiscord | <least antisemitic pole> i tried {.emit.}, but the comment would end up in a completely different place in the generated .js file |
12:52:39 | FromDiscord | <jmgomez> In reply to @least antisemitic pole "i tried {.emit.}, but": Not sure if codegenDecl is available in the js backend. But you can try that one out if so |
13:30:48 | * | fallback quit (Ping timeout: 240 seconds) |
13:33:32 | FromDiscord | <least antisemitic pole> that seems to work, thanks @jmgomez |
13:35:06 | * | fallback joined #nim |
13:37:51 | * | Notxor quit (Remote host closed the connection) |
13:43:36 | * | Cagalations3-16 joined #nim |
13:48:05 | FromDiscord | <ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4wgf |
13:48:31 | FromDiscord | <ieltan> ah wait its not `int` its `string` for the key |
13:48:57 | FromDiscord | <ieltan> (edit) "https://play.nim-lang.org/#ix=4wgf" => "https://play.nim-lang.org/#ix=4wgg" |
13:49:07 | FromDiscord | <ieltan> still have the issue |
13:51:52 | Cagalations3-16 | I have some great news guys! |
13:52:07 | Cagalations3-16 | A new season of Malcolm in the Middle is coming out! |
13:52:08 | Cagalations3-16 | Malcolm in the Middle Season 8 Episodes 1 and 2: 2. Reese Wilkerson Teams with Canadian Mountie Secret Agents to Trap and Torture Pedophile Tom Cruise https://justpaste.it/Tom_Cruise_BDSM_Tortured_Reese 1. Reese meets Edna Skilton, Fills Her Pussy with Shit, and Fucks that poopy cooter! https://justpaste.it/Reese_Fucks_Edna_Skilton_Malcolm |
13:52:15 | Cagalations3-16 | Check out these episode story lines! |
13:52:17 | Cagalations3-16 | genius! |
13:54:05 | FromDiscord | <amadan> <@&371760044473319454> |
13:57:35 | FromDiscord | <Chronos [She/Her]> In reply to @Cagalations3-16 "Malcolm in the Middle": Whatt the fuck |
14:04:55 | * | Cagalations3-16 quit (K-Lined) |
14:12:57 | FromDiscord | <demotomohiro> In reply to @ieltan "How can i make": I think you need to explicitly convert `MessageEvent` to `AwaitableEvent` so that type of `mys` become `seq[AwaitableEvent]`. |
14:16:05 | FromDiscord | <jmgomez> It's kinda of a shame but you could get around it by doing `cast[seq[AwaitableEvent]](mys)` |
14:18:36 | FromDiscord | <ieltan> In reply to @demotomohiro "I think you need": oh i see |
14:18:51 | FromDiscord | <ieltan> How do i get data back later ? |
14:19:04 | FromDiscord | <ieltan> recasting ? |
14:26:01 | FromDiscord | <demotomohiro> In reply to @ieltan "oh i see": Convert like `(MessageEvent)mys[0]`. |
14:26:37 | FromDiscord | <demotomohiro> Or `MessageEvent(mys[0])`. |
14:29:02 | FromDiscord | <ieltan> In reply to @jmgomez "It's kinda of a": Yes, I'm not worried about casting to the wrong type because I know in advance what type of event I will get/store. But I do wonder if there is a performance cost |
14:31:02 | FromDiscord | <ieltan> In reply to @demotomohiro "Convert like `(MessageEvent)mys[0]`.": Alright thanks! |
14:31:54 | FromDiscord | <jmgomez> In reply to @ieltan "Yes, I'm not worried": There isnt |
14:33:53 | FromDiscord | <ieltan> In reply to @jmgomez "There isnt": Nice, thanks for the help! |
14:53:40 | FromDiscord | <sOkam!> Is it possible to map a struct type from C with `importc` and be able to access its fields in some way? |
14:54:17 | FromDiscord | <sOkam!> its a big type, so looking for a way to not have to convert the whole thing manually to an object to be able to use it |
14:59:01 | FromDiscord | <jmgomez> In reply to @sOkam! "Is it possible to": not following, what do you mean by accessing its fields? like `importedType.fieldDefiendInC` ? |
15:00:22 | FromDiscord | <sOkam!> yeah |
15:01:54 | FromDiscord | <jmgomez> you should be able to access the field just by defining them, if you have another name for them you can modify the name by using `import` again in the name |
15:02:04 | FromDiscord | <jmgomez> (edit) "`import`" => "`importc`" |
15:02:37 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4wgI |
15:03:32 | FromDiscord | <sOkam!> what about the other elements of the object? the ones omitted |
15:04:32 | FromDiscord | <jmgomez> what do you mean? |
15:05:03 | FromDiscord | <jmgomez> like what happens to them? |
15:05:54 | FromDiscord | <sOkam!> as in does it crash if I don't define the others? |
15:06:05 | FromDiscord | <sOkam!> (edit) "others?" => "others in nim?" |
15:06:33 | FromDiscord | <jmgomez> oh no, since the C compiler already knows about them Nim doesnt produce new code for their definition |
15:07:36 | FromDiscord | <sOkam!> kk ty ✍️ |
15:10:45 | FromDiscord | <tsoj> How can do memory cache prefetchs like gcc's builtin_prefetch? |
15:26:22 | FromDiscord | <demotomohiro> In reply to @tsoj "How can do memory": Probably you can importc `builtin_prefetch` and call it from Nim code. |
15:33:31 | * | azimut joined #nim |
15:59:55 | FromDiscord | <chmod222> If all else fails, `{.emit.}` |
16:00:09 | FromDiscord | <Nlits (Ping on reply)> How would I wrap a C enum in nim? |
16:00:15 | FromDiscord | <Nlits (Ping on reply)> Using the header pragma |
16:01:07 | FromDiscord | <Nlits (Ping on reply)> also, what is a GString? |
16:01:28 | FromDiscord | <chmod222> Since a C enum is just a weakly typed wrapper over an int (until C23 at least), you can just `FooNum {.size: sizeof(cint).} = enum ...` |
16:01:48 | FromDiscord | <chmod222> And replicate the enum fields |
16:03:11 | FromDiscord | <chmod222> I don't think you can `.header:` enums |
16:03:31 | FromDiscord | <chmod222> Well, maybe you can and it'll `#include` the header, but you'll need to define the values anyways |
16:04:04 | NimEventer | New thread by ITwrx: Why does Nim source code filter add a newline at the end of the last line?, see https://forum.nim-lang.org/t/10208 |
16:07:51 | FromDiscord | <Nlits (Ping on reply)> sent a code paste, see https://play.nim-lang.org/#ix=4wgU |
16:08:21 | FromDiscord | <chmod222> You'll have to add the values for rst\_extensions at least, since it starts at 1 and nim at 0 |
16:08:23 | FromDiscord | <Nlits (Ping on reply)> (edit) "https://play.nim-lang.org/#ix=4wgU" => "https://play.nim-lang.org/#ix=4wgV" |
16:09:20 | FromDiscord | <Nlits (Ping on reply)> In reply to @chmod222 "You'll have to add": so i just do the same = 0x01 in nim? |
16:09:38 | FromDiscord | <chmod222> Yep |
16:10:44 | FromDiscord | <chmod222> Just replicate the values and make sure the size matches the one in C, which will probably be `cint` unless you deal with C23 where enums can be other things |
16:10:45 | FromDiscord | <chmod222> The names do not have to match |
16:10:45 | FromDiscord | <chmod222> Just the number |
16:10:56 | FromDiscord | <chmod222> Since again, to C enums are basically just very weakly typed ints |
16:12:40 | FromDiscord | <chmod222> One sticky issue you may run into is that in C, enums may have duplicate values, which nim forbids |
16:13:32 | FromDiscord | <chmod222> I work around that by declaring the duplicate values as `consts` of the same type as the enum, but there are other ways |
16:18:33 | FromDiscord | <Nlits (Ping on reply)> sent a code paste, see https://play.nim-lang.org/#ix=4wgW |
16:18:57 | FromDiscord | <chmod222> That'll work |
16:19:15 | FromDiscord | <chmod222> C strings, as in `char ` for Nim is just `cstring` |
16:21:20 | FromDiscord | <Nlits (Ping on reply)> In reply to @chmod222 "C strings, as in": 👍↵What about gstrings? |
16:21:36 | FromDiscord | <chmod222> I don't know what gstrings are |
16:21:45 | FromDiscord | <chmod222> glib? |
16:22:31 | FromDiscord | <Nlits (Ping on reply)> In reply to @chmod222 "glib?": yes |
16:22:43 | FromDiscord | <Nlits (Ping on reply)> are those easier to convert to nimstrings/safer |
16:22:53 | FromDiscord | <Nlits (Ping on reply)> Idk what they are but it has a function for it |
16:23:51 | FromDiscord | <chmod222> If you know where they are defined and don't care all too much about what's inside because you'll use them from behind a pointer, `GString {.importc: "header.h", "gstring".} = object` but you probably only want to use them when talking to some code in C that already uses them |
16:23:56 | FromDiscord | <chmod222> Nim has `string` |
16:24:38 | FromDiscord | <chmod222> there's probably already Nim bindings for glib somewhere on nimble though |
16:24:52 | FromDiscord | <chmod222> Glib is a massive library so I'd not bother with doing it myself |
16:25:04 | FromDiscord | <Nlits (Ping on reply)> In reply to @chmod222 "If you know where": So i should not even wrap the function that uses GString instead? I should just use cstring |
16:25:29 | FromDiscord | <chmod222> gstring is not `const char ` so cstring won't work there |
16:27:46 | FromDiscord | <Nlits (Ping on reply)> In reply to @chmod222 "gstring is not `const": no I mean, there are 2 c functions that do the same thing except one uses Gstring and the other uses char |
16:36:02 | FromDiscord | <Nlits (Ping on reply)> In reply to @chmod222 "Since a C enum": Just realized that the enum is meant to hold multiple values (via the | operator in C) and that `0` is for none and ` 0xFFFFFF` is for all |
16:36:11 | FromDiscord | <Nlits (Ping on reply)> How do I properly wrap this? |
16:36:41 | FromDiscord | <chmod222> You can use `set[ThatEnum]` to represent this |
16:37:10 | FromDiscord | <chmod222> https://nim-lang.org/docs/manual.html#set-type-bit-fields |
16:37:16 | FromDiscord | <chmod222> This is exactly what you want |
16:37:54 | FromDiscord | <chmod222> Doesn't work if the enum is too large though, you'll need to see if it works for you |
16:39:39 | FromDiscord | <chmod222> sent a code paste, see https://paste.rs/nbO7M |
16:40:20 | FromDiscord | <chmod222> Since it's `cint`, C will eat it |
16:40:30 | FromDiscord | <Nlits (Ping on reply)> In reply to @chmod222 "Doesn't work if the": the enum has 6 options that can be combined |
16:40:36 | FromDiscord | <chmod222> Again, enums are just ints as far as C is concerned, how they came about doesn't really matter |
16:40:47 | FromDiscord | <chmod222> The set thing will probably work in your case |
16:41:38 | FromDiscord | <Nlits (Ping on reply)> In reply to @chmod222 "The set thing will": how you represent "all" without just adding all the of them in a set. |
16:41:46 | FromDiscord | <jmgomez> @Nlits (Ping on reply) I do this at it has proven to work just fine: https://github.com/jmgomez/NimForUE/blob/master/src/nimforue/unreal/coreuobject/uobjectflags.nim |
16:42:11 | FromDiscord | <Nlits (Ping on reply)> A shortcut type would be nice for "all" |
16:42:17 | FromDiscord | <chmod222> 0xfffffff...↵(@Nlits (Ping on reply)) |
16:42:38 | FromDiscord | <chmod222> or \~0 |
16:42:46 | FromDiscord | <Nlits (Ping on reply)> In reply to @chmod222 "0xfffffff... (<@910899642236043294>)": yeah, but how would I put that into a type... |
16:42:50 | FromDiscord | <chmod222> well, `not 0` |
16:43:14 | FromDiscord | <chmod222> `const AllFlags = cast[FlagsEnum](0xffffffff)` |
16:43:25 | FromDiscord | <Nlits (Ping on reply)> In reply to @chmod222 "`const AllFlags = cast[FlagsEnum](0xffffffff)`": thanks you |
16:44:09 | FromDiscord | <Nlits (Ping on reply)> wait, is flagsEnum the set |
16:44:16 | FromDiscord | <Nlits (Ping on reply)> or just the enum |
16:44:30 | * | lucasta joined #nim |
16:44:30 | FromDiscord | <chmod222> Cast to the set |
16:45:26 | FromDiscord | <Nlits (Ping on reply)> Also, are there any inefficiencies with using `$` to convert between cstring and string? |
16:46:31 | FromDiscord | <demotomohiro> `cast[FlagEnum](-1)` would be simpler |
16:46:45 | FromDiscord | <chmod222> Some I believe, Nim strings are represented differently |
16:46:56 | FromDiscord | <chmod222> But I wouldn't worry about that unless you do it billions of times per second |
16:48:36 | FromDiscord | <demotomohiro> string is already zero terminated so string to cstring is just return pointer to content of the string. |
16:49:43 | FromDiscord | <demotomohiro> cstring to string might requires copying as Nim doesn't know what kind of memory cstring points to. |
16:50:53 | FromDiscord | <chmod222> I'm pretty sure it will copy because Nim will want to own the memory for the new `string` |
16:51:42 | FromDiscord | <chmod222> But again, it's the kind of overhead you only want to look to closely at if you know from profiling that it's a factor |
16:52:09 | FromDiscord | <Nlits (Ping on reply)> sent a code paste, see https://play.nim-lang.org/#ix=4wgZ |
16:52:11 | FromDiscord | <Nlits (Ping on reply)> Guess that does not work? |
16:52:19 | FromDiscord | <Nlits (Ping on reply)> Or is it supposed to be a const |
16:52:47 | FromDiscord | <chmod222> i64 may be too large, since that's not cint anymore |
16:53:13 | FromDiscord | <Nlits (Ping on reply)> In reply to @chmod222 "i64 may be too": I never set it to i64 |
16:53:28 | FromDiscord | <Nlits (Ping on reply)> sent a code paste, see https://play.nim-lang.org/#ix=4wh0 |
16:54:32 | FromDiscord | <Nlits (Ping on reply)> In reply to @demotomohiro "`cast[FlagEnum](-1)` would be simpler": tried that, did not work either |
16:55:58 | FromDiscord | <demotomohiro> In reply to @not logged in "tried that, did not": If you using `set[]`, https://nim-lang.org/docs/setutils.html#fullSet%2Ctypedesc%5BT%5D |
17:09:30 | FromDiscord | <jmgomez> In reply to @not logged in "And const gives this": why dont you just do importc? |
17:10:45 | FromDiscord | <jmgomez> For cpp this works just fine: `{. importcpp, nodecl size:sizeof(TheSize).}` |
17:11:16 | FromDiscord | <jmgomez> (edit) "nodecl" => "nodecl," |
17:22:16 | FromDiscord | <Nlits (Ping on reply)> In reply to @demotomohiro "If you using `set[]`,": ok, I don't need it then |
17:22:28 | FromDiscord | <Nlits (Ping on reply)> In reply to @jmgomez "For cpp this works": for the enum? |
17:23:04 | FromDiscord | <jmgomez> In reply to @not logged in "for the enum?": Yes, posted a file above |
17:24:10 | FromDiscord | <jmgomez> There is also a macro that defines some operation on them and generates a few converters so they can be used at compile time (but I dont think you need the later) |
17:24:19 | FromDiscord | <Nlits (Ping on reply)> In reply to @jmgomez "Yes, posted a file": does it have any explicit benefits? |
17:25:36 | FromDiscord | <Nlits (Ping on reply)> it breaks stuff, idk if i should use it |
17:26:09 | FromDiscord | <Nlits (Ping on reply)> sent a code paste, see https://play.nim-lang.org/#ix=4whb |
17:27:16 | FromDiscord | <jmgomez> importc them breaks things? Sounds like the compiler doesnt locate where the original lives |
17:27:41 | FromDiscord | <jmgomez> you would need to have that file in the search path of the c compiler |
17:28:15 | FromDiscord | <Nlits (Ping on reply)> In reply to @jmgomez "you would need to": idk where that is. I placed in the nimble bin hoping the c compiler would find it, but it seems it does not work |
17:28:22 | FromDiscord | <jmgomez> I also use PCH for all the headers. So the C/C++ compiler doesnt compile redundant stuff |
17:29:51 | FromDiscord | <jmgomez> there is `--passC` and `-t` to pass parameters to the compiler. I think there is also one specific for includes in the nim compiler, `cIncludes`? |
17:31:03 | FromDiscord | <Nlits (Ping on reply)> I still dk where my nimble package needs to put the .h file |
17:33:21 | FromDiscord | <jmgomez> You have a file with your c sources? |
17:33:30 | FromDiscord | <jmgomez> (edit) "file" => "folder" |
17:35:05 | FromDiscord | <Nlits (Ping on reply)> In reply to @jmgomez "You have a folder*": Yes, idk why but I put both my .a file and my .h file in `.nimble/bin` (I was trying to make it install them when you install the nimble package) |
17:36:10 | FromDiscord | <jmgomez> ahh, I see. Then you would need to add that nimble/bin to the search paths in the C compiler and watch out how rst_lib.h is used, if it's just like that you could add it directly in there |
17:37:48 | FromDiscord | <Nlits (Ping on reply)> In reply to @jmgomez "ahh, I see. Then": so, I looked it up and I need to pass a `-I` flag to the c comp, is there a good way to do this in the lib? (Kind of like passl pragma) |
17:38:10 | FromDiscord | <Nlits (Ping on reply)> Also, do you happen to know why the passL pragma does not error when the lib does not exist? |
17:38:53 | FromDiscord | <Nlits (Ping on reply)> ok, nvm: https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-passc-pragma |
17:40:48 | FromDiscord | <Nlits (Ping on reply)> sent a code paste, see https://play.nim-lang.org/#ix=4whi |
17:45:19 | FromDiscord | <Nlits (Ping on reply)> works |
17:46:33 | FromDiscord | <pinkdev> any example of embedding nimscript or whatever its called? |
17:48:17 | FromDiscord | <Nlits (Ping on reply)> In reply to @pinkdev "any example of embedding": what do you mean embedding? |
17:48:36 | FromDiscord | <pinkdev> as a scripting language in my application |
17:48:46 | FromDiscord | <Elegantbeef> https://github.com/beef331/nimscripter |
17:48:55 | FromDiscord | <pinkdev> oh thanks |
17:48:59 | FromDiscord | <pinkdev> ill check that! |
17:59:17 | FromDiscord | <Nlits (Ping on reply)> do .a files work on windows? |
17:59:30 | FromDiscord | <Elegantbeef> If you use mingw |
17:59:47 | FromDiscord | <Elegantbeef> And it was compiled with mingw |
18:00:19 | FromDiscord | <Nlits (Ping on reply)> In reply to @Elegantbeef "And it was compiled": so I need to compile 1 version of the c lib for linux, and one for windows |
18:00:27 | FromDiscord | <Nlits (Ping on reply)> I am assuming the .h file works for both |
18:00:28 | FromDiscord | <sOkam!> @PMunch could you give a simple example of how you would access the code in here with futhark?↵https://github.com/godotengine/godot-headers/blob/master/godot/gdnative_interface.h |
18:00:54 | FromDiscord | <sOkam!> in order to avoid having to do a c2nim pass |
18:01:16 | FromDiscord | <sOkam!> (it absolutely obliterates the format, even with c2nim 😭 |
18:01:25 | FromDiscord | <sOkam!> (edit) "😭" => "😭)" |
18:01:42 | FromDiscord | <sOkam!> (edit) "(it" => "(c2nim" | "c2nim" => "Nep1" |
18:02:04 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4whn |
18:02:32 | FromDiscord | <sOkam!> how are the functions accessed after? |
18:03:00 | FromDiscord | <jmgomez> In reply to @not logged in "so I need to": why dont you use `.lib` on win? |
18:03:00 | FromDiscord | <Elegantbeef> verbatim name |
18:03:20 | FromDiscord | <Elegantbeef> Mingw makes a `.a` afaik so that's one reason |
18:03:32 | FromDiscord | <Nlits (Ping on reply)> sent a code paste, see https://play.nim-lang.org/#ix=4wgI |
18:03:42 | FromDiscord | <jmgomez> In reply to @Elegantbeef "Mingw makes a `.a`": well, there is `clang` and `msvc` |
18:03:55 | FromDiscord | <Elegantbeef> Sure |
18:03:59 | FromDiscord | <Nlits (Ping on reply)> sent a code paste, see https://play.nim-lang.org/#ix=4who |
18:04:04 | FromDiscord | <Elegantbeef> But mingw is better cause i can use it on linux 😛 |
18:04:11 | * | Guest15 joined #nim |
18:04:30 | * | Guest15 quit (Client Quit) |
18:04:36 | FromDiscord | <Nlits (Ping on reply)> In reply to @Elegantbeef "But mingw is better": how do you even install mingw |
18:04:47 | FromDiscord | <Elegantbeef> `yay mingw` |
18:05:08 | FromDiscord | <Nlits (Ping on reply)> In reply to @Elegantbeef "`yay mingw`": ;-; |
18:05:11 | FromDiscord | <Nlits (Ping on reply)> not a command |
18:05:23 | FromDiscord | <Elegantbeef> Use a better OS |
18:06:10 | FromDiscord | <Elegantbeef> Wait @sOkam! what was wrong with the c2nim'd file? |
18:06:11 | FromDiscord | <Elegantbeef> Seems fine to me |
18:06:15 | FromDiscord | <Nlits (Ping on reply)> In reply to @Elegantbeef "Use a better OS": I can't really |
18:06:40 | FromDiscord | <Nlits (Ping on reply)> sent a code paste, see https://play.nim-lang.org/#ix=4whp |
18:06:43 | FromDiscord | <Nlits (Ping on reply)> The header file legit defines it |
18:08:00 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4whq |
18:08:55 | FromDiscord | <Elegantbeef> Are you really that concerned with the format of mostly typedefs 😄 |
18:09:09 | FromDiscord | <sOkam!> its fucking unreadable beyond reason |
18:09:21 | FromDiscord | <sOkam!> i cannot even navigate it without losing track of where i am |
18:09:42 | FromDiscord | <Elegantbeef> Futhark isnt going to do any better |
18:09:53 | FromDiscord | <Elegantbeef> Actually maybe it will with the new features pmunch added |
18:09:55 | FromDiscord | <sOkam!> no but it will avoid me having to rename everything |
18:10:11 | FromDiscord | <Elegantbeef> "rename everything"? |
18:10:34 | FromDiscord | <Elegantbeef> `c2nim --stdints ./the.h` solves the int mismatch |
18:10:38 | FromDiscord | <sOkam!> slow coder brain issues. i cannot live with the mess |
18:10:47 | FromDiscord | <Elegantbeef> wchar\_t requires looking at what type of wchar they use |
18:10:58 | FromDiscord | <Nlits (Ping on reply)> 🤦♂️ I just realized I had extra quotes |
18:11:28 | FromDiscord | <Nlits (Ping on reply)> sent a code paste, see https://play.nim-lang.org/#ix=4whr |
18:15:30 | FromDiscord | <Nlits (Ping on reply)> I got it working |
18:15:58 | FromDiscord | <Nlits (Ping on reply)> sent a code paste, see https://play.nim-lang.org/#ix=4whs |
18:16:24 | FromDiscord | <Elegantbeef> I'm surprised there isnt a `--lineLength` or similar flag to stop the odd formatting |
18:23:01 | * | ttkap joined #nim |
19:02:08 | FromDiscord | <enigma> In reply to @not logged in "🤦♂️ I just realized": single quotes are for char ↵doulble for strings |
19:02:21 | FromDiscord | <enigma> (edit) "↵doulble" => "↵double" |
19:09:46 | FromDiscord | <michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4whC |
19:25:54 | FromDiscord | <enigma> sent a code paste, see https://play.nim-lang.org/#ix=4whG |
19:26:43 | FromDiscord | <enigma> so i just compiled w/ separated options,..but not seeing a `cache` |
19:26:47 | FromDiscord | <michaelb.eth> I don't think you can combine them |
19:26:47 | FromDiscord | <enigma> my goal was to get the c files |
19:27:15 | FromDiscord | <michaelb.eth> by default the c files are in `~/.cache/nim` on non-Windows |
19:27:17 | FromDiscord | <enigma> (edit) "`cache`" => "`nimcache`" |
19:27:29 | FromDiscord | <michaelb.eth> you can, though, control where the cache directory resides, just a sec |
19:30:23 | FromDiscord | <enigma> sent a code paste, see https://play.nim-lang.org/#ix=4whH |
19:30:55 | FromDiscord | <enigma> (edit) "https://play.nim-lang.org/#ix=4whH" => "https://play.nim-lang.org/#ix=4whI" |
19:31:43 | FromDiscord | <michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4whJ |
19:34:42 | FromDiscord | <michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4whK |
19:35:27 | FromDiscord | <enigma> In reply to @michaelb.eth "if you have a": I do not have one, so I'll look into that too. ↵thank you for the tip! |
19:44:55 | * | Notxor joined #nim |
19:55:44 | * | azimut quit (Ping timeout: 240 seconds) |
19:56:54 | * | azimut joined #nim |
20:48:43 | * | lucasta quit (Quit: Leaving) |
21:10:52 | FromDiscord | <Chronos [She/Her]> What's a very simple library to use for API stuff? |
21:11:09 | FromDiscord | <Chronos [She/Her]> Rather not use Prologue when in reality all I need is JSON requests and stuff |
21:11:23 | FromDiscord | <Chronos [She/Her]> Sending and fetching JSON data from an API, I mean |
21:13:49 | FromDiscord | <Chronos [She/Her]> May use httpx tbh |
21:47:18 | * | Notxor quit (Remote host closed the connection) |
21:47:35 | * | Notxor joined #nim |
21:56:59 | * | lucasta joined #nim |
22:08:26 | FromDiscord | <jmgomez> In reply to @Hourglass, When the Hour Strikes "Rather not use Prologue": What's wrong with using Prologue for that? Is not like you were pulling unnecessary stuff |
22:20:03 | * | Notxor quit (Remote host closed the connection) |
22:20:53 | FromDiscord | <michaelb.eth> In reply to @Hourglass, When the Hour Strikes "What's a very simple": how about nim-json-rpc?↵https://github.com/status-im/nim-json-rpc |
22:42:26 | FromDiscord | <Kirik> Hi, I wonder where is that "sk" folder on my disk, can anyone claify what is "sk" in this path config if its not a forler ?↵` export PATH=/home/sk/.nimble/bin:$PATH`↵Thanks a lot |
22:42:53 | FromDiscord | <Kirik> (edit) "claify" => "clarify" | "forler" => "real folder" |
22:43:22 | FromDiscord | <Kirik> (edit) "PATH=/home/sk/.nimble/bin:$PATH`↵Thanks" => "PATH=/home/sk/.nimble/bin:$PATH`↵Linux install / Thanks" |
22:44:04 | FromDiscord | <Kirik> (edit) "its not" => "it ain't" |
23:02:47 | FromDiscord | <michaelb.eth> `sk` is the name of a user on the Linux system, is that the username you use on your system? |
23:02:53 | FromDiscord | <Graveflo> idk what did `~` evaluate to when the config file was dropped? |
23:03:06 | FromDiscord | <Nlits (Ping on reply)> In reply to @enigma "single quotes are for": Ik, I meant I mixed up some stuff, I was using double for everything |
23:05:27 | FromDiscord | <Graveflo> In reply to @Kirik "Hi, I wonder where": try running this in terminal: `cat /etc/passwd | grep ^sk` |
23:06:36 | FromDiscord | <Kirik> In reply to @Graveflo "try running this in": nothin happens... |
23:07:57 | FromDiscord | <Graveflo> welp that is odd. Are they any account names of which "sk" is a substring? |
23:08:43 | FromDiscord | <Kirik> In reply to @Graveflo "welp that is odd.": dont know, i usually dont mix at all with user account creation or edition... |
23:09:11 | FromDiscord | <Kirik> nim works and compile fine though... |
23:09:43 | FromDiscord | <Graveflo> if you type `sudo ls -an /home` in terminal do you see anything different? |
23:10:47 | FromDiscord | <Kirik> diferent than previously or what ? |
23:11:30 | FromDiscord | <Graveflo> well you sad that the folder isn't on your disk. is it present in that output? what flavor so linux is this btw |
23:11:48 | FromDiscord | <Graveflo> (edit) "so" => "of" |
23:12:02 | FromDiscord | <Kirik> mint, no, I dont see any sk folder |
23:12:30 | FromDiscord | <Kirik> it does say > total 4...but only list 3 lines |
23:12:40 | FromDiscord | <Graveflo> oh ok. try `which nim` |
23:13:41 | FromDiscord | <Kirik> > > /home/mint/.nimble/bin/nim |
23:13:49 | FromDiscord | <Kirik> still no "sk" |
23:14:21 | FromDiscord | <Graveflo> okay so it seems that config file was made on a different computer that had a different file structure. So it basically wont do anything unless that path exists at some point. |
23:15:49 | FromDiscord | <Kirik> ok, i've just made this fresh installation of nim, maybe i should reboot and see if the .config/bashrc still works or need a new edition with the correct path... |