03:18:50 | * | rockcavera quit (Remote host closed the connection) |
03:51:10 | FromDiscord | <sOkam! 🫐> how do you define a multiline string without `\n` added to them? |
03:52:25 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4Irb |
03:53:19 | FromDiscord | <odexine> if that's so why do you need them to be multiline |
03:53:34 | FromDiscord | <sOkam! 🫐> In reply to @odexine "if that's so why": for clarity |
03:53:42 | FromDiscord | <sOkam! 🫐> of the data written in the code |
03:53:59 | FromDiscord | <odexine> sent a code paste, see https://play.nim-lang.org/#ix=4Irc |
03:54:10 | FromDiscord | <sOkam! 🫐> is there an alternative without `&`? |
03:54:13 | FromDiscord | <odexine> no |
03:54:28 | FromDiscord | <sOkam! 🫐> 😔 |
03:54:37 | FromDiscord | <odexine> if you want you can use regular multilines and remove the newlines with some proc |
03:54:53 | FromDiscord | <odexine> which will remove all newlines even if it is explicitly added |
03:55:18 | FromDiscord | <sOkam! 🫐> asking because its for minc codegen, so i don't have string tools or anything, and my multiline becomes \n like nim's one |
03:55:58 | FromDiscord | <odexine> if it's not nim then just make an extra syntax to denote that newlines arent added |
03:56:36 | FromDiscord | <sOkam! 🫐> yeah that's what i was thinking |
04:03:40 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4Ire |
04:04:22 | FromDiscord | <sOkam! 🫐> and `"""` strings cannot be `r` either |
04:19:56 | NimEventer | New post on r/nim by qtless: HappyX And NodeJS, see https://reddit.com/r/nim/comments/172py9b/happyx_and_nodejs/ |
04:38:38 | FromDiscord | <leorize> wdym? \`"""\` strings can \_only\_ be \`r\`↵(@sOkam! 🫐) |
04:39:21 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Irl |
04:39:21 | FromDiscord | <Elegantbeef> Where it doesnt add any newlines |
04:39:29 | FromDiscord | <Elegantbeef> Might be without commas in C, don't recall it's awful |
04:39:38 | FromDiscord | <leorize> no commas in C, yea |
04:44:19 | FromDiscord | <sOkam! 🫐> Seems like `nkCallStrLit` is a thing, triggered by `somename"...."` and works for `"""`... so, awesome! easy to check |
05:09:27 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4Irs |
05:09:51 | FromDiscord | <sOkam! 🫐> it does have some uses in regular nim too, right?↵What does it change exactly? 🤔 |
05:12:31 | FromDiscord | <sOkam! 🫐> like doing `echo"thing"` compared to `echo "thing"`.... is there any differences, other than ignoring the next thing after the second `"` |
05:12:51 | FromDiscord | <Elegantbeef> It turns it into a raw string |
05:13:04 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#lexical-analysis-generalized-raw-string-literals |
05:23:44 | FromDiscord | <xtrayambak> sent a code paste, see https://play.nim-lang.org/#ix=4IrB |
07:04:30 | FromDiscord | <luxurymode> sent a code paste, see https://play.nim-lang.org/#ix=4IrL |
07:08:37 | FromDiscord | <Elegantbeef> Yea in the case of mismatch due to `var` it should be explicit about it |
07:10:02 | FromDiscord | <Elegantbeef> PRs possibly welcomed |
07:46:09 | FromDiscord | <Phil> Question:↵What risks am I exposing myself to by capturing a pointer to a value type? |
07:46:30 | FromDiscord | <Elegantbeef> Dangling pointers |
07:47:57 | FromDiscord | <Phil> Mostly wondering because in an owlkettle widget, you know that your `AppState` instance is around forever.↵So say AppState has a field of type int.↵If you have a pointer to that and you know AppState is never getting free'd, is there actually a risk? |
07:48:35 | FromDiscord | <Elegantbeef> No |
07:50:07 | FromDiscord | <Phil> Facepalm moment↵I just realized I had an entirely wrong mental model of memory regarding ref-types that contain value-types and didn't even notice and that made absolutely no sense |
07:50:33 | FromDiscord | <Elegantbeef> I mentioned multiple times lifetime matters for ptr |
07:50:36 | FromDiscord | <Phil> Somehow my brain concocted together that the ref-type is stored in heap and if it has a value-type field that somehow gets stored in stack. |
07:50:51 | FromDiscord | <Phil> Which makes around 0 sense. |
07:51:07 | FromDiscord | <Elegantbeef> Right that seems to be a common mistake |
07:51:41 | FromDiscord | <Phil> I don't even know how I got to that model, I guess it's just "if value-type = stack" applied to fields |
07:52:13 | FromDiscord | <Phil> So getting pointers to that, while still cursed, in a controlled environment seems okay |
07:52:33 | FromDiscord | <Elegantbeef> Yea it's a misconception caused by the phrase "values are stack allocated" |
07:53:04 | FromDiscord | <Elegantbeef> Should be 'value types can be stack allocated' |
07:53:47 | FromDiscord | <Phil> "Value-types that are at the top-level and not fields of other types are stack allocated" doesn't roll of the tongue that smoothly |
07:54:09 | FromDiscord | <Phil> Well, I guess not even top-level is correct here as that word is taken up by talking about scope levels |
07:54:54 | FromDiscord | <Elegantbeef> Top level's not even true 😛 |
07:55:54 | FromDiscord | <Phil> ?↵I meant basically "If your value type is not a field of anything else, it will guaranteed be stack allocated", is that wrong? |
07:56:06 | FromDiscord | <Elegantbeef> Yes |
07:56:21 | FromDiscord | <Phil> Because of `new(ValueType)`? |
07:56:37 | FromDiscord | <Elegantbeef> No, cause you can put data in static memory |
07:57:35 | FromDiscord | <Phil> Static memory is a new word in my vocabulary, does that refer to the memory where static proc definitions and const values are stored? |
07:58:17 | FromDiscord | <Elegantbeef> Though I don't recall if `{.global.}` actually is `static` in C |
07:58:17 | FromDiscord | <Elegantbeef> Taking the address of a static allocated type is always safe as it's practically a program globaal |
07:58:47 | FromDiscord | <Elegantbeef> It'll never be reallocated and is always accessible |
08:00:18 | FromDiscord | <Phil> For discord user reference:↵The bridge ate a line from beef:↵> No, cause you can put data in static memory |
08:01:32 | FromDiscord | <Phil> What things get put in static memory? ↵I assume it's not everything at top level |
08:02:12 | FromDiscord | <Elegantbeef> It should be all toplevel any `{.global.}` |
08:02:21 | FromDiscord | <Elegantbeef> I don't know what Nim exactly puts in static memory |
08:02:32 | FromDiscord | <Elegantbeef> I was just being needlessly pedantic |
08:07:15 | * | azimut quit (Ping timeout: 252 seconds) |
08:39:56 | * | rockcavera joined #nim |
09:24:02 | FromDiscord | <ebahie> sent a code paste, see https://play.nim-lang.org/#ix=4Is3 |
09:25:25 | FromDiscord | <ebahie> sent a code paste, see https://play.nim-lang.org/#ix=4Is4 |
09:35:51 | * | jkl quit (Quit: Gone.) |
09:45:51 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Is7 |
09:46:20 | FromDiscord | <Phil> It'll return the last expression of "block" as the value for the if-statement |
09:48:20 | FromDiscord | <ebahie> but how would i reference token as the content of tokenFile in writeFile? |
09:48:25 | FromDiscord | <ebahie> (edit) "but how would i ... reference" added "be able" |
09:48:28 | FromDiscord | <ebahie> (edit) "but how would i be able ... reference" added "to" |
09:49:56 | FromDiscord | <ebahie> because doing `writeFile(tokenFile, token)` within `let token` does not work |
09:50:24 | * | jkl joined #nim |
10:01:50 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Isa |
10:02:21 | FromDiscord | <Phil> You're after the value of input, not after what's in token, no? |
10:02:36 | FromDiscord | <Phil> (edit) "after what's in token," => "necessarily the token variable itself," |
10:04:16 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Isb |
10:05:03 | FromDiscord | <Phil> Note though if you're writing an if-statement this complex you're (for readabilities sake) better served just writing a proc "getToken" or something like it |
10:06:38 | FromDiscord | <hotdog6666> sent a code paste, see https://play.nim-lang.org/#ix=4Isc |
10:07:20 | FromDiscord | <Phil> Hm, could've sworn I had syntax issues last time I tried this kind of thing without block, 🤷 oh well.↵TIL |
10:12:18 | FromDiscord | <hotdog6666> In reply to @isofruit "Hm, could've sworn I": Not sure about that, maybe a nesting issue? |
10:12:25 | FromDiscord | <hotdog6666> How's your webdev stuff going these days? |
10:22:22 | FromDiscord | <kcvinker5420> sent a code paste, see https://play.nim-lang.org/#ix=4Isg |
10:27:21 | * | junaid_ joined #nim |
10:49:48 | FromDiscord | <hotdog6666> In reply to @kcvinker5420 "I am using my": You can qualify usages of WPARAM by adding the module like the error says, or exclude it from the import of one of the modules |
10:50:28 | FromDiscord | <kcvinker5420> In reply to @hotdog6666 "You can qualify usages": My gui lib is independent from winim. |
10:50:42 | FromDiscord | <kcvinker5420> So I cannot use any data types from winim. |
10:50:50 | FromDiscord | <kcvinker5420> I just want to use the com module |
10:51:32 | FromDiscord | <hotdog6666> In reply to @kcvinker5420 "My gui lib is": But you are importing winim? |
10:51:48 | FromDiscord | <kcvinker5420> In reply to @hotdog6666 "But you are importing": Just for com module |
10:51:56 | FromDiscord | <hotdog6666> I’m not sure what you are trying to do. Can you paste the actual code? |
10:51:59 | FromDiscord | <kcvinker5420> I don't want any other stuff from winim |
10:52:35 | FromDiscord | <kcvinker5420> I am sorry, I cannot paste the complete code. But I can paste the import statements |
10:55:33 | FromDiscord | <hotdog6666> Ok just try the two options I pasted above |
10:57:49 | * | PMunch joined #nim |
11:00:39 | FromDiscord | <kcvinker5420> In reply to @hotdog6666 "Ok just try the": All win32 datatypes are declared in my gui library. The same types are declared in winim library. I cannot depend winim for data types. I only need the com module. So I think making com related code a separate program is the best idea. I can start it from my program and collect the output from it's stdout |
11:26:41 | NimEventer | New thread by askodev: Type mismatch on Future's, see https://forum.nim-lang.org/t/10537 |
11:36:51 | * | junaid_ quit (Quit: leaving) |
11:41:24 | * | junaid_ joined #nim |
11:46:12 | * | krux02 joined #nim |
11:50:47 | * | junaid_ quit (Remote host closed the connection) |
12:26:34 | arkanoid | what does it mean to have type Foo = distinct object" ? |
12:27:51 | FromDiscord | <Phil> Hmm only thing I could think of is that Foo no longer applies to generics defined for object |
12:28:13 | FromDiscord | <Phil> Which includes iterators such as fieldPairs and a fair amount of other procs |
12:28:28 | FromDiscord | <Phil> (edit) "Which includes iterators such as fieldPairs ... and" added "(I think?)" |
12:28:56 | arkanoid | do you think imported objects here should really be distinct object? https://github.com/guzba/nimsimd/blob/master/src/nimsimd/neon.nim |
12:29:09 | FromDiscord | <Phil> that is SIMD, I'm out |
12:30:43 | FromDiscord | <Phil> Wait, that repo does not contain "distinct" anywhere in the codebase |
13:04:43 | * | junaid_ joined #nim |
14:47:57 | * | junaid_ quit (Remote host closed the connection) |
15:06:59 | FromDiscord | <treeform> SIMD is different from usual programming ... it requires its own paradigm. |
15:35:30 | FromDiscord | <fakecrafter> sent a code paste, see https://play.nim-lang.org/#ix=4Ity |
15:35:56 | FromDiscord | <fakecrafter> (edit) "https://play.nim-lang.org/#ix=4Ity" => "https://play.nim-lang.org/#ix=4Itz" |
15:38:04 | FromDiscord | <odexine> integers do not have a representation for infinity, you will have to settle for "maximum integer" which is `int.high` IIRC |
15:39:09 | FromDiscord | <fakecrafter> ok↵thx |
15:44:27 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4ItB |
15:45:24 | FromDiscord | <Phil> Because currently this task fails complaining that nimibook doesn't exist.↵When I compile with `nim c -d:release --mm:refc nbook.nim` directly in my terminal it works.↵So exec is also caught in the nimble execution context or sth? |
15:59:08 | * | rockcavera quit (Ping timeout: 255 seconds) |
15:59:10 | FromDiscord | <kcvinker5420> I want to use `startProcess` function from `asynctools/asyncproc`. But I don't know how to get the out from AsyncProcess in both realtime and after the process exits. I need to know both ways. |
15:59:35 | FromDiscord | <kcvinker5420> (edit) "out" => "output" |
16:04:19 | * | rockcavera joined #nim |
16:04:19 | * | rockcavera quit (Changing host) |
16:04:19 | * | rockcavera joined #nim |
16:05:03 | * | junaid_ joined #nim |
16:07:53 | * | def- quit (Quit: -) |
16:08:35 | * | def- joined #nim |
16:09:32 | FromDiscord | <kcvinker5420> sent a code paste, see https://play.nim-lang.org/#ix=4ItI |
16:34:14 | * | azimut joined #nim |
16:39:12 | * | junaid_ quit (Remote host closed the connection) |
16:45:13 | * | junaid_ joined #nim |
17:25:50 | FromDiscord | <hotdog6666> In reply to @isofruit "Because currently this task": Yeah it needs to be required in your nimble file if it is compiled via a nimble task I think |
17:26:37 | FromDiscord | <Phil> In reply to @hotdog6666 "Yeah it needs to": I was expected that for compile commands executed in the nim context via nimble.↵I didn't expect that to also apply to compiles via `exec` |
17:27:29 | FromDiscord | <Phil> That was the thing that was confusing me.↵Either way though, the main problem appears to have been that I had a nimbledeps folder that was forcing some things that usually are pulled from a global context to be local |
17:47:52 | * | junaid_ quit (Remote host closed the connection) |
18:29:45 | * | junaid_ joined #nim |
18:33:50 | * | junaid_ quit (Remote host closed the connection) |
19:44:01 | * | PMunch quit (Quit: leaving) |
20:01:36 | FromDiscord | <kcvinker5420> How to construct a `Path` from a string |
20:03:08 | Amun-Ra | Path("string") |
20:08:22 | * | azimut quit (Remote host closed the connection) |
20:08:31 | FromDiscord | <demotomohiro> It is same to calling a proc with string.↵So `Path "string"`, `Path"string"` and `"string".Path` works |
20:08:47 | * | azimut joined #nim |
20:14:24 | FromDiscord | <kcvinker5420> Thanks |
20:20:17 | FromDiscord | <kcvinker5420> Which module should I import to use Path ? `std/paths` shows an error |
20:28:45 | Amun-Ra | std/paths |
20:29:00 | Amun-Ra | unless you're using older nim |
20:31:20 | FromDiscord | <kcvinker5420> I am using |
20:31:29 | FromDiscord | <kcvinker5420> (edit) "I am using ... " added "1" |
20:31:39 | FromDiscord | <kcvinker5420> (edit) "1" => "1.6.2" |
20:36:40 | FromDiscord | <Elegantbeef> Paths is only 2.0 |
20:41:05 | Amun-Ra | sad thing is debian still ships nim 1.6 |
20:42:21 | FromDiscord | <Elegantbeef> A lot of people oddly still use 1.6.12 |
20:42:55 | Amun-Ra | I'm on sid/unstable and it's still 1.6.14 |
20:43:20 | Amun-Ra | so I have my own in /opt |
20:43:32 | FromDiscord | <Elegantbeef> Atleast it's the newest 1.6 |
20:59:51 | FromDiscord | <nasuray> In reply to @isofruit "I was expected that": Have you tried setting this up with `taskRequires`? |
21:13:39 | * | lucasta joined #nim |
21:29:20 | * | incal joined #nim |
21:29:58 | incal | o/ is there an example of a simple 2D game, e.g. snake or whatever, that I can try compile and run? TIA |
21:30:42 | incal | I did google but only found libraries and people asking the same question ... |
21:31:09 | Amun-Ra | you can find an example for SDL2 and port it to nim + sdl2 |
21:31:46 | Amun-Ra | (I know that's not exactly what you have in mind…) |
21:32:05 | incal | but surely someone wrote a game for nim already? like a pong or space invaders clone or whatever |
21:32:41 | FromDiscord | <kcvinker5420> In reply to @Elegantbeef "Paths is only 2.0": Thanks |
21:33:11 | Amun-Ra | incal: https://github.com/dom96/snake |
21:33:12 | incal | I read the declaration of purpose, speed of C, devel speed of Python and modularity of List, that sounds like something I'd like |
21:33:37 | incal | ah, thank, trying |
21:34:23 | incal | I got the compiler from the Debian repos and found a major-mode in MELPA so should be all set |
21:37:01 | incal | hm, it's a game for the web browser, maybe there is some simpler still to be run locally |
21:47:59 | FromDiscord | <luxurymode> sent a long message, see http://ix.io/4Iv2 |
21:48:56 | FromDiscord | <Elegantbeef> There is not much more to it to be frank |
21:50:13 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/tut1.html#procedures-forward-declarations |
21:50:13 | FromDiscord | <Elegantbeef> also covers it |
21:50:31 | FromDiscord | <luxurymode> Ah, that's it. That's all I was looking for. Thank you |
21:52:35 | incal | got it, looks clean |
21:53:02 | incal | maybe not a minimal project but the author didn't have me in mind LOL |
22:16:14 | * | incal left #nim (ERC 5.6-git (IRC client for GNU Emacs 30.0.50)) |
22:21:22 | arkanoid | can defined(FOO) be used in nimble tasks? calling it with nimble mytask -d:FOO, or nimble -d:FOO mytask |
22:25:06 | NimEventer | New thread by brainproxy: Learning Nim: Write an Interpreter [Episode 01], see https://forum.nim-lang.org/t/10538 |
22:25:53 | FromDiscord | <Elegantbeef> Someone really likes their internet points 😄 |
22:26:24 | FromDiscord | <michaelb.eth> just hadn't seen it shared there yet ¯\_(ツ)_/¯ |
22:27:21 | FromDiscord | <Elegantbeef> I kid, I just see you sharing a lot of Nim related stuff on hackernews |
23:03:26 | * | lucasta quit (Quit: Leaving) |
23:13:08 | FromDiscord | <.aingel.> The more the better! |
23:36:36 | NimEventer | New post on r/nim by Uwu_Uwu135: How to use nim for p2p, see https://reddit.com/r/nim/comments/173defc/how_to_use_nim_for_p2p/ |
23:51:35 | * | krux02 quit (Remote host closed the connection) |