01:00:37 | FromDiscord | <alice.> how do i find where this is happening |
01:00:48 | FromDiscord | <alice.> sent a code paste, see https://play.nim-lang.org/#ix=4fEO |
01:13:29 | FromDiscord | <Andreas> Would anybody see a glitch here ? https://play.nim-lang.org/#ix=4fEQ↵My valgrind-alternative on osx `leaks` reports a leak of 48-bytes per myseq-instance ? `myseq` is from 'Nim Destructors and Move Semantics' [ https://nim-lang.org/docs/destructors.html ]. The built-in seq-type shows no leaks ? The destructor look pretty much ok to me ? |
01:14:55 | FromDiscord | <Andreas> (edit) "Would anybody see a glitch here ? https://play.nim-lang.org/#ix=4fEQ↵My valgrind-alternative on osx `leaks` reports a leak of 48-bytes per myseq-instance ? `myseq` is ... from]" added "the motivating example" | "]." => "] ." |
01:19:02 | FromDiscord | <Bung> https://github.com/nim-lang/Nim/issues/14604 I guess similar one? |
01:23:01 | FromDiscord | <alice.> can i please get help |
01:23:08 | FromDiscord | <alice.> my code wont compile and i have no idea why |
01:23:36 | FromDiscord | <alice.> even when git pulling it doesnt work |
01:23:39 | FromDiscord | <alice.> and i have no clue why tf |
01:23:53 | FromDiscord | <Andreas> In reply to @Bung "https://github.com/nim-lang/Nim/issues/14604 I gues": my observation does deal with Nims seq-type at all. At least my test with `---d:useMalloc --mm:orc --gc:orc` shows NO leak. But the motivation example, which is not used in Nim has it.. |
01:24:08 | FromDiscord | <Andreas> (edit) "In reply to @Bung "https://github.com/nim-lang/Nim/issues/14604 I gues": my observation does ... deal" added "not" |
01:24:39 | FromDiscord | <Andreas> (edit) "leak." => "leak for the built-in `seq`." |
01:29:01 | FromDiscord | <Bung> https://github.com/nim-lang/Nim/issues/19794 what about this |
01:29:29 | FromDiscord | <Bung> I've seen several arc leak issues |
01:30:09 | FromDiscord | <alice.> @Bung could i get help w this weird issue |
01:30:22 | FromDiscord | <alice.> sent a code paste, see https://play.nim-lang.org/#ix=4fEV |
01:30:46 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fEW |
01:31:06 | FromDiscord | <ChocolettePalette> Invalid indentation o.o |
01:31:56 | FromDiscord | <alice.> yeah it makes NO fucking sense |
01:32:02 | FromDiscord | <alice.> i have no idea why it broke |
01:32:11 | FromDiscord | <alice.> nothing has changed' |
01:32:35 | FromDiscord | <alice.> why can it not parse the package info file????? |
01:32:46 | FromDiscord | <alice.> this is the contents of it |
01:32:53 | FromDiscord | <alice.> @ElegantBeef |
01:32:54 | FromDiscord | <alice.> sent a code paste, see https://play.nim-lang.org/#ix=4fEX |
01:33:41 | FromDiscord | <ChocolettePalette> That's sus! |
01:34:03 | FromDiscord | <alice.> ffs |
01:34:06 | FromDiscord | <alice.> can i get some help w this |
01:34:13 | FromDiscord | <ChocolettePalette> Try removing spaces or tabs between variables and ='s |
01:34:14 | FromDiscord | <alice.> because i literally cannot build this project |
01:34:15 | FromDiscord | <alice.> at all |
01:34:31 | FromDiscord | <alice.> why would that fix it |
01:34:47 | FromDiscord | <ChocolettePalette> Just try it why not |
01:34:51 | FromDiscord | <alice.> it did nothing |
01:35:30 | FromDiscord | <alice.> well nim is just fucked |
01:35:37 | FromDiscord | <alice.> it cant read a project file from an old file |
01:35:37 | FromDiscord | <Elegantbeef> nimble\ |
01:35:40 | FromDiscord | <alice.> which is 100% valid |
01:35:49 | FromDiscord | <alice.> how does it just break |
01:35:50 | FromDiscord | <alice.> WTF |
01:36:27 | FromDiscord | <alice.> so i guess i cant use this language now |
01:36:34 | FromDiscord | <alice.> because its package manager just died |
01:36:42 | FromDiscord | <alice.> wtf?? |
01:37:04 | FromDiscord | <Bung> I cant see invalid code in nimble by eye |
01:37:27 | FromDiscord | <alice.> because there IS none |
01:37:40 | FromDiscord | <alice.> the proof is that i c loned another project that i didnt touch in weeks |
01:37:43 | FromDiscord | <alice.> and it also doesnt build |
01:37:47 | FromDiscord | <Bung> maybe use choosenim try other version ? |
01:38:37 | FromDiscord | <Elegantbeef> Also what's the repo? |
01:39:21 | FromDiscord | <Bung> yeah, maybe provide the repo then other people can try |
01:39:24 | FromDiscord | <alice.> why is that relevant |
01:39:29 | FromDiscord | <alice.> its fucked on nimble as a whole |
01:39:33 | FromDiscord | <alice.> > the proof is that i c loned another project that i didnt touch in weeks |
01:39:39 | FromDiscord | <alice.> and it also didnt build |
01:39:42 | FromDiscord | <alice.> this is not a repo issue |
01:40:31 | FromDiscord | <Bung> but other can try in their env and use their nim version |
01:40:43 | FromDiscord | <alice.> its not a repo issue |
01:41:04 | FromDiscord | <Bung> like I can try with latest devel and nimble |
01:42:25 | FromDiscord | <alice.> well i got it working again |
01:42:31 | FromDiscord | <alice.> i had to uninstall and reinstall nim stable |
01:42:35 | FromDiscord | <alice.> no idea what happened |
01:43:37 | FromDiscord | <alice.> nimble seems to be cabal level unstable |
01:43:43 | FromDiscord | <sOkam!> Would it be possible to create an app with Nim code for a plugin infrastructure that expects cpp code instead?↵I know its doable with C, but is that possible for cpp too? |
01:44:02 | FromDiscord | <sOkam!> (edit) removed "an app with" |
01:44:04 | FromDiscord | <alice.> which is fine if its buggy but provide an option to reset it then |
01:44:29 | FromDiscord | <Elegantbeef> Depends on how it works↵(@sOkam!) |
01:44:48 | FromDiscord | <alice.> In reply to @Bung "like I can try": devel worked i guess stable was corrupted somehow |
01:46:16 | FromDiscord | <sOkam!> In reply to @Elegantbeef "Depends on how it": This is all I know about it so far↵https://vcvrack.com/manual/PluginDevelopmentTutorial↵Tried to find something more specific in how it wants the code structured (monolithic gdscript-like, with api calls, or c-like with headers instead), but no luck so far |
01:50:48 | FromDiscord | <alice.> anyway its fixed now but i would be lying if i said that wasnt weird |
01:50:57 | FromDiscord | <alice.> i genuienely have no idea what happened |
01:51:10 | FromDiscord | <alice.> how does nimble just corrupt its installation |
01:51:42 | FromDiscord | <Elegantbeef> A cosmic ray flipped a bit on your drive |
01:54:03 | FromDiscord | <alice.> fr lol |
01:54:41 | FromDiscord | <alice.> reminds me of https://media.discordapp.net/attachments/371759389889003532/1040806809310609469/unknown.png |
01:55:00 | FromDiscord | <alice.> also cursed question but would it possible to install nim on a steam deck 🤔 |
01:56:06 | FromDiscord | <alice.> if so i will try it |
01:56:24 | FromDiscord | <Andreas> In reply to @Bung "I've seen several arc": thx, fixed it - was my bad.. |
01:59:13 | FromDiscord | <Andreas> @Bung BTW would'nt it be nice to have a valgrind-report in the playground ? |
02:00:46 | FromDiscord | <Bung> you can make a PR for it , it's on github |
02:01:13 | FromDiscord | <Bung> sry, it's frontend public. |
02:01:16 | FromDiscord | <Andreas> In reply to @Bung "you can make a": i know yod'd say that 🙂 |
02:01:41 | FromDiscord | <Bung> haha , this one https://github.com/PMunch/nim-playground |
02:12:15 | * | Guest76 joined #nim |
02:12:45 | * | Guest76 quit (Client Quit) |
02:33:58 | * | aegeaner joined #nim |
02:46:07 | * | rockcavera quit (Remote host closed the connection) |
02:47:46 | FromDiscord | <dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4fFf |
02:48:12 | FromDiscord | <dlesnoff> (edit) "https://play.nim-lang.org/#ix=4fFf" => "https://play.nim-lang.org/#ix=4fFg" |
02:48:34 | FromDiscord | <dlesnoff> (edit) "https://play.nim-lang.org/#ix=4fFg" => "https://play.nim-lang.org/#ix=4fFh" |
02:49:03 | FromDiscord | <dlesnoff> (edit) "https://play.nim-lang.org/#ix=4fFh" => "https://play.nim-lang.org/#ix=4fFi" |
02:52:52 | FromDiscord | <ChocolettePalette> Slideshow o.o |
02:53:14 | FromDiscord | <dlesnoff> Well nimibook here |
02:54:24 | FromDiscord | <dlesnoff> I guess I could do a regex, but I don't know how this manages multiline replacement. |
02:54:32 | FromDiscord | <ringabout> Would it be better to use a Markdown parser? |
02:54:46 | FromDiscord | <ChocolettePalette> You kinda don't have to use regex |
02:55:52 | FromDiscord | <ChocolettePalette> Like, it would be a simple algorithm\:↵1. Find markdown beginning & replace it with your stuff nbCode or smth↵2. Until you reached the end of markdown, add two spaces to the start of a line |
02:56:17 | FromDiscord | <dlesnoff> In reply to @ringabout "Would it be better": I don't know any. I use pandoc, but can I extract his MD parser and specify my output format? |
02:57:10 | FromDiscord | <ringabout> https://github.com/soasme/nim-markdown |
02:57:19 | FromDiscord | <ringabout> A Nim one probably works too. |
02:57:28 | FromDiscord | <dlesnoff> In reply to @ChocolettePalette "Like, it would be": The thing that annoys me, is how do I extract the text between the quotes? |
02:57:41 | FromDiscord | <ChocolettePalette> 3. Have to replace the end of markdown markup as well |
02:58:28 | FromDiscord | <ringabout> Or it you use a c wrapper. |
02:58:49 | FromDiscord | <ChocolettePalette> You don't have to extract it, it's a finite automata or smth↵(@dlesnoff) |
02:59:04 | FromDiscord | <ChocolettePalette> I.e. it processes the file line by line |
03:00:17 | FromDiscord | <ChocolettePalette> And if you manage to do it inplace somehow, you'll be able to convert files of arbitary size |
03:00:47 | FromDiscord | <dlesnoff> In reply to @ChocolettePalette "You don't have to": I see I could define a boolean state to test when I should stop parsing. Fine, I'll try it. |
03:05:09 | FromDiscord | <ringabout> I think some Markdown parser will exposes the ast of markdown file and you can extract what you want. https://github.com/kyoheiu/nmark/blob/6aae07347e928b817c03940d68d0162ef3964204/src/nmark/mdToAst.nim#L5 |
03:11:38 | FromDiscord | <dlesnoff> Can I have the line number of my file in addition to the line string itself? |
03:16:40 | FromDiscord | <dlesnoff> Finally, I don't need that. @ringabout I expect to do a conversion only once of the wiki markdown files to a nimibook and then let people modify the nimibook.↵I am not sure this is quite a good idea, to convert to a nimibook. This introduces many formatting issues.↵The good point is that we will be able to check code examples easily. |
03:18:07 | FromDiscord | <ringabout> The Nim dialect markdown supports testing example too. |
03:19:22 | FromDiscord | <ringabout> sent a code paste, see https://paste.rs/SAT |
03:19:26 | FromDiscord | <ringabout> (edit) |
03:19:41 | FromDiscord | <dlesnoff> Nimibook leverages this markdown tool. |
03:20:16 | FromDiscord | <ringabout> (edit) |
03:20:26 | FromDiscord | <dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4fFo |
03:20:40 | FromDiscord | <ringabout> Lol, I gave up |
03:21:37 | FromDiscord | <ringabout> The documentation of Nim has switched to markdown which is supposed to have more support in the future. |
03:21:51 | FromDiscord | <dlesnoff> It suffices to add a compilation flag on top of all nim code blocks 😮 |
03:22:42 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=4fFp |
03:24:11 | FromDiscord | <pip install tester> sent a code paste, see https://play.nim-lang.org/#ix=4fFq |
03:24:50 | FromDiscord | <pip install tester> sent a code paste, see https://play.nim-lang.org/#ix=4fFr |
03:26:04 | FromDiscord | <dlesnoff> In reply to @ringabout "The documentation of Nim": Oh it used RST before. |
03:27:12 | * | joast quit (Quit: Leaving.) |
03:27:59 | FromDiscord | <dlesnoff> oh I got it |
03:28:00 | FromDiscord | <dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4fFs |
03:28:17 | FromDiscord | <dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4fFt |
03:28:34 | FromDiscord | <dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4fFu |
03:29:03 | FromDiscord | <dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4fFv |
03:29:10 | FromDiscord | <dlesnoff> Almost got it 😦 |
03:29:39 | FromDiscord | <dlesnoff> (edit) "https://play.nim-lang.org/#ix=4fFv" => "https://play.nim-lang.org/#ix=4fFw" |
03:31:58 | FromDiscord | <pip install tester> sent a code paste, see https://paste.rs/4co |
03:33:42 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4fFz |
03:34:16 | FromDiscord | <scarf> which library should i use for video to ascii tranalation? (to make something like ascii bad apple) |
03:34:41 | FromDiscord | <ringabout> (edit) "https://play.nim-lang.org/#ix=4fFz" => "https://play.nim-lang.org/#ix=4fFA" |
03:35:03 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4fFB |
03:35:47 | FromDiscord | <ringabout> We can use `nim ms2html` to test the examples and use external md tools to generate nice HTML documentation. |
03:35:52 | FromDiscord | <ringabout> (edit) "ms2html`" => "md2html`" |
03:37:01 | FromDiscord | <dlesnoff> `nim md2html` does not produce a HTML for both text and code? |
03:37:10 | * | arkurious quit (Quit: Leaving) |
03:39:04 | FromDiscord | <ringabout> Yeah, it produces. But the generated HTML is not necessarily great or customizable. |
03:41:52 | FromDiscord | <dlesnoff> I have got a lot of errors on nimwiki files indeed, but at least it works for small files. |
03:44:33 | FromDiscord | <ringabout> Yeah, it is the Nim dialect syntax of Markdown. |
03:45:46 | FromDiscord | <ringabout> We can implement code blocks checking based on the last of a proper Markdown parser + custom test commanf syntax. |
03:46:02 | FromDiscord | <ringabout> (edit) "last" => "ast" |
03:46:53 | FromDiscord | <ringabout> Or we can delay the testing and just render the Markdown file. |
03:48:22 | FromDiscord | <ringabout> So we can make progress step by step in place of the original wiki. |
03:49:52 | FromDiscord | <ringabout> It is not necessarily nimibook. I use mkdocs which is pretty good. |
03:49:54 | FromDiscord | <ringabout> https://github.com/planety/prologue/blob/112df3c42826d76c426f5f8ffd8b174b1fada65d/prologue.nimble#L36 |
03:50:14 | FromDiscord | <ringabout> https://planety.github.io/prologue/quickstart/ |
04:02:40 | FromDiscord | <pip install tester> sent a long message, see http://ix.io/4fFL |
05:20:47 | * | ltriant quit (Ping timeout: 268 seconds) |
05:27:17 | FromDiscord | <Prestige> No idea about Windows |
05:57:13 | * | Amun-Ra quit (*.net *.split) |
05:57:13 | * | pbsds quit (*.net *.split) |
05:57:14 | * | fallback quit (*.net *.split) |
05:57:45 | * | Amun-Ra joined #nim |
06:00:25 | * | pbsds joined #nim |
06:09:23 | * | fallback joined #nim |
06:13:54 | FromDiscord | <JeysonFlores> sent a long message, see http://ix.io/4fGc |
06:13:57 | FromDiscord | <JeysonFlores> and doesn't print anything |
06:17:14 | FromDiscord | <demotomohiro> @JeysonFlores I think this section helps you:↵https://nim-lang.org/docs/manual.html#userminusdefined-pragmas-custom-annotations |
06:21:36 | * | madprog quit (*.net *.split) |
06:21:44 | * | madprog joined #nim |
06:25:44 | madprops | madprog? |
06:26:43 | FromDiscord | <JeysonFlores> In reply to @demotomohiro "<@639292135098810390> I think this": It only says about the template definition as pragma which is already in my code. But not the behavior of the custom pragma. |
06:34:18 | FromDiscord | <Rika> ? |
06:34:37 | FromDiscord | <demotomohiro> @JeysonFlores ↵Nim manual says:↵> Custom pragmas do not affect code generation directly, but their presence can be detected by macros.↵So you need to write the macro that detects your custom template pragma and generates AST that makes behavior you want. |
06:35:03 | FromDiscord | <JeysonFlores> In reply to @demotomohiro "<@639292135098810390> Nim manual": Ok fair enough then. Thanks! |
06:38:06 | FromDiscord | <qb> sent a code paste, see https://play.nim-lang.org/#ix=4fGg |
07:04:46 | * | rockcavera joined #nim |
07:23:09 | FromDiscord | <pip install tester> In reply to @Avahe "No idea about Windows": Ah, thanks anyway. I figured it out with a bit more snooping of the docs. |
07:23:45 | FromDiscord | <pip install tester> just a matter of creating the nimble.ini in Roaming\\.nimble and editing nim.cfg's nimblepath= to the new path |
08:17:19 | FromDiscord | <alice.> whats the way to do visitor pattern in nim? |
08:21:22 | * | ensyde joined #nim |
08:29:50 | * | jjido joined #nim |
08:39:53 | * | derpydoo joined #nim |
09:53:46 | FromDiscord | <Kermithos> In reply to @qb "A string should be": maybe strip the whitespaces first? |
09:58:44 | FromDiscord | <planetis> why is conversion from cstring to ptr char considered unsafe? They're both unsafe language features, so what's the new warning about? |
10:15:52 | FromDiscord | <pietroppeter> hi @rlipsc, you around? i was trying to run and execute one of the example demos but it seems they do not contain the code to actually run the ECS, right? is there somewhere an example on how to do that? |
10:16:18 | FromDiscord | <pietroppeter> (finally starting to use polymorph and trying out polymers... :)) |
10:24:15 | FromDiscord | <ringabout> Converting ptr char to cstring should be discouraged since ptr char isn't necessarily null termination, which is quite dangerous. |
10:34:17 | FromDiscord | <ringabout> Also It seems that if implicit conversion is disabled, the conversion doesn't work either. |
10:48:28 | Guest1473 | Hi! Is there any possibility to convert seq[] to heap allocated array? |
10:50:10 | Guest1473 | Using alloc0 maybe it is possible to allocate object in heap with required size, then using cast conversion transform it to the desired type |
10:50:43 | Guest1473 | but for some reason it not works, or I'm doint it wrong |
10:53:46 | FromDiscord | <Rika> You cannot convert sequences from or to manually heap allocated arrays |
10:54:06 | FromDiscord | <Rika> There is no way, do not try it, it is not possible |
10:55:06 | Guest1473 | Rika, thnx |
10:55:31 | FromDiscord | <scarf> there's tons of ptr char to cstring error when compiling nim from source, are they okay to ignore? |
10:55:37 | FromDiscord | <Rika> There are other options, but not to a sequence |
10:55:55 | FromDiscord | <Rika> You can use the unchecked array type for at least some array like ergonomics |
10:56:11 | FromDiscord | <planetis> Thanks xflywind |
10:56:33 | Guest1473 | Rika, what if I create proc, that will alloc and return ptr to the heap object with desired type, which will assign seq element values to that arr? |
10:56:54 | FromDiscord | <Rika> I don’t understand |
10:57:11 | Guest1473 | Rika, yeah, hard to explain for me little bit |
10:57:36 | FromDiscord | <Rika> I’ll wait then |
10:58:11 | Guest1473 | Rika, thanks, I will write example in playground, that should be better than just words |
11:01:24 | Guest1473 | Rika, https://play.nim-lang.org/#ix=4fGW |
11:01:58 | Guest1473 | Rika you mentioned uncheckedArray, and that helped me, thanks a lot |
11:02:17 | Guest1473 | I hope this will work with type "complex" |
11:02:25 | FromDiscord | <Rika> Multiply sequence length by size of integer, allocation procedure takes byte count |
11:02:45 | FromDiscord | <Rika> That works |
11:02:53 | Guest1473 | Rika, yeah, like in C |
11:03:44 | Guest1473 | the problem is with dfft lib binding, it requires arrays with structure |
11:04:33 | Guest1473 | I hope somebody will have the time for own math library for nim |
11:05:13 | Guest1473 | I mean who will implement fast enough dfft |
11:05:21 | Guest1473 | *dft |
11:05:46 | FromDiscord | <Rika> Wait, I realised something |
11:05:54 | FromDiscord | <Rika> Wait no it’s okay |
11:06:06 | FromDiscord | <Rika> You technically can go from sequence to raw heap array |
11:06:18 | FromDiscord | <Rika> But there are limitations and unsafeties with it |
11:06:36 | Guest1473 | using pointer arithmetic? |
11:07:21 | FromDiscord | <Rika> cast[ptr UncheckedArray[int](aSeq[0].addr) |
11:07:44 | Guest1473 | hmm, interesting. I'll try now |
11:07:50 | FromDiscord | <Rika> Limitation is be careful of keeping the pointer for too long |
11:07:58 | FromDiscord | <Rika> (It might change when you mutate the sequence) |
11:08:05 | FromDiscord | <Rika> Change as in invalidate |
11:08:53 | Guest1473 | aha.. ok. It should not change in that block of code |
11:08:55 | FromDiscord | <Rika> Just don’t add to the regular sequence when you have the pointer, and don’t add or remove elements using the raw pointer |
11:09:27 | Guest1473 | aha, awesome. exactly what I need |
11:09:34 | Guest1473 | let me verify that |
11:09:34 | FromDiscord | <Rika> I think you should effectively treat the raw pointer as “do not mutate” (but technically you can change the contents) |
11:10:18 | FromDiscord | <scarf> sent a code paste, see https://play.nim-lang.org/#ix=4fGX |
11:10:31 | FromDiscord | <Rika> And you can also technically add and remove (but that involves changing the length and verifying the capacity can hold it and whatever else so yeah more effort) |
11:10:33 | Guest1473 | no, it should not mutate there. |
11:10:49 | FromDiscord | <Rika> In reply to @scarf "can nim assert show": In unit test module there is check procedure |
11:10:50 | FromDiscord | <Rika> I think |
11:11:16 | FromDiscord | <albassort> yea you can do a check and explain |
11:12:05 | FromDiscord | <scarf> In reply to @Rika "In unit test module": can i use `check` for stdlib tests? they all uses `doAssert` |
11:12:16 | FromDiscord | <Rika> Dunno |
11:15:47 | FromDiscord | <scarf> ok. also what are ccgbugs? https://media.discordapp.net/attachments/371759389889003532/1040948015822819399/image.png |
11:16:52 | FromDiscord | <Bung> generate invalid c code |
11:22:53 | * | disso_peach quit (Remote host closed the connection) |
11:24:16 | * | disso_peach joined #nim |
11:26:32 | FromDiscord | <scarf> In reply to @Bung "generate invalid c code": does it mean that nim compiler generated invalid c code? |
11:27:08 | FromDiscord | <ringabout> It's the nimcache of tests. |
11:27:47 | FromDiscord | <dlesnoff> In reply to @scarf "can i use `check`": unittest says that you have to be sure that there is no type conversion required for the assertion to be true |
11:28:11 | FromDiscord | <dlesnoff> Personally I would prefer using check in my future projects. |
11:28:39 | FromDiscord | <dlesnoff> `4.0 == 2 + 2` should fail IMO |
11:28:42 | FromDiscord | <scarf> In reply to @ringabout "It's the nimcache of": should `nimcache` be added to `.gitignore`? |
11:30:19 | FromDiscord | <dlesnoff> shouldn't these questions be asked in `internals` instead? |
11:30:35 | FromDiscord | <scarf> In reply to @Jiezron "shouldn't these questions be": oh, didn't know that, sorry |
11:34:47 | FromDiscord | <dlesnoff> I am unsure, that's why I ask. You don't have to be sorry.↵I just guess you will get a better answer there. |
12:20:28 | FromDiscord | <Phil> internals is compiler dev |
12:20:44 | FromDiscord | <Phil> Yeah, you can add nimcache to gitignore, the files in there don't matter for your source code |
12:30:49 | * | jmdaemon quit (Ping timeout: 252 seconds) |
12:33:49 | * | carce joined #nim |
12:45:30 | * | ltriant joined #nim |
12:50:07 | * | ltriant quit (Ping timeout: 256 seconds) |
12:54:44 | * | carce quit (Remote host closed the connection) |
13:12:37 | FromDiscord | <Require Support> how does one differentiate between timeinterval and Duration, keep getting weird errors im using `waitTime.milliseconds` but its registering as TimeInterval when I want it to be Duration |
13:13:29 | FromDiscord | <Require Support> (edit) "Duration" => "Duration. I'm using devel btw, not sure if it matters" |
13:16:59 | FromDiscord | <Require Support> nvm it was chronos... it has Duration object, woops |
13:19:01 | * | krux02 joined #nim |
13:33:05 | FromDiscord | <Anna Aurora 🏳🌈🏴☠🕳> How do I write a library in nim? Any tutorials? |
13:33:06 | FromDiscord | <enthus1ast> export stuff from one nim file with `` import the module in another nim file with `import theOtherFile` |
13:33:35 | FromDiscord | <Anna Aurora 🏳🌈🏴☠🕳> how do I export? |
13:33:51 | FromDiscord | <enthus1ast> `proc myProc() =` |
13:34:54 | FromDiscord | <enthus1ast> https://nim-lang.org/docs/manual.html#procedures-export-marker |
13:35:47 | FromDiscord | <enthus1ast> also this\: https://nim-lang.org/docs/system.html#isMainModule |
13:36:11 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4fHv |
13:39:52 | FromDiscord | <Anna Aurora 🏳🌈🏴☠🕳> so I export the functions from my submodule and then import them in `src/x.nim` where I export them again? |
13:41:48 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4fHw |
13:44:05 | FromDiscord | <Anna Aurora 🏳🌈🏴☠🕳> do `export submodule` in my main nim file, will users of the library have to import `x/submodule` or `x`? |
13:44:05 | FromDiscord | <Anna Aurora 🏳🌈🏴☠🕳> If I do `export submodule` in my main nim file, will users of the library have to import `x/submodule` or `x`? |
13:44:15 | FromDiscord | <enthus1ast> often, you implement stuff in submodules, but want users of your library just import one module file, where you can control what users can see and use |
13:44:52 | FromDiscord | <enthus1ast> so for example\: https://github.com/enthus1ast/nimja/blob/master/src/nimja.nim |
13:46:18 | FromDiscord | <enthus1ast> 1, |
13:50:18 | FromDiscord | <auxym> you might also be interested in https://github.com/treeform/nimtemplate |
13:58:02 | FromDiscord | <scarf> is `i32` same as `int32`? |
13:58:52 | FromDiscord | <scarf> (edit) "is `i32` same as `int32`? ... " added "int32 is defined in <https://nim-lang.org/docs/system.html#int32> but i32 isn't" |
13:59:07 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4fHD |
14:02:58 | FromDiscord | <Bung> literal i32 exactly matches int32 |
14:09:17 | FromDiscord | <scarf> oh, just found out `let foo: i32 = 10` doesn't work (since it's not defined) |
14:18:05 | FromDiscord | <auxym> yeah i32 is just for literals |
14:19:31 | * | PMunch joined #nim |
15:00:42 | * | arkurious joined #nim |
15:08:36 | * | ehmry quit (Ping timeout: 248 seconds) |
15:19:49 | * | possess joined #nim |
15:36:45 | * | aegeaner quit (Quit: WeeChat 3.7.1) |
15:37:02 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
15:52:46 | FromDiscord | <ngangngong> hi guys, why `asynchttpserver` slower compared to net/http go's and actix rust's? |
15:53:01 | FromDiscord | <ngangngong> (edit) "slower" => "slower(wrk benchmark)" |
15:53:57 | FromDiscord | <ngangngong> I wonder if there's any faster http server than asynchttpserver comparable to both go's and rust's? |
15:54:07 | FromDiscord | <Rika> httpbeast or httpx |
15:54:14 | FromDiscord | <Rika> both external library |
15:54:39 | FromDiscord | <ngangngong> have you tested it? |
15:55:12 | FromDiscord | <ngangngong> ok, so i checked on nimble both, lemme test it. |
15:55:29 | FromDiscord | <Rika> i have not |
15:55:37 | FromDiscord | <Rika> but i know theyre better than asynchttpserver |
15:55:41 | FromDiscord | <Rika> in terms of throughput |
15:58:50 | * | ehmry joined #nim |
15:59:07 | * | krux02 quit (Remote host closed the connection) |
16:11:30 | * | possess quit (Read error: Connection reset by peer) |
16:13:01 | * | possess joined #nim |
16:16:47 | * | possess quit (Read error: Connection reset by peer) |
16:22:37 | * | possess joined #nim |
16:23:14 | PMunch | Hmm, something funky is going on with $ on the Arduino |
16:27:04 | PMunch | Aha, there is no $ for int32, it just converts it to a int and stringifies that |
16:27:13 | PMunch | Problem is, on the Arduino int is int16 |
16:28:14 | PMunch | So trying to stringify an int32 on an Arduino silently converts that to an int16 and prints that instead (losing the high bits and potentially turning the number negative) |
16:29:48 | * | possess quit (Read error: Connection reset by peer) |
16:32:08 | FromDiscord | <auxym> nice. I'd consider that a bug in the stdlib `$` |
16:33:07 | FromDiscord | <auxym> btw, why does `deepCopy` in arc/orc require a compiler flag? Does it add significant overhead somewhere? |
16:33:57 | * | possess joined #nim |
16:34:50 | FromDiscord | <Require Support> is there an equivalent to `intAlloc` in nim? trying to convert the following line to nim `pSsInfo = (ENUM_SERVICE_STATUS_PROCESSA)intAlloc(dwBytesNeeded);` |
16:35:11 | * | possess quit (Read error: Connection reset by peer) |
16:35:32 | FromDiscord | <Require Support> i guess i could covert from int array of size `dwBytesNeeded` ? idk im lost |
16:35:40 | FromDiscord | <auxym> not familiar, what does intAlloc do? |
16:36:59 | FromDiscord | <Require Support> sent a code paste, see https://paste.rs/unJ |
16:37:59 | FromDiscord | <auxym> so it allocates space for X ints? or X bytes? |
16:38:42 | FromDiscord | <Require Support> good question, i have no idea 😄 |
16:38:46 | FromDiscord | <Require Support> i guess ill answer that first |
16:39:35 | FromDiscord | <auxym> anyways you can use alloc/alloc0 in nim to allocate a block of memory, then use cast to convert the pointer to a pointer of your kind. See also: UncheckedArray |
16:40:05 | FromDiscord | <auxym> be careful: all this stuff bypasses the GC, so make sure you `dealloc` the memory somewhere (and only once) |
16:40:16 | FromDiscord | <auxym> and that you never use the memory after dealloc. |
16:40:26 | FromDiscord | <auxym> So basically all the standard C footguns |
16:41:13 | FromDiscord | <Require Support> Thanks 🙏 |
16:41:26 | * | possess joined #nim |
16:41:48 | * | possess quit (Read error: Connection reset by peer) |
16:42:16 | FromDiscord | <auxym> if you want to use the GC, you can create a `ref` type and use `[].addr` to get a pointer from it, for C++ interop purposes |
16:43:55 | FromDiscord | <Require Support> ok alloc() worked, ill try the ref way and see what i get |
16:44:25 | * | possess joined #nim |
16:45:09 | FromDiscord | <auxym> what's your end goal anyways? You're allocating space for an enum kind (or an array of the enum), what are you doing with it after? |
16:45:49 | FromDiscord | <Require Support> I am messing with win32 APIs https://learn.microsoft.com/en-us/windows/win32/api/winsvc/nf-winsvc-enumservicesstatusexa |
16:46:04 | * | ltriant joined #nim |
16:46:06 | FromDiscord | <auxym> if it's an array and size isn't known at compile-time, you can also use a plain old seq and get a pointer with `mySeq[0].addr` |
16:46:55 | FromDiscord | <Require Support> in the cpp example, the first run of the API gives you the bytesneeded then you alloc and cast to the ptr object |
16:47:13 | FromDiscord | <Require Support> since im a noob i just follow what they do, there's a probably a nim way of doing this |
16:48:52 | * | possess quit (Read error: Connection reset by peer) |
16:49:10 | FromDiscord | <auxym> i don't see the example on the page you linked though |
16:50:39 | * | ltriant quit (Ping timeout: 260 seconds) |
16:55:26 | FromDiscord | <Require Support> oh i can paste the example here its not on there i just took one snippet from github |
16:56:45 | FromDiscord | <Require Support> sent a code paste, see https://play.nim-lang.org/#ix=4fIM |
16:57:04 | FromDiscord | <Require Support> (edit) "https://play.nim-lang.org/#ix=4fIM" => "https://play.nim-lang.org/#ix=4fIN" |
17:11:44 | FromDiscord | <Phil> Anyone have an idea what libDOtherSide is? |
17:12:40 | * | jonlevin left #nim (#nim) |
17:12:45 | FromDiscord | <Phil> sent a long message, see http://ix.io/4fIX |
17:13:52 | Amun-Ra | https://github.com/filcuc/DOtherSide |
17:14:07 | Amun-Ra | "C language library for creating bindings for the Qt QML language." |
17:15:19 | FromDiscord | <Phil> Argh, step 1 in the flipping manual got me again |
17:15:32 | * | joast joined #nim |
17:16:29 | Amun-Ra | I tried to use qml a frew times but I can't bear it, I still prefer good old ui |
17:18:20 | FromDiscord | <Phil> "Good old ui"? |
17:18:50 | FromDiscord | <Phil> I am but a simple webdev, never done native before, just a few webview experiments here and there |
17:20:37 | PMunch | Hmm, fun.. I have a calculation that works fine on my machine. But when I compile for the Arduino it fails.. |
17:30:05 | PMunch | I have a sneaking suspicion that this is also caused by int issues |
17:31:58 | FromDiscord | <Phil> sent a long message, see http://ix.io/4fJ7 |
17:32:43 | FromDiscord | <Phil> Do I need to specify the so file via some specific nim flag? |
17:33:30 | Amun-Ra | Phil: good old ui as in using .ui files |
17:42:28 | * | jjido joined #nim |
17:43:19 | FromDiscord | <Slazaa> Hey, how can I declare procedures depending on the current OS ? :o |
17:43:45 | FromDiscord | <Slazaa> sent a code paste, see https://play.nim-lang.org/#ix=4fJe |
17:43:52 | FromDiscord | <Slazaa> I've tried this but it doesn't seem to work |
17:43:57 | FromDiscord | <Phil> As in, you want to swap out the proc at compile-time? |
17:44:46 | FromDiscord | <Phil> Did you compile with a "--define:window" or "-d:window" flag? |
17:44:57 | FromDiscord | <Slazaa> Oh :o |
17:45:01 | FromDiscord | <Slazaa> No I didn't |
17:45:13 | FromDiscord | <Slazaa> I thought it did it automatically like C x) |
17:45:20 | FromDiscord | <Slazaa> Thanks I'll try that :3 |
17:45:22 | FromDiscord | <Phil> basically with the -d flag you can define parameters (you can even pass them values) |
17:45:37 | FromDiscord | <Phil> And those are then available for the "defined()" proc |
17:46:01 | FromDiscord | <Slazaa> Actually I misspelled windows xD |
17:46:58 | FromDiscord | <Slazaa> VS Code still complains it cannot find the proc though |
17:48:03 | FromDiscord | <Phil> Error message or it didn't happen 😛 |
17:51:01 | FromDiscord | <Slazaa> Thank you :D |
17:51:25 | FromDiscord | <Phil> No worrie |
17:51:27 | FromDiscord | <Phil> (edit) "worrie" => "worries" |
17:52:49 | FromDiscord | <Phil> Also, fixed my lib problem. One of those things when you have no C background ~.~ ↵Apparently you can't normally link against so libs in your /usr/lib directory... even though make install throws any shared lib you compile in there.↵You need to add it to the PATH for finding shared libs. |
17:52:59 | FromDiscord | <Phil> > export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib↵To do it for the current session |
17:56:05 | FromDiscord | <Phil> sent a long message, see http://ix.io/4fJf |
17:56:18 | Amun-Ra | Slazaa: you wanted "if defined windows:" |
17:56:33 | FromDiscord | <Slazaa> I do :o |
17:59:18 | * | ixmpp joined #nim |
18:00:28 | FromDiscord | <.tochka> is there a way to conditionally compile based on used c compiler? cant find any info about definitions or anything related to that |
18:01:46 | Amun-Ra | .tochka: if defined gcc/… |
18:02:14 | Amun-Ra | two defines I know exist are gcc and clang |
18:03:06 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4fJi |
18:04:07 | FromDiscord | <.tochka> In reply to @Amun-Ra "two defines I know": huh, yeah, those work, but apparently my mingw clang gets treated as gcc |
18:04:48 | Amun-Ra | .tochka: I'd just use my own define, f.e. -d=mingw |
18:06:48 | Amun-Ra | System64 ~ Flandre Scarlet: https://play.nim-lang.org/#ix=4fJl |
18:07:16 | Amun-Ra | System64 ~ Flandre Scarlet: what editor are you using? it makes that mess |
18:07:53 | Amun-Ra | chr(29) is not printable, hence you can't see it |
18:08:14 | * | derpydoo quit (Quit: derpydoo) |
18:08:35 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Amun-Ra "System64 ~ Flandre Scarlet:": The actor type is in another file↵I'm using VSCode |
18:08:47 | FromDiscord | <.tochka> sent a code paste, see https://paste.rs/XoE |
18:09:13 | Amun-Ra | System64: invalid token \29 is editor's fault |
18:09:31 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Amun-Ra "System64: invalid token \29": Wait, what?!↵Which line?? |
18:09:49 | Amun-Ra | iirc 2 |
18:10:23 | Amun-Ra | or it's a result of pasting to play.nim, isn't it? you haven't stated what the error was |
18:10:38 | FromDiscord | <System64 ~ Flandre Scarlet> The sussiest thing is I don't even have a stacktrace! |
18:11:25 | Amun-Ra | that's compiler error |
18:11:54 | FromDiscord | <System64 ~ Flandre Scarlet> Whaaaat |
18:12:20 | Amun-Ra | let's get to the same page |
18:12:38 | FromDiscord | <System64 ~ Flandre Scarlet> the play.nim site? |
18:12:47 | Amun-Ra | running your paste on the page results with: /usercode/in.nim(2, 10) Error: invalid token: (\29) |
18:14:08 | FromDiscord | <System64 ~ Flandre Scarlet> I don't have this problem, WTF |
18:14:20 | Amun-Ra | so it's the paste fault |
18:14:40 | Amun-Ra | I've fixed it and got import error (box module) |
18:15:09 | Amun-Ra | there's almost no sense in providing pastes that do not compile online |
18:15:31 | FromDiscord | <System64 ~ Flandre Scarlet> Humm can I send the sources there? |
18:15:56 | Amun-Ra | could you make a, as small as possible, functional test case? |
18:16:11 | FromDiscord | <System64 ~ Flandre Scarlet> okay lemme do it |
18:16:44 | Amun-Ra | I mean I don't guarantee I'll fix it but someone probably will :> |
18:19:47 | FromDiscord | <System64 ~ Flandre Scarlet> Okay I have an illegal storage access |
18:19:57 | Amun-Ra | hmm |
18:20:23 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4fJo |
18:21:47 | Amun-Ra | btw, I almost never use refs :> |
18:21:59 | FromDiscord | <System64 ~ Flandre Scarlet> I try to use inheritence |
18:22:11 | FromDiscord | <Elegantbeef> You dont initalize `Player` |
18:22:27 | FromDiscord | <Elegantbeef> `var p = Player()` |
18:22:41 | Amun-Ra | new(result)? |
18:22:50 | FromDiscord | <Phil> ref objects do NOT get default initialized |
18:22:52 | FromDiscord | <Phil> Only value objects do |
18:23:04 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4fJp |
18:23:09 | FromDiscord | <Elegantbeef> I mean ref objects do get default intialized |
18:23:15 | FromDiscord | <System64 ~ Flandre Scarlet> Oh okay that works now, thanks |
18:23:18 | FromDiscord | <Elegantbeef> But it just happens that they dont get heap allocated 😄 |
18:23:26 | FromDiscord | <System64 ~ Flandre Scarlet> Ah alright |
18:23:27 | FromDiscord | <Phil> In reply to @Elegantbeef "I mean ref objects": I don't count "nil" as initalized xP |
18:23:28 | FromDiscord | <Elegantbeef> they're 0'd out which is nil |
18:23:31 | FromDiscord | <System64 ~ Flandre Scarlet> so nil ptr goes brr |
18:23:40 | FromDiscord | <System64 ~ Flandre Scarlet> and then segfault |
18:24:03 | FromDiscord | <Elegantbeef> Phil 0 initialized is better than C |
18:24:08 | FromDiscord | <Phil> In reply to @System64 "so nil ptr goes": The fact that ref types can have nil pointers is one of the reasons I tend to prefer value types wherever possible |
18:24:13 | Amun-Ra | next time compile with *san libs (asan, ubsa, etc.) |
18:24:16 | FromDiscord | <Phil> In reply to @Elegantbeef "Phil 0 initialized is": You're about to tell me they do something even more insane? |
18:24:31 | FromDiscord | <Elegantbeef> They dont 0 memory so whatever was on the stack is what you get |
18:24:36 | FromDiscord | <Phil> I mean, it's C, they think that a pointer to a value can also be an array because fuck you, at that point everything is possible |
18:24:41 | FromDiscord | <Phil> C |
18:24:43 | FromDiscord | <Phil> was written |
18:24:47 | FromDiscord | <Phil> by insane people |
18:25:08 | Amun-Ra | nah, it's just time was different |
18:25:19 | Amun-Ra | have you ever seen B? |
18:25:36 | FromDiscord | <Phil> I shudder to think what it or A might've looked like |
18:25:41 | Amun-Ra | ;> |
18:26:02 | Amun-Ra | the only A (except ARexx, a variant of Rexx) I know of is APL |
18:26:54 | FromDiscord | <Phil> Anyway, afaik Pascal was around at the the time of C and from what I hear it had a much saner way of viewing types |
18:27:20 | FromDiscord | <System64 ~ Flandre Scarlet> Okay it works now, thanks! |
18:27:33 | FromDiscord | <Elegantbeef> Pascal actually had a type system C on the otherhand.... |
18:27:43 | FromDiscord | <Phil> C seems like it has suggestions |
18:27:57 | Amun-Ra | Pascal had one drawback, no openArray equivalent |
18:28:08 | FromDiscord | <System64 ~ Flandre Scarlet> what's an openArray? |
18:28:26 | Amun-Ra | I mean the array in pascal had to have a fixed, known at compile time, size |
18:28:59 | Amun-Ra | you couldn't pass arr[3, int] and arr[4, int] to one function |
18:32:43 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright |
18:33:44 | Amun-Ra | System64: openArray in just nim's way of accepting arrays and seqs as function arguments |
18:34:34 | FromDiscord | <Phil> ... I think I'll just give up on the nimqml experiment, I can not be bothered to figure out what of the 50 different qt programs to install in the exact correct (slightly outdated) version for nimqml |
18:40:42 | FromDiscord | <System64 ~ Flandre Scarlet> Ah, good to know |
18:41:47 | FromDiscord | <System64 ~ Flandre Scarlet> Uuuh, polymorphism? https://media.discordapp.net/attachments/371759389889003532/1041060257071386726/image.png |
18:41:56 | FromDiscord | <Phil> Wait, one sec |
18:41:56 | FromDiscord | <Phil> Wtf |
18:42:04 | FromDiscord | <Phil> When I remove the version specification it works |
18:42:46 | FromDiscord | <Phil> In reply to @System64 "Uuuh, polymorphism?": I assume ActorList is a variable containing a seq/array even though it starts with a capital letter? |
18:43:08 | FromDiscord | <System64 ~ Flandre Scarlet> yeah it is a seq |
18:43:09 | FromDiscord | <Elegantbeef> They are using `proc` instead of `method` |
18:43:22 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#methods |
18:43:25 | FromDiscord | <System64 ~ Flandre Scarlet> Oh, so I need to use method instead? |
18:43:26 | FromDiscord | <Phil> method is for runtime dispatch |
18:43:35 | FromDiscord | <Elegantbeef> I swear some people dont even glimpse at the manual |
18:43:38 | FromDiscord | <Phil> which you need for polymorphism for reasons I haven't understood yet |
18:45:42 | FromDiscord | <System64 ~ Flandre Scarlet> okay works now |
18:45:50 | FromDiscord | <System64 ~ Flandre Scarlet> wait, no |
18:45:52 | FromDiscord | <Elegantbeef> Cause you're dynamically dispatching which isnt on the variable type but the runtime type |
18:46:02 | FromDiscord | <Elegantbeef> procs are dispatched on the static type, methods are not |
18:46:40 | FromDiscord | <Phil> I think in my head I don't separate between the two yet |
18:46:40 | * | rockcavera quit (Remote host closed the connection) |
18:47:08 | FromDiscord | <System64 ~ Flandre Scarlet> anyways it should be executed in update method, it wil change anyways |
18:48:59 | * | rockcavera joined #nim |
18:49:03 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef "Cause you're dynamically dispatching": so, what should I do? |
18:52:11 | FromDiscord | <Phil> Yeah I think runtime vs static type is one of those mental models I don't have yet. ↵I think I do get the examples I'm seeing though, just needs to settle a bit |
18:58:51 | NimEventer | New post on r/nim by Bleant: Is Fidget usable for implementation of 3D rendering?, see https://reddit.com/r/nim/comments/ytfdoe/is_fidget_usable_for_implementation_of_3d/ |
19:00:44 | * | pro joined #nim |
19:14:40 | FromDiscord | <rlipsc> In reply to @pietroppeter "hi <@800432830605819906>, you around?": Hey @pietroppeter, which example? They should only depend on sdl2, opengl, and glbits (from my github). |
19:17:00 | FromDiscord | <Phil> I believe he might be talking about stuff like the pixel-example where a million or so entities react to your mouse as you move it through said entities |
19:32:18 | * | TakinOver joined #nim |
19:34:47 | FromDiscord | <Elegantbeef> If you need runtime dispatch you use methods↵(@System64 ~ Flandre Scarlet) |
19:36:40 | FromDiscord | <guttural666> any good way to always exit a proc through a clean up block? goto clean_up? |
19:36:45 | FromDiscord | <rlipsc> In reply to @Isofruit "I believe he might": Oh, well that should work straight up. Is there an error? |
19:37:19 | FromDiscord | <Elegantbeef> `try finally` or `defer`↵(@guttural666) |
19:37:21 | FromDiscord | <Phil> In reply to @rlipsc "Oh, well that should": Was more like, where's the code 😄 |
19:37:31 | FromDiscord | <rlipsc> oh! |
19:37:35 | FromDiscord | <guttural666> In reply to @Elegantbeef "`try finally` or `defer`": thanks, gonna read up |
19:37:58 | * | fibonacci joined #nim |
19:38:04 | * | derpydoo joined #nim |
19:38:08 | FromDiscord | <rlipsc> In reply to @Isofruit "Was more like, where's": https://github.com/rlipsc/polymers/blob/master/polymers/demos/sdl2_opengl/modelsandtextures.nim |
19:38:10 | FromDiscord | <Phil> At least I think the pixel example isn't in the github (?) |
19:38:36 | FromDiscord | <Phil> Huh, I was staring at the example folder |
19:39:21 | FromDiscord | <Phil> Wait, wait, wait |
19:39:27 | FromDiscord | <Phil> You have 2 projects, polymer and polymorph |
19:39:31 | FromDiscord | <Phil> God damnit, no wonder I never found it |
19:39:32 | FromDiscord | <rlipsc> yep 🙂 |
19:40:01 | FromDiscord | <guttural666> In reply to @Elegantbeef "`try finally` or `defer`": a return statement in the proc will still run the defer stuff? |
19:40:07 | FromDiscord | <rlipsc> polymers is like a combination of a 'stdlib' of components and examples of how to do things |
19:40:54 | FromDiscord | <rlipsc> polymers -> stringing components together 😄 |
19:41:17 | FromDiscord | <pietroppeter> In reply to @rlipsc "Hey <@588390287810887693>, which example?": Chipmunk example: https://github.com/rlipsc/polymers/blob/master/polymers/physics/ecs_chipmunk2D.nim it is not a matter of dependencies. It is just misses the code to launch the ECS (I guess some kind of loop) |
19:41:21 | FromDiscord | <Phil> Oh that I got, I just mixed the two up back in the day. Anyway, I believe that might've been the example to look for |
19:41:56 | FromDiscord | <.tochka> wonder, is it possible to have something like errdefer from zig in nim, but with optional types, aka execute some block only if proc returns none |
19:42:02 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fJM |
19:42:10 | * | fibonacci left #nim (#nim) |
19:42:24 | FromDiscord | <pietroppeter> Btw @rlpisc I was always testing if it works with JS backend and apparently there is some issue (I tried the simple physics example in polymorph). Will open an issue on this |
19:42:34 | FromDiscord | <rlipsc> In reply to @pietroppeter "Chipmunk example: https://github.com/rlipsc/polymer": Ah, yes - that's the Chipmunk2d component itself. The demo for the component is here: https://github.com/rlipsc/polymers/blob/master/polymers/demos/sdl2_opengl/chipmunkballpit.nim |
19:42:58 | FromDiscord | <guttural666> In reply to @Elegantbeef "Why ask a question": you're right ofc |
19:43:22 | FromDiscord | <Elegantbeef> Yea it is tochka https://play.nim-lang.org/#ix=4fJN |
19:43:24 | FromDiscord | <pietroppeter> (edit) "@rlpisc" => "@rlipsc " | "this" => "this!" |
19:43:58 | FromDiscord | <pietroppeter> In reply to @rlipsc "Ah, yes - that's": Ah I see, I lost that part 🙂 thanks! |
19:44:14 | FromDiscord | <Elegantbeef> Can also do it with exceptions |
19:44:21 | FromDiscord | <rlipsc> I think polymers needs a bit of reorganising to be fair! |
19:44:30 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=4fJO |
19:44:36 | FromDiscord | <rlipsc> maybe the demos need to come out to a seperate repo |
19:45:00 | FromDiscord | <pietroppeter> Btw I also tried easyess (the polymorph inspired simple ecs), and that one does run in the js backend |
19:46:02 | FromDiscord | <rlipsc> Nice! I've not really tested it in JS so will be interesting to see what's going wrong. |
19:47:50 | FromDiscord | <rlipsc> It would be cool to do the particle demo for JS, but I'm not sure the best way to go about rendering. I guess I'd need a canvas component or something. |
19:50:11 | FromDiscord | <.tochka> In reply to @Elegantbeef "Yea it is tochka": oh, right. having result accessible everywhere is surprisingly versatile |
19:50:52 | FromDiscord | <Elegantbeef> Yea also `return` is a rewrite into setting the result and going to the finally block if it exists |
19:51:30 | FromDiscord | <Elegantbeef> Since it has NRVO |
19:51:43 | FromDiscord | <pietroppeter> In reply to @rlipsc "It would be cool": There is jscanvas (a Nim wrapper) that I was planning to use. For the experiment of today I tried moving a simple bouncing ball in a box using p5js since I had that example already working but probably jscanvas is a better match |
19:52:41 | FromDiscord | <Elegantbeef> Was going to jokingly say "just opengl es" but forgot that you dont get compute shaders↵(@rlipsc) |
20:03:12 | FromDiscord | <rlipsc> I've been wondering lately how feasible it'd be to expand what I have from particles to a general compute physics engine. Would be pretty cool if you could have 500k items bouncing about. |
20:05:20 | FromDiscord | <.tochka> In reply to @Elegantbeef "Was going to jokingly": gles 3.1 and later has compute afaik? |
20:05:59 | FromDiscord | <Elegantbeef> But webgl that opengl es goes to doesnt iirc |
20:07:26 | FromDiscord | <.tochka> oh right it goes to webgl api |
20:07:39 | FromDiscord | <.tochka> maybe some day https://registry.khronos.org/webgl/specs/latest/2.0-compute/ |
20:13:01 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
20:17:13 | FromDiscord | <JeysonFlores> sent a long message, see http://ix.io/4fJY |
20:17:35 | FromDiscord | <JeysonFlores> (edit) "http://ix.io/4fJY" => "http://ix.io/4fJZ" |
20:17:43 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/macros.html#getCustomPragmaVal.m%2Ctyped%2C |
20:19:26 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fK0 |
20:19:41 | FromDiscord | <Elegantbeef> `getImpl` emits the var def not the type def |
20:22:43 | FromDiscord | <JeysonFlores> Thanks! |
20:28:45 | * | megabytesofrem quit (Quit: Leaving) |
20:48:20 | * | ltriant joined #nim |
20:48:20 | * | cyraxjoe quit (Ping timeout: 248 seconds) |
20:49:06 | * | cyraxjoe joined #nim |
21:22:53 | FromDiscord | <guttural666> any terminal heroes here, who know how to do this better? I want to print a header to the terminal, then go to a subfunction, do my user interaction, do the actual work, go back and clean up the console echos I needed for that proc etc. etc., my solution works but is kind of ugly/tedious etc. |
21:23:18 | FromDiscord | <guttural666> omg KDE is so fucking buggy rn |
21:23:55 | FromDiscord | <guttural666> https://media.discordapp.net/attachments/371759389889003532/1041101057704591462/image.png |
21:25:48 | FromDiscord | <guttural666> have to replace all echos with that echo_count, keep track of the lines I've printed through all the loops and shit I do etc., then remember or defer clean up after a section, kinda meh |
21:25:57 | FromDiscord | <Elegantbeef> I'd probably suggest using illwill |
21:26:09 | FromDiscord | <guttural666> what's that? |
21:26:23 | FromDiscord | <Elegantbeef> A pure nim terminal library like ncurses |
21:29:13 | FromDiscord | <guttural666> god this looks powerful |
21:30:09 | FromDiscord | <guttural666> thanks for the tip |
21:30:51 | FromDiscord | <Mike> How is your screenshot so shiny?↵(@guttural666) |
21:31:21 | FromDiscord | <Elegantbeef> transparent terminals |
21:32:12 | * | pro quit (Quit: pro) |
21:32:24 | FromDiscord | <Mike> I mean my terminal is transparent too, but that looks... glossy |
21:32:57 | FromDiscord | <Elegantbeef> Think it's mainly the thumbnail |
21:32:59 | FromDiscord | <Elegantbeef> Making it full res doesnt look glossy here, but the thumbnail kinda does |
21:33:35 | FromDiscord | <guttural666> In reply to @Mike "I mean my terminal": just the effect of KDE Konsole (semi) transparency and the background |
21:34:04 | FromDiscord | <Mike> Yeah fair enough, it is more clear when it's fullscreen |
21:34:07 | FromDiscord | <guttural666> that might make it appear to be glossy, but could just be the random point in the wallpaper shining through |
21:35:23 | FromDiscord | <Mike> Thought maybe you were using wayfire or some other crazy compositor |
21:36:22 | FromDiscord | <guttural666> just X11/KDE out of the box from endevourOS |
21:38:23 | FromDiscord | <guttural666> well that effect is not out of the box, but my config of Konsole, you get the point |
21:39:38 | FromDiscord | <Mike> Yeah I have a similar setup for Kitty |
21:40:37 | FromDiscord | <guttural666> is that the SSH client? bah |
21:40:39 | FromDiscord | <guttural666> nah |
21:42:50 | FromDiscord | <Mike> Nah it's just a terminal emulator. It's cool though. It's GPU accelerated and will do some neat stuff like display images if you want it to |
21:43:03 | FromDiscord | <guttural666> ah okay, never heard of that |
21:43:41 | FromDiscord | <guttural666> kind of a rough name for a small project to be searched haha |
21:50:27 | * | jmdaemon joined #nim |
21:51:57 | FromDiscord | <guttural666> how do I sneak in this bad boy before case evaluation? https://media.discordapp.net/attachments/371759389889003532/1041108107775975585/image.png |
21:54:11 | FromDiscord | <huantian> why not just put it the line before the case? |
21:54:58 | FromDiscord | <guttural666> probably drunk |
21:55:01 | FromDiscord | <guttural666> you're right |
21:55:29 | * | dnh joined #nim |
21:55:47 | FromDiscord | <guttural666> but I remember the if x = 0, x == 0 thing works in Nim somehow |
21:56:44 | FromDiscord | <Slazaa> sent a code paste, see https://play.nim-lang.org/#ix=4fKz |
21:56:59 | FromDiscord | <guttural666> no, I can't do it that way, because I want to increment only of the endless loops executes again |
21:57:10 | FromDiscord | <Slazaa> sent a code paste, see https://play.nim-lang.org/#ix=4fKA |
21:57:22 | FromDiscord | <huantian> In reply to @guttural666 "but I remember the": I think you'd have to do something like `↵(inc lines2; readLine(stdin).toLower())` |
21:57:57 | FromDiscord | <huantian> sent a code paste, see https://play.nim-lang.org/#ix=4fKB |
21:58:46 | FromDiscord | <guttural666> In reply to @huantian "I think you'd have": yeeeees! now we're talkin |
21:58:51 | FromDiscord | <Slazaa> Sorry, this code doesn't give me any error either :o |
21:59:00 | FromDiscord | <Slazaa> But I have a similiar case that does |
21:59:09 | FromDiscord | <huantian> In reply to @guttural666 "yeeeees! now we're talkin": I still don't know what the functional difference is between this and just putting it the line before lol |
21:59:39 | FromDiscord | <guttural666> In reply to @huantian "I still don't know": next time this endless loop comes around, it should do the same inc |
22:00:03 | FromDiscord | <guttural666> In reply to @huantian "I still don't know": engage thinker cap haha |
22:01:37 | FromDiscord | <huantian> what does that mean |
22:02:13 | FromDiscord | <guttural666> the inc should not only occur once at the start of the while loop but at each instance the while loop is run |
22:02:48 | FromDiscord | <huantian> so you want to inc at the end of each iteration? |
22:03:04 | FromDiscord | <guttural666> effectively a do{} while {} loop in other lngs |
22:03:11 | FromDiscord | <guttural666> no at the start |
22:03:59 | FromDiscord | <huantian> right but how does putting it in the matched variable affect it |
22:04:25 | FromDiscord | <huantian> sent a code paste, see https://play.nim-lang.org/#ix=4fKD |
22:04:50 | FromDiscord | <guttural666> uhhhm, yes you are still right |
22:05:00 | FromDiscord | <guttural666> 100% correct, sorry haha |
22:05:07 | * | carce joined #nim |
22:05:18 | FromDiscord | <huantian> no need to be sorry lol I was just confused |
22:06:18 | FromDiscord | <guttural666> I'm the one who is confues rn haha |
22:06:47 | FromDiscord | <guttural666> I stand corrected |
22:31:03 | FromDiscord | <.tochka> can somebody point examples for emit pragma |
22:31:31 | FromDiscord | <.tochka> manual shows too little |
22:38:55 | FromDiscord | <Elegantbeef> https://github.com/ftsf/nico/blob/main/nico/stb_vorbis.nim |
22:40:59 | FromDiscord | <.tochka> lol |
22:41:11 | FromDiscord | <.tochka> now that's efficient nim |
22:41:42 | FromDiscord | <Elegantbeef> What are you after exactly with the emit though |
22:42:02 | FromDiscord | <Elegantbeef> It just outputs verbatim what you put in for the backend language to manage |
22:43:11 | FromDiscord | <.tochka> wanted to use some compiler intrinsics, question is how do you pass nim variables there |
22:44:42 | FromDiscord | <auxym> you can use plain old importc for compiler intrinsics |
22:44:57 | FromDiscord | <auxym> https://github.com/status-im/nim-stew/blob/master/stew/endians2.nim |
22:45:09 | PMunch | Fuck me.. A `var1 = if var1 < 0: 0 else: var1` check in my code was the cause of all my grief |
22:45:58 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fKI |
22:46:08 | FromDiscord | <.tochka> In reply to @auxym "you can use plain": oh nice |
22:46:11 | FromDiscord | <Elegantbeef> Though think it's proper to backtick around the variable |
22:46:15 | PMunch | Since it's 16-bit target that 0 is treated as a int16, but Nim sees it as an int. It thinks it can fit an int32 into an int, so it doesn't complain about the cast here, and happily chops two bytes of var1.. |
22:46:40 | PMunch | I've spent hours upon hours trying to figure out why this code doesn't work.. |
22:47:36 | FromDiscord | <Elegantbeef> I'd comment on you reinventing max but meh 😄 |
22:48:22 | PMunch | Max does indeed not have this issue |
22:48:41 | PMunch | But I was porting C code |
22:54:39 | FromDiscord | <Bung> how to verify this, am considering make a patch for this |
22:55:26 | PMunch | The int16 stuff? |
22:56:41 | FromDiscord | <Bung> yeah |
23:02:50 | FromDiscord | <Bung> it get wrong at semantic step |
23:03:17 | PMunch | Well you'd need to compile for a 16 bit target |
23:03:52 | PMunch | So either find an Arduino to run it on, or maybe try to find an Arduino emulator? |
23:04:53 | FromDiscord | <.tochka> nim with cc65 when |
23:05:42 | FromDiscord | <Elegantbeef> Just use llvm-mos |
23:06:17 | FromDiscord | <auxym> In reply to @PMunch "So either find an": might be possible with QEMU: https://www.qemu.org/docs/master/system/target-avr.html |
23:06:35 | FromDiscord | <auxym> when I looked into for ARM though it seemed really complicated |
23:07:04 | PMunch | @auxym, oh yeah that should work |
23:08:03 | FromDiscord | <.tochka> In reply to @Elegantbeef "Just use llvm-mos": seen their rust demo, impressive stuff |
23:09:03 | FromDiscord | <Elegantbeef> Yea I know someone used it with Nim aswell |
23:09:11 | FromDiscord | <Elegantbeef> Just for a toy of course |
23:09:17 | FromDiscord | <Bung> so nim can produce elf file?↵(@auxym) |
23:09:43 | * | carce quit (Remote host closed the connection) |
23:10:25 | FromDiscord | <auxym> well technically, avr-gcc can produce the ELF 😉 elf is just the executable format for linux though, all execs on linux are ELF format, even if they don't have the ELF extension |
23:11:33 | FromDiscord | <Elegantbeef> The fuck is a file extension?! |
23:12:07 | FromDiscord | <.tochka> i think coff and com files are still in kernel? |
23:12:27 | FromDiscord | <.tochka> (edit) "files" => "loaders" |
23:13:19 | PMunch | @Bung, yes with avr-gcc you can end up with elf files |
23:17:34 | FromDiscord | <guttural666> In reply to @PMunch "Fuck me.. A `var1": is this the PMunch himself? thanks for the lsp man hahaha |
23:18:08 | FromDiscord | <Elegantbeef> Nah the domesticated viking is in another castle |
23:18:39 | PMunch | @guttural666, haha yes it's me :) Glad you like LSP! |
23:19:00 | * | dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
23:21:22 | FromDiscord | <Bung> thanks! I'll try to see if I can make it work |
23:23:40 | FromDiscord | <guttural666> In reply to @PMunch "<@375727321958580228>, haha yes it's": all the sweet sweet Vim stuff is from you so I remembered that name 🙂 this bad boy broke for me lately tho, giving the error " function tab not available or something" not a vim expert didn't know what to do |
23:23:44 | FromDiscord | <guttural666> https://media.discordapp.net/attachments/371759389889003532/1041131210707058698/image.png |
23:25:20 | FromDiscord | <guttural666> just started a new linux machine, install all the nim stuff and vim and then tab stops working, not sure why |
23:25:27 | FromDiscord | <guttural666> in vim |
23:30:40 | PMunch | Hmm, that's weird |
23:30:47 | FromDiscord | <.tochka> also is there a way to enforce openArray to be read only? |
23:31:02 | FromDiscord | <Elegantbeef> Pass it without `var` |
23:32:02 | PMunch | To be honest I barely use NimLSP myself :P It's to the point where I haven't even bothered to create shortcuts for the various things. So I just go somewhere and run e.g. :LspHover manually. I think tab completion works on my work machine though |
23:38:37 | FromDiscord | <Bung> I guess I'll need prevent the sigmatch first? `of tyInt: result = handleRange(f, a, tyInt8, tyInt32)` |
23:41:19 | FromDiscord | <Bung> sent a code paste, see https://play.nim-lang.org/#ix=4fKR |
23:43:23 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fKS |
23:44:21 | FromDiscord | <Elegantbeef> I guess one doesnt need that much `var i: int = 100i32` compiles |
23:45:30 | FromDiscord | <Elegantbeef> The implicit conversions to larger sized integers is odd |
23:46:36 | FromDiscord | <Bung> maybe just add extro step check the target int size |
23:48:10 | FromDiscord | <Bung> the sigmatch doesn't take config argument even. |
23:49:38 | FromDiscord | <Elegantbeef> Eh it's↵> Automatic type conversion is performed in expressions where different kinds of integer types are used |
23:49:47 | PMunch | Hmm, this constant objects leaking into code as actual objects is also really concerning.. |
23:50:13 | PMunch | The generated C code is full of nimZeroMem for things which should be a static object.. |
23:50:21 | FromDiscord | <Elegantbeef> Widening for integers only happens in Nim |
23:51:00 | FromDiscord | <Elegantbeef> Yea i looked at it Pmunch it loses the static information inside `evalStaticExpr` |
23:51:15 | FromDiscord | <Elegantbeef> Field access isnt a `static[T]` so it doesnt evaluate it it statically |
23:51:25 | PMunch | Well that sounds like a silly place to lose static information |
23:52:02 | FromDiscord | <Elegantbeef> Well i added it back and it broke other code so i called it a night 😛 |
23:57:24 | PMunch | Hmm, I guess I have to look into this at some other time |
23:57:28 | PMunch | But now I'm off to bed |
23:57:29 | * | PMunch quit (Quit: leaving) |
23:57:54 | FromDiscord | <Elegantbeef> Buh bye |