<< 23-05-2022 >>

00:07:46*noeontheend joined #nim
00:12:26NimEventerNew thread by Jwatson-CO-edu: Building Nim + Nimble on Ubuntu 22, "could not import: SSL_get_peer_certificate", see https://forum.nim-lang.org/t/9168
00:59:37*noeontheend quit (Ping timeout: 244 seconds)
01:07:02*vicfred quit (Quit: Leaving)
02:02:17*noeontheend joined #nim
02:03:06FromDiscord<morgan> been working on a pixel art upscaler, it's now like 900 lines long. i think i need to break it up into a few files
02:03:26FromDiscord<morgan> 1.5x scaling that looks nice is hard
02:04:35FromDiscord<morgan> next im going to try using a DCT of the input 2x2 and some pixels around it (haven't decided on 4x4, 6x6, or 8x8) to sample the new 3x3 from
02:04:53FromDiscord<morgan> and then quantizing to the palette
02:05:24FromDiscord<morgan> eventually im gonna make a cli app from it using my cli input parser framework thing, tho i think i gotta do some more on that before it's done
02:22:55*kayabaNerve quit (Ping timeout: 260 seconds)
02:25:54*rockcavera joined #nim
02:25:54*rockcavera quit (Changing host)
02:25:54*rockcavera joined #nim
02:54:42FromDiscord<morgan> ok so following on from #internals, does the compiler have any special treatment for range?
02:55:01FromDiscord<Elegantbeef> Yes it does
02:56:14FromDiscord<Elegantbeef> But i mean you can get compile time and runtime checks with distincts
02:56:23FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/NG3
02:56:59FromDiscord<Elegantbeef> Though they're not implicit conversions
02:57:06FromDiscord<Elegantbeef> But you can make a converter for your specific Factor
02:57:06*noeontheend quit (Ping timeout: 272 seconds)
02:57:14FromDiscord<morgan> right
02:59:17FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Yps
03:00:47FromDiscord<Elegantbeef> A reason that ranges are done in the compiler is the implicit conversion and also the nice type syntax
03:01:08FromDiscord<Elegantbeef> Like you can do `var a: 0..1` and there is no way to do that without the compiler support
03:02:12FromDiscord<morgan> yeah
03:03:08FromDiscord<morgan> `var b: 2x3` 👀
03:14:55FromDiscord<morgan> tempted to clone the compiler and poke around and see if i can get it working with `factor[2, 3]` instead of `Factor[[2, 3]]`, and add 2x3x5 etc for another way of encoding it
03:15:08FromDiscord<morgan> even if just for fun
03:15:28FromDiscord<Elegantbeef> It's not an easy task
03:15:34FromDiscord<morgan> i know
03:15:43FromDiscord<Elegantbeef> The compiler is not something very simple
03:15:54FromDiscord<Elegantbeef> Easier to use a macro to do it
03:15:59FromDiscord<morgan> yeah i was already poking around in the files
03:30:13FromDiscord<morgan> i think i’m gonna try and figure out all the syntax variations first
03:46:14*vicfred joined #nim
04:55:11*vicfred quit (Quit: Leaving)
05:20:57FromDiscord<sushie> sent a code paste, see https://play.nim-lang.org/#ix=3YpH
05:21:18FromDiscord<sushie> (edit) "https://play.nim-lang.org/#ix=3YpH" => "https://play.nim-lang.org/#ix=3YpI"
05:21:34FromDiscord<Yardanico> this is invalid code anyway, but yes, the compiler should show a proper error
05:21:36FromDiscord<sushie> (edit) "https://play.nim-lang.org/#ix=3YpI" => "https://paste.rs/7yo"
05:21:52FromDiscord<Yardanico> `const` is for compile-time constants
05:21:58FromDiscord<Yardanico> why do you want a `const` proc?
05:22:12FromDiscord<Yardanico> if you want to run it at compile-time, then you can just define a normal proc and call it in a `static` block
05:24:32FromDiscord<Yardanico> The difference between `var`/`let`/`const` in Nim is not the same as in some other languages. `var` means that the variable is created during runtime and is mutable, `let` - also created during runtime, and immutable (the variable itself, not its underlying data), `const` - a variable is created during compile time and is immutable
05:28:52FromDiscord<sushie> sent a code paste, see https://play.nim-lang.org/#ix=3YpJ
05:29:01FromDiscord<sushie> the above is generated as a macro
05:29:07FromDiscord<sushie> (edit) "as" => "using" | "macro" => "macro"
05:29:25FromDiscord<sushie> (edit) "https://play.nim-lang.org/#ix=3YpJ" => "https://play.nim-lang.org/#ix=3YpK"
05:29:28FromDiscord<Yardanico> why won't it let you call it if you make it a normal proc and not a `const`?
05:29:44FromDiscord<sushie> (edit) "https://play.nim-lang.org/#ix=3YpK" => "https://play.nim-lang.org/#ix=3YpL"
05:30:21FromDiscord<Yardanico> i just don't quite get what this code does, sorry
05:36:49FromDiscord<sushie> sent a code paste, see https://paste.rs/ZeO
05:37:11FromDiscord<sushie> (edit) "https://play.nim-lang.org/#ix=3YpN" => "https://play.nim-lang.org/#ix=3YpM"
05:39:03FromDiscord<Elegantbeef> What version doesnt work?
05:41:10FromDiscord<sushie> sent a code paste, see https://play.nim-lang.org/#ix=3YpP
05:41:16FromDiscord<sushie> but if it has an argument, it runs fine
05:41:53FromDiscord<sushie> (edit) "but if ... it" added "you give" | removed "has" | "argument," => "parameter/argument,"
05:42:17*kayabaNerve joined #nim
05:42:32FromDiscord<Elegantbeef> It's a compiler bug that's quite odd
05:48:43FromDiscord<ripluke> can i use nim to get images in a terminal
05:49:04FromDiscord<Elegantbeef> Yes, now is there a wrapped API for it probably not
05:49:24FromDiscord<ripluke> how
05:49:30FromDiscord<Elegantbeef> https://sw.kovidgoyal.net/kitty/graphics-protocol/
05:50:00FromDiscord<Yardanico> https://github.com/jesvedberg/tpix for kitty graphics protocol, idk about other terminal emulators
05:50:09FromDiscord<ripluke> thats just for kitty, i was thinking something like w3m
05:50:25FromDiscord<Yardanico> so you mean pseudographics?
05:51:33FromDiscord<ripluke> nah like w3m can show images
05:51:54FromDiscord<Yardanico> just check how w3m does it, easy :P
05:52:10FromDiscord<Yardanico> "Best i understand you need to use a xterm derived terminal for this to work, because the sub-program used by w3m for this draws over the terminal window to make things happen."
05:52:16FromDiscord<Yardanico> also this sounds really hacky and not a good way to do things
05:52:17FromDiscord<Elegantbeef> > w3m and überzug both rely on x11 to draw an image in a subwindow. It is highly unlikely that either of the two can be made to work in Terminal without also modifying the tools themselves.
05:52:33FromDiscord<Elegantbeef> It doesnt render it in the window it renders a hidden window where the image should be
05:52:36FromDiscord<Yardanico> yep
05:57:17FromDiscord<ripluke> oh
05:57:19FromDiscord<ripluke> rip
05:57:45FromDiscord<Elegantbeef> Terminal emulators generally just emulate terminals and terminals of course couldnt display images
06:07:06*crem quit (*.net *.split)
06:07:07*euantorano quit (*.net *.split)
06:07:24*crem joined #nim
06:08:18*euantorano joined #nim
06:18:17*PMunch joined #nim
06:18:30*cornfeedhobo quit (*.net *.split)
06:18:31*tinystoat quit (*.net *.split)
06:19:27*tinystoat joined #nim
06:22:42FromDiscord<Phil> TFW you still use the gnome terminal because you never saw the need to upgrade
06:24:28FromDiscord<Yardanico> i also just use konsole, it works really well
06:24:32*cornfeedhobo joined #nim
06:30:05om3gawhat I don't get. var declared in thread function's scope is thread local by default?
06:30:29FromDiscord<Elegantbeef> What?
06:31:07om3gaI'm asking the variable declared in thread procedure (in nim terms), will be accessible for that procedure only?
06:32:15FromDiscord<Elegantbeef> Safely yes
06:32:35om3gawhy I'm asking that, because something really strange happens, with the code that used to work without any problem before :)
06:32:57FromDiscord<Elegantbeef> I believe you should be able to pass the address to other threads and it can write, but i may be mistaken
06:33:08FromDiscord<Elegantbeef> It's all memory inside of a program so I imagine it's true
06:33:10om3ganow what I did, I used locks (posix mutex), and locked entire procedure
06:33:28om3gaso that helped
06:34:26om3gaI see concurency issues, which are issues more to application logic, not for the runtime
06:36:33om3gaeach thread here has a variable request, which initialized by library, and is a structure in C. By some reason it's content changes
06:36:52FromDiscord<Elegantbeef> Code?
06:37:08om3gaElegantbeef, just a second
06:37:12FromDiscord<Elegantbeef> Does the library you're using support threading?
06:37:23om3gaElegantbeef, sure
06:38:08om3gaI recently asked here couple of times about that, it is old fcgi lib (patched)
06:38:21om3gaI mapped it to nim (from C)
06:39:06om3gamy "mapping" had issues, but all of them are fixed, just a second, I will share the code
06:47:38om3gaElegantbeef: https://drive.google.com/file/d/1Zuh6ekg6-J-MSC_15sXIXOjdYuEkXNQW/view?usp=sharing
06:48:18om3gathis is the "compact" version of the server app
06:49:54*jjido joined #nim
06:51:11om3gawhat happens there, in proc worker, there is var request, which is C struct FCGX_Request. When http pipelined requests are sent to the fcgi app, then that var somehow being affected.
06:52:57FromDiscord<Elegantbeef> Google drive more like gitdrive amirite
06:54:27om3gasorry, I don't know where to upload files nowadays, without registration and sending sms
06:54:51om3gaI don't like Gdrive
06:54:57FromDiscord<Zectbumo> it bugs me when libs have "almost useful" functions. Take io.readLines() for example↵https://nim-lang.org/docs/io.html#readLines%2Cstring%2CNatural
06:55:09FromDiscord<Elegantbeef> Eh most people just host their code on a gitrepo
06:55:15FromDiscord<Elegantbeef> "almostUseful"?
06:55:44FromDiscord<Zectbumo> yeah, like who is going to want `n` lines. what generally we want is to iterate over all the lines
06:55:51FromDiscord<Yardanico> there's `lines` for that
06:55:56FromDiscord<Yardanico> https://nim-lang.org/docs/io.html#lines.i%2Cstring
06:56:09FromDiscord<Zectbumo> and if I don't get the number of lines I want then I can throw EOF if I wanted to
06:56:12FromDiscord<Yardanico> readLines is specifically if you only want to read `n` files from a file
06:56:15FromDiscord<Yardanico> and not all
06:56:25FromDiscord<Zectbumo> who does that?
06:56:34FromDiscord<Elegantbeef> Consider a file format with a header and you want to validate the file 😄
06:56:38FromDiscord<Yardanico> In reply to @Zectbumo "who does that?": if you want to read first 100 lines of 10 GB file
06:56:53FromDiscord<Yardanico> good like doing `"file.txt".readFile.splitLines[0..99]`
06:56:57FromDiscord<Yardanico> (edit) "like" => "luck"
06:57:08FromDiscord<Yardanico> why do you not like `lines` iterator? It's exactly what you're asking for
06:57:20FromDiscord<Zectbumo> I'll use `lines` yes
06:57:21FromDiscord<Yardanico> it's defined for both `File` and `string` (filename)
06:57:22FromDiscord<Elegantbeef> What's the behaviour om3ga?
06:57:38FromDiscord<Elegantbeef> I'm looking at the code now and it seems ok
06:58:09om3gaElegantbeef, in worker procedure, there is var request, with type FCGX_Request
06:58:23om3gait defined in fcgx_lib.nim
06:58:23FromDiscord<Elegantbeef> Also there is a `withLock(lock): echo "Hello"` 😛
06:58:25FromDiscord<Zectbumo> but I was just looking at the readLines (while I needed lines) and saw it pulls it all `n` lines into memory
06:58:55FromDiscord<Yardanico> so do you want the stdlib to be bigger or smaller? :P
06:59:13FromDiscord<Yardanico> In reply to @Zectbumo "but I was just": and of course it will put all lines into memory, since it's a `proc` and returns a seq
06:59:16FromDiscord<Yardanico> not an `iterator`
06:59:35FromDiscord<Elegantbeef> Just to be clear you did setup fastcgi to work with multithreading? Generally libraries need that explicitly
06:59:59om3gaElegantbeef, sure, I used that lib in C before
07:01:19FromDiscord<Zectbumo> In reply to @Elegantbeef ""almostUseful"?": yes almost, as in, just use `lines`. maybe `readLines` came out first and then someone came out and made `lines` because `readLines` was "almost useful, but didn't cut it". for example, PHP had a lot of "almost useful" functions and kept adding substr1() substr2() substr3(). it was just forehead slap after forehead slap
07:01:22om3gamaybe I forgot something, and don't remember (here is more than 10 tasks running with that lib which were written long ago in C). But how I see now, it's not ok
07:01:24FromDiscord<Elegantbeef> Oh om3ga you've got two procs that point to the same procedure
07:01:41om3gaElegantbeef: where?
07:01:45FromDiscord<Elegantbeef> `proc FCGX_InitRequest(): int {.header: "fcgiapp.h", varargs.}` and `proc FCGX_InitRequest(request: ptr FCGX_Request; sock: cint; flags: cint): cint {.header: "fcgiapp.h", varargs.}` go to the same proc, that doesnt seem right
07:02:18om3gaOMG
07:02:24om3gajust a second
07:03:03FromDiscord<Elegantbeef> Where's pmunch to scream "Should've used futhark" 😄
07:03:17FromDiscord<Yardanico> also, is `varargs` really needed here if all arguments are already in the proc definition?
07:03:27FromDiscord<Elegantbeef> It's not
07:03:38FromDiscord<Elegantbeef> They probably just seen it in some C code and thought it was
07:04:08om3gayes. this looks like the reason
07:04:16FromDiscord<Elegantbeef> also you can do `{.push header: "fcgiapp.h".}` `{.pop.}`
07:04:23FromDiscord<Elegantbeef> Dont need to annotate every single proc with the header
07:04:31PMunchOh yeah, Futhark wouldn't mess up like that :P
07:04:32om3gaI used c2nim
07:04:51FromDiscord<Elegantbeef> Fuck the demon is here
07:04:55PMunchMuhahah
07:04:55om3gaand strange thing, it work'd before
07:05:04FromDiscord<Elegantbeef> Anyway well i have the code want me to touch it up a bit? 😛
07:05:21om3gaElegantbeef sure
07:05:22PMunchYou're the one who called me by my true name and summoned me, don't act all surprised now
07:06:25om3gaI spent hours with debugger, with pipelined http requests, it just corrupts request var content
07:06:59FromDiscord<Elegantbeef> Is there any reason for `Shared2` isnt that just a `distinct cint`?
07:07:08om3gacausing segfaults (because Accept_r frees, and re-inits stuff in that struct)
07:07:55om3gaElegantbeef, yeah, fcgi procs need cint
07:08:11FromDiscord<Elegantbeef> So then it's just a distinct cint
07:08:22om3gayes
07:09:09FromDiscord<Elegantbeef> It's not much but https://play.nim-lang.org/#ix=3Yq4
07:09:54FromDiscord<Elegantbeef> Guess that should be `sys[] = Shared2(-1)`
07:10:25FromDiscord<Elegantbeef> Anyway glad to have helped did c2nim cause the issue or you?
07:10:58om3gainteresting, but withLock may not work with that lib
07:11:40FromDiscord<Elegantbeef> I mean it should, but meh
07:11:56om3gaELephantbeef, thank you very much, I will fix imports from C, and verify if everything is ok
07:11:58FromDiscord<Elegantbeef> I have to think about the nine slice i added to my gui system and how to best work with it
07:12:14om3gaThank you!
07:13:31PMunch@Elegantbeef, ooh you're doing nine-slices as well?
07:13:38FromDiscord<Elegantbeef> Yea
07:13:58FromDiscord<Elegantbeef> My game gui is going mostly well
07:14:23PMunchYou can have a look at how I handle them in SDLGamelib: https://github.com/PMunch/SDLGamelib/blob/master/gamelib/ninepatch.nim
07:14:29PMunchMight give you some inspiration
07:14:38FromDiscord<Elegantbeef> It's all in shader
07:14:57FromDiscord<Elegantbeef> simplescreenrecorder-2022-05-23\_01.14.09.mp4 https://media.discordapp.net/attachments/371759389889003532/978194307339157534/simplescreenrecorder-2022-05-23_01.14.09.mp4
07:15:01FromDiscord<Elegantbeef> Present state of my gui if interested
07:15:18*gsalazar joined #nim
07:15:48PMunchDefinitely looks like a game UI :P
07:16:41FromDiscord<Elegantbeef> So rood
07:17:07FromDiscord<Elegantbeef> It actually looks nice without the ugly 9slice
07:17:26FromDiscord<Elegantbeef> simplescreenrecorder-2022-05-21\_19.23.42.mp4 [simplescreenrecorder-2022-05-21_19.23.42.mp4](https://t2bot.io/_matrix/media/r0/download/matrix.org/PnsdWNlZKNDkxaPWcEksAALA)
07:18:26FromDiscord<Bung> @PMunch have you recheck this PR https://github.com/PMunch/nimlsp/pull/125
07:28:35*ltriant_ quit (Ping timeout: 260 seconds)
07:52:47om3gaElegantbeef: no, that not helped unfortunately. I should to verify FCGI man again, maybe it's not the issue with threads at all..
07:53:40FromDiscord<everyone> In reply to @Elegantbeef "simplescreenrecorder-2022-05-21\_19.23.42.mp4 [simp": it looks like it was made in TempleOS
07:55:55FromDiscord<everyone> Guys i want to learn about compilers and language development. Are there any blog posts or videos or guides that can help me get to know them?
07:55:58PMunchom3ga, maybe try with Futhark, at least then you can be fairly certain that the C <-> Nim bindings are sound
07:56:33om3gaPMunch, yeah. Good idea indeed, I will try that right now
07:56:37PMunch@everyone, just have to ask, but is your username just a way to troll the channel with people tagging you (which at least on some platforms tags @everyone :P)
07:56:58FromDiscord<everyone> In reply to @PMunch "<@856412455507984404>, just have to": lol
07:58:13FromDiscord<everyone> i just thought it was funn
07:58:17FromDiscord<everyone> (edit) "funn" => "funni"
07:58:34FromDiscord<everyone> i'll change it if you want me too
07:59:04PMunchI'm on IRC so it doesn't bother me, just wondered if @everyone else gets pinged when I tag you :P
07:59:29FromDiscord<everyone> In reply to @PMunch "I'm on IRC so": no they do't
07:59:34FromDiscord<everyone> (edit) "do't" => "don't"
07:59:47PMunchRight, then feel free to keep it :)
08:00:13FromDiscord<everyone> do you know some source where i could learn about making languages?
08:00:32*dithpri quit (Remote host closed the connection)
08:00:40FromDiscord<Elegantbeef> Crafting interpreters is like the #1 suggested resource
08:00:58*dithpri joined #nim
08:01:43FromDiscord<everyone> In reply to @Elegantbeef "Crafting interpreters is like": guess we have to buy that
08:02:25FromDiscord<Elegantbeef> http://www.craftinginterpreters.com/
08:02:55FromDiscord<everyone> https://craftinginterpreters.com/introduction.html
08:04:24FromDiscord<everyone> is there any book or something related to making programming languages in nim?
08:05:05FromDiscord<Elegantbeef> https://gist.github.com/haxscramper/3562fa8fee4726d7a30a013a37977df6 is a good resource
08:12:03FromDiscord<qb> choosenim fails with `could not import: SSL_get_peer_certificate` on popos. Any ideas?
08:12:25FromDiscord<Elegantbeef> Ubuntu updated openssl and choosenim doesnt support it yet
08:12:57FromDiscord<qb> Oh
08:13:32FromDiscord<Elegantbeef> I've been shouting about flatpak for a few weeks now 😄
08:17:37PMunchUgh, flatpak is just bringing us down to Windows level..
08:17:48FromDiscord<Elegantbeef> How?
08:17:58FromDiscord<Elegantbeef> Are you mistaking it for appimage?
08:18:03PMunchAh, maybe
08:18:28FromDiscord<Elegantbeef> Flatpak is distributed the same as your other software in a nice manager, it's just distro agnostic
08:19:04FromDiscord<Elegantbeef> In other words if it works in one place with flatpak it works everywhere
08:19:06PMunchHmm, so it's just like another separate manager?
08:19:48FromDiscord<Elegantbeef> Yes, i'd much prefer it in the package manager, but i think flatpak solves the issue much more elegantly than relying on X maintainers for Y distros
08:20:33FromDiscord<Elegantbeef> In an ideal world you just setup flatpak on your distro(many do this automatically) and then just `flatpak install choosenim`
08:21:07FromDiscord<Elegantbeef> Or use your GUI if you're one of those and it'd appear in there
08:22:27FromDiscord<Elegantbeef> Appimage is the more windowsy binary image
08:22:53FromDiscord<Elegantbeef> Which i think is sensible for paid proprietary software and non steam games
08:32:06*ltriant joined #nim
08:33:32*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
08:34:19om3gaPMunch, may I ask you, in case if include files are in the system path, should I enter the same /usr/include for both sysPath and path?
08:40:23FromDiscord<Rika> I am pretty sure Flatpak is closer to windows than AppImage.
08:40:59FromDiscord<Rika> Someone has definitely sent this before
08:41:01FromDiscord<Rika> https://ludocode.com/blog/flatpak-is-not-the-future
08:41:03FromDiscord<Elegantbeef> Well appimage's are generally distributed on websites
08:41:15FromDiscord<Elegantbeef> https://theevilskeleton.gitlab.io/2022/05/16/response-to-flatpak-is-not-the-future.html#introduction 😄
08:42:36om3gaPMunch, maybe I'm tired or doing everything wrong but it says Fatal: 'stdarg.h' file not found
08:43:11FromDiscord<Rika> Even with these extra arguments I don’t think I will ever use either Flatpak or Snap
08:43:38FromDiscord<Rika> And if the binary is an AppImage I would extract it and delete the dependencies
08:43:44FromDiscord<Rika> If something doesn’t work I’ll deal with it
08:46:02FromDiscord<Elegantbeef> Yea I mostly try to avoid flatpak, but fragmentation is an issue that needs resolved somewhere for a reduction of work 😄
08:50:30FromDiscord<Rika> Versioning is hard and needs fixing but this isn’t the way
08:58:11FromDiscord<Rika> Ooh the portal argument is nice though
08:58:36FromDiscord<Rika> I don’t know what the original author was thinking with the Flatpak only thing
09:01:36FromDiscord<heinthanth> sent a long message, see http://ix.io/3Yqi
09:01:41FromDiscord<heinthanth> I tried to leak some mem, but not leak at all
09:01:59FromDiscord<Rika> You just did
09:02:09FromDiscord<Rika> How do you know it didn’t leak
09:02:13FromDiscord<Elegantbeef> use `-d:useMalloc`
09:02:18FromDiscord<Rika> He does
09:02:26FromDiscord<Elegantbeef> Oh i'm blind
09:02:27FromDiscord<heinthanth> 0 leaks of 0 total leaked bytes
09:02:42FromDiscord<heinthanth> in C https://media.discordapp.net/attachments/371759389889003532/978221419756421160/Screen_Shot_2022-05-23_at_3.32.37_PM.png
09:03:35FromDiscord<heinthanth> I looked for `free()` call in generated C code. But how nim free that allocated memory. Or `leaks` command on macOS did wrong ...
09:03:49FromDiscord<Rika> Try Valgrind
09:04:18FromDiscord<heinthanth> Ohh ... valgrind does not support later macOS.
09:04:25FromDiscord<Elegantbeef> This is a fools errand Nim doesnt track `ptr`
09:04:35FromDiscord<Rika> It really doesn’t
09:04:43FromDiscord<Elegantbeef> If it's a `ptr` there is no deallocation
09:04:44FromDiscord<Rika> So even if you didn’t disable anything it would have leaked
09:07:41FromDiscord<everyone> how do i split a string using a for loop?
09:08:24FromDiscord<sheerluck> In reply to @uncle jim "how do i split": https://www.rosettacode.org/wiki/Tokenize_a_string#Nim
09:08:38FromDiscord<everyone> In reply to @sheerluck "https://www.rosettacode.org/wiki/Tokenize_a_string#": thanks lizzOS
09:09:08FromDiscord<heinthanth> In reply to @Rika "Try Valgrind": the same on Linux too https://media.discordapp.net/attachments/371759389889003532/978223042553610250/Screen_Shot_2022-05-23_at_3.38.56_PM.png
09:09:37FromDiscord<heinthanth> I was like WTF, how nim deallocate that allocation without `free()`
09:09:42FromDiscord<Elegantbeef> I can say for certainty that memory is not freed, given that `ptr`s are raw C pointers 😄
09:10:07FromDiscord<sheerluck> In reply to @uncle jim "thanks lizzOS": http://www.rosettacode.org/wiki/Category:Nim
09:10:44FromDiscord<everyone> damn who made this site????? Must have taken a lifetime to make it lel
09:10:54FromDiscord<Elegantbeef> I think i see what's happening
09:12:47*ltriant quit (Ping timeout: 255 seconds)
09:12:48FromDiscord<sheerluck> In reply to @uncle jim "damn who made this": https://github.com/ad-si/RosettaGit
09:14:05FromDiscord<Elegantbeef> Nope i was wrong it's not due to top level statement
09:16:38FromDiscord<heinthanth> there's no magic in `nimbase.h` too.
09:16:41FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/dC3
09:16:45FromDiscord<Elegantbeef> That does work
09:16:49FromDiscord<Elegantbeef> I mean you can trust me 😄
09:17:50FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/oL1
09:19:12FromDiscord<heinthanth> In reply to @Elegantbeef "That does work": how ...
09:19:16FromDiscord<heinthanth> not working on my side.
09:19:30FromDiscord<heinthanth> valgrind always report "All heap blocks were freed -- no leaks are possible"
09:19:34FromDiscord<Rika> Maybe the c compiler is removing unused variables
09:19:56FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/14I
09:19:59FromDiscord<Rika> Because you’re passing in danger (-O2) maybe?
09:20:08FromDiscord<Elegantbeef> I tested with both
09:20:24FromDiscord<Elegantbeef> It lost the proper amount of bytes
09:20:32FromDiscord<heinthanth> Yeah ...
09:20:51FromDiscord<Elegantbeef> With refc it doesnt report any loss
09:21:02FromDiscord<Elegantbeef> Dont recall if `useMalloc` works there
09:21:18FromDiscord<Elegantbeef> with arc/orc it says the proper
09:23:04FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Yqo
09:23:52*ltriant joined #nim
09:24:17FromDiscord<heinthanth> idk ... what's different between u and me https://media.discordapp.net/attachments/371759389889003532/978226853787607080/Screen_Shot_2022-05-23_at_3.53.55_PM.png
09:24:38FromDiscord<Elegantbeef> `nim -v`?
09:24:49FromDiscord<heinthanth> sent a code paste, see https://paste.rs/bPG
09:25:03FromDiscord<Elegantbeef> Same versions
09:25:27FromDiscord<Elegantbeef> I can ship the binary if you trust a random binary from a random joe schmoe
09:25:41FromDiscord<Elegantbeef> Can diff it atleast with yours 😄
09:25:51FromDiscord<heinthanth> nim binary or valgrind binary
09:25:59FromDiscord<Elegantbeef> The output
09:26:05FromDiscord<heinthanth> Ofc
09:26:22FromDiscord<Elegantbeef> test https://media.discordapp.net/attachments/371759389889003532/978227377094156358/test.null
09:26:26FromDiscord<Elegantbeef> sketchy 28kb file
09:27:03FromDiscord<Elegantbeef> that's `-d:useMalloc --mm:none -d:danger`
09:27:56FromDiscord<heinthanth> yeah ... your binary did leak https://media.discordapp.net/attachments/371759389889003532/978227769651638302/Screen_Shot_2022-05-23_at_3.57.31_PM.png
09:28:13FromDiscord<Elegantbeef> Do you have a config overriding your GC by any chance?
09:28:33FromDiscord<Elegantbeef> Are the binaries the same size?
09:28:48FromDiscord<heinthanth> Yours bigger
09:28:55FromDiscord<heinthanth> 28392 and 28552
09:29:41FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Yqp
09:29:51FromDiscord<heinthanth> yes!
09:29:58FromDiscord<Elegantbeef> This is super weird
09:30:06FromDiscord<heinthanth> Just default nim config.
09:30:07FromDiscord<heinthanth> sent a code paste, see https://play.nim-lang.org/#ix=3Yqq
09:30:13FromDiscord<Elegantbeef> gcc version?
09:30:20FromDiscord<heinthanth> 11.2.0
09:30:26FromDiscord<Elegantbeef> 11.3 here
09:31:03FromDiscord<heinthanth> this case is super weird ...
09:31:09FromDiscord<golova> Maybe you should check via godbolt?
09:31:10FromDiscord<Elegantbeef> try `--cc:clang`
09:31:16FromDiscord<golova> Or disassembler idk
09:31:24FromDiscord<Elegantbeef> You will need to download clang of course
09:32:09FromDiscord<heinthanth> sent a code paste, see https://paste.rs/E1g
09:32:29FromDiscord<Elegantbeef> Well give it a whirl and see if you can find the leak
09:32:42FromDiscord<Elegantbeef> This is the first time i've ever seen this behaviour so i'm lost
09:32:46FromDiscord<heinthanth> no no ... the same ... all free'd
09:33:06FromDiscord<Elegantbeef> I have to believe your GC is being set somewhere
09:33:33FromDiscord<Elegantbeef> When you compile does it have a unexpected `config` loaded?
09:33:47FromDiscord<Elegantbeef> The first messages it goes through are config files it's loading
09:33:53FromDiscord<heinthanth> Hint: used config file '/home/ubuntu/nim-1.6.6/config/nim.cfg' [Conf]↵Hint: used config file '/home/ubuntu/nim-1.6.6/config/config.nims' [Conf]
09:33:59FromDiscord<heinthanth> just installation defaults
09:34:07FromDiscord<heinthanth> I just downloaded https://nim-lang.org/install_unix.html and extract
09:34:21FromDiscord<heinthanth> that server is new and so, no prior config files
09:35:16FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Yqs
09:36:07FromDiscord<Elegantbeef> It'll print out during Nim compilation the GC it uses
09:36:15FromDiscord<Elegantbeef> So if all things are proper should say `"None"`
09:36:40FromDiscord<heinthanth> Yeah ... none
09:36:47FromDiscord<heinthanth> https://media.discordapp.net/attachments/371759389889003532/978230000207675402/Screen_Shot_2022-05-23_at_4.06.42_PM.png
09:37:19FromDiscord<Elegantbeef> There's got to be a very very simple thing we're missing and it's going to make us feel as dumb as possible
09:37:45FromDiscord<Elegantbeef> Well until then, I need to sleep now, sorry i couldnt help
09:37:58FromDiscord<heinthanth> Thanks for your patience too ...
09:38:07FromDiscord<heinthanth> Hope some nim compiler guys see this message.
09:44:42*xet7 quit (Remote host closed the connection)
09:45:40FromDiscord<Rika> Probably something to do with macOS no?
09:46:45FromDiscord<heinthanth> the same on Linux too
09:51:01FromDiscord<Rika> This is going to sound dumb but
09:51:08FromDiscord<Rika> “Are you compiling the right file”
09:52:22FromDiscord<heinthanth> Of course.
09:52:26FromDiscord<heinthanth> There's is only one file
09:52:55FromDiscord<heinthanth> I'm just testing around if I can disable GC completely. Sometimes, I love do allocation manually.
09:54:05FromDiscord<Rika> This is very strange
09:54:21FromDiscord<Rika> Maybe it has to do with the other flags you added
09:55:21FromDiscord<heinthanth> Idk, if I can ping some nim member I know.
09:55:31FromDiscord<heinthanth> I feel super weird about this case.
09:56:19FromDiscord<heinthanth> @Araq ... sorry to bother you. What do you think about this case.
10:00:49FromDiscord<tandy> why am i getting `Error: undeclared identifier: 'isNil'` when using it on an object
10:02:37FromDiscord<Rika> ? How are you using it
10:02:45FromDiscord<tandy> `if client.isNil:`
10:03:12FromDiscord<Rika> Maybe full code is needed now
10:03:18FromDiscord<tandy> hmm
10:03:52FromDiscord<tandy> im pushing
10:04:29FromDiscord<Rika> Push harder
10:05:48FromDiscord<tandy> https://github.com/Listen2gether/Listen2gether.github.io/blob/remove-serviceuser/src/views/home.nim
10:05:49FromDiscord<tandy> lol
10:05:58FromDiscord<tandy> if you clone this branch and run nimble buildjs
10:06:14FromDiscord<tandy> line 81
10:06:22FromDiscord<Rika> If only I could clone on my phone
10:06:31FromDiscord<tandy> rip
10:07:36FromDiscord<Rika> Where the heck is client and mirror defined h
10:09:28FromDiscord<tandy> in share.nim↵(@Rika)
10:09:40FromDiscord<tandy> the type is defined in types.nim
10:09:44FromDiscord<tandy> sorry for the maze
10:11:18FromDiscord<Rika> I mean the variable
10:11:30FromDiscord<Rika> Nothing in the global or local scope around line 81
10:11:31FromDiscord<Andreas> hi, i'm looking for a example of a long running-thread, doing maintanance and never quits ?
10:13:37FromDiscord<tandy> yeah the var is defined in share.nim↵(@Rika)
10:13:43FromDiscord<tandy> weir↵(@Rika)
10:13:44FromDiscord<tandy> weird
10:13:52FromDiscord<Rika> Okay so it’s there wait I’ll look then
10:15:06FromDiscord<Rika> Tbh this is cursed, global exported variables
10:15:43FromDiscord<Rika> Can you post full error
10:21:27FromDiscord<N00nehere> is it possible to make a nim program run on ms-dos or windows xp?
10:22:27FromDiscord<Rika> Sure why not
10:28:49FromDiscord<tandy> yes \:'(↵(@Rika)
10:28:52FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=3YqC
10:30:05FromDiscord<demotomohiro> In reply to @N00nehere "is it possible to": https://github.com/nim-lang/Nim/pull/19742↵There is PR for adding support for targeting 16-bit x86
10:31:06FromDiscord<Yardanico> In reply to @tandy "yes \:'( (<@259277943275126785>)": what type is client ?
10:31:58FromDiscord<Rika> User
10:32:04FromDiscord<Rika> It is a reference type
10:33:20FromDiscord<tandy> if u have ideas on how to improve this btw im interested↵(@Rika)
10:33:30FromDiscord<Rika> No I don’t
10:33:51FromDiscord<Rika> I don’t want to think about it, I have no interest in thinking for hours to fix your project
10:34:22FromDiscord<Yardanico> In reply to @tandy "if u have ideas": you didn'
10:34:26FromDiscord<Yardanico> t add prologue to the requirements
10:35:01FromDiscord<Yardanico> also just FYI it compiles for me on devel :P
10:35:08FromDiscord<Yardanico> ah develop branch
10:35:08FromDiscord<Yardanico> hm
10:35:13FromDiscord<Rika> Lol
10:39:45FromDiscord<Yardanico> the problem is related to `pkg/[listenbrainz, lastfm],`
10:39:56FromDiscord<Yardanico> @tandy do those also have some User type or not? or some client variable
10:40:32FromDiscord<Yardanico> listenbrainz exports client
10:40:33FromDiscord<tandy> hmm, yes i think they might have somethign called client
10:40:37FromDiscord<tandy> fuck
10:40:50PMunchom3ga, sorry I was off for lunch. In general you don't want to put the /usr/include directory as a path argument as that would import all sorts of things
10:41:03FromDiscord<tandy> understandable↵(@Rika)
10:41:19PMunchIf you have something as path there is no reason to also define it as syspath
10:42:18om3gaPMunch, thanks, I will try
10:49:19FromDiscord<tandy> how did u identify this btw?↵(@Yardanico)
10:49:37FromDiscord<Yardanico> i frequently use sledgehammer approach for this, it works well
10:49:50FromDiscord<Yardanico> just removed code in home.nim excluding that part with client.isNil until it started compiling
10:51:38*xet7 joined #nim
10:52:32*jmd_ quit (Ping timeout: 260 seconds)
10:54:59FromDiscord<N00nehere> In reply to @demotomohiro "https://github.com/nim-lang/Nim/pull/19742 There is": cool
10:55:47FromDiscord<Yardanico> In reply to @N00nehere "cool": nim runs on windows xp out of the box
10:56:03FromDiscord<N00nehere> In reply to @Yardanico "nim runs on windows": without any problem?
10:56:23FromDiscord<Yardanico> no one ran tests on it, but apparently nimble worked fine
10:59:20FromDiscord<tandy> i see, thanks↵(@Yardanico)
11:05:20*tinystoat is now known as sir_stoat
11:05:35*sir_stoat is now known as tiny_stoat
11:06:15*tiny_stoat is now known as sir_stoat
11:12:35*om3ga quit (Ping timeout: 260 seconds)
11:16:51*jjido joined #nim
11:27:34*om3ga joined #nim
11:46:21FromDiscord<tandy> is there any way to "cancel" an async function?
11:46:43FromDiscord<enthus1ast> dom mentioned once you can close the fd
11:47:32FromDiscord<tandy> hmm
11:48:11FromDiscord<enthus1ast> what do you wanna cancel?
11:48:21FromDiscord<enthus1ast> i guess there is no general way yet
11:49:13FromDiscord<tandy> well im using asyncjs
11:49:46FromDiscord<tandy> but i have a recursive "update" async proc which is called when a user visits a page in my spa
11:50:13FromDiscord<tandy> but when the user presses the back button and they leave that page, the proc should not execute
11:50:14FromDiscord<tandy> but it does
11:50:19FromDiscord<hotdog> In reply to @tandy "well im using asyncjs": I don’t think js promises are cancellable
11:51:14FromDiscord<hotdog> In reply to @tandy "but when the user": As a simple hack, could the proc check that ‘window.location.href’ matches what it expects, if not then early return?
11:54:34FromDiscord<tandy> thats a good idea, i currently check the status of a global enum, but that didnt seem to fix it↵(@hotdog)
11:57:50FromDiscord<tandy> nvm, got it
12:14:54om3gaPMunch, unfortunately it not works, Fatal: 'stdarg.h' file not found. I impotred missing va_list manually like that: type va_list* {.importc: "va_list", header: "<stdarg.h>".} = object
12:15:31FromDiscord<ynfle> Can someone help me with this error message `Error: unhandled exception: field 'node' is not accessible for type 'TFullReg' using 'kind = rkInt' [FieldDefect]`
12:15:33PMunchWhat? You don't have to manually import va_list like that
12:15:34FromDiscord<ynfle> (edit) "[FieldDefect]`" => "[FieldDefect]`?"
12:17:05PMunchstdarg.h missing sounds like a linking issue
12:17:20PMunchWell, not linking, but build flags
12:17:30om3gaPMunch, I don't remember exactly it required somewhere
12:17:54om3gaI will check right now
12:17:57FromDiscord<Andreas> sent a code paste, see https://play.nim-lang.org/#ix=3Yr4
12:18:30FromDiscord<Andreas> (edit) "https://play.nim-lang.org/#ix=3Yr4" => "https://paste.rs/1GU"
12:19:44om3gaPMunch, proc FCGX_VFPrintF*(stream: ptr FCGX_Stream; format: cstring; arg: va_list): cint {.header: "fcgiapp.h", varargs, cdecl.}
12:19:51FromDiscord<Andreas> (edit) "https://play.nim-lang.org/#ix=3Yr7" => "https://paste.rs/TZ4"
12:19:53om3gaFCGX_VFPrintF* needs va_list
12:20:53PMunchYes, but Futhark should wrap that properly
12:21:07om3gawell, for some reason it not does that
12:21:12om3gaunfortunately
12:21:15PMunchHmm, that's not great
12:21:34PMunchSeems like a regression
12:21:53PMunchIt does correctly tag it as `varargs`, but apparently it doesn't remove the va_list argument
12:22:32om3gaIf you need the code, I can send link
12:23:06PMunchYeah, please create an issue in GitHub with code and preferably link to documentation
12:23:27om3gaPMunch, no prob, thanks
12:30:13FromDiscord<ynfle> In reply to @Andreas "seems you need to": I'm pretty sure TFullReg is in the compiler
12:31:10FromDiscord<Andreas> In reply to @ynfle "I'm pretty sure TFullReg": ?? wdym ? i don't now the names of the variant-kinds..
12:31:31FromDiscord<konsumlamm> it's a bug
12:32:11FromDiscord<konsumlamm> (in the nim compiler)
12:32:15*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
12:33:56FromDiscord<Andreas> In reply to @konsumlamm "(in the nim compiler)": u mean there are errors in the nim-compiler - fuck me running, i did not expect that at all 😉
12:35:03FromDiscord<konsumlamm> yes, there a lot of errors actually
12:35:14FromDiscord<konsumlamm> have you ever looked at the Nim issue tracker?
12:37:25FromDiscord<Andreas> In reply to @konsumlamm "have you ever looked": not recently, too scary..
12:39:42*ltriant quit (Ping timeout: 244 seconds)
12:40:07FromDiscord<ynfle> In reply to @Andreas "?? wdym ? i": https://github.com/nim-lang/Nim/blob/05c0419658e3f97c29a12a16e99c0f8b842622c8/compiler/vmdef.nim#L220
12:42:00FromDiscord<Yardanico> In reply to @ynfle "https://github.com/nim-lang/Nim/blob/05c0419658e3f9": no real reason to look at it
12:42:05FromDiscord<Yardanico> just run the same command with nim_dbg
12:42:17FromDiscord<Yardanico> depending on how you installed nim, you might already have it
12:42:22FromDiscord<Yardanico> `nim_dbg` is the nim compiler in full debug mode
12:52:39FromDiscord<Andreas> In reply to @Yardanico "depending on how you": i did it via `brew`, but no nim_dbg here. found `nimsuggest, nimble, nimgrep` ? i can't build latest on my machine ?
12:52:53FromDiscord<Andreas> (edit) "no nim_dbg" => "no` nim_dbg`"
12:52:55FromDiscord<Yardanico> In reply to @Andreas "i did it via": but you don't have a bug? it was ynfle
12:53:00FromDiscord<Yardanico> and why you can't build latest?
12:53:04FromDiscord<Yardanico> but yeah, things like brew won't ship nim_dbg
12:54:27FromDiscord<Andreas> In reply to @Yardanico "but yeah, things like": well, i have my fair share of bugs here 🙂 no gcc on macOS and `clang version 12.0.1` had some problem, that i forgot..
12:54:37FromDiscord<Andreas> (edit) "gcc" => "`gcc`"
12:54:45FromDiscord<Yardanico> btw, if anyone needs nim manual in pdf for the latest devel version, https://transfer.sh/xJaGra/manual.pdf
12:55:02FromDiscord<Yardanico> (if you didn't know nim has `./koch pdf` to build all separate docs into pdf files, for that it uses nim's `rst2tex` command`
12:55:04FromDiscord<Yardanico> (edit) "command`" => "command)"
12:57:45*sir_stoat is now known as tinystoat
13:02:02*kayabaNerve quit (Read error: Connection reset by peer)
13:02:11*kayabaNerve joined #nim
13:02:29FromDiscord<ambient> yeah i have many issues where running clang instead of gcc will reveal bugs in some libraries
13:02:49FromDiscord<ambient> but apple m1 is twice as fast with nim when compared to AMD 3600 so 🙂
13:03:28FromDiscord<ambient> and its running only in Rosetta
13:04:23FromDiscord<Yardanico> why not build nim for arm64?
13:04:30FromDiscord<ambient> i can do that?
13:04:34FromDiscord<Yardanico> of course?!
13:04:38FromDiscord<Yardanico> in fact Araq uses it on an M1 mac
13:04:46FromDiscord<Yardanico> why did you think you won't be able to do it :DDD
13:05:08FromDiscord<ambient> im a software developer, not a programming language developer
13:05:36FromDiscord<Yardanico> yes, so why did you think that a language that compiles to C and has like tens of architectures/OSes supported won't run on M1 natively 🤔
13:05:47FromDiscord<ambient> theres usually a line where i just trust my tools to work for me instead of diving in too deep into the weeds
13:07:47FromDiscord<Andreas> In reply to @Yardanico "yes, so why did": cos' my old-clang had a problem with nim.latest - i'd really like to use head, but thus would require a macOS-upgrade to - at least Catalina, prolly Big Sur
13:07:59FromDiscord<Yardanico> huh, weird
13:08:35*ltriant joined #nim
13:08:53FromDiscord<ynfle> In reply to @Yardanico "just run the same": Do you know if it's available for `jiro4989/setup-nim-action@v1`
13:09:19FromDiscord<Yardanico> no clue honestly, probably not :( you can always just build it manually from the nim github repo
13:11:08FromDiscord<ynfle> It works on my local machine
13:11:22*noeontheend joined #nim
13:13:23FromDiscord<ynfle> In reply to @Yardanico "`nim_dbg` is the nim": Will it help if it only fails when running
13:13:40FromDiscord<ynfle> It's probably related to nimscripter
13:13:44FromDiscord<everyone> GUYS.....how do print statements work?
13:13:51*ltriant quit (Ping timeout: 276 seconds)
13:13:53FromDiscord<ynfle> Because compilation itself is fine
13:13:59FromDiscord<everyone> do they just spilt it?
13:14:08FromDiscord<ynfle> In reply to @uncle jim "GUYS.....how do print statements": `echo "Hello", ", world"`
13:14:16FromDiscord<everyone> In reply to @ynfle "`echo "Hello", ", world"`": ik that
13:14:25FromDiscord<everyone> but how do they work under the hood?
13:14:36FromDiscord<everyone> how do they print the stuff between ""
13:14:49FromDiscord<everyone> or a variable
13:14:49FromDiscord<Yardanico> In reply to @uncle jim "how do they print": just call the relevant system/standard C library routines
13:14:58FromDiscord<Yardanico> worst case you use linux system calls to write to the file descriptor
13:15:06FromDiscord<ynfle> In reply to @uncle jim "how do they print": They don't print stuff in between
13:15:19FromDiscord<ynfle> It call `$` on every parameter passed in
13:15:40FromDiscord<everyone> In reply to @ynfle "It call `$` on": ummmmmm
13:16:18FromDiscord<everyone> https://tenor.com/view/i-dont-get-it-i-dont-understand-clueless-laughing-huh-gif-15442422
13:16:28FromDiscord<ynfle> What part don't you understand?
13:16:42FromDiscord<ynfle> `$` is nim's `toString` operator by convention
13:17:07FromDiscord<everyone> i am not asking it specifically for nim
13:17:17FromDiscord<everyone> all languages in general
13:17:22FromDiscord<Yardanico> it works differently in different languages
13:17:42FromDiscord<ynfle> What is you question then?
13:17:44FromDiscord<everyone> In reply to @Yardanico "it works differently in": python should be easy
13:17:52FromDiscord<ynfle> What do you mean?
13:18:02FromDiscord<ynfle> Like how does it interact with the operating system?
13:18:23FromDiscord<ynfle> Well Unix, it just write to the processes `/dev/stdout` file and the OS takes care of the rest
13:18:51FromDiscord<everyone> In reply to @ynfle "What is you question": for eg in python:
13:19:11FromDiscord<everyone> sent a code paste, see https://paste.rs/uuy
13:19:23FromDiscord<everyone> how does it only print the `ello`
13:19:41FromDiscord<Yardanico> we have #offtopic for that
13:19:54FromDiscord<Yardanico> please ask such questions that are about programming in general there :)
13:20:00FromDiscord<Yardanico> or maybe in #langdev , but in your case #offtopic would be a bit better
13:20:40FromDiscord<ambient> seems theres no way but manual git pull and copy files to right locations to get Nim for arm64
13:20:41FromDiscord<everyone> In reply to @Yardanico "please ask such questions": oke
13:20:48FromDiscord<ambient> would be nice to have something with choosenim
13:40:22FromDiscord<Andreas> Howto use `atomic.compareExchange `with a custom Variant ?↵`location is (nonAtomicValue: cBranch-1/32 branches-0 leaves-1, guard: ())`
13:41:08FromDiscord<Andreas> (edit) "())`" => "())`↵possible at all ?"
13:41:17FromDiscord<ynfle> In reply to @Yardanico "no clue honestly, probably": Does chooenim install it by default?
13:41:25FromDiscord<Yardanico> don't think so
13:54:10FromDiscord<ynfle> In reply to @Yardanico "don't think so": It does, but it it doesn't link to `nimble/bin`
13:57:47*haliucinas quit (Ping timeout: 240 seconds)
13:59:54FromDiscord<ynfle> @Yardanico Any idea how to go about trying debug this? I'm nimscripter and it compiles fine on my machine
14:00:29FromDiscord<Yardanico> well, I only know one way - manually compiling nim and then using nim_dbg from the installation
14:00:44FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Yry
14:00:44*vicfred joined #nim
14:00:44FromDiscord<Yardanico> then run nim_dbg from bin/
14:00:49*PMunch quit (Quit: Leaving)
14:01:04FromDiscord<ynfle> It installed it
14:01:09FromDiscord<dom96> `~/.choosenim/toolchains/nim-1.6.4/bin/` might have it
14:01:14FromDiscord<ynfle> sent a code paste, see https://play.nim-lang.org/#ix=3Yrz
14:01:21FromDiscord<ynfle> This is the stack trace and error message
14:01:21FromDiscord<dom96> (edit) "`~/.choosenim/toolchains/nim-1.6.4/bin/`" => "`~/.choosenim/toolchains/nim-1.6.6/bin/`"
14:01:27FromDiscord<ynfle> In reply to @dom96 "`~/.choosenim/toolchains/nim-1.6.6/bin/` might have": It does
14:02:50FromDiscord<ynfle> (edit) "https://play.nim-lang.org/#ix=3Yrz" => "https://paste.rs/P5G"
14:02:54FromDiscord<Yardanico> ahh, nimscripter
14:02:56FromDiscord<Yardanico> hmm
14:02:58FromDiscord<ynfle> Ya
14:03:16FromDiscord<Yardanico> don't know if you can get a better traceback than this then, can you try to minimize your code?
14:03:48FromDiscord<ynfle> Not sure
14:03:56FromDiscord<ynfle> I can try, just not sure where to start
14:04:13FromDiscord<ynfle> running `nimble test -y` works
14:10:30*noeontheend quit (Ping timeout: 260 seconds)
14:19:05*dithpri quit (Quit: '); DROP TABLE Users;--)
14:23:32*noeontheend joined #nim
14:40:02*noeontheend quit (Ping timeout: 260 seconds)
14:50:36*noeontheend joined #nim
15:08:46FromDiscord<ambient> if i manually build Nim, can i just copy the entire folder into .choosenim/toolchains, and it will work?
15:10:56*noeontheend quit (Ping timeout: 258 seconds)
15:12:07*om3ga quit (Ping timeout: 260 seconds)
15:17:40*noeontheend joined #nim
15:30:45*ltriant joined #nim
15:34:27FromDiscord<demotomohiro> You can use your manually built Nim by just adding the path to bin directory in your Nim source to PATH environment variable.
15:34:28*mjsir911 quit (Quit: Goodbye, World!)
15:34:43*mjsir911 joined #nim
15:35:22*ltriant quit (Ping timeout: 244 seconds)
15:37:10FromDiscord<ambient> yeah but doesnt that overwrite choosenim
15:44:14FromDiscord<ynfle> Remove the choosenim links
15:45:17FromDiscord<ambient> i want to use it tho to quickly switch different nim versions
15:46:19FromDiscord<ambient> going to test and see if it works i guess
15:48:28FromDiscord<ynfle> You use choosenim with custom version of nim
15:48:45FromDiscord<ambient> yep, that's what i want to do
15:48:48FromDiscord<ambient> custom builds
15:52:26FromDiscord<ynfle> see the choosenim error message
15:52:53FromDiscord<dom96> In reply to @ambient "if i manually build": Yep. You can
16:01:37FromDiscord<spoon> sent a code paste, see https://play.nim-lang.org/#ix=3YrW
16:01:45FromDiscord<spoon> same error if i try to assign it to a variable first
16:02:17FromDiscord<Rika> you cant use await outside of an async proc
16:02:22FromDiscord<Rika> or in the top level
16:03:43FromDiscord<spoon> ah, added async pragma and it works
16:08:00FromDiscord<spoon> ty
16:09:28*wallabra joined #nim
16:09:52*wallabra quit (Remote host closed the connection)
16:10:08*wallabra joined #nim
16:15:43*arkurious joined #nim
16:17:48FromDiscord<ambient> well i built Nim for arm64, and added it as nim-#apple to choosenim, but it still makes x86_64 executables 😭
16:22:01FromDiscord<Rika> building nim for arm doesnt mean it would default to building on arm
16:22:03FromDiscord<Rika> (edit) "on" => "to"
16:25:38FromDiscord<Yardanico> In reply to @ambient "well i built Nim": are you sure you're running the arm64 one?
16:25:55*om3ga joined #nim
16:25:58FromDiscord<ambient> nim -v gave arm64 yes
16:26:03FromDiscord<Yardanico> does `nim -v` actually show `arm64` and not `amd64` (they look alike a bit)
16:26:06*om3ga quit (Read error: Connection reset by peer)
16:26:07FromDiscord<Yardanico> huh
16:26:31FromDiscord<Yardanico> In reply to @ambient "nim -v gave arm64": and what if you explicitly specify the `cpu` when compiling?
16:26:37FromDiscord<Yardanico> `nim c --cpu:arm64 file.nim`
16:27:03FromDiscord<Rika> wait i didnt realise youre running this on m1 are you
16:27:04FromDiscord<Rika> xd
16:27:09FromDiscord<ambient> i just followed this https://forum.nim-lang.org/t/7823
16:27:17FromDiscord<Rika> then that is strange
16:28:11FromDiscord<ambient> @Yardanico i have to test that later today, have to go for now
16:28:14FromDiscord<Yardanico> In reply to @ambient "i just followed this": there's no need for that anymore
16:28:55*om3ga joined #nim
16:29:06FromDiscord<Yardanico> at least as far as i know
16:29:35FromDiscord<ambient> choosenim installs amd64 version of nim on M!
16:29:49FromDiscord<Yardanico> that's choosenim
16:29:52FromDiscord<Yardanico> choosenim != nim
16:33:34NimEventerNew Nimble package! ipfshttpclient - ipfs http client, see https://github.com/xflywind/ipfshttpclient
16:34:25*wallabra quit (Changing host)
16:34:25*wallabra joined #nim
16:35:18*wallabra quit (Quit: ZNC 1.8.2 - https://znc.in)
16:35:30*wallabra joined #nim
16:36:03*wallabra quit (Changing host)
16:36:03*wallabra joined #nim
16:40:18*om3ga quit (Read error: Connection reset by peer)
16:40:38*om3ga joined #nim
16:44:40FromDiscord<Yardanico> @xflywind any reason for merging a package without actual source code right away? :P
16:45:21*tiorock joined #nim
16:45:21*tiorock quit (Changing host)
16:45:21*tiorock joined #nim
16:45:21*rockcavera is now known as Guest484
16:45:21*Guest484 quit (Killed (tantalum.libera.chat (Nickname regained by services)))
16:45:21*tiorock is now known as rockcavera
16:45:30*rockcavera quit (Remote host closed the connection)
16:46:49*jjido joined #nim
16:55:47FromDiscord<xflywind> really, it has some code?
16:56:06FromDiscord<Yardanico> just a tiny bit :P
16:57:02FromDiscord<xflywind> oh, i forget to push internal directory though
16:58:39FromDiscord<xflywind> Oh, i forgot to push the internal directory.
17:00:52FromDiscord<xflywind> I basically modified puppy to add file upload feature because I cannot make httpclient work.
17:01:23FromDiscord<xflywind> (edit) "modified" => "modify" | "to" => "which uses curl directly and"
17:01:59FromDiscord<xflywind> (edit) "curl" => "libcurl"
17:02:29FromDiscord<xflywind> It is broken when using winhttp api in the puppy. So I can only believe curl.
17:02:38FromDiscord<xflywind> (edit) "puppy." => "puppy too."
17:05:48FromDiscord<ambient> @Yardanico ´´nim c --cpu:arm64 --os:macosx -d:release -d:danger --passC:"-flto" --passL:"-flto" -r fft.nim´´´still gives x86_64 on file fft
17:06:00FromDiscord<Yardanico> check your config files
17:06:04FromDiscord<ambient> (edit) "´´nim" => "´´´nim"
17:06:14FromDiscord<Yardanico> nim shows the config files it is using when compiling a file
17:06:17FromDiscord<Yardanico> check if those have a hardcoded arch
17:07:35FromDiscord<ambient> they are the default config files from nim git
17:13:59FromDiscord<ambient> i also tested clang and it does output arm64 by default
17:21:00FromDiscord<d4rckh> is choosenim supposed to add nim to my path? https://media.discordapp.net/attachments/371759389889003532/978346824001785866/unknown.png
17:21:06FromDiscord<d4rckh> tried to sign out and log back in
17:21:29FromDiscord<d4rckh> and %PATH% does not contain any nim folder
17:23:41FromDiscord<d4rckh> meh, added it myself
17:23:46FromDiscord<Rika> It does not add automatically
17:23:54FromDiscord<Rika> It’s supposed to tell you to add it if it isn’t in
17:24:13FromDiscord<d4rckh> i see
17:33:47*noeontheend quit (Ping timeout: 256 seconds)
18:03:26FromDiscord<ynfle> Just tried on a fresh git clone and I get the error
18:20:25*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
18:28:10*PMunch joined #nim
18:28:23FromDiscord<treeform> In reply to @Yardanico "for example if you": Does it include flatty twice in the exe? Is it some thing I can fix?
18:29:09FromDiscord<Yardanico> In reply to @treeform "Does it include flatty": flatty.nim was my own file
18:29:14FromDiscord<Yardanico> its not related to flatty at all
18:29:22FromDiscord<Yardanico> it's just me showing how nim makes filenames for C files
18:30:04FromDiscord<treeform> oh got it 🙂
18:32:49FromDiscord<Andreas> Is std/atomics or threading/atomics the one to use ?
18:36:29PMunchUgh, I should move closer to China..
18:36:59PMunchJust realised I need a 24pin FPC connector for a project, that's a solid month of waiting..
18:43:44FromDiscord<ynfle> Fixed the bug. I had edited and fixed a bug but hadn't committed and pushed that code
18:43:53*jmdaemon joined #nim
18:51:51*rockcavera joined #nim
18:51:51*rockcavera quit (Changing host)
18:51:51*rockcavera joined #nim
19:03:15FromDiscord<dom96> In reply to @Rika "It’s supposed to tell": Yeah. Only does that if you pass —firstInstall which gets passed for you on Windows if you use the zip install method. Not supposed to just run the exe directly. Probably should just get rid of this tbh and detect this flag implicitly.
19:32:58*ltriant joined #nim
19:37:41*ltriant quit (Ping timeout: 244 seconds)
19:47:25*kenran joined #nim
19:49:54FromDiscord<deech> sent a code paste, see https://play.nim-lang.org/#ix=3YsH
19:51:43FromDiscord<planetis> In reply to @Andreas "Is std/atomics or threading/atomics": I would say the threading/atomics but I made it
19:51:50FromDiscord<planetis> (edit) removed "the"
19:52:10FromDiscord<Andreas> In reply to @planetis "I would say threading/atomics": good to know, ty..
19:53:44*kenran quit (Quit: WeeChat info:version)
19:54:37FromDiscord<Rika> In reply to @deech "How do I combine": you dont
19:54:44FromDiscord<Rika> you lose MCS with enforced qualification
19:54:48FromDiscord<Rika> no way around it afaik
19:55:10FromDiscord<Rika> i mean in terms of explicit "nice" syntax, of course theres probably some hacky way you could
19:58:18FromDiscord<deech> A different syntax for module qualification vs. mcs vs. field access would be nice, conflating all three into the dot looks nice but make code hard to understand.
19:58:45FromDiscord<huantian> I feel like module qualifcation isn't used enough to justify it tbh
20:05:35FromDiscord<Andreas> @planetis so may i ask you about how to use it in my case - cos' the runnable examples don't help me out. I read in some C++/Atomics blogs, that one can load a pointer, copy/clone the shared object, make changes on the local clone, then compareAndExchange. I'm working on a data-structure and like to try this approach with a graph of `ref object variant`. But the compiler wont let do this 🙂
20:07:08*xet7 quit (Remote host closed the connection)
20:07:47FromDiscord<planetis> you need a Atomic[ref T] but that's not allowed only type AtomType = SomeNumber | pointer | ptr | char | bool
20:08:42FromDiscord<planetis> there are threading/smartptrs SharedPtr for this job
20:08:58FromDiscord<Andreas> In reply to @planetis "you need a Atomic[ref": hmm, that is my impression. But a ref object can be 'downgraded' to a raw-pointer, can it ?
20:09:14FromDiscord<planetis> but most likely you should stay with a pointer
20:09:44FromDiscord<planetis> it can but incRef/decRef are not threadsafe
20:11:16FromDiscord<planetis> Now that I think about it, it might have been better if SharedPtr was a distinct ptr
20:11:47FromDiscord<Andreas> In reply to @planetis "but most likely you": ok, i'm confused 😉 do you mean a Smart/Unique/Shared-Ptr from the threading/atomics-lib or a dumb raw-pointer ?
20:12:24FromDiscord<planetis> yeah a dumb one
20:12:38FromDiscord<Andreas> In reply to @planetis "Now that I think": do these Smart/Shared=Ptr have some sort of aquire/release semantics ?
20:12:56FromDiscord<Andreas> (edit) "Smart/Shared=Ptr" => "Smart/Shared-Ptr"
20:12:57FromDiscord<planetis> but I should make Atomic[SharedPtr] work somehow
20:13:23FromDiscord<Andreas> (edit) "Smart/Shared-Ptr" => "Smart-/Shared-Ptr"
20:13:45FromDiscord<planetis> In reply to @Andreas "do these Smart-/Shared-Ptr have": no they just atomically increment / decrement a counter
20:14:44FromDiscord<Andreas> In reply to @planetis "yeah a dumb one": and a dump one i get by `my_thing.unsafeAddr` ?
20:16:03*dithpri joined #nim
20:16:13*dithpri quit (Client Quit)
20:16:51FromDiscord<planetis> it depends...
20:17:08FromDiscord<planetis> but I guess
20:18:11FromDiscord<Andreas> In reply to @planetis "but I guess": ty, just tried it and yep, works
20:19:28FromDiscord<planetis> https://play.nim-lang.org/#ix=3YsN don't tell me, it can't match because it's distinct... pfff
20:23:58*noeontheend joined #nim
20:24:57FromDiscord<Andreas> In reply to @planetis "https://play.nim-lang.org/#ix=3YsN don't tell me,": https://play.nim-lang.org/#ix=3YsO
20:26:38FromDiscord<planetis> btw just use a Lock and you will be blessed
20:26:53FromDiscord<Andreas> (edit) "https://play.nim-lang.org/#ix=3YsO" => "https://play.nim-lang.org/#ix=3YsP changed again, get a true for n1.unsafeAddr"
20:28:35FromDiscord<Andreas> In reply to @planetis "btw just use a": maybe, well see - i wanna learn this stuff - for a different part i could need a thread-safe queue - is there smth. in your other package of yours, that i just discovered on nimble
20:29:26FromDiscord<Andreas> (edit) "your" => "the" | "theother package of yours, that i just discovered on nimble ... " added " 'sync' ?"
20:30:04FromDiscord<planetis> I guess many atomic linked lists exist out there
20:30:11FromDiscord<planetis> but what kind of queue?
20:31:27FromDiscord<Andreas> In reply to @planetis "but what kind of": hmm, size limited, thread-safe, put stuff in on the left and pop it from the right, so LIFO it is..
20:32:07FromDiscord<planetis> single producer/ consumer?
20:34:53FromDiscord<Andreas> In reply to @planetis "single producer/ consumer?": good question, not sure yet. Its not critical. Could be any combination many producers : one consumer could be the scenario.. yes many-to-one, the one threads job is to fix orphaned-branches in the tree, that other thread have produced, as a result of a node removal..
20:34:59FromDiscord<planetis> if so sync/spsc, the rest either use std/channels? or port one yourself
20:35:20FromDiscord<planetis> where is std/channels I can't find it, wtf happened?
20:35:45FromDiscord<planetis> it's channels_builtin now?
20:36:34FromDiscord<Andreas> yes, it says so 1.6.6 channels_builtin
20:36:37FromDiscord<planetis> I tried a mpsc implementation once but it wasn't right
20:36:51FromDiscord<planetis> but someone else found a different paper and might have a package
20:38:51FromDiscord<planetis> oh it was that one https://github.com/nim-works/loony
20:39:11FromDiscord<Andreas> and for channels, one can have any arrangement one-to-many, many-to-many etc..
20:40:41FromDiscord<planetis> yes, I have a long time to code something with multiple threads so things have changed
20:41:20FromDiscord<planetis> there is also https://github.com/status-im/nim-taskpools
20:41:35FromDiscord<planetis> a better threadpool impl
20:42:11FromDiscord<Andreas> reading the loony-lib, sounds good to me, maybe a bit overkill, but why not,, i'm planning for 4-6-threads max..
20:43:32FromDiscord<planetis> if you use it use TheadSanitizer and tell us if it works
20:43:40*noeontheend quit (Ping timeout: 258 seconds)
20:44:22FromDiscord<planetis> sent a code paste, see https://paste.rs/DaR
20:44:24FromDiscord<Andreas> `TheadSanitizer` what is that ? smth. that makes thread-debugging easier ?
20:45:03FromDiscord<Rika> oh man you have to learn about the sanitisers
20:45:17FromDiscord<Rika> https://clang.llvm.org/docs/ThreadSanitizer.html
20:52:49NimEventerNew post on r/nim by hc0re: Installing NIM using choosenim on Pop!_OS fails with reason "could not load: libcrypto.so", see https://reddit.com/r/nim/comments/uwa1qv/installing_nim_using_choosenim_on_pop_os_fails/
20:55:02FromDiscord<Andreas> this video was recommended, just-in-case,, https://www.youtube.com/watch?v=KeLBd2EJLOU 'Atomic Weapons' by Herp Sutter, very funny - in part I he explains that 1-percent of the silicon deals with our source-code - the rest makes all sort of memory related optimizations..
20:59:22FromDiscord<planetis> I've never watched it in full, I should make time
20:59:32FromDiscord<planetis> is the information still relevant?
21:00:11FromDiscord<federico3> @Yardanico\: what makes you say that LibreSSL support is required?
21:00:50FromDiscord<Andreas> In reply to @planetis "is the information still": i's say yes - very much - he argues that the von-Neumann-machine has died in the 90'ies, but nobody noticed and the mental-model lives on..
21:00:58FromDiscord<Andreas> (edit) "i's" => "i'd"
21:18:41*PMunch quit (Quit: leaving)
21:23:23FromDiscord<morgan> is there any way for me to see what nimsuggest is doing? it's using a full core rn, and has been for hours
21:23:50*dithpri joined #nim
21:25:44FromDiscord<morgan> https://media.discordapp.net/attachments/371759389889003532/978408412394176592/unknown.png
21:25:57FromDiscord<morgan> yeah turns out it has been going for a while
21:26:14FromDiscord<Elegantbeef> Are you using vscode?
21:26:18FromDiscord<morgan> yes
21:26:19*arkurious quit (Quit: Leaving)
21:26:25FromDiscord<Elegantbeef> What extension?
21:26:35FromDiscord<morgan> saem's
21:26:47FromDiscord<Elegantbeef> You should setup the project settings
21:27:39FromDiscord<morgan> sent a code paste, see https://play.nim-lang.org/#ix=3Yt4
21:27:54FromDiscord<Elegantbeef> ok?
21:28:05FromDiscord<morgan> that's the open files and ports
21:28:34FromDiscord<morgan> i'll look into the project settings
21:28:55FromDiscord<Elegantbeef> https://github.com/saem/vscode-nim#options it's mentioned in here
21:31:59FromDiscord<morgan> ok maybe it's the nim.project, since i'm `include`ing a file atm
21:32:19FromDiscord<morgan> tho actually i probably don't need to
21:32:32FromDiscord<morgan> yeah i don't think i need to
21:32:39FromDiscord<Elegantbeef> include is literally satan
21:35:34FromDiscord<morgan> ok why does importing from another file not let me use stuff defined in it?????? it keeps displaying errors
21:36:00FromDiscord<morgan> oh
21:36:04FromDiscord<morgan> im dumb
21:36:15FromDiscord<morgan> before it was all in one so i wasn't exporting anything i declared
21:41:02FromDiscord<voidwalker> how do i debug a startprocess, to see its execution line ? executable starts but does not appear to be doing what I intended
21:42:03FromDiscord<Elegantbeef> you can pass the option `poEchoCmd` and it'll show what it's running
21:46:33*noeontheend joined #nim
21:52:54FromDiscord<voidwalker> hmm looks good, it might be that it needs its output read to progress ?
22:04:07*jjido joined #nim
22:12:24*wallabra quit (Quit: ZNC 1.8.2 - https://znc.in)
22:13:38*wallabra joined #nim
22:13:45FromDiscord<voidwalker> `while myproc.running: discard myproc.readLines` how else can i do this ? without blocking
22:14:51FromDiscord<Elegantbeef> async perhaps
22:18:52FromDiscord<voidwalker> would another kind of exec proc work, that I don't have to read its output ?
22:20:30FromDiscord<Elegantbeef> I mean you dont need to read the output
22:21:12*gsalazar quit (Ping timeout: 252 seconds)
22:21:34FromDiscord<Elegantbeef> you can just do `while myProc.running: discard`
22:22:02FromDiscord<Elegantbeef> Think there is also a `waitForExit`
22:22:39FromDiscord<voidwalker> yes but i want to let the program run in the background, and have some kind of watchdog process that checks if it's done (it produced a certain file)
22:23:15FromDiscord<Elegantbeef> So then just have the process run then check if it's finished when you need to
22:24:56*Guest21 joined #nim
22:25:05Guest21hi!
22:25:35FromDiscord<voidwalker> but it does not start working if I don't read its output. that's why I asked if there is an alternative (besides using async, which I don't know how to use yet, but I will read)
22:26:10FromDiscord<Elegantbeef> You shouldnt need to read the output for a process to wrok
22:32:55FromDiscord<dom96> @voidwalker you should be able to also have the process output its stdout to your process' stdout
22:33:17FromDiscord<dom96> if you're just debugging that should work quite well
22:34:54*noeontheend quit (Ping timeout: 244 seconds)
22:37:29FromDiscord<voidwalker> How would I do that ?
22:41:28FromDiscord<j-james> In reply to @MorganAlyssa "is there any way": this is a known bug: https://github.com/nim-lang/Nim/issues/11679
22:44:14FromDiscord<morgan> good to know
22:45:16*ltriant joined #nim
22:55:46FromDiscord<dom96> Hopefully the likes of https://github.com/nim-lang/langserver/ can manage the nimsuggest process to prevent it running wild
22:57:44FromDiscord<dom96> In reply to @voidwalker "How would I do": use the `poParentStreams` ProcessOption
22:58:11FromDiscord<dom96> or just use `execCmd` which does it implicitly https://nim-lang.org/docs/osproc.html#execCmd%2Cstring
22:59:28FromDiscord<voidwalker> I just tried the poParentStreams. I get the first line, and then the process turns into a zombie instead of continuing
22:59:59FromDiscord<voidwalker> It should output a text progress bar.. maybe that's too complex
23:32:12*Guest21 quit (Quit: Client closed)
23:32:46*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)