00:00:49 | FromDiscord | <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:56 | FromDiscord | <arathanis> it has components for digestive systems |
00:01:05 | FromDiscord | <arathanis> components for numbers of limbs |
00:01:18 | FromDiscord | <arathanis> which in game translates to being able to cut limbs off of enemies (or lose your own) |
00:01:22 | FromDiscord | <arathanis> or even gain additional limbs |
00:01:30 | FromDiscord | <arathanis> and it all just fits together |
00:03:14 | FromDiscord | <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:44 | FromDiscord | <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:08 | FromDiscord | <arathanis> you dont have to do it this way, but its good cause of the memory locality. |
00:04:36 | FromDiscord | <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:46 | FromDiscord | <arathanis> so you get huge performance wins |
00:05:49 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @arathanis "it has components for": Interesting, and would it work for a modular synthesizer |
00:05:51 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "synthesizer" => "synthesizer?" |
00:06:02 | FromDiscord | <arathanis> im not sure i know what a modular synthesizer is |
00:06:19 | FromDiscord | <arathanis> ECS is very much a pattern for video games. |
00:06:27 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright |
00:49:38 | * | skulk joined #nim |
00:51:10 | skulk | what'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:05 | FromDiscord | <Elegantbeef> nimlangserver might be more reliable, but both rely on nimsuggest which is the crux of the issue |
01:00:03 | FromDiscord | <arathanis> nimlangserver crashes for me on devel : |
01:00:04 | FromDiscord | <arathanis> (edit) ":" => ":/" |
01:05:36 | FromDiscord | <anuke> Why is nimsuggest so unstable? |
01:06:15 | FromDiscord | <Elegantbeef> It's a modified compiler with changes to make it work as fast as possible |
01:07:28 | FromDiscord | <.bobbbob> update: having to deal with the c style of doing things when using SDL with nim is friccin annoying |
01:08:14 | FromDiscord | <.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:50 | FromDiscord | <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:17 | NimEventer | New thread by ttott: Help: nim c -r --verbository:0 test2.nim fail, see https://forum.nim-lang.org/t/10363 |
05:15:12 | FromDiscord | <shalokshalom> In reply to @anuke "Why is nimsuggest so": It's drunk |
05:16:06 | FromDiscord | <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:58 | FromDiscord | <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:25 | FromDiscord | <shalokshalom> See: Scott Wlaschkin - Domain Modeling Made Functional |
05:38:38 | FromDiscord | <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:18 | FromDiscord | <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:46 | FromDiscord | <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:39 | FromDiscord | <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:35 | FromDiscord | <ratogbm> Does nim have enumerate? |
06:42:07 | FromDiscord | <Elegantbeef> It has an implicit pairs iterator, but `std/enumerate` exists for when needed |
07:01:37 | FromDiscord | <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:44 | FromDiscord | <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:11 | FromDiscord | <anuke> Testing it now, it works great, jumps to definition instantly, unlike Nimsuggest. |
07:08:42 | FromDiscord | <Elegantbeef> Yea not using the compiler is bound to make it work better |
07:09:02 | FromDiscord | <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:15 | FromDiscord | <Elegantbeef> The issue is though when you use macros to introduce symbols the lookups will be useless |
07:09:43 | FromDiscord | <anuke> True, but nimsuggest chokes on my macros anyway and refuses to show anything |
07:10:02 | FromDiscord | <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:20 | FromDiscord | <Elegantbeef> The could be on you depending on how you wrote them |
07:10:20 | FromDiscord | <Elegantbeef> I know for my fungus macro I had to rewrite line info, due to using genast |
07:10:46 | FromDiscord | <anuke> Maybe - could also be related to polymorph, since that is extremely macro heavy |
07:11:18 | FromDiscord | <Elegantbeef> Very chuffed with my macro free ECS 😄 |
07:11:24 | FromDiscord | <Elegantbeef> Not that I actually use it |
07:12:09 | FromDiscord | <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:27 | FromDiscord | <anuke> Even in the best of times nimsuggest was so unreliable that it took seconds to jump places |
07:12:49 | FromDiscord | <Elegantbeef> That's the crux of using a compiler with no IC to do code lookup |
07:13:11 | FromDiscord | <Elegantbeef> The first lookup will always be slow, future lookups should be faster |
07:13:36 | FromDiscord | <anuke> Ah well. |
07:14:04 | FromDiscord | <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:47 | FromDiscord | <Elegantbeef> It's only been a few years, how much could a IC cost 😄 |
07:15:46 | FromDiscord | <anuke> IC, just a week away! |
07:17:53 | FromDiscord | <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:53 | FromDiscord | <Elegantbeef> I joke, but then again I'm probably part of the problem since I havent contributed anything to Nim this year |
07:23:39 | Amun-Ra | bad Elegantbeef! |
07:24:13 | FromDiscord | <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:31 | FromDiscord | <Elegantbeef> Which reminds me I should take another whack at that before 2.0 is released |
07:25:53 | Amun-Ra | ;) |
07:27:05 | FromDiscord | <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:24 | FromDiscord | <ratogbm> @elegantbeef nim proc vs func |
07:27:36 | FromDiscord | <Elegantbeef> RTFM |
07:27:59 | FromDiscord | <ratogbm> (edit) "@elegantbeef nim" => "Explain" | "Explainproc vs func ... " added "ot me pls" |
07:28:09 | FromDiscord | <ratogbm> (edit) "pls" => "pls↵↵sorry for the ping btw" |
07:28:25 | * | ntat joined #nim |
07:28:57 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html that'll be better than asking all these minor questions |
07:28:57 | FromDiscord | <Elegantbeef> Read it over a couple dozen times |
07:29:55 | FromDiscord | <ratogbm> In reply to @Elegantbeef "RTFM": btw, are you a bot or not, I don't get it |
07:30:33 | FromDiscord | <Elegantbeef> I'm a human that uses matrix to talk |
07:30:36 | FromDiscord | <Elegantbeef> I'm really amazed at how stymied people get about a `[bot]` tag |
07:30:52 | FromDiscord | <Elegantbeef> Even before the LLM craze |
07:32:00 | FromDiscord | <ratogbm> Sorry, I thaought you were like a ChatGTP bot like the one on the python server. |
07:32:23 | FromDiscord | <ratogbm> You account has no description, no tag no nothing. |
07:32:42 | Amun-Ra | :P |
07:32:47 | FromDiscord | <ratogbm> (edit) "You account has no description, no tag no nothing. ... " added "I was confused about your behaviour" |
07:32:51 | FromDiscord | <Elegantbeef> It used to have a pfp but the bridge axed that for whatever reason |
07:33:30 | FromDiscord | <ratogbm> (edit) "server." => "server (it has one that executes code and links to documentation etc.)." |
07:33:32 | FromDiscord | <Elegantbeef> Now only matrix users get to see my dog with a tongue that looks like it was photo manipulated on |
07:36:59 | FromDiscord | <Elegantbeef> Wow a new matrix user the hostile responses work! |
07:37:20 | FromDiscord | <ratogbm> Here I am, just wanted to see your dog |
07:37:50 | FromDiscord | <Elegantbeef> Dog pictures really are the most effective motivator |
07:39:34 | FromDiscord | <ratogbm> I really thought you were a bot, I am so sorry. |
07:39:42 | FromDiscord | <Elegantbeef> I'm not offended |
07:39:48 | FromDiscord | <Elegantbeef> I've been assumed worse before |
07:40:06 | FromDiscord | <Elegantbeef> Some people have even asked "Why does a bot have a github profile" |
07:40:28 | FromDiscord | <Elegantbeef> You can take a horse to water, but you cannot make it think |
07:55:16 | FromDiscord | <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:37 | FromDiscord | <Elegantbeef> But I don't like LLMs so that's not fun |
07:56:04 | FromDiscord | <ieltan> It'd be funny to see the reactiond lol |
07:56:11 | FromDiscord | <ieltan> (edit) "reactiond" => "reactions" |
07:56:25 | FromDiscord | <Elegantbeef> Others do it |
08:14:03 | FromDiscord | <shalokshalom> In reply to @ratogbm "Sorry, I thaought you": Beef actually behaves like a bot, and is exactly about to be treated |
08:18:08 | FromDiscord | <pmunch> Haven't really looked at your avatar before, but that dog does indeed appear to have its tongue photoshopped on |
08:21:04 | FromDiscord | <ratogbm> This discord server is like: ↵↵Breaking News! Over 90% of all bots are fake. |
08:21:51 | FromDiscord | <ratogbm> (edit) "This discord server is like: ↵↵Breaking News! Over 90% of all bots ... are" added "on the platform" |
08:25:43 | FromDiscord | <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:16 | FromDiscord | <arathanis> Beef is actually just ChatGPT |
08:27:40 | FromDiscord | <odexine> That’s an insult to ChatGPT |
08:31:40 | FromDiscord | <shalokshalom> In reply to @ratogbm "This discord server is": The bot is actually the bridge between Matrix and Discord |
08:31:54 | FromDiscord | <shalokshalom> Beef 4.0 |
08:48:05 | FromDiscord | <Elegantbeef> If only my programming did not prevent me from insults |
08:53:54 | NimEventer | New 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:20 | FromDiscord | <ratogbm> Does nim have structs? or do i have to use object? |
09:36:45 | Amun-Ra | objectr |
09:36:57 | Amun-Ra | or tuple |
09:41:51 | FromDiscord | <ratogbm> thks |
10:03:10 | FromDiscord | <ratogbm> sent a long message, see http://ix.io/4BWy |
10:04:25 | Amun-Ra | use \e instead |
10:06:16 | FromDiscord | <ratogbm> Yeap, that works. thanks |
10:06:43 | Amun-Ra | of \x2b |
10:07:08 | FromDiscord | <ratogbm> did you mean OR |
10:07:12 | FromDiscord | <ratogbm> (edit) "OR" => "OR?" |
10:07:15 | Amun-Ra | yes |
10:07:22 | Amun-Ra | I missed the right key :> |
10:07:58 | Amun-Ra | btw. 033 is base 10 in nim |
10:08:51 | Amun-Ra | 0o33 is base 8; and IIRC there's no octal escape prefix in Nim |
10:09:12 | FromDiscord | <ratogbm> While I was typing on discord, I decided to open Element. Felt like a real spy watching the matrix chat. |
10:10:06 | FromDiscord | <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:48 | FromDiscord | <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:29 | Amun-Ra | write 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:38 | FromDiscord | <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:48 | FromDiscord | <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:24 | NimEventer | New 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:34 | FromDiscord | <Chronos [She/Her]> Is there a way to make an int with a custom size? |
15:45:38 | FromDiscord | <Chronos [She/Her]> Like int48 |
15:46:12 | FromDiscord | <Chronos [She/Her]> HmI mean int128 exists could prolly do it in a similar way with an int32 and uint16 |
15:47:32 | FromDiscord | <Chronos [She/Her]> Can't be bothered to write it all myself tho so eh |
15:48:00 | FromDiscord | <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:03 | FromDiscord | <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:20 | FromDiscord | <Chronos [She/Her]> Yeah makes sense, oh well |
15:51:41 | FromDiscord | <treeform> You could probably make this type based on a 6 byte array, but it would a lot of work. |
15:52:10 | FromDiscord | <odexine> Doesn’t stint do that |
15:52:14 | FromDiscord | <odexine> The library by status |
15:52:33 | * | progranner joined #nim |
15:53:08 | * | Lord_Nightmare quit (Client Quit) |
15:53:22 | FromDiscord | <Chronos [She/Her]> Hm, idk how it works tbh |
15:55:16 | FromDiscord | <treeform> chatGTP is great for these kind of puzzles: https://chat.openai.com/?model=gpt-4 |
15:55:34 | FromDiscord | <treeform> (edit) "https://chat.openai.com/?model=gpt-4" => "https://chat.openai.com/share/3d1541e9-c8e8-482f-83f7-fec56c342dee" |
15:57:16 | FromDiscord | <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:35 | FromDiscord | <Chronos [She/Her]> Stint does seem t work, thanks guys! |
16:09:50 | * | kenran joined #nim |
16:28:18 | FromDiscord | <.bobbbob> maybe create a custom type and overload add, sub, etc to mask off the upper bits with bitwise ops |
16:28:35 | FromDiscord | <.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:09 | FromDiscord | <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:54 | FromDiscord | <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:23 | FromDiscord | <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:46 | FromDiscord | <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:10 | FromDiscord | <ratogbm> Is there a way to explicitly "deleate" a variable? |
18:40:59 | FromDiscord | <Andreas> `=destroy` maybe |
18:41:47 | FromDiscord | <Andreas> (edit) "maybe" => "maybe, but ARC/ORC do it automagically when your var leaves scope.." |
18:43:46 | FromDiscord | <ratogbm> In reply to @Andreas "`=destroy` maybe, but ARC/ORC": I have it in the main scope... |
18:46:17 | FromDiscord | <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:57 | FromDiscord | <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:09 | FromDiscord | <Andreas> (edit) "https://play.nim-lang.org/#ix=4BZg" => "https://play.nim-lang.org/#ix=4BZh" |
18:47:39 | FromDiscord | <ratogbm> My compiler is marking it bright red... |
18:48:11 | FromDiscord | <ratogbm> nvm, I spelled it wrong |
18:48:51 | FromDiscord | <ratogbm> (edit) "wrong" => "wrong, works now thks" |
18:54:46 | * | xaltsc quit (Quit: WeeChat 4.0.2) |
19:34:16 | NimEventer | New post on r/nim by tttt7777t7: Procedural type troubles, see https://reddit.com/r/nim/comments/15epo7r/procedural_type_troubles/ |
19:36:05 | FromDiscord | <.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:51 | FromDiscord | <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:23 | FromDiscord | <takemichihanagaki3129> sent a code paste, see https://play.nim-lang.org/#ix=4BZD |
20:37:31 | FromDiscord | <takemichihanagaki3129> (edit) "https://play.nim-lang.org/#ix=4BZD" => "https://play.nim-lang.org/#ix=4BZE" |
20:38:30 | FromDiscord | <takemichihanagaki3129> Or force namespaces with macros... |
20:42:53 | FromDiscord | <deech4592> sent a code paste, see https://play.nim-lang.org/#ix=4BZL |
20:43:59 | FromDiscord | <deech4592> However for `std` libs it's probably best to just fully qualify the call |
20:43:59 | FromDiscord | <that_dude.> sent a code paste, see https://play.nim-lang.org/#ix=4BZM |
20:45:36 | FromDiscord | <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:44 | FromDiscord | <takemichihanagaki3129> (edit) "module...↵But" => "module (file)...↵But" |
20:46:40 | FromDiscord | <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:57 | FromDiscord | <takemichihanagaki3129> In reply to @deech4592 "I'm not sure, I": Sure, thanks for the info! |
20:47:51 | FromDiscord | <huantian> In reply to @deech4592 "However for `std` libs": or just not use namespaces |
20:48:01 | FromDiscord | <huantian> I feel like so manyh of the string ops you wouldn't want name spaces for |
20:48:11 | FromDiscord | <huantian> since they're ones you'd want to use ufc |
20:48:37 | FromDiscord | <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:08 | FromDiscord | <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:37 | FromDiscord | <huantian> what are you trying to do |
20:49:38 | FromDiscord | <huantian> haha |
20:50:44 | FromDiscord | <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:11 | FromDiscord | <takemichihanagaki3129> sent a code paste, see https://play.nim-lang.org/#ix=4BZS |
20:52:43 | FromDiscord | <huantian> right but why would you want that |
20:52:56 | FromDiscord | <takemichihanagaki3129> In reply to @huantian "right but why would": For fun. 🙂 |
20:53:05 | FromDiscord | <huantian> i see lol |
20:53:10 | FromDiscord | <huantian> I can't give any alternatives then |
20:53:53 | FromDiscord | <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:01 | FromDiscord | <takemichihanagaki3129> (edit) "to" => "do" |
20:54:22 | FromDiscord | <huantian> I'll still give the same advice that you should almost never need namespaces |
20:55:40 | * | ajunior joined #nim |
20:57:09 | FromDiscord | <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:23 | FromDiscord | <huantian> hm perhaps |
20:57:49 | FromDiscord | <takemichihanagaki3129> (edit) "use" => "using" | "usingthe power of the compiler ... andusing" added "(function overloading)" | "use" => "using" |
20:59:04 | FromDiscord | <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:19 | FromDiscord | <takemichihanagaki3129> In reply to @deech4592 "This isn't helpful for": Sounds a interesting thing to search I'll look for it. |
21:00:20 | FromDiscord | <deech4592> (edit) "think" => "thinking" |
21:00:29 | FromDiscord | <takemichihanagaki3129> (edit) "Sounds a" => "That sounds an" |
21:02:32 | FromDiscord | <takemichihanagaki3129> In reply to @deech4592 "This isn't helpful for": I saw that it has support for wildcard on imports... |
21:02:36 | FromDiscord | <takemichihanagaki3129> Is it true? |
21:03:06 | FromDiscord | <takemichihanagaki3129> `import Console._ // println' bound by wildcard import` |
21:03:27 | FromDiscord | <takemichihanagaki3129> (edit) "Console._ // println' bound by wildcard import`" => "Console._`" |
21:03:54 | kedin | hello... |
21:03:54 | kedin | are you busy right now? |
21:03:55 | kedin | i need some help in a nim exercise... |
21:04:04 | FromDiscord | <deech4592> sent a code paste, see https://play.nim-lang.org/#ix=4BZW |
21:04:22 | FromDiscord | <deech4592> I think D does the latter as well. It's a very nice feature. |
21:04:49 | FromDiscord | <takemichihanagaki3129> In reply to @deech4592 "Yep, it's used all": Is this import only available just inside the scope? |
21:04:57 | FromDiscord | <deech4592> yes |
21:05:11 | FromDiscord | <takemichihanagaki3129> In reply to @deech4592 "yes": Impressive, I liked it. |
21:05:39 | FromDiscord | <takemichihanagaki3129> In python, I do something similar, using lazy imports. |
21:05:52 | kedin | https://play.nim-lang.org/#ix=4BZX |
21:06:04 | kedin | i don,t know why it errors |
21:06:57 | FromDiscord | <huantian> your indentation is invalid |
21:07:07 | FromDiscord | <huantian> you have to add an extra indentation for the if and elif body |
21:07:37 | kedin | hmm |
21:07:38 | kedin | (still doesn,t understand) |
21:07:49 | FromDiscord | <huantian> https://play.nim-lang.org/#ix=4BZY |
21:08:00 | FromDiscord | <huantian> still doesn't work tho because `/=` isn't defined for ints, only for floats |
21:08:41 | kedin | oh.. i guess that makes sense |
21:08:48 | FromDiscord | <huantian> so you'd have to replace it with `nom = nom div 2` |
21:09:45 | FromDiscord | <takemichihanagaki3129> sent a code paste, see https://play.nim-lang.org/#ix=4BZZ |
21:09:58 | FromDiscord | <takemichihanagaki3129> Be consistent with your indentation and you won't have problems. |
21:10:56 | kedin | i,m sorry but... |
21:10:56 | kedin | i don,t know what "indentation" means. |
21:11:04 | kedin | fr |
21:11:27 | FromDiscord | <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:02 | FromDiscord | <takemichihanagaki3129> In reply to @kedin "i don,t know what": A empty space in the start of the line. |
21:12:06 | FromDiscord | <takemichihanagaki3129> (edit) "A" => "An" |
21:12:41 | FromDiscord | <takemichihanagaki3129> sent a code paste, see https://play.nim-lang.org/#ix=4C01 |
21:13:36 | kedin | so you say that my code broke because i had 2 spaces instead of 4? |
21:13:47 | kedin | at the start of the line |
21:14:20 | kedin | * 4 -> 3 |
21:15:07 | * | progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
21:15:31 | * | progranner joined #nim |
21:17:12 | FromDiscord | <takemichihanagaki3129> In reply to @kedin "so you say that": Just if you're not being consistent. |
21:17:31 | kedin | oh... now i get it |
21:17:31 | kedin | it should be just under the function (two spaces after it in the next line) |
21:17:36 | FromDiscord | <takemichihanagaki3129> But you can use what you want.↵I use 3 spaces of indentation for my personal projects. |
21:17:50 | FromDiscord | <takemichihanagaki3129> But generally, people use 2 or 4... |
21:18:46 | kedin | but i used 2 and it gave me an error ??? |
21:19:35 | FromDiscord | <takemichihanagaki3129> In reply to @kedin "but i used 2": It depends on what have you written. Let me see. |
21:20:05 | FromDiscord | <takemichihanagaki3129> Your compiler will tell you where is the error. |
21:20:43 | kedin | it did... but i didn,t understand that i didn,t give it enough spaces |
21:20:47 | kedin | https://play.nim-lang.org/#ix=4BZX |
21:21:07 | FromDiscord | <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:16 | FromDiscord | <takemichihanagaki3129> But it should be inner them. |
21:22:32 | kedin | "inner them" means right after them in the next line? |
21:24:03 | FromDiscord | <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:40 | kedin | oh |
21:24:57 | FromDiscord | <takemichihanagaki3129> Your lastest `echo` is right for what I've understood. Because it's outside of the `while`. |
21:25:11 | FromDiscord | <ieltan> You press space where usually you would put { |
21:25:32 | FromDiscord | <ieltan> Except you don't have to "close" it with anything |
21:25:51 | FromDiscord | <ieltan> What language did you use before Nim? |
21:26:01 | kedin | yeah.. now that makes sense |
21:26:01 | kedin | so to make it inside the scope i have to put 2 spaces for each scope |
21:26:10 | kedin | i was learning c |
21:26:20 | FromDiscord | <ieltan> Ah I see |
21:26:20 | FromDiscord | <takemichihanagaki3129> In reply to @kedin "so to make it": Yes, this. |
21:26:50 | FromDiscord | <ieltan> You don't have to make it two space, but definitely not a single space, it will make your code unreadable |
21:27:54 | kedin | great! |
21:27:54 | kedin | now why something like this isn,t documented or in the tutorial website |
21:27:55 | kedin | https://narimiran.github.io/nim-basics/ |
21:27:56 | kedin | ? |
21:28:25 | FromDiscord | <huantian> https://media.discordapp.net/attachments/371759389889003532/1135685423981662268/image.png |
21:28:29 | FromDiscord | <ieltan> It is documented in the manual/tutorial |
21:28:38 | FromDiscord | <ieltan> You didn't read it 😅 |
21:28:44 | kedin | oh... |
21:29:22 | FromDiscord | <huantian> https://nim-lang.org/docs/tut1.html#statements-and-indentation |
21:30:22 | FromDiscord | <takemichihanagaki3129> sent a code paste, see https://play.nim-lang.org/#ix=4C09 |
21:32:28 | kedin | yeah.. i guess that was a problem in the tutorial i,m using (or perhaps i missed it by accident) |
21:32:28 | kedin | thanks for helping me and understand this! |
21:32:29 | kedin | (i was clueless of this issue...) |
21:33:44 | FromDiscord | <takemichihanagaki3129> In reply to @kedin "thanks for helping me": No prob |
21:36:20 | kedin | <takemichihanagaki3129> i didn,t need to make code like this in c |
21:36:21 | kedin | well.... at least in the ide in codecademy |
21:36:21 | kedin | (just realises that was the case) |
21:38:16 | * | progranner quit (Ping timeout: 258 seconds) |
21:39:24 | kedin | also... |
21:39:24 | kedin | i used the div operator and the code made a weird output and gave an error... |
21:39:25 | kedin | https://play.nim-lang.org/#ix=4C00 |
21:40:12 | FromDiscord | <Elegantbeef> You overflowed with `=3` |
21:41:27 | FromDiscord | <huantian> you're multiplying a number by 3 over and over |
21:46:10 | kedin | i realised |
21:46:11 | kedin | it isn,t dividing bc it still odd |
21:46:11 | kedin | i should add one to make it even as the tutorial said |
21:46:12 | kedin | https://narimiran.github.io/nim-basics/#_while_loop |
21:46:12 | kedin | now it fixed https://play.nim-lang.org/#ix=4C0c |
21:48:06 | kedin | thanks again for helping a noobie like me to complete a exercise like this... |
21:48:06 | kedin | even tho i should have tried harder to do it myself.. |
21:49:41 | kedin | (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:45 | FromDiscord | <.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:05 | FromDiscord | <demotomohiro> It should be possible as long as same algorith and same key is used. |
22:41:54 | FromDiscord | <.uninnocent> In reply to @demotomohiro "It should be possible": Such as? |
22:42:03 | FromDiscord | <Elegantbeef> 1 |
22:44:35 | FromDiscord | <huantian> ah yes I love using the 1 encryption algo |
22:44:41 | FromDiscord | <huantian> it's super simple too you always just use 1 as the key |
22:45:00 | FromDiscord | <Elegantbeef> Same |
22:45:17 | FromDiscord | <demotomohiro> Most of encryption algorithms specify how it encrypt/decrypt data and different programming languages or OSs produce same bit patterns. |
22:46:37 | FromDiscord | <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:28 | FromDiscord | <.uninnocent> Is xxtea good + compatable with both? |
23:00:02 | * | marcus quit (Remote host closed the connection) |
23:00:44 | * | marcus joined #nim |