<< 31-07-2023 >>

00:00:49FromDiscord<arathanis> @System64 ~ Flandre Scarlet if you want to see how an ECS design enables modular, dynamic, and deep gameplay and design play Caves of Qud
00:00:56FromDiscord<arathanis> it has components for digestive systems
00:01:05FromDiscord<arathanis> components for numbers of limbs
00:01:18FromDiscord<arathanis> which in game translates to being able to cut limbs off of enemies (or lose your own)
00:01:22FromDiscord<arathanis> or even gain additional limbs
00:01:30FromDiscord<arathanis> and it all just fits together
00:03:14FromDiscord<arathanis> In reply to @sys64 "So it only has": ECS + data driven design basically works like this:↵↵- you have an array of entities, entities only have an ID↵- for each kind of component, you have an array of that component.components know the ID of the entity they care about
00:03:44FromDiscord<arathanis> (edit) "In reply to @sys64 "So it only has": ECS + data driven design basically works like this:↵↵- you have an array of entities, entities only have an ID↵- for each kind of component, you have an array of that component.components know the ID of the entity they care about" => "sent a long message, see http://ix.io/4BV7"
00:04:08FromDiscord<arathanis> you dont have to do it this way, but its good cause of the memory locality.
00:04:36FromDiscord<arathanis> you only ever need to load 2 arrays into the CPUs cache at a time, much more likely to be able to have the CPU predict the memory you need
00:04:46FromDiscord<arathanis> so you get huge performance wins
00:05:49FromDiscord<System64 ~ Flandre Scarlet> In reply to @arathanis "it has components for": Interesting, and would it work for a modular synthesizer
00:05:51FromDiscord<System64 ~ Flandre Scarlet> (edit) "synthesizer" => "synthesizer?"
00:06:02FromDiscord<arathanis> im not sure i know what a modular synthesizer is
00:06:19FromDiscord<arathanis> ECS is very much a pattern for video games.
00:06:27FromDiscord<System64 ~ Flandre Scarlet> Oh alright
00:49:38*skulk joined #nim
00:51:10skulkwhat's the recommended LSP server? I'm having issues with nimlsp crashing so I want to make sure it's the most recent one available before I deep dive into debugging it
00:53:05FromDiscord<Elegantbeef> nimlangserver might be more reliable, but both rely on nimsuggest which is the crux of the issue
01:00:03FromDiscord<arathanis> nimlangserver crashes for me on devel :
01:00:04FromDiscord<arathanis> (edit) ":" => ":/"
01:05:36FromDiscord<anuke> Why is nimsuggest so unstable?
01:06:15FromDiscord<Elegantbeef> It's a modified compiler with changes to make it work as fast as possible
01:07:28FromDiscord<.bobbbob> update: having to deal with the c style of doing things when using SDL with nim is friccin annoying
01:08:14FromDiscord<.bobbbob> I ended up writing wrapper functions for most of the SDL functions i use that converts nim types to the C types and throws an exception instead of having to check for null pointers each time
01:09:50FromDiscord<Elegantbeef> Time to write some higher level bindings 😛
01:43:13*ajunior quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
03:13:11*azimut quit (Read error: Connection reset by peer)
03:13:44*azimut joined #nim
03:41:25*ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
03:41:58*azimut quit (Ping timeout: 240 seconds)
03:43:46*ehmry joined #nim
04:35:17NimEventerNew thread by ttott: Help: nim c -r --verbository:0 test2.nim fail, see https://forum.nim-lang.org/t/10363
05:15:12FromDiscord<shalokshalom> In reply to @anuke "Why is nimsuggest so": It's drunk
05:16:06FromDiscord<shalokshalom> In reply to @skulk "what's the recommended LSP": The only thing that is not based on nimsuggest, (and so not crashing all the time) is the Nim plugin for IDEA/Jetbrains.
05:18:58FromDiscord<shalokshalom> In reply to @_gumbercules "I think property-based testing": No, it's not. And when you look closely, you will see that i pitched another idea as replacement for unit tests, and property tests are simply the only type of tests I recommend to be written as explicitly written as such. ↵↵I have complete unit type functionality in all my code, just by the architectural design.
05:19:25FromDiscord<shalokshalom> See: Scott Wlaschkin - Domain Modeling Made Functional
05:38:38FromDiscord<Phil> In reply to @_gumbercules "Assuming toMappedObject is thoroughly": So basically "testing this is pointless, it doesn't do work".↵However in a sense it does do work, it couples individual operations into a larger more useful task.↵That is useful from a business logic perspective, just not from a "this code does work" perspective.
05:41:18FromDiscord<Phil> Not that I disagree with you all that much consciously, I'm tempted to state that this should be covered via integration tests, just don't have a good gut feeling with really not testing
05:41:46FromDiscord<Phil> (edit) "Not that I disagree with you all that much consciously, I'm tempted to state that this should be covered via integration tests, just don't have a good gut feeling with really not ... testing" added "unit"
05:46:39FromDiscord<Phil> In reply to @shalokshalom "And you would know": That is A response if I control the language chosen or the decision whether or not to write unit tests, both of which is not the case for the purposes of that kind of question 😛
05:47:08*ajunior joined #nim
05:47:48*ajunior quit (Client Quit)
06:29:24*rockcavera quit (Remote host closed the connection)
06:41:35FromDiscord<ratogbm> Does nim have enumerate?
06:42:07FromDiscord<Elegantbeef> It has an implicit pairs iterator, but `std/enumerate` exists for when needed
07:01:37FromDiscord<anuke> In reply to @shalokshalom "The only thing that": Yeah, that was my experience as well. Turning off nimsuggest in VSC and relying purely on the keyword suggestions seemed to work better than having it on. Wish they updated the plugin more.
07:01:44FromDiscord<anuke> (edit) "In reply to @shalokshalom "The only thing that": Yeah, that was my experience as well. Turning off nimsuggest in VSC and relying purely on the keyword suggestions seemed to work better than having it on. Wish they updated the ... plugin" added "IJ"
07:08:11FromDiscord<anuke> Testing it now, it works great, jumps to definition instantly, unlike Nimsuggest.
07:08:42FromDiscord<Elegantbeef> Yea not using the compiler is bound to make it work better
07:09:02FromDiscord<anuke> Unfortunately, the color highlighting is a bit broken. It highlights types and variables the same exact way (as 'identifiers'), and there's no way to change them separately https://media.discordapp.net/attachments/371759389889003532/1135469152400855142/image.png
07:09:15FromDiscord<Elegantbeef> The issue is though when you use macros to introduce symbols the lookups will be useless
07:09:43FromDiscord<anuke> True, but nimsuggest chokes on my macros anyway and refuses to show anything
07:10:02FromDiscord<anuke> In reply to @anuke "Unfortunately, the color highlighting": (This is not great to look at) https://media.discordapp.net/attachments/371759389889003532/1135469401618010152/image.png
07:10:20FromDiscord<Elegantbeef> The could be on you depending on how you wrote them
07:10:20FromDiscord<Elegantbeef> I know for my fungus macro I had to rewrite line info, due to using genast
07:10:46FromDiscord<anuke> Maybe - could also be related to polymorph, since that is extremely macro heavy
07:11:18FromDiscord<Elegantbeef> Very chuffed with my macro free ECS 😄
07:11:24FromDiscord<Elegantbeef> Not that I actually use it
07:12:09FromDiscord<anuke> I'd be fine with jump-to-definition that just jumps to any type/proc with the same name, that's better than nothing.
07:12:27FromDiscord<anuke> Even in the best of times nimsuggest was so unreliable that it took seconds to jump places
07:12:49FromDiscord<Elegantbeef> That's the crux of using a compiler with no IC to do code lookup
07:13:11FromDiscord<Elegantbeef> The first lookup will always be slow, future lookups should be faster
07:13:36FromDiscord<anuke> Ah well.
07:14:04FromDiscord<anuke> It'll probably take quite a while for that to work properly, last I heard IC is barely even on the horizon
07:14:47FromDiscord<Elegantbeef> It's only been a few years, how much could a IC cost 😄
07:15:46FromDiscord<anuke> IC, just a week away!
07:17:53FromDiscord<Elegantbeef> Who knows how long IC will take after 2.0 is finally released, 2.0 is supposed to be released in early 2023
07:18:53FromDiscord<Elegantbeef> I joke, but then again I'm probably part of the problem since I havent contributed anything to Nim this year
07:23:39Amun-Rabad Elegantbeef!
07:24:13FromDiscord<Elegantbeef> Hey it's not strictly true, I fixed a bug with inheritance and started a PR to thunk all procedures to closure/nimcall
07:24:31FromDiscord<Elegantbeef> Which reminds me I should take another whack at that before 2.0 is released
07:25:53Amun-Ra;)
07:27:05FromDiscord<Elegantbeef> I did have to check how well nimlsp's goto works with nvim and my game. It's not instant but it's usable(I rarely use goto it seems) 😄
07:27:24FromDiscord<ratogbm> @elegantbeef nim proc vs func
07:27:36FromDiscord<Elegantbeef> RTFM
07:27:59FromDiscord<ratogbm> (edit) "@elegantbeef nim" => "Explain" | "Explainproc vs func ... " added "ot me pls"
07:28:09FromDiscord<ratogbm> (edit) "pls" => "pls↵↵sorry for the ping btw"
07:28:25*ntat joined #nim
07:28:57FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html that'll be better than asking all these minor questions
07:28:57FromDiscord<Elegantbeef> Read it over a couple dozen times
07:29:55FromDiscord<ratogbm> In reply to @Elegantbeef "RTFM": btw, are you a bot or not, I don't get it
07:30:33FromDiscord<Elegantbeef> I'm a human that uses matrix to talk
07:30:36FromDiscord<Elegantbeef> I'm really amazed at how stymied people get about a `[bot]` tag
07:30:52FromDiscord<Elegantbeef> Even before the LLM craze
07:32:00FromDiscord<ratogbm> Sorry, I thaought you were like a ChatGTP bot like the one on the python server.
07:32:23FromDiscord<ratogbm> You account has no description, no tag no nothing.
07:32:42Amun-Ra:P
07:32:47FromDiscord<ratogbm> (edit) "You account has no description, no tag no nothing. ... " added "I was confused about your behaviour"
07:32:51FromDiscord<Elegantbeef> It used to have a pfp but the bridge axed that for whatever reason
07:33:30FromDiscord<ratogbm> (edit) "server." => "server (it has one that executes code and links to documentation etc.)."
07:33:32FromDiscord<Elegantbeef> Now only matrix users get to see my dog with a tongue that looks like it was photo manipulated on
07:36:59FromDiscord<Elegantbeef> Wow a new matrix user the hostile responses work!
07:37:20FromDiscord<ratogbm> Here I am, just wanted to see your dog
07:37:50FromDiscord<Elegantbeef> Dog pictures really are the most effective motivator
07:39:34FromDiscord<ratogbm> I really thought you were a bot, I am so sorry.
07:39:42FromDiscord<Elegantbeef> I'm not offended
07:39:48FromDiscord<Elegantbeef> I've been assumed worse before
07:40:06FromDiscord<Elegantbeef> Some people have even asked "Why does a bot have a github profile"
07:40:28FromDiscord<Elegantbeef> You can take a horse to water, but you cannot make it think
07:55:16FromDiscord<ieltan> Ngl if I was beef I'd just say "why yes of course I'm a bot made by status.im (proprietary) trained on billion of Discord user interaction... and I'm coded in Nim too"
07:55:37FromDiscord<Elegantbeef> But I don't like LLMs so that's not fun
07:56:04FromDiscord<ieltan> It'd be funny to see the reactiond lol
07:56:11FromDiscord<ieltan> (edit) "reactiond" => "reactions"
07:56:25FromDiscord<Elegantbeef> Others do it
08:14:03FromDiscord<shalokshalom> In reply to @ratogbm "Sorry, I thaought you": Beef actually behaves like a bot, and is exactly about to be treated
08:18:08FromDiscord<pmunch> Haven't really looked at your avatar before, but that dog does indeed appear to have its tongue photoshopped on
08:21:04FromDiscord<ratogbm> This discord server is like: ↵↵Breaking News! Over 90% of all bots are fake.
08:21:51FromDiscord<ratogbm> (edit) "This discord server is like: ↵↵Breaking News! Over 90% of all bots ... are" added "on the platform"
08:25:43FromDiscord<arathanis> we are just trying to make sure everyone gets accustomed to our new AI friends before they really start hitting the road
08:26:16FromDiscord<arathanis> Beef is actually just ChatGPT
08:27:40FromDiscord<odexine> That’s an insult to ChatGPT
08:31:40FromDiscord<shalokshalom> In reply to @ratogbm "This discord server is": The bot is actually the bridge between Matrix and Discord
08:31:54FromDiscord<shalokshalom> Beef 4.0
08:48:05FromDiscord<Elegantbeef> If only my programming did not prevent me from insults
08:53:54NimEventerNew thread by FabienPRI: How to close a Logger, see https://forum.nim-lang.org/t/10364
09:13:17*ajunior joined #nim
09:13:58*ajunior quit (Client Quit)
09:14:51*jmdaemon quit (Ping timeout: 260 seconds)
09:30:20FromDiscord<ratogbm> Does nim have structs? or do i have to use object?
09:36:45Amun-Raobjectr
09:36:57Amun-Raor tuple
09:41:51FromDiscord<ratogbm> thks
10:03:10FromDiscord<ratogbm> sent a long message, see http://ix.io/4BWy
10:04:25Amun-Rause \e instead
10:06:16FromDiscord<ratogbm> Yeap, that works. thanks
10:06:43Amun-Raof \x2b
10:07:08FromDiscord<ratogbm> did you mean OR
10:07:12FromDiscord<ratogbm> (edit) "OR" => "OR?"
10:07:15Amun-Rayes
10:07:22Amun-RaI missed the right key :>
10:07:58Amun-Rabtw. 033 is base 10 in nim
10:08:51Amun-Ra0o33 is base 8; and IIRC there's no octal escape prefix in Nim
10:09:12FromDiscord<ratogbm> While I was typing on discord, I decided to open Element. Felt like a real spy watching the matrix chat.
10:10:06FromDiscord<ratogbm> In reply to @Amun-Ra "btw. 033 is base": Oh, I see, that's good to know
10:20:24*xet7 quit (Remote host closed the connection)
10:35:48*ntat quit (Quit: leaving)
10:47:45*disso-peach joined #nim
10:58:14*ntat joined #nim
12:21:37*ajunior joined #nim
12:27:15*lucasta joined #nim
12:46:48FromDiscord<ieltan> Does anyone has an example of a macro generating a template ?
12:51:56*azimut joined #nim
13:02:02*frenchboy[m] quit (Write error: Connection reset by peer)
13:02:02*psydruid quit (Write error: Connection reset by peer)
13:15:31*frenchboy[m] joined #nim
13:27:29Amun-Rawrite an example template and dump it with std/macros
13:31:22*psydruid joined #nim
13:35:02*xet7 joined #nim
13:48:10*rockcavera joined #nim
14:08:38FromDiscord<ieltan> In reply to @Amun-Ra "write an example template": I succeeded however, I wish to be able to have procs from other modules to bind to the generated template at callsite, is there a way to do that ?
14:08:48FromDiscord<ieltan> `bindSym` doesnt seem to work
14:18:24*ajunior quit (Quit: Textual IRC Client: www.textualapp.com)
14:27:51*ajunior joined #nim
14:30:38*kenran joined #nim
14:39:26*progranner joined #nim
14:52:45*lucasta quit (Quit: Leaving)
15:10:47*ntat quit (Quit: leaving)
15:24:24NimEventerNew Nimble package! battinfo - cli tool to query battery info for GNU/Linux, see https://gitlab.com/prashere/battinfo
15:28:38*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
15:33:35*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…)
15:34:23*kenran quit (Remote host closed the connection)
15:45:34FromDiscord<Chronos [She/Her]> Is there a way to make an int with a custom size?
15:45:38FromDiscord<Chronos [She/Her]> Like int48
15:46:12FromDiscord<Chronos [She/Her]> HmI mean int128 exists could prolly do it in a similar way with an int32 and uint16
15:47:32FromDiscord<Chronos [She/Her]> Can't be bothered to write it all myself tho so eh
15:48:00FromDiscord<Chronos [She/Her]> Main reason I wanted it was so I could cast it to a bytearray of 6 bytes
15:50:03*Lord_Nightmare joined #nim
15:50:03FromDiscord<treeform> In reply to @yu.vitaqua.fer.chronos "Is there a way": i don't think so. You would probably need to make a function that reads/writes 6 byte with shifts though given a regular int.
15:50:20FromDiscord<Chronos [She/Her]> Yeah makes sense, oh well
15:51:41FromDiscord<treeform> You could probably make this type based on a 6 byte array, but it would a lot of work.
15:52:10FromDiscord<odexine> Doesn’t stint do that
15:52:14FromDiscord<odexine> The library by status
15:52:33*progranner joined #nim
15:53:08*Lord_Nightmare quit (Client Quit)
15:53:22FromDiscord<Chronos [She/Her]> Hm, idk how it works tbh
15:55:16FromDiscord<treeform> chatGTP is great for these kind of puzzles: https://chat.openai.com/?model=gpt-4
15:55:34FromDiscord<treeform> (edit) "https://chat.openai.com/?model=gpt-4" => "https://chat.openai.com/share/3d1541e9-c8e8-482f-83f7-fec56c342dee"
15:57:16FromDiscord<treeform> In reply to @odexine "Doesn’t stint do that": I did not know about this https://github.com/status-im/nim-stint it looks like it can do what you want. But they are going for big integers, not small ones?
16:03:35FromDiscord<Chronos [She/Her]> Stint does seem t work, thanks guys!
16:09:50*kenran joined #nim
16:28:18FromDiscord<.bobbbob> maybe create a custom type and overload add, sub, etc to mask off the upper bits with bitwise ops
16:28:35FromDiscord<.bobbbob> (edit) "maybe create a custom type ... and" added "from int"
16:51:05*Lord_Nightmare joined #nim
17:09:46*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
17:09:47*xet7 quit (Remote host closed the connection)
17:12:46*Lord_Nightmare joined #nim
17:17:13*kenran quit (Remote host closed the connection)
17:23:04*progranner quit (Ping timeout: 260 seconds)
17:26:58*jmdaemon joined #nim
17:49:41*ajunior quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
18:00:30*ajunior joined #nim
18:00:58*xet7 joined #nim
18:07:09FromDiscord<tauruuuuuus> does anyone know when the next release is scheduled for? I got a nasty bug in a codebase that gets solved by using the last develop
18:11:54FromDiscord<Andreas> In reply to @tauruuuuuus "does anyone know when": its somewhere 'around the corner', without release date..
18:18:19*ntat joined #nim
18:19:23FromDiscord<tauruuuuuus> got it! thanks for the info
18:26:48*xet7 quit (Remote host closed the connection)
18:28:17*xet7 joined #nim
18:29:46FromDiscord<Andreas> In reply to @tauruuuuuus "got it! thanks for": there is a list of showstoppers https://github.com/nim-lang/Nim/labels/Showstopper↵idk if its still up-to-date, if so, then there is one problem left..
18:40:10FromDiscord<ratogbm> Is there a way to explicitly "deleate" a variable?
18:40:59FromDiscord<Andreas> `=destroy` maybe
18:41:47FromDiscord<Andreas> (edit) "maybe" => "maybe, but ARC/ORC do it automagically when your var leaves scope.."
18:43:46FromDiscord<ratogbm> In reply to @Andreas "`=destroy` maybe, but ARC/ORC": I have it in the main scope...
18:46:17FromDiscord<Andreas> In reply to @ratogbm "I have it in": ic, try <yourvar>.`=destroy`() and you can make the ARC/ORC-destructor-call visible via a compiler-switch..
18:46:57FromDiscord<Andreas> (edit) "In reply to @ratogbm "I have it in": ic, try <yourvar>.`=destroy`() and you can make the ARC/ORC-destructor-call visible via" => "sent" | "compiler-switch.." => "code paste, see https://play.nim-lang.org/#ix=4BZg"
18:47:09FromDiscord<Andreas> (edit) "https://play.nim-lang.org/#ix=4BZg" => "https://play.nim-lang.org/#ix=4BZh"
18:47:39FromDiscord<ratogbm> My compiler is marking it bright red...
18:48:11FromDiscord<ratogbm> nvm, I spelled it wrong
18:48:51FromDiscord<ratogbm> (edit) "wrong" => "wrong, works now thks"
18:54:46*xaltsc quit (Quit: WeeChat 4.0.2)
19:34:16NimEventerNew post on r/nim by tttt7777t7: Procedural type troubles, see https://reddit.com/r/nim/comments/15epo7r/procedural_type_troubles/
19:36:05FromDiscord<.uninnocent> How can I encrypt a string with fernet in python, and decrypt with nimlang?
19:55:17*ntat quit (Quit: leaving)
20:25:43*ajunior quit (Remote host closed the connection)
20:27:17*progranner joined #nim
20:28:45*droidrage quit (K-Lined)
20:28:45*qwestion quit (K-Lined)
20:28:51FromDiscord<auxym> In reply to @.uninnocent "How can I encrypt": nimpy? Otherwise I don't think there's an easy solution other than digging in the fernet source and re-implementing in nim. as an alternative, consider using libsodium on both sides (pynacl and nim-libsodium)
20:31:23*ajunior joined #nim
20:37:23FromDiscord<takemichihanagaki3129> sent a code paste, see https://play.nim-lang.org/#ix=4BZD
20:37:31FromDiscord<takemichihanagaki3129> (edit) "https://play.nim-lang.org/#ix=4BZD" => "https://play.nim-lang.org/#ix=4BZE"
20:38:30FromDiscord<takemichihanagaki3129> Or force namespaces with macros...
20:42:53FromDiscord<deech4592> sent a code paste, see https://play.nim-lang.org/#ix=4BZL
20:43:59FromDiscord<deech4592> However for `std` libs it's probably best to just fully qualify the call
20:43:59FromDiscord<that_dude.> sent a code paste, see https://play.nim-lang.org/#ix=4BZM
20:45:36FromDiscord<takemichihanagaki3129> In reply to @deech4592 "I think you can": I'm trying this without creating a new module...↵But IDK if there's a way to handle modules virtually.
20:45:44FromDiscord<takemichihanagaki3129> (edit) "module...↵But" => "module (file)...↵But"
20:46:40FromDiscord<deech4592> In reply to @takemichihanagaki3129 "I'm trying this without": I'm not sure, I don't believe there a way to create a module with a macro.
20:46:57FromDiscord<takemichihanagaki3129> In reply to @deech4592 "I'm not sure, I": Sure, thanks for the info!
20:47:51FromDiscord<huantian> In reply to @deech4592 "However for `std` libs": or just not use namespaces
20:48:01FromDiscord<huantian> I feel like so manyh of the string ops you wouldn't want name spaces for
20:48:11FromDiscord<huantian> since they're ones you'd want to use ufc
20:48:37FromDiscord<takemichihanagaki3129> In reply to @huantian "or just not use": 😂 , IK. But what I'm trying to do is too specific, and I need them at the same namespace.
20:49:01*ajunior quit (Remote host closed the connection)
20:49:08FromDiscord<takemichihanagaki3129> (edit) "In reply to @huantian "or just not use": 😂 , IK. But what I'm trying to do is too specific, and I need them at the same namespace. ... " added "However, without creating a new file just for that."
20:49:37FromDiscord<huantian> what are you trying to do
20:49:38FromDiscord<huantian> haha
20:50:44FromDiscord<takemichihanagaki3129> In reply to @huantian "what *are* you trying": I library that imports all available modules from a folder into one namespace.↵Basically, the same as deech've said, but without creating a file for that.
20:52:11FromDiscord<takemichihanagaki3129> sent a code paste, see https://play.nim-lang.org/#ix=4BZS
20:52:43FromDiscord<huantian> right but why would you want that
20:52:56FromDiscord<takemichihanagaki3129> In reply to @huantian "right but why would": For fun. 🙂
20:53:05FromDiscord<huantian> i see lol
20:53:10FromDiscord<huantian> I can't give any alternatives then
20:53:53FromDiscord<takemichihanagaki3129> In reply to @huantian "I can't give any": Yes... I usually just create a file to export them, and it's fine to me.↵But would be fun to that this way.
20:54:01FromDiscord<takemichihanagaki3129> (edit) "to" => "do"
20:54:22FromDiscord<huantian> I'll still give the same advice that you should almost never need namespaces
20:55:40*ajunior joined #nim
20:57:09FromDiscord<takemichihanagaki3129> In reply to @huantian "I'll still give the": I avoid to use them, I just use it when I think it's needed.↵The fun part of Nim is that: there are namespaces but they are optional.↵Sincerely, use the power of the compiler and use functions like methods sounds better to me 🙂.↵But if I think it would be semantically better use namespaces, then I do it so.
20:57:16*kedin joined #nim
20:57:23FromDiscord<huantian> hm perhaps
20:57:49FromDiscord<takemichihanagaki3129> (edit) "use" => "using" | "usingthe power of the compiler ... andusing" added "(function overloading)" | "use" => "using"
20:59:04FromDiscord<deech4592> This isn't helpful for your current situation but the best namespace story I've seen is Scala. In Nim it's probably best to stick to think of namespaces as simple Pascal style units. 🤷
21:00:19FromDiscord<takemichihanagaki3129> In reply to @deech4592 "This isn't helpful for": Sounds a interesting thing to search I'll look for it.
21:00:20FromDiscord<deech4592> (edit) "think" => "thinking"
21:00:29FromDiscord<takemichihanagaki3129> (edit) "Sounds a" => "That sounds an"
21:02:32FromDiscord<takemichihanagaki3129> In reply to @deech4592 "This isn't helpful for": I saw that it has support for wildcard on imports...
21:02:36FromDiscord<takemichihanagaki3129> Is it true?
21:03:06FromDiscord<takemichihanagaki3129> `import Console._ // println' bound by wildcard import`
21:03:27FromDiscord<takemichihanagaki3129> (edit) "Console._ // println' bound by wildcard import`" => "Console._`"
21:03:54kedinhello...
21:03:54kedinare you busy right now?
21:03:55kedini need some help in a nim exercise...
21:04:04FromDiscord<deech4592> sent a code paste, see https://play.nim-lang.org/#ix=4BZW
21:04:22FromDiscord<deech4592> I think D does the latter as well. It's a very nice feature.
21:04:49FromDiscord<takemichihanagaki3129> In reply to @deech4592 "Yep, it's used all": Is this import only available just inside the scope?
21:04:57FromDiscord<deech4592> yes
21:05:11FromDiscord<takemichihanagaki3129> In reply to @deech4592 "yes": Impressive, I liked it.
21:05:39FromDiscord<takemichihanagaki3129> In python, I do something similar, using lazy imports.
21:05:52kedinhttps://play.nim-lang.org/#ix=4BZX
21:06:04kedini don,t know why it errors
21:06:57FromDiscord<huantian> your indentation is invalid
21:07:07FromDiscord<huantian> you have to add an extra indentation for the if and elif body
21:07:37kedinhmm
21:07:38kedin(still doesn,t understand)
21:07:49FromDiscord<huantian> https://play.nim-lang.org/#ix=4BZY
21:08:00FromDiscord<huantian> still doesn't work tho because `/=` isn't defined for ints, only for floats
21:08:41kedinoh.. i guess that makes sense
21:08:48FromDiscord<huantian> so you'd have to replace it with `nom = nom div 2`
21:09:45FromDiscord<takemichihanagaki3129> sent a code paste, see https://play.nim-lang.org/#ix=4BZZ
21:09:58FromDiscord<takemichihanagaki3129> Be consistent with your indentation and you won't have problems.
21:10:56kedini,m sorry but...
21:10:56kedini don,t know what "indentation" means.
21:11:04kedinfr
21:11:27FromDiscord<takemichihanagaki3129> In reply to @huantian "still doesn't work tho": This operator just works for floats, so you have 2 options, or convert your integer to float first, or try to use another operator that works with integer.
21:12:02FromDiscord<takemichihanagaki3129> In reply to @kedin "i don,t know what": A empty space in the start of the line.
21:12:06FromDiscord<takemichihanagaki3129> (edit) "A" => "An"
21:12:41FromDiscord<takemichihanagaki3129> sent a code paste, see https://play.nim-lang.org/#ix=4C01
21:13:36kedinso you say that my code broke because i had 2 spaces instead of 4?
21:13:47kedinat the start of the line
21:14:20kedin* 4 -> 3
21:15:07*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…)
21:15:31*progranner joined #nim
21:17:12FromDiscord<takemichihanagaki3129> In reply to @kedin "so you say that": Just if you're not being consistent.
21:17:31kedinoh... now i get it
21:17:31kedinit should be just under the function (two spaces after it in the next line)
21:17:36FromDiscord<takemichihanagaki3129> But you can use what you want.↵I use 3 spaces of indentation for my personal projects.
21:17:50FromDiscord<takemichihanagaki3129> But generally, people use 2 or 4...
21:18:46kedinbut i used 2 and it gave me an error ???
21:19:35FromDiscord<takemichihanagaki3129> In reply to @kedin "but i used 2": It depends on what have you written. Let me see.
21:20:05FromDiscord<takemichihanagaki3129> Your compiler will tell you where is the error.
21:20:43kedinit did... but i didn,t understand that i didn,t give it enough spaces
21:20:47kedinhttps://play.nim-lang.org/#ix=4BZX
21:21:07FromDiscord<takemichihanagaki3129> Notice that these lines are at the same level of your `if`/`elif`. https://media.discordapp.net/attachments/371759389889003532/1135683587627302982/image.png
21:21:16FromDiscord<takemichihanagaki3129> But it should be inner them.
21:22:32kedin"inner them" means right after them in the next line?
21:24:03FromDiscord<takemichihanagaki3129> In reply to @kedin ""inner them" means right": I mean.↵`while` has 0 of indentation, `if`/`elif` has 2 of indentation (so it's inside the `while`), and your operations should be inside your `if`/`elif`, so use 4 spaces of indentation.
21:24:40kedinoh
21:24:57FromDiscord<takemichihanagaki3129> Your lastest `echo` is right for what I've understood. Because it's outside of the `while`.
21:25:11FromDiscord<ieltan> You press space where usually you would put {
21:25:32FromDiscord<ieltan> Except you don't have to "close" it with anything
21:25:51FromDiscord<ieltan> What language did you use before Nim?
21:26:01kedinyeah.. now that makes sense
21:26:01kedinso to make it inside the scope i have to put 2 spaces for each scope
21:26:10kedini was learning c
21:26:20FromDiscord<ieltan> Ah I see
21:26:20FromDiscord<takemichihanagaki3129> In reply to @kedin "so to make it": Yes, this.
21:26:50FromDiscord<ieltan> You don't have to make it two space, but definitely not a single space, it will make your code unreadable
21:27:54kedingreat!
21:27:54kedinnow why something like this isn,t documented or in the tutorial website
21:27:55kedinhttps://narimiran.github.io/nim-basics/
21:27:56kedin?
21:28:25FromDiscord<huantian> https://media.discordapp.net/attachments/371759389889003532/1135685423981662268/image.png
21:28:29FromDiscord<ieltan> It is documented in the manual/tutorial
21:28:38FromDiscord<ieltan> You didn't read it 😅
21:28:44kedinoh...
21:29:22FromDiscord<huantian> https://nim-lang.org/docs/tut1.html#statements-and-indentation
21:30:22FromDiscord<takemichihanagaki3129> sent a code paste, see https://play.nim-lang.org/#ix=4C09
21:32:28kedinyeah.. i guess that was a problem in the tutorial i,m using (or perhaps i missed it by accident)
21:32:28kedinthanks for helping me and understand this!
21:32:29kedin(i was clueless of this issue...)
21:33:44FromDiscord<takemichihanagaki3129> In reply to @kedin "thanks for helping me": No prob
21:36:20kedin<takemichihanagaki3129> i didn,t need to make code like this in c
21:36:21kedinwell.... at least in the ide in codecademy
21:36:21kedin(just realises that was the case)
21:38:16*progranner quit (Ping timeout: 258 seconds)
21:39:24kedinalso...
21:39:24kedini used the div operator and the code made a weird output and gave an error...
21:39:25kedinhttps://play.nim-lang.org/#ix=4C00
21:40:12FromDiscord<Elegantbeef> You overflowed with `=3`
21:41:27FromDiscord<huantian> you're multiplying a number by 3 over and over
21:46:10kedini realised
21:46:11kedinit isn,t dividing bc it still odd
21:46:11kedini should add one to make it even as the tutorial said
21:46:12kedinhttps://narimiran.github.io/nim-basics/#_while_loop
21:46:12kedinnow it fixed https://play.nim-lang.org/#ix=4C0c
21:48:06kedinthanks again for helping a noobie like me to complete a exercise like this...
21:48:06kedineven tho i should have tried harder to do it myself..
21:49:41kedin(but now i understand better)
21:51:30*kedin quit (Quit: Connection closed)
21:51:39*lumo_e joined #nim
22:11:38*lumo_e quit (Quit: Quit)
22:29:10*koltrast_ quit (Quit: ZNC - http://znc.in)
22:32:16*frenchboy[m] quit (Ping timeout: 245 seconds)
22:32:21*koltrast joined #nim
22:32:45FromDiscord<.uninnocent> How can I encrypt a string in python and decrypt in nimlang?↵An example would be great
22:37:00*psydruid quit (Ping timeout: 246 seconds)
22:41:05FromDiscord<demotomohiro> It should be possible as long as same algorith and same key is used.
22:41:54FromDiscord<.uninnocent> In reply to @demotomohiro "It should be possible": Such as?
22:42:03FromDiscord<Elegantbeef> 1
22:44:35FromDiscord<huantian> ah yes I love using the 1 encryption algo
22:44:41FromDiscord<huantian> it's super simple too you always just use 1 as the key
22:45:00FromDiscord<Elegantbeef> Same
22:45:17FromDiscord<demotomohiro> Most of encryption algorithms specify how it encrypt/decrypt data and different programming languages or OSs produce same bit patterns.
22:46:37FromDiscord<demotomohiro> In reply to @.uninnocent "How can I encrypt": https://github.com/ringabout/awesome-nim#cryptography↵Here is a list of Nim crypto libraries.
22:47:28FromDiscord<.uninnocent> Is xxtea good + compatable with both?
23:00:02*marcus quit (Remote host closed the connection)
23:00:44*marcus joined #nim