00:01:48 | * | Gustavo6046 quit (Read error: Connection reset by peer) |
00:01:49 | arkanoid | nimpy is great for python, futhark is great for C, should I consider nbindgen on same level? |
00:02:14 | arkanoid | I've never used rust in my life, just tutorial to understand what kind of beast it is |
00:02:38 | arkanoid | I'm interested in some scientific libraries written in it |
00:06:42 | * | Gustavo6046 joined #nim |
00:11:52 | noeontheend | From this whole conversation, I guess I'm the oddball--I deeply enjoy writing both Nim and Rust. |
00:18:46 | nrds | <Prestige99> hm this blows that closure iterators can't recurse |
00:18:50 | arkanoid | fighting the borrow checker and the ugly syntax is keeping my away from rust, but apart from that, I do understand the revolution it brings |
00:26:44 | nrds | <Prestige99> Couldn't get any of the macros working for my use case, for some reason |
00:27:15 | FromDiscord | <Elegantbeef> What are you trying to do?↵(<@709044657232936960_nrds=5b=49=52=43=5d>) |
00:27:28 | FromDiscord | <Elegantbeef> Oh right that reply was silly 😀 |
00:30:33 | FromDiscord | <evoalg> In reply to @noeontheend "From this whole conversation,": What do you like about Nim (as compared to Rust)? |
00:30:49 | FromDiscord | <Elegantbeef> Prestige what're you doing! |
00:31:00 | nrds | <Prestige99> https://play.nim-lang.org/#ix=3M6Y |
00:31:06 | FromDiscord | <Elegantbeef> Attempting a recursive iteration over a binary tree? |
00:31:12 | nrds | <Prestige99> yep |
00:31:18 | nrds | <Prestige99> for postorder iteration |
00:35:34 | FromDiscord | <Elegantbeef> Why didnt the for loop macro not work |
00:35:46 | FromDiscord | <Elegantbeef> Or that without a double negative |
00:37:32 | noeontheend | evoalg: It's hard for me to pin down why, but I always tell people Nim fills me with joy. I think a big part is actually the syntactic flexibility--I feel like I can write in whatever style I want to whenever I want to. Another big plus is the stdlib. sequtils and sugar in particular make life very pleasant. |
00:38:08 | nrds | <Prestige99> I tried a few and they failed for different reasons beef, I can try pulling them in again and making a playground |
00:38:38 | nrds | <Prestige99> https://play.nim-lang.org/#ix=3M7b |
00:39:29 | FromDiscord | <evoalg> In reply to @noeontheend "<@900872397224280125>: It's hard for": interesting thank you, and what do you like about Rust (as compared to Nim)? |
00:46:29 | noeontheend | evoalg: Again, I'm struggling to articulate it because I think it's mostly matters of taste. I like how explicit (most) things are in Rust. Without going full Rust-evangelist, it is nice to have memory safety and no GC (don't throw things, I <3 Nim). Then Rust has enough modern features (ADTs, a reasonably powerful type system, various functional niceties, etc.) that I feel like it fits my style well. |
00:46:59 | FromDiscord | <Elegantbeef> well the only thing to throw is that `arc/orc` arent a conventional GC\: P |
00:47:03 | FromDiscord | <Sabena Sema> I find nim way more ergonomic in almost every way than rust |
00:47:25 | noeontheend | I will say that I didn't fully grok the borrow checker for a *long* time. Like, I thought I did, but I only recently realized I didn't. My last few projects in Rust have been much better because I'm finally understanding why things that I thought should work weren't working. |
00:47:44 | FromDiscord | <Elegantbeef> Prestige this is doable without recursion just requires a big ol' think |
00:48:48 | noeontheend | Elegantbeef: Touché, ARC/ORC are really nifty. |
00:48:56 | FromDiscord | <evoalg> In reply to @noeontheend "I will say that": Thank you! |
00:49:15 | FromDiscord | <Sabena Sema> you don't really save much memory with a non-recursive tree visitation |
00:49:25 | FromDiscord | <Sabena Sema> but can save some I guess |
00:49:33 | FromDiscord | <Elegantbeef> Well the issue prestige wants it in an iterator |
00:49:42 | FromDiscord | <Sabena Sema> oh, yeah |
00:49:48 | FromDiscord | <Sabena Sema> in that case make the stack explicit |
00:50:00 | nrds | <Prestige99> oh |
00:50:07 | FromDiscord | <Elegantbeef> Sabena can probably help you make this work better than i |
00:50:52 | FromDiscord | <Sabena Sema> you basically just make a stack, push the root on, then write `while !stack.empty() ...` |
00:51:19 | FromDiscord | <Sabena Sema> visiting the current node is a pop followed by an operation |
00:52:04 | FromDiscord | <Sabena Sema> traversing to the next node is a peek followed by pushing the node then continuing |
00:52:05 | FromDiscord | <Sabena Sema> etc |
00:53:11 | FromDiscord | <Rika> I sleep and the rust thread gains 25 replies |
00:53:13 | FromDiscord | <Rika> Jesus |
00:53:31 | FromDiscord | <Elegantbeef> I slept and it was made and locked with 25 replies 😀 |
00:53:52 | FromDiscord | <Rika> I’ll backread the channel wait |
00:55:45 | FromDiscord | <Sabena Sema> There's almost no reliable evidence that any language reduces overall number of bugs (I think C vs writing assembly has some compelling evidence) |
00:56:32 | FromDiscord | <Sabena Sema> it's plausible that it does, but it's hard to study effectively, most people who do study it don't do very good experimental design, and results so far have not shown much |
00:56:55 | FromDiscord | <Elegantbeef> hey `set[T]` can easily reduce bugs caused by bitwise operations 😛 |
00:57:54 | nrds | <Prestige99> Sabena: so I'd basically build the stack until I reach a leaf node, then yeild the leaves in left, right order? |
00:58:00 | nrds | <Prestige99> That may work.. |
00:58:59 | FromDiscord | <Sabena Sema> yeah you probably want "peak always, then pushes for children (with continue) then yield, then pop" |
00:59:20 | FromDiscord | <Sabena Sema> In reply to @Elegantbeef "hey `set[T]` can easily": it might, it might not |
00:59:33 | FromDiscord | <Sabena Sema> it's plausible that it does |
01:00:00 | FromDiscord | <Elegantbeef> I was mostly joking |
01:01:13 | FromDiscord | <Sabena Sema> it ends up being the same amount of memory basically, but it's heap memory, so you tend to be able to use a lot more |
01:01:35 | FromDiscord | <Sabena Sema> and it's in reality slightly less memory because you don't have to store the return address or frame pointers or whatnot |
01:03:32 | FromDiscord | <Sabena Sema> I do like Araq's quote about round wheels, you can't get a round wheel via incremental improvements |
01:04:13 | FromDiscord | <Sabena Sema> Anyway wrapping rust has the same problem as C++, the abi isn't usually stable |
01:04:22 | FromDiscord | <Sabena Sema> for rust it's worse because the language abi itself is unstable |
01:04:52 | FromDiscord | <Sabena Sema> also: I _hate_ that rust doesn't have any implicit widening conversions |
01:05:14 | FromDiscord | <Sabena Sema> it's like someone saw C's integral promotions (which are _different_) and just decided all widening was bad |
01:05:43 | FromDiscord | <Sabena Sema> imho Rust's standard library _is_ extremely good |
01:08:14 | FromDiscord | <Patitotective> In reply to @Patitotective "Hey <@!392962235737047041>, I'm having": i think i've got the answer, make three different rules, the start of the sequence, the content and the end, so it starts saving the elements in the content until the end |
01:50:59 | * | adigitoleo_ is now known as adigitoleo |
02:02:27 | FromDiscord | <Patitotective> I have an object and I want the `seqRef` field to be a reference to a sequence so if I change that field the sequence changes, but I'm not sure how to set that field to something↵`ref mySeqVar`??↵https://play.nim-lang.org/#ix=3M7u |
02:03:29 | FromDiscord | <Elegantbeef> To have what you want you need to make the seq a reference aswell |
02:04:18 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3M7y |
02:04:33 | FromDiscord | <Patitotective> Oh, that makes sense |
02:04:34 | FromDiscord | <Patitotective> Thanks |
02:04:36 | FromDiscord | <Patitotective> 🙃 |
02:05:27 | nrds | <Prestige99> hmm, @Sabena Sema working on postorder for a binary tree, the only solution I can think of is building the entire stack _first_, then iterating over it and yielding each element. Do you know if there's a way I could do that without this? |
02:05:35 | nrds | <Prestige99> maybe if I had a do while |
02:06:36 | FromDiscord | <dumbmahreeo> Hey, is someone else having trouble cross compiling to ARM64 from x86\_64?↵↵The compilation doesn't fail but the produced binary is still a x86\_64 |
02:07:07 | FromDiscord | <Elegantbeef> how are you attempting to compile it? |
02:09:49 | FromDiscord | <dumbmahreeo> immagine.png https://media.discordapp.net/attachments/371759389889003532/931369484386713660/immagine.png |
02:12:22 | FromDiscord | <Elegantbeef> You did read https://nim-lang.org/docs/nimc.html#crossminuscompilation ? |
02:12:30 | FromDiscord | <dumbmahreeo> yep |
02:14:19 | FromDiscord | <Elegantbeef> compile with `--verbosity:2` to see the command it calls |
02:14:35 | FromDiscord | <Elegantbeef> I swear there is a way to get it to echo the C compiler command but i dont recall |
02:14:37 | * | noeontheend quit (Ping timeout: 240 seconds) |
02:14:46 | FromDiscord | <Elegantbeef> it might be `--listCmd` |
02:15:04 | FromDiscord | <dumbmahreeo> It's quite the output, gonna put it on pastebin |
02:15:13 | FromDiscord | <Elegantbeef> Ah yes `--listCmd` does |
02:15:53 | FromDiscord | <dumbmahreeo> https://pastebin.com/Ay0QwZrE↵↵This is --verbosity\:2 output, gonna try --listCmd now |
02:15:55 | FromDiscord | <Bung> In reply to @PMunch "That is still a": I dont know since it changes main branch, I can assuming my first PR will be merged , then create PRs base on that, If the first PR can |
02:16:20 | FromDiscord | <dumbmahreeo> immagine.png https://media.discordapp.net/attachments/371759389889003532/931371126205055066/immagine.png |
02:16:21 | FromDiscord | <Elegantbeef> I just tried `--arm64` it compiled with no issue but `--arm` threw an error |
02:16:30 | FromDiscord | <Bung> (edit) "can" => "can't not be merged, I just waste of my time." |
02:17:15 | FromDiscord | <dumbmahreeo> Yardanico on the telegram group is telling me that I need a separate C compiler to cross compile |
02:17:31 | FromDiscord | <dumbmahreeo> I've never attempted C or C++ cross compilation so I know nothing about them |
02:17:39 | FromDiscord | <dumbmahreeo> Only time I've tried cross compilation was with Rust and Go |
02:17:48 | FromDiscord | <dumbmahreeo> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/931371419365945355): I've never attempted C or C++ cross compilation so I know nothing about this |
02:17:51 | FromDiscord | <Elegantbeef> Yea you need to get the arm tool chain |
02:17:52 | FromDiscord | <Elegantbeef> It might be in your package manager |
02:18:15 | FromDiscord | <Elegantbeef> Like when i try with `--cpu:arm` i get `/bin/sh: 1: arm-linux-gnueabihf-gcc: not found` |
02:21:03 | FromDiscord | <auxym> hey beef, in your tusb stuff, why are you using `codegendecl: "$1 $2$3"` a lot, instead of say `{.cdecl.}`? |
02:21:29 | FromDiscord | <Elegantbeef> Cant recall atm |
02:21:38 | FromDiscord | <dumbmahreeo> Perhaps the package aarch64-linux-gnu-gcc will do |
02:21:40 | FromDiscord | <Elegantbeef> Think it was related to what they expected |
02:21:41 | FromDiscord | <Elegantbeef> especially `const` |
02:21:49 | FromDiscord | <auxym> k |
02:26:16 | * | neurocyte091709 joined #nim |
02:27:54 | * | neurocyte09170 quit (Ping timeout: 250 seconds) |
02:27:54 | * | neurocyte091709 is now known as neurocyte09170 |
02:28:17 | FromDiscord | <dumbmahreeo> Nope, absolutely nothing changed after installing the package along with all its dependencies (glibc, headers, etc...) |
02:29:22 | FromDiscord | <Elegantbeef> Given that `arm64` doesnt error and produces a binary that runs on amd64 i think there is a misconfiguration with the c compiler |
02:29:24 | FromDiscord | <Elegantbeef> I could be wrong |
02:31:50 | FromDiscord | <auxym> https://nim-lang.org/docs/nimc.html#crossminuscompilation |
02:32:04 | FromDiscord | <Elegantbeef> If only someone didnt link it before! |
02:32:41 | FromDiscord | <dumbmahreeo> I already read it before asking \:D↵(@auxym) |
02:32:52 | FromDiscord | <auxym> oh |
02:33:03 | FromDiscord | <auxym> did you set the `aarch64.linux.gcc...` options in your nim.cfg? |
02:35:02 | FromDiscord | <auxym> in case it helps: see here the options I pass for arm cortex mcus (`arm-none-eabi-gcc`): https://github.com/auxym/nim-on-samd21/blob/master/config.nims#L13 |
02:35:10 | FromDiscord | <dumbmahreeo> sent a code paste, see https://play.nim-lang.org/#ix=3M7z |
02:36:36 | FromDiscord | <auxym> not sure, I set them myself in config to get it to work. See above link, combined with cli args `--os:any --cpu:arm` |
02:37:47 | FromDiscord | <auxym> https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L23 |
02:37:51 | FromDiscord | <Elegantbeef> I think for crosscompilation they dont have a consistent name which is why it's something you have to set |
02:38:37 | FromDiscord | <auxym> That's the default config, it calls `arm-linux-gnueabihf-gcc` for `--cpu:arm`, which is the cross toolchain for 32bit arm |
02:39:09 | FromDiscord | <Elegantbeef> Oddly `--cpu:arm64` calls your default gcc |
02:39:52 | FromDiscord | <dumbmahreeo> Wait, I solved |
02:39:56 | FromDiscord | <auxym> no idea, it might fall back on the default if there's nothing in the config? |
02:40:06 | FromDiscord | <Elegantbeef> Perhaps |
02:40:09 | FromDiscord | <dumbmahreeo> immagine.png https://media.discordapp.net/attachments/371759389889003532/931377117114023986/immagine.png |
02:40:24 | FromDiscord | <dumbmahreeo> Yardanico told me to simply point to the aarch64 compiler trough those flags |
02:40:32 | FromDiscord | <Elegantbeef> no make a `config.nims` with those |
02:40:35 | FromDiscord | <Elegantbeef> now\ |
02:40:37 | FromDiscord | <Elegantbeef> And you're holden |
02:40:40 | FromDiscord | <Elegantbeef> golden even |
02:40:42 | FromDiscord | <dumbmahreeo> Which I guess is what auxym was telling me to do |
02:40:43 | FromDiscord | <auxym> yeah that's the equivalent of setting those in the config |
02:40:51 | FromDiscord | <dumbmahreeo> Yeah, that's what I'll |
02:41:00 | FromDiscord | <dumbmahreeo> Yeah, that's what I'll do. This was just a test though |
02:41:19 | FromDiscord | <auxym> I thing you can define an arbitrary string for the cpu? Like you could call it arm64 or aarch64? |
02:41:22 | FromDiscord | <Elegantbeef> Yea we were all pointing to manually setting those 😀 |
02:41:26 | FromDiscord | <Elegantbeef> So cheers, we have it! |
02:41:35 | FromDiscord | <auxym> If you want to differentiate from eabihf (332bit arm) |
02:41:38 | FromDiscord | <Elegantbeef> nah if you dont pass one of the valiid cpu flags iterrors |
02:41:45 | FromDiscord | <auxym> ah |
02:41:48 | FromDiscord | <Elegantbeef> it errors\ |
02:41:57 | FromDiscord | <dumbmahreeo> Now time to try statically linking with musl while crosscompiling |
02:42:12 | FromDiscord | <Elegantbeef> like i tried `nim --cpu:dinglebop` to see and it errored with a list of valid CPUs |
02:42:38 | FromDiscord | <Elegantbeef> You can do `-d:arm64` which is used by your `config.nims` |
02:43:14 | FromDiscord | <auxym> arm64 is in there, that's probably what you should use for `--cpu` @DumbMahreeo |
02:43:34 | FromDiscord | <auxym> combined with `arm64.gcc...` options in nim.cfg |
02:43:39 | FromDiscord | <dumbmahreeo> That's what I use for --cpu, aarch is just how the compiler toolchain is called↵(@auxym) |
02:43:40 | FromDiscord | <Elegantbeef> Yep |
02:43:48 | FromDiscord | <auxym> all good |
02:43:57 | FromDiscord | <Elegantbeef> that's why it compiles with system |
02:44:05 | FromDiscord | <Elegantbeef> It doesnt have a default and falls through system gcc |
02:44:19 | FromDiscord | <Elegantbeef> Wonder if a PR should be made for this |
02:44:27 | FromDiscord | <auxym> yeah. someone should probably put in a pr |
02:44:37 | FromDiscord | <Elegantbeef> I'm a numpty so i dont know 😀 |
02:45:38 | FromDiscord | <Elegantbeef> I wonder how many fun conversations i miss from telegram |
02:45:43 | FromDiscord | <Elegantbeef> I know they despised when they got bridged here 😀 |
02:52:59 | FromDiscord | <evoalg> what's this telegram channel you speak of? |
02:53:32 | FromDiscord | <Elegantbeef> There is a nim chat on telegram |
02:54:02 | FromDiscord | <evoalg> I have telegram ... dunno if it's worth checking out tho |
02:54:14 | FromDiscord | <Elegantbeef> Probably a few people that dont come here there |
02:54:43 | FromDiscord | <Elegantbeef> It's 100% less me so clearly superior |
02:54:54 | FromDiscord | <dumbmahreeo> I just realized I'm also on the Discord after receiving the ping both on Matrix and on Discord |
02:54:54 | FromDiscord | <evoalg> ... not to sound like a stalker, but I'll stick to where you are beefy |
02:55:19 | FromDiscord | <Elegantbeef> I think i'll stay where i am aswell though |
02:55:50 | FromDiscord | <evoalg> Then I'll do nothing ... I'm good at that (just ask my boss) |
02:55:51 | FromDiscord | <dumbmahreeo> Btw I think eventually I'm gonna create something like Rust's cross. Containers to have seamless crosscompilation |
02:56:16 | FromDiscord | <Elegantbeef> When i was searching for the flags i diid stumble on https://github.com/iffy/nimxc |
02:56:24 | FromDiscord | <Elegantbeef> Might be up your alley |
02:56:58 | FromDiscord | <Elegantbeef> Evo you capable of profiling yet? |
02:57:23 | FromDiscord | <evoalg> no ... I'm going to use something to time proc's myself |
02:58:02 | FromDiscord | <Elegantbeef> Hey it's template time! |
02:58:12 | FromDiscord | <Elegantbeef> PS use `std/monotimes` |
02:58:48 | FromDiscord | <evoalg> ok thanks ... I think in my notes I have an example of monotimes .. .maybe it was one of your eg's |
02:58:58 | FromDiscord | <Elegantbeef> Perhaps |
02:59:00 | FromDiscord | <evoalg> it's not a template tho |
02:59:40 | FromDiscord | <evoalg> I was just going to do it horribly and update some global vars instead the proc |
03:00:32 | FromDiscord | <evoalg> I was even thinking of writing a bash script to copy nim code and substitute it in ... see what I mean by horrible? |
03:01:22 | FromDiscord | <evoalg> I mean take nim source file and substitute it into a 2nd nim source file ... in case there are lots of procs |
03:01:40 | FromDiscord | <dumbmahreeo> Everything works like a charm, aarch64 cross compilation + musl static linking. Thanks everyone for the help |
03:01:42 | FromDiscord | <Elegantbeef> templates you're describing templates 😀 |
03:01:54 | FromDiscord | <Elegantbeef> Or macros |
03:02:15 | FromDiscord | <evoalg> so with templates, I'd just do a call at the beginning of the proc and the end? |
03:04:29 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3M7F |
03:04:48 | FromDiscord | <evoalg> oh!! |
03:05:52 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/WXq |
03:06:25 | FromDiscord | <evoalg> ahhh ok as it doesn't care what the body is |
03:07:51 | FromDiscord | <evoalg> that's cunning, and simple! |
03:10:51 | FromDiscord | <evoalg> that 2nd code times the calling of the two procs, but both of those proc's are timed too ... so I get total and breakdown ... amazing |
03:13:06 | FromDiscord | <evoalg> `static string` because the template it in-lined at compile time, ok I see |
03:13:23 | FromDiscord | <Elegantbeef> the calls for monotime and echo have some cost, nah the static is just so you dont do silly stuff 😛 |
03:14:25 | FromDiscord | <evoalg> so if it was just `string` instead of `static string` what silliness could I do? |
03:15:14 | FromDiscord | <Elegantbeef> Pass in runtime strings basically is it |
03:15:18 | FromDiscord | <Elegantbeef> So concatenated funky stuff |
03:21:15 | FromDiscord | <evoalg> sent a code paste, see https://play.nim-lang.org/#ix=3M7H |
03:21:31 | FromDiscord | <Rika> The time code has overhead |
03:21:33 | FromDiscord | <Elegantbeef> echoing takes time |
03:21:43 | FromDiscord | <Rika> That as well |
03:23:44 | FromDiscord | <Elegantbeef> Really the time it should be used to time overall operations and not procedures do to the overhead |
03:24:52 | FromDiscord | <evoalg> ahh ok ... I was hoping to extend this to update the total times a proc is called (adding to a variable for the proc each time it's called) so at the end I can have total times for each proc ... and maybe the number of times they are called ... just to get a sense of which proc is using most of the time etc. I guess I can use a table |
03:34:25 | FromDiscord | <evoalg> Can the template get the name of the proc it's inside? .. or is that asking a bit much from it? |
03:34:43 | * | arkurious quit (Quit: Leaving) |
03:35:40 | FromDiscord | <Elegantbeef> It can with a hack |
03:35:40 | FromDiscord | <Elegantbeef> But as is it cannot |
03:36:15 | FromDiscord | <evoalg> that's fine ... I'll keep it simple and in a way I can understand ... it's a great little temple, thank you beefy! |
03:40:31 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3M7J |
03:43:37 | FromDiscord | <evoalg> oh! |
03:43:49 | FromDiscord | <Elegantbeef> Evo's like "Well cool but i dont know what's going on, send help" |
03:43:59 | FromDiscord | <evoalg> lol |
03:43:59 | * | rockcavera quit (Remote host closed the connection) |
03:44:11 | FromDiscord | <Elegantbeef> Oh guess we dont need the static string parameter anymore |
03:45:56 | FromDiscord | <evoalg> that feeling a bliss but confusion at the same time ... it's like you're giving me drugs |
03:46:14 | FromDiscord | <Elegantbeef> Drugs are cool dont got to school kids |
03:46:29 | FromDiscord | <Elegantbeef> I think that's what we're supposed to say |
03:46:53 | FromDiscord | <evoalg> that's what all the dealers say ... even the dealer kids |
03:48:02 | FromDiscord | <evoalg> I'm sure before long I'll be back for more |
03:48:22 | FromDiscord | <Elegantbeef> It'll give you a small amount of enjoyment but just more want for knowledge |
03:48:24 | FromDiscord | <Elegantbeef> Is learning a drug |
04:01:01 | FromDiscord | <evoalg> sent a code paste, see https://play.nim-lang.org/#ix=3M7P |
04:06:07 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3M7Q |
04:07:28 | FromDiscord | <evoalg> magic! |
04:08:39 | FromDiscord | <evoalg> @hmmm take a look at this! |
04:08:48 | FromDiscord | <Elegantbeef> Of course you can make an overload that takes a string you can put in place of `getProcName(start)` like it was doing so you can have named blocks |
04:09:35 | FromDiscord | <evoalg> Right |
04:12:18 | FromDiscord | <evoalg> I'm tempted to just stay with the template |
04:30:00 | FromDiscord | <huantian> Just to make sure I’m C-ing correctly, a Window is the same as a ptr UncheckedArray[ptr Window] right |
04:30:40 | FromDiscord | <Elegantbeef> Sounds right |
04:31:42 | FromDiscord | <huantian> Then I have still 0 idea why XQueryTree is only filling the first element of the array |
04:36:13 | FromDiscord | <Elegantbeef> Can i see the code again? |
04:37:26 | FromDiscord | <huantian> Yeah sure, just 1 dev |
04:37:29 | FromDiscord | <huantian> Sec |
04:47:10 | FromDiscord | <mratsim> In reply to @leorize "btw <@570268431522201601>, are you": My time has been blackholed by being a father ¯\_(ツ)_/¯ |
04:47:37 | FromDiscord | <huantian> sent a code paste, see https://play.nim-lang.org/#ix=3M7Y |
04:48:46 | FromDiscord | <congusbongus> In reply to @mratsim "My time has been": then your children must inherit your duties, for the good of the kingdom |
04:53:58 | FromDiscord | <mratsim> In reply to @congusbongus "then your children must": they certainly cry for food efficiently enough. With O(1) complexity |
04:54:39 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/hil |
04:54:43 | FromDiscord | <Elegantbeef> I dont get why it returns an incorrect length but it does |
04:59:49 | FromDiscord | <huantian> It doesn't make sense that there's only one child window though |
05:00:16 | FromDiscord | <huantian> thanks for the help tho |
05:45:15 | FromDiscord | <evoalg> In reply to @mratsim "My time has been": Congrats! |
06:24:18 | NimEventer | New thread by Bj0: Cannot instantiate: 'T' with importcpp generic, see https://forum.nim-lang.org/t/8803 |
06:50:17 | * | anadahz quit (Remote host closed the connection) |
06:50:38 | * | anadahz joined #nim |
07:11:40 | * | jjido joined #nim |
07:12:25 | NimEventer | New thread by Ethernaut: Variable prints out its type correctly, but can't access members and I can't figure out why, see https://forum.nim-lang.org/t/8804 |
07:21:26 | FromDiscord | <evoalg> sent a code paste, see https://play.nim-lang.org/#ix=3M8f |
07:22:16 | FromDiscord | <evoalg> https://termbin.com/jjlo |
07:22:51 | FromDiscord | <evoalg> (since play is down) |
07:23:56 | FromDiscord | <Elegantbeef> `sortedByIt` exists btw |
07:24:26 | FromDiscord | <Elegantbeef> Oh wait that's a table |
07:25:45 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3M8g |
07:27:20 | FromDiscord | <Elegantbeef> tinge cleaner even |
07:27:24 | FromDiscord | <evoalg> "tingle" <-- I like that word .... yea I sort of remembered that was hasKeyOrPut but then I sort of remembered it was slow or something (but I'm probably misremembering) |
07:27:38 | FromDiscord | <evoalg> no I'm sticking with tingle |
07:27:48 | FromDiscord | <Elegantbeef> It's not slow it just lacks lazy evaluation |
07:28:02 | FromDiscord | <Elegantbeef> So `(1, delta)` is created regardless of if it has the key |
07:28:47 | FromDiscord | <evoalg> ok nice thank you! |
07:29:00 | FromDiscord | <Elegantbeef> The issue is when that's a function call or something costly |
07:29:54 | FromDiscord | <evoalg> a function call to create the key? |
07:30:10 | FromDiscord | <Elegantbeef> A function to create the new entry |
07:30:35 | FromDiscord | <Elegantbeef> Say you do `calltimes.hasKeyOrPut(name, aCostlyCalc())` |
07:31:01 | FromDiscord | <evoalg> ahhhh right! |
07:31:21 | FromDiscord | <evoalg> In reply to @Elegantbeef "So `(1, delta)` is": that's why you said this ... I understand now! |
07:31:31 | FromDiscord | <Elegantbeef> With lazy evaluation that you get from a template you can only do that when you add a key |
07:32:50 | FromDiscord | <evoalg> now I'm confused again by your last sentence 😉 |
07:34:03 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/Nru |
07:34:40 | FromDiscord | <Elegantbeef> Unlike if a function `newVal` will get moved into a conditional statement and only get called if it's met |
07:35:18 | FromDiscord | <Elegantbeef> This gives us lazy evaluation like behaviour, we can pass `aCostlyCalc()` to a call, but it only is evaluated under a specific scenario |
07:36:28 | FromDiscord | <Elegantbeef> Versus a function call which is eagerly evaluated, when we call the present `hasKeyOrPut` all arguments are called if they're a function then it calls the procedure |
07:38:28 | FromDiscord | <Elegantbeef> This just comes down to templates being code substitution and as such dont call function arguments, they just take them as is and paste them at the call site |
07:39:50 | FromDiscord | <evoalg> I think I may be falling in love with templates |
07:40:00 | FromDiscord | <Elegantbeef> They're quite nice tools |
07:40:26 | FromDiscord | <Elegantbeef> They give you flexibility and reduce redundancy |
07:41:03 | FromDiscord | <Elegantbeef> The half joke i say is i hate coding so i use metaprogramming to make me not code as much |
07:42:02 | FromDiscord | <evoalg> hehehe gotcha ... but ... but with macros, it's like learning a whole new languages by the looks |
07:42:34 | FromDiscord | <Elegantbeef> And i mean like your first reaction to do what you're doing was to use an external tool to generated code, which ime is what languages without templates/macros force you to do |
07:42:48 | FromDiscord | <Elegantbeef> It's not a whole knew language as much as learning what this language does under the hood |
07:42:56 | FromDiscord | <Elegantbeef> You learn the languages semantics at a lower level |
07:43:26 | FromDiscord | <evoalg> You got me there |
07:43:41 | FromDiscord | <evoalg> guilty as charged |
07:44:04 | FromDiscord | <Elegantbeef> Macros really arent that complex once you realize you're a manual macro writer |
07:45:33 | FromDiscord | <Elegantbeef> Like for the getting proc name stuff the code that's written goes up the owner and looks for a `proc`, which is basically what you'd do when looking for the proc name |
07:45:55 | FromDiscord | <Elegantbeef> You'd look until you find the first `proc name` and then copy that name to where you want |
07:46:06 | FromDiscord | <Elegantbeef> Owners in nim are a bit more complicated but you can just think of them as any named scope |
07:46:40 | FromDiscord | <evoalg> ok |
07:47:27 | FromDiscord | <evoalg> thank you btw for letting me start to get comfy with templates first ... starting to, but a long way to go 😉 |
07:47:54 | FromDiscord | <evoalg> and that template you gave me sold it |
07:47:55 | FromDiscord | <Elegantbeef> The thing that tickles my brain is that it's technically possible to have an entire compiler written in macros 😀 |
07:48:10 | FromDiscord | <evoalg> LOL! |
07:48:25 | FromDiscord | <Elegantbeef> You'd have to be a masochist todo it, but it's technically possible, since macros can represent any code |
07:48:53 | * | PMunch joined #nim |
07:50:17 | FromDiscord | <Elegantbeef> Once you use macros and templates you're corrupted and will miss them where you dont have them |
07:50:18 | FromDiscord | <evoalg> it is possible to write a nim-non-macro-to-macro converter? |
07:50:38 | FromDiscord | <Elegantbeef> You mean take nim code and generate a macro from it? |
07:50:58 | FromDiscord | <evoalg> yea ... like, it takes a whole program and automatically converts it to macros but it does the same thing |
07:51:08 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/macros.html#dumpAstGen.m%2Cuntyped |
07:51:18 | FromDiscord | <evoalg> ohhhhhhh |
07:52:04 | FromDiscord | <Elegantbeef> Not that it'd be very useful or pointful, it's probably possible |
07:52:30 | FromDiscord | <evoalg> yea true I dunno why I was wondering about that |
07:53:17 | FromDiscord | <evoalg> I must be a tingle tired |
07:53:32 | FromDiscord | <Elegantbeef> lol |
07:54:08 | PMunch | I mean you can wrap your entire codebase in a macro call, that would turn it into a macro :P |
07:54:24 | FromDiscord | <evoalg> hehe true |
07:54:26 | FromDiscord | <Elegantbeef> In the loosest sense |
07:54:52 | FromDiscord | <Elegantbeef> All code needs to be making nodes or it doesnt count! |
07:56:02 | FromDiscord | <evoalg> "code with nodes" |
07:57:07 | FromDiscord | <Elegantbeef> Stuff like this though is what just makes me love templates https://github.com/beef331/nimscripter/blob/master/tests/example/first.nims#L48-L71 |
07:57:16 | FromDiscord | <Elegantbeef> Plays right into my i dont like writing code 😛 |
07:58:33 | FromDiscord | <evoalg> hang on ... what does that do? |
07:59:01 | FromDiscord | <Elegantbeef> Emits a bunch of procedures named `getType` so for `uint16` emits `getunit16` |
07:59:08 | FromDiscord | <Elegantbeef> `uint16`\ |
07:59:36 | FromDiscord | <Elegantbeef> Templates have a symbol joining feature where you can abuse the acc quote to join a symbol |
08:00:05 | FromDiscord | <evoalg> "acc"? |
08:00:18 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/3dB |
08:00:27 | FromDiscord | <Elegantbeef> accent i think, dont recall |
08:01:12 | FromDiscord | <evoalg> ohhhh |
08:01:28 | FromDiscord | <Elegantbeef> It's just any identifier that surrounded by backticks |
08:01:54 | FromDiscord | <evoalg> so `makeNumTest(char)` is expanded into what? |
08:02:09 | FromDiscord | <evoalg> (it's still hurting my brain) |
08:02:24 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/xUt |
08:02:47 | FromDiscord | <Elegantbeef> it's pointless everywhere but this test |
08:03:00 | FromDiscord | <Elegantbeef> I need to ensure that a char going in matches a char coming out |
08:03:09 | FromDiscord | <evoalg> ohhhhh ... ohhh right ... and so you cunning made the "getchar" through abuse |
08:03:19 | FromDiscord | <evoalg> ahhhh |
08:04:33 | FromDiscord | <Elegantbeef> I know pmunch also uses it a fair bit, think he's the one that showed me |
08:04:56 | FromDiscord | <evoalg> the abuse? |
08:05:03 | PMunch | Uses what? |
08:05:25 | FromDiscord | <Elegantbeef> backticks to join a template paramter with a identifer |
08:05:37 | PMunch | Ah right, yes that I use from time to time :) |
08:05:39 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
08:05:42 | PMunch | Nifty little feature |
08:06:07 | FromDiscord | <Elegantbeef> Oh i know it put me prestige and saem in a loop of "where the fuck does this function exist" |
08:06:29 | FromDiscord | <evoalg> that's not possible with a proc right? |
08:06:41 | FromDiscord | <Elegantbeef> Think prestige was working on nimlsp and we stared for like 10 minutes just confused, then one of us remembered the joining stuff |
08:07:31 | FromDiscord | <Elegantbeef> Also pmunch what's with the playground? |
08:07:38 | FromDiscord | <Elegantbeef> Shit broke |
08:07:41 | PMunch | Anything wrong with it? |
08:07:48 | FromDiscord | <Elegantbeef> Cant access it |
08:08:05 | PMunch | Huh, that's not great |
08:09:29 | PMunch | I think Docker might've filled up the hard-disk again.. |
08:11:03 | FromDiscord | <Elegantbeef> I'll try not to make too many examples this time |
08:11:33 | * | jjido joined #nim |
08:12:03 | FromDiscord | <Elegantbeef> Well i mean you can use accquoted identifiers anywhere just templates allow you to paste the arguments inside them which then expands↵(@evoalg) |
08:12:28 | FromDiscord | <Elegantbeef> It doesnt make sense with a proc since they're not expanding and cannot inject ast |
08:14:29 | FromDiscord | <evoalg> ahhh I meant: is it something that templates can do that proc's can't ... I wasn't challenging you to create a proc that does it ... it seemed to me that it wouldn't make sense for a proc because ... I dunno actually! |
08:16:37 | FromDiscord | <Elegantbeef> Well even if a proc code it'd be a case of well yes you can do it, but it's pointless cause you cannot call it |
08:16:57 | PMunch | @Elegantbeef, problem is that for every example docker leaves a tiny little bit of data behind that doesn't get cleaned out |
08:17:41 | FromDiscord | <evoalg> cron a bash script to delete? |
08:17:54 | FromDiscord | <Elegantbeef> Yea i figured which is why i jokingly said i'd make fewer examples cause i do make a lot |
08:20:42 | FromDiscord | <evoalg> is a new docker fired up for each example?? |
08:21:15 | PMunch | @evoalg, you're not supposed to delete these files manually, so they can trip up docker and break stuff (once I even had to completely reinstall docker) |
08:21:23 | PMunch | So I can't really put it in a cron job.. |
08:21:33 | FromDiscord | <evoalg> ahhh true |
08:41:26 | FromDiscord | <mratsim> In reply to @evoalg "that's not possible with": It is, if the proc is in a template 😉 |
08:41:53 | FromDiscord | <evoalg> hehe ok 🙂 |
08:44:05 | FromDiscord | <retkid> how can i create a thread and add it to an array of threads |
08:44:14 | FromDiscord | <retkid> ie |
08:44:53 | PMunch | @retkid, have you seen the threading example in the manual? |
08:44:56 | PMunch | It does exactly that |
08:45:06 | FromDiscord | <retkid> sent a code paste, see https://paste.rs/QJe |
08:45:13 | FromDiscord | <retkid> believe it not, I come here usually as a last resort |
08:45:17 | FromDiscord | <retkid> I tend to try and read the docs |
08:45:39 | FromDiscord | <Rika> That’s not really how you make a thread |
08:45:52 | FromDiscord | <retkid> createThread runs a thread |
08:45:59 | FromDiscord | <retkid> unless im wrong |
08:46:03 | FromDiscord | <retkid> and it only does sometimes |
08:46:14 | FromDiscord | <Rika> Well you must use that to create a thread properly |
08:47:46 | FromDiscord | <retkid> oh wait i should have looked at my example code |
08:47:56 | FromDiscord | <retkid> (edit) removed "example" |
08:48:09 | FromDiscord | <retkid> thats kinda strange behaviour |
08:48:12 | FromDiscord | <retkid> (edit) "behaviour" => "behavior" |
08:48:40 | FromDiscord | <Rika> Why so |
08:48:51 | FromDiscord | <retkid> createThread kinda casts data onto a Thread type, like jsonutils.fromJson |
08:49:01 | FromDiscord | <retkid> correct? |
08:49:34 | FromDiscord | <Rika> I don’t know, I never bothered to read the source for threads |
08:49:53 | FromDiscord | <retkid> probably best you dont |
08:50:03 | FromDiscord | <Rika> Why do you need to create a thread without running it? |
08:50:23 | FromDiscord | <retkid> i dont quite know thats just how i wanna organize it |
08:50:24 | FromDiscord | <retkid> but i cant |
08:53:15 | FromDiscord | <mratsim> organization is good but what do you want to do? Organization serves and end goal. |
08:54:05 | FromDiscord | <retkid> there is no end goal, i just wanted my code to flow where you make the threads, runs, clears, make the threads, runs, clears |
08:54:10 | szahid | When i should use let and when const? |
08:54:28 | FromDiscord | <retkid> const is compiler defined, non-static immovable, code-imprinted data |
08:54:35 | FromDiscord | <retkid> (edit) "non-static" => "" |
08:54:40 | FromDiscord | <retkid> (edit) removed "" |
08:54:52 | FromDiscord | <retkid> so like lets say you wanted to have a file that you read in your program |
08:55:26 | PMunch | @evoalg, @Elegantbeef, welp dockers fucked again.. |
08:56:15 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=3M8x |
08:56:32 | FromDiscord | <retkid> b is defined at compile time, a is defined on execution |
08:59:08 | FromDiscord | <retkid> i use const for distributing stuff for testing on different systems, because i dont have to manage directories |
08:59:27 | FromDiscord | <retkid> otherwise i prefer the flexibility of let |
08:59:45 | FromDiscord | <retkid> (edit) "directories" => "directories, or things being out of date-sync" |
08:59:54 | FromDiscord | <retkid> god sorry for editing its bad habbit |
09:08:54 | PMunch | Think I've got it now, just need to rebuild all the images (should take a couple hours I believe) |
09:13:45 | PMunch | I should really reverse the install order in that script, it starts with the oldest version :P |
09:15:28 | PMunch | If you want you can now have a blast from the past and run your examples on 0.13.0 |
09:22:08 | * | Gustavo6046 quit (Quit: Leaving) |
09:25:21 | FromDiscord | <mratsim> In reply to @retkid "there is no end": you should use a threadpool instead. Thread creation and destruction takes a loooong time. |
09:26:45 | FromDiscord | <mratsim> 1. A thread must be started with a proc.↵2. So either you have a very-long running task (think minutes) or you give a job to wait for new tasks in a loop (threadpool) |
09:27:57 | FromDiscord | <retkid> In reply to @mratsim "you should use a": threadpool has a lot of problems |
09:28:07 | FromDiscord | <retkid> its basically abandoned |
09:28:26 | FromDiscord | <retkid> last time i tried to use 'em they had weird performance issues, things |
09:28:28 | FromDiscord | <mratsim> you can write one. |
09:28:43 | FromDiscord | <retkid> Y'know what. With enough time, I could write one |
09:28:48 | FromDiscord | <retkid> is that time worth it? no |
09:29:03 | FromDiscord | <retkid> it would be worse than the already existing one shaha |
09:29:07 | FromDiscord | <mratsim> but the main question is, why do you want threads? |
09:29:15 | FromDiscord | <retkid> math takes long |
09:29:25 | FromDiscord | <mratsim> here is one I wrote: https://forum.nim-lang.org/t/8791 |
09:29:29 | FromDiscord | <retkid> im not smart enough to write the equation in asm |
09:29:39 | FromDiscord | <mratsim> what kind of math? |
09:29:53 | FromDiscord | <retkid> median deviation of like 400 numbers |
09:30:03 | FromDiscord | <retkid> more specifically, colors |
09:30:08 | FromDiscord | <mratsim> that's not worth parallelizing. |
09:30:09 | FromDiscord | <retkid> so like 1200 numbers |
09:30:12 | FromDiscord | <retkid> but over uhh |
09:30:18 | FromDiscord | <retkid> theres around 96000 of them |
09:30:25 | FromDiscord | <retkid> so its like 12009600 |
09:30:33 | FromDiscord | <retkid> 120096000 |
09:30:41 | FromDiscord | <retkid> (edit) "120096000" => "1200 96000" |
09:31:19 | FromDiscord | <mratsim> In reply to @retkid "1200 * 96000": https://github.com/mratsim/Arraymancer/blob/master/src/arraymancer/tensor/aggregate.nim#L114-L156 |
09:31:43 | FromDiscord | <retkid> then its adding it to a db, its taking a pretty long time |
09:32:15 | FromDiscord | <mratsim> you want to add just the stddev to the db or all numbers as well? |
09:33:05 | FromDiscord | <mratsim> threads won't solve DB access, they will make it worse due to synchronization issues. |
09:33:48 | FromDiscord | <retkid> its that or channel it and save it to a json, but i need to read it manually so into a db it goes |
09:34:06 | FromDiscord | <retkid> eh fuck it'll serial write it and channel it |
09:34:17 | FromDiscord | <mratsim> channel? |
09:34:24 | FromDiscord | <retkid> Channel[type] |
09:34:59 | FromDiscord | <mratsim> What I'm saying is that you're adding threading problems where it's not an issue |
09:35:18 | FromDiscord | <retkid> lol |
09:35:26 | FromDiscord | <retkid> its almost certainly an issue what |
09:35:49 | FromDiscord | <retkid> you're telling me im watching something max out a thread and its not an issue? |
09:36:21 | FromDiscord | <mratsim> sure, if you're using the wrong algorithm or data structures with O(n²) complexity it is. |
09:36:36 | FromDiscord | <mratsim> it is your algorithm the issue. |
09:39:08 | FromDiscord | <retkid> im loosing some efficiency to db locking but the algorithm is literally just adding numbers to a sequence then getting a mean then writing it to a db |
09:41:01 | FromDiscord | <retkid> running 30 at a time right now and its averaging about 3 seconds each |
09:41:23 | FromDiscord | <retkid> while using around 16 gm of ram |
09:41:48 | FromDiscord | <retkid> a big performance loss in half of that being swap |
09:42:11 | FromDiscord | <retkid> im going to destroy this nvme ssd.... |
09:43:21 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
09:45:13 | FromDiscord | <mratsim> In reply to @retkid "running 30 at a": https://media.discordapp.net/attachments/371759389889003532/931484087334625290/unknown.png |
09:45:37 | FromDiscord | <mratsim> this is single-threaded |
09:46:19 | FromDiscord | <retkid> its more like↵compare every number to every number in that range using Distance() from chroma |
09:46:33 | FromDiscord | <mratsim> with openmp https://media.discordapp.net/attachments/371759389889003532/931484420265885736/unknown.png |
09:46:51 | FromDiscord | <mratsim> mmmh pairwise distance is a bit of a memory and CPU hog. |
09:47:29 | FromDiscord | <retkid> ¯\_(ツ)_/¯ |
09:47:34 | FromDiscord | <mratsim> it's n², I wonder if we could reduce that to O(n log n) using something similar to FFT for polynomial multiplication |
09:48:18 | FromDiscord | <retkid> its more like this |
09:53:42 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=3M8M |
09:53:50 | FromDiscord | <retkid> turns out discord is not a good ide |
09:54:34 | FromDiscord | <retkid> thats not valid code, and distance.add() should be indented |
09:56:53 | FromDiscord | <mratsim> so many sqrt and exponetial in distance |
09:57:38 | FromDiscord | <retkid> thats why its annoying to implement in asm |
09:57:55 | FromDiscord | <mratsim> let's see if I can parallelize this |
09:59:01 | FromDiscord | <retkid> i did it just by running the calcs at the same time |
09:59:16 | FromDiscord | <retkid> so instead of doing 1000, it does 1000/30 |
10:03:26 | FromDiscord | <mratsim> do you need float64 btw? |
10:03:43 | FromDiscord | <retkid> not really i dont think |
10:04:48 | FromDiscord | <retkid> this isn't the most accurate, some have more numbers than others, etc |
10:05:07 | FromDiscord | <mratsim> also why are you parseHex within a loop? |
10:05:12 | FromDiscord | <eyecon> sent a code paste, see https://play.nim-lang.org/#ix=3M8Q |
10:05:23 | FromDiscord | <mratsim> string processing is very slow |
10:05:44 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=3M8R |
10:05:44 | FromDiscord | <retkid> i didn't know taht |
10:05:49 | FromDiscord | <retkid> (edit) "taht" => "that" |
10:05:53 | FromDiscord | <eyecon> No, it's just a number |
10:06:02 | FromDiscord | <eyecon> 255 is 0xFF |
10:06:38 | FromDiscord | <retkid> i dont think that would work because it could be like↵05, 255, 96 |
10:07:02 | FromDiscord | <retkid> lemme look at this lol |
10:08:40 | FromDiscord | <retkid> nimplayground down |
10:08:50 | FromDiscord | <eyecon> In reply to @retkid "nimplayground down": Yep, just saw that |
10:09:34 | FromDiscord | <retkid> https://replit.com/languages/nim |
10:10:06 | FromDiscord | <eyecon> In reply to @retkid "https://replit.com/languages/nim": This uses 1.2.0 but better than nothing I suppose |
10:10:56 | FromDiscord | <retkid> i guess it does work. |
10:11:05 | FromDiscord | <retkid> kinda hard for me to think of colors as an increasing number |
10:11:11 | FromDiscord | <retkid> idk why i didnt think of that |
10:11:12 | FromDiscord | <mratsim> In reply to @retkid "rand outputs hex?": https://media.discordapp.net/attachments/371759389889003532/931490629039583232/unknown.png |
10:11:30 | FromDiscord | <mratsim> sent a code paste, see https://play.nim-lang.org/#ix=3M8T |
10:11:38 | FromDiscord | <mratsim> (edit) |
10:12:21 | FromDiscord | <retkid> rand 1.0" |
10:12:27 | FromDiscord | <mratsim> are there only 25 colors in the real app? |
10:12:33 | FromDiscord | <retkid> no |
10:12:48 | FromDiscord | <mratsim> the x 0 ..1000 is just for benchmarking right? |
10:12:53 | FromDiscord | <retkid> yes |
10:13:59 | FromDiscord | <retkid> well the data is already in strings |
10:14:06 | FromDiscord | <retkid> so i kinda do have to process them |
10:15:03 | szahid | Im looking for dict replacment in nim. is there something like this? |
10:15:08 | FromDiscord | <retkid> though i guess that is my fault for shooting myself in the foot when i compiled the data |
10:15:17 | FromDiscord | <mratsim> In reply to @szahid "Im looking for dict": std/tables |
10:18:17 | szahid | mratsim i need something like this: var x = {"key":"value"} \ echo x["key"] |
10:18:34 | FromDiscord | <retkid> yea |
10:19:18 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=3M8V |
10:19:23 | FromDiscord | <retkid> might need tables import |
10:22:04 | szahid | {}.toTable works fine |
10:40:16 | FromDiscord | <eyecon> I didn't know about futhark until recently, any reason why it's not in the curated packages list? |
10:43:23 | FromDiscord | <eyecon> And isn't the package "cascade" listed there basically std/with? |
10:43:37 | FromDiscord | <mratsim> In reply to @retkid "though i guess that": https://media.discordapp.net/attachments/371759389889003532/931498783395688479/message.txt |
10:43:56 | FromDiscord | <mratsim> https://media.discordapp.net/attachments/371759389889003532/931498860512182312/unknown.png |
10:44:03 | FromDiscord | <mratsim> on an 8 core machine |
10:44:31 | FromDiscord | <mratsim> sent a code paste, see https://play.nim-lang.org/#ix=3M91 |
10:45:10 | FromDiscord | <retkid> this is very interesting code |
10:45:31 | FromDiscord | <retkid> some of this stuff is above my head ahaha |
10:46:10 | FromDiscord | <mratsim> the casting to ptr UncheckedArray is because passing seq to threads is annoying |
10:46:22 | FromDiscord | <eyecon> sent a code paste, see https://play.nim-lang.org/#ix=3M92 |
10:46:28 | FromDiscord | <mratsim> in the code it's both |
10:46:49 | FromDiscord | <mratsim> there is a distance coming from the chroma library, and there is a seq of distances |
10:47:02 | FromDiscord | <eyecon> That's... I dunno... Isn't it confusing |
10:47:15 | FromDiscord | <mratsim> that's on @retkid |
10:47:31 | FromDiscord | <eyecon> Yeah |
10:47:48 | FromDiscord | <retkid> hey in the smaller code it works |
10:47:51 | FromDiscord | <retkid> in that it doesn't |
10:48:32 | FromDiscord | <mratsim> anyway, you have an example on parallelizing your code using Weave. can't spend more time on this today unfortunately |
10:49:13 | FromDiscord | <retkid> Weave? |
10:49:18 | FromDiscord | <retkid> what is weave |
10:51:33 | FromDiscord | <mratsim> my multithreading runtime. |
10:51:41 | FromDiscord | <mratsim> added an issue for UI improvement: https://github.com/mratsim/weave/issues/179 |
10:52:10 | FromDiscord | <mratsim> it's an implementation of this RFC: https://github.com/nim-lang/RFCs/issues/160 |
10:52:53 | FromDiscord | <mratsim> I also did this threadpool https://github.com/status-im/nim-taskpools↵↵But weave is particularly tuned for parallel for loops and scientific computing in general |
10:56:15 | FromDiscord | <eyecon> In reply to @eyecon "I didn't know about": Also honeycomb which is a very nice to use PEG |
11:10:04 | szahid | Guys. How i should declare Table [string, string] ? |
11:10:41 | szahid | just table? |
11:11:22 | NimEventer | New thread by Rforcen: Llvm wrap, see https://forum.nim-lang.org/t/8805 |
11:13:05 | PMunch | szahid, what do you mean? |
11:13:24 | PMunch | `Table[string, string]` is how you would do that |
11:14:46 | szahid | Visual studio code mark this as error. |
11:15:04 | PMunch | What is the error? |
11:15:12 | PMunch | Might be something else you're doing wrong |
11:16:13 | szahid | type mismatch. But app run correctly. |
11:23:21 | * | jjido joined #nim |
11:27:38 | PMunch | Then it's probably an error with nimsuggest |
11:28:06 | PMunch | Might be related to this https://github.com/nim-lang/Nim/issues/19371 |
12:01:06 | FromDiscord | <ynfle (ynfle)> Anyone know of a library that converts a jsonschema to a nim type or something like that? |
12:01:35 | PMunch | std/json? |
12:01:58 | PMunch | Oh, you have a scheme in some format and want to have a Nim type that represents it? |
12:02:07 | PMunch | My jsonschema package does something similar |
12:02:07 | FromDiscord | <ynfle (ynfle)> Ya |
12:02:17 | PMunch | I use it for NimLSP |
12:02:33 | FromDiscord | <ynfle (ynfle)> I know. It's really cool, but it doesn't read in a json schema file |
12:02:35 | PMunch | It's actually caught multiple poorly implemented clients :P |
12:02:45 | FromDiscord | <ynfle (ynfle)> Nice |
12:03:00 | PMunch | There is no specified format for json schema though is there? |
12:04:01 | FromDiscord | <ynfle (ynfle)> json schema specifies the format if that's what you're saying. And you can build schemas on other schemas which specify the format of the schema |
12:06:47 | PMunch | I know what a schema is, but you're asking for a package that reads schema definitions. But there is no standard for these, so how would you write a package for it? |
12:31:58 | FromDiscord | <xx_ns> ynfle: you mean like https://json-schema.org/draft/2020-12/schema ? |
12:46:14 | * | rockcavera joined #nim |
12:46:14 | * | rockcavera quit (Changing host) |
12:46:14 | * | rockcavera joined #nim |
13:13:21 | FromDiscord | <xx_ns> @treeform haha I didn't realise you were in here |
13:13:42 | FromDiscord | <xx_ns> you can merge the pixie PR if you want, i put the asserts in the test file itself |
13:40:57 | FromDiscord | <Isofruit> sent a code paste, see https://paste.rs/HN4 |
13:43:09 | FromDiscord | <Isofruit> In the sqlite lib it'd then use DbConn alias specifically for PSqlite, in the postgress lib it'd use the DbConn alias for PPGConn etc.↵Splitting it into a separate module to avoid code duplication just feels like it'll start coupling these modules and makes the code more complex (because I now need to handle allowing various DbConn types), while the other way round feels bad because code duplication and unnecessary work. |
13:44:55 | FromDiscord | <Isofruit> Hmm you know what, I'll first start writing the generic variation of this (without concepts for now, I don't want to force the maintainer of norm to adopt a still experimental feature) and see how that goes |
14:00:34 | FromDiscord | <Isofruit> Yeah, I was being silly, I had to write separate tests for them either way, but I could just make a central model that is imported and exported by the other two |
14:37:29 | * | arkurious joined #nim |
14:43:15 | nrds | <Prestige99> Hey @PMunch |
15:00:31 | PMunch | Hello Prestige |
15:00:34 | PMunch | What's up? |
15:04:08 | * | PMunch quit (Quit: leaving) |
15:11:08 | FromDiscord | <Bung> @ElegantBeef `intr.invoke(fancyStuff, 10) # Calls `fancyStuff(10)` in vm` where is fancyStuff symbol ? |
15:35:05 | FromDiscord | <baalajimaestro> https://paste.baalajimaestro.me/MDvGXU↵↵can someone guide me on how to convert the input to output with nim. I tried with regex patterns but i am not able to achieve it. Is there any other logical approach to doing this |
15:38:23 | FromDiscord | <geekrelief> In reply to @baalajimaestro "https://paste.baalajimaestro.me/MDvGXU can someone": Have you looked at strscans? |
15:38:49 | FromDiscord | <geekrelief> actually, nevermind not sure that would work cause you need to ignore stuff |
15:39:18 | FromDiscord | <Bung> you need parseHtml and xmltree |
15:39:20 | FromDiscord | <geekrelief> you might have to use a parsing library |
15:42:44 | FromDiscord | <Bung> I think u can find what u need here https://github.com/nim-lang/fusion/tree/master/src/fusion/htmlparser |
15:48:16 | FromDiscord | <baalajimaestro> fine with even if there is an option to remove the entire \<img\@geekrelief) |
15:49:00 | FromDiscord | <baalajimaestro> lemme check, im pretty new to nim so gotta figure out how to use this↵(@Bung) |
15:50:01 | FromDiscord | <auxym> old but classic SO: https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags |
15:52:16 | FromDiscord | <baalajimaestro> hmmmmm, so gotta figure out how to use a parser. any docs other than the code as such? |
15:53:26 | FromDiscord | <baalajimaestro> i dont understand much from the example provided here https://github.com/nim-lang/fusion/blob/master/src/fusion/htmlparser.nim |
15:55:27 | FromDiscord | <baalajimaestro> got it never mind |
16:05:26 | FromDiscord | <auxym> you could also try xmlparser in the stdlib. Though you might need to add a "root" element that wraps you "img" element in order for it to be considered strictly valid xml. Not sure if xmlparser is tolerant of that. https://nim-lang.org/docs/parsexml.html |
16:05:54 | * | rockcavera quit (Remote host closed the connection) |
16:20:33 | FromDiscord | <baalajimaestro> https://nim-lang.org/docs/htmlparser.html↵↵I found this, will try it out tomorrow |
16:22:23 | * | stkrdknmibalz quit (Ping timeout: 256 seconds) |
16:30:18 | NimEventer | New thread by Geekrelief: How can I implement a conditional access operator?, see https://forum.nim-lang.org/t/8806 |
16:43:57 | FromDiscord | <Patitotective> Is there a way I could find where a procedure has been called from? to debug |
16:45:39 | FromDiscord | <Tanguy> echo getStackTrace() |
16:47:12 | FromDiscord | <Patitotective> Thanks 🙃 |
16:47:37 | FromDiscord | <treeform> In reply to @xx_ns "<@!107140179025735680> haha I didn't": I merged your PR, thanks! |
16:58:42 | * | vicfred joined #nim |
17:47:43 | * | Lord_Nightmare quit (Read error: Connection reset by peer) |
17:49:31 | * | Lord_Nightmare joined #nim |
18:05:31 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
18:26:37 | NimEventer | New thread by Sixte: Nim 1.6.2 : silent program rejection, see https://forum.nim-lang.org/t/8807 |
18:54:46 | * | vicfred quit (Quit: Leaving) |
19:36:03 | nrds | <Prestige99> @PMunch not much. Been having a painful nim editing experience because of nimsuggest lol |
20:08:16 | FromDiscord | <hmmm> nimsuggest is evil turn it off 🤔 |
20:11:28 | nrds | <Prestige99> Yeah it's been broken since 1.6.0 it seems |
20:20:07 | FromDiscord | <QueenFuckingAdrielle> What's everyone working on with nim? Anybody doing any interesting projects? |
20:23:14 | FromDiscord | <hmmm> there is "This month in nim" on the official blog if you hadn't read with plenty of nifty stuff |
20:25:55 | * | fvs left #nim (WeeChat 3.4) |
20:27:12 | FromDiscord | <Isofruit> Has anyone here successfully used "nimcrypto" to compute hashes? |
20:27:23 | FromDiscord | <Isofruit> (edit) "hashes?" => "hashes (in my case of passwords)?" |
20:30:22 | FromDiscord | <hmmm> I tested it for a smol project I abandoned and it seemed to work, afaik it's the best crypto lib we have |
20:30:54 | FromDiscord | <Patitotective> In reply to @QueenFuckingAdrielle "What's everyone working on": NiPrefs: _PREFS_ for _Nim_ 😎 lol |
20:31:52 | FromDiscord | <Isofruit> In reply to @hmmm "I tested it for": Do you know whether it supports pbkdf2? I supposedly does, I've been searching for any sort of function mentioning it for a while (as someone with very little knowledge about cryptography, I'm still not too sure about the concept of digests neither) |
20:32:22 | FromDiscord | <hmmm> ah no idea, wait for the brainy guys 😊 |
20:34:29 | FromDiscord | <Isofruit> In reply to @QueenFuckingAdrielle "What's everyone working on": I'm rewriting my REST-API from Django to Nim, because I feel personally slighted that some of my pages need more than 500ms to load even though the serialization etc. should be trivial... and I wanted to learn another language either way, so killing 2 birds with one stone instead of improving the Django backend |
20:36:32 | FromDiscord | <Isofruit> ... which turns out means I'm now also contributing to norm, hopefully my current PR isn't too bad |
20:43:43 | FromDiscord | <Isofruit> In reply to @hmmm "ah no idea, wait": I mean, if you used a function you proooobably had to at one point uses one that uses an "HMAC" type as a param? |
20:53:51 | FromDiscord | <hmmm> hm maybe I don't even remember, I remember using the CTR thing to encrypt stuff |
21:08:55 | FromDiscord | <Elegantbeef> it's declared in the constant `script`↵(@Bung) |
21:25:38 | FromDiscord | <Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3Mcd |
21:26:19 | * | anadahz quit (Remote host closed the connection) |
21:26:53 | * | anadahz joined #nim |
21:39:57 | * | anadahz quit (Remote host closed the connection) |
21:41:03 | * | anadahz joined #nim |
21:46:29 | * | anadahz quit (Quit: anadahz) |
21:51:26 | NimEventer | New thread by Freeflow: Novice Question: Implement the Step functionality in VBA, see https://forum.nim-lang.org/t/8808 |
21:51:59 | NimEventer | New question by Philipp Doerner: How do I re-build django's password hashing with nimcrypto?, see https://stackoverflow.com/questions/70716906/how-do-i-re-build-djangos-password-hashing-with-nimcrypto |
21:53:06 | FromDiscord | <Isofruit> (Nobody worry about this one, I'm answering it myself so I can also figure out in the future how to use nimcrypto) |
21:57:19 | FromDiscord | <Elegantbeef> No i'm going to worry about it |
22:00:12 | FromDiscord | <leorize> I'm not sure if nimcrypto has been audited yet |
22:00:12 | FromDiscord | <leorize> probably already by the Status folks |
22:01:01 | FromDiscord | <leorize> but for security applications I'd recommend using already established libraries like libsodium which does have a good nim wrapper |
22:01:54 | FromDiscord | <Elegantbeef> Clearly you're supposed to role your own cause that's totally the safest thing possible 😛 |
22:02:21 | FromDiscord | <Isofruit> God |
22:02:22 | FromDiscord | <Isofruit> dangit |
22:02:27 | FromDiscord | <Isofruit> Like, I appreciate it leorize |
22:02:33 | FromDiscord | <treeform> sent a long message, see http://ix.io/3Mcs |
22:02:34 | FromDiscord | <Isofruit> But I had assumed nimcrypto was already safe |
22:02:44 | FromDiscord | <Isofruit> And it took me way too long to figure out how to use that lib |
22:03:17 | FromDiscord | <Isofruit> I guess back to the drawing board and looking at libsodium |
22:03:59 | FromDiscord | <QueenFuckingAdrielle> Nice, came back from the store and saw all these cool projects |
22:04:32 | FromDiscord | <leorize> when it comes to security libraries, always check if they are wildly adopted and whether they are audited |
22:04:37 | FromDiscord | <leorize> better be safe than sorry |
22:06:52 | FromDiscord | <Elegantbeef> Lol treeform just linked his entire git 😀 |
22:07:11 | FromDiscord | <treeform> No just the nimble published stuff |
22:10:01 | FromDiscord | <evoalg> In reply to @treeform "No just the nimble": I'm enjoying bitty so far ... thank you! |
22:11:03 | * | lispy joined #nim |
22:11:26 | FromDiscord | <QueenFuckingAdrielle> sent a long message, see http://ix.io/3Mcu |
22:13:22 | FromDiscord | <Isofruit> Is there a largely adopted wrapper of libsodium leorize? I found like 3 different wrappers by now and the one from FredericoCeratto was the most adopted one I could find yet (https://github.com/FedericoCeratto/nim-libsodium) |
22:13:39 | FromDiscord | <leorize> federico is the one I used, I haven't tried the other ones |
22:15:06 | FromDiscord | <treeform> In reply to @evoalg "I'm enjoying bitty so": Thank you for using my stuff. |
22:15:07 | FromDiscord | <Isofruit> Then to figure out how to do that entire sha256+HMAC+pbkdf2 in that one |
22:15:26 | FromDiscord | <QueenFuckingAdrielle> I have seen much activity with some of the nim math libs we are using. I'm worried I'll have to take over maintaining them. |
22:15:34 | FromDiscord | <QueenFuckingAdrielle> (edit) "have" => "havent" |
22:16:41 | FromDiscord | <leorize> you can query the science people for more details |
22:16:51 | FromDiscord | <leorize> they might be shifting development priorities elsewhere |
22:18:14 | FromDiscord | <QueenFuckingAdrielle> Yea that might be a good idea. The main one is arrayfire, which is just c2nim iirc. That's probably the most important lib. We are also using weave/laser/arraymancer some. |
22:19:03 | FromDiscord | <leorize> looks like mratsim just announced that he doesn't have time to maintain arraymancer anymore |
22:19:29 | FromDiscord | <QueenFuckingAdrielle> We are currently looking at ways on inlining nvidia ptx to bypass cuda completely but we haven't figured it out yet. |
22:19:42 | FromDiscord | <QueenFuckingAdrielle> I had thought that might be the case |
22:20:31 | FromDiscord | <QueenFuckingAdrielle> Finding anyone who knows ptx is like, impossible. |
22:20:43 | FromDiscord | <hmmm> In reply to @treeform "I am working on:": print not named printy... it must not production ready 🤔 |
22:20:53 | FromDiscord | <hmmm> in treeform-land the y is given to the golden eggs |
22:20:58 | * | joe_mad joined #nim |
22:21:10 | * | jjido joined #nim |
22:21:12 | FromDiscord | <evoalg> treeformy |
22:21:55 | FromDiscord | <QueenFuckingAdrielle> What is everyone's opinion on the outlook of nim? I hope it continues to increase in popularity. |
22:23:26 | FromDiscord | <Isofruit> As someone barely in deep enough to be able to contribute to an ORM and even that at debatable levels, I don't think I have a qualified opinion here. ↵I'd assume a growth in popularity, but I know little and the world is complex |
22:23:31 | FromDiscord | <Elegantbeef> Considering its gotten me into compiler dev i hope it dies 😛 |
22:23:41 | FromDiscord | <QueenFuckingAdrielle> Lol |
22:23:45 | FromDiscord | <Isofruit> That would be a disaster beef! |
22:23:59 | FromDiscord | <Isofruit> Where else could you abandon your macros as easily as here? |
22:23:59 | FromDiscord | <QueenFuckingAdrielle> There are just no other real options |
22:24:05 | FromDiscord | <hmmm> I'm glad we have it 😊 it must grow at it's own pace imo |
22:24:34 | FromDiscord | <QueenFuckingAdrielle> Say what you will but rust and nim are apples and oranges and they are usually compared to each other. |
22:25:04 | FromDiscord | <QueenFuckingAdrielle> I agree, I'm promoting it in dl and robotics as much as possible |
22:25:29 | FromDiscord | <QueenFuckingAdrielle> But I'm not really an application developer in a traditional sense so idk |
22:26:12 | FromDiscord | <Isofruit> I shill for it in my own circles, got one person to look at it confirmed for now, though she got put a bit off-guard by the antivirus warnings |
22:26:37 | FromDiscord | <leorize> that's the fate of all unpopular languages |
22:26:44 | FromDiscord | <leorize> even go went through that phase |
22:26:44 | FromDiscord | <theSherwood> Speaking of which, are the antivirus warnings an ongoing issue? |
22:27:08 | FromDiscord | <Isofruit> Last I checked 1.6 is once again under antivirus flagging |
22:27:10 | FromDiscord | <Elegantbeef> Yea i'm more of a game dev, which is why i like it, tons of nice features to make life easy there↵(@QueenFuckingAdrielle) |
22:27:22 | FromDiscord | <Isofruit> as is 1.6.2, given that said friend of mine got it immediately flagged as such |
22:27:22 | FromDiscord | <leorize> aren't you a compiler dev? |
22:27:29 | FromDiscord | <Elegantbeef> I hate you leorize |
22:27:33 | FromDiscord | <Elegantbeef> Go die in a hole or something 😛 |
22:27:38 | FromDiscord | <leorize> \:P |
22:27:51 | FromDiscord | <QueenFuckingAdrielle> In reply to @Elegantbeef "Yea i'm more of": Oh cool, have you used nim with godot? |
22:28:17 | FromDiscord | <Elegantbeef> I have briefly, but eh godo's native sucks imo |
22:28:26 | FromDiscord | <Elegantbeef> It's not a first class feature and it feels it |
22:28:35 | FromDiscord | <QueenFuckingAdrielle> My gf and I are planning a little indie title and I was going to look at the nim interface. |
22:28:52 | FromDiscord | <leorize> as more malwares are written in Nim, AV will pick up Nim executables as malicious↵(@Isofruit) |
22:28:56 | FromDiscord | <QueenFuckingAdrielle> Yea, I just hate how bloated unity and unreal are for what we are doing. |
22:29:05 | FromDiscord | <leorize> it's kinda unavoidable until we have mainstream software in Nim |
22:29:06 | FromDiscord | <Elegantbeef> It works and all but it's not fun imo, my most recent stuff is built on my own framework using Opengl/Sdl/Assimp |
22:29:12 | FromDiscord | <Elegantbeef> Might be interested in TheMachinery aswell |
22:29:25 | FromDiscord | <Elegantbeef> Or pay for signing |
22:29:27 | FromDiscord | <QueenFuckingAdrielle> Ah gotcha, I'm not on that level of gamedev |
22:29:32 | FromDiscord | <Isofruit> Okay it appears I'm blind, I can't find a pbkdf2 function or so for the life of me in libsodium |
22:29:49 | FromDiscord | <Elegantbeef> I mean i'm not either |
22:29:50 | FromDiscord | <Elegantbeef> I just play pretend 😛 |
22:29:57 | FromDiscord | <Elegantbeef> As i do everywhere |
22:30:05 | FromDiscord | <hmmm> I mean antivirus software is the real malware themselves. We are on the right side of history 🧐 |
22:30:34 | FromDiscord | <Elegantbeef> drop-2021-11-19\_19.05.30.mp4 https://media.discordapp.net/attachments/371759389889003532/931676696032182322/drop-2021-11-19_19.05.30.mp4 |
22:30:36 | FromDiscord | <Elegantbeef> This is where my project sits if wondering |
22:30:38 | FromDiscord | <hmmm> In reply to @Elegantbeef "I just play pretend": not tru, beef best compiler dev |
22:30:51 | FromDiscord | <evoalg> In reply to @QueenFuckingAdrielle "Ah gotcha, I'm not": do you do like data analysis or ai programming? |
22:31:03 | FromDiscord | <QueenFuckingAdrielle> We are making a witchy version of stardew valley basically. Unreal isn't great for that. |
22:31:11 | FromDiscord | <Isofruit> In reply to @Elegantbeef "drop-2021-11-19\_19.05.30.mp4": puzzle game I take it? |
22:31:20 | FromDiscord | <Elegantbeef> Yea |
22:31:22 | FromDiscord | <Elegantbeef> As all my good games are |
22:31:27 | * | joe_mad left #nim (ERC (IRC client for Emacs 27.1)) |
22:31:53 | FromDiscord | <leorize> any day now, beef will make a puzzle game about debugging the compiler |
22:31:56 | FromDiscord | <hmmm> In reply to @Elegantbeef "drop-2021-11-19\_19.05.30.mp4": beef put space marines in there |
22:32:29 | FromDiscord | <Isofruit> In reply to @leorize "any day now, beef": with ~~knuckles~~ macros! |
22:32:30 | FromDiscord | <QueenFuckingAdrielle> In reply to @evoalg "do you do like": I do, my background is in cognitive science and cs. My main research is in neuromorphic computing and cognitive robotics. |
22:33:00 | FromDiscord | <Elegantbeef> Hey with nimscripter that's not too far off just need to make a compiler in nimscripter and purposely put bugs in it 😜 |
22:33:19 | FromDiscord | <evoalg> In reply to @QueenFuckingAdrielle "I do, my background": Interesting ... I'm not familiar with those terms ... but is it neural network based? |
22:33:21 | FromDiscord | <Elegantbeef> If you're doing 2D Queen, i can suggest Nico |
22:33:32 | FromDiscord | <Elegantbeef> https://jbeetham.itch.io/linerino was made using Nico |
22:34:14 | FromDiscord | <QueenFuckingAdrielle> In reply to @evoalg "Interesting ... I'm not": Yea I dot alot of neural network training etc. Not just in nim but also with pytorch and Tensorflow... when I have to. |
22:34:31 | FromDiscord | <QueenFuckingAdrielle> In reply to @Elegantbeef "If you're doing 2D": Oh cool, I'll check that out |
22:34:57 | FromDiscord | <evoalg> Oh you prefer Nim to pytorch? |
22:35:13 | FromDiscord | <QueenFuckingAdrielle> We are mostly planning right now, she's an artist and wants to learn to program and the other way around for me. |
22:36:04 | FromDiscord | <QueenFuckingAdrielle> I do prefer nim c or cpp yea. I prefer to use tensor/array libraries directly because of the architectures I work on. |
22:36:59 | FromDiscord | <QueenFuckingAdrielle> Most of them are more tied to simulating how the brain actually functions as opposed to what alot of models do nowadays. |
22:37:29 | FromDiscord | <QueenFuckingAdrielle> We also train transformers and the like, but that's a product of the gpu and von Neumann hardware we use. |
22:38:34 | FromDiscord | <evoalg> wow you sound like a serious ai researcher |
22:39:48 | FromDiscord | <Elegantbeef> Remember AI is nothing but nested if statements |
22:39:48 | FromDiscord | <Elegantbeef> Anyone that says otherwise is a liar |
22:40:32 | FromDiscord | <evoalg> it might be more like voting believe it or not |
22:40:33 | FromDiscord | <QueenFuckingAdrielle> Lol, thanks! Like @ElegantBeef I just kinda do the stuff I do. |
22:40:58 | FromDiscord | <Elegantbeef> Wait i do stuff? |
22:41:05 | FromDiscord | <QueenFuckingAdrielle> Idk, game stuff |
22:41:08 | FromDiscord | <QueenFuckingAdrielle> Sounds like lol |
22:41:22 | FromDiscord | <Elegantbeef> Fuck dont let my mind know that, might make the "Useless narrative" harder to believe! |
22:41:26 | lispy | Besides nim, what would you say your favourite programming language is? |
22:41:37 | FromDiscord | <Elegantbeef> Nimscript 😛 |
22:41:45 | FromDiscord | <QueenFuckingAdrielle> Tbh I just wanna be a stay at home mom. But that's expensive nowadays lol. |
22:42:11 | FromDiscord | <Elegantbeef> Jokes aside, i dont really use anything but Nim, so dont really have a second |
22:42:21 | lispy | Don't lie I know it's VBA |
22:42:26 | FromDiscord | <Elegantbeef> I do have respect for Rust/Ada/Odin/Zig 😀 |
22:42:31 | FromDiscord | <Elegantbeef> Fuck no |
22:42:35 | lispy | lol |
22:42:39 | FromDiscord | <Elegantbeef> That's a heavily dotnet relying language |
22:43:11 | FromDiscord | <evoalg> In reply to @QueenFuckingAdrielle "Tbh I just wanna": make an ai child? |
22:43:25 | FromDiscord | <QueenFuckingAdrielle> Hmm can't narrow it past 3. C and julia I guess. Haxe is kinda neeto. |
22:43:31 | FromDiscord | <Elegantbeef> The benefit of an AI child is you can kill it and no one complains |
22:43:38 | FromDiscord | <QueenFuckingAdrielle> In reply to @evoalg "make an ai child?": That's the goal. |
22:44:31 | FromDiscord | <QueenFuckingAdrielle> Truth. "Is that an affliction tshirt??" Then I just yank the cord to the server. |
22:44:59 | FromDiscord | <Elegantbeef> Do that to a real child and you're called a murderer or something dumb |
22:45:43 | lispy | ikr double standards |
22:46:15 | FromDiscord | <evoalg> In reply to @Elegantbeef "The benefit of an": not if it kills you first, like in ex machina |
22:46:31 | FromDiscord | <Elegantbeef> Jokes on you i dont speak latin |
22:47:11 | FromDiscord | <Isofruit> not knowing latin saves you from ex machina↵Noted! |
22:47:36 | FromDiscord | <Elegantbeef> What you dont know cant harm you, and that's why i'm still alive after smoking 30 packs of cigs a day |
22:49:42 | FromDiscord | <evoalg> In reply to @QueenFuckingAdrielle "That's the goal.": NN's have been put into robots (physical and simulated) and everyone is surprised at how hard it is to make true ai ... it's really difficult |
22:50:29 | FromDiscord | <Elegantbeef> What i've watched Pinocchio, that was a wooden AI |
22:50:52 | FromDiscord | <Elegantbeef> That's a good documentary |
22:52:29 | FromDiscord | <evoalg> lots of trees where you live too I bet beefy |
22:52:56 | FromDiscord | <evoalg> but are you emotionally ready for an ai child? |
22:53:44 | FromDiscord | <Elegantbeef> Nah they call it a boreal forest cause there arent any trees |
22:53:56 | FromDiscord | <evoalg> makes sense |
22:54:35 | FromDiscord | <Elegantbeef> So uhh do any more fun template stuff? |
22:55:29 | FromDiscord | <evoalg> hehe not yet |
22:56:06 | * | lispy quit (Quit: Leaving) |
22:56:36 | FromDiscord | <evoalg> I still can't get over how simple and clean your timing template made things |
22:56:54 | FromDiscord | <Elegantbeef> Lol |
22:57:06 | FromDiscord | <Elegantbeef> Like i said before i went to sleep, welcome to metaprogramming |
22:57:28 | FromDiscord | <Elegantbeef> If you can write the code by hand you can write a macro or template to automate it |
22:59:23 | FromDiscord | <evoalg> yea it finally makes sense to me that it's the next step up from procedures / functions |
22:59:55 | FromDiscord | <Elegantbeef> I'd say they're simpler to procedures, but that's playing semantics 😀 |
23:00:10 | FromDiscord | <Elegantbeef> templates i mean |
23:00:48 | FromDiscord | <evoalg> so templates are just procedures that take code as arguments? |
23:01:24 | FromDiscord | <Elegantbeef> Nah |
23:01:35 | FromDiscord | <Elegantbeef> They're callables that take anything as arguments 😀 |
23:01:39 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
23:01:53 | FromDiscord | <Elegantbeef> Procedures by definition run code inside them, templates emit code inside them |
23:02:21 | FromDiscord | <leorize> very important details about templates\: the arguments are AST nodes |
23:03:19 | FromDiscord | <leorize> so be careful about potential side-effects from them |
23:03:30 | FromDiscord | <Elegantbeef> Yea we talked about lazy evaluation yesterday |
23:03:41 | FromDiscord | <Elegantbeef> Well yesterday for me |
23:04:45 | FromDiscord | <evoalg> I understand that (or thought I did) because the template would rewrite it by hand to do the right thing (lazy evaluation), but what has that got to do with AST? |
23:05:04 | FromDiscord | <Elegantbeef> Well leorize is just saying "It doesnt get the result so be cautious" |
23:06:00 | FromDiscord | <evoalg> ahhh ok I think I understand |
23:06:11 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3McD |
23:06:40 | FromDiscord | <evoalg> that is lazy, no |
23:06:48 | FromDiscord | <evoalg> no? |
23:07:00 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3McH |
23:07:44 | FromDiscord | <evoalg> ohhhh you're saying that the "a" arg isn't evaluated! |
23:07:52 | FromDiscord | <Elegantbeef> Yep |
23:08:04 | FromDiscord | <Elegantbeef> And as such you can have a value that is less than `b` |
23:08:48 | FromDiscord | <leorize> https://play.nim-lang.org/#ix=3McJ |
23:09:02 | FromDiscord | <leorize> ^ that one is much easier to follow |
23:09:30 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3McK |
23:09:45 | FromDiscord | <leorize> can't beat deterministic execution \:p |
23:10:02 | FromDiscord | <Elegantbeef> Now the question is "Can evo solve this himself" |
23:11:00 | FromDiscord | <evoalg> I though the if and else block would be substituted in ... hmmmm lemme think |
23:11:25 | FromDiscord | <Elegantbeef> It is |
23:11:57 | FromDiscord | <Elegantbeef> Remember everywhere a template parameter is, the code passed is pasted in |
23:13:01 | FromDiscord | <leorize> https://play.nim-lang.org/#ix=3McL \<- here is the exploded version if you wanna see the answer |
23:13:43 | FromDiscord | <Elegantbeef> Now leorize show how to prevent it in the most mundane way 😛 |
23:13:59 | FromDiscord | <leorize> use a proc \:p |
23:14:13 | FromDiscord | <Elegantbeef> No that doesnt work always 😛 |
23:14:25 | FromDiscord | <Elegantbeef> \glares at `hasKeyOrPut` |
23:14:32 | FromDiscord | <Isofruit> But what if you use a lot of procs? |
23:14:44 | FromDiscord | <Elegantbeef> What about it |
23:15:06 | FromDiscord | <evoalg> so `s.pop()` is performed twice! |
23:15:16 | FromDiscord | <Elegantbeef> Procs are what you should generally use first unless you need certain behaviour or desires |
23:15:38 | FromDiscord | <Elegantbeef> Indeed |
23:15:48 | FromDiscord | <leorize> https://play.nim-lang.org/#ix=3McM \<- here is how to fix it if you really want to use templates for whatever reason |
23:15:51 | FromDiscord | <Elegantbeef> For instance if you want lazy evaluation you'd use a template |
23:16:26 | FromDiscord | <evoalg> In reply to @evoalg "so `s.pop()` is performed": lol expanded it myself and saw the problem and then I read your expanded version leorize 😉 |
23:16:53 | FromDiscord | <Elegantbeef> the table interaction procedures are things that should be templates `hasKeyOrPut` and `getOrDefault` for instance |
23:17:20 | FromDiscord | <Elegantbeef> Just cause your default shouldnt be ran unless you want to insert it |
23:17:41 | FromDiscord | <Elegantbeef> anyone that relies on the behaviour that the default is called should be shot imo |
23:18:01 | FromDiscord | <Elegantbeef> But you use the simplest tool for the job which is generaly a proc |
23:18:01 | FromDiscord | <evoalg> I can see that now! |
23:18:25 | FromDiscord | <evoalg> (being shot I mean) |
23:19:24 | FromDiscord | <evoalg> and yea assigning the args to variables means they are only evaluated once each ... why did you use `_genSym` though leo? |
23:19:50 | FromDiscord | <Elegantbeef> Cause he's showing that you cannot access the variables |
23:20:23 | FromDiscord | <evoalg> ahh |
23:20:34 | FromDiscord | <Elegantbeef> templates are hygienic which means to pollute the scope is an explicit operation |
23:21:07 | FromDiscord | <Elegantbeef> So `tmpA` and `tmpB` are not accessible by you unless you explicitly say you want them with either `var tmpA {.inject.}` or make the template `{.dirty.}` |
23:21:32 | FromDiscord | <evoalg> ah yea I've seen those dirty tricks |
23:22:21 | FromDiscord | <evoalg> so my lesson for today is, args to templates are taken as is and they are evaluated when passed |
23:22:23 | FromDiscord | <Elegantbeef> And now you're a template master |
23:22:40 | FromDiscord | <Elegantbeef> are not\ ? |
23:22:56 | FromDiscord | <evoalg> not |
23:23:03 | FromDiscord | <evoalg> aren't |
23:23:16 | FromDiscord | <Isofruit> to be or not to be? |
23:25:15 | FromDiscord | <evoalg> In reply to @Isofruit "to be or not": apparently once when Bobby Fischer was thinking about taking a potentially poisoned pawn on b2, someone who was watching said "b2 or not b2" and Fischer told them to fuck off |
23:25:34 | FromDiscord | <evoalg> (if might not have been Fischer) |
23:25:58 | FromDiscord | <Isofruit> Either way makes for a funny little story 😄 |
23:26:55 | FromDiscord | <leorize> they can be templates once views work |
23:26:58 | FromDiscord | <leorize> maybe in a decade or so |
23:27:12 | FromDiscord | <Elegantbeef> Why do we need views for them? |
23:27:45 | FromDiscord | <leorize> try writing the template, you will end up evaluating the "table" argument more than once |
23:28:05 | FromDiscord | <Elegantbeef> It'd be a `var T` |
23:28:21 | FromDiscord | <leorize> not like templates care and give you a nice pointer \:p |
23:28:33 | FromDiscord | <Elegantbeef> So.. worst comes to worse you cache it and use `byaddr` like logic |
23:29:15 | FromDiscord | <leorize> you can also generate a closure on-the-fly \:p |
23:36:41 | FromDiscord | <Elegantbeef> I can also reset them 😛 |
23:36:50 | FromDiscord | <Elegantbeef> Oh wait you dont mean you you |
23:37:46 | NimEventer | New post on r/nim by Pcarbonn: Nim Community Survey 2021 Results, see https://reddit.com/r/nim/comments/s46036/nim_community_survey_2021_results/ |