<< 01-11-2024 >>

00:00:01*marcus quit (Remote host closed the connection)
00:00:43*marcus joined #nim
00:54:01*rockcavera joined #nim
01:17:31*Jjp137 quit (Quit: Leaving)
01:18:07FromDiscord<nitely_> In reply to @albassort "(in sync and not": you could take a look at mummy, it's a non-async server↵in case you have not yet
01:19:19*Jjp137 joined #nim
01:45:54FromDiscord<threefour> In reply to @Elegantbeef "well Nimsuggest is a": I'd wondered how it's so good at understanding even complex macros. That also explains why it seems so slow compared to other languages' analyzers.
01:54:00FromDiscord<Elegantbeef> Well with most languages it's required to use a modified compiler practically
01:55:15FromDiscord<Elegantbeef> Like you could parse all of C then handle `#ifdef`s yourself, but then you have a C frontend with a backend that emits LSP data
02:03:46*rockcavera quit (Remote host closed the connection)
02:48:45*lucasta quit (Quit: Leaving)
04:57:03FromDiscord<Robyn [She/Her]> In reply to @albassort "i'd be better off": does Mummy not work?
04:57:10FromDiscord<Robyn [She/Her]> In reply to @nitely_ "you could take a": oh that was alr said
05:47:00*alexdaguy joined #nim
06:43:30FromDiscord<grumblygibson> In reply to @Elegantbeef "NIR and IC allows": This makes the new strategy make way more sense. Thanks for explaining that.
07:14:05*ntat joined #nim
09:41:02*coldfeet joined #nim
10:16:41*przmk joined #nim
10:16:43*przmk quit (Client Quit)
10:52:35FromDiscord<narimiran> For those who haven't switched yet to Nim 2.2, here's a new 2.0 patch release — Nim 2.0.12:↵https://nim-lang.org/blog/2024/11/01/nim-2012-released.html
11:19:27FromDiscord<zumi.dxy> damn we really on a roll huh
11:45:50*ntat quit (Quit: Leaving)
12:10:04*alexdaguy quit (Quit: WeeChat 4.4.3)
12:41:22FromDiscord<cb314> bobbym
12:45:47FromDiscord<TӨMΛ ☠> sent a long message, see https://pasty.ee/NZtStkEv
12:45:57FromDiscord<TӨMΛ ☠> (edit) "https://pasty.ee/kUhJukYh" => "https://pasty.ee/DaosdiMr"
12:46:41FromDiscord<TӨMΛ ☠> (edit) "https://pasty.ee/xpcEOHXZ" => "https://pasty.ee/eSzZoAEk"
14:58:36FromDiscord<victormaster_> # https://discord.gg/N8MFyX8Yfx @everyone
15:12:47FromDiscord<odexine> xd nice bot
16:12:46*ntat joined #nim
17:00:47*GnuYawk quit (Quit: The Lounge - https://thelounge.chat)
17:01:07*GnuYawk joined #nim
18:01:52FromDiscord<TFed> sent a code paste, see https://play.nim-lang.org/#pasty=fENtvgDg
18:05:13FromDiscord<TFed> i can't `nimble build`, probably because i'm trying to convert int to string (or something)
18:09:06Amun-Rait's the cast not the conversion
18:17:53FromDiscord<TFed> what's cast 😅?
18:17:53*Deadm0th quit (Remote host closed the connection)
18:18:45FromDiscord<TFed> what cast 😅?
18:18:53FromDiscord<TFed> what is the cast 😅?
18:25:43*lucasta joined #nim
18:38:42FromDiscord<solitudesf> In reply to @TFed "i can't `nimble build`,": in this case it doesn't even matter, you can't use `re` at compiletime
18:49:10*coldfeet quit (Remote host closed the connection)
19:04:05FromDiscord<demotomohiro> @TFed https://nim-lang.org/docs/manual.html#statements-and-expressions-type-casts↵> Type casts are a crude mechanism to interpret the bit pattern of an expression as if it would be of another type. Type casts are only needed for low-level programming and are inherently unsafe.
19:09:59FromDiscord<graveflo> sent a code paste, see https://play.nim-lang.org/#pasty=dFEQAkdP
19:16:55FromDiscord<leorize> it's supposed to be empty, yes
19:17:07FromDiscord<leorize> move meant that you "stole" `s` memory
19:17:31FromDiscord<graveflo> sure but isn't it supposed to work like `sink` where it still retains a copy if you use it after you move it?
19:17:44FromDiscord<leorize> nope, it's an invalidating move
19:18:14FromDiscord<leorize> move is what you use to override that sink quirk
19:18:58FromDiscord<graveflo> interesting... I'm curious what the usefulness of it is. It would be better if it's a compile time error doing what I posted. uninitialized memory isn't usually desirable
19:19:04FromDiscord<guzba8> prevents copies
19:19:07FromDiscord<guzba8> its hugely useful
19:19:37FromDiscord<guzba8> why would what you posted be a compile time error? makes no sense
19:20:01FromDiscord<guzba8> you literally explicitly asked to move the memory to a discard
19:20:20FromDiscord<leorize> it depends™
19:20:31FromDiscord<TFed> yup, turns out, that i broke another package by storing `re` in `const` instead of `var`↵(@solitudesf)
19:20:34FromDiscord<leorize> but for the most part nim does not host a linear type system
19:20:35*lucasta quit (Quit: Leaving)
19:20:43FromDiscord<graveflo> right... so using it afterwards is arguably invalid
19:20:43FromDiscord<leorize> so stuff like this are expected
19:21:13FromDiscord<leorize> this is more akin to Rust's `mem::take` than a traditional move
19:22:13FromDiscord<graveflo> sink seems to do this just fine in a more sane way. Why use `move` that just puts the "use after move" scenario in a state of uninitialize memory rather then it's current state
19:22:35FromDiscord<fabric.input_output> more like c++ `std::move`
19:24:13FromDiscord<graveflo> Just trying to get the rational of what to use this for. iirc `sink` will not make a copy as long as you do not mutate the object after it was sunk (barring situations where a copy is inevitable)
19:25:05FromDiscord<graveflo> and by that I mean mutate it in the calling context after giving it away. Not the context where is was given to
19:26:11FromDiscord<guzba8> sent a code paste, see https://play.nim-lang.org/#pasty=TQXOBBbT
19:26:22FromDiscord<guzba8> in this case `int` would be something huge like a big string
19:28:00FromDiscord<graveflo> sent a code paste, see https://play.nim-lang.org/#pasty=UhEHuseQ
19:28:22FromDiscord<guzba8> nope you need to explicitly steal it from the big seq
19:28:33FromDiscord<guzba8> i just did add(i) but it really is add(move bigseq[i])
19:28:51FromDiscord<guzba8> it partially works
19:30:10FromDiscord<guzba8> sink is good to but its too flaky, move lets you be explicit
19:30:31FromDiscord<graveflo> I see what you are getting at with that
19:31:14FromDiscord<guzba8> sent a code paste, see https://play.nim-lang.org/#pasty=RJHTwPai
19:31:21FromDiscord<guzba8> it should be but ive not tested that
19:31:27FromDiscord<graveflo> there is the issue of bigseq having a hole in it after that happens, which does seem to be linked to this type of situation in general, but eh
19:32:11FromDiscord<graveflo> sent a code paste, see https://play.nim-lang.org/#pasty=AqXygjNi
19:32:44FromDiscord<graveflo> well it always sinks it.. question is, is nim smart enough to know that resetting the value ensures that it is not mutated after the sink
19:35:19FromDiscord<graveflo> sent a code paste, see https://play.nim-lang.org/#pasty=MAYzLGAA
19:38:21FromDiscord<guzba8> i look at this and still have no idea if it avoids a copy
19:38:48FromDiscord<guzba8> but this is the right thing to check ofc
19:43:14FromDiscord<graveflo> sent a code paste, see https://play.nim-lang.org/#pasty=riqrZlxd
19:43:25FromDiscord<graveflo> (edit) "https://play.nim-lang.org/#pasty=oAXXgyVI" => "https://play.nim-lang.org/#pasty=SmjoUVnb"
20:18:14*ntat quit (Quit: Leaving)
20:28:12*Deadm0th joined #nim
22:03:42*lucasta joined #nim
22:46:45*Jjp137 quit (Quit: Leaving)
22:47:55*Jjp137 joined #nim
23:07:58FromDiscord<Clonkk> Is there a way to automatically import from C header identifier that can either be an enum or a macro pointing to that enum, without having to re-calculate the enum value
23:11:30FromDiscord<Elegantbeef> Futhark?
23:14:09FromDiscord<Clonkk> Wouldn't that gives me all the symbol from the headers ?
23:14:21FromDiscord<Clonkk> I guess dead code will be eliminated on compilation
23:21:59*Jjp137 quit (Ping timeout: 260 seconds)
23:22:19*Jjp137 joined #nim
23:38:50FromDiscord<leorize> unless your header is gigantic (which would meant slower compile time), I'd say that the dead code wouldn't be too much of an issue
23:47:02FromDiscord<pmunch> In reply to @Clonkk "Wouldn't that gives me": Yes it would, but as you mention dead code elimination makes this a non issue,