<< 11-11-2021 >>

00:00:07*ehmry joined #nim
00:00:32*lain joined #nim
00:02:54FromDiscord<hmmm> aaaa why python can have the beautiful a[1:] and we need to have this monstrosity a[1 .. ^1]
00:07:39FromDiscord<Elegantbeef> You... do realize you can make your own sugar
00:07:44FromDiscord<impbox [ftsf]> https://github.com/nim-lang/RFCs/issues/311
00:09:19FromDiscord<impbox [ftsf]> sounds like one reason is because nim doesn't have support for postfix operators, only prefix and infix
00:09:35FromDiscord<impbox [ftsf]> and `1..^1` does the job
00:11:57FromDiscord<evoalg> I would say that `a[1 .. ^1]` is more readable than `a[1:]` anyway. I used to write perl scripts where I would feel cool using a few symbols to do stuff, but it wasn't readable, so I now like the longer form
00:14:46FromDiscord<impbox [ftsf]> i wouldn't mind having `a[1..]` or `a[..5]` but easy to manage without, it could also be ambiguous in different contexts. `1..` -> `1..type(1).high` ? `..5` `type(5).low..5` would make sense for ranges, but slicing a string you'd probably want it to have a different meaning
00:15:45FromDiscord<Elegantbeef> Just make `1.^1` sugar πŸ˜›
00:17:22FromDiscord<evoalg> `a[1 .. a.high]` may be even more readable, yea
00:18:02FromDiscord<evoalg> dunno
00:18:20FromDiscord<Elegantbeef> Ideally you avoid these slice operations though, unless you need a sequence
00:18:30FromDiscord<Elegantbeef> But that's just me going "Memory usage bad"
00:19:43FromDiscord<evoalg> so would `for x in a[1 .. ^1]` make a new seq and then loop over it?
00:19:59FromDiscord<Elegantbeef> Yep
00:20:22FromDiscord<Elegantbeef> to do the 0cost iteration you'd want `for x in a.toOpenArray(1, a.high)`
00:20:47FromDiscord<evoalg> ooooo
00:21:00FromDiscord<evoalg> lemme look up toOpenArray
00:21:25FromDiscord<impbox [ftsf]> oh, i've not encountered that
00:21:38FromDiscord<Elegantbeef> Though now we can use `[]` for iterators so we can make 0 cost iterators
00:23:06FromDiscord<evoalg> I looked up toOpenArray is system ... no explanation or examples ... I'm not able to glean stuff form proc definitions yet 😦
00:23:17FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3EDN
00:23:29FromDiscord<Elegantbeef> it just returns an `openArray` which is basically a `pointer, len`
00:23:45FromDiscord<Elegantbeef> It cannot be stored in a variable, it can only be passed to procedures or used in loops
00:24:03FromDiscord<evoalg> nice πŸ™‚
00:24:05*LyndsySimon quit (Ping timeout: 260 seconds)
00:24:32*robertmeta quit (Ping timeout: 268 seconds)
00:24:42*euantorano quit (Ping timeout: 260 seconds)
00:24:42FromDiscord<Elegantbeef> But yea if you care about memory usage/performance `toOpenArray` is the way to iterator over slices
00:25:51FromDiscord<evoalg> I guess if I'm writing something that will only be use used where they'll be plenty of mem and the seq / array isn't too long then I don't have to worry
00:27:34*ormiret quit (Read error: Connection reset by peer)
00:27:34*notchris quit (Write error: Connection reset by peer)
00:28:27*elph quit (Ping timeout: 250 seconds)
00:29:33FromDiscord<Elegantbeef> Yep bikeshedding is a hobby πŸ˜›
00:30:46FromDiscord<Elegantbeef> Eh i see zoom is happy that i passed a flag along πŸ˜›
00:31:41FromDiscord<evoalg> huh?
00:31:58FromDiscord<Elegantbeef> They reacted to my `[]` comment, which was fixed by passing a flag along
00:32:16FromDiscord<Elegantbeef> Matrix/discord reactions arent cross bridge sadly
00:32:32FromDiscord<Zoom> Yeah, implicit seq creation makes me sad
00:33:06FromDiscord<Elegantbeef> Yea was the reason i looked into it, smelled like a simple issue that should've been easy to fix
00:34:09FromDiscord<Elegantbeef> Low hanging fruit is my forte!
00:34:55FromDiscord<impbox [ftsf]> Well slicing is not really implicit
00:35:35FromDiscord<Elegantbeef> The copy is implicit there are many usages of `for x in a[b..c]` which shouldnt be copies
00:35:56FromDiscord<Zoom> But you probably should expect it to return a "view type"↡(@impbox [ftsf])
00:36:04FromDiscord<Elegantbeef> Ideally the `a[b..c]` is only a copy when needs to be
00:36:39FromDiscord<impbox [ftsf]> `var b = a[1..5]` i wouldn't expect to be a view
00:37:04FromDiscord<Elegantbeef> In that case it shouldnt be you're right
00:37:09FromDiscord<Elegantbeef> Luckily we can support both now
00:37:42FromDiscord<impbox [ftsf]> `for x in a{1..5}:` or something for view perhaps?
00:37:57FromDiscord<Elegantbeef> It doesnt make sense in this case
00:37:58FromDiscord<impbox [ftsf]> Not sure if that syntax is already used by sets
00:38:21FromDiscord<impbox [ftsf]> But if the compiler can do the magic to determine the correct thing by context that's cool
00:38:23FromDiscord<Elegantbeef> `for x a[1..5]` doesnt need to copy since `x` is immutable
00:38:31FromDiscord<Elegantbeef> It can
00:38:33FromDiscord<impbox [ftsf]> Nice
00:38:51FromDiscord<Zoom> I would. Not in Nim, though \:D↡(@impbox [ftsf])
00:41:06FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3EDQ
00:43:17FromDiscord<evoalg> seems like magic to me
00:44:24*elph joined #nim
00:44:48FromDiscord<Zoom> `let s = x[0..1] & x[3..4]` it would be nice if it didn't create intermediate seqs and copied directly.
00:45:35FromDiscord<Elegantbeef> Well with TRM that's actually possible πŸ˜€
00:46:29FromDiscord<evoalg> TRM?
00:47:18FromDiscord<Elegantbeef> Term rewriting macros, they allow you to use pattern matching to define what to replace
00:47:55FromDiscord<Elegantbeef> So for instance you could replace `"Hello" & " " & "World"` with `"Hello world"`
00:48:09FromDiscord<Elegantbeef> not a overly compelling example of course
00:48:57FromDiscord<Zoom> If slices were immutable by default it would be unnecessary.
00:49:02FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3EDU
00:49:17FromDiscord<RattleyCooper> In reply to @evoalg "seems like magic to": Wait until you see a template that uses `{.inject.}` πŸ˜›
00:49:29FromDiscord<evoalg> lol
00:49:35*elph quit (Ping timeout: 264 seconds)
00:49:41FromDiscord<Elegantbeef> Unhygienic templates arent that complicated though
00:50:14FromDiscord<RattleyCooper> But it def seems like magic to me
00:50:36FromDiscord<Elegantbeef> I dont recall Zoom do you have a performance focused library for iterators or is that someone else
00:51:10FromDiscord<Zoom> I got nothing. I just liked zero\_functional
00:51:13FromDiscord<Elegantbeef> Ah
00:51:35FromDiscord<Elegantbeef> I recall from the forum you + ZF but didnt remember who was the author
00:51:42FromDiscord<Zoom> Although it's limited
00:52:20*elph joined #nim
00:53:14*LyndsySimon joined #nim
00:54:20*notchris joined #nim
01:02:06FromDiscord<evoalg> so it's possible that nim could have done slices as iterators by default, but didn't go down that path when nim was developed?
01:02:14*robertmeta joined #nim
01:03:14FromDiscord<RattleyCooper> The great thing about nim is you can usually just make it do the things you want, so even if it's not developed that way you can create the iterators you want/need.
01:04:01FromDiscord<Elegantbeef> Indeed evoalg, especially if someone fixed the bug when it was introduced πŸ˜›
01:04:59FromDiscord<Elegantbeef> The issue was that `[]` was accidentally disallowed for iterators until 1.6.0, but there is no reason for the stdlib not to have them, personally i'm somewhat considering making a module for it
01:06:08FromDiscord<Elegantbeef> It'd never be introduced into `iterators` i assume since it'd be a possible breaking change
01:08:54FromDiscord<Zoom> It would be nice to be considered for v2
01:09:51FromDiscord<Elegantbeef> yep
01:10:54FromDiscord<Zoom> And to be considered it needs to be suggested..
01:11:18FromDiscord<evoalg> I heard a rumor that v2 is 1 year away, and it always will be 1 year away ... am I cynical?
01:11:36*euantorano joined #nim
01:11:48FromDiscord<evoalg> it's more that I'm worried this will be the case, as I've seen that sort of thing before
01:14:11FromDiscord<RattleyCooper> I haven't been around that long but since I started using nim it's gone from 1.4.8 to 1.6. Don't know if that's normal or not for that timeframe though
01:14:29FromDiscord<impbox [ftsf]> does the number matter to you?
01:14:51FromDiscord<RattleyCooper> Yeah, so long as progress is made it really shouldn't matter if it's 2.0 or 1.9.99
01:15:02FromDiscord<impbox [ftsf]> is there's a specific feature you're waiting on?
01:15:15*elph quit (Quit: Connection closed for inactivity)
01:15:44FromDiscord<impbox [ftsf]> since the scope for v2 isn't announced, I understand why you'd care when a version with that number it gets released.
01:17:19FromDiscord<impbox [ftsf]> i think a roadmap would be great though, hopefully we'll see something like that soon
01:22:08FromDiscord<evoalg> sent a long message, see http://ix.io/3EDY
01:22:38FromDiscord<RattleyCooper> Ahhh, that makes a lot of sense
01:23:04FromDiscord<RattleyCooper> Just a backlog of features
01:23:54FromDiscord<evoalg> will it be as backwards compatible as 1.6 is to 1.4 sort-of-thing?
01:23:59FromDiscord<Elegantbeef> v2 allows breaking changes, so it will allow many API changes
01:24:05FromDiscord<evoalg> ahhh ok
01:24:27FromDiscord<Elegantbeef> Major changes do not need to be backwards compatible
01:24:40*ormiret joined #nim
01:25:50FromDiscord<evoalg> so would it be fair to compare v2 to Python2 -> Python3 ? (as fair as we can be with no roadmaps at this stage)
01:26:11FromDiscord<Elegantbeef> There is a forum post for what araq wants for 2.0
01:26:55FromDiscord<Elegantbeef> https://forum.nim-lang.org/t/7983
01:27:25FromDiscord<evoalg> thank you! (and I'll stop asking the tough questions πŸ˜‰ )
01:27:54FromDiscord<Elegantbeef> none of us are core devs so cannot say much of what 2.0 will entail
01:30:00FromDiscord<evoalg> Makes sense ... and please remember I don't really know what I'm talking about ... thank you all for your thoughts
01:30:21FromDiscord<RattleyCooper> Neither do I!
01:30:31FromDiscord<Elegantbeef> Well i never know what i'm talking about, i just take the lack of argument for that i do πŸ˜›
01:31:53FromDiscord<evoalg> πŸ˜‰
01:34:06FromDiscord<impbox [ftsf]> In reply to @evoalg "so would it be": I would guess not, python 2->3 completely fragmented their ecosystem, i imagine nim would not repeat their mistake
01:35:01FromDiscord<impbox [ftsf]> nim 0 -> 1 was an easy transition, as have been 1.x -> 1.x+1
01:40:39FromDiscord<Elegantbeef> you mean `1.x + 2` πŸ˜›
01:41:13FromDiscord<impbox [ftsf]> true, 1.x -> 1.x+1 was troublesome =p
01:41:18FromDiscord<Elegantbeef> `x mod 2 == 0` are stable releases `x mod 2 == 1` are devel branches
01:52:56FromDiscord<Daniel M. JaΓ©n> The best package for MySQL?
01:53:17FromDiscord<Daniel M. JaΓ©n> (edit) "The" => "What is the"
02:38:25FromDiscord<exelotl> In reply to @Daniel M. JaΓ©n "What is the best": sadly I think std/db_mysql is the only real option
02:40:13FromDiscord<exelotl> ndb would be preferable but it only supports sqlite and postgres :(
02:40:32*arkurious quit (Quit: Leaving)
02:40:59FromDiscord<Daniel M. JaΓ©n> In reply to @exelotl "ndb would be preferable": F
02:41:06FromDiscord<Daniel M. JaΓ©n> In reply to @exelotl "sadly I think std/db_mysql": ok
02:55:02*neurocyte0132889 quit (Ping timeout: 240 seconds)
03:30:23FromDiscord<Qixt> what's the most recommended nim gui toolkit
03:40:32FromDiscord<impbox [ftsf]> if you have the option, postgresql is significantly better than mysql
03:40:47*rockcavera quit (Remote host closed the connection)
03:54:17FromDiscord<evoalg> I can do `echo @[1, 2, 3, 4, 5].find(3)` but I can't do the same with "rfind", ie `echo @[1, 2, 3, 4, 5].rfind(3)` ... should I reverse the seq and then use find?
03:56:48FromDiscord<Rika> Is there an rfind for regular seqs?
03:56:53FromDiscord<Yardanico> In reply to @Rika "Is there an rfind": no, that's the point
03:57:00FromDiscord<Yardanico> there's only rfind for strings
03:57:27FromDiscord<evoalg> ohhhhh ok ... so I should reverse using the algorithm module and then use find?
03:59:22FromDiscord<evoalg> or I could loop through the seq and keep the last matched index I guess
04:06:01*supakeen quit (Quit: WeeChat 3.3)
04:06:32*supakeen joined #nim
04:17:16FromDiscord<impbox [ftsf]> or add an rfind for seqs
04:17:23FromDiscord<impbox [ftsf]> sounds like a useful thing to have
04:17:51FromDiscord<Elegantbeef> Well i guess i'll make that iterator module since i cannot be arsed to try to debug opengl's debug handler causing a segfault
04:18:09FromDiscord<Elegantbeef> Grabbed an old laptop installed an OS and turns out i'm an idiot that forgot the GPU it had sucks πŸ˜€
04:21:37FromDiscord<evoalg> I make my own rfind https://play.nim-lang.org/#ix=3EEz ... but I haven't been brave enough to make a iterator for it instead
04:24:05FromDiscord<evoalg> I'm wanting the rfind for seq's so that I can compare eg user input of a number to if it has been previously entered, and if so when, ie the last time, ie the last index, so hence rfind ... if that makes sense
04:25:10FromDiscord<Elegantbeef> Why is it named `myrfind` πŸ˜€
04:25:37FromDiscord<Elegantbeef> try `proc rfind[T](s: seq[T], n: T): int` as the proc definition for infinite reuse πŸ˜›
04:26:05FromDiscord<evoalg> I wasn't brave and thought it might break something ... it'd be the first time I named something the same as a standard proc ... ok I will do that! πŸ™‚
04:26:13FromDiscord<evoalg> Thank you!
04:28:46FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3EEH
04:28:50FromDiscord<impbox [ftsf]> you can do something like this to make it more generic
04:29:02FromDiscord<impbox [ftsf]> then it'll work with any type of seq
04:29:28FromDiscord<Elegantbeef> I didnt even look at the body, use that implicit result if you're going to do that style of coding evoalg
04:29:30FromDiscord<evoalg> I want it to return on the last match not the first though
04:29:44FromDiscord<impbox [ftsf]> oh right, in which case ,iterate backwards
04:29:52FromDiscord<impbox [ftsf]> sorry i didn't realise it wasn't doing that
04:30:07FromDiscord<evoalg> oh I didn't realize I could iterate backwards!
04:30:32FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3EEI
04:30:36FromDiscord<Elegantbeef> Is one way of doing it
04:30:56FromDiscord<Elegantbeef> I dont recall if the stdlib provides a reversed iterator
04:31:01FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3EEJ
04:31:10FromDiscord<Elegantbeef> open arrays `s.low` is 0
04:31:23FromDiscord<evoalg> much nicer and much more efficient, both of you thank you!
04:31:39FromDiscord<impbox [ftsf]> openarray means it'll work with both seqs and arrrays
04:32:10FromDiscord<evoalg> ahhh ok!
04:33:09FromDiscord<impbox [ftsf]> if you wanted to find all occurrences starting from the back you could do an iterator
04:33:34FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3EEK
04:34:29FromDiscord<evoalg> gotcha, thanks! ... Elegantbeef gave me a "find all" iterator going forward, so I've got lots to play with now - thank you both!
04:34:54FromDiscord<impbox [ftsf]> hurrah! have fun!
04:53:52FromDiscord<evoalg> for the iterator way, I looped over it and it works great. If I wanted to use the iterator only to grab the first match, how do I do that? ... as I can't do `v = myseq.rfind(4)` if it's an iterator
04:54:26FromDiscord<Elegantbeef> You'd need a proc for that syntax
04:56:18FromDiscord<evoalg> ok thank you ... gosh I was thinking of using the iterator and then using a for loop and breaking on the first iteration ... that's not particularly good programming practice right?
04:56:39FromDiscord<Elegantbeef> Not when it can be avoided, you can always make a proc to do that though
04:56:59FromDiscord<Elegantbeef> https://github.com/beef331/slicerator/blob/master/src/slicterator.nim here's a bunch of inspiration πŸ˜›
04:57:21FromDiscord<Elegantbeef> Even got tests https://github.com/beef331/slicerator/blob/master/tests/test1.nim
04:58:05FromDiscord<Rika> When the fuck did you become treeform where you have 91726493 libraries
04:59:47FromDiscord<evoalg> How do I import slicterator if it's not in nimble?
05:00:25FromDiscord<Elegantbeef> `requires "https://github.com/beef331/slicerator#0.10`
05:00:29FromDiscord<Elegantbeef> in your nimble file
05:01:01FromDiscord<Elegantbeef> If you dont have a nimble file you can just do `nimble install https://github.com/beef331/slicerator`
05:01:06FromDiscord<Elegantbeef> Then `import slicerator`
05:01:33FromDiscord<Elegantbeef> To be fair rika i mostly just made this to show evo how one would handle this πŸ˜€
05:01:53FromDiscord<evoalg> works!
05:02:07FromDiscord<impbox [ftsf]> In reply to @evoalg "ok thank you ...": you can create a proc and iterator with the same name and they'll do the right thing
05:02:27FromDiscord<! ash> :shrug:
05:02:27FromDiscord<Elegantbeef> Is that a question or a statement? πŸ˜€
05:02:33FromDiscord<! ash> wow
05:03:05FromDiscord<Elegantbeef> Wow indeed
05:06:21FromDiscord<evoalg> "Success: slicterator installed successfully." ... but do I import slicerator or slicterator ?
05:06:36FromDiscord<Elegantbeef> `import slicerator`
05:07:04FromDiscord<Elegantbeef> Lol i messed up the repo name
05:07:30FromDiscord<Rika> Lol
05:07:34FromDiscord<Rika> Like you always do
05:07:38FromDiscord<Elegantbeef> should be `import sliceterator`
05:07:53FromDiscord<Elegantbeef> Thanks rika, you're my best friend
05:08:37FromDiscord<Elegantbeef> You might ask yourself "Where would we be without rika" and the answer is "happy"
05:08:51FromDiscord<evoalg> or "imoport slicterator" ?
05:09:10FromDiscord<Elegantbeef> Just monkey at the keyboard it until it works
05:09:31FromDiscord<Elegantbeef> Do you have a `projectname.nimble`?
05:09:47FromDiscord<evoalg> "slicterator" worked not "sliceterator"
05:10:34FromDiscord<evoalg> ... in ~/.nimble/ I only have: bin nimbledata.json packages_official.json packages_temp.json pkgs
05:11:01FromDiscord<Elegantbeef> That's not what i meant
05:11:16FromDiscord<Elegantbeef> You generally want to have a nimble file for your project so you can pin dependancies
05:11:30FromDiscord<Elegantbeef> https://github.com/beef331/truss3d/blob/master/truss3D.nimble stuff like this
05:13:07FromDiscord<evoalg> oh ... would I put that in the same dir as my nim files?
05:14:57FromDiscord<Elegantbeef> Yea for your project so you dont need to manually fetch all dependancies if you move computers
05:15:21FromDiscord<evoalg> ie if I have a myprogram.nim and I'm programming and have includes etc, would I put myprogram.nimble in the same directory ... ahh ok
05:15:36FromDiscord<evoalg> makes sense!
05:15:50FromDiscord<Elegantbeef> It's more for libraries/serious projects, for one off stuff it doesnt matter
05:16:11FromDiscord<evoalg> gotcha ... I guess I'm just playing around learning at the moment
05:17:11FromDiscord<Elegantbeef> Well then yea no purpose making nimble
05:17:47FromDiscord<evoalg> I have to run out for a bit ... will play later ... thank you for your help Elegantbeef πŸ™‚
05:18:24FromDiscord<Rika> Please pin your dependencies
05:19:06FromDiscord<Elegantbeef> No problem
05:19:16FromDiscord<Elegantbeef> With evo i probably should make that tip jar impbox πŸ˜›
05:19:31FromDiscord<impbox> you totally should make a tip jar
05:20:05FromDiscord<Elegantbeef> I should figure out my opengl issue πŸ˜›
05:20:35FromDiscord<impbox> what's the prob?
05:20:43FromDiscord<Elegantbeef> the opengl debug handler causes a seg fault
05:20:53FromDiscord<Elegantbeef> Atleast enabling it causes it
05:22:07*blackbeard420 quit (Quit: ZNC 1.8.2 - https://znc.in)
05:22:17*blackbeard420_ joined #nim
05:22:17FromDiscord<impbox> hmm, i've used it successfully in the past
05:24:05FromDiscord<impbox> but also getting crashes now when i use it
05:24:13FromDiscord<Elegantbeef> Oh so it's not just me?!
05:25:08FromDiscord<Yardanico> nim is good for when you're too lazy to calculate some stuff by hand :) at the level of python
05:27:40*riceman_ joined #nim
05:27:58FromDiscord<impbox> [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org)\: seems not, i can't get it to work, can look into it a bit more later
05:28:15*ecs quit (Ping timeout: 268 seconds)
05:28:35FromDiscord<Elegantbeef> Appreciated if you can, mine works sometimes but seg faults others
05:28:41FromDiscord<Elegantbeef> So something is off
05:29:08FromDiscord<Elegantbeef> Sometimes gdb points towards my gpu drivers sometimes to nim code
05:29:21FromDiscord<impbox [ftsf]> i'm certain it worked at some point in the past, wonder if a driver update broke it
05:29:26FromDiscord<impbox [ftsf]> on NVIDIA here
05:29:36FromDiscord<Elegantbeef> AMD OSS linux drivers here
05:29:44FromDiscord<impbox [ftsf]> hmm unlikely then
05:30:12*ecs joined #nim
05:30:28*krux02 quit (Remote host closed the connection)
05:30:30FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3EEX the odd backtrace from gdb
05:31:01FromDiscord<Elegantbeef> You're on windows right?
05:31:06FromDiscord<impbox [ftsf]> yaa
05:31:24FromDiscord<Elegantbeef> Odd
05:31:47FromDiscord<Elegantbeef> The last PR was in july
06:50:43FromDiscord<evoalg> In reply to @Elegantbeef "With evo i probably": Sure let me know when you make a tip jar
06:51:26FromDiscord<Rika> Damn people tip others for stuff like this?
06:51:46FromDiscord<Elegantbeef> Fuck if i know impbox suggested it half joking
06:51:53FromDiscord<Elegantbeef> I jokingly referenced it
06:52:12FromDiscord<Elegantbeef> Also if impbox responds on discord when i referenced him on matrix i'll question their sanity
06:52:17FromDiscord<impbox [ftsf]> not jokingly
06:52:50FromDiscord<Rika> BRB setting up a tip jar 9/10ths jk
06:53:11FromDiscord<evoalg> I dunno what's expected, I just know Elegantbeef has been answering so many of my noob questions with nice examples
06:53:49FromDiscord<Rika> Sounds like I need to be home more
06:54:11FromDiscord<Elegantbeef> You act like you'd be rolling in money
06:54:39FromDiscord<evoalg> and I try and limit my noob questions to 2 per day ... but then answers raise more questions as usual πŸ˜‰
06:54:46FromDiscord<impbox [ftsf]> well the amount of time you spend helping people here, i figure you're either unemployed or about to get fired, so i figure you could use a tip jar
06:55:04FromDiscord<Rika> Beef: you don’t know how valuable even a dollar is to me lol
06:55:06FromDiscord<Elegantbeef> Damn imp is onto me
06:55:16FromDiscord<Elegantbeef> Well then pitter patter
06:55:32FromDiscord<impbox [ftsf]> unless beef is getting some of those donated cryptobucks for being our mascot
06:55:45FromDiscord<Elegantbeef> Sadly not
06:55:51FromDiscord<Rika> Lol
06:56:05FromDiscord<Elegantbeef> I'm unemployed, but not needing money
06:56:40FromDiscord<Rika> Imagine not needing money
06:56:41FromDiscord<Rika> MBN
06:56:59FromDiscord<impbox [ftsf]> ahh the glucose guardian
06:57:08FromDiscord<Rika> What
06:57:51FromDiscord<Elegantbeef> Probably an australianism
06:59:41FromDiscord<Elegantbeef> Seems to be gender neutral for someone that doesnt work and gets money from a SO
07:00:05FromDiscord<Rika> Eh
07:00:11FromDiscord<Rika> Do you have an SO? I don’t actually know
07:00:17FromDiscord<Elegantbeef> Nope
07:03:24FromDiscord<evoalg> I had to look at urban dictionary to find what SO stood for, geez I'm so out of touch with that sort of speak
07:03:48FromDiscord<Elegantbeef> Evoalg outting that they're a 40 year old πŸ˜›
07:04:02FromDiscord<evoalg> If I were only that young
07:04:04FromDiscord<Rika> Better than most, still willing to learn
07:04:32FromDiscord<evoalg> I'm 53
07:04:41FromDiscord<Elegantbeef> Of course, no one is to close to death to learn to program, i mean no one is too old to lear... i mean....
07:05:15FromDiscord<Elegantbeef> Is that joke too dark? Hmm i'll have to find a flash light to see
07:05:30FromDiscord<Rika> Didn’t know you were legally blind
07:05:37FromDiscord<Elegantbeef> Only occasionally
07:06:31FromDiscord<evoalg> ... and it's difficult to keep up with you youngsters
07:06:45FromDiscord<Rika> Yeah I’m under 25
07:06:51FromDiscord<Rika> Tehe
07:06:53FromDiscord<Elegantbeef> Just go get your cricket bat and cap us
07:06:56FromDiscord<Elegantbeef> It'll slow us down
07:07:14FromDiscord<Elegantbeef> I forget if Rika is younger than me
07:07:20FromDiscord<Rika> Quick, use very zoomer-level slang
07:07:24FromDiscord<Rika> Obviously
07:07:31FromDiscord<Elegantbeef> Nah i'm not a fucking degenerate
07:07:36FromDiscord<Rika> I am younger than basically everyone here
07:07:45FromDiscord<Rika> Yet older than most teenagers
07:08:11FromDiscord<Elegantbeef> "Obviously" is so rude
07:08:43FromDiscord<Elegantbeef> People often think i'm 30 cause of how i type, so that's always fun
07:08:52FromDiscord<impbox [ftsf]> slowly?
07:08:59FromDiscord<impbox [ftsf]> with one finger?
07:09:14FromDiscord<Elegantbeef> Impbox the person with RSI talking about typing slow?!
07:09:23FromDiscord<Rika> I meant it more like β€œobviously” as in against me than against you
07:09:25FromDiscord<Elegantbeef> Jeez i'm surprised your hands let you type insults like that
07:09:41FromDiscord<Rika> I don’t think 30 year olds use single finger typing
07:09:46FromDiscord<Rika> I’d say some 40
07:09:58FromDiscord<Elegantbeef> Evoalg nervously looks around
07:10:10FromDiscord<Rika> I doubt he does use single finger typing
07:10:13FromDiscord<impbox [ftsf]> i thought it was the youngsters who can't type fast because they're used to touchscreens?
07:10:17FromDiscord<evoalg> I'm one of the few of my generation to touch type
07:10:20FromDiscord<Rika> Nice
07:10:29FromDiscord<Rika> In reply to @impbox "i thought it was": I guess?
07:10:31FromDiscord<impbox [ftsf]> typewriters have been around for a long time
07:10:44FromDiscord<Elegantbeef> For sure he probably learned to touch type on an commodore 64 or whatever the kiwi equivlent is
07:10:50FromDiscord<Rika> Though I assume you mean the way younger youngsters since most people I know touch type
07:10:57FromDiscord<impbox [ftsf]> i learnt to type on a typewriter as a kid
07:11:06FromDiscord<evoalg> I did have a commodore 64 actually
07:11:10FromDiscord<Rika> Me too even if I’m like under 20
07:11:14FromDiscord<impbox [ftsf]> but it was one of those fancy electronic typewriters
07:11:20FromDiscord<Rika> Rather 25, I’m not fucking under 20
07:11:24FromDiscord<Rika> Mistype
07:11:32FromDiscord<Elegantbeef> See rika we're not that far apart in age
07:11:35FromDiscord<Elegantbeef> I'm only 22
07:11:36FromDiscord<Rika> My brain is lagging behind my real age
07:11:52FromDiscord<impbox [ftsf]> so sleek https://media.discordapp.net/attachments/371759389889003532/908252670404464680/unknown.png
07:11:55FromDiscord<Rika> Beef I was sure you were like 27 or something Christ
07:12:12FromDiscord<Elegantbeef> See look what i saidd
07:12:14FromDiscord<Rika> Ah my grandfather had a real mechanical typewriter and I used it before
07:12:20FromDiscord<Elegantbeef> I type like an asshole apparently
07:12:26FromDiscord<impbox [ftsf]> yeah, i think we had a mechanical one too
07:12:28FromDiscord<Rika> Beef: what’s new?
07:12:29FromDiscord<Elegantbeef> Well typing like an asshole was a given
07:12:30FromDiscord<impbox [ftsf]> it made cool sounds
07:12:36FromDiscord<Rika> Exactly beef
07:13:06FromDiscord<Elegantbeef> One person said that "you're so jaded which is why you seem old"
07:13:10FromDiscord<Rika> They made cool sounds but you better have fingers made of lead to type anything more than a paragraph on them
07:13:40FromDiscord<Rika> Beef I guess your communication reflects more of the older generation than our own generation
07:14:22FromDiscord<Elegantbeef> Yea certainly
07:14:45FromDiscord<Rika> I bet I sound like my age though
07:15:45FromDiscord<Elegantbeef> If you mean a zoomer that uses tiktok unironically, probably πŸ˜›
07:16:16FromDiscord<Rika> I don’t use tiktok what the fuck dude
07:16:41FromDiscord<impbox [ftsf]> but it's what all the cool kids are using these days?
07:17:15FromDiscord<impbox [ftsf]> maybe can do nim tutorials on tiktok
07:17:25FromDiscord<Elegantbeef> !ban @impbox [ftsf]
07:17:41FromDiscord<Rika> What the fuck
07:17:44FromDiscord<Rika> Heresy
07:18:08FromDiscord<Rika> In reply to @impbox "but it's what all": I mean I guess you can become big as an influencer or entertainer
07:18:11FromDiscord<Rika> With using it
07:20:40FromDiscord<Elegantbeef> evoalg's now reminiscing about making stuff using basic, we've lost them
07:20:52FromDiscord<impbox [ftsf]> those were good times
07:21:19FromDiscord<Elegantbeef> Wouldnt know, do want to get a commedore eventually though
07:21:22FromDiscord<Rika> What
07:21:33FromDiscord<evoalg> why?
07:21:33FromDiscord<Rika> Sorry I spaced out
07:22:30FromDiscord<impbox [ftsf]> dunno how we did programming without the internet back then
07:22:46FromDiscord<evoalg> books
07:23:46FromDiscord<Rika> I probably could program without internet given the documentation pages of Nim and libraries
07:23:47FromDiscord<impbox [ftsf]> mmm i somehow learnt qbasic using the help files and a few example scripts, though i never learn to how to return, so i'd always blow the stack and i thought it was just a limitation of qbasic and i needed to upgrade or something
07:23:54FromDiscord<Rika> In print or in file
07:24:19FromDiscord<evoalg> but although I've dabbled in bits & pieces, I've never been a serious programmer or anything, I've just sometimes used programming languages to do stuff occasionally ... I don't know much
07:25:22FromDiscord<Elegantbeef> How'd you stumble onto nim?
07:25:46FromDiscord<impbox [ftsf]> finally made it back on topic, nice
07:27:01FromDiscord<Rika> In reply to @evoalg "but although I've dabbled": Isn’t that pretty much everything programmers are? β€œI just wanted to do this automatically and then I became a programmer” xd
07:27:03FromDiscord<evoalg> ahhh well python is a natural fit as I don't have to think about it too much, but then I had some ideas about doing something more serious, and so I wanted speed but I also didn't want me code easily read, so I started reading about compiling (even though some of that can be reversed) and one of the things I read about was nim
07:27:34FromDiscord<Rika> Lol that’s one more on the β€œI looked for fast Python” boat
07:27:47FromDiscord<Elegantbeef> Ah python -\> nim path for fast automation
07:28:27FromDiscord<impbox [ftsf]> i used to do a lot of python at old job, i loved it at first (after coming from php eww)
07:28:54FromDiscord<evoalg> I mean I've never had a job as a programmer ... it's just a hobby, and so I don't know much, hence all my noob questions
07:29:18FromDiscord<Elegantbeef> hey it's technically a hobby for me aswell
07:29:36FromDiscord<impbox [ftsf]> it's better as a hobby
07:29:44FromDiscord<impbox [ftsf]> though as far as jobs go, it's probably pretty good
07:30:48FromDiscord<Rika> It gets ya the money if ya ain’t picky
07:31:41FromDiscord<evoalg> so if I wanted to solve some math thing, I'd automatically fire up ipython ... and if fact I'm going through last years advent of code (which I've never done before) and trying them in both python and nim ... to help me learn nim ... and comparing my answers with narimiran's answer on github
07:32:58FromDiscord<Elegantbeef> Well if you ever want a code review you know where to find me
07:33:25FromDiscord<evoalg> Thank you Elegantbeef!
07:34:52FromDiscord<evoalg> but it's natural for me to first play around in ipython, and at the moment it takes me much longer to do it in nim. I find that my programming is very bottom-up and non-functional, so my python solutions look pretty similar to my nim ones
07:35:11FromDiscord<Rika> Nothing wrong with that is there?
07:36:53FromDiscord<evoalg> while I'm sharing, my ultimate goal is to try and program AGI ... not machine learning (as I don't like that) but true AGI like the arc challenge https://www.kaggle.com/c/abstraction-and-reasoning-challenge
07:37:00FromDiscord<Yardanico> wow
07:37:07FromDiscord<Yardanico> that's a very nice life goal :)
07:37:13*LyndsySimon quit (Ping timeout: 256 seconds)
07:37:38FromDiscord<Yardanico> i hope to see AGI during my lifetime
07:38:04*LyndsySimon joined #nim
07:38:23FromDiscord<Rika> AGI is very challenging isn’t it
07:38:25FromDiscord<evoalg> heh yea it's a pretty grand goal but it's the only think I'm interested in, and I don't believe that machine learning is the way forward (and I don't like it)
07:38:40FromDiscord<Rika> Well it clearly isn’t, there’s something missing to it
07:39:04FromDiscord<Yardanico> In reply to @Rika "Well it clearly isn’t,": 86 billion neurons with complex interactions
07:39:23FromDiscord<Yardanico> but of course simply copying the human brain might be far from the best way to do AGI
07:39:29FromDiscord<impbox [ftsf]> ahh AGI is different to what I thought
07:39:33FromDiscord<evoalg> the most interesting and intriguing thing about AGI is that we've made such little progress, and it'll take some real out-of-the-box thinking and anyone might be able to come up with, even me
07:39:49FromDiscord<impbox [ftsf]> https://en.wikipedia.org/wiki/Adventure_Game_Interpreter
07:39:52FromDiscord<Yardanico> we just don't know anything than a human brain that can have true intelligence
07:39:55FromDiscord<Yardanico> In reply to @impbox "https://en.wikipedia.org/wiki/Adventure_Game_Interp": lol
07:40:00FromDiscord<Rika> https://en.m.wikipedia.org/wiki/Artificial_general_intelligence
07:40:12FromDiscord<Rika> For the curious
07:40:44FromDiscord<impbox [ftsf]> ahh
07:40:55FromDiscord<impbox [ftsf]> close
07:41:13FromDiscord<evoalg> Yardanico I can tell you know what you're talking about ... most people think it's just around the corner and that Elon Musk will invent it
07:41:37FromDiscord<Yardanico> i don't know much, I just like to read sci-fi novels :P
07:42:19FromDiscord<Rika> In reply to @Yardanico "we just don't know": Then we don’t even know how it fucking works lol
07:42:25FromDiscord<Yardanico> exactly
07:42:39FromDiscord<evoalg> that's absolutely right
07:43:39FromDiscord<Rika> Think I’ve thought a bit too much today, I’ve been brainstorming hard for a few hours and I’m tired
07:43:41FromDiscord<Elegantbeef> I hope this doesnt mean evo is a musk fan πŸ˜›
07:43:54FromDiscord<evoalg> no I am not!
07:44:06FromDiscord<Rika> Beef you are, bet
07:44:21FromDiscord<Elegantbeef> Do i have douche energy
07:44:32FromDiscord<Rika> You’re seriously asking that?
07:44:42FromDiscord<Elegantbeef> Hey self awareness is for losers
07:44:43FromDiscord<impbox [ftsf]> i used to think he was cool when i was younger =\ i am ashamed
07:46:56FromDiscord<Elegantbeef> It's ok, we all get sold snake oil once in our lives
07:50:26FromDiscord<evoalg> it's easy to get trapped down the path in machine learning with AlphaGo and big NN's, and there's a lot of money in it too actually, but I want to purposely take a path where it might be untravelled
07:51:07FromDiscord<Rika> That’s nice
07:51:08FromDiscord<Elegantbeef> The only thing i know about AI is that it's a bunch of ifstatements πŸ˜›
07:51:16FromDiscord<Elegantbeef> Wait that's my game dev hat speaking
07:51:38FromDiscord<impbox [ftsf]> FSMs are the future of AI
07:51:49FromDiscord<Elegantbeef> See imp gets it
07:52:06FromDiscord<Rika> Well technically
07:52:28FromDiscord<Rika> Current AI could be said to be just some really complicated FSM can’t it lol
07:53:25FromDiscord<evoalg> true AI, which is AGI, it's more like a 3 month old has leaned things we haven't even come close to getting computers to learn
07:54:25FromDiscord<evoalg> they can already make abstract inferences that no computer program can (yet)
07:54:53FromDiscord<evoalg> yes they can't do times tables or even count properly
07:55:03FromDiscord<evoalg> fascinating stuff πŸ™‚
07:55:23FromDiscord<Elegantbeef> Do any know why children love the taste of cinnamon toast crunch?
07:55:32FromDiscord<impbox [ftsf]> i played around a bit with linear regression and stuff, pretty cool, and q learning seems fun
07:55:46FromDiscord<impbox [ftsf]> speaking of i need to improve my racing AI
07:55:56FromDiscord<impbox [ftsf]> currently it's just a couple of PID controllers
08:00:37*ecs quit (Read error: Connection reset by peer)
08:00:44*ecs joined #nim
08:02:57FromDiscord<evoalg> A chess playing program is very cool, but in terms of true intelligence it's very dense. No-one has come close to creating the intelligence of a dog, for example.
08:03:12FromDiscord<evoalg> anyway I digress
08:03:39FromDiscord<evoalg> the point is, I'm not sure the python will be enough for my needs πŸ˜‰
08:03:53FromDiscord<Rika> It probably won’t lol
08:04:03FromDiscord<impbox [ftsf]> depends how long you want to wait
08:04:12FromDiscord<Rika> The fast stuff is in C and are for traditional machine learning
08:04:13FromDiscord<impbox [ftsf]> does AGI need to be fast?
08:04:31FromDiscord<evoalg> In reply to @impbox "does AGI need to": very good question
08:04:38FromDiscord<impbox [ftsf]> deep thought wasn't very fast
08:04:39FromDiscord<Rika> In reply to @impbox "does AGI need to": It probably has a lot of complex pieces that need to be fast for the whole thing to even be viable
08:05:02FromDiscord<Rika> Iterating every few days is agonising
08:05:20FromDiscord<Yardanico> playing around a bit more with wasm4 https://media.discordapp.net/attachments/371759389889003532/908266127317160027/unknown.png
08:05:25FromDiscord<impbox [ftsf]> nice
08:05:45FromDiscord<Elegantbeef> What're you using?
08:05:48FromDiscord<Yardanico> (i don't know how to properly color mandelbrot and I just used the code from rosetta) https://media.discordapp.net/attachments/371759389889003532/908266244711538709/unknown.png
08:05:56FromDiscord<Yardanico> @ElegantBeef https://wasm4.org/
08:06:09FromDiscord<Yardanico> yesterday dom referred me to a tweet by contextfree about wasm4 for nim
08:06:12FromDiscord<Elegantbeef> Ah didnt realize it was a fantasy console
08:06:30FromDiscord<Elegantbeef> wasm4 + nimscript πŸ˜›
08:06:37FromDiscord<Yardanico> 64KB hard binary limit :)
08:06:41FromDiscord<Yardanico> and total memory limit
08:06:48FromDiscord<Elegantbeef> Ah shucks
08:06:50FromDiscord<Yardanico> so only native languages qualify
08:06:51FromDiscord<impbox [ftsf]> yeah the name is a bit misleading
08:07:03FromDiscord<Rika> The limit is only for fun right
08:07:16FromDiscord<Yardanico> not sure what you mean
08:07:21FromDiscord<impbox [ftsf]> fantasy consoles are serious business
08:07:24FromDiscord<Yardanico> the binary limit - yes, it's not actually enforced unless you want to publish
08:07:27FromDiscord<Yardanico> but memory limit is enforced
08:07:29FromDiscord<Rika> For no real reason but to be there
08:07:32FromDiscord<Yardanico> yes
08:07:41FromDiscord<Rika> Okay I see
08:07:44FromDiscord<impbox [ftsf]> limitations to push creativity
08:07:47FromDiscord<Yardanico> you can allocate gigabytes of RAM with wasm and have binaries the size of tens of MBs
08:08:11FromDiscord<Yardanico> but yeah, with WASI SDK and wasm-opt nim wasm binaries are really small (almost same as C)
08:08:16FromDiscord<Yardanico> if you don't allocate memory of course :)
08:08:33FromDiscord<Yardanico> WASI uses dlmalloc for memory allocation so that's +9KB to your binary (after all optimizations)
08:08:44FromDiscord<Yardanico> i mean heap allocations
08:35:04*riceman_ quit (Ping timeout: 256 seconds)
08:36:21FromDiscord<evoalg> In reply to @Elegantbeef "To be fair rika": If it's a personal module, would an include file be just as good? I'm trying understand what's the advantage of a module if it's just a personal one, or are modules intended to be shared?
08:38:15FromDiscord<Elegantbeef> Include has different semantics if that's what you're talking about
08:38:20FromDiscord<Rika> Yes
08:38:25FromDiscord<Rika> It β€œduplicates code”
08:38:32FromDiscord<Rika> If you include the same module in two other files
08:38:50FromDiscord<impbox> as to why you'd choose one over the other... i dunno, i just put all my code in one file mostly
08:38:51FromDiscord<Rika> You can’t use that module’s types to pass data to other files
08:39:01FromDiscord<Rika> Most people opt for imports because it’s just what’s recommende
08:39:02FromDiscord<Rika> S
08:39:07FromDiscord<Rika> In reply to @Rika "S": D
08:39:11FromDiscord<impbox> yeah, i use import when i split things up
08:39:23FromDiscord<Rika> Include is really for special cases
08:39:23FromDiscord<Elegantbeef> Well imports let you actually use modules, include is just splitting large files up and it's generally bad form
08:39:56FromDiscord<Rika> β€œActually use modules” is vague
08:40:15FromDiscord<impbox> include feels like C, and that's probably my most hated bit of C
08:40:17FromDiscord<Elegantbeef> Well include copy pastes the file into the `include` site so things like `yourModule.name` doesnt work
08:40:42FromDiscord<Rika> But basically if you include A in two files B and C, you can’t use A’s types included in B with functions that take in A’s types included in C
08:41:00FromDiscord<Rika> Since it’s just copy paste, there are two types named the same but are actually different
08:42:21FromDiscord<Rika> It’s functionally equivalent to defining the same types in module B and C, sure they’re the same name and the same data, but since they’re in different modules, they’re treated differently
08:42:37FromDiscord<Rika> And then including both B and C into a file D would probably cause an error
08:42:50FromDiscord<Rika> Also you don’t get access modifiers this way afaik
08:43:18FromDiscord<impbox> yeah, they're considered local to that file
08:43:18FromDiscord<Rika> There’s just a lot of generally undesirable behaviour in including
08:44:39*neurocyte0132889 joined #nim
08:44:39*neurocyte0132889 quit (Changing host)
08:44:39*neurocyte0132889 joined #nim
08:45:16FromDiscord<evoalg> so if I write a proc that depends on strutils (for example), and I import my file instead of include it, I'd also have to import strutils? (if I'm making sense)
08:45:38FromDiscord<Rika> Yes since imports do not implicitly transfer
08:46:12FromDiscord<Rika> You can either import again in the importing file or `export strutils` in the imported file
08:46:42FromDiscord<evoalg> oh I didn't know about export
08:46:47FromDiscord<Rika> Which you use is up to you
08:46:59FromDiscord<Rika> Most prefer importing again
08:47:05FromDiscord<Elegantbeef> Well if a proc depends on strutils you do not need to import strutils↡(@evoalg)
08:47:06FromDiscord<Rika> A few prefer the export
08:47:22FromDiscord<Rika> In reply to @Elegantbeef "Well if a proc": But if a type does then you would need to
08:47:26FromDiscord<Rika> I misread
08:47:57FromDiscord<Elegantbeef> You can use `export` for all symbols so `proc` `module` `var/let/const`s...
08:48:09FromDiscord<impbox> think of include as saying "paste this file here", that's pretty much all it is
08:48:15FromDiscord<impbox> but usually it's not what you want
08:48:23FromDiscord<impbox> import is much cnier
08:48:26FromDiscord<impbox> nicer\
08:48:53FromDiscord<Rika> It’s hard to explain when to export
08:49:02FromDiscord<Rika> But you don’t need to if only your procs need the module
08:49:28FromDiscord<evoalg> when I import something that's in nimble, like strutils, I never have to import anything that it might rely on (which it good)
08:49:34FromDiscord<Rika> Yes
08:50:08FromDiscord<Rika> Sometimes it does expose to you things that you might need to rely on for ergonomics
08:50:47FromDiscord<Rika> Like let’s say I have a module β€œjson” and I have it split into stuff like β€œparser” and β€œserialiser” files or so
08:51:05*LyndsySimon quit (Ping timeout: 264 seconds)
08:51:05FromDiscord<Rika> I don’t want to import json/parser and json/serialiser all the time or whatever
08:51:16FromDiscord<Rika> So you can just make the json module file export those two
08:51:25FromDiscord<Rika> Now you just need to import json and you have both
08:51:35FromDiscord<Rika> Without including
08:51:39*LyndsySimon joined #nim
08:51:49FromDiscord<Rika> Because including has caveats while export generally doesn’t
08:51:53*pro joined #nim
08:52:13FromDiscord<Rika> Or rather, including has more caveats than edporting
08:52:15FromDiscord<Rika> Exporting
08:53:34FromDiscord<Rika> It’s for convenience is the gist I guess
08:53:54FromDiscord<Rika> So you don’t need to keep on importing common modules you would need for a portion of your system
08:54:24FromDiscord<Rika> If you have a database module I don’t want to keep on importing certain files every time so I collate all module imports and export them in a common database module file
08:55:17FromDiscord<evoalg> Nice thank you Rika. I can put personal procs I've made into a file and import them (as long as I use the in the right places), but when would I put them into a github module like ElegantBeef did with slicterator ?
08:55:35FromDiscord<Elegantbeef> When you want to easily distribute them
08:55:58FromDiscord<Rika> If you want to share πŸ˜›
08:56:04*PMunch joined #nim
08:56:10FromDiscord<Elegantbeef> Well or want to easily develop/depend on it πŸ˜€
08:56:18FromDiscord<evoalg> nice I understand (or I'm starting to)
08:56:23FromDiscord<Rika> You don’t need to put it in GitHub for that
08:56:37FromDiscord<Rika> Could just make it a local git repo
08:57:19FromDiscord<evoalg> I'll try and keep things simple for as long as I can πŸ˜‰
08:57:37FromDiscord<Rika> Whatever floats your boat I guess
08:57:45FromDiscord<Rika> I tend to do as complex as I can handle to learn stuff
08:59:19FromDiscord<evoalg> hehe this is just a bit overwhelming ... but yea I was all intent on splitting code and using includes, but now I'll use imports, and for large bits of code I can fold it away (something I've never used before if you can believe it)
08:59:36FromDiscord<evoalg> (I've never used folds before neovim)
09:02:42FromDiscord<Rika> Most people haven’t used it afaik
09:03:03FromDiscord<Elegantbeef> You can fold code?! πŸ˜›
09:03:18FromDiscord<Elegantbeef> I dont tend to fold code unless i'm debugging and need to really clear my mind
09:04:28FromDiscord<Rika> I tend to fold code when it is larger than a few lines
09:04:32FromDiscord<Rika> Let’s say 20
09:04:51PMunchI tend to fold mine into nice little paper crane
09:04:51FromDiscord<impbox> i usually find folding more annoying than not using it
09:05:06FromDiscord<Elegantbeef> Dont lie pmunch, i've seen your code πŸ˜›
09:05:17PMunchHehe
09:05:47*notchris quit (Ping timeout: 264 seconds)
09:05:59FromDiscord<evoalg> I don't know why I'm laughing so much at that, I must be tired
09:06:07FromDiscord<Rika> Folding gets useful when you’re at a few thousand lines really
09:06:14FromDiscord<Rika> It’s pretty funny
09:06:30*notchris joined #nim
09:06:43FromDiscord<Elegantbeef> I'm a fantastic comedian, atleast people laugh at my face
09:07:18PMunchThat's true comedy, making people laugh without even opening your mouth
09:09:58FromDiscord<impbox> image.png https://media.discordapp.net/attachments/371759389889003532/908282393679499284/image.png
09:10:04FromDiscord<impbox> i do like this kind of thing to help me navigate around
09:10:18FromDiscord<Elegantbeef> You dont like const blocks do you?
09:10:21FromDiscord<impbox> i find it more helpful than folding
09:10:26FromDiscord<Rika> Or import blocks
09:10:34FromDiscord<impbox> i should get into the habit of using blocks for things
09:10:36FromDiscord<impbox> i just never think of it
09:10:57FromDiscord<Rika> Thankfully it’s easy if they’re in a line like that
09:11:26FromDiscord<Rika> Just put the first one in a new line then replace every other occurrence of β€œconst” with a space
09:11:26FromDiscord<impbox> i guess i just duplicate line and change
09:11:48FromDiscord<Rika> Ah I guess the multi line ones need an indent too
09:11:48FromDiscord<Elegantbeef> Let's bike shed about other stuff!
09:12:05FromDiscord<Rika> Use an enum for those sfx values smh
09:12:32FromDiscord<Rika> Etc hehe
09:12:33FromDiscord<impbox> mmm i did use an enum in the past with a converter
09:12:39FromDiscord<impbox> i forget why it switched to consts
09:12:41FromDiscord<Rika> You do it beef I’m mentally dead
09:12:51FromDiscord<Elegantbeef> you dont need a converter, you just do it `$yourEnum`
09:13:17FromDiscord<impbox> i'm passing them to procs that take an int
09:13:30FromDiscord<Rika> Then just make it take an enum instead hehe
09:13:31PMunchThen `.int` them?
09:13:35PMunchOr that :P
09:13:36FromDiscord<Rika> If you can’t use ord
09:13:43FromDiscord<Elegantbeef> using `self` for all your procedures!
09:13:46FromDiscord<impbox> the procs are in another module
09:13:49FromDiscord<Elegantbeef> That's a paddlin
09:13:56FromDiscord<Rika> Self is fine IMO but I don’t like it
09:14:19FromDiscord<Elegantbeef> i prefer `thisFuckingInstanceIsItself`
09:14:21PMunchI kinda like self when code is organised like this. Makes it more obvious what's going on, same as `result` in a way
09:14:23FromDiscord<impbox> my sidebar thing uses `self` to know which type to associate it with
09:14:49FromDiscord<impbox> so i can easily look up functions by their main type
09:14:52FromDiscord<Elegantbeef> I prefer a slightly more informative variable but to each their own
09:15:03*PMunch looking at newIngredient
09:15:06FromDiscord<impbox> eg `draw(cat: Cat)` ?
09:15:12FromDiscord<Elegantbeef> Hell yea!
09:15:59FromDiscord<Rika> In reply to @impbox "my sidebar thing uses": The main type is always the first one though?
09:16:03NimEventerNew thread by Markspanbroek: Dot-like operations and calls, see https://forum.nim-lang.org/t/8610
09:16:11FromDiscord<impbox> yeah it has special cases for `new` and `init` based on their return type
09:16:25FromDiscord<impbox> @Rika\: not always
09:16:49FromDiscord<Rika> Then those procs are wrong smh
09:16:55FromDiscord<Rika> I kid, example?
09:17:24FromDiscord<impbox> hmm i forget, but i'm sure i encounter them from time to time and get annoyed
09:17:35FromDiscord<impbox> in think mostly from stdlib
09:18:04FromDiscord<impbox> or maybe i'm just tripping
09:19:48FromDiscord<impbox> ohh that's the reason it's using self not first argument, sometimes it shouldn't be linked to the type of the first argument
09:20:11FromDiscord<impbox> eg. `gameUpdate(dt: float32)` shouldn't be listed under float32
09:20:14FromDiscord<Rika> Ah I can see that
09:20:50FromDiscord<impbox> `proc drawTextBubble(origin: Vec2i, text: string, color: int, offset = vec2i(0,-4), bg = 7, step = -1) =`↡and shouldn't be listed under `Vec2i`
09:21:19FromDiscord<impbox> by making the ones that should be listed under their type use `self` it knows how to display them in a nice way
09:23:05FromDiscord<Rika> Well I guess I would name it the same as my type so β€œcontainer: Container”
09:23:13FromDiscord<Rika> So that would be what I would use to group with
09:23:34PMunchAah I see, that's actually pretty clever. Can we get this for the official documentation as well? :P
09:23:52*notchris quit (Read error: No route to host)
09:23:52FromDiscord<impbox> it's such a pain finding which procs are for which type
09:23:56FromDiscord<impbox> though less useful for generics
09:23:59*notchris joined #nim
09:24:12FromDiscord<impbox> @Rika\: could probably be done, though the regex would be even more messy \>\_\<
09:24:26FromDiscord<Rika> Wouldn’t be regular anymore
09:24:27FromDiscord<Elegantbeef> Well i feel like it's subjective, but using a pragma might be more appropriate
09:25:01FromDiscord<impbox> i want it to not be invasive, other than the kind of naming i'd use anyway
09:25:31FromDiscord<Rika> Ngl would say the pragma would look ugly as fuuuuck
09:25:39FromDiscord<Elegantbeef> Like the docgen could look for a `{.self: paramName.}` then attach that procedure to that type in a nice list, given we have free standing procedures
09:25:56FromDiscord<Elegantbeef> I dont deny it
09:26:22FromDiscord<impbox> maybe something in the doccoments
09:26:37FromDiscord<impbox> `## listUnder:string`
09:27:12FromDiscord<Rika> Ngl kinda feel we need a more structured doc comment scheme
09:27:16FromDiscord<Rika> Would be easier for tooling
09:27:28PMunchOh please god no
09:27:39FromDiscord<Rika> No I don’t mean the shitty one
09:27:45FromDiscord<Rika> You know not like javadoc or whatever
09:27:54FromDiscord<Rika> Something much nicer whilst still being structured
09:27:56PMunchStructured doc comments are such a pain. People never do them properly, and then they drift away from what they're documenting which just makes matters worse..
09:28:39FromDiscord<Rika> I see
09:29:01FromDiscord<Rika> Maybe structured things should be either a pragma or macro I guess
09:29:15PMunchWhat I would like though is argument references. So you can do things like "Argument `myarg` takes a value to be printed" and the compiler will complain if you rename `myarg` without renaming it in your documentation
09:29:48FromDiscord<Rika> Eh
09:47:27*mjsir911 quit (Quit: Goodbye, World!)
09:48:25*mjsir911 joined #nim
09:57:54*pch quit (Remote host closed the connection)
09:58:12*pch joined #nim
11:34:11*krux02 joined #nim
11:36:16PMunchIs `repr` broken in 1.6.0?
11:36:18PMunchError: ambiguous call; both repr_v2.repr(x: uint64) [proc declared in /home/peter/.choosenim/toolchains/nim-1.6.0/lib/system/repr_v2.nim(19, 6)] and repr_v2.repr(x: ref T or ptr T) [proc declared in /home/peter/.choosenim/toolchains/nim-1.6.0/lib/system/repr_v2.nim(133, 6)] match for: (uint16)
11:51:26FromDiscord<Rika> Why do those match what
11:56:04PMunchBeats me
12:06:02*supakeen quit (Quit: WeeChat 3.3)
12:06:32*supakeen joined #nim
12:38:21FromDiscord<hmmm> hai nimblets I finally finished my small utility that connects to the web takes some data, does some google level magic calculation and spits out data in csv or html form. Now I kind of want to put this thing on some thingy-like server and execute it every hour. What is the most for dummies way of doing it for a dude that never touched web in his life? Possibly using nim since I hate every single lang out there except python
12:39:15FromDiscord<Rika> uh
12:39:19FromDiscord<Rika> good luck
12:39:24FromDiscord<hmmm> ha!
12:39:33FromDiscord<Rika> i can think of a few ways but its kinda
12:39:35FromDiscord<Rika> lol
12:39:37FromDiscord<Rika> not easy
12:39:42FromDiscord<hmmm> I knew it was impossible πŸ˜’
12:39:47FromDiscord<Rika> its not
12:39:55FromDiscord<Rika> oh maybe you can use heroku
12:39:58FromDiscord<Rika> not that i know how to
12:40:00FromDiscord<Rika> but its an option
12:40:59FromDiscord<hmmm> I do not like the not easy implication πŸ€”
12:41:45FromDiscord<hmmm> heroku seems ovekill tbh 😬
12:45:37FromDiscord<Rika> where do you want to run this then
12:45:41FromDiscord<Rika> on your desktop?
12:45:44FromDiscord<Rika> or like on a webserver
12:45:49FromDiscord<Rika> because that was not clear to me
12:46:06FromDiscord<Rika> if its not on your desktop then its not getting any simpler than heroku i would say
12:47:31FromDiscord<hmmm> well I can, but I should leave the desktop up, I wanted to put this crap on a serverthingy if it wasn't an enormous hassle, even a raspberry thingy I think
12:50:21FromDiscord<Rika> well i guess it can be simple as uh
12:50:24FromDiscord<Rika> boot raspi
12:50:26FromDiscord<Rika> put program
12:50:28FromDiscord<Rika> make crontab
12:50:30FromDiscord<Rika> done
12:50:38NimEventerNew thread by Oyster: When will nimble be ready for new/nightly nim?, see https://forum.nim-lang.org/t/8611
12:50:55FromDiscord<Rika> does this program have a webserver
12:51:14FromDiscord<hmmm> that's what I want rika, but can people other than me access it?
12:51:29FromDiscord<Rika> In reply to @Rika "does this program have": i asked that
12:51:32FromDiscord<Rika> so you want it to do that
12:51:44FromDiscord<hmmm> yea
12:51:49FromDiscord<Rika> you're gonna have a hell of a time then i would say, if you dont want to try heroku
12:53:16FromDiscord<Rika> sent a long message, see https://paste.rs/Y5w
12:53:31FromDiscord<Rika> (afaik most ISPs are using cgnat?)
12:56:17FromDiscord<hmmm> money is not a problem in general but still if the data served is minimal and the usecase is minimal too I expect to find a solution with appropriate costs, otherwise I can just call someone and pay him to do it for me. Since it's just an hobby project I wanted to DIY
12:57:09FromDiscord<Rika> i assume its a very cpu-lax program so its prolly gonna cost like idk 2 dollars a month if you try hard to look for the provider
12:57:21FromDiscord<Rika> (for bare metal, i mean)
12:57:29FromDiscord<Rika> im no pro at managed providers so i dont know their pricing
12:57:42FromDiscord<Rika> but they tend to bill per every single factor you can think of
12:57:55FromDiscord<hmmm> ye like 50$ year are not a problem lol, but if it's an hassle to do it, it is
12:58:05FromDiscord<Rika> (think money per data uploaded to user)
12:58:28FromDiscord<Rika> my internet is slow, im downloading a windows iso
13:08:24FromDiscord<Rika> well idk why do you think heroku is overkill
13:14:36FromDiscord<hmmm> don't know, I went to the site and seemed like something a small business would use, there is a get started guide and it seems to imply I need to use python/django
13:14:53FromDiscord<Rika> no you do not
13:15:02FromDiscord<Rika> many individuals use heroku
13:15:32FromDiscord<Rika> bare metal servers are even more "something a small business would use"
13:17:06FromDiscord<Benjamin> By 'bare metal,' do you mean a dedicated server or VPS?
13:18:26FromDiscord<Rika> perhaps it is the wrong word, i mean unmanaged
13:22:59FromDiscord<Benjamin> AlphaVPS is the cheapest VPS provider I know if you need a decent amount of space and have low RAM and CPU requirements\: https://alphavps.com/storage-vps.html
13:24:27PMunchThe more I think about this the more I appreciate my server at the university..
13:28:20FromDiscord<dom96> Why? VPS' are awesome
13:31:12PMunchWell what I have is a VPS, but I know the people who run the underlying servers so I can get them to fix things (or get the keys to the castle and fix them myself). And maybe best of all, I don't pay for it :P
13:32:41FromDiscord<Rika> pay
13:33:12PMunchHuh?
13:33:17FromDiscord<Rika> uh
13:33:21FromDiscord<Rika> my internet fucked itself
13:33:49FromDiscord<Rika> i was gonna say the pay part but only one of the messages (the correction) seems to have sent
13:34:19PMunchHmm, on IRC it just looks like you wrote the word "pay"
13:34:56FromDiscord<Rika> i know
13:35:01FromDiscord<Rika> discord didnt send my other message
13:37:20*rockcavera joined #nim
13:37:21*rockcavera quit (Changing host)
13:37:21*rockcavera joined #nim
13:40:50*ormiret quit (Ping timeout: 260 seconds)
13:40:51*notchris quit (Read error: Network is unreachable)
13:40:57*LyndsySimon quit (Read error: Connection reset by peer)
13:41:01*euantorano quit (Ping timeout: 256 seconds)
13:42:28*robertmeta_ joined #nim
13:42:30*robertmeta quit (Ping timeout: 268 seconds)
13:42:31*robertmeta_ is now known as robertmeta
13:42:48*LyndsySimon joined #nim
13:43:03*ormiret joined #nim
13:43:31*euantorano joined #nim
13:43:35*notchris joined #nim
13:43:41*rockcavera quit (Remote host closed the connection)
13:47:40*rockcavera joined #nim
13:47:40*rockcavera quit (Changing host)
13:47:40*rockcavera joined #nim
13:55:44*arkurious joined #nim
13:59:04*oddish quit (Quit: nyaa~)
14:02:45NimEventerNew thread by Deech: How do I inject a NimNode directly instead of going through a macro or template?, see https://forum.nim-lang.org/t/8612
14:17:25*robertmeta quit (Ping timeout: 250 seconds)
14:17:32*notchris quit (Ping timeout: 240 seconds)
14:18:02*euantorano quit (Ping timeout: 240 seconds)
14:19:09*ormiret quit (Ping timeout: 250 seconds)
14:19:35*LyndsySimon quit (Ping timeout: 250 seconds)
14:22:58*euantorano joined #nim
14:23:21*LyndsySimon joined #nim
14:23:24*robertmeta joined #nim
14:23:44*ormiret joined #nim
14:34:09*notchris joined #nim
14:35:37*SebastianM joined #nim
14:38:07SebastianMHi, is there a way to pass to function variable number of keyword arguments? Like in python **kwargs?
14:38:57*SebastianM quit (Client Quit)
14:40:35FromDiscord<dom96> don't think so, you'd need a macro
14:40:49FromDiscord<dom96> we have `varargs` but no equivalent for kw args. Could be a nice addition
14:42:04PMunchWhat does kwargs do differently from varargs?
14:43:58*SebastianM joined #nim
14:48:03SebastianM@dom96 Thank you
14:50:36SebastianM@PMunch I just wanted to fire up function with f(name="Seba", lang="Nim") and get it like varargs
14:50:55PMunchAah I see
14:51:06PMunchNo that has to be a macro as dom said
14:51:17PMunchYou might just want to pass it a tuple though..
14:51:29PMunchOr you know, name your arguments properly :P
14:57:48SebastianM@PMunch I'll check the tuple way. Thank you
14:58:27PMunchHmm, it won't really do what you want though I think
14:59:03*pro quit (Quit: WeeChat 3.3)
15:02:02FromDiscord<dom96> proc f(data: (string, string)) = ...; f({"name": "Seba", "lang": "Nim"})
15:02:12FromDiscord<dom96> that's another option since Nim supports this syntax for tuples
15:06:27SebastianM@dom96 Haven't though about that. Thank you once again
15:08:40*SebastianM quit (Quit: Bye)
16:07:29*PMunch quit (Quit: leaving)
16:17:02*riceman_ joined #nim
16:17:18*riceman_ quit (Client Quit)
16:30:18*neurocyte0132889 quit (Quit: The Lounge - https://thelounge.chat)
16:35:04FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=3EHO
16:36:11*xet7 quit (Remote host closed the connection)
16:37:09*xet7 joined #nim
16:38:53*krux02_ joined #nim
16:40:12*Vladar joined #nim
16:40:55*krux02__ joined #nim
16:41:29*krux02 quit (Ping timeout: 264 seconds)
16:43:27*krux02_ quit (Ping timeout: 250 seconds)
16:46:29*krux02__ quit (Ping timeout: 250 seconds)
16:51:00*krux02 joined #nim
17:02:48FromDiscord<demotomohiro> `rand` proc in your code reads and modify same variable in random module.
17:06:27FromDiscord<demotomohiro> Create `Rand` with `initRand()` in each thread and use it.
17:06:51FromDiscord<Rika> they mean that the code compiles but should not
17:22:32FromDiscord<demotomohiro> Nim forbids threads sharing heap memory, but allows writing a same global variable...
17:29:19Amun-RaPragma mismatch: got '{.locks: 0.}', but expected '{.locks: 0.}'.
17:29:25Amun-RaI love these kinds of errors
17:31:01nrds<Prestige99> Was that the whole error?
17:32:00Amun-Ra{.gcsafe, locks: 0.} vs {.closure, gcsafe, locks: 0.}
17:32:10*neurocyte0132889 joined #nim
17:32:10*neurocyte0132889 quit (Changing host)
17:32:10*neurocyte0132889 joined #nim
17:32:19nrds<Prestige99> The erorr is probably about closure
17:32:31nrds<Prestige99> error*
17:34:25Amun-Rayes, I removed raise of ValueError with "not yet implemented" and it worked ;>
17:46:04*rockcavera quit (Remote host closed the connection)
18:06:48FromDiscord<dom96> In reply to @reilly "Shouldn't this code be": don't you get a warning for this?
18:07:19FromDiscord<Rika> i tried it, you dont
18:11:29FromDiscord<dom96> Oh. You only get the gc safety warnings when it’s a ref
18:24:50FromDiscord<LilTuxie> why can't I convert a BigInt to int32? I tried it with this and it doesn't work. `int32(BigInt.pow(int32) mod int32)`
18:25:12FromDiscord<LilTuxie> (replaced variables with their types)
18:26:37FromDiscord<konsumlamm> it would have to be builtin for that syntax to work
18:27:02FromDiscord<konsumlamm> and in general, you don't know if it would fit into 32 bits
18:28:16FromDiscord<LilTuxie> it will because `mod int32` can't be more than 32 bits
18:28:34FromDiscord<LilTuxie> so is there a way to make it work?
18:30:10FromDiscord<konsumlamm> apart from the fact that you can't do `x mod int32`, the compiler doesn't know that
18:31:55FromDiscord<konsumlamm> you could convert it to a string and then parse that, but that's an ugly hack
18:33:17FromDiscord<LilTuxie> i'd rather not do that. I'll just convert my functions argument from int32 to BigInt
18:42:37Amun-Rawhat would mod int32 even mean?
18:45:29FromDiscord<konsumlamm> `mod (int32.high.uint32 + 1)` presumably
18:46:23FromDiscord<konsumlamm> tl;dr seems there is no function to turn a `BigInt` into some standard int, you may wanna open an issue about that
18:48:02*PMunch joined #nim
18:49:16FromDiscord<konsumlamm> a conversion could also just cut off the higher bit, so the modulo operation wouldn't even be necessary
18:58:07FromDiscord<Rika> he said `(replaced variables with their types)`
18:58:34FromDiscord<Rika> so `int32(<BigInt>.pow(<int32>) mod <int32>)`
19:27:41FromDiscord<reilly> In reply to @dom96 "Oh. You only get": Shouldn't this still be unsafe though?
19:30:00FromDiscord<Recruit_main707> its a race condition, its not unsafe perse is it?
19:35:07FromDiscord<dom96> In reply to @reilly "Shouldn't this still be": Might be worth starting a discussion about it on the forum
19:36:44FromDiscord<Recruit_main707> what should the warning be, and how easy it would be to implement it
19:44:25FromDiscord<reilly> Well, I imagine that practically speaking, reading/writing to an integer is fast enough that the likelihood of a race condition is very very low... but not zero. Maybe give us a compiler warning, but let us disable it with a pragma as a way of saying "I understand there is a small risk, now do as I say!"
19:45:06FromDiscord<Recruit_main707> if its a warning you dont need a flag since it will compile it anyways
19:45:10FromDiscord<konsumlamm> i think the main problem is not that two writes might happen at exactly the same time
19:45:31FromDiscord<konsumlamm> but rather that functions use old values of the variables
19:46:13FromDiscord<konsumlamm> e..g. if you have n threads that all add 1 to some variable (that is initially 0), the end result is not necessarily n
19:49:11FromDiscord<konsumlamm> "i understand there is a small risk" doesn't sound like you really understand tbh (a bug that only has a small chance of occuring is even worse), the point of such a pragma would be "i'm sure this is safe, eventhough the compiler doesn't know"
20:03:45FromDiscord<reilly> sent a long message, see http://ix.io/3EJ2
20:03:50*kenran joined #nim
20:22:22*rockcavera joined #nim
20:22:22*rockcavera quit (Changing host)
20:22:22*rockcavera joined #nim
20:38:42*xet7 quit (Remote host closed the connection)
20:39:29*xet7 joined #nim
21:09:23*Pyautogui joined #nim
21:13:54*neurocyte0132889 quit (Ping timeout: 268 seconds)
21:15:49*Pyautogui quit (Quit: Connection closed)
21:18:20PMunchRendering episode 4 of the keyboard firmware series!
21:19:16supakeenlink?
21:20:11nrds<Prestige99> \o/
21:21:46PMunchI mean it's rendering, so it's not uploaded yet, and so no link :P
21:22:47PMunchIt'll be added to this playlist though once it's done: https://www.youtube.com/playlist?list=PL9Yd0XwsGAqwzBkhRNT_H2gsedNcCh4Pw
21:23:05PMunchBut it's going to take about an hour to render. And it's getting late. So I'll probably upload it tomorrow morning
21:24:11FromDiscord<Elegantbeef> Content with content πŸ˜›
21:25:26PMunchUgh, I just looked at the other episodes I've recorded.. Not looking forward to edit nr. 6.. It's almost six and a half hours long, and the first hour I was muted -_-
21:25:55FromDiscord<Elegantbeef> Ah so you mean only the first hour is watchable
21:26:12FromDiscord<Elegantbeef> I could not help myself
21:27:11PMunchHaha :P
21:27:42FromDiscord<Elegantbeef> You say haha but i can hear the crying from here
21:28:18PMunchNot at all, people actually seem to prefer my audio to my videos :P
21:28:49FromDiscord<Elegantbeef> Well the accent is calming, when it's not screaming "viking"
21:29:27FromDiscord<Elegantbeef> I'm currently taking a break from fighting with framebuffers, so where the hell are all the Nim questions?!
21:30:49PMunchAccent? Believe me you don't want the Norwegian accent
21:30:58PMunchOooh, Nim questions! I know this
21:31:16PMunchWhat is the benefit of style insensitivity?
21:31:42PMunchSince Nim uses C as a backend, does that mean it's a transpiler?
21:32:04PMunchCan I program Nim with brackets instead of indentation? I don't like whitespace
21:32:17PMunchOh, and if I do want to use whitespace, can I use tabs?
21:32:46FromDiscord<Elegantbeef> Lol
21:33:01PMunchI really like Nim, just a shame that it uses a GC..
21:33:07PMunchDid I miss anything? :P
21:33:17FromDiscord<Elegantbeef> Oh there's evo πŸ˜›
21:33:39FromDiscord<evoalg> You called? πŸ˜‰ Some people use `1..5` and some use `1 .. 5` ... it's just a matter of preference?
21:34:09FromDiscord<Elegantbeef> Why is my program slower than python?
21:34:31FromDiscord<evoalg> my question was serious!
21:34:37FromDiscord<Elegantbeef> i use `a..b` when there is no math, if there is math i do `a .. 1 +5`
21:34:50PMunch@evoalg, was that actually a question? It's mostly preference, although I think the official styleguide is to use the spaces variant
21:35:09PMunch`a .. 1 +5`... You psycho
21:35:18FromDiscord<Elegantbeef> i edited it
21:35:24FromDiscord<Elegantbeef> `a .. 1 + 5` dumbo
21:36:06PMunchHaha :P
21:36:08nrds<Prestige99> I usually wrap mine in parens if anything else is nearby
21:36:26nrds<Prestige99> but nobody likes the way I do things so :P
21:36:28FromDiscord<evoalg> thank you ... and some for `1 ..< 5` vs `1..<5` vs `1 .. <5` I guess
21:36:31FromDiscord<Elegantbeef> Well it's ok to be wrong prestige, just as long as you admit it
21:36:36nrds<Prestige99> Lol
21:37:13FromDiscord<Elegantbeef> Yep it's mostly preference but mine is right
21:37:48FromDiscord<evoalg> I had `a -1` in my and it took me ages to figure out what was wrong (being new to nim)
21:38:16FromDiscord<Elegantbeef> unary operators!
21:39:06FromDiscord<evoalg> I didn't understand why the compiler error message was saying I was trying to call a
21:39:21FromDiscord<evoalg> but in hindsight it obvious
21:40:16PMunchHaha, yeah the Nim syntax is sometimes so lenient that error messages can be a bit confusing :P
21:41:30FromDiscord<evoalg> `a -1` in python subtracts 1 ... but yea it's bad practice
21:42:36FromDiscord<Elegantbeef> Yea it's very ambiguous
21:43:08FromDiscord<evoalg> Elegantbeef I was looking at your elegant slicterator and I see you cunningly have an iterator call an iterator ... but does that use extra mem?
21:43:16FromDiscord<Elegantbeef> Nope
21:43:20FromDiscord<Elegantbeef> Iterators expand at compile time
21:43:25FromDiscord<Elegantbeef> non closure ones atleast
21:43:34FromDiscord<evoalg> oh that's soo cool
21:44:00FromDiscord<evoalg> what is non closure? ... is it meta programing that I'm not up to yet?
21:44:59FromDiscord<Elegantbeef> closure iterators are iterators that capture their initialization values
21:45:27PMunchIf you need to ask you probably don't need to worry about them
21:46:54FromDiscord<Elegantbeef> For a shitty example https://play.nim-lang.org/#ix=3EJy
21:47:01FromDiscord<Elegantbeef> But yea like pmunch said no need to worry
21:47:25FromDiscord<impbox [ftsf]> closure iterators can capture state and then you can call them at your leisure or pass them around as variables
21:47:33FromDiscord<impbox [ftsf]> Pretty cool
21:47:50FromDiscord<impbox [ftsf]> I use them like coroutines
21:47:51PMunchFun fact, it's also how async is implemented in Nim
21:50:35FromDiscord<Elegantbeef> That wasnt too fun, i want a refund
21:52:20PMunchWell it was free..
21:52:42FromDiscord<Elegantbeef> Free things can be good, all the software i use is free! 😜
21:52:53PMunchAll?
21:53:31*kenran quit (Quit: WeeChat info:version)
22:01:16FromDiscord<Elegantbeef> Yep
22:04:10FromDiscord<dom96> sent a code paste, see https://play.nim-lang.org/#ix=3EJM
22:07:55FromDiscord<evoalg> I'm confused ... I get subtraction when I do that in python
22:08:11PMunchI guess it depends on what `a` is defined as
22:08:27FromDiscord<dom96> yeah, I assigned a function to `a`
22:08:40PMunch>>> a = 10
22:08:40*vicecea quit (Remote host closed the connection)
22:08:40PMunch>>> a -1
22:09:06FromDiscord<evoalg> ah! ... trying to confuse me ... you'll find it's not difficult πŸ˜‰
22:09:12*vicecea joined #nim
22:11:53FromDiscord<evoalg> ElegantBeef I see with that closure example you gave: https://play.nim-lang.org/#ix=3EJy ... I can't do `echo doThing(5)` or `echo doThing()(5)` ... I have to assign the closure iterator to a variable first?
22:14:28FromDiscord<Elegantbeef> Yea afaik when you do `var a = doThing` it instantiates the iterator so if you want to do it on one line you'd have to do `echo (var a = doThing; a(5))`
22:14:39FromDiscord<dom96> heh, PMunch's messages come through as "quotes" on Discord
22:14:45FromDiscord<Elegantbeef> I dont use closures much so i could be wrong about the semantics there
22:14:58FromDiscord<Elegantbeef> Well he did quote
22:15:05FromDiscord<Zoom> You're not
22:15:13PMunchThe messages starting with `>>>` ?
22:15:14FromDiscord<Elegantbeef> Thanks Zoom
22:15:20FromDiscord<dom96> PMunch: yeah
22:15:43FromDiscord<Elegantbeef> yea `>` is the quote in element/discord
22:15:46PMunchGuess that makes sense, just the bridge trying its best :P
22:16:30FromDiscord<dom96> I often wonder why closure iterators don't have a clearer way of initialisation
22:16:44FromDiscord<Zoom> [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org)\: any idea on how to add `pairs` to your slierators?
22:16:54FromDiscord<Elegantbeef> What type of pairs
22:16:58FromDiscord<Zoom> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/908480390484856892): [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org)\: any idea on how to add `pairs` to your slicerators?
22:17:52FromDiscord<Zoom> immutable and mutable? \:P
22:18:16FromDiscord<evoalg> gosh Elegantbeef you might have to fix that module name if people are actually going to start using it
22:18:16FromDiscord<Elegantbeef> Well i can make a macro for mutable pairs
22:18:34FromDiscord<Elegantbeef> slicerator is probably the better name
22:18:46FromDiscord<Elegantbeef> sliceterator is too silly
22:19:09FromDiscord<evoalg> it grows on me after a while πŸ˜‰
22:19:30FromDiscord<Elegantbeef> But i did fix the repo name so it should be fine now
22:19:49FromDiscord<Elegantbeef> Remember Zoom we cannot do `(int, var T)` but a macro can
22:19:56FromDiscord<Elegantbeef> So yea i'll throw in some macros for that
22:20:51FromDiscord<Zoom> Yeah, I figured there's no room for much improvement besides macros.
22:22:07FromDiscord<evoalg> when I uninstall and install it, it still says "Success: slicterator installed successfully."
22:22:54FromDiscord<Elegantbeef> Lol
22:22:56FromDiscord<Zoom> I like and don't like how conservative Nim is with all those suggestion and PRs for iterators and such by Timothee.
22:23:23FromDiscord<Elegantbeef> I mean iterable is a mess imo
22:23:28FromDiscord<Elegantbeef> Its a nice idea but poorly implemented
22:23:58FromDiscord<Zoom> It's something and the scope is limited, so at least not much damage
22:24:00PMunchOkay, video is finished rendering now, and uploading to YouTube. Should go live once it's ready
22:24:30FromDiscord<evoalg> I also have to `import slicterator` as `import slicerator` doesn't work ... would my system be caching the old one with the wrong name?
22:24:55FromDiscord<Elegantbeef> Well sliceterator is the name of the module
22:25:01FromDiscord<Elegantbeef> Look at the git url and the module in `src`
22:25:14FromDiscord<Elegantbeef> I will be changing it to slicerator since i prefer that happy accident
22:25:24FromDiscord<Elegantbeef> But i'm still dicking around with framebuffers
22:27:15PMunchNow I really have to go to bed..
22:27:50FromDiscord<evoalg> I played with `rfind` in slicerator and maybe it should maybe be named `rfindAll` as I think the `re` module has findAll to return all the instances??
22:28:23FromDiscord<Elegantbeef> Just dont use regex like a sane person πŸ˜›
22:28:26FromDiscord<Elegantbeef> I'm kidding of course
22:33:18FromDiscord<Elegantbeef> The names arent ideal either, so yea will probably change it
22:35:44PMunchSo I should use regex like an insane person?
22:37:40FromDiscord<evoalg> my Perl days meant I fell in love with regex's
22:37:54FromDiscord<zentoad> Is there a way to use a C++ class that takes std::vector?
22:44:12PMunchVideo seems to be up now. And I'm off to bed! It's not super interesting unless you're interested in macros, microcontrollers, and/or keyboards though..
22:44:13PMunchhttps://www.youtube.com/watch?v=4lyGYD0C1qQ
22:44:25FromDiscord<Elegantbeef> Buh bye
22:44:30PMunchBye
22:44:33*PMunch quit (Quit: leaving)
22:46:26*Vladar quit (Quit: Leaving)
22:51:12FromDiscord<evoalg> non-closure iterators calling non-closure iterators don't use extra mem, but proc's do right? Each time a proc is called it will assign mem for that proc etc, whereas non-closure iterators are expand inline to the code that called it at compile time ... have I got that right?
22:52:19FromDiscord<Elegantbeef> Yes
22:52:29FromDiscord<evoalg> Thank you!
22:54:04FromDiscord<Elegantbeef> `template` `macro` and non closure `iterator` are expanded at the call site at compile time so you can do 0 cost abstractions there
22:54:23FromDiscord<Elegantbeef> inb4 "There are no 0 cost abstractions" gang shows up
22:54:50FromDiscord<tandy> is it possible to make nim bindings for a typescript project?
22:55:07*stkrdknmibalz joined #nim
22:55:42FromDiscord<Elegantbeef> There is an (abandoned?) typescript to nim transpiler but nope you cannot just do TS \<-\> Nim since nim doesnt know about TS
23:00:11FromDiscord<logo> Once PMunch comes back up, I need to talk to him about keyboards lmao.
23:02:05FromDiscord<PMunch> Did someone say keyboards?
23:02:58FromDiscord<evoalg> So an iterator is good for low mem and probably some faster code too right? .. but other than that, everything an iterator can do a proc can do??
23:03:24FromDiscord<logo> In reply to @PMunch "Did someone say keyboards?": Mechanical keyboard nerd here!
23:04:00FromDiscord<logo> opens spreadsheet
23:04:17FromDiscord<logo> https://media.discordapp.net/attachments/371759389889003532/908492359262679070/unknown.png
23:04:34FromDiscord<logo> Not too much rn
23:04:40FromDiscord<PMunch> Oh damn!
23:04:55FromDiscord<logo> Been in the hobby for like two years now?
23:04:58FromDiscord<tandy> https://github.com/mcclure/dts2nim
23:05:00FromDiscord<tandy> https://github.com/bung87/ts2nim
23:05:04FromDiscord<PMunch> Still way more than my single board πŸ˜‹
23:05:07FromDiscord<tandy> i found these
23:05:09FromDiscord<logo> Ah we should move to #offtopic
23:07:04FromDiscord<tandy> nice↡(@logo)
23:07:10FromDiscord<tandy> have you guys seen the dactyl generator josh reve is building?
23:07:11FromDiscord<tandy> https://github.com/joshreve/dactyl-keyboard
23:07:31FromDiscord<tandy> hmm yes↡(@logo)
23:07:42FromDiscord<Elegantbeef> Using iterators over procs generally reduces the memory foot print and reduces allocations increasing performance
23:08:10FromDiscord<Elegantbeef> That doesnt hold true 100% but in cases you're slicing to iterate using Nim's built in `[]` slice proc you're going to get better performance from a proper iterator
23:12:29FromDiscord<evoalg> Thank you!
23:15:21FromDiscord<Elegantbeef> No problem, finally got my framebuffers to work properly!
23:22:28FromDiscord<demotomohiro> But inline iterator always inlining code in call site. Isn't that make your code larger than using proc and affect instruction cache?
23:22:52FromDiscord<Elegantbeef> Oh no larger code, whatever will we do!
23:25:18FromDiscord<Elegantbeef> Yes it makes the binary larger probably, but given that we're comparing `a[3..5]` duplicating a slice then iterating the children vs just iterating over the elements directly there is no issue
23:26:31FromDiscord<demotomohiro> I see
23:31:40FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3EK3
23:31:48FromDiscord<impbox [ftsf]> i thought i'd try that block style syntax
23:32:19FromDiscord<Elegantbeef> Ah you're too good for `import std/[os, strformat, strutils]` i see
23:33:36FromDiscord<Elegantbeef> You just need commas for that one since that's a single import statement
23:33:51FromDiscord<Elegantbeef> Oddly it doesnt support newline seperated ones
23:34:46*rockcavera quit (Remote host closed the connection)
23:41:46*rockcavera joined #nim
23:41:46*rockcavera quit (Changing host)
23:41:46*rockcavera joined #nim
23:41:47FromDiscord<evoalg> In reply to @Elegantbeef "No problem, finally got": Well done!
23:44:57FromDiscord<tandy> im gna try use futhark to wrap this https://github.com/TeamAntumbra/libantumbra
23:50:09FromDiscord<impbox [ftsf]> so a C type has a null terminated array of chars `char szPname[123];` I want to convert this to a nim string, what's the recommended method?
23:50:56FromDiscord<impbox [ftsf]> using $ on it gives me `[82, 111, 108, 97, 110, 100, 32, 68, 1...`
23:51:40FromDiscord<Elegantbeef> If you know the length make a new string of that length and copymem, if you dont know the length iterate over it adding each to the string
23:51:41*mal`` quit (Quit: Leaving)
23:52:17FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3EK4
23:52:28FromDiscord<impbox [ftsf]> I know the size of the array, but it's null terminated so it will be shorter
23:52:56FromDiscord<impbox [ftsf]> i figured i could cast it to a cstring and then $ that, but can't figure out how
23:53:25FromDiscord<impbox [ftsf]> `Error: expression cannot be cast to cstring`
23:53:25FromDiscord<Elegantbeef> should just be `cast[cstring](yourCharStr[0].addr)`
23:53:37FromDiscord<impbox [ftsf]> ` result.add($cast[cstring](caps.szPname))` ahh i was doing this
23:55:44FromDiscord<Elegantbeef> Did the cast to cstring work?
23:55:51FromDiscord<impbox [ftsf]> hmm only gives me the first character
23:56:43FromDiscord<Elegantbeef> Wait is the a reason you dont just wrap it as a cstring?
23:56:56FromDiscord<impbox [ftsf]> i didn't write the wrapper
23:57:08FromDiscord<Elegantbeef> Isnt it for all intents and purposes a cstring
23:57:10FromDiscord<Elegantbeef> Ah
23:57:26FromDiscord<impbox [ftsf]> windows api shit
23:57:33FromDiscord<Elegantbeef> perhaps `$cast[ptr cstring](yourCharStr.addr)[]` though that seems odd
23:58:44*mal`` joined #nim
23:58:49FromDiscord<impbox [ftsf]> https://play.nim-lang.org/#ix=3EK5 mmm it works here
23:58:53FromDiscord<impbox [ftsf]> wonder what's different