<< 03-11-2022 >>

00:04:51FromDiscord<dlesnoff> I have generated about 60 nimibs from the wiki's markdown, only got a few compilation errors, almost there. https://media.discordapp.net/attachments/371759389889003532/1037517675506712727/Firefox_Full_Of_Nimib.png
00:07:33FromDiscord<Bung> https://github.com/nim-lang/Nim/pull/20738 fails on cpp backend , any help ?
00:13:02FromDiscord<dlesnoff> The error comes from weave, isn't it ?
00:25:17*derpydoo quit (Ping timeout: 276 seconds)
00:47:40FromDiscord<Elegantbeef> Yea the error comes from weave but the culprit is their code changes
01:12:58*alice quit (Read error: Software caused connection abort)
01:15:55*alice joined #nim
01:30:15*nyeaa492 joined #nim
01:30:28*nyeaa49 quit (Ping timeout: 248 seconds)
01:45:10*GreaseMonkey quit (Read error: Software caused connection abort)
01:49:43*greaser|q joined #nim
01:53:03FromDiscord<sOkam!> how do you convert a cstring to a string?↵is the lsp just trolling me, or is `var thing:cstring; thing.string` not enough?
01:53:42FromDiscord<sOkam!> its for a glfw error callback, that has a cstring as the prototype, in case that's important
01:53:56FromDiscord<sOkam!> (edit) "as" => "in"
02:01:55FromDiscord<Elegantbeef> `$myCstring`
02:07:25*LyndsySimon quit (Read error: Software caused connection abort)
02:08:06*nyeaa4928 joined #nim
02:09:18FromDiscord<sOkam!> ty
02:10:30*LyndsySimon joined #nim
02:12:22*nyeaa492 quit (Ping timeout: 272 seconds)
02:28:15FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4eNw
02:29:09FromDiscord<ringabout> (edit) "https://play.nim-lang.org/#ix=4eNw" => "https://play.nim-lang.org/#ix=4eNx"
02:30:13FromDiscord<ringabout> A more simple case
02:30:24FromDiscord<ringabout> sent a code paste, see https://paste.rs/rmO
02:44:21*greaser|q quit (Changing host)
02:44:21*greaser|q joined #nim
02:44:24*greaser|q is now known as GreaseMonkey
02:46:36FromDiscord<Bung> does static obj work well before ?
02:49:41FromDiscord<ringabout> That's the problem.
03:00:06*genpaku quit (Read error: Connection reset by peer)
03:00:47*genpaku joined #nim
03:31:56FromDiscord<proton> `C:\Users\low\.nimble\pkgs\eth-1.0.0\eth\p2p\discoveryv5\routing_table.nim(485, 14) Error: undeclared identifier: 'shallowCopy'`
03:40:54*arkurious quit (Quit: Leaving)
04:11:30*nyeaa49284 joined #nim
04:12:13*nyeaa4928 quit (Ping timeout: 252 seconds)
04:52:07*LuxuryMode quit (Quit: Connection closed for inactivity)
05:44:23FromDiscord<ShalokShalom> In reply to @Jiezron "I wanted a zsh/bash": Such things go much easier im xonsh and fishshell
05:48:02FromDiscord<ShalokShalom> In reply to @Jiezron "I have generated about": I recommend you something like Grammarly or https://www.grammarcheck.net/editor/
05:54:06FromDiscord<Rika> That’s not his writing
06:45:49*kenran joined #nim
06:51:23FromDiscord<dlesnoff> No but it's not a bad idea to do a spell check on the wiki files ... oh wait
06:52:05FromDiscord<dlesnoff> was there spelling errors in what I wrote in the chat ?
06:52:29FromDiscord<ChocolettePalette> Yes
06:54:59FromDiscord<dlesnoff> 😅
07:09:14madpropsmade a demo of my firefox addon https://youtu.be/OQFbv9wAccI
07:11:01FromDiscord<dlesnoff> Can we revert the color of your addon back to the default color of firefox ?
07:11:34madpropssure
07:11:53madpropsmanually
07:13:03FromDiscord<dlesnoff> but not from the addon.
07:16:11FromDiscord<dlesnoff> In reply to @ShalokShalom "I recommend you something": This does not allow copy-paste for some reason. But I fixed myself my sentence :↵« I generated about 60 nimibs from the wiki's markdown. I had only a few compiler's issues. I am almost there.»
07:17:46termer@ElegantBeef What happened to your Raspberry Pi Pico examples repo on GitHub? I saw it linked on the Nim forum but it's gone now
07:18:02termerI'd also be curious to hear about your experiences working with Nim on a Pico board
07:18:30FromDiscord<Elegantbeef> https://github.com/EmbeddedNim/picostdlib it exists here now
07:18:40FromDiscord<Elegantbeef> It works is all i can really say, i'm not an embedded programmer
07:18:42termerthere was another repo linked but maybe it was just this
07:18:59*kenran` joined #nim
07:19:08termerI'm about to work on building a kernel for it and I'm torn between C, Rust, and Nim so I was interested when I saw your nim lib
07:21:08termerin some ways Nim could be better suited for the job if using ARC GC and making heavy use of macros to write efficient code
07:21:08termerand being able to export C bindings
07:21:08termerbut memory might be too magical
07:21:08termerI need to look at the generated C sources
07:21:17*kenran quit (Ping timeout: 276 seconds)
07:24:21FromDiscord<Elegantbeef> I cant say much in that regard aside from "It should work" 😛
07:28:00termerI see
07:33:25FromDiscord<ShalokShalom> In reply to @Jiezron "This does not allow": Grammarly offers a browser extension, that's what I use
07:33:35FromDiscord<ShalokShalom> On Android, there is a keyboard
07:34:12termeris there any way to disable the nim stdlib altogether?
07:34:33FromDiscord<Elegantbeef> Just dont import it
07:35:14termerI'm not but it's being imported in part anyway
07:35:44termerstdlib_system.nim.c is being generated
07:35:49FromDiscord<Elegantbeef> I guess use patchfile then
07:35:59termerwhat's that
07:36:03FromDiscord<Elegantbeef> Well yea system is where all of nim builtin features are
07:36:10FromDiscord<Elegantbeef> you want data types dont you? 😄
07:36:32FromDiscord<Elegantbeef> https://nim-lang.org/docs/nimscript.html#patchFile%2Cstring%2Cstring%2Cstring
07:37:29termersomething tells me nim isn't suitable for low level development
07:37:46FromDiscord<Elegantbeef> It likely is, but meh
07:38:30*kenran` quit (Remote host closed the connection)
07:38:46termerI can't trust anything besides C to do what I tell it to
07:39:05termerwhat's the difference between a nim string and a c string anyway
07:39:13termerI see a type for nim string generated in the C sources
07:39:15FromDiscord<Elegantbeef> Nim's are pascal
07:39:28*kenran joined #nim
07:39:33FromDiscord<Elegantbeef> Nim is safer so uses sensible string types
07:40:04termerc string is just an array of chars which I think is better for many use-cases
07:40:07termerlike buffers
07:40:12termerbut that should probably be its own type
07:40:23FromDiscord<Elegantbeef> You'd be wrong
07:40:30termerin what way
07:40:42termerwhen I'm writing display buffer code, I want to only be allocating as much as I think I am
07:40:43FromDiscord<Elegantbeef> The amount of issues Cstrings cause is tangible
07:41:18termerI wouldn't know cause I only use C for microcontrollers and there I only use them as buffers basically
07:41:18FromDiscord<Elegantbeef> So then .... allocate buffers directly?
07:41:33termerusually I do allocate directly lol
07:41:40FromDiscord<Elegantbeef> There are so many issues due to null terminated strings
07:42:04termerwell like I said, I use them more as char arrays than real strings lol
07:42:05*kenran` joined #nim
07:42:07FromDiscord<Elegantbeef> Like you can do `newStringOfCap(128)` and use a distinct type to disallow adding/growing
07:42:22FromDiscord<Elegantbeef> That's exactly where the issue arise though
07:42:40termerfor fixed size, I try to use arrays in nim cause then I don't need to allocate nonsense dynamically
07:42:41FromDiscord<Elegantbeef> "There has to be a \\0 in this collection" often ends badly
07:42:56termerthat figures
07:43:06termerI just wish I knew more of what was going on in nim world
07:43:13termerc world you more of less get what you write
07:43:20termer*more or less
07:43:24FromDiscord<Elegantbeef> I mean you do generally with Nim aswell
07:43:44*kenran quit (Ping timeout: 246 seconds)
07:43:48termerlooking at this generated c source, it may as well be assembly with how little I understand what's happening
07:44:20termerbut I'm just saying, a 2551 line file for the stdlib is a big overhead on a device with 2mb flash storage
07:44:52termerand god knows where my ram is gonna go
07:45:42FromDiscord<Elegantbeef> I'm going to pretend you didnt say that and carry on
07:45:43*tiorock joined #nim
07:45:43*tiorock quit (Changing host)
07:45:43*tiorock joined #nim
07:45:43*rockcavera quit (Killed (tantalum.libera.chat (Nickname regained by services)))
07:45:43*tiorock is now known as rockcavera
07:46:07FromDiscord<Elegantbeef> Using patchfile you can write your own allocator
07:46:20*jjido joined #nim
07:46:23FromDiscord<Elegantbeef> Like i dont get you points, though that's likely cause i've never done kernel development
07:46:45FromDiscord<Elegantbeef> a file with 2.5k lines doesnt mean anything assuming your compiler/linker does anything
07:47:15Amun-Rayou almost never use stdlib and gc != none when writing kernel anyway
07:48:10FromDiscord<Elegantbeef> Yea like you can write it using ARC for some types and use manual memory management elsewhere
07:48:40FromDiscord<Elegantbeef> You still have macros, and fine control, but also dont need to make your own sequence type for whatever reason you might need to test or for use
07:48:49*LyndsySimon quit (Ping timeout: 268 seconds)
07:50:36FromDiscord<ElementalX> sent a code paste, see https://play.nim-lang.org/#ix=4eOd
07:50:47FromDiscord<Elegantbeef> `i` is not mutable
07:51:13FromDiscord<ElementalX> so for the second case how is `inc i` valid
07:51:18*LyndsySimon joined #nim
07:51:22FromDiscord<Elegantbeef> You did `var i = 0`
07:51:54FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4eOe
07:52:55FromDiscord<ElementalX> I see, so it would be better if I use a while loop for this, not sure I I decrement the value, that is my code should reach 100 to 1 and stop not 1 to 100
07:53:16FromDiscord<Elegantbeef> `for i in countDown(100, 1)`
07:53:22Amun-Raif you need to modify i inside the loop use while; otherwise use iterators
07:53:26FromDiscord<Elegantbeef> While loops are used for different semantics
07:54:40FromDiscord<ElementalX> In reply to @Elegantbeef "`for i in countDown(100,": Thanks it worked, appreciate the help!
08:04:16FromDiscord<dlesnoff> @ElementalX that was not the purpose of the exercise
08:09:43FromDiscord<dlesnoff> You have to determine for each integer in 2..100, how much steps you need before getting 1, by computing the next term in the Collatz sequence repeatidly.
08:11:15FromDiscord<dlesnoff> You have only computed the second term for each initial values of the Collatz sequence.
08:21:24FromDiscord<ElementalX> sent a code paste, see https://play.nim-lang.org/#ix=4eOm
08:22:25FromDiscord<ElementalX> https://narimiran.github.io/nim-basics/#_exercises_2 oops my bad I pasted the link to exercise#3 😅 sorry @dlesnoff
08:23:23*vicecea quit (Remote host closed the connection)
08:27:18*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
08:28:45FromDiscord<dlesnoff> No problem.
08:31:59*qwr quit (Ping timeout: 268 seconds)
08:32:12*qwr joined #nim
08:38:57FromDiscord<Prestige> sent a long message, see http://ix.io/4eOr
08:41:26FromDiscord<Elegantbeef> https://github.com/nim-lang/x11/blob/2093a4c01360cbb5dd33ab79fd4056e148b53ca1/x11/x11pragma.nim#L17 they seem to target the right lib
08:42:50FromDiscord<Prestige> I don't know how the system looks for the lib, maybe that location isn't included
08:43:17FromDiscord<Elegantbeef> `LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu/` 😄
08:43:28*jjido joined #nim
08:43:34FromDiscord<Elegantbeef> Debian generally just symlinks `lib` iirc to that or a similar one
08:43:49FromDiscord<Elegantbeef> No longer over there so I cannot tell you for certain
08:44:02FromDiscord<Prestige> I've never been on Debian so idk either
08:45:02FromDiscord<narimiran> Nim 1.6.10 RC is here: https://github.com/nim-lang/nightlies/releases/tag/2022-11-03-version-1-6-121602e88ffcb9bfefe62265aebe81692e9e8124
08:48:54FromDiscord<dlesnoff> In reply to @Avahe "Anyone that's Linux/Debian savvy:": The path with x86 is the location for one of my ubuntu machine
08:49:21NimEventerNew thread by miran: Nim 1.6.10 release candidate, see https://forum.nim-lang.org/t/9574
08:49:26FromDiscord<Elegantbeef> Yea debian does some wacky things with default paths, ubuntu inherits that
08:56:01*rockcavera quit (Ping timeout: 252 seconds)
08:56:20*rockcavera joined #nim
08:56:20*rockcavera quit (Changing host)
08:56:20*rockcavera joined #nim
08:57:54FromDiscord<Prestige> I don't understand why it would cause a problem, unless building on a machine that uses a different path and executing it on a debian machine causes the lib to not be found
08:58:12FromDiscord<Prestige> But it should find it dynamically on start
08:58:29FromDiscord<Elegantbeef> It shouldnt
08:58:35FromDiscord<Elegantbeef> Using `LD_LIBRARY_PATH` should resolve it, but I dont see what causes it
08:59:50*alice quit (Quit: *disappears* U_U)
09:00:12*alice joined #nim
09:01:47*rockcavera quit (Ping timeout: 246 seconds)
09:03:32*rockcavera joined #nim
09:03:33*rockcavera quit (Changing host)
09:03:33*rockcavera joined #nim
09:06:52*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
09:12:23FromDiscord<Phil> sent a long message, see http://ix.io/4eOy
09:13:57FromDiscord<Phil> (edit) "http://ix.io/4eOy" => "http://ix.io/4eOz"
09:14:49FromDiscord<ringabout> Now part of datetime bugs is fixed https://github.com/nim-lang/Nim/pull/20741
09:15:11FromDiscord<ringabout> (edit) "Now ... part" added "a"
09:15:19FromDiscord<Phil> Sweet, so I should try out my example again. Will do so after work
09:17:24FromDiscord<ringabout> No, just the private access to object construction works. It still reports the second errors.
09:18:04FromDiscord<Phil> Dangit!
09:18:15FromDiscord<Phil> However, awesome to see this progress being made!
09:18:32FromDiscord<Phil> Thank you very, very much for your contributions!
09:18:33FromDiscord<ringabout> (edit) "second" => "first"
09:18:53FromDiscord<ringabout> My pleasure
09:20:21FromDiscord<luteva> @Phil Thx a lot! Email is a Model that can have several properties. not just a string. So i have to use custom types then, right??
09:22:23FromDiscord<luteva> i didn't "made a table", i thought that norm would generate it. just as in the norm tutorial: https://norm.nim.town/tutorial/tables.html
09:24:45FromDiscord<luteva> so the dbConn.createTables(newCustomer()) is exactly where it fails, when trying to use a sequence. seq[Email] in my case.
09:24:54FromDiscord<luteva> (edit) "dbConn.createTables(newCustomer())" => "dbConn.createTables(newUser())"
09:26:44FromDiscord<luteva> so well. gonna have a deep look into the customDatatypes. maybe this is already what i am searching for. thx a lot!
09:28:06*rockcavera quit (Ping timeout: 272 seconds)
09:31:17*jmdaemon quit (Ping timeout: 276 seconds)
09:31:33FromDiscord<nocturn9x> well
09:31:35FromDiscord<nocturn9x> guess what
09:31:43FromDiscord<nocturn9x> now the gc problem arises with `--gc:none` too
09:31:52FromDiscord<nocturn9x> I'm glad. Now at least I can rule out nim's mm strategy
09:32:42*rockcavera joined #nim
09:32:42*rockcavera quit (Changing host)
09:32:42*rockcavera joined #nim
09:34:44FromDiscord<nocturn9x> but if I debug my collector it goes away, hmm
09:37:25FromDiscord<nocturn9x> no, it's not that either
09:37:34FromDiscord<nocturn9x> could it be link time optimization?
09:40:57FromDiscord<nocturn9x> nope, here it goes, the issue appears when using the default gc rip
09:41:03*jjido joined #nim
09:41:31FromDiscord<nocturn9x> markAndSweep works, but probably because it actually never runs as not enough objects are allocated
09:45:48FromDiscord<nocturn9x> btw is it possible to compile different nim files with different flags?
09:45:58FromDiscord<nocturn9x> I'd like to compile my vm module with `--gc:none`
09:46:01FromDiscord<ShalokShalom> In reply to @termer "looking at this generated": The generated source is also not optimised for reading, but compiling. ↵↵The generated source of Nim is not meant to be read, so judging it by this merrit is questionable.
09:46:26FromDiscord<ShalokShalom> The written Nim code is imho more explicit as C, like typing related stuff, as an example
09:48:20*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
11:11:18FromDiscord<Phil> In reply to @luteva "so the dbConn.createTables(newUser()) is": One sec, my advice may be wrong in this case, so I understand correctly that you have 2 Models, User and Email and User is supposed to have a seq[Email] field?
11:11:26FromDiscord<Phil> So a user may have many email addesses?
11:13:04FromDiscord<Phil> In that case you'll need to handle this differently. That's a Many-To-One relationship and you can't quite do it this way. ↵You'll need to add a "User" field on your Email-Models.↵Then you can use the procs norm provides for querying many-to-one relationships, as is described here https://norm.nim.town/tutorial/rows.html↵(Look at the chapter `Selecting Many-To-One/One-To-Many relationships`)
11:13:10FromDiscord<Phil> (edit) "chapter" => "section"
11:14:17*vicecea joined #nim
11:14:26FromDiscord<Tanguy> So to be sure, `sink` has no effect with `refc`, but `lent` has? That's what I understood from various readings
11:15:03FromDiscord<Phil> However, @luteva , that is ONLY the case IF you want "Email" to be its own table.↵If you're fine with e.g. storing it as a JSON string in a field of your User table, you could solve this via a custom data-type
11:15:33FromDiscord<Phil> IIRC both Postgres and SQLITE support JSON in their tables
11:15:56FromDiscord<Phil> (edit) "tables" => "tables, should you want to do even deeper manipulations with fancy SQL (though that won't be absolutely necessary, only if you really need to get fancy)"
11:19:45*tiorock joined #nim
11:19:46*tiorock quit (Changing host)
11:19:46*tiorock joined #nim
11:19:46*rockcavera quit (Killed (copper.libera.chat (Nickname regained by services)))
11:19:46*tiorock is now known as rockcavera
11:21:46FromDiscord<Phil> sent a long message, see http://ix.io/4eP5
11:22:09FromDiscord<luteva> ok, so. i want to query emailaddrresses by users. but as i understand, it has to go through email having a user as property, right?
11:22:11FromDiscord<Phil> (edit) "http://ix.io/4eP5" => "http://ix.io/4eP6"
11:22:56FromDiscord<Phil> Correct, I don't know how familiar you are with SQL, the word you'd be looking for is "Foreign Key", so that an entry in the "Email" table points to a specific entry on the "User" table
11:23:15FromDiscord<luteva> and, yes, email should be a model.
11:23:44FromDiscord<luteva> and a user can have many emails
11:24:31FromDiscord<Phil> Check, in that case you have 2 tables and a many-to-one relationship.↵In that case you must instantiate both tables separately and the User model can not have a seq[Email] field
11:25:04FromDiscord<luteva> so i want to have something like "select from email where email.user_id = ?" my_user.id
11:25:13FromDiscord<Phil> Norm does not handle representing Many-to-X relationships in Models very graciously
11:25:19FromDiscord<luteva> or something like this.
11:25:20FromDiscord<Phil> In reply to @luteva "so i want to": That one is possible
11:25:54FromDiscord<luteva> and ideally i only want to specify the model. just as it goes in the example.
11:25:55FromDiscord<Phil> You can do a query that gives you a seq[Email] where the Email contains also an instance of User or only the value of the foreign key
11:26:50FromDiscord<Phil> In reply to @luteva "so i want to": For that one see https://norm.nim.town/tutorial/rows.html , the section "Select in general"
11:27:05FromDiscord<Phil> It does in fact almost provide a 1:1 example for your problem ^^
11:27:21FromDiscord<Phil> Well, not quite, a similar one, the email there is a string
11:28:41FromDiscord<Phil> Basically there's 2 ways you can query a one-to-many relationship:↵1) Use `selectOneToMany`↵2) Use `select` and pass it a `seq[Email]`
11:29:18FromDiscord<Phil> `selectOneToMany` is a helper proc to essentially simplify case number 2), as it actually uses that one under the hood but tries to take away some of the logic for you
11:29:24FromDiscord<luteva> ok, but in the end i probably have to write the sql (or part of it). there's no implicit mapping, right?
11:30:01FromDiscord<Phil> Correct, but that's the case with all of norm.↵You will always have to write WHERE clauses if you need any, as that's never abstracted away.
11:30:15FromDiscord<luteva> ok thx!
11:30:36FromDiscord<Phil> Actually there's also a 3rd way, write full up raw sql so you can do it all in one query and parse it into a custom datatype, see rawSQL section for that as specified earlier.
11:30:57FromDiscord<Phil> Though personally I'd only use that one if you go into fancy SQL syntax such as recursive queries
11:53:16NimEventerNew post on r/nim by thindil: [Nim Blog] This Month with Nim: October 2022, see https://reddit.com/r/nim/comments/yl0m6b/nim_blog_this_month_with_nim_october_2022/
12:15:31*neceve quit (Quit: ZNC - https://znc.in)
12:19:41*neceve joined #nim
12:32:50*wallabra quit (Ping timeout: 246 seconds)
12:33:39*wallabra joined #nim
12:37:30*kenran` quit (Remote host closed the connection)
12:57:25*derpydoo joined #nim
13:28:41*rockcavera quit (Remote host closed the connection)
13:34:07*kenran joined #nim
13:39:12*Jjp137 quit (*.net *.split)
13:39:13*mahlon quit (*.net *.split)
13:49:10*arkurious joined #nim
14:00:06*derpydoo quit (Ping timeout: 255 seconds)
14:17:16*mahlon joined #nim
14:48:17*wallabra quit (Ping timeout: 246 seconds)
14:49:52*wallabra joined #nim
14:50:08*Guest82 joined #nim
14:50:22Guest82hih
14:51:28*Guest82 quit (Client Quit)
14:56:09FromDiscord<!&luke> https://youtu.be/WHyOHQ_GkNo↵Finally!
14:56:55*derpydoo joined #nim
14:59:03NimEventerNew thread by Jaap: Youtube video Nim in 100 seconds from Fireship, see https://forum.nim-lang.org/t/9575
15:03:23FromDiscord<spoon> love to see it
15:07:44FromDiscord<rlipsc> In reply to @sOkam! "tysm btw, beef. I": I did a video on Polymorph for NimConf that covers what ECS is and how it works if you're interested 🙂 https://www.youtube.com/watch?v=zCHZ0l7nLA0
15:12:57*Guest9038 joined #nim
15:13:49FromDiscord<auxym> good talk btw @rlipsc , the demos were really cool 🙂
15:17:14*hexeme joined #nim
15:17:16*hexeme_ quit (Ping timeout: 240 seconds)
15:21:14FromDiscord<hugogranstrom> In reply to @NimEventer "New thread by Jaap:": https://plausible.io/nim-lang.org?period=day The page visits seems to have peaked in the last hour. This video will certainly drive more traffic our way
15:25:09*derpydoo quit (Ping timeout: 268 seconds)
15:27:43*derpydoo joined #nim
15:30:39*Guest9038 quit (Quit: Client closed)
15:40:21FromDiscord<rlipsc> In reply to @auxym "good talk btw <@800432830605819906>": Thanks for the feedback! I'm considering doing more vids/articles on ECS in general and design patterns in Polymorph if anyone would be interested.
15:41:21*kenran quit (Remote host closed the connection)
15:44:50FromDiscord<4zv4l> does it mean that Nim's default gc will never stop the current program ? `Stop The World` is when the program is paused to collect the garbage right ? https://media.discordapp.net/attachments/371759389889003532/1037754232234840124/image.png
15:45:10FromDiscord<4zv4l> does it mean that even if its garbage collected Nim could be used to make pacemaker for example since it will never stop ?
15:45:35FromDiscord<Phil> ECS? Another concept I need to learn about.... Eventually!
15:47:43FromDiscord<Phil> I believe you might want our embedded folks for that one. Or yard, I haven't played around much with low level
15:48:10FromDiscord<Phil> (edit) "I believe you might want our embedded folks for that one. Or yard, I haven't played around much with low level ... " added "memory controls and the line"
15:48:18FromDiscord<Phil> (edit) "line" => "like"
15:48:44FromDiscord<jmgomez> In reply to @hugogranstrom.nim "https://plausible.io/nim-lang.org?period=day The pa": It's huge! Also the video is very well done, it should even be on the Nim main page (after the wave of visitors passes)
15:49:34FromDiscord<rlipsc> In reply to @Isofruit "ECS? Another concept I": The first 10m of my talk gives a quick intro on what ECS is and loosely compares it to OOP if you want an overview 🙂
15:50:00*jjido joined #nim
15:50:38FromDiscord<Phil> Given that I just recently had my Heureka on how Oop solves problems differently than procedural that... God dangit you got me, time to find the link
15:52:05*Jjp137 joined #nim
15:52:55*arkurious quit (Ping timeout: 252 seconds)
15:54:43*jjido quit (Client Quit)
15:57:50FromDiscord<Tanguy> In reply to @4zv4l "does it mean that": "Stop the World" means the GC will pause every thread at the same time to collect memory↵Nim refc will only stop the current thread, and offers strict boundaries on the time it takes to run↵↵And arc will not stop the thread at all (orc will if you have cyclic memory)
15:59:13NimEventerNew thread by scarf: Kotlin style scope macros?, see https://forum.nim-lang.org/t/9576
16:03:45FromDiscord<rlipsc> In reply to @Isofruit "Given that I just": tl;dw: OOP lets you categorise `things` in a hierarchy (`X` is a `Y`). ECS lets you combine `attributes` to run behaviours (`X` has a `Y` and `Z` -> do `behaviourYZ`).
16:03:49FromDiscord<Phil> Now I'm wondering if you can forbid an entity to have certain components
16:04:52FromDiscord<Phil> Like if there's an entity you want to use for the player, them having an ai component would not make sense
16:05:34FromDiscord<rlipsc> In reply to @Isofruit "Now I'm wondering if": No, you can't. Entities are basically just bags of parameters. You can however write system logic that says `[Comp1, not Comp2]`.
16:05:35FromDiscord<Phil> So to prevent that, have certain schemas that define a set of components that make up a player
16:05:43*arkurious joined #nim
16:06:41FromDiscord<Phil> Though I think that might be my desire for static trying and "preventing mistakes I'll make" shining through
16:06:42FromDiscord<rlipsc> In reply to @Isofruit "Like if there's an": You can just not add an `AI` component to the player entity 🙂
16:07:02FromDiscord<Phil> In reply to @rlipsc "You can just not": Totally fair!
16:08:15FromDiscord<Phil> Really good video so far btw. I think I'm getting the general gists and benefits
16:08:48FromDiscord<rlipsc> Instead of `AI`, add a `Controls` component that reads keyboard/mouse for the player. The nice thing about this is you can add `Controls` or `AI` to any entity without constraint. So you can say, let the player control a tree by adding the `Controls` component, and so on.
16:13:39FromDiscord<Phil> Ohhh basically changing the system an entity participates in at runtime?
16:13:47FromDiscord<rlipsc> Yup! 🙂
16:13:49FromDiscord<Phil> Dang
16:16:31FromDiscord<rlipsc> For me, this is much more intuitive than describing "what" an object is. Instead you just write logic that takes parameters and combine them however you want. That way you don't need to worry about classifying `things` at all, only their `attributes`.
16:18:50FromDiscord<Rika> wait wtf that nim in 100 seconds video was way more than 100 seconds i want a refund
16:20:01FromDiscord<rlipsc> Especially important in games perhaps, where you start off with `Player`, `Zombie` and `Bird`, and do walking/flying physics. Then later on decide to add `Griffon` or something and you don't need to think about how to handle both walking and flying, you just add both attributes.
16:20:58FromDiscord<rlipsc> In reply to @Rika "wait wtf that nim": Maybe he couldn't fit all the goodness into only 100s!
16:21:00FromDiscord<Phil> Say you want to affect only zombies with something, do you just give them a zombie Tag like you gave a bounce tag?
16:21:20FromDiscord<Phil> And then affect all zombie components?
16:21:34FromDiscord<Phil> Or would you have an If zombie somewhere?
16:23:02FromDiscord<Phil> Ah, zombie entities, not components
16:23:43FromDiscord<rlipsc> sent a code paste, see https://paste.rs/osS
16:23:52FromDiscord<Phil> Check
16:24:14FromDiscord<rlipsc> Then you could add `Zombie` to player as a debuff 🙂
16:24:20FromDiscord<Phil> How do you solve two systems wanting to affect the same data of the same entity in different ways?
16:24:42NimEventerNew post on r/nim by jabbalaci: Nim in 100 Seconds, see https://reddit.com/r/nim/comments/yl753v/nim_in_100_seconds/
16:24:53FromDiscord<Phil> Say the player walks somewhere and a collision system procs by him being hit with a boulder
16:25:15FromDiscord<Phil> Both the control and the collision system would try to update the same data
16:32:07FromDiscord<rlipsc> Systems are run in a fixed order - that's a key aspect of the pattern to describe behaviour, and make systems like a data pipeline of transformations. So for instance take the `Position` and `Velocity` components for your player. System order might be `readControls` (add to `Velocity`) -> `applyGravity` (add to `Velocity`) -> `calcCollisions` (correct `Velocity`/`Position`) -> `move` (add/integrate `Velocity` to `Position`).
16:33:47FromDiscord<rlipsc> So when your later systems are using `Position` and `Velocity`, they're already processed. You can update them further, and next tick they get corrected according to your collisions.
16:34:05FromDiscord<Phil> Does the framework arbitrarily decide that order?
16:35:32FromDiscord<rlipsc> No, the order is decided in two ways. 1) by the order systems are seen with `makeSystem` (or `defineSystem` for 'forward declarations'), and 2) by putting systems into groups with `defineGroup`.
16:37:24FromDiscord<rlipsc> sent a code paste, see https://play.nim-lang.org/#ix=4eQB
16:37:49FromDiscord<rlipsc> (edit) "https://play.nim-lang.org/#ix=4eQB" => "https://paste.rs/JkC"
16:38:17FromDiscord<rlipsc> Here's the manual section on system order: https://github.com/rlipsc/polymorph#system-execution-order
16:40:04FromDiscord<rlipsc> A nice consequence of this is that it can make debugging easier because there's no callbacks. Everything's just run from top to bottom.
16:41:11*rockcavera joined #nim
16:41:11*rockcavera quit (Changing host)
16:41:12*rockcavera joined #nim
16:41:17FromDiscord<Phil> What parts would be parallelized? Computing actions on the individual entities?
16:41:29FromDiscord<rlipsc> It also means you don't have to manually write any dispatch code. System logic only runs when it's parameters are present, so you get inversion of control.
16:41:45FromDiscord<Phil> Like have s thread pool per system and they chunk through entities in parallel?
16:41:58FromDiscord<Phil> (edit) "s" => "a"
16:46:39*Guest77 joined #nim
16:46:39Guest77Hey guys
16:46:47FromDiscord<Phil> Heya
16:46:53Guest77how is it going?
16:47:04Guest77Just found out about nim
16:47:06Guest77looks nice
16:47:25FromDiscord<rlipsc> sent a long message, see http://ix.io/4eQF
16:48:10Guest77this link looks suspicious
16:48:28*Guest77 quit (Client Quit)
16:50:21FromDiscord<Phil> In reply to @rlipsc "In an ideal scenario": Ohhhhh that's why you group systems! That is Hella cool!
16:50:21FromDiscord<Phil> In reply to @Guest77 "this link looks suspicious": Link?
16:50:22FromDiscord<Phil> So that's how you intend the final boss of shared mutable data
16:50:26FromDiscord<planetis> Irc bridge pits long text in a paste
16:50:36FromDiscord<planetis> puts
16:50:41FromDiscord<Phil> Which essentially allows entirely different systems to modify the same entity at the same time but on different components of it
16:51:00FromDiscord<Phil> (edit) "So that's how you intend ... the" added "to beat"
16:51:25FromDiscord<rlipsc> In reply to @Isofruit "Which essentially allows entirely": Yep, exactly! 😄
16:51:36FromDiscord<Phil> I can confirm that no link was posted in the last 5 minutes
16:51:43FromDiscord<Phil> On discord at least
16:55:52FromDiscord<rlipsc> sent a code paste, see https://play.nim-lang.org/#ix=4eQM
16:56:20FromDiscord<Phil> I kinda love the underlying simplicity of the overall pattern
16:56:27FromDiscord<rlipsc> me too 🙂
16:56:38FromDiscord<Phil> Literally just a bunch of lists with pointers to objects
16:56:50FromDiscord<Phil> Well, not objects... Data boxes
16:57:05FromDiscord<Phil> And then you attach procs to those lists
16:57:13*dnh joined #nim
16:57:23FromDiscord<Phil> And dynamically add remove from them at runtime
16:58:52FromDiscord<rlipsc> Yeah! And as it boils down to just `proc` of processing `list[i]` it runs pretty fast!
17:01:42FromDiscord<Phil> It's kinda like Conway's game of Life if you think about it
17:01:51FromDiscord<Phil> Really simple basic rules
17:02:05FromDiscord<Phil> But the complexity that arises from their interaction is insane
17:02:14FromDiscord<Phil> Literally infinite
17:03:19FromDiscord<rlipsc> Another characteristic of the design is that systems are a window into component arena storage, so data locality is independent for each system. This makes it a lot easier to structure your design to run fast by splitting work into different components.
17:05:10FromDiscord<Phil> And just to make sure for my understanding, in your ECS you achieve polymorphism basically via tag components, correct?
17:08:05FromDiscord<rlipsc> sent a long message, see http://ix.io/4eQO
17:09:14FromDiscord<Phil> I think I would be hesitant to apply it to stuff that focuses on correctness such as payment systems as I would want to see the entire logic flow in its totality at any time
17:09:47FromDiscord<Phil> And with ECS I don't think I could easily predict the outcome of the totality of behaviour I define
17:09:53FromDiscord<auxym> In reply to @4zv4l "does it mean that": yes, exactly. ARC is particularly well suited for real-time systems, since its fully deterministic. all allocations and free's are determined at compile-time and can be inspected, etc.
17:12:13FromDiscord<4zv4l> but it leaks if there are cycles right ?
17:12:28FromDiscord<auxym> yes
17:12:33FromDiscord<4zv4l> do you have any example of a cycle ? because I really don't see a situation when it can happen
17:12:33FromDiscord<Phil> Correct, it requires you manually take care of those
17:12:51FromDiscord<rlipsc> ...and then I could write a `LogFile` component to summarise `TcpRecv` and log in a file of my choosing, add `GridMap` for spatial mapping to these network display entities, then let a user click on the connections and add `LogFile` arbitrarily at run time.
17:12:53FromDiscord<4zv4l> and so with nim I could just use a `free` function to take care of it ?
17:13:07FromDiscord<Phil> In reply to @4zv4l "do you have any": Doubly linked lists
17:13:44FromDiscord<auxym> its rare in embedded/RT systems to need cyclical structures though. You could use manual MM (`ptr, alloc, dealloc`) as a workaround, or the `{.cursor}` pragma (carefully)
17:13:55FromDiscord<4zv4l> In reply to @Isofruit "Doubly linked lists": that's the one who has link with the next and the previous node right ?
17:14:20FromDiscord<4zv4l> In reply to @auxym "its rare in embedded/RT": what does the `cursor` pragma ?
17:14:21FromDiscord<auxym> a cycle is eg. any graph or linked list with a cycle
17:14:38FromDiscord<auxym> https://nim-lang.org/docs/destructors.html#the-dotcursor-annotation
17:14:59FromDiscord<rlipsc> In reply to @Isofruit "And just to make": Entities are by nature polymorphic as they're fully abstract and can contain any components. Components can represent multiple design patterns within an ECS. Tags can be 'events', or things to separate processing, or anything you want 🙂
17:16:28FromDiscord<rlipsc> In reply to @Isofruit "And with ECS I": Can you expand on that, I consider ECS a pretty transparent design as logic runs in a fixed order.
17:16:30FromDiscord<Phil> In reply to @4zv4l "that's the one who": Aye
17:16:35FromDiscord<4zv4l> > With the .cursor annotation one can break up cycles declaratively↵even with that notation, how can arc knows if it can free it ?
17:16:42FromDiscord<rlipsc> (edit) "that," => "that?"
17:17:33FromDiscord<auxym> that's above my paygrade 😄 I don't know enough about ARC internals (or even GC in general)
17:20:23FromDiscord<rlipsc> In reply to @Isofruit "I think I would": I've actually been interested in trying the pattern for finance type stuff but couldn't think of a good project. Anything that comes to mind?
17:21:31FromDiscord<Phil> sent a long message, see http://ix.io/4eQR
17:22:18FromDiscord<Phil> (edit) "http://ix.io/4eQR" => "http://ix.io/4eQS"
17:22:37FromDiscord<Phil> Finding rule contradictions like that is the nightmare of the current payment system I work in
17:25:25FromDiscord<auxym> you might also be interested in pararules, in that same line of thought: https://github.com/paranim/pararules zach has a talk about from last year IIRC
17:25:32FromDiscord<Phil> In reply to @rlipsc "I've actually been interested": A fundamental finance systems is have products, you need to be able to pay them up front and in rates, you need to have immutable data somewhere so that in case of a data issue elsewhere you can rebuild your data from that immutable data storage. ( We use event sourcing for that one)
17:28:25FromDiscord<Phil> sent a long message, see http://ix.io/4eQT
17:29:02FromDiscord<Phil> You also need to be able to just turn renewal of and on arbitrarily while still in the timeframe of the initial product
17:29:31FromDiscord<Phil> After sports I'll try to recall some more of the more basic business logic
17:32:47*derpydoo quit (Ping timeout: 246 seconds)
17:34:33FromDiscord<rlipsc> Okay that's a nice spec to try the pattern against. It would be cool to have something like that in a data oriented style.
17:34:36FromDiscord<Phil> Ah! You need to be able to fetch lists of users that have a given product, users that are currently overdue on a single rate (if rate payment) or an entire product (if your trying to pay for an entire product at once), people you have forwarded to debt collectors, people that were overdue but have paid now, people that need their product renewal'd and some more I can't think of.↵You need to connect to banking systems via http calls to uplo
17:35:38FromDiscord<rlipsc> Using HTTP is already a component btw: https://github.com/rlipsc/polymers/blob/master/polymers/demos/web/simplewebsite.nim
17:36:02FromDiscord<Phil> Also some products have a timeframe (memberships) others don't ( e.g. purchases to boost your findability to other members on your service)
17:36:12FromDiscord<Phil> Nice!
17:36:26FromDiscord<rlipsc> sent a code paste, see https://play.nim-lang.org/#ix=4eQY
17:37:23FromDiscord<rlipsc> an entity in this context represents a TCP channel.
17:37:38*rockcavera quit (Remote host closed the connection)
17:38:40FromDiscord<Phil> Already have a component for interacting with messaging systems for e.g. Microservice interaction?
17:39:00FromDiscord<rlipsc> That website example does immediate dispatch BTW, so responses are sent as soon as they're received. For what you're talking about, I would queue HTTP responses in a system (instead of using `added:` events).
17:40:01FromDiscord<rlipsc> In reply to @Isofruit "Already have a component": There is a JSON RPC component: https://github.com/rlipsc/polymers/blob/master/polymers/demos/web/jsonrpc_ecsinfo.nim
17:40:25FromDiscord<rlipsc> I have considered something more specific though, like protobuf or something
17:40:49FromDiscord<rlipsc> of which Nim has a few libraries for 🙂
17:44:01FromDiscord<rlipsc> There's also ODBC database components so that might help. Here's a console database browser ECS using them https://github.com/rlipsc/polymers/blob/master/polymers/db/ecs_db.nim
17:44:57FromDiscord<rlipsc> (edit) "There's also ODBC database components ... sohttps://github.com/rlipsc/polymers/blob/master/polymers/demos/dbbrowser.nim" added "(https://github.com/rlipsc/polymers/blob/master/polymers/db/ecs_db.nim)" | "https://github.com/rlipsc/polymers/blob/master/polymers/db/ecs_db.nim" => "https://github.com/rlipsc/polymers/blob/master/polymers/demos/dbbrowser.nim"
17:46:02FromDiscord<planetis> In reply to @4zv4l "> With the .cursor": It's an escape hatch in order not to create cycles. It's equivalent to ptr and doesn't free.
17:48:52FromDiscord<ShalokShalom> https://youtu.be/WHyOHQ_GkNo
17:49:09FromDiscord<ShalokShalom> 100 seconds of Nim
17:49:22FromDiscord<Phil> You're like 3 hours late 😄
17:50:10FromDiscord<Tai> i came from that video
17:50:48FromDiscord<Tai> This programming language looks very interesting
17:50:57FromDiscord<ba5u> In reply to @ShalokShalom "100 seconds of Nim": same here
17:51:04FromDiscord<ShalokShalom> Hihi
17:51:23FromDiscord<auxym> Cool, already lots of people curious about Nim 🙂
17:51:29FromDiscord<ShalokShalom> @Tai Yeah, it is. Cyo, its community spin is even more interesting, IMHO
17:51:40FromDiscord<ShalokShalom> @auxym Yeah, Firebase has a huge community
17:52:52FromDiscord<ShalokShalom> And its content is pretty good, I think.
17:52:58FromDiscord<Tai> I want to try nim to make Discord bots
17:53:18FromDiscord<Tai> I usually use typescript but I want to try something new
17:53:19FromDiscord<jmgomez> Nimble is down?
17:53:38FromDiscord<jmgomez> What a bad timing, may it be to increase number of users?
17:53:40FromDiscord<jmgomez> https://nimble.directory/
17:53:45FromDiscord<ShalokShalom> In reply to @Tai "I want to try": There are actually a couple libraries to assist you
17:53:46FromDiscord<jmgomez> (edit) "increase" => "increased"
17:53:47FromDiscord<Phil> Hmmm appears so
17:54:11FromDiscord<jmgomez> seems to be back now!
17:54:35FromDiscord<Tai> In reply to @ShalokShalom "There are actually a": Any recommended?
17:54:45FromDiscord<ShalokShalom> @Tai that the good one↵↵https://github.com/krisppurg/dimscord
17:55:12FromDiscord<ShalokShalom> (edit) "@Tai that ... the" added "is"
17:55:59FromDiscord<Arathanis> Might be a repost, but it finally happened: https://www.youtube.com/watch?v=WHyOHQ_GkNo
17:56:04FromDiscord<Tai> Thx, I will go to learn
17:56:08FromDiscord<Arathanis> been waiting for them to do a Nim vid
17:59:26FromDiscord<Phil> In reply to @jmgomez "seems to be back": Still down for me
18:00:09FromDiscord<Phil> <@&371760044473319454> err... I know this isn't about moderation but nimble.directory appears to be down?↵Sends out http 502 responses
18:00:59FromDiscord<jmgomez> In reply to @Isofruit "Still down for me": yes, is back again for me too.. that's probably it that the server cant catch up. Im afraid that people will get frustrated and abandon the tries out
18:01:06FromDiscord<jmgomez> (edit) "back again" => "downagain"
18:03:05FromDiscord<EyeCon> FYI nimble.directory is down https://media.discordapp.net/attachments/371759389889003532/1037789022229106828/image.png
18:03:58FromDiscord<EyeCon> In reply to @Isofruit "<@&371760044473319454> err... I know": I can't read apparently, sorry for the duplicate
18:04:01FromDiscord<4zv4l> that's amazing how a simple video can have that much influence
18:04:28*phytolizer joined #nim
18:05:22phytolizerhi, i came to ask a question about some annoying Nimble behavior. when a test fails, it dumps the .exe file of the test right inside the tests/ directory. Is there a way to customize that, e.g. move it to the bin/ folder or something else i can readily add to gitignore?
18:05:43FromDiscord<Rika> doesnt .exe work?
18:05:46phytolizer(yes, i can ignore *.exe, but i'd rather not see them mixed with my tests)
18:06:09FromDiscord<Rika> not sure then
18:06:36phytolizerit has binDir which moves the binary out of the root dir, i was hoping there'd be something similar for test exes but i haven't been able to find it
18:06:59phytolizeri suppose i could just define my own test task :/
18:08:05FromDiscord<auxym> or PR nimble 🙂
18:09:01phytolizertrue, i could do that. would have to wait till i get off work though;)
18:09:49FromDiscord<planetis> Are you ok posting a link to something already made?
18:09:52*arkurious quit (Ping timeout: 252 seconds)
18:10:17phytolizerme?
18:10:19FromDiscord<planetis> Here https://github.com/status-im/nim-drchaos/blob/master/drchaos.nimble#L12
18:11:02phytolizeroh this looks handy. thanks, i'll try and adapt it
18:14:36*jjido joined #nim
18:18:00FromDiscord<jmgomez> Is someone doing something about nimble?
18:22:38*arkurious joined #nim
18:29:51*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
18:37:16FromDiscord<EyeCon> sent a code paste, see https://play.nim-lang.org/#ix=4eRc
18:37:47FromDiscord<EyeCon> sent a code paste, see https://play.nim-lang.org/#ix=4eRd
18:37:57FromDiscord<EyeCon> This used to work at some point, I have the executable from then
18:38:02FromDiscord<EyeCon> What can I do to resolve this?
18:38:22FromDiscord<EyeCon> I thought the noconv pragma on `do` resolves this, and I remember this working
18:39:50FromDiscord<EyeCon> I tried to test on devel but then it chokes on jsony because of the effects
18:40:59FromDiscord<ShalokShalom> In reply to @Arathanis "been waiting for them": They did a Godot vid just recently
18:41:24FromDiscord<4zv4l> is there any `crypto` lib in the stdlib ?
18:41:51FromDiscord<Tai> any formatter?
18:43:50FromDiscord<4zv4l> In reply to @Tai "any formatter?": what do you need ?
18:44:12FromDiscord<Tai> Format code on save
18:44:37FromDiscord<4zv4l> I didn't really look for that↵but vim can format it for you
18:44:49FromDiscord<Tai> i use vscode
18:45:23FromDiscord<4zv4l> you want it to format the spaces/tabs right ?
18:46:00FromDiscord<4zv4l> I think as far as you setup your preference in vscode (using spaces instead of tab, size of tab)↵you have a command or a shortcut to format the file
18:46:55FromDiscord<exelotl> the formatter is called nimpretty, I'd be surprised if the nimsaem github extension couldn't utilise it
18:47:04FromDiscord<exelotl> (edit) "github" => "vscode"
18:47:26phytolizeri believe nimsaem does use nimpretty, it at least does something when i press format
18:48:48FromDiscord<exelotl> In reply to @4zv4l "is there any `crypto`": I don't think there's anything in the stdlib, but https://github.com/cheatfate/nimcrypto is good I think
18:49:14*rockcavera joined #nim
18:49:15*rockcavera quit (Changing host)
18:49:15*rockcavera joined #nim
18:50:19FromDiscord<4zv4l> In reply to @exelotl "I don't think there's": I'm taking a look at it but the doc seems...weird
18:50:53FromDiscord<4zv4l> the comments of the proc here https://media.discordapp.net/attachments/371759389889003532/1037801052398952518/image.png
18:51:36FromDiscord<Phil> I'd generally rather recommend directly making use of hashing packages such as openssl or using libsodium bindings
18:51:58FromDiscord<4zv4l> from C ?
18:52:07FromDiscord<Phil> It's hard to beat the speed of their implementations
18:52:08FromDiscord<Phil> Aye
18:52:19FromDiscord<4zv4l> would be nice to make wrapper around them tho
18:52:36FromDiscord<4zv4l> same goes for libpcap that I wish I can use easily with a wrapper
18:53:01FromDiscord<Phil> I use like one specific hashing proc from openssl to imitate how Django hashes passwords by default
18:53:21FromDiscord<4zv4l> well I was looking for an asymmetric encryption solution in Nim
18:54:02FromDiscord<Phil> At that point I'm out, I know very little in general about crypto and that one proc was already difficult for me as I'm not a massive fan of c
18:54:04FromDiscord<4zv4l> `nacl` one specifically
18:54:37FromDiscord<dlesnoff> In reply to @4zv4l "`nacl` one specifically": There is no full crypto solution in Nim
18:54:46FromDiscord<Pietro Peterlongo> Let me ping federico3 form matrix\: nimble directory is down!↵(@jmgomez)
18:54:48FromDiscord<dlesnoff> In reply to @4zv4l "`nacl` one specifically": nacl is libsodium I think
18:55:08FromDiscord<Phil> Maybe https://github.com/zielmicha/libsodium.nim ?
18:55:28FromDiscord<Phil> In reply to @Pietro Peterlongo "Let me ping federico3": It is on again
18:55:34FromDiscord<Phil> At least for be
18:55:52FromDiscord<Phil> Me
18:55:52FromDiscord<dlesnoff> wait no it isn't the same thing as libsodium https://github.com/aschoepe/nacl
18:55:59FromDiscord<4zv4l> In reply to @Isofruit "Maybe https://github.com/zielmicha/libsodium.nim ?": indeed, looks quite old but there are SecretBoxes at least
18:56:32FromDiscord<Phil> I'm beginning to think all the crypto people are super salty given these package names
18:57:02FromDiscord<4zv4l> lmao xD nice joke
18:58:16FromDiscord<Phil> If that doesn't suit you, there are a couple packages that can be found in nimble.directory when searching for crypto
18:59:31FromDiscord<Phil> The only one I ever used was nimcrypto and for the password hashing solution I had it was like half as fast or even slower than the openssl equivalent
19:00:04FromDiscord<Phil> Which is why for my Webapplication I eventually dropped it
19:00:14FromDiscord<rlipsc> Check out https://github.com/status-im/ for crypto (both cryptocurrency and encryption) related stuff.
19:01:16FromDiscord<Phil> Status is actually a fairly big player in the Nim ecosystem in general. The projects that spawned from their team are pretty solid
19:01:32FromDiscord<4zv4l> well that was more to check crypto libs in Nim↵my program for now is made in Zig, and I was just wondering how it would look in Nim, probably shorter and cleaner
19:02:03FromDiscord<4zv4l> I was a huge fan of Go before and I try to move my project from Go to Nim
19:02:21FromDiscord<Phil> Fascinatingly not too long ago I had to write docs on how to use the zig compiler to compile Nim projects
19:02:43FromDiscord<4zv4l> Zig is really amazing too↵I love those two languages
19:03:09FromDiscord<Phil> Mostly to allow you to compile against glibc versions of ancient Ubuntu versions while you're on arch and too lazy to set up a container just for compiling
19:03:37FromDiscord<4zv4l> what is more annoying is that from the 3 languages I chose to keep↵only Ruby has a decent packets capture lib↵which is nice but if I want to make an IDS or something I don't want to start using FFI or interop with C code
19:03:37FromDiscord<Phil> Which means I wrote docs for the target group of me and myself, I'll be honest
19:04:16*wallabra_ joined #nim
19:05:01FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4eRl
19:06:10FromDiscord<4zv4l> since Nim can easily interop with C the questions is always, do I wrap a lib or make it from scratch ?↵because I have two libs in mind that saved me when I wanted to share my program `nim-regex` (which doesn't require the extra dll) and an http one to avoid packing the `ssl` dll too
19:06:28*wallabra quit (Ping timeout: 248 seconds)
19:06:28*wallabra_ is now known as wallabra
19:07:59*phytolizer quit (Quit: Client closed)
19:08:34FromDiscord<Phil> The answer IMO should almost always be to wrap
19:09:20FromDiscord<Phil> At least if it's highly complicated stuff like cryptography and hashing
19:11:13FromDiscord<4zv4l> yes right I agree↵to avoid making errors or making it slower
19:12:02FromDiscord<pietroppeter> In reply to @Isofruit "It is on again": Huh, for me still off
19:12:55FromDiscord<dlesnoff> In reply to @Isofruit "The answer IMO should": security errors could happen in library wrapping too, but I agree it seems safer.
19:14:59FromDiscord<Phil> In reply to @pietroppeter "Huh, for me still": Ah, now off again for me to, not sure what is bringing it down to its knees
19:15:16FromDiscord<System64 ~ Flandre Scarlet> https://www.youtube.com/watch?v=WHyOHQ_GkNo↵He made a video about Nim
19:15:37FromDiscord<Phil> Yeh we aware 😄
19:15:51FromDiscord<System64 ~ Flandre Scarlet> wait, why aren't videos rendered?
19:16:06FromDiscord<dlesnoff> we even posted it on the forum and on reddit
19:16:12FromDiscord<Phil> It and images are generally blocked from rendering
19:16:20FromDiscord<System64 ~ Flandre Scarlet> Oh, sorry
19:16:24FromDiscord<Phil> Unless you upload the images yourself
19:16:48FromDiscord<System64 ~ Flandre Scarlet> This is weird
19:32:29FromDiscord<ShalokShalom> sent a code paste, see https://play.nim-lang.org/#ix=4eRr
19:43:05FromDiscord<ShalokShalom> https://github.com/jmgomez/NimForUE#why-nim
19:43:17FromDiscord<ShalokShalom> Thats a real nice description of Nim.
19:43:26FromDiscord<ShalokShalom> Hyper hyper 😅👍🏻
19:44:57termerthat repo looks awesome
19:47:58FromDiscord<planetis> Btw did you noticed something missing from the fireship video comments?
19:48:28FromDiscord<Phil> ~~Complaints about style insensitivity were missing~~
19:48:58FromDiscord<planetis> yep
19:48:58FromDiscord<dlesnoff> But he did not mention it as a feature of the language at all
19:49:31*jjido joined #nim
19:50:32FromDiscord<dlesnoff> (edit) "But he" => "He" | "Hedid not mention it as a feature of the language at all ... " added "in his video"
19:58:00FromDiscord<rlipsc> In reply to @ShalokShalom "Thats a real nice": Here's my 'why Nim' 😄 https://github.com/rlipsc/polymorph#why-nim
20:04:43FromDiscord<ygol55> In reply to @rlipsc "Here's my 'why Nim'": wait wait, why nim?
20:05:52FromDiscord<guttural666> any more concise way to check if an int is part of an enum? nimlsp has forsaken me 😛 https://media.discordapp.net/attachments/371759389889003532/1037819923629609040/image.png
20:06:37FromDiscord<guttural666> looking for something like .contains() or in
20:06:47FromDiscord<rlipsc> > Fully control the memory if you so desire (including move semantics).↵That's one my favorite parts of the language design. The defaults are made for both productivity and speed, and full control when you want.
20:07:31FromDiscord<rlipsc> In reply to @ygol55 "wait wait, why nim?": As in, why I chose Nim to make the library 🙂
20:09:05FromDiscord<exelotl> In reply to @guttural666 "any more concise way": `i in ord(func_id.low)..ord(func_id.high)` right?
20:09:24FromDiscord<jmgomez> In reply to @ShalokShalom "https://github.com/jmgomez/NimForUE#why-nim": haha thanks
20:10:18FromDiscord<jmgomez> In reply to @rlipsc "Here's my 'why Nim'": love this one too. I will grab a few ideas from there 😄
20:10:21FromDiscord<guttural666> I'm kind of missing the dedicated page in the documentation where all available procs for type enum etc. are just listed, think I said this before, the docs are very extensive and well done but painful to search nativelyon the site
20:10:50FromDiscord<guttural666> In reply to @exelotl "`i in ord(func_id.low)..ord(func_id.high)` ": not really that more concise or expressive, but will try that out, thanks!
20:11:18FromDiscord<ShalokShalom> In reply to @rlipsc "Here's my 'why Nim'": Thanks!
20:11:50FromDiscord<Phil> Hmmm how do you get a ref of a value object?
20:11:58*phytolizer joined #nim
20:12:13FromDiscord<Phil> In reply to @ShalokShalom "Thanks!": You seen his talk about polymorph yet? It's pretty good and well explaining (well, it was to me)
20:13:46FromDiscord<ShalokShalom> @rlipsc can I use this just in any game engine?
20:13:47FromDiscord<ShalokShalom> Or do I need to implement that
20:13:57FromDiscord<ShalokShalom> In reply to @Isofruit "You seen his talk": No, not yet?
20:14:04FromDiscord<ShalokShalom> From the NimConf2022?/
20:14:27FromDiscord<Phil> In reply to @ShalokShalom "No, not yet?": https://www.youtube.com/watch?v=zCHZ0l7nLA0
20:14:30FromDiscord<Phil> Aye
20:14:33FromDiscord<jmgomez> In reply to @Isofruit "Hmmm how do you": doesnt a ptr work?
20:16:13FromDiscord<guttural666> just checked out YAML for Nim the other day, my god is serialization dead simple, makes C++ look fucking stupid, listing class members like a pleb for de/serialization 😄
20:17:34FromDiscord<Phil> On the last line
20:17:36FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4eRC
20:17:58FromDiscord<Phil> Ignore the comments, I basically simplified the example from nim's manual for circular types
20:18:17FromDiscord<jmgomez> oh I mean for you to use a ptr instead of a ref, you go from value to ptr by using addrs/unsafeAddrs
20:19:05FromDiscord<Phil> But why not refs though for that sweet sweet reference counting? ^^
20:19:17FromDiscord<Phil> Does compile with ptr
20:19:30phytolizer@guttural666 that's what happens when you use a language with reflection and good macros ^_^
20:19:46FromDiscord<jmgomez> yeah, I dont know about that. If there is a hook for the GC to collect a type but you can use new if the type is not an instance
20:20:09FromDiscord<jmgomez> the problem is when the type is already a value and you want to convert it to ref, Im not sure if you can do that
20:20:25FromDiscord<jmgomez> (you can to a ptr though)
20:20:53FromDiscord<jmgomez> (edit) "collect" => "collect/ref"
20:21:10FromDiscord<jmgomez> you can try to do a cast but not sure if it will cause you problems
20:21:13phytolizer@jmgomez probably not without a copy, since value types end up on the stack and refs are on the heap/GC'd :P
20:21:15FromDiscord<jmgomez> from ptr to ref I mean
20:21:17FromDiscord<guttural666> In reply to @phytolizer "<@375727321958580228> that's what happens": dude, I have a hobby project trying to learn C++ and Qt, and I can't fathom how to this day they don't have compile time reflection, this is soooo powerful and necessary, makes you think the compiler is fucking stupid if even I can see at one glance how many data members a class has hahaha
20:21:41FromDiscord<jmgomez> In reply to @phytolizer "<@726017160115126333> probably not without": yeah but you can still point to the stack, cant you?
20:21:49phytolizeryes, but ref is for GC'd pointers iirc
20:22:44FromDiscord<Elegantbeef> Refs have to be on the heap as it's the only safe place for a pointer without a borrow checker
20:22:49FromDiscord<jmgomez> yeah, that's the part where Im not sure if doing a cast will cause issues.. I dont know much about the internals of the GCs, we dont use it
20:23:24FromDiscord<Elegantbeef> Nim's `ref`s are interoperable with C/C++'s pointers, but casting is generally not suggested
20:23:31phytolizeri'm not sure, as if you could cast a value to a ref it wouldn't actually be tracked by GC so idk
20:24:11phytolizercool thanks for the info @elegantbeef
20:27:55FromDiscord<planetis> the counter is placed before the pointer's address btw
20:28:06phytolizer@guttural666 yeah i'm writing an excel -> sqlite converter for work right now, and i couldn't imagine writing this in c++ lmao
20:28:35FromDiscord<guttural666> that sounds really cool, sqlite is an incredible project
20:28:50FromDiscord<guttural666> can you use Nim at work?
20:28:59phytolizersure is, and the nim bindings are really easy to use (even if it's just db.exec sql"blah")
20:29:12phytolizeryes i can use whatever i want for internal tooling
20:29:15FromDiscord<ygol55> Wait a sec, Nim is just done for replacing the job of others langauges?
20:29:25FromDiscord<guttural666> that's super cool
20:29:41FromDiscord<ygol55> I mean, Nim is more for game dev and gui and project that are made in python like that?
20:29:41phytolizermy boss was like "wtf is nim" at first but now he's happy
20:29:43FromDiscord<guttural666> I can just write ABAP at work haha
20:30:28FromDiscord<ygol55> wdym?
20:30:35phytolizerabap :O
20:30:52FromDiscord<guttural666> I'm really hoping for a "new Qt" for Nim, Rust or ZIG instead of C++, really want to write real desktop apps easily
20:31:12phytolizerwould be neat for sure, rust seems closest at the moment but none of them are production ready imo
20:31:25FromDiscord<guttural666> yeah, SAP master race hehe
20:31:47FromDiscord<guttural666> PopOS guys are working with Iced in Rust
20:32:12FromDiscord<guttural666> anything more exciting than C/C++ will make me happy
20:32:15phytolizeryeah it's definitely possible to do native stuff in rust, but i believe they use gtk bindings no?
20:32:31FromDiscord<guttural666> I think Iced is 100% Rust
20:33:04FromDiscord<guttural666> https://docs.iced.rs/iced/
20:33:12FromDiscord<ShalokShalom> In reply to @guttural666 "I'm really hoping for": Godot
20:33:35phytolizeroh i'm silly i thought it was their tiling WM stuff lol
20:33:36FromDiscord<guttural666> In reply to @ShalokShalom "Godot": is a game engine, not a GUI library 😛
20:33:46FromDiscord<ShalokShalom> https://medium.com/swlh/what-makes-godot-engine-great-for-advance-gui-applications-b1cfb941df3b
20:33:57FromDiscord<guttural666> that's just Gnome hackery, tried it a couple days ago, but also really cool
20:34:11FromDiscord<guttural666> better than the KDE Tiling KWin script for sure
20:34:32phytolizerthe only gui app i ever made was java awt so i'm definitely not knowledgeable about them
20:34:35phytolizeri had to write my own widgets
20:34:58FromDiscord<jmgomez> In reply to @ShalokShalom "Godot": I wonder if the license of UE will allow to use it for that too. Slate/UMG have some decent tools to make UI stuff
20:35:21FromDiscord<ShalokShalom> Well, the license of UE puts very little pressure on you
20:35:31FromDiscord<ShalokShalom> You dont earn more than a million
20:35:38FromDiscord<rlipsc> In reply to @ShalokShalom "<@800432830605819906> can I use": It should work in anything as it's stand alone. In terms of platforms, I've even compiled it to embedded . Some engines have their own ECS built in of course which might be specifically integrated.
20:35:41FromDiscord<ShalokShalom> So you are free to do, what you want.
20:35:46FromDiscord<ShalokShalom> But Godot is much smaller
20:35:49FromDiscord<guttural666> In reply to @phytolizer "i had to write": Java is an atrocity
20:35:57FromDiscord<ShalokShalom> 35mb for the whole game engine, then you strip
20:36:00phytolizeragree, but it's all i knew in HSXD
20:36:05FromDiscord<Phil> In reply to @phytolizer "the only gui app": Ah yes, Java Gui libs
20:36:08FromDiscord<ShalokShalom> Godot makes it possible to make even websites.
20:36:09FromDiscord<Phil> Did it once 5 years ago
20:36:12FromDiscord<jmgomez> In reply to @ShalokShalom "You dont earn more": I think it only apples to Games, but not sure
20:36:16FromDiscord<Phil> Haven't written a GUI since that wasn't a webpage
20:36:18FromDiscord<ShalokShalom> Unreal is what? Several dozen GB
20:36:24FromDiscord<Phil> I feel like that shit just scars you for life
20:36:24FromDiscord<jmgomez> (edit) "apples" => "applies"
20:36:40FromDiscord<guttural666> Eclipse is written in Java and I use it at work, thank god it has a Vim mode
20:36:46FromDiscord<jmgomez> In reply to @ShalokShalom "Unreal is what? Several": Oh no, it can be for a game 50Mb. So I guess just UMG with some work could be a few Mb
20:36:47phytolizereclipse.... ouch
20:36:51FromDiscord<ShalokShalom> In reply to @jmgomez "I think it only": Whatever. I think the license is fine. Its just, that Unreal is huge and the community would never adopt it
20:37:01FromDiscord<Phil> Look, I gave eclipse a try.... even I ended up in intellij
20:37:05FromDiscord<jmgomez> In reply to @ShalokShalom "Whatever. I think the": That's true
20:37:08FromDiscord<guttural666> without Vim mode it's pure cock and ball torture
20:37:11FromDiscord<ShalokShalom> Alone that it runs better on WINE than the unmaintained Linux version↵..
20:37:17FromDiscord<guttural666> but works well with the SAP backends
20:37:18phytolizersome angel told me about IJ in high school, never looked back
20:37:25FromDiscord<ShalokShalom> People would never choose it to be the next Qt
20:37:34FromDiscord<ShalokShalom> Alone from the mindset level
20:37:41FromDiscord<ShalokShalom> But Godot is MIT
20:37:49FromDiscord<guttural666> In reply to @phytolizer "some angel told me": what's IJ?
20:37:52phytolizerintellij
20:37:53FromDiscord<Phil> IntelliJ
20:37:53FromDiscord<ShalokShalom> And much more effective, thanks to Nodes.
20:38:35FromDiscord<guttural666> oh okay, I do know that
20:38:56FromDiscord<ShalokShalom> In reply to @rlipsc "It should work in": Thanks a lot
20:39:42FromDiscord<ShalokShalom> In reply to @guttural666 "is a game engine,": Its not only a game entine. Lots of applications use it, and the very Godot game engine itself is written in Godot
20:39:47FromDiscord<ShalokShalom> Godot is a Godot app
20:40:02FromDiscord<ShalokShalom> Do you think, your app exceeds the standards of it? 😄
20:40:06FromDiscord<guttural666> In reply to @ShalokShalom "Its not only a": ah okay, guess I'm out of the loop
20:40:40FromDiscord<guttural666> anything else than Electron is fine with me haha
20:40:41FromDiscord<ShalokShalom> This article is really good
20:40:44FromDiscord<ShalokShalom> https://discord.com/channels/371759389889003530/371759389889003532/1037826943313264660
20:41:08FromDiscord<guttural666> can't even build Electron on my laptop, it just shit its pants 3 times trying to build Balena Etcher yesterday including Electron
20:41:16FromDiscord<guttural666> 100% crap
20:49:44FromDiscord<ShalokShalom> Yeah
20:50:43FromDiscord<ShalokShalom> sent a long message, see http://ix.io/4eRN
20:51:05FromDiscord<ShalokShalom> So you dont see Electron as a dep of VSCode, since they incorporated the code
20:51:15FromDiscord<ShalokShalom> Its basicially a fork
20:51:16FromDiscord<guttural666> Teams is Electron as well, a simple chatting app uses 600 MB RAM it's ridic
20:51:21FromDiscord<guttural666> interesting
20:52:39FromDiscord<guttural666> why doesn't version 1 work? the compiler should be able to figure this out, no? what if the types are ambivalent in the tuple and I want to specify them? https://media.discordapp.net/attachments/371759389889003532/1037831699591090216/image.png
20:53:15FromDiscord<Elegantbeef> Nim doesnt have length inference for arrays
20:53:23FromDiscord<Elegantbeef> Arrays require a length and a type
20:53:40FromDiscord<Phil> In reply to @guttural666 "Teams is Electron as": Teams is its own browser over microsoft servers which includes a chat app and video calling
20:53:52FromDiscord<guttural666> yeah sure they do, but the compiler knows what to do if I just don't specify anything right 😄
20:54:02FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4eRO
20:54:02FromDiscord<Elegantbeef> Of course it does
20:54:04FromDiscord<Phil> And god damn does it run terrible on the "native" application
20:54:33FromDiscord<Elegantbeef> Nim's type inference is local so it's generally right to left not left to right
20:54:40FromDiscord<Elegantbeef> There are some cases that's untrue, but meh
20:54:41FromDiscord<guttural666> okay, haven't looked into tables yes, are these a distinct type?
20:54:54FromDiscord<Elegantbeef> The above is a sugar syntax for an array
20:55:01FromDiscord<Phil> Table = Hashmap
20:55:03FromDiscord<Elegantbeef> It emits the same as what you have
20:55:07FromDiscord<Phil> (edit) "Table = Hashmap ... " added "= dictionary"
20:55:22FromDiscord<Elegantbeef> Hence why i said table constructor syntax and not `std/tables`
20:55:31FromDiscord<guttural666> In reply to @Elegantbeef "It emits the same": very interesting, thanks for that
20:55:39FromDiscord<guttural666> yeah that looks very attractive
20:55:51FromDiscord<Phil> In reply to @Elegantbeef "Hence why i said": Wait a sec there's a second "kind" of table?
20:55:57FromDiscord<Elegantbeef> No
20:56:08FromDiscord<Elegantbeef> The above syntax emits an array and is called a table constructor
20:56:24FromDiscord<Elegantbeef> `const a = {a: b, c: d}` emits an array
20:56:26FromDiscord<Phil> Never heard before, I guess I'll have to google that one
20:56:34FromDiscord<Elegantbeef> `const a = {a: b, c: d}.toTable` emits a table
20:56:44*phytolizer quit (Quit: Client closed)
20:56:52FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#statements-and-expressions-table-constructor
20:56:55FromDiscord<Elegantbeef> Dont google go to the manual
20:57:00FromDiscord<guttural666> the table concept is really central to ABAP and a super useful concept, glad to see it represented in Nim in such a way
20:57:04FromDiscord<Phil> Ohhh its a nim specific thing
20:57:28FromDiscord<Elegantbeef> Well Nim doesnt have tables builtin, they're added in userspace
20:57:34FromDiscord<guttural666> yeah
20:57:39FromDiscord<ShalokShalom> Tables everywhere is a Lua thing
20:57:50FromDiscord<Elegantbeef> This syntax exists for some sugar for associative data
20:58:45FromDiscord<Elegantbeef> But luckily this syntax can be used anywhere, so httpheaders for instance
20:59:04FromDiscord<Elegantbeef> Much cleaner to read than the `[(a, b), (c, d)]` variant imo
20:59:05FromDiscord<ShalokShalom> Why do you know so much about Nim?
20:59:19FromDiscord<ShalokShalom> Did you dig into the compiler, or just had lots of convos or what?
20:59:23FromDiscord<Elegantbeef> I have been using it for years and contribute to the compiler
21:02:23FromDiscord<guttural666> tables does not automatically do SOA though correct?
21:03:00FromDiscord<Elegantbeef> The table syntax emits an array of tuples
21:03:00FromDiscord<rlipsc> In reply to @guttural666 "why doesn't version 1": `const files: auto = [("a", "b")]` 🙂
21:03:04FromDiscord<Elegantbeef> It's not an SOA
21:03:08FromDiscord<guttural666> yeah okay
21:03:15FromDiscord<Elegantbeef> Lol rlipsc really trolling
21:03:20FromDiscord<Elegantbeef> `: auto` is the same as no type
21:03:38FromDiscord<guttural666> haven't seen auto in Nim before, started to really miss it hahaha
21:03:50FromDiscord<guttural666> Germans love their Autos
21:03:50FromDiscord<Elegantbeef> You dont need it really
21:03:59FromDiscord<guttural666> no I don't thank you very much haha
21:04:02FromDiscord<Elegantbeef> Nim's auto is rarely used in reality
21:04:12FromDiscord<guttural666> auto in terms of C++ I mean
21:04:34FromDiscord<ShalokShalom> In reply to @guttural666 "Germans love their Autos": That would be uppercase then 😉
21:04:36FromDiscord<rlipsc> yeah iirc `auto` is sorta weird as it puts things at the generic stage of sempass?
21:04:47FromDiscord<Elegantbeef> Depends on where you use it
21:04:59FromDiscord<ShalokShalom> In German, there is no 'auto' that is a car, like in no instance of the lang 🙂
21:05:05FromDiscord<Elegantbeef> In parameters it turns it into a generic procedure
21:05:17FromDiscord<rlipsc> I've had issues using it when performing a dance of macro unfoldings
21:05:21FromDiscord<Elegantbeef> `proc doThing(a: auto)` == `proc doThing[T](a: T)`
21:05:31FromDiscord<Phil> We like cars so much we put them in front of every variable
21:05:47FromDiscord<Elegantbeef> For return types it infers the return type from the body
21:06:07FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4eRS
21:06:26FromDiscord<guttural666> In reply to @Elegantbeef "For return types it": oh so it does kind of work like CPP auto
21:06:50FromDiscord<guttural666> just don't need it for compile time type deduction of variables et al
21:07:02FromDiscord<Elegantbeef> Indeed
21:07:08FromDiscord<Elegantbeef> Anyway snow shovelling
21:12:23*phytolizer joined #nim
21:24:46*nisstyre quit (Ping timeout: 260 seconds)
21:26:54*phytolizer left #nim (#nim)
21:29:09FromDiscord<guttural666> In reply to @Elegantbeef "The table syntax emits": not with named fields though right, which makes it less useful 😦
21:30:30FromDiscord<Elegantbeef> Named tuples are a mistake, prove me wrong
21:30:45FromDiscord<guttural666> this version is probably more useful, to be able to dynamically address the fields right? https://media.discordapp.net/attachments/371759389889003532/1037841283231780884/image.png
21:30:51FromDiscord<guttural666> why so? haha
21:31:05FromDiscord<guttural666> named columns are pretty useful haha
21:31:29FromDiscord<Elegantbeef> I dont get the point of named tuples generally
21:31:49FromDiscord<Elegantbeef> They're not distinctly typed, so you have 0 type safety
21:32:09FromDiscord<guttural666> well, to address table fields by name without having to index?
21:32:26FromDiscord<Elegantbeef> Just use a proper table then
21:33:13FromDiscord<guttural666> proper table in Nim would be what?
21:33:16FromDiscord<konsumlamm> named tuples are useful as return type, when you want to return multiple values and you don't want to force people to remember which means what
21:33:28FromDiscord<guttural666> for example yeah
21:34:22FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4eRZ
21:35:22FromDiscord<guttural666> ahhhh, you would have to reference the definition though to make sure you got it right, yeah?
21:35:41FromDiscord<guttural666> this kind of structured binding or whatever in the for loop is very cool
21:36:01FromDiscord<Elegantbeef> `for x, y, in z` just does `z.pairs`
21:36:09FromDiscord<Elegantbeef> Which for table yields `(key, value)`
21:36:27FromDiscord<Elegantbeef> See i dont get why named tuples are better than objects here↵(@konsumlamm)
21:36:49FromDiscord<guttural666> object would be kind of equivalent right
21:36:51FromDiscord<Elegantbeef> The argument of "Oh you can unpack them" defeats the argument that "Named tuples are better cause you dont need to remember order"
21:36:56FromDiscord<konsumlamm> because it's more boilerplate to create a new object when you only use it for one or two functions
21:37:00FromDiscord<Elegantbeef> Object is 100% equivalent but statically typed
21:37:08FromDiscord<Elegantbeef> Distinctly typed\
21:37:59FromDiscord<guttural666> have to think about this, but your table solution is pretty cool
21:38:58FromDiscord<Elegantbeef> I just dislike the lack of distinct typing mostly 😄
21:39:03*jmdaemon joined #nim
21:39:15FromDiscord<guttural666> didn't quite get that part, reading the docs rn haha
21:39:38FromDiscord<guttural666> because the tuple members are distinctly typed as well arent they?
21:41:03FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4eS2
21:41:33FromDiscord<Elegantbeef> `(string, string)` implicitly converts to any named tuple that matches parameters regardless if it comes from a literal or not
21:42:38FromDiscord<guttural666> you would have to type mytuple = tuple[a, b: string] then and use that
21:42:45FromDiscord<Elegantbeef> Nope
21:42:52FromDiscord<Elegantbeef> `mytuple` is an alias it's not distinct
21:42:58FromDiscord<guttural666> ahh
21:43:07FromDiscord<Elegantbeef> Tuples are structurally typed
21:43:18FromDiscord<guttural666> so any tuple witht he same number of fields and the same type of fields would qualify
21:43:35FromDiscord<Elegantbeef> I think the field names do matter in some cases
21:44:18FromDiscord<guttural666> but in principle a return type of string, string would match any variable of any tuple with the type of string, string
21:46:07FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/Dg5
21:46:38FromDiscord<Elegantbeef> Named tuple -\> named tuple requires a signature match so field and types much match, but name -\> anoynmous doesnt matter about names they're just structurally typed
21:46:59FromDiscord<guttural666> yeah yeah okay
21:47:17FromDiscord<guttural666> that's pretty nuanced
21:47:20FromDiscord<Elegantbeef> So in the `doThing(getThing())` case you might feed a tuple of the same type from a different API that returns different things to a procedure that expects X thing
21:47:35FromDiscord<guttural666> yeah, I get it
21:47:50FromDiscord<guttural666> okay, gonna go with your solution then 😄
21:48:55FromDiscord<Elegantbeef> Hey you can use whichever you prefer i cannot force you to do anything 😛
21:50:58FromDiscord<guttural666> nah man, the technically best and optimal solution should always be preferred
21:51:22FromDiscord<guttural666> and I'm not gonna argue with a compiler author haha
21:51:39FromDiscord<Elegantbeef> I'm not an author
21:52:00*dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:52:00FromDiscord<Elegantbeef> I have supplied some bugfixes, i havent done anything fancy
21:52:38FromDiscord<guttural666> oh okay, well still way beyond my purview in Nim
21:57:27FromDiscord<guttural666> AMD's live stream for RDNA3 was insane btw
22:03:00FromDiscord<System64 ~ Flandre Scarlet> what is a clojure?µ
22:03:00FromDiscord<ShalokShalom> #offtopic
22:03:02FromDiscord<System64 ~ Flandre Scarlet> (edit) "clojure?µ" => "clojure?"
22:03:07FromDiscord<ShalokShalom> We talked about it here
22:03:25FromDiscord<ShalokShalom> In reply to @System64 "what is a clojure?": Closure you mean?
22:03:57FromDiscord<ShalokShalom> Clojure is a programming language
22:03:57FromDiscord<System64 ~ Flandre Scarlet> In reply to @ShalokShalom "Closure you mean?": Oh, yeah Closure
22:03:59FromDiscord<Phil> Closure is a function that accesses variables outside of its own definition
22:04:07FromDiscord<Phil> And encapsulates them
22:04:12FromDiscord<System64 ~ Flandre Scarlet> 🤯
22:04:14FromDiscord<Phil> In a simply said manner
22:04:22FromDiscord<ShalokShalom> In reply to @System64 "Oh, yeah Closure": https://en.m.wikipedia.org/wiki/Closure_(computer_programming)
22:04:26FromDiscord<Phil> That doesn't fully cover it afaik,, but it gives an idea
22:05:29FromDiscord<System64 ~ Flandre Scarlet> why is it useful?
22:05:43FromDiscord<Elegantbeef> do you mean a closure?
22:05:43FromDiscord<Elegantbeef> Clojure is a JS tool
22:05:58FromDiscord<System64 ~ Flandre Scarlet> Closure
22:06:38FromDiscord<ShalokShalom> In reply to @Elegantbeef "Clojure is a JS": You mean Clojurescript
22:06:41FromDiscord<Elegantbeef> Closure is a procedure or iterator that has a persistant environment
22:06:41FromDiscord<konsumlamm> Clojure is a programming language that runs on the JVM and JS, not a "JS tool"
22:07:05FromDiscord<ShalokShalom> And .NET
22:07:16FromDiscord<Elegantbeef> Clojure compiler is what i was thinking of
22:07:19FromDiscord<ShalokShalom> But its hardly any used there
22:07:28FromDiscord<ShalokShalom> Yeah, it has a JS backend.
22:07:43FromDiscord<ShalokShalom> JS, JVM and .NET
22:07:52FromDiscord<konsumlamm> the JS compiler is called closure again
22:07:58FromDiscord<ShalokShalom> Basically Lisp going mainstream
22:08:01FromDiscord<konsumlamm> (the one beef is talking about)
22:08:05FromDiscord<Elegantbeef> > The Closure Compiler is a tool for making JavaScript download and run faster.↵> I mean i'm not wrong to call it a JS tool
22:08:20FromDiscord<ShalokShalom> Ah, that one. Closure.
22:08:22FromDiscord<Elegantbeef> Yea I mistakenly got them mixed up
22:11:16FromDiscord<ShalokShalom> In reply to @System64 "why is it useful?": People call anonymous functions often Closures
22:11:31FromDiscord<ShalokShalom> As you can read in the Wikipedia text, is this not correct
22:11:32FromDiscord<Elegantbeef> No they dont
22:11:34FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4eSc
22:11:37FromDiscord<Elegantbeef> A closure is a specific type of procedure
22:11:38FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4eSc" => "https://play.nim-lang.org/#ix=4eSd"
22:11:45FromDiscord<ShalokShalom> In Nim
22:11:48FromDiscord<Elegantbeef> Which captures a state that allows calls after to reuse the v alue
22:11:56FromDiscord<Elegantbeef> Not even just in Nim
22:11:58FromDiscord<Elegantbeef> By definition
22:12:18FromDiscord<exelotl> Yeah, Nim can have anonymous procs which aren't closures
22:12:26FromDiscord<ShalokShalom> Nice
22:12:49FromDiscord<ShalokShalom> Anonymous func too, I guess
22:12:59FromDiscord<guttural666> anybody got an efficient idea to replace $USER with the current user in Nim to be able to copyFile() these bad boys? I could just call the cp command with execCmd from std/osproc to call console commands directly, dunno how good/efficient that is https://media.discordapp.net/attachments/371759389889003532/1037851913225506877/image.png
22:13:00FromDiscord<ShalokShalom> How does that look like?
22:13:14FromDiscord<Elegantbeef> The same as a closure just with `{.nimcall.}`
22:13:50FromDiscord<huantian> see <https://nim-lang.org/docs/os.html#getHomeDir>
22:13:57FromDiscord<huantian> and perhaps https://nim-lang.org/docs/os.html#getConfigDir
22:13:59FromDiscord<Phil> In reply to @rlipsc "It should work in": There is one thing I was deeply saddened by when I noticed it during the talk btw
22:14:08FromDiscord<huantian> or even https://nim-lang.org/docs/os.html#expandTilde,string
22:14:13FromDiscord<Phil> Abbreviated vairiable names.↵Everywhere
22:14:24FromDiscord<ShalokShalom> In reply to @guttural666 "anybody got an efficient": I love this for those issues↵↵https://github.com/Vindaar/shell
22:14:24FromDiscord<Phil> It tore at my heart and soul
22:14:50FromDiscord<Phil> Rendered me speechless
22:14:58FromDiscord<System64 ~ Flandre Scarlet> In reply to @Isofruit "I can *right now*": Oh alright, so just an anonymous function
22:15:06FromDiscord<ShalokShalom> In reply to @Isofruit "Abbreviated vairiable names. Everywhere": You also dislike that?
22:15:16FromDiscord<ShalokShalom> In reply to @System64 "Oh alright, so just": Haha
22:15:17FromDiscord<Phil> In reply to @System64 "Oh alright, so just": An anonymous function only accesses its own parameters, not stuff from the outside
22:15:34FromDiscord<Phil> Once it accesses the outside its a closure, by definition, due to having an environment
22:16:07FromDiscord<Phil> In reply to @ShalokShalom "You also dislike that?": It is a curse and like the one good thing I often see in Java Code
22:16:17FromDiscord<Phil> They don't abbreviate... as much
22:16:49FromDiscord<guttural666> the whole DSL thing in Nim is somethig I really don't wont to delve into rn, since I want to learn the base language and anything with macros et al in Nim is basically god mode, the getHomeDir stuff is acceptable though thanks! haha 😄
22:16:54FromDiscord<System64 ~ Flandre Scarlet> In reply to @Isofruit "An anonymous function **only**": variables must be global, no?
22:17:08FromDiscord<Phil> In reply to @System64 "variables must be global,": No, why would they?
22:17:38FromDiscord<huantian> In reply to @guttural666 "the whole DSL thing": I wonder if `~` is expanded automatically with other procs
22:17:43FromDiscord<huantian> so you might not even need `expandTilde`
22:18:12FromDiscord<guttural666> gonna try that rn
22:18:21FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4eSg
22:18:29FromDiscord<rlipsc> In reply to @Isofruit "Abbreviated vairiable names. Everywhere": as in ECS/DOD/OOP?
22:18:31FromDiscord<Phil> Once the scope of the block ends they're both gone
22:18:38FromDiscord<Phil> In reply to @rlipsc "as in ECS/DOD/OOP?": Nah, in the code examples
22:18:43FromDiscord<Phil> Pos
22:18:44FromDiscord<Phil> Vel
22:18:47FromDiscord<ShalokShalom> In reply to @Isofruit "It is a curse": Yeah, same. This is one of the things I love when coding in dotnet with fsharp
22:18:49FromDiscord<ShalokShalom> Also, same
22:18:50FromDiscord<rlipsc> Oh!
22:19:04FromDiscord<ShalokShalom> No abbrevitions
22:19:18FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4eSh
22:19:32FromDiscord<ShalokShalom> (edit) "abbrevitions" => "abbreviations"
22:19:47FromDiscord<guttural666> In reply to @huantian "I wonder if `~`": doesn't seem to
22:20:13FromDiscord<Elegantbeef> That's not even the definition↵(@Phil)
22:20:26FromDiscord<Elegantbeef> Anonymous has no name
22:20:40FromDiscord<ShalokShalom> sent a long message, see http://ix.io/4eSi
22:20:42FromDiscord<ShalokShalom> Thats the whole syntax xD
22:20:46FromDiscord<ShalokShalom> Well, basically
22:21:12FromDiscord<ShalokShalom> But yeah, get home dir is perfectly fine and probably more appropriate
22:21:23FromDiscord<ShalokShalom> Ah, this auto correct
22:21:36FromDiscord<ShalokShalom> (edit) "get home dir" => "getHomeDir"
22:21:38FromDiscord<Phil> In reply to @Elegantbeef "Anonymous has no name": Argh, right that goes into it as well. Strictly speaking that's the only thing needed but what you typically mean by that is literally a pure function without a name
22:22:26FromDiscord<Phil> I don't think I've ever seen folks speak about anonymous procs in my place and not mean pure funcs without names
22:22:33FromDiscord<Phil> (edit) "place" => "workplace"
22:22:42FromDiscord<Phil> (edit) "procs" => "functions"
22:23:01FromDiscord<Elegantbeef> An anonymous function is just an unnamed function
22:23:02FromDiscord<Elegantbeef> That's it
22:23:12FromDiscord<ShalokShalom> People confusing functions with procedures is one of the things that drive me nuts
22:23:32FromDiscord<Elegantbeef> All functions are procedures but not all procedures are functions
22:23:44FromDiscord<rlipsc> Originally they were `Position`, `Velocity`, `position.x += velocity.x`, but I thought it was less noisy and it's easier to take in with `Pos`, `Vel`, `pos.x += vel.x`.
22:23:59FromDiscord<guttural666> In reply to @ShalokShalom "Its literally ": that's the point, I want to use the base lang as much as poss first, to learn it
22:24:24FromDiscord<ShalokShalom> Ah, you mean you like to challenge you?/
22:24:34FromDiscord<ShalokShalom> And actually make yourself using the language
22:25:03FromDiscord<Phil> In reply to @guttural666 "that's the point, I": There is 2 macros I would genuinely recommend at least taking a look at once you delve into compile-time stuff
22:25:07FromDiscord<guttural666> In reply to @ShalokShalom "Ah, you mean you": I also use only standard c++ and stl in my c++ hobby project despite using Qt, cause I think I need to know c++ first, before using the Qt shit
22:25:22FromDiscord<ShalokShalom> In reply to @rlipsc "Originally they were `Position`,": Code gets written 1x and read 10x ↵↵People who have never read the code, usually strongly prefer not abbreviated code
22:25:28FromDiscord<ShalokShalom> For obvious reasons.
22:25:53FromDiscord<Phil> They're very simple ones, but extremely useful:↵The equivalent of "getField" and "setField".↵So that you can turn `getField(myObj, "fieldOnObj")` into `myObj.fieldOnObj`
22:26:06FromDiscord<ShalokShalom> In reply to @guttural666 "I also use only": Why not using Nim with QML?
22:26:29FromDiscord<ShalokShalom> I am still convinced Godot is the more convenient tool by miles
22:26:40FromDiscord<guttural666> In reply to @ShalokShalom "Why not using Nim": not ready to delve into that rn, setup is way harder than just to start Vim and Qt and there you go IU guess
22:26:50FromDiscord<ShalokShalom> But Nim with QML seems quite approachable
22:26:55FromDiscord<guttural666> okay
22:27:08FromDiscord<guttural666> I have so many things to learn haha
22:27:22FromDiscord<ShalokShalom> I wouldn't do it
22:27:32FromDiscord<rlipsc> Yeah that's fair and I did consider it. I suppose because I'm talking about them verbally as 'position' and 'velocity' it would make sense. Noted though for future talks.
22:27:34FromDiscord<Phil> In reply to @rlipsc "Originally they were `Position`,": For me personally I'll always advocate for the long-form as I find it more readable. Yeah more characters, but that is not that much.↵Then again, I'm not a game-writer, I'm a webdev
22:27:40FromDiscord<guttural666> not using QML anyway rn, I prefer coding all the GUI in cpp directly
22:27:41FromDiscord<ShalokShalom> I started a project, and noticed quickly that qml tools are just not there
22:27:44FromDiscord<ShalokShalom> Compared with Godot
22:27:49FromDiscord<ShalokShalom> Its not even close.
22:28:05FromDiscord<ShalokShalom> But I use KDE on my desktop
22:28:12FromDiscord<rlipsc> (edit) "Yeah that's fair and I did consider it. I suppose because I'm talking about them verbally as 'position' and 'velocity' ... iteasily" added "I thought" | "make sense." => "easily translate."
22:28:14FromDiscord<Phil> ~~I noticed~~
22:28:17FromDiscord<guttural666> In reply to @ShalokShalom "Compared with Godot": is there a good YT video on how to use Godot for GUI?
22:28:21FromDiscord<ShalokShalom> So QML seemed tempting to implement it natively.
22:28:21FromDiscord<Phil> ~~It was subtle~~
22:28:31FromDiscord<guttural666> KDE is just amazeballs
22:28:46FromDiscord<ShalokShalom> In reply to @guttural666 "is there a good": I would advise you the official Discord↵↵That has a UI section
22:29:06FromDiscord<ShalokShalom> https://medium.com/swlh/what-makes-godot-engine-great-for-advance-gui-applications-b1cfb941df3b
22:29:10FromDiscord<guttural666> literlly the first time I heard about this
22:29:28FromDiscord<ShalokShalom> The Godot UI itself is implemented in Godot
22:29:30FromDiscord<rlipsc> In reply to @Isofruit "For me personally I'll": Yeah it's easy to assume things people don't know when you've been working on something a while
22:29:36FromDiscord<ShalokShalom> So Godot is basically a Godot application
22:29:43FromDiscord<ShalokShalom> You open it as a project
22:29:45FromDiscord<rlipsc> So thanks for the feedback 🙂
22:29:48FromDiscord<Phil> While the link is nice
22:29:51FromDiscord<Phil> I detest login walls
22:30:02FromDiscord<ShalokShalom> Yeah 🙄
22:30:08FromDiscord<Phil> In reply to @rlipsc "So thanks for the": Amazing talk overall btw.
22:30:09FromDiscord<guttural666> In reply to @ShalokShalom "The Godot UI itself": how long have they been supporting this kind of stuff? I do have Godot in Steam and have coded basic movement in their srcipting lng
22:30:25FromDiscord<ShalokShalom> GDScript
22:30:29FromDiscord<guttural666> yeh
22:30:32FromDiscord<ShalokShalom> Supporting?
22:30:35FromDiscord<rlipsc> In reply to @Isofruit "Amazing talk overall btw.": Cheers!
22:30:57FromDiscord<Phil> In reply to @rlipsc "Cheers!": The fact I could follow along with a knowledge base of barely more than having a decent understanding of poymorphism and OO and we could literally talk about some of the more nitty gritty stuff is quite something!
22:31:13FromDiscord<guttural666> I assumed they used something like dear imGUI for their tools
22:31:16FromDiscord<Phil> (edit) "something!" => "something and a testament of how well you explained it!"
22:31:25FromDiscord<ShalokShalom> There are also UI videos on Youtube
22:31:32FromDiscord<ShalokShalom> Most of them show Godot 3
22:31:44FromDiscord<ShalokShalom> Godot 4 is in beta 4
22:32:04FromDiscord<guttural666> Godot has really made a lot of strides recently, I think I've seen a talk on them implementing Vulkan rendering
22:32:11FromDiscord<ShalokShalom> Yep
22:32:23FromDiscord<ShalokShalom> Thats Godot 4 biggest feature
22:32:33FromDiscord<ShalokShalom> They were already great for 2D stuff
22:32:39FromDiscord<guttural666> yeah
22:32:40FromDiscord<ShalokShalom> Now they are great at 3D as well.
22:38:09FromDiscord<ShalokShalom> I should mention, the new binding is not ready yet
22:38:13FromDiscord<ShalokShalom> https://github.com/Hapenia-Lans/gdextension-nim
22:38:25FromDiscord<ShalokShalom> Godot 3 binding is top notch.
22:39:30FromDiscord<guttural666> this is pretty amazing, I'm always searching for new GUI solutions with good languages like Nim, Zig, Rust etc.
22:39:53FromDiscord<ShalokShalom> Yeah. And you can mix
22:40:04FromDiscord<ShalokShalom> So long as there are bindings
22:40:14FromDiscord<ShalokShalom> Every node can have its own language
22:40:16FromDiscord<guttural666> without having to be a fucking expert in DLL and binding and FFI shite, I'm just a noob who writes console apps and Qt haha
22:40:24FromDiscord<ShalokShalom> And I happen to co maintain...
22:40:38FromDiscord<guttural666> nice work man
22:40:50FromDiscord<ShalokShalom> https://github.com/Vivraan/godot-lang-support
22:40:56FromDiscord<ShalokShalom> This list here 😅😅😅
22:41:10FromDiscord<ShalokShalom> In reply to @guttural666 "without having to be": Yeah, absolutely
22:41:18FromDiscord<ShalokShalom> the whole deployment.
22:41:25FromDiscord<ShalokShalom> Dont get me started
22:41:44FromDiscord<guttural666> just bookmarked, gotta read up on this
22:41:52FromDiscord<ShalokShalom> With sdk contracts signed, you could even develop for xbox, switch, ps and so
22:42:22FromDiscord<ShalokShalom> https://discord.gg/wNRMBQeJ
22:42:33FromDiscord<ShalokShalom> You`re welcome
22:43:01FromDiscord<ShalokShalom> (Hope anyone helps with the bindings 😄 )
22:47:08FromDiscord<guttural666> how do I adress the last char of a string? https://media.discordapp.net/attachments/371759389889003532/1037860508243591320/image.png
22:47:25FromDiscord<Elegantbeef> `tdir[^1]`
22:47:38FromDiscord<guttural666> that carrot does what?
22:47:56FromDiscord<Elegantbeef> Reverse index
22:47:59FromDiscord<Elegantbeef> `^1` is last
22:48:04FromDiscord<Elegantbeef> `^2` is second from last
22:48:16FromDiscord<guttural666> right, I've read that, that's very useful
22:48:24FromDiscord<guttural666> i remember thanks!
22:49:05FromDiscord<Elegantbeef> You also dont really need `()` on `len` or `high`
22:49:28FromDiscord<Elegantbeef> It's pretty clear that they're properties
22:49:36FromDiscord<guttural666> if there are no params I don't need it rigt?
22:49:46FromDiscord<guttural666> oh they are
22:49:47FromDiscord<guttural666> okay
22:50:53FromDiscord<guttural666> and single quotes for a char
22:51:02FromDiscord<guttural666> works now, thanks
22:57:52FromDiscord<guttural666> @ElegantBeef : if a table were subject to change layout wise I still think it would be better to use at least an array of objects, especially with a lot of dependencies in place, or a custom data structure right?
22:58:11FromDiscord<Elegantbeef> No clue what you mean, but i'll say sure
22:59:08FromDiscord<guttural666> if the ordering here at the definition were subject to change https://media.discordapp.net/attachments/371759389889003532/1037863529782444032/image.png
22:59:28FromDiscord<guttural666> I would invalidate all dependent for loops for example
23:00:04FromDiscord<ShalokShalom> @guttural666 nice you use fish?
23:00:09*wallabra quit (Ping timeout: 255 seconds)
23:00:44FromDiscord<guttural666> with for file, dir in files, that would no longer bet true and with a lot of such dependencies, a named reference would be better
23:00:58FromDiscord<guttural666> In reply to @ShalokShalom "<@375727321958580228> nice you use": yeah man, best ever
23:01:01FromDiscord<ShalokShalom> I wrote my first 'publicly released' source code in it 😅↵↵Same wrapper for the package management at Arch
23:01:11FromDiscord<ShalokShalom> In reply to @guttural666 "yeah man, best ever": Yeah, absolutely love it.
23:02:34FromDiscord<guttural666> In reply to @ShalokShalom "Yeah, absolutely love it.": I'm trying to write a "config copier" for my linux systems rn, that is able to export all the important config files for fish, vim etc. and import them to a new system + install all the standard software I want on a new arch based installation ^
23:03:10FromDiscord<guttural666> maybe even KDE auto styling but that's something for the future 😄
23:03:35FromDiscord<ShalokShalom> https://codeberg.org/ShalokShalom/add
23:03:39FromDiscord<guttural666> change grub to wait = 0 etc
23:03:49FromDiscord<guttural666> all the standard stuff, correct scroll direction etc haha
23:03:53FromDiscord<ShalokShalom> In reply to @guttural666 "I'm trying to write": Ah nice
23:04:07FromDiscord<guttural666> Garuda is so fucking sexy
23:04:19FromDiscord<guttural666> thats on my gaming PC rn
23:04:26FromDiscord<ShalokShalom> sent a long message, see http://ix.io/4eSq
23:04:31FromDiscord<ShalokShalom> Yeah, using Garuda too 😅❤️
23:04:38FromDiscord<guttural666> no clue what you're talking about but yeah haha
23:04:51FromDiscord<guttural666> using endeavourOS KDE on my laptop rn
23:05:07FromDiscord<ShalokShalom> https://codeberg.org/ShalokShalom/Linda
23:05:17FromDiscord<guttural666> Garuda is amazing but kind of excessive for a dev machine haha
23:05:38FromDiscord<ShalokShalom> Nspawn is container management, that every distro supports, that uses systemd
23:05:44*wallabra joined #nim
23:05:52FromDiscord<ShalokShalom> And I like to implement a GUI for it
23:05:53FromDiscord<guttural666> thats way over my head
23:06:28FromDiscord<guttural666> I'm happy to be able to migrate my vimrc and fish.config from one machine to another with one exe, thats my goal atm
23:06:46FromDiscord<guttural666> maybe even auto download them from gitlab haha
23:06:54FromDiscord<ShalokShalom> sent a long message, see http://ix.io/4eSr
23:06:59FromDiscord<guttural666> yeah yeah
23:07:04FromDiscord<ShalokShalom> Just for the desktop, more integrated into Linux
23:07:25FromDiscord<guttural666> I'm distro hopping like a whore again rn, but reconfiguring basics annoys me
23:07:31FromDiscord<guttural666> thats my use case
23:07:41FromDiscord<ShalokShalom> Yeah, totally get that
23:07:45FromDiscord<guttural666> hehehe
23:08:04FromDiscord<ShalokShalom> I jumped from distro to distro, till KaOS catched me for 7 years
23:08:13FromDiscord<ShalokShalom> Now for about 1 year at Garuda.
23:08:21FromDiscord<ShalokShalom> Super happy since then.
23:09:20FromDiscord<guttural666> I had Manjaro KDE on all my machines for a long time, then switched to Garuda on all, now I'm looking around and experimenting with a bunch of Arch based distros
23:10:12FromDiscord<ShalokShalom> @guttural666 https://pypi.org/project/dotfiles-sync/
23:10:52FromDiscord<guttural666> In reply to @ShalokShalom "<@375727321958580228> https://pypi.org/project/dotf": gonna write that myself, gotta learn haha
23:13:31FromDiscord<ShalokShalom> Good so!
23:16:32FromDiscord<guttural666> https://gitlab.com/hansdampfinger666/flubber
23:16:46FromDiscord<guttural666> this is my level rn, if you want to take a look 😄
23:20:36FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4eSw
23:20:58FromDiscord<ShalokShalom> Do you know about the benefits of let/const and func?
23:22:01FromDiscord<guttural666> sent a code paste, see https://play.nim-lang.org/#ix=4eSx
23:22:31FromDiscord<guttural666> In reply to @ShalokShalom "Do you know about": compile time vs. run time benefits I suppose
23:22:58FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4eSy
23:23:05FromDiscord<Elegantbeef> `var (fdir, tdir) = (fromDir, toDir)`
23:23:22FromDiscord<Elegantbeef> But even then it doesnt make sense as you dont mutate them afaict
23:24:39FromDiscord<ShalokShalom> sent a long message, see http://ix.io/4eSA
23:24:58FromDiscord<ShalokShalom> Those things help, to keep the code easy to test and scale.
23:26:14FromDiscord<ShalokShalom> Like, you can easier see, when you call a side effect, and it's not as easy to change a variable by accident.
23:26:23FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4eSC
23:26:53FromDiscord<Elegantbeef> Also types are conventionally UpperPascalCase
23:27:00*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
23:28:41FromDiscord<guttural666> In reply to @Elegantbeef "But even then it": talked about this couple days ago, I would have liked to have a default for a variable variable
23:29:20FromDiscord<guttural666> to be able to not have to provide anything at the call site and still be able to default the inpuit param to current dir or something like that
23:29:58FromDiscord<guttural666> I since then changed a couple of instances of this to just use var and then default to seomthing if the input was ""
23:30:30FromDiscord<guttural666> since copying the immutable params was a useless copy and therefor inefficient
23:31:34FromDiscord<guttural666> In reply to @ShalokShalom "const vs let has": yeah I knew that, basically comptime in ZIG or constexpr in CPP I think
23:32:41FromDiscord<Elegantbeef> Also you dont need the `none` flag unless you use that enum value
23:32:47FromDiscord<Elegantbeef> `{}` is an empty set and it has no bits on 😄
23:33:19FromDiscord<guttural666> okay that makes sense, gonna drop that
23:33:38FromDiscord<guttural666> default initialized also works tho?
23:33:50FromDiscord<Elegantbeef> Yes default value for a set is empty
23:34:34FromDiscord<guttural666> okay, I'm used to providing a NONE or invalid as the first option since CPP will default to 0 etc.
23:34:49FromDiscord<Elegantbeef> Nim also defaults to 0
23:34:59FromDiscord<Elegantbeef> But Nim bitsets arent dumb like `a | b` in C++
23:35:21FromDiscord<ShalokShalom> sent a long message, see http://ix.io/4eSF
23:35:36FromDiscord<ShalokShalom> Nim is a bit .. disinterest about that
23:35:54FromDiscord<Elegantbeef> If they're contiguous the bit position they occupy is always their position in the enum
23:36:08FromDiscord<guttural666> okay, so the normal enums would have to have a 0 = none value right, that would be the safe thing to do if you forget to set it
23:36:24FromDiscord<guttural666> aside from bitset
23:37:29FromDiscord<guttural666> In reply to @ShalokShalom "Serious functional languages share": this should be copy elision right?
23:37:52FromDiscord<Elegantbeef> No normal enums do not have a `0 = none`
23:38:07FromDiscord<Elegantbeef> Normal enums start off at `0` but when you use a bitset the ordinal value is their bit position
23:38:40FromDiscord<guttural666> yea, but talking about normie enums
23:38:50FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4eSG
23:39:18FromDiscord<guttural666> it would be prudent to define the first entry as none and handle that case in case anybody just declares and does not explicitly define the bad boy
23:39:19FromDiscord<guttural666> right
23:39:28FromDiscord<Elegantbeef> No
23:39:34FromDiscord<Elegantbeef> Only if you need a `none` value
23:39:39FromDiscord<guttural666> okay
23:40:06FromDiscord<guttural666> because a not defined enum in nim is not equal to the first option
23:40:26FromDiscord<Elegantbeef> It is equal to the first option
23:40:36FromDiscord<Elegantbeef> So if you need none you use it otherwise you dont
23:41:18FromDiscord<guttural666> yeah yeah, but if you forget to set an enum, that is declared as {yes, no} you will get a false positive yknow
23:41:30FromDiscord<Elegantbeef> If you're using a set you get `{}`
23:41:32FromDiscord<guttural666> because nim will auto define it with a default val
23:41:40FromDiscord<guttural666> a set yes
23:41:41FromDiscord<Elegantbeef> That's not a false positive that's a empty set
23:41:50FromDiscord<Elegantbeef> A normal enum yes you will get yes
23:42:02FromDiscord<guttural666> yeah, now were talking 😄
23:42:41FromDiscord<guttural666> that's what I meant and that is why I think it's prudent to reserve the standard initialized value of an enum to none/ n/a etc.
23:43:01FromDiscord<Elegantbeef> Well you're actually using none here so yes
23:43:07*pyrex is now known as coolbat666
23:43:14FromDiscord<guttural666> yes! 😄
23:43:16FromDiscord<Elegantbeef> I dont often have the need for `none` in my enums
23:43:32FromDiscord<guttural666> I don't either, just thinking ahead needlessly 😄
23:43:38FromDiscord<Elegantbeef> I did say multiple times if you dont use `none` then there is no need for it
23:43:46FromDiscord<Elegantbeef> You use it as a value so you need it
23:43:54FromDiscord<guttural666> yes, now I get what you meant
23:44:25*coolbat666 is now known as pyrex
23:45:24FromDiscord<guttural666> everything that is not explicitly initialized or deliberately set to none can be dealt with a certain way
23:45:58FromDiscord<guttural666> everything that is implicitly