<< 22-12-2024 >>

00:18:42*beholders_eye quit (Ping timeout: 265 seconds)
02:48:45*alexdaguy joined #nim
03:38:33*ftajhii quit (Read error: Connection reset by peer)
03:41:59*ftajhii joined #nim
03:55:38*SchweinDeBurg quit (Quit: WeeChat 4.6.0-dev)
06:03:28*SchweinDeBurg joined #nim
07:30:26FromDiscord<k0ts> sent a code paste, see https://play.nim-lang.org/#pasty=LdVIRrKF
07:35:03FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=qPumWgBm
07:35:04FromDiscord<heysokam> In reply to @k0ts "thoughts on this behavior?": my first reaction:↵> that should be `approxEqual` with an epsilon
07:35:30FromDiscord<heysokam> (edit) "that" => "`==`"
07:36:16FromDiscord<k0ts> In reply to @heysokam "my first reaction: >": I think float.high is by definition exactly Inf. the surprising behavior is on the third line
07:36:22FromDiscord<Elegantbeef> At the very least `inf -> int` is a value so useless it's fine 😄
07:36:58FromDiscord<Elegantbeef> I'd imagine a overflow error though
07:37:09FromDiscord<k0ts> yes, i expected an overflow at the point of int conversion
07:37:17FromDiscord<k0ts> instead I got one later when trying to take the abs of int.low
07:39:26FromDiscord<k0ts> In reply to @demotomohiro "It seems no overflow": it's strange that it doesn't even just go to int.high. it goes to int.low for some reason. is this some C backend stuff?
07:42:13FromDiscord<Elegantbeef> Nim probably just uses the C behaviour for `(uint64_t)(inf)`
07:55:16FromDiscord<k0ts> sent a code paste, see https://play.nim-lang.org/#pasty=vdXpNErD
07:56:17FromDiscord<k0ts> (edit) "https://play.nim-lang.org/#pasty=qDUurUSi" => "https://play.nim-lang.org/#pasty=WCbguTyv"
08:06:57FromDiscord<TFed> what to use for parsing web pages?
08:07:05FromDiscord<TFed> [echo loadHtml("mydirty.html")](https://nim-lang.org/docs/htmlparser.html)
08:07:06FromDiscord<TFed> ?
08:07:26FromDiscord<TFed> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1320301571157786646): https://nim-lang.org/docs/htmlparser.html
08:07:34*ntat joined #nim
08:09:42FromDiscord<TFed> I want to check what app platform is running... like invidious, forgejo, or for instance github on github.com
08:09:56FromDiscord<TFed> I want to check what app platform is running... like invidious, forgejo, or for instance github.com has github
08:09:59FromDiscord<k0ts> htmlparser is fine, chame is fine too
08:10:43FromDiscord<TFed> chame? is there links?
08:10:49FromDiscord<k0ts> https://git.sr.ht/~bptato/chame
08:10:52FromDiscord<k0ts> https://github.com/nim-lang/htmlparser
08:11:02FromDiscord<k0ts> https://www.google.com/search?q=chame+nim
08:11:15FromDiscord<TFed> thanks
08:12:11FromDiscord<k0ts> and then https://github.com/GULPF/nimquery or https://github.com/Niminem/CSS3Selectors respectively for CSS selectors
08:56:44*xaltsc joined #nim
10:46:16*coldfeet joined #nim
11:18:25FromDiscord<xtrayambak> Is there a way to export pragmas? :P
11:20:52Amun-Rano
11:21:28Amun-Rawell, only custom ones made with template
11:26:22FromDiscord<xtrayambak> In reply to @k0ts "htmlparser is fine, chame": chame is nice when you want a browser-grade HTML5 parser
11:26:33FromDiscord<xtrayambak> htmlparser works fine for menial scraping tasks from personal experience
11:48:42FromDiscord<fabric.input_output> In reply to @xtrayambak "Is there a way": doesn't `export the_pragma` work?
11:48:58FromDiscord<xtrayambak> Nope, it's only for templates apparently
11:52:58FromDiscord<pmunch> You could make a macro that adds the pragmas though. Macros can be called as pragmas
11:57:21FromDiscord<xtrayambak> In reply to @pmunch "You could make a": Fair, I should try that
12:34:07*alexdaguy quit (Quit: w)
12:57:39FromDiscord<dawidek.2137> is there any reason asynchttpserver's serve wants the callback to be gcsafe?
13:40:58FromDiscord<odexine> all async functions must be gcsafe
14:01:35FromDiscord<dawidek.2137> because someone might send a future to another thread?
14:02:19FromDiscord<dawidek.2137> it's not 100% clear it's safe to tell to compiler to shut up about it
14:03:08FromDiscord<dawidek.2137> also is there a pattern matching library that "everyone uses"
14:04:12*nils` quit (Ping timeout: 252 seconds)
14:20:30FromDiscord<k0ts> No, there isn't
14:37:32FromDiscord<user2m> is there an asyncExecCmd
14:41:33*nils` joined #nim
14:50:43FromDiscord<dawidek.2137> How can you bundle resources into the produced binary?↵I assume simple constants are a bad idea because everything will be loaded into RAM at startup
14:52:55FromDiscord<whorf> sent a code paste, see https://play.nim-lang.org/#pasty=zsMXOIrA
14:53:16FromDiscord<user2m> In reply to @dawidek.2137 "How can you bundle": what resources specifically?
14:54:05FromDiscord<dawidek.2137> In reply to @user2m "what resources specifically?": long strings, binary data etc
14:54:16FromDiscord<user2m> In reply to @dawidek.2137 "long strings, binary data": maybe here https://github.com/genotrance/nimdeps
14:54:18FromDiscord<odexine> yeah
14:54:56FromDiscord<odexine> if you dont want to use that you can use https://nim-lang.org/docs/system.html#staticRead,string
14:56:17FromDiscord<dawidek.2137> In reply to @user2m "maybe here https://github.com/genotrance/nimdeps": thanks, this is what I was looking for
14:56:43FromDiscord<dawidek.2137> In reply to @odexine "if you dont want": that string would be loaded into RAM at startup, right?
14:56:55FromDiscord<odexine> yes
16:15:57*ntat quit (Remote host closed the connection)
16:16:15*ntat joined #nim
16:24:34*ntat quit (Quit: Leaving)
16:37:16*coldfeet quit (Quit: Lost terminal)
16:39:52*ntat joined #nim
16:44:00FromDiscord<abraham> I use the "re" package...
16:55:39FromDiscord<k0ts> I think they meant more this kind of thing
16:55:40FromDiscord<k0ts> https://github.com/haxscramper/hmatching
17:01:38*ntat quit (Quit: Leaving)
17:05:52*ntat joined #nim
17:17:14*ntat quit (Quit: Leaving)
17:23:53*nils` quit (Ping timeout: 244 seconds)
17:49:46*nils` joined #nim
18:07:04*ntat joined #nim
18:33:11FromDiscord<nnsee> In reply to @dawidek.2137 "that string would be": the whole program will be loaded into memory regardless of how you bundle your resources if they're part of the executable
18:34:52FromDiscord<nnsee> okay, this is actually not accurate, since i suppose you can have your data in a different section which you can load on demand
18:35:18FromDiscord<nnsee> but what's the point? you'll eventually need to load it regardless if you're accessing the data
19:02:16*ntat quit (Quit: Leaving)
19:25:22FromDiscord<bostonboston> You may not need to load it every application execution, and you may not need every resource loaded at the same time, but I do think just having seperate files on disk is the better option
19:52:54FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=PifqNmIr
20:03:50FromDiscord<Elegantbeef> You can do `"$projectdir"/globals` but that means you can only ever compile this module with the root
20:04:35*ntat joined #nim
20:05:18FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "You can do `"$projectdir"/globals`": I have quite a complex hierarchy https://media.discordapp.net/attachments/371759389889003532/1320482315679563869/image.png?ex=6769c27d&is=676870fd&hm=e49e18d1adcdf41924552dae7590563a004630a5492801a7e5bffefc297c1dc5&
20:06:11FromDiscord<Elegantbeef> Ok? I did say you could do what you wanted, but that obviously puts a hard limit on how you compile anything
20:06:59FromDiscord<System64 ~ Flandre Scarlet> So it won't work in every file?
20:07:18FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#pasty=ELSikWmO
20:07:47FromDiscord<Elegantbeef> No
20:08:00FromDiscord<Elegantbeef> That is a very pointless feature to have in a static typed language
20:08:31FromDiscord<Elegantbeef> It'll work in ever file, the issue is that if you want to compile one of these modules standalone `$projectDir` is the main module's directory
20:08:48FromDiscord<Elegantbeef> Or if you import it from another project
20:08:59FromDiscord<System64 ~ Flandre Scarlet> Oh alright, makes sense
20:10:09FromDiscord<System64 ~ Flandre Scarlet> However, it reports an error while there is nothing wrong https://media.discordapp.net/attachments/371759389889003532/1320483537928847390/image.png?ex=6769c3a0&is=67687220&hm=f4cd4f635be3532da17e18ba4f99bc173f59abd6b1d9493d785b6048a4a0f109&
20:10:57FromDiscord<Elegantbeef> Your nimsuggest is not looking at the main module
20:11:34FromDiscord<System64 ~ Flandre Scarlet> How to set the main module please?
20:12:30FromDiscord<Elegantbeef> https://github.com/nim-lang/vscode-nim?tab=readme-ov-file#example
20:18:08FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "https://github.com/nim-lang/vscode-nim?tab=readme-o": Like this? https://media.discordapp.net/attachments/371759389889003532/1320485546266460200/image.png?ex=6769c57f&is=676873ff&hm=5ea3e0e8b9bee5a3aa2cfb657c13b201822be0cdb6f54c6b54ab97bde8cf31ac&
20:18:20FromDiscord<Elegantbeef> Why ask when you can test
20:18:51FromDiscord<System64 ~ Flandre Scarlet> Do I have to restart my VS Code?
20:19:20FromDiscord<Elegantbeef> Of course
20:19:21FromDiscord<Elegantbeef> Atleast nimsuggest
20:22:51FromDiscord<System64 ~ Flandre Scarlet> Well, autosuggestion died now
20:24:36*redj quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
20:24:57FromDiscord<System64 ~ Flandre Scarlet> Maybe I should use the nimble file instead?
20:26:15*redj joined #nim
20:28:16FromDiscord<System64 ~ Flandre Scarlet> Yeah seems it was the Nimble file
20:31:38*redj quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
20:32:55*redj joined #nim
20:41:25FromDiscord<System64 ~ Flandre Scarlet> Uh oh I don't think it's normal https://media.discordapp.net/attachments/371759389889003532/1320491406749470822/image.png?ex=6769caf4&is=67687974&hm=2da098f0f7c3f23c6197c516622f3491879841af4f6642dbf53b9e816bdb17a3&
20:42:43FromDiscord<dawidek.2137> nim.project definitely shouldnt be set to the nimble file
20:42:59FromDiscord<dawidek.2137> just the kurumiXP file I guess
20:43:12FromDiscord<dawidek.2137> I leave this field empty and things just work[tm]
20:50:37FromDiscord<System64 ~ Flandre Scarlet> In reply to @dawidek.2137 "just the kurumiXP file": So kurumiXP.nim?
20:55:58FromDiscord<dawidek.2137> that's what I would do
20:56:51FromDiscord<dawidek.2137> but if it's in the src dir you might need to write "src/kurumiXP.nim"
21:02:38FromDiscord<System64 ~ Flandre Scarlet> In reply to @dawidek.2137 "but if it's in": I have the feeling it's still broken↵I try to call knobInteger() but the IDE says it's Error Type
21:45:41*ntat quit (Remote host closed the connection)
22:53:17FromDiscord<.tokyovigilante> Orthogonally, is there any better way to import a C++ library automatically? imgui-nim etc are wrapping older versions of the library, and ideally there'd be a futhark-like mechanism to automatically import C++ as well. Swift's FFI for C/C++ is pretty magic.
22:54:02FromDiscord<Elegantbeef> Well futhark uses libclang so it can always parse C++, be the change you want in the owrld
22:57:01*beholders_eye joined #nim
23:15:40FromDiscord<pmunch> Yeah Futhark is able to parse C++, it just needs the mapping to Nim
23:24:14FromDiscord<spotlightkid> 'evening. If I have a C function, which writes `n` bytes to a `void `, is it safe to pass `s[0].addr` as the pointer, where `var s = newSeqOfCap(n)` ?
23:24:43FromDiscord<spotlightkid> 'evening. If I have a C function, which writes `n` bytes to a `void `, is it safe to pass `s[0].addr` as the pointer, where `var s = newSeqOfCap[byte](n)` ?
23:25:06FromDiscord<Elegantbeef> Yes
23:27:56FromDiscord<spotlightkid> Cool, thx.