<< 01-03-2021 >>

00:06:30*krux02` quit (Remote host closed the connection)
00:30:32audiofilehow do I have an empty function as default arg in a function signature
00:30:55audiofileproc(givefunc: proc = ??? )
00:31:12audiofileproc ABC(givefunc: proc = ??? )
00:31:40FromDiscord<Yardanico> proc myproc(givefunc: proc = proc = discard) = discard
00:31:41FromDiscord<Yardanico> XDDDD
00:31:52FromDiscord<Yardanico> (this works, but jk)↡↡proc myproc(givefunc = proc() = discard)
00:32:26FromDiscord<Yardanico> it really depends on if your proc needs to be a closure or a nimcall, etc
00:32:49audiofilecan I not pass a function as it is so I can call it later () in my function
00:33:06audiofilelike proc myproc(givefunc: proc = discard)
00:33:17FromDiscord<Yardanico> wdym
00:33:37audiofilewill pastebin
00:33:48FromDiscord<Yardanico> you can use play.nim-lang.org
00:33:56audiofileyes that is the one
00:35:32audiofileerror 502 bad gateway
00:36:01audiofilehttps://play.nim-lang.org/#ix=2Rfw Yardanico
00:36:22YardanicoI still didn't understand what you want
00:36:28Yardanicoyou can do this just fine with the example I sent
00:37:08Yardanicoah, if you mean "different number arguments", then you'll have to make a generic proc at the very least
00:37:23Yardanicodifferent number of arguments means different proc types
00:37:46audiofileoh sorry I misread the proc = proc =
00:37:52audiofileyour solutions works!
00:37:58YardanicoI just want to give you an advice - don't try to replicate Python idioms in Nim :)
00:38:08audiofileindeed
00:40:38saemYardanico: that DFA issue ate my brain this entire weekend. :D I have an idea for a fix but it seems terrible. I'm curious where Clyybber ends up with it.
00:40:51FromDiscord<Yardanico> lol, don't force yourself too much :D
00:41:07FromDiscord<Yardanico> afaik Clyybber will be busy doing exams for a ~month
00:41:41saemI can't help it, my brain doesn't give me a choice in this matter. I kept trying to go back to sem and looking at nkError but couldn't focus.
00:43:35saemNot a terrible thing, I did learn a few things about DFA.
00:54:10FromDiscord<Clyybber> hey, maybe I'll have some more time this week or next one
00:54:36FromDiscord<Clyybber> My fix would be to not make it recursive anymore
01:01:34audiofilewhat si the default encoding? like is convert(destEncoding=getCurrentEncoding()) safe?
01:02:00audiofileIs that equivalent to .decode() from python?
01:02:00FromDiscord<Yardanico> did you read the docs?
01:02:00FromDiscord<Yardanico> https://nim-lang.org/docs/encodings.html#getCurrentEncoding
01:02:14FromDiscord<Yardanico> kind of
01:02:24FromDiscord<Yardanico> nim strings aren't "encoded" in any encoding
01:02:28FromDiscord<Yardanico> they are just a sequence of chars/bytes
01:04:33FromDiscord<ElegantBeef> Well you can think of them as ascii encoded but they do support unicode, but that's just intepreted as a grouping of chars
01:04:49FromDiscord<ElegantBeef> So yea just think of them as a byte sequence or char sequence πŸ˜„
01:06:46FromDiscord<treeform> If you need encoding stuff: https://github.com/treeform/encode
01:07:10FromDiscord<treeform> I can do all UTF encoding and decoding
01:07:15FromDiscord<treeform> (without using system libs)
01:08:08*wasted_youth2 quit (Quit: Leaving)
01:08:08FromDiscord<Yardanico> @audiofile you only need to care about "encodings" module if you receive input that's not utf-8
01:08:27FromDiscord<Yardanico> which is pretty rare nowadays
01:08:41audiofileso what if I receive a utf-8 encoded string, how do I make it a nim string
01:08:46FromDiscord<ElegantBeef> Treeform has so many libraries i'm surprised he doesnt just have his own stdlib πŸ˜„
01:09:10FromDiscord<Yardanico> @audiofile as I said, nim strings aren't encoded in any way
01:09:18FromDiscord<Yardanico> so you don't need to care about it if it's utf8
01:09:25audiofilesorry, I'm a bit confused
01:09:29FromDiscord<treeform> In reply to @ElegantBeef "Treeform has so many": soon I will have enough for my own stdlib πŸ™‚
01:09:41FromDiscord<Rika> nim strings can contain any encoding
01:09:42FromDiscord<Yardanico> idk how to explain so that it's easier to understand :D
01:09:44FromDiscord<ElegantBeef> Just make sure you include my constructor so i can whore it more πŸ˜„
01:09:49audiofileI am receiving a string froom a socket, it is going to be in utf-8 so how do I make it normal
01:09:50FromDiscord<Rika> so a utf8 string is a nim string
01:09:56FromDiscord<ElegantBeef> It is normal
01:09:58FromDiscord<Rika> it already is normal
01:09:58audiofileoh
01:09:59FromDiscord<Yardanico> @audiofile everything's going to be ok
01:10:08audiofileyou sound like my therapist xD
01:10:09FromDiscord<ElegantBeef> In nim there is one type of string, a string
01:10:18FromDiscord<treeform> nim uses utf8 internally
01:10:22FromDiscord<Yardanico> you might need the https://nim-lang.org/docs/unicode.html module if you want to do unicode string handling
01:10:27audiofileso why am I doing "string".convert() <- that is useless right?
01:10:30FromDiscord<Yardanico> yes
01:10:38audiofilehmm got it
01:10:40FromDiscord<ElegantBeef> There is also `unidecode` which attempts to convert unicode to ascii
01:10:48FromDiscord<Yardanico> well that's a bit different
01:10:55FromDiscord<treeform> yeah, you loose information there?
01:11:03FromDiscord<ElegantBeef> Well you get different characters
01:11:10FromDiscord<ElegantBeef> https://nim-lang.org/docs/unidecode.html#unidecode%2Cstring
01:11:11FromDiscord<Yardanico> @treeform yes, it's mostly for human readability
01:11:24FromDiscord<ElegantBeef> It has an example
01:11:44*Vladar quit (Remote host closed the connection)
01:11:48FromDiscord<treeform> Usually if you are dealing with windows or the non ObjC macOS apis you need to worry about UTF16
01:12:09FromDiscord<Yardanico> yes, nim has a pure-nim module for that :P
01:12:26FromDiscord<treeform> Tons of file formats also have UTF16 strings in them.
01:12:31FromDiscord<Yardanico> https://nim-lang.org/docs/widestrs.html
01:13:02FromDiscord<treeform> I need to handle UTF16 LE or BE I forget which is not supported.
01:13:19FromDiscord<treeform> Does not handle the BOM marker which some times also happens.
01:13:33FromDiscord<treeform> Usually older windows crap
01:13:40FromDiscord<Yardanico> sure, but I mean that for APIs it's usually okay
01:13:47FromDiscord<treeform> yes
01:14:15FromDiscord<treeform> There is also UCS16 vs UTF16 etc...
01:14:52FromDiscord<treeform> sorry UCS2 is roughly UTF16 mostly
01:16:06*oprypin quit (Quit: Bye)
01:16:13*oprypin joined #nim
01:23:57*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
01:24:16*njoseph joined #nim
01:32:43*phpostrich joined #nim
01:34:12audiofilehttps://bpa.st/JD7X2 can someone help me figure out what is type mismatch here
01:34:45audiofileerrr wait
01:35:09audiofilehttps://bpa.st/VL6JG HERE
01:35:58phpostrichUndeclared Identifier for "Thread", from the vscode plugin for nim
01:36:10audiofileI dont even have thread...?
01:36:21phpostrichas a module?
01:36:35phpostrichits there just not detected by the plugin i guess
01:37:43audiofileoh wow yes, `import threads` worked...
01:37:58phpostrichhmm not for me
01:37:59audiofileI'm guessing sockets needs it?
01:38:07audiofilethanks phpostrich
01:38:18phpostrichk
01:38:34audiofileoh i have an error for the import lmao
01:38:42phpostrichlol
01:39:24phpostrichyou can use threads but its not really useable if the plugin breaks
01:40:57FromDiscord<ElegantBeef> You dont import threads manually
01:41:20FromDiscord<ElegantBeef> you do `--threads:on` in a .cfg or `switch("threads", "on")` in a .nims
01:41:59phpostrichik but the vscode plugin doesnt work for the module
01:42:29FromDiscord<ElegantBeef> If you enable threads in a config and restart vscode the new config should tell nimsuggest to look there
01:42:44phpostrichohh didnt think about that
01:42:46phpostrichthanks
01:43:09phpostrichdang technology
01:52:18phpostrichhow long has nim been around?
01:52:36*asdflkj quit (Ping timeout: 240 seconds)
01:52:42phpostrichits my favorite, no doubt.
01:52:59FromDiscord<ElegantBeef> Since around 2008 πŸ˜„
01:54:18phpostrichthat dope. I went from Go to Rust to Nim. Nim is like the god of all languages.
01:54:42FromDiscord<バロアード> alright how do i vendor this
01:54:48FromDiscord<ElegantBeef> I came from C# and agree
01:55:13FromDiscord<バロアード> https://media.discordapp.net/attachments/371759389889003532/815764074457333770/unknown.png
01:55:17FromDiscord<バロアード> i want to import that into this
01:55:23FromDiscord<ElegantBeef> Hmmm dont know about this concept interface method https://media.discordapp.net/attachments/371759389889003532/815764118978953256/unknown.png
01:55:29FromDiscord<バロアード> https://media.discordapp.net/attachments/371759389889003532/815764140743983134/unknown.png
01:55:53FromDiscord<ElegantBeef> You can do `nimble develop` at the root of the one project if it's a nimble package and then it'll locally connect it
01:56:22FromDiscord<ElegantBeef> The fuck is this https://media.discordapp.net/attachments/371759389889003532/815764365911392256/unknown.png
01:56:49audiofilehttps://bpa.st/VYFQW how do I get a to be the first element in the sequence and not the index
01:57:01audiofileI want to do unpacking, not implicitly get index
01:57:43FromDiscord<Yardanico> @ElegantBeef again? The article was considered for deletion a long time ago, now it shouldn't
01:57:48FromDiscord<Yardanico> Who started the process
01:58:04FromDiscord<Yardanico> https://en.wikipedia.org/wiki/Wikipedia:Articles_for_deletion/Nim_(programming_language)_(5th_nomination)
01:58:50FromDiscord<ElegantBeef> Audio try this https://play.nim-lang.org/#ix=2Rgc
01:59:24FromDiscord<ElegantBeef> It's really the rust people πŸ˜„
01:59:30FromDiscord<Yardanico> "Yet another open source computer language that never quite achieved notability despite the developer's attempts to promote it." I'm angry
02:00:07FromDiscord<InventorMatt> They seem to underestimate the growth nim has had recently
02:00:47FromDiscord<Yardanico> How come Zig has an article on wiki
02:01:22FromDiscord<Yardanico> Despite literally being less popular than Nim (I'm not saying it's bad, just the popularity facts)
02:01:34FromDiscord<Yardanico> But yeah, don't worry, people will vote against deletion
02:01:43*audiofile quit (Ping timeout: 245 seconds)
02:01:59FromDiscord<Yardanico> that guy probably just came around Nim article randomly
02:02:47FromDiscord<mattrb> This is largely unrelated to nim, but does anyone here have any examples of using sdl2 audio with emscripten?
02:04:34FromDiscord<Yardanico> Ahahaha
02:04:48FromDiscord<Yardanico> So that guy recently opened a vote for deletion for Zig
02:04:50FromDiscord<Yardanico> And it failed
02:04:52FromDiscord<Yardanico> https://en.m.wikipedia.org/wiki/Wikipedia:Articles_for_deletion/Zig_(programming_language)
02:04:55FromDiscord<Yardanico> @ElegantBeef
02:05:08FromDiscord<Yardanico> Maybe he has a grudge against smaller languages or whatever
02:05:18FromDiscord<ElegantBeef> How do you see who opened it?
02:05:59FromDiscord<Yardanico> The first message
02:06:50FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/815766996125614140/Screenshot_20210301-050630430.jpg
02:07:31FromDiscord<MapleSyrup|TagMeIfReply> @ElegantBeef thanks (I'm audio) why change from seq[array[2, string]] to seq[(string, string)] tho?
02:07:49FromDiscord<ElegantBeef> Cause we dont have array unpacking in the base language
02:09:03FromDiscord<ElegantBeef> Sidenote, why do people swap between Discord/Irc depending on who's talking to them, it's weird πŸ˜„
02:09:19phpostrichwould it be overkill to use a random number generator with an elliptical curve algorithm for encryption?
02:09:33FromDiscord<ElegantBeef> Just use `nimcrypto` πŸ˜›
02:09:47FromDiscord<Hi02Hi> wait why are wiki pages linked in the most unrelated places?
02:09:50phpostrichill check it out
02:10:13federico3phpostrich: please use well known libraries and methods
02:10:15FromDiscord<Yardanico> @Hi02Hi wdym?
02:10:17FromDiscord<ElegantBeef> We're talking about the Nim language page getting a AfD
02:10:37phpostrichfederico3, k
02:11:05FromDiscord<Yardanico> Wikipedia has Zig, Crystal just fine
02:11:15FromDiscord<Hi02Hi> according to https://en.wikipedia.org/w/index.php?title=Special%3AWhatLinksHere&limit=500&target=Rust+%28programming+language%29&namespace=, i kid you not, rust is linked in the page for "Grin"
02:11:25FromDiscord<ElegantBeef> Ah that's what you meant πŸ˜„
02:11:53federico3Yardanico: deletion requests are not based by rankings and comparisons
02:12:03FromDiscord<Yardanico> I know
02:12:03FromDiscord<konsumlamm> In reply to @Hi02Hi "according to https://en.wikipedia.org/w/index.php?t": > Grin, a minimal cryptocurrency based on the Rust programming language transaction format
02:12:29FromDiscord<konsumlamm> you could've just looked up why it's linked there :P
02:12:36*abm quit (Quit: Leaving)
02:13:45FromDiscord<ElegantBeef> Hey we average like 250 page views a day according to this pageviews graph! https://media.discordapp.net/attachments/371759389889003532/815768741504876544/unknown.png
02:14:13phpostrichdats pretty good
02:14:26FromDiscord<Hi02Hi> nice
02:14:35FromDiscord<ElegantBeef> Zig does about half
02:15:36FromDiscord<ElegantBeef> Rust did a lot more in 2020, but actually hit a rather low amount in 2021, though still like averaging 2000 πŸ˜„
02:15:49FromDiscord<konsumlamm> i think we should delete the Wikipedia page for brainfuck, it's not used anywhere in industry
02:16:00FromDiscord<Yardanico> I remembered comparing Nim to D :) @ElegantBeef
02:16:06FromDiscord<Yardanico> @konsumlamm they don't care about that
02:16:12FromDiscord<ElegantBeef> Weird hitler is more popular than all the languages
02:16:23FromDiscord<Yardanico> Wikipedia cares about references and trustable sources
02:16:40FromDiscord<Yardanico> If something is covered in enough sources Wikipedia will have an article about it
02:16:54FromDiscord<MapleSyrup|TagMeIfReply> can smeone help me figure out a typeerror in my code? I can share my entire program if that would be helpful
02:17:05FromDiscord<ElegantBeef> Yea that's what we're here for, solving problems πŸ˜›
02:17:32FromDiscord<MapleSyrup|TagMeIfReply> sorry i mean or do you want me to do a smaller example
02:17:46FromDiscord<ElegantBeef> Minimal example is always better
02:17:46FromDiscord<MapleSyrup|TagMeIfReply> you are all much apprciated frfr
02:17:50FromDiscord<MapleSyrup|TagMeIfReply> ok coming up
02:18:12FromDiscord<ElegantBeef> Oddly enough there seems to be an increase looking for languages every so often
02:18:27FromDiscord<ElegantBeef> look at this graph, so weird to see https://media.discordapp.net/attachments/371759389889003532/815769925855477760/unknown.png
02:18:55FromDiscord<ElegantBeef> Python, C, Rust, Nim, Zig
02:18:58FromDiscord<ElegantBeef> Top to bottom
02:19:41FromDiscord<ElegantBeef> Wouldnt expect them all to be so related, but i guess python links to C which then links to rust
02:21:18FromDiscord<Yardanico> Can you compare views for D, Nim, Crystal, Zig?
02:22:01FromDiscord<ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/815770822157402112/unknown.png
02:22:21FromDiscord<ElegantBeef> https://pageviews.toolforge.org/
02:22:29FromDiscord<Yardanico> Yeah I know, just from the phone rn
02:22:32FromDiscord<ElegantBeef> Ah
02:24:24FromDiscord<MapleSyrup|TagMeIfReply> it looks like my short version of the code works, but not the full file...
02:24:41FromDiscord<MapleSyrup|TagMeIfReply> have I unwittingly excluded the error
02:24:56FromDiscord<ElegantBeef> Wonder if prestige is around, he might find my interface somewhat interesting, though doesnt percisely solve MI
02:32:57*lritter quit (Ping timeout: 264 seconds)
02:33:10*lritter joined #nim
02:33:42phpostrichdoes the "random" module have an iterator that produces random numbers, its like 4 lines of code to implement but I might be doing that for no reason
02:39:10FromDiscord<Yardanico> No, you can check that it doesn't yourself :)
02:40:49phpostrichWe should make a nim-lang anime. That'd be cool
02:42:33FromDiscord<Rika> and difficult
02:42:48FromDiscord<Rika> dont think an anime has been centred around a programming language before
02:43:15phpostrichYeah but we can inspire weebs to program in nim, making it more popular
02:44:36FromDiscord<Rika> i think youre missing the issue
02:45:04FromDiscord<exelotl> What if Kobayashi was actually writing Nim all along
02:47:01phpostrichopenbsd releases a song every year. we can do something like that
02:47:28phpostrichfor each update we could do some deep poetry
02:48:53FromDiscord<MapleSyrup|TagMeIfReply> here is the error and code: https://bpa.st/XCTL2 can someone help me figure this out
02:49:02PrestigeHello Beef - link?
02:49:26Prestige@ElegantBeef ^
02:49:29FromDiscord<MapleSyrup|TagMeIfReply> I can make house music so count me in if you want same boring repetitive music
02:49:35FromDiscord<ElegantBeef> Just this impl atm https://media.discordapp.net/attachments/371759389889003532/815777759209062441/unknown.png
02:50:50Prestigelooks interesting, could be useful
02:51:06PrestigeWish I could actually implement the MI example I wanted in my PR
02:51:13Prestigeer, RFC
02:51:24FromDiscord<Rika> @MapleSyrup|TagMeIfReply onSend cannot take any parameters
02:53:44FromDiscord<Rika> make it `onSend: proc(a, b: string) = proc(a, b: string) = discard`
02:54:19FromDiscord<MapleSyrup|TagMeIfReply> oh...I see. so why doesn't this work? https://bpa.st/TPE3A
02:54:56FromDiscord<MapleSyrup|TagMeIfReply> oh
02:55:10FromDiscord<Rika> because proc anon({this has to contain definitions, not values)
02:55:13FromDiscord<Rika> (edit) "values)" => "values})"
02:55:19FromDiscord<Rika> lol
02:55:25FromDiscord<Rika> did you realize?
02:56:58FromDiscord<MapleSyrup|TagMeIfReply> thanks that worked
02:57:06FromDiscord<MapleSyrup|TagMeIfReply> yes I'm still getting used to the syntax lol
02:57:35FromDiscord<Rika> okay
03:00:02phpostrichIs Nim funded? If so, how?
03:05:19saemThere is a compiler bug here, but also am I doing something really dumb when generating this giant if/else expr: https://play.nim-lang.org/#ix=2Rgu
03:06:45FromDiscord<MapleSyrup|TagMeIfReply> is there anything I need to do before switching from socket.send() to socket.recv()?
03:06:58FromDiscord<MapleSyrup|TagMeIfReply> server isn't sending a response T_T
03:08:37saemWow, I found the regression, can't believe we don't have tests for that -- fixing.
03:12:13FromDiscord<ElegantBeef> Nim is funded by the community and also status.im afaik
03:12:23saemOK, crap... that's tricky as heck.
03:12:47saemThe removal of noNilSeqs is a problem for object variants, well at least the AST.
03:12:51saemπŸ€”
03:15:33*phpostrich quit (Ping timeout: 264 seconds)
03:18:54saemHmm, so PNode is an object variant, one part of the variant has a seq of `sons`, the compiler was using `isNil` (now an error) to guard against the variants that don't have an `sons`. That's not a thing anymore with nimNoNilSeqs gone. So most code will work fine, except for things like `if true: ...` which the compiler will attempt to sem and will now try to access a nil sons (wrong kinds). πŸ™
03:19:43*phpostrich joined #nim
03:20:27PrestigeThat sounds odd
03:20:35saemoh... maybe I can just use `safeLen`
03:20:51saemOh, it's not odd, it's easy to miss.
03:21:09saemControl flow based type narrowing can't come soon enough.
03:27:47*muffindrake quit (Ping timeout: 272 seconds)
03:29:25*muffindrake joined #nim
03:30:04FromDiscord<MapleSyrup|TagMeIfReply> thanks for all the help, folks, I've finished writing my library gonna ZZZ now
03:31:08FromDiscord<Rika> See you
03:35:39saemalso fixed my playground issue
03:36:01FromDiscord<バロアード> how would i actually make a variable a fixed point using this library
03:36:12FromDiscord<ElegantBeef> What library?
03:36:43FromDiscord<バロアード> https://gitlab.com/lbartoletti/fpn/-/tree/master/
03:37:19FromDiscord<バロアード> sent a code paste, see https://play.nim-lang.org/#ix=2RgA
03:40:41FromDiscord<Rika> What library
03:40:52FromDiscord<Rika> Oh the linked
03:40:54FromDiscord<バロアード> ye
03:41:37FromDiscord<Rika> The first should work
03:41:56FromDiscord<バロアード> but it doesnt
03:41:57FromDiscord<バロアード> 😭
03:42:14FromDiscord<ElegantBeef> Errors help
03:42:17FromDiscord<Rika> Yeah
03:43:07FromDiscord<バロアード> sent a code paste, see https://paste.rs/KGk
03:43:46FromDiscord<バロアード> https://pastebin.com/a2L5gMNU
03:44:26FromDiscord<ElegantBeef> Did you not try `FixedPoint`?
03:45:03FromDiscord<Rika> That is honestly very strange
03:45:14FromDiscord<バロアード> tried that too, I get this error: C:\Users\sraya\OneDrive\Documents\Nim\Projects\test_game\src\main.nim(44, 15) Error: undeclared identifier: 'FixedPoint'↡stack trace: (most recent call last)
03:45:53FromDiscord<Rika> Make a file that only imports the module and instantiates a variable of that type
03:45:56FromDiscord<Rika> See if it works
03:46:08FromDiscord<バロアード> kk
03:46:23FromDiscord<バロアード> i should mention that i 'vendored' the module
03:46:31FromDiscord<バロアード> i copied the source code and put it in my project
03:46:45FromDiscord<バロアード> https://media.discordapp.net/attachments/371759389889003532/815792146028036126/unknown.png
03:46:46FromDiscord<バロアード> like so
03:47:10FromDiscord<バロアード> i could try removing this and installing with nimble instead, but i wanted to be able to modify it as i want
03:47:34FromDiscord<Rika> Well are you importing it right then
03:47:45FromDiscord<バロアード> import fpn
03:47:48FromDiscord<バロアード> i just did that
03:47:52FromDiscord<バロアード> and it gave me no errosr
03:47:53FromDiscord<Rika> Doesn’t look correct to me
03:47:59FromDiscord<Rika> How did you install it
03:48:14FromDiscord<バロアード> i didnt i just copied the source code and dragged it to my project
03:48:23FromDiscord<Rika> Then import fpn shouldn’t work at all
03:48:35FromDiscord<バロアード> but vscode gave me no errors
03:48:38FromDiscord<バロアード> and it complied fine
03:48:48FromDiscord<Rika> Then that means it’s installed somewhere in nimble
03:48:58FromDiscord<バロアード> oh i see
03:49:11FromDiscord<バロアード> ok lemme try removing it
03:49:18FromDiscord<Rika> Try nimble uninstall fpn
03:49:57FromDiscord<バロアード> ok uhhhh
03:50:04FromDiscord<バロアード> i guess i reintall now?
03:50:08FromDiscord<バロアード> is fpn on nimble?
03:50:15FromDiscord<Rika> Uh
03:50:25FromDiscord<Rika> Wait
03:50:31FromDiscord<Rika> Did you do what I say
03:50:42FromDiscord<バロアード> yep
03:50:43FromDiscord<Rika> Or did you delete the folder you made
03:50:47FromDiscord<バロアード> i did both
03:50:50FromDiscord<Rika> Why
03:50:57FromDiscord<Rika> You didn’t have to do the second one
03:51:02FromDiscord<バロアード> oh
03:51:09FromDiscord<バロアード> aight ill recopy it lol
03:51:33FromDiscord<Rika> You could have changed the import to `import ./FixedPoint-lib/fpn”
03:51:38FromDiscord<Rika> (edit) "./FixedPoint-lib/fpn”" => "./FixedPoint-lib/fpn`"
03:51:47FromDiscord<ElegantBeef> you know you can just do `nimble develop giturl` and it'll clone the project and put it in your `pkg` path
03:52:04FromDiscord<Rika> Yeah but that’s global not per project
03:52:07FromDiscord<バロアード> yeah but i want to be able to edit the orignal code
03:52:17FromDiscord<Rika> You will still be able to edit the code with develop
03:52:39FromDiscord<Rika> It’s just like install except the code is put into the current directory
03:52:45FromDiscord<Rika> But it’s also still global
03:52:59FromDiscord<Rika> So the code you change will apply for all projects you use the library in
03:53:24FromDiscord<バロアード> ok so it still doesnt work
03:53:36FromDiscord<バロアード> i recopied it, and changed the import path
03:54:08FromDiscord<バロアード> ill try the git thing elegant suggested
03:54:16FromDiscord<バロアード> maybe that will work better πŸ˜…
03:54:30*krux02 quit (Remote host closed the connection)
03:55:20FromDiscord<バロアード> .... nope that failed too
03:55:29FromDiscord<ElegantBeef> Well i do it whenever i'm forking packages as it just works better especially since you're wanting to change the package
03:55:45FromDiscord<ElegantBeef> I'll have to try this package in a minute to figure what's going wrong
03:56:10FromDiscord<バロアード> yeah
03:58:17FromDiscord<ElegantBeef> So `fixedPoint32` is a generic
03:58:31FromDiscord<ElegantBeef> It takes a size i believe being bits
03:59:09FromDiscord<バロアード> ....
03:59:15FromDiscord<バロアード> but....
03:59:20FromDiscord<バロアード> it already says its 32 bits....
04:01:20FromDiscord<Rika> That is so odd
04:02:20FromDiscord<バロアード> i wonder if i should just build my own fixed point library at this rate....
04:02:32FromDiscord<バロアード> that or wait for the creator to show up
04:04:16*lritter quit (Quit: Leaving)
04:05:16FromDiscord<Rika> Ngl the library doesn’t follow a lot of conventions
04:05:23FromDiscord<Rika> Like the type name being capitalised
04:05:43FromDiscord<ElegantBeef> I have to look at it more i just got the code to run πŸ˜„
04:06:12FromDiscord<ElegantBeef> Ok so you can generate your own fpn type
04:06:41FromDiscord<Rika> Good luck, I’m on a phone so I can’t do much
04:07:41FromDiscord<ElegantBeef> Seems you can do `genQMN(initQ1616, 16, FixedPoint)` then just refer to it as `FixedPoint`
04:07:49FromDiscord<バロアード> ok thats really fucking weird
04:08:28FromDiscord<バロアード> ok so i just wanted a fixedPoint type thats like 22,10
04:08:38FromDiscord<Rika> Man this is weird shit
04:08:41FromDiscord<ElegantBeef> Yep
04:09:02FromDiscord<ElegantBeef> There is a `initQ2210` so congrats!
04:09:15FromDiscord<バロアード> buuuuuuuuut its untested
04:09:21FromDiscord<バロアード> all of the unit tests only work for 16 16
04:09:31FromDiscord<Rika> I mean
04:09:36FromDiscord<Rika> You can make the tests
04:09:41FromDiscord<バロアード> yeah but idk how
04:10:20FromDiscord<ElegantBeef> I'd imagine the procedures are all generic(they are if i read properly) so you just replicate what they did for 1616
04:10:35FromDiscord<バロアード> but there isnt a 10 bit int
04:10:43FromDiscord<バロアード> so some of the tests would have to be different
04:11:25FromDiscord<Rika> You can make one with a range can’t you
04:11:36FromDiscord<Rika> Just find the limits of a 10 bit integer and put that in the range
04:12:08FromDiscord<バロアード> true....
04:12:32FromDiscord<バロアード> honestly tho, im just not going to bother righ tnow lol, ill just use the variable and hope it works
04:12:58FromDiscord<Rika> Bad developer smh not testing their code
04:13:12FromDiscord<ElegantBeef> I'm kinda surprised that you're needing fixed points for a 2D game πŸ˜„
04:14:03FromDiscord<ElegantBeef> I say 2D but i mean a single player game non lockstep game
04:14:13FromDiscord<Rika> I mean if you need it then you need it
04:14:14FromDiscord<バロアード> hahahahha, i want to try my hand at rollback netcode
04:14:28FromDiscord<バロアード> which means lockstep
04:14:32FromDiscord<ElegantBeef> Ah i see
04:14:50FromDiscord<Rika> I am understanding none of this
04:14:51FromDiscord<バロアード> its always the fcking fixed point that gets me
04:14:57FromDiscord<バロアード> ok so rollback netcode
04:14:58FromDiscord<Rika> Tfw backend dev
04:15:02FromDiscord<バロアード> here's a good article about it
04:15:11FromDiscord<Rika> Dude I only make servers
04:15:17FromDiscord<バロアード> https://ki.infil.net/w02-netcode.html
04:15:33FromDiscord<バロアード> its pretty simple to understan
04:15:58FromDiscord<Rika> Will look into it because it’s in my fields of interest
04:16:17FromDiscord<バロアード> but uh, beef, so how exactly do i instantiate?
04:16:28FromDiscord<バロアード> do I just do FixedPoint = genwhatever() somewhere?
04:16:53FromDiscord<ElegantBeef> It makes the type for you
04:17:18FromDiscord<ElegantBeef> You later should be able to do `let a = FixedPoint()` or use the `fromFloat` or `fromInt`
04:17:47FromDiscord<バロアード> hm but uh
04:17:57FromDiscord<バロアード> when i do fixedPoint32 or FixedPoint it doesnt work
04:18:28FromDiscord<バロアード> oh
04:18:29FromDiscord<バロアード> ok
04:18:49FromDiscord<バロアード> nvm that doesnt work
04:18:50FromDiscord<バロアード> AHHHHHHH
04:19:50FromDiscord<ElegantBeef> Yep idk how to properly use it
04:20:21FromDiscord<バロアード> this is terrible
04:20:31FromDiscord<バロアード> i might just go with my hack idea of just rounding the last three decimal places
04:27:54*spiderstew joined #nim
04:28:12*spiderstew_ quit (Ping timeout: 260 seconds)
04:42:19*vicfred quit (Quit: Leaving)
04:43:52FromDiscord<ElegantBeef> This probably isnt possible but is there a way to bind a symbol in a macro in in the scope of the calling file, without using include on the file with the macro?
05:29:25FromDiscord<バロアード> so uh, networking in nim
05:29:27FromDiscord<バロアード> whats the status
05:34:15FromDiscord<ElegantBeef> Depends on what you want
05:34:40FromDiscord<ElegantBeef> Reliable udp can use Netty
05:40:40FromDiscord<バロアード> how about universal plug and play
05:41:51FromDiscord<Rika> I think netty still fits there
05:41:52FromDiscord<ElegantBeef> Netty has nat punch-through
05:42:31FromDiscord<バロアード> oh shit ok
05:42:36FromDiscord<ElegantBeef> But you should be able to use upnp and netty
05:42:45FromDiscord<ElegantBeef> idk much about networking to be honest πŸ˜„
05:43:31FromDiscord<バロアード> oh shit it was made by treeform
05:43:36FromDiscord<バロアード> @treeform hello!
05:43:50FromDiscord<ElegantBeef> Like i said earlier he should make his own stdlib
05:44:35FromDiscord<Rika> Most people don’t have access to upnp do they?
05:44:46FromDiscord<ElegantBeef> It's based on the modem/router afaik
05:45:17FromDiscord<treeform> In reply to @バロアード "<@!107140179025735680> hello!": hello
05:45:36FromDiscord<バロアード> so it really works? it does nat hole punching???
05:46:01FromDiscord<ElegantBeef> Nah treeform thought it was funny to put it in his readme, he realized he'd prank this random person named "Valor"
05:46:16FromDiscord<バロアード> ha ha very funny
05:46:21FromDiscord<バロアード> its just
05:46:22FromDiscord<バロアード> suprising
05:46:32FromDiscord<バロアード> most programming lirbaries in the world dont do nat holepunching
05:46:38FromDiscord<バロアード> its exceedingly rare
05:47:01FromDiscord<バロアード> like, godots own networking doesnt do nat holepunching
05:47:05FromDiscord<バロアード> nor does unity
05:47:07FromDiscord<ElegantBeef> The C# reliable UDP i used did nat hole punching
05:47:14FromDiscord<バロアード> oh, ruffle?
05:47:18FromDiscord<ElegantBeef> So i just expect it, since both i used id
05:47:23FromDiscord<ElegantBeef> Litenetlib
05:47:25FromDiscord<バロアード> ah
05:47:36FromDiscord<バロアード> yeah no, i tried doing nat holepunching in godot
05:47:38FromDiscord<バロアード> no luck
05:48:48FromDiscord<バロアード> sorry if i come across as rude
05:48:51FromDiscord<バロアード> i apologize
05:49:17FromDiscord<バロアード> i knwo ive asked you guys a lot today and i really do appreciate all the help you've given
05:50:46FromDiscord<ElegantBeef> No need to apologize you werent rude
05:52:02FromDiscord<バロアード> πŸ™‚
05:56:15FromDiscord<Rika> In reply to @ElegantBeef "It's based on the": I know, when I think games I think children and most of them will be rejected when they ask their parents to open a port lol
05:58:29FromDiscord<ElegantBeef> Yea
06:12:18*NimBot joined #nim
06:18:11FromGitter<redblack3_gitlab> So I just found that this works exactly like a ternary operator in C: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ It works so well that I'm afraid it might not be on purpose. Using this as short-hand to test 1-line "truthy" values. Does this have a chance to break? [https://gitter.im/nim-lang/Nim?at=603c8723a3a2f04f1fc63916]
06:20:09FromDiscord<バロアード> people use gitter???
06:20:55FromDiscord<ElegantBeef> Well it's matrix based now, so why not!
06:21:38FromDiscord<ElegantBeef> nah `?` invokes the procedure and `:` passes the next variable
06:21:48FromDiscord<ElegantBeef> last variable
06:22:06FromDiscord<ElegantBeef> That's completely expected and solves the whole "How to do ternary operator in Nim"
06:22:35FromGitter<redblack3_gitlab> Awesome. will keep it then :)
06:22:44FromDiscord<Rika> Kinda cursed though ngl
06:25:31FromDiscord<ElegantBeef> On the plus side though it cannot be nested
06:26:14FromDiscord<ElegantBeef> Atleast i dont think it can
06:32:04FromDiscord<バロアード> Alright, ive made a bunch of progress on my game the past two days
06:32:41FromDiscord<バロアード> im going to do a dumb and make it a smash bros style game, but super stripped down and simple, and I will attempt to add netcode. You can see my repo and the current goals here: https://github.com/ValorZard/Nim-Platformer
06:32:50FromDiscord<バロアード> I wrote down the list of stuff i need to work on in my readme
06:33:26FromDiscord<バロアード> Let's see how far I can go
06:34:03FromDiscord<ElegantBeef> You're pushing binaries
06:34:16FromDiscord<ElegantBeef> both your executable and your sdl πŸ˜„
06:34:21FromDiscord<バロアード> oh woop
06:34:56FromDiscord<ElegantBeef> How are you liking nico anywho?
06:35:14FromDiscord<バロアード> It .... strangly feels more fun/easy to use than godot
06:35:15FromDiscord<バロアード> idk why
06:35:24FromDiscord<バロアード> probably cuz i dont have to use motherfucking GDSCRIPT
06:35:27FromDiscord<ElegantBeef> Might just be the amount of control πŸ˜›
06:35:33FromDiscord<バロアード> that too
06:35:38FromDiscord<バロアード> but mostly its gdscript
06:35:41FromDiscord<ElegantBeef> Now now, Nim is basically just grown up gdscript
06:35:59FromDiscord<バロアード> nim is what gdscript is going to end up turning into lol
06:36:31FromDiscord<ElegantBeef> Imagine if they just you know threw nim in there πŸ˜›
06:37:28FromDiscord<バロアード> there ARE nim bindings, but i really dont want to deal with gdnative, and i suspect it would end up giving me the same amount of frustration as using gdscript anyways
06:37:40FromDiscord<ElegantBeef> I used the bindings
06:37:57FromDiscord<ElegantBeef> They're ok, would be nice if it was firstclass and you could create everything you need with a single button
06:38:09FromDiscord<バロアード> having an editor is super nice
06:38:18FromDiscord<バロアード> Sure im able to get programming super fast NOW
06:38:25FromDiscord<バロアード> but once i have to start adding actual assets
06:38:27FromDiscord<バロアード> oh boy
06:39:00FromDiscord<バロアード> i mean, it would be cool if we could turn nico into an actual game engine, but idk if anyone wants that to happen
06:39:15FromDiscord<ElegantBeef> Impbox doesnt, he likes it being out of the way
06:39:21FromDiscord<バロアード> ah k
06:39:42FromDiscord<ElegantBeef> But it's OSS so you can always do it yourself
06:39:56FromDiscord<ElegantBeef> Though i'm uncertain how you could really turn it into an engine
06:40:05FromDiscord<バロアード> i mean i just want a nice way to import assets
06:40:13FromDiscord<バロアード> and manage scenes and stuff
06:40:18FromDiscord<ElegantBeef> You can use tiled for thata
06:40:20FromDiscord<ElegantBeef> (edit) "thata" => "that"
06:40:25FromDiscord<バロアード> does tiled do animations?
06:40:34FromDiscord<ElegantBeef> No, you'd have to make your own editor for that
06:40:38FromDiscord<バロアード> sigh
06:41:07FromDiscord<ElegantBeef> My player animation for linerino is just `time.floor.int.mod(playerSpriteCount)` πŸ˜„
06:41:46FromDiscord<バロアード> one of the things i like about godot is that you can add a lot of stuff to their animations
06:41:51FromDiscord<バロアード> including hooks and animations and stuff
06:42:00FromDiscord<バロアード> (edit) "animations" => "scripts"
06:42:06FromDiscord<バロアード> but i guess ill just do that manually lol
06:42:38FromDiscord<ElegantBeef> I might be misremembering but i do recall him mentioning he had some sort of animation setup
06:42:45FromDiscord<バロアード> ah k
06:42:55FromDiscord<バロアード> i mean everything is there for nico to turn into a full engine
06:42:59FromDiscord<バロアード> it just needs ui and its good to go
06:43:14FromDiscord<ElegantBeef> You mean an inspector or a gui toolkit?
06:43:20FromDiscord<バロアード> gui toolkit
06:43:24FromDiscord<ElegantBeef> It has a built in imgui
06:43:28FromDiscord<バロアード> oh
06:43:29FromDiscord<バロアード> lol
06:43:44FromDiscord<ElegantBeef> https://github.com/ftsf/nico/blob/master/examples/gui.nim
06:43:51FromDiscord<バロアード> i mean nico already has the same amount of tools as bevy
06:43:59FromDiscord<バロアード> its just that bevy has fancy smancy ecs
06:44:11FromDiscord<バロアード> which they've spent so much development time on
06:44:18FromDiscord<ElegantBeef> So does Nico, just pull in your favourite ECS library πŸ˜›
06:44:24FromDiscord<バロアード> no i hate ecs lol
06:44:50FromDiscord<ElegantBeef> it doesnt enforce a paradigm so you have whatever you want
06:44:55FromDiscord<バロアード> i mean, im sure its nice, but observing how bevy has had to deal with it
06:45:00FromDiscord<バロアード> it seems like a MASSIVE time sink
06:45:24FromDiscord<バロアード> the people making bevy have had to spend so much time optimizing ecs that its taken away resources from (what i think) are more pressing matters
06:45:27FromDiscord<ElegantBeef> Fairly certain anukens framework is using ECS, and pixeye also is investigating ECS
06:45:38FromDiscord<バロアード> what are those
06:45:48FromDiscord<ElegantBeef> Both Nim users
06:45:51FromDiscord<バロアード> ah
06:45:59FromDiscord<バロアード> i mean if you can make ecs work, more power to you
06:46:02FromDiscord<バロアード> just dont like
06:46:06FromDiscord<バロアード> make it one of your core tenets
06:46:09FromDiscord<バロアード> or something
06:46:26FromDiscord<ElegantBeef> Well it's that rust mantra of "There is only one right way"
06:46:35FromDiscord<バロアード> yeahhhhhh
06:46:47FromDiscord<バロアード> definetly starting to sour on that rust mentality
06:47:15FromDiscord<バロアード> it feels like rust people are too orthodox with their ideology
06:47:26FromDiscord<ElegantBeef> The general idea that the Rust community spews are nice ideas
06:47:58FromDiscord<ElegantBeef> No unneeded copies, dont allow nil refs, write performant code
06:47:59FromDiscord<バロアード> i agree, i mean what drew me to rust was how egronomic cargo was, compared to the messy dependency hell of c++
06:48:04FromDiscord<バロアード> and i liked the memory stuff
06:48:07FromDiscord<バロアード> but like
06:48:07FromDiscord<バロアード> yeah
06:48:25FromDiscord<ElegantBeef> Well i like borrowing as much as the next person but i really like it being opt in
06:48:38FromDiscord<ElegantBeef> ~~Glances at views~~
06:48:43FromDiscord<hamidb80> i remember i wanted to pass a string to another function in rust ...
06:48:54FromDiscord<hamidb80> that moment was ...
06:48:57FromDiscord<ElegantBeef> You need to give up ownership or lend it
06:49:17FromDiscord<ElegantBeef> I like that behaviour in some cases where it makes sense
06:49:24FromDiscord<ElegantBeef> strutils for instance
06:49:40FromDiscord<ElegantBeef> Most of those operations can be borrow only
06:50:50FromDiscord<ElegantBeef> Although apparently they've made ownership less annoying, but i've never wrote rust code so not a clue
06:51:22ForumUpdaterBotNew thread by Neodim: SQLite getRow data changing, see https://forum.nim-lang.org/t/7567
06:51:47FromDiscord<hamidb80> hey treeform
06:51:55FromDiscord<hamidb80> hows going
06:52:05FromDiscord<treeform> In reply to @バロアード "most programming lirbaries in": Well home punching is complex. It involves a central server... so a library can't implement it all on its own, it needs some thing else. I provide the call but you need to provide the central server.
06:52:23FromDiscord<treeform> In reply to @hamidb80 "hey treeform": hey
06:57:15*waleee-cl quit (Quit: Connection closed for inactivity)
07:10:13FromDiscord<hamidb80> is it possible to `sleep` less than 1ms or it is a OS limitation?
07:10:20FromDiscord<hamidb80> (edit) "is it possible to `sleep` ... less" added "for"
07:10:26FromDiscord<hamidb80> (edit) "a" => "an"
07:11:25FromDiscord<ElegantBeef> It's an OS limitation, hell sleeping for 1ms isnt even certain to last one ms
07:12:55*JustASlacker joined #nim
07:21:47FromDiscord<Rika> ~~and sleeping is pretty wasteful of resources xd~~
07:22:43saem Fun the tests passed, hopefully that doesn't introduce a ton of issues: https://github.com/nim-lang/Nim/pull/17210
07:25:30FromDiscord<hamidb80> In reply to @Rika "~~and sleeping is pretty": to be honest, i wanna run 2 async procs together
07:25:38FromDiscord<ElegantBeef> So then do it
07:26:02FromDiscord<hamidb80> ` await sleepAsync 1`
07:26:09FromDiscord<Rika> thats what i do too, yeah
07:26:13FromDiscord<Rika> 1 is fine
07:26:23FromDiscord<Rika> well i'd recommend something like 50
07:26:38FromDiscord<Rika> too fast and you're polling too quickly and wasting a lot of resources πŸ˜›
07:26:50FromDiscord<hamidb80> tnx
07:27:05FromDiscord<Rika> if its polling too slow just change the number then ig
07:33:37lbartThanks Yardanico :)
07:33:41*narimiran joined #nim
07:34:16*PMunch joined #nim
07:40:00FromDiscord<lbart> @treeform Nice: https://github.com/treeform/spacy !
07:53:27FromDiscord<hyu1996> good work
07:56:54phpostrichIs Nim's default garbage collector the best one?
07:57:06saembest for?
07:57:32saemPersonally, for development productivity I prefer the default.
07:57:32phpostrichSpeed
07:58:22saemIn which case my understanding is that in most cases that's not true, wherein when you say speed you're primarily concerned about avoiding allocations or GC pauses.
07:59:52FromDiscord<ElegantBeef> Arc/Orc are the lowest latency and Arc can improve speped a lot
08:00:00FromDiscord<ElegantBeef> (edit) "speped" => "speed"
08:00:06FromDiscord<Rika> i think best for throughput is mark and sweep
08:00:18FromDiscord<ElegantBeef> It's highly dependant on what you're doing
08:00:23saemreally depends upon the type of speed you want, yeah
08:00:29FromDiscord<Rika> dependent
08:01:00FromDiscord<ElegantBeef> Is that not grammatically correct?
08:01:24saemIn a non-prescriptive language at that. :D
08:01:51phpostrichI only made it to English 2 in high school (not far in my state)
08:02:01phpostrichI'z a dropout boy
08:02:02FromDiscord<Rika> dependant is a noun
08:02:48FromDiscord<Rika> im not a native english speaker (though i also am technically native depending on definition)
08:02:53FromDiscord<ElegantBeef> All the dicts i see say it's an adjective
08:02:59saemand a noun
08:03:11FromDiscord<Rika> dependant? im pretty sure its a noun
08:03:16FromDiscord<ElegantBeef> a dependant is
08:03:16saemThough the whole which dictionary you subscribe to matters
08:03:20FromDiscord<Rika> dependent is the adjective
08:03:25phpostrichI wish to only speak Nim one day
08:03:41FromDiscord<ElegantBeef> They're different spellings of the same word afaik
08:03:42phpostrichReprogram the universe
08:04:41FromDiscord<Rika> https://media.discordapp.net/attachments/371759389889003532/815857054047535114/image0.png
08:04:45FromDiscord<Rika> phone dict doesnt say so
08:04:57saemThat's all Oxford
08:05:11FromDiscord<Rika> i mean i guess it is
08:05:15FromDiscord<ElegantBeef> > dependent tends to be used for the adjective and dependant for the noun
08:05:18FromDiscord<ElegantBeef> tends to
08:05:24FromDiscord<ElegantBeef> Indicates it's not an enforcement
08:05:39phpostrichIs Nim every going to adapt Rust's ownership model?
08:06:00phpostrichnot adapt but implement ig
08:06:01FromDiscord<ElegantBeef> That's Merriam Webster and talking about British English, which as a Canadian I prescribe more to than that stuff spoken south of me πŸ˜„
08:06:13FromDiscord<ElegantBeef> It already has a small implementation
08:06:18FromDiscord<Rika> something similar but not exactly
08:06:24FromDiscord<ElegantBeef> It's just not enforced and is expiremental
08:06:28FromDiscord<Rika> one difference is that
08:06:29FromDiscord<Rika> yeah
08:06:30FromDiscord<Rika> that
08:06:42FromDiscord<ElegantBeef> https://nim-lang.org/docs/manual_experimental.html#view-types
08:06:51FromDiscord<Rika> how experimental is it btw
08:06:56FromDiscord<ElegantBeef> I mean i made <https://github.com/beef331/strviewutils> with it
08:07:08FromDiscord<Rika> still disappointed its not strviewtils
08:07:11FromDiscord<ElegantBeef> It gets a lot of codegen issues, if not using arc/orc afaik
08:07:50phpostrichHmm, what would be the benefit of using ownership in Nim?
08:07:56FromDiscord<Rika> LMAO the program i made got `out of memory` with orc
08:08:02phpostrichIts already pretty darn fast
08:08:20FromDiscord<treeform> In reply to @lbart "<@!107140179025735680> Nice: https://github.com/tre": I am glad you like it.
08:08:40FromDiscord<ElegantBeef> In reply to @phpostrich "Its already pretty darn": Fewer allocations, and as my strviewutils shows it can be faster
08:08:54FromDiscord<Rika> actually very strange, valgrind says i only allocate a few kb...
08:09:08FromDiscord<ElegantBeef> are you using `-d:useMalloc` or w/e it is?
08:09:10FromDiscord<Rika> how do i oom at a few kb?
08:09:20FromDiscord<Rika> oh i didnt
08:09:23FromDiscord<Rika> okay let me check again
08:09:27FromDiscord<ElegantBeef> Valgrind doesnt follow nim's allocator
08:10:12saemwhat you working on lately, Beef?
08:10:37FromDiscord<ElegantBeef> Playing with macros. Also aglet
08:10:42FromDiscord<ElegantBeef> (edit) "Playing with macros. Also ... aglet" added "playing with"
08:11:06FromDiscord<ElegantBeef> Made some weird runtime interface with concepts today
08:11:07saemaglet?
08:11:13saemOh, game
08:11:16FromDiscord<ElegantBeef> A opengl abstraction
08:11:19phpostrichNamed after the end of a shoelace?
08:11:34FromDiscord<ElegantBeef> I'm not the one that made the library!
08:11:42FromDiscord<Rika> i wish people cared about what i make πŸ˜”
08:11:49phpostrichI care
08:11:50FromDiscord<ElegantBeef> Eh no one cares about what i make either
08:11:56saemWhat'd you make Rika?
08:12:03FromDiscord<Rika> saem just asked you! you're awful at lying
08:12:07saemPeople only care about what I made when it breaks.
08:12:14phpostrichLol
08:12:16saemRika, I asked, but I didn't say I cared.
08:12:17FromDiscord<Rika> that means theyre relying on what you make
08:12:24FromDiscord<Rika> oh oof wow
08:12:25FromDiscord<ElegantBeef> Here is the weird interface i mentioned https://github.com/beef331/constructor/blob/master/tests/timplements.nim
08:12:28saemUsers, they're the worst. :D
08:12:42FromDiscord<Rika> dont people want more users?
08:12:50FromDiscord<ElegantBeef> Uses the new concepts and idk how i feel about it
08:13:03saemHoly crap, I just realized how much my code is actually used. Ugh, I feel awful.
08:14:06FromDiscord<lbart> In reply to @treeform "I am glad you": I'm writing a CAD/GIS lib in Nim. Maybe I'll use or contribute on spacy. Don't know yet
08:15:16FromDiscord<ElegantBeef> Hey saem atleast you get issues for more than just you're month moderation of the blog post πŸ˜›
08:15:23FromDiscord<ElegantBeef> (edit) "you're" => "your"
08:16:04saemwait what?
08:16:17saemOh yeah, the blog posts, where are those again <-- I'm the worst.
08:16:36FromDiscord<ElegantBeef> This month with nim
08:16:50FromDiscord<ElegantBeef> You know the monthly blog post i started for people to submit their projects to πŸ˜„
08:17:03saemOH yeah, i remember that thread.
08:17:22*lbart left #nim ("https://quassel-irc.org - Chat comfortably. Anywhere.")
08:17:29saemMy advice, do the lazy thing. I stand by it.
08:17:41saemSpacy is cool
08:19:20saemHmm, not sure if I can muster up a few sentences.
08:19:24FromDiscord<ElegantBeef> What do you mean do the lazy thing?
08:20:16saemThe one that's sustainable and can grow over time rather than person who thought you had to go whole hog from the get go.
08:20:54FromDiscord<ElegantBeef> Ah
08:21:15FromDiscord<ElegantBeef> Well so far in two months we have had 12 posts πŸ˜„
08:25:21PMunchAre you telling me another month has passed without me writing a single new (public) Nim project?
08:25:22PMunchHuh
08:25:35saemikr
08:25:44PMunchI guess I could release v2 of stacklang
08:26:02PMunchAnd my stacksheet program based on the library version of said language
08:30:15*Josh_ joined #nim
08:33:11*Josh__ joined #nim
08:33:42*Josh__ quit (Client Quit)
08:34:21*Josh__ joined #nim
08:34:23*phpostrich quit (Ping timeout: 260 seconds)
08:34:40saemI madez a post.
08:35:44*Josh__ quit (Client Quit)
08:35:50*phpostrich joined #nim
08:35:54FromDiscord<ElegantBeef> Lol sounds fine
08:36:15*Josh_ quit (Ping timeout: 240 seconds)
08:36:57saemI wonder if it's possible to auto post an issue easy enough every time I do a release of the extension, that way you get a post "for free".
08:38:49FromDiscord<ElegantBeef> Well ideally we dont just spam the same packages over and over again
08:39:00FromDiscord<ElegantBeef> So we just watch treeforms postings and take those and submit them πŸ˜„
08:39:09saemhaha
08:39:15saemFair
08:39:42saemIs there a particular type of posting you'd like to see?
08:40:34FromDiscord<ElegantBeef> Unique packages that draw in more users πŸ˜„
08:40:38saemBecause besides me releasing an occasional improvement to the extension. I'm mostly screwing around fixing random issues in the compiler's semantic analysis layer (sem) and this weekend perhaps DFA.
08:41:21FromDiscord<ElegantBeef> Well it's mostly about software around Nim and not the compiler itself, i did think that the core devs want a monthly blog post for documenting compiler development and the like, but idk
08:42:03saemOK
08:42:40FromDiscord<ElegantBeef> Like i said in the forum post that's why it's "This Month In Nim"
08:42:45FromDiscord<ElegantBeef> (edit) "Like i said in the forum post that's why it's ... " added "not"
08:46:34FromDiscord<iWonderAboutTuatara> Is there a way to compile across platforms easily?
08:48:05FromDiscord<iWonderAboutTuatara> aka can I compile to macos without owning one
08:49:09FromDiscord<Rika> maybe clang can cross compile for you
08:49:23FromDiscord<ElegantBeef> you can do linux -> windows fairly easily
08:49:35FromDiscord<ElegantBeef> Assuming you dont use any native windows libraries
09:01:54FromDiscord<treeform> In reply to @lbart "I'm writing a CAD/GIS": Let me know how it turns out.
09:16:50JustASlackerthere is a nice cross compile docker somewhere @iWonderAboutTuatar
09:18:35JustASlackerthink this is it https://github.com/juancarlospaco/nim-crosscompile
09:19:09*phpostrich quit (Ping timeout: 264 seconds)
09:19:45*krux02 joined #nim
09:24:06FromDiscord<enthus1ast> In reply to @iWonderAboutTuatara "aka can I": yes, i've done this with OSXCross
09:24:35JustASlackerActually, take a look at this: https://github.com/chrisheller/docker-nim-cross
09:24:54JustASlackerdocker run --rm -v `pwd`:/usr/local/src \
09:24:55JustASlacker chrishellerappsian/docker-nim-cross:latest \
09:24:55JustASlacker nim c --os:macosx --cpu:amd64 --out:hello32.osx.bin hello.nim
09:25:28JustASlackerwas planning on using that these days
09:26:35FromDiscord<enthus1ast> ive once build a cross compile docker for linux, windows, macos, arm, it took a whole day(!) to build/install.
09:35:02FromDiscord<Clyybber> saem: nice
09:35:26FromDiscord<Clyybber> saem: WDYM with "no longer guard on nil as they used to"?
09:36:45FromDiscord<phpOstrich> What does this pragma do? {.inline}
09:37:07FromDiscord<phpOstrich> {.inline.}
09:37:09FromDiscord<ElegantBeef> Enforces(or attempts to) inline the body of the procedure in it's call site
09:37:30FromDiscord<phpOstrich> I don't follow
09:37:54FromDiscord<ElegantBeef> So say you have `proc add(a,b: int): int = a + b`
09:38:05FromDiscord<Rika> think of it as a "tries to use it as a template"
09:38:06FromDiscord<ElegantBeef> when you call that you have a procedure call to it
09:38:07*JustASlacker quit (Ping timeout: 276 seconds)
09:38:28FromDiscord<ElegantBeef> but with inline it turns `let a = 10.add(20)` into `let a = 10 + 20`
09:38:59FromDiscord<ElegantBeef> The reason it exists is to allow procedure calls, but in areas of high traffic or where you want it to you can inline it to produce code which is faster
09:39:11FromDiscord<ElegantBeef> Cause procedure calls add up
09:39:22FromDiscord<phpOstrich> Oh gotcha.
09:39:36FromDiscord<enthus1ast> its a trade between faster calls / executable size
09:39:40FromDiscord<ElegantBeef> > The inline convention means the the caller should not call the procedure, but inline its code directly. Note that Nim does not inline, but leaves this to the C compiler; it generates inline procedures. This is only a hint for the compiler: it may completely ignore it and it may inline procedures that are not marked as inline.
09:39:53FromDiscord<ElegantBeef> But like i said it attempts to
09:40:24FromDiscord<mratsim> Not always a tradeoff, a function calls requires most of the time 5~10 instructions to deal with parameter passing
09:40:41FromDiscord<mratsim> inline functions would skip that, if the code inlined is small, you reduce code size
09:40:45FromDiscord<ElegantBeef> https://nim-lang.org/docs/manual.html#types-procedural-type can read all the calling conventions below
09:40:49FromDiscord<mratsim> if it's big well you duplicate big code
09:41:38FromDiscord<phpOstrich> Ah, I see people use it with all there procs. Is that bad habit or what?
09:41:51FromDiscord<ElegantBeef> It can be, since it duplicates code with 0 benefit in some cases
09:42:19FromDiscord<ElegantBeef> Increases binary size, and probably compile time, though dont quote me on the latter
09:42:23FromDiscord<Rika> and the c compiler can already see whats best inlined
09:43:22FromDiscord<phpOstrich> Is nim always going to be dependent on a c compiler?
09:43:30FromDiscord<ElegantBeef> Well nlvm exists
09:43:42FromDiscord<ElegantBeef> But really relying on a C compiler isnt overly bad
09:44:03*JustASlacker joined #nim
09:44:16FromDiscord<phpOstrich> Ig you could see it as a good thing
09:44:19krux02phpOstrich: nim does not depend on llvm but instead cas use all platforms that have a C compiler
09:44:52FromDiscord<mratsim> In reply to @Rika "and the c compiler": across modules it doesn't.
09:45:05FromDiscord<ElegantBeef> Well it gives you more portability, and already very good optimized compilers
09:45:22FromDiscord<phpOstrich> True
09:45:43FromDiscord<ElegantBeef> Based off these benchmarks Nim shoots pretty high https://github.com/kostya/benchmarks
09:48:09JustASlackeranybody using the compile to javascript for anythgin?
09:48:41FromDiscord<phpOstrich> It generates like 400 lines of js
09:48:54FromDiscord<phpOstrich> But it works I assume
09:49:11krux02JustASlacker, AFAIK the vscode plugin is written in Nim using the javascript backend.
09:49:25JustASlackeroh? kinda impressive
09:49:30FromDiscord<Unaimend> good morning πŸ™‚
09:49:32FromDiscord<ElegantBeef> do `-d:release` php
09:49:38ForumUpdaterBotNew thread by Ofsho: How to get the value of an input element by name when POST., see https://forum.nim-lang.org/t/7568
09:49:50FromDiscord<ElegantBeef> The nico game framework currently outputs using JS for web builds
09:49:56FromDiscord<ElegantBeef> So i've used it for my game
09:50:19FromDiscord<enthus1ast> battlestory: we have generated a html interface from nim types (for a games map generator) with nim js compilation, no coding needed to add more parameters, just add types, nice
09:51:00FromDiscord<phpOstrich> @ElegantBeef does -d:release minify the js?
09:51:08FromDiscord<ElegantBeef> No it just removes all the debug logic
09:51:15FromDiscord<ElegantBeef> You can minify it afterword of course
09:51:27FromDiscord<phpOstrich> Oh I didn't think about that
09:51:32JustASlackerso people actually use it. thats nice
09:51:52*clyybber joined #nim
09:51:59FromDiscord<ElegantBeef> Hell even this exists
09:52:00FromDiscord<ElegantBeef> https://github.com/juancarlospaco/nodejs
09:52:01*clyybber quit (Client Quit)
09:52:56FromDiscord<phpOstrich> Hmm would it be possible to compile nim to dart
09:53:09FromDiscord<phpOstrich> Or how hard would that be to implement
09:53:18FromDiscord<ElegantBeef> You'd need to make an entire backend
09:53:36FromDiscord<phpOstrich> Probably difficult
09:53:37FromDiscord<ElegantBeef> Easier to just work on fidget or similar GUI library
09:54:13FromDiscord<phpOstrich> Yeah ui in nim isnt to mature yet, I don't think.
09:54:22JustASlackerui is bad in any language
09:54:31FromDiscord<ElegantBeef> I mean we've got things that draw but it's similar to Rust's state
09:54:39FromDiscord<phpOstrich> True
09:54:48FromDiscord<ElegantBeef> Fidget and Nimx are the most notable pure libraries
09:55:44FromDiscord<ElegantBeef> Then you got the typical bindings to Gtk/qt, and nigui for abstractions ontop of Gtk/Windows/Mac ui
09:55:59FromDiscord<phpOstrich> Doesn't Status use nim and qt?
09:56:11FromDiscord<mratsim> QT isn't pure
09:57:01FromDiscord<phpOstrich> Anything made with qt looks pretty good. Gtk is kinda dull
09:57:28FromDiscord<mratsim> Both requires designers to make them good.
09:57:36FromDiscord<ElegantBeef> Fidget can look pretty good, but still not polished yet 😦
09:57:38FromDiscord<mratsim> we have full time designers at Status.
09:57:48PMunchYou've got bindings to WxWidgets as well
09:57:49FromDiscord<ElegantBeef> Looks nice https://media.discordapp.net/attachments/371759389889003532/815885526375858206/uiExampleIce.png
09:58:01FromDiscord<ElegantBeef> Ah i forgot that wxwidgets existed sorry pmunch
09:58:08FromDiscord<phpOstrich> Fidget is the figma thing right?
09:58:11FromDiscord<ElegantBeef> Yea
09:58:19FromDiscord<phpOstrich> It is nice looking
09:58:59FromDiscord<phpOstrich> Anyone ever use GoDot to make a gui ?
09:59:01PMunch@ElegantBeef, I mean it's not native either. And I'm not the one who made the bindings, I'm just the one who maintains them after I made the genui macro to make it simple to create UIs in code.
09:59:13FromDiscord<mratsim> Why use GoDot? that's a game engine
09:59:23FromDiscord<mratsim> if you want immediate UI, use imgui or nuklear
09:59:34FromDiscord<ElegantBeef> Some people do use is it, pixelrama for instance is built in it
09:59:36FromDiscord<mratsim> or OpenGL, like nimx does
09:59:43FromDiscord<ElegantBeef> The editor afterall is made inside the engine
10:00:14FromDiscord<phpOstrich> Godots ui is made with Godot ui
10:00:23FromDiscord<phpOstrich> Crazy
10:00:40FromDiscord<dk> you won't guess what nim is made in
10:00:50FromDiscord<mratsim> Made in China
10:01:57FromDiscord<phpOstrich> Ives always wanted to make my own gui framework, I just don't know how to start
10:03:13FromDiscord<ElegantBeef> Well congrats nimx and fidget are both open source πŸ˜›
10:04:08FromDiscord<phpOstrich> I meant "library from scratch" kinda deal
10:04:19FromDiscord<ElegantBeef> So did I
10:04:24FromDiscord<phpOstrich> Ohh
10:04:28FromDiscord<mratsim> See you in 10 years it was nice meeting you
10:04:30FromDiscord<ElegantBeef> ^
10:05:13FromDiscord<phpOstrich> How will we reunite? @mratsim
10:05:29FromDiscord<ElegantBeef> Well he'll find you in 10 years when you submit to this month with nim
10:05:39FromDiscord<mratsim> If you're not a UX designer yourself, you need to collaborate with one or you will repeat the mistakes of the past.
10:05:42FromDiscord<ElegantBeef> I'm sorry did i say month, i meant decade
10:06:15FromDiscord<phpOstrich> I use to most web stuff before learning about the cooler stuff
10:06:29FromDiscord<phpOstrich> To do mostly
10:06:51FromDiscord<enthus1ast> In reply to @mratsim "Why use GoDot? that's": build guis with an editor, lots of widgets, easily composite your own widgets thanks to how godot scenes work, export to many platforms without all the platforms nitty gritty, yeah its tempting to use.
10:07:42FromDiscord<ElegantBeef> Plus you can use native code if you want to get performance
10:07:48FromDiscord<Unaimend> I would kill for a nice gui framework in nim
10:07:50FromDiscord<phpOstrich> I just did it because I was learning maths and saw it had 2d sh
10:08:16FromDiscord<ElegantBeef> In reply to @Unaimend "I would kill for": Well make it then off yourself, and we'll bid you farewell for your sacrifice
10:08:55FromDiscord<phpOstrich> All you need a cool name and that's 75% of the battle
10:09:02FromDiscord<phpOstrich> Need is a
10:09:08FromDiscord<ElegantBeef> Ah so guirino
10:09:13FromDiscord<mratsim> all you need is pick one from C, C++, JS
10:09:26FromDiscord<mratsim> if there aren't any well, what can I do
10:09:52FromDiscord<phpOstrich> Ive made a ui in canvas before learning about wasm
10:10:04FromDiscord<phpOstrich> It wasn't good
10:10:11FromDiscord<ElegantBeef> Hey dont be knocking canvas that's how nico renders on the web πŸ˜„
10:10:24FromDiscord<phpOstrich> Fr?
10:10:31FromDiscord<Unaimend> In reply to @ElegantBeef "Well make it then": If I tried, the framework would be really shitty 😒
10:10:52PMunchHmm, one of the many projects I have on the back burner
10:10:56PMunchA nice GUI framework..
10:11:09FromDiscord<ElegantBeef> Just follow cunninghams law and put a shitty implementation
10:11:19FromDiscord<Unaimend> should net just try to extend the ui framework?
10:11:27FromDiscord<Unaimend> https://github.com/nim-lang/ui
10:11:47*tribly joined #nim
10:11:48FromDiscord<Unaimend> (edit) "net" => "we not"
10:11:48PMunchProblem is that I want it to choose the platform specific library on compile-time. And they all have slightly different interfaces for callbacks and such..
10:11:51FromDiscord<enthus1ast> or nigui
10:12:29FromDiscord<ElegantBeef> Pure Nim is always preferable imo, but it's a shit ton of work
10:12:35FromDiscord<enthus1ast> nigui with basic widgets (aaand tables) would be nice, for a lot of in house stuff
10:12:54*teasea quit (Quit: teasea)
10:13:01FromDiscord<phpOstrich> I dont understand how pure nim libraries work
10:13:01FromDiscord<ElegantBeef> Replace nigui with nimx πŸ˜›
10:13:15FromDiscord<enthus1ast> every time i try nimx it does not build
10:13:16FromDiscord<ElegantBeef> Well they rely on C bindings to opengl and the like
10:13:24FromDiscord<ElegantBeef> Worked here the last time i tried
10:13:30PMunch@ElegantBeef, problem with pure Nim for UI libraries is that they don't interface with the underlying system
10:13:35FromDiscord<ElegantBeef> Are you the mac user having issues? πŸ˜„
10:13:39PMunchUnless you put a lot of work into it
10:13:44FromDiscord<ElegantBeef> Eh i dont need my UI to interface with the underlying system
10:14:04FromDiscord<mratsim> So you like your Windows applications from space?
10:14:04PMunchBut your vision impaired users might need it to
10:14:21PMunchIn order to have accessibility options
10:14:26FromDiscord<ElegantBeef> I like my windows applications like i like my Windows OS, rarely used
10:14:36FromDiscord<ElegantBeef> Yea i know pmunch
10:14:41PMunchOr just people like me who prefer my programs to have a cohesive appearance
10:15:48FromDiscord<ElegantBeef> Well considering there isnt really a standardized GUI anywhere arent we a little stymied on what is "system" πŸ˜„
10:16:27FromDiscord<phpOstrich> Is there no electron bindings for nim?
10:16:37FromDiscord<ElegantBeef> There is the door, leave!
10:16:41FromDiscord<ElegantBeef> Jokes aside there are
10:16:54FromDiscord<ElegantBeef> Or similar atleast
10:17:07FromDiscord<ElegantBeef> https://github.com/Niminem/Neel
10:17:15FromDiscord<phpOstrich> I'd never use electron but I was just wondering if anyone cared
10:18:05FromDiscord<enthus1ast> yeah all the windows bashing, but have you tried running 32 Bit apps on recent macs? Or have you found yourself with an ancient centos with old clib and newer applications, have fun tinkering.
10:18:07FromDiscord<ElegantBeef> Also pmunch have you decided to leave nico?
10:18:15FromDiscord<ElegantBeef> Nope
10:18:23FromDiscord<ElegantBeef> My software works as the good lord intended
10:18:31FromDiscord<enthus1ast> Windows is not sexy but it works.
10:18:51FromDiscord<ElegantBeef> It works like my strain works as a sieve, slightly and only if you dont mind the visible holes
10:18:55FromDiscord<ElegantBeef> (edit) "strain" => "strainer"
10:18:58FromDiscord<ElegantBeef> (edit) "sieve," => "bowl,"
10:19:06FromDiscord<phpOstrich> Bodhi linux is baller
10:19:40FromDiscord<phpOstrich> Unfortunately my intel graphics didn't like wayland
10:20:00PMunch@ElegantBeef, nah I've decided to keep using it
10:20:14PMunchI've gotten the graphics to a point where I'm pretty happy
10:20:32FromDiscord<phpOstrich> Is anyone using sway?
10:20:47PMunchSo I'll focus on gameplay and then redo the whole thing in something different later if I want to do a full redo of the graphics
10:20:47FromDiscord<ElegantBeef> I couldnt ever care enough to move over
10:20:48FromDiscord<phpOstrich> I3's replacement
10:21:02PMunch@phpOstrich, nah I use i3
10:21:04FromDiscord<ElegantBeef> I3wm-gaps works for me and i cannot be arsed to try sway
10:21:20PMunchAnd sway isn't really a replacement as just a port for Wayland
10:21:21FromDiscord<phpOstrich> But sway is sway?
10:21:22FromDiscord<ElegantBeef> I game on my linux machine and have 0 plans to fuck with xwayland if it fails
10:21:39PMunchI use Nimdow at work though
10:21:54FromDiscord<ElegantBeef> A true nimion
10:22:05FromDiscord<phpOstrich> Nimoid
10:22:43PMunchAnd @phpOstrich, there are electron bindings, I've used them before (and by used them I mean tried them to see if I could do some weird abuse with it)
10:23:03FromDiscord<phpOstrich> Oh ok so ... Assembly in nim. How do you get that to work?
10:23:05PMunch@ElegantBeef, I use pakku on all my machines as well (it's written in Nim)
10:23:31PMunchAssembly?
10:23:36FromDiscord<ElegantBeef> Yea i've heard of it from another discord server(the only time i've heard someone using nim written software)
10:23:49FromDiscord<ElegantBeef> You use `asm """ #asm here """`
10:24:18FromDiscord<phpOstrich> I'm not at my computer rn but I get an error
10:24:33FromDiscord<ElegantBeef> https://nim-lang.org/docs/manual.html#statements-and-expressions-assembler-statement
10:24:38PMunchWell try running it on a computer
10:24:41FromDiscord<ElegantBeef> Well read that when you get to that computer of yours
10:24:56PMunchNim only runs on computer
10:25:04FromDiscord<ElegantBeef> Termux says otherwise
10:25:13FromDiscord<phpOstrich> I was gonna say that
10:25:15PMunchEh, phones are practically computers nowadays
10:25:23FromDiscord<ElegantBeef> Lol
10:25:27FromDiscord<phpOstrich> I mean they are
10:25:32FromDiscord<phpOstrich> Computers
10:25:46*teasea joined #nim
10:26:04FromDiscord<phpOstrich> I'm a computer, technically
10:26:06FromDiscord<ElegantBeef> Well buh bye, yall have one assignment, make a GUI framework by tomorrow
10:26:26FromDiscord<phpOstrich> Eh homework is for chumps
10:26:49PMunchShit one day GUI framework challenge
10:27:13FromDiscord<phpOstrich> I would just automate mspaint
10:27:22FromDiscord<enthus1ast> > make a GUI framework by tomorrow↡it all start and fails with tables πŸ˜„
10:27:31PMunchHaha, oh that would be brilliant phpOstrich!
10:28:00JustASlackerif you guys want a challenge, Id like to talk to TPM2 with nim
10:28:05FromDiscord<phpOstrich> I was talking about that with my older brother yesterday. We should revive mspaint
10:28:07PMunchUsing some kind of mouse automation to draw a UI in Paint :P
10:28:31FromDiscord<phpOstrich> Lol
10:28:42FromDiscord<phpOstrich> Next generation technology
10:28:57FromDiscord<phpOstrich> Everyone is drawing websites
10:29:27liblq-devi made three already
10:29:27liblq-devhow
10:29:27liblq-devhow's that sound
10:29:40liblq-devalso frickin' network connection sucks
10:30:00liblq-devi was responding to the one day GUI framework challenge
10:30:00FromDiscord<phpOstrich> Who is the youngest here?
10:30:06liblq-dev16
10:30:08FromDiscord<phpOstrich> Oh
10:30:13liblq-devpmunch is old
10:30:17FromDiscord<phpOstrich> You are young
10:30:28FromDiscord<phpOstrich> Im 17
10:31:53liblq-devthough actually thinking about it
10:32:01liblq-devi'm almost 17 as well so there's that
10:32:03liblq-devi'm old now
10:32:35FromDiscord<phpOstrich> No. I disagree
10:32:58FromDiscord<phpOstrich> What got you into programming?
10:33:56liblq-devcomputercraft
10:34:07liblq-devmaybe when i was 12 or 13
10:34:09liblq-devi don't remember
10:34:23FromDiscord<phpOstrich> Computercraft?
10:34:33FromDiscord<phpOstrich> Like building computers?
10:34:51*Vladar joined #nim
10:35:05narimiranITT: 17-year-old telling 16-year old that they (16) are young
10:35:40narimirani have T-shirts i wear that are older than that!!
10:36:09liblq-dev@phpOstrich it's a minecraft mod that adds Lua-programmable computers
10:36:28PMunchliblq-dev, ey!
10:36:32FromDiscord<phpOstrich> Lua is cool
10:36:37liblq-devyes
10:36:58narimiranPMunch: don't listen to those kids! we're not old!!
10:37:12FromDiscord<phpOstrich> I started out with php and web stuff at age 9
10:37:12PMunchHaha, thanks :P
10:37:45liblq-devwell alright i did kinda start out that young
10:38:01liblq-devmaybe when i was 10 i was playing around with UI design and visual basic
10:38:10FromDiscord<phpOstrich> I have 2 brothers that also program
10:38:22FromDiscord<phpOstrich> And my dad was a linux wizard
10:38:30liblq-devyou were lucky then
10:38:48liblq-devi'm self-taught
10:39:07FromDiscord<phpOstrich> No because I didn't really have my dad and my brothers pretty much said fuck off and learn it yourself
10:39:20FromDiscord<Clyybber> In reply to @phpOstrich "No because I didn't": thats the way!
10:39:38FromDiscord<phpOstrich> Yeah self taught is the only way pretty much
10:40:14FromDiscord<phpOstrich> Ur old
10:40:23FromDiscord<phpOstrich> Anyone into crypto?
10:41:40JustASlackeras in crypto money?
10:41:58JustASlackeror just general crypto
10:41:59FromGitter<gogolxdong> Is there any nim stack of developping Polkdot parachain?It uses rust.
10:42:03FromDiscord<phpOstrich> Oh yes. I guess I could have been more clear
10:42:36FromDiscord<phpOstrich> I put $400 in ethereum or eth based tokens
10:42:44FromDiscord<phpOstrich> It's not $300
10:42:51FromDiscord<phpOstrich> It's now
10:43:18PMunchWhen did you put that in?
10:43:18JustASlackerdoes ethereum do something useful already?
10:43:28PMunchEthereum is at an all time high now isn't it?
10:43:31narimirani like the oldschool way of burning money....
10:43:39JustASlackerI thought its supposed to run distributed code
10:43:42FromDiscord<phpOstrich> Yeah kind of
10:44:02FromDiscord<Rika> yall hate it when youre at the age where younger people call you old and older people call you young
10:44:03FromDiscord<phpOstrich> It went down and gas was a lot so I loss some there
10:44:04PMunchnarimiran, buy low sell high. I've only made money on the small investments in crypto I've made
10:44:04JustASlackerand isnt ethereum supposed to give you interest soonish? Ive heard like 7%
10:44:43FromDiscord<Clyybber> https://status.im/ is a company that uses nim to implement the ethereum blockchain protocol
10:44:45narimiranPMunch: but 'low' and 'high' are hard to guess correctly, aren't they?
10:44:54FromDiscord<phpOstrich> I have a status wallet
10:45:03FromDiscord<Clyybber> is that how you discovered nim?
10:45:06FromDiscord<phpOstrich> There desktop app is noice asf
10:45:10FromDiscord<phpOstrich> No
10:45:30FromDiscord<phpOstrich> I test out like every language as a hobby type thing
10:45:40PMunchnarimiran, my system is fool-proof. Haven't heard of crypto in the news for a couple months? Buy some. Is it all over the news? Sell
10:45:54FromDiscord<Rika> In reply to @narimiran "<@392962235737047041>: but 'low' and": nah you just get it with ethereum.low and ethereum.high πŸ˜›
10:46:24FromDiscord<phpOstrich> Anyone heard of galas games
10:46:36FromDiscord<phpOstrich> Gala Games
10:46:52narimiran@Rika why didn't i think of that? brb, i need to go and make myself some millions in gains....
10:47:05FromDiscord<phpOstrich> It's a crypto gaming platform made by the people that made words for friends
10:48:36PMunchwhile true: if ethereum.price == ethereum.low: buy() elif ethereum.price == ethereum.high: sell()
10:49:15FromDiscord<phpOstrich> Basic economics
10:50:54FromDiscord<phpOstrich> Im gonna hang in #offtopic for now on.
11:00:55*Vladar quit (Remote host closed the connection)
11:11:17*JustASlacker quit (Quit: Leaving)
11:11:36*JustASlacker joined #nim
11:12:45*Vladar joined #nim
11:14:03FromDiscord<inv> sent a code paste, see https://play.nim-lang.org/#ix=2Ric
11:14:51FromDiscord<inv> looks like choosenim . helped
11:17:29FromDiscord<inv> But I remember I built it with stable and then just koch test
11:17:52FromDiscord<inv> how to build koch from table but using the gitutils?
11:46:37*abm joined #nim
12:00:08*tane joined #nim
13:00:53*narimiran quit (Ping timeout: 245 seconds)
13:04:38*sacredfrog quit (Quit: ZNC 1.8.2 - https://znc.in)
13:04:58*sacredfrog joined #nim
13:19:46*JustASlacker quit (Quit: Leaving)
13:48:36*wasted_youth2 joined #nim
13:49:52FromGitter<HJarausch> How to create a sequence of type T and *given length* on the *heap* ⏎ One could use ⏎ ```but this causes reallocation. ⏎ ⏎ Thanks for a hint, ⏎ Helmut``` [https://gitter.im/nim-lang/Nim?at=603cf100a3a2f04f1fc76ff6]
13:50:52FromGitter<ynfle> Use `newSeq()`
13:51:38FromGitter<ynfle> Do you want a reference to a `seq`?
13:52:25FromGitter<ynfle> https://nim-lang.org/docs/system.html#newSeq%2Cseq%5BT%5D%2CNatural
13:53:38FromGitter<HJarausch> Yes, I do need a ref seq, and despite of its name, newSeq cannot be used.
13:56:11FromDiscord<mratsim> sent a code paste, see https://play.nim-lang.org/#ix=2RiV
13:58:07FromGitter<ynfle> Doesn't work
13:58:28FromDiscord<Solitude> `s[].newSeq(1000)`?
13:59:01FromDiscord<mratsim> not my fault if autodereference doesn't work with var
13:59:29FromDiscord<Solitude> it works for field access, not for callables
14:00:45FromDiscord<Solitude> deref for call is exprimental https://nim-lang.org/docs/manual_experimental.html#automatic-dereferencing
14:00:51FromGitter<ynfle> @Solitude, they said that it causes it to allocate twice
14:04:13FromGitter<HJarausch> Thanks to you all. I haven't thought of the ``newSeq`` proc which takes a ``var seq`` parameter.
14:08:38FromGitter<ynfle> `var seq` means "this proc modifies this seq and is therefore passed by reference"
14:16:36*narimiran joined #nim
14:27:23*wasted_youth2 quit (Read error: Connection reset by peer)
14:27:41*wasted_youth2 joined #nim
14:28:10*wasted_youth2 quit (Read error: Connection reset by peer)
14:28:36*wasted_youth2 joined #nim
14:31:31FromGitter<HJarausch> My Nim compiler (GIT 0222) doesn't accept ⏎ ⏎ ```var Sq: ref seq[float] ⏎ newSeq(Sq[], 1000)``` ⏎ ⏎ is accepted. Strange, isn't it? ... [https://gitter.im/nim-lang/Nim?at=603cfac3a3a2f04f1fc791b0]
14:32:22FromDiscord<Yardanico> works fine here, what is "git 0222"?
14:32:27FromDiscord<Yardanico> can you show the output of "nim -v"
14:32:41FromDiscord<Yardanico> that said, your first example will SIGSEGV at runtime because you need to allocate the ref itself
14:32:56FromDiscord<Yardanico> you need something like
14:33:01FromGitter<HJarausch_gitlab> `` ⏎ Nim Compiler Version 1.5.1 [Linux: amd64] ⏎ Compiled at 2021-02-22 ⏎ Copyright (c) 2006-2021 by Andreas Rumpf ⏎ ... [https://gitter.im/nim-lang/Nim?at=603cfb1d823b6654d27781e6]
14:33:03FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2Rj6
14:35:16FromGitter<HJarausch_gitlab> Thanks! Is there a difference between ⏎ ⏎ ```var Sq = new(seq[float]) ⏎ Sq[].newSeq(1000)``` [https://gitter.im/nim-lang/Nim?at=603cfba4e8267a46f2e53e32]
14:35:42FromDiscord<Yardanico> yes, first one will SIGSEGV because you need to allocate the ref itself
14:35:51FromGitter<ynfle> The different in the initialization
14:35:52FromDiscord<Yardanico> second line is the same though
14:36:04FromGitter<ynfle> I don't think ref types are initialized automatically
14:45:37*magdril joined #nim
14:48:01*vicfred joined #nim
14:55:48FromDiscord<mratsim> ah yes I forgot a new
14:56:09FromDiscord<Yardanico> seems like github doesn't want to forget 4raq's old profile picture (I checked, it's not my cache's fault) :P https://media.discordapp.net/attachments/371759389889003532/815960603931181117/unknown.png
15:06:38*teasea quit (Quit: teasea)
15:06:43FromDiscord<Araq> does it matter?
15:09:45*muffindrake quit (Quit: muffindrake)
15:10:29FromDiscord<Yardanico> no, i was just surprised a bit :)
15:10:53*muffindrake joined #nim
15:31:44FromDiscord<Yardanico> https://nim-lang.org/blog/2021/03/01/this-month-with-nim.html
15:33:29FromDiscord<Yardanico> Nim #announcements
15:34:28narimiran@Yardanico don't you have your bot for that? :)
15:35:12Yardanicoyes, but why not post it in #main as well :P
15:36:13narimiranno, i meant: your bot posts here new forum threads, stuff from r/nim, etc. - why not from the website too?
15:36:27narimiranalthough, it would often be duplicated
15:38:31FromDiscord<Yardanico> yeah, that's a good idea
15:43:07narimiranthe more i think about it, the less i'm sure it is a good idea :)
15:43:25FromDiscord<mratsim> it's just the new posts right?
15:43:34FromDiscord<mratsim> not everyone's replies
15:43:54FromDiscord<Yardanico> my bot also checks for new replies
15:43:58FromDiscord<Yardanico> but only posts them in some channels
15:44:17FromDiscord<Yardanico> e..g in #community-events, #nim-news on IRC and https://t.me/nimforum_updates on Telegram
15:44:35FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/815972796265136148/unknown.png
15:54:40FromGitter<HJarausch_gitlab> A for loop variable shadows an ordinary variable without notice - how to detect this latent bug? ⏎ ⏎ ```var Id = 0 ⏎ for Id in 0 .. 10 : ⏎ if Id == 3 : break ⏎ echo Id # prints 0``` [https://gitter.im/nim-lang/Nim?at=603d0e40823b6654d277c350]
15:55:34*teasea joined #nim
15:56:14FromDiscord<terkwood> In reply to @phpOstrich "Im gonna hang in": same lol. i wanna learn nim but i 'm having trouble focusing on one virtuously shiny thing at a time
16:00:09*jk13579[m] quit (Quit: Idle for 30+ days)
16:00:51narimiran@HJarausch_gitlab and what behaviour would you expect? this seems normal to me
16:01:15narimiranalternatively, use while loop
16:03:34narimiranand please refrain from classifications such as "latent bug" or "Nim can be so difficult to understand" for stuff that you personally don't understand
16:04:30FromDiscord<Araq> I use this idiom in order to avoid bugs fwiw, you cannot access the other name accidentically
16:05:47FromGitter<HJarausch_gitlab> @narimiran I'm just looking if there is a possibility to get warned if the loop variable shadows an ordinary variable. (Coming from C++ this error in Nim is insidious)
16:07:52FromDiscord<Araq> https://godbolt.org/z/q7o5a3 C++ doesn't mind it either
16:11:05*haxscramper joined #nim
16:25:58federico3@Araq what do you mean https://github.com/nim-lang/security/issues/2#issuecomment-787808460 ?
16:32:26FromDiscord<Araq> I replied there
16:34:57*rockcavera joined #nim
16:45:01ForumUpdaterBotNew question by Michael Hecht: Nim-Lang compiler error with leading @ character, see https://stackoverflow.com/questions/66426124/nim-lang-compiler-error-with-leading-character
16:46:34*magdril quit (Quit: Connection closed)
16:50:36*Vladar quit (Quit: Leaving)
17:01:39FromDiscord<バロアード> Ok, so, I want to have a gamestate data structure, but i dont really know what to use
17:01:50FromDiscord<バロアード> its basically going to be a giant nested dictionary...
17:01:54FromDiscord<バロアード> wait ill just do that lol
17:01:58federico3@Araq we are reinventing the wheel (badly): the draft advisories are already kept secret by github automatically and become public when... published
17:02:36*waleee-cl joined #nim
17:04:16FromDiscord<バロアード> Can tables in nim have values mapped to multiple types
17:06:21FromDiscord<haxscramper> No, you need to use object variants or type erasure
17:07:03FromDiscord<バロアード> .... and that is?
17:07:32FromDiscord<haxscramper> https://nim-lang.org/docs/manual.html#types-object-variants
17:10:22FromDiscord<dk> also inherance
17:14:44FromDiscord<mratsim> pretty sure the question was asked yesterday
17:24:02ForumUpdaterBotNew thread by Michaelhecht: Compiler error with generated compile script, see https://forum.nim-lang.org/t/7569
17:26:58*Tuatarian joined #nim
17:29:05haxscramperIs it possible to determine at compile-time if expression can raise `FieldDefect` error?
17:29:47haxscramperMaybe it is possible to somehow use https://nim-lang.org/docs/effecttraits.html#getTagsList%2CNimNode by wrapping expression in temporary proc, getting it's raises list and working from that, but I hope there is a cleaner solution.
17:30:59FromDiscord<mratsim> `when compiles(raise newException(FieldDefect, "")`
17:31:17FromDiscord<mratsim> but now that raises: [] doesn't prevent raising Defect I fear you can't
17:31:22haxscramperI have object pretty-printer that checks if `items()` is implemented and tries to use that first, but sometimes (especially for AST-like structures) `for item in items(node):` can raise field **defect**, which are not always catchable.
17:35:09*PMunch quit (Quit: leaving)
17:39:05haxscramperEven `getRaisesList` cannot determine if expression can raise defect: https://play.nim-lang.org/#ix=2Rk2. Is there *anything* else that would allow to detect defects?
17:40:14haxscramperBecause the only other option would be to `try .. except FieldDefect:` and pretend that `--panics:on` does not exist.
17:43:00FromDiscord<mratsim> RFC β™ͺβ™«
17:43:56haxscramperThe whole RFC would be "Can I check for `FieldDefect` please?"
17:44:38FromDiscord<Yardanico> pretty please
17:46:40FromDiscord<mratsim> Can I check that a proc raises no Defect please
17:58:01*solitudesf joined #nim
18:05:57*Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in)
18:09:44*magdril joined #nim
18:11:07*magdril quit (Client Quit)
18:27:01*fosred joined #nim
18:32:52*Vladar joined #nim
18:36:39*vivus joined #nim
18:47:25*fosred quit (Quit: Leaving)
18:56:29*blackpawn_ quit (Quit: ZNC 1.7.2+deb3 - https://znc.in)
18:56:46*blackpawn joined #nim
18:59:30Oddmongerwith foo( v:ref machin = nil) , how to modify v in the function ?
19:00:20Oddmongernak forget it
19:00:54Oddmongerwith foo( v:ref machin = addr(truc) ) , how to get it compiled ? ^^'
19:01:38FromDiscord<Yardanico> uhh, what does this mean?
19:02:01FromDiscord<Yardanico> first of all, "ref" is a traced reference, you can't get a "ref" with addr
19:02:09Oddmongerah forget it, i want ptr instead
19:02:35Oddmongerit's for a recursive calling, with a ptr on my root elem at first pass
19:13:56FromDiscord<バロアード> ok so ive been starting at the description for object varaints and im very confused
19:15:15FromDiscord<Yardanico> why?
19:15:47FromDiscord<Yardanico> it's actually not hard - basically you have an enum with possible "kinds" of object, and then object itself can be initialized with that kind and different "branches" become active
19:16:09FromDiscord<Yardanico> json in nim is modelled with object variants too - https://nim-lang.org/docs/json.html#JsonNodeObj
19:16:17FromDiscord<Yardanico> even the ast is made with object variants
19:16:31FromDiscord<バロアード> i see.... so its how you build a dictionary right
19:16:41FromDiscord<バロアード> i should probably have a new project to fully understand
19:38:45*junland quit (Quit: %ZNC Disconnected%)
19:39:36*junland joined #nim
19:44:17FromDiscord<exelotl> you might use it for a dictionary that can have multiple different kinds of values (without resorting to inheritance)
19:45:17FromDiscord<exelotl> honestly json is still the best example for that
19:47:38FromDiscord<exelotl> a JSON object is a dictionary with strings as keys, and the values can be strings, ints or any other valid JSON value
19:55:08*vivus quit (Quit: Leaving)
20:05:45FromDiscord<enthus1ast> In reply to @バロアード "Ok, so, I want": maybe use an ESC for your gamestate?
20:05:52FromDiscord<enthus1ast> (edit) "ESC" => "ECS"
20:06:49FromDiscord<enthus1ast> depends on the type of game oc.
20:08:40*superbia joined #nim
20:09:26FromDiscord<exelotl> In reply to @exelotl "you might use it": oh... I just realised this is exactly what you were asking for lol
20:09:40*vicfred quit (Quit: Leaving)
20:10:18*Q-Master quit (Ping timeout: 260 seconds)
20:10:21FromDiscord<exelotl> tbh for an actors list I'd just inheritance rather than case objects
20:10:54FromDiscord<exelotl> you want to be able to easily add new kinds of actors to the game
20:12:07FromDiscord<exelotl> without having to go edit some lists in several different files
20:18:23*haxscramper quit (Remote host closed the connection)
20:27:24FromDiscord<バロアード> ah k
20:27:41FromDiscord<バロアード> yeah ill just use inheritance loool
20:27:48FromDiscord<バロアード> will probably be easier tbh
20:30:29*Q-Master joined #nim
20:56:26*jess quit (Quit: K-Lined)
20:57:33*jess joined #nim
20:57:59FromDiscord<martinium> anyone here have experience using the chronos async library? I am curious in how it performs in comparison to the standard libraries current implementation?
20:58:13FromDiscord<martinium> (edit) "libraries" => "library's"
21:03:11FromDiscord<mratsim> Works well for dealing with high volume of P2P messaging in blockchain.
21:05:00FromDiscord<mratsim> (edit) "messaging" => "message"
21:15:02*asdflkj joined #nim
21:18:53FromDiscord<enthus1ast> @Valor i would also consider ECS for a gamestate, since they map quite nicely to a lot of games. eg.: a living tree (with collision and stuff), a tree "item" on the ground , a tree in your inventory, does it has trade value? Health? A name? Then an enemy, they might have stuff in common (Name, Health), a collision, but cannot be placed in an inventory.
21:19:39FromGitter<wrq> Will there ever be a Discourse forum for Nim?
21:19:55FromDiscord<enthus1ast> In an ESC you would give Entities Components when they fit
21:20:45FromDiscord<mratsim> In reply to @wrq "Will there ever be": If Discourse switches to Nim sure
21:21:05FromDiscord<enthus1ast> Then the System would operate on those Entities that have given Component ("Mana regeneration", "poison damage")
21:21:22FromDiscord<exelotl> @wrq we eat our own dogfood, as the idiom goes
21:21:44FromGitter<wrq> it's really the main thing holding me back from taking nim seriously. without a place like Discourse, or even Github Discussions to have medium/long-form discussions, I can't really invest that much time in it
21:21:53FromGitter<wrq> I know, the dog food idea is awful. The forum is terrible
21:22:04FromGitter<wrq> I've seen a number of conversations about it
21:22:20FromGitter<wrq> it seems like there's only 2-3 core devs and the author of the forum that actually oppose it.
21:23:49FromDiscord<mratsim> You realize that Github Discussions are not even a month old.
21:24:04FromDiscord<mratsim> And we use the RFC repo for deeper think
21:24:14FromDiscord<Solitude> how is forums functionality stopping you from using the language? what discourse feature is so vital to your workflow?
21:28:23*narimiran quit (Ping timeout: 245 seconds)
21:33:15PrestigeIs there a way to run single tests in a file with testament? Like in some js testing libs, you can do `test.only`
21:45:12*Gustavo6046 joined #nim
22:00:20FromDiscord<バロアード> isnt blockchain like increbly wasteful for the enviroment
22:01:07Prestigewhat do you mean?
22:01:17FromDiscord<ElegantBeef> Yea i dont get the detractor i'm fairly active on the forum and it's fine
22:01:27FromDiscord<バロアード> like apparently bitcoin takes up a shitton of electricity
22:01:39Prestigeoh, yeah
22:03:27FromDiscord<exelotl> yeah I'm not a fan of blockchain stuff either
22:03:39FromDiscord<ElegantBeef> Well it's a nice idea but it's incredibly wasteful
22:03:40FromDiscord<バロアード> i mean i like the IDEA of blockchain as a way to own something so artists dont get scammed
22:03:49FromDiscord<バロアード> but yeah, the implementation is,,,, bad
22:03:51FromDiscord<Recruit_main707> @Valor likes proof-of-stake :P
22:04:12FromDiscord<バロアード> i mean, i have artist friends who id like to see make lots of money off comission
22:04:24FromDiscord<バロアード> and they cant do that if random people photoshop their works into memes lol
22:05:00FromDiscord<Recruit_main707> this reminds me of the pepe blockchain
22:06:24*NimBot joined #nim
22:12:20*Q-Master quit (Read error: Connection reset by peer)
22:12:31*Q-Master joined #nim
22:24:20FromDiscord<mratsim> In reply to @バロアード "isnt blockchain like increbly": It's the proof-of-work consensus algorithm that is wasteful, environment waste is not inherent to the blockchain.
22:24:32FromDiscord<mratsim> (edit) "the blockchain." => "blockchains."
22:25:21FromDiscord<mratsim> I would put proof-of-work in the same bucket as javascript in terms of environmental waste.
22:27:13FromDiscord<mratsim> channels specified ... https://github.com/mratsim/weave/commit/30bacedc841c5a4caf8424c5c342f352805ccf73↡↡Now only misc definitions TODO.
22:29:09giacoI want to check if string contains all elements of a set, but I'm failing to find the proper function. "in", "find", "contains" seems all doing different things
22:29:10FromDiscord<バロアード> I mean theres also the fact that bitcoin/crytocurrency people are just .... creepy.
22:29:21giacoset is a char set
22:29:23FromDiscord<ElegantBeef> mratsim you might know a way about this aside from using include, anyway from binding a symbol in the file that invoked the macro instead of the macro scope? πŸ˜„
22:29:44FromDiscord<ElegantBeef> in and contains are the same
22:29:56FromDiscord<ElegantBeef> `if set in string` == `if string.contains(set)`
22:30:17FromDiscord<ElegantBeef> make sure you import strutils and you'll be fine
22:30:18FromDiscord<dom96> In reply to @wrq "I know, the dog": The forum definitely ain’t perfect. But that’s a strange reason not to use a language.
22:30:48giacoyeah, but they are not doing what I need
22:30:59FromDiscord<ElegantBeef> What do yo uneed
22:31:16FromDiscord<Yardanico> one way you can do it is with allIt from sequtils
22:31:17giacoI want to check if string contains all elements of a char set
22:31:29FromDiscord<Yardanico> But that's not the most efficient way :P
22:31:30FromDiscord<treeform> I think forum is great.
22:31:34FromDiscord<ElegantBeef> If on devel you could use `setutils` and do `toSet` on the string and compare to your set
22:31:55FromDiscord<Yardanico> https://nim-lang.org/docs/strutils.html#allCharsInSet%2Cstring%2Cset%5Bchar%5D
22:31:58FromDiscord<ElegantBeef> Though again not too efficient
22:32:01FromDiscord<Yardanico> @giaco
22:32:11FromDiscord<Yardanico> Ah sorry
22:32:17FromDiscord<Yardanico> It's the wrong one xd
22:32:24FromDiscord<ElegantBeef> Ah weird that the contains is just "if any char in set")
22:32:29FromDiscord<ElegantBeef> Nah that's the right one
22:32:42FromDiscord<ElegantBeef> Isnt it?
22:32:48giacoallCharsInSet is not doing what I need
22:32:52*Gustavo6046 quit (Read error: Connection reset by peer)
22:33:07giacoallIt might do it, but is not better than a for loop
22:33:32giacobut I could be the best way, dunno
22:33:36giaco*it
22:34:17FromDiscord<ElegantBeef> Well there is always `toSet` in setutils, but it's just a for loop over the entire string
22:34:30FromDiscord<Yardanico> I don't think it's possible to do much optimization, just loop and short circuit if some char doesn't match
22:34:52FromDiscord<Yardanico> Uhh, again talking about the wrong thing here
22:35:03FromDiscord<ElegantBeef> Well that's what allChars does, they just want to see if the set is in the string. so it's iterate the entire string and when all chars match exit
22:36:41*superbia quit (Quit: WeeChat 3.0)
22:42:03*solitudesf quit (Quit: Leaving)
22:42:16giacofor c in {'a'..'z'}:; if c notin mysentence.lower:; return false; return true. Ugly but works. If you have any suggestions I'm just experimenting
22:42:48*Gustavo6046 joined #nim
22:43:09Prestigereturn c in mysentence.lower ?
22:43:26FromDiscord<ElegantBeef> That'd early exit
22:43:51FromDiscord<Yardanico> That's a bit unoptimized though
22:44:05Prestigesince there's no formatting I can't tell where they are returning
22:44:15FromDiscord<Yardanico> For one you can convert the whole string to lowercase or just have birth lowercase and uppercase in your set
22:44:22FromDiscord<Yardanico> both
22:45:39giacoI'm already converting it to lowercase, as you can see
22:46:49FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2RlP
22:46:51FromDiscord<ElegantBeef> There you go
22:47:31FromDiscord<Yardanico> @giaco I meant that you do it for each letter individually
22:47:55giacoElengantBeef, my solution is exactly like your but I'm not using variable i, that seems unnecessary to me
22:48:01FromDiscord<Yardanico> Wait @ElegantBeef why i
22:48:05FromDiscord<ElegantBeef> yea it's a `O(strLen charsN)` in your case
22:48:06FromDiscord<Yardanico> :nimAngry:
22:48:11FromDiscord<ElegantBeef> True can do for c in s
22:48:22FromDiscord<ElegantBeef> too used to iterating strings from my strview
22:48:26Prestigeare you doing something like https://play.nim-lang.org/#ix=2RlS giaco
22:48:44giacoPrestige: precisely that
22:48:51FromDiscord<ElegantBeef> Yea that's iterating twice
22:49:06FromDiscord<ElegantBeef> once per char in the set and again the entire string until a hit
22:49:49FromDiscord<ElegantBeef> Here we go a proper idiomatic solution πŸ˜› https://play.nim-lang.org/#ix=2RlT
22:50:09FromDiscord<ElegantBeef> The `c in chars` is a non iterative operation
22:50:18FromDiscord<ElegantBeef> Plus ever iteration you're converting s to lower
22:50:27FromDiscord<ElegantBeef> You've got like 3 loops going on vs the one of mine
22:51:13FromDiscord<GamzWithJamz> Do any of you know how to print string values in LLDB for Nim? The instructions from the book "Nim in Action" are not valid anymore: https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html↡↡I get this error: https://media.discordapp.net/attachments/371759389889003532/816080158704009216/unknown.png
22:52:16FromDiscord<Yardanico> https://www.reddit.com/r/nim/comments/lhaaa6/debugging_support_formatters_for_lldb_in_vscode/ might be useful
22:52:26FromDiscord<dom96> This isn't part of the book btw
22:52:30FromDiscord<dom96> it's just a separate article
22:52:39FromDiscord<GamzWithJamz> In reply to @GamzWithJamz "Do any of you": Realized I missed something in the instructions. Just needed to cast it to `char` https://media.discordapp.net/attachments/371759389889003532/816080522286989322/unknown.png
22:52:49giacoElegantBeef, I just wrote toLower inside the for loop for simplicity here on irc, but really is outside like in the play.nim link posted by Prestige. Also, I'm using "c in chars" too, so according to what you are saying also mine is 1 loop
22:53:06FromDiscord<dom96> would appreciate a PR to fix the article if you find the solution πŸ™‚
22:53:08FromDiscord<ElegantBeef> Well it's not one loop
22:53:22FromDiscord<ElegantBeef> for each character you're iterating the entire string checking if it's in the string
22:53:37FromDiscord<GamzWithJamz> In reply to @dom96 "This isn't part of": You're right. My mistake.
22:53:56FromDiscord<ElegantBeef> Mine also doesnt do the same thing, but i can quickly fix that
22:54:19FromDiscord<Delta> sent a long message, see http://ix.io/2RlV
22:58:43FromDiscord<dom96> @Delta This is just my opinion, so take it as purely that, but if I was in your shoes I would write a simple suggestion engine that works for 90% of cases and which doesn't depend on the Nim compiler.
22:59:43FromDiscord<dom96> New developments in Nim are meant to improve nimsuggest but I'm skeptical and I think that we can get good enough suggestions that are fast by simply indexing the Nim code ourselves.
22:59:49FromDiscord<Delta> simple suggestion engine i.e. simple autocomplete?
22:59:56FromDiscord<Delta> (to get started)
23:00:09giacoElengantBeef, if you iterate over the string instead of the char set, you're assuming the string doesn't contains chars outside the set. It doesn't return the same result as the dual loop
23:00:29FromDiscord<dom96> In reply to @Delta "simple suggestion engine i.e.": yeah, it could be as simple as finding all the `proc` in the project's Nim files
23:01:26*tane quit (Quit: Leaving)
23:02:02FromDiscord<Delta> Wonderful, thanks for the suggestion. I'll see where this takes me. Is there any prior work on "indexing the Nim code ourselves" outside of the compiler? I know there is https://github.com/tree-sitter/tree-sitter which could probably be used here.
23:02:31FromDiscord<Yardanico> there was a ctags tool written quite a long time ago, there's also the nim plugin for jetbrains IDEs
23:02:44FromDiscord<GamzWithJamz> In reply to @Yardanico "https://www.reddit.com/r/nim/comments/lhaaa6/debugg": This thing is also out of date, but I believe I can fix it. I will post the updated one on that reddit.
23:04:27FromDiscord<Yardanico> actually there's `ctags` embedded in the Nim compiler already
23:05:00FromDiscord<Yardanico> not sure how usable it is though
23:06:34FromDiscord<Yardanico> also you can use `jsondoc` to build the documentation in machine-readable json which then can be used for suggestions
23:08:29FromDiscord<Delta> Thanks for the pointers, I'll check it out.
23:11:51FromDiscord<ElegantBeef> giaco i did actually time it and my method is measurably faster
23:11:54FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2Rm6
23:12:15FromDiscord<ElegantBeef> Compiled with -d:danger and --gc:arc
23:12:20FromDiscord<ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/816085469397516308/unknown.png
23:14:04FromDiscord<ElegantBeef> doing `c notin lower` requires iterating from the start over and over again, whereas me iterating over the entire string left to right means i dont restart the search for every character
23:14:26FromDiscord<ElegantBeef> So yes your method iterates twice
23:14:53*krux02 quit (Remote host closed the connection)
23:16:14FromDiscord<ElegantBeef> Ah turns out most of that speed is just form using `toLowerAscii` instead of `toLower`
23:16:21FromDiscord<ElegantBeef> So i guess i'm a numpty
23:16:23giacoElegantBeef, sure now it is, but you've changed your previously proposed solution. Thanks for the hint! Surely more elegant solution triggering early return after set comparison
23:16:39FromDiscord<ElegantBeef> Well i pointed that issue out, and said i was going to resolve it
23:18:34FromDiscord<Yardanico> heh nep1 in devel is funny
23:18:39FromDiscord<Yardanico> http://nim-lang.github.io/Nim/nep1.html
23:18:41FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/816087070761811968/unknown.png
23:18:45FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/816087087711387650/unknown.png
23:19:25FromDiscord<Yardanico> time to fix
23:20:31PrestigeIs there not a specific style enforced with linting?
23:20:40FromDiscord<Yardanico> no, nim is not about "one style for all"
23:20:49FromDiscord<Yardanico> I've grown to like `a .. b` over `a..b` by the way, I don't really know why
23:21:02FromDiscord<ElegantBeef> So yea disregard everything i said about performance
23:21:19FromDiscord<ElegantBeef> Checking if a set is apart of another set is apparently somehow slower
23:23:23FromDiscord<flywind> timoth like a..<b
23:23:44FromDiscord<Yardanico> well, that was discussed in a PR
23:23:46FromDiscord<Yardanico> before he merged it
23:24:20FromDiscord<Yardanico> but yeah, I like spaces before and after more anyway :D
23:24:23FromDiscord<flywind> https://github.com/nim-lang/Nim/pull/16992
23:24:46PrestigeI thought the compiler would just have a single style so it's more readable
23:25:02FromDiscord<Yardanico> we're not talking about the compiler though
23:25:03FromDiscord<Yardanico> we're talking about user code
23:25:07Prestigeah
23:25:13FromDiscord<Yardanico> nep1 is basically "pep8 but for nim" :D
23:25:26FromDiscord<Yardanico> (since then nim switched to normal RFCs)
23:25:31Prestigeoh, I wasn't familiar with the term
23:25:49FromDiscord<Yardanico> https://nim-lang.org/docs/nep1.html
23:27:35PrestigeThanks, cool to see this exists
23:27:41FromDiscord<Yardanico> hm, I think like the note about old naming conventions (TFoo/PFoo) should be removed from nep1 too, nowadays no stdlib module has those
23:28:14FromDiscord<flywind> some pure enum is not fit for nep1 too
23:28:30FromDiscord<Yardanico> yeah it's just a general guide to follow in most (not all) cases
23:31:12FromDiscord<ElegantBeef> Giaco this is my last version i promise i'll stop spamming you πŸ˜„ https://play.nim-lang.org/#ix=2Rme
23:31:24FromDiscord<ElegantBeef> No copying = much faster for larger string
23:32:13FromDiscord<ElegantBeef> Thus ends this day's edition of code golf
23:32:41FromDiscord<Yardanico> πŸ₯΄
23:33:06FromDiscord<Recruit_main707> In reply to @バロアード "I mean theres also": why lol
23:34:03giacoin a sequence of and, or, mod, div, !=, == on a single line, you think is better to wrap things with parenthesis even is not necessary, or better leave reader to comply with natural order of operations?
23:34:25giacoElegantBeef, thanks a lot? Haven't though about that. Nice exercise
23:34:57FromDiscord<Yardanico> @giaco I'd say it depends on the context, but a bit of parenthesis won't hurt
23:40:41FromDiscord<Rika> how does one debug an error that changes when i add any one of `--gc:orc` `--debugger:native` `-d:useMalloc`
23:41:03FromDiscord<Rika> each one (and combinations of each) makes the error change
23:41:11FromDiscord<Rika> its making me go crazy
23:41:50FromDiscord<Yardanico> what kind of errors do you get?
23:44:11FromDiscord<Rika> index not in, sigsegv, another index not in with different indices
23:44:29FromDiscord<Rika> fg
23:44:32FromDiscord<Yardanico> i'm assuming devel? try with --gc:arc to see if it still crashes
23:44:33FromDiscord<Rika> wrong chat
23:44:37FromDiscord<Rika> okay
23:44:39FromDiscord<Yardanico> then try with --gc:arc --cursorInference:off
23:44:44FromDiscord<Yardanico> (if it still crashes)
23:44:44FromDiscord<Rika> ah wait
23:44:46FromDiscord<Rika> this is async
23:44:52FromDiscord<Yardanico> yes I understand
23:44:59FromDiscord<Rika> okay
23:45:05FromDiscord<Yardanico> your async code will still run with arc just fine, it'll "just" leak :)
23:45:14FromDiscord<Yardanico> so it's much easier to understand if it's an orc bug (cycles) or not
23:45:27FromDiscord<Rika> i know yes
23:45:31FromDiscord<Rika> okay
23:49:44FromDiscord<Rika> ill report back next time, this is mind numbing
23:50:17FromDiscord<ElegantBeef> After that string impl i kinda now want a `for x.toLowerAscii in s` πŸ˜„
23:51:12FromDiscord<Rika> that makes no sense
23:52:01FromDiscord<ElegantBeef> It iterates the for loop then shadows the identifier in the procedure call internally
23:52:14FromDiscord<Yardanico> you know the rules and so do I
23:52:16FromDiscord<Yardanico> (edit) "you" => "you" | removed ""
23:52:18FromDiscord<Yardanico> (edit) "you" => "you" | "I" => "I"
23:52:58FromDiscord<Yardanico> write a \\\\\
23:53:16FromDiscord<ElegantBeef> Hmm 5 letters must be RFFCC πŸ˜›
23:53:24FromDiscord<phpOstrich> What are methods good for?
23:53:24FromDiscord<Rika> In reply to @ElegantBeef "It iterates the for": ??
23:53:29FromDiscord<ElegantBeef> Inheritance
23:53:33FromDiscord<Yardanico> @phpOstrich dynamic dispatch, quite obviously :P
23:53:42FromDiscord<ElegantBeef> What rika
23:53:51FromDiscord<Rika> i dont understand
23:53:58FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2Rmp
23:54:03FromDiscord<Rika> that makes no sense
23:54:11FromDiscord<Yardanico> of course the expression will be assigned to a temp var instead, but you get the idea
23:54:24FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=2Rmq
23:54:27FromDiscord<Rika> why would that be?
23:54:43FromDiscord<ElegantBeef> What do you mean?
23:55:10FromDiscord<Rika> why would `for x.call in y` make sense to you
23:55:27FromDiscord<ElegantBeef> I said i kinda wanted it
23:55:32FromDiscord<Rika> it does not make sense to me, i know what you want it to do but it does not conceptually or logically connect
23:55:33FromDiscord<ElegantBeef> Didnt say it made sense
23:58:09FromDiscord<InventorMatt> I could see some use cases for it such as converting integers to float or if you wanted to square a number coming out. it would just reduce everything by one line of code
23:58:40FromDiscord<Yardanico> you can write most of Nim in one line of code, but do you want to? :D
23:58:50giacoI'm trying to find the way-to-go to alias a proc, I see some old merged PR, but not the line in official docs
23:59:09FromDiscord<Yardanico> a template?
23:59:33FromDiscord<Yardanico> it depends on what you want to do really :P
23:59:45FromDiscord<Yardanico> you can always write a "wrapper" proc if you really need a "proc", but in most cases you can get away with a template