<< 05-01-2023 >>

00:38:12*jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in)
00:40:50FromDiscord<djazz> okay, lwip with futhark is working, managed to do a https request through it
00:41:40FromDiscord<djazz> although having anything include a header to the same types/functions taints it and c compiler complains that the types dont match
00:41:57*jmdaemon joined #nim
00:42:13FromDiscord<djazz> so i cant use header pragma for the #define functions/inline functions
00:42:22FromDiscord<djazz> static inline
01:23:15*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
02:09:42FromDiscord<ambient> when you guys talk about Futhark you don't mean this futhark? https://futhark-lang.org/
02:09:56FromDiscord<Rika> It is not
02:09:58FromDiscord<djazz> https://github.com/PMunch/futhark
02:10:06FromDiscord<ambient> I was super confused
02:10:16FromDiscord<djazz> mhmm
02:16:50*azimut quit (Ping timeout: 255 seconds)
02:35:06FromDiscord<ted__> sent a code paste, see https://play.nim-lang.org/#ix=4knl
02:36:47FromDiscord<ted__> (edit) "https://play.nim-lang.org/#ix=4knl" => "https://paste.rs/xxz"
02:40:15FromDiscord<Elegantbeef> Your latest version writes to `table` instead of result
02:40:26FromDiscord<Elegantbeef> Also why are you using `OrderedTableRef` do you need the reference semantics?
02:41:05FromDiscord<ted__> doh! let me fix that. ↵↵I did have just `Table` in there, but one of my variations was complaining and told me that ref type in an error
02:41:47FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4knm
02:44:45FromDiscord<ted__> sent a code paste, see https://paste.rs/Amp
02:44:50FromDiscord<ted__> let me try yours as you have it though
02:45:21FromDiscord<Elegantbeef> you need to change line 4 in your code
02:45:27FromDiscord<Rika> Because you don’t change the new call to the init call
02:45:32FromDiscord<Elegantbeef> `result = initTable[string, seq[T]]()`
02:46:13FromDiscord<ted__> oh! yours is simpler and removes the initialization I was doing and that fixes it. Thanks Beef!
02:46:52FromDiscord<Elegantbeef> Technically only `ref` variants of tables need initialised
02:47:07FromDiscord<Elegantbeef> you can manually initialise them for capacity, but that's between you and your problem
02:47:29FromDiscord<Elegantbeef> The reason you got a segfault was cause the `ref` was nil and you attempted to derefernece it
02:47:51FromDiscord<ted__> got it, that makes sense
03:19:55FromDiscord<UN533N_5PY> \>when you run for five minutes wondering why your changes didnt work↵\>instead of running ./
03:24:15*DarrylTheFish2 joined #nim
03:24:23*DarrylTheFish quit (Read error: Connection reset by peer)
03:35:46*yolo left #nim (#nim)
03:49:37*arkurious quit (Quit: Leaving)
05:01:16*ephaptic joined #nim
05:35:07*ephaptic quit (Quit: WeeChat 3.7.1)
06:20:26*fallback quit (Ping timeout: 246 seconds)
06:32:45*fallback joined #nim
06:35:34FromDiscord<Jakraes> Quick question, I'm using ubuntu for a project and I'm trying to get nim on it although apt-get install nim doesn't work
06:35:45FromDiscord<Jakraes> Basically apt-get can't find nim
06:36:35FromDiscord<Jakraes> Nvm, I had a typo xd
06:42:35FromDiscord<Rika> Not recommended
06:42:46FromDiscord<Rika> Most likely a very old version of Nim is packaged with such operating system
07:16:38*rockcavera quit (Remote host closed the connection)
07:36:05*PMunch joined #nim
07:43:58FromDiscord<fbpyr> sent a long message, see http://ix.io/4ko7
07:44:01FromDiscord<Elegantbeef> You want to create a detached process on linux/mac you might be able to pass `poDaemon`
07:45:10FromDiscord<Elegantbeef> the way startProcess works by default is by childing the process to the active one, poDaemon i believe causes it to be a detached process and should work fine
07:45:18FromDiscord<fbpyr> I tried poDaemon on linux, but it had the same effect.
07:47:51FromDiscord<Elegantbeef> Well https://github.com/status-im/nim-daemon i guess
07:47:54FromDiscord<fbpyr> with `poDaemon` in htop I could see, that mpv was then grouped somewhere under systetemd --user
07:49:32FromDiscord<fbpyr> Elegantbeef\: thank you for the link!
07:50:20FromDiscord<fbpyr> that lib in `daemonize` wants a path to a pid file.↵that would be the pid of the `osproc.startProcess` process?
07:51:23*ltriant_ quit (Ping timeout: 260 seconds)
07:51:46FromDiscord<Elegantbeef> Afaict it's like posix fork
07:52:47FromDiscord<Elegantbeef> https://github.com/status-im/nim-daemon/blob/master/tests/testdaemon.nim#L52-L60
07:52:47FromDiscord<Elegantbeef> Example of that
07:52:53FromDiscord<Elegantbeef> I guess it doesnt work how you want since it'd still have the name of the original process
07:52:53FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ko8
07:53:51FromDiscord<fbpyr> I willl try it out. thank you so much! 🙂
08:10:05*ltriant joined #nim
08:14:34*ltriant quit (Ping timeout: 252 seconds)
08:53:27*jjido joined #nim
09:11:28FromDiscord<untoreh> does `cstringArrayToSeq` take ownership of the array? I think not?
09:12:52*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
09:30:53*jjido joined #nim
09:42:45*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
09:56:42FromDiscord<enthus1ast> fbpyr\: i do not know what you want to achive, but when you want good control over mpv you can try this\: https://github.com/daniel-j/nim-mpv with this i was able to build a tui music/video player with an mpv backend
09:56:42FromDiscord<enthus1ast> Thats the tui player\: https://github.com/enthus1ast/muk
09:56:45FromDiscord<fbpyr> enthus1ast\: thank you so much for the links!
09:56:45FromDiscord<fbpyr> thank you for the inspiration, I had not yet considered controlling mpv via a lib.. 🤔
09:56:46FromDiscord<fbpyr> I'll try muk out - might be a nice cross-platform replacement for cmus.
09:56:46FromDiscord<enthus1ast> But for your issue, I'm wondering tha poDeamon does not work
09:56:46FromDiscord<enthus1ast> I waa wanted to have a mocp for windows (that also had some features of ncmcpp)
09:56:47FromDiscord<fbpyr> well, for the current use case I actually want no control over mpv from cli side, just would like a way to 'fire-and-forget' start mpv with some args, without it being connected with the calling cli app. 🙂
09:56:48FromDiscord<enthus1ast> But I build in too many features too fast
09:56:49FromDiscord<fbpyr> yeah mocp is another nice one. 🙂
09:56:50FromDiscord<enthus1ast> But also unfinished and buggy 🙄
09:56:50FromDiscord<fbpyr> well it seems to work for some aspects
09:56:52FromDiscord<fbpyr> enthus1ast\: muk is super cool!
09:56:52FromDiscord<enthus1ast> I wanted to have a mocp for windows (that also had some features of ncmcpp)
09:56:53FromDiscord<fbpyr> on linux it is a new proc as child somewhere from systemd --user
09:56:54FromDiscord<fbpyr> only that it seems to still have a connection (maybe via stdout?) to the calling process
09:56:55FromDiscord<enthus1ast> This means it will stop if the calling process is terminated?
09:56:55FromDiscord<fbpyr> mpv does not terminate when the calling nim-cli is terminated
09:56:56FromDiscord<fbpyr> in that sense they are nicely disconnected
09:56:56FromDiscord<fbpyr> so there is some connection, which I ideally would not have.
09:56:57FromDiscord<fbpyr> only that it seems to still have a connection (maybe via stdout?) to the calling proc
09:56:57FromDiscord<fbpyr> ah, right - good idea! thank you! ↵another path maybe poEvalCommand - maybe that is started detached.. 🤔
10:00:21*jjido joined #nim
10:05:29*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
10:09:26*azimut joined #nim
10:12:02*jjido joined #nim
10:57:18*ltriant joined #nim
11:19:20*jmdaemon quit (Ping timeout: 265 seconds)
11:52:24*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
12:19:16FromDiscord<Jessa> sent a code paste, see https://play.nim-lang.org/#ix=4koS
12:21:37FromDiscord<djazz> test.one.ord?
12:21:52FromDiscord<djazz> ord returns the ordinal
12:23:34FromDiscord<Jessa> sent a long message, see http://ix.io/4koW
12:25:32FromDiscord<Jessa> why wouldn't `test.one` not just be an int
12:28:20FromDiscord<Rika> because theyre ints
12:28:23FromDiscord<Rika> i mean enums
12:28:24FromDiscord<Zoom> Yep, you're missing the fact enums are meant to leverage the type system to produce correct, safe and concise code, compared to pure numbers.
12:28:38FromDiscord<Rika> what if you pass the wrong enum into that func?
12:28:40FromDiscord<pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4koX
12:29:05FromDiscord<Rika> In reply to @Jessa "do i need to": in such case, yes consts would be better
12:30:07FromDiscord<Zoom> How can you say consts are better if it's absolutely unclear what is the code supposed to do? \:D
12:30:57FromDiscord<Rika> in such case, being the one shown
12:31:04FromDiscord<Rika> and the one expressed
12:33:05FromDiscord<Jessa> In reply to @Rika "in such case, being": the only valid way to respond to that
12:33:42FromDiscord<Jessa> people that're like "oh BuT i DoN'T kNoW WhaT You"RE tRyInG tO Do" despite giving a very clear and consise example of exactly what i'm trying to do
12:37:32FromDiscord<Rika> to be fair, i would say that the example doesnt really tell much about what you're "really" trying to do but so be it
12:59:12FromDiscord<Jotrorox> If I try to install choosenim it prints "Downloading C compiler (Mingw64)" but nothing happens for 30min, is this just my internet or is it because i already have Mingw installed
13:06:12*jjido joined #nim
13:10:17FromDiscord<Taurus> In reply to @Jotrorox "If I try to": I have problems with choosenim on win11 too, the mingw phase always gets blocked from windows defender, I could only make nim work by installing nim/nimble with pacman from the mingw64 repo
13:10:34FromDiscord<Jotrorox> ok
13:37:53FromDiscord<haoyu> the link about the exception in the article Version 2.0.0 release candidate cannot be opened
13:39:23FromDiscord<haoyu> https://media.discordapp.net/attachments/371759389889003532/1060553098172575744/IMG_20230105_213839.jpg
13:51:10FromDiscord<ringabout> In reply to @haoyu "the link about the": fixed => https://github.com/nim-lang/website/pull/355
13:56:26*DarrylTheFish2 quit (Remote host closed the connection)
14:06:14*junaid_ joined #nim
14:23:29*junaid_ quit (Remote host closed the connection)
14:23:43*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
14:39:51*Phytolizer joined #nim
14:48:17FromDiscord<AmjadHD> sent a code paste, see https://play.nim-lang.org/#ix=4kpv
14:49:15FromDiscord<AmjadHD> Note: I'm on Windows.
15:09:36*PMunch quit (Quit: Leaving)
15:19:13*Phytolizer quit (Remote host closed the connection)
15:43:58*derpydoo joined #nim
15:59:00*jmdaemon joined #nim
15:59:53FromDiscord<Bung> I guess you can't start it like that , it's not interactive app
16:01:54FromDiscord<jos> does ORC work with the js target?
16:01:58FromDiscord<jos> or does it still rely on js gc
16:02:43FromDiscord<Bung> gc is noop for js target
16:03:11FromDiscord<jos> so then if u use destructors, u can't cross compile to JS and expect correct behavior? i guess
16:05:15FromDiscord<AmjadHD> In reply to @Bung "I guess you can't": Then How is it started then ?
16:08:02FromDiscord<Bung> dunno , havn't try by myself, but the client side should send first message to server for initialization.
16:09:06FromDiscord<Bung> generally it should start through stdio then write message to stdin
16:17:37*rockcavera joined #nim
16:25:13*jmdaemon quit (Ping timeout: 252 seconds)
16:35:34FromDiscord<planetis> In reply to @jos "so then if u": Usually when you program for js, you use a subset of the language, refs, arrays, seqs, maybe cstrings instead of strings but no unmanaged pointers. So what's correct behavior if alloc is not defined in js? https://github.com/nim-lang/Nim/blob/devel/lib/system/memalloc.nim#L49
16:36:05FromDiscord<planetis> you are forced to when not defined(js): proc =destroy in your library
16:38:35FromDiscord<jos> i never really thought of it as "programming for JS"
16:38:45FromDiscord<jos> i thought the whole point was "deploy your app on the web"
16:39:12FromDiscord<jos> there's other options so it's not a big deal, like emscripten or wasm, but I would have expected it to work personally
16:40:22FromDiscord<planetis> It's possible, but need to have a separate when defined(js) for everything
16:45:41FromDiscord<planetis> I mean it's needed for low level stuff for example https://github.com/beef331/nimtrest/blob/master/yeacs.nim but everything in std should work
16:49:04FromDiscord<planetis> so it's not as black and white you think
17:02:56FromDiscord<Solitude> In reply to @jos "so then if u": they work only for non-ref objects/arrays, thats it.
17:03:28FromDiscord<justinn> sent a code paste, see https://paste.rs/Mio
17:08:59FromDiscord<Solitude> how do you invoke it?
17:09:35FromDiscord<justinn> `module.get.invoke(req.httpMethod.get.methodToString)`
17:10:02FromDiscord<Solitude> what would T be in that context?
17:10:06FromDiscord<Solitude> write an overload without args
17:14:35FromDiscord<justinn> sent a code paste, see https://play.nim-lang.org/#ix=4kqa
17:16:05FromDiscord<Solitude> zamn, i didnt think of that...
17:23:57FromDiscord<Bung> am wondering how your proc returns from symAddr work with generic
17:27:05*jmdaemon joined #nim
17:28:55FromDiscord<justinn> tbh. didn't get that far yet, so far I'm only invoking functions without params
17:34:30FromDiscord<@thatrandomperson5-6310e3b26da03> How would i make a static string table from `strtabs`
17:37:41FromDiscord<jtv> Meaning const, or meaning available at compile time only?
17:38:15FromDiscord<@thatrandomperson5-6310e3b26da03> > Meaning const, or meaning available at compile time only?↵Const
17:39:32FromDiscord<jtv> This is what I do: https://play.nim-lang.org/
17:39:35FromDiscord<jtv> Whoops one sec
17:39:56FromDiscord<jtv> https://play.nim-lang.org/
17:40:01FromDiscord<jtv> Why isn't it copying the link?
17:40:20FromDiscord<jtv> sent a code paste, see https://paste.rs/Ltu
17:40:22FromDiscord<Solitude> its a test if you're paying attention
17:40:22FromDiscord<jtv> There you go anyway
17:41:05FromDiscord<jtv> No something's horked w/ my local cut and paste buffer
17:41:07FromDiscord<jtv> https://play.nim-lang.org/#ix=4kqh
17:44:52FromDiscord<@thatrandomperson5-6310e3b26da03> That is not strtabs, i have to use strtabs↵(@jtv)
17:45:48FromDiscord<Solitude> for some reason strtabs dont have api for non-ref tables, so you're out of luck
17:46:32FromDiscord<jtv> There's not a static object constructor for that, yeah
17:51:02FromDiscord<jtv> You might be able to statically initialize by initializing the individual components, but that would be a lot of pain to shave off a few cycles at startup
17:54:07*jmdaemon quit (Ping timeout: 256 seconds)
18:02:59*jmdaemon joined #nim
18:22:08FromDiscord<JonasL> why is deepcopy hiding behind a compiler flag for arc/orc?
18:29:21FromDiscord<@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4kqv
18:31:42FromDiscord<@thatrandomperson5-6310e3b26da03> I can’t seem to track why the error is happening
18:40:04*jmdaemon quit (Ping timeout: 260 seconds)
18:47:54FromDiscord<JonasL> Do I have to use ref seq to use seq as a reference type? Would that introduce a double indirection, since I suspect that seq is stored on the heap internally?
19:07:45FromDiscord<jtv> No, declaring it a ref means you'll have to explicitly new it, and the language will put it on the heap unless it knows it's safe to leave on the stack
19:08:20FromDiscord<planetis> In reply to @JonasL "Do I have to": yep its double indirection, unless you care so much to implement a cow seq type with destructors
19:09:37*arkurious joined #nim
19:17:08*jmdaemon joined #nim
19:21:36FromDiscord<WabileM> Jester
19:25:16*jjido joined #nim
19:25:34FromDiscord<planetis> In reply to @@thatrandomperson5-6310e3b26da03 "Im getting this error": need to use initTable and don't try to access fields that are not public. Also you might be including the file instead of import
19:33:36FromDiscord<@thatrandomperson5-6310e3b26da03> i used `toTable`. Also, i am importing, not including. Also, the error has no tracbacks in my file↵(@planetis)
19:35:03FromDiscord<planetis> I dunno maybe use a newer version than 1.4.8
19:36:12FromDiscord<justinn> I have a nooby question about nim's FFI, I have a `.so` containing some procedures that return `string` which I just found out caused segfaults more often than not (it used to work for a while, then later not at all), with `cstring`s it works just fine. Could it be that the garbage collector cleans them up before the parent process accesses them?
19:45:03*jmdaemon quit (Ping timeout: 260 seconds)
19:53:26*jmdaemon joined #nim
19:56:09*mahlon quit (Quit: PotatoTech)
20:04:07*jmdaemon quit (Ping timeout: 252 seconds)
20:15:35FromDiscord<djazz> @PMunch Sent you a Futhark PR 😄 for extern vars
20:15:53*pro joined #nim
20:18:36*pro quit (Client Quit)
20:18:56FromDiscord<fabricio> Why do I get the error `cmdfile(1, 16) Error: ordinal type expected` when I try to do `echo 'a' notin {'\0'..<'a', succ('a')..high(char)}` and what can I do to make this work
20:20:25*jmdaemon joined #nim
20:21:50Amun-Rafabricio: replace ..< with ..
20:23:06FromDiscord<jtv> The < is "up to but not including"
20:23:33FromDiscord<fabricio> In reply to @Amun-Ra "<@607600292086939696>: replace ..< with": thanks, it worked↵any reason why `..<` wasn't working?
20:24:14Amun-Rafabricio: I know it does not work that way, I don't remember why is that
20:26:13FromDiscord<Solitude> In reply to @fabricio "thanks, it worked any": `..<` is an iterator/slice constructor. there is no special case to support it in range/set constructors.
20:26:44FromDiscord<fabricio> ok thanks
20:43:52FromDiscord<planetis> In reply to @justinn "I have a nooby": could be only use orc.
20:44:01FromDiscord<planetis> (edit) "orc." => "arc/orc."
20:49:48FromDiscord<justinn> I tested out all the `--mm:` options and could verify that `orc, arc` segfaulted, while all the other algorithms ran like expected, weird
20:54:17FromDiscord<planetis> can you explain again your setup? You have a dynamic library written in nim, trying to use from ?
20:57:48FromDiscord<planetis> also if your problem is not fixed here, feel free to open an issue on the forum. Just try to provide more useful info.
21:02:49FromDiscord<justinn> The binary and the dynlibs are both written in Nim, I load them at runtime and then call a `proc run(): string` function.↵That call fails with orc and arc, but not with the other GC algorithms, let me try to code up an MRE
21:13:56FromDiscord<sOkam!> is there an operator that divides uint64, and returns a float?↵I'm trying `/`, but its complaining it wants float
21:14:26FromDiscord<justinn> sent a code paste, see https://play.nim-lang.org/#ix=4krc
21:14:57FromDiscord<Elegantbeef> `/` is the way
21:14:58FromDiscord<Elegantbeef> Though only works with `int` i guess
21:15:23FromDiscord<justinn> (edit) "https://play.nim-lang.org/#ix=4krc" => "https://play.nim-lang.org/#ix=4krd"
21:22:18FromDiscord<planetis> @justinn cannot reproduce on devel, I run it with sanitizers as well
21:24:10FromDiscord<justinn> Run it with sanitizers? whats that? sry, really new to nim
21:35:51FromDiscord<planetis> sure no problem, I should have said earlier, my build commands is: ``nim c --cc:clang --mm:orc --panics:on --threads:on --threadanalysis:off --tlsEmulation:off -t:"-fsanitize=address,undefined" -l:"-fsanitize=address,undefined" -d:nosignalhandler -d:release -g parent.nim``
21:36:46FromDiscord<planetis> if you use gcc need to replace/remove --cc:clang argument and also there should be some packages installed
21:37:54FromDiscord<planetis> gcc-libs on arch
21:45:12FromDiscord<planetis> I removed some unnecessary ones: ``nim c --cc:clang --mm:arc --panics:on -t:"-fsanitize=address,undefined" -l:"-fsanitize=address,undefined" -d:nosignalhandler -d:release --app:lib -g child`` still the same
21:46:07FromDiscord<planetis> (edit) "ones:" => "options:"
21:54:37*mahlon joined #nim
22:13:50FromDiscord<justinn> Huh, yup, that works, weird
23:33:15*derpydoo quit (Ping timeout: 260 seconds)
23:37:24FromDiscord<! Nilts> how would i install nim using choosenim and the `-y` option as described here: https://github.com/dom96/choosenim/blob/master/scripts/choosenim-unix-init.sh#L73
23:40:41FromDiscord<! Nilts> I basically need to force yes or no for automated choosenim installation
23:42:56*azimut quit (Ping timeout: 255 seconds)
23:43:04*azimut_ joined #nim
23:46:15FromDiscord<! Nilts> nvm, i figured it out
23:58:55*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)