00:38:12 | * | jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in) |
00:40:50 | FromDiscord | <djazz> okay, lwip with futhark is working, managed to do a https request through it |
00:41:40 | FromDiscord | <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:13 | FromDiscord | <djazz> so i cant use header pragma for the #define functions/inline functions |
00:42:22 | FromDiscord | <djazz> static inline |
01:23:15 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
02:09:42 | FromDiscord | <ambient> when you guys talk about Futhark you don't mean this futhark? https://futhark-lang.org/ |
02:09:56 | FromDiscord | <Rika> It is not |
02:09:58 | FromDiscord | <djazz> https://github.com/PMunch/futhark |
02:10:06 | FromDiscord | <ambient> I was super confused |
02:10:16 | FromDiscord | <djazz> mhmm |
02:16:50 | * | azimut quit (Ping timeout: 255 seconds) |
02:35:06 | FromDiscord | <ted__> sent a code paste, see https://play.nim-lang.org/#ix=4knl |
02:36:47 | FromDiscord | <ted__> (edit) "https://play.nim-lang.org/#ix=4knl" => "https://paste.rs/xxz" |
02:40:15 | FromDiscord | <Elegantbeef> Your latest version writes to `table` instead of result |
02:40:26 | FromDiscord | <Elegantbeef> Also why are you using `OrderedTableRef` do you need the reference semantics? |
02:41:05 | FromDiscord | <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:47 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4knm |
02:44:45 | FromDiscord | <ted__> sent a code paste, see https://paste.rs/Amp |
02:44:50 | FromDiscord | <ted__> let me try yours as you have it though |
02:45:21 | FromDiscord | <Elegantbeef> you need to change line 4 in your code |
02:45:27 | FromDiscord | <Rika> Because you don’t change the new call to the init call |
02:45:32 | FromDiscord | <Elegantbeef> `result = initTable[string, seq[T]]()` |
02:46:13 | FromDiscord | <ted__> oh! yours is simpler and removes the initialization I was doing and that fixes it. Thanks Beef! |
02:46:52 | FromDiscord | <Elegantbeef> Technically only `ref` variants of tables need initialised |
02:47:07 | FromDiscord | <Elegantbeef> you can manually initialise them for capacity, but that's between you and your problem |
02:47:29 | FromDiscord | <Elegantbeef> The reason you got a segfault was cause the `ref` was nil and you attempted to derefernece it |
02:47:51 | FromDiscord | <ted__> got it, that makes sense |
03:19:55 | FromDiscord | <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:34 | FromDiscord | <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:45 | FromDiscord | <Jakraes> Basically apt-get can't find nim |
06:36:35 | FromDiscord | <Jakraes> Nvm, I had a typo xd |
06:42:35 | FromDiscord | <Rika> Not recommended |
06:42:46 | FromDiscord | <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:58 | FromDiscord | <fbpyr> sent a long message, see http://ix.io/4ko7 |
07:44:01 | FromDiscord | <Elegantbeef> You want to create a detached process on linux/mac you might be able to pass `poDaemon` |
07:45:10 | FromDiscord | <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:18 | FromDiscord | <fbpyr> I tried poDaemon on linux, but it had the same effect. |
07:47:51 | FromDiscord | <Elegantbeef> Well https://github.com/status-im/nim-daemon i guess |
07:47:54 | FromDiscord | <fbpyr> with `poDaemon` in htop I could see, that mpv was then grouped somewhere under systetemd --user |
07:49:32 | FromDiscord | <fbpyr> Elegantbeef\: thank you for the link! |
07:50:20 | FromDiscord | <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:46 | FromDiscord | <Elegantbeef> Afaict it's like posix fork |
07:52:47 | FromDiscord | <Elegantbeef> https://github.com/status-im/nim-daemon/blob/master/tests/testdaemon.nim#L52-L60 |
07:52:47 | FromDiscord | <Elegantbeef> Example of that |
07:52:53 | FromDiscord | <Elegantbeef> I guess it doesnt work how you want since it'd still have the name of the original process |
07:52:53 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ko8 |
07:53:51 | FromDiscord | <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:28 | FromDiscord | <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:42 | FromDiscord | <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:42 | FromDiscord | <enthus1ast> Thats the tui player\: https://github.com/enthus1ast/muk |
09:56:45 | FromDiscord | <fbpyr> enthus1ast\: thank you so much for the links! |
09:56:45 | FromDiscord | <fbpyr> thank you for the inspiration, I had not yet considered controlling mpv via a lib.. 🤔 |
09:56:46 | FromDiscord | <fbpyr> I'll try muk out - might be a nice cross-platform replacement for cmus. |
09:56:46 | FromDiscord | <enthus1ast> But for your issue, I'm wondering tha poDeamon does not work |
09:56:46 | FromDiscord | <enthus1ast> I waa wanted to have a mocp for windows (that also had some features of ncmcpp) |
09:56:47 | FromDiscord | <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:48 | FromDiscord | <enthus1ast> But I build in too many features too fast |
09:56:49 | FromDiscord | <fbpyr> yeah mocp is another nice one. 🙂 |
09:56:50 | FromDiscord | <enthus1ast> But also unfinished and buggy 🙄 |
09:56:50 | FromDiscord | <fbpyr> well it seems to work for some aspects |
09:56:52 | FromDiscord | <fbpyr> enthus1ast\: muk is super cool! |
09:56:52 | FromDiscord | <enthus1ast> I wanted to have a mocp for windows (that also had some features of ncmcpp) |
09:56:53 | FromDiscord | <fbpyr> on linux it is a new proc as child somewhere from systemd --user |
09:56:54 | FromDiscord | <fbpyr> only that it seems to still have a connection (maybe via stdout?) to the calling process |
09:56:55 | FromDiscord | <enthus1ast> This means it will stop if the calling process is terminated? |
09:56:55 | FromDiscord | <fbpyr> mpv does not terminate when the calling nim-cli is terminated |
09:56:56 | FromDiscord | <fbpyr> in that sense they are nicely disconnected |
09:56:56 | FromDiscord | <fbpyr> so there is some connection, which I ideally would not have. |
09:56:57 | FromDiscord | <fbpyr> only that it seems to still have a connection (maybe via stdout?) to the calling proc |
09:56:57 | FromDiscord | <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:16 | FromDiscord | <Jessa> sent a code paste, see https://play.nim-lang.org/#ix=4koS |
12:21:37 | FromDiscord | <djazz> test.one.ord? |
12:21:52 | FromDiscord | <djazz> ord returns the ordinal |
12:23:34 | FromDiscord | <Jessa> sent a long message, see http://ix.io/4koW |
12:25:32 | FromDiscord | <Jessa> why wouldn't `test.one` not just be an int |
12:28:20 | FromDiscord | <Rika> because theyre ints |
12:28:23 | FromDiscord | <Rika> i mean enums |
12:28:24 | FromDiscord | <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:38 | FromDiscord | <Rika> what if you pass the wrong enum into that func? |
12:28:40 | FromDiscord | <pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4koX |
12:29:05 | FromDiscord | <Rika> In reply to @Jessa "do i need to": in such case, yes consts would be better |
12:30:07 | FromDiscord | <Zoom> How can you say consts are better if it's absolutely unclear what is the code supposed to do? \:D |
12:30:57 | FromDiscord | <Rika> in such case, being the one shown |
12:31:04 | FromDiscord | <Rika> and the one expressed |
12:33:05 | FromDiscord | <Jessa> In reply to @Rika "in such case, being": the only valid way to respond to that |
12:33:42 | FromDiscord | <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:32 | FromDiscord | <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:12 | FromDiscord | <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:17 | FromDiscord | <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:34 | FromDiscord | <Jotrorox> ok |
13:37:53 | FromDiscord | <haoyu> the link about the exception in the article Version 2.0.0 release candidate cannot be opened |
13:39:23 | FromDiscord | <haoyu> https://media.discordapp.net/attachments/371759389889003532/1060553098172575744/IMG_20230105_213839.jpg |
13:51:10 | FromDiscord | <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:17 | FromDiscord | <AmjadHD> sent a code paste, see https://play.nim-lang.org/#ix=4kpv |
14:49:15 | FromDiscord | <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:53 | FromDiscord | <Bung> I guess you can't start it like that , it's not interactive app |
16:01:54 | FromDiscord | <jos> does ORC work with the js target? |
16:01:58 | FromDiscord | <jos> or does it still rely on js gc |
16:02:43 | FromDiscord | <Bung> gc is noop for js target |
16:03:11 | FromDiscord | <jos> so then if u use destructors, u can't cross compile to JS and expect correct behavior? i guess |
16:05:15 | FromDiscord | <AmjadHD> In reply to @Bung "I guess you can't": Then How is it started then ? |
16:08:02 | FromDiscord | <Bung> dunno , havn't try by myself, but the client side should send first message to server for initialization. |
16:09:06 | FromDiscord | <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:34 | FromDiscord | <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:05 | FromDiscord | <planetis> you are forced to when not defined(js): proc =destroy in your library |
16:38:35 | FromDiscord | <jos> i never really thought of it as "programming for JS" |
16:38:45 | FromDiscord | <jos> i thought the whole point was "deploy your app on the web" |
16:39:12 | FromDiscord | <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:22 | FromDiscord | <planetis> It's possible, but need to have a separate when defined(js) for everything |
16:45:41 | FromDiscord | <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:04 | FromDiscord | <planetis> so it's not as black and white you think |
17:02:56 | FromDiscord | <Solitude> In reply to @jos "so then if u": they work only for non-ref objects/arrays, thats it. |
17:03:28 | FromDiscord | <justinn> sent a code paste, see https://paste.rs/Mio |
17:08:59 | FromDiscord | <Solitude> how do you invoke it? |
17:09:35 | FromDiscord | <justinn> `module.get.invoke(req.httpMethod.get.methodToString)` |
17:10:02 | FromDiscord | <Solitude> what would T be in that context? |
17:10:06 | FromDiscord | <Solitude> write an overload without args |
17:14:35 | FromDiscord | <justinn> sent a code paste, see https://play.nim-lang.org/#ix=4kqa |
17:16:05 | FromDiscord | <Solitude> zamn, i didnt think of that... |
17:23:57 | FromDiscord | <Bung> am wondering how your proc returns from symAddr work with generic |
17:27:05 | * | jmdaemon joined #nim |
17:28:55 | FromDiscord | <justinn> tbh. didn't get that far yet, so far I'm only invoking functions without params |
17:34:30 | FromDiscord | <@thatrandomperson5-6310e3b26da03> How would i make a static string table from `strtabs` |
17:37:41 | FromDiscord | <jtv> Meaning const, or meaning available at compile time only? |
17:38:15 | FromDiscord | <@thatrandomperson5-6310e3b26da03> > Meaning const, or meaning available at compile time only?↵Const |
17:39:32 | FromDiscord | <jtv> This is what I do: https://play.nim-lang.org/ |
17:39:35 | FromDiscord | <jtv> Whoops one sec |
17:39:56 | FromDiscord | <jtv> https://play.nim-lang.org/ |
17:40:01 | FromDiscord | <jtv> Why isn't it copying the link? |
17:40:20 | FromDiscord | <jtv> sent a code paste, see https://paste.rs/Ltu |
17:40:22 | FromDiscord | <Solitude> its a test if you're paying attention |
17:40:22 | FromDiscord | <jtv> There you go anyway |
17:41:05 | FromDiscord | <jtv> No something's horked w/ my local cut and paste buffer |
17:41:07 | FromDiscord | <jtv> https://play.nim-lang.org/#ix=4kqh |
17:44:52 | FromDiscord | <@thatrandomperson5-6310e3b26da03> That is not strtabs, i have to use strtabs↵(@jtv) |
17:45:48 | FromDiscord | <Solitude> for some reason strtabs dont have api for non-ref tables, so you're out of luck |
17:46:32 | FromDiscord | <jtv> There's not a static object constructor for that, yeah |
17:51:02 | FromDiscord | <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:08 | FromDiscord | <JonasL> why is deepcopy hiding behind a compiler flag for arc/orc? |
18:29:21 | FromDiscord | <@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4kqv |
18:31:42 | FromDiscord | <@thatrandomperson5-6310e3b26da03> I can’t seem to track why the error is happening |
18:40:04 | * | jmdaemon quit (Ping timeout: 260 seconds) |
18:47:54 | FromDiscord | <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:45 | FromDiscord | <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:20 | FromDiscord | <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:36 | FromDiscord | <WabileM> Jester |
19:25:16 | * | jjido joined #nim |
19:25:34 | FromDiscord | <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:36 | FromDiscord | <@thatrandomperson5-6310e3b26da03> i used `toTable`. Also, i am importing, not including. Also, the error has no tracbacks in my file↵(@planetis) |
19:35:03 | FromDiscord | <planetis> I dunno maybe use a newer version than 1.4.8 |
19:36:12 | FromDiscord | <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:35 | FromDiscord | <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:56 | FromDiscord | <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:50 | Amun-Ra | fabricio: replace ..< with .. |
20:23:06 | FromDiscord | <jtv> The < is "up to but not including" |
20:23:33 | FromDiscord | <fabricio> In reply to @Amun-Ra "<@607600292086939696>: replace ..< with": thanks, it worked↵any reason why `..<` wasn't working? |
20:24:14 | Amun-Ra | fabricio: I know it does not work that way, I don't remember why is that |
20:26:13 | FromDiscord | <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:44 | FromDiscord | <fabricio> ok thanks |
20:43:52 | FromDiscord | <planetis> In reply to @justinn "I have a nooby": could be only use orc. |
20:44:01 | FromDiscord | <planetis> (edit) "orc." => "arc/orc." |
20:49:48 | FromDiscord | <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:17 | FromDiscord | <planetis> can you explain again your setup? You have a dynamic library written in nim, trying to use from ? |
20:57:48 | FromDiscord | <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:49 | FromDiscord | <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:56 | FromDiscord | <sOkam!> is there an operator that divides uint64, and returns a float?↵I'm trying `/`, but its complaining it wants float |
21:14:26 | FromDiscord | <justinn> sent a code paste, see https://play.nim-lang.org/#ix=4krc |
21:14:57 | FromDiscord | <Elegantbeef> `/` is the way |
21:14:58 | FromDiscord | <Elegantbeef> Though only works with `int` i guess |
21:15:23 | FromDiscord | <justinn> (edit) "https://play.nim-lang.org/#ix=4krc" => "https://play.nim-lang.org/#ix=4krd" |
21:22:18 | FromDiscord | <planetis> @justinn cannot reproduce on devel, I run it with sanitizers as well |
21:24:10 | FromDiscord | <justinn> Run it with sanitizers? whats that? sry, really new to nim |
21:35:51 | FromDiscord | <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:46 | FromDiscord | <planetis> if you use gcc need to replace/remove --cc:clang argument and also there should be some packages installed |
21:37:54 | FromDiscord | <planetis> gcc-libs on arch |
21:45:12 | FromDiscord | <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:07 | FromDiscord | <planetis> (edit) "ones:" => "options:" |
21:54:37 | * | mahlon joined #nim |
22:13:50 | FromDiscord | <justinn> Huh, yup, that works, weird |
23:33:15 | * | derpydoo quit (Ping timeout: 260 seconds) |
23:37:24 | FromDiscord | <! 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:41 | FromDiscord | <! 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:15 | FromDiscord | <! Nilts> nvm, i figured it out |
23:58:55 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |