00:01:56 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46Bm |
00:02:02 | FromDiscord | <!Patitotective> (edit) "https://play.nim-lang.org/#ix=46Bm" => "https://play.nim-lang.org/#ix=46Bn" |
00:02:08 | FromDiscord | <!Patitotective> why is padding 0 |
00:05:23 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46Bp |
00:14:22 | FromDiscord | <!Patitotective> ok beef, ive no idea↵you must forgive me↵ill work around it |
00:18:47 | FromDiscord | <Elegantbeef> Is it a bug with imported types and sequences perhaps |
00:20:09 | FromDiscord | <!Patitotective> im going to add a screenshot of your message to _Additional information_ in my nimgl issue |
00:23:59 | FromDiscord | <Elegantbeef> I mean it might not even be a nimgl bug |
00:24:30 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46Bs |
00:24:54 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "I mean it might": but i haven't been able to reproduce it without imgui :/ |
00:32:50 | FromDiscord | <Elegantbeef> Did you import a type like they do? |
00:33:00 | FromDiscord | <Elegantbeef> Like remove the imgui dependency and attempt to reproduce it |
00:51:10 | FromDiscord | <AmjadHD> Hi, Where do I access the docs generated from my fork of Nim ? |
00:52:12 | FromDiscord | <!Patitotective> In reply to @AmjadHD "Hi, Where do I": you have to generate them |
00:54:53 | FromDiscord | <AmjadHD> In reply to @Patitotective "you have to generate": How ? |
00:55:52 | FromDiscord | <!Patitotective> In reply to @AmjadHD "How ?": this is how they do it↵https://github.com/nim-lang/Nim/blob/devel/.github/workflows/ci_docs.yml |
01:00:27 | FromDiscord | <AmjadHD> In reply to @Patitotective "this is how they": So do I need to merge the commit to devel for docs to be generated ? |
01:02:40 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Did you import a": (amazing edit) https://media.discordapp.net/attachments/371759389889003532/1004554928641019934/unknown.png https://media.discordapp.net/attachments/371759389889003532/1004554929047871599/unknown.png |
01:03:32 | FromDiscord | <!Patitotective> In reply to @AmjadHD "So do I need": compile koch and `./koch doc`↵i think |
01:04:17 | FromDiscord | <!Patitotective> In reply to @Patitotective "(amazing edit)": could the x and y `importc`ed have some weird stuff? |
01:05:26 | FromDiscord | <Elegantbeef> Import your own type |
01:05:35 | FromDiscord | <Elegantbeef> Like i said to do 3 times |
01:05:57 | FromDiscord | <!Patitotective> you mean put `ImVec2` in another module and import it? or |
01:06:09 | FromDiscord | <Elegantbeef> No have C++ code you import just like they do |
01:06:14 | FromDiscord | <Elegantbeef> Cmon patito i believe in you |
01:06:24 | FromDiscord | <!Patitotective> nooo c++, pls |
01:06:33 | FromDiscord | <Elegantbeef> Use `{.emit.}` and `importCpp` |
01:15:58 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46BB |
01:16:18 | FromDiscord | <!Patitotective> (edit) "https://play.nim-lang.org/#ix=46BB" => "https://play.nim-lang.org/#ix=46BC" |
01:23:29 | FromDiscord | <Elegantbeef> No clue what does the compiler say |
01:25:14 | FromDiscord | <!Patitotective> i mean, it works↵the assert fails |
01:25:17 | FromDiscord | <!Patitotective> padding is 10 10 |
01:26:41 | FromDiscord | <!Patitotective> so imgui must be doing some weird stuff |
01:28:31 | FromDiscord | <Girvo> Sounds like imgui is doing some internal initialisation or something? |
01:37:45 | FromDiscord | <Professor Actual Factual> Am i missing out not ever using pure `object` and sticking with `ref object`?↵Outside of really niche programming fields (e.g. stack), why would I ever mix and match between the two. What do people here tend to use |
01:40:15 | FromDiscord | <Elegantbeef> Does the imgui vector have a default constructor, could be related to that? |
01:40:21 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46BH |
01:40:23 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Does the imgui vector": :p |
01:40:49 | FromDiscord | <!Patitotective> c++ defines constructors in the struct definition, right? |
01:42:56 | FromDiscord | <Elegantbeef> ` IM_VEC2_CLASS_EXTRA // Define additional constructors and implicit cast operators in imconfig.h to convert back and forth between your math types and ImVec2.` that macro is sketchy↵\` |
01:44:06 | FromDiscord | <Elegantbeef> Yes |
01:44:06 | FromDiscord | <Elegantbeef> It's probably macro inside the def |
01:44:24 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46BI |
01:44:58 | FromDiscord | <Elegantbeef> Yea the constructor is dubious |
01:45:10 | FromDiscord | <Elegantbeef> Atleast it might possibly cause this |
01:45:35 | * | tiorock joined #nim |
01:45:35 | * | tiorock quit (Changing host) |
01:45:35 | * | tiorock joined #nim |
01:45:35 | * | rockcavera quit (Killed (zinc.libera.chat (Nickname regained by services))) |
01:45:35 | * | tiorock is now known as rockcavera |
01:47:27 | * | tiorock joined #nim |
01:47:27 | * | tiorock quit (Changing host) |
01:47:27 | * | tiorock joined #nim |
01:47:27 | * | rockcavera quit (Killed (lead.libera.chat (Nickname regained by services))) |
01:47:27 | * | tiorock is now known as rockcavera |
01:49:55 | FromDiscord | <bumpy> sent a long message, see http://ix.io/46BJ |
01:50:15 | FromDiscord | <Elegantbeef> Antivirus is shit so it targets a common denominator is what i've been hearing |
01:50:32 | FromDiscord | <Elegantbeef> Report it as a false positive to your AV software and hope that it changes |
01:50:32 | FromDiscord | <bumpy> ah, lovely |
01:50:52 | FromDiscord | <Elegantbeef> The reason it's getting flagged is likely due to people using it to write malware but i think that's not really substantiated |
01:51:00 | FromDiscord | <bumpy> it's the built in antivirus for windows 😅 |
01:54:28 | FromDiscord | <j-james> oh that's fantastic, yikes |
01:55:18 | FromDiscord | <Girvo> Sophos also marks it. It's idotic |
01:55:21 | FromDiscord | <Girvo> (edit) "idotic" => "idiotic" |
01:58:31 | FromDiscord | <Elegantbeef> Report as false positive and hope eventually it'll either get marked as "super virus" or no longer considered a virus |
02:00:38 | FromDiscord | <!Patitotective> ~~microsoft hardcoding a token in their apps so windows doesnt mark them as virus~~ |
02:24:14 | FromDiscord | <Hi02Hi> sent a code paste, see https://play.nim-lang.org/#ix=46BM |
02:26:15 | FromDiscord | <Elegantbeef> Oh did my response not go through |
02:26:33 | FromDiscord | <Elegantbeef> > Generally you use what you need, if you dont need OOP mechanisms a pure inheritable is better↵Is what i said |
02:26:44 | FromDiscord | <Professor Actual Factual> In reply to @Hi02Hi "One difference is that": Thanks for the reply. I'm aware of the properties of `object` and `ref object`↵My question is why would you ever want to use an `object` |
02:27:02 | FromDiscord | <Professor Actual Factual> E.g. what scenarios would warrant you prefering it over the other? |
02:27:06 | FromDiscord | <Elegantbeef> Why would you ever want to use a `ref` is the real question |
02:27:22 | FromDiscord | <Girvo> I basically _only_ use `object`; stack allocation as the default means avoiding unneccesary mallocs, which for the stuff I'm doing is ideal 🙂 |
02:27:39 | FromDiscord | <Elegantbeef> References should only be used in the case you want reference semantics |
02:27:44 | FromDiscord | <Girvo> ^ what he said |
02:28:01 | FromDiscord | <Girvo> We still have some `ref object` types in there, but they're explicit and used sparingly |
02:28:05 | FromDiscord | <Elegantbeef> reference objects are not stored contiguously in memory which means you always get a pointer indirection to access them, and you also introduce possible memory issues |
02:28:06 | FromDiscord | <Professor Actual Factual> In reply to @Elegantbeef "References should only be": Almost always I need reference semantics, I can't think of a time I wouldn't want reference semantics ;/ |
02:28:32 | FromDiscord | <Professor Actual Factual> In reply to @Elegantbeef "reference objects are not": That Im aware, in embedded stuff this is key |
02:28:40 | FromDiscord | <Elegantbeef> Well then you use ref objects |
02:28:41 | FromDiscord | <Hi02Hi> That sounds like a difference in usecases |
02:28:49 | FromDiscord | <Elegantbeef> I hardly ever use reference objects as they're a bitch to everything |
02:30:03 | FromDiscord | <Girvo> Even for desktop use I prefer to avoid ref object unless I explicitly need it's behaviour: if performance is the goal, I find it easier to achieve (for some definition of performance) by avoiding the need to chase pointers. Also I just find it easier to reason about lol but thats a personal bias more than anything else |
02:30:08 | FromDiscord | <Professor Actual Factual> My current nim philosophy is use `ref object` unless you have a reason not to. But clearly others here think it should be the other way around. ↵What I don't see is why you wouldn't always use `ref object` in your day to day work |
02:30:39 | FromDiscord | <Hi02Hi> I personally default to plain objects but would use ref objects if necessary, though I haven't found a clear usecase imho. |
02:31:38 | FromDiscord | <Professor Actual Factual> In reply to @Elegantbeef "reference objects are not": This is hardly an issue for day to day work. Performance critical work I agree, but Im not implementing `seq` from scratch or doing embedded work |
02:32:16 | FromDiscord | <Elegantbeef> Cause i dont need to have multiple views to objects↵(@Professor Actual Factual) |
02:32:17 | FromDiscord | <Girvo> Using `object` by default is hardly any more difficult than using `ref object` by default, and it gives me performance for free. Why wouldn't I? |
02:32:19 | FromDiscord | <Elegantbeef> It complicates the scope of the program |
02:32:29 | FromDiscord | <Professor Actual Factual> In reply to @Elegantbeef "It complicates the scope": Thats a very good point |
02:32:56 | FromDiscord | <Elegantbeef> References are pointers, if you cannot validate using a pointer then why use a reference? |
02:34:10 | FromDiscord | <Professor Actual Factual> In reply to @Girvo "Using `object` by default": I guess it would depend on the type of work. For me my day to day is scientific computing, which means large data and alot of creating of objects. So I can see why I tend towards `ref object` |
02:34:32 | FromDiscord | <Elegantbeef> What benefit does it afford you? |
02:34:48 | FromDiscord | <Professor Actual Factual> In reply to @Elegantbeef "What benefit does it": Stack issues by exceeding it primarily |
02:34:53 | FromDiscord | <Professor Actual Factual> Also threaded work |
02:35:17 | FromDiscord | <Professor Actual Factual> But thats obvious that ref is the better choice |
02:35:40 | FromDiscord | <Girvo> For threaded work (which I live in entirely haha) I find `object` far _far_ easier to reason about than `ref object` which then means locks etc. etc. -- but my stuff works by-copy message passing so it also depends I guess |
02:36:04 | FromDiscord | <Elegantbeef> Yea girvo i prefer passing data along over accessing it from the heap |
02:36:23 | FromDiscord | <Elegantbeef> If you can avoid using mutexs you should |
02:36:43 | FromDiscord | <Elegantbeef> It's another case where `ref` slows down the program 😛 |
02:37:01 | FromDiscord | <Hi02Hi> In reply to @Professor Actual Factual "Stack issues by exceeding": I think that unless you are using 2 views of the same object, then ref objects use more space, as ref objects still have to point to something. If they are all pointing to different things, then you are allocating separate objects and separate references, the extra refs take more space |
02:37:03 | FromDiscord | <Professor Actual Factual> In reply to @Girvo "For threaded work (which": Interesting perspective. I don't do copy messages |
02:37:20 | FromDiscord | <Girvo> Yeah even threaded programming has a few approaches! It's pretty neat 🙂 |
02:37:24 | FromDiscord | <Elegantbeef> It's negligable↵(@Hi02Hi) |
02:37:30 | FromDiscord | <Girvo> And Nim is great because we can do all of them haha |
02:37:32 | FromDiscord | <Hi02Hi> In reply to @Elegantbeef "It's negligable (<@787421416227995699>)": true |
02:37:40 | FromDiscord | <Hi02Hi> but still |
02:37:42 | FromDiscord | <Elegantbeef> Objects also use more space since they cannot share stack |
02:38:41 | FromDiscord | <Professor Actual Factual> Ya i don't buy performance issues stuff arguement. And i've coded a low level stack based `CircularBuffer` before, performance benefit was there, but not that much |
02:38:50 | FromDiscord | <Hi02Hi> In reply to @Elegantbeef "Objects also use more": What do you mean? does this not apply to refs? |
02:39:02 | FromDiscord | <Elegantbeef> I mean depends what you're doing |
02:39:08 | FromDiscord | <Hi02Hi> if they point to different things i mean |
02:39:31 | FromDiscord | <Elegantbeef> If you're doing heavy iteration over references you're purposely slowing down your code |
02:39:44 | FromDiscord | <Professor Actual Factual> Arguements to use `object` seem to come to↵1. Reducing complicated scope of the program↵2. Needing to work in the stack↵3. Avoiding issues that come with working with references (e.g. copy on assign vs ref on assign) |
02:39:51 | FromDiscord | <Elegantbeef> I can prove that references are fucking terrible for iterative performance in like lines of code |
02:40:02 | FromDiscord | <Elegantbeef> like 10 lines of code\ |
02:40:19 | FromDiscord | <Girvo> > Ya i don't buy performance issues stuff arguement↵I mean I can show you benchmarks if you're interested haha. It makes a huge difference, which is why it matters in embedded. Still matters if you care about fitting in L1/L2 etc |
02:40:32 | FromDiscord | <Girvo> Surprisngly huge difference, is what I mean 🙂 |
02:40:52 | FromDiscord | <Professor Actual Factual> Yes the memory access stuff for l1 l2 cache can make magnitiude of performance gains. I don't disagree |
02:41:06 | FromDiscord | <Elegantbeef> So then why do you say "i dont buy the performance" |
02:41:07 | FromDiscord | <Professor Actual Factual> BUt when you are playing with anything larger than that I don't see it |
02:41:22 | FromDiscord | <Girvo> But bro. _Everything_ goes into L1/L2 lol |
02:41:23 | FromDiscord | <Elegantbeef> If you ever iterate a collection of your data types you're slowing down the program by using references |
02:41:25 | FromDiscord | <Elegantbeef> It's a fact |
02:41:39 | FromDiscord | <Girvo> (Well, mostly. It's complicated) |
02:41:41 | FromDiscord | <Elegantbeef> Even with large objects it's a fact |
02:42:22 | FromDiscord | <Elegantbeef> References add indirection which means you have to fetch memory a lot more for objects |
02:42:35 | FromDiscord | <Elegantbeef> So you then just ruin your cache and have to go back to memory more and more |
02:43:36 | FromDiscord | <Professor Actual Factual> sent a long message, see http://ix.io/46BO |
02:43:40 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46BP |
02:44:02 | FromDiscord | <Elegantbeef> I'm more game dev focused so is that "general purpose" 😄 |
02:44:02 | FromDiscord | <Girvo> Embedded isn't a different beast, it's just magnified, is my point |
02:45:08 | FromDiscord | <Elegantbeef> You dont increase the program complexity by using `object` over `ref object` but can speed it up, so i dont get why you'd ever default to `ref object` it just is purposely shooting your program in the leg |
02:45:27 | FromDiscord | <Professor Actual Factual> sent a code paste, see https://play.nim-lang.org/#ix=46BQ |
02:45:30 | FromDiscord | <Professor Actual Factual> Its just not practical |
02:45:32 | FromDiscord | <Elegantbeef> Treeform uses ref a fair bit, but his reason is to reduce copying(which is less of an issue with orc/arc) |
02:45:44 | FromDiscord | <Elegantbeef> Do `seq[Player]` |
02:45:58 | FromDiscord | <Elegantbeef> There is no stack allocation there aside from the pointer to seq |
02:46:11 | FromDiscord | <Elegantbeef> But we've made the program faster cause we dont have any added pointer indirection |
02:46:19 | FromDiscord | <Elegantbeef> `object` isnt always stored on the stack |
02:46:29 | FromDiscord | <Professor Actual Factual> In reply to @Elegantbeef "`object` isnt always stored": Really? I never knew that |
02:46:53 | FromDiscord | <Elegantbeef> It's a 'value type' which means when declared in a proc it's stored on the stack, but for collections it's stored on the heap, but since it's fixed size and isnt a pointer it's stored contiguously |
02:47:21 | FromDiscord | <Elegantbeef> So you have instead of `pointer Player, pointer Player` `Player, Player` the fields are after eachother |
02:47:41 | FromDiscord | <Elegantbeef> Which means when you have 64 - 128 bytes as your cache line when you fetch a single player you fetch parts of the next(s) |
02:47:50 | FromDiscord | <Hi02Hi> Arrays are stack based, but seqs are heap based for their data, for example |
02:48:21 | * | arkurious quit (Quit: Leaving) |
02:48:25 | FromDiscord | <Elegantbeef> > Really? I never knew that↵Is this sarcasm? |
02:49:02 | FromDiscord | <Professor Actual Factual> In reply to @Elegantbeef "> Really? I never": No. I though `object` is stack `ref` is heap. Or at least thats my understanding↵Im aware fields of those objects can be head based, for example araqs implementation of `seq` |
02:49:20 | FromDiscord | <Professor Actual Factual> (edit) "though" => "thought" | "head" => "heap" |
02:49:20 | FromDiscord | <Hi02Hi> Single objects are also on the stack, but I don't think that's a worry |
02:50:08 | FromDiscord | <ElegantBeef> bridge moment https://media.discordapp.net/attachments/371759389889003532/1004581974863773778/unknown.png |
02:51:31 | FromDiscord | <ElegantBeef> This is why people arent concerned about blowing the stack up, cause no one is storing all their data there, they store it in a collection that's heap allocated |
02:51:58 | FromDiscord | <ElegantBeef> The fun part is in Nim `ref object` is actually just a shorthand |
02:52:56 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=46BS |
02:53:11 | FromDiscord | <Professor Actual Factual> In reply to @ElegantBeef "the `type Player =": I tend to see this approach used alot in the stdlib |
02:53:12 | FromDiscord | <Elegantbeef> Hmm bridge seems to be alive again |
02:53:31 | FromDiscord | <Elegantbeef> Yea depending on what's being done there is reason for it |
02:53:41 | FromDiscord | <Rika> You have 8 pointers in your cache, then when you dereference them you flush that lol |
02:53:46 | FromDiscord | <Elegantbeef> But it's also somewhat a remnant of Nim being pascal |
02:53:58 | FromDiscord | <Elegantbeef> Well cacheline isnt the size of your cache 😄↵(@Rika) |
02:54:05 | FromDiscord | <Girvo> Also known as The Good Old Days 😉 |
02:54:07 | FromDiscord | <Rika> I guess |
02:54:08 | FromDiscord | <Professor Actual Factual> In reply to @Elegantbeef "But it's also somewhat": Ah, i thought it was because of move semantics and destructors |
02:54:16 | FromDiscord | <Girvo> `TName` and `PWhatever` lol |
02:54:34 | FromDiscord | <Elegantbeef> It's a mixture of both i'd say |
02:54:43 | FromDiscord | <Elegantbeef> The compiler has `TName` and `PName` |
02:54:53 | FromDiscord | <Girvo> I know 🙂 |
02:55:04 | FromDiscord | <Elegantbeef> Cause it was written in pascal and transpiiled to Nim |
02:55:43 | FromDiscord | <Elegantbeef> Which i think is objectively cool 😄 |
02:56:15 | FromDiscord | <Rika> Not refly? |
02:56:19 | FromDiscord | <Elegantbeef> Anyway i hope learning that you cannot use object too much to stack overflow changes your view |
02:56:22 | FromDiscord | <Girvo> I still love Pascal. I wish it had won instead of C in terms of being the base language/ABI for operating systems 😭 |
02:56:32 | FromDiscord | <Elegantbeef> Fuck that'd be wonderful girvo |
02:56:50 | FromDiscord | <Elegantbeef> A strongly typed language |
02:57:05 | FromDiscord | <Rika> I don’t know, I think it would have been same old same old |
02:57:15 | FromDiscord | <Elegantbeef> I mean things would be more clear |
02:57:22 | FromDiscord | <Rika> I guess slightly better but not by much |
02:57:28 | FromDiscord | <Elegantbeef> instead of `T` you'd have `^array[T]` |
02:57:39 | FromDiscord | <Elegantbeef> It'd be much more readable for ABI |
02:57:42 | FromDiscord | <Girvo> And type defintions are far easier to read lol |
02:57:44 | FromDiscord | <Girvo> Yeah haha |
02:57:55 | FromDiscord | <Elegantbeef> And the intent is more clear so you can probably automate more |
02:58:03 | FromDiscord | <Girvo> But again, I'm biased because of the shit I'm working on at the moment. ESP-IDF is nice, but man C does not make it easy sometimes |
02:58:23 | FromDiscord | <Elegantbeef> `T` is ambiguous but in pascal `^T` and `array[T]` are very clear |
02:58:52 | FromDiscord | <Elegantbeef> Actually girvo am i wrong with the Pascal array syntax |
02:58:59 | FromDiscord | <Elegantbeef> I havent ever wrote it so i'm just going off memory |
02:59:09 | FromDiscord | <Rika> But I still think it would be better had we figured out ABI with another system instead |
02:59:29 | FromDiscord | <Elegantbeef> Sure but given the choice between pascal and C for ABI i'd take pascal 10/10 times |
03:00:06 | FromDiscord | <Elegantbeef> Pascal is just much more explicit about what things are and as such makes life easier for everyone involved |
03:00:11 | FromDiscord | <b1rdf00d> relevant article RE values vs refs: https://blog.johnnovak.net/2017/04/22/nim-performance-tuning-for-the-uninitiated/#2-nim-----custom-vector-class-object-refs |
03:00:15 | FromDiscord | <Professor Actual Factual> In reply to @Elegantbeef "Anyway i hope learning": Thank you. And thanks to everyone who participated in this discussion.↵↵I guess I kind of did change my view. Instead of being a `ref object` unless you have a good reason not to. I am a `object` unless you have to person. |
03:00:30 | FromDiscord | <Elegantbeef> Yay! |
03:00:41 | FromDiscord | <Hi02Hi> You're welcome! |
03:00:44 | FromDiscord | <Girvo> No worries! It's a fascinating topic really |
03:00:47 | FromDiscord | <Elegantbeef> The proselytization worked |
03:02:25 | FromDiscord | <Hi02Hi> In reply to @Girvo "I still love Pascal.": maybe this is off topic but in the early days wasn't c fighting asm? was pascal ever competing with asm? |
03:03:10 | FromDiscord | <Elegantbeef> Pascal was originally a language for teaching but there were many dialects that were competing with C |
03:03:13 | FromDiscord | <Hi02Hi> and since low level stuff used asm, c gained a reputation there and spread? |
03:03:23 | FromDiscord | <Girvo> C won because Unix won, more-or-less |
03:03:40 | FromDiscord | <Girvo> Pascal was used as the low-level language in Mac OS (the old one not the new one) extensively |
03:03:46 | FromDiscord | <Hi02Hi> ah so it gained its rep in unix? |
03:04:04 | FromDiscord | <Elegantbeef> Those bastards made a language then made software with it |
03:04:10 | FromDiscord | <Elegantbeef> Fuckers ruined computing! |
03:04:13 | FromDiscord | <Girvo> Haha |
03:04:27 | FromDiscord | <Girvo> But C and Unix are inextricably linked |
03:04:27 | FromDiscord | <Elegantbeef> Wirth needed to make oberon 30 years before he did |
03:04:45 | FromDiscord | <Girvo> Yeah I do wish Wirth was more in actual production software dev rather than teaching haha |
03:04:48 | FromDiscord | <Prestige> Weren't c and unix made at the same time |
03:04:51 | FromDiscord | <Girvo> Would've been a different world |
03:05:03 | FromDiscord | <Girvo> Yep, and they made each other what they are |
03:05:22 | FromDiscord | <Girvo> Its why the C ABI is what is used by basically every OS |
03:05:34 | FromDiscord | <Elegantbeef> Even the NT one 😛 |
03:05:42 | FromDiscord | <Girvo> COM makes me want to die |
03:05:50 | FromDiscord | <Girvo> Thats only semi related |
03:05:54 | FromDiscord | <Girvo> But I still feel the need to share |
03:06:20 | FromDiscord | <Prestige> JS makes me want to die |
03:06:22 | FromDiscord | <Elegantbeef> I say we make a time machine using a pascal dialect go back in time and make a good unix derived kernel before unix is made |
03:06:23 | FromDiscord | <Hi02Hi> In reply to @Girvo "Pascal was used as": til |
03:06:25 | FromDiscord | <Elegantbeef> Problem solved |
03:06:26 | FromDiscord | <Girvo> Speaking of, fuck me I am upset that Carbon is basically going "we're replacing C++, but making the same mistake wrt. ABI guarantees, so fuck anyone who wants to link to it from another language" |
03:06:58 | FromDiscord | <Elegantbeef> I mean luckily carbon isnt overly inviting to new developers 😄 |
03:06:59 | FromDiscord | <Prestige> C++ was a mistake |
03:07:02 | FromDiscord | <Girvo> For a while, it looked like Pascal dialects were going to be _the_ "high level systems language" above Assembly |
03:07:15 | FromDiscord | <Girvo> Hah not wrong, beef. But still, Google worries me. |
03:07:44 | FromDiscord | <Elegantbeef> Modula-2 and delphi? 😄 |
03:07:48 | FromDiscord | <Hi02Hi> i hope it doesn't happen again with nim v carbon |
03:08:03 | FromDiscord | <Prestige> Wdym? |
03:08:06 | FromDiscord | <Girvo> Hah man I loved Delphi |
03:08:06 | FromDiscord | <Elegantbeef> Why did you just say `nim vs nim but curly` |
03:08:16 | FromDiscord | <Hi02Hi> In reply to @Girvo "For a while, it": ^ |
03:08:21 | FromDiscord | <Girvo> nim vs nim but curly and weird some seriously odd choices |
03:08:30 | FromDiscord | <Girvo> Mind you, Nim has a few of those too I guess lol |
03:08:34 | FromDiscord | <Elegantbeef> Nim must really make you happy given it's very pascallian |
03:08:39 | FromDiscord | <Girvo> Yep! |
03:08:43 | FromDiscord | <Prestige> Nim > Carbon, that's all I'm saying |
03:08:46 | FromDiscord | <Girvo> Its why I adopted it initially 😄 |
03:08:47 | FromDiscord | <Elegantbeef> Nim doesnt do `let a:! f32 = 100` |
03:08:50 | FromDiscord | <Hi02Hi> agreed |
03:08:52 | FromDiscord | <Girvo> Pascal, but modern |
03:08:54 | FromDiscord | <Elegantbeef> Like the fuck is that constant declaration |
03:08:59 | FromDiscord | <Elegantbeef> I'll never not shit talk that |
03:09:02 | FromDiscord | <Girvo> haha |
03:09:08 | FromDiscord | <Girvo> Looks like line noise |
03:09:11 | FromDiscord | <Elegantbeef> Who the fuck though `:!` looks like constant |
03:09:12 | FromDiscord | <Rika> What does that exclamation point mean |
03:09:20 | FromDiscord | <Elegantbeef> It's a compile time constant rika |
03:09:23 | FromDiscord | <Girvo> `:!` just looks like a weird emoticon |
03:09:25 | FromDiscord | <Hi02Hi> `const` |
03:09:29 | FromDiscord | <Elegantbeef> I shit you not |
03:09:36 | FromDiscord | <Elegantbeef> `let a:!` is Nim's `const a` |
03:09:51 | FromDiscord | <Rika> Okay so do they have any such type inference |
03:10:00 | FromDiscord | <Rika> How would that work if so |
03:10:11 | FromDiscord | <Elegantbeef> `let a:! auto = 0` |
03:10:20 | FromDiscord | <Rika> Wow |
03:10:25 | FromDiscord | <Elegantbeef> Rika carbon doesnt do implicit type inference |
03:10:40 | FromDiscord | <Elegantbeef> you have to use `auto` like it's C++ |
03:10:41 | FromDiscord | <Girvo> Don't forget: Carbon is written for C++ developers first and foremost |
03:10:54 | FromDiscord | <Girvo> Those poor, poor bastards |
03:11:07 | FromDiscord | <Elegantbeef> Imagine wanting a modern C++ and getting this as an offering |
03:11:14 | FromDiscord | <Elegantbeef> That's like wanting a modern C and getting vlang |
03:11:40 | FromDiscord | <Elegantbeef> Or wanting a modern oberon and getting Go |
03:11:55 | FromDiscord | <Elegantbeef> Which i'm certain shares like nothing of worth with Oberon |
03:12:51 | FromDiscord | <Elegantbeef> "So we copied exporting, but we made it use a captialised ASCII character, we made packages installable through git without any declaration of requirements, we've copied `:=` and uh.... yea" |
03:13:37 | FromDiscord | <Elegantbeef> I dont know how language designers get qualifications at google related ventures, but fuck do they need to retest them |
03:13:49 | * | wallabra_ joined #nim |
03:14:14 | * | wallabra quit (Ping timeout: 240 seconds) |
03:14:27 | FromDiscord | <Elegantbeef> The most cursed thing about carbon is they're considering making it so you can use different C++ compilers for different C++ packages at the same time |
03:14:41 | FromDiscord | <Elegantbeef> So you can import some code for C++17 and C++20 and C++14 |
03:15:08 | FromDiscord | <Girvo> Except you can't really, you have to recompile the C++ to even use it lol |
03:15:17 | * | wallabra_ is now known as wallabra |
03:15:28 | FromDiscord | <Elegantbeef> I mean presently you have to transpile it to Carbon |
03:15:31 | FromDiscord | <Girvo> So it doesn't even solve the whole "linking against C++ libraries without a C intermediate marshalling stuff back and forward" shit lol |
03:15:35 | FromDiscord | <Elegantbeef> But they do intend on Zig like imports |
03:16:04 | FromDiscord | <Girvo> Yep but it'll always require re-compiling that C++ source. No linking libraries here lol. So it's not even a good replacement to C |
03:16:07 | FromDiscord | <Elegantbeef> they want you to be able to do `using someC++Package # C++ 17` or something similar |
03:16:37 | FromDiscord | <Girvo> Which I get: it's bloody hard to do. I just hoped Google of all companies would tackle it lol |
03:16:39 | FromDiscord | <Elegantbeef> It's such an odd language |
03:16:44 | FromDiscord | <Girvo> It really, really is |
03:16:53 | FromDiscord | <Elegantbeef> Just use D-lang |
03:17:04 | FromDiscord | <Rika> I didn’t look at carbon at all because it felt like all hype |
03:17:36 | FromDiscord | <Elegantbeef> Syntax/semantic wise it's pretty much Nim - but with curlies and more cruft |
03:17:54 | FromDiscord | <Prestige> I'm wary of decisions made by anyone that chooses to write c++ |
03:18:05 | FromDiscord | <Elegantbeef> It still uses all the same operators for pointers/references |
03:18:12 | FromDiscord | <Elegantbeef> So code is still incredibly tedious to parse |
03:18:35 | FromDiscord | <Elegantbeef> `` and `&` totally look like a pointer and reference respectively |
03:19:04 | FromDiscord | <Elegantbeef> Say what you will but `^` very much is a point |
03:19:47 | FromDiscord | <Elegantbeef> Remember they're the folks that think MI is a good idea 😛↵(@Prestige) |
03:20:21 | FromDiscord | <Elegantbeef> Yes i'll continue joking about MI |
03:20:53 | FromDiscord | <Hi02Hi> whats mi (?) |
03:20:59 | FromDiscord | <Elegantbeef> Multiple inheritance |
03:21:16 | FromDiscord | <b1rdf00d> oh man how good is concrete multiple inheritance |
03:21:18 | FromDiscord | <Prestige> Eh they don't do anything correctly |
03:21:27 | FromDiscord | <Hi02Hi> im not an oop person why is that bad? |
03:21:43 | FromDiscord | <Elegantbeef> It can create even more complicated to follow inheritance trees |
03:21:49 | FromDiscord | <Elegantbeef> Plus the diamond problem is fun |
03:21:56 | FromDiscord | <Prestige> It gives developers more choice in how they write code |
03:22:16 | FromDiscord | <Prestige> Which is good for good engineers, bad for bad engineers |
03:22:57 | FromDiscord | <Hi02Hi> so the problem is people default to bad engineers? |
03:23:39 | FromDiscord | <Prestige> Most (or at least half) of software devs suck, or are relatively new to programming |
03:23:40 | FromDiscord | <DaiChimpo> I know my boss does |
03:23:56 | FromDiscord | <Elegantbeef> Dont lie they all suck↵(@Prestige) |
03:24:02 | FromDiscord | <Elegantbeef> If they write code they're awful programmers |
03:24:15 | FromDiscord | <Prestige> Eh I know some good ones |
03:24:47 | FromDiscord | <b1rdf00d> in my experience: ↵it's been used to limit duplicated code, but then you end up with some class that needs different behaviour and it becomes a real mess to extend it↵or; you're trying to debug why the state of some instance is changing and it has a very deep inheritance tree |
03:25:11 | FromDiscord | <Elegantbeef> Yea avoiding inheritance trees is just for the best |
03:25:30 | FromDiscord | <Elegantbeef> Interfaces/traits are the way to go imo |
03:25:46 | FromDiscord | <Prestige> That's just crippled MI |
03:26:04 | FromDiscord | <Prestige> MI isn't inherently bad, it just gets misused |
03:26:10 | FromDiscord | <b1rdf00d> yeah it's not _good_ but it still existed and I needed to work with it |
03:27:10 | FromDiscord | <b1rdf00d> Robert Nystrom's Game Programming Patterns I think it a really pragmatic book on different architectures, it feels like it's how youre meant to use OOP |
03:29:28 | FromDiscord | <Bubblie> is there any alternatives to std vector for nim or is there one in nim? |
03:29:51 | FromDiscord | <b1rdf00d> seq |
03:30:09 | FromDiscord | <Bubblie> thanks! |
03:31:58 | FromDiscord | <b1rdf00d> sent a long message, see http://ix.io/46BX |
03:32:21 | FromDiscord | <b1rdf00d> I guess this is just contributing to OSS |
03:38:17 | FromDiscord | <Bubblie> is there anything on using seq? |
03:38:32 | FromDiscord | <Bubblie> feel like im doing something wrong so I just want to double check here |
03:40:07 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#types-array-and-sequence-types |
03:40:26 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/tut1.html#advanced-types-sequences |
03:48:08 | FromDiscord | <Bubblie> thanks! |
03:55:49 | FromDiscord | <Bubblie> whats the difference between newSeq and seq? |
04:00:53 | FromDiscord | <Elegantbeef> One is a procedure the other is a type |
04:01:01 | FromDiscord | <Elegantbeef> `newSeq` allocates and 0's a sequence |
04:40:42 | FromDiscord | <DaiChimpo> Funny little question: I got 2000+ values to sort but the range is only 0-15, roughly, heavy weighting on smaller numbers. Good Bubble Sort scenario? |
04:52:31 | FromDiscord | <Elegantbeef> I'm simple i'd just use the stdlib sort unless it proved to be a bottle neck |
05:32:24 | FromDiscord | <Phil> Out of curiosity, what does `system/coro_detection` do?↵I can't look at the docs for it, they throw 404s |
05:32:29 | FromDiscord | <Phil> (edit) "404s" => "404s↵https://nim-lang.org/docs/coro_detection.html" |
05:34:34 | FromDiscord | <flywind> It is used internally for `std/coro`. |
05:34:37 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=46Co |
05:36:41 | FromDiscord | <flywind> In reply to @Isofruit "Out of curiosity, what": https://nim-lang.org/docs/coro.html |
05:37:53 | FromDiscord | <flywind> In reply to @Isofruit "Like, this is the": It probably has been fixed by my pr. |
05:39:03 | FromDiscord | <flywind> With https://github.com/nim-lang/Nim/pull/20151 hintAsError and warningAsError now ignore foreign packages |
05:41:55 | FromDiscord | <Phil> Ohh I though back in the day your PR did a different approach that tackled the problems more individually.↵Yeah this PR makes a lot of sense!↵Can choosenim jump my nim version to a specific branch? |
05:42:30 | FromDiscord | <Phil> It can! |
05:43:06 | FromDiscord | <Phil> I'll throw some feedback on if that solved the issue or not, shall I do it into the issue and the PR? |
05:43:47 | FromDiscord | <flywind> Either way is fine. Feel free to review my PR. |
05:46:09 | FromDiscord | <Phil> Feedback may take a bit, I don't think I ever had choosenim build a branch before ^^' |
05:46:54 | FromDiscord | <flywind> I would recommend to use koch to build a debug Nim compiler. |
05:47:32 | FromDiscord | <flywind> https://media.discordapp.net/attachments/371759389889003532/1004626620000260136/unknown.png |
05:48:46 | FromDiscord | <flywind> First checkout the code, then bootstrap a compiler https://nim-lang.github.io/Nim/intern.html#bootstrapping-the-compiler or https://nim-lang.github.io/Nim/intern.html#debugging-the-compiler |
05:49:15 | FromDiscord | <Phil> That might be the better approach, after running `choosenim #pr_warnings` it did not change much so chances are something in there did not work as I expected. |
05:56:25 | FromDiscord | <Phil> sent a long message, see http://ix.io/46Ct |
05:57:08 | FromDiscord | <flywind> You don't need to clone https://github.com/nim-lang/csources_v1 |
05:57:12 | FromDiscord | <Phil> (edit) "http://ix.io/46Ct" => "http://ix.io/46Cu" |
05:58:29 | FromDiscord | <flywind> 1) clone https://github.com/nim-lang/Nim↵2) switch to the the Nim project↵3) nim c koch.nim↵3) ./koch temp c -r yournimfile.nim # or ./koch boot |
05:58:57 | FromDiscord | <Phil> So the entire bootstrapping step is for those who want to play around with it? |
05:59:10 | FromDiscord | <flywind> (edit) "1) clone https://github.com/nim-lang/Nim↵2) switch to the the Nim project↵3) nim c koch.nim↵3) ./koch temp c -r yournimfile.nim # or ./koch boot" => "sent a long message, see http://ix.io/46Cv" |
05:59:48 | FromDiscord | <flywind> In reply to @Isofruit "So the entire bootstrapping": The entire bootstrapping step is necessary only when you haven't installed a Nim compiler. |
06:00:17 | FromDiscord | <flywind> For developing a compiler, this is unnecessary. |
06:01:49 | FromDiscord | <flywind> (edit) "a" => "the" |
06:23:02 | * | gsalazar quit (Ping timeout: 240 seconds) |
06:23:37 | * | rockcavera quit (Remote host closed the connection) |
06:44:34 | * | gsalazar joined #nim |
06:49:22 | FromDiscord | <Phil> In reply to @flywind "1) clone https://github.com/nim-lang/Nim 2)": So that command compiles 2 things, right? It compiles the compiler and then with the temporary compiler compiles my project? |
06:50:04 | FromDiscord | <Elegantbeef> Correct |
06:50:51 | FromDiscord | <Phil> Alrighty, so I can compile my project with that temp compiler, lets see what happens once I add the evil flagg |
06:51:00 | FromDiscord | <Elegantbeef> Yep |
06:55:39 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/DBq |
06:55:54 | FromDiscord | <Phil> the path in the end is correct, without the hintAsError flag the above command executes |
06:56:18 | FromDiscord | <Elegantbeef> does something in there make your shell sad? |
06:57:24 | FromDiscord | <Phil> Ugh, yeah that was it, shell didn't like the long flag for some reason, maybe because of brackets or colon. It starts compiling when used with quotation marks |
06:57:38 | FromDiscord | <flywind> How about `./koch temp c -d:ssl --hintAsError:XDeclaredButNotUsed] ../nimstoryfont/src/nimstoryfont.nim` |
06:57:43 | FromDiscord | <flywind> (edit) "--hintAsError:XDeclaredButNotUsed]" => "--hintAsError:XDeclaredButNotUsed" |
07:01:05 | FromDiscord | <Phil> That also works! |
07:01:40 | FromDiscord | <DaiChimpo> I joked about bubble sort but instead I wrote my own cmp, this language really kicks ass and I hope to get better at it |
07:01:52 | FromDiscord | <!&luke> In reply to @Isofruit "I will admit this": It's the sqare brackets |
07:02:01 | FromDiscord | <!&luke> You can quote that arg |
07:04:23 | FromDiscord | <Phil> In reply to @ripluke "It's the sqare brackets": Aye, went that route in the end |
07:13:18 | FromDiscord | <Phil> It works, yay! |
07:34:14 | FromDiscord | <proton> Is there any search engine in Nim? |
07:38:03 | FromDiscord | <Elegantbeef> https://github.com/search?q=search+engine+language%3Anim perhaps |
07:40:26 | * | om3ga quit (Quit: Bye) |
07:41:07 | * | oz joined #nim |
07:41:35 | * | oz is now known as Guest8615 |
07:41:46 | arkanoid | why nim failed to catch the science train? https://www.nature.com/articles/d41586-020-03382-2 |
07:42:05 | arkanoid | it's on hackernews, beside being 2020 |
07:49:16 | FromDiscord | <Phil> sent a long message, see http://ix.io/46CU |
07:50:55 | FromDiscord | <Phil> sent a long message, see http://ix.io/46CV |
07:51:38 | FromDiscord | <enthus1ast> BUT they can copy and paste R code |
07:51:53 | FromDiscord | <enthus1ast> and ask the it guy (me) why stuff is not working |
07:52:11 | FromDiscord | <enthus1ast> then i get cancer while understanding stupid R code |
08:11:56 | FromDiscord | <haxscramper> https://github.com/nim-works/nimskull/pull/214 was a wip implementation that improved the genDepends, which is already available in the regular compiler. It is pretty anemic wrt. to the graph generated, but you can expand from that PR - generate json instead etc. if you want a proper graph exploration↵(@LNSD) |
08:20:06 | arkanoid | Phil: as a person living next to scientists I may agree with you, but what we are talking here is traction |
08:20:38 | arkanoid | enthis1ast: what do you mean by "pasting R code?" |
08:21:13 | * | Jjp137 quit (Ping timeout: 244 seconds) |
08:22:08 | arkanoid | I mean *enthus1ast |
08:22:25 | * | Jjp137 joined #nim |
08:24:26 | FromDiscord | <Phil> In reply to @arkanoid "enthis1ast: what do you": A lot of stats is done in R, I assume he's often confronted with folks copy pasting code of the language R from stackoverflow |
08:27:28 | FromDiscord | <Phil> I found bioinformatics to be taken by ~4-6 languages:↵The vast majority is python and R and last time I was in the field, python started eating into R's share.↵You have some java here and there as well as legacy perl.↵And for those that actually have an understanding on how to code and are deeper into the informatics side of things, you actually have folks writing C++/C |
08:28:06 | FromDiscord | <Phil> (edit) "C++/C" => "C++/C, though only when absolutely necessary for performance due to gargantuan datasets." |
08:30:45 | FromDiscord | <enthus1ast> because noone (i know) is realy fluent in R |
08:30:50 | FromDiscord | <enthus1ast> but all use it |
08:31:47 | FromDiscord | <enthus1ast> i was sitting next to one of our scientists that do a lot of analysis with R and asked them basic syntax/semantic questions (because R is full of strange stuff) and they could not answer, i had to google all of this myself |
08:32:00 | FromDiscord | <enthus1ast> i mean |
08:32:02 | FromDiscord | <enthus1ast> foo.baa |
08:32:10 | FromDiscord | <enthus1ast> ^ this alone |
08:32:14 | FromDiscord | <Phil> This would barely be better if it were another language |
08:32:20 | FromDiscord | <Phil> "scientific programming" |
08:32:34 | FromDiscord | <enthus1ast> foo.baa is just a variable name (sic yes) |
08:32:56 | FromDiscord | <Phil> R allows variable names with dots? TIL |
08:33:02 | FromDiscord | <enthus1ast> yes \:) |
08:33:12 | FromDiscord | <enthus1ast> not only allowes but is all over the place |
08:38:04 | FromDiscord | <proton> https://github.com/c-blake/nimsearch looks promising |
08:41:07 | FromDiscord | <proton> sent a code paste, see https://play.nim-lang.org/#ix=46D7 |
08:41:44 | FromDiscord | <proton> Where should I put nimbase.h to have it compile? |
09:24:14 | FromDiscord | <demotomohiro> `nimbase.h` should be in lib directory in your nim directory. |
09:25:26 | FromDiscord | <demotomohiro> And when Nim compile generated c code, it automatically add lib directory as include path |
09:27:24 | FromDiscord | <proton> It seems failed to do so. |
09:30:36 | FromDiscord | <demotomohiro> That means you dont have `nimbase.h` in <nim installed dir>/lib? |
09:38:53 | * | wallabra quit (Ping timeout: 268 seconds) |
09:40:02 | FromDiscord | <proton> I do have, nimsearch/start.sh failed to do it right. |
09:40:23 | FromDiscord | <proton> (edit) "nimsearch/start.sh" => "nimsearch/build.sh" |
09:43:24 | * | kenran joined #nim |
09:48:33 | FromDiscord | <EyeCon> In reply to @Isofruit "R allows variable names": ... and uses $ for namespacing |
09:48:57 | FromDiscord | <demotomohiro> nimsearh/nim-pgo have line: `: ${ccI="-I/usr/lib/nim/lib"}`.↵So it seems nim/lib should be in /usr/lib. |
09:58:00 | * | jmdaemon quit (Ping timeout: 268 seconds) |
10:04:20 | FromDiscord | <proton> thanks, it helps a lot! |
11:18:08 | FromDiscord | <lantos> sent a code paste, see https://play.nim-lang.org/#ix=46DJ |
11:52:19 | FromDiscord | <gaopow> sent a long message, see http://ix.io/46DV |
11:56:56 | FromDiscord | <Rika> SAS? |
12:43:33 | FromDiscord | <4zv4l> I don't find the name of the Coc extension for nim in vim↵anyone can help me ? |
13:01:11 | FromDiscord | <EyeCon> Yes, the R ecosystem is everything but consistent or intuitive - they have the probably most correct statistics implementations because there are so many users |
13:01:23 | FromDiscord | <EyeCon> I wish R the language were a bit better |
13:01:26 | FromDiscord | <gibson> @4zv4l https://github.com/PMunch/nimlsp |
13:02:23 | NimEventer | New thread by HJarausch: WithColor template in "THE BOOK" , see https://forum.nim-lang.org/t/9347 |
13:14:50 | FromDiscord | <4zv4l> In reply to @gibson "<@329196212282458112> https://github.com/PMunch/nim": there isn't the coc plugin in there, I don't use that lsp vim plugin↵and I found one last time but I don't find it anymore |
13:17:34 | FromDiscord | <gibson> @4zv4l I don't use it. Maybe this helps? https://forum.nim-lang.org/t/7713 |
13:21:47 | * | CyberTailor joined #nim |
13:37:52 | FromDiscord | <huantian> In reply to @Rika "SAS?": Another tool often used for stats and data analytics |
14:17:26 | * | gsalazar quit (Ping timeout: 240 seconds) |
14:22:08 | * | gsalazar joined #nim |
14:24:46 | * | gsalazar quit (Remote host closed the connection) |
14:25:04 | * | gsalazar joined #nim |
14:30:22 | FromDiscord | <flywind> How can I skip the range type and get the internal type? |
14:30:41 | FromDiscord | <flywind> For example |
14:30:55 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=46EP |
14:31:23 | FromDiscord | <flywind> How can get the Ct[uint32] tyoe? |
14:31:29 | FromDiscord | <flywind> (edit) "tyoe?" => "type?" |
14:33:05 | * | LuxuryMode joined #nim |
14:37:16 | * | gsalazar quit (Remote host closed the connection) |
14:37:42 | * | kenran quit (Quit: WeeChat info:version) |
14:46:22 | FromDiscord | <Rika> doesnt `x.typeof.T` work |
14:47:04 | FromDiscord | <Rika> yup it does |
14:47:15 | FromDiscord | <Rika> @flywind if you're still here `x.typeof.T` |
14:47:57 | FromDiscord | <pruno> sent a code paste, see https://play.nim-lang.org/#ix=46ER |
14:49:44 | FromDiscord | <flywind> In reply to @Rika "<@658563905425244160> if you're still": thank you! What if the type descriptor cannot be known ahead of time. |
14:49:50 | FromDiscord | <flywind> (edit) "In reply to @Rika "<@658563905425244160> if you're still": thank you! What if the ... type" added "generic" |
14:51:06 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=46ES |
14:52:11 | FromDiscord | <Rika> `import std/typetraits; x.typeof.genericParams.get(0 #[index of type]#)` |
14:52:29 | FromDiscord | <Rika> if you use x: distinct i believe the type info is lost |
14:52:47 | FromDiscord | <Rika> not sure how that even works really |
14:52:54 | FromDiscord | <Rika> idk what that x: distinct means |
14:53:57 | FromDiscord | <flywind> It seem to work, thanks! |
14:55:51 | FromDiscord | <flywind> No all cases, I probably still need to go for skipRanges hack in the compiler. |
14:56:23 | FromDiscord | <flywind> (edit) "No" => "Not" |
14:56:32 | FromDiscord | <flywind> (edit) "hack" => "hacks" |
15:00:38 | * | mahlon quit (Ping timeout: 268 seconds) |
15:07:39 | FromDiscord | <Raws> sent a code paste, see https://play.nim-lang.org/#ix=46F7 |
15:09:17 | FromDiscord | <flywind> What's the error message after installing the compiler? |
15:09:27 | FromDiscord | <Raws> Same error message |
15:09:56 | FromDiscord | <Raws> https://media.discordapp.net/attachments/371759389889003532/1004768151977869332/unknown.png |
15:12:17 | FromDiscord | <flywind> `nimble build` seems to require you put `requires "compiler"` on your nimble file irrc, |
15:12:42 | * | wallabra joined #nim |
15:14:36 | FromDiscord | <Raws> Ooh!! Thank you, that was the missing piece. I figured since it required `nim` it implicitly required `compiler` but that was a stupid assumption |
15:14:56 | FromDiscord | <flywind> You are welcome |
15:27:03 | NimEventer | New thread by Drkameleon: If-else VS case-else VS case, see https://forum.nim-lang.org/t/9348 |
15:27:58 | * | mahlon joined #nim |
16:05:07 | * | rockcavera joined #nim |
16:05:07 | * | rockcavera quit (Changing host) |
16:05:07 | * | rockcavera joined #nim |
16:26:31 | FromDiscord | <Bubblie> when should I use newSeq compared to just seq? |
16:26:42 | FromDiscord | <Bubblie> im still a tad bit confused between the different usages between them |
16:26:50 | FromDiscord | <Rika> what does that mean? seq is a type, newseq is a proc |
16:26:52 | FromDiscord | <Bubblie> sorry 😅 |
16:27:03 | FromDiscord | <Rika> im not sure what the confusion is from |
16:27:16 | FromDiscord | <Bubblie> is that the only difference really? |
16:28:23 | FromDiscord | <Rika> in most common cases yeah kinda |
16:28:37 | FromDiscord | <Rika> can you give examples where you'd be unsure which to use |
16:29:04 | FromDiscord | <Bubblie> hmmm |
16:29:17 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix= |
16:29:29 | FromDiscord | <Bubblie> is what I have |
16:29:36 | FromDiscord | <Bubblie> but should I use seq here instead? |
16:29:48 | FromDiscord | <Bubblie> because from what I know you cant define a length with seq |
16:29:50 | FromDiscord | <Bubblie> right? |
16:30:24 | FromDiscord | <Rika> what is layercount |
16:30:47 | FromDiscord | <Rika> like its a number right sorry lmao im not reading |
16:30:58 | FromDiscord | <Bubblie> yeah I should have specified that 😭 sorry |
16:30:59 | FromDiscord | <Rika> `seq[Type](number)` is not valid code |
16:31:06 | FromDiscord | <Bubblie> its a cuint |
16:31:08 | FromDiscord | <Rika> !eval echo seq[int](12) |
16:31:11 | NimBot | Compile failed: /usercode/in.nim(1, 14) Error: type mismatch: got 'int literal(12)' for '12' but expected 'seq[int]' |
16:31:21 | FromDiscord | <Rika> !eval echo newSeq[int](12) |
16:31:25 | NimBot | @[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] |
16:31:31 | FromDiscord | <Bubblie> ohhhhh |
16:31:37 | FromDiscord | <Bubblie> I see now! |
16:31:38 | FromDiscord | <Rika> seq[type](thing) is for conversion |
16:31:53 | FromDiscord | <Rika> though its rare to use it |
16:32:01 | FromDiscord | <Rika> since you usually use `@` for arrays |
16:32:08 | FromDiscord | <Bubblie> ah okay! |
16:32:10 | FromDiscord | <Bubblie> thank you so much |
16:32:24 | FromDiscord | <Rika> thats infact the @ in the @[0,0,0,0...] above, its just a proc for array -> seq |
16:33:33 | FromDiscord | <Bubblie> thank you rika :) |
16:35:00 | FromDiscord | <Rika> if you see `type()`, its usually a conversion↵like for example `uint(12)` (i cant actually think of more examples, its kinda not used often without custom types) |
16:35:09 | FromDiscord | <Rika> or maybe im just not thinking well today |
16:35:15 | FromDiscord | <Rika> likely the latter xd |
16:54:20 | FromDiscord | <Bubblie> Okay! |
16:54:40 | FromDiscord | <Bubblie> Is there any nim bindings for bullet (the physics library) |
16:54:46 | FromDiscord | <Bubblie> Btw |
16:56:33 | FromDiscord | <Rika> i do not know, you can ask in #gamedev if its a game dev thing |
16:58:24 | * | arkurious joined #nim |
17:04:12 | * | rockcavera quit (Read error: Connection reset by peer) |
17:04:31 | * | rockcavera joined #nim |
17:04:32 | * | rockcavera quit (Changing host) |
17:04:32 | * | rockcavera joined #nim |
17:10:18 | * | vicecea quit (Remote host closed the connection) |
17:10:47 | * | vicecea joined #nim |
17:21:42 | * | rockcavera quit (Read error: Connection reset by peer) |
17:23:47 | * | rockcavera joined #nim |
17:23:47 | * | rockcavera quit (Changing host) |
17:23:47 | * | rockcavera joined #nim |
17:40:21 | FromDiscord | <jmgomez> is auto not inferring the right type on a function as a parameter and compiling a known issue? |
17:42:20 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=46FJ |
17:49:42 | * | rockcavera quit (Read error: Connection reset by peer) |
17:50:06 | FromDiscord | <voidwalker> what's wrong with this code, I want to manually get HTTP response (cause I can't get it until it's finished loading with httpclient): |
17:50:15 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=46FK |
17:50:21 | * | rockcavera joined #nim |
17:50:21 | * | rockcavera quit (Changing host) |
17:50:21 | * | rockcavera joined #nim |
17:51:50 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=46FL |
17:51:57 | FromDiscord | <voidwalker> I really hate it that the docs lack basic examples for most stuff |
17:53:33 | FromDiscord | <Phil> Sth sth be the change you want to see sth sth |
17:56:16 | FromDiscord | <voidwalker> How exactly do you submit edits to the docs? |
17:56:34 | FromDiscord | <voidwalker> Would be nice if the docs were a wiki |
18:00:41 | FromDiscord | <flywind> In reply to @voidwalker "How exactly do you": there are edit buttons on the docs. |
18:02:06 | FromDiscord | <flywind> https://media.discordapp.net/attachments/371759389889003532/1004811480035770418/Screenshot_2022-08-05-02-01-56-84_40deb401b9ffe8e1df2f1cc5ba480b12.jpg |
18:02:30 | FromDiscord | <flywind> Remember to edit the devel branch though. |
18:03:07 | FromDiscord | <flywind> https://nim-lang.github.io/Nim/os.html |
18:04:09 | FromDiscord | <flywind> Docs changes tend to be merged quicker if good enough. |
18:06:02 | * | CyberTailor quit (Remote host closed the connection) |
18:06:17 | FromDiscord | <flywind> Consise and simple runnableEx amples are mostly welcome. |
18:06:55 | * | CyberTailor joined #nim |
18:08:50 | FromDiscord | <jmgomez> In reply to @jmgomez "it seems to only": @flywind do you know if what I just posted is a known issue with auto or should I open one? |
18:11:31 | FromDiscord | <flywind> Hi, I'm not familiar with auto, so I don't know. Feel free to open an issue, someone else probably has more knowledge about it. |
18:14:41 | FromDiscord | <pruno> sent a code paste, see https://play.nim-lang.org/#ix=46FQ |
18:15:20 | FromDiscord | <enthus1ast> you can cast it to the type it is and just echo it |
18:15:51 | FromDiscord | <pruno> Oh |
18:16:04 | FromDiscord | <Tuatarian> how can I index an array with bools if I don't know it at compile time? |
18:16:32 | FromDiscord | <Tuatarian> I know it's length 2, but that's it |
18:16:50 | FromDiscord | <Phil> As in, you want to use a bool as an index on an array of size 2 that already exists? |
18:16:53 | FromDiscord | <pruno> In reply to @enthus1ast "you can cast it": Works indeed lol, thanks |
18:17:25 | FromDiscord | <Tuatarian> without having to write a[int b] each time |
18:17:49 | FromDiscord | <Phil> Ah, so you don't want to convert the bool to int? |
18:17:54 | FromDiscord | <Phil> Err |
18:18:12 | FromDiscord | <Phil> Write a custom seq type and define a `[]` proc of your own? |
18:18:17 | FromDiscord | <Phil> Alternatively hashmap ? |
18:18:19 | FromDiscord | <Tuatarian> it's possible if you can write the array, eg `let z = [false : 1, true : 2]` or something |
18:18:23 | FromDiscord | <Tuatarian> hashmap super slow |
18:18:57 | FromDiscord | <Tuatarian> I have an array[2, array[169, int]] which obviously |
18:19:03 | FromDiscord | <Phil> You could define a type `boolArray` and define `[]` procs for it that still do the bool conversion but do it for you |
18:19:22 | FromDiscord | <Tuatarian> I guess... |
18:19:28 | FromDiscord | <mr_noia> you can do\: `let x: array[bool, int] = [2, 3]` |
18:19:46 | FromDiscord | <Tuatarian> that works? |
18:19:54 | FromDiscord | <Tuatarian> also, would I have to write out the array in that case? |
18:20:23 | FromDiscord | <Tuatarian> unless there's a newArrWith proc or similar, I can't really write out the array |
18:20:26 | FromDiscord | <Phil> `let y: array[bool, int] = [1,2]` compiles |
18:20:42 | FromDiscord | <Phil> And it does allow access with bools |
18:21:10 | FromDiscord | <Tuatarian> but then I have to write out the rhs right? |
18:21:18 | FromDiscord | <Phil> the what now? |
18:21:33 | FromDiscord | <Tuatarian> my type is `array[2, array[169, int]]` so I can't really write out the rhs |
18:21:35 | FromDiscord | <Tuatarian> right hand side |
18:21:37 | FromDiscord | <Tuatarian> of the assignment operator |
18:21:42 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=46FS |
18:21:59 | FromDiscord | <Phil> Ahhh check, didn't know the acronym |
18:21:59 | * | rockcavera quit (Remote host closed the connection) |
18:22:24 | FromDiscord | <Tuatarian> I've used `let z = [false : 1, true : 2]` before so I'm fine if I can write the contents of the array when the variable is declared |
18:22:53 | FromDiscord | <Elegantbeef> You can make an `arrayWith[bool](val)` |
18:23:29 | FromDiscord | <Phil> play nim lang is down |
18:23:33 | FromDiscord | <Phil> Sad noises |
18:24:14 | FromDiscord | <Tuatarian> `let z : array[2, array[169, int]] = arrayWith[bool](arrayWith(0))`? |
18:24:27 | FromDiscord | <Tuatarian> play is down, I became so reliant on it for stuff like this |
18:24:36 | FromDiscord | <Tuatarian> since I don't really want to make a new file for greyboxing |
18:24:49 | FromDiscord | <Elegantbeef> Yea you could make those procedures |
18:24:50 | FromDiscord | <Tuatarian> especially since I don't even have error highlighting on emacs |
18:25:10 | FromDiscord | <Elegantbeef> though it's really just `default(array[bool, array[169, int]])` |
18:26:45 | FromDiscord | <voidwalker> The edit buttons on the doc gets me to the github of that .nim file. I can't find "os" in the doc folder, after forking the nim repo |
18:27:42 | FromDiscord | <Tuatarian> oh I see, you can use bool as a length |
18:27:46 | FromDiscord | <Tuatarian> that's why that makes sense |
18:27:59 | FromDiscord | <voidwalker> anyway, anything else than wiki is too complicated to bother with |
18:28:00 | FromDiscord | <Elegantbeef> any ordinal can be |
18:28:06 | FromDiscord | <Tuatarian> does it compute sizeof or similar |
18:28:22 | FromDiscord | <Elegantbeef> It's a bool indexed array |
18:28:35 | FromDiscord | <Elegantbeef> It calculates the range of the ordinal and makes an array that size |
18:29:11 | FromDiscord | <voidwalker> https://discord.com/channels/371759389889003530/371759389889003532/1004808464859680798 can someone look at this please? |
18:37:55 | FromDiscord | <Elegantbeef> Void you should os inside `lib/pure/os` |
18:42:43 | FromDiscord | <voidwalker> I meant the docs for the os |
18:43:24 | FromDiscord | <voidwalker> It's not obvious how you could contribute to the docs. A wiki style platform would incentivise more people to add content |
18:43:34 | FromDiscord | <Elegantbeef> The docs are in the code |
18:43:37 | FromDiscord | <Elegantbeef> `##` are doc comments |
18:44:57 | FromDiscord | <voidwalker> hmm was that a good idea? |
18:45:08 | FromDiscord | <voidwalker> cause now you can't go crazy with the examples and verbosity |
18:45:10 | FromDiscord | <Elegantbeef> I'd argue yes |
18:48:58 | FromDiscord | <Zectbumo> I want restarting frames in nim↵https://developer.chrome.com/blog/new-in-devtools-104/?utm_source=devtools#restart-frame |
18:48:59 | FromDiscord | <Elegantbeef> I dont see why you cannot go crazy with examples |
18:52:37 | FromDiscord | <Elegantbeef> Use a macro to copy what vale does https://verdagon.dev/blog/perfect-replayability-prototyped |
18:54:09 | FromDiscord | <Zectbumo> interesting |
18:58:01 | FromDiscord | <Phil> I'm wondering whether you could define a type in python and pass it to nim for doing stuff. I'm not sure that's possible |
18:58:23 | FromDiscord | <Elegantbeef> Isnt that what nimpy allows? |
18:58:35 | FromDiscord | <Phil> Nimpy allows you to define a type in nim and use it in python |
18:58:45 | FromDiscord | <Phil> I was wondering whether the reverse is possible and I can't think of a way |
18:58:57 | FromDiscord | <Phil> Since nim must know for a proc definition what type it accepts at compile time |
18:59:11 | FromDiscord | <Phil> Unless you can just generally interpret the python object as a Hashmap I guess |
18:59:12 | FromDiscord | <Elegantbeef> I dont see why it's not possible since python types would just be a table of object variants |
19:01:31 | * | rockcavera joined #nim |
19:01:31 | * | rockcavera quit (Changing host) |
19:01:31 | * | rockcavera joined #nim |
19:02:07 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=46G2 |
19:02:22 | FromDiscord | <Elegantbeef> Does nimpy not expose a way to access the raw python type? |
19:02:50 | FromDiscord | <Phil> It might but I'm not seeing one at a glance in the github documentation |
19:02:59 | FromDiscord | <Phil> And I#ve read that thing 3 times by now |
19:03:23 | FromDiscord | <Phil> It shows off how to import python modules and use its functions |
19:03:42 | FromDiscord | <Phil> But I'm not seeing a "import python type as X" section |
19:03:45 | FromDiscord | <Phil> (edit) "type" => "class" |
19:09:44 | * | kenran joined #nim |
19:12:21 | * | kenran quit (Client Quit) |
19:16:53 | FromDiscord | <phillvancejr> is there a way to get the path to the current executable? |
19:18:17 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/os.html#getAppDir |
19:26:35 | FromDiscord | <4zv4l> how can I add a timeout to a `socket.connect()` to check if the port is filtered ? |
19:37:38 | * | krux02 joined #nim |
19:42:12 | NimEventer | New thread by Rayman22201: Nim spotted in the wild on new Hacker News code education startup, see https://forum.nim-lang.org/t/9349 |
19:44:41 | FromDiscord | <pouriya.jamshidi> sent a code paste, see https://play.nim-lang.org/#ix=46G5 |
19:45:07 | FromDiscord | <Elegantbeef> `&=` or `.add` |
19:48:42 | * | jmdaemon joined #nim |
19:53:27 | FromDiscord | <Phil> Using `&` at the start to allow for usage of "{}" in strings to render variables into a string works? |
19:53:43 | FromDiscord | <Elegantbeef> If you `import std/strformat` |
19:54:06 | FromDiscord | <Phil> It's an even shorter version of `fmt`? |
19:54:15 | FromDiscord | <Elegantbeef> It has different semantics |
19:55:11 | FromDiscord | <Elegantbeef> `fmt` is a raw string literal so `\t` doesnt echo a tab it echoes `\t` |
19:55:49 | FromDiscord | <Elegantbeef> `&` properly handles those characters |
19:59:12 | * | mahlon quit (Ping timeout: 245 seconds) |
19:59:17 | FromDiscord | <pouriya.jamshidi> In reply to @Isofruit "Using `&` at the": not if it is a multiline string. Otherwise, it is ok |
19:59:46 | FromDiscord | <Phil> In reply to @pouriya.jamshidi "not if it is": Just checked, this does work! It just doesn't handle `\n` and `\t` properly, which is annoying |
20:00:00 | FromDiscord | <pouriya.jamshidi> In reply to @Elegantbeef "`&=` or `.add`": I couldn't figure out the `&=` but the `.add` worked. thanks |
20:00:16 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=46Gc |
20:00:36 | FromDiscord | <Elegantbeef> use tabs instead phil |
20:01:01 | FromDiscord | <pouriya.jamshidi> In reply to @Isofruit "Like, this seemed to": yea, that was my main question here. In multiline strings, the `&` does not work :S |
20:01:36 | FromDiscord | <Phil> In reply to @pouriya.jamshidi "yea, that was my": "Not work" in the sense that it doesn't handle \n and \t, right?↵Or am I missing another way in which it is failing? |
20:02:04 | FromDiscord | <Phil> Maybe I should mention that I do have an import of std/strformat above that piece of code |
20:03:46 | FromDiscord | <pouriya.jamshidi> In reply to @Isofruit ""Not work" in the": correct. it escapes those special characters |
20:04:21 | FromDiscord | <Phil> In that case I got nothing |
20:04:49 | FromDiscord | <pouriya.jamshidi> I used the `.add()` proc as a workaround |
20:05:25 | FromDiscord | <pouriya.jamshidi> sent a code paste, see https://play.nim-lang.org/#ix=46Gf |
20:07:19 | FromDiscord | <EyeCon> Just insert a real tab character |
20:08:18 | FromDiscord | <EyeCon> Or declare these strings as constants |
20:12:16 | * | Guest64 joined #nim |
20:13:00 | FromDiscord | <gibson> What are the downsides to using templates instead of procs? My current list:↵ UFCS issues sometimes due to parsing restrictions.↵ Code bloat due to the replacement/inlining behavior of templates.↵ Cannot take a pointer to a template. |
20:15:58 | FromDiscord | <pouriya.jamshidi> In reply to @EyeCon "Or declare these strings": could you give me an example? |
20:18:40 | * | Guest64 quit (Ping timeout: 252 seconds) |
20:24:19 | FromDiscord | <EyeCon> sent a code paste, see https://play.nim-lang.org/#ix=46Gk |
20:24:47 | FromDiscord | <EyeCon> Or declare a function that prints all these, or if you are into OOP, make all of this its own object and then give the object an output function |
20:29:07 | * | jmd_ joined #nim |
20:29:59 | * | jmdaemon quit (Ping timeout: 252 seconds) |
20:42:50 | * | LuxuryMode quit (Quit: Connection closed for inactivity) |
20:55:42 | FromDiscord | <pouriya.jamshidi> In reply to @EyeCon "Or declare a function": thank you! |
20:56:36 | * | mahlon joined #nim |
21:41:26 | FromDiscord | <gibson> In reply to @gibson "What are the downsides": A neat upside to templates is that they enable Pythonesque monkeypatching, which I didn't think was possible in Nim. |
21:41:34 | * | rockcavera quit (Remote host closed the connection) |
21:42:25 | FromDiscord | <huantian> the ideal way of doing that is traits/concepts tho imo |
21:43:50 | * | CyberTailor quit (Remote host closed the connection) |
21:43:59 | FromDiscord | <huantian> which is similar to what statically typed python does with duck typing |
21:44:56 | * | CyberTailor joined #nim |
21:46:17 | FromDiscord | <gibson> sent a code paste, see https://play.nim-lang.org/#ix=46GN |
21:46:30 | FromDiscord | <gibson> I'm very interested in solving this better. |
21:47:10 | FromDiscord | <gibson> (edit) "https://play.nim-lang.org/#ix=46GN" => "https://play.nim-lang.org/#ix=46GO" |
21:49:33 | FromDiscord | <Elegantbeef> These are free standing functions you cant really use concepts here |
21:51:20 | FromDiscord | <gibson> Ah okay, that's what I suspected. Still, being able to do this with templates is quite nice. |
21:52:10 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46GR |
21:52:42 | FromDiscord | <Elegantbeef> Whoops that last one should be `typedesc[Invalid]` |
21:53:32 | FromDiscord | <Elegantbeef> Probably best to do `login(t: typedesc[Loginable], s: string)` so you can do `Admin.login(testuser)` |
21:54:52 | FromDiscord | <Elegantbeef> No clue why you'd do it your way, but this is just food for thought |
21:59:47 | FromDiscord | <gibson> The way I have it is essentially what you posted, but I'm not using concepts. The template `login` specifies `getToken` as a mixin, which allows `getToken` to be defined at the callsite, similar to what you have. I guess the benefit of what I have is that it's less code, easier to read, and requires scopes, which promote clearly separable testing conditions. Does that seem right? |
22:00:45 | FromDiscord | <Elegantbeef> It's harder to read if you ask me since the `getToken` that is chosen is based off scope you're in |
22:00:53 | FromDiscord | <Elegantbeef> So you have a very obscure dispatch to me |
22:01:16 | FromDiscord | <Elegantbeef> Also for templates you shouldnt need to mixin |
22:01:37 | FromDiscord | <Elegantbeef> You might depending on the way you call the procedure though i guess |
22:01:54 | FromDiscord | <Elegantbeef> It also means you can only use one login procedure per scope |
22:01:59 | FromDiscord | <gibson> No you're right! That's great. |
22:02:20 | FromDiscord | <Elegantbeef> But it's very much "Write the code how you want it" |
22:02:34 | FromDiscord | <gibson> Well, it's very "monkeypatching" culture to define everything a test needs together in one place. Whether or not that practice is good is debatable. "how you want it" haha yes, very true. |
22:03:02 | FromDiscord | <Elegantbeef> If you really really were lazy you could make a template for declaring login tokens |
22:04:36 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46GT |
22:05:59 | FromDiscord | <Elegantbeef> Also one thing i'd comment on is that the "implicit" `getToken` call is more prone to security issues |
22:06:32 | FromDiscord | <gibson> Instead of fully qualifying `tokens.getToken`? |
22:06:44 | FromDiscord | <Elegantbeef> No |
22:07:09 | FromDiscord | <Elegantbeef> You call which ever `getToken` is closer to the callsite afaict, which means that as you get deeper in code it may be confusing which is used |
22:07:34 | FromDiscord | <Elegantbeef> So you may accidentally give admin access |
22:08:11 | FromDiscord | <gibson> Oh, because `mixin`. True... good point. |
22:08:58 | FromDiscord | <gibson> I'd want to wrap it in a `when defined(testing)` so the binding isn't always open like that. |
22:09:27 | FromDiscord | <Elegantbeef> The method i've given also has the same issue but it's slightly less confusing as you'd declare a `proc getToken(_: typedesc[MyType])` closer |
22:09:37 | FromDiscord | <Elegantbeef> But anywho there you go that's the concept method i'd use |
22:09:58 | FromDiscord | <gibson> 👍 cool! Thank you for the enlightening discussion. |
22:21:05 | FromDiscord | <gibson> 😦 `mixin` does not respect `when` branching. Weird. |
22:35:11 | FromDiscord | <Rainbow Asteroids> for a constant lookup table for string -> string, should I use `std/strtabs.StringTable` or `std/tables.Table`, because it appears that `StringTable` cannot be const while `Table` can. |
22:42:48 | NimEventer | New thread by Ggibson: `mixin` ignores `when` branching, see https://forum.nim-lang.org/t/9350 |
22:44:08 | FromDiscord | <Elegantbeef> Probably the one you can use as a const↵(@Rainbow Asteroids) |
22:51:29 | FromDiscord | <mim> im having trouble getting nim istalled |
22:51:41 | FromDiscord | <mim> i used the choosenim bat file |
22:51:53 | FromDiscord | <mim> and i verified the bin folder was added to my path |
22:52:03 | FromDiscord | <mim> and i checked the folder to see if nim was in there |
22:52:14 | FromDiscord | <mim> but i still cant use nim from command prompt |
22:52:32 | FromDiscord | <mim> sent a code paste, see https://play.nim-lang.org/#ix=46GZ |
22:53:42 | FromDiscord | <mim> https://media.discordapp.net/attachments/371759389889003532/1004884864698425424/unknown.png |
22:53:47 | FromDiscord | <mim> as you can see it does exist |
22:53:57 | FromDiscord | <mim> i tried restarting my terminal as well |
22:54:15 | FromDiscord | <mim> it works from powershell |
22:54:18 | FromDiscord | <mim> but not cmd |
22:54:45 | FromDiscord | <mim> (edit) "my terminal" => "cmd" |
22:58:55 | FromDiscord | <Prestige> Do you need to log out for it to take effect? Idk Windows |
22:59:09 | FromDiscord | <mim> no but ive never needed to before |
22:59:12 | FromDiscord | <mim> ill give it a try i guess |
23:01:03 | FromDiscord | <mim> works now- |
23:01:06 | FromDiscord | <mim> thats so weird |
23:01:13 | FromDiscord | <mim> i never had to log out for node or anything |
23:01:21 | FromDiscord | <mim> or when installed java a few days ago |
23:01:32 | FromDiscord | <mim> (edit) "java" => "the jdk" |
23:02:52 | FromDiscord | <sOkam!> sent a long message, see http://ix.io/46H1 |
23:24:46 | FromDiscord | <michaelb.eth> sent a long message, see http://ix.io/46H7 |
23:35:33 | FromDiscord | <!Patitotective> In reply to @sOkam! "I have a cpp": https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importcpp-pragma |
23:37:57 | FromDiscord | <sOkam!> why does everything say that c2nim can parse cpp... but then the app doesn't even handle basic class definitions without errors? 😔 |
23:38:26 | FromDiscord | <sOkam!> Am I missing some cli modifier to handle cpp or something? |
23:38:59 | FromDiscord | <!Patitotective> In reply to @Patitotective "https://nim-lang.org/docs/manual.html#implementatio": doesn't this work? |
23:39:23 | FromDiscord | <sOkam!> i mean, that's for importing directly cpp code, right? |
23:39:42 | FromDiscord | <sOkam!> (edit) "i mean, that's for importing ... directlywithout" added "cpp code" | "cpp code," => "without translation," |
23:39:48 | FromDiscord | <!Patitotective> yes |
23:40:00 | FromDiscord | <!Patitotective> thats what you asked for |
23:40:01 | FromDiscord | <sOkam!> My attempts have all being about translation |
23:40:31 | FromDiscord | <sOkam!> Ah ye. Goal would be both. Interface at first, but eventually translate |
23:40:39 | FromDiscord | <!Patitotective> yes, you asked if there was a way to work with cpp code while you work on the translation (?) |
23:41:05 | FromDiscord | <Elegantbeef> `Option[Bar] isnot Option[Foo]` you need to convert to `Foo`↵(@michaelb.eth) |
23:41:21 | FromDiscord | <sOkam!> But I read in the readme, and then in the manual too, that c2nim can "parse" cpp... and parsing I understand as translating |
23:41:56 | FromDiscord | <!Patitotective> i dont know about c3nim https://media.discordapp.net/attachments/371759389889003532/1004897004998107196/unknown.png |
23:42:17 | FromDiscord | <!Patitotective> (edit) "c3nim" => "c2nim" |
23:42:50 | FromDiscord | <sOkam!> That's my point. It says that it can parse a large subset of cpp... yet... it fails when giving it a cpp file that has a basic class? 🤔 |