<< 03-06-2022 >>

00:00:00FromDiscord<IzanamiのMegumi> sent a long message, see http://ix.io/3Zf3
00:00:06FromDiscord<IzanamiのMegumi> will return 02468
00:00:07FromDiscord<IzanamiのMegumi> and
00:00:44FromDiscord<IzanamiのMegumi> sent a long message, see https://paste.rs/GkE
00:00:59FromDiscord<IzanamiのMegumi> (edit) "https://paste.rs/LxE" => "http://ix.io/3Zf5"
00:01:06FromDiscord<Elegantbeef> Yes code is order dependant 😄
00:01:14FromDiscord<IzanamiのMegumi> (edit) "http://ix.io/3Zf5" => "http://ix.io/3Zf6"
00:01:26FromDiscord<IzanamiのMegumi> (edit) "http://ix.io/3Zf7" => "https://paste.rs/PfV"
00:01:28FromDiscord<IzanamiのMegumi> (edit) "http://ix.io/3Zf6" => "https://paste.rs/kY7"
00:02:05FromDiscord<IzanamiのMegumi> why didn't it return 10 in the first time though?
00:02:25FromDiscord<Elegantbeef> cause it increments and then checks it
00:03:33FromDiscord<Elegantbeef> The while loop doesnt exist when the value meets 10 it exits after the iteration finishes and the value hits 10
00:26:41FromDiscord<sOkam!> In reply to @Patitotective "https://github.com/Patitotective/ImTemplate hehe": handy ✍️
00:31:22*lumo_e joined #nim
00:31:52*vicfred quit (Quit: Leaving)
00:35:42FromDiscord<sOkam!> Is there any nice database type to use with nim?
00:54:37FromDiscord<Andreas> hi, i have C-fn `set_pointer(T a, T b)` and for b i can give it a `nim_var.unsafeAddr` and for a it expect a pointer-to-a-pointer ? how is that doable in Nim ?
00:54:44FromDiscord<Andreas> (edit) "expect" => "expects"
00:55:01FromDiscord<Andreas> (edit) "b" => "`b`"
00:55:27FromDiscord<Andreas> (edit) "a" => "`a`"
01:40:50*lumo_e quit (Quit: Quit)
01:42:11FromDiscord<Zectbumo> In reply to @ss219 "Do you think long": I'm fairly new and I see great potential here
01:43:40FromDiscord<demotomohiro> In reply to @Andreas "hi, i have C-fn": You can declare a pointer like `var p: ptr T` and pass it to the function with `p.addr`.
02:00:54FromDiscord<Yepoleb> sent a code paste, see https://play.nim-lang.org/#ix=3Zfo
02:01:13FromDiscord<Elegantbeef> `uniform[: Mat4f]`
02:02:37FromDiscord<Yepoleb> In reply to @Elegantbeef "`uniform[: Mat4f]`": thanks, what syntax magic is this?
02:03:19FromDiscord<Andreas> In reply to @demotomohiro "You can declare a": ty, tried that before, but cannot keep that 'var ptr T' around - the C-fns purpose is to exchange b with a - the double-indirection has smth. to do with generics, that i don't understand.
02:04:10FromDiscord<Elegantbeef> `The method call syntax conflicts with explicit generic instantiations: p[T](x) cannot be written as x.p[T] because x.p[T] is always parsed as (x.p)[T]`↵https://nim-lang.org/docs/manual.html#procedures-method-call-syntax
02:07:52FromDiscord<Yepoleb> thanks!
02:08:07FromDiscord<Yepoleb> sorry for not reading the manual
02:21:36FromDiscord<Elegantbeef> Hey dont apologize it's learning!
02:29:33FromDiscord<demotomohiro> @Yepoleb Many people asked the same quesion here.
02:31:00FromDiscord<demotomohiro> Many people encouter `x.p[:T](a)` trap.
02:35:22FromDiscord<demotomohiro> If Nim used unicode parenthesis like '【' and '】' for generics instead of '[' and ']', we don't need to add `:` in generic parameter.↵In Vim, you can type '【' with `ctrl+k ("` in insert mode.
02:36:41FromDiscord<Elegantbeef> Most people dont have a way to easily write unicode so i mean you're right but it makes life a bit more tedious
02:37:17FromDiscord<Yepoleb> Unicode outside string literals is kinda asking for trouble
02:37:40FromDiscord<Elegantbeef> Like since i write english and have a NA keyboard i'm fucking lost to write the unicode operators, since there is no ergonomic way
02:38:02FromDiscord<Elegantbeef> Yes yes i can memorize the code point and type
02:38:07FromDiscord<Korven> that'd just be extra work for no reason methinks
02:38:15FromDiscord<Elegantbeef> I agree
02:38:24FromDiscord<Elegantbeef> It's a nice idea to remove the ambiguity but it's much more work
02:38:37FromDiscord<Elegantbeef> One could just use `<>` for generics and it also solves it
02:38:45FromDiscord<Korven> ye true
02:38:49FromDiscord<Yepoleb> A custom compose key combination would make it easier
02:39:01FromDiscord<Yepoleb> But that's a bit of work to set up
02:39:05FromDiscord<Korven> kinda always have associated generics with angled brackets
02:39:10FromDiscord<Elegantbeef> Oh of course, but how many people are going to have that setup 😄
02:39:37FromDiscord<Elegantbeef> Given `{}` is hardly ever used could use a macro for that and dont need compiler support
02:40:25FromDiscord<demotomohiro> '<' and '>' are used as binary operator. Im not they can really fix the issue.
02:40:30FromDiscord<Elegantbeef> `result.thingy.uniform{myGeneric}("proj")` would turn it into the `uniform[myGeneric](result.thingy, "proj")`
02:40:44FromDiscord<Elegantbeef> Where are they used for binary operators in Nim?
02:40:56FromDiscord<Elegantbeef> `<>` are used for comparisons in Nim
02:41:13FromDiscord<Yepoleb> I think it's not a big issue if the user knows about it
02:41:28FromDiscord<Yepoleb> It's ugly 🤷
02:41:30FromDiscord<Elegantbeef> I know it's very NA thing for me to say but i really dont want to use a language that requires a keyboard setup 😄
02:42:17FromDiscord<Elegantbeef> The unicode operators i understand since they're uncommon math/science related things, but unicode in the language's common syntax is just tedium, but ymmv
02:42:21FromDiscord<demotomohiro> `a < b and c > d()`.
02:42:30FromDiscord<Korven> maybe it's time a new pair of brackets was invented
02:42:41FromDiscord<Korven> haven't had a new one in quite a while🤔
02:43:05FromDiscord<Korven> would suffer the same setup problem ofc, but it's be quite cool
02:43:40FromDiscord<Elegantbeef> I guess i have a 70% keyboard so i could use my f-keys for unicode brackets
02:43:55FromDiscord<Elegantbeef> But think about those with 60% or even 50%s 😄
02:44:06FromDiscord<Elegantbeef> They already have to hit 3 button combinations just to go to end of line
02:44:10FromDiscord<Yepoleb> I have added "write a compiler hint about method syntax with generics" to my todo-when-i-got-gud list, that's probably the best fix for now
02:44:38FromDiscord<Yepoleb> In reply to @Elegantbeef "They already have to": That's their fetish
02:44:38FromDiscord<demotomohiro> Remove reraly used charactor from ascii code and add new parenthesis like charactor and create corresponding keyboard standard :p.
02:44:58FromDiscord<Yepoleb> So many control characters to recycle
02:45:13FromDiscord<Elegantbeef> Demo do i get a free new set of keycaps?!
02:45:34FromDiscord<Yepoleb> You get a set of stickers
02:45:49FromDiscord<Yepoleb> Or a pdf you can print
02:46:05FromDiscord<Yepoleb> And glue on with epoxy
02:47:26FromDiscord<Korven> In reply to @Elegantbeef "They already have to": untrue sire XD maybe it's cuz of my emacs keybinds tho
02:47:46FromDiscord<Korven> i have a 60%
02:48:37FromDiscord<Yepoleb> Le emacs user has arrived
02:54:12FromDiscord<demotomohiro> @Elegantbeef pick keycaps you want from here: https://shop.yushakobo.jp/collections/artisan-keycaps
02:54:37FromDiscord<Elegantbeef> I'd rather go get razer blades and tape them to my key stems
02:54:41FromDiscord<huantian> I hear keyboard I have been summoned
02:55:15FromDiscord<Andreas> sent a code paste, see https://play.nim-lang.org/#ix=3Zfu
02:55:49FromDiscord<Andreas> (edit) "https://play.nim-lang.org/#ix=3Zfu" => "https://paste.rs/z0D"
02:56:06FromDiscord<Andreas> (edit) "https://play.nim-lang.org/#ix=3Zfv" => "https://paste.rs/3B6"
02:56:11FromDiscord<Elegantbeef> Fuck i only have a mechanical keyboard due to my friend giving me one
02:56:43FromDiscord<Andreas> (edit) "https://play.nim-lang.org/#ix=3Zfx" => "https://play.nim-lang.org/#ix=3Zfw"
02:57:10FromDiscord<huantian> I kinda wanna build a Sofie v2 https://josefadamcik.github.io/SofleKeyboard/
02:57:24FromDiscord<huantian> what kinda retro looking? Like MT3 style retro?
02:58:45FromDiscord<Elegantbeef> Commedore keycaps mostly 😄
02:58:52FromDiscord<huantian> actually I was also thinking of getting qpbd terminal, I kinda like the aesthetic↵https://vala.supply/collections/keycap-sets/products/qpbt-terminal
02:59:17FromDiscord<demotomohiro> @Andreas `T` in that function signature should represent some type.
02:59:37FromDiscord<Elegantbeef> But i'm not one that really cares
03:00:19FromDiscord<huantian> MT3 is made to be similar to that old style of keycap https://drop.com/buy/drop-mt3-white-on-black-keycap-set
03:00:37FromDiscord<huantian> this is kinda off topic lol
03:00:45FromDiscord<Elegantbeef> "kinda"
03:01:56FromDiscord<demotomohiro> @Andreas Is that C library actually have a such function and type T?
03:10:18FromDiscord<Andreas> In reply to @demotomohiro "<@754284517316886598> Is that C": no, that C-lib accepts anything that i throw at it, any T seems to be ok - and this for sure can't be true. The fn `set_pointer( a, b)` does a simple pointer-exchange `a = b` the double-star has smth. todo with C-generics. When i pass in my `a`(ptr to old value) and `b`(ptr to new value) values then i end up with a empty `a`. It's not `nil` - the type is correct, the result
03:11:12FromDiscord<Andreas> (edit) "values" => "-values" | "-valuesthen i end up with a empty `a`. It's not `nil` - the type is correct, the result is kinda ... `new(a)`in" added "doing" | "then i end up with a empty `a`. It's not `nil` - the type is correct, the result is kindadoing`new(a)` ... ?" added "in nim."
03:17:18FromDiscord<demotomohiro> So `set_pointer` actually do `a = b;`?
03:20:03FromDiscord<demotomohiro> Most of C functions use pointer to pointer parameter like `T a` to create a new `T` and write an address of it to `a`.
03:21:44FromDiscord<Andreas> In reply to @demotomohiro "So `set_pointer` actually do": `a` and `b` are of the same type `ref-object`s. in nim i's do `a=b`. The C-fn is supposed to do the same - without any knowledge of my nim-types. and if the C-fn would take two pointers `set_pointer( a, b)` all would be fine - but the `` ptr-to-ptr is smth i cannot provide and it must have some relevance i don't get..
03:22:26FromDiscord<Elegantbeef> pointer to pointer is generally an array of arrays if my C knowledge remembers correctly
03:23:07FromDiscord<Andreas> (edit) "i's" => "i'd"
03:23:58FromDiscord<huantian> or a pointer to an array sometimes
03:24:23FromDiscord<demotomohiro> Pointer in C can point to single variable or array.
03:24:42FromDiscord<huantian> I think in this case you pass a pointer to the pointer that you want to be changed
03:28:33FromDiscord<demotomohiro> If that pointer to pointer is not used for passing array of pointer or array of array, I only know `var a: ptr T; set_pointer(a.addr, b.addr)`.
03:28:51FromDiscord<Andreas> In reply to @demotomohiro "Most of C functions": so then i should pass-in a constructor ? in a closure, so that the value arrives..
03:29:25FromDiscord<huantian> agah
03:29:31FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=3ZfD
03:29:34FromDiscord<demotomohiro> @Andreas Please tell us URL of the C library you are talking.
03:29:52FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=3ZfE
03:30:52FromDiscord<Andreas> its the RCU-lib here https://lwn.net/Articles/573439/#qq2answer in the section "URCU read-side API", 2-nd page
03:31:19FromDiscord<Andreas> (edit) "read-side" => "update-side"
03:32:00FromDiscord<Andreas> (edit) "page" => "page, points 5/6/7"
03:40:12FromDiscord<demotomohiro> It is hard to understand about c function and how to use it correclty only from C function signature and small part of text. I need to read whole manual of the c libaray to fully understsnd what you are talking :(.
03:49:15FromDiscord<Andreas> In reply to @demotomohiro "It is hard to": the purpose of this pointer-exchange is a simple atomic(in most cases, depens on the platform)-swap and to make the lib aware that there was a change. I can do the exchange in nim, but then then the rcu-lib would not know about it.
03:49:30FromDiscord<Andreas> (edit) "depens" => "depends"
03:51:57FromDiscord<demotomohiro> I dont know whether URCU-library works safely with Nim' ref types or are you trying manual memory management?
03:55:12FromDiscord<Andreas> In reply to @demotomohiro "I dont know whether": that lib is supposed to be agnostic of user-types - it's purpose is to notice changes (anonymous types = pointers ) which are published/announced by the provided user-facing-API.
04:06:18FromDiscord<demotomohiro> Why do you need to URCU library?
04:08:46FromDiscord<Andreas> In reply to @demotomohiro "Why do you need": it enables lockless concurrent data-structures and is battle-tested since 2002. I'm working on a tree-structure and to enable lockless-reads from multiple threads, i thought URCU could be a good fit.
04:25:42FromDiscord<demotomohiro> Are you trying to use URCU with Nim's ref types?
04:28:49FromDiscord<demotomohiro> If both `a` and `b` are ref types, `a = b` do not only copy pointer but also increment ref counts.↵If you copy ref types with C function, it can copy poitner but doesn't increment ref count.↵So it can cause memory leak or read after free.
04:29:06FromDiscord<Andreas> In reply to @demotomohiro "Are you trying to": well in my first test yes, `ref object` i follow the idea of a naive linked-list, which is more or or less a chain of ref-objects (no buckets, slots etc). just to simulate a couple of reader-threads that read random part while at the same time a writer-thread makes insertions or removes cells from the chain. That would be completly lock-less..
04:30:52FromDiscord<demotomohiro> So you might need to do manual memory management if you use URCU with Nim.
04:31:20FromDiscord<Andreas> In reply to @demotomohiro "If both `a` and": my initial problem was that nim's GC was too quick in disposing objects. So i found GC_ref to mark them as "please don't release them right now" and later use GC_unref to release..
04:31:55FromDiscord<Elegantbeef> Yea gcref can approximate manual memory management
04:32:50*fallback quit (Ping timeout: 260 seconds)
04:33:25FromDiscord<demotomohiro> GC_ref/GC_unref allows C code to hold ref types even when last ref variable in Nim get out from the scope.
04:33:43FromDiscord<Andreas> In reply to @demotomohiro "So you might need": the lib offers a call-back solution - basically passing nim's free-proc or destroy-proc to the lib and then it will care for the deferred disposal.. But yes i had manual-memory-mgmt on my mind - maybe later..
04:43:49FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=3ZfO
04:49:05FromDiscord<Andreas> In reply to @demotomohiro "If I understand correctly,": thx, that did the trick..
04:49:32*fallback joined #nim
04:50:46FromDiscord<Andreas> (edit) "In reply to @demotomohiro "If I understand correctly,": thx, that did the trick.. ... " added "- man great, ty"
04:51:46FromDiscord<demotomohiro> Maybe you dont't need to call `GC_ref/GC_unref` if `b` exists while `a` is used.
04:59:43FromDiscord<Andreas> sent a long message, see https://paste.rs/598
05:00:52FromDiscord<Andreas> (edit) "http://ix.io/3ZfQ" => "http://ix.io/3ZfP"
05:04:54*rockcavera quit (Remote host closed the connection)
05:14:34*rockcavera joined #nim
05:14:34*rockcavera quit (Changing host)
05:14:34*rockcavera joined #nim
06:36:41*jjido joined #nim
07:02:02*gsalazar joined #nim
07:04:49FromDiscord<Korven> What's the go to plugin for Nim on Sublime Text? I'm looking at the wiki and I see two options. The `nimlsp` github mentions that we should use `NimLime`, but the other one on the wiki, `SublimeNim`, is for Sublime Text 4.
07:04:58FromDiscord<Korven> any ideas? 🤔
07:12:18*dtomato joined #nim
07:12:38FromDiscord<huantian> Is sublime 4 an old version of sublime?
07:12:53FromDiscord<Elegantbeef> new
07:19:30FromDiscord<Korven> it's the latest release
07:19:57FromDiscord<Korven> I do intend to run ST4
07:23:29*PMunch joined #nim
07:23:53FromDiscord<uncle jim> PIL:python::pixie:nim?
07:30:07*ltriant quit (Ping timeout: 240 seconds)
07:37:14FromDiscord<j-james> in terms of features, no, i believe pixie has a wider scope (ex. typesetting)
07:37:38FromDiscord<j-james> in terms of being the best imaging library for the language yes
07:41:18*xet7 quit (Remote host closed the connection)
07:42:28*xet7 joined #nim
08:01:26PMunchHmm, what is the state of Android app development in Nim nowadays? Haven't really heard a lot about it lately
08:12:30PMunchThis certainly looks like a way that could work: https://github.com/marcomq/nimview
08:13:44PMunchOr this: https://github.com/akavel/hellomello, but I don't think that has any usable UI stuff at the moment (although maybe both could be combined to use a webview but still no Android Studio)
08:29:32FromDiscord<j-james> what's the state of android app development in non-jvm languages (aside from react and dart)?
08:31:26FromDiscord<j-james> i always thought you had to interface with java at a pretty low level
08:38:11PMunchWell
08:38:31PMunchThere is the Android NDK (Native Development Kit) which is meant to write native code for Java apps
08:39:44PMunchI've written a game in Nim which ran on Android before, that was using Nim with SDL2 through the NDK and a thin Android shim which was basically just setting up a canvas and hooking into some events and passing everything along to the NDK
08:40:21PMunchhttps://github.com/akavel/hellomello <- This seems to bypass the Java code somehow, which is neat
08:41:21PMunchSo if it is possible to set up a webview using nothing but the JNI (Java Native Interface, part of the NDK) then you could have a kind-of pure Nim application with Nim code driving the webpage for the UI
08:42:10PMunchOf course if it is possible to set up the webview it is also possible to set up the Android UI stuff, which means you technically don't need the web-stuff. But I'm guessing that it's more comfortable to use that than to work with the Android UI through the JNI..
08:44:25*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
08:58:11NimEventerNew post on r/nim by dsrw: Inky: Isolation. A 90 minute game built with Enu, Nim and Godot, see https://reddit.com/r/nim/comments/v3v5fj/inky_isolation_a_90_minute_game_built_with_enu/
09:08:36FromDiscord<uncle jim> sent a code paste, see https://paste.rs/7I2
09:09:26FromDiscord<Elegantbeef> you dont have an image variable
09:09:59FromDiscord<uncle jim> In reply to @Elegantbeef "you dont have an": oh
09:11:05FromDiscord<uncle jim> and what should be in the `image` variable?
09:11:20FromDiscord<Elegantbeef> It should be an image?
09:11:29FromDiscord<uncle jim> In reply to @Elegantbeef "It should be an": a string?
09:11:42FromDiscord<Elegantbeef> `let image = newImage(256, 256)`
09:11:50FromDiscord<uncle jim> bruh
09:12:13FromDiscord<Elegantbeef> https://github.com/treeform/pixie/blob/master/examples/square.nim
09:18:07FromDiscord<luteva> Hi! I am thinking about solution that can be used to do complex calculations (e.g. video processing) in the user's browser with webassembly and continiously transfers the processed data to a server. Then, whenever the connection gets lost, the server continues the work (at the point the connection was lost).↵Are there any solutions (libraries or whatever) that face this situation? Any ideas, links or info?
09:18:10*jmdaemon quit (Ping timeout: 244 seconds)
09:18:37FromDiscord<luteva> (edit) "lost," => "lost (or processing is too slow),"
09:26:02*jjido joined #nim
09:27:32FromDiscord<voidwalker> distributed video encoding ?
09:42:29*ltriant joined #nim
09:44:11FromDiscord<luteva> yes kind of...
09:44:32*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
09:46:02FromDiscord<luteva> the main thing is not the distribution but trying to do the work on the client and having a failover on the server.
09:46:36FromDiscord<voidwalker> 1 server, how many clients, how many concurrent "works" ?
09:46:57FromDiscord<luteva> and all that in webassembly in the browser and (for the failover) on the server
09:48:33FromDiscord<luteva> each video being processed in one client browser only (so no distribution is needed, here). but one the client closes the connection, the work should continue on a server
09:49:00FromDiscord<voidwalker> yes, but if 100 clients close the connection, the server will get overwhelmed, so it has to be distributed, or queued
09:50:49FromDiscord<luteva> yes of course. but this is not the problem i am facing now. there are dozens of servers ready for taking over the work. but they shouldn't be used, unless a clients connection is closed.
09:51:56FromDiscord<luteva> the idea is to use the clients resources whenver possible and only use the servers resources when necessary
10:00:24*arkurious joined #nim
10:04:19*xet7 quit (Remote host closed the connection)
10:36:13FromDiscord<Korven> that feels like abusing client resources. while I understand it's possible to use client resources since they are just there, it sucks to see a tab take lots of resources up 🤔
10:49:50FromDiscord<luteva> sent a long message, see https://paste.rs/Hsx
10:53:21FromDiscord<luteva> this of course implies that the computation already being done (like the first few minutes of an edited video clip) must be transferred to the server continiously.
10:53:52FromDiscord<Korven> or some sort of checksum/track of how far the computation has progressed
10:57:10FromDiscord<luteva> well in my case, not just a checksum must be transferred but the clip itself. as the whole video clip must be on the server when the computation has finished. as the clip then needs to be transferred to the TV studio and/or social media channels (and more)....
10:57:41FromDiscord<luteva> (edit) "studio" => "station/studio"
11:36:26NimEventerNew thread by Georgeethan: What are the best hosting companies to host systems written in the Nim language?, see https://forum.nim-lang.org/t/9196
11:38:52FromDiscord<voidwalker> What a nonsensical question
11:44:27PMunchIt's not so strange if you consider that they're coming from Wordpress
11:50:28NimEventerNew thread by Georgeethan: Where can I find information about Nim architecture? , see https://forum.nim-lang.org/t/9197
12:23:45FromDiscord<enthus1ast> Video encoding in js?? Total waste of resources imho↵(@Korven)
12:24:14FromDiscord<Korven> where'd js come from :o
12:25:26*xet7 joined #nim
12:25:53FromDiscord<Rika> he said wasm afaik
12:26:12FromDiscord<Korven> ah yeah he did
12:27:06FromDiscord<enthus1ast> is wasm significant faster? Compared to a tuned state of the art video codec?
12:28:12FromDiscord<Rika> no
12:28:19FromDiscord<Korven> it won't be as fast as encoding it on a GPU, or something of the sort, per se
12:28:20FromDiscord<Rika> wasm is ofc not as fast as native so
12:28:22FromDiscord<Korven> but faster than js aye
12:28:38FromDiscord<enthus1ast> what i mean is, there are encoder chips on most machines, that are blazingly fast
12:34:46*tiorock joined #nim
12:34:46*tiorock quit (Changing host)
12:34:46*tiorock joined #nim
12:34:46*rockcavera quit (Killed (silver.libera.chat (Nickname regained by services)))
12:34:46*tiorock is now known as rockcavera
13:04:24FromDiscord<windowsboy111> someone might need to update the fedora installation thing on the website
13:04:49FromDiscord<windowsboy111> last update on the package was like 4 years ago
13:13:32*om3ga quit (Quit: Bye)
13:18:12*vicfred joined #nim
13:22:37*Guest72 joined #nim
13:28:11*jjido joined #nim
13:33:10Guest72(help for noob). hello, I have an array of objects. each obj contains a thread. I want to joinThreads(objs.map(x => x.thr)). I get the error '=copy' is not available for type <Thread>. joinThreads(objs.[0].thr, objs.[1].thr) works. Any ideas?
13:36:57*xet7 quit (Read error: Connection reset by peer)
13:43:22*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
13:50:19FromDiscord<qb> Nims equivalent to `for (int i = 0; i < 360; i += 10)` would be `for i in countUp(0, 360, 10)` right?
13:51:37FromDiscord<Yardanico> @qb no, countup is inclusive
13:51:42FromDiscord<Yardanico> so it'll also return 360 for your expression
13:51:47FromDiscord<Yardanico> so you probably want 359 instead
13:55:06FromDiscord<Rika> I eluded to that when he accidentally posted in #jobs
13:55:11FromDiscord<Rika> :XD:
13:56:13FromDiscord<demotomohiro> @Guest72 `Thread` type is uncopyable and you cannot create a seq of Thread from a seq objects containing Thread. I think you need to change data structure that separate seq of object and seq of Thread.
13:59:06FromDiscord<br4n_d0n> Is the plan for Nim to always use a third party compiler?
13:59:10Guest72demotomohiro: as a 'workaround', I just use a for loop and call joinThread (this is what joinThreads does). Changing the structure is not a good solution. A collection of objects containing threads is perfectly good data structure desing imho.
13:59:33FromDiscord<Rika> In reply to @br4n_d0n "Is the plan for": I believe so
14:00:05FromDiscord<Rika> Most languages do though I believe
14:01:59*PMunch quit (Quit: Leaving)
14:05:53FromDiscord<nwilburn> sent a code paste, see https://paste.rs/MPa
14:06:41FromDiscord<Rika> Procedures don’t use : for keyword arguments
14:06:44FromDiscord<Rika> Use =
14:07:02FromDiscord<Yardanico> @Rika no, that's correct usage
14:07:08FromDiscord<Yardanico> you can specify the type even if you specify the default value
14:07:21FromDiscord<Rika> ? Look at the last line?
14:07:27FromDiscord<Yardanico> yeah, i thought you meant the proc sig :)
14:07:31FromDiscord<Yardanico> then you're right
14:07:49FromDiscord<nwilburn> oh damnit
14:07:50FromDiscord<Prestige> I've always found that a bit weird tbh
14:07:50FromDiscord<nwilburn> thanks guys
14:07:52FromDiscord<Yardanico> @nwilburn in nim `:` is used in object and table construction syntax, not in proc calls
14:09:11FromDiscord<br4n_d0n> The other day I found that someone thinks Nim is a "toy" programming language because "it's a pre-processor over the C compiler" and I don't quite get that
14:09:49FromDiscord<Yardanico> In reply to @br4n_d0n "The other day I": yeah, that's totally false
14:09:51FromDiscord<Prestige> bad opinion, really
14:10:14FromDiscord<Yardanico> Nim treats C like a proper backend, there's even nlvm which is an LLVM backend for Nim, and it only adds a couple patches on top of the nim compiler frontend
14:13:14FromDiscord<Rika> In reply to @br4n_d0n "The other day I": Yeah and C is a preprocessor over assembly
14:16:57FromDiscord<d4rckh> if i have↵`
14:17:56FromDiscord<d4rckh> sent a code paste, see https://paste.rs/9gs
14:18:10FromDiscord<d4rckh> (edit) "https://play.nim-lang.org/#ix=3ZhL" => "https://paste.rs/7lL"
14:19:35FromDiscord<Rika> Deep or shallow?
14:20:05FromDiscord<demotomohiro> You want to do `a1[] = a2[]`?
14:20:17FromDiscord<d4rckh> yes
14:20:56FromDiscord<d4rckh> In reply to @Rika "Deep or shallow?": deep
14:20:58FromDiscord<Rika> If there is a reference in the fields then the reference won’t be copied deeply
14:21:14FromDiscord<Rika> In reply to @demotomohiro "You want to do": Given this, I mean
14:21:38FromDiscord<d4rckh> In reply to @Rika "If there is a": thats ok
14:21:47FromDiscord<Rika> Then you want shallow
14:22:41FromDiscord<d4rckh> In reply to @demotomohiro "You want to do": is this the right way of doing it?
14:23:13FromDiscord<enthus1ast> with this logic typescript is also a toy since its just a preprocessor over js↵(@br4n_d0n)
14:23:33FromDiscord<enthus1ast> i mean who cares really, its just a tool to get things done
14:23:40FromDiscord<demotomohiro> It works as if a1.x = a2.x for each fields.
14:24:26FromDiscord<demotomohiro> But if they have ref type field, it is not deeply copied.
14:24:58FromDiscord<d4rckh> thanks
14:24:58FromDiscord<d4rckh> that worked
14:26:18FromDiscord<demotomohiro> There is deepCopy proc: https://nim-lang.org/docs/system.html#deepCopy%2CT%2CT
14:40:39FromDiscord<d4rckh> hmm
14:42:25FromDiscord<Geiseric> sent a code paste, see https://paste.rs/dR3
14:42:59FromDiscord<Geiseric> The compilenim contains the following and it's a bash script: `nim c -d:release -d:danger --cc:gcc -d:strip --opt:size --passL:-s --passc=-flto --passl=-flto -d=mingw --cpu=amd64 --hint[Pattern]:off $1`
14:43:29FromDiscord<Geiseric> (edit) removed "The"
14:44:46FromDiscord<Yardanico> if you (or c2) use(s) any `emit` s it will not work, the term-rewriting macro seems to get the string passed to emit, but even if I specifically check it and not handle it, then it fails to compile because macro'd string doesn't seem to get accepted by emit
14:45:41FromDiscord<Geiseric> Oh yes, i have few emits but it's weird, in another project i've emits too but strenc works without issues
14:53:12*Guest72 quit (Quit: Client closed)
14:54:04FromDiscord<demotomohiro> Are you using Nim with root account?
14:55:02FromDiscord<d4rckh> looks like it
14:55:50FromDiscord<d4rckh> how do i supply something to a `var T`? i forgot the syntax 😓
14:57:18FromDiscord<Yardanico> you have your own variable as `var`
14:57:24FromDiscord<Yardanico> or have a ref and refer to its field
14:57:32FromDiscord<d4rckh> hmm
14:57:33FromDiscord<d4rckh> thanks
14:59:16FromDiscord<Geiseric> In reply to @demotomohiro "Are you using Nim": Are you talking to me? If so, wdym by "root account"?
15:01:44FromDiscord<d4rckh> `root@WinDev2110Eval`
15:02:14FromDiscord<d4rckh> uhh, what does this mean? `Error: 'client' is of type <var Client> which cannot be captured as it would violate memory safety, declared here: ...; using '-d:nimNoLentIterators' helps in some cases`
15:02:23FromDiscord<d4rckh> the code it points to is `while client.connected:`
15:03:17FromDiscord<demotomohiro> @Geiseric Yes. Your log says you installed nim in /root.
15:03:48FromDiscord<Geiseric> In reply to @demotomohiro "<@253937871348563970> Yes. Your log": Yes, i'm using WSL
15:03:56FromDiscord<Yardanico> In reply to @d4rckh "uhh, what does this": it's not possible to use a var of something in a closure
15:04:12FromDiscord<Yardanico> and async is built on closures, so if you're using async, you're using closures
15:04:17FromDiscord<Yardanico> a workaround for that is to use `ref`
15:04:19FromDiscord<demotomohiro> Using root means you might accidentally delete or change imortant files.
15:04:37FromDiscord<Yardanico> In reply to @demotomohiro "Using root means you": it's WSL
15:04:51FromDiscord<Yardanico> doesn't really matter, he can delete all of his windows files even from a user account in WSL
15:04:57FromDiscord<Korven> is the `object` type allocated on the stack?
15:04:58FromDiscord<d4rckh> In reply to @Yardanico "a workaround for that": well client is already ref of object
15:05:02FromDiscord<d4rckh> (edit) "In reply to @Yardanico "a workaround for that": well client is already ... ref" added "a type of" | removed "of"
15:05:14FromDiscord<Yardanico> then why are you doing `var Client`? it's only needed if you want to change the underlying ref
15:05:18FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3Zi9
15:05:24FromDiscord<d4rckh> yeah i wanna change the ref to another ref
15:05:24FromDiscord<Yardanico> fields of a ref object are mutable anyway, you don't have to pass it as `var Client`
15:05:31FromDiscord<Yardanico> oh, then you have to use a double ref i guess...
15:05:46FromDiscord<d4rckh> amazing
15:05:55FromDiscord<demotomohiro> Linux user use root only when really need to be but it is different in WSL?
15:06:04FromDiscord<d4rckh> i didnt have to use root in wsl
15:06:05FromDiscord<d4rckh> 🤔
15:06:33FromDiscord<Geiseric> I just prefer using root when i'm on linux, wether is wsl or a classic linux machine
15:07:15FromDiscord<d4rckh> how do i create a ref? 😓
15:07:21FromDiscord<demotomohiro> @Korven https://internet-of-tomohiro.netlify.app/nim/faq.en.html#type-when-to-use-ref-object-vs-plain-object-qmark
15:07:41FromDiscord<Korven> netlify, nice.
15:08:16FromDiscord<Korven> wait are these notes from the official tutorial? 🤔
15:10:06FromDiscord<demotomohiro> I have accidentally deleted import directly with root several times before. I hope you dont make any mistake like me. @Geiseric
15:10:37FromDiscord<Geiseric> I hope it too ahahah
15:24:10FromDiscord<jmgomez> should when declared x work when x is an argument in a bigger scope?
15:24:53FromDiscord<d4rckh> what was the keyword for creating a ref of something?
15:26:29FromDiscord<demotomohiro> `var a = Foo(x: 123)` if Foo is ref object.
15:26:49FromDiscord<d4rckh> yes
15:26:54FromDiscord<d4rckh> i want to create a ref of Foo
15:26:56FromDiscord<d4rckh> in that case
15:27:02FromDiscord<d4rckh> so its a ref of ref
15:27:39FromDiscord<jmgomez> not sure if you can do that but I guess getting the addr may work?
15:28:45FromDiscord<demotomohiro> In reply to @d4rckh "yes": https://nim-lang.org/docs/system.html#new%2Ctypedesc
15:29:11FromDiscord<demotomohiro> So you want a ref of existing variable?
15:29:56FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3Zig
15:31:23FromDiscord<demotomohiro> What is the type of `Client` in your code?
15:36:31FromDiscord<demotomohiro> You cannot create a ref that points to a variable on stack. If you want to refer variables, https://nim-lang.org/docs/manual_experimental.html#view-types
15:36:58*om3ga joined #nim
15:38:06FromDiscord<d4rckh> Client is ref object
15:38:31FromDiscord<d4rckh> i just want to modify a variable from a proc
15:38:37FromDiscord<d4rckh> (edit) "a" => "an async"
15:49:17NimEventerNew thread by Clavismax: How to run testament Exe-Test-Files in a different Folder, see https://forum.nim-lang.org/t/9198
15:52:57FromDiscord<demotomohiro> In reply to @d4rckh "i just want to": https://wandbox.org/permlink/JE6zyVqjK9DqFgg1
15:53:57FromDiscord<demotomohiro> If you want to modify int variable from an async proc: https://wandbox.org/permlink/1GO0F6glxsdNQrZE
15:57:12FromDiscord<d4rckh> In reply to @demotomohiro "https://wandbox.org/permlink/JE6zyVqjK9DqFgg1": Yes, but I want to change the reference itself
15:57:19FromDiscord<d4rckh> Like swap the client object
15:57:24FromDiscord<d4rckh> With another reference
16:11:59FromDiscord<demotomohiro> @d4rckh Is this what you want? https://wandbox.org/permlink/q9JCo3Q2fbudQVxu
16:27:18FromDiscord<d4rckh> In reply to @demotomohiro "<@648552095531663361> Is this what": yes!
16:29:17*xet7 joined #nim
17:03:35*sagax joined #nim
17:18:04*jjido joined #nim
17:39:15FromDiscord<yttriy> Is there a proc for mapping a range of values to another?
17:39:43FromDiscord<huantian> what kind of mapping are you looking for?
17:42:08FromDiscord<yttriy> In reply to @huantian "what kind of mapping": For example I have numbers from 1 to 10 and I want to convert them to numbers from 1 to 5. Is there a proc for that in std?
17:42:35FromDiscord<huantian> well there's no built-in function to do that specific task, but you can just use a floor division
17:42:37FromDiscord<Rika> divide or clamp?
17:43:00FromDiscord<Rika> so 6 -> 3 or 6 -> 5?
17:45:02FromDiscord<yttriy> In reply to @Rika "so 6 -> 3": 6 -> 3
17:45:18FromDiscord<Rika> `((number + 1) div 2)`?
17:46:23FromDiscord<yttriy> In reply to @Rika "`((number + 1) div": Yes, but I am asking is there a proc for that
17:46:29FromDiscord<Rika> no
17:46:48FromDiscord<yttriy> Ok thanks
17:48:09FromDiscord<yttriy> (edit) "In reply to @Rika "`((number + 1) div": Yes, but I am asking ... is" added "if there" | removed "there"
18:49:17*jmdaemon joined #nim
19:00:28FromDiscord<dziki> sent a long message, see http://ix.io/3Zj8
19:05:31FromDiscord<Yardanico> https://github.com/johnnovak/illwill
19:12:37*LuxuryMode joined #nim
19:22:31*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
19:36:47*jjido joined #nim
19:37:28*om3ga quit (Quit: Bye)
19:42:01FromDiscord<dziki> In reply to @Yardanico "https://github.com/johnnovak/illwill": Thank You! It's more than I could wish for 🙂
20:24:57FromDiscord<Bubblie> Has the import bug been fixed yet?
20:25:21FromDiscord<Yardanico> what bug?
20:26:28FromDiscord<Bubblie> In reply to @Elegantbeef "`../` is not parsed": .
20:26:48FromDiscord<Bubblie> I was trying to fix it myself but I couldnt find where nim handles the parsing
20:29:38FromDiscord<Yardanico> In reply to @Bubblie "I was trying to": well, I don't think it's easy to fix considering that import statements' paths must be valid nim syntax unless you use ""
20:29:49FromDiscord<Yardanico> same reason you can't do `import proc`
20:30:09FromDiscord<Yardanico> (well, a bit different, because then you can't refer to it by the module name)
20:31:01FromDiscord<Bubblie> This is a minor inconvenience for me but I hope at some point it is fixed 😅 but for now ill deal with it it isnt a big deal
20:31:11FromDiscord<Bubblie> In reply to @Yardanico "well, I don't think": Ah okay
20:35:17*sagax quit (Remote host closed the connection)
20:42:46*vicfred quit (Quit: Leaving)
20:59:21FromDiscord<clifonlintic> I'll help 10 individuals how to earn $20,000 in just 72 hours from the crypto market. But you will pay me 10% commission when you receive your profit. if interested send me a direct message via WhatsApp by asking me HOW for more details on how to get started↵+1 (2297781881
21:00:54FromDiscord<Yardanico> wow
21:01:45FromDiscord<Andreas> sent a code paste, see https://play.nim-lang.org/#ix=3ZjB
21:02:24FromDiscord<Yardanico> nim expects a thread proc to be GC-safe (that is, not accessing any GC'd data created outside of it, or globals)
21:02:39FromDiscord<Yardanico> of course you can always override that behaviour if you really want
21:02:49FromDiscord<Yardanico> but don't forget that with refc GC is local heap
21:02:56FromDiscord<Andreas> In reply to @Yardanico "of course you can": that sounds great - let"s try this..
21:03:00FromDiscord<Yardanico> so your `item` won't be accessible from `defer_rcu` with refc
21:03:00FromDiscord<Elegantbeef> Oh fuck yea my Pragma mismatch message exists!
21:04:40FromDiscord<Andreas> @Yardanico @ElegantBeef so the clean solution would be to use a channel and have the C-call outside the thread-proc ? is that correct ?
21:17:52FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3ZjE
21:18:33NimEventerNew thread by Icedquinn: Connect protocol, see https://forum.nim-lang.org/t/9199
21:38:31FromDiscord<Elegantbeef> The answe is always going to be yes↵(@System64 ~ Flandre Scarlet)
21:41:06*sagax joined #nim
21:42:01FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3ZjK
21:42:07FromDiscord<Elegantbeef> There you go @System64 ~ Flandre Scarlet you have C interfaces
21:42:43FromDiscord<System64 ~ Flandre Scarlet> Is it possible to have something more Nim friendly?
21:43:21FromDiscord<Elegantbeef> Yea use methods or object variants
21:43:43FromDiscord<System64 ~ Flandre Scarlet> Nim has Methods?
21:43:50FromDiscord<exelotl> I have a very similar setup in my game. Except it has to `{.emit.}` C code so that the `ActorClass` objects are actually `const` and the actors have pointers to them
21:43:51FromDiscord<Elegantbeef> Yes
21:43:56FromDiscord<Elegantbeef> Nim has single parent inheritance
21:44:08FromDiscord<exelotl> but yes if you're not targetting an embedded platform then methods are the way to go
21:44:19FromDiscord<Elegantbeef> Also exelotl did my template show you anything new that you didnt know? Or was it redundant?
21:44:54FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "Nim has single parent": So I should use inheritance?
21:46:03FromDiscord<exelotl> In reply to @Elegantbeef "Also exelotl did my": oh yeah I actually hadn't considered using parameterless templates for that purpose, but sadly it doesn't solve the case where you did `destroy(foo)` inside a block and then accessed `foo` outside the block
21:47:31FromDiscord<Yardanico> you can probably do some more magic, like having some compile time variable tracking destruction :P
21:47:37FromDiscord<Yardanico> reimplementing DFA as a macro XD
21:50:21FromDiscord<Elegantbeef> Ah shame
21:50:59FromDiscord<Elegantbeef> It'd be dumb but you could use TRMs to reason it
21:51:06FromDiscord<Elegantbeef> But good bye compile times 😄
21:59:15FromDiscord<System64 ~ Flandre Scarlet> Not sure if inheritence is the way to go
22:01:32*vicecea quit (Remote host closed the connection)
22:02:04*vicecea joined #nim
22:06:08FromDiscord<Andreas> sent a long message, see http://ix.io/3ZjR
22:09:15FromDiscord<Elegantbeef> Well what are you after↵(@System64 ~ Flandre Scarlet)
22:09:33FromDiscord<Elegantbeef> You can do the exact same thing as C
22:09:59FromDiscord<Elegantbeef> You can use pointer procs as interfaces, you can use methods, you can make your own trait system, you can use iface or similar....
22:12:21*LuxuryMode quit (Quit: Connection closed for inactivity)
22:12:41FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3ZjT
22:13:05FromDiscord<Elegantbeef> All the systems i mentioned give that
22:14:58FromDiscord<System64 ~ Flandre Scarlet> wait, every system needs something like Switch statement?
22:15:18FromDiscord<Elegantbeef> All the systems i mentioned allow you to do that without a switch statement
22:15:28FromDiscord<System64 ~ Flandre Scarlet> ah alright
22:17:48FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3ZjU
22:18:04FromDiscord<Elegantbeef> Why are you using a seq, we have enum indexed arrays
22:18:24FromDiscord<Elegantbeef> Also for one that didnt want to use OOP you're using OOP
22:18:34FromDiscord<Elegantbeef> `ref object of RootObj` is a inheritable reference object
22:18:47FromDiscord<Elegantbeef> `constructActor` returns a dangling pointer
22:18:56FromDiscord<Elegantbeef> Nothing about this code is afe 😩
22:19:07FromDiscord<Elegantbeef> Uhhh that's supposed to be 🙂 but i muspressed
22:19:32FromDiscord<Elegantbeef> Also `ptr Actor` when `Actor` is a `ref object` is a pointer to a pointer
22:21:43FromDiscord<System64 ~ Flandre Scarlet> Ah alright
22:22:31FromDiscord<br4n_d0n> Is that last proc always initializing Actor's with default values? If so, why not define that in the type?
22:22:51FromDiscord<Elegantbeef> Nim doesnt have default values without macros
22:23:10FromDiscord<br4n_d0n> Really?
22:23:25FromDiscord<Elegantbeef> Yes it 0 init's all values you need constructors to do it otherwise
22:23:30FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/pzo
22:23:39FromDiscord<Elegantbeef> 0 init'd values are a thing for 2.0
22:23:47FromDiscord<Elegantbeef> No it's not you're not allocating the Actor
22:23:53FromDiscord<Elegantbeef> Did you even run that code it'll error nil ref
22:25:26FromDiscord<System64 ~ Flandre Scarlet> Didn't I init an empty Actor at the start?
22:25:31FromDiscord<Elegantbeef> No
22:25:43FromDiscord<Elegantbeef> It's a reference object it 0 inits
22:25:57FromDiscord<System64 ~ Flandre Scarlet> ah so what should I do?
22:26:25FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3ZjV
22:27:22FromDiscord<System64 ~ Flandre Scarlet> Ah alright
22:29:20FromDiscord<br4n_d0n> Is there a roadmap/timeline for Nim anywhere? I tried searching the website and github, but was unable to find anything
22:29:32FromDiscord<System64 ~ Flandre Scarlet> Why? https://media.discordapp.net/attachments/371759389889003532/982410731603492924/unknown.png
22:29:34FromDiscord<Elegantbeef> There's the 2.0 rfc on nim-lang/rfcs
22:29:51FromDiscord<br4n_d0n> In reply to @Elegantbeef "There's the 2.0 rfc": Thanks, I'll check that out
22:30:29FromDiscord<Elegantbeef> The fuck is `behaviourTable[Player, result]`?
22:30:45FromDiscord<Elegantbeef> It's an array why do you have 2 indicies
22:31:12FromDiscord<System64 ~ Flandre Scarlet> wait I'm dumb
22:33:35FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3ZjW
22:33:40FromDiscord<Elegantbeef> Dont need the `return result` but sure
22:33:58FromDiscord<Elegantbeef> Still dont know why you're using `flags: byte`
22:34:11FromDiscord<Elegantbeef> This is Nim not C we dont use silliness
22:35:01FromDiscord<System64 ~ Flandre Scarlet> it's like a propertie
22:35:47FromDiscord<Elegantbeef> What?
22:36:24FromDiscord<System64 ~ Flandre Scarlet> For exemple in Mario, you have green and red Koopa↵They're both Koopas but the difference is the red one is careful about void
22:37:42FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3ZjZ
22:38:00FromDiscord<Elegantbeef> It's the exact same code just one is much much more Nim and clean
22:38:07FromDiscord<System64 ~ Flandre Scarlet> Ah yeah true
22:38:19FromDiscord<Elegantbeef> Ah sorry that should be `1, 2, 4, 8`
22:38:43FromDiscord<System64 ~ Flandre Scarlet> I have 8 bits for the flag
22:38:53FromDiscord<Elegantbeef> Ok?
22:39:25FromDiscord<Elegantbeef> The `set[ActorFlag]` uses 8 bits aswell
22:39:35FromDiscord<Elegantbeef> It's actually dynamically sized to use the fewest amount of bits possible
22:40:03FromDiscord<br4n_d0n> @ElegantBeef ... that RFC repo doesn't seem to have much in it and they are from like 2-3 years ago. Am I missing something?
22:40:21FromDiscord<Elegantbeef> https://github.com/nim-lang/RFCs/issues/437
22:40:25FromDiscord<Elegantbeef> Did you look at the issues?
22:41:33FromDiscord<Elegantbeef> In the case of nim bitsets if you have 20 elements it uses 3 bytes
22:41:54FromDiscord<Elegantbeef> It's a packed bitset just much much more ergonomic to the C variant
22:42:13FromDiscord<br4n_d0n> Ah, seems strange to have in the "issues" section, but whatever, I now can look at it
22:53:09FromDiscord<System64 ~ Flandre Scarlet> Is it a good idea to make the Actor seq global?
22:56:10FromDiscord<Elegantbeef> That's up to you
22:56:44FromDiscord<System64 ~ Flandre Scarlet> Isn't a.update() supposed to be allowed? https://media.discordapp.net/attachments/371759389889003532/982417584399990804/unknown.png
22:56:56FromDiscord<Elegantbeef> It's a pointer proc
22:57:00FromDiscord<Elegantbeef> `a.update(a)`
22:57:34FromDiscord<System64 ~ Flandre Scarlet> ah yeah true
22:58:52FromDiscord<Elegantbeef> Using OOP wouldnt have that issue
22:59:50FromDiscord<System64 ~ Flandre Scarlet> will be OOP more CPU intensive?
23:01:13FromDiscord<Elegantbeef> Negligably
23:01:18FromDiscord<Elegantbeef> You're already using reference objects
23:01:47FromDiscord<System64 ~ Flandre Scarlet> ah alright↵So I guess it would be better to use OOP
23:01:58*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
23:02:07FromDiscord<System64 ~ Flandre Scarlet> and so with OOP I wouldn't need a behavior table
23:02:20FromDiscord<Bubblie> In reply to @Yardanico "wow": ?
23:04:13FromDiscord<Elegantbeef> Exactly system each actor would be it's own type and would override the update procedure
23:05:10FromDiscord<Bubblie> In reply to @Bubblie "?": Im a bit confused with the wow reply 💀
23:05:17FromDiscord<Bubblie> Not sure if it was directed towards me or sometjing
23:05:55FromDiscord<Elegantbeef> There was a deleted scam message
23:06:20FromDiscord<Elegantbeef> > I'll help 10 individuals how to earn $20,000 in just 72 hours from the crypto market. But you will pay me 10% commission when you receive your profit. ...
23:06:22FromDiscord<Bubblie> Oh
23:06:28FromDiscord<Bubblie> LMAO
23:07:25FromDiscord<Elegantbeef> Relatively common matrix spam it seems
23:10:37FromDiscord<System64 ~ Flandre Scarlet> So this is Method? https://media.discordapp.net/attachments/371759389889003532/982421075612819516/unknown.png
23:11:35*ltriant quit (Ping timeout: 255 seconds)
23:14:18FromDiscord<huantian> look at <https://nim-lang.org/docs/tut2.html#object-oriented-programming-dynamic-dispatch>
23:18:19FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3Zk5
23:19:30FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=3Zk6
23:19:40FromDiscord<System64 ~ Flandre Scarlet> ah alright
23:19:53FromDiscord<System64 ~ Flandre Scarlet> btw Actor and Player are in different files
23:26:29FromDiscord<Elegantbeef> Doesnt matter as long as `Player` imports `Actor`
23:29:30FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3Zk8
23:30:31FromDiscord<huantian> send code pls?
23:30:52FromDiscord<huantian> it works just fine on my end https://play.nim-lang.org/#ix=3Zk9
23:31:09FromDiscord<Elegantbeef> They probably didnt export `Actor` or `constructActor`
23:31:15FromDiscord<Elegantbeef> Errors are a magical thing
23:32:09FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3Zkb
23:32:19FromDiscord<huantian> well yeah that wont' work because constructActor returns an Actor
23:32:22FromDiscord<huantian> not a Player
23:32:35FromDiscord<System64 ~ Flandre Scarlet> but a Player is an Actor
23:32:44FromDiscord<huantian> but not all Actors are Players
23:32:47FromDiscord<System64 ~ Flandre Scarlet> true
23:33:30FromDiscord<System64 ~ Flandre Scarlet> So I have to rewrite the same code in Player?
23:34:00FromDiscord<Elegantbeef> Then you can do `new result` `result.construct` and then set your player specific variables
23:35:27FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3Zkc
23:35:42FromDiscord<Elegantbeef> No
23:36:08FromDiscord<Elegantbeef> make a procedure inside actor that takes in a `Actor` and sets the fields of that actor
23:36:46FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Zkd
23:36:58FromDiscord<System64 ~ Flandre Scarlet> Ah alright
23:37:13FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Zke
23:37:18FromDiscord<System64 ~ Flandre Scarlet> aaaah alright
23:42:45FromDiscord<System64 ~ Flandre Scarlet> Yeeees! It works! https://media.discordapp.net/attachments/371759389889003532/982429160637075526/unknown.png
23:44:18FromDiscord<Elegantbeef> Weird how methods work 😄
23:48:25*ltriant joined #nim