00:00:40 | FromDiscord | <πτ (pi man)> huh, are arguments passed by reference by default? |
00:01:03 | FromDiscord | <treeform> sent a long message, see http://ix.io/4igK |
00:01:13 | FromDiscord | <Elegantbeef> For large types yes↵(@πτ (pi man)) |
00:01:26 | FromDiscord | <πτ (pi man)> In reply to @Elegantbeef "For large types yes": even `int` seems to be by reference |
00:01:32 | FromDiscord | <Elegantbeef> Nope |
00:01:45 | FromDiscord | <Elegantbeef> Anything larger than 24 bytes i believe is passed by reference |
00:02:02 | FromDiscord | <πτ (pi man)> looking at the function prototype for this↵https://nim-lang.org/docs/parseutils.html#parseInt%2Cstring%2Cint%2Cint↵it seems to be passing `number` by reference |
00:02:11 | FromDiscord | <Elegantbeef> `var int` |
00:02:17 | FromDiscord | <Elegantbeef> `var` is a mutable reference |
00:02:23 | FromDiscord | <πτ (pi man)> In reply to @Elegantbeef "`var int`": right, not `var ref int` |
00:02:23 | FromDiscord | <treeform> In reply to @arkanoid "<@145405730571288577>, yes, the assert": You probably just want to cast image.data to seq[uint32] and do it that way. |
00:02:30 | FromDiscord | <Gumbercules> In reply to @treeform "https://github.com/guzba/nimsimd has support for": how do you detect what instruction sets are supported at compile time? |
00:02:39 | FromDiscord | <πτ (pi man)> In reply to @Elegantbeef "`var` is a mutable": I know var is mutable, but I expected it to still be value |
00:02:41 | FromDiscord | <Elegantbeef> `var ref int` is a heap allocated mutable reference |
00:02:46 | FromDiscord | <πτ (pi man)> (edit) "In reply to @Elegantbeef "`var` is a mutable": I know var is mutable, but I expected it to still be ... value" added "pass by" |
00:02:59 | FromDiscord | <Elegantbeef> A `var` parameter is a mutable reference |
00:03:01 | FromDiscord | <πτ (pi man)> In reply to @πτ (pi man) "I know var is": is this even possible? |
00:03:01 | FromDiscord | <Elegantbeef> Not a mutable copy |
00:03:05 | FromDiscord | <Elegantbeef> A mutable copy is pointless |
00:03:17 | FromDiscord | <treeform> In reply to @Gumbercules "how do you detect": I don't think that's the correct way to do it. You want to produce the best binary possible that will run. |
00:03:35 | FromDiscord | <Gumbercules> this is how every simd library does this though |
00:03:38 | FromDiscord | <πτ (pi man)> In reply to @Elegantbeef "A mutable copy is": so I'd have to make a copy inside the function then to have a mutable copy |
00:03:43 | arkanoid | treeform, makes sense |
00:03:44 | FromDiscord | <Elegantbeef> Correct |
00:03:46 | FromDiscord | <treeform> So if you are on SSE only machine, why not compile a AVX/AVX2 path, but just dont use it. |
00:03:57 | FromDiscord | <Elegantbeef> Nim does not allow you to mutate parameters for a few reasons |
00:04:23 | FromDiscord | <Elegantbeef> It prefers immutability, and it means the compiler cannot do pass by reference |
00:04:40 | FromDiscord | <Gumbercules> if you can compile only the path that will be used and detect that at compile time - why not do that? |
00:04:44 | FromDiscord | <Elegantbeef> Pass by reference is a very easy way to increase performance that the programmer doesnt need to worry about when writing pure Nim |
00:06:40 | FromDiscord | <Yepoleb> In reply to @treeform "https://github.com/guzba/nimsimd has support for": have you benchmarked how much faster avx is? |
00:08:35 | FromDiscord | <πτ (pi man)> In reply to @Elegantbeef "`var ref int` is": is there a stack version of `ref` or would that just be `ptr`? |
00:08:58 | FromDiscord | <Elegantbeef> `var` is a mutable reference to a resource that is stack or heap allocated |
00:09:09 | FromDiscord | <Elegantbeef> It's a safe pointer that is ensured to not outlive the place of access |
00:09:59 | FromDiscord | <πτ (pi man)> sent a code paste, see https://play.nim-lang.org/#ix=4igQ |
00:10:17 | FromDiscord | <πτ (pi man)> now is that printing 10 or 5? |
00:10:20 | FromDiscord | <Elegantbeef> There is no safe way of doing that so you use a pointer |
00:10:32 | FromDiscord | <Elegantbeef> That prints 10 cause nim has value semantics |
00:10:41 | FromDiscord | <Elegantbeef> If you want it to print 5 you use pointers |
00:11:00 | FromDiscord | <Elegantbeef> Nim does not have a borrow checker presently so there is no way to borrow memory that way |
00:11:12 | FromDiscord | <Elegantbeef> it does have cursor inference and other fancy tools with orc/arc to avoid copying |
00:11:23 | FromDiscord | <Elegantbeef> But when using value types you get value types |
00:11:42 | FromDiscord | <πτ (pi man)> so var is sometimes reference sometimes value |
00:11:50 | FromDiscord | <Elegantbeef> `var` is always reference |
00:11:56 | FromDiscord | <Elegantbeef> As a parameter |
00:12:24 | FromDiscord | <πτ (pi man)> and value on a variable |
00:13:01 | FromDiscord | <Elegantbeef> var parameters are equivlent to C++ references |
00:13:05 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4igR |
00:13:25 | FromDiscord | <Elegantbeef> `var` used on a variable vs parameter is two different things |
00:13:29 | FromDiscord | <Elegantbeef> One is declaring a variable as mutable |
00:13:46 | FromDiscord | <Elegantbeef> The other is saying this parameter is mutable and due to what's required that means it's a pointer to the data |
00:15:38 | FromDiscord | <πτ (pi man)> so `var` != `var` :var: |
00:15:52 | FromDiscord | <treeform> In reply to @Yepoleb "have you benchmarked how": Yes we benched all the things. AVX and AVX2 is way faster then SSE4 |
00:15:57 | FromDiscord | <Elegantbeef> This isnt that complicated |
00:16:07 | FromDiscord | <Elegantbeef> `var` used to declare a variable states it's mutable |
00:16:15 | FromDiscord | <πτ (pi man)> it's not complicated, but it is confusing to someone new to Nim |
00:16:23 | FromDiscord | <Elegantbeef> `var` as a parameter is a pointer to a mutable resource |
00:17:01 | FromDiscord | <Elegantbeef> To carry on |
00:17:03 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4igS |
00:17:06 | FromDiscord | <Gumbercules> I still don't see how nim simd is detecting what instruction sets to use at compile time |
00:17:24 | FromDiscord | <Gumbercules> seems to be compiling whatever instruction sets might be availaable and then checking at runtime |
00:17:42 | FromDiscord | <Gumbercules> but I'm probably missing something |
00:17:45 | FromDiscord | <Elegantbeef> Indeed it seems to limit the selection based off compiler and platform |
00:18:07 | FromDiscord | <DaiChimpo> sent a code paste, see https://play.nim-lang.org/#ix=4igT |
00:18:08 | FromDiscord | <DaiChimpo> Don't mean to disrupt the convo |
00:18:12 | FromDiscord | <πτ (pi man)> In reply to @Elegantbeef "Indeed it seems to": wouldn't it also need to limit based on chipset also? |
00:19:14 | FromDiscord | <πτ (pi man)> sent a code paste, see https://play.nim-lang.org/#ix=4igU |
00:24:15 | FromDiscord | <Gumbercules> new int allocates on the heap |
00:24:18 | FromDiscord | <Rika> In reply to @πτ (pi man) "what is `new int`": Make a new reference↵Dereference |
00:24:19 | FromDiscord | <Gumbercules> `[]` dereferences |
00:25:20 | FromDiscord | <Elegantbeef> I swear this bridge craps itself more than it doesnt |
00:26:11 | FromDiscord | <Elegantbeef> DaiChamp your `j` is likely out of range of your slice |
00:32:41 | FromDiscord | <DaiChimpo> sent a code paste, see https://play.nim-lang.org/#ix=4igY |
00:33:15 | FromDiscord | <Elegantbeef> cause you're creating a new sequence and indexing it |
00:33:22 | FromDiscord | <Elegantbeef> Like what behaviour do you expect? |
00:40:17 | FromDiscord | <DaiChimpo> I was hoping it would grab 3Dseq[0][j], 3Dseq[1][j] ... 3Dseq[i-1][j] and put that into a new seq for echo |
00:40:40 | FromDiscord | <Elegantbeef> Well that's not how that works 😄 |
00:41:14 | FromDiscord | <Elegantbeef> `3dSeq[a..b]` emits a new sequence that is all the elements of `a..b` then you index `j` from it |
00:42:13 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/k7A |
00:56:12 | FromDiscord | <DaiChimpo> hmm ok. It's a rewrite then |
01:35:30 | FromDiscord | <sOkam!> sent a long message, see http://ix.io/4ih6 |
01:37:33 | FromDiscord | <Elegantbeef> They have a `.h` file so you wrap that and then compile the C++ as a static library, or dynamic library |
02:06:25 | FromDiscord | <sOkam!> oh so the nim code wouldn't really access the cpp code directly? or am i misunderstanding? |
02:13:11 | FromDiscord | <auxym> C rather than C++ but the idea is similar: https://gist.github.com/zacharycarter/846869eb3423e20af04dea226b65c18f |
02:16:25 | FromDiscord | <auxym> https://github.com/PMunch/wxnim is a rather complete example, maybe a bit big, and it does static linking |
02:16:35 | FromDiscord | <auxym> wx is c++ |
02:20:48 | FromDiscord | <sOkam!> In reply to @auxym "https://github.com/PMunch/wxnim is a rather": this is why i'm overwhelmed by the topic, in essence↵there is so much to libraries, that seeing the bare minimum basics becomes really really difficult from a total nub perspective |
02:21:21 | FromDiscord | <sOkam!> I see that wxnim result code, and I have no clue where to start from or how to get to the destination |
02:22:07 | FromDiscord | <auxym> first of all you should probably get familiar with how c++ code is compiled and linked. you need to understand that, to be able to understand what you want nim to do |
02:22:38 | FromDiscord | <albassort> help circular imports are kicking my ass |
02:22:55 | FromDiscord | <albassort> every file needs every other file and my global file needs those files and those files need my globals file |
02:23:17 | FromDiscord | <sOkam!> In reply to @auxym "first of all you": I have translated that library's compile chain into scons, so I can handle that |
02:23:27 | FromDiscord | <sOkam!> the problem is the interfacing itself, that's what kicks my ass |
02:23:33 | FromDiscord | <albassort> guess globals is going to be come globals apart from all the other globals everywhere else |
02:24:17 | FromDiscord | <albassort> as in asterix not public |
02:24:43 | FromDiscord | <auxym> In reply to @sOkam! "the problem is the": interfacing isn't too hard. just need to use the importc/importcpp + header pragmas. that's it. Compiling is harder IMO, you need to pass a bunch of flags to nim so it links the c++ lib in your build |
02:24:58 | FromDiscord | <Olyno> Hi :vmathi: Beginner here 😅 Does anyone know how to convert a sequence to string please? Can't find a correct way to concat a string and a sequence :/ |
02:25:13 | FromDiscord | <albassort> depends on the type but |
02:25:17 | FromDiscord | <albassort> for char / string |
02:25:41 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4ih9 |
02:25:51 | FromDiscord | <sOkam!> In reply to @auxym "interfacing isn't too hard.": it might be. but i have translated a 3.5k lines monster makefile fully to scons before, so I can handle compile chains due to that experience↵my problems always are at the stupid noob level, which why I make so many stupid noob questions |
02:25:56 | FromDiscord | <albassort> #abbc |
02:25:59 | FromDiscord | <Olyno> In reply to @albassort "depends on the type": It would be a tuple, that's probably why i have so much difficulties ahah |
02:26:06 | FromDiscord | <Olyno> (edit) "would be" => "is" |
02:26:25 | FromDiscord | <albassort> .join("") only works for seq / arrays |
02:26:50 | FromDiscord | <Olyno> Oh indeed, seems to work, thank you!! |
02:27:05 | FromDiscord | <sOkam!> In reply to @auxym "interfacing isn't too hard.": meaning that that "isnt too hard part" is what im not understanding |
02:27:38 | FromDiscord | <albassort> oh glad i could help lol |
02:32:57 | FromDiscord | <Olyno> sent a code paste, see https://play.nim-lang.org/#ix=4iha |
02:33:11 | FromDiscord | <Olyno> (edit) "https://play.nim-lang.org/#ix=4iha" => "https://play.nim-lang.org/#ix=4ihb" |
02:33:19 | FromDiscord | <Elegantbeef> That's literally how procedures work |
02:33:32 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ihc |
02:33:53 | FromDiscord | <Elegantbeef> `openArray[T]` accepts `seq[T]` |
02:34:07 | FromDiscord | <Olyno> Ooooh, that's so interesting, i guess i begin to like Nim xD |
02:34:35 | FromDiscord | <Gumbercules> In reply to @auxym "C rather than C++": forgot I had written that... |
02:36:20 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=4ihe |
02:36:42 | FromDiscord | <Rika> Use option types in the options module |
02:37:46 | FromDiscord | <ajusa> That could work, but I'm really looking to have different behavior based on which type is returned. I guess what I want is an overload instead |
02:38:26 | FromDiscord | <ambient> create an optional type? |
02:39:12 | FromDiscord | <ajusa> Sorry, different compile time behavior - I don't want to be doing a different thing at runtime. An overload works, just tried it. |
02:40:56 | FromDiscord | <Gumbercules> In reply to @Gumbercules "forgot I had written": One day I'll get around to re-writing it and do a better job |
02:46:43 | FromDiscord | <Dumb Dragon> sent a code paste, see https://play.nim-lang.org/#ix=4ihf |
02:59:46 | FromDiscord | <ShalokShalom> In reply to @treeform "https://github.com/guzba/nimsimd has support for": How do you get to the conclusion, that 90% of the computers dont support AVX? |
03:03:19 | FromDiscord | <Gumbercules> the whole explanation doesn't make sense to me - the point of detecting at compile time is to avoid the runtime check |
03:05:58 | FromDiscord | <albassort> beef help |
03:06:02 | FromDiscord | <albassort> circular imports |
03:06:08 | FromDiscord | <Elegantbeef> delay them |
03:06:13 | FromDiscord | <albassort> how |
03:08:50 | FromDiscord | <Elegantbeef> https://wandbox.org/permlink/haocTxT4BZMFpCPF |
03:10:01 | * | rockcavera joined #nim |
03:10:46 | FromDiscord | <albassort> ok delay it until what tho |
03:10:52 | FromDiscord | <albassort> whats the criteria |
03:11:15 | FromDiscord | <Elegantbeef> You delay the import until you need to use the other module to not create a tight cyclical graph |
03:13:57 | FromDiscord | <albassort> bella |
03:16:02 | FromDiscord | <albassort> segmentation fault |
03:16:25 | FromDiscord | <albassort> my code is spaghetti |
03:20:47 | FromDiscord | <Rika> Address sanitiser to save the day? |
03:28:01 | FromDiscord | <albassort> currently my nimsuggest has a memory hole |
03:28:11 | FromDiscord | <albassort> https://media.discordapp.net/attachments/371759389889003532/1051339587873685514/image.png |
03:28:47 | FromDiscord | <Elegantbeef> Welcome to Nim suggest |
03:32:44 | FromDiscord | <albassort> is there anyway to find where this memory hole is? |
03:32:49 | FromDiscord | <albassort> it doesn't seem to be in my program |
03:34:14 | FromDiscord | <albassort> https://media.discordapp.net/attachments/371759389889003532/1051341110234062908/image.png |
03:34:17 | FromDiscord | <albassort> oh good |
03:34:48 | FromDiscord | <Elegantbeef> I mean it needs to be a compiler |
03:34:51 | FromDiscord | <Elegantbeef> So what do you expect 😄 |
03:35:26 | FromDiscord | <albassort> time to turn nimsuggest off i guess? |
03:36:04 | FromDiscord | <Gumbercules> Can just kill it and if you're using VS code it will restart eventually |
03:36:09 | FromDiscord | <albassort> yea |
03:36:11 | FromDiscord | <albassort> and then it leaks again |
03:36:15 | FromDiscord | <Gumbercules> Nimsuggest does annoy the ever living fuck out of me though |
03:36:16 | FromDiscord | <Gumbercules> yeah |
03:36:20 | FromDiscord | <Gumbercules> it's leaky fosho |
03:36:31 | FromDiscord | <albassort> https://media.discordapp.net/attachments/371759389889003532/1051341681401806919/image.png |
03:36:37 | FromDiscord | <Elegantbeef> nimlangserver is supposed to be a bit less chaotic but no clue |
03:36:50 | FromDiscord | <albassort> https://media.discordapp.net/attachments/371759389889003532/1051341761752072212/image.png |
03:36:52 | FromDiscord | <albassort> this is for nim right |
03:36:53 | FromDiscord | <Elegantbeef> Yes nimsuggest has bugs |
03:36:59 | FromDiscord | <Gumbercules> just switch to vim and use nim languag eserver |
03:37:06 | FromDiscord | <Gumbercules> or be really cool and use kakoune |
03:37:17 | FromDiscord | <albassort> i want to take vim and make my own keybinds |
03:37:26 | FromDiscord | <Elegantbeef> If you dont properly setup your project it could be the issue |
03:37:32 | FromDiscord | <Gumbercules> if I was on nix I'd be using kak |
03:37:36 | FromDiscord | <Gumbercules> but I'm on Windows atm |
03:37:39 | FromDiscord | <Elegantbeef> Without a properly setup project the extension dispatches a nimsuggest per file |
03:38:14 | FromDiscord | <albassort> ok what is a properly setup project |
03:38:29 | FromDiscord | <albassort> one with a nimble? |
03:39:27 | FromDiscord | <Elegantbeef> https://github.com/saem/vscode-nim#options |
03:39:57 | FromDiscord | <albassort> cbt.gif |
03:40:31 | FromDiscord | <treeform> In reply to @ShalokShalom "How do you get": steam survey: https://store.steampowered.com/hwsurvey/Steam-Hardware-Software-Survey-Welcome-to-Steam https://media.discordapp.net/attachments/371759389889003532/1051342686633873438/image.png |
03:41:12 | FromDiscord | <treeform> if you target games this makes sense |
03:41:24 | FromDiscord | <treeform> if you target servers, well there you pick the machine and can make sure it has AVX2 |
03:41:50 | FromDiscord | <huantian> wait isnt that 90 percent of computers do support avx? |
03:42:07 | FromDiscord | <Elegantbeef> That is |
03:43:00 | FromDiscord | <treeform> sorry I had it flipped in my message |
03:43:11 | FromDiscord | <albassort> even my pc supports AVX |
03:43:18 | FromDiscord | <treeform> 10% of computers do not support avx because they are old, but people still use them. |
03:43:36 | FromDiscord | <albassort> i'll upgrade my pc on my deathbed |
03:43:41 | FromDiscord | <huantian> yeah that makes more sense lol |
03:44:16 | FromDiscord | <albassort> it would be really fucking cool if nimsuggests told me the files indexing |
03:45:34 | FromDiscord | <albassort> im just deleting files and hoping i find it |
03:48:41 | FromDiscord | <albassort> ok i found the troublesome code |
03:48:46 | FromDiscord | <albassort> it was a io based try except |
03:48:49 | FromDiscord | <albassort> :KEK: |
04:03:45 | * | encyde quit (Quit: WeeChat 2.8) |
04:31:10 | NimEventer | New Nimble package! parazoa - Immutable, persistent data structures, see https://github.com/paranim/parazoa |
04:38:01 | FromDiscord | <Rika> Cool |
05:52:50 | FromDiscord | <MetuMortis> sent a code paste, see https://play.nim-lang.org/#ix=4ihB |
05:55:11 | FromDiscord | <Rika> Log is printed when you compile and not when you run |
05:55:21 | FromDiscord | <MetuMortis> oh yes I just realised that :d |
07:21:11 | NimEventer | New thread by Araq: Update on strict funcs, see https://forum.nim-lang.org/t/9716 |
07:34:31 | FromDiscord | <voidwalker> Can you import just a type definition from a module ? |
07:35:24 | FromDiscord | <voidwalker> apparently yes |
07:40:44 | FromDiscord | <voidwalker> ` can raise an unlisted exception` - is there any way to tell the compiler to ignore these ? |
07:49:05 | FromDiscord | <j-james> In reply to @Elegantbeef "nimlangserver is supposed to": it is 😌 |
07:49:20 | FromDiscord | <j-james> much better at killing and restarting nimsuggest processes |
07:50:58 | FromDiscord | <voidwalker> I am trying to integrate https://github.com/status-im/nim-eth/tree/master/eth/utp in my code, for testing purposes. But it depends on chronos, and I used asyncdispatch to write my code so far.. I am not sure how compatible those two are, and if I am wasting my time. |
07:54:40 | FromDiscord | <j-james> i don't believe std/async and chronos are interoperable |
07:54:52 | FromDiscord | <j-james> but i do think they behave pretty similarly |
07:55:05 | FromDiscord | <j-james> a comparison is here: https://github.com/status-im/nim-chronos/wiki/AsyncDispatch-comparison |
07:56:15 | FromDiscord | <j-james> (note: i have never used async beyond the basics, this is just what i've heard) |
08:00:22 | FromDiscord | <voidwalker> So I have two choices then. Hope that someone will port that lib to be compatible with asyncdispatch, or switch my code to chronos, and deal with any unforeseen consequences |
08:03:01 | FromDiscord | <j-james> curious if anyone's worked with npeg: can you return captures from child rules to the parent rule? |
08:03:09 | FromDiscord | <j-james> sent a code paste, see https://play.nim-lang.org/#ix=4ihS |
08:12:34 | FromDiscord | <Elegantbeef> You can do `-d:asyncBackend=chronos`↵(@voidwalker) |
08:13:09 | FromDiscord | <voidwalker> and where will that get me ? |
08:13:49 | FromDiscord | <Elegantbeef> You then can use chronos and it should be a drop in replacement |
08:15:36 | FromDiscord | <Elegantbeef> Oh i'm wrong how that works |
08:15:40 | FromDiscord | <voidwalker> I thought that's for when you write your libs to be able to handle both async backends |
08:15:46 | FromDiscord | <Elegantbeef> I thought there was a `when asyncBackend == "chronos"` |
08:16:35 | FromDiscord | <voidwalker> yeah anyway, this is beyond my abilities to even understand. I just hoped I can import the uTP transport protocol code and be done with it 😦 |
08:17:14 | FromDiscord | <voidwalker> still, the easier route is probably to get chronos to work with my existing code |
08:18:07 | FromDiscord | <voidwalker> very unlikely somebody at status will be assigned the job to port it to asyncdispatch, dev work costs money there : P |
08:18:46 | FromDiscord | <voidwalker> and even less unlikely somebody skillful enough will be interested in implementing this by their own |
08:18:56 | FromDiscord | <voidwalker> (edit) "unlikely" => "likely" |
08:29:10 | * | jmdaemon joined #nim |
08:31:58 | * | pro joined #nim |
08:32:19 | * | pro left #nim (#nim) |
08:38:44 | FromDiscord | <voidwalker> oh, I think chronos is incompatible with asyncnet as well |
08:53:01 | FromDiscord | <MetuMortis> can I do sth like that? https://media.discordapp.net/attachments/371759389889003532/1051421337282957342/Screenshot_20221211_115250.png |
09:01:11 | FromDiscord | <ShalokShalom> https://forum.nim-lang.org/t/9716 |
09:01:17 | FromDiscord | <ShalokShalom> Interesting |
09:10:35 | FromDiscord | <amadan> sent a code paste, see https://play.nim-lang.org/#ix=4ii3 |
09:18:13 | FromDiscord | <MetuMortis> Error: 'node' cannot be assigned to |
09:18:14 | FromDiscord | <MetuMortis> sent a code paste, see https://play.nim-lang.org/#ix=4ii8 |
09:19:40 | FromDiscord | <amadan> Have you made `node` be `var`? |
09:20:14 | FromDiscord | <that_dude> if it's the name of the proc arg, it shouldn't work iirc. they are constant too |
09:54:14 | * | ltriant joined #nim |
09:59:06 | * | ltriant quit (Ping timeout: 256 seconds) |
10:34:09 | FromDiscord | <ravinder387> how to setup for indentation for 2 spaces in vscode for nim https://media.discordapp.net/attachments/371759389889003532/1051446781625507950/Screenshot_from_2022-12-11_15-59-57.png |
10:37:14 | * | kenran joined #nim |
10:37:21 | * | kenran quit (Remote host closed the connection) |
11:16:56 | FromDiscord | <Phil> Anyone have a good name ready for a function that checks if String X contains String Y exactly N times? |
11:19:09 | FromDiscord | <Phil> Its for unit-testing, I'm writing utility procs |
11:19:23 | FromDiscord | <Phil> Well, more templates since `check` doesn't work well if you use it in procs |
11:19:43 | FromDiscord | <Phil> (edit) "use" => "outsource" | "in procs" => "from the actual test-proc" |
11:19:46 | FromDiscord | <ezquerra> Why don’t you just call it contains but make the first argument an integer and the second the string? That way you could say my string.contains(5, “xxx”) |
11:20:14 | FromDiscord | <ezquerra> You can call the first argument “times” for example |
11:21:00 | FromDiscord | <ezquerra> (edit) "my string.contains(5," => "myString.contains(5," |
11:21:22 | FromDiscord | <ezquerra> (edit) "myString.contains(5, “xxx”)" => "`myString.contains(5, “xxx”)`" |
11:24:11 | FromDiscord | <Phil> Fair shout |
11:35:41 | FromDiscord | <ravinder387> @Phil hello phil how are you |
11:40:51 | FromDiscord | <scruz> can someone who doesn't have Nim installed use my program? |
11:41:07 | FromDiscord | <scruz> Like can I convert my Nim code to a .exe file? |
11:42:51 | FromDiscord | <leetnewb> yes |
11:43:17 | FromDiscord | <scruz> how so? |
11:43:57 | FromDiscord | <leetnewb> nim compiles to c, and (usually) gcc compiles to a binary |
11:46:32 | FromDiscord | <leetnewb> you have some control over that second stage that can help with targeting platforms |
11:47:00 | FromDiscord | <H̲A̲C̲K̲K̲E̲R̲> I wrote a ChatGPT CLI client in nim, should I add it to nimble? |
11:48:29 | FromDiscord | <H̲A̲C̲K̲K̲E̲R̲> https://github.com/HACCKKER/gptcli |
11:50:26 | FromDiscord | <H̲A̲C̲K̲K̲E̲R̲> or is it too bad for publishing to nimble? |
11:50:47 | FromDiscord | <H̲A̲C̲K̲K̲E̲R̲> after all, it is my first useful(for me) program in nim |
11:51:17 | FromDiscord | <auxym> In reply to @scruz "how so?": It's the "main" way to use nim. You call "nim c myfile.nim" and it will compile to "myfile.exe" which is standalone |
11:56:28 | FromDiscord | <auxym> In reply to @sOkam! "meaning that that "isnt": here, the button file in wxnim is relatively short: https://github.com/PMunch/wxnim/blob/master/wxnim/private/button.nim see how it defines procs and types with the header and importcpp pragma? It's wrapping this header: https://github.com/PMunch/wxnim/blob/master/headers/button.h Is that the part you were missing? |
11:58:49 | FromDiscord | <auxym> and fwiw `header: wxh` is defined here, just a bit of magic to define a macro before including wx.h: https://github.com/PMunch/wxnim/blob/master/wxnim/wx.nim#L9 |
11:59:54 | FromDiscord | <MetuMortis> Can't I use fmt with """? |
12:00:13 | FromDiscord | <MetuMortis> https://media.discordapp.net/attachments/371759389889003532/1051468445029502986/Screenshot_20221211_150007.png |
12:00:48 | FromDiscord | <auxym> yes |
12:00:57 | FromDiscord | <auxym> import std/strformats? |
12:01:11 | FromDiscord | <MetuMortis> it is imported |
12:02:39 | NimEventer | New post on r/nim by 6eason: What is concurrency like?, see https://reddit.com/r/nim/comments/zipc52/what_is_concurrency_like/ |
12:02:47 | FromDiscord | <auxym> there your issue is elsewhere. what is the full error the compiler is giving you? |
12:02:49 | FromDiscord | <auxym> https://play.nim-lang.org/#ix=4iiG |
12:03:20 | FromDiscord | <MetuMortis> there is { braces on Java code :/ my bad thanjks |
12:03:21 | FromDiscord | <MetuMortis> (edit) "thanjks" => "thanks" |
12:03:27 | FromDiscord | <sOkam!> In reply to @auxym "here, the button file": that is extremely clarifying, tysm! |
12:04:25 | FromDiscord | <MetuMortis> In reply to @MetuMortis "there is { braces": is there any way to escape {s? |
12:04:58 | FromDiscord | <auxym> you can escape them by doubling IIRC, `{{`. or you can actually use any char you want for opening/closing: https://nim-lang.org/docs/strformat.html#fmt.m%2Cstaticstring%2Cstaticchar%2Cstaticchar |
12:06:29 | FromDiscord | <MetuMortis> thanks a lot |
12:24:19 | * | jmdaemon quit (Ping timeout: 260 seconds) |
12:31:55 | FromDiscord | <hotdog> In reply to @H̲A̲C̲K̲K̲E̲R̲ "I wrote a ChatGPT": Yeah publish it 👍 |
12:32:13 | FromDiscord | <H̲A̲C̲K̲K̲E̲R̲> In reply to @hotdog "Yeah publish it 👍": thx |
12:32:43 | FromDiscord | <dlesnoff> In reply to @hotdog "Yeah publish it 👍": Looking forward to it |
13:03:49 | * | ltriant joined #nim |
13:09:09 | * | ltriant quit (Ping timeout: 260 seconds) |
13:14:17 | * | pro joined #nim |
13:15:38 | * | pro left #nim (#nim) |
13:22:44 | * | ltriant joined #nim |
13:29:47 | * | ltriant quit (Ping timeout: 248 seconds) |
13:43:23 | * | ltriant joined #nim |
13:48:20 | * | ltriant quit (Ping timeout: 260 seconds) |
13:51:11 | FromDiscord | <sOkam!> Are hash sets the tool that's used to create sets of custom object types?↵Or are object sets not poss? |
13:56:22 | FromDiscord | <Phil> Actually, good question. If you have a set of objects, does an object count as "already in the set if the set has an object where each individual field has equal values to the given object instance? |
13:56:39 | FromDiscord | <Phil> (edit) "set" => "set"" |
14:00:25 | FromDiscord | <Rika> In reply to @sOkam! "Are hash sets the": They are |
14:00:43 | FromDiscord | <Rika> In reply to @Isofruit "Actually, good question. If": It depends on your definition |
14:01:18 | FromDiscord | <Rika> You can define your hash function (which implies defining what objects are determined as equal in a hash set) to be anything you need it to be |
14:02:41 | FromDiscord | <auxym> so... if I have a `static[string]`, can I split it to a `static[seq[string]]` and iterate over each `static string` in that? (... yes this is aoc related) |
14:03:15 | FromDiscord | <auxym> ie reading a bunch of lines from a file at compile time and passing line to a macro that takes `static[string]` |
14:08:32 | FromDiscord | <Rika> Think so, you can |
14:11:49 | FromDiscord | <@thatrandomperson5-6310e3b26da03> How would i obtain a typed proc from name inside a macro |
14:12:50 | FromDiscord | <auxym> In reply to @Rika "Think so, you can": how D: nim keeps telling me it can't evaluate at compile time. lemme put something together in playground |
14:13:11 | FromDiscord | <Rika> In reply to @auxym "how D: nim keeps": I’ll take a look then |
14:18:40 | FromDiscord | <auxym> something like this, but I think I understand why it's not working (macro doesn't get evaluated when the CT-proc runs in the VM?) https://play.nim-lang.org/#ix=4ijg |
14:19:25 | FromDiscord | <auxym> oops meant this https://play.nim-lang.org/#ix=4iji |
14:23:29 | FromDiscord | <MetuMortis> sent a code paste, see https://play.nim-lang.org/#ix=4ijk |
14:23:39 | FromDiscord | <auxym> import std/sugar |
14:25:06 | FromDiscord | <MetuMortis> wow |
14:25:17 | FromDiscord | <MetuMortis> have never seen any lang that has sugar library :d |
14:28:09 | FromDiscord | <auxym> yeah, part of nim's philosophy is a small but highly flexible/extensible core. Therefore "extensions" like that can be, and often are, implemented as macros and optionally importable |
14:35:40 | FromDiscord | <sOkam!> What's the downside of using seq vs using fixed sized arrays?↵I understand the benefit of seq, but not getting why/when they could be undesirable |
14:36:21 | * | ltriant joined #nim |
14:41:00 | FromDiscord | <auxym> array = no allocation necessary, one less indirection on accesses |
14:41:05 | FromDiscord | <auxym> so in theory, faster |
14:41:18 | Zevv | seqs go on the heap, one more level of indirection |
14:41:29 | FromDiscord | <auxym> also, safety, somewhat: size is guaranteed at compile-time by the type system |
14:41:41 | * | ltriant quit (Ping timeout: 256 seconds) |
14:42:11 | Zevv | https://zevv.nl/nim-memory/#_lets_talk_about_seqs |
14:43:55 | FromDiscord | <sOkam!> how much "faster" would that mean to be? |
14:44:53 | FromDiscord | <sOkam!> 0.00000000001% faster still fits the faster definition, so wonder how different they are in practice, to know when I should worry about them or not at all |
14:48:01 | FromDiscord | <auxym> probably not worth worrying about unless you are optimizing a tight loop |
14:49:52 | FromDiscord | <auxym> depends on what your program is doing: if you're creating a single seq and doing a million other things, then the time for seq allocation and accesses is negligible. If 99% of execution time of your program is allocating seqs, or accessing seq elements, then perhaps using arrays instead could make your program 2X faster or something like that. |
14:50:12 | FromDiscord | <auxym> that's where profiling comes in, and the old saying about premature optimization |
14:52:55 | FromDiscord | <Rika> I don’t know why people (including me) are so concerned about things not being fast (if it’s not slow) |
15:07:43 | NimEventer | New Nimble package! gptcli - chatgpt cli client written in nim, see https://github.com/HACCKKER/gptcli |
15:20:33 | FromDiscord | <sOkam!> In reply to @Rika "I don’t know why": in this case its for a renderer, and I'm noob, so just worried about my noob decisions biting future me in the ass |
15:24:05 | FromDiscord | <Rika> In reply to @sOkam! "in this case its": That’s a problem future you should solve xddd |
15:24:52 | FromDiscord | <sOkam!> sent a long message, see http://ix.io/4ijU |
15:25:52 | FromDiscord | <sOkam!> In reply to @Rika "That’s a problem future": I understand, but I can avoid shooting myself in the foot a lot less hard just by having a rough approx-guess-timation 🤷♂️ |
15:31:14 | FromDiscord | <Rika> In reply to @sOkam! "question was more about": 1000 is pretty much nothing in the context of seconds |
15:31:27 | FromDiscord | <Rika> If your budget is milliseconds then maybe there might be some impact but it’s hard to tell |
15:33:59 | FromDiscord | <Horizon [She/Her]> Looking at the docs rn, i can see `HttpHeaderValues = distinct seq[string]`, but when doing `req.headers["X-RateLimit-Limit"][0]` it says it's of type char? |
15:36:05 | FromDiscord | <Rika> Just because a type is a distinct sequence doesn’t mean that it borrows [] |
15:36:14 | FromDiscord | <Rika> Actually no that’s misspoken |
15:36:35 | FromDiscord | <Rika> Are you sure indexing headers returns the header values type |
15:36:49 | FromDiscord | <Horizon [She/Her]> That's what VSC is saying |
15:37:19 | FromDiscord | <Horizon [She/Her]> `expression 'req.headers["X-RateLimit-Limit"]' is of type 'HttpHeaderValues' and has to be used (or discarded)` |
15:38:00 | FromDiscord | <Rika> Check the converters |
15:38:03 | FromDiscord | <Rika> https://nim-lang.org/docs/httpcore.html#%5B%5D%2CHttpHeaders%2Cstring |
15:38:12 | FromDiscord | <Rika> Docs says there’s a converter that picks the first type |
15:38:36 | FromDiscord | <Rika> Prolly the http core [] isn’t exported |
15:39:10 | FromDiscord | <Horizon [She/Her]> ah |
15:39:23 | FromDiscord | <Rika> (edit) "type" => "value" |
15:40:27 | FromDiscord | <auxym> In reply to @sOkam! "I understand, but I": just do whatever is easier first. run your program. is it fast enough? great, you're done. Is it too slow? Then run a profiler, figure out the slowest part, optimize that. Then go back to "run your program", and repeat. |
15:43:18 | FromDiscord | <sOkam!> In reply to @Rika "1000 is pretty much": yeah i understand. but multiply 1000 by any relevant number and the result is the same↵_(aka a rough and aprox guesstimation, that's still better than going in blind with no info at all)_ |
15:45:58 | FromDiscord | <sOkam!> sent a long message, see https://paste.rs/PmE |
15:46:40 | FromDiscord | <auxym> whenever a profiler tells you that seq operations are talking a significant chunk of your runtime |
15:53:20 | FromDiscord | <scruz> In reply to @auxym "It's the "main" way": Thanks, btw how can I make my program not quit quickly? |
15:53:54 | FromDiscord | <scruz> Like I have a simple calculator that I made into a .exe file |
15:54:03 | FromDiscord | <scruz> It quits before I even see the output |
15:54:27 | FromDiscord | <scruz> https://github.com/scrazzz/nimballs/blob/main/calculator/main.nim |
15:58:21 | FromDiscord | <huantian> Do something like discard stdin.readLine(“push enter to exit”$ |
15:58:26 | FromDiscord | <huantian> (edit) "exit”$" => "exit”)" |
15:58:33 | FromDiscord | <huantian> Or run your program from the command line |
15:59:59 | FromDiscord | <scruz> oh I see |
16:00:11 | FromDiscord | <scruz> I just double-clicked the exe file |
16:00:17 | FromDiscord | <scruz> thanks |
16:06:18 | * | ltriant joined #nim |
16:07:47 | * | pro joined #nim |
16:08:23 | * | pro left #nim (#nim) |
16:11:24 | * | ltriant quit (Ping timeout: 256 seconds) |
16:51:48 | FromDiscord | <albassort> alright i have encountered a nasty bug in my code |
16:52:10 | FromDiscord | <albassort> with a sequence, if x goes up, everything is fine, if x goes down, the sequence returns null |
16:52:27 | FromDiscord | <albassort> if it goes back up to before the last place it read, it returns data again |
16:52:42 | FromDiscord | <albassort> eg |
16:53:43 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4ikv |
16:55:21 | FromDiscord | <Rika> What? |
16:55:46 | FromDiscord | <Rika> What do you mean, what’s the context |
16:55:54 | FromDiscord | <albassort> i take this back |
16:56:00 | FromDiscord | <albassort> it appears im flooding the array somehow |
16:56:47 | FromDiscord | <albassort> i dont know how im mutating it |
16:57:48 | FromDiscord | <albassort> var not even once |
17:14:12 | FromDiscord | <guzba> In reply to @Gumbercules "I still don't see": nimsimd https://github.com/guzba/nimsimd does no decisionmaking, its just the intrinsics bindings |
17:16:28 | FromDiscord | <guzba> sent a long message, see http://ix.io/4ikL |
17:17:08 | FromDiscord | <guzba> (edit) "http://ix.io/4ikL" => "http://ix.io/4ikM" |
17:17:15 | FromDiscord | <guzba> (edit) "http://ix.io/4ikM" => "http://ix.io/4ikN" |
17:18:25 | FromDiscord | <guzba> (edit) "http://ix.io/4ikN" => "http://ix.io/4ikO" |
17:20:08 | FromDiscord | <guzba> if we did not do this, we could only assume sse2 and a default build using pixie would be unnecessarily slower for the vast majority of people↵then we'd have to explain how to turn on various levels of instruction sets↵then the user of pixie would need to pick the level(s) they wanted to support, and figure out how to set up their builds and final prod executable↵all this mess of complication is completely unnecessary |
17:21:52 | FromDiscord | <ShalokShalom> In reply to @guzba "when building a x86-64": Yes, 90% will have AVX2 activated |
17:22:03 | FromDiscord | <ShalokShalom> If I understood treeform correct, he meant it the other way |
17:22:10 | FromDiscord | <guzba> yep just a little typo earlier |
17:22:39 | FromDiscord | <ShalokShalom> https://discord.com/channels/371759389889003530/371759389889003532/1051287441044144149 |
17:22:46 | FromDiscord | <ShalokShalom> Ah, I see |
17:27:43 | FromDiscord | <albassort> it seems that, for whatever reason, after reading from the sequence, its set to null |
17:28:00 | FromDiscord | <albassort> garbage collector? |
17:28:33 | FromDiscord | <albassort> yes garbage collector |
17:28:36 | FromDiscord | <albassort> found a bug in orc |
17:28:47 | FromDiscord | <a weird programmer> lets transcompile nim to rust |
17:29:06 | FromDiscord | <albassort> In reply to @a weird programmer "lets transcompile nim to": but why tho |
17:29:22 | FromDiscord | <a weird programmer> rust is faster |
17:29:26 | FromDiscord | <a weird programmer> and safer |
17:29:29 | FromDiscord | <albassort> than what |
17:29:34 | FromDiscord | <a weird programmer> than C |
17:29:51 | FromDiscord | <albassort> Where did you see something that said Rust was faster than C |
17:30:08 | FromDiscord | <a weird programmer> benchmarks |
17:30:13 | FromDiscord | <albassort> and also thats not transcompiling, thats just compiling |
17:30:20 | FromDiscord | <albassort> which benchmarks? |
17:30:30 | FromDiscord | <albassort> usually Rust and C++ are around equal |
17:31:18 | FromDiscord | <a weird programmer> https://programming-language-benchmarks.vercel.app/c-vs-rust |
17:31:43 | FromDiscord | <ieltan> LMAO |
17:31:53 | FromDiscord | <ieltan> Why is it always this 'benchmark' |
17:33:52 | FromDiscord | <ShalokShalom> @a weird programmer Nim is about as speedy as Rust and C |
17:34:08 | FromDiscord | <ieltan> In reply to @a weird programmer "lets transcompile nim to": Nim is already pretty safe. It also reacts to optimization nicely. The reason why Rust is safer than C is because of the borrow checker, which Nim introduces with view types so there's no reason to transpile to Rust. |
17:34:10 | FromDiscord | <ShalokShalom> And Rust can operate on lists etc, in a way that is highly unsafe in C |
17:34:11 | FromDiscord | <a weird programmer> In reply to @ieltan "Why is it always": bro the benchmark bro trust |
17:34:22 | FromDiscord | <ShalokShalom> And in these contexts, Rust is faster |
17:34:38 | FromDiscord | <ShalokShalom> But usually, the performance difference between all three does not really matter |
17:34:43 | FromDiscord | <ShalokShalom> In real world scenarios. |
17:35:05 | FromDiscord | <albassort> in real world scenarios Rust, C++, C, Nim are usually within like 2% |
17:35:11 | FromDiscord | <albassort> which aren't doing anything |
17:35:20 | FromDiscord | <albassort> because if you care that much, you're probably gonna be in Cuda or ASM |
17:35:30 | FromDiscord | <albassort> and probably have a degree in writing things fast |
17:35:34 | FromDiscord | <ShalokShalom> I personally see the super flexible GC/ manual memory management situation as something very valuable to target different devices and use cases |
17:36:04 | FromDiscord | <ShalokShalom> Rust basically assumes, that every app written in it is either a kernel, or some IOT firmware |
17:36:08 | FromDiscord | <albassort> (edit) "Cuda or ASM" => "Cuda, C, C++, Fortran, Or ASM. Or some combination" |
17:36:10 | FromDiscord | <ShalokShalom> Nim can do that as well |
17:36:31 | FromDiscord | <ShalokShalom> But doesn't restrict to manual memory management in 99% of all common applications |
17:36:33 | FromDiscord | <albassort> i just think at that rate, speed doesn't matter whatsoever |
17:36:57 | FromDiscord | <ShalokShalom> I mean, is it really necessary, that your text editor is written with the borrow checker? |
17:36:58 | FromDiscord | <albassort> the market for extremely fast shit is dominated by other things |
17:37:07 | FromDiscord | <Horizon [She/Her]> In reply to @ShalokShalom "But doesn't restrict to": Also arc isn't a gc which iirc, gets rid of many of the issues people had with Nim imo |
17:37:16 | FromDiscord | <ShalokShalom> Would Helix really be less safe and speedy if written with ORC instead? |
17:37:18 | FromDiscord | <albassort> is it really not tho |
17:37:35 | FromDiscord | <Horizon [She/Her]> In reply to @albassort "is it really not": ¯\\_(ツ)\_/¯ |
17:37:38 | FromDiscord | <albassort> horizon i found a bug in orc and im writing replication code!!! |
17:37:40 | FromDiscord | <ShalokShalom> I think its pretty bonkers, to write everything with a complicated setup like a borrow checker |
17:37:46 | FromDiscord | <ShalokShalom> Maybe me being ignorant |
17:37:47 | FromDiscord | <Horizon [She/Her]> In reply to @albassort "horizon i found a": Oop |
17:38:13 | FromDiscord | <ShalokShalom> Reference counting is not GC, technically |
17:38:36 | FromDiscord | <ShalokShalom> On 4kb big devices is it probably still too consuming |
17:38:57 | FromDiscord | <ShalokShalom> But why would I apply the same memory model in every other case. |
17:39:01 | FromDiscord | <ShalokShalom> That's bonkers. |
17:39:26 | FromDiscord | <albassort> on 4kb device, its in C |
17:39:34 | FromDiscord | <albassort> theres no place for nim there |
17:39:40 | FromDiscord | <albassort> or Rust, really |
17:40:05 | FromDiscord | <albassort> might have a c++ compiler but who knows |
17:40:10 | FromDiscord | <albassort> probably not |
17:40:30 | FromDiscord | <ShalokShalom> In reply to @albassort "because if you care": If you care about speed, the question is still the application case.↵↵Speedy homepage?↵Speedy multi core environment? |
17:40:39 | FromDiscord | <ShalokShalom> Erlang is not the fastest language |
17:40:58 | FromDiscord | <ShalokShalom> And WhatsApp was managed from a single, central BSD server |
17:41:12 | FromDiscord | <ShalokShalom> Like, until they got sold for 19 billions |
17:41:22 | FromDiscord | <ShalokShalom> With like idk how many million users. |
17:41:24 | FromDiscord | <albassort> im trying to make a replication but the setup seems so standard that I might have to fix the bug on the code i already have |
17:41:34 | FromDiscord | <albassort> which would be... nightmarish |
17:41:46 | FromDiscord | <ShalokShalom> @albassort Rust has space on 4kb |
17:41:49 | FromDiscord | <ShalokShalom> Why wouldn't it |
17:42:00 | FromDiscord | <albassort> a compiler for the microcontroller to run it on |
17:42:05 | FromDiscord | <albassort> it would probably not have |
17:42:12 | FromDiscord | <ShalokShalom> Yeah, that's true |
17:42:28 | FromDiscord | <ShalokShalom> I kinda wonder, why Rust isn't ported to more architectures |
17:42:36 | FromDiscord | <ShalokShalom> And still, ARM is present there |
17:42:48 | FromDiscord | <ShalokShalom> And I guess, RISC V might be added later or sooner |
17:43:06 | FromDiscord | <ShalokShalom> https://github.com/Manishearth/rust-gc |
17:43:11 | FromDiscord | <ShalokShalom> And there is that 😋 |
17:43:46 | FromDiscord | <ieltan> In reply to @ShalokShalom "On 4kb big devices": In Nim refcounts are optimized by move semantics, so we shouldn't expect be typical memory consumption but I'm curious how much it cost in real life |
17:44:19 | FromDiscord | <ShalokShalom> Yes |
17:44:25 | FromDiscord | <ieltan> In reply to @ShalokShalom "I kinda wonder, why": Maybe because it's work and it doesn't help that Rust has a tendency to 'rebuild the world' |
17:44:34 | FromDiscord | <ShalokShalom> Do you think, it could replace manual memory management completely? |
17:44:36 | FromDiscord | <ieltan> (edit) removed "be" |
17:44:56 | FromDiscord | <ShalokShalom> In reply to @ieltan "Maybe because it's work": I actually think Rust makes the most sense |
17:45:10 | FromDiscord | <ShalokShalom> Considering how borderline broken firmware usually is |
17:45:35 | FromDiscord | <ShalokShalom> Did you see security converence videos about firmware? |
17:45:39 | FromDiscord | <ShalokShalom> Its frightening |
17:46:18 | FromDiscord | <ieltan> In reply to @ShalokShalom "Do you think, it": I'm not sure how well it does against hard real-time constraints, I often check #embedded and I see very interesting stuff there though so based on that it's doable. |
17:46:37 | FromDiscord | <ShalokShalom> 🤔 |
17:46:47 | FromDiscord | <ShalokShalom> Demonstrating that could be valuable |
17:47:08 | FromDiscord | <ieltan> I only touched toys like esp32 for school projects tho lol |
17:47:30 | FromDiscord | <ieltan> It was the most fun and pain I had in high school |
17:48:13 | FromDiscord | <albassort> oh god it doesn't replicate |
17:48:14 | FromDiscord | <ieltan> In reply to @ShalokShalom "I actually think Rust": Yes it does make sense, but it isn't free. |
17:48:27 | FromDiscord | <albassort> how do i debug the gc |
17:48:32 | FromDiscord | <ieltan> Nim helps with its top tier C-FFI |
17:49:00 | FromDiscord | <albassort> In reply to @ieltan "Nim helps with its": C-FFI is easy when you are C 😎 |
17:49:25 | FromDiscord | <ieltan> I'm not sure how rust manages FFI but the fact they are hell bent over nil already does not bode well |
17:49:43 | FromDiscord | <albassort> i dont see how rust would do FFI as well as nim |
17:49:48 | FromDiscord | <albassort> seeing as how... nim is c |
17:49:50 | FromDiscord | <ieltan> Unless unsafe Rust has nil |
17:49:53 | FromDiscord | <ieltan> Lol |
17:50:23 | FromDiscord | <ieltan> Tbh I don't see how any language would do without any presence of nil |
17:50:39 | FromDiscord | <Horizon [She/Her]> In reply to @ShalokShalom "I kinda wonder, why": It uses LLVM, as long as it can compile for LLVM, it can use that platforms |
17:51:39 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4il4 |
17:52:16 | FromDiscord | <ShalokShalom> In reply to @Event Horizon "It uses LLVM, as": That sounds true, and I can sweat I read on the official Rust docs, that only x86 and arm8 are supported |
17:52:40 | FromDiscord | <Horizon [She/Her]> Oh huh |
17:52:46 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=4il4" => "https://play.nim-lang.org/#ix=4il5" |
17:53:33 | FromDiscord | <albassort> In reply to @sOkam! "Lets say you have": love to help; but idfk what a vmath.Vec3 is |
17:54:00 | FromDiscord | <albassort> oh ok |
17:54:01 | FromDiscord | <albassort> uh |
17:54:12 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4il6 |
17:54:21 | FromDiscord | <sOkam!> its a math type thats stored as an array of 3 float32 |
17:54:31 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4il7 |
17:54:46 | FromDiscord | <albassort> well if you know the type you're converting to, it doesn't help to try this: |
17:55:26 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4il9 |
17:55:42 | FromDiscord | <albassort> if it doesn't work then.... well, you got a more complicated problem |
17:56:11 | FromDiscord | <sOkam!> https://github.com/treeform/vmath/blob/f4c668874e48e9153d52c4d098f8202e5abec8a9/src/vmath.nim#L45 |
17:56:32 | FromDiscord | <sOkam!> can tuples be casted to arrays? 🤔 |
17:56:52 | FromDiscord | <albassort> probably but you dont need to |
17:56:57 | FromDiscord | <albassort> [x, y, z] |
17:57:17 | FromDiscord | <sOkam!> i dont follow |
17:57:26 | FromDiscord | <albassort> thats the answer, that is an array of t |
17:57:28 | FromDiscord | <sOkam!> i tend to get lost in the stupid dumb details |
17:57:40 | FromDiscord | <sOkam!> but [x,y,z] is an array, not a tuple |
17:57:42 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4ilb |
17:57:51 | FromDiscord | <albassort> yea |
17:57:58 | FromDiscord | <sOkam!> and TVector3 is a pointer to an array of tuples |
17:58:00 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4ilc |
17:58:22 | FromDiscord | <sOkam!> not a pointer to one single tuple, it contains verticescount tuples |
17:58:39 | FromDiscord | <sOkam!> (edit) "verticescount" => "VertexCount" |
17:59:12 | FromDiscord | <albassort> hmm well |
17:59:23 | FromDiscord | <sOkam!> sry, vertices is a pointer to an array of tuples |
17:59:33 | FromDiscord | <albassort> ptr UncheckedArray[T] is the nim form ot T |
17:59:35 | FromDiscord | <sOkam!> TVector3 is the tuple itself |
17:59:45 | FromDiscord | <albassort> (edit) "ot" => "of" |
18:00:40 | FromDiscord | <albassort> i might be stupid, I don't think im helping, but, im not seeing the correlation between anything you've given me... uh @ShalokShalom help |
18:01:47 | FromDiscord | <ShalokShalom> It's probably me |
18:02:00 | FromDiscord | <ShalokShalom> I didn't even know, I am giving you anything 😅 |
18:02:08 | FromDiscord | <ShalokShalom> What are you talking about? |
18:03:32 | FromDiscord | <sOkam!> sent a long message, see http://ix.io/4ilg |
18:04:39 | FromDiscord | <sOkam!> (edit) "http://ix.io/4ilg" => "http://ix.io/4ilh" |
18:06:28 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4ilk |
18:07:23 | FromDiscord | <sOkam!> but I don't know if you can access a `ptr TVector3` like that, with a number, to access one of the tuples 🤷♂️ |
18:07:40 | FromDiscord | <ShalokShalom> I probably just missed the context. If you are talking about Rust, it is potentially just me not having understood well, what I did read. |
18:08:01 | FromDiscord | <sOkam!> In reply to @ShalokShalom "I probably just missed": its assimp's nim bindings |
18:10:02 | FromDiscord | <ShalokShalom> I dont know them |
18:11:59 | FromDiscord | <sOkam!> In reply to @sOkam! "Lets say you have": the context is here↵the question is how to iterate over a `ptr tuple[x,y,z : cfloat]`, to get the C types out of C into standard nim types |
18:16:05 | FromDiscord | <sOkam!> like, how do you even access something that's behind a ptr an contains more than just a single variable of data |
18:16:17 | FromDiscord | <sOkam!> (edit) "an" => "and" | removed "of data" |
18:17:58 | FromDiscord | <jan0809> doesnt pointers point to certain locations in memory usually? |
18:19:57 | FromDiscord | <sOkam!> yeah, which makes it really straight forward when the location in memory contains just one thing↵but this contains a pointer to multiple tuples |
18:20:00 | FromDiscord | <jtv> In that case the pointer points to a tuple of a specific type |
18:20:20 | FromDiscord | <jtv> If you want to recover what's in it, take the ptr and apply the [] operator to dereference |
18:20:37 | FromDiscord | <jtv> So declare a tuple of that type, and assign it to tupleptr[] |
18:21:19 | FromDiscord | <sOkam!> In reply to @jtv "So declare a tuple": i see. but there are `vertexCount` many tuples stored in that pointer↵how do you access them all? |
18:21:29 | FromDiscord | <jtv> With a loop? |
18:21:37 | FromDiscord | <sOkam!> yeah, i get that, but how |
18:21:49 | FromDiscord | <sOkam!> as i said, i get stuck in the stupid dumb details always |
18:22:00 | FromDiscord | <jtv> assign each in turn to a variable of type ptr tuple[x,y,z : cfloat] |
18:22:01 | FromDiscord | <sOkam!> conceptually i get it, but i struggle converting concepts to small details |
18:22:17 | FromDiscord | <jtv> And then dereference that into a variable of type tuple[x,y,z: cfloat] |
18:22:56 | FromDiscord | <sOkam!> how do you reach the next tuple? |
18:23:49 | FromDiscord | <jtv> It depends on how they're stored. If they're in a seq[ptr tuple[x,y,z: cfloat] named `list` you can just do `for p in list:` |
18:24:09 | FromDiscord | <sOkam!> they are not a seq, they are just a ptr tuple |
18:24:26 | FromDiscord | <sOkam!> In reply to @sOkam! "Lets say you have": ☝️ |
18:25:34 | FromDiscord | <jtv> Ah, if it's stored in a C array, which it looks like that is, then for the dereference part, you should be able to put the index in brackets. |
18:26:27 | FromDiscord | <jtv> so tup = TVector3d[1] should get the second one |
18:26:50 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4ilu |
18:26:57 | FromDiscord | <jtv> Oh wait my scrolling sucks, that's wrong |
18:26:58 | FromDiscord | <sOkam!> that's as far as i can reason about it 😔 |
18:27:03 | FromDiscord | <jtv> one sec |
18:27:44 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=4ilu" => "https://play.nim-lang.org/#ix=4ilv" |
18:29:44 | FromDiscord | <jtv> Something like this for reading them: |
18:29:50 | FromDiscord | <jtv> sent a code paste, see https://play.nim-lang.org/#ix=4ilx |
18:30:27 | FromDiscord | <jtv> For setting them, you can pass your tuple through the addr() operator, but your tuple then has to stay in scope, or it will end up a dangling pointer. |
18:31:54 | FromDiscord | <sOkam!> nah, just reading them is enough |
18:31:56 | FromDiscord | <jtv> Oh, no, it should probably work okay if you leave off the addr. I haven't exercised that part of the language yet tho |
18:32:11 | FromDiscord | <sOkam!> im getting "cannot evaluate at compile time `i`" |
18:32:17 | * | disso_peach quit (Ping timeout: 246 seconds) |
18:33:30 | FromDiscord | <jtv> Well, something else is going on then, because for loops are not only evaluated at compile time 🙂 |
18:33:46 | FromDiscord | <sOkam!> but the array accessing is |
18:33:53 | FromDiscord | <sOkam!> which is the line that is complaining |
18:34:10 | FromDiscord | <jtv> Well, then that's because mesh.vertexCount is not |
18:34:19 | FromDiscord | <jtv> It can't figure it out at compile time |
18:34:41 | FromDiscord | <sOkam!> so back to square one |
18:35:12 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4ilA |
18:35:39 | FromDiscord | <jtv> To "open" them? |
18:35:45 | FromDiscord | <jmgomez> (edit) "https://play.nim-lang.org/#ix=4ilA" => "https://play.nim-lang.org/#ix=4ilB" |
18:36:22 | FromDiscord | <jmgomez> Yeah, like you would do with a variable but inside the params. Right now it's a whole block for $3 |
18:37:28 | FromDiscord | <jtv> You're writing a macro, and your last parameter is a whole block, and you want to add a parameter? I don't understand the question, a real example might help |
18:39:16 | * | disso_peach joined #nim |
18:39:36 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4ilE |
18:40:09 | FromDiscord | <jtv> Ahhh, got it |
18:41:54 | FromDiscord | <jtv> I don't know the answer to that one either :/ |
18:45:01 | * | wallabra_ joined #nim |
18:46:24 | FromDiscord | <jmgomez> I guess I will just use emit |
18:47:14 | * | wallabra quit (Ping timeout: 260 seconds) |
18:47:15 | * | wallabra_ is now known as wallabra |
18:55:12 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4ilI |
18:56:10 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=4ilI" => "https://play.nim-lang.org/#ix=4ilJ" |
18:57:23 | FromDiscord | <jtv> Well, what's probably happening then is the value for vertexCount somehow has a dependency that crosses module boundaries |
18:57:33 | FromDiscord | <jtv> That makes it ineligible for static execution ATM |
18:57:54 | FromDiscord | <jtv> As does calling out to external code via the FFI, which is another possibility |
18:58:21 | FromDiscord | <sOkam!> how can i iterate over the data, though? |
18:59:17 | FromDiscord | <jtv> You need to do it at compile time?? |
18:59:23 | FromDiscord | <sOkam!> its runtime |
18:59:40 | FromDiscord | <sOkam!> its supposed to be importing variable amounts of memory, since its loading a model at runtime |
18:59:43 | FromDiscord | <jtv> Well, it's definitely trying to execute your code at compile time or you wouldn't get that error |
18:59:57 | FromDiscord | <sOkam!> but there is a pointer to the address, and an amount to know how many |
19:00:31 | FromDiscord | <sOkam!> so the idea is how to iterate with that data that is given, and not force it to be know at compile time (which will not be) |
19:01:00 | FromDiscord | <jtv> You might be trying to reference something only available at compile time, IDK. I don't know exactly what you might be doing to trigger it thinking your code is supposed to be compile-time. |
19:01:39 | FromDiscord | <sOkam!> i mean, the others are accesing unchecked arrays, this is accessing a ptr to an undefined amount of tuples |
19:01:49 | FromDiscord | <sOkam!> but the amount is given into a different value |
19:02:17 | FromDiscord | <sOkam!> so there is a place in memory, and we know the size↵just how the hell do you iterate over that at runtime |
19:02:34 | FromDiscord | <jtv> You're doing something to indicate your code should be compile time. Usually, that's just code that's in a macro or called by a macro, so IDK |
19:03:00 | FromDiscord | <sOkam!> i mean, that's not a macro. I just showed you all the code that its in my file |
19:03:13 | FromDiscord | <sOkam!> and the rest is in the link, but its also the same I also have in my file |
19:04:19 | FromDiscord | <jtv> Well I'd have to look at the library you're trying to use, which I don't have time to do. But for it to be complaining about something not being available at compile time, you'd absolutely need to be referencing something that's compile-time only. At runtime, it would be easy enough you read the variable indicating the number of items, then loop through indexing each one |
19:04:36 | FromDiscord | <vindaar> the issue you see is that the `TVector3d` in the link is defined as a `tuple`. You can't index a tuple using a runtime loop. You can use the`fields` / `fieldPairs` iterator instead↵(@sOkam!) |
19:04:54 | FromDiscord | <vindaar> https://nim-lang.org/docs/iterators.html |
19:05:08 | FromDiscord | <vindaar> \runtime variable from a loop |
19:05:28 | FromDiscord | <jtv> Well first, you need white space after the < |
19:06:03 | FromDiscord | <sOkam!> In reply to @vindaar "the issue you see": will fields yield one of the complete tuples, or one if the variables contained inside the tuple instead? |
19:06:05 | FromDiscord | <jtv> and possibly before the =, that one I'm less sure about b/c I'd always put one there anyway |
19:06:30 | FromDiscord | <sOkam!> you put it there, and its considered Nim's standard due to NEP, but its not required, neither of them are |
19:06:52 | FromDiscord | <jtv> LOL |
19:06:58 | FromDiscord | <jtv> Well, vindaar seems to have your answer |
19:07:21 | FromDiscord | <jtv> The fact that it's a tuple is what's trying to get it to run at compile time |
19:07:34 | FromDiscord | <sOkam!> i see |
19:10:27 | FromDiscord | <sOkam!> struggling to see how to use it |
19:10:40 | FromDiscord | <sOkam!> does fields yield one item, or all of them at once? |
19:10:43 | FromDiscord | <vindaar> sent a code paste, see https://play.nim-lang.org/#ix=4ilO |
19:11:25 | FromDiscord | <sOkam!> also, how do you iterate over a pointer of tuples with this? |
19:13:37 | FromDiscord | <vindaar> can you give a self contained example of what you are struggling with? |
19:13:41 | FromDiscord | <sOkam!> i understand how to use it when there is one tuple↵but this is a pointer to `vertexCount` tuples, so that extra layer is what's confusing me |
19:13:48 | FromDiscord | <vindaar> it unrolls the loop |
19:14:10 | FromDiscord | <sOkam!> but you are not unrolling one tuple, you are unrolling a ptr tuple |
19:14:44 | FromDiscord | <sOkam!> which is what's failing to compile, because mesh.vertices[number] is not known at compile time |
19:15:06 | FromDiscord | <sOkam!> as far as i understand at least 🤷♂️ |
19:17:37 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4ilQ |
19:18:21 | FromDiscord | <vindaar> ok, just looked at the linked code a bit longer. Sorry, I think my message was confusing, because I misread what the code should do.↵↵I think your actual issue is another. Let me check that snippet of yours |
19:21:21 | FromDiscord | <vindaar> sent a code paste, see https://play.nim-lang.org/#ix=4ilT |
19:22:04 | FromDiscord | <vindaar> the issue is that the field`vertices` of `TMesh` is defined as `ptr TVector3d`. But in order to access it by element you need it to be a `ptr UncheckedArray` |
19:22:20 | FromDiscord | <vindaar> so we just create a local variable of that type from the `ptr` |
19:22:24 | FromDiscord | <sOkam!> that makes more sense |
19:22:41 | FromDiscord | <sOkam!> i wonder why its not stored as an array in the first place 🤔 |
19:23:38 | FromDiscord | <vindaar> probably beef didn't feel the need to iterate over it so far and hence never changed it from what `c2nim` spat out? just guessing here |
19:23:57 | FromDiscord | <vindaar> Elegantbeef\: ^ |
19:25:08 | FromDiscord | <sOkam!> its a fork of a fork of a fork, so maybe he didn't even use this yet |
19:25:46 | FromDiscord | <sOkam!> he is uploading the assimp data straight to the gpu without intermediate storage, so would make sense if he didn't |
19:29:04 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4ilX |
19:30:11 | FromDiscord | <vindaar> why is the return type now `Vec3` instead of `TVector3d`? Whether `tmp[key]` is valid I have no idea (depends on what `Vec3` is and if it has a `[]=` operator |
19:30:22 | FromDiscord | <vindaar> otherwise it should be fine |
19:30:39 | FromDiscord | <sOkam!> Vec3 is vmath.Vec3 |
19:31:01 | FromDiscord | <sOkam!> the reason is because I don't want to yield the intermediate type, when I can just store the value directly from the iterator |
19:31:33 | FromDiscord | <sOkam!> (edit) "vmath.Vec3" => "vmath.Vec3, which is an `array[3, float32]`" |
19:31:48 | FromDiscord | <vindaar> ah, in that case the `[]=` like that won't work as `key` from `fieldPairs` is really a `string` |
19:32:03 | FromDiscord | <sOkam!> oh 😔 |
19:32:13 | FromDiscord | <vindaar> `Vec3` probably offers an index access though. So just have a manual index |
19:32:32 | FromDiscord | <sOkam!> what do you mean by index access? |
19:32:50 | FromDiscord | <vindaar> sent a code paste, see https://paste.rs/rG3 |
19:33:27 | FromDiscord | <sOkam!> won't that try to get tuple fields 4051 or some crazy high number eventually, aka go out of bounds of the tuple? |
19:33:44 | FromDiscord | <vindaar> sent a code paste, see https://play.nim-lang.org/#ix=4im0 |
19:34:07 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4im1 |
19:34:15 | FromDiscord | <vindaar> no, `fields` unrolls to exactly the number of fields of the tuple, in this case 3 |
19:34:51 | FromDiscord | <sOkam!> i see |
19:35:10 | FromDiscord | <sOkam!> accesing by index is much cleaner in this case, though. nice catch |
19:43:25 | FromDiscord | <sOkam!> is it safe to convert cfloat to float32 directly, btw?↵I never found any specific info on c types compatibility, other than vague "be careful, but should work" type of thing |
19:44:13 | Amun-Ra | yes |
19:45:25 | Amun-Ra | there were some non IEEE 754 systems in good old dark age days, but they're long since gone now |
19:46:19 | Amun-Ra | and if the conversion is within one system it doesn't matter |
20:07:52 | * | ltriant joined #nim |
20:08:20 | FromDiscord | <sOkam!> ✍️ |
20:12:45 | * | ltriant quit (Ping timeout: 260 seconds) |
20:35:54 | * | arkurious joined #nim |
20:36:41 | FromDiscord | <Yepoleb> federico3\: have you thought about packaging individual nim libraries for debian? |
20:38:19 | FromDiscord | <EyeCon> I'm on devel. Is it expected that `filename.lines` iterator skip over empty lines or am I doing something wrong? |
20:45:34 | FromDiscord | <pouriya.jamshidi> sent a code paste, see https://play.nim-lang.org/#ix=4imj |
20:46:19 | FromDiscord | <EyeCon> In reply to @pouriya.jamshidi "Hi I was": https://nim-lang.org/docs/strscans.html |
20:48:20 | FromDiscord | <j-james> In reply to @EyeCon "I'm on devel. Is": yes, it's expected |
20:49:03 | FromDiscord | <EyeCon> In reply to @apropos "yes, it's expected": Thanks, on to a custom line iterator then |
20:49:17 | FromDiscord | <EyeCon> 😔 |
20:51:37 | FromDiscord | <j-james> try `.splitLines()` |
20:55:06 | NimEventer | New thread by snej: Best practices for initializing objects?, see https://forum.nim-lang.org/t/9717 |
20:56:30 | FromDiscord | <j-james> curious if anyone's worked with npeg: can you return captures from child rules to the parent rule? |
20:57:09 | FromDiscord | <j-james> sent a code paste, see https://play.nim-lang.org/#ix=4imn |
21:06:30 | * | jmdaemon joined #nim |
21:09:54 | Zevv | j-james: drop the ">" before `success` and `failure` |
21:10:21 | Zevv | thes rules already capture whay you want, but you are also capturing the entire match of `success` and `failure` rules like this |
21:10:55 | Zevv | these end up in capture $2 and $4, but you do not want that |
21:11:23 | Zevv | http://ix.io/4imz |
21:18:53 | * | ltriant joined #nim |
21:26:27 | FromDiscord | <a weird programmer> is it worth disabling nim's gc and manually managing memory in long running rest api's? |
21:29:51 | FromDiscord | <Elegantbeef> Nope |
21:30:54 | FromDiscord | <jmgomez> How do you free strings/seqs when mm is none? |
21:31:10 | FromDiscord | <Elegantbeef> You dont |
21:31:27 | FromDiscord | <Elegantbeef> You use `--mm:arc` like a sane person |
21:31:36 | FromDiscord | <jmgomez> Yeah, I meant out of curiosity |
21:31:42 | FromDiscord | <jmgomez> Is there a mechanism? |
21:31:44 | FromDiscord | <Elegantbeef> There is no way of doing it |
21:31:52 | FromDiscord | <a weird programmer> what does --mm:arc do |
21:31:56 | FromDiscord | <Elegantbeef> Nim does not provide any method of reallocating them |
21:32:10 | FromDiscord | <Elegantbeef> It uses Nim's reference counting memory management |
21:32:18 | FromDiscord | <Elegantbeef> That has move semantics and all that jazz |
21:33:28 | FromDiscord | <jmgomez> In reply to @Elegantbeef "Nim does not provide": Hmm, and how do you suppose to instantiate a string literal if string cant be freed? |
21:33:36 | FromDiscord | <a weird programmer> is it the fastest out of all available nim GC? |
21:33:42 | FromDiscord | <Elegantbeef> string literals do not need to be freed |
21:33:53 | FromDiscord | <a weird programmer> plus from where is elegant beef talking to us why is he a bot |
21:33:56 | FromDiscord | <Elegantbeef> Automatic memory management is all tradeoffs |
21:34:02 | FromDiscord | <Elegantbeef> Arc is lower latency |
21:34:15 | FromDiscord | <Elegantbeef> Arc is also deterministic |
21:34:31 | FromDiscord | <a weird programmer> they say that most libs dont work well when disabling the GC |
21:34:34 | FromDiscord | <Elegantbeef> refc is higher latency, but has higher throughput and is not deterministic |
21:34:40 | FromDiscord | <Elegantbeef> Of course not |
21:34:43 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4imK |
21:34:43 | FromDiscord | <Elegantbeef> Most people write Nim, not C with a Nim skin |
21:35:03 | FromDiscord | <Elegantbeef> you'd make a compile time procedure |
21:35:03 | FromDiscord | <a weird programmer> the removal of the GC as whole would be better, doing something like rust's ownership would work well |
21:35:23 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4imL |
21:35:30 | FromDiscord | <Elegantbeef> Nim's refc is like Rust's ownership |
21:35:32 | FromDiscord | <Elegantbeef> I mean arc |
21:35:32 | FromDiscord | <Elegantbeef> Sorry |
21:35:48 | FromDiscord | <Elegantbeef> It's move semantic, scope based memory management |
21:35:56 | FromDiscord | <a weird programmer> so its like C++ smart pointers? |
21:36:01 | FromDiscord | <Elegantbeef> Yes |
21:36:05 | FromDiscord | <a weird programmer> and whats the default GC anyways |
21:36:12 | FromDiscord | <Elegantbeef> refc presently |
21:36:19 | FromDiscord | <Elegantbeef> when 2.0 releases Orc will be |
21:36:23 | FromDiscord | <Elegantbeef> Which is arc + a cycle collector |
21:36:31 | FromDiscord | <a weird programmer> so its better to switch to arc correct? |
21:37:00 | FromDiscord | <Elegantbeef> If you have no cycles and want a lower memory footprint, lower latency, and a better language |
21:37:03 | FromDiscord | <Elegantbeef> Otherwise you use orc |
21:37:48 | FromDiscord | <a weird programmer> as a python dev wtf am i doing asking about a GC |
21:38:00 | FromDiscord | <Elegantbeef> @jmgomez\: worth nothing with orc/arc string literals are actually COW, so it's bleh anyway 😄 |
21:38:04 | FromDiscord | <a weird programmer> its 100x faster than py |
21:38:04 | FromDiscord | <Elegantbeef> noting\ |
21:38:12 | FromDiscord | <Elegantbeef> The reason i'm a bot is cause i'm using matrix |
21:38:24 | FromDiscord | <a weird programmer> what is that |
21:38:40 | FromDiscord | <Elegantbeef> A open standard communication protocol |
21:38:53 | FromDiscord | <a weird programmer> like irc? |
21:39:05 | FromDiscord | <jmgomez> In reply to @Elegantbeef "<@726017160115126333>\: worth nothing with": Yeah, I was just curious, thanks! |
21:39:13 | FromDiscord | <Elegantbeef> Nah it's more modern |
21:39:37 | FromDiscord | <Elegantbeef> It has multi media, E2E encryption, and more |
21:39:45 | FromDiscord | <a weird programmer> why would one use it instead of discord? privacy reasons? |
21:40:05 | FromDiscord | <Elegantbeef> I dont like proprietary shitware |
21:40:08 | FromDiscord | <scruz> I wonder how replies on discord render in matrix |
21:40:17 | FromDiscord | <Elegantbeef> Depends on your client |
21:40:25 | FromDiscord | <Elegantbeef> They work generally fine on matrix |
21:40:26 | FromDiscord | <a weird programmer> In reply to @Elegantbeef "I dont like proprietary": debatable |
21:40:56 | FromDiscord | <leetnewb> matrix is also a full messaging platform that enables federation, can be self-hosted, allows e2ee |
21:41:18 | FromDiscord | <a weird programmer> so its not something central like discord |
21:41:30 | FromDiscord | <a weird programmer> i can run a server on a vps and call it a day |
21:41:36 | FromDiscord | <leetnewb> right |
21:41:40 | FromDiscord | <a weird programmer> neat |
21:42:22 | FromDiscord | <a weird programmer> mans probably running matrix + neovim + arch |
21:43:11 | FromDiscord | <Elegantbeef> I dont know why it's so weird to want to be able to control software |
21:43:16 | FromDiscord | <Elegantbeef> You cannot even change the theme of discord |
21:43:29 | FromDiscord | <Elegantbeef> But but better discord |
21:44:09 | FromDiscord | <a weird programmer> it is not weird but the thing with proprietary software that its paying people's bills |
21:44:27 | FromDiscord | <Elegantbeef> ...? |
21:44:29 | FromDiscord | <a weird programmer> the argument that i should only use FOSS would render my degree worthless |
21:44:40 | FromDiscord | <Elegantbeef> You do realise people make a living off FOSS right? |
21:44:45 | FromDiscord | <a weird programmer> No? |
21:44:47 | FromDiscord | <a weird programmer> since when |
21:44:50 | FromDiscord | <a weird programmer> and who |
21:45:53 | FromDiscord | <leetnewb> matrix devs |
21:45:55 | FromDiscord | <Elegantbeef> Many core developers of popular open source software |
21:46:02 | FromDiscord | <a weird programmer> such as who |
21:46:18 | FromDiscord | <Elegantbeef> The Nim core developers |
21:46:26 | FromDiscord | <Elegantbeef> Debian developers |
21:46:32 | FromDiscord | <a weird programmer> they arent making nearly as much as a regular joe shmoe working in a big tech company |
21:47:05 | FromDiscord | <Elegantbeef> Goalposts have moved |
21:47:24 | FromDiscord | <a weird programmer> whats that? |
21:47:38 | FromDiscord | <a weird programmer> metaphor? |
21:47:56 | FromDiscord | <Boston> Currently I use my degree to utilize FOSS at my job, I still make a living |
21:48:06 | FromDiscord | <a weird programmer> a living |
21:48:13 | FromDiscord | <Elegantbeef> Well matrix is an open standard and a lot of work is being done by a for profit group named, but their software is still open source↵(@leetnewb) |
21:48:23 | FromDiscord | <Elegantbeef> I dont get why people act like FOSS cannot be profitable |
21:48:24 | FromDiscord | <Boston> In reply to @a weird programmer "a *living*": Well above average for my area |
21:48:50 | FromDiscord | <a weird programmer> In reply to @Elegantbeef "I dont get why": because it is free software, most people think that if its free then the devs can fuck themselves |
21:49:04 | FromDiscord | <Elegantbeef> Well that's wrong |
21:49:13 | FromDiscord | <Elegantbeef> Many people donate to FOSS projects and contribute to them |
21:49:52 | FromDiscord | <Boston> Wait a minute, isn't Nim foss |
21:50:12 | FromDiscord | <Boston> 🤔 |
21:50:17 | FromDiscord | <a weird programmer> and i am not talking about a programmer who understands what FOSS is. Most people do not care about what their software is built with (non tech people) so they'd gladly pay whatever to a large corp and consume their products |
21:50:18 | FromDiscord | <Elegantbeef> It is FOSS |
21:50:41 | FromDiscord | <Elegantbeef> You do realise Aseprite is FOSS but is also well supported |
21:50:53 | FromDiscord | <a weird programmer> Aseprite is a proprietary, source-available image editor designed primarily for pixel art drawing and animation. It runs on Windows, macOS, and Linux, and features different tools for image and animation editing such as layers, frames, tilemap support, command-line interface, Lua scripting, among others. Wikipedia |
21:50:55 | FromDiscord | <sOkam!> In reply to @Elegantbeef "I dont get why": ignorance |
21:51:00 | FromDiscord | <a weird programmer> proprietary |
21:51:12 | FromDiscord | <Boston> My man |
21:52:21 | FromDiscord | <a weird programmer> In reply to @Elegantbeef "I dont get why": its gonna stay that way for a long long time, the issue is not with people who realize what FOSS is, the issue is with people who dont know something called FOSS at all. |
21:52:23 | FromDiscord | <Boston> Foss also works great when you can sell it with something |
21:52:28 | FromDiscord | <Boston> Android for example |
21:52:46 | FromDiscord | <a weird programmer> dont see the core android devs getting rich |
21:52:49 | FromDiscord | <Elegantbeef> Aseprite is an iffy one since the source is available freely, but it's license restricts redistribution |
21:53:26 | FromDiscord | <Yepoleb> the core android devs probably aren't any poorer than a developer working on google's proprietary projects |
21:53:28 | FromDiscord | <a weird programmer> In reply to @Elegantbeef "Aseprite is an iffy": something like QT5? |
21:53:52 | FromDiscord | <Boston> Core android devs make more than you, I'd bet on that |
21:53:53 | FromDiscord | <Elegantbeef> https://github.com/aseprite/aseprite/blob/main/EULA.txt |
21:54:00 | FromDiscord | <Elegantbeef> Read the license and decide for yourself |
21:55:45 | FromDiscord | <a weird programmer> At the end of the day, i am a programmer. And i want to get paid as much as possible and i do not care about the bureaucracy that comes with it. Why should i care if i support open source or not? if its on my free time i'd gladly audit code and help with it as much as possible but speaking about money wise its more viable to stick with a MAANG company and get paid as much as i can |
21:55:50 | FromDiscord | <Elegantbeef> The world is built on FOSS is all i'll conclude with |
21:55:58 | FromDiscord | <a weird programmer> I know |
21:56:42 | FromDiscord | <leetnewb> I'd just add that we benefit from communications stacks being open |
21:56:51 | FromDiscord | <scruz> #offtopic |
21:57:01 | FromDiscord | <a weird programmer> too late scruz |
21:57:05 | FromDiscord | <a weird programmer> begone |
21:57:36 | FromDiscord | <scruz> I know, but it's best not to flood channel even more this with your illogical statements |
21:57:44 | FromDiscord | <scruz> (edit) "I know, but it's best not to flood ... channel" added "this" |
21:58:00 | FromDiscord | <a weird programmer> you are clearly biased towards proprietary software |
21:58:09 | FromDiscord | <Elegantbeef> Why you got so uppity about my view is beyond me |
21:58:10 | FromDiscord | <Elegantbeef> This after all started after I said I dislike discord being proprietary |
21:58:10 | FromDiscord | <Yepoleb> thanks for caring about open source |
21:58:10 | FromDiscord | <scruz> no I'm not |
21:58:30 | FromDiscord | <scruz> (edit) removed "this" |
21:58:43 | FromDiscord | <scruz> I use both type of softwares |
21:58:52 | FromDiscord | <scruz> Don't have any special feeling towards both |
21:58:57 | FromDiscord | <Yepoleb> are you an oracle lawyer?↵(@a weird programmer) |
21:59:03 | FromDiscord | <scruz> Anyways, #offtopic |
21:59:10 | FromDiscord | <a weird programmer> No i hate oracle |
21:59:21 | FromDiscord | <Elegantbeef> Scruz do you have any Nim related question? 😄 |
21:59:53 | FromDiscord | <a weird programmer> scruz wants to silence our lovely discussion |
22:00:08 | FromDiscord | <Elegantbeef> They literally just said go to offtopic |
22:00:25 | FromDiscord | <a weird programmer> sure #offtopic |
22:00:32 | FromDiscord | <Elegantbeef> I'd tell you to stop being a contrarian but you'd probably say "No" |
22:09:32 | FromDiscord | <Phil> In reply to @a weird programmer "is it worth disabling": Unless you're running into the weirdest and insanest of edgecases I'm willing to bet my ass that you'll never run into a scenario where you actually need to care, performance wise, what memory management type you're using.↵And if you do that likely should be a separate program because it's apparently doing insanely intense calculations on the fly and fast enough to be worth its own |
22:10:46 | FromDiscord | <a weird programmer> xD fair |
22:10:49 | FromDiscord | <Phil> You can comfortably reach levels where network latency easily makes up 40%+ of your entire time to response, even if the server is in the same country.↵At that point you're optimizing for individual miliseconds |
22:11:32 | FromDiscord | <Rika> In reply to @Isofruit "You can comfortably reach": Maybe even if the users had been in the same building it would be true |
22:25:58 | * | ltriant quit (Ping timeout: 256 seconds) |
22:27:52 | * | ltriant joined #nim |
22:34:59 | * | adium quit (Quit: Stable ZNC by #bnc4you) |
22:42:40 | * | junaid_ joined #nim |
22:45:54 | * | junaid__ joined #nim |
22:49:08 | * | junaid__ quit (Remote host closed the connection) |
22:49:08 | * | junaid_ quit (Remote host closed the connection) |
22:50:03 | FromDiscord | <j-james> Zevv: tysm, that worked 👍 |
22:50:10 | FromDiscord | <j-james> thanks for the excellent library |
23:31:14 | * | jkl quit (Quit: Gone.) |
23:32:52 | * | jkl joined #nim |
23:35:38 | FromDiscord | <Horizon [She/Her]> In reply to @Elegantbeef "This after all started": Agreed, and while it's not the same: Fosscord exists? A reimpl of discord |
23:38:21 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
23:39:59 | FromDiscord | <Elegantbeef> And it's against their TOS |
23:40:52 | FromDiscord | <Rika> It isn’t |
23:41:00 | FromDiscord | <Rika> It’s a whole reimplementation down to the servers |
23:41:13 | FromDiscord | <Elegantbeef> So it's pointless |
23:41:28 | FromDiscord | <Rika> It is technically against if you use it to connect to discord but otherwise no |
23:41:33 | FromDiscord | <Elegantbeef> I was thinking it was along the lines of gtkcord or ripcord |
23:41:53 | FromDiscord | <Rika> It’s half |
23:42:33 | * | Lord_Nightmare joined #nim |
23:42:43 | FromDiscord | <Elegantbeef> I dont really see the benefit in yet another protocol |
23:48:15 | FromDiscord | <Rika> Ain’t got anything to say about that lol |
23:56:20 | FromDiscord | <Yepoleb> the protocol already exists anyway and is in use, at least it has an open implementation now |