00:01:26 | FromDiscord | <!Patitotective> how should i cast a `seq[string]` to `seq[cstring]`? `cast[seq[cstring]](mySeq)` doesnt seem to work |
00:01:59 | FromDiscord | <Elegantbeef> You cannot |
00:02:06 | FromDiscord | <Elegantbeef> you need to make a new sequence of cstrings |
00:02:18 | FromDiscord | <Elegantbeef> remember `cstring` is a `ptr char` it's not an allocated collection |
00:03:15 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3YBr |
00:03:24 | FromDiscord | <Elegantbeef> That should atleast explain that `b` reuses `a`'s memory |
00:13:07 | FromDiscord | <luteva> Hi! I want to compare a DateTime, parsed from a string with a creationtime of a file, using getCreationTime.↵So the first returns a Datetime the other one returns a times.Time object. so what is the correct way to do that? converting from time to datetime? or the other way around? or use different procs to get the creation(date)time of a file? |
00:14:07 | FromDiscord | <Elegantbeef> `getCreationTime` returns `Time` and `parseTime` returns `Time` |
00:15:25 | * | noeontheend joined #nim |
00:16:01 | FromDiscord | <luteva> oh yes of course! there's the timezone in parseTime, alright. thank you! |
00:16:17 | FromDiscord | <Elegantbeef> No problem |
00:22:14 | * | noeontheend quit (Ping timeout: 255 seconds) |
00:41:34 | FromDiscord | <Elegantbeef> Ok i'm quite surprised that Nim didnt explode implementing a `Sentinel` type |
00:41:36 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3YBt |
00:42:02 | * | vicfred joined #nim |
00:44:00 | FromDiscord | <huantian> static auto generic... |
00:44:11 | FromDiscord | <Elegantbeef> Yea i didnt expect it to work |
00:44:43 | NimEventer | New question by itil memek cantik: Nim to use identifier names space, see https://stackoverflow.com/questions/72385515/nim-to-use-identifier-names-space |
00:58:25 | * | xet7 quit (Remote host closed the connection) |
01:00:41 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "https://play.nim-lang.org/#ix=3YBt": _\visible confusion\_ |
01:04:26 | FromDiscord | <Elegantbeef> It's like `std/options` but uses 0 extra memory |
01:04:52 | FromDiscord | <Elegantbeef> You specify an invalid value |
01:06:00 | FromDiscord | <demotomohiro> `Sentinel` is a distinct type and specified value is sentinel value. |
01:08:11 | FromDiscord | <demotomohiro> `distinctBase <https://nim-lang.org/docs/typetraits.html#distinctBase.t%2CT%2Cstaticbool>`_ is used. |
01:08:27 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/typetraits.html#distinctBase.t%2CT%2Cstaticbool |
01:11:03 | FromDiscord | <!Patitotective> and why would i want a sentinel? |
01:11:19 | FromDiscord | <!Patitotective> (edit) "and why would i want a sentinel? ... " added "like when" |
01:11:37 | FromDiscord | <Elegantbeef> When you want option but dont want to take up extra memory |
01:16:03 | FromDiscord | <huantian> actually that would be kinda convenient if all the valid values were `Positive` and you could just have `-1` be the sentinel |
01:16:19 | FromDiscord | <Elegantbeef> You can do that with a overload 😄 |
01:16:30 | FromDiscord | <huantian> yeah but it's not as ✨ fancy ✨ |
01:16:37 | FromDiscord | <demotomohiro> !eval import options; echo sizeof(Option[int]), ", ", sizeof(int) |
01:16:40 | NimBot | 16, 8 |
01:20:25 | FromDiscord | <Elegantbeef> What do you mean huan? |
01:20:38 | FromDiscord | <Elegantbeef> `sentinal(100, Positive)`? |
01:23:14 | arkanoid | I'm looking into a native windows dll with a disassembler. Some exported functions are __cdecl, some other are __stdcall, I'm puzzled |
01:24:07 | FromDiscord | <huantian> In reply to @Elegantbeef "`sentinal(100, Positive)`?": sentinalVal would be -1 as `-1..high(int)` then the value it would hold would be a Positive↵but it seems like a kinda bad idea lol |
01:25:25 | FromDiscord | <Elegantbeef> you can just do range.low.prev or pred w/e it is |
01:29:56 | FromDiscord | <huantian> true, as long as the range isn't low(int)..high(int) you could automatically choose a sentinel for range types |
01:30:14 | FromDiscord | <Elegantbeef> This nerd thinking only with ints |
01:30:24 | FromDiscord | <Elegantbeef> Enums are the same |
01:31:56 | FromDiscord | <huantian> I meannnn enums are just fancy ints 😛 |
02:17:27 | FromDiscord | <sken130> Hi, I registered my account in https://forum.nim-lang.org, but I still haven't received the confirmation after 23 hours. What should I do? |
02:17:44 | FromDiscord | <ambient> it's all a bunch of nand gates in the end |
03:19:00 | FromDiscord | <Elegantbeef> Ping dom96 is what most do 😄↵(@sken130) |
03:19:41 | FromDiscord | <sken130> @dom96 Hi, I registered my account in https://forum.nim-lang.org/, but I still haven't received the confirmation email after 23 hours. What should I do? |
04:30:56 | * | ltriant quit (Ping timeout: 258 seconds) |
05:04:17 | FromDiscord | <Elegantbeef> @treeform\: does pixie presently have a "Render to quad with a given font size, or shrink to best fit if too large" feature? |
05:10:48 | * | ltriant joined #nim |
05:12:48 | FromDiscord | <treeform> No it does not. You can probably make it one in like 10 lines |
05:12:58 | FromDiscord | <treeform> just compute layout on font you have |
05:13:22 | FromDiscord | <treeform> dec font size if it does not fit |
05:13:24 | FromDiscord | <treeform> and try again |
06:27:45 | FromDiscord | <my mom said 👇> how do i use parseopt to select a file |
06:28:59 | FromDiscord | <my mom said 👇> sent a code paste, see https://paste.rs/jUs |
07:19:29 | FromDiscord | <mbrc> Is the result of every typeof call known at compile time? |
07:20:03 | FromDiscord | <Elegantbeef> Yes |
07:21:34 | FromDiscord | <my mom said 👇> ik how to do the output part but not getting how to get the file |
07:22:27 | FromDiscord | <Elegantbeef> If you dont need options just use `os` `paramstr`s |
07:29:47 | FromDiscord | <Elegantbeef> To elaborate mbrc all types are known statically in Nim, so there is no way to have `typeof` run at runtime, types dont even exist there 😄 |
07:33:20 | FromDiscord | <my mom said 👇> In reply to @Elegantbeef "If you dont need": damn how do i use it |
07:33:31 | FromDiscord | <my mom said 👇> the docs ain't helping |
07:33:31 | FromDiscord | <Elegantbeef> Do you read docs or just ask questions |
07:33:40 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/os.html#paramStr%2Cint |
07:33:56 | FromDiscord | <my mom said 👇> In reply to @uncle jim "the docs ain't helping": this |
07:33:59 | FromDiscord | <Elegantbeef> Well formulate an actual question |
07:34:47 | FromDiscord | <my mom said 👇> sent a code paste, see https://play.nim-lang.org/#ix=3YCa |
07:35:22 | FromDiscord | <Elegantbeef> You do `let myFile = paramStr(1)` |
07:35:26 | FromDiscord | <Elegantbeef> Then you're done |
07:36:02 | FromDiscord | <my mom said 👇> In reply to @Elegantbeef "You do `let myFile": hmmmm got it thenks |
07:36:46 | * | jjido joined #nim |
07:38:03 | FromDiscord | <mbrc> I see, thanks for the clarification. I was getting confused by all the typeof calls in the template examples in the manual. |
07:45:30 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
07:49:08 | * | ltriant quit (Ping timeout: 246 seconds) |
09:09:59 | FromDiscord | <dom96> In reply to @Elegantbeef "Ping dom96 is what": Ping `@Moderator`. Any mod can activate accounts on the forum. |
09:42:46 | FromDiscord | <sken130> <@&371760044473319454> Hi, I registered my account in https://forum.nim-lang.org/, but I still haven't received the confirmation email after 23 hours. What should I do? |
09:46:46 | FromDiscord | <PMunch> It says your account is already a user |
09:47:00 | FromDiscord | <PMunch> Not sure if Dom already fixed it |
09:55:37 | FromDiscord | <dom96> yep, I fixed it |
09:55:51 | FromDiscord | <sken130> Oh, thanks a lot. |
10:09:50 | * | jjido joined #nim |
10:11:03 | * | ltriant joined #nim |
10:44:33 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
11:06:44 | FromDiscord | <Othello> sent a code paste, see https://paste.rs/Vrd |
11:07:35 | FromDiscord | <Othello> (edit) "https://play.nim-lang.org/#ix=3YCI" => "https://play.nim-lang.org/#ix=3YCH" |
11:08:34 | FromDiscord | <Othello> (edit) "https://play.nim-lang.org/#ix=3YCH" => "https://paste.rs/1ee" |
11:08:46 | arkanoid | I'm looking into a native windows dll with a disassembler. Some exported functions are __cdecl, some other are __stdcall, I'm puzzled |
11:10:13 | arkanoid | what would cause this? do I have to cimport them following this difference? |
11:15:10 | FromDiscord | <Andreas> @Othello your variant type-definition would help now or a minimal thing in the playground |
11:16:06 | FromDiscord | <Othello> Hi @Andreas ! Here the full variant-type definition. Sorry it's a bit long: |
11:16:19 | FromDiscord | <Othello> sent a code paste, see https://play.nim-lang.org/#ix=3YCN |
11:16:28 | FromDiscord | <Rika> That’s a chonker |
11:16:47 | FromDiscord | <Rika> When it’s an error from the C compiler it’s usually a compiler issue |
11:19:50 | FromDiscord | <Andreas> In reply to @Rika "When it’s an error": @Rika maybe better to ask at #internal ? sry @Othello u need more competence than i can provide |
11:20:46 | FromDiscord | <Rika> Othello’s error involves a C compiler error |
11:22:27 | FromDiscord | <Andreas> In reply to @Rika "Othello’s error involves a": so this a issue for #main or github ? |
11:23:02 | FromDiscord | <Rika> I mean a compiler issue in that issue means its dictionary definition |
11:23:30 | FromDiscord | <Rika> I have a suspicion it’s the var return and inline |
11:24:27 | FromDiscord | <Othello> Thanks @Rika and @Andreas! Shall I open an issue on Github then? Or should we move this to #internal? |
11:26:07 | FromDiscord | <Othello> I have a hard time pinning down the bug to a small reproducible example |
11:49:19 | FromDiscord | <Othello> Removing the `{.inline.}` pragma on `append` doesn't fix it |
12:04:10 | FromDiscord | <konsumlamm> In reply to @Othello "Thanks <@259277943275126785> and <@7542845173168865": this is a bug and the github issue teacker is for bug reports, so yes, open an issue |
12:15:03 | * | arkurious joined #nim |
12:48:44 | * | djanatyn1 quit (Ping timeout: 250 seconds) |
12:49:08 | * | djanatyn1 joined #nim |
13:32:57 | * | rockcavera quit (Remote host closed the connection) |
13:40:03 | FromDiscord | <Othello> Thanks @konsumlamm , @Rika and @Andreas . I have submitted a Gihub issue over there: https://github.com/nim-lang/Nim/issues/19833↵↵I have managed to distill the problem down to the following minimal reproducible example (also posted on the GH issue): https://play.nim-lang.org/#ix=3YDf |
13:46:39 | FromDiscord | <Othello> In the meantime, would you have a recommendation to circumvent the issue? |
13:47:12 | FromDiscord | <Yardanico> @Othello don't use `discardable`, your example in the github issue works without that |
13:47:26 | FromDiscord | <Yardanico> or as an alternative - just don't return the var string itself after changing it |
13:49:30 | FromDiscord | <Othello> Thanks @Yardanico! Indeed, it does fix it, thanks a lot! I just wanted to be able to chain the calls - would you recommend mechanism other than returning the var string to achieve that? |
13:49:50 | FromDiscord | <Yardanico> oh, if you want to chain, then you have to do it this way I guess |
13:50:15 | FromDiscord | <Othello> `discard`ing explicitly is a lesser evil, will definitely work for now! |
14:12:11 | om3ga | Hi everybody! do we have something that frees allocated heap? I created signal handler where all shared ram being freed, but valgrind still reports that there is something in ram |
14:13:01 | FromDiscord | <Yardanico> no, Nim trusts the OS to clean up all the unfreed stuff on program exit, that's why it doesn't free things like global variables |
14:13:17 | FromDiscord | <Yardanico> "something in ram" is probably global variables or something, it's nothing to worry about |
14:13:55 | FromDiscord | <Yardanico> of course it might be a leak, but you need to check what exactly valgrind is saying |
14:16:44 | FromDiscord | <John0> Is the email verification for nim forum broken? |
14:16:55 | FromDiscord | <John0> (edit) removed "the" |
14:17:00 | om3ga | Yardanico, thanks for explanation. I don't had before too much experience with shared, so I hope freeShared will do it's job |
14:17:40 | FromDiscord | <Yardanico> In reply to @John0 "Is email verification for": it's not broken, but in a lot of cases the emails don't get past the email providers checks |
14:17:46 | FromDiscord | <Yardanico> what's your username? i can activate you manually |
14:17:47 | om3ga | I mean in handler, since last time I used custom handlers in C, it was strong pain |
14:17:58 | FromDiscord | <John0> Jon |
14:19:04 | FromDiscord | <Yardanico> In reply to @John0 "Jon": activated |
14:19:17 | FromDiscord | <John0> In reply to @Yardanico "activated": Thanks |
14:27:16 | FromDiscord | <stoneface> how do you get a command line switch in nimscript? Like how do I check `cc` is `vcc`? |
14:30:23 | FromDiscord | <Yardanico> In reply to @stoneface "how do you get": one way is https://nim-lang.org/docs/nimscript.html#getCommand |
14:30:32 | FromDiscord | <Yardanico> or you can just check `if defined` i think |
14:30:39 | FromDiscord | <Yardanico> but not sure, lemme dig a bit more, I don't use nimscript that much |
14:34:35 | FromDiscord | <stoneface> getCommand doesn't give you the switches though |
14:35:16 | FromDiscord | <Yardanico> there is https://nim-lang.org/docs/compilesettings.html but I'm not sure if it works for Nimscript |
14:35:46 | FromDiscord | <Yardanico> In reply to @stoneface "getCommand doesn't give you": if you mean `define`, you can probably check them in nimscript with the usual `when defined` |
14:41:47 | FromDiscord | <stoneface> like `when defined(cc):`? |
14:42:19 | FromDiscord | <stoneface> tried that and it evaluates to false for `cc` and `vcc` |
14:43:20 | FromDiscord | <stoneface> I could parse `os.commandLineParams` but I'd rather not do that if I don't have to |
14:49:10 | * | haliucinas quit (Ping timeout: 260 seconds) |
15:04:35 | FromDiscord | <stoneface> just trying to pass `/nologo` when building a static library with vcc since nim doesn't |
15:09:50 | FromDiscord | <Yardanico> In reply to @stoneface "just trying to pass": you can just add an option specifically to vcc |
15:10:26 | FromDiscord | <Yardanico> check the main nim config, it has a lot of this stuff https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg |
15:10:46 | FromDiscord | <Yardanico> In reply to @stoneface "just trying to pass": also it does seem to pass /nologo to VCC so it's weird https://media.discordapp.net/attachments/371759389889003532/979401209725218816/unknown.png |
15:11:57 | FromDiscord | <stoneface> yeah it only doesn't pass it for `--app:staticLib` |
15:14:56 | FromDiscord | <stoneface> in the nimcache json, it uses `lib` as the linkcmd instead of `vccexe.exe` and also doesn't use any of the flags passed via --passL |
15:15:26 | FromDiscord | <stoneface> so I'm not sure if tweaking the config will help |
15:32:16 | * | soileh joined #nim |
15:48:56 | FromDiscord | <demotomohiro> In general, a program that links object files and generate an exetuable file and a program that link object files and generate static link file is different. So you cannot simply pass linker options to `ar` or `lib` commands. |
15:49:59 | FromDiscord | <demotomohiro> We might need additional option for `ar` or `lib`. |
15:56:57 | FromDiscord | <demotomohiro> https://github.com/nim-lang/Nim/blob/d81edcacc6740a99b0360cf31ddc2f2a1626006c/compiler/extccomp.nim#L156↵Sending a PR that just adds `/nologo` option to this line would be easiest way. |
16:03:34 | FromDiscord | <demotomohiro> It seems currently there is no way to pass additional options to `ar` or `lib` command excepts editing `compiler/extccomp.nim`. Probably we dont need to pass additional options to these commands in most case. |
16:13:56 | FromDiscord | <stoneface> ah right it's an archiver not a linker, passL doesn't make sense for this context |
16:15:23 | FromDiscord | <stoneface> so a `--passA:<flags>` option would be nice but yeah I don't think most people will need that |
16:57:04 | * | rockcavera joined #nim |
16:57:05 | * | rockcavera quit (Changing host) |
16:57:05 | * | rockcavera joined #nim |
17:15:30 | * | noeontheend joined #nim |
17:19:30 | * | noeontheend quit (Ping timeout: 240 seconds) |
17:58:09 | * | jjido joined #nim |
18:38:09 | * | xet7 joined #nim |
18:39:44 | FromDiscord | <RootofFear> Anyone know of a functioning audio library capable of playing on a device of choice, and multiple devices at the same time(with or without threading). Other things that would be dope are the ability to playback a wav file on only one channel of an audio device. As well as easily integrated audio control. |
18:43:00 | FromDiscord | <RootofFear> I had been trying to use OpenAL but it had lots of issues with devices. |
18:43:53 | om3ga | noob questuon, I need to close socket, and use proc from std/net. but compiler warns that close(file) is choosen |
18:44:02 | om3ga | what can I do :D |
18:51:56 | FromDiscord | <Yardanico> wdym "warns" ? |
18:52:09 | FromDiscord | <Yardanico> it can't choose a close for a file if you're closing a socket, they have different types |
18:52:12 | FromDiscord | <Yardanico> @om3ga |
18:52:29 | FromDiscord | <Yardanico> is your socket an actual socket or a file descriptor? |
18:55:57 | FromDiscord | <stoneface> In reply to @RootofFear "Anyone know of a": check out https://miniaud.io |
18:56:34 | FromDiscord | <stoneface> don't think there's any nim bindings but it's a header only C library so it shouldn't be too difficult to interface with it |
18:56:41 | om3ga | Yardanico, real socket |
18:56:52 | FromDiscord | <Yardanico> if it's a nim socket, just call `close` on it no problem |
18:56:58 | FromDiscord | <Yardanico> i mean if you created it in nim |
18:57:08 | om3ga | ah, no,it's cint |
18:57:35 | om3ga | or I can try to cast it to that type |
18:59:19 | FromDiscord | <Yardanico> you just close the socket as a file descriptor then |
19:11:30 | om3ga | it segfaults, but close from std/posix worked |
19:15:50 | om3ga | swesome, found the way how to unblock FCGX_Accept_r and gracefully shutdown all the threads |
19:16:58 | om3ga | I think it would be great if some easy mechanism will exist for thread termination. maybe based on signals or something |
20:30:36 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
20:31:47 | * | xet7 quit (Remote host closed the connection) |
21:19:24 | * | jjido joined #nim |
22:16:53 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
22:22:54 | * | ehmry quit (Ping timeout: 250 seconds) |
22:31:51 | * | krux02 joined #nim |
22:33:25 | FromDiscord | <ripluke> How can I use Nim to make a file and write some lines to it |
22:33:54 | FromDiscord | <dom96> `writeFile("filename.txt", "file contents")` |
22:42:53 | * | xet7 joined #nim |
22:47:55 | FromDiscord | <Elegantbeef> You can use the streams API depending |
23:47:44 | FromDiscord | <commander_c> https://play.nim-lang.org/#ix=3YFy |
23:47:55 | FromDiscord | <commander_c> Hi all, looking for assist with indentation error here. No clue... |
23:48:02 | FromDiscord | <commander_c> (New to Nim) |
23:48:27 | FromDiscord | <Elegantbeef> `"Date: ", line` is invalid code |
23:48:41 | FromDiscord | <Elegantbeef> do you mean `"Date: " & line`? |
23:49:03 | FromDiscord | <commander_c> Oh is & needed for concatenation? I'm assuming line is a regular string I guess. |
23:49:17 | FromDiscord | <Elegantbeef> `&` is collection concatenation yes |
23:49:33 | FromDiscord | <commander_c> Thank you bot, what is a collection? |
23:49:43 | FromDiscord | <Elegantbeef> sequence, string |
23:49:49 | FromDiscord | <Elegantbeef> I'm not a bot! |
23:50:05 | FromDiscord | <commander_c> Cool, thanks & apologies |
23:50:09 | FromDiscord | <Elegantbeef> Do you have an example of the file btw? |
23:50:27 | FromDiscord | <commander_c> I could put one together. Let me see. |
23:51:39 | FromDiscord | <Andreas> https://play.nim-lang.org/#ix=3YFz |
23:51:45 | FromDiscord | <Elegantbeef> also line 34 isnt updating the date |
23:51:52 | FromDiscord | <Elegantbeef> line 34 is declaring a new variable |
23:52:00 | FromDiscord | <Elegantbeef> Ah andreas got it |
23:52:34 | FromDiscord | <commander_c> Oh cool. Thanks to Andreas, I'm just putting this demo file together rn |
23:52:45 | FromDiscord | <commander_c> Is there a way to see a diff or should I manage that here |
23:52:47 | FromDiscord | <Elegantbeef> worth noting also line 21 does nothing |
23:53:04 | FromDiscord | <Elegantbeef> You'll have to diff it yourself |
23:54:05 | FromDiscord | <commander_c> https://pastebin.com/NhBF5Uda |
23:54:08 | FromDiscord | <commander_c> There's the demo file. |
23:55:17 | FromDiscord | <Elegantbeef> is `+billed` always at the end? |
23:55:18 | FromDiscord | <commander_c> OK, so what I'm learning today is that collections are a thing, that they are concatted with &, and that I need to watch that I'm not declaring vars where I mean to assign values to them. |
23:55:38 | FromDiscord | <commander_c> No, +billed can be anywhere |
23:55:56 | FromDiscord | <commander_c> Once it's found we're not working with current timesheet data anymore. |
23:56:17 | FromDiscord | <commander_c> Like, "below this point in the file was already billed" |
23:57:08 | FromDiscord | <Elegantbeef> Ah was going to mention the `endswith` and `startswith` procedures |
23:57:41 | FromDiscord | <commander_c> Oh, line 21 isn't needed? Weird, I swear I got that from some example. So "line in lines" takes care of opening that? |
23:58:04 | FromDiscord | <Elegantbeef> Yep `lines` opens the file and iterates all it's lines |
23:59:08 | FromDiscord | <commander_c> Oh, those procedures would be great, I'll check them out. |
23:59:55 | FromDiscord | <commander_c> I don't like contains..."### 20" at all but I'll be retired by the time we hit the year 2100 hopefully |