00:00:23 | FromDiscord | <Avatarfighter> I'm so jealous of terminal editors I can barely learn the keybinds for them lol |
00:00:35 | * | kinkinkijkin joined #nim |
00:00:46 | disruptek | that word is `envious`. |
00:00:49 | FromDiscord | <JSGRANT> @disruptek I think that's fair; The whole Eight-megabytes-and-constantly-swapping was a meme for a reason. Heck Lisp-Machines were a thing for a reason ... that level of dynamicism surely has a cost; ESPECIALLY in a historical context. It's crazy to think modern-day Common-Lisp implmentations are in the same league as Java. |
00:01:08 | * | abm quit (Read error: Connection reset by peer) |
00:01:13 | FromDiscord | <XeroOl> there's a terminal editor called "micro" that uses easy-to-learn keybinds |
00:01:17 | FromDiscord | <XeroOl> ie ctrl+c is copy |
00:01:30 | FromDiscord | <Avatarfighter> disruptek how do I use your bot to set a description for a word again? |
00:01:50 | disruptek | just ~someword is some description. |
00:01:55 | FromDiscord | <Avatarfighter> ~disruptek A human dictionary and thesaurus. |
00:01:55 | disbot | no matching footnotes for `disruptek` with regexps `A, human, dictionary, and, thesaurus.`. ๐ |
00:02:03 | FromDiscord | <Avatarfighter> i cry |
00:02:03 | FromDiscord | <JSGRANT> I was considering trying to learn (Neo)Vim again -- but I'm 'too hipster' to use a normal keymap (Colemak) & I can't seem to get :langmap / :keymap to work ever. So visual-mode uses qwerty ... so I don't have to modifying every freaking binding lol |
00:02:37 | disruptek | you omitted `is`. |
00:03:17 | disruptek | i still don't really know how to use my editor very well. |
00:03:30 | FromDiscord | <Avatarfighter> oh I didn't realize you meant `~word is` + `description` |
00:04:07 | disruptek | i don't think i ever taught the bot what to do when a discord person says `~help`. |
00:06:12 | FromDiscord | <Avatarfighter> I'm curious to see the code behind the bot |
00:06:36 | disruptek | pretty messy, but i show it on stream frequently. |
00:06:46 | FromDiscord | <Avatarfighter> stream!? |
00:07:11 | disruptek | it's been a little while, but i used to stream like 10hrs/day. |
00:07:17 | FromDiscord | <Avatarfighter> you've been withholding critical information from me disruptek |
00:07:24 | disruptek | as per usual. |
00:07:31 | FromDiscord | <Avatarfighter> What site do you stream on? |
00:07:32 | FromDiscord | <Avatarfighter> ahah |
00:07:37 | disruptek | twitch. |
00:07:42 | disruptek | ~stream |
00:07:43 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
00:08:09 | FromDiscord | <Avatarfighter> Thank you ๐ |
00:08:45 | FromDiscord | <JSGRANT> I think I might of saw him stream before I ever talked to him on Discord; lol |
00:09:01 | FromDiscord | <JSGRANT> Like only result I ever got from "nim lang" on Twitch |
00:09:09 | disruptek | yeah. |
00:09:25 | voidpi | what does the * mean in: type client* = object |
00:09:28 | voidpi | ? |
00:09:33 | disruptek | it means that symbol is exported. |
00:10:05 | disruptek | equivalent syntax to `export client`. |
00:10:39 | voidpi | thanks disruptek |
00:11:16 | disruptek | sure thing. |
00:19:42 | * | kinkinkijkin quit (Remote host closed the connection) |
00:20:05 | * | kinkinkijkin joined #nim |
00:21:27 | disruptek | all the hookers in vermont smell like patchouli. |
00:21:31 | disruptek | what's that about? |
00:33:15 | * | sagax joined #nim |
01:05:26 | * | enthus1ast quit (Ping timeout: 246 seconds) |
01:09:46 | * | lritter joined #nim |
01:15:13 | * | voltist joined #nim |
01:22:52 | * | brainbomb[m] quit (Ping timeout: 244 seconds) |
01:22:53 | * | lnxw37d4 quit (Ping timeout: 244 seconds) |
01:22:55 | * | Northstrider[m] quit (Ping timeout: 240 seconds) |
01:22:57 | * | stisa[m] quit (Ping timeout: 240 seconds) |
01:22:59 | * | Helios quit (Ping timeout: 244 seconds) |
01:22:59 | * | agentofuser[m] quit (Ping timeout: 244 seconds) |
01:23:15 | * | Northstrider[m] joined #nim |
01:23:27 | * | silvernode[m] quit (Ping timeout: 244 seconds) |
01:23:27 | * | orazovae[m] quit (Ping timeout: 244 seconds) |
01:23:27 | * | unclechu quit (Ping timeout: 244 seconds) |
01:23:33 | * | planetis[m] quit (Ping timeout: 260 seconds) |
01:23:33 | * | einichi quit (Ping timeout: 260 seconds) |
01:23:58 | * | reversem3 quit (Ping timeout: 244 seconds) |
01:24:07 | * | leorize[m]1 quit (Ping timeout: 260 seconds) |
01:26:46 | * | silvernode[m] joined #nim |
01:27:47 | * | reversem3 joined #nim |
01:28:39 | * | planetis[m] joined #nim |
01:31:25 | * | voltist quit (Quit: The Lounge - https://thelounge.chat) |
01:33:28 | * | agentofuser[m] joined #nim |
01:34:12 | * | lnxw37d4 joined #nim |
01:34:52 | * | voltist joined #nim |
01:38:08 | * | brainbomb[m] joined #nim |
01:39:04 | * | stisa[m] joined #nim |
01:41:16 | * | unclechu joined #nim |
01:41:38 | * | orazovae[m] joined #nim |
01:42:06 | * | einichi joined #nim |
01:43:04 | * | lritter quit (Quit: Leaving) |
01:46:06 | FromDiscord | <dayl1ght> why can I take the addr of a variable declare with `var`, but not with `let`? |
01:46:29 | FromDiscord | <dayl1ght> with `let` I get the error `Error: expression has no address; maybe use 'unsafeAddr'` |
01:49:12 | * | apahl quit (Ping timeout: 260 seconds) |
01:50:57 | * | apahl joined #nim |
01:55:37 | * | Tanger joined #nim |
02:01:52 | * | lritter joined #nim |
02:12:11 | * | enthus1ast joined #nim |
02:14:56 | * | unclechu quit (*.net *.split) |
02:14:57 | * | Northstrider[m] quit (*.net *.split) |
02:14:57 | * | kinkinkijkin quit (*.net *.split) |
02:14:57 | * | ormiret quit (*.net *.split) |
02:14:57 | * | waleee-cl quit (*.net *.split) |
02:14:57 | * | ee7[m] quit (*.net *.split) |
02:14:57 | * | muffindrake quit (*.net *.split) |
02:14:57 | * | hpyc9 quit (*.net *.split) |
02:14:57 | * | junland quit (*.net *.split) |
02:15:06 | * | kinkinkijkin joined #nim |
02:15:15 | * | hpyc9 joined #nim |
02:15:19 | * | ormiret joined #nim |
02:15:31 | * | waleee-cl joined #nim |
02:15:41 | * | muffindrake joined #nim |
02:16:19 | * | unclechu joined #nim |
02:16:43 | * | Northstrider[m] joined #nim |
02:17:16 | * | junland joined #nim |
02:18:15 | * | ee7[m] joined #nim |
02:56:34 | * | leorize[m]1 joined #nim |
02:56:35 | leorize[m]1 | @dayl1ght as the error said, you gotta use unsafeAddr to get the address of let variables |
02:56:55 | FromDiscord | <dayl1ght> Yes but _why_ |
02:57:15 | FromDiscord | <dayl1ght> What is the semantic difference between var and let other than mutability? |
02:57:24 | leorize[m]1 | mutability |
02:57:43 | FromDiscord | <dayl1ght> And why does mutability imply being able to call addr |
02:57:59 | leorize[m]1 | if you got the memory address, you may write into it |
02:58:05 | * | jeff3 joined #nim |
02:58:19 | leorize[m]1 | that's just how computers work |
02:58:24 | Prestige | If anyone can take a look, I'm a bit confused about some OOP related stuff: ttps://github.com/avahe-kellenberger/nimlike/blob/master/src/ground.nim#L17 |
02:58:33 | leorize[m]1 | so Nim helps you by forcing you to declare that you really wanted the address |
02:58:37 | * | muffindrake quit (Ping timeout: 260 seconds) |
02:58:37 | FromDiscord | <dayl1ght> ok but I'm not necessarily going to write to something just because I took addr |
02:58:40 | FromDiscord | <dayl1ght> but I could |
02:58:45 | FromDiscord | <dayl1ght> So I guess that makes sense |
02:58:56 | Prestige | My base class/object has a method x that isn't getting called from the subclass |
02:59:08 | Prestige | unless I redeclare it and use procCall |
02:59:09 | FromDiscord | <dayl1ght> Since nim can't predict if I'm going to write or not |
02:59:38 | FromDiscord | <dayl1ght> Thanks for the explanation :) I think the manual could highlight this, or maybe the error message could be a little clearer |
03:00:43 | * | opal quit (Ping timeout: 240 seconds) |
03:00:52 | * | muffindrake joined #nim |
03:01:58 | Prestige | Maybe it's just a limitation of Nim right now, but I want to make sure I'm not missing something |
03:02:25 | leorize[m]1 | Prestige: so what's the error when you omit `x()` |
03:02:36 | FromDiscord | <dayl1ght> @leorize Wait but at runtime there's no difference right? E.g. having addr called on a let variable and passed onto a c function would still work |
03:02:49 | FromDiscord | <dayl1ght> but it would break nim's type system promise that let variables are immutable |
03:03:06 | FromDiscord | <dayl1ght> (Assuming the c function tries to write to the address) |
03:03:19 | leorize[m]1 | @dayl1ght yep there aren't any difference other than the explicit "I know what I am doing" promise |
03:04:10 | leorize[m]1 | you can look at the C function prototype to know if the proc writes into the passed pointer (at least for well formed programs/libraries) |
03:04:36 | Prestige | leorize[m]1: It was thinking that I was calling the vector2d `x` proc |
03:04:45 | FromDiscord | <dayl1ght> I see. I think I'll open a PR later to update the docs and maybe the message, "expression has no address" seems confusing |
03:05:05 | Prestige | but after adding the methods, running, then deleting the methods, it's working all of a sudden... |
03:05:22 | leorize[m]1 | if it's `const type* variable`, then it usually means that nothing will be written |
03:06:03 | FromDiscord | <dayl1ght> right, but if it's just type* variable then I have no guarantees |
03:06:16 | leorize[m]1 | yep |
03:06:42 | FromDiscord | <dayl1ght> Thanks for explaining :) |
03:06:57 | leorize[m]1 | Prestige: uhmmm isn't that what's AABB.x() do? |
03:07:22 | leorize[m]1 | or do you mean you got an overloading error? |
03:07:36 | * | opal joined #nim |
03:08:22 | Prestige | I got an error saying it expected x(this: Vector) but got x(this: Ground) |
03:08:58 | Prestige | But now after doing those steps and reverting back to the original code, it's working without error. I've no idea why |
03:09:01 | * | vegai quit (Ping timeout: 265 seconds) |
03:09:24 | leorize[m]1 | did you work with code that imports only ground but not aabb? |
03:09:37 | leorize[m]1 | then just export aabb from ground |
03:09:50 | Prestige | Ah yes, the import must have fixed it |
03:09:58 | Prestige | Thanks, makes sense now |
03:10:41 | Prestige | I keep feeling like I don't have to import files that I'm extending |
03:30:17 | * | vegai joined #nim |
03:34:57 | * | sealmove quit (Quit: WeeChat 2.9) |
03:43:45 | Prestige | leorize[m]1: Is there any way to automatically export all of your imports in a file? Maybe it's not a great idea, but seems to be what I need at the moment... |
03:50:21 | FromDiscord | <Elegant Beef> you'd have to import the macro but you could write a macro to do importing and exporting for you |
03:50:56 | leorize[m]1 | Prestige: write a template that import and export whatever you passed |
03:51:21 | Prestige | good idea |
03:51:23 | FromDiscord | <Elegant Beef> Can it be done in a template since you may not always import just a single file |
03:51:39 | FromDiscord | <Elegant Beef> Since you may import `dir/subfile` |
03:51:56 | Prestige | then you only need to export subfile |
03:52:18 | FromDiscord | <Elegant Beef> that's my point |
03:53:19 | Prestige | wouldn't I need to import the module that has my import template? lol |
03:53:27 | FromDiscord | <Elegant Beef> You would |
03:53:32 | * | jeff3 quit (Quit: WeeChat 2.8) |
03:53:40 | FromDiscord | <Elegant Beef> You could use the `--importModule` flag |
03:57:16 | FromDiscord | <Elegant Beef> So your nimble task would pass that module which it'd import in every file, and boom no importing it manually ๐ |
04:00:11 | Prestige | Hm good idea, trying to get it to work |
04:00:34 | Prestige | using exec "nim c -r -d:release --import:src/util/imports.nim -o:nimlike src/main.nim" |
04:00:50 | Prestige | nimlike/src/main.nim(1, 2) Error: cannot open file: src/util/imports.nim |
04:01:14 | Prestige | If I remove the src in the import line, it says cannot open file: "" |
04:02:25 | leorize[m]1 | Prestige: you can copy karax |
04:02:48 | leorize[m]1 | put every imports into a file, then use `include` on it whenever you want them all |
04:04:12 | Prestige | well I really like the solution @Elegant Beef proposed, if I can get it working |
04:05:29 | FromDiscord | <Elegant Beef> Yea import is broken for sub dirs |
04:05:43 | FromDiscord | <Elegant Beef> include isnt |
04:05:52 | Prestige | oh, damn |
04:06:02 | * | supakeen quit (Quit: WeeChat 2.9) |
04:06:40 | * | supakeen joined #nim |
04:07:11 | FromDiscord | <Elegant Beef> I've opened an issue but probably didnt document it well enough ๐ |
04:07:54 | Prestige | I feel like importing a file should also import it's deps, but I guess there's probably a reason not to |
04:08:02 | Prestige | its* |
04:08:06 | FromDiscord | <Elegant Beef> That ruins exporting |
04:08:32 | Prestige | what do you mean by ruins? |
04:08:43 | FromDiscord | <Elegant Beef> You cant selectively export things |
04:08:46 | FromDiscord | <Elegant Beef> so you expose many things |
04:09:24 | Prestige | maybe at least for methods that are extended from |
04:11:30 | leorize[m]1 | there were talks about selective exports of everything related to a type |
04:11:34 | leorize[m]1 | but it never flew |
04:12:57 | leorize[m]1 | I guess that has to do with how most Nim users don't do complicated inheritance (or at all) |
04:13:02 | Prestige | It really feels clunky - maybe I'll try bringing up the topic again |
04:13:04 | Prestige | Yeah |
04:13:12 | Prestige | I feel like every1 here but me hates OOP |
04:14:21 | FromDiscord | <Elegant Beef> I dont hate it, i feel there is a time and a place ๐ |
04:15:07 | Prestige | I couldn't find a good way to implement ECS so I'm going with OOP for a game I'm making. It's simple enough for nim's minimal OOP support to work, if I'm careful |
04:15:25 | Prestige | multiple inheritence would make things much easier |
04:15:40 | FromDiscord | <Elegant Beef> Multiple inheritance ewww |
04:16:10 | Prestige | MI is such a great language feature, really hope it's added eventually |
04:17:19 | FromDiscord | <Elegant Beef> Why is it great? |
04:17:29 | FromDiscord | <Elegant Beef> Just use interfaces like a good OOPer |
04:17:45 | Prestige | It gives the user a lot of flexibility. We also don't have interfaces |
04:17:58 | Prestige | interfaces are just very partial MI anyway |
04:18:16 | FromDiscord | <Elegant Beef> Well they're the only way to do MI without headaches |
04:18:55 | Prestige | I mean, other languages have done it - only real issue is the diamond problem, and you could just simply not allow the diamond to compile |
04:19:18 | FromDiscord | <Elegant Beef> I dont think it matters what other languages have done ๐ |
04:19:28 | Prestige | I'm saying it's possible is all |
04:19:40 | FromDiscord | <Elegant Beef> I didnt disagree with it being possible |
04:21:29 | FromDiscord | <Elegant Beef> I do think nim needs an standard method for interfaces, be it expanding concepts for runtime support or just a easy to use macro ๐ |
04:21:42 | Prestige | ah okay. Anyway, interfaces are ok, just not as powerful as MI |
04:21:49 | Prestige | Yeah I agree |
04:22:16 | FromDiscord | <Elegant Beef> I mean interfaces are better as it's composition |
04:22:23 | FromDiscord | <Elegant Beef> Composition is vastly better to inheritance |
04:22:30 | FromDiscord | <Elegant Beef> It's the entire reason EC, and ECS exist |
04:23:02 | Prestige | interfaces are just abstract classes though, it's essentially still inheritence |
04:23:23 | bung | dart has complete OOP supported |
04:24:58 | FromDiscord | <Elegant Beef> I'd be pretty happy with runtime concepts ๐ |
04:25:08 | bung | it has interface ,abstract class, mixin, extension |
04:26:05 | Prestige | if I could type Foo = ref object of A, B, C I'd be very happy |
04:33:52 | * | NimBot joined #nim |
04:43:30 | leorize[m]1 | it'll take awhile before runtime concepts become a thing |
04:45:20 | leorize[m]1 | currently it seems that we are prioritizing borrow checking and nil checking |
04:45:34 | leorize[m]1 | maybe after that concepts will be finalized (hopefully) |
04:48:26 | FromDiscord | <flywind> How could I test nimdoc? I have found a bug in nimdoc |
04:50:09 | FromGitter | <xflywind> never mind, now I know |
04:54:29 | * | mmohammadi9812 joined #nim |
04:55:18 | FromDiscord | <flywind> I want to escape HTML code in JS backend, any solution? |
04:58:20 | leorize[m] | wdym escape html code? are you building a DOM? |
04:58:34 | FromDiscord | <flywind> No I want to fix a Nim doc bug |
04:58:53 | FromDiscord | <flywind> https://media.discordapp.net/attachments/371759389889003532/760727342695317566/unknown.png |
04:59:07 | FromDiscord | <flywind> (edit) removed 'No' |
04:59:30 | FromDiscord | <flywind> I need to escape strings |
05:00:52 | FromDiscord | <flywind> `matches[i][0].innerHTML = matches[i][0].getAttribute("data-doc-search-tag")` |
05:01:46 | FromDiscord | <flywind> Anyway I could write escape function by myself |
05:02:26 | * | narimiran joined #nim |
05:02:53 | leorize[m] | maybe create a text node explicitly with the DOM api? |
05:03:10 | leorize[m] | then the html shouldn't be an issue |
05:03:52 | FromDiscord | <flywind> I will check it, thanks! |
05:04:36 | * | thomasross quit (Ping timeout: 260 seconds) |
05:35:37 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
05:36:55 | * | sagax quit (Quit: Konversation terminated!) |
06:11:12 | FromDiscord | <shad0w> i've read it a few times now and i think i still don't get the `proc` vs `method` difference ? |
06:11:40 | FromDiscord | <shad0w> i read a few articles about static vs dynamic dispatch since i was unfamiliar, didn't really help : ? |
06:12:17 | FromDiscord | <Rika> proc is static dispatch, meaning compile time choice depending on the types of the arguments; method is dynamic dispatch meaning run time choice depending on the runtime types of the arguments |
06:13:05 | FromDiscord | <shad0w> but the only thing that i wouldn't know compile time are things that come from outside at runtime ? |
06:13:49 | FromDiscord | <Rika> inheritance/oop is runtime, if you arent using those then you dont need methods |
06:14:05 | FromDiscord | <Elegant Beef> Methods mainly so you can override procs and have the called at runtime for inheriting objects |
06:14:08 | FromDiscord | <shad0w> @Rika screw OOP |
06:14:12 | FromDiscord | <Rika> lol |
06:14:19 | FromDiscord | <Rika> that's the spirit |
06:14:31 | FromDiscord | <shad0w> i've had enough of that shit already |
06:14:43 | FromDiscord | <Rika> (nim programmers seem to not like oop at all) |
06:15:05 | FromDiscord | <Rika> well yeah im done with oop too |
06:15:16 | FromDiscord | <Rika> object variants do enough for me already |
06:15:25 | FromDiscord | <shad0w> > (nim programmers seem to not like oop at all)โต@Rika oop programmers should not like oop |
06:15:32 | FromDiscord | <Rika> lol |
06:15:53 | FromDiscord | <shad0w> i picked up haskell, just to rebel |
06:16:28 | FromDiscord | <Rika> nice |
06:16:41 | FromDiscord | <Rika> well yeah thats basically it |
06:16:45 | FromDiscord | <Rika> if you dont use oop dont use methods |
06:16:47 | FromDiscord | <Rika> no reason to |
06:17:08 | FromDiscord | <Rika> you lose out on some optimisations by doing so too afaik? |
06:17:11 | FromDiscord | <shad0w> but not using something vs not understanding something erks me |
06:17:26 | FromDiscord | <Rika> well i just tried explaining above, maybe you missed it? |
06:17:42 | FromDiscord | <Rika> > proc is static dispatch, meaning compile time choice depending on the types of the arguments; method is dynamic dispatch meaning run time choice depending on the runtime types of the argumentsโตi'll rephrase it; one moment |
06:19:08 | FromDiscord | <Rika> proc is static dispatch, meaning which proc to use is chosen at compile time depending on the types (regular types, "type xxxx = object") of the arguments; method is dynamic dispatch meaning which method to use is chosen at run time depending on the runtime types (oop types, "type xxxx = ref object of Something") of the arguments |
06:19:18 | FromDiscord | <Elegant Beef> Dynamic dispatch allows the runtime situation choose the most fitting method to be used based off the type, so if you use inheritance and have a proc for the parent, and the children it can choose the child proc at times, but also the parent one if needed |
06:19:25 | * | euantorano quit (Ping timeout: 240 seconds) |
06:19:42 | * | matlock quit (Ping timeout: 256 seconds) |
06:20:14 | FromDiscord | <shad0w> i see. it's kindda hitting now |
06:20:24 | FromDiscord | <Elegant Beef> you can override the behaviour of inherited functions, and have it called without having to manually cast to the type you wan |
06:20:26 | * | matlock joined #nim |
06:20:27 | * | euantorano joined #nim |
06:21:14 | FromDiscord | <Rika> ~~except you kinda still have to but thats another discussion for another day~~ |
06:21:32 | FromDiscord | <Elegant Beef> In what way rika? |
06:21:45 | FromDiscord | <Rika> idk, i still had to do that when i called a method in a proc |
06:21:46 | FromDiscord | <shad0w> > proc is static dispatch, meaning which proc to use is chosen at compile time depending on the types (regular types, "type xxxx = object") of the arguments; method is dynamic dispatch meaning which method to use is chosen at run time depending on the runtime types (oop types, "type xxxx = ref object of Something") of the argumentsโต@Rika wouldn't procs have different signatures for different types anyway ? |
06:22:18 | FromDiscord | <shad0w> like `proc(x: Parent): something` vs` proc(x:Child): something` |
06:22:33 | FromDiscord | <Rika> > @Rika wouldn't procs have different signatures for different types anyway ?โต@shad0w what if you had two procs, same signatures except for the first arg, proc 1 has "BaseType" and the 2nd has "InheritingFromBaseType" |
06:22:52 | * | solitudesf joined #nim |
06:22:52 | Prestige | @Rika I haven't seen a good replacement for OOP (aside from ECS) for my use cases |
06:23:09 | FromDiscord | <Rika> how do you know which proc a call with first type "InheritingFromBaseType" wants? does it want base or 2nd? |
06:23:51 | FromDiscord | <Rika> and even sometimes the explicit type is just BaseType since lets say you got a seq of these |
06:23:54 | FromDiscord | <Elegant Beef> https://play.nim-lang.org/#ix=2zeo |
06:24:00 | FromDiscord | <Elegant Beef> There is why they're nice if using OOP |
06:24:04 | FromDiscord | <shad0w> > @shad0w what if you had two procs, same signatures except for the first arg, proc 1 has "BaseType" and the 2nd has "InheritingFromBaseType"โต@Rika i think im missing something, they have the same first argument :? |
06:24:12 | FromDiscord | <Rika> no |
06:24:20 | FromDiscord | <Elegant Beef> Just look at my example and run it ๐ |
06:24:22 | FromDiscord | <Rika> look at beed's |
06:24:24 | FromDiscord | <Rika> beef |
06:24:34 | FromDiscord | <Rika> i dont use inheritance at all |
06:24:44 | FromDiscord | <Rika> beef prolly does |
06:24:50 | FromDiscord | <Elegant Beef> I've played with it |
06:25:06 | FromDiscord | <Elegant Beef> I learned you have to explictly import the base object or the entire seemless casting falls apart |
06:25:40 | FromDiscord | <Elegant Beef> If the base object isnt imported by the module attempting to call methods, it doesnt automagically cast ๐ |
06:26:41 | Prestige | ^ bugs me |
06:26:50 | FromDiscord | <shad0w> > https://play.nim-lang.org/#ix=2zeoโต@Elegant Beef exactly mypoint, doThing should already be called the right call based on the fact that we overload it for different types anyway ? |
06:26:58 | FromDiscord | <Elegant Beef> Look how they're stored |
06:27:04 | FromDiscord | <Elegant Beef> They're all stored as if they're `A` |
06:27:16 | FromDiscord | <Elegant Beef> So in your world it'd call only the parent proc |
06:27:43 | Prestige | We need dynamic dispatching |
06:28:04 | FromDiscord | <shad0w> > They're all stored as if they're `A`โต@Elegant Beef lol, how :? pardon the noobness |
06:28:17 | FromDiscord | <Elegant Beef> Inherited reference objects implictly cast to `A` |
06:28:21 | FromDiscord | <Elegant Beef> Well their parents |
06:28:30 | FromDiscord | <Rika> because type info is stored in the type itself, so on run time we know what it actually is |
06:29:52 | FromDiscord | <shad0w> wait. i just typed `echo typeof x` in the loop in your example @Elegant Beef |
06:29:57 | FromDiscord | <shad0w> it says they're all A |
06:30:14 | FromDiscord | <shad0w> that's not right ? |
06:30:32 | FromDiscord | <Elegant Beef> That is |
06:30:56 | FromDiscord | <shad0w> that's what i've been having problems with, then |
06:30:57 | FromDiscord | <Rika> the way inheritance in nim works a bit weirdly |
06:31:12 | FromDiscord | <shad0w> > the way inheritance in nim works a bit weirdlyโต@Rika it should just mention it there lol. |
06:31:36 | FromDiscord | <Rika> there is a *compile time type* and a *run time type* (im pretty sure?) |
06:31:52 | FromDiscord | <shad0w> most newbies like me expect if i do `var b = B()` then `typeof b` == `B` |
06:32:04 | Prestige | The col array is of type A |
06:32:15 | FromDiscord | <shad0w> no matter if it inherits from A |
06:32:34 | FromDiscord | <Elegant Beef> It's not cause it inherits from A |
06:32:36 | FromDiscord | <JSGRANT> I wish method's keyword was just 'meth' so it stuck with the proc, & func 4 letter word stylistic choice |
06:32:46 | FromDiscord | <Elegant Beef> It's cause we stored it in a `seq[A]` |
06:33:01 | Prestige | Nah that would be gross jsgrant |
06:33:03 | FromDiscord | <Elegant Beef> Here is my example expanded to work with static dispatch https://play.nim-lang.org/#ix=2zer |
06:33:31 | FromDiscord | <shad0w> > It's cause we stored it in a `seq[A]`โต@Elegant Beef what was i gonna ask next. it's that way because we store it that way or we store it that way, BECAUSE its that way |
06:33:33 | FromDiscord | <JSGRANT> Prestige: But it'd also be c o n s i s t e n t ; lol |
06:33:45 | FromDiscord | <Rika> i dont actually know how typeof works, but im pretty sure about the distinction of a compiletime type and runtime type |
06:33:52 | FromDiscord | <lqdev> @JSGRANT iter |
06:33:53 | Prestige | Say no to meth! Lol |
06:34:07 | FromDiscord | <Elegant Beef> It's the same as `seq[10u32, 100, 200]`, we know the data type by the first value |
06:34:15 | Prestige | ^ |
06:34:22 | FromDiscord | <Rika> btw echo typeof B() still says B |
06:34:24 | FromDiscord | <JSGRANT> @lqdev Wouldn't mind it that much; But don't view it on the same level |
06:34:43 | FromDiscord | <Rika> just not `let a: A = B(); echo typeof a` |
06:34:49 | FromDiscord | <lqdev> eh you drug addicts |
06:34:55 | FromDiscord | <shad0w> so it's typecasted to A's since all elements in dequence must be of asme type :? |
06:35:01 | FromDiscord | <Rika> yes |
06:35:02 | FromDiscord | <Elegant Beef> Yes |
06:35:02 | Prestige | lqdev likes meth? |
06:35:09 | FromDiscord | <shad0w> (edit) 'dequence' => 'sequence' |
06:35:19 | FromDiscord | <JSGRANT> method man |
06:35:28 | FromDiscord | <Elegant Beef> Nim is statically type so containers have to be all the same type, which nim inferers from the first element |
06:35:34 | FromDiscord | <shad0w> wouldn't that result is loss of information ? |
06:35:48 | FromDiscord | <Elegant Beef> Yes, which is where `of` and method dispatch comes into play |
06:35:55 | FromDiscord | <shad0w> > because type info is stored in the type itself, so on run time we know what it actually isโต@Rika but this, i guess ? |
06:36:14 | FromDiscord | <Rika> thats why theres no loss of info |
06:36:25 | FromDiscord | <Elegant Beef> As you can see the method dispatch is vastly more compact, and the inside the method we have the actual type |
06:36:42 | FromDiscord | <Elegant Beef> So you dont *have* to cast yourself to have type safety as long as you design the OOP right |
06:37:29 | FromDiscord | <shad0w> OOP should come with a mental health warning :? |
06:37:38 | FromDiscord | <Rika> yes |
06:37:44 | FromDiscord | <Elegant Beef> Nim's certainly should |
06:38:13 | FromDiscord | <lqdev> every should |
06:38:28 | FromDiscord | <lqdev> java's oop is certainly no better |
06:38:40 | FromDiscord | <JSGRANT> OOP within certain-contexts is absolutely fine; The amount of internet-hate I've seen for it over the past few years has been crazy to me lol It has costs, like everything else. |
06:38:48 | FromDiscord | <Elegant Beef> I mean C#'s OOP is more complex but the story is told differently, and it is more graspable i think |
06:39:03 | FromDiscord | <Rika> python's oop is pretty bad imo |
06:39:10 | FromDiscord | <shad0w> i think the mental model is flawed |
06:39:14 | FromDiscord | <Rika> shudders in multiple inheritance |
06:39:15 | FromDiscord | <Elegant Beef> It's a tool, it needs to be used in the proper context |
06:39:18 | FromDiscord | <shad0w> scale just excacerbates it |
06:39:26 | FromDiscord | <lqdev> Nim's OOP is bad because Nim shouldn't be written with an object-oriented style |
06:39:33 | FromDiscord | <JSGRANT> Python feels like it has OO tacked-on; More-so than OCaml which ... blatantly did lol |
06:39:40 | FromDiscord | <lqdev> Nim is not Java nor C# |
06:39:47 | FromDiscord | <Elegant Beef> You can scream DoD from rooftops but that isnt always the solution |
06:39:52 | FromDiscord | <Rika> no, its bad because no one is writing much oop in nim, so it's basically ignored/low priority to nim devs |
06:40:09 | FromDiscord | <shad0w> > Nim is not Java nor C#โต@lqdev thanks @Araq : ) |
06:40:12 | FromDiscord | <lqdev> because the language embraces a more procedural style, rika |
06:40:21 | * | giaco quit (Remote host closed the connection) |
06:40:46 | * | giaco joined #nim |
06:40:52 | FromDiscord | <Elegant Beef> Lq is right, nim allows you to have an "object definition" to span multiple files, whereas C# you're limited to the scope of the class def |
06:41:22 | FromDiscord | <Elegant Beef> Aside from extension methods you cannot add to a class without being inside a classes body |
06:42:10 | FromDiscord | <shad0w> so tl;dr, if i don't care about OOPS, i can just ignore i ever read `method` exists / |
06:42:17 | FromDiscord | <Rika> yes |
06:42:22 | FromDiscord | <shad0w> thenks |
06:42:51 | FromDiscord | <Elegant Beef> Well i wouldnt personally act like OOP doesnt exist in nim, as it's a tool, but yea |
06:43:41 | * | fredrikhr quit (Quit: Ping timeout (120 seconds)) |
06:43:41 | FromDiscord | <Elegant Beef> Try all you will your shitty phillips screw will never turn the superior robertson head ๐ |
06:43:44 | Prestige | @Rika I'm wanting to write more oop in Nim - I wish we could get more support |
06:43:50 | Prestige | Maybe a donation.. |
06:43:51 | * | PMunch joined #nim |
06:43:54 | * | fredrikhr joined #nim |
06:43:56 | FromGitter | <ynfle> @shad0w, one time where it made a difference is the `unittest` module is written with `method`s so `test` can't be run in a `static` context |
06:43:57 | FromDiscord | <Elegant Beef> Start making macros ๐ |
06:44:03 | FromDiscord | <Rika> no, a big project |
06:44:18 | FromDiscord | <Rika> donation has no intent so it wont go towards what you want |
06:44:22 | FromDiscord | <JSGRANT> I can't remember where I saw it; But I remember someone implemented the more-traditional "class whatever extends whatever" styled object-model in Nim via Macros not too-too long ago |
06:45:09 | FromGitter | <ynfle> https://github.com/bluenote10/oop_utils |
06:45:11 | Prestige | @Elegant Beef well I'm thinking more along the lines of MI, so compiler changes |
06:45:36 | Prestige | Maybe I should look into the compiler |
06:45:36 | FromDiscord | <JSGRANT> Nah, was just searching and it wasn't this -- but close |
06:45:37 | FromDiscord | <Elegant Beef> You'd be suprised what's capable using nim's current type system ๐ |
06:46:17 | FromDiscord | <lqdev> i honestly don't think nim's OOP support is that terrible |
06:46:32 | FromDiscord | <lqdev> it's rudimentary, yes, but also enough for pretty much everything |
06:46:39 | FromDiscord | <lqdev> in my experience. |
06:46:40 | * | sagax joined #nim |
06:46:42 | FromDiscord | <lqdev> but ymmv |
06:46:49 | Prestige | Lack of interfaces and multiple inheritance makes it difficult |
06:46:54 | FromDiscord | <Elegant Beef> I mean they exist |
06:46:55 | FromDiscord | <lqdev> true |
06:47:06 | FromDiscord | <lqdev> runtime interfaces could be a nice addition |
06:47:09 | Prestige | I'd settle for interfaces, but would like multiple inheritance |
06:47:10 | FromDiscord | <JSGRANT> Also the "tool" is the right context/mindset to frame this; There's a reason MOST languages aren't pure-OO or pure-FP; Ultimately everything breaks down when you push a paradigm to it's limits and requires kludges to dig yourself out |
06:47:22 | FromDiscord | <lqdev> multiple inheritance? never needed it |
06:47:22 | FromDiscord | <Elegant Beef> Yea included in the language would be nice, but there are macros to get interfaces |
06:47:25 | FromDiscord | <Rika> a LOT of languages have no multiple inheritance |
06:47:48 | Prestige | I always miss multiple inheritance in those cases |
06:47:50 | FromDiscord | <lqdev> like, the only language i used that had multiple inheritance was c++ |
06:48:01 | FromDiscord | <Elegant Beef> For instance https://github.com/slangmgh/interfaced/blob/master/example.nim |
06:48:02 | FromDiscord | <lqdev> and i never even inherited from more than one object |
06:48:23 | Prestige | I don't think it's needed in most applications, but it's very useful in some cases |
06:48:29 | FromDiscord | <Rika> python has MI but i dont see it used often |
06:48:55 | FromDiscord | <shad0w> > multiple inheritance? never needed itโต@lqdev how do you make a robot dog then ? inhereit from Robot and Animal lol. you also get all the methods you're not gonna use for fee : ) |
06:49:19 | FromDiscord | <lqdev> yea i guess |
06:49:29 | FromDiscord | <Elegant Beef> I always just feel MI is interfaces but done annoyingly |
06:49:34 | FromDiscord | <lqdev> but i generally don't like deep inheritance chains |
06:49:41 | Prestige | Useful for game engines |
06:49:42 | FromDiscord | <lqdev> one level is cool |
06:49:44 | FromDiscord | <lqdev> two are fine |
06:49:48 | FromDiscord | <lqdev> three or more are hell |
06:49:59 | FromDiscord | <Elegant Beef> prestige im uncertain how it's useful |
06:50:26 | FromDiscord | <shad0w> (edit) 'fee' => 'free' |
06:50:40 | Prestige | Imagine you'd want most objects to have a location |
06:51:13 | Prestige | They could extend an object that handles anything to do with location and translations |
06:51:17 | FromDiscord | <Rika> i'd use composition for that but okay |
06:51:22 | FromDiscord | <lqdev> lemme guess, but not all of them? https://gameprogrammingpatterns.com/component.html |
06:51:23 | Prestige | How? |
06:51:23 | FromDiscord | <Elegant Beef> So i make a position component for this hypothetical EC |
06:51:33 | FromDiscord | <Elegant Beef> A transform component |
06:51:40 | FromDiscord | <Elegant Beef> *Like how unity does it without MI* |
06:51:42 | FromDiscord | <Rika> a location type as a field? |
06:51:49 | Prestige | @Rika I always hear that but I've never seen a clean example |
06:52:00 | FromDiscord | <Elegant Beef> Unity's EC is perfectly fine |
06:52:08 | FromDiscord | <Rika> what the hell is a *clean* example ***objectively***? |
06:52:38 | FromDiscord | <Elegant Beef> In Unity's case all GameObjects are forced to have a transform component which is unremoveable |
06:52:39 | Prestige | Something that isn't annoying or cumbersome to use and implement |
06:52:54 | FromDiscord | <Elegant Beef> an Entity Component system(small s) |
06:52:55 | FromDiscord | <Rika> ...which is subjective, is it not |
06:53:14 | FromDiscord | <Gary M> hi beef |
06:53:19 | FromDiscord | <Elegant Beef> an EC doesnt require MI, is composition based, and isnt annoying to use |
06:53:21 | FromDiscord | <Elegant Beef> Hey jerry |
06:53:43 | Prestige | I haven't seen a good ECS in Nim at least - I was going to implement one but couldn't figure it out |
06:53:48 | FromDiscord | <Elegant Beef> Not ECS |
06:53:49 | FromDiscord | <Elegant Beef> EC |
06:53:54 | FromDiscord | <Gary M> I'm trying to use g++ and {.importcpp.} but it's not liking it. |
06:54:07 | FromDiscord | <Gary M> it works fine if it's gcc and importc |
06:54:09 | Prestige | Would be stupid easy with MI |
06:54:20 | FromDiscord | <JSGRANT> Okay, bed-time. o/ |
06:54:21 | FromDiscord | <Elegant Beef> It's stupid easy with an entity component implementation |
06:54:32 | FromDiscord | <Elegant Beef> You make a new Transform and put it on the entity |
06:54:35 | Prestige | Can you give me an example? |
06:54:40 | FromDiscord | <Elegant Beef> Unity's |
06:54:43 | Prestige | A code example |
06:54:48 | FromDiscord | <Elegant Beef> Ok |
06:55:18 | FromDiscord | <Gary M> what happens when I try to compile and importcpp:โตerror: request for member 'addTwoIntegers' in '3', which is of non-class type 'int'โต ... int T2_ = ((int) 3).addTwoIntegers(((int) 7)); |
06:55:46 | Prestige | Because I can't for the life of me figure out how it can be done without being worse than MI |
06:56:21 | FromDiscord | <Elegant Beef> https://play.nim-lang.org/#ix=2zes |
06:56:26 | FromDiscord | <lqdev> https://github.com/liquid600pgm/rapid/blob/master/tests/tworld.nim#L22 |
06:56:56 | FromDiscord | <Elegant Beef> No MI, is composition based, and isnt ass to work with |
06:57:40 | Prestige | Beef: but how do you use this? Like how do I invoke some proc that utilizes the component |
06:58:01 | FromDiscord | <Elegant Beef> You call update on each component every frame |
06:59:03 | Prestige | Is there any way to have behavior happen when the object has two specific components? |
06:59:13 | FromDiscord | <Elegant Beef> @Gary M how are you compiling? |
06:59:22 | FromDiscord | <Gary M> nimble build via cpp backend |
06:59:36 | FromDiscord | <Elegant Beef> Yes you check if the object has to specific components in update |
06:59:39 | FromDiscord | <Elegant Beef> (edit) 'to' => 'two' |
06:59:45 | FromDiscord | <lqdev> Prestige: look no further than ECS |
06:59:51 | * | PMunch quit (Quit: leaving) |
07:00:02 | FromDiscord | <Elegant Beef> You'd implement a GetComponent which returns the requested type from the entity list |
07:00:03 | Prestige | I haven't seen a good ECS impl in Nim |
07:00:20 | FromDiscord | <Elegant Beef> Well this isnt an ECS it's EC lq, unless you're suggesting to use an ECS |
07:00:44 | FromDiscord | <Elegant Beef> As i know nothing about C++ you're on unix right? |
07:01:07 | Araq | I haven't seen a good ECS, ever. Just write domain objects for you game and stop pretending you're in AAA land |
07:01:13 | Prestige | I like the concept of ECS, but I've yet to see how it can work in Nim |
07:01:25 | Prestige | Which is why I want MI |
07:01:26 | FromDiscord | <lqdev> Araq: domain objects? |
07:01:41 | Araq | Monster = object |
07:01:44 | FromDiscord | <Elegant Beef> What do you mean how it can work in nim? It's inheritly the same everywhere |
07:01:56 | Araq | rotation: Matrix |
07:02:02 | Araq | velocity: float |
07:02:07 | Araq | etc. etc. |
07:02:32 | Prestige | Araq: How much money do I need to give you to add multiple inheritance to Nim |
07:02:49 | Araq | 100K |
07:03:00 | FromDiscord | <lqdev> too low imo |
07:03:05 | Prestige | You drive a hard bargain |
07:03:06 | Araq | I'm cheap :P |
07:03:42 | Araq | I'm not against MI btw, I prefer if over classes+interfaces splits |
07:03:55 | Prestige | Me too |
07:04:14 | Araq | I've seen discussions about "oh, should we use an interface here or a class, blah blah blub" |
07:04:29 | Prestige | I may open an issue soon about it, I want it. But I need to sleep |
07:04:41 | Araq | of course they went with "interface" because it's a sexier name |
07:05:09 | Araq | thankfully I never had to look at the resulting code |
07:06:53 | FromDiscord | <shad0w> i think im gonna try it as an exercise. write basic ML classifiers from python sklearn, perceptron adaline etc which are OOP style in a composition style and see if i can figure it out |
07:07:25 | FromDiscord | <shad0w> would probably give me a chance to hammer in the basics i've learned till now |
07:10:42 | Araq | ping alehander92 |
07:12:54 | FromDiscord | <shad0w> @alexander92 @alehander42 im sorry it's ambiguous, but _PING_ ? |
07:16:13 | * | mmohammadi9812 quit (Ping timeout: 258 seconds) |
07:16:46 | * | bozaloshtsh quit (Quit: ZNC 1.7.5 - https://znc.in) |
07:16:58 | * | bozaloshtsh joined #nim |
07:16:58 | * | bozaloshtsh quit (Changing host) |
07:16:58 | * | bozaloshtsh joined #nim |
07:19:40 | FromDiscord | <Gary M> I just can't run any nim project compiled with cpp instead of c on windows. I don't know what gives. |
07:22:52 | * | oculux quit (Ping timeout: 272 seconds) |
07:22:54 | FromDiscord | <haxscramper> !requires patty |
07:22:55 | disbot | patty: 11akavel[ixit,3dali], 11QuinnFreedman/3smoke-dungeon, 11loloicci/3nimly, 11vegansk/3nimboost, 11NickSeagull/3nim-twtypes, 11zedeus/3kinoplex, 11juancarlospaco/3fision, 11nonvirtualthunk/3nledgine, 11andreaferretti/3backupper 710 total |
07:22:59 | * | oculuxe joined #nim |
07:23:04 | FromDiscord | <haxscramper> !requires gara |
07:23:05 | disbot | gara: 11akavel/ixit, 11citycide/3fugitive, 11berquist/3rangemath, 11juancarlospaco/3fision, 11Adeohluwa/3gen, 11matkarlg/3rps-nim 76 total |
07:24:49 | FromDiscord | <haxscramper> !requires ast_pattern_matching |
07:24:50 | disbot | ast_pattern_matching: 11kristianmandrup[im_esmodules,3nim_es2015_classes,3nim_custom_elements], 11zacharycarter/3nes, 11PMunch/3jsonschema, 11chocobo333/3mcmurry 76 total |
07:25:17 | FromDiscord | <Rika> wonder if anyone uses one of my libraries lol |
07:26:14 | * | letto quit (Quit: Konversation terminated!) |
07:28:08 | FromDiscord | <shad0w> what's the existing convention for naming types with multiple words? |
07:28:18 | FromDiscord | <Elegant Beef> Pascal casing |
07:28:36 | FromDiscord | <Elegant Beef> but remember casing only matters on first character and `_` dont matter ๐ |
07:28:52 | FromDiscord | <shad0w> 1.) THIS_IS_A_TYPEโต2.) This_is_a_typeโต3) This_Is_A_Type |
07:28:57 | FromDiscord | <Elegant Beef> `FancyType` is the same as `fan_cy_t_y_p_e` |
07:29:01 | FromDiscord | <Elegant Beef> shit |
07:29:10 | FromDiscord | <Elegant Beef> Captialize the "f" |
07:29:22 | FromDiscord | <Rika> @shad0w ThisIsAType |
07:29:30 | FromDiscord | <Rika> that's the "convention" |
07:29:34 | FromDiscord | <Rika> but as most of us will say |
07:29:37 | FromDiscord | <Rika> it doesnt matter |
07:29:41 | FromDiscord | <shad0w> > that's the "convention"โต@Rika lmao, i see. |
07:29:48 | FromDiscord | <Rika> because of partial style insensitivity |
07:30:22 | FromDiscord | <Elegant Beef> I'm always suprised when people say that's a bad thing ๐ |
07:30:48 | FromDiscord | <Rika> well its rarely a problem |
07:31:02 | FromDiscord | <Rika> whats the chance of you having a type with the same name but different meanings |
07:32:06 | * | letto joined #nim |
07:43:43 | * | kinkinkijkin quit (Ping timeout: 244 seconds) |
07:54:42 | FromDiscord | <lqdev> also the first letter is style sensitive which eliminates most if not all problems |
07:58:01 | * | Vladar joined #nim |
08:01:14 | ForumUpdaterBot | New thread by ElAfalw: Assignment in if condition, see https://forum.nim-lang.org/t/6874 |
08:06:34 | * | kinkinkijkin joined #nim |
08:06:45 | FromDiscord | <alehander42> sorry Araq |
08:06:54 | FromDiscord | <alehander42> / narimiran |
08:07:15 | ForumUpdaterBot | New thread by Jasonfi: How to pass an array to fastRows?, see https://forum.nim-lang.org/t/6875 |
08:07:18 | FromDiscord | <alehander42> i forgot to charge my phone battery (so stopped my hotspot) |
08:19:12 | FromDiscord | <Giamby> sent a long message, see http://ix.io/2zeM |
08:21:43 | FromDiscord | <Elegant Beef> So you're making JS but not garbage ๐ |
08:23:12 | FromDiscord | <Giamby> basically |
08:23:20 | Araq | creating toy languages is fine but I'm not interested :-) |
08:23:33 | FromDiscord | <Giamby> it's a toy now |
08:23:48 | FromDiscord | <Giamby> it should become production ready asap |
08:23:52 | FromDiscord | <Giamby> that's the goal |
08:23:56 | Araq | sure sure |
08:24:19 | FromDiscord | <Elegant Beef> So you're using nim to make a new intepreted language when nim has an intepreter ๐ |
08:24:27 | Araq | and then we have one more language that is like all the others but incompatible with them, it'll be great |
08:24:47 | FromDiscord | <Giamby> why should it be incompatible |
08:24:52 | FromDiscord | <Giamby> with FFI you can do anything |
08:25:13 | FromDiscord | <Giamby> I mean anyone could reason that about nim as well |
08:25:28 | FromDiscord | <Giamby> or about any language really |
08:25:42 | Araq | not really, no. only if you don't think it through. |
08:25:52 | FromDiscord | <Giamby> > So you're using nim to make a new intepreted language when nim has an intepreter ๐โต@Elegant Beef It's both a fun project and a learning experience |
08:26:28 | Araq | a VM FFI is not a magic wand |
08:27:15 | Araq | and writing the FFI code to bridge your VM and e.g Python's VM will be somebody's debugging hell |
08:29:20 | FromDiscord | <Giamby> I understand your reasoning, but I'm here to both improve my skills and knowledge about programming languages. I'm not a language hacker, but languages always charmed me and I'm hoping there's other people like me here who would like to help me out, that's it :) |
08:30:00 | FromDiscord | <Giamby> I'm not trying to compete with any other existing solution, but It would be nice being able to in the future |
08:30:00 | Araq | to improve your skills it's an excellent project |
08:30:36 | Araq | for "production" it's a nightmare. :-) |
08:30:48 | FromDiscord | <Elegant Beef> I do feel like nim is one of the harder languages to find developers for an interpreted language considering we've got nimscript ๐ |
08:31:47 | FromDiscord | <Giamby> I like challenges๐ป, I've developed mission critical backend software (and designed a custom protocol standard for one of those), it can't be much harder๐ |
08:32:17 | FromDiscord | <Giamby> @Elegant Beef I understand there's nimscript, but that's not my point |
08:33:51 | FromDiscord | <Giamby> if there's anyone interested, I'll be here ๐ |
08:36:44 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
08:36:49 | * | PMunch joined #nim |
08:37:29 | FromDiscord | <Giamby> Also @Araq[IRC]#0000, this is mainly a learning project so yeah |
08:39:02 | FromDiscord | <Rika> theyre just trying to learn is what i'm getting from their messages |
08:39:09 | * | arecacea1 quit (Remote host closed the connection) |
08:39:13 | FromDiscord | <Rika> yeah didnt see that last one there ๐ |
08:39:33 | * | arecacea1 joined #nim |
08:39:58 | Araq | Giamby: you can copy and modify compiler/vm.nim and get a good one |
08:40:24 | FromDiscord | <Rika> theyre trying to learn how to make one tho |
08:40:56 | Araq | that's easy, a while loop plus a case statement inside |
08:41:17 | FromDiscord | <flywind> !repo nim-lox |
08:41:17 | disbot | https://github.com/cabhishek/nimlox -- 9nimlox: 11Interpreter for the 'Lox' language written in Nim 15 31โญ 1๐ด 7& 3 more... |
08:41:41 | FromDiscord | <flywind> https://github.com/Yardanico/nim-lox |
08:45:05 | * | vicfred_ joined #nim |
08:45:48 | Araq | the reason why there are so many programming languages is because they are so easy to build. |
08:47:06 | * | vicfred quit (Ping timeout: 272 seconds) |
08:47:22 | FromDiscord | <ache of head> Oh, thanks for posting these! |
08:47:50 | FromDiscord | <ache of head> Seem like good resources |
08:49:36 | * | arecacea1 quit (Remote host closed the connection) |
08:50:32 | * | arecacea1 joined #nim |
08:58:40 | FromDiscord | <flywind> When I use `testament all` to test all tests, it causes an unexpected in one file. But when I test that file, everything is ok. Any idea? |
08:58:45 | FromDiscord | <flywind> https://media.discordapp.net/attachments/371759389889003532/760787704731664404/unknown.png |
08:58:52 | FromDiscord | <flywind> (edit) 'When I use `testament all` to test all tests, it causes an unexpected ... in' => 'When I use `testament all` to test all tests, it causes an unexpectederror' |
08:58:55 | Araq | test 'metatest' |
08:59:01 | Araq | test 'megatest' |
09:01:03 | * | agentofuser[m] quit (Quit: Idle for 30+ days) |
09:02:29 | FromDiscord | <flywind> D:\QQPCmgr\Desktop\prologue\tests\megatest.nim(1, 8) Error: cannot open file: nimcache\tests\megatest_0d61f8370cad1d412f80b84d143e1257\megatest_0.nim |
09:03:01 | FromDiscord | <flywind> ```nim c -r tests/megatest.nim``` |
09:07:49 | PMunch | zielmicha__, hi are you around? |
09:08:29 | FromDiscord | <Giamby> > Giamby: you can copy and modify compiler/vm.nim and get a good oneโต@Araq[IRC]#0000 that feels like cheating |
09:09:03 | FromDiscord | <Giamby> > that's easy, a while loop plus a case statement insideโต@Araq[IRC]#0000 that's the beginning tho |
09:09:43 | FromDiscord | <Giamby> > the reason why there are so many programming languages is because they are so easy to build.โต@Araq[IRC]#0000 I could argue that the basics are easy, but not so trivial |
09:10:32 | FromDiscord | <Giamby> there's possible bugs, then things like bytecode optimization such as constant folding or stack caching, string interning etc |
09:11:22 | FromDiscord | <Giamby> the main purpose for this project is for me to understand fully all of the concepts and algorithms that come into play when writing compilers and VMs and I learn by doing from scratch |
09:11:44 | FromDiscord | <Giamby> When I wanted to understand async deeply I created a simple yet working async event loop implementation for I/O and stuff |
09:11:58 | FromDiscord | <Giamby> but I'd like to push this further and make it more structured |
09:12:11 | FromDiscord | <flywind> I use lots of `block`, but when using `testament all`, the test is still polluted, I don't know why. |
09:12:45 | * | newUser joined #nim |
09:13:43 | newUser | hi, I have no idea for ptr ptr float initialisation, please can someone help: https://play.nim-lang.org/#ix=2zfx |
09:13:50 | FromDiscord | <flywind> I guess `testament all` collect many tests into one, and some released memory block is reuse again without collected. |
09:20:24 | FromDiscord | <Rika> newUser: is there a reason you're doing this in this way |
09:21:02 | newUser | translating from a cpp file |
09:21:15 | FromDiscord | <Rika> translating or ffi? |
09:21:29 | FromDiscord | <Rika> like, really translating or translating for ffi? |
09:21:33 | newUser | what is ffi? |
09:21:42 | FromDiscord | <Rika> interfacing nim with cpp |
09:22:01 | newUser | no, translating (for fun and exercise) |
09:22:05 | FromDiscord | <Rika> if you're just purely translating i suggest you to use actual nim types |
09:22:17 | newUser | array or seq? |
09:22:30 | FromDiscord | <Rika> seq |
09:22:49 | newUser | how to init 2 dim seq with newSeq? |
09:23:06 | newUser | newSeq[newSeq[float](17)](6)? |
09:23:10 | FromDiscord | <Rika> you can just leave it normally, it's initialized automatically |
09:23:24 | FromDiscord | <Rika> seqs are not nilable anymore |
09:23:29 | FromDiscord | <Rika> so they'll start out as empty |
09:23:46 | FromDiscord | <Rika> empty, but existing |
09:23:51 | newUser | k |
09:27:26 | bung | send a code paste https://play.nim-lang.org/#ix=2zfz |
09:33:43 | FromDiscord | <Vindaar> newUser, if you do want to init a 2D seq of some form use `newSeqWith` https://nim-lang.github.io/Nim/sequtils.html#newSeqWith.t%2Cint%2Cuntyped |
09:34:33 | newUser | <Vindaar> nice, thx |
09:35:33 | * | oz quit (Quit: EOF) |
09:35:48 | * | oz joined #nim |
09:38:51 | FromDiscord | <Gary M> is it possible to call a C macro from nim |
09:39:22 | FromDiscord | <Gary M> or do I have to expand the macro myself in nim |
09:40:15 | FromDiscord | <haxscramper> No, you cannot call c macro. The closes thing should be either wrapping it with c2nim or using .emit. depending on what your are after |
09:40:41 | FromDiscord | <Gary M> well the issue is the library I'm trying to interface abuses macros everywhere |
09:41:06 | FromDiscord | <Gary M> macros that expand into other macros etc lol |
09:41:28 | FromDiscord | <haxscramper> So it has horrible C API and they just wrapped everything in macros to make calling it not so painful, correct? |
09:41:40 | FromDiscord | <haxscramper> Then you should probably look into c2nim |
09:41:47 | FromDiscord | <Gary M> well, the api for working with it in C is fine |
09:42:02 | FromDiscord | <Gary M> I've already tried every interop solution under the sun |
09:42:13 | FromDiscord | <Gary M> I've never got any to work, ever |
09:42:21 | FromDiscord | <haxscramper> Can you link the library in question |
09:42:29 | FromDiscord | <Vindaar> unfortunately that's just the way it is sometimes @Gary M. The header files of R were so bad for me last weekend that I ended up wrapping the stuff I needed manually, because c2nim was choking all over the place |
09:42:35 | FromDiscord | <Gary M> https://github.com/SanderMertens/flecs |
09:43:16 | FromDiscord | <Gary M> so the C api for working with this is like ECS_COMPONENT(world, Position); |
09:43:31 | FromDiscord | <Gary M> sent a long message, see http://ix.io/2zfA |
09:43:53 | FromDiscord | <Gary M> so the macro expands it to basically have generics for other structs |
09:44:26 | FromDiscord | <haxscramper> So you are talking about things like `Copy convenience macro */โต#define ECS_COPY_IMPL(type, dst_var, src_var, ...)\` which expands to something else |
09:44:27 | FromDiscord | <Gary M> which looks rather ugly like: ECS_ENTITY_VAR(component) = ecs_new_component(world, 0, "component", sizeof(component), ECS_ALIGNOF(component)); ECS_VECTOR_STACK(FLECS__Tcomponent, ecs_entity_t, &FLECS__Ecomponent, 1); (void)ecs_entity(component); (void)ecs_type(component) |
09:44:47 | FromDiscord | <Gary M> which... has more macros |
09:44:48 | FromDiscord | <Gary M> lol |
09:45:15 | FromDiscord | <Gary M> again, using it in C, works fine.... interop outside of C, ehhhhhhh |
09:45:24 | FromDiscord | <mratsim> @Gary M @haxscramper you can call C macros |
09:45:30 | FromDiscord | <Gary M> how |
09:45:38 | FromDiscord | <Vindaar> you can try to run `gcc -E` on the file to let `gcc` expand the macro. Then take the expansion and make it a Nim template |
09:46:02 | FromDiscord | <Vindaar> @mratsim huh? using `emit`? |
09:46:06 | FromDiscord | <mratsim> no |
09:46:16 | FromDiscord | <mratsim> using importc |
09:46:23 | FromDiscord | <haxscramper> Oh |
09:46:27 | FromDiscord | <mratsim> I had an example in Weave, looking for an old commit |
09:46:34 | FromDiscord | <Vindaar> interesting |
09:46:38 | FromDiscord | <haxscramper> Yes, inportc it is just dumb codegen actually |
09:46:40 | FromDiscord | <Gary M> I'd like to see that |
09:47:31 | FromDiscord | <mratsim> https://github.com/mratsim/weave/blob/5ce845517948ef7011412fa41055c9472d57e045/experiments/e04_channel_based_work_stealing/primitives/coz.nim#L21-L23 |
09:47:45 | FromDiscord | <mratsim> wrapping this: https://github.com/mratsim/weave/blob/5ce845517948ef7011412fa41055c9472d57e045/experiments/e04_channel_based_work_stealing/primitives/coz.h#L79 |
09:48:02 | FromDiscord | <Vindaar> mind blown |
09:48:14 | FromDiscord | <Gary M> thanks, I'll take a look |
09:49:30 | FromDiscord | <mratsim> When we say Nim has the best C / C++ interop, it really means the best ๐ |
09:53:04 | bung | how to wraps a proc like `wrapApi( rawQuery )` ? |
09:53:34 | bung | it can't take the rawQuery as nnkProcDef |
09:54:46 | * | synthmeat quit (Quit: WeeChat 2.9) |
09:56:06 | * | synthmeat joined #nim |
09:59:20 | Araq | just forget about C ECS frameworks, it's trolling via code |
10:00:50 | FromDiscord | <Gary M> I like ECS, so I'll withstand the trolling ๐ |
10:00:58 | Araq | just use an object of arrays instead of an array of objects. yes it's super annoying in practice, you can sugar over it with Nim's templates |
10:01:17 | Araq | no need to wrap anything for that... |
10:01:17 | FromDiscord | <Gary M> besides, I simply cannot get C++ to compile either |
10:02:09 | Araq | if you cannot get things to compile you have very different problems from "omg, I lose 8ns because the cache line is not saturated" |
10:04:50 | FromDiscord | <Gary M> I mean yes I definitely don't have those problems lol |
10:05:20 | FromDiscord | <Gary M> everything works with the default gcc compiler on windows, but as soon as I try to compile the simplest application with g++ it just doesn't work. |
10:07:18 | * | Tlangir joined #nim |
10:08:18 | FromDiscord | <lqdev> Araq but ECS doesn't just imply better performance, it also has a nicer code structure esp. for a language like Nim where you cannot have recursive module dependencies |
10:09:25 | * | Tanger quit (Ping timeout: 244 seconds) |
10:10:10 | Araq | I don't agree but let's say you're completely right. why do need to wrap anything to get it? it's not really much code to write an ECS |
10:10:10 | FromDiscord | <alehander42> @Giamby cool ! |
10:10:40 | FromDiscord | <alehander42> ok back to work today from now: hm, i allocate a sequence >= 900k times |
10:11:02 | FromDiscord | <alehander42> my favorite stat from yesterday |
10:15:52 | newUser | please can someone help: https://play.nim-lang.org/#ix=2zfM |
10:15:55 | * | kinkinkijkin quit (Ping timeout: 240 seconds) |
10:16:16 | FromDiscord | <mratsim> use a proc not a template |
10:16:17 | FromDiscord | <lqdev> why template? |
10:16:32 | FromDiscord | <mratsim> C templates map to Nim generic procs |
10:16:38 | FromDiscord | <lqdev> also, generic params go after the export marker |
10:16:48 | FromDiscord | <lqdev> https://play.nim-lang.org/#ix=2zfN |
10:17:16 | newUser | yup, thx |
10:28:17 | * | dv-^_^6 quit (Quit: The Lounge - https://thelounge.chat) |
10:44:05 | PMunch | Hmm, trying to figure out how to use dbus to create a notification daemon, this stuff is tricky.. |
10:45:54 | newUser | bye |
10:45:58 | * | newUser quit (Remote host closed the connection) |
10:49:31 | * | Tlangir quit (Remote host closed the connection) |
10:53:59 | * | noname joined #nim |
10:54:32 | noname | was any decision taken / rfc written regarding https://github.com/nim-lang/Nim/pull/15282#pullrequestreview-484151422 ? |
10:54:33 | disbot | โฅ borrow checking |
10:58:05 | * | noname quit (Remote host closed the connection) |
11:08:39 | planetis[m] | a few days back i finished a port of an breakout clone written using ecs https://github.com/planetis-m/breakout-ecs |
11:09:10 | planetis[m] | the original was created in typescript and already had c and rust ports |
11:09:54 | planetis[m] | plus I added some improvements of my own |
11:16:00 | FromDiscord | <whisperdev> Does Nim have interfaces? |
11:17:19 | planetis[m] | yes |
11:17:19 | FromDiscord | <Rika> !repo interfaced |
11:17:20 | disbot | https://github.com/andreaferretti/interfaced -- 9interfaced: 11 15 27โญ 4๐ด & 29 more... |
11:17:50 | planetis[m] | or just https://www.openmymind.net/Interfaces-In-Nim/ |
11:21:35 | bung | undeclared identifier: 'await' , how to fix this , when I call `ident("await")` in macro |
11:25:19 | * | synthmeat quit (Remote host closed the connection) |
11:26:19 | * | lritter quit (Ping timeout: 244 seconds) |
11:26:25 | * | synthmeat joined #nim |
11:26:49 | FromDiscord | <Vindaar> are you sure the generated code is inside of an async procedure? |
11:27:09 | FromDiscord | <Gary M> well I got one of the macros to work so that's fun |
11:27:21 | * | synthmeat quit (Client Quit) |
11:27:26 | FromDiscord | <Gary M> but the next one is giving me more trouble because of the varargs |
11:28:57 | bung | Vindaar , it's in template |
11:30:44 | FromDiscord | <Vindaar> not quite following. `await` is only valid inside procs annotated with the `async` pragma iirc. So if your macro generates code that ends up outside of such a proc it throws that error |
11:32:26 | bung | await in template works well since 1.3.1 AFAIK |
11:32:58 | bung | https://play.nim-lang.org/#ix=2zg8 I also can't make this work |
11:34:47 | * | narimiran quit (Ping timeout: 240 seconds) |
11:34:55 | bung | well, it works when the hello proc is sync, maybe I should create a issue for this |
11:35:13 | * | natrys joined #nim |
11:37:55 | FromDiscord | <Vindaar> hm, maybe. I'm no help here :/ |
11:40:43 | * | orazovae[m] left #nim ("User left") |
11:42:18 | bung | the only way I know is write this macro as a pragma attach to original proc |
11:43:00 | bung | but I dont want touch original procs |
11:43:44 | FromDiscord | <Vindaar> the issue to me is due to the complexity of the async macro, there's a lot of ways to run into weird problems trying to modify those |
11:44:39 | FromDiscord | <Vindaar> as in elements of the body already being turned into symbols, which causes problems when reinserting the modified code with the same symbols cte |
11:44:42 | FromDiscord | <Vindaar> *etc |
11:46:10 | * | dv-^_^6 joined #nim |
11:49:37 | bung | yeah, the await template appears when compile async proc |
11:50:44 | bung | it will be a problem when I wrap it as a new template |
11:55:15 | * | altarrel joined #nim |
11:56:23 | * | opal quit (Ping timeout: 240 seconds) |
11:59:26 | * | opal joined #nim |
12:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
12:06:34 | * | supakeen joined #nim |
12:15:07 | * | sagax quit (Remote host closed the connection) |
12:24:54 | * | krux02 joined #nim |
12:25:24 | * | luis_ joined #nim |
12:31:33 | * | synthmeat joined #nim |
12:40:56 | * | waleee-cl joined #nim |
12:41:20 | * | sagax joined #nim |
12:44:55 | Araq | so ... what can we do about https://github.com/nim-lang/RFCs/issues/178 ? |
12:44:55 | disbot | โฅ lent/var/openArray inside objects/containers |
12:45:23 | Araq | the more time I spent on it, the more I realize I have no clue how this feature should really work |
12:45:28 | * | luis_ quit (Quit: luis_) |
12:46:00 | Araq | it's fairytale stuff, I don't even know what a borrow operation **is** |
12:46:29 | Araq | it's some assignment to a view type, but not all of them |
12:47:08 | Araq | and you want to allow assignments between view types so that Table[int, ViewType] can compile |
12:48:12 | * | luis_ joined #nim |
12:51:21 | * | arecacea1 quit (Remote host closed the connection) |
12:51:40 | * | arecacea1 joined #nim |
13:04:07 | * | altarrel quit (Quit: WeeChat 2.8) |
13:05:18 | * | altarrel joined #nim |
13:13:56 | ForumUpdaterBot | New thread by Bung: How to wraps async proc, see https://forum.nim-lang.org/t/6876 |
13:18:37 | FromDiscord | <shad0w> sent a code paste, see https://play.nim-lang.org/#ix=2zgA |
13:19:16 | FromDiscord | <shad0w> Is there any way that the function that i pass to mul can access whatever function i pass to add ? |
13:19:28 | FromDiscord | <shad0w> (edit) 'mul' => '`mul`' | 'add' => '`add`' |
13:20:11 | FromDiscord | <shad0w> if i want to define a function in terms of another, or is it a no go ? |
13:23:42 | Araq | I don't understand the question |
13:24:16 | FromDiscord | <shad0w> hi Araq. something analogous to javascripts `this` ? |
13:24:44 | FromDiscord | <Rika> no |
13:24:47 | FromDiscord | <Rika> not that i know of |
13:24:55 | Araq | I never understood JS's 'this' |
13:25:05 | FromDiscord | <Rika> unless you pass the type into the function |
13:25:19 | FromDiscord | <Rika> like mul: proc(this: MyType, x:... |
13:26:31 | FromDiscord | <shad0w> sent a code paste, see https://play.nim-lang.org/#ix=2zgF |
13:26:41 | FromDiscord | <shad0w> (edit) 'https://play.nim-lang.org/#ix=2zgF' => 'https://play.nim-lang.org/#ix=2zgG' |
13:27:25 | Araq | ok, now I understand 'this' |
13:27:29 | Araq | yeah, Nim doesn't have it |
13:27:53 | FromDiscord | <shad0w> > I never understood JS's 'this'โต@Araq[IRC]#0000 that just means. in whichever context this function runs (the stack context) find the value that i am asking for in THAT context |
13:28:51 | Araq | the question always was what 'context' means, but it's the thing you write before the dot |
13:28:59 | Araq | (roughly) |
13:29:07 | FromDiscord | <shad0w> it's runtime |
13:34:06 | FromDiscord | <exelotl> @shad0w If I understand correctly, you can do what you want if you add a `self: MyType` as the first param to each procedure |
13:35:05 | FromDiscord | <shad0w> cant really say what scope it will run in exactly, until it does run in it. (event handlers? async stuff ? stuff that completes later, after the function that called it is long returned ? ) and whatever the scope is at that time (the context?), fetch me the value of the thing i asked after the dot.โตโต `this` is really untrival to explain clearly, you kindda sorta get a intuition for this over repeated use(abuse?). |
13:36:13 | FromDiscord | <shad0w> > @shad0w If I understand correctly, you can do what you want if you add a `self: MyType` as the first param to each procedureโต@exelotl i could. i was just wondering if there is an inbuilt way for this in nim, since i am a newbie ? |
13:37:38 | FromGitter | <alehander92> wow `this` is not simpl |
13:37:41 | FromGitter | <alehander92> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this |
13:38:43 | FromDiscord | <shad0w> > @exelotl i could. i was just wondering if there is an inbuilt way for this in nim, since i am a newbie ?โต@shad0w wait no, this wont work ? i'd need the reference of the object that i am initialzing in the first place ? |
13:39:50 | FromDiscord | <shad0w> var m: MyType = MyType(x=1,y=1, add=fn Ref, mul=fn_ref) |
13:39:53 | FromDiscord | <exelotl> @shad0w I'm using a similar design in my game because I needed VTable kind of behaviour https://media.discordapp.net/attachments/371759389889003532/760858452833730571/unknown.png |
13:41:36 | FromDiscord | <exelotl> but this is because I'm working without the GC and needed more control than Nim's `method`s |
13:41:55 | FromDiscord | <Rika> @shad0w that is fine, because you will be calling the function like `m.mul(m, someint, someint2)` |
13:42:24 | FromDiscord | <exelotl> yep, that ^ |
13:42:24 | FromDiscord | <shad0w> > @shad0w that is fine, because you will be calling the function like `m.mul(m, someint, someint2)`โต@Rika i see. |
13:42:34 | FromDiscord | <Rika> note that m is written twice |
13:42:40 | FromDiscord | <shad0w> i got that. |
13:42:45 | FromDiscord | <Rika> okay |
13:42:56 | FromDiscord | <shad0w> at which point, i just might rip it out of m |
13:43:09 | FromDiscord | <shad0w> mul m, someint, someint2 |
13:43:41 | FromDiscord | <exelotl> to avoid the self parameter you might want to try using RootObj + methods instead |
13:44:03 | FromDiscord | <exelotl> that's the more idiomatic way to do dynamic dispatch in Nim |
13:44:07 | FromDiscord | <shad0w> i'd avoid inheritance if i could |
13:44:32 | Zevv | yeah I made kids. would not recommend. |
13:45:03 | FromDiscord | <shad0w> wait, wut |
13:47:54 | * | luis_ quit (Quit: luis_) |
13:48:20 | * | luis_ joined #nim |
13:51:02 | * | luis_ quit (Client Quit) |
13:53:47 | disruptek | lol |
13:53:58 | disruptek | !last zevv |
13:53:59 | disbot | Zevv spoke in 12#nim 9 minutes ago 12https://irclogs.nim-lang.org/30-09-2020.html#13:44:32 |
13:54:04 | Zevv | wut |
13:54:05 | disruptek | now it's immortalized. |
13:54:40 | disruptek | how are you, zevv? |
13:55:00 | Zevv | overwhelmed but enjoying myself thoroughly |
13:55:38 | disruptek | what are you working on? |
13:56:17 | * | Trustable joined #nim |
13:57:03 | Zevv | the usual stuff at $customer. But there's all kind of interesting organizational things going on, it's Interesting Times |
13:57:18 | Zevv | given that this channel is logged, I'll not go into details :) |
13:57:29 | disruptek | hehe |
13:57:31 | Zevv | everything you #nim can and might be used against you |
13:57:40 | disruptek | i'm counting on it. |
13:57:53 | FromDiscord | <Recruit_main707> Default values for object fields was something planned? |
13:58:26 | Zevv | and you? got your villa at the lake yet? |
13:59:15 | disruptek | recruit: yep. |
13:59:37 | disruptek | no, i just got back from moving my parents. and retrieving a car from storage. |
14:00:05 | disruptek | man, it's been so long since i had a proper drive. |
14:00:10 | Zevv | you didn't have to move in with your parents, at least |
14:00:17 | Zevv | not yet |
14:00:24 | disruptek | i did that earlier. |
14:00:30 | Zevv | didn't we all |
14:01:02 | disruptek | it's a plague across this country. i hate it. |
14:01:47 | Zevv | I was expected to have a good laugh this morning. but I really had to switch that off after a minute or two |
14:02:03 | Zevv | but let's not go into the details |
14:02:47 | * | altarrel quit (Quit: WeeChat 2.8) |
14:03:01 | disruptek | well, my 911 still raises my spirits. i forgot how much we need something like that. |
14:03:42 | disruptek | and i killed a mouse in the trailer last night, so there's that. |
14:03:53 | disruptek | what have you killed lately? |
14:04:54 | Zevv | I caught one in a mouse-friendly trap that didn't turn out too mouse-friendly because the tail was stuck |
14:05:04 | Zevv | put it out 1 km away in the forst. Took it about 15 minutes to get back |
14:05:18 | Zevv | caught it a second time, put it away 2 KM. Not made it back yet. |
14:05:32 | Zevv | it's wife was still here, however, so caught that as well and put it out 2 KM |
14:05:41 | disruptek | same direction? |
14:05:43 | Zevv | took about half an hour to get back and climb in throuhg the window again |
14:05:45 | Zevv | yeah |
14:06:09 | disruptek | i used the friendly traps for awhile. used to get 4-5 mice in one trap every night. |
14:06:31 | disruptek | then i took a trip and forgot to pick up one of the "friendly" traps. |
14:06:31 | Zevv | well, it's common voles, so I'm not keen on termintaing hem |
14:06:35 | disruptek | i won't do that again. |
14:06:38 | Zevv | they just come in, steal some food and go out again |
14:06:39 | Zevv | kind of like that |
14:06:49 | Zevv | ooh the smell? |
14:06:54 | disruptek | just cruel. |
14:06:59 | Zevv | or just the act of killing them like that |
14:06:59 | Zevv | right |
14:07:05 | Zevv | yeah I felt sorry for the one with the tail |
14:07:10 | Zevv | the good thing is that I recongnize it now |
14:07:16 | Zevv | it's the one with the dent |
14:07:22 | disruptek | voles already have short tails, no? |
14:07:33 | Zevv | kind of. but long enough to get stuck |
14:07:41 | Zevv | but I like them, they don't piss in the house or make nests |
14:07:55 | disruptek | no problem, then. |
14:08:05 | Zevv | late evening the come speeding throuhg the house. I leave them a snack and wave. and they go again |
14:08:17 | Zevv | oh you don't have these in the states? |
14:08:17 | Zevv | wow |
14:08:23 | Zevv | I thought they would be pretty common |
14:08:43 | disruptek | i don't mind mice running across my legs while i'm working. i just don't like the scent of their urine dripping down the walls. |
14:08:55 | Zevv | yeah, that's the difference :) |
14:09:02 | Zevv | my kids had rats for some time. never ever again |
14:09:05 | disruptek | i don't love the idea of their eating through my pantry and leaving dead family members in my walls. |
14:09:12 | Zevv | right so |
14:09:19 | Zevv | voles just like to sleep out side I guess |
14:09:32 | disruptek | i had rats for awhile. i bred different coloration patterns. |
14:09:54 | Zevv | I liked their characters, but hated the piss |
14:10:09 | disruptek | i have a video of bentley inspecting a vole in the yard. |
14:10:46 | disruptek | imgur does video, right? |
14:10:56 | Zevv | snippets |
14:13:04 | disruptek | what the hell is a snippet? |
14:13:14 | Zevv | I mean just a short fragment |
14:13:16 | Zevv | a few secs |
14:15:12 | * | disruptek tries to find a 10 year old to help him post something. |
14:17:20 | Zevv | dude you should tiktok that shit |
14:17:29 | disruptek | just what i need. |
14:17:53 | Zevv | oh wait that's illegal, right? |
14:18:10 | disruptek | the way i use tiktok is illegal, yeah. |
14:18:16 | Zevv | hooo |
14:18:40 | disruptek | vermont is gorgeous this time of year. it's a shame all the colorful leaves will be blown off the trees today. |
14:18:59 | Zevv | that's what makes it so beautiful |
14:19:35 | Zevv | This time of year I alwas pick up one nice big conker on my daily hikes and put it on the table, all in a row over the days |
14:19:44 | Zevv | so the latest is big and shiny and has a great smell |
14:19:52 | Zevv | the oldest is shrinking, getting dull and wrinkly |
14:20:03 | Zevv | and they just lie around all year. Until half of september |
14:20:36 | Zevv | looking like rasins by that time |
14:20:38 | disruptek | remind me about conkers. |
14:20:45 | Zevv | hey disruptek |
14:22:16 | disruptek | i mean the game, chucklehead. |
14:22:23 | Zevv | ooow |
14:22:57 | Zevv | my kids always play it wrong |
14:23:08 | Zevv | they hit eachother and scream loud until I break |
14:24:20 | disruptek | yeah, but how is the game supposed to be played? |
14:24:31 | Zevv | I don't know. It's nothing dutch |
14:24:38 | disruptek | hmm. |
14:24:48 | Zevv | I believe you take one each, smack them into eachother and see which once survices |
14:24:53 | disruptek | i didn't know that was a prerequisite for you. |
14:24:54 | Zevv | they do that with raw eggs here |
14:25:41 | disruptek | oh, i have a talent for smacking nuts. |
14:26:20 | disruptek | imgur doesn't support my vole video. such a shame. |
14:26:26 | Zevv | bah |
14:26:54 | disruptek | where are we on cps? |
14:27:06 | disruptek | it's supposed to work with arc now, right? |
14:27:10 | Zevv | I have no clue. I forgot what that was |
14:27:44 | disruptek | i am pulling the first-proc-param-is-included-in-proc-name out of mangling. |
14:28:10 | disruptek | i just cannot make it work right now, and i'd rather move on to ic. |
14:28:24 | Zevv | man you're still chewing on that |
14:28:43 | disruptek | it's too boring for me, honestly. |
14:29:24 | Zevv | hmm got a meeting and a call and stuff. that's also getting kind of boring... |
14:29:26 | Zevv | bbl! |
14:45:17 | * | dv-^_^6 quit (Quit: The Lounge - https://thelounge.chat) |
14:47:44 | * | luis_ joined #nim |
15:05:51 | FromDiscord | <lqdev> is there a "symbol" (interned string) library for nim? |
15:06:11 | FromDiscord | <lqdev> didn't find anything on nimble |
15:19:26 | * | a_chou joined #nim |
15:22:46 | * | hnOsmium0001 joined #nim |
15:24:39 | leorize[m]1 | then probably there aren't any |
15:24:59 | leorize[m]1 | what is this "interned string" thingy btw? :P I read up on wikipedia but still not sure what exactly is it |
15:25:12 | * | leorize[m]1 quit (Quit: issued !quit command) |
15:25:12 | FromDiscord | <lqdev> an immutable string with a precomputed hash basically |
15:25:32 | FromDiscord | <lqdev> it's represented by an ID |
15:25:37 | FromDiscord | <lqdev> so table lookups are fast |
15:26:41 | Araq | it's a poor man's enum :P |
15:27:23 | disruptek | yep. |
15:27:37 | FromDiscord | <lqdev> yeah, kind of |
15:28:11 | FromDiscord | <lqdev> i need them because you can't expand an enum easily |
15:28:24 | FromDiscord | <lqdev> also things like language string lookups are much faster |
15:28:35 | disruptek | don't be rude. of course you can. |
15:28:46 | disruptek | E n u m |
15:29:01 | Araq | lqdev: you can compute string hashes at compile-time |
15:29:04 | FromDiscord | <lqdev> wow that's a t h i c c enum you got there disruptek |
15:29:10 | disruptek | right? |
15:29:22 | Araq | and thus Nim offers everything to build one |
15:29:32 | FromDiscord | <lqdev> Araq: yeah, i know |
15:29:38 | FromDiscord | <lqdev> that's what i'm doing right now |
15:29:43 | Araq | enums are still much better as they are typo safe |
15:29:51 | disruptek | he's trying to make his code harder to understand. |
15:30:00 | FromDiscord | <lqdev> yeah, i agree that enums are better |
15:30:10 | FromDiscord | <lqdev> but sometimes symbols are more flexible |
15:30:12 | * | leorize joined #nim |
15:30:36 | disruptek | can you give me an example? |
15:31:21 | FromDiscord | <lqdev> i am developing a "tracer" system for debugging physics - basically, physics objects can request drawing stuff during the update process |
15:31:25 | FromGitter | <alehander92> e.g. cases where you might have dynamic source of values? |
15:31:35 | FromDiscord | <lqdev> i want to be able to filter what gets draw |
15:31:38 | FromDiscord | <lqdev> drawn* |
15:31:38 | FromGitter | <alehander92> i guess if you want to ensure stuff is only one of n "init"-ed values |
15:31:49 | FromGitter | <alehander92> but you init them on runtime, that's a bit tough to represent with enums |
15:31:57 | FromDiscord | <lqdev> and using strings as tags is gonna be slow |
15:32:08 | FromDiscord | <lqdev> and enums are too inflexible for that |
15:32:14 | disruptek | sounds like sets of enums. |
15:32:23 | FromDiscord | <lqdev> no disruptek |
15:32:31 | Araq | you can also do |
15:32:32 | FromDiscord | <lqdev> my engine would need to define a fixed set of categories |
15:32:39 | FromDiscord | <lqdev> which i don't want |
15:32:46 | Araq | type Thing = distinct uint8 |
15:32:52 | Araq | type Filter = set[Thing] |
15:33:03 | Araq | const systemA = Thing(1) |
15:33:06 | disruptek | that seems even less useful. |
15:33:13 | FromDiscord | <lqdev> hm true |
15:33:21 | Araq | const systemB = Thing(2) # look, can put this in a different file |
15:33:31 | FromDiscord | <lqdev> but autoincrementing the Thing number would be a nice thing to have |
15:33:41 | disruptek | i do a lot of set/enum/const gymnastics in gully. |
15:33:45 | disruptek | !repo gully |
15:33:46 | disbot | https://github.com/disruptek/gully -- 9gully: 11a code comment formatter 15 1โญ 0๐ด |
15:33:47 | Araq | you can do that with a .compileTime variable |
15:34:01 | FromDiscord | <lqdev> true |
15:34:02 | disruptek | i think you're making this hard than it needs to be. |
15:34:08 | disruptek | ^ harder, too. |
15:34:19 | Araq | I'm not sure it's a good idea, stable values are better when you ever debug your code |
15:34:36 | FromGitter | <alehander92> you can just have a wrapper ? `systemA = initThing()` |
15:34:47 | FromGitter | <alehander92> which uses the compile time var inside |
15:35:21 | * | a_chou quit (Remote host closed the connection) |
15:36:09 | FromDiscord | <lqdev> yea, but what if i have tons of language strings? i'd have to do that for every one of them |
15:36:29 | FromDiscord | <lqdev> a bit annoying imo |
15:37:00 | Araq | 'what if' you don't? you cannot program against what-ifs. what if the coworker also wants to understand your complex solution? |
15:37:35 | Araq | what if you need to port your code over to Java which lacks compile-time variables? I hate what-if. |
15:37:48 | Araq | you can whatif everything |
15:37:59 | disruptek | if only there was a way to make a device that could do one verbose operation over and over without human intervention. |
15:38:03 | Araq | do you have tons of language strings? |
15:38:17 | FromDiscord | <lqdev> well, not yet. but i expect to |
15:38:25 | disruptek | store them in code, not csv or json. |
15:38:37 | disruptek | make sure whatever you do, you don't structure them at all. |
15:38:53 | disruptek | it's important that a computer cannot do the job of your coworker. |
15:38:56 | * | luis_ quit (Quit: luis_) |
15:39:19 | Araq | lqdev: is it related to i18n ? |
15:39:20 | * | luis_ joined #nim |
15:39:25 | FromDiscord | <lqdev> yes. |
15:40:23 | Araq | ah, now we're getting somewhere |
15:40:50 | Araq | I designed a library for that use case, not sure if I kept the code |
15:42:13 | Araq | karax/i18.nim |
15:42:45 | Araq | was written for the JS target |
15:45:25 | Araq | I used Table[string, string] but you can indeed do better than that. Easiest way it to compute a hash at compile-time and don't bother with incrementing a global counter (which breaks modularity) |
15:45:57 | Araq | simply add some runtime check that you never got a hash collision |
15:46:47 | Araq | (and you won't for any hash function that is at least mediocre) |
15:48:08 | FromDiscord | <lqdev> hm |
15:48:21 | leorize | we have several i18n libraries iirc |
15:48:50 | FromDiscord | <lqdev> yeah but it's not just about i18n |
15:49:26 | FromDiscord | <lqdev> there are many more usecases for a symbol library, at least in my opinion |
15:49:43 | FromDiscord | <lqdev> there probably exist faster solutions, but i do not want to overoptimize my code. |
15:50:06 | FromDiscord | <lqdev> so one of those use cases is a modding API for my game |
15:50:35 | FromDiscord | <lqdev> modders will be able to arbitrarily add blocks and stuff, and of course storing a tile's name for each tile on the map is very inefficient |
15:50:36 | Araq | i18n is also about a format like DSL that allows for pluralizations etc |
15:50:51 | FromDiscord | <lqdev> so a simple solution would be storing a symbol |
15:50:57 | FromDiscord | <lqdev> and i do not want to overengineer this |
15:51:17 | FromDiscord | <lqdev> i want the API to be simple to use and understand. i don't want to require the modder to first fetch a special block ID thing |
15:51:23 | FromDiscord | <lqdev> just provide the name |
15:52:56 | bung | circular dependecies is headache, move code around every time |
15:52:57 | Araq | if you don't want to overengineer it, use an enum |
15:53:18 | FromDiscord | <lqdev> so we're back to square one. |
15:53:20 | Araq | you can map the ordinal value to a line number in a text file |
15:53:37 | Araq | and then for i18n you simply use a different text file |
15:53:52 | Araq | translators have it easy, one file they have to translate |
15:54:29 | Araq | extra points if the format strings are position independent (use $1 and not %s) |
15:55:03 | FromGitter | <alehander92> but lqdev what happens if people access a symbol that doesnt exist |
15:55:13 | FromGitter | <alehander92> does it just gets auto-initialized |
15:55:30 | FromGitter | <alehander92> or is there not a concept of "acceptable set of values" |
15:56:20 | * | NimBot joined #nim |
15:56:34 | FromDiscord | <lqdev> it's just created |
15:56:45 | FromDiscord | <lqdev> i do agree it's less type safe |
15:57:05 | FromDiscord | <lqdev> it has its drawbacks just like the enum approach |
15:57:15 | FromDiscord | <lqdev> you go either safe or easily expandable |
16:01:26 | FromGitter | <alehander92> well, if you force the user to handle the case when it's not a valid symbol |
16:01:32 | FromGitter | <alehander92> it's maybe similarly safe |
16:01:49 | FromGitter | <alehander92> but it might be more verbose |
16:02:28 | Araq | the enum is a better fit because for translations you need to know *all* the strings to be translated |
16:02:44 | Araq | so you might as well enumerate them in a single place |
16:03:01 | * | uhoh joined #nim |
16:03:10 | uhoh | Why Nim over Rust? |
16:03:39 | supakeen | Why not :) |
16:03:47 | leorize | we have nicer syntax with pretty much the same safety :P |
16:03:49 | FromDiscord | <lqdev> yes Araq, but not when you have a plugin/modding API |
16:03:56 | leorize | not as big ecosystem though |
16:03:58 | Araq | cause it has fewer different pointer types and is more convenient |
16:04:20 | uhoh | Araq What about the fact that Rust doesn't have a garbage collector? |
16:04:25 | FromDiscord | <lqdev> uhoh: primarily because it's less verbose. |
16:04:37 | FromDiscord | <lqdev> nim also has deterministic memory management, --gc:arc |
16:05:13 | uhoh | FromDiscord What does "deterministic memory management" mean? |
16:05:20 | Araq | "no GC" |
16:05:34 | FromDiscord | <mratsim> it means you know at compile-time when memory/resource is released |
16:05:41 | krux02 | uhoh: FromDiscord is not a user name |
16:06:20 | Araq | (even though reference counting is a GC and thus Rust and C++ are GC'ed too) |
16:06:39 | FromDiscord | <mratsim> it's a memory management technique, not a GC ๐ |
16:07:04 | leorize | I guess popular belief is that GC = stack scanning monster that locks your program up |
16:07:11 | FromDiscord | <mratsim> there is not garbage with refcounting because it's collected immediately as it's not useful, so you don't put it in a "bin" |
16:07:22 | krux02 | "deterministic memory management" means no garbage collection interrupiton of the program |
16:07:41 | FromDiscord | <mratsim> well you have ref deletion amplification |
16:08:06 | FromDiscord | <mratsim> when you remove the last ref of a long leaf node and then you need to collect the whole tree/graph |
16:08:25 | FromDiscord | <lqdev> is reading elements from a single table thread-safe? |
16:08:27 | FromDiscord | <lqdev> i'd expect it to be |
16:08:31 | FromDiscord | <lqdev> but not writing |
16:08:37 | leorize | @lqdev locks |
16:08:43 | leorize | always use locks |
16:08:47 | FromDiscord | <lqdev> leorize: even for writing? |
16:08:50 | FromDiscord | <lqdev> gah |
16:08:51 | FromDiscord | <lqdev> reading* |
16:08:51 | leorize | even for reading |
16:08:53 | Araq | mratsim, true but not related to refcounting, a tree of unique pointers has the same downside |
16:09:00 | FromDiscord | <lqdev> leorize: why? |
16:09:00 | uhoh | How does Nim handle errors? |
16:09:06 | FromDiscord | <lqdev> uhoh: exceptions |
16:09:14 | FromDiscord | <mratsim> or Result, or bool or options |
16:09:28 | leorize | @lqdev because cpu caches :P ask mratsim |
16:09:31 | FromDiscord | <mratsim> and you can enforce exceptions handling or not raising exceptions |
16:09:52 | krux02 | lqdev: Don't expect things to be "thread safe", thread safe means that it locks internally, which is an expensive overhead on single threaded applications. |
16:09:52 | FromDiscord | <lqdev> @mratsim i'm asking you then, why do i need a lock when reading or writing to a table? |
16:09:57 | FromDiscord | <mratsim> "Multithreading pitfalls for the unsuspecting dev" |
16:10:22 | * | natrys quit (Quit: natrys) |
16:10:45 | FromDiscord | <mratsim> A Nim table assume a single threaded portion of the program so in that case you don't need a lock. If multithreaded, don't use Nim tables so you wouldn't need a lock either ๐ |
16:10:47 | krux02 | lqdev: you don't want Tables to have locking overhead on single thread applications, or do you? |
16:10:55 | uhoh | lqdev: Why exceptions over functors? |
16:11:01 | FromDiscord | <lqdev> krux02: of course not |
16:11:03 | uhoh | Does Nim have null? |
16:11:11 | krux02 | yes |
16:11:11 | leorize | uhoh: Araq can answer that for you |
16:11:20 | leorize | and yes we have null, it's called `nil` here |
16:11:24 | FromDiscord | <mratsim> functors are not a way to handle errors |
16:11:41 | uhoh | mratsim: What do you mean? |
16:11:46 | Araq | uhoh, please read one of our tutorials. |
16:11:58 | uhoh | Araq sure |
16:12:00 | leorize | anyone have a good write up on why we don't use result types? |
16:12:10 | disruptek | what? |
16:12:22 | leorize | I'll just add that to disbot so we can refer people to it whenever someone asks :P |
16:12:24 | disruptek | what are result types? |
16:12:28 | krux02 | uhoh: you are asking basic question here, they are not hard to answer, but they are also pretty well covered by the tutorials. |
16:12:29 | leorize | Result[T] |
16:12:35 | FromDiscord | <mratsim> A functor is a map between categories, unless you meant handling errors with Monad like Result or Either types |
16:13:05 | FromDiscord | <mratsim> @leorize, because it needs a maintainer in the stdlib |
16:13:25 | FromDiscord | <mratsim> This has been reviewed in security audits btw: https://github.com/status-im/nim-stew/blob/master/stew/results.nim |
16:13:39 | leorize | everything needs a maintainer, and there will be if there's interest for it in the core language |
16:13:42 | disruptek | well, i use result types and i like them. |
16:13:46 | disruptek | !repo badresults |
16:13:46 | disbot | https://github.com/disruptek/badresults -- 9badresults: 11like results but worse 15 1โญ 0๐ด |
16:14:10 | leorize | Araq is very insistent on exceptions as default instead of result types |
16:14:16 | FromDiscord | <mratsim> https://github.com/disruptek/badresults/blob/master/badresults.nim#L1 |
16:14:27 | Prestige | disruptek: why are the builds always failing |
16:14:37 | disruptek | what builds? |
16:14:51 | disruptek | mratsim: it's MIT-licensed. |
16:14:59 | Araq | monads don't compose. ;-) |
16:15:17 | Prestige | https://travis-ci.org/github/disruptek/badresults |
16:15:26 | disruptek | who cares? |
16:15:40 | Araq | I do. |
16:15:44 | Prestige | It's just funny, like 99% of repos I see have failing builds |
16:15:56 | disruptek | Araq: i'm talking to prestige. |
16:16:03 | Araq | ah :D |
16:16:07 | FromGitter | <alehander92> that's a nolan's movie man |
16:16:15 | disruptek | Prestige: it's arne's tests and i don't care about travis anymore; it's too annoying to use. |
16:16:23 | disruptek | i only use github actions now. |
16:16:33 | Prestige | fair, I also dislike travis |
16:16:34 | FromDiscord | <Rika> why is travis annoying for you? |
16:16:44 | leorize | it's slow, and the ui doesn't work |
16:16:49 | FromGitter | <alehander92> circle ci? |
16:16:51 | Prestige | tbh I can't figure out github actions, I just use circleci |
16:16:54 | disruptek | badresults is used extensively in gittyup, so i know that it works fine. |
16:17:03 | disruptek | prestige: just copy it from one of my repos. |
16:17:05 | FromGitter | <alehander92> but edge cases |
16:17:12 | leorize | circle ci is cool but can't do OSX |
16:17:17 | leorize | (without paying) |
16:17:25 | disruptek | travis doesn't track the nims i care about. |
16:17:30 | disruptek | and, not in a way i trust. |
16:17:44 | disruptek | ie. i don't want choosenim to be a part of my ci. |
16:18:54 | disruptek | my opinion is that exceptions should be exceptional. |
16:19:10 | * | luis_ quit (Read error: Connection reset by peer) |
16:19:12 | disruptek | if you have a known error condition and you're going to write code against it, then what the fuck. write the damn code. |
16:19:17 | disruptek | write it in the right place. |
16:19:21 | disruptek | have it do the right thing. |
16:19:28 | disruptek | and have it abstract the error condition properly. |
16:19:35 | leorize | exceptional is subjective |
16:19:37 | * | luis_ joined #nim |
16:19:42 | disruptek | of course. |
16:19:58 | disruptek | but a plan for failure isn't exceptional. |
16:20:05 | disruptek | it's no less exceptional than a plan for success. |
16:20:15 | FromDiscord | <mratsim> agreed |
16:20:22 | FromDiscord | <mratsim> file not found should not be an exception |
16:20:27 | Prestige | disruptek is exceptional |
16:20:57 | FromDiscord | <Rika> of course he is |
16:21:24 | disruptek | exceptionally difficult. |
16:22:13 | leorize | file not found can be an exception depends on the type of application/library you're working on :P |
16:22:17 | FromDiscord | <Rika> i guess everyone has their self deprecating moments |
16:22:43 | disruptek | rika: how would you like a throat punch? |
16:22:58 | disruptek | i am on a killing spree. |
16:23:05 | disruptek | 0 days since my last kill. |
16:23:39 | FromDiscord | <Rika> i dont have a throat |
16:23:43 | FromDiscord | <Rika> in fact, i dont exist |
16:23:45 | FromDiscord | <Rika> wake up |
16:23:48 | Prestige | Weapon of choice? Compiled languages. |
16:24:17 | leorize | I have yet to see a good writeup on exceptions vs result in Nim |
16:24:24 | FromGitter | <alehander92> the problem is |
16:24:27 | disruptek | why do you keep saying this? |
16:24:40 | FromGitter | <alehander92> if you just define it like "use whatever you want" |
16:24:54 | FromGitter | <alehander92> i guess i like strong conventions |
16:25:04 | FromGitter | <alehander92> except when i disagree with them :( |
16:25:12 | FromDiscord | <Rika> lol |
16:25:14 | disruptek | i've explained my position on exceptions vs. results multiple times in this channel. you don't think it's a good write-up? or you have a good rebuttal? |
16:25:16 | FromDiscord | <Rika> doesnt everyone |
16:25:34 | disruptek | people vote with their feet. |
16:25:38 | leorize | disruptek: I mean a written one on paper/rfcs |
16:25:59 | leorize | like result types are the hot thing rn and I do like them |
16:26:06 | FromDiscord | <Rika> why does it have to be on paper or an rfc |
16:26:09 | leorize | I just feel like I'm not seeing enough of issues with exceptions |
16:26:13 | Prestige | I'd like to see an RFC |
16:27:28 | FromGitter | <alehander92> oh man |
16:27:48 | disruptek | my issues with exceptions mostly surround interop, macros, scope. |
16:27:56 | leorize | @Rika because chat is small and there aren't room for debate without you having the information on hand already |
16:28:13 | FromDiscord | <Vindaar> and also, _because it gets lost_ |
16:28:14 | FromDiscord | <Rika> i guess it is time to write |
16:28:30 | Prestige | Maybe I should write an RFC about multiple inheritance, but I think this community would burn me at the stake |
16:28:42 | leorize | Prestige: someone did already iirc |
16:29:07 | disruptek | leorize: what would the rfc request comments on? |
16:29:46 | FromDiscord | <Rika> prestige: it cant hurt to try i assume |
16:29:57 | leorize | the possibility of result as the default error handling scheme? if you don't want that then a forum post is fine |
16:30:14 | disruptek | i'm fairly certain that there will be big pushback on that. |
16:30:28 | leorize | like I would really want opinions of people who are much more qualified than me :P |
16:30:46 | disruptek | but, putting a results type into stdlib makes sense to me. |
16:30:56 | disruptek | a more basic one than badresults. |
16:31:22 | leorize | you can just push one to fusion |
16:31:29 | disruptek | no, i don't /do/ fusion. |
16:31:29 | leorize | lower barrier of entry and still usable ootb |
16:31:37 | * | uhoh quit (Quit: Leaving) |
16:32:59 | disruptek | maybe i'll just strip down badresults. maybe that'll be more attractive to other folks. |
16:33:01 | Prestige | @Rika yeah I think I will, after work |
16:33:02 | * | altarrel joined #nim |
16:33:07 | leorize | Prestige: as long as you present your case convincingly no one will burn you down :P |
16:33:19 | Prestige | I'll do my best haha |
16:34:43 | FromDiscord | <Rika> good luck |
16:37:57 | * | altarrel quit (Quit: WeeChat 2.8) |
16:44:27 | FromGitter | <alehander92> i am testing |
16:44:33 | FromGitter | <alehander92> different impls of data structures |
16:44:37 | FromGitter | <alehander92> in the same module |
16:44:40 | FromGitter | <alehander92> with when implX |
16:44:51 | FromGitter | <alehander92> is that a common approach: i feel like |
16:44:59 | FromGitter | <alehander92> its cleaner than commenting out stuff |
16:45:09 | FromGitter | <alehander92> but maybe more fragmented |
16:45:44 | bung | proc in template still need exported ? |
16:45:48 | disruptek | dude, newline is not a substitute for punctuation. |
16:48:18 | FromGitter | <alehander92> :) |
16:48:23 | FromGitter | <alehander92> ! ok |
16:50:45 | FromGitter | <alehander92> ok |
16:51:02 | FromGitter | <alehander92> testing my next impl : tables vs seq |
16:53:18 | Zevv | disruptek: you are the only one here using punctuation anyway. |
16:53:29 | Zevv | oh look at me, i just punctuated. |
16:53:40 | * | bung quit (Ping timeout: 246 seconds) |
16:53:47 | disruptek | yeah, but i hate having to hang on sasha's every word. i never know when the sentence ends. |
16:53:52 | Zevv | "punkt" |
16:53:57 | disruptek | i mean, what the fuck, man. |
16:54:10 | disruptek | some of us are trying to watch porn. |
16:54:40 | FromGitter | <alehander92> porn is evil, man |
16:54:49 | disruptek | don't be silly. |
16:54:52 | FromGitter | <alehander92> and this fact is so important, i use punctuation |
16:54:54 | FromDiscord | <Rika> some people read it too |
16:55:22 | FromGitter | <alehander92> So, read my analysis and focus. |
16:55:27 | disruptek | there are many shades of evil. |
16:55:48 | Zevv | like, 50 |
16:55:52 | disruptek | shhh |
16:55:57 | disruptek | that book was horrible. |
16:56:18 | FromGitter | <alehander92> Yes, and porn is horrible . |
16:56:34 | disruptek | what did i tell you about being silly? |
16:57:03 | FromDiscord | <lqdev> why don't tables preserve their contents between run time and compile time? https://play.nim-lang.org/#ix=2zi0 |
16:57:16 | FromDiscord | <lqdev> and is there a way i could work around that? |
16:58:35 | disruptek | https://play.nim-lang.org/#ix=2zi4 |
16:58:58 | FromGitter | <alehander92> So |
16:59:03 | FromDiscord | <Vindaar> https://play.nim-lang.org/#ix=2zi5 |
16:59:15 | FromGitter | <alehander92> I'll try to hide set logic behind `implSets` |
16:59:26 | FromGitter | <alehander92> and see how long does it take without it. |
16:59:29 | FromDiscord | <lqdev> thanks vindaar |
16:59:33 | FromDiscord | <lqdev> and disruptek |
16:59:34 | disruptek | lqdev: i use a proc instead of static: |
16:59:45 | FromDiscord | <lqdev> yeah but it doesn't work with a proc either |
17:00:01 | disruptek | hmm, works for me. lemme hack your example. |
17:00:09 | FromGitter | <alehander92> With `nkSym` only and `implSets = false`, I hope I see more clearly bottlenecks. |
17:00:40 | FromDiscord | <lqdev> hm but this won't work here |
17:00:47 | FromDiscord | <lqdev> because it'll make the table immutable |
17:00:54 | FromDiscord | <lqdev> unless maybe i use a TableRef? |
17:01:12 | disruptek | https://play.nim-lang.org/#ix=2zi9 |
17:01:16 | disruptek | works fine. |
17:01:40 | FromDiscord | <lqdev> yeah but the table is mutated after its declaration |
17:02:04 | FromDiscord | <lqdev> TableRef doesn't seem to be valid for const |
17:02:13 | disruptek | well, sure. |
17:03:34 | FromGitter | <alehander92> yess |
17:03:35 | disruptek | this seems like a bug to me. |
17:03:50 | FromGitter | <alehander92> With sets false , we get to <4s |
17:04:04 | disruptek | lqdev: ie, i would file this as an issue: https://play.nim-lang.org/#ix=2zic |
17:04:05 | FromGitter | <alehander92> much closer to the original compiler time. |
17:04:30 | FromDiscord | <lqdev> disruptek: this applies to seqs too, btw |
17:04:40 | FromDiscord | <lqdev> i'm filing a bug then |
17:08:08 | * | vicfred_ quit (Quit: Leaving) |
17:08:32 | disruptek | also https://play.nim-lang.org/#ix=2zih |
17:08:53 | disruptek | i mean, how the hell are we supposed to do this? |
17:11:37 | * | thomasross joined #nim |
17:21:29 | * | D_ quit (Ping timeout: 260 seconds) |
17:23:05 | * | luis_ quit (Ping timeout: 240 seconds) |
17:23:58 | FromDiscord | <lqdev> https://github.com/nim-lang/Nim/issues/15441 |
17:24:00 | disbot | โฅ {.compileTime.} variables' values do not get transitioned over to runtime ; snippet at 12https://play.nim-lang.org/#ix=2zim |
17:24:32 | ForumUpdaterBot | New thread by Niminem: First Nimble Package - process, see https://forum.nim-lang.org/t/6877 |
17:24:42 | disruptek | to me, the problem is that you cannot mutate a ct var at ct. |
17:24:54 | disruptek | i've never been a fan of transitioning ct vars to rt. |
17:25:03 | * | D_ joined #nim |
17:25:11 | disruptek | especially because they silently swallow mutations there. |
17:25:18 | disruptek | which is fucked up. |
17:29:44 | disruptek | i guess the problem is that this condition extends to ct, right? |
17:30:06 | FromDiscord | <lqdev> wdym? |
17:30:18 | disruptek | you cannot mutate the ct var at ct or at rt. |
17:30:30 | disruptek | mutations are just silently ignored. |
17:32:26 | FromDiscord | <lqdev> but the compile time value is clearly changed |
17:32:35 | FromDiscord | <lqdev> in the static block |
17:32:42 | * | Vladar quit (Quit: Leaving) |
17:33:07 | disruptek | #15441 |
17:33:08 | disbot | https://github.com/nim-lang/Nim/issues/15441 -- 3{.compileTime.} variables' values do not get transitioned over to runtime ; snippet at 12https://play.nim-lang.org/#ix=2zim |
17:33:57 | disruptek | hmm, maybe i'm misremembering my own repro. |
17:47:29 | * | Trustable quit (Remote host closed the connection) |
17:57:34 | * | narimiran joined #nim |
18:03:35 | * | bung joined #nim |
18:05:14 | * | natrys joined #nim |
18:11:43 | * | bung quit (Ping timeout: 246 seconds) |
18:22:16 | FromGitter | <alehander92> praise God |
18:22:25 | FromGitter | <alehander92> such a calm evening |
18:23:58 | FromGitter | <alehander92> ok, good timings for implTables=false, implSets=false |
18:24:05 | FromGitter | <alehander92> but i need to implHistory=false now |
18:24:09 | FromGitter | <alehander92> still >4s |
18:24:11 | FromGitter | <alehander92> most of the time |
18:24:48 | FromGitter | <alehander92> The compiler is built with `-d:release` ? |
18:24:51 | FromGitter | <alehander92> Usually, right? |
18:24:55 | disruptek | yep. |
18:25:35 | FromGitter | <alehander92> dude now i get slower times |
18:25:38 | FromGitter | <alehander92> without my code |
18:25:46 | FromGitter | <alehander92> i really need to find a way to get more stable timings |
18:26:23 | FromGitter | <alehander92> how do people benchmark? i get 5s then I get 3.4s |
18:26:40 | FromGitter | <alehander92> I know about medians, but there must be a strategy, |
18:26:40 | * | vicfred joined #nim |
18:26:55 | FromGitter | <alehander92> for just getting more stable results: probably have to turn off my other apps. |
18:27:01 | disruptek | i just make up numbers. |
18:32:44 | FromGitter | <alehander92> :) |
18:32:52 | FromGitter | <alehander92> it feels like that, right.. |
18:36:21 | FromGitter | <alehander92> huh man |
18:36:28 | FromGitter | <alehander92> this is unexpectedly hard |
18:36:38 | FromGitter | <alehander92> can't i just isolate one of my cpu-s and be like |
18:36:43 | FromGitter | <alehander92> just use this. |
18:38:45 | FromGitter | <alehander92> You know, the weird thing is |
18:38:57 | FromGitter | <alehander92> 6s look slower to me, but not twice as slow as 3s. |
18:40:28 | FromGitter | <alehander92> I should try with the medians of 10 runs, I guess :) |
18:41:05 | FromGitter | <alehander92> !repo golden |
18:41:06 | disbot | https://github.com/disruptek/golden -- 9golden: 11a benchmark for compile-time and/or runtime Nim ๐ 15 22โญ 0๐ด |
18:41:19 | Araq | simply write your Nim compiler code as I do |
18:41:37 | FromDiscord | <Avatarfighter> What is up everyone |
18:41:42 | * | gmaggior joined #nim |
18:42:01 | FromGitter | <alehander92> Benchmarking is fun. |
18:42:06 | FromGitter | <alehander92> Let me play a bit |
18:42:20 | FromDiscord | <Avatarfighter> What are you benchmarking alehander? |
18:43:02 | FromGitter | <alehander92> Something that made Araq laugh. |
18:43:08 | FromGitter | <alehander92> :D |
18:43:34 | Araq | his not-nil implementation, featuring an exponential number of memory allocations |
18:43:58 | Araq | because we can never let reality win over functional programming |
18:44:04 | Araq | :P |
18:44:41 | FromGitter | <alehander92> That's not really the problem, tho. |
18:44:53 | FromGitter | <alehander92> I mean, I had some needless stuff |
18:44:56 | Araq | yeah I'm not serious |
18:45:07 | Araq | but the code looked slow |
18:45:13 | Araq | and surprise, it is. |
18:45:16 | FromGitter | <alehander92> But I am trying to find out what of the things I disable wins most time |
18:45:40 | FromGitter | <alehander92> That's true. |
18:45:47 | FromGitter | <alehander92> Man, golden install a lot of stuff |
18:46:07 | * | dv-^_^6 joined #nim |
18:48:08 | * | ldlework quit (Ping timeout: 272 seconds) |
18:49:59 | disruptek | it'll be even "worse" with the next version. |
18:50:11 | disruptek | it's a thing i like to call, "code reuse." |
18:50:33 | FromGitter | <alehander92> Sorry, this is cool. |
18:50:44 | FromGitter | <alehander92> I just expected one feature. |
18:50:54 | disruptek | which one? |
18:51:25 | FromGitter | <alehander92> Thanks, man. |
18:51:27 | FromGitter | <alehander92> I found it. |
18:51:38 | FromGitter | <alehander92> The passing of args to the binary thing. |
18:52:04 | FromGitter | <alehander92> Is ~0.85 a big standard deviation? |
18:53:24 | disruptek | sure. |
18:53:35 | Zevv | is 3cm small? is an hour long? |
18:53:41 | disruptek | shhh |
18:53:45 | FromGitter | <alehander92> Yeah, I realized it later. |
18:54:06 | FromDiscord | <Rika> zevv i regret to inform you that 3cm is indeed small |
18:54:07 | Zevv | that was a pretty stupid question, right? :) |
18:54:12 | disruptek | lol |
18:54:19 | FromGitter | <alehander92> Super stupid. |
18:54:45 | disruptek | i'm pretty sure it's a lot but i'm also sure you don't need to look at stddev in your case. |
18:55:02 | disruptek | the longer golden runs, the more accurate the output. |
18:55:34 | FromGitter | <alehander92> :) http://ix.io/2ziQ |
18:55:39 | FromDiscord | <Vindaar> @Rika I beg to differ. 3 cm is 3ยท10ยณยณ planck lengths |
18:55:56 | Zevv | right so |
18:56:08 | disruptek | alehander92: why does it vary? |
18:56:41 | FromGitter | <alehander92> Awesome. |
18:56:42 | Zevv | Vindaar: although you're not _quite_ right |
18:56:56 | FromGitter | <alehander92> Thank God, I feel close to figuring out what to do. |
18:56:58 | Zevv | it's 1.8561e33 lp |
18:57:05 | FromDiscord | <Vindaar> did I misremember a Planck length? damn |
18:57:13 | FromGitter | <alehander92> @disruptek , because .. I have a lot turned on currently |
18:57:29 | FromGitter | <alehander92> So probably my resource usage varies significantly. |
18:57:31 | Zevv | it would be kind of happy little accident if the plank length had any relation with the circumference of the earth, right? |
18:57:50 | FromDiscord | <Vindaar> oh, haha. I totally ignored those 1.65 ish |
18:57:52 | Zevv | at least you had the number of zeroes right |
18:57:52 | FromGitter | <alehander92> ok, so this is for `nkSym, implHistory = false, implTables = false, implSets = false` |
18:58:17 | * | rockcavera joined #nim |
18:58:34 | FromDiscord | <Vindaar> I'd argue the zeros are the important bit here ๐ |
18:59:05 | Zevv | pff zeros are nothing |
18:59:20 | FromDiscord | <Vindaar> false |
18:59:42 | FromDiscord | <Vindaar> the set of zeros has 1 element. thus it's different from the empty set, the real nothing |
19:00:51 | FromGitter | <alehander92> ix.io/2ziW ! |
19:01:05 | FromGitter | <alehander92> http://ix.io/2ziW * |
19:01:27 | disruptek | json bench: (arc) 2.79, (refc) 3.29. arc is faster. |
19:01:32 | FromDiscord | <Avatarfighter> I want to make something really inefficient |
19:01:40 | FromGitter | <alehander92> So, Araq |
19:01:44 | FromDiscord | <Avatarfighter> anyone have any ideas ๐ |
19:02:18 | FromGitter | <alehander92> the good news is if I cut out a lot of stuff, the main functionality seems close to the compiler now |
19:03:15 | disruptek | base64 bench: (arc) 1.88, (refc) 1.38. refc is faster. |
19:05:03 | * | leorize[m]1 joined #nim |
19:06:00 | disruptek | alehander92: what's the point of removing functionality? |
19:06:36 | FromGitter | <alehander92> BEING FAST |
19:07:22 | disruptek | wrong answers, delivered quickly? |
19:07:38 | FromGitter | <alehander92> you're right :) |
19:07:55 | FromGitter | <alehander92> I am saying it not very seriously . |
19:08:16 | FromGitter | <alehander92> However what this means is that I can focus on the slowest sub-feature and optimize that. |
19:08:23 | FromGitter | <alehander92> Knowing the other ones aren't a bottleneck. |
19:08:55 | FromGitter | <alehander92> Maybe http://ix.io/2zj1 |
19:09:07 | FromGitter | <alehander92> this is with the alias set stuff on |
19:09:25 | FromGitter | <alehander92> It seems this is where I need to optimize ^ |
19:18:12 | * | leorize[m]1 quit (Quit: authenticating) |
19:18:18 | * | leorize[m]1 joined #nim |
19:29:30 | disruptek | sounds fun. |
19:30:09 | disruptek | my current problem is that i get type and proc symbols entered into the typecache out of order, and into separate caches. so of course they end up with the same names. |
19:30:22 | disruptek | but the caches are nominally for the same module. |
19:30:46 | FromGitter | <alehander92> can't you merge em |
19:32:43 | * | tane joined #nim |
19:34:26 | FromGitter | <alehander92> it really seems my sets stuff is the bottleneck |
19:34:54 | ForumUpdaterBot | New thread by Niminem: Library for making lightweight Electron-like HTML/JS GUI applications, see https://forum.nim-lang.org/t/6878 |
19:36:48 | disruptek | i didn't expect to have multiple toplevel typecaches for a single module. |
19:38:47 | FromGitter | <Knaque> I'm not seeing anything in Nimble's official package list, so does anyone know if someone has made a wrapper for the Firebase SDK already? |
19:38:58 | disruptek | no one has. |
19:39:40 | disruptek | i assume you mean the rest api. |
19:40:08 | * | rockcavera quit (Remote host closed the connection) |
19:40:26 | disruptek | i guess i should release my version. |
19:40:29 | FromGitter | <alehander92> ok dude |
19:41:10 | FromGitter | <Knaque> So you've been working on one, or are you referring to an earlier conversation? |
19:41:32 | FromGitter | <alehander92> i can rebuild the compiler now in 7s |
19:41:36 | FromGitter | <alehander92> it's a bit strange |
19:41:52 | disruptek | i wrote something over a year ago. i dunno what kinda state it's in now, though. |
19:41:52 | FromGitter | <Knaque> I'm referring to https://github.com/firebase/firebase-cpp-sdk (firebase/firebase-cpp-sdk) specifically. |
19:42:06 | disruptek | oh, i don't know anything about that. |
19:42:06 | FromGitter | <alehander92> i almost wonder if i am just not visiting some stuff |
19:42:29 | FromGitter | <Knaque> But I'm not picky, I only would *really* need to query a Firestore database. |
19:42:32 | disruptek | 7s is about what it takes me to build the compiler. |
19:42:43 | * | gmaggior quit (Ping timeout: 246 seconds) |
19:42:46 | FromGitter | <Knaque> Problem is, I'd love to do it myself, but I'm *so* unqualified to do so. |
19:42:57 | disruptek | nonsense. |
19:43:13 | FromGitter | <alehander92> yes disruptek :) |
19:43:28 | * | haxscramper joined #nim |
19:43:49 | FromGitter | <alehander92> huh, so it's all the set/history stuff |
19:44:03 | FromGitter | <alehander92> i just see it visually stopping |
19:44:05 | FromGitter | <alehander92> when i enable it |
19:44:25 | haxscramper | Knaque: if you don't have a lot of functions you can just wrap them using importcpp manually |
19:44:40 | haxscramper | Or try nimterop/c2nim to wrap things |
19:44:58 | disruptek | or just see if the cpp actually adds value. if not, just start from scratch in nim. |
19:46:18 | disruptek | if you want a simple example of a rest api impl in nim, i can offer a few. |
19:46:28 | haxscramper | !repo openapi |
19:46:28 | disbot | https://github.com/disruptek/openapi -- 9openapi: 11OpenAPI Code Generator for Nim 15 33โญ 3๐ด 7& 5 more... |
19:46:32 | disruptek | if you can get a swagger/openapi definition, then you can use openapi. |
19:46:49 | disruptek | !repo datamuse |
19:46:49 | disbot | https://github.com/disruptek/datamuse -- 9datamuse: 11 15 2โญ 0๐ด |
19:46:56 | disruptek | one we made on-stream. |
19:49:05 | FromGitter | <Knaque> I'm not committed to Firebase, so while it would be preferred, it depends on if the effort required to make it usable would be meaningfully better than just using some other service with some other flavor of SQL and being able to use the stdlib. |
19:49:33 | disruptek | well, firebase isn't sql. |
19:49:49 | FromGitter | <Knaque> I know, just poor phrasing. |
19:50:22 | disruptek | i use firebase in production. i don't recommend firebase. i recommend aws services, but i'm heavily biased because i don't care to use the other clouds. |
19:50:45 | disruptek | what are you trying to store? |
19:51:20 | FromGitter | <Knaque> Basically just a single table with A:B relationships. |
19:51:28 | disruptek | !repo atoz |
19:51:29 | disbot | https://github.com/disruptek/atoz -- 9atoz: 11Amazon Web Services (AWS) APIs in Nim 15 20โญ 0๐ด |
19:51:34 | disruptek | recommend dynamodb. |
19:52:15 | disruptek | Sadly, only the 220 most popular AWS APIs are supported at this time. ๏ฟผ๐ข |
19:52:59 | FromGitter | <Knaque> I genuinely can't tell if that's sarcasm or not, I've never touched anything like this before. |
19:53:33 | disruptek | it's sarcasm. all the api versions are supported. |
19:54:49 | * | gmaggior joined #nim |
19:54:54 | FromGitter | <alehander92> Araq |
19:55:20 | FromGitter | <alehander92> so .. |
19:55:23 | * | narimiran quit (Ping timeout: 240 seconds) |
19:55:35 | FromGitter | <alehander92> final for today (I might not be online 10 tomorrow): good news and bad news |
19:55:50 | disruptek | gimme the bad news first. |
19:55:58 | FromGitter | <alehander92> good news is it seems just by disabling the alias set part of all (some bugfixes needed) |
19:56:02 | disruptek | damnit. |
19:56:06 | FromGitter | <alehander92> the speed gets close to the compiler one |
19:56:15 | FromGitter | <alehander92> so most of this N times slowdown seems to come from there |
19:56:25 | disruptek | maybe it's slow because you're generating so many warnings. |
19:56:41 | FromGitter | <alehander92> so now even with this nilmap data structure it seems fast |
19:56:46 | FromGitter | <alehander92> ~relatively |
19:56:46 | disbot | no footnotes for `relatively`. ๐ |
19:57:10 | FromGitter | <alehander92> bad news is that yeah the set alias thing needs some good optimization then, but i'll try to do that tomorrow |
19:57:18 | FromGitter | <alehander92> disruptek well no |
19:57:33 | FromGitter | <alehander92> i am using the `--warning ..off` stuff |
19:58:06 | FromGitter | <alehander92> and even with warning generation it can be very fast |
19:58:07 | FromGitter | <alehander92> ~10s |
19:58:07 | disbot | no footnotes for `10s`. ๐ |
19:58:12 | FromGitter | <alehander92> with the output included |
19:58:42 | FromGitter | <alehander92> (but probably not very correct warnings right now :D) |
19:59:11 | disruptek | honestly, i wouldn't worry about the speed unless it's like 50% slower. |
19:59:44 | disruptek | just put a warning in like, "notnil enabled: maybe grab a coffee..." |
20:00:23 | FromGitter | <alehander92> well it was 6x slower |
20:00:24 | FromGitter | <alehander92> now it's like |
20:01:27 | FromGitter | <alehander92> 12% |
20:01:28 | FromGitter | <alehander92> slower |
20:01:31 | FromGitter | <alehander92> for nkSym, nkDotExpr and static nkBracketExpr, implHistory = false, implTables = false, implSets = false |
20:01:45 | disruptek | i dunno what that means. |
20:02:15 | disruptek | it sounds like you disabled functionality to make the speed comparable, which sounds pointless. |
20:02:15 | FromGitter | <alehander92> super unscientific, different benchmark etc |
20:02:42 | FromGitter | <alehander92> without set aliases it's ~12% slower with it's i dunno 2-4x slower probably |
20:03:05 | disruptek | .msg ryan74 i'm looking for kids, not full-grown. |
20:03:10 | disruptek | oops |
20:04:27 | FromGitter | <alehander92> ? |
20:04:28 | Zevv | !- There is no such nick: ryan74 |
20:04:34 | Zevv | don't feed the trolls |
20:04:47 | FromGitter | <alehander92> an irc professional! |
20:05:03 | Zevv | 20+ years of experience, at your service |
20:05:11 | disruptek | gah you make one typo and then... |
20:05:23 | FromGitter | <alehander92> ok, so the point is that we need to keep the aliasing stuff but I just need to read a bit more |
20:05:27 | FromGitter | <alehander92> cool |
20:05:29 | FromGitter | <alehander92> thanks guys |
20:08:34 | * | bung joined #nim |
20:09:23 | * | evanj quit (Quit: WeeChat 2.9) |
20:10:44 | haxscramper | Does anyone use nimdow window manager as main one? |
20:13:12 | * | bung quit (Ping timeout: 265 seconds) |
20:15:34 | * | natrys quit (Quit: natrys) |
20:20:00 | disruptek | prestige does. |
20:21:37 | * | nature joined #nim |
20:21:42 | Prestige | Yep |
20:22:09 | Prestige | haxscramper: it's still in beta but is usable - if you have questions lmk |
20:24:05 | haxscramper | Prestige: do you recommend using it if I want to write some extensive additions on top of it? For example I use two languages and I coded up extension to awesome-wm that keeps track on layouts on per-window basis. |
20:24:22 | haxscramper | I'm fine with writing nim code & recompiling it |
20:24:42 | disruptek | i think that's kinda the idea behind impl a wm in nim. |
20:24:56 | Prestige | You could do that, sure |
20:25:01 | haxscramper | It might also use nimscript. nimdow does not though |
20:25:25 | Prestige | Yeah I've not tried using nimscript much, yet |
20:25:36 | Prestige | I'm receptive of suggestions |
20:27:31 | haxscramper | Prestige: Is there API for customization or it is more dwm-style approach where you just write everything directly in project's code? And nimscript is just one possibility for extensions (and not really the best one in this scenario). |
20:29:25 | Prestige | Atm it's more patch style like dwm - I haven't made plans for extensions |
20:30:33 | Prestige | If you have questions about the code just ping me |
20:30:51 | disruptek | prestige: why did you write it? |
20:31:26 | Prestige | I mostly liked my dwm version but it would crash sometimes when I'd move windows between monitors |
20:31:45 | Prestige | So I wrote my own wm, and it's working better for me |
20:32:16 | Zevv | it's just like forth. Everybody just needs to write a forth at least once, just like a wm |
20:32:19 | Prestige | I also liked awesome but it had a memleak |
20:32:24 | haxscramper | Is it a good idea to try and integrate it with hcr or `plugins` module? |
20:32:29 | haxscramper | Or just waste of time |
20:32:53 | disruptek | hcr is a waste. plugins would be worthwhile, especially if you could help get it working on arc. |
20:33:38 | haxscramper | isn't hcr just glorified DLL i.e. similar to plugins? |
20:33:48 | disruptek | i only say this because i want fewer arc bugs and hcr is ripe for disruption during ic. |
20:34:39 | Prestige | I just cba to write a plugin system currently, there's a lot more core functionality I want to add before that |
20:34:40 | FromDiscord | <Avatarfighter> whats hcr for the uneducated like myself? |
20:34:45 | FromDiscord | <Avatarfighter> Hot code reload |
20:34:47 | FromDiscord | <Avatarfighter> nvm |
20:34:51 | FromDiscord | <Avatarfighter> I am educated |
20:35:27 | leorize[m]1 | lol |
20:36:01 | leorize[m]1 | haxscramper: nah, HCR lets you edit the source code and has that change seamlessly loaded into the current program |
20:36:17 | haxscramper | Prestige: I think that providing WM-as-a-library is a better starting point compared to plugin system as it only requires separating code into "internal" and "more-public" parts. Well, that's how I would start something like this |
20:36:40 | leorize[m]1 | for starters just a configuration system like xmonad sounds fun |
20:36:54 | haxscramper | And end user just builds own WM or reuses existing solution (default one that is shipped with the library and only works with simple configurations) |
20:36:54 | leorize[m]1 | I don't know how exactly xmonad works, but it's configuration is written in haskell |
20:37:19 | Prestige | I'm planning on writing a cli client that will invoke WM actions, like bspwm |
20:38:03 | haxscramper | Because in the end I think there are two types of users (roughly): ones that want to customize everything and ones that just want different shortcuts/styles. |
20:41:53 | Prestige | haxscramper: well if you have questions or have ideas, hit me up. It's still in a working state, a lot to add and a lot can be changed |
20:44:09 | haxscramper | Most likely I will try it in the next several days. Since I'm interested rewriting & relatively heavy customizations I might do a PR with some documentation updates or new helper functions but that's probably it. Otherwise I don't think I will have some major ideas. |
20:45:43 | Prestige | One thing I'm planning on doing is having a 81 tags per monitor (9x9 grid) - that's kind of the next thing I'm adding |
20:48:20 | haxscramper | Can I have multiple workspaces per monitor & multiple windows per workspace? Similar to awesome-wm |
20:48:58 | Prestige | You mean have the same window on multiple workspaces? |
20:49:45 | Prestige | Yeah that's called 'tags', I'm working on adding that currently. Atm it's just regular workspaces, 9 per monitor |
20:49:53 | * | nature quit (Ping timeout: 260 seconds) |
20:51:26 | haxscramper | And each tag can have any number of clients & I can move clients between tags? And no, I didn't mean to have same window on multiple tags |
20:52:07 | Prestige | Ah I think that's just regular workspace behavior - yeah, you can do that |
20:52:13 | haxscramper | I'm just not that great when it comes to WM terminology because after I configured mine I just forgot everything |
20:52:57 | haxscramper | Great, seems like everything I need is already there. Thanks for answering they questions |
20:53:08 | haxscramper | the* |
20:53:12 | Prestige | Any time |
20:55:13 | Prestige | Look over https://github.com/avahe-kellenberger/nimdow/wiki/User-Configuration-File#controls-table- to see the available controls. There's also a default config file in the repo |
21:06:30 | * | Jesin quit (Quit: Leaving) |
21:09:56 | * | Jesin joined #nim |
21:24:57 | disruptek | prestige: you looked at the i3ipc, right? |
21:25:35 | Prestige | I'm aware it exists, that's about it |
21:26:14 | disruptek | there are a couple clients for it (i wrote one) and wm'ers in wayland and x that use it, so... |
21:26:35 | disruptek | maybe it will be good inspiration if you decide to go a different way. |
21:26:44 | disruptek | anything dbus would make me happy. |
21:26:57 | Prestige | I'll check it out, thanks |
21:42:56 | * | def- quit (Quit: -) |
21:43:07 | * | def- joined #nim |
21:51:39 | * | ldlework joined #nim |
21:52:53 | FromDiscord | <Avatarfighter> What is the tool that all the cool Nim developers use to convert C code to Nim but then you tweak it by hand |
21:53:16 | leorize | c2nim |
21:54:06 | FromDiscord | <Avatarfighter> oh yeah that's what I am looking for |
21:54:16 | FromDiscord | <Avatarfighter> Thank you leorize, the name was slipping from me |
21:55:56 | FromDiscord | <Avatarfighter> Has anyone used https://github.com/nimterop/nimterop before and to rate their experience on a scale of 0-9 |
21:56:12 | disruptek | 09 |
21:56:13 | leorize | I'll give it a 6 |
21:56:34 | leorize | really cool, just that nimterop have a lot of dependency (not that it can be avoided) |
21:56:54 | disruptek | what does that have to do with anything? |
21:57:17 | FromDiscord | <Avatarfighter> Ok that's neat, I want to make a wrapper for a lib but I'm too lazy to figure out what to put in my importc pragmas |
21:57:36 | leorize[m]1 | I guess nimble stop doing that now but I used to have a ton of installation errors when I try nimterop to write nim-kmod |
21:57:57 | leorize[m]1 | if nimble is better now then this should stop being an issue |
21:58:01 | * | haxscramper quit (Remote host closed the connection) |
22:00:35 | * | solitudesf quit (Ping timeout: 240 seconds) |
22:04:16 | FromDiscord | <Avatarfighter> nimterop is the coolest thing I've ever seen |
22:09:24 | * | bung joined #nim |
22:10:22 | * | abm joined #nim |
22:13:47 | * | bung quit (Ping timeout: 240 seconds) |
22:14:40 | * | tane quit (Quit: Leaving) |
22:24:24 | disruptek | you need to get out more. |
22:32:35 | * | oprypin quit (Quit: Bye) |
22:32:43 | * | oprypin joined #nim |
22:33:46 | * | def- quit (Quit: -) |
22:34:26 | * | def- joined #nim |
22:37:59 | FromDiscord | <Avatarfighter> lmao |
22:38:17 | FromDiscord | <Avatarfighter> What is this outside you speak of? |
22:49:46 | FromDiscord | <Avatarfighter> Oh my goodness I just spent the past hour making this in figma so I can mess with it with fidget https://media.discordapp.net/attachments/371759389889003532/760996830619631646/unknown.png |
22:50:24 | disruptek | that's crazy; `Main` is my mom's name. |
22:50:33 | disruptek | are we related? |
22:53:39 | disruptek | hello? |
22:54:07 | disruptek | are you `Main` on your mother's side, or is it dad's family? |
22:55:40 | FromDiscord | <Avatarfighter> main is on my fathers side of course |
22:55:42 | FromDiscord | <Avatarfighter> hbu |
22:55:49 | disruptek | mom. |
22:56:04 | disruptek | grammy main just died like 5 years ago. |
22:56:09 | FromDiscord | <Avatarfighter> are our parents related? siblings maybe |
22:56:27 | disruptek | no; my mom only has sisters. |
22:56:33 | FromDiscord | <Avatarfighter> oh |
22:57:04 | FromDiscord | <Avatarfighter> well my main is better ๐ |
22:58:14 | disruptek | https://www.youtube.com/watch?v=AYo2vpzfvj8 |
23:01:12 | FromDiscord | <Avatarfighter> oh god |
23:01:14 | FromDiscord | <Avatarfighter> the intro |
23:01:21 | FromDiscord | <Avatarfighter> i wasn't expecting this |
23:02:11 | disruptek | no one expects the spanish inquisition. |
23:11:40 | FromDiscord | <Avatarfighter> how would one iterate through a `ptr cstring`? |
23:11:57 | * | enthus1ast quit (Ping timeout: 260 seconds) |
23:13:03 | disruptek | what does that even mean? |
23:13:25 | FromDiscord | <Avatarfighter> I'm not sure how to phrase my question to be honest |
23:13:56 | disruptek | items cst |
23:15:02 | FromDiscord | <Avatarfighter> this library that i'm wrapping has `char**` as a parameter and I believe the Nim equivalent is `ptr cstring` right? |
23:15:21 | FromDiscord | <Avatarfighter> Can I iterate a ptr? |
23:15:34 | disruptek | you can deref a ptr. |
23:16:43 | FromDiscord | <Avatarfighter> What type would I get? |
23:16:55 | FromDiscord | <Avatarfighter> if I deref'd a ptr like the one I put above? |
23:17:00 | disruptek | who knows. nim is funky that way. |
23:17:07 | FromDiscord | <Avatarfighter> lovely |
23:17:11 | disruptek | it's a total crapshoot. |
23:17:33 | FromDiscord | <Avatarfighter> im assuming I cant cast my `ptr cstring` to an openarray or something lol |
23:18:20 | disruptek | use [] to deref it, chuckles. |
23:18:39 | FromDiscord | <Avatarfighter> I'm going to be so sad if i can't iterate this |
23:18:56 | disruptek | me too, you're embarrassing me. |
23:19:23 | disruptek | so i guess the icons for my bookmarks are stored in a sqlite db. |
23:19:24 | FromDiscord | <Avatarfighter> lol |
23:20:18 | disruptek | i wonder if there's an easy way to set a bookmark icon manually. |
23:21:29 | disruptek | ah, you do this with extensions. i guess that makes sense. |
23:25:26 | * | abm quit (Read error: Connection reset by peer) |
23:25:28 | * | enthus1ast joined #nim |
23:31:17 | FromDiscord | <liming-coder> xmlparser doesn't support namespace? |
23:34:02 | * | gmaggior quit (Quit: Leaving) |
23:42:11 | * | fredrikhr5 joined #nim |
23:42:11 | * | ^Q-Master^ joined #nim |
23:45:24 | * | Q-Master quit (Read error: Connection reset by peer) |
23:45:36 | * | fredrikhr quit (Ping timeout: 258 seconds) |
23:45:36 | * | fredrikhr5 is now known as fredrikhr |
23:45:56 | disruptek | i think i'm ready to become a grandpa. |
23:45:59 | * | Prestige quit (Ping timeout: 258 seconds) |
23:46:29 | disruptek | recreational child-rearing, you know what i mean? |
23:46:47 | * | Prestige joined #nim |
23:47:08 | disruptek | i'll stay on your couch and smoke your dope when i'm not watching yer nasty ass kids. |
23:47:26 | disruptek | i think we could make this work out great for everyone. |
23:47:56 | * | arecacea1 quit (Remote host closed the connection) |
23:48:35 | * | arecacea1 joined #nim |
23:51:09 | disruptek | dude, can you stream an appletv to airpods? |
23:51:38 | disruptek | holy shit, that's killer. |
23:55:47 | FromDiscord | <Vindaar> @Avatarfighter if you know your `char **` really is an array of `char *`, you can cast to `ptr UncheckedArray[cstring]`. Need to know the length of course:โตhttps://play.nim-lang.org/#ix=2zkeโตโตgotta go to bed, good night ๐ |