<< 28-02-2024 >>

00:16:51*xet7 quit (Ping timeout: 272 seconds)
00:52:33*arkanoid joined #nim
00:56:07arkanoidmh, I'm using "chronos" lib in my project. It compiles and works correctly, but nimsuggest/nimlangserver keeps complaining that "cannot evaluate at compile time: result" in "error "Error", host = server.host, error = result.error". How can I convince nimsuggest that that line is ok?
00:56:25arkanoidsorry, not chronos, but chronicles
00:56:33arkanoid(the logging one)
00:56:58FromDiscord<Robyn [She/Her]> In reply to @arkanoid "mh, I'm using "chronos"": Restart VSC and kill any Nimsuggest processed
00:57:39FromDiscord<Robyn [She/Her]> Unfortunately it's a known bug, should probably report it in case though
00:58:11arkanoidno, it is repeatable. I keep receiving it even after nimlangserver/nimsuggest/vscode restart
01:03:28FromDiscord<Robyn [She/Her]> Hm... Odd then
01:06:57*SchweinD1 quit (Quit: WeeChat 4.3.0-dev)
01:07:23*SchweinDeBurg joined #nim
01:23:25FromDiscord<awesome3434> sent a code paste, see https://play.nim-lang.org/#pasty=ABOCaPrNkvPJ
01:24:16FromDiscord<awesome3434> In reply to @Elegantbeef "Probably best to do": I'm not sure about this, but I think it will lead to the same issue?
01:24:49FromDiscord<Elegantbeef> I don't even know what you're trying to solve
01:25:03FromDiscord<Elegantbeef> I don't use C++ so don't know why it requires an attribute for interop
01:26:14FromDiscord<Elegantbeef> Though with the closure macro you could use `emit` or `codegendecl` to emit your own type
01:28:31FromDiscord<awesome3434> In reply to @Elegantbeef "I don't use C++": Basically I can't put any object that doesn't have the attribute within the function that requires it (which is required for any object that isn't primitive)
01:29:24FromDiscord<Elegantbeef> And you cannot just wrap a Nim object with a C++ object?
01:29:30FromDiscord<awesome3434> Also it's not really much of a library but a custom compiler with own attributes
01:30:05FromDiscord<awesome3434> In reply to @Elegantbeef "And you cannot just": But Nim will still put it's own object within the C++ code, right?
01:30:09FromDiscord<Elegantbeef> Sounds like a CGPU compiler ๐Ÿ˜„
01:30:12FromDiscord<Elegantbeef> Right
01:30:33FromDiscord<awesome3434> In reply to @Elegantbeef "Sounds like a CGPU": To be more precise Cheerp
01:30:38FromDiscord<Elegantbeef> You cannot control the Nim code generation for everything that requires forking the compiler
01:31:20FromDiscord<Elegantbeef> Why do you even need to send closures across a bridge
01:31:34FromDiscord<Elegantbeef> Atleast I assume these attributes generate interop code
01:33:05FromDiscord<Elegantbeef> If this is for JS interop you should just send all your ref objects as `ptr object` and not send closures to the JS side
01:34:49arkanoidis switch("stackTrace", "on") compatible with release mode?
01:35:15arkanoidI'm trying to use https://nim-lang.org/docs/estp.html but all I get is "Entry: 1/1 Calls: 3544/3544 = 100.00% [sum: 3544; 3544/3544 = 100.00%]"
01:36:04FromDiscord<Elegantbeef> Using nimprof is sorta meme as a lot of software ๐Ÿ˜„
01:36:30arkanoidmh, ok, I'll switch to something else then
01:36:39FromDiscord<Elegantbeef> I suggest using hotspot
01:36:53FromDiscord<Elegantbeef> It's a nice gui program built ontop of linux's perf
01:37:27FromDiscord<Elegantbeef> But to use the nim profiler I believe you need `stackTrace` `lineTrace` and `profiler`
01:38:22arkanoidI'm compiling with switch("profiler", "on") and switch("stackTrace", "on")
01:38:47arkanoidthis page https://nim-lang.org/docs/estp.html does not reference lineTrace
01:39:24FromDiscord<Elegantbeef> Yea I played with the profiler briefly to generate a flamegraph
01:39:28FromDiscord<Elegantbeef> So I think you need all three
01:40:44FromDiscord<awesome3434> sent a code paste, see https://play.nim-lang.org/#pasty=FvAHfvPrYbMx
01:40:56arkanoidwell, I'm installing hotspot, now I need to recap how to run perf
01:41:09FromDiscord<Elegantbeef> hotspot runs perf ๐Ÿ˜›
01:41:43FromDiscord<.bobbbob> sent a code paste, see https://play.nim-lang.org/#pasty=PuhbmdveJoti
01:42:47arkanoidcan't run perf as ubuntu makes a mess with kernels
01:43:25FromDiscord<awesome3434> In reply to @Elegantbeef "If this is for": I'm not really sure what you meant by that
01:44:14arkanoidok, recording
01:44:45FromDiscord<Elegantbeef> Why do you need to have the attribute if you don't generate JS code?
01:44:47arkanoidbut I guess I sould compile release but with debug symbols
01:46:36FromDiscord<awesome3434> In reply to @Elegantbeef "Why do you need": Though I have to use DOM API later which makes it inevitable to have it
01:48:17FromDiscord<Elegantbeef> Don't call the dom API ๐Ÿ˜„
01:49:28FromDiscord<awesome3434> In reply to @Elegantbeef "Don't call the dom": Nice tip, thanks
01:49:39FromDiscord<Elegantbeef> Jokes aside we have nim -\> js
01:50:17FromDiscord<awesome3434> Although It doesn't seem to provide any WASM support
01:51:38FromDiscord<awesome3434> (which in my case both are needed)
01:52:09FromDiscord<Elegantbeef> So write frontend in Nim then call that from wasm
01:52:26FromDiscord<Elegantbeef> Maybe speak to @jmgomez though given his UE work he might help
02:02:04FromDiscord<awesome3434> In reply to @Elegantbeef "So write frontend in": Uhh, Cheerp handles everything on it's own, including bridging, so now it'd be quite a nonsense having set-up everything from the bottom in JS, I really thought it could be easily solved with a few lines of code considering Nim is quite a powerful language with lots of comp-time reflections
02:02:25FromDiscord<awesome3434> to set-up
02:06:34arkanoiddo you know how can I compile release but with debug symbols?
02:07:02FromDiscord<Elegantbeef> `--debugger:native`
02:07:27arkanoidthanks
02:12:53arkanoidmh, perf.data generated with --debugger:native is "not readable" according to hotspot
02:15:40arkanoidmy fault, it was a permission problem
02:23:57NimEventerNew thread by sls1005: What will happen if allocation fails?, see https://forum.nim-lang.org/t/11106
02:37:57*Jjp137 quit (Ping timeout: 255 seconds)
02:42:31NimEventerNew Nimble package! rmq_statsd - Pure nim rabbitmq to statsd metrics pusher, see https://github.com/Q-Master/rmq-statsd.nim
02:48:13*Jjp137 joined #nim
02:57:12*jmdaemon joined #nim
04:14:09FromDiscord<dysrakescence> sent a code paste, see https://play.nim-lang.org/#pasty=bMUtswDhCRxt
04:14:31FromDiscord<dysrakescence> right now the content that gets scraped looks like this https://media.discordapp.net/attachments/371759389889003532/1212251461954576384/image.png?ex=65f12827&is=65deb327&hm=fcf6e9c93362953336caaf59421a28950c6d97ef7acc9e0a45b3f8b9010ca827&
04:14:54FromDiscord<leorize> looks like that site requires JS to render
04:15:03FromDiscord<leorize> which means you can't scrape using a simple http client
04:15:55FromDiscord<dysrakescence> I'm new to web scraping but I heard that I would probably need something like a browser header or something?
04:16:10FromDiscord<leorize> for this you don't need headers
04:16:13FromDiscord<leorize> you need a browser
04:17:38FromDiscord<dysrakescence> is there a std library that I can use to scrape the site?
04:17:44FromDiscord<leorize> no
04:18:30FromDiscord<leorize> this is not really a website, it's an application
04:18:58FromDiscord<leorize> there are two paths to this\: either you figure out their API endpoints and use it to obtain the raw data that they use to render their pages
04:21:21FromDiscord<leorize> or just use a headless browser to render the page then download the result
04:31:47FromDiscord<saint._._.> In reply to @dysrakescence "is there a std": use playwright
04:32:13FromDiscord<saint._._.> Oh also you could try readability.js
04:32:31FromDiscord<saint._._.> https://github.com/mozilla/readability
04:32:33FromDiscord<saint._._.> With node
05:02:52NimEventerNew thread by enaaab460: Sending to a channel before opening it doesn't create an error, see https://forum.nim-lang.org/t/11107
05:16:14*azimut quit (Ping timeout: 260 seconds)
05:27:12FromDiscord<dysrakescence> In reply to @leorize "there are two paths": I ended up finding all the information that I needed through browsing the files that the website was hosting and got the json content :)
05:36:45*ntat joined #nim
05:47:35*rockcavera quit (Remote host closed the connection)
06:01:33FromDiscord<Phil (he/him)> Imagine going to sleep and thus doing an avatar - when the world needed him he was nowhere to be found
06:19:22*advesperacit joined #nim
07:09:03*disso-peach joined #nim
07:09:23*m5zs7k quit (Ping timeout: 256 seconds)
07:22:17*m5zs7k joined #nim
07:24:43NimEventerNew thread by dwhall256: ANN: minisvd2nim generates a Nim lib to access ARM CortexM device and registers, see https://forum.nim-lang.org/t/11113
07:27:50*disso-peach quit (Quit: Leaving)
08:08:36*ntat quit (Quit: Leaving)
08:30:56FromDiscord<fosster> folks, is there someone familiar with bittorrent protocol?
08:33:02FromDiscord<fosster> is it the only way btw? because I've seen a kind of tutorial online about it, but nothing elseโ†ต(@Robyn [She/Her])
08:33:34FromDiscord<fosster> I know that there is someone working with wasm backend, something called nimwasm or something
08:33:48FromDiscord<fosster> I know that there is someone building a wasm backend, something called nimwasm or something
08:36:48FromDiscord<fosster> I remember a few years ago when wasm was the new hot thing, people were like "finally JS is dead, get ready for the revolution"...
08:45:57FromDiscord<whisperecean> Is Prologue dead?
10:03:49*ntat joined #nim
10:39:20FromDiscord<nnsee> "dead"?
10:40:31*jmdaemon quit (Ping timeout: 268 seconds)
11:15:31*ntat quit (Quit: Leaving)
11:35:27FromDiscord<whisperecean> I dont see any more commits and there were some issues with it crashing pre nim 2.0
11:59:05*krux02 quit (Quit: Leaving)
12:29:48FromDiscord<ezquerra> sent a code paste, see https://play.nim-lang.org/#pasty=ZhABOUJlWsMc
12:34:28FromDiscord<odexine> yes
12:37:00*ntat joined #nim
12:42:04FromDiscord<im__cynical> Any way I can make the executable smaller than with this? I dont care about preformance loss.โ†ตnim c -d:danger -d:release -d:strip -d:mingw --opt:size --passc=-flto --passl:-s main.nim
12:42:35FromDiscord<ezquerra> sent a code paste, see https://play.nim-lang.org/#pasty=YRSeYZLUXvYW
12:44:10FromDiscord<ezquerra> In reply to @im__cynical "Any way I can": Not an answer to your question, but I believe that when you use `-d:danger` you don't need `-d:release`
12:45:23FromDiscord<im__cynical> In reply to @ezquerra "Not an answer to": Yes, it doenst nag about needing release for better preformance when I use danger
12:55:43FromDiscord<odexine> In reply to @ezquerra "Umm, when I do": seems like in your case specifically it isnt allowed, i was thinking about another case
12:55:57*azimut joined #nim
12:57:21FromDiscord<odexine> well in this case id say use overloading instead...
12:59:00FromDiscord<ezquerra> OK, thank you
13:51:13*rockcavera joined #nim
14:11:45FromDiscord<niggergooner69> hello
14:11:46FromDiscord<niggergooner69> does anyone want to try my library
14:11:49FromDiscord<niggergooner69> its called fuckNiggers
14:11:57FromDiscord<niggergooner69> does anyone want to try my fuckNiggers library for nim
14:12:44*FromDiscord quit (Remote host closed the connection)
14:13:22*FromDiscord joined #nim
14:39:28NimEventerNew thread by MauroG: Using NiGUI, open a second window from main window, see https://forum.nim-lang.org/t/11118
15:15:51*ntat quit (Remote host closed the connection)
15:19:01*ntat joined #nim
17:01:03*advesperacit quit (Ping timeout: 255 seconds)
17:17:40*ntat quit (Quit: Leaving)
17:21:19*ntat joined #nim
17:43:39*advesperacit joined #nim
17:44:08Zevvat least no one here is feeding the trolls
17:53:14*junaid_ joined #nim
18:12:14*disso-peach joined #nim
18:29:40*FromDiscord quit (Remote host closed the connection)
18:29:53*FromDiscord joined #nim
19:06:45*Jhonny2x4 joined #nim
19:55:52FromDiscord<awesome3434> sent a code paste, see https://play.nim-lang.org/#pasty=YNoWWnljkOob
19:57:55*ntat quit (Quit: Leaving)
20:01:56FromDiscord<awesome3434> sent a code paste, see https://play.nim-lang.org/#pasty=DqzGLtoBxUNl
20:03:01FromDiscord<awesome3434> Which produces the same error, though the good news is that the macro has somewhat control of it and doesn't spew anything unwanted out of it
20:06:00FromDiscord<demotomohiro> Adding if that `nimZeroMem` causes compile error, adding `{.noinit.}` pragma to `p` might remove `nimZeroMem`.
20:06:19FromDiscord<demotomohiro> (edit) "Adding if" => "If"
20:08:11FromDiscord<awesome3434> sent a code paste, see https://play.nim-lang.org/#pasty=rRYKjvciHvex
20:12:23FromDiscord<djazz> {.push genericjs.} before? what does your macro do?
20:13:08FromDiscord<djazz> push maybe only work for internal pragmas tho
20:13:10FromDiscord<awesome3434> sent a code paste, see https://play.nim-lang.org/#pasty=ULPHBxhrQxLY
20:13:15FromDiscord<awesome3434> In reply to @djazz "push maybe only work": Yeahh ik
20:14:08FromDiscord<djazz> that macro needs to be recursive
20:14:14FromDiscord<djazz> try loop child nodes?
20:14:21FromDiscord<djazz> maybe
20:14:38FromDiscord<djazz> i just coming up with random ideas
20:17:07FromDiscord<awesome3434> sent a code paste, see https://play.nim-lang.org/#pasty=CocqsuuNftTF
20:17:45FromDiscord<awesome3434> It's just the code isn't there when the macro tries to reach it
20:17:53FromDiscord<awesome3434> (edit) "It's just the code isn't there ... when" added "yet"
20:17:58FromDiscord<djazz> i wonder if you can generate a c++ macro that does the same thing but after nim's output
20:20:31FromDiscord<djazz> with some {.emit.} magic haha
20:21:07FromDiscord<djazz> can you modify the generated C code manually and add the attributes, does it work then?
20:21:16FromDiscord<djazz> to see if its actually possible
20:25:39FromDiscord<djazz> It would also be interesting to look at decompiled wasm module how its calling across and generating code
20:25:53FromDiscord<djazz> Or the post-attribute output
20:26:12*gst joined #nim
20:31:30*junaid_ quit (Remote host closed the connection)
20:32:01FromDiscord<awesome3434> sent a code paste, see https://play.nim-lang.org/#pasty=FgcNFBGqDGBh
20:32:12FromDiscord<awesome3434> (edit) "https://play.nim-lang.org/#pasty=HYijYmeYEtNj" => "https://play.nim-lang.org/#pasty=HdyWROKURLbm"
20:33:00FromDiscord<djazz> hmm
20:33:48FromDiscord<djazz> isnt memset wrapped when it gets compiled to js? like emscripten?
20:34:05FromDiscord<awesome3434> Emscripten is WASM only though
20:34:22FromDiscord<awesome3434> It has no access to JS env
20:34:50FromDiscord<awesome3434> At least not in the way that Cheerp has
20:35:03*def- quit (Quit: -)
20:35:14*def- joined #nim
20:36:49FromDiscord<awesome3434> In reply to @djazz "isnt memset wrapped when": It might be supported by JS side too, but I don't think it's safe enough to be used by Nim
20:37:15FromDiscord<awesome3434> Haven't tested that yet tho
20:38:43termerHow do people compile Nim to wasm these days
20:39:39FromDiscord<Elegantbeef> emcc or wasi-sdk
20:39:44FromDiscord<Elegantbeef> Though you can also use clang directly
20:40:31termerI mean how do you set it up to use that
20:40:39termerI know of emscripten
20:40:54FromDiscord<Elegantbeef> https://github.com/beef331/wasm3/blob/master/wasmsources/config.nims
20:41:47FromDiscord<Elegantbeef> If you use clang directly you need to set the linker to wasm-ld or w/e it's called
20:41:49termerThis could probably be made an official build target fairly easily
20:42:00FromDiscord<Elegantbeef> It's all just fiddling with configs so yea
20:42:39FromDiscord<Elegantbeef> Should just be forking the default compiler config for `defined(emscripten)`
20:42:46FromDiscord<Elegantbeef> then you should be able to do the same as `-d:mingw` on linux
20:42:59termerThat would be really beneficial to do
20:43:07termerI don't think Araq likes wasm for some reason though
20:43:29FromDiscord<Elegantbeef> Would also be nice to get a `-d:clangwasm` ๐Ÿ˜„
20:43:34termerYeah
20:43:39termerI think using the JS target when you're building something for modern browsers when you could just use wasm
20:43:39FromDiscord<Elegantbeef> Since most people have clang in their path
20:44:35termerwhat the fuck is "quirky" for --exceptions
20:44:41termerreading the compiler user guide right now
20:44:51termerI thought goto exceptions were made the default for some reason
20:45:51*def- quit (Quit: -)
20:46:57FromDiscord<Elegantbeef> It does seem like cheerp support makes some sense in that regard but meh webdev is silly
20:46:57FromDiscord<Elegantbeef> goto is default with arc/orc
20:46:57FromDiscord<Elegantbeef> quirky is "we don't handle exceptions"
20:48:01*def- joined #nim
20:49:41termerLOL why is it an option
20:49:43FromDiscord<Elegantbeef> iirc the way it works is only blocks with try excepts actually generate exception checks in code
20:49:49termerand why is it named quirky instead of none or noop
20:50:01termeroh, so it's manual
20:50:08termerHow do you know that
20:50:40FromDiscord<Elegantbeef> https://play.nim-lang.org/#pasty=IcduaMrGooOG can confirm it's only explicit blocks
20:50:47FromDiscord<Elegantbeef> I know cause uhhh
20:51:26FromDiscord<Elegantbeef> You can also apply it to specific procs if you wish with the quirky pragma
20:51:45*krux02 joined #nim
20:51:47termer"I know cause uhhh" I actually wanna know how you know about this undocumented feature lol
20:52:05FromDiscord<Elegantbeef> I read it somewhere in the year 1993
20:52:20termerdude
20:52:27termerwhat's up with your insane esoteric Nim knowledge
20:52:55FromDiscord<Elegantbeef> I have a great skill for retaining knowledge
20:53:00FromDiscord<Elegantbeef> Whether it's useful is another thing
20:53:44FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/pull/22691 think I first seen quirky here really
20:54:33FromDiscord<grumblygibson> Anyone use `nimporter`? The `setup.py` as in the README specifies variables and functions that don't exist in `nimporter.py` anymore. Even just a link to a working project would be great.
21:05:13*xet7 joined #nim
21:09:09FromDiscord<v_e_c_k> sent a long message, see https://pasty.ee/yhpBBbjliAKE
21:09:53FromDiscord<v_e_c_k> (edit) "https://pasty.ee/nTdjviiGzGoN" => "https://pasty.ee/DhcyusbPfojF"
21:09:54FromDiscord<Elegantbeef> Referring to chatgpt is where you went wrong
21:10:01FromDiscord<Elegantbeef> What's the glibc of your system vs. target
21:10:12FromDiscord<Elegantbeef> Ah you're on mac
21:10:39FromDiscord<Elegantbeef> Best way to cross compile Nim is to use zigcc
21:12:30FromDiscord<v_e_c_k> zig? i've experimented with that, too -- it and Go seem to cross-compile effortlessly (experimenting with Rust -- the CentOS trick worked, IIRC) -- so zigcc -- I can look for info, but have any favorite links?
21:13:02FromDiscord<Elegantbeef> `nim c -d:release --cc:clang --clang.exe:zigcc --clang.linkerexe:zigcc --passC="-target x86_64-linux-gnu.2.19" --passL="-target x86_64-linux-gnu.2.19"` should work
21:13:39FromDiscord<Elegantbeef> there is a nimble package named `zigcc` you can install and then also install the zig compiler
21:13:40*def- quit (Quit: -)
21:14:00FromDiscord<v_e_c_k> thx so much for the tip!
21:14:18FromDiscord<Elegantbeef> Then that should work to compile to a linux build that depends on 2.19 glibc
21:14:31FromDiscord<Elegantbeef> If you want to target musl you can do that aswell swapping `gnu....` with `musl`
21:14:53*def- joined #nim
21:15:16FromDiscord<Elegantbeef> If you want to see valid targets you can do `zig targets`
21:15:24FromDiscord<Elegantbeef> There are a lot
21:15:51FromDiscord<Elegantbeef> I suppose you should also have `--os:linux` given you're on mac
21:18:11FromDiscord<Elegantbeef> If you don't want to use zig you could follow something like https://mcilloni.ovh/2021/02/09/cxx-cross-clang/
21:22:44*jmdaemon joined #nim
21:24:45*gst quit (Ping timeout: 250 seconds)
21:27:54FromDiscord<awesome3434> sent a code paste, see https://play.nim-lang.org/#pasty=FUpyQhCwTsCL
21:32:04FromDiscord<djazz> hmm
21:32:46FromDiscord<v_e_c_k> In reply to @Elegantbeef "Then that should work": The zig suggesion worked! Thank you _so_ much! โ†ตโ†ต(keywords here for anyone searching: #cross-compilation #mac-to-linux)
21:33:16FromDiscord<djazz> using zig for cross compile is really cool
21:33:59FromDiscord<djazz> it comes with all the headers needed
21:35:21FromDiscord<awesome3434> In reply to @djazz "i wonder if you": However this is still a thing, nothing that I'm aware of worked on it
21:36:50*gst joined #nim
21:56:54FromDiscord<Elegantbeef> @v_e_c_k just remember that the `2.19` is the glibc version so older OS require older glibc
22:10:33*disso-peach quit (Quit: Leaving)
22:21:05*gst quit (Ping timeout: 250 seconds)
22:21:17*rockcavera quit (Read error: Connection reset by peer)
22:21:37*rockcavera joined #nim
22:21:37*rockcavera quit (Changing host)
22:21:37*rockcavera joined #nim
22:32:08*gst joined #nim
23:01:45*advesperacit quit ()
23:43:31arkanoiduser nickysn on github just found the root of the problem that has been haunting nim+nimsuggest+nimlangserver for YEARS. And the cause seems to be choosenim + shims. https://github.com/nim-lang/langserver/issues/184#issuecomment-1969415140
23:44:13arkanoidI see the light!
23:44:13FromDiscord<saint.___.> That seems promising
23:44:57FromDiscord<Elegantbeef> lol
23:45:30FromDiscord<Elegantbeef> That's crazy silly that it's the culprit
23:48:24arkanoidmy initial tests seems to prove that
23:48:44arkanoidand I know this problem so well that I have a global keyboard shortcut that calls "kill nimlangserver"
23:51:12*gst quit (Quit: Client closed)
23:53:30arkanoidhow many people use choosenim for running nim+nimsuggest? How is possible that this issue went unseen for so long time?
23:54:19FromDiscord<Elegantbeef> Many people use choosenim
23:54:26FromDiscord<Elegantbeef> Infact I use choosenim and nimlangserver(with kate)
23:56:17arkanoidmaybe the issue is due to how vscode nim extension deals with choosenim shims