<< 15-11-2025 >>

01:35:58*beholders_eye quit (Ping timeout: 256 seconds)
02:19:33*TheTechRobo4 joined #nim
02:21:37*TheTechRobo quit (Ping timeout: 264 seconds)
02:21:37*TheTechRobo4 is now known as TheTechRobo
02:26:57FromDiscord<.somechump> sent a code paste, see https://play.nim-lang.org/#pasty=dKHYUqKt
02:27:12FromDiscord<.somechump> (edit) "https://play.nim-lang.org/#pasty=mUMMAcnS" => "https://play.nim-lang.org/#pasty=RtUrucPr"
03:10:46*rockcavera joined #nim
03:13:44FromDiscord<Elegantbeef> The former
03:59:29*xet7 joined #nim
04:04:22FromDiscord<.somechump> In reply to @Elegantbeef "The former": Thank you for the input. 🙂
06:23:07*xet7 quit (Remote host closed the connection)
07:59:11FromDiscord<kiloneie> In reply to @systemblue_2010 "there's VSCode nim extensions": And the lsp crabs itself constantly, on anything more than a single file or two. Giving me false errors, no auto-complete/suggestions, etc.
08:00:40FromDiscord<kiloneie> I could make Nim videos again one day, but i want assured minimum wage of my country, with good communication. I'd love to do it for free, full freedom, and then lose my mind paying the bills.
08:23:59FromDiscord<tomexmachina> have things improved around all that concurrency troublemaking? just checking back in to see if nim has resolved the scary multithreading issues since I was last here, and what the state of it all has become
09:03:04*przmk quit (Remote host closed the connection)
09:19:27*SchweinD1 quit (Quit: WeeChat 4.8.0-dev)
09:19:55*SchweinDeBurg joined #nim
10:45:58FromDiscord<aethrvmn> I would make AI Nim videos but I'm not allowed to because of my job, I could do Nim system programming videos though↵(@kiloneie)
11:04:34*przmk joined #nim
11:48:17*beholders_eye joined #nim
11:53:09*xet7 joined #nim
12:31:49*hygo quit (Ping timeout: 264 seconds)
12:47:25FromDiscord<systemblue_2010> sent a long message, see https://pasty.ee/qteSXCMx
12:47:54FromDiscord<systemblue_2010> modern programmers don't think about optimizing but it is important for system programming and low level library
12:49:22FromDiscord<lainlaylie> youve found evidence that contradicts this?↵> Note: var parameters are never necessary for efficient parameter passing. Since non-var parameters cannot be modified the compiler is always free to pass arguments by reference if it considers it can speed up execution.
12:51:53FromDiscord<systemblue_2010> you mean let can be passed by reference when compiler consider for speed?↵I don't totally trust compiler so ↵I rather prefer to use explicit reference type
12:53:35FromDiscord<systemblue_2010> and returning big type(such as object, array, seq) is not good for optimizing↵we have to pass it with var or ptr then returning it with "return" keyword
12:54:54FromDiscord<lainlaylie> there's nothing to trust, you can check the generated C and see that any parameter bigger than 3 floats gets passed by pointer
12:54:59FromDiscord<lainlaylie> returning is a different story
12:56:16FromDiscord<systemblue_2010> you mean I don't have to use var or ptr keyword only for optimizing?↵compiler does it automatically?
12:56:27FromDiscord<lainlaylie> in terms of parameters, correct
12:57:17FromDiscord<0xfab_10> also there's rvo iirc
13:00:06FromDiscord<systemblue_2010> um...↵but it seems explicit optimized code is faster then compiler-only optimized code
13:01:01FromDiscord<lainlaylie> youve benchmarked it or?
13:01:29FromDiscord<systemblue_2010> I said "seems"↵just my thinking
13:02:16FromDiscord<0xfab_10> "seems" sounds like you've checked
13:03:02FromDiscord<lainlaylie> the compiler indeed is not all-powerful but passing parameters by pointer is probably not an optimization you have to worry about
13:04:53FromDiscord<systemblue_2010> but I think ↵doing passing parameter with reference type and using output to reference type ↵will be better then not doing it
13:05:01FromDiscord<systemblue_2010> it'
13:05:15FromDiscord<systemblue_2010> s "better" not must I think
13:06:07FromDiscord<systemblue_2010> In reply to @systemblue_2010 "hey why many nim": I recognize "must use var, ptr, ref type" is wrong
13:06:41FromDiscord<systemblue_2010> but for library that needs extreme optimization and speed might need this
13:06:56FromDiscord<systemblue_2010> because I can't trust compiler totally
13:07:01FromDiscord<lainlaylie> try it and benchmark it
13:07:18FromDiscord<0xfab_10> no need for discussing speculations
13:07:19FromDiscord<systemblue_2010> yes I will test it after I finish my cryptography library
13:49:16FromDiscord<auxym> In reply to @systemblue_2010 "um... but it seems": But there's a tradeoff. `var` vs immutable parameters by default exist for a reason (type safety, easier to reason about). 1st benchmark, second decide if the "optimization" is worth the trade-off. Never forget that quote about premature optimization.
14:00:44FromDiscord<demotomohiro> It seems Nim passes object types by reference if it is larger than sizeof(float) 3↵https://github.com/nim-lang/Nim/blob/devel/compiler/ccgutils.nim#L93
14:04:16FromDiscord<0xfab_10> you can also force it with the `byref` pragma iirc (`type obj {.byref.} = object ..`)
14:05:58*beholders_eye quit (Ping timeout: 256 seconds)
14:07:30*beholders_eye joined #nim
14:37:24*xet7 quit (Remote host closed the connection)
15:04:01FromDiscord<aethrvmn> Let tells the compiler that this object is set at runtime and won't change, which allows the compiler to optimize it. I write `let` by default and go back to change it if I actually update the value↵(@systemblue_2010)
15:19:41FromDiscord<mratsim> In reply to @systemblue_2010 "hey why many nim": The compiler will always pass parameters that are bigger than 24 bytes by reference. It's in the code. Unless you interface with C ABI and you tag the type as `{.bycopy.}`
15:21:03FromDiscord<mratsim> If that doesn't happen it's a bug and you can raise an issue: exemple - https://github.com/nim-lang/Nim/issues/16897
18:20:26FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "The compiler needs to": it needs to work, and exist :P
18:21:15FromDiscord<Robyn [She/Her]> In reply to @tomexmachina "have things improved around": Nope
18:21:54FromDiscord<Robyn [She/Her]> In reply to @systemblue_2010 "hey why many nim": You should be able to use `lent T` iirc
18:22:26FromDiscord<Robyn [She/Her]> there's also `sink` which passes ownership of a variable to the function
18:22:35FromDiscord<Robyn [She/Her]> Useful for builder pattern stuff I think
18:34:28*ChanServ quit (*.net *.split)
20:14:51FromDiscord<David> sent a long message, see https://pasty.ee/snzMROoL
20:30:25FromDiscord<auxym> In reply to @David "How do you get": it's been a while but IIRC I added this nim.cfg to my tests dir which fixed the issue: https://github.com/auxym/bight/blob/main/tests/nim.cfg
21:00:04FromDiscord<David> sent a long message, see https://pasty.ee/tXrVeckY
21:04:33FromDiscord<David> Well it's not treesitter... the method name is an identified. Also syntax highlighting would've probably been wonky, so not sure why I thought that in the first place.↵↵So it must be something with the langauge server 🤔
21:35:56FromDiscord<auxym> fwiw... I just booted up vs code with the nimlang.org extension and nimlangserver, open that tests dir and... yeah it doesn't work. can't resolve my package. Sorry, must have misremembered. :/ hopefully someone else can chime in
21:58:23FromDiscord<goldenlion5648> sent a code paste, see https://play.nim-lang.org/#pasty=UyBNUWSK
21:58:33FromDiscord<goldenlion5648> (edit) "https://play.nim-lang.org/#pasty=aPJzoLbo" => "https://play.nim-lang.org/#pasty=HcpsnVmZ"
21:59:14FromDiscord<Elegantbeef> Nope `addr` is explicitly unsafe
22:00:05FromDiscord<Elegantbeef> Use `var int` as a parameter and you don't need `addr`
22:17:29*ReneSac joined #nim
23:21:43ReneSachello, I'm trying to setup my nim develop enviroment again after quite some time, and I can't get nimsuggest to work on vscodium
23:21:58ReneSacit finds the nimlangserver:
23:22:00ReneSacDBG Starting nimlangserver version=1.12.0 params="(clientProcessId: none(int), transport: some(stdio), port: 0)"
23:22:19ReneSacBut then it fails:
23:22:19ReneSacDBG Initialize completed. Trying to start nimsuggest instances
23:22:19ReneSacSIGSEGV: Illegal storage access. (Attempt to read from nil?)
23:22:59ReneSacwhen I did nimble install nimlangserver I received the following warning:
23:23:08ReneSacPackage requires nim 2.0.8 but 2.2.6. Attempting to compile with the current nim version.
23:24:39ReneSacit gave some warnings on "githubcom_nimlanglangserver/routes.nim(284, 47) Warning: a new symbol 'projectFile' has been injected during template or generic instantiation, [...]" but ended up installing somehow
23:24:43ReneSacany idea of what is wrong?
23:25:20ReneSacor what I can do to make it run?
23:28:59ReneSacsearching the web I only found old closed issues.