<< 04-08-2022 >>

00:01:56FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46Bm
00:02:02FromDiscord<!Patitotective> (edit) "https://play.nim-lang.org/#ix=46Bm" => "https://play.nim-lang.org/#ix=46Bn"
00:02:08FromDiscord<!Patitotective> why is padding 0
00:05:23FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46Bp
00:14:22FromDiscord<!Patitotective> ok beef, ive no idea↵you must forgive me↵ill work around it
00:18:47FromDiscord<Elegantbeef> Is it a bug with imported types and sequences perhaps
00:20:09FromDiscord<!Patitotective> im going to add a screenshot of your message to _Additional information_ in my nimgl issue
00:23:59FromDiscord<Elegantbeef> I mean it might not even be a nimgl bug
00:24:30FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46Bs
00:24:54FromDiscord<!Patitotective> In reply to @Elegantbeef "I mean it might": but i haven't been able to reproduce it without imgui :/
00:32:50FromDiscord<Elegantbeef> Did you import a type like they do?
00:33:00FromDiscord<Elegantbeef> Like remove the imgui dependency and attempt to reproduce it
00:51:10FromDiscord<AmjadHD> Hi, Where do I access the docs generated from my fork of Nim ?
00:52:12FromDiscord<!Patitotective> In reply to @AmjadHD "Hi, Where do I": you have to generate them
00:54:53FromDiscord<AmjadHD> In reply to @Patitotective "you have to generate": How ?
00:55:52FromDiscord<!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:27FromDiscord<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:40FromDiscord<!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:32FromDiscord<!Patitotective> In reply to @AmjadHD "So do I need": compile koch and `./koch doc`↵i think
01:04:17FromDiscord<!Patitotective> In reply to @Patitotective "(amazing edit)": could the x and y `importc`ed have some weird stuff?
01:05:26FromDiscord<Elegantbeef> Import your own type
01:05:35FromDiscord<Elegantbeef> Like i said to do 3 times
01:05:57FromDiscord<!Patitotective> you mean put `ImVec2` in another module and import it? or
01:06:09FromDiscord<Elegantbeef> No have C++ code you import just like they do
01:06:14FromDiscord<Elegantbeef> Cmon patito i believe in you
01:06:24FromDiscord<!Patitotective> nooo c++, pls
01:06:33FromDiscord<Elegantbeef> Use `{.emit.}` and `importCpp`
01:15:58FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46BB
01:16:18FromDiscord<!Patitotective> (edit) "https://play.nim-lang.org/#ix=46BB" => "https://play.nim-lang.org/#ix=46BC"
01:23:29FromDiscord<Elegantbeef> No clue what does the compiler say
01:25:14FromDiscord<!Patitotective> i mean, it works↵the assert fails
01:25:17FromDiscord<!Patitotective> padding is 10 10
01:26:41FromDiscord<!Patitotective> so imgui must be doing some weird stuff
01:28:31FromDiscord<Girvo> Sounds like imgui is doing some internal initialisation or something?
01:37:45FromDiscord<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:15FromDiscord<Elegantbeef> Does the imgui vector have a default constructor, could be related to that?
01:40:21FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46BH
01:40:23FromDiscord<!Patitotective> In reply to @Elegantbeef "Does the imgui vector": :p
01:40:49FromDiscord<!Patitotective> c++ defines constructors in the struct definition, right?
01:42:56FromDiscord<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:06FromDiscord<Elegantbeef> Yes
01:44:06FromDiscord<Elegantbeef> It's probably macro inside the def
01:44:24FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46BI
01:44:58FromDiscord<Elegantbeef> Yea the constructor is dubious
01:45:10FromDiscord<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:55FromDiscord<bumpy> sent a long message, see http://ix.io/46BJ
01:50:15FromDiscord<Elegantbeef> Antivirus is shit so it targets a common denominator is what i've been hearing
01:50:32FromDiscord<Elegantbeef> Report it as a false positive to your AV software and hope that it changes
01:50:32FromDiscord<bumpy> ah, lovely
01:50:52FromDiscord<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:00FromDiscord<bumpy> it's the built in antivirus for windows 😅
01:54:28FromDiscord<j-james> oh that's fantastic, yikes
01:55:18FromDiscord<Girvo> Sophos also marks it. It's idotic
01:55:21FromDiscord<Girvo> (edit) "idotic" => "idiotic"
01:58:31FromDiscord<Elegantbeef> Report as false positive and hope eventually it'll either get marked as "super virus" or no longer considered a virus
02:00:38FromDiscord<!Patitotective> ~~microsoft hardcoding a token in their apps so windows doesnt mark them as virus~~
02:24:14FromDiscord<Hi02Hi> sent a code paste, see https://play.nim-lang.org/#ix=46BM
02:26:15FromDiscord<Elegantbeef> Oh did my response not go through
02:26:33FromDiscord<Elegantbeef> > Generally you use what you need, if you dont need OOP mechanisms a pure inheritable is better↵Is what i said
02:26:44FromDiscord<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:02FromDiscord<Professor Actual Factual> E.g. what scenarios would warrant you prefering it over the other?
02:27:06FromDiscord<Elegantbeef> Why would you ever want to use a `ref` is the real question
02:27:22FromDiscord<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:39FromDiscord<Elegantbeef> References should only be used in the case you want reference semantics
02:27:44FromDiscord<Girvo> ^ what he said
02:28:01FromDiscord<Girvo> We still have some `ref object` types in there, but they're explicit and used sparingly
02:28:05FromDiscord<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:06FromDiscord<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:32FromDiscord<Professor Actual Factual> In reply to @Elegantbeef "reference objects are not": That Im aware, in embedded stuff this is key
02:28:40FromDiscord<Elegantbeef> Well then you use ref objects
02:28:41FromDiscord<Hi02Hi> That sounds like a difference in usecases
02:28:49FromDiscord<Elegantbeef> I hardly ever use reference objects as they're a bitch to everything
02:30:03FromDiscord<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:08FromDiscord<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:39FromDiscord<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:38FromDiscord<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:16FromDiscord<Elegantbeef> Cause i dont need to have multiple views to objects↵(@Professor Actual Factual)
02:32:17FromDiscord<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:19FromDiscord<Elegantbeef> It complicates the scope of the program
02:32:29FromDiscord<Professor Actual Factual> In reply to @Elegantbeef "It complicates the scope": Thats a very good point
02:32:56FromDiscord<Elegantbeef> References are pointers, if you cannot validate using a pointer then why use a reference?
02:34:10FromDiscord<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:32FromDiscord<Elegantbeef> What benefit does it afford you?
02:34:48FromDiscord<Professor Actual Factual> In reply to @Elegantbeef "What benefit does it": Stack issues by exceeding it primarily
02:34:53FromDiscord<Professor Actual Factual> Also threaded work
02:35:17FromDiscord<Professor Actual Factual> But thats obvious that ref is the better choice
02:35:40FromDiscord<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:04FromDiscord<Elegantbeef> Yea girvo i prefer passing data along over accessing it from the heap
02:36:23FromDiscord<Elegantbeef> If you can avoid using mutexs you should
02:36:43FromDiscord<Elegantbeef> It's another case where `ref` slows down the program 😛
02:37:01FromDiscord<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:03FromDiscord<Professor Actual Factual> In reply to @Girvo "For threaded work (which": Interesting perspective. I don't do copy messages
02:37:20FromDiscord<Girvo> Yeah even threaded programming has a few approaches! It's pretty neat 🙂
02:37:24FromDiscord<Elegantbeef> It's negligable↵(@Hi02Hi)
02:37:30FromDiscord<Girvo> And Nim is great because we can do all of them haha
02:37:32FromDiscord<Hi02Hi> In reply to @Elegantbeef "It's negligable (<@787421416227995699>)": true
02:37:40FromDiscord<Hi02Hi> but still
02:37:42FromDiscord<Elegantbeef> Objects also use more space since they cannot share stack
02:38:41FromDiscord<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:50FromDiscord<Hi02Hi> In reply to @Elegantbeef "Objects also use more": What do you mean? does this not apply to refs?
02:39:02FromDiscord<Elegantbeef> I mean depends what you're doing
02:39:08FromDiscord<Hi02Hi> if they point to different things i mean
02:39:31FromDiscord<Elegantbeef> If you're doing heavy iteration over references you're purposely slowing down your code
02:39:44FromDiscord<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:51FromDiscord<Elegantbeef> I can prove that references are fucking terrible for iterative performance in like lines of code
02:40:02FromDiscord<Elegantbeef> like 10 lines of code\
02:40:19FromDiscord<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:32FromDiscord<Girvo> Surprisngly huge difference, is what I mean 🙂
02:40:52FromDiscord<Professor Actual Factual> Yes the memory access stuff for l1 l2 cache can make magnitiude of performance gains. I don't disagree
02:41:06FromDiscord<Elegantbeef> So then why do you say "i dont buy the performance"
02:41:07FromDiscord<Professor Actual Factual> BUt when you are playing with anything larger than that I don't see it
02:41:22FromDiscord<Girvo> But bro. _Everything_ goes into L1/L2 lol
02:41:23FromDiscord<Elegantbeef> If you ever iterate a collection of your data types you're slowing down the program by using references
02:41:25FromDiscord<Elegantbeef> It's a fact
02:41:39FromDiscord<Girvo> (Well, mostly. It's complicated)
02:41:41FromDiscord<Elegantbeef> Even with large objects it's a fact
02:42:22FromDiscord<Elegantbeef> References add indirection which means you have to fetch memory a lot more for objects
02:42:35FromDiscord<Elegantbeef> So you then just ruin your cache and have to go back to memory more and more
02:43:36FromDiscord<Professor Actual Factual> sent a long message, see http://ix.io/46BO
02:43:40FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46BP
02:44:02FromDiscord<Elegantbeef> I'm more game dev focused so is that "general purpose" 😄
02:44:02FromDiscord<Girvo> Embedded isn't a different beast, it's just magnified, is my point
02:45:08FromDiscord<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:27FromDiscord<Professor Actual Factual> sent a code paste, see https://play.nim-lang.org/#ix=46BQ
02:45:30FromDiscord<Professor Actual Factual> Its just not practical
02:45:32FromDiscord<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:44FromDiscord<Elegantbeef> Do `seq[Player]`
02:45:58FromDiscord<Elegantbeef> There is no stack allocation there aside from the pointer to seq
02:46:11FromDiscord<Elegantbeef> But we've made the program faster cause we dont have any added pointer indirection
02:46:19FromDiscord<Elegantbeef> `object` isnt always stored on the stack
02:46:29FromDiscord<Professor Actual Factual> In reply to @Elegantbeef "`object` isnt always stored": Really? I never knew that
02:46:53FromDiscord<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:21FromDiscord<Elegantbeef> So you have instead of `pointer Player, pointer Player` `Player, Player` the fields are after eachother
02:47:41FromDiscord<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:50FromDiscord<Hi02Hi> Arrays are stack based, but seqs are heap based for their data, for example
02:48:21*arkurious quit (Quit: Leaving)
02:48:25FromDiscord<Elegantbeef> > Really? I never knew that↵Is this sarcasm?
02:49:02FromDiscord<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:20FromDiscord<Professor Actual Factual> (edit) "though" => "thought" | "head" => "heap"
02:49:20FromDiscord<Hi02Hi> Single objects are also on the stack, but I don't think that's a worry
02:50:08FromDiscord<ElegantBeef> bridge moment https://media.discordapp.net/attachments/371759389889003532/1004581974863773778/unknown.png
02:51:31FromDiscord<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:58FromDiscord<ElegantBeef> The fun part is in Nim `ref object` is actually just a shorthand
02:52:56FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=46BS
02:53:11FromDiscord<Professor Actual Factual> In reply to @ElegantBeef "the `type Player =": I tend to see this approach used alot in the stdlib
02:53:12FromDiscord<Elegantbeef> Hmm bridge seems to be alive again
02:53:31FromDiscord<Elegantbeef> Yea depending on what's being done there is reason for it
02:53:41FromDiscord<Rika> You have 8 pointers in your cache, then when you dereference them you flush that lol
02:53:46FromDiscord<Elegantbeef> But it's also somewhat a remnant of Nim being pascal
02:53:58FromDiscord<Elegantbeef> Well cacheline isnt the size of your cache 😄↵(@Rika)
02:54:05FromDiscord<Girvo> Also known as The Good Old Days 😉
02:54:07FromDiscord<Rika> I guess
02:54:08FromDiscord<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:16FromDiscord<Girvo> `TName` and `PWhatever` lol
02:54:34FromDiscord<Elegantbeef> It's a mixture of both i'd say
02:54:43FromDiscord<Elegantbeef> The compiler has `TName` and `PName`
02:54:53FromDiscord<Girvo> I know 🙂
02:55:04FromDiscord<Elegantbeef> Cause it was written in pascal and transpiiled to Nim
02:55:43FromDiscord<Elegantbeef> Which i think is objectively cool 😄
02:56:15FromDiscord<Rika> Not refly?
02:56:19FromDiscord<Elegantbeef> Anyway i hope learning that you cannot use object too much to stack overflow changes your view
02:56:22FromDiscord<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:32FromDiscord<Elegantbeef> Fuck that'd be wonderful girvo
02:56:50FromDiscord<Elegantbeef> A strongly typed language
02:57:05FromDiscord<Rika> I don’t know, I think it would have been same old same old
02:57:15FromDiscord<Elegantbeef> I mean things would be more clear
02:57:22FromDiscord<Rika> I guess slightly better but not by much
02:57:28FromDiscord<Elegantbeef> instead of `T` you'd have `^array[T]`
02:57:39FromDiscord<Elegantbeef> It'd be much more readable for ABI
02:57:42FromDiscord<Girvo> And type defintions are far easier to read lol
02:57:44FromDiscord<Girvo> Yeah haha
02:57:55FromDiscord<Elegantbeef> And the intent is more clear so you can probably automate more
02:58:03FromDiscord<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:23FromDiscord<Elegantbeef> `T` is ambiguous but in pascal `^T` and `array[T]` are very clear
02:58:52FromDiscord<Elegantbeef> Actually girvo am i wrong with the Pascal array syntax
02:58:59FromDiscord<Elegantbeef> I havent ever wrote it so i'm just going off memory
02:59:09FromDiscord<Rika> But I still think it would be better had we figured out ABI with another system instead
02:59:29FromDiscord<Elegantbeef> Sure but given the choice between pascal and C for ABI i'd take pascal 10/10 times
03:00:06FromDiscord<Elegantbeef> Pascal is just much more explicit about what things are and as such makes life easier for everyone involved
03:00:11FromDiscord<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:15FromDiscord<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:30FromDiscord<Elegantbeef> Yay!
03:00:41FromDiscord<Hi02Hi> You're welcome!
03:00:44FromDiscord<Girvo> No worries! It's a fascinating topic really
03:00:47FromDiscord<Elegantbeef> The proselytization worked
03:02:25FromDiscord<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:10FromDiscord<Elegantbeef> Pascal was originally a language for teaching but there were many dialects that were competing with C
03:03:13FromDiscord<Hi02Hi> and since low level stuff used asm, c gained a reputation there and spread?
03:03:23FromDiscord<Girvo> C won because Unix won, more-or-less
03:03:40FromDiscord<Girvo> Pascal was used as the low-level language in Mac OS (the old one not the new one) extensively
03:03:46FromDiscord<Hi02Hi> ah so it gained its rep in unix?
03:04:04FromDiscord<Elegantbeef> Those bastards made a language then made software with it
03:04:10FromDiscord<Elegantbeef> Fuckers ruined computing!
03:04:13FromDiscord<Girvo> Haha
03:04:27FromDiscord<Girvo> But C and Unix are inextricably linked
03:04:27FromDiscord<Elegantbeef> Wirth needed to make oberon 30 years before he did
03:04:45FromDiscord<Girvo> Yeah I do wish Wirth was more in actual production software dev rather than teaching haha
03:04:48FromDiscord<Prestige> Weren't c and unix made at the same time
03:04:51FromDiscord<Girvo> Would've been a different world
03:05:03FromDiscord<Girvo> Yep, and they made each other what they are
03:05:22FromDiscord<Girvo> Its why the C ABI is what is used by basically every OS
03:05:34FromDiscord<Elegantbeef> Even the NT one 😛
03:05:42FromDiscord<Girvo> COM makes me want to die
03:05:50FromDiscord<Girvo> Thats only semi related
03:05:54FromDiscord<Girvo> But I still feel the need to share
03:06:20FromDiscord<Prestige> JS makes me want to die
03:06:22FromDiscord<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:23FromDiscord<Hi02Hi> In reply to @Girvo "Pascal was used as": til
03:06:25FromDiscord<Elegantbeef> Problem solved
03:06:26FromDiscord<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:58FromDiscord<Elegantbeef> I mean luckily carbon isnt overly inviting to new developers 😄
03:06:59FromDiscord<Prestige> C++ was a mistake
03:07:02FromDiscord<Girvo> For a while, it looked like Pascal dialects were going to be _the_ "high level systems language" above Assembly
03:07:15FromDiscord<Girvo> Hah not wrong, beef. But still, Google worries me.
03:07:44FromDiscord<Elegantbeef> Modula-2 and delphi? 😄
03:07:48FromDiscord<Hi02Hi> i hope it doesn't happen again with nim v carbon
03:08:03FromDiscord<Prestige> Wdym?
03:08:06FromDiscord<Girvo> Hah man I loved Delphi
03:08:06FromDiscord<Elegantbeef> Why did you just say `nim vs nim but curly`
03:08:16FromDiscord<Hi02Hi> In reply to @Girvo "For a while, it": ^
03:08:21FromDiscord<Girvo> nim vs nim but curly and weird some seriously odd choices
03:08:30FromDiscord<Girvo> Mind you, Nim has a few of those too I guess lol
03:08:34FromDiscord<Elegantbeef> Nim must really make you happy given it's very pascallian
03:08:39FromDiscord<Girvo> Yep!
03:08:43FromDiscord<Prestige> Nim > Carbon, that's all I'm saying
03:08:46FromDiscord<Girvo> Its why I adopted it initially 😄
03:08:47FromDiscord<Elegantbeef> Nim doesnt do `let a:! f32 = 100`
03:08:50FromDiscord<Hi02Hi> agreed
03:08:52FromDiscord<Girvo> Pascal, but modern
03:08:54FromDiscord<Elegantbeef> Like the fuck is that constant declaration
03:08:59FromDiscord<Elegantbeef> I'll never not shit talk that
03:09:02FromDiscord<Girvo> haha
03:09:08FromDiscord<Girvo> Looks like line noise
03:09:11FromDiscord<Elegantbeef> Who the fuck though `:!` looks like constant
03:09:12FromDiscord<Rika> What does that exclamation point mean
03:09:20FromDiscord<Elegantbeef> It's a compile time constant rika
03:09:23FromDiscord<Girvo> `:!` just looks like a weird emoticon
03:09:25FromDiscord<Hi02Hi> `const`
03:09:29FromDiscord<Elegantbeef> I shit you not
03:09:36FromDiscord<Elegantbeef> `let a:!` is Nim's `const a`
03:09:51FromDiscord<Rika> Okay so do they have any such type inference
03:10:00FromDiscord<Rika> How would that work if so
03:10:11FromDiscord<Elegantbeef> `let a:! auto = 0`
03:10:20FromDiscord<Rika> Wow
03:10:25FromDiscord<Elegantbeef> Rika carbon doesnt do implicit type inference
03:10:40FromDiscord<Elegantbeef> you have to use `auto` like it's C++
03:10:41FromDiscord<Girvo> Don't forget: Carbon is written for C++ developers first and foremost
03:10:54FromDiscord<Girvo> Those poor, poor bastards
03:11:07FromDiscord<Elegantbeef> Imagine wanting a modern C++ and getting this as an offering
03:11:14FromDiscord<Elegantbeef> That's like wanting a modern C and getting vlang
03:11:40FromDiscord<Elegantbeef> Or wanting a modern oberon and getting Go
03:11:55FromDiscord<Elegantbeef> Which i'm certain shares like nothing of worth with Oberon
03:12:51FromDiscord<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:37FromDiscord<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:27FromDiscord<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:41FromDiscord<Elegantbeef> So you can import some code for C++17 and C++20 and C++14
03:15:08FromDiscord<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:28FromDiscord<Elegantbeef> I mean presently you have to transpile it to Carbon
03:15:31FromDiscord<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:35FromDiscord<Elegantbeef> But they do intend on Zig like imports
03:16:04FromDiscord<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:07FromDiscord<Elegantbeef> they want you to be able to do `using someC++Package # C++ 17` or something similar
03:16:37FromDiscord<Girvo> Which I get: it's bloody hard to do. I just hoped Google of all companies would tackle it lol
03:16:39FromDiscord<Elegantbeef> It's such an odd language
03:16:44FromDiscord<Girvo> It really, really is
03:16:53FromDiscord<Elegantbeef> Just use D-lang
03:17:04FromDiscord<Rika> I didn’t look at carbon at all because it felt like all hype
03:17:36FromDiscord<Elegantbeef> Syntax/semantic wise it's pretty much Nim - but with curlies and more cruft
03:17:54FromDiscord<Prestige> I'm wary of decisions made by anyone that chooses to write c++
03:18:05FromDiscord<Elegantbeef> It still uses all the same operators for pointers/references
03:18:12FromDiscord<Elegantbeef> So code is still incredibly tedious to parse
03:18:35FromDiscord<Elegantbeef> `` and `&` totally look like a pointer and reference respectively
03:19:04FromDiscord<Elegantbeef> Say what you will but `^` very much is a point
03:19:47FromDiscord<Elegantbeef> Remember they're the folks that think MI is a good idea 😛↵(@Prestige)
03:20:21FromDiscord<Elegantbeef> Yes i'll continue joking about MI
03:20:53FromDiscord<Hi02Hi> whats mi (?)
03:20:59FromDiscord<Elegantbeef> Multiple inheritance
03:21:16FromDiscord<b1rdf00d> oh man how good is concrete multiple inheritance
03:21:18FromDiscord<Prestige> Eh they don't do anything correctly
03:21:27FromDiscord<Hi02Hi> im not an oop person why is that bad?
03:21:43FromDiscord<Elegantbeef> It can create even more complicated to follow inheritance trees
03:21:49FromDiscord<Elegantbeef> Plus the diamond problem is fun
03:21:56FromDiscord<Prestige> It gives developers more choice in how they write code
03:22:16FromDiscord<Prestige> Which is good for good engineers, bad for bad engineers
03:22:57FromDiscord<Hi02Hi> so the problem is people default to bad engineers?
03:23:39FromDiscord<Prestige> Most (or at least half) of software devs suck, or are relatively new to programming
03:23:40FromDiscord<DaiChimpo> I know my boss does
03:23:56FromDiscord<Elegantbeef> Dont lie they all suck↵(@Prestige)
03:24:02FromDiscord<Elegantbeef> If they write code they're awful programmers
03:24:15FromDiscord<Prestige> Eh I know some good ones
03:24:47FromDiscord<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:11FromDiscord<Elegantbeef> Yea avoiding inheritance trees is just for the best
03:25:30FromDiscord<Elegantbeef> Interfaces/traits are the way to go imo
03:25:46FromDiscord<Prestige> That's just crippled MI
03:26:04FromDiscord<Prestige> MI isn't inherently bad, it just gets misused
03:26:10FromDiscord<b1rdf00d> yeah it's not _good_ but it still existed and I needed to work with it
03:27:10FromDiscord<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:28FromDiscord<Bubblie> is there any alternatives to std vector for nim or is there one in nim?
03:29:51FromDiscord<b1rdf00d> seq
03:30:09FromDiscord<Bubblie> thanks!
03:31:58FromDiscord<b1rdf00d> sent a long message, see http://ix.io/46BX
03:32:21FromDiscord<b1rdf00d> I guess this is just contributing to OSS
03:38:17FromDiscord<Bubblie> is there anything on using seq?
03:38:32FromDiscord<Bubblie> feel like im doing something wrong so I just want to double check here
03:40:07FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#types-array-and-sequence-types
03:40:26FromDiscord<Elegantbeef> https://nim-lang.org/docs/tut1.html#advanced-types-sequences
03:48:08FromDiscord<Bubblie> thanks!
03:55:49FromDiscord<Bubblie> whats the difference between newSeq and seq?
04:00:53FromDiscord<Elegantbeef> One is a procedure the other is a type
04:01:01FromDiscord<Elegantbeef> `newSeq` allocates and 0's a sequence
04:40:42FromDiscord<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:31FromDiscord<Elegantbeef> I'm simple i'd just use the stdlib sort unless it proved to be a bottle neck
05:32:24FromDiscord<Phil> Out of curiosity, what does `system/coro_detection` do?↵I can't look at the docs for it, they throw 404s
05:32:29FromDiscord<Phil> (edit) "404s" => "404s↵https://nim-lang.org/docs/coro_detection.html"
05:34:34FromDiscord<flywind> It is used internally for `std/coro`.
05:34:37FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=46Co
05:36:41FromDiscord<flywind> In reply to @Isofruit "Out of curiosity, what": https://nim-lang.org/docs/coro.html
05:37:53FromDiscord<flywind> In reply to @Isofruit "Like, this is the": It probably has been fixed by my pr.
05:39:03FromDiscord<flywind> With https://github.com/nim-lang/Nim/pull/20151 hintAsError and warningAsError now ignore foreign packages
05:41:55FromDiscord<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:30FromDiscord<Phil> It can!
05:43:06FromDiscord<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:47FromDiscord<flywind> Either way is fine. Feel free to review my PR.
05:46:09FromDiscord<Phil> Feedback may take a bit, I don't think I ever had choosenim build a branch before ^^'
05:46:54FromDiscord<flywind> I would recommend to use koch to build a debug Nim compiler.
05:47:32FromDiscord<flywind> https://media.discordapp.net/attachments/371759389889003532/1004626620000260136/unknown.png
05:48:46FromDiscord<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:15FromDiscord<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:25FromDiscord<Phil> sent a long message, see http://ix.io/46Ct
05:57:08FromDiscord<flywind> You don't need to clone https://github.com/nim-lang/csources_v1
05:57:12FromDiscord<Phil> (edit) "http://ix.io/46Ct" => "http://ix.io/46Cu"
05:58:29FromDiscord<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:57FromDiscord<Phil> So the entire bootstrapping step is for those who want to play around with it?
05:59:10FromDiscord<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:48FromDiscord<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:17FromDiscord<flywind> For developing a compiler, this is unnecessary.
06:01:49FromDiscord<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:22FromDiscord<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:04FromDiscord<Elegantbeef> Correct
06:50:51FromDiscord<Phil> Alrighty, so I can compile my project with that temp compiler, lets see what happens once I add the evil flagg
06:51:00FromDiscord<Elegantbeef> Yep
06:55:39FromDiscord<Phil> sent a code paste, see https://paste.rs/DBq
06:55:54FromDiscord<Phil> the path in the end is correct, without the hintAsError flag the above command executes
06:56:18FromDiscord<Elegantbeef> does something in there make your shell sad?
06:57:24FromDiscord<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:38FromDiscord<flywind> How about `./koch temp c -d:ssl --hintAsError:XDeclaredButNotUsed] ../nimstoryfont/src/nimstoryfont.nim`
06:57:43FromDiscord<flywind> (edit) "--hintAsError:XDeclaredButNotUsed]" => "--hintAsError:XDeclaredButNotUsed"
07:01:05FromDiscord<Phil> That also works!
07:01:40FromDiscord<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:52FromDiscord<!&luke> In reply to @Isofruit "I will admit this": It's the sqare brackets
07:02:01FromDiscord<!&luke> You can quote that arg
07:04:23FromDiscord<Phil> In reply to @ripluke "It's the sqare brackets": Aye, went that route in the end
07:13:18FromDiscord<Phil> It works, yay!
07:34:14FromDiscord<proton> Is there any search engine in Nim?
07:38:03FromDiscord<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:46arkanoidwhy nim failed to catch the science train? https://www.nature.com/articles/d41586-020-03382-2
07:42:05arkanoidit's on hackernews, beside being 2020
07:49:16FromDiscord<Phil> sent a long message, see http://ix.io/46CU
07:50:55FromDiscord<Phil> sent a long message, see http://ix.io/46CV
07:51:38FromDiscord<enthus1ast> BUT they can copy and paste R code
07:51:53FromDiscord<enthus1ast> and ask the it guy (me) why stuff is not working
07:52:11FromDiscord<enthus1ast> then i get cancer while understanding stupid R code
08:11:56FromDiscord<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:06arkanoidPhil: as a person living next to scientists I may agree with you, but what we are talking here is traction
08:20:38arkanoidenthis1ast: what do you mean by "pasting R code?"
08:21:13*Jjp137 quit (Ping timeout: 244 seconds)
08:22:08arkanoidI mean *enthus1ast
08:22:25*Jjp137 joined #nim
08:24:26FromDiscord<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:28FromDiscord<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:06FromDiscord<Phil> (edit) "C++/C" => "C++/C, though only when absolutely necessary for performance due to gargantuan datasets."
08:30:45FromDiscord<enthus1ast> because noone (i know) is realy fluent in R
08:30:50FromDiscord<enthus1ast> but all use it
08:31:47FromDiscord<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:00FromDiscord<enthus1ast> i mean
08:32:02FromDiscord<enthus1ast> foo.baa
08:32:10FromDiscord<enthus1ast> ^ this alone
08:32:14FromDiscord<Phil> This would barely be better if it were another language
08:32:20FromDiscord<Phil> "scientific programming"
08:32:34FromDiscord<enthus1ast> foo.baa is just a variable name (sic yes)
08:32:56FromDiscord<Phil> R allows variable names with dots? TIL
08:33:02FromDiscord<enthus1ast> yes \:)
08:33:12FromDiscord<enthus1ast> not only allowes but is all over the place
08:38:04FromDiscord<proton> https://github.com/c-blake/nimsearch looks promising
08:41:07FromDiscord<proton> sent a code paste, see https://play.nim-lang.org/#ix=46D7
08:41:44FromDiscord<proton> Where should I put nimbase.h to have it compile?
09:24:14FromDiscord<demotomohiro> `nimbase.h` should be in lib directory in your nim directory.
09:25:26FromDiscord<demotomohiro> And when Nim compile generated c code, it automatically add lib directory as include path
09:27:24FromDiscord<proton> It seems failed to do so.
09:30:36FromDiscord<demotomohiro> That means you dont have `nimbase.h` in <nim installed dir>/lib?
09:38:53*wallabra quit (Ping timeout: 268 seconds)
09:40:02FromDiscord<proton> I do have, nimsearch/start.sh failed to do it right.
09:40:23FromDiscord<proton> (edit) "nimsearch/start.sh" => "nimsearch/build.sh"
09:43:24*kenran joined #nim
09:48:33FromDiscord<EyeCon> In reply to @Isofruit "R allows variable names": ... and uses $ for namespacing
09:48:57FromDiscord<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:20FromDiscord<proton> thanks, it helps a lot!
11:18:08FromDiscord<lantos> sent a code paste, see https://play.nim-lang.org/#ix=46DJ
11:52:19FromDiscord<gaopow> sent a long message, see http://ix.io/46DV
11:56:56FromDiscord<Rika> SAS?
12:43:33FromDiscord<4zv4l> I don't find the name of the Coc extension for nim in vim↵anyone can help me ?
13:01:11FromDiscord<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:23FromDiscord<EyeCon> I wish R the language were a bit better
13:01:26FromDiscord<gibson> @4zv4l https://github.com/PMunch/nimlsp
13:02:23NimEventerNew thread by HJarausch: WithColor template in "THE BOOK" , see https://forum.nim-lang.org/t/9347
13:14:50FromDiscord<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:34FromDiscord<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:52FromDiscord<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:22FromDiscord<flywind> How can I skip the range type and get the internal type?
14:30:41FromDiscord<flywind> For example
14:30:55FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=46EP
14:31:23FromDiscord<flywind> How can get the Ct[uint32] tyoe?
14:31:29FromDiscord<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:22FromDiscord<Rika> doesnt `x.typeof.T` work
14:47:04FromDiscord<Rika> yup it does
14:47:15FromDiscord<Rika> @flywind if you're still here `x.typeof.T`
14:47:57FromDiscord<pruno> sent a code paste, see https://play.nim-lang.org/#ix=46ER
14:49:44FromDiscord<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:50FromDiscord<flywind> (edit) "In reply to @Rika "<@658563905425244160> if you're still": thank you! What if the ... type" added "generic"
14:51:06FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=46ES
14:52:11FromDiscord<Rika> `import std/typetraits; x.typeof.genericParams.get(0 #[index of type]#)`
14:52:29FromDiscord<Rika> if you use x: distinct i believe the type info is lost
14:52:47FromDiscord<Rika> not sure how that even works really
14:52:54FromDiscord<Rika> idk what that x: distinct means
14:53:57FromDiscord<flywind> It seem to work, thanks!
14:55:51FromDiscord<flywind> No all cases, I probably still need to go for skipRanges hack in the compiler.
14:56:23FromDiscord<flywind> (edit) "No" => "Not"
14:56:32FromDiscord<flywind> (edit) "hack" => "hacks"
15:00:38*mahlon quit (Ping timeout: 268 seconds)
15:07:39FromDiscord<Raws> sent a code paste, see https://play.nim-lang.org/#ix=46F7
15:09:17FromDiscord<flywind> What's the error message after installing the compiler?
15:09:27FromDiscord<Raws> Same error message
15:09:56FromDiscord<Raws> https://media.discordapp.net/attachments/371759389889003532/1004768151977869332/unknown.png
15:12:17FromDiscord<flywind> `nimble build` seems to require you put `requires "compiler"` on your nimble file irrc,
15:12:42*wallabra joined #nim
15:14:36FromDiscord<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:56FromDiscord<flywind> You are welcome
15:27:03NimEventerNew 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:31FromDiscord<Bubblie> when should I use newSeq compared to just seq?
16:26:42FromDiscord<Bubblie> im still a tad bit confused between the different usages between them
16:26:50FromDiscord<Rika> what does that mean? seq is a type, newseq is a proc
16:26:52FromDiscord<Bubblie> sorry 😅
16:27:03FromDiscord<Rika> im not sure what the confusion is from
16:27:16FromDiscord<Bubblie> is that the only difference really?
16:28:23FromDiscord<Rika> in most common cases yeah kinda
16:28:37FromDiscord<Rika> can you give examples where you'd be unsure which to use
16:29:04FromDiscord<Bubblie> hmmm
16:29:17FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=
16:29:29FromDiscord<Bubblie> is what I have
16:29:36FromDiscord<Bubblie> but should I use seq here instead?
16:29:48FromDiscord<Bubblie> because from what I know you cant define a length with seq
16:29:50FromDiscord<Bubblie> right?
16:30:24FromDiscord<Rika> what is layercount
16:30:47FromDiscord<Rika> like its a number right sorry lmao im not reading
16:30:58FromDiscord<Bubblie> yeah I should have specified that 😭 sorry
16:30:59FromDiscord<Rika> `seq[Type](number)` is not valid code
16:31:06FromDiscord<Bubblie> its a cuint
16:31:08FromDiscord<Rika> !eval echo seq[int](12)
16:31:11NimBotCompile failed: /usercode/in.nim(1, 14) Error: type mismatch: got 'int literal(12)' for '12' but expected 'seq[int]'
16:31:21FromDiscord<Rika> !eval echo newSeq[int](12)
16:31:25NimBot@[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
16:31:31FromDiscord<Bubblie> ohhhhh
16:31:37FromDiscord<Bubblie> I see now!
16:31:38FromDiscord<Rika> seq[type](thing) is for conversion
16:31:53FromDiscord<Rika> though its rare to use it
16:32:01FromDiscord<Rika> since you usually use `@` for arrays
16:32:08FromDiscord<Bubblie> ah okay!
16:32:10FromDiscord<Bubblie> thank you so much
16:32:24FromDiscord<Rika> thats infact the @ in the @[0,0,0,0...] above, its just a proc for array -> seq
16:33:33FromDiscord<Bubblie> thank you rika :)
16:35:00FromDiscord<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:09FromDiscord<Rika> or maybe im just not thinking well today
16:35:15FromDiscord<Rika> likely the latter xd
16:54:20FromDiscord<Bubblie> Okay!
16:54:40FromDiscord<Bubblie> Is there any nim bindings for bullet (the physics library)
16:54:46FromDiscord<Bubblie> Btw
16:56:33FromDiscord<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:21FromDiscord<jmgomez> is auto not inferring the right type on a function as a parameter and compiling a known issue?
17:42:20FromDiscord<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:06FromDiscord<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:15FromDiscord<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:50FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=46FL
17:51:57FromDiscord<voidwalker> I really hate it that the docs lack basic examples for most stuff
17:53:33FromDiscord<Phil> Sth sth be the change you want to see sth sth
17:56:16FromDiscord<voidwalker> How exactly do you submit edits to the docs?
17:56:34FromDiscord<voidwalker> Would be nice if the docs were a wiki
18:00:41FromDiscord<flywind> In reply to @voidwalker "How exactly do you": there are edit buttons on the docs.
18:02:06FromDiscord<flywind> https://media.discordapp.net/attachments/371759389889003532/1004811480035770418/Screenshot_2022-08-05-02-01-56-84_40deb401b9ffe8e1df2f1cc5ba480b12.jpg
18:02:30FromDiscord<flywind> Remember to edit the devel branch though.
18:03:07FromDiscord<flywind> https://nim-lang.github.io/Nim/os.html
18:04:09FromDiscord<flywind> Docs changes tend to be merged quicker if good enough.
18:06:02*CyberTailor quit (Remote host closed the connection)
18:06:17FromDiscord<flywind> Consise and simple runnableEx amples are mostly welcome.
18:06:55*CyberTailor joined #nim
18:08:50FromDiscord<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:31FromDiscord<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:41FromDiscord<pruno> sent a code paste, see https://play.nim-lang.org/#ix=46FQ
18:15:20FromDiscord<enthus1ast> you can cast it to the type it is and just echo it
18:15:51FromDiscord<pruno> Oh
18:16:04FromDiscord<Tuatarian> how can I index an array with bools if I don't know it at compile time?
18:16:32FromDiscord<Tuatarian> I know it's length 2, but that's it
18:16:50FromDiscord<Phil> As in, you want to use a bool as an index on an array of size 2 that already exists?
18:16:53FromDiscord<pruno> In reply to @enthus1ast "you can cast it": Works indeed lol, thanks
18:17:25FromDiscord<Tuatarian> without having to write a[int b] each time
18:17:49FromDiscord<Phil> Ah, so you don't want to convert the bool to int?
18:17:54FromDiscord<Phil> Err
18:18:12FromDiscord<Phil> Write a custom seq type and define a `[]` proc of your own?
18:18:17FromDiscord<Phil> Alternatively hashmap ?
18:18:19FromDiscord<Tuatarian> it's possible if you can write the array, eg `let z = [false : 1, true : 2]` or something
18:18:23FromDiscord<Tuatarian> hashmap super slow
18:18:57FromDiscord<Tuatarian> I have an array[2, array[169, int]] which obviously
18:19:03FromDiscord<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:22FromDiscord<Tuatarian> I guess...
18:19:28FromDiscord<mr_noia> you can do\: `let x: array[bool, int] = [2, 3]`
18:19:46FromDiscord<Tuatarian> that works?
18:19:54FromDiscord<Tuatarian> also, would I have to write out the array in that case?
18:20:23FromDiscord<Tuatarian> unless there's a newArrWith proc or similar, I can't really write out the array
18:20:26FromDiscord<Phil> `let y: array[bool, int] = [1,2]` compiles
18:20:42FromDiscord<Phil> And it does allow access with bools
18:21:10FromDiscord<Tuatarian> but then I have to write out the rhs right?
18:21:18FromDiscord<Phil> the what now?
18:21:33FromDiscord<Tuatarian> my type is `array[2, array[169, int]]` so I can't really write out the rhs
18:21:35FromDiscord<Tuatarian> right hand side
18:21:37FromDiscord<Tuatarian> of the assignment operator
18:21:42FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=46FS
18:21:59FromDiscord<Phil> Ahhh check, didn't know the acronym
18:21:59*rockcavera quit (Remote host closed the connection)
18:22:24FromDiscord<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:53FromDiscord<Elegantbeef> You can make an `arrayWith[bool](val)`
18:23:29FromDiscord<Phil> play nim lang is down
18:23:33FromDiscord<Phil> Sad noises
18:24:14FromDiscord<Tuatarian> `let z : array[2, array[169, int]] = arrayWith[bool](arrayWith(0))`?
18:24:27FromDiscord<Tuatarian> play is down, I became so reliant on it for stuff like this
18:24:36FromDiscord<Tuatarian> since I don't really want to make a new file for greyboxing
18:24:49FromDiscord<Elegantbeef> Yea you could make those procedures
18:24:50FromDiscord<Tuatarian> especially since I don't even have error highlighting on emacs
18:25:10FromDiscord<Elegantbeef> though it's really just `default(array[bool, array[169, int]])`
18:26:45FromDiscord<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:42FromDiscord<Tuatarian> oh I see, you can use bool as a length
18:27:46FromDiscord<Tuatarian> that's why that makes sense
18:27:59FromDiscord<voidwalker> anyway, anything else than wiki is too complicated to bother with
18:28:00FromDiscord<Elegantbeef> any ordinal can be
18:28:06FromDiscord<Tuatarian> does it compute sizeof or similar
18:28:22FromDiscord<Elegantbeef> It's a bool indexed array
18:28:35FromDiscord<Elegantbeef> It calculates the range of the ordinal and makes an array that size
18:29:11FromDiscord<voidwalker> https://discord.com/channels/371759389889003530/371759389889003532/1004808464859680798 can someone look at this please?
18:37:55FromDiscord<Elegantbeef> Void you should os inside `lib/pure/os`
18:42:43FromDiscord<voidwalker> I meant the docs for the os
18:43:24FromDiscord<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:34FromDiscord<Elegantbeef> The docs are in the code
18:43:37FromDiscord<Elegantbeef> `##` are doc comments
18:44:57FromDiscord<voidwalker> hmm was that a good idea?
18:45:08FromDiscord<voidwalker> cause now you can't go crazy with the examples and verbosity
18:45:10FromDiscord<Elegantbeef> I'd argue yes
18:48:58FromDiscord<Zectbumo> I want restarting frames in nim↵https://developer.chrome.com/blog/new-in-devtools-104/?utm_source=devtools#restart-frame
18:48:59FromDiscord<Elegantbeef> I dont see why you cannot go crazy with examples
18:52:37FromDiscord<Elegantbeef> Use a macro to copy what vale does https://verdagon.dev/blog/perfect-replayability-prototyped
18:54:09FromDiscord<Zectbumo> interesting
18:58:01FromDiscord<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:23FromDiscord<Elegantbeef> Isnt that what nimpy allows?
18:58:35FromDiscord<Phil> Nimpy allows you to define a type in nim and use it in python
18:58:45FromDiscord<Phil> I was wondering whether the reverse is possible and I can't think of a way
18:58:57FromDiscord<Phil> Since nim must know for a proc definition what type it accepts at compile time
18:59:11FromDiscord<Phil> Unless you can just generally interpret the python object as a Hashmap I guess
18:59:12FromDiscord<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:07FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=46G2
19:02:22FromDiscord<Elegantbeef> Does nimpy not expose a way to access the raw python type?
19:02:50FromDiscord<Phil> It might but I'm not seeing one at a glance in the github documentation
19:02:59FromDiscord<Phil> And I#ve read that thing 3 times by now
19:03:23FromDiscord<Phil> It shows off how to import python modules and use its functions
19:03:42FromDiscord<Phil> But I'm not seeing a "import python type as X" section
19:03:45FromDiscord<Phil> (edit) "type" => "class"
19:09:44*kenran joined #nim
19:12:21*kenran quit (Client Quit)
19:16:53FromDiscord<phillvancejr> is there a way to get the path to the current executable?
19:18:17FromDiscord<Elegantbeef> https://nim-lang.org/docs/os.html#getAppDir
19:26:35FromDiscord<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:12NimEventerNew 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:41FromDiscord<pouriya.jamshidi> sent a code paste, see https://play.nim-lang.org/#ix=46G5
19:45:07FromDiscord<Elegantbeef> `&=` or `.add`
19:48:42*jmdaemon joined #nim
19:53:27FromDiscord<Phil> Using `&` at the start to allow for usage of "{}" in strings to render variables into a string works?
19:53:43FromDiscord<Elegantbeef> If you `import std/strformat`
19:54:06FromDiscord<Phil> It's an even shorter version of `fmt`?
19:54:15FromDiscord<Elegantbeef> It has different semantics
19:55:11FromDiscord<Elegantbeef> `fmt` is a raw string literal so `\t` doesnt echo a tab it echoes `\t`
19:55:49FromDiscord<Elegantbeef> `&` properly handles those characters
19:59:12*mahlon quit (Ping timeout: 245 seconds)
19:59:17FromDiscord<pouriya.jamshidi> In reply to @Isofruit "Using `&` at the": not if it is a multiline string. Otherwise, it is ok
19:59:46FromDiscord<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:00FromDiscord<pouriya.jamshidi> In reply to @Elegantbeef "`&=` or `.add`": I couldn't figure out the `&=` but the `.add` worked. thanks
20:00:16FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=46Gc
20:00:36FromDiscord<Elegantbeef> use tabs instead phil
20:01:01FromDiscord<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:36FromDiscord<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:04FromDiscord<Phil> Maybe I should mention that I do have an import of std/strformat above that piece of code
20:03:46FromDiscord<pouriya.jamshidi> In reply to @Isofruit ""Not work" in the": correct. it escapes those special characters
20:04:21FromDiscord<Phil> In that case I got nothing
20:04:49FromDiscord<pouriya.jamshidi> I used the `.add()` proc as a workaround
20:05:25FromDiscord<pouriya.jamshidi> sent a code paste, see https://play.nim-lang.org/#ix=46Gf
20:07:19FromDiscord<EyeCon> Just insert a real tab character
20:08:18FromDiscord<EyeCon> Or declare these strings as constants
20:12:16*Guest64 joined #nim
20:13:00FromDiscord<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:58FromDiscord<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:19FromDiscord<EyeCon> sent a code paste, see https://play.nim-lang.org/#ix=46Gk
20:24:47FromDiscord<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:42FromDiscord<pouriya.jamshidi> In reply to @EyeCon "Or declare a function": thank you!
20:56:36*mahlon joined #nim
21:41:26FromDiscord<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:25FromDiscord<huantian> the ideal way of doing that is traits/concepts tho imo
21:43:50*CyberTailor quit (Remote host closed the connection)
21:43:59FromDiscord<huantian> which is similar to what statically typed python does with duck typing
21:44:56*CyberTailor joined #nim
21:46:17FromDiscord<gibson> sent a code paste, see https://play.nim-lang.org/#ix=46GN
21:46:30FromDiscord<gibson> I'm very interested in solving this better.
21:47:10FromDiscord<gibson> (edit) "https://play.nim-lang.org/#ix=46GN" => "https://play.nim-lang.org/#ix=46GO"
21:49:33FromDiscord<Elegantbeef> These are free standing functions you cant really use concepts here
21:51:20FromDiscord<gibson> Ah okay, that's what I suspected. Still, being able to do this with templates is quite nice.
21:52:10FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46GR
21:52:42FromDiscord<Elegantbeef> Whoops that last one should be `typedesc[Invalid]`
21:53:32FromDiscord<Elegantbeef> Probably best to do `login(t: typedesc[Loginable], s: string)` so you can do `Admin.login(testuser)`
21:54:52FromDiscord<Elegantbeef> No clue why you'd do it your way, but this is just food for thought
21:59:47FromDiscord<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:45FromDiscord<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:53FromDiscord<Elegantbeef> So you have a very obscure dispatch to me
22:01:16FromDiscord<Elegantbeef> Also for templates you shouldnt need to mixin
22:01:37FromDiscord<Elegantbeef> You might depending on the way you call the procedure though i guess
22:01:54FromDiscord<Elegantbeef> It also means you can only use one login procedure per scope
22:01:59FromDiscord<gibson> No you're right! That's great.
22:02:20FromDiscord<Elegantbeef> But it's very much "Write the code how you want it"
22:02:34FromDiscord<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:02FromDiscord<Elegantbeef> If you really really were lazy you could make a template for declaring login tokens
22:04:36FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46GT
22:05:59FromDiscord<Elegantbeef> Also one thing i'd comment on is that the "implicit" `getToken` call is more prone to security issues
22:06:32FromDiscord<gibson> Instead of fully qualifying `tokens.getToken`?
22:06:44FromDiscord<Elegantbeef> No
22:07:09FromDiscord<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:34FromDiscord<Elegantbeef> So you may accidentally give admin access
22:08:11FromDiscord<gibson> Oh, because `mixin`. True... good point.
22:08:58FromDiscord<gibson> I'd want to wrap it in a `when defined(testing)` so the binding isn't always open like that.
22:09:27FromDiscord<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:37FromDiscord<Elegantbeef> But anywho there you go that's the concept method i'd use
22:09:58FromDiscord<gibson> 👍 cool! Thank you for the enlightening discussion.
22:21:05FromDiscord<gibson> 😦 `mixin` does not respect `when` branching. Weird.
22:35:11FromDiscord<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:48NimEventerNew thread by Ggibson: `mixin` ignores `when` branching, see https://forum.nim-lang.org/t/9350
22:44:08FromDiscord<Elegantbeef> Probably the one you can use as a const↵(@Rainbow Asteroids)
22:51:29FromDiscord<mim> im having trouble getting nim istalled
22:51:41FromDiscord<mim> i used the choosenim bat file
22:51:53FromDiscord<mim> and i verified the bin folder was added to my path
22:52:03FromDiscord<mim> and i checked the folder to see if nim was in there
22:52:14FromDiscord<mim> but i still cant use nim from command prompt
22:52:32FromDiscord<mim> sent a code paste, see https://play.nim-lang.org/#ix=46GZ
22:53:42FromDiscord<mim> https://media.discordapp.net/attachments/371759389889003532/1004884864698425424/unknown.png
22:53:47FromDiscord<mim> as you can see it does exist
22:53:57FromDiscord<mim> i tried restarting my terminal as well
22:54:15FromDiscord<mim> it works from powershell
22:54:18FromDiscord<mim> but not cmd
22:54:45FromDiscord<mim> (edit) "my terminal" => "cmd"
22:58:55FromDiscord<Prestige> Do you need to log out for it to take effect? Idk Windows
22:59:09FromDiscord<mim> no but ive never needed to before
22:59:12FromDiscord<mim> ill give it a try i guess
23:01:03FromDiscord<mim> works now-
23:01:06FromDiscord<mim> thats so weird
23:01:13FromDiscord<mim> i never had to log out for node or anything
23:01:21FromDiscord<mim> or when installed java a few days ago
23:01:32FromDiscord<mim> (edit) "java" => "the jdk"
23:02:52FromDiscord<sOkam!> sent a long message, see http://ix.io/46H1
23:24:46FromDiscord<michaelb.eth> sent a long message, see http://ix.io/46H7
23:35:33FromDiscord<!Patitotective> In reply to @sOkam! "I have a cpp": https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importcpp-pragma
23:37:57FromDiscord<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:26FromDiscord<sOkam!> Am I missing some cli modifier to handle cpp or something?
23:38:59FromDiscord<!Patitotective> In reply to @Patitotective "https://nim-lang.org/docs/manual.html#implementatio": doesn't this work?
23:39:23FromDiscord<sOkam!> i mean, that's for importing directly cpp code, right?
23:39:42FromDiscord<sOkam!> (edit) "i mean, that's for importing ... directlywithout" added "cpp code" | "cpp code," => "without translation,"
23:39:48FromDiscord<!Patitotective> yes
23:40:00FromDiscord<!Patitotective> thats what you asked for
23:40:01FromDiscord<sOkam!> My attempts have all being about translation
23:40:31FromDiscord<sOkam!> Ah ye. Goal would be both. Interface at first, but eventually translate
23:40:39FromDiscord<!Patitotective> yes, you asked if there was a way to work with cpp code while you work on the translation (?)
23:41:05FromDiscord<Elegantbeef> `Option[Bar] isnot Option[Foo]` you need to convert to `Foo`↵(@michaelb.eth)
23:41:21FromDiscord<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:56FromDiscord<!Patitotective> i dont know about c3nim https://media.discordapp.net/attachments/371759389889003532/1004897004998107196/unknown.png
23:42:17FromDiscord<!Patitotective> (edit) "c3nim" => "c2nim"
23:42:50FromDiscord<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? 🤔