00:00:12 | FromDiscord | <spoon> are there any other language-agnostic solutions to scripting? llvm maybe? |
00:00:31 | FromDiscord | <Elegantbeef> System libraries |
00:00:44 | FromDiscord | <huantian> though I'm still not very familiar with wasm in geenra |
00:00:49 | FromDiscord | <spoon> wouldn't that make it platform-dependent though? |
00:00:59 | FromDiscord | <Elegantbeef> So what? |
00:01:18 | FromDiscord | <Elegantbeef> Crosscompiling is easiy |
00:01:27 | FromDiscord | <Elegantbeef> easier than me spelling easy atleast |
00:02:18 | FromDiscord | <spoon> system libraries? |
00:02:28 | FromDiscord | <spoon> for scripting? |
00:02:32 | nrds | <Prestige99> Can a seq be passed to a function expecting varargs, or do you have to "spead" it somehom? |
00:02:34 | FromDiscord | <Elegantbeef> Yes |
00:02:35 | nrds | <Prestige99> somehow* |
00:02:52 | nrds | <Prestige99> neat ty |
00:02:52 | FromDiscord | <Elegantbeef> It works identical to how WASM works, and is basically how GDNative works in 3.x |
00:02:58 | nrds | <Prestige99> oh |
00:03:07 | FromDiscord | <Elegantbeef> `varargs[T]` should accept `seq` |
00:03:18 | nrds | <Prestige99> that's neat |
00:03:31 | FromDiscord | <Elegantbeef> If it doesnt you can take an `openArray` instead 😄 |
00:03:32 | FromDiscord | <huantian> can you only pass ints and floats and other basic datatypes through wasm exposed funcs? |
00:04:10 | FromDiscord | <Elegantbeef> It also supports tuples, but yea it's a relatively barebones bridge |
00:04:14 | FromDiscord | <spoon> if you want different languages to support it, probably |
00:04:18 | FromDiscord | <Elegantbeef> It does have reference support but didnt see how that works |
00:05:37 | FromDiscord | <Elegantbeef> reference types in wasm are pointer basicallly that can only come from the host |
00:06:49 | FromDiscord | <Elegantbeef> So the way it works is you get a reference from the host and the host defines procedures for that reference type |
00:07:09 | FromDiscord | <Elegantbeef> So all the operations happen in the host environment but can be scripted from WASM |
00:08:50 | FromDiscord | <Elegantbeef> I really need to look at a wasm runtime a bit more an play with it |
00:11:43 | FromDiscord | <Elegantbeef> Who wants to make yet another wasm runtime? |
00:13:06 | FromDiscord | <huantian> hm is it possible inspect the exported functions from wasm? |
00:13:18 | FromDiscord | <Elegantbeef> Which way? |
00:13:29 | FromDiscord | <Elegantbeef> From the host? |
00:13:35 | FromDiscord | <huantian> Host program looks at what functions the script implements |
00:13:45 | FromDiscord | <Elegantbeef> I'd imagine so |
00:16:05 | FromDiscord | <Elegantbeef> Yea it seems you can |
00:16:16 | FromDiscord | <Elegantbeef> Atleast with the WASM runtime i'm looking at now |
00:19:08 | FromDiscord | <Elegantbeef> @huantian\: might be better to refer to https://wasmedge.org/book/en/embed/c.html |
00:19:08 | FromDiscord | <Elegantbeef> It's better documented |
00:20:38 | FromDiscord | <Alea> I tried the block highlighter plugin and it changed my current line highlight :BwaahSnap: |
00:20:48 | FromDiscord | <Alea> and now I can't undo it |
00:21:00 | FromDiscord | <huantian> it's in your settings.json |
00:21:31 | FromDiscord | <Elegantbeef> Yea blockman doesnt work for Nim presently iirc |
00:21:32 | FromDiscord | <Elegantbeef> I couldnt be arsed to fix it |
00:21:32 | FromDiscord | <Elegantbeef> It'd be a nice project if someone wanted to |
00:43:44 | FromDiscord | <Elegantbeef> uh oh futhark dun brokey on wasmedge |
00:44:30 | FromDiscord | <Rika> I can’t believe you broke it |
00:44:45 | FromDiscord | <Elegantbeef> Same |
00:46:52 | FromDiscord | <Elegantbeef> Might be me on second thought |
00:48:40 | FromDiscord | <Elegantbeef> Eitherway seems clang is having fun with int128 |
01:05:17 | FromDiscord | <!Patitotective> sent a code paste, see https://paste.rs/UGC |
01:05:24 | FromDiscord | <!Patitotective> (edit) "https://play.nim-lang.org/#ix=3WHv" => "https://paste.rs/BnJ" |
01:05:38 | FromDiscord | <Elegantbeef> You can make it catchable but it's dumb to and bad practise |
01:05:43 | FromDiscord | <Elegantbeef> Nil check your code |
01:06:36 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "You *can* make it": its just that when an image fails loading i dont want the app to crash, but instead to load an empty image |
01:07:18 | FromDiscord | <huantian> how does the image fail to load? |
01:07:27 | FromDiscord | <Elegantbeef> So then do `if image.isNil` |
01:07:41 | FromDiscord | <Elegantbeef> You dont catch nil errors you.... check if it's not nil |
01:07:53 | FromDiscord | <Elegantbeef> Yay huan i got wasmedge working! 😄 |
01:08:41 | FromDiscord | <huantian> 👏 |
01:08:57 | FromDiscord | <huantian> what's the difference between wasmedge and wasmer |
01:08:59 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3WHy |
01:08:59 | FromDiscord | <!Patitotective> sent a code paste, see https://paste.rs/hkk |
01:09:00 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "You dont catch nil": smart |
01:10:11 | * | vicfred joined #nim |
01:12:54 | FromDiscord | <Elegantbeef> Better docs↵(@huantian) |
01:13:00 | FromDiscord | <huantian> mm |
01:13:26 | FromDiscord | <Elegantbeef> The CAPI for wasmer was a dead link and -10 docs existed |
01:42:43 | FromDiscord | <Elegantbeef> Uh oh the generated futhark bindings are causing a nil reference error |
01:42:48 | FromDiscord | <ynfle> In reply to @Knedlik "Sorry that I took": There isn't any code there |
01:43:58 | FromDiscord | <Elegantbeef> https://github.com/Periapsis-Studios/Beyond-the-Sphere/tree/nim there is here |
01:45:48 | FromDiscord | <ynfle> ok thanks |
01:55:40 | FromDiscord | <huantian> In reply to @Elegantbeef "The CAPI for wasmer": Yeahhh I couldn’t find good docs on it |
01:57:26 | FromDiscord | <Elegantbeef> think\ |
02:01:28 | FromDiscord | <ElegantBeef> Lol matrix bridge went kapoot again |
02:01:44 | FromDiscord | <ElegantBeef> Well Huan i sent a message for you there go read it! |
02:10:03 | * | Zectbumo quit (Remote host closed the connection) |
02:12:17 | FromDiscord | <ynfle> @Knedlik it doesn't crash for me on 1.6.4 on macOS. Is there something specific that you did that made it crash? |
02:13:02 | FromDiscord | <ynfle> I noticed you are using devel, any reason? |
02:23:46 | * | arkurious quit (Quit: Leaving) |
02:36:25 | FromDiscord | <Elegantbeef> For storing values it seems |
02:36:40 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/970151740894744656/image.png |
02:45:48 | FromDiscord | <huantian> Ahh |
03:17:30 | NimEventer | New Nimble package! mealdb - TheMealDB API client, see https://github.com/thechampagne/mealdb-nim |
03:18:34 | FromDiscord | <Rika> In reply to @NimEventer "New Nimble package! mealdb": Terrifying object right there |
03:19:03 | FromDiscord | <Elegantbeef> Jeesus christ people enum arrays exist |
03:33:26 | * | Zectbumo joined #nim |
04:16:19 | pch | very funny development in the awfulness of my situation means things are even worse but also in a way that means my projects are now back to being worked on until i find paid work |
04:16:51 | pch | so if you remember me putting all my projects on hold i believe early april? that's reversed but not becasue of things getting better |
04:17:17 | pch | oh, no, it was end of march |
04:17:50 | pch | give me a few days to recover mentally though, and if I get paid work in that time then oops lol |
04:18:23 | pch | (paid work isn't going to happen, nobody ever pays me for shit) |
04:21:47 | FromDiscord | <Elegantbeef> Hey more Nim code the better 😛 |
04:22:03 | pch | i really wish that were the case |
04:22:32 | pch | my projects being in nim is actually likely to hinder positive progress in this case, due to low hiring desirability |
04:23:23 | pch | basically i need a job that pays a living wage and doesn't care which country i live in by the end of may that also won't care if i immediately take a week away to move |
04:23:31 | FromDiscord | <Elegantbeef> Eh my view is it's a system language and complex projects still show off capabillity and intelligence, but i'm also a numpty |
04:23:49 | pch | yes, but nobody hiring searches through nim code |
04:24:02 | pch | and projects being in nim reduces their visibility to the nim-using community mainly |
04:24:54 | pch | and no company that i can submit a resume with a link to my github to will hire me as they will also require arbitrary education-related formalities to be met |
04:25:01 | pch | such as having finished high school |
04:26:37 | pch | in fact finding any job willing to pay me, for this reason only, in the deadline I have to obtain gainful employment, will require an extreme strike of luck that has no reason to happen now, as it has not happened in the 6 years I've been trying to make it happen |
04:27:21 | pch | employers don't care if you've performed and proven highly useful research in your field unless they heard of it 10 years ago |
04:28:06 | pch | employers don't care if they're using software you are the sole developer and licensor of unless you're famous |
04:29:30 | pch | employers don't care if you have more experience in the field than all of their entire current hirebase combined unless you have a degree from a university in their country |
04:30:41 | pch | I'm maybe too bitter right now to be chatting |
04:31:19 | pch | at this point the only hope for me is if someone sees my bitter rants and tries to make them stop with money |
04:31:47 | pch | if I don't have gainful employment in a month all of my equipment will be destroyed and I will be homeless, presumably permanently this time |
04:32:08 | pch | even then I still have to find somewhere to go |
04:32:31 | pch | oh crap just counted how many lines I've just sent |
04:33:08 | FromDiscord | <Rika> Well I don’t know most of us here don’t use Nim to get employed |
04:33:24 | FromDiscord | <Rika> If we wanted employment we’d use whatever popular language most tolerable to us |
04:35:49 | pch | I do |
04:36:36 | FromDiscord | <Rika> I can’t tell you what to do nor will I say what I think because you’re just gonna snap at me so xd |
04:36:36 | pch | I use C, I use java, I use C#, I use AArch64 ASM, so many others, but my biggest undertakings are all in nim |
04:36:41 | FromDiscord | <Rika> Good luck or whatever |
04:36:58 | pch | no, I'm not going to snap at you, sorry for making that impression |
04:37:16 | pch | just very embittered with employers and in a situation of awfulness that they created |
05:27:34 | FromDiscord | <Phil> In reply to @Rika "If we wanted employment": ~~If you want employment in germany you do java, python or search for ages~~ |
05:31:10 | * | slowButPresent quit (Quit: leaving) |
05:46:29 | FromDiscord | <SolitudeSF> @dom96 you forgot to ban me on matrix, asshole. im still posing a huge threat to the community. |
05:47:18 | FromDiscord | <Rika> When did you get banned lmao |
05:47:38 | FromDiscord | <SolitudeSF> yesterday/today |
05:47:58 | FromDiscord | <SolitudeSF> community-wide ban too, im a fucking problem |
05:48:10 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/970199934223663124/image.png |
05:48:13 | FromDiscord | <Elegantbeef> Ah you're the reason for this |
05:48:17 | FromDiscord | <Elegantbeef> I was confused what they did |
05:49:04 | FromDiscord | <SolitudeSF> what |
05:49:28 | FromDiscord | <Elegantbeef> The icon on the left when hovered says "thread author banned" |
05:50:15 | FromDiscord | <SolitudeSF> i havent authored any threads in last year |
05:50:59 | FromDiscord | <Elegantbeef> Bug with forum code i wager |
05:51:14 | FromDiscord | <SolitudeSF> as expected |
05:52:20 | FromDiscord | <xflywind> Why are you banned? Is there some conversations link? |
05:52:40 | FromDiscord | <xflywind> (edit) "Is" => "Are" | "conversations link?" => "conversation links?" |
05:53:28 | FromDiscord | <Elegantbeef> Seems it's in #discord-only |
05:54:05 | FromDiscord | <xflywind> I se |
05:54:09 | FromDiscord | <xflywind> (edit) "se" => "see" |
05:55:02 | FromDiscord | <Elegantbeef> I dont know why exactly |
06:04:30 | pch | i am not in discord and have no access to context but im not sure i want to know tbh |
06:04:45 | FromDiscord | <Elegantbeef> Eh was a dick measuring contest for the most part |
06:05:00 | pch | probably just someone acting out to make a security hole noticed or something |
06:05:42 | pch | or like just yelling at mods for random programming politics crap like "support riscv better or else" |
06:06:01 | pch | even though nim doesn't use any asm directly afaik |
06:06:54 | FromDiscord | <Elegantbeef> Nah it was dick measuring contest about someone getting someone banned from another server or something like that |
06:09:14 | FromDiscord | <Elegantbeef> Dumb shit |
06:10:29 | pch | oh so like, mind poison, got it |
06:28:12 | FromDiscord | <Phil> I mean, the last 48h in discord-only were a mud-bath of the dirty kind, skimming through it.↵I'm personally surprised to see a ban result out of this that wasn't xanax's |
06:29:23 | FromDiscord | <Phil> But this is offtopic I guess |
07:00:28 | * | neceve joined #nim |
07:24:12 | * | jmdaemon quit (Ping timeout: 240 seconds) |
07:25:51 | FromDiscord | <ShalokShalom> pch: Reading your comments on employment. I think considering the chances of getting hired, F#, Scala (3), and maybe Clojure might be the sanest modern languages in my point of view, who offer you a job. ↵↵Simply for the reason, that they employ established platforms, and lots of shops are ready to hire people from these "unknown" languages. |
07:26:43 | FromDiscord | <ShalokShalom> I prefer Nim being simply a compiler, as in contrast, needing to setup .NET, personally. |
07:28:52 | FromDiscord | <ShalokShalom> In reply to @Alea "If you only attract": Nobody said attracting established users only. I said, it won't grow, if attracting new programmers isnt a goal, like Python and Ruby do, success like in those languages will stay out. |
07:29:56 | FromDiscord | <ShalokShalom> In reply to @konsumlamm "Rust didn't get popular": Rust is in a very special position, attracting both C++ and Haskell developers, who are tired of their old languages and I would argue, there is not much room left in that space. |
07:31:02 | FromDiscord | <ShalokShalom> And Nim seems to try to challenge Rust, more so than Ruby and Python, when I see how newbies are considered potential users and that's the mistake in my book. |
07:31:07 | FromDiscord | <ShalokShalom> 🙂 |
07:39:21 | FromDiscord | <Knedlik> In reply to @ynfle "I noticed you are": Devel doesn’t get flagged by Avast |
07:40:20 | FromDiscord | <Knedlik> And what you were responding to already got resolved |
08:08:19 | FromDiscord | <ITR> Are there any image manipulation libraries? |
08:08:26 | FromDiscord | <Rika> Pixie |
08:09:05 | FromDiscord | <ITR> ty |
08:39:07 | * | SebastianM joined #nim |
08:39:53 | * | Gustavo6046 quit (Quit: Goodbye! Leave messages at my XMPP @ [email protected] or my Discord Gustavo6046#9009 or possibly my Mastodon [email protected] – I don't check my email often since it's full of crap, but in any case, [email protected]) |
08:56:04 | * | SebastianM quit (Quit: Bye) |
08:58:43 | FromDiscord | <ITR> is there a faster way of flattening a seq of seq than foldl? |
08:59:22 | FromDiscord | <Elegantbeef> It's a slow data structure so dont expect muuch 😄 |
08:59:38 | FromDiscord | <Rika> An iterator then to seq lmao |
09:00:02 | * | ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
09:00:45 | * | ehmry joined #nim |
09:00:50 | FromDiscord | <Elegantbeef> nested seq is one of the slower things you can do 😄 |
09:07:03 | FromDiscord | <dom96> In reply to @flywind "Why are you banned?": For reacting with the words "HITLER" on a person's message, after I warned them to stop that kind offensive bullshit. |
09:07:19 | FromDiscord | <dom96> (edit) "In reply to @flywind "Why are you banned?": For reacting with the words "HITLER" on a person's message, after I warned them to stop that kind ... offensive" added "of" |
09:08:28 | FromDiscord | <Phil> So we do have an Andreas and an Araq account on this server.... if a "Rumpf" account joins, we'll have a tri-fecta |
09:08:58 | FromDiscord | <Phil> As bill wurtz would say, we can make a religion out of this |
09:09:29 | FromDiscord | <Rika> In reply to @Isofruit "So we do have": LMAO |
09:09:55 | FromDiscord | <dom96> lol |
09:11:43 | FromDiscord | <dom96> wow, so it seems most people want style insensitivity to stay |
09:12:02 | FromDiscord | <Elegantbeef> Yea it's not Nim programmers that complain about it |
09:13:37 | FromDiscord | <dom96> I guess removing do notation is even less likely, my dreams are crushed :P |
09:16:00 | FromDiscord | <Elegantbeef> Eh that's more disliked |
09:16:22 | FromDiscord | <Phil> Couldn't come up with a decent pattern where I'd actually want to use the do notation |
09:16:43 | FromDiscord | <dom96> In reply to @Elegantbeef "Eh that's more disliked": yeah, that's what I think too |
09:17:31 | FromDiscord | <Elegantbeef> Eitherway i'd liked more intelligent inference of procedure definitions |
09:17:49 | FromDiscord | <Elegantbeef> There is no reason to need types on a procedure passed to a non ambious procedure call |
09:18:36 | FromDiscord | <Andreas> Would it be a big effort to make case-sensivity a option ? maybe a compile-switch ? |
09:18:40 | FromDiscord | <Josef> How do I create 32bit dll?↵Is it possible to specify C++ version (for ABI compatibility)? |
09:18:43 | FromDiscord | <dom96> In reply to @Elegantbeef "There is no reason": sure, but that shouldn't require breaking changes |
09:19:04 | FromDiscord | <Elegantbeef> It doesnt make sense as an option↵(@Andreas) |
09:19:37 | FromDiscord | <xflywind> In reply to @Andreas "Would it be a": It is already an option. Uses "--stylecheck:usages" |
09:20:11 | FromDiscord | <Andreas> In reply to @Elegantbeef "It doesnt make sense": great, did not knew about this - so done |
09:20:59 | FromDiscord | <Elegantbeef> Atleast i think it doesnt make sense as an option 😄 |
09:21:22 | FromDiscord | <xflywind> The Nim compiler source actually uses "--styleCheck:errors" which enforces nep1 and the stdlib tests uses "--styleCheck:usages". |
09:21:45 | FromDiscord | <Elegantbeef> It doesnt take into account your preferred API as such you're forced to use it like the API you want |
09:22:07 | FromDiscord | <xflywind> (edit) ""--styleCheck:usages"." => ""--styleCheck:usages" enforces case senitivity." |
09:22:14 | FromDiscord | <Elegantbeef> So it's dumb as hell if you use two libraries with different styles |
09:22:46 | FromDiscord | <xflywind> yeah it is good if you can control all the libs you have |
09:23:17 | FromDiscord | <xflywind> that's what status does, they enfore "styleCheck:usages" |
09:23:39 | FromDiscord | <xflywind> (edit) "enfore" => "enforce" | "enforce"styleCheck:usages" ... " added "for the libraries they have." |
09:23:50 | FromDiscord | <Elegantbeef> Now we could argue there is merit in saying "There is only one right way to program" but I feel that's demonstrably false |
09:25:50 | FromDiscord | <xflywind> If we can have case sensitivity, one bonus is that Nim can support `_` as the start of an identifier which is convenient for C interoperability in some extent. |
09:26:03 | FromDiscord | <dom96> true |
09:26:17 | FromDiscord | <Elegantbeef> What's the benefit of that? |
09:26:20 | FromDiscord | <Elegantbeef> Shitty code? |
09:27:04 | FromDiscord | <Elegantbeef> You dont even need case sensitivity to support that you just make it so only `_` after the first is disregarded like the case sensitivity is already done |
09:28:03 | FromDiscord | <whisper> Is disruptek here or was he banned also from discord? |
09:28:09 | FromDiscord | <Elegantbeef> He was banned |
09:28:14 | FromDiscord | <dom96> he was banned from everywhere |
09:28:53 | FromDiscord | <dom96> except github that is |
09:29:58 | FromDiscord | <dom96> I think the thing that gets me about style insensitivity is how it evolved into this partial thing, where we're not even fully case insensitive anymore. It's just such a complicated rule by now. |
09:30:34 | FromDiscord | <dom96> I can really see this being a barrier to entry for a lot of people |
09:30:49 | FromDiscord | <Elegantbeef> Is "first character is sensitive" really a complex rule |
09:30:50 | FromDiscord | <Elegantbeef> I think my dogs understand it |
09:30:51 | FromDiscord | <whisper> Oh I wanted to ask him about the his cloud libs |
09:31:16 | FromDiscord | <Elegantbeef> You can head to matrix and go hitup #disruptek or nim-skull's matrix |
09:31:26 | FromDiscord | <whisper> It is kinda neat but i dont want to rely on libs from a basically banned user xD |
09:31:54 | FromDiscord | <Elegantbeef> He makes good software so you'll be fine |
09:32:23 | FromDiscord | <Phil> I think it isn't a complicated rule to avoid |
09:32:46 | FromDiscord | <ITR> In reply to @Elegantbeef "nested seq is one": problem is that I'm reading from a json file with lists of lists, lol. I feel like it should be possible with some speedup by anticipating the size by summing the length of the seqs first? As it currently stands it's running even slower than in python, even when compiled with d:release |
09:32:54 | FromDiscord | <Phil> But I can see it being hard to actually make use of (case insensitivity that is) |
09:33:10 | FromDiscord | <whisper> Maybe I should figure out how that openapi generator works |
09:33:15 | FromDiscord | <Elegantbeef> Nim's json is slow use jsony, jason, or packedjson |
09:33:47 | FromDiscord | <ITR> In reply to @Elegantbeef "Nim's json is slow": yea, but doesn't really help me when the flattening afterwards takes even longer |
09:33:53 | FromDiscord | <Elegantbeef> nested sequences thrash the cache so you're going to lose a lot of performance |
09:34:17 | FromDiscord | <Andreas> BTW = why has nobody tried to wrap SIMDJson yet ? |
09:34:20 | FromDiscord | <Elegantbeef> I mean you can skip the flattening with your own json hook |
09:34:34 | FromDiscord | <Phil> Never heard of it |
09:34:36 | FromDiscord | <dom96> In reply to @whisper "It is kinda neat": yeah, I wouldn't recommend it |
09:34:46 | FromDiscord | <Elegantbeef> ...? |
09:34:54 | FromDiscord | <Phil> (edit) "Never heard of it ... " added "(SIMDJson)" |
09:35:11 | FromDiscord | <ITR> double iterator like rika suggested might work better, I guess that's what python does |
09:35:28 | FromDiscord | <Andreas> rumor has it - you can't get any faster than SIMDJson 🙂 |
09:35:31 | FromDiscord | <ITR> json hook sounds more work |
09:35:40 | FromDiscord | <Elegantbeef> It's super easier |
09:35:48 | FromDiscord | <Elegantbeef> The stdlib even has hooks in `jsonutils` |
09:36:00 | FromDiscord | <Phil> Use jsony if you're going to hook stuff |
09:36:04 | FromDiscord | <Phil> Make your life not hell |
09:36:12 | FromDiscord | <Elegantbeef> Eh the stdlib hooks are ok |
09:36:21 | FromDiscord | <Elegantbeef> Yea vindaar i concur |
09:36:34 | FromDiscord | <Elegantbeef> I feel like Dom's putting his feelings towards disruptek ahead of rationality |
09:36:47 | FromDiscord | <dom96> lol |
09:36:50 | FromDiscord | <vindaar> yup |
09:37:15 | FromDiscord | <Phil> ...? When did vindaar write anything before his "yup"? Did discord eat it? |
09:37:36 | FromDiscord | <Phil> (edit) "...? When did vindaar write anything before his "yup"? Did discord eat it? ... " added "(I assume there was something because you reacted to sth beef)" |
09:37:38 | FromDiscord | <dom96> In reply to @Elegantbeef "I feel like Dom's": I feel the same about you |
09:37:40 | FromDiscord | <vindaar> beef and me are telepathically linked |
09:37:41 | FromDiscord | <Elegantbeef> matrix reaction |
09:38:09 | FromDiscord | <dom96> strange that a newcomer with no skin in the game shares the same opinion I do |
09:38:21 | FromDiscord | <Phil> ? |
09:38:22 | FromDiscord | <Elegantbeef> I have skin in the game? |
09:38:27 | FromDiscord | <Elegantbeef> Fuck where'd my skin go! |
09:38:54 | FromDiscord | <Phil> Disruptek debate off to offtopic ? |
09:39:36 | FromDiscord | <Phil> In reply to @ITR "json hook sounds more": Jsony hooks are decently easy. I can't speak for std/json hooks, these feel funky to me. |
09:40:17 | FromDiscord | <ITR> sent a code paste, see https://play.nim-lang.org/#ix=3WID |
09:40:20 | FromDiscord | <Elegantbeef> The ones in stdlib are a bit more reasonable as they operate on Jsonnodes not a string |
09:40:36 | FromDiscord | <Elegantbeef> Yea so dont do it that way |
09:40:47 | FromDiscord | <Elegantbeef> Write a json hook that converts it into a `seq[PixelPlaced]` |
09:40:53 | FromDiscord | <ITR> right, i'mma look into that now |
09:41:14 | FromDiscord | <Elegantbeef> You can also preallocate like 1000 or w/e |
09:41:34 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/version-1-6/lib/std/jsonutils.nim#L390 should show you how it works |
09:41:40 | FromDiscord | <ITR> ty |
09:41:40 | FromDiscord | <Elegantbeef> If you use stdlib |
09:42:17 | FromDiscord | <ITR> I can just install Jsony if that's simpler |
09:42:28 | FromDiscord | <Elegantbeef> They're equally complex |
09:43:05 | FromDiscord | <Elegantbeef> Despire what Phill said the stdlib's hooks are simple yet under documented |
09:43:16 | FromDiscord | <Elegantbeef> you do have to use `jsonTo` instead of `fromJson` |
09:45:33 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/Bbc |
09:45:56 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3WIE |
09:46:34 | FromDiscord | <Elegantbeef> then you use use `MyPixelPlaced` instead of `seq[seq[PixelPlaced]]` and bingo bango bongo bish bash bosh |
09:47:29 | FromDiscord | <d4rckh> i have a property of a type with the type of an enum, how can i add a case in a case block, that runs if the value of the enum is anything |
09:48:03 | FromDiscord | <d4rckh> sent a code paste, see https://paste.rs/4nQ |
09:48:09 | FromDiscord | <Phil> That is on an object type? |
09:48:20 | FromDiscord | <d4rckh> (edit) "https://play.nim-lang.org/#ix=3WIH" => "https://play.nim-lang.org/#ix=3WIG" |
09:48:25 | FromDiscord | <d4rckh> something is an object, myEnum is an enum |
09:49:02 | FromDiscord | <d4rckh> (edit) "https://play.nim-lang.org/#ix=3WIG" => "https://play.nim-lang.org/#ix=3WII" |
09:49:23 | FromDiscord | <Elegantbeef> you put a `defer` before or use `try finally` |
09:49:24 | FromDiscord | <d4rckh> building a cli so i need some commands to be accessible in all modes |
09:49:25 | FromDiscord | <ITR> In reply to @Elegantbeef "but in your case": Hmm, I don't see newSeqWith in sequtils. There's newSeqWith, but that's with a preset size, not capacity |
09:49:34 | FromDiscord | <Phil> doesn't something have to be a valid enum value? Or can it be nil?↵Either way, if it can be an enum value I feel like it could be an optional |
09:49:45 | FromDiscord | <Phil> (edit) "an enum value" => ""empty"" |
09:49:52 | FromDiscord | <Elegantbeef> `newSeqOfCap` |
09:49:56 | FromDiscord | <Elegantbeef> My bad always forget |
09:49:59 | FromDiscord | <Phil> (edit) "something" => "something.myEnum" |
09:50:04 | FromDiscord | <ITR> oh, in system, ty |
09:50:34 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3WIK |
09:51:09 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/e9k |
09:51:42 | FromDiscord | <Elegantbeef> Nim does not have a syntax for "always run" |
09:53:42 | FromDiscord | <d4rckh> hm, thanks |
09:54:12 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/aTB |
09:54:44 | FromDiscord | <Elegantbeef> Phill options dont always represent what you're doing well |
09:55:09 | FromDiscord | <ITR> if you have control over the enum, couldn't you just make an enum value that's "None"? I feel like adding an option there would just be less efficient and use more memor y |
09:55:10 | FromDiscord | <Elegantbeef> Right now in my game i have an enum with `box` and `turret` i'm not going to use an `Option[bool]` since it doesnt make sense to |
09:55:11 | FromDiscord | <ITR> (edit) "memor y" => "memory" |
09:55:21 | FromDiscord | <Phil> I'm mostly confused by the "no-value"-state of an enum |
09:55:32 | FromDiscord | <Elegantbeef> It's not no value they want the code to always run |
09:55:35 | FromDiscord | <Phil> (edit) "enum" => "enum-field" |
09:55:54 | FromDiscord | <ITR> In reply to @Isofruit "I'm mostly confused by": "runs if myEnum is Value1 or Value2" is what was in their comment |
09:56:25 | FromDiscord | <Elegantbeef> They just want a scope in the try that runs |
09:56:32 | FromDiscord | <Elegantbeef> Which is redundant when you can just put the statement afterr |
09:56:35 | FromDiscord | <Elegantbeef> sorry scope in the case |
09:57:36 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/pN2 |
09:57:49 | FromDiscord | <Phil> So I assumed there was a scenario in which myEnum had no value |
09:57:50 | FromDiscord | <ITR> In reply to @Isofruit "I think I got": yea, but i think that's exactly what they want, lol |
09:59:47 | FromDiscord | <ambient> is there any prettier way of doing this: var val: int16 = (cast[ptr int16](wavFile.data[i].addr))[] --- I'm converting a stream of bytes into int16 |
10:00:08 | FromDiscord | <ambient> (edit) "is there any prettier way of doing this: var val: int16 = (cast[ptr int16](wavFile.data[i].addr))[] --- I'm converting" => "sent" | "stream of bytes into int16" => "code paste, see https://paste.rs/u9s" |
10:00:48 | FromDiscord | <Phil> In reply to @Elegantbeef "Which is redundant when": This is what I somehow assumed wasn't possible as I thought it wouldn't be a question if that was an option. |
10:02:24 | FromDiscord | <Rika> In reply to @ambient "is there any prettier": Cast the data itself into int16? |
10:03:03 | FromDiscord | <Rika> Oh |
10:03:53 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix= |
10:04:00 | FromDiscord | <Rika> I don’t know if I copied any new lines |
10:06:40 | FromDiscord | <ITR> Bleh, the error messages in std/json are horrible |
10:08:03 | FromDiscord | <ITR> I think it's not using the hook, and thus erroring because it's getting an array instead of an object |
10:09:26 | FromDiscord | <ambient> sent a code paste, see https://play.nim-lang.org/#ix= |
10:10:39 | FromDiscord | <Rika> Oops my bad |
10:10:43 | FromDiscord | <Rika> Didn’t see lol |
10:28:33 | * | Zectbumo quit (Remote host closed the connection) |
10:35:24 | FromDiscord | <SirElephant> sent a code paste, see https://paste.rs/Ds2 |
10:35:36 | FromDiscord | <SirElephant> i want the output to be like this`.-` |
10:36:03 | FromDiscord | <SirElephant> sent a code paste, see https://play.nim-lang.org/#ix=3WIY |
10:36:12 | FromDiscord | <SirElephant> (edit) "https://play.nim-lang.org/#ix=3WIY" => "https://paste.rs/e9T" |
10:36:23 | FromDiscord | <SirElephant> how do i fix this? |
10:38:43 | FromDiscord | <0ffh> Check the type of translations_a, I'd guess it is seq[seq[string]]. If that's the case you probably want translation:a[k][1] |
10:39:00 | FromDiscord | <0ffh> (edit) "translation:a[k][1]" => "translation_a[k][1]" |
10:39:43 | FromDiscord | <Rika> In reply to @0ffh "Check the type of": No |
10:39:50 | FromDiscord | <SirElephant> ummm can you edit the code above and tell me? |
10:39:51 | FromDiscord | <Rika> When you read a file it’s a single string |
10:39:55 | FromDiscord | <Rika> It doesn’t split at new lines |
10:40:12 | FromDiscord | <SirElephant> oh |
10:40:16 | FromDiscord | <Rika> You have to split new lines (better yet iterate) then split : |
10:40:42 | FromDiscord | <0ffh> Ah, sorry, my bad. |
10:41:17 | FromDiscord | <0ffh> Actually I wanted to ask a question myself. |
10:41:17 | FromDiscord | <0ffh> I have an application that has a ton of variable churn, as in it creates tons of short-lived variables of a certain type. How would I most efficiently implement a re-use the allocated memory of these variables (think object pool)? Or is there a good library for that? |
10:41:22 | FromDiscord | <SirElephant> In reply to @Rika "You have to split": how do i do that? |
10:42:41 | FromDiscord | <SirElephant> ?? |
10:44:36 | FromDiscord | <0ffh> for line in lines "file.txt":↵ echo line |
10:44:53 | FromDiscord | <0ffh> Reads the file line by line |
10:45:22 | FromDiscord | <0ffh> (edit) "for line in lines "file.txt":↵ echo line" => "sent a code paste, see https://play.nim-lang.org/#ix=3WIZ" |
10:45:25 | FromDiscord | <Rika> https://nim-lang.org/docs/io.html#lines.i%2CFile |
10:47:48 | FromDiscord | <Phil> In reply to @0ffh "I have an application": I can't really give qualified advice here. ↵But if you want an object pool, you could check out tinypool (which does connection pooling), copy the code and adjust it to your needs.↵If anyone else chimes in, they likely have a better idea of what they're doing and you might want to listen to them more than to me, just wanted to provide some level of help you can fall back to. |
10:48:19 | FromDiscord | <Phil> (edit) "In reply to @0ffh "I have an application": I can't really give qualified advice here. ↵But if you want an object pool, you could check out tinypool (which does connection pooling), copy the code and adjust it to your needs.↵If anyone else chimes in, they likely have" => "sent" | "better idea of what they're doing and you might want to listen to them more than to me, just wanted to provide some level of help you can fall b |
10:49:01 | FromDiscord | <0ffh> In reply to @Isofruit "I can't really give": Great, that's a good hint! I'll check out that code and see if I can adapt it. |
10:51:33 | FromDiscord | <Phil> In reply to @0ffh "Great, that's a good": The core code is like 200 lines of which half is whitespace or comments, so hopefully not a lot of work |
10:55:08 | FromDiscord | <d4rckh> does `walkDir` recursively get files? |
10:56:40 | FromDiscord | <Rika> In reply to @0ffh "I have an application": Do you know that this is causing you issues |
10:58:05 | FromDiscord | <Rika> or is it just “I think it is so it probably is” |
10:58:37 | FromDiscord | <Rika> Point being can you actually test before optimising, pre optimisation is a waste of time |
10:58:51 | FromDiscord | <Rika> If you really want to, are your variables reference types or regular |
11:02:11 | FromDiscord | <d4rckh> i am creating a new macro: `macro importDirectory(a: string): untyped =`, why's `a` of type NimNode when I use it with walkDir, but when I print it, it prints like a normal string? https://media.discordapp.net/attachments/371759389889003532/970278958174208000/unknown.png |
11:02:28 | FromDiscord | <d4rckh> this is how i call it btw `importDirectory("src/clientTasks")` |
11:03:21 | FromDiscord | <Rika> If you want it to be passed as a regular string use “static string” |
11:03:40 | FromDiscord | <d4rckh> wow ty |
11:08:34 | * | slowButPresent joined #nim |
11:28:00 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3WJ6 |
11:28:06 | FromDiscord | <d4rckh> i got this from dump tree https://media.discordapp.net/attachments/371759389889003532/970285480811847740/unknown.png |
11:28:22 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3WJ7 |
11:28:48 | FromDiscord | <d4rckh> but its saying thats not the proper use of newCall() |
11:29:30 | FromDiscord | <d4rckh> i think i am supposed to use proc `newCall(theProc: string; args: varargs[NimNode]):` |
11:29:46 | FromDiscord | <d4rckh> i assume theProc is gonna be add, what about args? |
11:32:12 | FromDiscord | <Rika> You’re putting identifier add inside the identifier command |
11:32:20 | FromDiscord | <Rika> Wait no I didn’t see it properly |
11:32:32 | FromDiscord | <Rika> What’s the precise error |
11:33:22 | FromDiscord | <Rika> Make a new tree of type call instead I guess |
11:34:38 | * | firq joined #nim |
11:37:28 | NimEventer | New post on r/nim by owl_000: Is move of a ref object and accessing later to the object supposed to compile?, see https://reddit.com/r/nim/comments/ufy1a7/is_move_of_a_ref_object_and_accessing_later_to/ |
11:53:15 | FromDiscord | <d4rckh> In reply to @Rika "What’s the precise error": oh sorry for not posting it. |
11:53:25 | FromDiscord | <d4rckh> sent a code paste, see https://paste.rs/Uho |
11:58:42 | FromDiscord | <Phil> Hoh boy, d-release with lto flag can truly take a bit |
12:06:33 | * | PMunch joined #nim |
12:07:19 | FromDiscord | <Rika> LTO takes time |
12:15:30 | FromDiscord | <d4rckh> ok i figured it out |
12:15:34 | FromDiscord | <d4rckh> sent a code paste, see https://paste.rs/hSi |
12:46:32 | * | joshbaptiste quit (Ping timeout: 250 seconds) |
13:36:12 | * | arkurious joined #nim |
13:39:56 | FromDiscord | <Zoom> Hey everyone! I'd like to use `setControlCHook` to send a cleanup message to a channel without making the channel var `{.global.}`. Is it doable? |
13:41:00 | FromDiscord | <Rika> No, that hook cannot be a closure |
13:41:23 | FromDiscord | <Rika> It’s not gonna be a global (pragma) but it will be a global |
13:41:50 | FromDiscord | <Rika> In reply to @Rika "No, that hook cannot": I think |
13:41:50 | FromDiscord | <FireLite> I am trying to get a process from dll to manage memory. Is there any libs for this or built in functions? |
13:46:22 | PMunch | @FireLite, not quite sure what you mean |
13:48:59 | FromDiscord | <FireLite> Nvm, I just realised that writing dll in c++ and nim is quite same. I can use `CreateThread`, `OpenProcess` and other things. |
13:50:14 | FromDiscord | <FireLite> Also, another questions, is there `NULL` in nim? |
13:50:17 | FromDiscord | <Zoom> The only stupid thing I can do is declare a global pointer to a channel and use that. |
13:51:23 | FromDiscord | <Zoom> But this is no better than declaring a channel itself `{.global.}` |
13:56:27 | PMunch | @FireLite, yes it's called `nil` |
14:00:02 | FromDiscord | <Rika> In reply to @Zoom "But this is no": I’d say it’s worse |
14:42:09 | * | joshbaptiste joined #nim |
15:26:14 | FromDiscord | <kiell> is there a way to have nim not yell at me about gc unsafe procs even when they're accessing global vars that are constant? |
15:26:37 | FromDiscord | <kiell> or do i just have to do the cast thing to ignore it |
15:28:09 | FromDiscord | <ynfle> In reply to @Knedlik "Devel doesn’t get flagged": Without devel on the latest stable nothing crashes. Try that. Does it still crash? If not, report a regression.↵How did you instigate the crash? I just ran the app and saw the screen and nothing crashed |
15:28:40 | FromDiscord | <Knedlik> Read the line right under that |
15:30:38 | FromDiscord | <ynfle> I don't think I said anything about getting resolved |
15:30:44 | FromDiscord | <ynfle> If I did, I don't remember |
15:51:59 | * | pch quit (Ping timeout: 240 seconds) |
15:56:30 | * | vicfred quit (Quit: Leaving) |
16:22:19 | FromDiscord | <Phil> In reply to @kiell "is there a way": Feel free to inform me if you figure out a way. I myself put all the gc-safe stuff into its own set of modules and left it there |
16:25:52 | * | pch joined #nim |
16:32:32 | * | vicfred joined #nim |
16:44:01 | FromDiscord | <2F42BBA1> in python there's str() is there something similiar to it in nim? |
16:45:17 | FromDiscord | <Phil> I mean, you can make it similar by making sure every module within which you define an object type also has a str() proc for it |
16:45:26 | FromDiscord | <haxscramper> In reply to @2F42BBA1 "in python there's str()": `$` on any object/value |
16:45:41 | FromDiscord | <haxscramper> `$12`, `$[12, 23]`, `$(field: 12)` etc. |
16:45:46 | FromDiscord | <Phil> Oh, right, `$` is the nim sign for string conversion |
16:46:55 | FromDiscord | <@singularperturbation-56538b4816> Are there any plans to warnings for accessing a value after being moved? I saw https://www.reddit.com/r/nim/comments/ufy1a7/is_move_of_a_ref_object_and_accessing_later_to/ and that confused me - I'd like to make accessing-after-moved a compile-time error, if possible |
16:47:14 | FromDiscord | <2F42BBA1> In reply to @haxscramper "`$12`, `$[12, 23]`, `$(field:": var s = $trolleybus()↵↵↵like that? |
16:47:21 | FromDiscord | <haxscramper> yes |
16:47:33 | FromDiscord | <haxscramper> (almost) any object can be converted to string using `$` |
16:47:43 | FromDiscord | <haxscramper> except for pointers and references, to avoid inifite cycles |
16:48:03 | FromDiscord | <haxscramper> for those you either need to dereference object via `[]`, or provide own implementation of `$` procedure |
16:48:17 | FromDiscord | <haxscramper> ``proc `$`(a: YourObject): string`` |
17:04:39 | nrds | <Prestige99> I'm using a github link as a dependency in my nimble file, but am making changes to that dependency locally. Attempting to use `nimble develop` to link to that package, but it's just using the version downloaded from github |
17:04:53 | nrds | <Prestige99> How is this supposed to work so I can use my local version? |
17:06:41 | FromDiscord | <ynfle> In reply to @Isofruit "Feel free to inform": You have to cast the block |
17:07:57 | FromDiscord | <vindaar> check where `nimble` is pointing to using `nimble path <package>`. If it's not to your local directory of the package, I'd just delete the directory of the downloaded package and call `nimble develop` in the local one again |
17:08:31 | FromDiscord | <Phil> In reply to @ynfle "You have to cast": Oh I know how to get past the gc-safe limitation with cast, I was under the assumption that kiell was looking for a more beautiful solution than just casting |
17:08:51 | FromDiscord | <Phil> Because I have entire modules where almost every proc is annotated with casting to gc-safe |
17:09:44 | FromDiscord | <Phil> In reply to @haxscramper "(almost) any object can": I think any object with a DateTime field is pre-destined to blow up in your face if you haven't specified a formatting proc IIRC |
17:10:02 | nrds | <Prestige99> vindaar: It's downloading the latest version from the github repo, even though there's already a linked version of the package in ~/.nimble/pkgs - which is weird |
17:10:08 | FromDiscord | <Phil> Been a while since the compile yelled at me for stringifying an object without meeting some hoops, not entirely sure what they all were |
17:10:20 | FromDiscord | <Phil> (edit) "meeting" => "jumping through" |
17:10:23 | nrds | <Prestige99> Keep having to fiddle with nimble's crap every time |
17:10:47 | FromDiscord | <vindaar> wait, how do you compile the thing that uses the dependency? |
17:11:31 | nrds | <Prestige99> just using nim r myfile.nim, Problem is it will just say it can't find the dependency unless I nimble install -dy |
17:11:43 | nrds | <Prestige99> but then it downloads and uses the online version instead of the local version |
17:12:25 | nrds | <Prestige99> Maybe I'll just make a min repro and create an issue in nimble |
17:12:28 | FromDiscord | <vindaar> huh, that's really weird |
17:12:33 | FromDiscord | <vindaar> have you tried manually deleting all versions of the dependency in `~/.nimble/pkgs` and then `nimble develop` -ing the local thing? |
17:13:33 | nrds | <Prestige99> Yeah that gets it working, but I have to make sure I have all the other deps already downloaded. Because if I run nimble install -dy afterward, it replaces the local version with the online version |
17:13:58 | FromDiscord | <vindaar> I don't understand how it can download from github if you never call nimble directly. Because when doing `nimble develop` locally there's no reason it would download anything after all |
17:14:34 | FromDiscord | <vindaar> ah, that's possible yeah |
17:18:16 | FromDiscord | <kiell> In reply to @Isofruit "Feel free to inform": for my specific case i figured out a way but not sure yet about general workarounds |
17:21:16 | * | vicfred quit (Quit: Leaving) |
17:41:29 | * | vicfred joined #nim |
17:52:16 | FromDiscord | <Zodey> anybody has idea why the output is only 4 and not 456? https://media.discordapp.net/attachments/371759389889003532/970382157572878346/unknown.png |
17:53:53 | FromDiscord | <huantian> Prefixing your variable names with the quite classy |
17:54:35 | FromDiscord | <Zodey> In reply to @huantian "Prefixing your variable names": ? |
17:54:56 | FromDiscord | <huantian> (edit) "the" => "`the`" |
17:55:04 | FromDiscord | <huantian> Nothing I was just poking fun of your variable names |
17:55:19 | FromDiscord | <ynfle> In reply to @Isofruit "Because I have entire": I would recommend limiting that functionality to a small layer of the program |
17:55:23 | FromDiscord | <huantian> Does it work if you don’t subtract theStaet from theEnd |
17:55:27 | FromDiscord | <Zodey> In reply to @huantian "Nothing I was just": nim didnt let me use only start and end xD |
17:55:44 | FromDiscord | <huantian> Use startIndex endIndex or something |
17:56:24 | FromDiscord | <Zodey> In reply to @huantian "Does it work if": that doesnt makes sense |
17:56:40 | FromDiscord | <Zodey> but yeah, i got 4567 |
17:57:43 | FromDiscord | <huantian> I would personally do [startIndex..<endIndex] |
17:58:02 | FromDiscord | <m4ul3r> I have a long sequence that contains a bunch of stuff like `dictionary.txt:word`, how can remove each element that contains `dictionary.txt`. I'm trying to use filterit but can't seem to figure it out |
17:58:26 | FromDiscord | <Zodey> In reply to @huantian "I would personally do": what do you mean? |
17:58:37 | FromDiscord | <Zodey> sorry, new to this lang |
17:58:46 | FromDiscord | <huantian> In reply to @m4ul3r "I have a long": someSeq.filterIt(“dictionary.txt” in it) |
17:58:54 | FromDiscord | <Phil> In reply to @ynfle "I would recommend limiting": Generally I agree, database delete procs tend to not go without that though |
17:59:33 | FromDiscord | <Phil> Oh an db-connection pooling was something I couldn't figure out without copious amounts of casting gc-safe |
17:59:43 | FromDiscord | <Phil> (edit) "Oh an db-connection pooling was something I couldn't figure out without copious amounts of casting gc-safe ... " added "(while using a lock naturally)" |
18:00:17 | FromDiscord | <m4ul3r> In reply to @huantian "someSeq.filterIt(“dictionary.txt” in it)": 🙏 thanks, I kept doing it the other way (it in "dictionary.txt") |
18:04:26 | FromDiscord | <huantian> In reply to @Zodey "sorry, new to this": No problem, “string”[1..3] is the same as “string”.substr(1, 3) I think |
18:05:41 | FromDiscord | <huantian> It’ll return the substring from index 1 to index 3, both inclusive |
18:05:47 | * | kayabaNerve quit (Ping timeout: 240 seconds) |
18:06:35 | FromDiscord | <huantian> https://nim-lang.org/docs/system.html#substr%2Cstring%2Cint%2Cint |
18:07:13 | FromDiscord | <huantian> When you do “string”[1..<3], that makes the second bound non inclusive |
18:08:03 | FromDiscord | <Zodey> i see |
18:08:28 | FromDiscord | <Zodey> sent a code paste, see https://paste.rs/nvL |
18:08:35 | * | Zectbumo joined #nim |
18:09:28 | FromDiscord | <Zoom> sent a code paste, see https://play.nim-lang.org/#ix=3WKB |
18:09:56 | FromDiscord | <Zoom> sent a code paste, see https://play.nim-lang.org/#ix=3WKC |
18:10:23 | * | kayabaNerve joined #nim |
18:10:58 | FromDiscord | <Zoom> You don't handle error cases at all, no bueno 🚓 |
18:11:13 | FromDiscord | <Zodey> 😂 |
18:11:44 | FromDiscord | <Zoom> sent a code paste, see https://play.nim-lang.org/#ix=3WKD |
18:11:49 | FromDiscord | <Zodey> still better then copying a random code from the internet :nim2: |
18:12:31 | FromDiscord | <Zodey> (edit) "still better then copying a random code from the internet ... :nim2:" added "(which i doesnt understand)" |
18:13:06 | FromDiscord | <Zoom> And damn `find` doesn't work on openArray! (I think I'm becoming [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org) 's lesser copy) |
18:13:34 | FromDiscord | <huantian> Or just use strscans!↵Actually not sure if that works for this |
18:14:52 | FromDiscord | <huantian> Yeah no it doesn’t |
18:14:58 | FromDiscord | <Zoom> If you have questions about my snippet above, shoot↵(@Zodey) |
18:15:02 | FromDiscord | <huantian> Idk what I was thinking |
18:16:28 | FromDiscord | <Zodey> In reply to @Zoom "If you have questions": well, basically im completely new to nim, so basically i just dont know what block: .high(), some and none means |
18:16:38 | FromDiscord | <Zodey> but i think i just need to learn it |
18:16:46 | FromDiscord | <Zodey> your code is logical i guess |
18:18:34 | * | Zectbumo quit (Remote host closed the connection) |
18:19:35 | FromDiscord | <Zoom> Also, docs for "find" suggest this\:@xflywind , you have some explaining to do here 😅 |
18:24:12 | FromDiscord | <Zoom> `some` and `none` are wrappers of [Option](https://nim-lang.org/docs/options.html), a type which represents optional values. Use them (don't forget to `import std/options`)↵`high` in this case is just `string.len() - 1`, i.e. the [highest index](https://nim-lang.org/docs/system.html#high%2Ccstring)↵(@Zodey) |
18:26:22 | FromDiscord | <Zoom> `block:` in this case this is a way to make an expression of a few lines. block creates a scope, so in cases like this it's handy to contain all temporary operations inside it. https://nim-lang.org/docs/manual.html#statements-and-expressions-block-expression |
18:30:34 | * | jmdaemon joined #nim |
18:32:03 | FromDiscord | <Zoom> @Zodey\: Also, use `func` and `let` by default, going to `proc` and `var` only when necessary, use `echoDebug` for what it says it's for.↵And please, use code blocks to share your short snippets, not screenshots. For longer bits of code use Nim playground's `share to ix.io`. |
18:32:35 | FromDiscord | <Phil> I think first things first |
18:32:41 | FromDiscord | <Phil> Zodey, have you heard of `null` so far? |
18:32:49 | FromDiscord | <Phil> Not in nim, in general |
18:34:09 | FromDiscord | <Phil> (edit) "Not in nim, in general ... " added "(imo it makes more sense to give a quick rundown of optionals once you realize what they're trying to solve)" |
18:40:40 | FromDiscord | <Zodey> In reply to @Zoom "<@460785667820224512>\: Also, use `func`": okay, thank you↵whats the difference between func and proc? i know what is var |
18:41:01 | FromDiscord | <Zodey> In reply to @Isofruit "<@460785667820224512> , have you": yeah, i have some c and c++ experience |
18:42:21 | FromDiscord | <Zodey> (edit) "In reply to @Zoom "<@460785667820224512>\: Also, use `func`": okay, thank you↵whats the difference between func and proc? i know what is ... var" added "the diff between let and" |
18:43:22 | FromDiscord | <Phil> Ohhh so just new to the language, alrighty, then you know how null is really annoying to deal with. Optional "none" expresses the same concept as null, but by having a variable be an optional-type you express that this may be null or not. |
18:44:10 | FromDiscord | <Phil> If it isn't optional, it's guaranteed to have a value. If it is optional, you'll want to check if it has or doesn't have a value with "isNone()" or "isSome()" before unpacking the value out of the optional with "get()".↵As for fun and proc, they're the same, but func has the compiler checking for side-effects |
18:44:27 | FromDiscord | <Phil> So e.g. in a func-call, you can't echo because that's a side-effect and in funcs the compiler ensures those do not happen |
18:44:43 | FromDiscord | <Zodey> In reply to @Isofruit "Ohhh so just new": yeah, i have some java and rust experience as well, but im still noob, so dont think im good 😄 |
18:45:14 | FromDiscord | <Phil> In reply to @Zodey "yeah, i have some": That works fine, just need to know how much you're already aware of to know where to start with explanations.↵If you've seen rust, you've likely also seen Result types |
18:45:21 | FromDiscord | <Phil> We don't have those here, this follows java-style exception handling |
18:45:41 | FromDiscord | <Zodey> well, i really has a little rust |
18:45:55 | FromDiscord | <Zodey> just the basics, then i switched to nim |
18:46:05 | FromDiscord | <Zodey> so much cleaner |
18:46:05 | FromDiscord | <huantian> We have results if you use them 😛 |
18:46:08 | FromDiscord | <Phil> Check, for me it was similar, though I hadn't been aware of nim before |
18:46:14 | FromDiscord | <Phil> In reply to @huantian "We have results if": Wait, we do? |
18:46:18 | * | Gustavo6046 joined #nim |
18:46:26 | FromDiscord | <huantian> Well as a nimble package |
18:46:32 | FromDiscord | <Phil> Hah! I knew it! |
18:46:50 | FromDiscord | <Phil> I will contemplate introducing that package into my codebase though, I like result types |
18:46:58 | FromDiscord | <huantian> “have” is vague 😉 |
18:48:15 | FromDiscord | <Phil> In reply to @Zodey "well, i really has": Similarly to rust, you declare variables and depending on how you declare them they're either mutable or immutable.↵Let = Immutable↵var = Mutable↵Const = Immutable, the variable is defined at compile-time and can't be changed at runtime, it can only be read |
18:49:30 | FromDiscord | <Phil> And I think anyway, that's it for unasked starting points from my end that you may or may not have already been aware of ^^ |
18:50:05 | FromDiscord | <huantian> Also do read the tutorials if you haven’t yet |
18:50:22 | FromDiscord | <Zodey> In reply to @Isofruit "And I think anyway,": its okay, thanks for everything ❤️ |
18:50:24 | FromDiscord | <Phil> Nim tutorial 1,2, 3 and nim by example are solid pages to have bookmarks of |
18:50:37 | FromDiscord | <Phil> I still reference those regularly |
18:52:05 | FromDiscord | <d4rckh> In reply to @Isofruit "Nim tutorial 1,2, 3": i dont have them bookmarked but they always pop up in search results when i need some help in nim |
18:52:10 | FromDiscord | <d4rckh> indeed they are super useful |
18:52:21 | FromDiscord | <Phil> sent a long message, see http://ix.io/3WKH |
19:11:05 | FromDiscord | <Zoom> https://github.com/arnetheduck/nim-result/↵(@Phil) |
19:12:45 | FromDiscord | <Phil> ~~What I'm learning for the most part is, if there's a language feature, people have written macros to copy it~~ |
19:13:11 | FromDiscord | <Zoom> That's a dead plain type |
19:17:58 | FromDiscord | <huantian> Yeah you don’t need macros for result |
19:20:48 | FromDiscord | <Phil> Ohhhh they solve this with an object variant |
19:20:48 | FromDiscord | <Phil> Neat |
19:21:11 | FromDiscord | <Phil> Well, they are somewhat limited to only one type of error per result though so that's a shame |
19:27:16 | FromDiscord | <huantian> Why would your errors be multiple types |
19:28:28 | FromDiscord | <Phil> proc that queries the database for example can error out at runtime because the SQL fails (DbError) or the conversion of row to object fails (... I dunno know one that'll be) |
19:28:46 | FromDiscord | <huantian> Then the type is just ref Excpetion |
19:28:51 | FromDiscord | <Phil> (edit) removed "know" |
19:29:47 | FromDiscord | <Phil> That doesn't change the key issues that you can't react differently to different types of exceptions |
19:30:35 | FromDiscord | <Phil> At least not in a beautiful way. I guess you might be able to try and cast that exception to different types of exceptions and behave accordingly? |
19:30:37 | FromDiscord | <huantian> If result.err of DbError |
19:30:47 | FromDiscord | <Phil> But that would kinda require you to know all error types ahead of time |
19:30:57 | FromDiscord | <Phil> Which is sorta not cool in terms of encapsulation |
19:31:09 | FromDiscord | <Phil> (edit) "But that would kinda require you to know all error types ahead of time ... " added "by looking them up" |
19:31:19 | FromDiscord | <Phil> (edit) "encapsulation" => "encapsulation/effort" |
19:31:37 | FromDiscord | <huantian> Then maybe use an anonymous union |
19:32:16 | FromDiscord | <Phil> that I could see working... if that does work? The result type is a generic, I'm unsure whether that would explode or not |
19:32:48 | FromDiscord | <huantian> How do other langs handle Results? Do you just specify what exceptsiojs in can hold in the type? |
19:32:54 | FromDiscord | <huantian> In reply to @Isofruit "*that* I could see": Nah it should be fine |
19:33:15 | FromDiscord | <Phil> Man my Rust has been a while, I'd need to look it up how they handle it again |
19:34:13 | FromDiscord | <Phil> Apparently they write error-enums? |
19:34:16 | FromDiscord | <huantian> It seems they just rise strings |
19:34:24 | FromDiscord | <huantian> (edit) "rise" => "use" |
19:34:36 | FromDiscord | <Phil> > If you expect to handle the errors (to recover from them in a way that is specific to which error occurred), or if you're writing a library, then define an enum type which can hold any of the errors might occur. Each enum variant might either contain the original error value (so it can be retrieved), or not (if the original error is purely an implementation detail). The thiserror crate can help you implement Error and From for such enums. |
19:34:50 | FromDiscord | <Phil> In reply to @huantian "It seems they just": Oh, under the hood? No clue |
19:35:13 | FromDiscord | <huantian> Yeah you could use strings and enums in Nim too ig |
19:35:29 | FromDiscord | <huantian> But doesn’t using enums mean you have to make a enum for each proc? |
19:35:54 | FromDiscord | <huantian> Maybe the solution is just use exception tracking 😛 |
19:35:57 | FromDiscord | <Phil> Yeah, that could very quickly become very painful if you have a bunch of error types you can actually deal with |
19:36:56 | FromDiscord | <Phil> The only good thing I can say about exception tracking is that I can hide it with templates |
19:37:44 | FromDiscord | <Phil> I think this might be an aesthetic style-choice or something but exceptions are one of those things that just feel disruptive when reading the flow of code |
19:38:06 | FromDiscord | <Phil> (edit) "I think this might be an aesthetic style-choice ... or" added "from me" |
19:38:28 | FromDiscord | <Phil> (edit) "are" => "tracking things is" |
19:40:13 | FromDiscord | <huantian> I meannnn you’re gonna have the same problem if you specify all the different result errors |
19:40:32 | FromDiscord | <Phil> Yeah but those will behave more like a case-statement |
19:40:35 | * | xet7 quit (Remote host closed the connection) |
19:42:31 | * | xet7 joined #nim |
19:42:50 | FromDiscord | <Phil> Try-catch is "start comprehending you're in a new block now, eyes scan lower, recognize what part of the code might be throwing the exception, scan up again at try to double-check whether this was a try-with-resources, scan down again to find the "catch/except/whatever" keyword and maybe it'll cover the exception that is being thrown" |
19:45:10 | FromDiscord | <Phil> Result is "Get something back, do a case statement, explicitly handle all the errors or explicitly don't handle them, unpack your value from the happy-path and finished". Or you can explicitly hand those results up to the next proc by returning yet another result type |
19:45:44 | FromDiscord | <Phil> To me it feels and reads nicer |
19:53:47 | FromDiscord | <arnetheduck> Relevant section from or style guide: https://status-im.github.io/nim-style-guide/errors.html |
19:59:03 | FromDiscord | <Phil> Huh, turns out the result library page nets you a 404: https://status-im.github.io/nim-style-guide/libraries.result.html |
20:05:01 | FromDiscord | <Phil> In reply to @arnetheduck "Relevant section from or": > ## Use an `enum` to provide in-depth errors where the caller is expected↵> ## to have different logic for different errors↵So that's how multiple errors get returned, neat! |
20:05:51 | FromDiscord | <arnetheduck> https://status-im.github.io/nim-style-guide/libraries.results.html |
20:06:11 | FromDiscord | <arnetheduck> Link needs updating |
20:22:52 | FromDiscord | <!Patitotective> https://github.com/xmonader/nimassets/pull/13 👀 |
20:48:04 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "`myData[0].addr` or `myData[0].unsafeaddr`": that does return `ptr char` and i need `pointer`↵`cast[pointer](myData[0].addr)`? |
20:55:53 | * | PMunch quit (Quit: leaving) |
20:56:49 | FromDiscord | <Generic> in Nim any typed pointer (`ptr T`) implicitly casts to an untyped pointer (`pointer`) |
20:58:18 | FromDiscord | <!Patitotective> :o |
21:08:00 | * | xet7 quit (Remote host closed the connection) |
21:15:14 | FromDiscord | <!Patitotective> how can i `strcpy` in nim? :p |
21:18:24 | FromDiscord | <ynfle> `let x = y` |
21:18:31 | FromDiscord | <Zoom> stringA=stringB↵(@!Patitotective) |
21:19:37 | FromDiscord | <!Patitotective> thanks 🤔 |
21:20:24 | FromDiscord | <Elegantbeef> Hey you cannot be my lesser i'm the bottom of the totem pole |
21:20:25 | FromDiscord | <Zoom> sent a code paste, see https://play.nim-lang.org/#ix=3WLh |
21:21:26 | FromDiscord | <Zoom> sent a code paste, see https://play.nim-lang.org/#ix=3WLj |
21:21:51 | FromDiscord | <Zoom> sent a code paste, see https://play.nim-lang.org/#ix=3WLk |
21:22:03 | FromDiscord | <ynfle> `stringA.setLen(stringB.len)` |
21:22:22 | FromDiscord | <Zoom> sent a code paste, see https://play.nim-lang.org/#ix=3WLl |
21:22:43 | FromDiscord | <Elegantbeef> Zoom they cant see our reactions |
21:22:49 | FromDiscord | <Zoom> I know \:) |
21:23:18 | FromDiscord | <Elegantbeef> Ah it'll be our little secret |
21:24:11 | FromDiscord | <Elegantbeef> Also why do you think you're becoming my lesser? |
21:24:48 | FromDiscord | <Zoom> I want lots of the same damn things |
21:25:04 | FromDiscord | <Elegantbeef> Ah |
21:26:14 | FromDiscord | <!Patitotective> hey beeeef :]↵im struggling to make the imgui `addFontFromMemoryTTF` stuff ↵you said that `addFontFromMemoryTTF(data[0].addr)` but when i do `context.igDestroyContext` it fails with `munmap_chunk(): invalid pointer↵` |
21:26:45 | FromDiscord | <Bubblie> I should probs get back into doing nim vulkan |
21:26:48 | FromDiscord | <Bubblie> I left it on hold |
21:27:08 | FromDiscord | <!Patitotective> sent a long message, see http://ix.io/3WLn |
21:27:14 | FromDiscord | <!Patitotective> (edit) "http://ix.io/3WLn" => "http://ix.io/3WLo" |
21:27:39 | FromDiscord | <!Patitotective> In reply to @Bubblie "I should probs get": 👀 |
21:27:48 | FromDiscord | <Bubblie> ? |
21:28:06 | FromDiscord | <Bubblie> 👁️👁️ |
21:28:13 | FromDiscord | <Bubblie> Yes? Lol |
21:28:17 | FromDiscord | <Elegantbeef> Provide code patito |
21:29:47 | FromDiscord | <!Patitotective> In reply to @Bubblie "Yes? Lol": just saying that im 👀 if you do the bindings |
21:30:15 | FromDiscord | <!Patitotective> (edit) "im" => "ill be" |
21:31:08 | FromDiscord | <Elegantbeef> But yea Zoom i just want things to be more usable 😛 |
21:31:21 | FromDiscord | <Elegantbeef> Concepts make code reuse much better than hard coded types |
21:31:21 | FromDiscord | <Zoom> [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org)\: btw, what do you think about https://github.com/nim-lang/Nim/issues/14810 ? |
21:31:54 | FromDiscord | <Zoom> It's kind of embarrassing that such issues just stall without any closure. |
21:32:12 | FromDiscord | <Elegantbeef> It's pointless accept `openArray[char or byte]` |
21:32:29 | FromDiscord | <Elegantbeef> Oh it's for converting to string i see |
21:32:30 | FromDiscord | <Elegantbeef> I cannot read |
21:33:35 | FromDiscord | <Elegantbeef> I think it's more of an issue with lack of usable view types |
21:33:44 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Provide code patito": https://play.nim-lang.org/#ix=3WLp↵`ProggyVector Regular.ttf`: https://github.com/bluescan/proggyfonts/raw/master/ProggyVector/ProggyVector%20Regular.ttf |
21:33:47 | FromDiscord | <Elegantbeef> In a world with view types we dont need this hack |
21:34:22 | FromDiscord | <Elegantbeef> we just have a `OpenString[T: char or byte] = distinct openarray[T]` and convert it to that |
21:34:48 | FromDiscord | <Bubblie> In reply to @Patitotective "just saying that ill": Im testing vulkan bindings already created for nim, and I used futhark for glfw |
21:35:04 | FromDiscord | <Zoom> If we can't push 3 lines of code since june 2020, how long will it take for view types to materialize? \:D |
21:36:01 | FromDiscord | <Elegantbeef> I mean Zoom you can do this outside of the stdlib so it's not a overly large concern imo |
21:36:29 | FromDiscord | <Elegantbeef> I personally dont get into the swinging of insults around these things |
21:37:08 | FromDiscord | <Zoom> I don't think I insulted anyone. I hope I didn't. |
21:37:50 | FromDiscord | <Zoom> And you can do almost anything outside of stdlib |
21:37:53 | FromDiscord | <Elegantbeef> Eh i might just have misread the way the last message was sent 😄 |
21:38:13 | FromDiscord | <Elegantbeef> Patitot you silly person |
21:38:13 | FromDiscord | <Elegantbeef> `sizeof(fontData)` is 8 |
21:38:14 | FromDiscord | <Elegantbeef> you want `len` |
21:38:23 | FromDiscord | <!Patitotective> In reply to @Bubblie "Im testing vulkan bindings": i-i thought you said nuklear :[ |
21:38:44 | FromDiscord | <Elegantbeef> You can wrap nuklear with futhark in like a minute probably 😄 |
21:38:52 | FromDiscord | <Elegantbeef> Speaking of futhark did i miss pmunch?! |
21:39:15 | FromDiscord | <Elegantbeef> Fuck i did, damn being 8 hours apart is such a disaster |
21:39:40 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "you want `len`": 🤔 you smart beef↵yet `free(): invalid size` |
21:39:58 | FromDiscord | <Elegantbeef> Can you guys in EU move norway to the west for a few days? |
21:40:15 | FromDiscord | <dom96> In reply to @Elegantbeef "I personally dont get": curious what you found insulting? :) |
21:40:27 | FromDiscord | <Elegantbeef> Eh disregard it |
21:41:39 | FromDiscord | <Elegantbeef> Also you realize patito you're getting 0 benefit from this `readFile` api right? |
21:41:56 | FromDiscord | <Zoom> I might be vitriolic, but I rarely insult. Barefaced 😅 |
21:42:47 | FromDiscord | <Elegantbeef> Yea i dont know what to say here, there doesnt seem to be anything that stands out to me that'd make sense for a issue |
21:43:13 | FromDiscord | <Bubblie> In reply to @Patitotective "i-i thought you said": Nuklear gui? |
21:43:14 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Also you realize patito": in my actual code im getting the data like that because im now using nimassets 👀 |
21:43:15 | FromDiscord | <Elegantbeef> There isnt any reason for it to attempt to free your cstring |
21:43:15 | FromDiscord | <Bubblie> What about it |
21:43:32 | FromDiscord | <Bubblie> Vulkan and Nuklear are diff |
21:43:33 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "There isnt any reason": https://github.com/ocornut/imgui/issues/220 ? |
21:43:36 | FromDiscord | <Elegantbeef> also you can just do `myString.cstring` i think |
21:43:41 | FromDiscord | <!Patitotective> In reply to @Bubblie "Vulkan and Nuklear are": yea, i misread sorry |
21:44:02 | FromDiscord | <Bubblie> I was thinking about using nuklear tho |
21:44:05 | FromDiscord | <Elegantbeef> Jesus that's fucking stupid |
21:44:17 | FromDiscord | <Bubblie> ? |
21:44:38 | FromDiscord | <Zoom> I have bad news for you. Norway is slowly drifting away. At least from the pov if a position between the Americas' East Cost and Europe. |
21:44:53 | FromDiscord | <Elegantbeef> A program should not take ownership of a cstring since it doesnt know how it was allocated |
21:45:37 | FromDiscord | <Elegantbeef> Well as the author suggests use `addFont` |
21:45:58 | FromDiscord | <Elegantbeef> There is no reason to use this API it's purposely written dumbly |
21:46:21 | FromDiscord | <Elegantbeef> When you take a pointer to a value as a library you only free it if it's certainly allocated by you |
21:46:50 | FromDiscord | <Elegantbeef> This is why we have things like `MyLibrary_AllocString` or w/e |
21:47:19 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Well as the author": ok let me try 🙃 |
21:48:24 | FromDiscord | <Elegantbeef> You can of course use `igMemAlloc` |
21:48:31 | FromDiscord | <Elegantbeef> But it's dumb as hell since it's a copy |
21:49:56 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3WLt |
21:50:00 | FromDiscord | <Elegantbeef> Then it should work fine with load from memory |
21:50:09 | FromDiscord | <Elegantbeef> It's silly as hell this is required but alas |
21:51:00 | FromDiscord | <Elegantbeef> actually it takes length in so you dont need the `+ 1` |
21:54:17 | FromDiscord | <!Patitotective> In reply to @Patitotective "ok let me try": its not working https://play.nim-lang.org/#ix=3WLu 😕 |
21:54:41 | FromDiscord | <Elegantbeef> Well yea you need to make a fontconfig or w/e |
21:54:53 | FromDiscord | <Elegantbeef> Well properly i guess |
21:55:12 | FromDiscord | <Elegantbeef> Ah god damn i cannot read |
21:55:33 | FromDiscord | <Elegantbeef> Someone take my eyes from me |
21:55:41 | FromDiscord | <!Patitotective> https://nimgl.dev/docs/imgui.html#newImFontConfig void 💀 |
21:55:49 | FromDiscord | <Elegantbeef> Same issue with the condif? |
21:55:54 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Someone take my eyes": 👀 |
22:02:56 | FromDiscord | <!Patitotective> `free(): invalid size` with https://play.nim-lang.org/#ix=3WLw |
22:03:22 | FromDiscord | <Elegantbeef> Did you just disregard my easy solution? |
22:06:06 | FromDiscord | <!Patitotective> yea, it works (~~yet the beautiful code~~) |
22:06:20 | FromDiscord | <!Patitotective> thanks 👍 |
22:07:12 | FromDiscord | <ambient> coincidentally I've also been looking for a decent OpenGL lib that can handle compute shaders hopefully with some ready-made battle-tested convinience wrappers, but most repos seem to be at least 2 years old. so at this point I'm just considering directly calling the .dll |
22:07:38 | FromDiscord | <Elegantbeef> Hey my framework could take some compute shaders 😄 |
22:08:01 | FromDiscord | <Elegantbeef> It doesnt have support for them but hey i'd like it 😛 |
22:08:11 | FromDiscord | <ambient> there's a lot of cool stuff, but the problem is fragmentation and maintenance |
22:08:34 | FromDiscord | <Elegantbeef> I havent got the point where i've needed compute shaders yet so havent abstracted them yet |
22:08:42 | FromDiscord | <ambient> I would have to build my own lib from 4 different sources |
22:17:03 | FromDiscord | <!Patitotective> can i run a nimble task from another nimble task? like in nake https://fowlmouth.github.io/nake/gh_docs/master/nakelib.html#runTask,string |
22:23:10 | FromDiscord | <dom96> selfExec("task") iirc |
22:23:25 | FromDiscord | <Zoom> Yep. Add a `Task()` suffix to a call↵(@!Patitotective) |
22:23:45 | FromDiscord | <!Patitotective> :o thanks 👍 |
22:24:18 | FromDiscord | <dom96> calling it like that is a bit of a hack :) |
22:24:33 | FromDiscord | <Zoom> sent a code paste, see https://play.nim-lang.org/#ix=3WLB |
22:24:55 | FromDiscord | <Zoom> Why is it in the docs then?↵(@dom96) |
22:25:29 | FromDiscord | <Zoom> https://nim-lang.org/docs/nimscript.html#task.t%2Cuntyped%2Cstring%2Cuntyped |
22:26:57 | FromDiscord | <Zoom> BTW, judging from `selfExec` description in the docs, it should work. So it callin Nim from a Nimble task is a bug |
22:27:14 | FromDiscord | <dom96> Good question. I see this as an implementation detail. |
22:27:24 | FromDiscord | <dom96> and indeed Nimble has it's implementation of `task` |
22:28:08 | FromDiscord | <dom96> hm, the bridge ate your message there |
22:28:30 | FromDiscord | <dom96> `selfExec` shouldn't call `nim` in a Nimble file |
22:30:06 | FromDiscord | <Zoom> Thanks for the confirmation. Do we need to file an issue on that? |
22:37:14 | FromDiscord | <Zoom> selfExe run from a .nimble file returns nim executable, not Nimble |
22:37:47 | * | firq quit (Ping timeout: 240 seconds) |
22:43:11 | FromDiscord | <Zoom> `getAppFilename` is not available from a nimscript. `paramStr(0)` returns nim too. |
22:45:38 | FromDiscord | <Elegantbeef> Zoom did moving to illwill mean my super amazing fix was replaced? 😄 |
22:46:28 | FromDiscord | <Zoom> Yep, I wouldn't, but illwill's init and deinit are mandatory, even though I didn't need them |
22:46:53 | FromDiscord | <Elegantbeef> Eh illwill is nice from what i recall 😄 |
22:46:58 | FromDiscord | <Zoom> It sets a global bool flag that gets checked on each getKey() |
22:47:09 | FromDiscord | <Zoom> that's not super-nice |
23:15:18 | FromDiscord | <pruno> sent a code paste, see https://play.nim-lang.org/#ix=3WLJ |
23:16:56 | FromDiscord | <Elegantbeef> `modulesPtr = modules[0].addr` |
23:17:09 | FromDiscord | <Elegantbeef> or `cast[ptr HModule](&modules)` |
23:24:17 | FromDiscord | <pruno> Thanks man, for the enumeration part, modified some other parts and my enum works :) |
23:42:25 | FromDiscord | <Elegantbeef> Also depending on the type of `modulesCount` you can just do `int` or equivlent |
23:42:41 | FromDiscord | <Elegantbeef> `cast` is generally only needed for low level conversions not type conversions |
23:43:46 | FromDiscord | <pruno> I see, thanks for the tip |
23:44:20 | FromDiscord | <pruno> Another question, how would you print a WideCString ?↵echo myWideCString results in /usr/lib/nim/system/widestrs.nim(180) $↵SIGSEGV: Illegal storage access. (Attempt to read from nil?) |
23:45:07 | FromDiscord | <Elegantbeef> Check if it's `nil` first then call `$` |
23:46:11 | FromDiscord | <pruno> mmmh, seems to always be nil then, i've got something wrong |
23:49:14 | FromDiscord | <pruno> sent a code paste, see https://play.nim-lang.org/#ix=3WLO |
23:51:02 | FromDiscord | <Elegantbeef> Uhh something is off with `GetModuleBaseName` i imagine |
23:51:16 | FromDiscord | <Elegantbeef> I dont know what but your args might not be right |
23:52:38 | FromDiscord | <pruno> sent a code paste, see https://play.nim-lang.org/#ix=3WLP |
23:52:45 | FromDiscord | <pruno> (edit) "https://play.nim-lang.org/#ix=3WLP" => "https://play.nim-lang.org/#ix=3WLQ" |
23:53:18 | FromDiscord | <Elegantbeef> The issue is the `sizeof(remoteModuleName)` i think |
23:53:23 | FromDiscord | <Elegantbeef> It should be `remoteModuleName.len` |
23:53:34 | FromDiscord | <Elegantbeef> Or `wstr.len` rather |
23:53:46 | FromDiscord | <Elegantbeef> `sizeOf` on dynamic collections is `sizeof(pointer)` |
23:53:51 | FromDiscord | <Elegantbeef> not the amount of allocated bytes |
23:53:57 | FromDiscord | <pruno> Oh stupid me |
23:53:57 | FromDiscord | <Elegantbeef> Which as you notice it always is giving you 8 |
23:54:03 | FromDiscord | <pruno> Yeah makes sense lol |
23:54:41 | FromDiscord | <Elegantbeef> Patito had the same issue just above 😄 |
23:55:50 | FromDiscord | <pruno> Well if wstr is empty at first, it'll always be 0 right ? |
23:56:19 | FromDiscord | <Elegantbeef> Yea i think you need to do something like `newWideStr("MyBufferLengthIsThis")` |
23:56:28 | FromDiscord | <Elegantbeef> There isnt a allocation that stores the length afaict |
23:56:48 | FromDiscord | <Elegantbeef> Oh nvm there is `newWideCstring(size: int)` |
23:57:04 | FromDiscord | <Elegantbeef> so you can do like `var wStr = newWideCstring(128)` |
23:58:09 | FromDiscord | <pruno> `wStr.len` here is still 0 |
23:59:55 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Patito had the same": 💀 |