00:23:23 | * | jmdaemon joined #nim |
01:00:02 | * | nazgulsenpai quit (Quit: ZNC 1.8.2 - https://znc.in) |
01:03:28 | * | nazgulsenpai joined #nim |
01:04:04 | * | Goodbye_Vincent quit (Ping timeout: 256 seconds) |
01:14:14 | * | Goodbye_Vincent joined #nim |
01:20:41 | * | Goodbye_Vincent quit (Ping timeout: 252 seconds) |
01:32:55 | * | raynei quit (Ping timeout: 276 seconds) |
01:34:32 | * | khazakar quit (Quit: Connection closed for inactivity) |
01:57:45 | FromDiscord | <ricky> i aint done much compile time nim but can u do reflection for minimal dynamic alloc @ runtime json deserde of objs |
01:58:17 | FromDiscord | <ricky> (edit) "do" => "use" | "usereflection ... for" added "@ compile time" |
02:05:44 | * | raynei joined #nim |
02:06:13 | FromDiscord | <Elegantbeef> Sure |
02:06:38 | FromDiscord | <Elegantbeef> Look at disruptek/frosty |
02:06:50 | FromDiscord | <Elegantbeef> It's like the ideal 'serde' api |
03:42:35 | * | raynei quit (Ping timeout: 252 seconds) |
04:33:19 | FromDiscord | <piman_discriminator_1010> templates are like C macros right? |
04:35:39 | FromDiscord | <Elegantbeef> Sorta, but not really |
04:36:22 | FromDiscord | <nnsee> In reply to @piman_discriminator_1010 "templates are like C": they're smarter, more powerful, and more ergonomic to use |
04:36:25 | FromDiscord | <Elegantbeef> They're both code substitution but Nim templates are overloadable |
04:36:42 | FromDiscord | <nnsee> they feel like an actual part of the language instead of an afterthought |
04:37:14 | FromDiscord | <leorize> nim templates are nothing like C macros |
04:37:34 | FromDiscord | <piman_discriminator_1010> undeclared identifier `&&` :unamused: why must Nim keep doing this to me |
04:37:51 | FromDiscord | <leorize> maybe you just have to learn the language \:p |
04:38:27 | FromDiscord | <piman_discriminator_1010> it would be a lot easier if Nim didn't seemingly randomly change things that have already been standardized :mood: |
04:38:37 | FromDiscord | <piman_discriminator_1010> also if it didn't take 3 minutes for this to compile |
04:38:50 | FromDiscord | <leorize> nim doesn't change standardized stuff |
04:38:58 | FromDiscord | <leorize> it's different standards |
04:38:59 | FromDiscord | <piman_discriminator_1010> && seems pretty standard to me |
04:39:06 | FromDiscord | <leorize> nim hail from the writh language family |
04:39:22 | FromDiscord | <leorize> where words are used |
04:39:44 | FromDiscord | <Elegantbeef> `&&` is standard in C style languages |
04:39:48 | FromDiscord | <Elegantbeef> But there are more fish in the sea |
04:42:03 | FromDiscord | <nnsee> `and` is also standard as per the 1998 C++ standard |
04:42:47 | FromDiscord | <nnsee> i think it's fairly reasonable to expect that not every language you learn is going to have the exact same syntax |
04:43:44 | FromDiscord | <takemichihanagaki3129> In reply to @piman_discriminator_1010 "&& seems pretty standard": I never used this, even when programming in C. |
04:43:48 | FromDiscord | <takemichihanagaki3129> Lol |
04:44:32 | FromDiscord | <takemichihanagaki3129> I always import the iso646.h. |
04:44:50 | FromDiscord | <piman_discriminator_1010> I don't even know what header that is lol |
04:45:04 | FromDiscord | <nnsee> i prefer the `and` keyword since && is often very fucking clumsy to write on a non-us keyboard layout |
04:45:14 | FromDiscord | <nnsee> although these days I've given up and just use US |
04:46:55 | FromDiscord | <piman_discriminator_1010> welp, time to google templates again |
04:47:04 | FromDiscord | <Elegantbeef> Quit googling |
04:47:09 | FromDiscord | <Elegantbeef> Just read the manual/tutorials |
04:47:49 | FromDiscord | <piman_discriminator_1010> I am, I google to get there |
04:49:21 | FromDiscord | <takemichihanagaki3129> In reply to @piman_discriminator_1010 "I don't even know": Basically this header brings the keywords and, or... |
04:52:16 | * | raynei joined #nim |
05:11:50 | FromDiscord | <piman_discriminator_1010> can templates not return values? (or substitute the call for an expression?) |
05:15:32 | FromDiscord | <Elegantbeef> They can but they need a return type |
05:15:36 | FromDiscord | <Elegantbeef> be it `untyped` or the expression |
05:19:53 | FromDiscord | <piman_discriminator_1010> yep, untyped return type worked, return keyword however kept expecting a string for some reason though |
05:21:53 | FromDiscord | <Elegantbeef> cause you called it in a proc |
05:22:04 | FromDiscord | <Elegantbeef> templates expand at callsite and do not have a `result` or return |
05:24:24 | FromDiscord | <piman_discriminator_1010> In reply to @Elegantbeef "templates expand at callsite": ok, makes sense, but also didn't seem work until I added `: untyped` so I got a bit confused |
05:44:12 | * | Goodbye_Vincent joined #nim |
05:49:45 | * | raynei quit (Ping timeout: 256 seconds) |
06:30:57 | NimEventer | New Nimble package! awsSigV4 - Simple package for creating AWS Signature Version 4 (SigV4), see https://github.com/ThomasTJdev/nim_awsSigV4 |
07:59:08 | * | zgasma quit (Quit: Lost terminal) |
08:16:59 | * | cnx quit (Remote host closed the connection) |
08:17:47 | * | cnx joined #nim |
08:51:00 | * | advesperacit joined #nim |
09:20:17 | * | wheatengineer joined #nim |
09:32:11 | * | wheatengineer quit (Ping timeout: 268 seconds) |
10:32:32 | FromDiscord | <albassort> is there anyway to request a memory block from the OS that is NOT swap |
10:32:42 | FromDiscord | <albassort> (edit) "is there anyway to request a memory block from the OS that is ... NOT" added "specifically" |
10:33:30 | FromDiscord | <albassort> i guess i can put it into vram |
10:33:42 | FromDiscord | <albassort> no that can leak into swap too |
10:41:41 | * | jmdaemon quit (Ping timeout: 240 seconds) |
10:44:45 | FromDiscord | <odexine> in unix there is pinning |
10:45:37 | FromDiscord | <odexine> check man pages for mlock(2) |
10:47:20 | FromDiscord | <Phil> What exactly does the move proc do? |
10:47:33 | FromDiscord | <Phil> https://nim-lang.org/docs/system.html#move%2CT |
10:49:18 | FromDiscord | <Phil> Does it just nil the var T you put in there (or reset the memory of var T) and that's it? |
11:17:39 | FromDiscord | <nnsee> In reply to @albassort "no that can leak": besides mlock I also suggest looking into madvise https://man7.org/linux/man-pages/man2/madvise.2.html |
13:04:38 | * | raynei joined #nim |
13:50:40 | * | raynei quit (Ping timeout: 276 seconds) |
14:03:14 | * | raynei joined #nim |
14:38:23 | FromDiscord | <jtiai> Hello, as trying to build OS with nim and trying to compile my old code I encountered issue with having some file (ssystem.nim?) generatong `#include "setjmp.h"`. I tried to add `--exceptions:quirky` but still getting the same error. Do I need to add some other flag(s) too? |
14:43:33 | FromDiscord | <odexine> this was a recently reported issue |
14:44:23 | FromDiscord | <odexine> i dont know if its in the tracker |
14:46:37 | FromDiscord | <_fcn_> sent a long message, see https://pasty.ee/oNyfkylLwQKD |
14:47:10 | FromDiscord | <_fcn_> Anyone knows how to avoid that? |
14:47:27 | FromDiscord | <demotomohiro> In reply to @jtiai "Hello, as trying to": This PR might related to your problem.↵https://github.com/nim-lang/Nim/pull/23259 |
14:50:13 | FromDiscord | <jtiai> In reply to @demotomohiro "This PR might related": Right, I was looking into that. |
14:52:26 | FromDiscord | <demotomohiro> In reply to @_fcn_ "Hi there! I am": If typeof(CPlayer_Data)` is cstring, it returns a pointer to heap that is freed. |
14:53:59 | FromDiscord | <demotomohiro> If `CPlayer_Data` is string, it will be fine. |
14:54:50 | FromDiscord | <demotomohiro> As long as CPlayer_Data is not local variable. |
14:56:22 | Amun-Ra | _fcn_: add explicit cstring conversion |
15:00:05 | FromDiscord | <_fcn_> In reply to @Amun-Ra "<@491734096620421120>: add explicit cstring": A simple "cstring(pd_from_disk)" solved the issue... Thanks! |
15:02:15 | FromDiscord | <demotomohiro> In reply to @_fcn_ "A simple "cstring(pd_from_disk)" solved": But cstring is a pointer to the heap in `pd_from_disk` and `pd_from_disk` is freed when you return from the proc. |
15:02:56 | FromDiscord | <demotomohiro> `cstring(pd_from_disk)` is invalid code. |
15:09:19 | * | raynei quit (Ping timeout: 260 seconds) |
15:10:21 | FromDiscord | <_fcn_> In reply to @demotomohiro "`cstring(pd_from_disk)` is invalid code.": When you say "invalid code", you mean, could lead to an unexpected behavior? |
15:11:31 | FromDiscord | <_fcn_> Because it is still working for my study case (Unity native plugin)... |
15:13:57 | FromDiscord | <_fcn_> One info not informed in the code I supply, CPlayer_Data is a global var, that (supposedly) will remain available until the lib is unloaded, I presume. |
15:14:16 | Amun-Ra | it's true that the way it works is undefined behavior |
15:14:34 | Amun-Ra | it'd be safer to alloc cstring and free after use |
15:15:16 | NimEventer | New thread by xTrayambak: Librng - a simple and fast PRNG library, see https://forum.nim-lang.org/t/10925 |
15:17:30 | Amun-Ra | …or store the string somewhere for gc not to free it |
15:23:52 | FromDiscord | <demotomohiro> In reply to @_fcn_ "Because it is still": If `pd_from_disk` is a `string` type and local variable, its heap is freed when return and `return cstring(pd_from_disk)` returns freed pointer.↵If you use returned pointer, it is so called 'use after free`.↵If you do `CPlayer_Data = pd_from_disk; return cstring(CPlayer_Data)`, it is fine as long as `CPlayer_Data` is global and `string` type. |
15:26:49 | * | raynei joined #nim |
15:58:56 | FromDiscord | <nnsee> looks like nitter is shutting down |
15:59:01 | FromDiscord | <nnsee> rip to a real one |
15:59:38 | FromDiscord | <␀ Array 🇵🇸 🍉> the most popular nim project is now dead [\:sob-cry\: https://mau.lu/lkxiq5 ] |
16:00:09 | systemdsucks | that's sad |
16:08:31 | FromDiscord | <exelotl> :( |
16:11:39 | FromDiscord | <jaar23> Hi, anyone try to read clipboard from illwill (the terminal ui library) before? |
16:14:59 | * | raynei quit (Ping timeout: 264 seconds) |
16:17:02 | FromDiscord | <saint.___.> Too bad invidious wasn't made with nim instead! |
16:17:16 | FromDiscord | <saint.___.> Although there seems to be efforts in place to shut down invidious too |
16:48:49 | FromDiscord | <whisperecean> Why is nitter shutting down? |
16:57:10 | FromDiscord | <␀ Array 🇵🇸 🍉> twitter changed their stuff so you cant see tweets without an account. nitter has a login option now but public instamces are getting rate limited↵(@whisperecean) |
17:00:45 | FromDiscord | <␀ Array 🇵🇸 🍉> twitter changed their stuff so you cant see tweets without an account. nitter has a login option now but public instances using them are getting rate limited or banned |
17:01:04 | FromDiscord | <␀ Array 🇵🇸 🍉> twitter changed their stuff so you cant see tweets without an account. nitter has a login option now but public instances using them are getting rate limited and may possibly grt banned |
17:03:03 | FromDiscord | <␀ Array 🇵🇸 🍉> twitter's changes is not just killing nitter but also all alternative frontends |
18:27:14 | FromDiscord | <piman_discriminator_1010> I thought nitter died months ago |
18:49:08 | FromDiscord | <␀ Array 🇵🇸 🍉> the dev found a work around making it work for a bit longer i think↵(@piman_discriminator_1010) |
18:49:25 | FromDiscord | <piman_discriminator_1010> huh |
19:15:37 | FromDiscord | <piman_discriminator_1010> sent a code paste, see https://play.nim-lang.org/#pasty=wVHnlalZQEMt |
19:18:12 | FromDiscord | <piman_discriminator_1010> sent a code paste, see https://play.nim-lang.org/#pasty=wKsIymCntlfN |
19:20:04 | FromDiscord | <piman_discriminator_1010> sent a code paste, see https://play.nim-lang.org/#pasty=cLUuPEVZOvfM |
19:25:47 | FromDiscord | <odexine> what is \`string\`? |
19:26:01 | FromDiscord | <piman_discriminator_1010> field of BACnetProperty |
19:27:11 | * | khazakar joined #nim |
19:27:24 | FromDiscord | <piman_discriminator_1010> derp, field of Data sorry |
19:27:29 | FromDiscord | <odexine> sent a code paste, see https://play.nim-lang.org/#pasty=GCIKPDTUBSqK |
19:27:53 | FromDiscord | <piman_discriminator_1010> In reply to @piman_discriminator_1010 "I'm trying to do": so there's no way to do this? |
19:28:35 | FromDiscord | <odexine> not in that form id say |
19:29:06 | FromDiscord | <odexine> definitely in macro form, not entirely sure if it is possible in template form |
19:36:58 | FromDiscord | <ambient3332> How do I log errors in a multithreaded environment with many callbacks etc? Seems something just eats the error messages like indexing out of range etc |
20:28:11 | * | advesperacit quit () |
20:31:17 | FromDiscord | <ambient3332> The program simply freezes when there's some illegal memory access in another thread |
20:31:32 | FromDiscord | <ambient3332> So I have to debug completely blind |
20:33:32 | FromDiscord | <Elegantbeef> Ensure all your top level thread procs are annotated `{.raises: [].}` and handle the exceptions, cry about the defects |
21:35:34 | * | khazakar quit (Quit: Connection closed for inactivity) |
22:04:54 | FromDiscord | <norax.2> does someone have a guide for illwill,im trying to use it but i cant really understand |
22:05:03 | FromDiscord | <norax.2> (edit) "illwill,im" => "illwill(library),im" | "understand" => "understand?" |
22:05:53 | FromDiscord | <Elegantbeef> https://github.com/johnnovak/illwill/tree/master/examples |
22:06:33 | FromDiscord | <norax.2> will check that thx |
22:07:19 | FromDiscord | <Elegantbeef> https://github.com/ansiwave/nimwave also might work for you |
22:10:15 | * | khazakar joined #nim |
22:17:48 | * | jmdaemon joined #nim |
23:03:52 | FromDiscord | <bubblie> sent a code paste, see https://play.nim-lang.org/#pasty=MetpIzacfmfI |
23:03:56 | FromDiscord | <piman_discriminator_1010> is there a way to clear a sequence so that the elements can be garbage collected, but without creating an entirely new sequence? |
23:04:09 | FromDiscord | <bubblie> (edit) "https://play.nim-lang.org/#pasty=eXrfdCPrbzOw" => "https://play.nim-lang.org/#pasty=fCeHkXHVJsHP" |
23:04:35 | FromDiscord | <piman_discriminator_1010> sent a code paste, see https://play.nim-lang.org/#pasty=dDfpHzeBtVzx |
23:04:41 | FromDiscord | <bubblie> thanks |
23:04:51 | FromDiscord | <Elegantbeef> `setLen(0)` |
23:05:06 | FromDiscord | <piman_discriminator_1010> In reply to @Elegantbeef "`setLen(0)`": does that allow the old elements to be garbage collected? |
23:05:42 | FromDiscord | <piman_discriminator_1010> (I originally assumed no, but since you answered with it, I assume now yes?) |
23:06:14 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#pasty=MsgnnImxGIoE check for yourself |
23:06:40 | FromDiscord | <piman_discriminator_1010> I'm not sure how to actually check what the GC is doing |
23:06:57 | FromDiscord | <Elegantbeef> Nim's Arc/Orc just calls `=destroy` |
23:07:08 | FromDiscord | <Elegantbeef> So just put in an object with a custom destructor |
23:07:21 | FromDiscord | <Elegantbeef> If it's called it's decrementing the ref count |
23:10:17 | FromDiscord | <piman_discriminator_1010> `proc =destroy() =` |
23:10:35 | FromDiscord | <piman_discriminator_1010> (edit) "`proc =destroy() =`" => "sent a code paste, see https://play.nim-lang.org/#pasty=kwvHWxjwmStc" |
23:10:41 | FromDiscord | <piman_discriminator_1010> like that? |
23:10:55 | FromDiscord | <Elegantbeef> What? |
23:12:59 | FromDiscord | <piman_discriminator_1010> nvm, I googled custom destructor |
23:13:19 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/theindex.html is better than google |
23:13:20 | FromDiscord | <piman_discriminator_1010> oh you already did it lol |
23:13:49 | FromDiscord | <piman_discriminator_1010> oh that's neat (though googling just takes me to the nim docs anyways) |
23:15:51 | FromDiscord | <bubblie> is there a way to obtain the access value of a variable in nim |
23:17:48 | FromDiscord | <bubblie> kinda like with C pointers where you just the asterick |
23:18:02 | FromDiscord | <Elegantbeef> what? |
23:19:46 | FromDiscord | <piman_discriminator_1010> is setLen part of sequtils? |
23:19:58 | FromDiscord | <bubblie> sent a code paste, see https://play.nim-lang.org/#pasty=TttPXFcyYqhF |
23:21:52 | FromDiscord | <Elegantbeef> `[]` |
23:21:58 | FromDiscord | <Elegantbeef> But just use `var T` inside your proc |
23:22:03 | FromDiscord | <Elegantbeef> It's called dereferencing a pointer |
23:22:45 | FromDiscord | <bubblie> yeah sorry |
23:22:48 | FromDiscord | <bubblie> thank you |
23:28:25 | FromDiscord | <piman_discriminator_1010> 🤔 https://media.discordapp.net/attachments/371759389889003532/1201307824039407716/image.png?ex=65c95818&is=65b6e318&hm=3adc62817bb893722f3735a5f6fca497e855737cee440e257270b19f0a5b621c& |
23:28:52 | FromDiscord | <Elegantbeef> `getChildren` does not return `var seq[wWindow]` |
23:29:42 | FromDiscord | <piman_discriminator_1010> return of `seq[Type]` is not the same as a return of `var seq[Type]`? |
23:30:53 | FromDiscord | <piman_discriminator_1010> I know parameters are immutable by default, are return parameters also immutable by default? |
23:31:20 | FromDiscord | <leorize> yes |
23:33:30 | FromDiscord | <piman_discriminator_1010> oh, I probably never noticed because I rarely work with ref types so they usually just copy to a variable I already declared as mutable |
23:39:08 | FromDiscord | <Elegantbeef> where's the ref type?! 😄 |
23:41:39 | FromDiscord | <luteva> sent a code paste, see https://play.nim-lang.org/#pasty=oHeYXhrxrqnS |
23:43:25 | * | raynei joined #nim |
23:48:49 | FromDiscord | <Elegantbeef> Make a macro to convert a tuple typedesc to or'd types |
23:50:46 | FromDiscord | <luteva> ok 🙂 |