<< 12-11-2022 >>

01:00:37FromDiscord<alice.> how do i find where this is happening
01:00:48FromDiscord<alice.> sent a code paste, see https://play.nim-lang.org/#ix=4fEO
01:13:29FromDiscord<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:55FromDiscord<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:02FromDiscord<Bung> https://github.com/nim-lang/Nim/issues/14604 I guess similar one?
01:23:01FromDiscord<alice.> can i please get help
01:23:08FromDiscord<alice.> my code wont compile and i have no idea why
01:23:36FromDiscord<alice.> even when git pulling it doesnt work
01:23:39FromDiscord<alice.> and i have no clue why tf
01:23:53FromDiscord<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:08FromDiscord<Andreas> (edit) "In reply to @Bung "https://github.com/nim-lang/Nim/issues/14604 I gues": my observation does ... deal" added "not"
01:24:39FromDiscord<Andreas> (edit) "leak." => "leak for the built-in `seq`."
01:29:01FromDiscord<Bung> https://github.com/nim-lang/Nim/issues/19794 what about this
01:29:29FromDiscord<Bung> I've seen several arc leak issues
01:30:09FromDiscord<alice.> @Bung could i get help w this weird issue
01:30:22FromDiscord<alice.> sent a code paste, see https://play.nim-lang.org/#ix=4fEV
01:30:46FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fEW
01:31:06FromDiscord<ChocolettePalette> Invalid indentation o.o
01:31:56FromDiscord<alice.> yeah it makes NO fucking sense
01:32:02FromDiscord<alice.> i have no idea why it broke
01:32:11FromDiscord<alice.> nothing has changed'
01:32:35FromDiscord<alice.> why can it not parse the package info file?????
01:32:46FromDiscord<alice.> this is the contents of it
01:32:53FromDiscord<alice.> @ElegantBeef
01:32:54FromDiscord<alice.> sent a code paste, see https://play.nim-lang.org/#ix=4fEX
01:33:41FromDiscord<ChocolettePalette> That's sus!
01:34:03FromDiscord<alice.> ffs
01:34:06FromDiscord<alice.> can i get some help w this
01:34:13FromDiscord<ChocolettePalette> Try removing spaces or tabs between variables and ='s
01:34:14FromDiscord<alice.> because i literally cannot build this project
01:34:15FromDiscord<alice.> at all
01:34:31FromDiscord<alice.> why would that fix it
01:34:47FromDiscord<ChocolettePalette> Just try it why not
01:34:51FromDiscord<alice.> it did nothing
01:35:30FromDiscord<alice.> well nim is just fucked
01:35:37FromDiscord<alice.> it cant read a project file from an old file
01:35:37FromDiscord<Elegantbeef> nimble\
01:35:40FromDiscord<alice.> which is 100% valid
01:35:49FromDiscord<alice.> how does it just break
01:35:50FromDiscord<alice.> WTF
01:36:27FromDiscord<alice.> so i guess i cant use this language now
01:36:34FromDiscord<alice.> because its package manager just died
01:36:42FromDiscord<alice.> wtf??
01:37:04FromDiscord<Bung> I cant see invalid code in nimble by eye
01:37:27FromDiscord<alice.> because there IS none
01:37:40FromDiscord<alice.> the proof is that i c loned another project that i didnt touch in weeks
01:37:43FromDiscord<alice.> and it also doesnt build
01:37:47FromDiscord<Bung> maybe use choosenim try other version ?
01:38:37FromDiscord<Elegantbeef> Also what's the repo?
01:39:21FromDiscord<Bung> yeah, maybe provide the repo then other people can try
01:39:24FromDiscord<alice.> why is that relevant
01:39:29FromDiscord<alice.> its fucked on nimble as a whole
01:39:33FromDiscord<alice.> > the proof is that i c loned another project that i didnt touch in weeks
01:39:39FromDiscord<alice.> and it also didnt build
01:39:42FromDiscord<alice.> this is not a repo issue
01:40:31FromDiscord<Bung> but other can try in their env and use their nim version
01:40:43FromDiscord<alice.> its not a repo issue
01:41:04FromDiscord<Bung> like I can try with latest devel and nimble
01:42:25FromDiscord<alice.> well i got it working again
01:42:31FromDiscord<alice.> i had to uninstall and reinstall nim stable
01:42:35FromDiscord<alice.> no idea what happened
01:43:37FromDiscord<alice.> nimble seems to be cabal level unstable
01:43:43FromDiscord<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:02FromDiscord<sOkam!> (edit) removed "an app with"
01:44:04FromDiscord<alice.> which is fine if its buggy but provide an option to reset it then
01:44:29FromDiscord<Elegantbeef> Depends on how it works↵(@sOkam!)
01:44:48FromDiscord<alice.> In reply to @Bung "like I can try": devel worked i guess stable was corrupted somehow
01:46:16FromDiscord<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:48FromDiscord<alice.> anyway its fixed now but i would be lying if i said that wasnt weird
01:50:57FromDiscord<alice.> i genuienely have no idea what happened
01:51:10FromDiscord<alice.> how does nimble just corrupt its installation
01:51:42FromDiscord<Elegantbeef> A cosmic ray flipped a bit on your drive
01:54:03FromDiscord<alice.> fr lol
01:54:41FromDiscord<alice.> reminds me of https://media.discordapp.net/attachments/371759389889003532/1040806809310609469/unknown.png
01:55:00FromDiscord<alice.> also cursed question but would it possible to install nim on a steam deck 🤔
01:56:06FromDiscord<alice.> if so i will try it
01:56:24FromDiscord<Andreas> In reply to @Bung "I've seen several arc": thx, fixed it - was my bad..
01:59:13FromDiscord<Andreas> @Bung BTW would'nt it be nice to have a valgrind-report in the playground ?
02:00:46FromDiscord<Bung> you can make a PR for it , it's on github
02:01:13FromDiscord<Bung> sry, it's frontend public.
02:01:16FromDiscord<Andreas> In reply to @Bung "you can make a": i know yod'd say that 🙂
02:01:41FromDiscord<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:46FromDiscord<dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4fFf
02:48:12FromDiscord<dlesnoff> (edit) "https://play.nim-lang.org/#ix=4fFf" => "https://play.nim-lang.org/#ix=4fFg"
02:48:34FromDiscord<dlesnoff> (edit) "https://play.nim-lang.org/#ix=4fFg" => "https://play.nim-lang.org/#ix=4fFh"
02:49:03FromDiscord<dlesnoff> (edit) "https://play.nim-lang.org/#ix=4fFh" => "https://play.nim-lang.org/#ix=4fFi"
02:52:52FromDiscord<ChocolettePalette> Slideshow o.o
02:53:14FromDiscord<dlesnoff> Well nimibook here
02:54:24FromDiscord<dlesnoff> I guess I could do a regex, but I don't know how this manages multiline replacement.
02:54:32FromDiscord<ringabout> Would it be better to use a Markdown parser?
02:54:46FromDiscord<ChocolettePalette> You kinda don't have to use regex
02:55:52FromDiscord<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:17FromDiscord<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:10FromDiscord<ringabout> https://github.com/soasme/nim-markdown
02:57:19FromDiscord<ringabout> A Nim one probably works too.
02:57:28FromDiscord<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:41FromDiscord<ChocolettePalette> 3. Have to replace the end of markdown markup as well
02:58:28FromDiscord<ringabout> Or it you use a c wrapper.
02:58:49FromDiscord<ChocolettePalette> You don't have to extract it, it's a finite automata or smth↵(@dlesnoff)
02:59:04FromDiscord<ChocolettePalette> I.e. it processes the file line by line
03:00:17FromDiscord<ChocolettePalette> And if you manage to do it inplace somehow, you'll be able to convert files of arbitary size
03:00:47FromDiscord<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:09FromDiscord<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:38FromDiscord<dlesnoff> Can I have the line number of my file in addition to the line string itself?
03:16:40FromDiscord<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:07FromDiscord<ringabout> The Nim dialect markdown supports testing example too.
03:19:22FromDiscord<ringabout> sent a code paste, see https://paste.rs/SAT
03:19:26FromDiscord<ringabout> (edit)
03:19:41FromDiscord<dlesnoff> Nimibook leverages this markdown tool.
03:20:16FromDiscord<ringabout> (edit)
03:20:26FromDiscord<dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4fFo
03:20:40FromDiscord<ringabout> Lol, I gave up
03:21:37FromDiscord<ringabout> The documentation of Nim has switched to markdown which is supposed to have more support in the future.
03:21:51FromDiscord<dlesnoff> It suffices to add a compilation flag on top of all nim code blocks 😮
03:22:42FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=4fFp
03:24:11FromDiscord<pip install tester> sent a code paste, see https://play.nim-lang.org/#ix=4fFq
03:24:50FromDiscord<pip install tester> sent a code paste, see https://play.nim-lang.org/#ix=4fFr
03:26:04FromDiscord<dlesnoff> In reply to @ringabout "The documentation of Nim": Oh it used RST before.
03:27:12*joast quit (Quit: Leaving.)
03:27:59FromDiscord<dlesnoff> oh I got it
03:28:00FromDiscord<dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4fFs
03:28:17FromDiscord<dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4fFt
03:28:34FromDiscord<dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4fFu
03:29:03FromDiscord<dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4fFv
03:29:10FromDiscord<dlesnoff> Almost got it 😦
03:29:39FromDiscord<dlesnoff> (edit) "https://play.nim-lang.org/#ix=4fFv" => "https://play.nim-lang.org/#ix=4fFw"
03:31:58FromDiscord<pip install tester> sent a code paste, see https://paste.rs/4co
03:33:42FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4fFz
03:34:16FromDiscord<scarf> which library should i use for video to ascii tranalation? (to make something like ascii bad apple)
03:34:41FromDiscord<ringabout> (edit) "https://play.nim-lang.org/#ix=4fFz" => "https://play.nim-lang.org/#ix=4fFA"
03:35:03FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4fFB
03:35:47FromDiscord<ringabout> We can use `nim ms2html` to test the examples and use external md tools to generate nice HTML documentation.
03:35:52FromDiscord<ringabout> (edit) "ms2html`" => "md2html`"
03:37:01FromDiscord<dlesnoff> `nim md2html` does not produce a HTML for both text and code?
03:37:10*arkurious quit (Quit: Leaving)
03:39:04FromDiscord<ringabout> Yeah, it produces. But the generated HTML is not necessarily great or customizable.
03:41:52FromDiscord<dlesnoff> I have got a lot of errors on nimwiki files indeed, but at least it works for small files.
03:44:33FromDiscord<ringabout> Yeah, it is the Nim dialect syntax of Markdown.
03:45:46FromDiscord<ringabout> We can implement code blocks checking based on the last of a proper Markdown parser + custom test commanf syntax.
03:46:02FromDiscord<ringabout> (edit) "last" => "ast"
03:46:53FromDiscord<ringabout> Or we can delay the testing and just render the Markdown file.
03:48:22FromDiscord<ringabout> So we can make progress step by step in place of the original wiki.
03:49:52FromDiscord<ringabout> It is not necessarily nimibook. I use mkdocs which is pretty good.
03:49:54FromDiscord<ringabout> https://github.com/planety/prologue/blob/112df3c42826d76c426f5f8ffd8b174b1fada65d/prologue.nimble#L36
03:50:14FromDiscord<ringabout> https://planety.github.io/prologue/quickstart/
04:02:40FromDiscord<pip install tester> sent a long message, see http://ix.io/4fFL
05:20:47*ltriant quit (Ping timeout: 268 seconds)
05:27:17FromDiscord<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:54FromDiscord<JeysonFlores> sent a long message, see http://ix.io/4fGc
06:13:57FromDiscord<JeysonFlores> and doesn't print anything
06:17:14FromDiscord<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:44madpropsmadprog?
06:26:43FromDiscord<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:18FromDiscord<Rika> ?
06:34:37FromDiscord<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:03FromDiscord<JeysonFlores> In reply to @demotomohiro "<@639292135098810390> Nim manual": Ok fair enough then. Thanks!
06:38:06FromDiscord<qb> sent a code paste, see https://play.nim-lang.org/#ix=4fGg
07:04:46*rockcavera joined #nim
07:23:09FromDiscord<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:45FromDiscord<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:19FromDiscord<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:46FromDiscord<Kermithos> In reply to @qb "A string should be": maybe strip the whitespaces first?
09:58:44FromDiscord<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:52FromDiscord<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:18FromDiscord<pietroppeter> (finally starting to use polymorph and trying out polymers... :))
10:24:15FromDiscord<ringabout> Converting ptr char to cstring should be discouraged since ptr char isn't necessarily null termination, which is quite dangerous.
10:34:17FromDiscord<ringabout> Also It seems that if implicit conversion is disabled, the conversion doesn't work either.
10:48:28Guest1473Hi! Is there any possibility to convert seq[] to heap allocated array?
10:50:10Guest1473Using 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:43Guest1473but for some reason it not works, or I'm doint it wrong
10:53:46FromDiscord<Rika> You cannot convert sequences from or to manually heap allocated arrays
10:54:06FromDiscord<Rika> There is no way, do not try it, it is not possible
10:55:06Guest1473Rika, thnx
10:55:31FromDiscord<scarf> there's tons of ptr char to cstring error when compiling nim from source, are they okay to ignore?
10:55:37FromDiscord<Rika> There are other options, but not to a sequence
10:55:55FromDiscord<Rika> You can use the unchecked array type for at least some array like ergonomics
10:56:11FromDiscord<planetis> Thanks xflywind
10:56:33Guest1473Rika, 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:54FromDiscord<Rika> I don’t understand
10:57:11Guest1473Rika, yeah, hard to explain for me little bit
10:57:36FromDiscord<Rika> I’ll wait then
10:58:11Guest1473Rika, thanks, I will write example in playground, that should be better than just words
11:01:24Guest1473Rika, https://play.nim-lang.org/#ix=4fGW
11:01:58Guest1473Rika you mentioned uncheckedArray, and that helped me, thanks a lot
11:02:17Guest1473I hope this will work with type "complex"
11:02:25FromDiscord<Rika> Multiply sequence length by size of integer, allocation procedure takes byte count
11:02:45FromDiscord<Rika> That works
11:02:53Guest1473Rika, yeah, like in C
11:03:44Guest1473the problem is with dfft lib binding, it requires arrays with structure
11:04:33Guest1473I hope somebody will have the time for own math library for nim
11:05:13Guest1473I mean who will implement fast enough dfft
11:05:21Guest1473*dft
11:05:46FromDiscord<Rika> Wait, I realised something
11:05:54FromDiscord<Rika> Wait no it’s okay
11:06:06FromDiscord<Rika> You technically can go from sequence to raw heap array
11:06:18FromDiscord<Rika> But there are limitations and unsafeties with it
11:06:36Guest1473using pointer arithmetic?
11:07:21FromDiscord<Rika> cast[ptr UncheckedArray[int](aSeq[0].addr)
11:07:44Guest1473hmm, interesting. I'll try now
11:07:50FromDiscord<Rika> Limitation is be careful of keeping the pointer for too long
11:07:58FromDiscord<Rika> (It might change when you mutate the sequence)
11:08:05FromDiscord<Rika> Change as in invalidate
11:08:53Guest1473aha.. ok. It should not change in that block of code
11:08:55FromDiscord<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:27Guest1473aha, awesome. exactly what I need
11:09:34Guest1473let me verify that
11:09:34FromDiscord<Rika> I think you should effectively treat the raw pointer as “do not mutate” (but technically you can change the contents)
11:10:18FromDiscord<scarf> sent a code paste, see https://play.nim-lang.org/#ix=4fGX
11:10:31FromDiscord<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:33Guest1473no, it should not mutate there.
11:10:49FromDiscord<Rika> In reply to @scarf "can nim assert show": In unit test module there is check procedure
11:10:50FromDiscord<Rika> I think
11:11:16FromDiscord<albassort> yea you can do a check and explain
11:12:05FromDiscord<scarf> In reply to @Rika "In unit test module": can i use `check` for stdlib tests? they all uses `doAssert`
11:12:16FromDiscord<Rika> Dunno
11:15:47FromDiscord<scarf> ok. also what are ccgbugs? https://media.discordapp.net/attachments/371759389889003532/1040948015822819399/image.png
11:16:52FromDiscord<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:32FromDiscord<scarf> In reply to @Bung "generate invalid c code": does it mean that nim compiler generated invalid c code?
11:27:08FromDiscord<ringabout> It's the nimcache of tests.
11:27:47FromDiscord<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:11FromDiscord<dlesnoff> Personally I would prefer using check in my future projects.
11:28:39FromDiscord<dlesnoff> `4.0 == 2 + 2` should fail IMO
11:28:42FromDiscord<scarf> In reply to @ringabout "It's the nimcache of": should `nimcache` be added to `.gitignore`?
11:30:19FromDiscord<dlesnoff> shouldn't these questions be asked in `internals` instead?
11:30:35FromDiscord<scarf> In reply to @Jiezron "shouldn't these questions be": oh, didn't know that, sorry
11:34:47FromDiscord<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:28FromDiscord<Phil> internals is compiler dev
12:20:44FromDiscord<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:37FromDiscord<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:29FromDiscord<Require Support> (edit) "Duration" => "Duration. I'm using devel btw, not sure if it matters"
13:16:59FromDiscord<Require Support> nvm it was chronos... it has Duration object, woops
13:19:01*krux02 joined #nim
13:33:05FromDiscord<Anna Aurora 🏳🌈🏴☠🕳> How do I write a library in nim? Any tutorials?
13:33:06FromDiscord<enthus1ast> export stuff from one nim file with `` import the module in another nim file with `import theOtherFile`
13:33:35FromDiscord<Anna Aurora 🏳🌈🏴☠🕳> how do I export?
13:33:51FromDiscord<enthus1ast> `proc myProc() =`
13:34:54FromDiscord<enthus1ast> https://nim-lang.org/docs/manual.html#procedures-export-marker
13:35:47FromDiscord<enthus1ast> also this\: https://nim-lang.org/docs/system.html#isMainModule
13:36:11FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4fHv
13:39:52FromDiscord<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:48FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4fHw
13:44:05FromDiscord<Anna Aurora 🏳🌈🏴☠🕳> do `export submodule` in my main nim file, will users of the library have to import `x/submodule` or `x`?
13:44:05FromDiscord<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:15FromDiscord<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:52FromDiscord<enthus1ast> so for example\: https://github.com/enthus1ast/nimja/blob/master/src/nimja.nim
13:46:18FromDiscord<enthus1ast> 1,
13:50:18FromDiscord<auxym> you might also be interested in https://github.com/treeform/nimtemplate
13:58:02FromDiscord<scarf> is `i32` same as `int32`?
13:58:52FromDiscord<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:07FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4fHD
14:02:58FromDiscord<Bung> literal i32 exactly matches int32
14:09:17FromDiscord<scarf> oh, just found out `let foo: i32 = 10` doesn't work (since it's not defined)
14:18:05FromDiscord<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:46FromDiscord<ngangngong> hi guys, why `asynchttpserver` slower compared to net/http go's and actix rust's?
15:53:01FromDiscord<ngangngong> (edit) "slower" => "slower(wrk benchmark)"
15:53:57FromDiscord<ngangngong> I wonder if there's any faster http server than asynchttpserver comparable to both go's and rust's?
15:54:07FromDiscord<Rika> httpbeast or httpx
15:54:14FromDiscord<Rika> both external library
15:54:39FromDiscord<ngangngong> have you tested it?
15:55:12FromDiscord<ngangngong> ok, so i checked on nimble both, lemme test it.
15:55:29FromDiscord<Rika> i have not
15:55:37FromDiscord<Rika> but i know theyre better than asynchttpserver
15:55:41FromDiscord<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:14PMunchHmm, something funky is going on with $ on the Arduino
16:27:04PMunchAha, there is no $ for int32, it just converts it to a int and stringifies that
16:27:13PMunchProblem is, on the Arduino int is int16
16:28:14PMunchSo 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:08FromDiscord<auxym> nice. I'd consider that a bug in the stdlib `$`
16:33:07FromDiscord<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:50FromDiscord<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:32FromDiscord<Require Support> i guess i could covert from int array of size `dwBytesNeeded` ? idk im lost
16:35:40FromDiscord<auxym> not familiar, what does intAlloc do?
16:36:59FromDiscord<Require Support> sent a code paste, see https://paste.rs/unJ
16:37:59FromDiscord<auxym> so it allocates space for X ints? or X bytes?
16:38:42FromDiscord<Require Support> good question, i have no idea 😄
16:38:46FromDiscord<Require Support> i guess ill answer that first
16:39:35FromDiscord<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:05FromDiscord<auxym> be careful: all this stuff bypasses the GC, so make sure you `dealloc` the memory somewhere (and only once)
16:40:16FromDiscord<auxym> and that you never use the memory after dealloc.
16:40:26FromDiscord<auxym> So basically all the standard C footguns
16:41:13FromDiscord<Require Support> Thanks 🙏
16:41:26*possess joined #nim
16:41:48*possess quit (Read error: Connection reset by peer)
16:42:16FromDiscord<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:55FromDiscord<Require Support> ok alloc() worked, ill try the ref way and see what i get
16:44:25*possess joined #nim
16:45:09FromDiscord<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:49FromDiscord<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:06FromDiscord<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:55FromDiscord<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:13FromDiscord<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:10FromDiscord<auxym> i don't see the example on the page you linked though
16:50:39*ltriant quit (Ping timeout: 260 seconds)
16:55:26FromDiscord<Require Support> oh i can paste the example here its not on there i just took one snippet from github
16:56:45FromDiscord<Require Support> sent a code paste, see https://play.nim-lang.org/#ix=4fIM
16:57:04FromDiscord<Require Support> (edit) "https://play.nim-lang.org/#ix=4fIM" => "https://play.nim-lang.org/#ix=4fIN"
17:11:44FromDiscord<Phil> Anyone have an idea what libDOtherSide is?
17:12:40*jonlevin left #nim (#nim)
17:12:45FromDiscord<Phil> sent a long message, see http://ix.io/4fIX
17:13:52Amun-Rahttps://github.com/filcuc/DOtherSide
17:14:07Amun-Ra"C language library for creating bindings for the Qt QML language."
17:15:19FromDiscord<Phil> Argh, step 1 in the flipping manual got me again
17:15:32*joast joined #nim
17:16:29Amun-RaI tried to use qml a frew times but I can't bear it, I still prefer good old ui
17:18:20FromDiscord<Phil> "Good old ui"?
17:18:50FromDiscord<Phil> I am but a simple webdev, never done native before, just a few webview experiments here and there
17:20:37PMunchHmm, fun.. I have a calculation that works fine on my machine. But when I compile for the Arduino it fails..
17:30:05PMunchI have a sneaking suspicion that this is also caused by int issues
17:31:58FromDiscord<Phil> sent a long message, see http://ix.io/4fJ7
17:32:43FromDiscord<Phil> Do I need to specify the so file via some specific nim flag?
17:33:30Amun-RaPhil: good old ui as in using .ui files
17:42:28*jjido joined #nim
17:43:19FromDiscord<Slazaa> Hey, how can I declare procedures depending on the current OS ? :o
17:43:45FromDiscord<Slazaa> sent a code paste, see https://play.nim-lang.org/#ix=4fJe
17:43:52FromDiscord<Slazaa> I've tried this but it doesn't seem to work
17:43:57FromDiscord<Phil> As in, you want to swap out the proc at compile-time?
17:44:46FromDiscord<Phil> Did you compile with a "--define:window" or "-d:window" flag?
17:44:57FromDiscord<Slazaa> Oh :o
17:45:01FromDiscord<Slazaa> No I didn't
17:45:13FromDiscord<Slazaa> I thought it did it automatically like C x)
17:45:20FromDiscord<Slazaa> Thanks I'll try that :3
17:45:22FromDiscord<Phil> basically with the -d flag you can define parameters (you can even pass them values)
17:45:37FromDiscord<Phil> And those are then available for the "defined()" proc
17:46:01FromDiscord<Slazaa> Actually I misspelled windows xD
17:46:58FromDiscord<Slazaa> VS Code still complains it cannot find the proc though
17:48:03FromDiscord<Phil> Error message or it didn't happen 😛
17:51:01FromDiscord<Slazaa> Thank you :D
17:51:25FromDiscord<Phil> No worrie
17:51:27FromDiscord<Phil> (edit) "worrie" => "worries"
17:52:49FromDiscord<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:59FromDiscord<Phil> > export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib↵To do it for the current session
17:56:05FromDiscord<Phil> sent a long message, see http://ix.io/4fJf
17:56:18Amun-RaSlazaa: you wanted "if defined windows:"
17:56:33FromDiscord<Slazaa> I do :o
17:59:18*ixmpp joined #nim
18:00:28FromDiscord<.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:46Amun-Ra.tochka: if defined gcc/…
18:02:14Amun-Ratwo defines I know exist are gcc and clang
18:03:06FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4fJi
18:04:07FromDiscord<.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:48Amun-Ra.tochka: I'd just use my own define, f.e. -d=mingw
18:06:48Amun-RaSystem64 ~ Flandre Scarlet: https://play.nim-lang.org/#ix=4fJl
18:07:16Amun-RaSystem64 ~ Flandre Scarlet: what editor are you using? it makes that mess
18:07:53Amun-Rachr(29) is not printable, hence you can't see it
18:08:14*derpydoo quit (Quit: derpydoo)
18:08:35FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "System64 ~ Flandre Scarlet:": The actor type is in another file↵I'm using VSCode
18:08:47FromDiscord<.tochka> sent a code paste, see https://paste.rs/XoE
18:09:13Amun-RaSystem64: invalid token \29 is editor's fault
18:09:31FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "System64: invalid token \29": Wait, what?!↵Which line??
18:09:49Amun-Raiirc 2
18:10:23Amun-Raor it's a result of pasting to play.nim, isn't it? you haven't stated what the error was
18:10:38FromDiscord<System64 ~ Flandre Scarlet> The sussiest thing is I don't even have a stacktrace!
18:11:25Amun-Rathat's compiler error
18:11:54FromDiscord<System64 ~ Flandre Scarlet> Whaaaat
18:12:20Amun-Ralet's get to the same page
18:12:38FromDiscord<System64 ~ Flandre Scarlet> the play.nim site?
18:12:47Amun-Rarunning your paste on the page results with: /usercode/in.nim(2, 10) Error: invalid token: (\29)
18:14:08FromDiscord<System64 ~ Flandre Scarlet> I don't have this problem, WTF
18:14:20Amun-Raso it's the paste fault
18:14:40Amun-RaI've fixed it and got import error (box module)
18:15:09Amun-Rathere's almost no sense in providing pastes that do not compile online
18:15:31FromDiscord<System64 ~ Flandre Scarlet> Humm can I send the sources there?
18:15:56Amun-Racould you make a, as small as possible, functional test case?
18:16:11FromDiscord<System64 ~ Flandre Scarlet> okay lemme do it
18:16:44Amun-RaI mean I don't guarantee I'll fix it but someone probably will :>
18:19:47FromDiscord<System64 ~ Flandre Scarlet> Okay I have an illegal storage access
18:19:57Amun-Rahmm
18:20:23FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4fJo
18:21:47Amun-Rabtw, I almost never use refs :>
18:21:59FromDiscord<System64 ~ Flandre Scarlet> I try to use inheritence
18:22:11FromDiscord<Elegantbeef> You dont initalize `Player`
18:22:27FromDiscord<Elegantbeef> `var p = Player()`
18:22:41Amun-Ranew(result)?
18:22:50FromDiscord<Phil> ref objects do NOT get default initialized
18:22:52FromDiscord<Phil> Only value objects do
18:23:04FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4fJp
18:23:09FromDiscord<Elegantbeef> I mean ref objects do get default intialized
18:23:15FromDiscord<System64 ~ Flandre Scarlet> Oh okay that works now, thanks
18:23:18FromDiscord<Elegantbeef> But it just happens that they dont get heap allocated 😄
18:23:26FromDiscord<System64 ~ Flandre Scarlet> Ah alright
18:23:27FromDiscord<Phil> In reply to @Elegantbeef "I mean ref objects": I don't count "nil" as initalized xP
18:23:28FromDiscord<Elegantbeef> they're 0'd out which is nil
18:23:31FromDiscord<System64 ~ Flandre Scarlet> so nil ptr goes brr
18:23:40FromDiscord<System64 ~ Flandre Scarlet> and then segfault
18:24:03FromDiscord<Elegantbeef> Phil 0 initialized is better than C
18:24:08FromDiscord<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:13Amun-Ranext time compile with *san libs (asan, ubsa, etc.)
18:24:16FromDiscord<Phil> In reply to @Elegantbeef "Phil 0 initialized is": You're about to tell me they do something even more insane?
18:24:31FromDiscord<Elegantbeef> They dont 0 memory so whatever was on the stack is what you get
18:24:36FromDiscord<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:41FromDiscord<Phil> C
18:24:43FromDiscord<Phil> was written
18:24:47FromDiscord<Phil> by insane people
18:25:08Amun-Ranah, it's just time was different
18:25:19Amun-Rahave you ever seen B?
18:25:36FromDiscord<Phil> I shudder to think what it or A might've looked like
18:25:41Amun-Ra;>
18:26:02Amun-Rathe only A (except ARexx, a variant of Rexx) I know of is APL
18:26:54FromDiscord<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:20FromDiscord<System64 ~ Flandre Scarlet> Okay it works now, thanks!
18:27:33FromDiscord<Elegantbeef> Pascal actually had a type system C on the otherhand....
18:27:43FromDiscord<Phil> C seems like it has suggestions
18:27:57Amun-RaPascal had one drawback, no openArray equivalent
18:28:08FromDiscord<System64 ~ Flandre Scarlet> what's an openArray?
18:28:26Amun-RaI mean the array in pascal had to have a fixed, known at compile time, size
18:28:59Amun-Rayou couldn't pass arr[3, int] and arr[4, int] to one function
18:32:43FromDiscord<System64 ~ Flandre Scarlet> Oh alright
18:33:44Amun-RaSystem64: openArray in just nim's way of accepting arrays and seqs as function arguments
18:34:34FromDiscord<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:42FromDiscord<System64 ~ Flandre Scarlet> Ah, good to know
18:41:47FromDiscord<System64 ~ Flandre Scarlet> Uuuh, polymorphism? https://media.discordapp.net/attachments/371759389889003532/1041060257071386726/image.png
18:41:56FromDiscord<Phil> Wait, one sec
18:41:56FromDiscord<Phil> Wtf
18:42:04FromDiscord<Phil> When I remove the version specification it works
18:42:46FromDiscord<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:08FromDiscord<System64 ~ Flandre Scarlet> yeah it is a seq
18:43:09FromDiscord<Elegantbeef> They are using `proc` instead of `method`
18:43:22FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#methods
18:43:25FromDiscord<System64 ~ Flandre Scarlet> Oh, so I need to use method instead?
18:43:26FromDiscord<Phil> method is for runtime dispatch
18:43:35FromDiscord<Elegantbeef> I swear some people dont even glimpse at the manual
18:43:38FromDiscord<Phil> which you need for polymorphism for reasons I haven't understood yet
18:45:42FromDiscord<System64 ~ Flandre Scarlet> okay works now
18:45:50FromDiscord<System64 ~ Flandre Scarlet> wait, no
18:45:52FromDiscord<Elegantbeef> Cause you're dynamically dispatching which isnt on the variable type but the runtime type
18:46:02FromDiscord<Elegantbeef> procs are dispatched on the static type, methods are not
18:46:40FromDiscord<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:08FromDiscord<System64 ~ Flandre Scarlet> anyways it should be executed in update method, it wil change anyways
18:48:59*rockcavera joined #nim
18:49:03FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "Cause you're dynamically dispatching": so, what should I do?
18:52:11FromDiscord<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:51NimEventerNew 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:40FromDiscord<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:00FromDiscord<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:47FromDiscord<Elegantbeef> If you need runtime dispatch you use methods↵(@System64 ~ Flandre Scarlet)
19:36:40FromDiscord<guttural666> any good way to always exit a proc through a clean up block? goto clean_up?
19:36:45FromDiscord<rlipsc> In reply to @Isofruit "I believe he might": Oh, well that should work straight up. Is there an error?
19:37:19FromDiscord<Elegantbeef> `try finally` or `defer`↵(@guttural666)
19:37:21FromDiscord<Phil> In reply to @rlipsc "Oh, well that should": Was more like, where's the code 😄
19:37:31FromDiscord<rlipsc> oh!
19:37:35FromDiscord<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:08FromDiscord<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:10FromDiscord<Phil> At least I think the pixel example isn't in the github (?)
19:38:36FromDiscord<Phil> Huh, I was staring at the example folder
19:39:21FromDiscord<Phil> Wait, wait, wait
19:39:27FromDiscord<Phil> You have 2 projects, polymer and polymorph
19:39:31FromDiscord<Phil> God damnit, no wonder I never found it
19:39:32FromDiscord<rlipsc> yep 🙂
19:40:01FromDiscord<guttural666> In reply to @Elegantbeef "`try finally` or `defer`": a return statement in the proc will still run the defer stuff?
19:40:07FromDiscord<rlipsc> polymers is like a combination of a 'stdlib' of components and examples of how to do things
19:40:54FromDiscord<rlipsc> polymers -> stringing components together 😄
19:41:17FromDiscord<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:21FromDiscord<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:56FromDiscord<.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:02FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fJM
19:42:10*fibonacci left #nim (#nim)
19:42:24FromDiscord<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:34FromDiscord<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:58FromDiscord<guttural666> In reply to @Elegantbeef "Why ask a question": you're right ofc
19:43:22FromDiscord<Elegantbeef> Yea it is tochka https://play.nim-lang.org/#ix=4fJN
19:43:24FromDiscord<pietroppeter> (edit) "@rlpisc" => "@rlipsc " | "this" => "this!"
19:43:58FromDiscord<pietroppeter> In reply to @rlipsc "Ah, yes - that's": Ah I see, I lost that part 🙂 thanks!
19:44:14FromDiscord<Elegantbeef> Can also do it with exceptions
19:44:21FromDiscord<rlipsc> I think polymers needs a bit of reorganising to be fair!
19:44:30FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4fJO
19:44:36FromDiscord<rlipsc> maybe the demos need to come out to a seperate repo
19:45:00FromDiscord<pietroppeter> Btw I also tried easyess (the polymorph inspired simple ecs), and that one does run in the js backend
19:46:02FromDiscord<rlipsc> Nice! I've not really tested it in JS so will be interesting to see what's going wrong.
19:47:50FromDiscord<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:11FromDiscord<.tochka> In reply to @Elegantbeef "Yea it is tochka": oh, right. having result accessible everywhere is surprisingly versatile
19:50:52FromDiscord<Elegantbeef> Yea also `return` is a rewrite into setting the result and going to the finally block if it exists
19:51:30FromDiscord<Elegantbeef> Since it has NRVO
19:51:43FromDiscord<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:41FromDiscord<Elegantbeef> Was going to jokingly say "just opengl es" but forgot that you dont get compute shaders↵(@rlipsc)
20:03:12FromDiscord<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:20FromDiscord<.tochka> In reply to @Elegantbeef "Was going to jokingly": gles 3.1 and later has compute afaik?
20:05:59FromDiscord<Elegantbeef> But webgl that opengl es goes to doesnt iirc
20:07:26FromDiscord<.tochka> oh right it goes to webgl api
20:07:39FromDiscord<.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:13FromDiscord<JeysonFlores> sent a long message, see http://ix.io/4fJY
20:17:35FromDiscord<JeysonFlores> (edit) "http://ix.io/4fJY" => "http://ix.io/4fJZ"
20:17:43FromDiscord<Elegantbeef> https://nim-lang.org/docs/macros.html#getCustomPragmaVal.m%2Ctyped%2C
20:19:26FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fK0
20:19:41FromDiscord<Elegantbeef> `getImpl` emits the var def not the type def
20:22:43FromDiscord<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:53FromDiscord<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:18FromDiscord<guttural666> omg KDE is so fucking buggy rn
21:23:55FromDiscord<guttural666> https://media.discordapp.net/attachments/371759389889003532/1041101057704591462/image.png
21:25:48FromDiscord<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:57FromDiscord<Elegantbeef> I'd probably suggest using illwill
21:26:09FromDiscord<guttural666> what's that?
21:26:23FromDiscord<Elegantbeef> A pure nim terminal library like ncurses
21:29:13FromDiscord<guttural666> god this looks powerful
21:30:09FromDiscord<guttural666> thanks for the tip
21:30:51FromDiscord<Mike> How is your screenshot so shiny?↵(@guttural666)
21:31:21FromDiscord<Elegantbeef> transparent terminals
21:32:12*pro quit (Quit: pro)
21:32:24FromDiscord<Mike> I mean my terminal is transparent too, but that looks... glossy
21:32:57FromDiscord<Elegantbeef> Think it's mainly the thumbnail
21:32:59FromDiscord<Elegantbeef> Making it full res doesnt look glossy here, but the thumbnail kinda does
21:33:35FromDiscord<guttural666> In reply to @Mike "I mean my terminal": just the effect of KDE Konsole (semi) transparency and the background
21:34:04FromDiscord<Mike> Yeah fair enough, it is more clear when it's fullscreen
21:34:07FromDiscord<guttural666> that might make it appear to be glossy, but could just be the random point in the wallpaper shining through
21:35:23FromDiscord<Mike> Thought maybe you were using wayfire or some other crazy compositor
21:36:22FromDiscord<guttural666> just X11/KDE out of the box from endevourOS
21:38:23FromDiscord<guttural666> well that effect is not out of the box, but my config of Konsole, you get the point
21:39:38FromDiscord<Mike> Yeah I have a similar setup for Kitty
21:40:37FromDiscord<guttural666> is that the SSH client? bah
21:40:39FromDiscord<guttural666> nah
21:42:50FromDiscord<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:03FromDiscord<guttural666> ah okay, never heard of that
21:43:41FromDiscord<guttural666> kind of a rough name for a small project to be searched haha
21:50:27*jmdaemon joined #nim
21:51:57FromDiscord<guttural666> how do I sneak in this bad boy before case evaluation? https://media.discordapp.net/attachments/371759389889003532/1041108107775975585/image.png
21:54:11FromDiscord<huantian> why not just put it the line before the case?
21:54:58FromDiscord<guttural666> probably drunk
21:55:01FromDiscord<guttural666> you're right
21:55:29*dnh joined #nim
21:55:47FromDiscord<guttural666> but I remember the if x = 0, x == 0 thing works in Nim somehow
21:56:44FromDiscord<Slazaa> sent a code paste, see https://play.nim-lang.org/#ix=4fKz
21:56:59FromDiscord<guttural666> no, I can't do it that way, because I want to increment only of the endless loops executes again
21:57:10FromDiscord<Slazaa> sent a code paste, see https://play.nim-lang.org/#ix=4fKA
21:57:22FromDiscord<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:57FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=4fKB
21:58:46FromDiscord<guttural666> In reply to @huantian "I think you'd have": yeeeees! now we're talkin
21:58:51FromDiscord<Slazaa> Sorry, this code doesn't give me any error either :o
21:59:00FromDiscord<Slazaa> But I have a similiar case that does
21:59:09FromDiscord<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:39FromDiscord<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:03FromDiscord<guttural666> In reply to @huantian "I still don't know": engage thinker cap haha
22:01:37FromDiscord<huantian> what does that mean
22:02:13FromDiscord<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:48FromDiscord<huantian> so you want to inc at the end of each iteration?
22:03:04FromDiscord<guttural666> effectively a do{} while {} loop in other lngs
22:03:11FromDiscord<guttural666> no at the start
22:03:59FromDiscord<huantian> right but how does putting it in the matched variable affect it
22:04:25FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=4fKD
22:04:50FromDiscord<guttural666> uhhhm, yes you are still right
22:05:00FromDiscord<guttural666> 100% correct, sorry haha
22:05:07*carce joined #nim
22:05:18FromDiscord<huantian> no need to be sorry lol I was just confused
22:06:18FromDiscord<guttural666> I'm the one who is confues rn haha
22:06:47FromDiscord<guttural666> I stand corrected
22:31:03FromDiscord<.tochka> can somebody point examples for emit pragma
22:31:31FromDiscord<.tochka> manual shows too little
22:38:55FromDiscord<Elegantbeef> https://github.com/ftsf/nico/blob/main/nico/stb_vorbis.nim
22:40:59FromDiscord<.tochka> lol
22:41:11FromDiscord<.tochka> now that's efficient nim
22:41:42FromDiscord<Elegantbeef> What are you after exactly with the emit though
22:42:02FromDiscord<Elegantbeef> It just outputs verbatim what you put in for the backend language to manage
22:43:11FromDiscord<.tochka> wanted to use some compiler intrinsics, question is how do you pass nim variables there
22:44:42FromDiscord<auxym> you can use plain old importc for compiler intrinsics
22:44:57FromDiscord<auxym> https://github.com/status-im/nim-stew/blob/master/stew/endians2.nim
22:45:09PMunchFuck me.. A `var1 = if var1 < 0: 0 else: var1` check in my code was the cause of all my grief
22:45:58FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fKI
22:46:08FromDiscord<.tochka> In reply to @auxym "you can use plain": oh nice
22:46:11FromDiscord<Elegantbeef> Though think it's proper to backtick around the variable
22:46:15PMunchSince 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:40PMunchI've spent hours upon hours trying to figure out why this code doesn't work..
22:47:36FromDiscord<Elegantbeef> I'd comment on you reinventing max but meh 😄
22:48:22PMunchMax does indeed not have this issue
22:48:41PMunchBut I was porting C code
22:54:39FromDiscord<Bung> how to verify this, am considering make a patch for this
22:55:26PMunchThe int16 stuff?
22:56:41FromDiscord<Bung> yeah
23:02:50FromDiscord<Bung> it get wrong at semantic step
23:03:17PMunchWell you'd need to compile for a 16 bit target
23:03:52PMunchSo either find an Arduino to run it on, or maybe try to find an Arduino emulator?
23:04:53FromDiscord<.tochka> nim with cc65 when
23:05:42FromDiscord<Elegantbeef> Just use llvm-mos
23:06:17FromDiscord<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:35FromDiscord<auxym> when I looked into for ARM though it seemed really complicated
23:07:04PMunch@auxym, oh yeah that should work
23:08:03FromDiscord<.tochka> In reply to @Elegantbeef "Just use llvm-mos": seen their rust demo, impressive stuff
23:09:03FromDiscord<Elegantbeef> Yea I know someone used it with Nim aswell
23:09:11FromDiscord<Elegantbeef> Just for a toy of course
23:09:17FromDiscord<Bung> so nim can produce elf file?↵(@auxym)
23:09:43*carce quit (Remote host closed the connection)
23:10:25FromDiscord<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:33FromDiscord<Elegantbeef> The fuck is a file extension?!
23:12:07FromDiscord<.tochka> i think coff and com files are still in kernel?
23:12:27FromDiscord<.tochka> (edit) "files" => "loaders"
23:13:19PMunch@Bung, yes with avr-gcc you can end up with elf files
23:17:34FromDiscord<guttural666> In reply to @PMunch "Fuck me.. A `var1": is this the PMunch himself? thanks for the lsp man hahaha
23:18:08FromDiscord<Elegantbeef> Nah the domesticated viking is in another castle
23:18:39PMunch@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:22FromDiscord<Bung> thanks! I'll try to see if I can make it work
23:23:40FromDiscord<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:44FromDiscord<guttural666> https://media.discordapp.net/attachments/371759389889003532/1041131210707058698/image.png
23:25:20FromDiscord<guttural666> just started a new linux machine, install all the nim stuff and vim and then tab stops working, not sure why
23:25:27FromDiscord<guttural666> in vim
23:30:40PMunchHmm, that's weird
23:30:47FromDiscord<.tochka> also is there a way to enforce openArray to be read only?
23:31:02FromDiscord<Elegantbeef> Pass it without `var`
23:32:02PMunchTo 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:37FromDiscord<Bung> I guess I'll need prevent the sigmatch first? `of tyInt: result = handleRange(f, a, tyInt8, tyInt32)`
23:41:19FromDiscord<Bung> sent a code paste, see https://play.nim-lang.org/#ix=4fKR
23:43:23FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fKS
23:44:21FromDiscord<Elegantbeef> I guess one doesnt need that much `var i: int = 100i32` compiles
23:45:30FromDiscord<Elegantbeef> The implicit conversions to larger sized integers is odd
23:46:36FromDiscord<Bung> maybe just add extro step check the target int size
23:48:10FromDiscord<Bung> the sigmatch doesn't take config argument even.
23:49:38FromDiscord<Elegantbeef> Eh it's↵> Automatic type conversion is performed in expressions where different kinds of integer types are used
23:49:47PMunchHmm, this constant objects leaking into code as actual objects is also really concerning..
23:50:13PMunchThe generated C code is full of nimZeroMem for things which should be a static object..
23:50:21FromDiscord<Elegantbeef> Widening for integers only happens in Nim
23:51:00FromDiscord<Elegantbeef> Yea i looked at it Pmunch it loses the static information inside `evalStaticExpr`
23:51:15FromDiscord<Elegantbeef> Field access isnt a `static[T]` so it doesnt evaluate it it statically
23:51:25PMunchWell that sounds like a silly place to lose static information
23:52:02FromDiscord<Elegantbeef> Well i added it back and it broke other code so i called it a night 😛
23:57:24PMunchHmm, I guess I have to look into this at some other time
23:57:28PMunchBut now I'm off to bed
23:57:29*PMunch quit (Quit: leaving)
23:57:54FromDiscord<Elegantbeef> Buh bye