00:00:52 | FromDiscord | <ShalokShalom> @c4ulmu#0000 thats languages vs implementations |
00:01:32 | FromDiscord | <ShalokShalom> Different implementations for Python, Ruby and others are actually not GIL locked |
00:01:35 | * | ltriant quit (Read error: Connection reset by peer) |
00:01:55 | FromDiscord | <c4ulmu> Yes, of course if they are based on java they gonna have multithreading |
00:01:59 | FromDiscord | <ShalokShalom> A language is not GIL locked itself.↵See Graal |
00:02:06 | FromDiscord | <ShalokShalom> Or Truffle |
00:02:35 | FromDiscord | <c4ulmu> But default mostly used implementations lacks normal multithreading |
00:02:55 | FromDiscord | <c4ulmu> it is kind of strange for me |
00:03:47 | FromDiscord | <ShalokShalom> That's historic cruft |
00:03:57 | FromDiscord | <ShalokShalom> Multi threading was not important |
00:04:15 | FromDiscord | <ShalokShalom> Erlang has that, since it was important in their use case |
00:04:50 | FromDiscord | <ShalokShalom> Multi threading makes no sense, if there are no multi threads 😅 |
00:06:46 | * | ltriant joined #nim |
00:13:40 | FromDiscord | <@thatrandomperson5-6310e3b26da03> Can someone please explain why this does not work\: https://play.nim-lang.org/#ix=4iD3 |
00:15:27 | FromDiscord | <Gumbercules> In reply to @ShalokShalom "Multi threading makes no": well - you can use software / green threads |
00:21:06 | FromDiscord | <Rika> Generics can’t be stored |
00:21:16 | FromDiscord | <Rika> They don’t exist until a type is given to make them concrete |
00:33:51 | * | rez quit (Quit: l8r) |
00:42:03 | FromDiscord | <@thatrandomperson5-6310e3b26da03> Then how would i type that? |
00:46:06 | FromDiscord | <amadan> sent a code paste, see https://paste.rs/SsD |
00:47:30 | FromDiscord | <! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4iDc |
00:47:44 | FromDiscord | <! Nilts> (edit) "https://play.nim-lang.org/#ix=4iDc" => "https://play.nim-lang.org/#ix=4iDd" |
00:49:44 | FromDiscord | <albassort> i wrote some eldritch code |
00:49:49 | FromDiscord | <albassort> and I rewrote it |
00:49:56 | FromDiscord | <albassort> and it was around 700% slower |
00:50:16 | FromDiscord | <albassort> why must I have this horrid fucking code |
02:16:14 | * | arkurious quit (Quit: Leaving) |
02:16:22 | * | rockcavera quit (Remote host closed the connection) |
02:33:52 | * | wallabra quit (Ping timeout: 256 seconds) |
02:34:34 | * | wallabra joined #nim |
02:42:59 | * | rockcavera joined #nim |
02:52:15 | * | wallabra quit (Remote host closed the connection) |
02:54:24 | * | wallabra joined #nim |
03:31:32 | FromDiscord | <albassort> what optimization do to a mf |
03:33:29 | FromDiscord | <Rika> pessimization |
03:36:26 | FromDiscord | <albassort> the stdlib codes something completely differently than how i would and I don't know if its for speeds sake or because its ancient and disgusting |
03:36:38 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4iDG |
03:37:04 | FromDiscord | <huantian> the obvious way would be to do a string slice |
03:37:06 | FromDiscord | <huantian> however this does a copy |
03:37:20 | FromDiscord | <huantian> so when you compare it character by character, it doesn't have to copy a big string |
03:37:35 | FromDiscord | <albassort> not trying to copy |
03:38:38 | FromDiscord | <huantian> well what's your code? |
03:38:52 | FromDiscord | <albassort> im writing it now but im optimizing something so its very specific |
03:38:55 | FromDiscord | <albassort> to what im doing |
03:41:33 | FromDiscord | <Rika> Do you need to optimise it or are you doing it because you think it’s slow |
03:42:23 | FromDiscord | <albassort> In reply to @Rika "Do you need to": I need to because the way i was doing it before was 20x slower than starts with |
03:42:29 | FromDiscord | <albassort> and startswith doesn't meet my needs |
03:42:39 | FromDiscord | <albassort> (edit) "starts with" => "startswith" |
03:43:49 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4iDJ |
03:44:28 | FromDiscord | <albassort> (edit) "https://play.nim-lang.org/#ix=4iDJ" => "https://play.nim-lang.org/#ix=4iDL" |
03:44:52 | FromDiscord | <albassort> ah wait i wrote this wrong |
03:46:57 | FromDiscord | <albassort> im hoping this is only 3x slower than starts with |
03:57:28 | FromDiscord | <albassort> 0.07999719499999999↵vs↵0.007708121999999998 |
03:57:57 | FromDiscord | <albassort> only 10x slower |
03:58:05 | FromDiscord | <albassort> before, i got the power wrong, it was 200x slower |
03:59:26 | FromDiscord | <Elegantbeef> To openarray ftw↵(@huantian) |
04:00:14 | FromDiscord | <albassort> In reply to @Elegantbeef "To openarray ftw (<@300050030923087872>)": i guess i could do that but im not working in ascii so i would need to chunk it by 3 |
04:00:24 | FromDiscord | <albassort> which would remove any benefit |
04:00:36 | FromDiscord | <Elegantbeef> If you're using `startswith` you dont need to worry about utf8 |
04:00:48 | FromDiscord | <albassort> no i mean in my implementaiton |
04:00:51 | FromDiscord | <albassort> (edit) "implementaiton" => "implementation" |
04:01:04 | FromDiscord | <albassort> for my specific usecase |
04:02:00 | FromDiscord | <Elegantbeef> 😄 |
04:02:03 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4iDQ |
04:02:27 | FromDiscord | <Elegantbeef> Of course we can use `equalMem` instead of the slicing |
04:03:24 | FromDiscord | <Elegantbeef> Easy simd optimisation for startwith |
04:05:03 | FromDiscord | <huantian> make a pr beef I dare you |
04:05:18 | FromDiscord | <Elegantbeef> Nah araq no like strutils to use `openarray[char]` |
04:05:53 | FromDiscord | <Elegantbeef> "Strutils doesnt need low level logic" or something silly like that |
04:06:14 | FromDiscord | <Elegantbeef> On the plus side we can remake strutils in userspace and just use that with openarray |
04:06:26 | FromDiscord | <Elegantbeef> Unicode and parseutils now use `openarray[char]` in devel |
04:06:36 | FromDiscord | <Elegantbeef> So the two important modules already use the 0 cost version |
04:07:36 | FromDiscord | <Elegantbeef> For context the simd comment was mainly just `startsWith` is actually quite good for simd |
04:08:52 | FromDiscord | <Elegantbeef> Load you register and your buffers if your result is all on up to your last interested byte you've got a starts with |
04:12:27 | FromDiscord | <Elegantbeef> I do now kinda want to see how much faster simd startswith is |
04:13:56 | FromDiscord | <メッリーレイムー 🎄> how do i convert this python code to nim? toying around w/ making a parsec style library thing↵> ParserP = tp.Callable[[str], tp.Tuple[tp.Any, str]] |
04:14:13 | FromDiscord | <Elegantbeef> If i knew what any of that did it'd tell you |
04:14:25 | FromDiscord | <huantian> > `Any`↵you can't do that here heh |
04:14:39 | FromDiscord | <メッリーレイムー 🎄> could I just create a generic type then? |
04:14:55 | FromDiscord | <メッリーレイムー 🎄> it just has to model `(str, (A, rest_str))` |
04:15:00 | FromDiscord | <huantian> yeah |
04:15:07 | FromDiscord | <メッリーレイムー 🎄> how would i do thta? |
04:15:44 | FromDiscord | <huantian> sent a code paste, see https://play.nim-lang.org/#ix=4iDS |
04:16:50 | FromDiscord | <メッリーレイムー 🎄> gotcha, thank |
04:17:55 | FromDiscord | <huantian> also I have never seen anyone `import typing as tp`, is that a convention? I've always just `import` `from`ed typing |
04:24:23 | FromDiscord | <Gumbercules> yes |
04:24:42 | FromDiscord | <Gumbercules> import from gets pretty unwieldy if you need to import more than one or two symbols |
04:47:08 | FromDiscord | <メッリーレイムー 🎄> @huantian i get the dumbest error ever |
04:47:21 | FromDiscord | <メッリーレイムー 🎄> sent a code paste, see https://play.nim-lang.org/#ix=4iDY |
04:47:35 | FromDiscord | <メッリーレイムー 🎄> sent a code paste, see https://play.nim-lang.org/#ix=4iDZ |
04:47:37 | FromDiscord | <メッリーレイムー 🎄> how do i go about this |
04:47:44 | FromDiscord | <huantian> Ah yeah I love that error |
04:48:02 | FromDiscord | <メッリーレイムー 🎄> sarcasm? |
04:48:14 | FromDiscord | <huantian> Yeah I’ve gotten that error before too lol |
04:48:26 | FromDiscord | <メッリーレイムー 🎄> how to fix |
04:49:18 | FromDiscord | <huantian> 1s |
04:49:21 | FromDiscord | <メッリーレイムー 🎄> kk |
04:50:55 | FromDiscord | <huantian> You seem to be a bit confused witht the return type in your type def |
04:51:27 | FromDiscord | <huantian> right now you're saying f should be a function that takes in a single argument that's a `string` |
04:51:36 | FromDiscord | <huantian> and returns a `(string, (string, A))` |
04:51:53 | FromDiscord | <huantian> but you give it a function that takes a single argument and returns a `(string, A)` |
04:52:07 | FromDiscord | <huantian> also, you can't name your function parameter `string` because that's the name of a type |
04:52:11 | FromDiscord | <メッリーレイムー 🎄> it s hould be this btw |
04:52:22 | FromDiscord | <メッリーレイムー 🎄> sent a code paste, see https://play.nim-lang.org/#ix=4iE0 |
04:52:23 | FromDiscord | <メッリーレイムー 🎄> In reply to @huantian "also, you can't name": i didnt do it?? |
04:52:35 | FromDiscord | <メッリーレイムー 🎄> oh wait |
04:52:38 | FromDiscord | <メッリーレイムー 🎄> im braindead |
04:52:41 | FromDiscord | <メッリーレイムー 🎄> thats not the type right? |
04:52:54 | FromDiscord | <メッリーレイムー 🎄> oh well it still btiches at me |
04:53:05 | FromDiscord | <メッリーレイムー 🎄> (edit) "https://play.nim-lang.org/#ix=4iE0" => "https://paste.rs/2E4" |
04:54:11 | FromDiscord | <huantian> ig you have to do `let pc = Parser[char](f: (s: string) => ("abcdef", ("Error", 'a')))` |
04:57:16 | FromDiscord | <Elegantbeef> You kids and your new fangled arrow operators 😛 |
05:01:31 | FromDiscord | <albassort> In reply to @Elegantbeef "Nah araq no like": make your own strutils |
05:01:35 | FromDiscord | <albassort> i will use it |
05:08:46 | * | rockcavera quit (Remote host closed the connection) |
05:15:29 | FromDiscord | <メッリーレイムー 🎄> In reply to @Elegantbeef "You kids and your": its called a lambda grand dad :p |
05:15:45 | FromDiscord | <Elegantbeef> It's an arrow operator |
05:16:01 | FromDiscord | <メッリーレイムー 🎄> no its lambda |
05:16:04 | FromDiscord | <メッリーレイムー 🎄> 😔 |
05:16:55 | FromDiscord | <albassort> its called an anonymous function |
05:18:46 | FromDiscord | <albassort> In reply to @huantian "ig you have to": i dont understand how these work in nim or haskell |
05:19:01 | FromDiscord | <albassort> and why you'd use them a not be normal and just write a normal function |
05:19:09 | FromDiscord | <albassort> seems needlessly ugly |
05:20:16 | FromDiscord | <Gumbercules> `=>` is just syntactic sugar you could write a normal procedure there |
05:20:38 | FromDiscord | <Gumbercules> what makes it anonymous is the fact that the procedure has no symbol associated with it |
05:21:01 | FromDiscord | <Gumbercules> if you're only ever going to invoke that particular function once, why write it elsewhere to be used? |
05:21:18 | FromDiscord | <Gumbercules> it's actually more explicit and readable to make it an anonymous function |
05:21:21 | FromDiscord | <Gumbercules> then the user knows that it is only available to be invoked in that scope |
05:23:30 | FromDiscord | <albassort> ok but |
05:23:38 | FromDiscord | <albassort> from nim by example |
05:23:46 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4iE3 |
05:23:46 | FromDiscord | <albassort> why do this when you can do this |
05:24:08 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4iE4 |
05:24:23 | FromDiscord | <albassort> (edit) "https://play.nim-lang.org/#ix=4iE4" => "https://play.nim-lang.org/#ix=4iE5" |
05:25:17 | FromDiscord | <albassort> @Gumbercules |
05:26:41 | FromDiscord | <Gumbercules> well one is more explicit and readable |
05:26:41 | FromDiscord | <Gumbercules> the former |
05:27:01 | FromDiscord | <Gumbercules> if I'm reading your code I have to figure out what `powersOfTwo.filtter` accepts as an argument |
05:27:10 | FromDiscord | <Elegantbeef> I mean to each their own, i personally dislike the arrow operators |
05:27:18 | FromDiscord | <albassort> the first one bombards you with a ton of info you dont need |
05:27:19 | FromDiscord | <Gumbercules> `x` could be an `int`, a `uint` an `int32` a `uint32` etc... |
05:27:27 | FromDiscord | <albassort> int and bool |
05:27:30 | FromDiscord | <albassort> you don't needthat |
05:27:36 | FromDiscord | <Gumbercules> you do need it if you don't know what `powerOfTwo` accepts |
05:27:50 | FromDiscord | <albassort> . > yields a bool and its between two ints so you don't need any type info |
05:27:55 | FromDiscord | <albassort> you already know the types |
05:27:58 | FromDiscord | <Gumbercules> no you don't |
05:28:09 | FromDiscord | <albassort> the extra types makes you re-read the proc and make sure you're not wrong |
05:28:11 | FromDiscord | <Elegantbeef> `>` can be user defined |
05:28:36 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4iE6 |
05:28:39 | FromDiscord | <albassort> ok it can be but at that point you have bigger problems than using non specific arrow functions |
05:28:44 | * | ltriant quit (Ping timeout: 252 seconds) |
05:28:51 | FromDiscord | <Gumbercules> well you don't if you're explicit |
05:28:54 | FromDiscord | <Elegantbeef> this is all down to user preference |
05:29:00 | FromDiscord | <Gumbercules> then you have no problem 🙂 |
05:29:01 | FromDiscord | <Elegantbeef> There is not much reason to dispute here |
05:29:22 | FromDiscord | <albassort> this is a friendly discussion on minor snytax |
05:29:26 | FromDiscord | <albassort> (edit) "snytax" => "syntax" |
05:29:38 | FromDiscord | <Gumbercules> beef isn't friendly, he's like the one Canadian that isn't |
05:29:46 | FromDiscord | <Gumbercules> he'll kill you over minor syntax |
05:29:58 | FromDiscord | <Elegantbeef> over allocations\ |
05:30:02 | FromDiscord | <Gumbercules> with his hands |
05:30:05 | FromDiscord | <Gumbercules> or paws |
05:30:13 | FromDiscord | <Gumbercules> still not sure if he's the dog in his picture or not |
05:30:17 | FromDiscord | <Gumbercules> avatar, excuse me |
05:30:28 | FromDiscord | <Gumbercules> I sound as old as I am |
05:30:31 | FromDiscord | <Elegantbeef> The dogs in my PFPs are too small to kill anything |
05:30:39 | FromDiscord | <Gumbercules> my dickhead dog bit me tonight |
05:30:57 | FromDiscord | <Gumbercules> she always does when she's trying to fight the neighbor dogs through our fence |
05:31:10 | FromDiscord | <Gumbercules> fucking chihuahuas |
05:31:46 | FromDiscord | <albassort> if your code isn't typesafe assembly beef will come to your house and kill you |
05:32:07 | FromDiscord | <Elegantbeef> The fuck is type safe assembly |
05:32:20 | FromDiscord | <Gumbercules> that's like a blank check to kill everyone |
05:32:31 | FromDiscord | <albassort> i mean extremely low level nim |
05:33:00 | FromDiscord | <Gumbercules> lol Improbable's military consulting metaverse arm went belly up |
05:33:14 | FromDiscord | <Elegantbeef> Unlikely |
05:33:16 | FromDiscord | <Gumbercules> I swear there has never been a more useless company on the face of the planet |
05:33:32 | FromDiscord | <Gumbercules> minus the one SBF just sunk |
05:33:40 | FromDiscord | <Gumbercules> and Theranos or whatever that lady's company was named |
05:33:50 | FromDiscord | <albassort> damn i wish i could use the super low level start with but i need to do unicode |
05:33:51 | FromDiscord | <albassort> 😭 |
05:33:53 | FromDiscord | <Elegantbeef> FTX was a grand company |
05:33:56 | FromDiscord | <Elegantbeef> It was a nice inverted funnel |
05:34:10 | FromDiscord | <Gumbercules> it was.... |
05:34:16 | FromDiscord | <Elegantbeef> Startwith doesnt need unicode support↵(@albassort) |
05:34:18 | FromDiscord | <Gumbercules> now its going to be a funnel into SBF's butthole |
05:34:23 | FromDiscord | <Gumbercules> filled with penis |
05:34:30 | FromDiscord | <Gumbercules> in prison |
05:34:56 | FromDiscord | <Rika> why does startswith have to be unicode compatible |
05:35:06 | FromDiscord | <Elegantbeef> Startwith is one of the few operators that needs no unicode support |
05:35:33 | FromDiscord | <Elegantbeef> if the start of the string matches the prefix it's starts with |
05:35:43 | FromDiscord | <Elegantbeef> There is no unicode needed as there is no indexxing offset or anything |
05:37:12 | FromDiscord | <albassort> In reply to @Elegantbeef "Startwith doesnt need unicode": mine does |
05:37:21 | FromDiscord | <Elegantbeef> Why? |
05:37:34 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4iE8 |
05:38:20 | FromDiscord | <Elegantbeef> You're not even using unicode properly |
05:38:27 | FromDiscord | <Elegantbeef> Ah nvm |
05:38:31 | FromDiscord | <Elegantbeef> I missed the `toRunes` |
05:40:02 | FromDiscord | <albassort> In reply to @Elegantbeef "I missed the `toRunes`": editing the code to make that more clear |
05:40:31 | FromDiscord | <Elegantbeef> Dont convert the `Rune` to an int |
05:40:46 | FromDiscord | <Elegantbeef> It's an int32 internally |
05:42:04 | FromDiscord | <Gumbercules> https://github.com/tail-wag-games/frag only 77.5% asm now |
05:42:05 | FromDiscord | <albassort> neat |
05:42:09 | FromDiscord | <Gumbercules> yeet |
05:42:52 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4iE9 |
05:43:15 | FromDiscord | <Elegantbeef> whoops `max(ouni, suni)` |
05:44:31 | FromDiscord | <albassort> i dont know what max does |
05:44:46 | FromDiscord | <Elegantbeef> takes the largest of two values |
05:45:02 | FromDiscord | <Elegantbeef> It seems you're just trying to see if the runes are specific runes though |
05:45:30 | FromDiscord | <albassort> no i only wanna do it if they fall between 2 blocks |
05:46:03 | FromDiscord | <albassort> im just making 2 orthogonal unicode blocks work via an offset |
05:46:30 | FromDiscord | <albassort> > orthogonal↵i used that word wrong |
05:46:49 | FromDiscord | <albassort> https://media.discordapp.net/attachments/371759389889003532/1052824029016358974/image.png |
05:46:53 | FromDiscord | <Gumbercules> 75.5 even |
05:47:08 | FromDiscord | <Elegantbeef> 100% too much asm |
05:47:14 | FromDiscord | <Gumbercules> nah |
05:47:22 | FromDiscord | <Gumbercules> it's just for set and jmp context |
05:48:00 | FromDiscord | <Gumbercules> it's - https://github.com/boostorg/context - minus boost |
05:48:59 | FromDiscord | <Gumbercules> https://github.com/boostorg/context/tree/develop/src/asm |
05:49:38 | FromDiscord | <Elegantbeef> albassort using words what are you trying to do with your code |
05:50:02 | FromDiscord | <Elegantbeef> My understanding is if your two characters are in a given range you want to return true |
05:50:10 | FromDiscord | <Elegantbeef> well two runes |
05:52:24 | arkanoid | how would you write a function that checks if any float field of a flat object is NaN or Inf? |
05:53:19 | arkanoid | I'm trying with fieldPairs but field inside the loop doesn't work with "if field.classify == fcNaN or field.classify == fcInf" |
05:55:15 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4iEc |
05:57:53 | FromDiscord | <albassort> In reply to @Elegantbeef "My understanding is if": MY CODE SPEAKS FOR ITSELF |
05:58:28 | FromDiscord | <albassort> ok lemme do it visually |
05:59:38 | FromDiscord | <albassort> sent a long message, see http://ix.io/4iEd |
05:59:42 | FromDiscord | <albassort> or something |
06:00:06 | FromDiscord | <Rika> if you named your variables better perhaps you would have an easier time |
06:03:58 | arkanoid | Elegantbeef, thanks, but it doesn't pass my tests |
06:04:19 | arkanoid | I'm trying to understand why |
06:16:48 | * | kenran joined #nim |
06:17:05 | arkanoid | I hardly believe I am the only one having such serious issues with nimsuggest. |
06:17:50 | * | kenran quit (Remote host closed the connection) |
06:17:54 | arkanoid | I have to reboot my machine (hard reboot!) Every 45/60 minutes when I try to make it work, as it fills the ram even before I can switch to console |
06:19:26 | arkanoid | I have to work without any of its service, especially check, otherwise goodbye productivity |
06:21:21 | arkanoid | This is a rant, I know, but I'm baffled by the lack of viable solution. I've tested vscode extension with and without lsp (both nimlsp and nimlangserver) everytime the same problem, HUGE memory leaks. Even when it seems to not be crashing the machines, it takes on average 8/9 GB of ram |
06:24:11 | FromDiscord | <Rika> you arent the only one, yes |
06:25:52 | FromDiscord | <ezquerra> The tooling situation is IMHO the least mature / nice part of nim’s ecosystem |
06:35:51 | FromDiscord | <Gumbercules> It doesn't ever require me to hard reboot my machine |
06:36:04 | FromDiscord | <Gumbercules> either of them |
06:36:53 | FromDiscord | <Gumbercules> the thing that annoys me about Nimsuggest is when I want to build a new version of Nim and its running in the background |
06:37:31 | FromDiscord | <Gumbercules> other than that - sure it leaks and has resource issues or whatever but if it was bothering me that much I'd just turn it off |
06:38:27 | FromDiscord | <Gumbercules> I think maybe I just have code completion turned off for Nim in VSCode or something - don't really need it at this point anyway... |
06:45:47 | FromDiscord | <ezquerra> One little thing that indicates that tooling is not at the top of the nim project’s priorities is that there is not even a “#tools” discord channel. There is only a #nimble channel |
06:47:52 | FromDiscord | <Elegantbeef> When it comes to nimsuggest it's apart of the compiler so #internals makes sense |
06:51:19 | arkanoid | I don't think I am writing the most complex piece of project in nim galaxy, how comes nimsuggest wants 8/10GB or ram space and a whole cpu core to work |
06:51:53 | FromDiscord | <Elegantbeef> Runaway nimsuggest likes running away |
06:58:09 | arkanoid | Elegantbeef, I'm fighting trying to make your isNan solution to work, but I thing all drills down to -ffast-math |
06:58:27 | FromDiscord | <Rika> oh definitely, NaNs are fucked with in fast math |
06:58:52 | arkanoid | but math.isNan docs says it works with ffast-math |
07:05:07 | FromDiscord | <pyolyokh> what math.isNan actually does is call the isnan() macro from math.h. Maybe that works with -ffast-math in some cases but not yours. It expands to a C compiler builtin for me. |
07:15:58 | * | ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
07:17:02 | * | ehmry joined #nim |
07:20:44 | FromDiscord | <Gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4iEl |
07:20:57 | FromDiscord | <Gumbercules> https://stackoverflow.com/questions/7420665/what-does-gccs-ffast-math-actually-do |
07:21:15 | FromDiscord | <Gumbercules> arkanoid ^ |
07:23:01 | FromDiscord | <arkanoid> Whoops |
07:23:41 | FromDiscord | <arkanoid> Well, then, I am the the wrong position. Thanks for the pointer |
07:25:04 | * | PMunch joined #nim |
07:43:39 | arkanoid | Elegantbeef, toggling ffast-math makes it work |
08:16:11 | PMunch | Hmm, is there a way to make Nim know that it depends on an external file? Currently I have to use `nim c -f` in order to make sure it rebuilds even if I didn't change anything in the Nim files |
08:16:18 | * | Amun-Ra_ is now known as Amun-Ra |
08:20:12 | FromDiscord | <Elegantbeef> I dont think so |
08:25:26 | FromDiscord | <amadan> perform `staticRead` on the file maybe?↵quick glace at the impl seems like it adds it to the module so assuming it would recheck? |
08:31:14 | FromDiscord | <Elegantbeef> It should indeed |
08:32:31 | FromDiscord | <ajusa> Anyone know if there is a library that has Pick/Omit utility types, similar to typescript? |
08:32:54 | FromDiscord | <ajusa> Would something like that even be possible using macros in Nim? |
08:33:26 | FromDiscord | <Elegantbeef> Wouldnt a concept just fit that? |
08:33:42 | FromDiscord | <Elegantbeef> Oh wait never mind |
08:33:43 | FromDiscord | <Elegantbeef> Misunderstood |
08:33:48 | FromDiscord | <Elegantbeef> Yea a macro could make this possible |
08:34:02 | FromDiscord | <ajusa> Yeah, I'm talking about generating a new type that is a subset of an existing type |
08:42:25 | FromDiscord | <ricky> just found out there's a bad clone of nim |
08:42:28 | FromDiscord | <ricky> and it's super laggy.. |
08:42:32 | FromDiscord | <ricky> ||python|| |
08:53:03 | FromDiscord | <Elegantbeef> @ajusa I couldnt help myself to expand micros' example base https://github.com/beef331/micros/blob/master/tests/t_tsinspiredmacros.nim#L4-L46 |
08:54:51 | FromDiscord | <Bung> oh, macro madman |
08:55:35 | FromDiscord | <Elegantbeef> Hey micros makes this actually readable |
08:58:45 | FromDiscord | <Bung> maybe you can do more like https://www.typescriptlang.org/docs/handbook/utility-types.html and https://github.com/sindresorhus/type-fest |
08:59:41 | FromDiscord | <Elegantbeef> What do you mean? |
09:00:25 | FromDiscord | <Bung> don't know , didn't look in deep, just for inspiration |
09:00:40 | FromDiscord | <Elegantbeef> I mean I copied omit and pick verbatim from there |
09:00:52 | FromDiscord | <Elegantbeef> Remove all fields that match a name, and keep all fields that match a name |
09:04:46 | FromDiscord | <Bung> I guess there can have some Optional fields combine with options module |
09:09:06 | FromDiscord | <Elegantbeef> It doesnt make much sense in Nim eitherway given most people dont use concepts |
09:09:28 | FromDiscord | <Bung> ok then. |
09:16:28 | FromDiscord | <nonce> sent a code paste, see https://play.nim-lang.org/#ix=4iEA |
09:18:14 | FromDiscord | <ajusa> Thanks beef! That's shockingly readable honestly |
09:19:01 | FromDiscord | <Elegantbeef> What line does it error on? |
09:19:50 | FromDiscord | <Elegantbeef> Yea micros aims to be readable |
09:23:10 | FromDiscord | <nonce> In reply to @Elegantbeef "Yea micros aims to": db.exec |
09:23:19 | FromDiscord | <nonce> (edit) "db.exec" => "sec" |
09:25:10 | FromDiscord | <nonce> argh, was looking at the wrong file. pardòn |
09:53:51 | FromDiscord | <ShalokShalom> In reply to @Gumbercules "beef isn't friendly, he's": haha, yeah he contains all the meanness and Nim skills of the entire nation 🇨🇦 |
09:53:56 | FromDiscord | <ShalokShalom> 😄 |
09:57:08 | * | pro joined #nim |
09:57:28 | * | pro left #nim (#nim) |
10:25:05 | FromDiscord | <BenitzCoding> Question, why should I start coding in Nim over other languages like Python and JS as a former Python Developer? Are there advantages? |
10:30:46 | FromDiscord | <leetnewb> In reply to @BenitzCoding "Question, why should I": Static typed and the ability to compile to a binary is nice |
10:31:04 | FromDiscord | <BenitzCoding> In reply to @leetnewb "Static typed and the": Anything else? |
10:31:08 | FromDiscord | <BenitzCoding> Is it as simple as Python? |
10:39:55 | FromDiscord | <leetnewb> Not exactly, but it depends on what you're trying to do |
10:40:32 | FromDiscord | <leetnewb> Pretty similar in getting basic stuff done |
10:41:06 | FromDiscord | <BenitzCoding> Interesting... Are there docs or examples I can go through? |
10:41:29 | FromDiscord | <Rika> https://nim-lang.org/docs/manual.html |
10:41:43 | FromDiscord | <BenitzCoding> Thank you! |
10:41:45 | FromDiscord | <Rika> there are other thirdparty documents but i do not know them |
10:42:03 | FromDiscord | <Rika> the third party documents are easier to go through if you're having difficulty with the manual |
10:42:22 | FromDiscord | <leetnewb> I've used the manual and this: https://ssalewski.de/nimprogramming.html |
10:43:01 | FromDiscord | <leetnewb> Also coming from python: https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers |
10:46:10 | FromDiscord | <BenitzCoding> Kinda feel like JavaScript + Bash with Python Syntax. |
10:46:17 | FromDiscord | <BenitzCoding> (edit) "feel" => "feels" |
10:46:34 | FromDiscord | <BenitzCoding> In reply to @leetnewb "Also coming from python:": Thank you! |
10:48:19 | * | PMunch quit (Quit: Leaving) |
11:15:30 | FromDiscord | <leetnewb> In reply to @BenitzCoding "Thank you!": Sure. One other thing I'd mention - this channel/community is very active and helpful. Not sure how that compares to other languages though. |
11:18:47 | FromDiscord | <nocturn9x> I have a question |
11:18:55 | FromDiscord | <nocturn9x> say I have a `Compiler` type |
11:19:03 | FromDiscord | <nocturn9x> then I subtype it with a `BytecodeCompiler` type |
11:19:18 | FromDiscord | <nocturn9x> `Compiler` defines a bunch of functions such as `unary` which return nil in the stub implementation |
11:19:53 | FromDiscord | <nocturn9x> if I declare them as `method` and then call `self.unary()` in a function declared in `Compiler`, will it work if I then also call that function from `BytecodeCompiler`? i.e. will the correct type dispatching occur |
11:20:01 | FromDiscord | <nocturn9x> (edit) "occur" => "occur?" |
11:22:45 | FromDiscord | <ShalokShalom> In reply to @leetnewb "Sure. One other thing": Oh, Python is crazy supportive on their Discord↵↵But here its more familiar 😊 |
11:29:20 | FromDiscord | <leetnewb> In reply to @ShalokShalom "Oh, Python is crazy": Fair enough. I was always bothered by /r/python shoving all questions to /r/learnpython rather than just using flairs, but I suppose I can't paint the entire community. |
11:31:05 | FromDiscord | <ShalokShalom> Python on Discord had channels that you could claim |
11:31:18 | FromDiscord | <ShalokShalom> And then you could close the question |
11:31:28 | FromDiscord | <ShalokShalom> To open the channel for someone else |
11:31:42 | FromDiscord | <ShalokShalom> Now, they are doing the same, just with the new forums feature |
11:32:14 | FromDiscord | <ShalokShalom> And it takes approximately 10 to 60 seconds, to get your answer, and mostly pretty straight |
11:32:52 | FromDiscord | <ShalokShalom> But for social activities, it is way too overcrowded for me, personally |
11:33:00 | FromDiscord | <leetnewb> That sounds surprisingly functional |
11:33:23 | FromDiscord | <ShalokShalom> Well, they have a heckton of people |
11:33:29 | FromDiscord | <ShalokShalom> Its kinda nessecary |
11:33:57 | FromDiscord | <ShalokShalom> The old system had the downside, that you could be typing, which ultimately locks the channel for one, and somebody is faster |
11:34:04 | FromDiscord | <ShalokShalom> That is solved now |
11:34:35 | FromDiscord | <leetnewb> Certainly a vast ecosystem |
11:43:53 | * | ltriant joined #nim |
11:52:52 | FromDiscord | <BenitzCoding> In reply to @leetnewb "Sure. One other thing": I can see that, most official communities are very toxic, this one on the other hand, seems nice and helpful! |
11:58:42 | FromDiscord | <ShalokShalom> You will see, Nim as a language is also like that |
11:58:50 | FromDiscord | <ShalokShalom> 😉 |
11:59:50 | FromDiscord | <Phil> sent a long message, see http://ix.io/4iF4 |
12:03:01 | FromDiscord | <ShalokShalom> Phil should maintain the homepage :nim1: |
12:03:23 | FromDiscord | <Phil> Personally, nim had me at "python-like syntax but with static typing and compiles to a binary", I'll be honest |
12:04:02 | FromDiscord | <Phil> What you want is foster off that task to somebody so its more actively maintained 😛 |
12:04:12 | FromDiscord | <nocturn9x> I can't seem to get methods working the way I like |
12:05:29 | FromDiscord | <nocturn9x> I have a module defining some methods that take a generic `self` argument of type `A` and just return `nil`, then I reimplement a specialized version of them with `self`'s type being `B of A`. The module defining `A` has some other method `m` that calls other methods, but Nim is always dispatching to my stubs rather than using RTTI to dispatch to my specialized versions |
12:05:47 | FromDiscord | <nocturn9x> module `B` calls `A`'s implementation of `m`, so `self` is of type `B of A` |
12:08:52 | FromDiscord | <Rika> can you show code because your terminology doesnt seem to be the same terminology for nim |
12:08:59 | FromDiscord | <ShalokShalom> In reply to @Isofruit "What you want is": Well you can compile Python to a binary |
12:09:06 | FromDiscord | <ShalokShalom> And it has limited typing |
12:09:14 | FromDiscord | <ShalokShalom> But I think Nim is more |
12:09:23 | FromDiscord | <nocturn9x> In reply to @Rika "can you show code": uhm |
12:09:27 | FromDiscord | <nocturn9x> it's like well over 3000 lines |
12:09:28 | FromDiscord | <ShalokShalom> It's the complete package |
12:09:37 | FromDiscord | <nocturn9x> I'll try to keep it concise |
12:09:44 | FromDiscord | <nocturn9x> let me write a short snippet |
12:12:04 | FromDiscord | <nocturn9x> sent a code paste, see https://paste.rs/pLZ |
12:13:12 | FromDiscord | <nocturn9x> I'd expect that when I call `self.infer()` from within `target.nim` with `self` being of type `BytecodeCompiler`, that when it calls `identifier()` it gets dispatched to my implementation for `BytecodeCompiler` rather than the stub returning `nil` |
12:13:27 | FromDiscord | <Rika> `type Compiler = ref object {.inheritable.}` -> `type Compiler = ref object of RootObj`↵first identifier and infer should have `{.base.}` |
12:13:37 | FromDiscord | <nocturn9x> ohhh |
12:13:44 | FromDiscord | <nocturn9x> stupid me |
12:14:09 | FromDiscord | <Rika> ah wait |
12:14:11 | FromDiscord | <Rika> not infer |
12:14:13 | FromDiscord | <Rika> just identifier |
12:14:30 | FromDiscord | <nocturn9x> ye, thx |
12:15:30 | FromDiscord | <nocturn9x> doesn't seem to be doing anything apparently |
12:15:36 | FromDiscord | <nocturn9x> should the `base` impl. be a stub |
12:15:38 | FromDiscord | <nocturn9x> without any body |
12:16:39 | FromDiscord | <Rika> no |
12:16:45 | FromDiscord | <Rika> not that i recall |
12:16:59 | FromDiscord | <Rika> include the parameters |
12:17:02 | FromDiscord | <Rika> the first one of each function |
12:17:08 | FromDiscord | <nocturn9x> I do |
12:17:11 | FromDiscord | <Rika> In reply to @Rika "include the parameters": in the demo |
12:17:14 | FromDiscord | <Rika> to read |
12:17:28 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#ix=4iFd |
12:17:55 | FromDiscord | <nocturn9x> (edit) "https://play.nim-lang.org/#ix=4iFd" => "https://play.nim-lang.org/#ix=4iFe" |
12:18:06 | FromDiscord | <Rika> the implementations one have BytecodeCompiler instead no? |
12:18:10 | FromDiscord | <nocturn9x> yes |
12:18:28 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#ix=4iFf |
12:18:45 | FromDiscord | <nocturn9x> is it not dispatching because `name` is of a different type |
12:18:48 | FromDiscord | <nocturn9x> (edit) "type" => "type?" |
12:19:03 | FromDiscord | <nocturn9x> afaik nim only has single dispatch, right? |
12:19:56 | FromDiscord | <nocturn9x> yes, that was it |
12:20:15 | FromDiscord | <nocturn9x> I had to declare `name` as `Name` rather than `BytecodeName` and then do an explicit type conversion inside |
12:22:04 | * | disso_peach quit (Ping timeout: 256 seconds) |
12:22:07 | FromDiscord | <ShalokShalom> Didn't the compiler just tell you that's a type error? |
12:22:27 | FromDiscord | <ShalokShalom> Error messages could surely improve 😅 |
12:22:49 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=4iFh |
12:23:00 | FromDiscord | <Rika> okay |
12:25:05 | FromDiscord | <nocturn9x> In reply to @ShalokShalom "Didn't the compiler just": no |
12:25:06 | FromDiscord | <nocturn9x> it did compile |
12:25:11 | FromDiscord | <nocturn9x> it just called the stub instead |
12:25:20 | FromDiscord | <nocturn9x> In reply to @Rika "are the implementations public": they don't need to be |
12:25:24 | FromDiscord | <nocturn9x> they're internal to the bytecode compiler |
12:25:27 | FromDiscord | <nocturn9x> only the stubs are |
12:42:30 | * | jmdaemon quit (Ping timeout: 252 seconds) |
12:47:32 | FromDiscord | <ringabout> Is there a difference to build course on between Window and Linux? |
12:51:57 | FromDiscord | <ShalokShalom> In reply to @nocturn9x "no": So the type system did fail somehow? |
12:52:11 | * | pro joined #nim |
12:52:55 | FromDiscord | <nocturn9x> nim's type system? I don't know if I'd call it a fail |
12:53:17 | FromDiscord | <nocturn9x> it was yet another case of PEBCAK |
12:57:34 | FromDiscord | <ShalokShalom> Idk, that's a fail in my book |
12:58:16 | FromDiscord | <ShalokShalom> Or I misunderstood the sense of a type system |
13:06:50 | FromDiscord | <scruz> How would I delete all nimble packages in one command? |
13:07:40 | FromDiscord | <scruz> There's `nimble delete [pkg]` but there's a lot of pkg(s) that I get when I use the command `nimble list` |
13:10:28 | FromDiscord | <scruz> nvm I'm just gonna manually delete the .nimble folder |
13:24:09 | FromDiscord | <Phil> In reply to @scruz "nvm I'm just gonna": I was about to say that your solution is one rm command away |
13:31:39 | FromDiscord | <scruz> I asked because I want to uninstall nim |
13:31:52 | FromDiscord | <scruz> So I figured I'll delete all the nimble packages first |
13:33:09 | FromDiscord | <aMOPel> Hey there 🙂 I'm stuck on this problem:↵I have a `distinct` type and I want to `{.borrow.}` the operations from the base type. However the base type defines the operations in a template so I get the error "no symbol to borrow from found", because the template that defines the operations gets evaluated to late. Is there some way to force an earlier evaluation of that template? Or is there another way to get around this problem? |
13:33:36 | * | xet7 quit (Remote host closed the connection) |
13:36:08 | FromDiscord | <Bung> better post your code to https://play.nim-lang.org/ |
13:38:33 | * | disso_peach joined #nim |
13:41:46 | FromDiscord | <aMOPel> In reply to @Bung "better post your code": https://play.nim-lang.org/#ix=4iFs↵It doesn't run in the browser since it depends on a nimble package... |
13:45:41 | FromDiscord | <Bung> you can't borrow `[]` `[]=` |
13:46:26 | FromDiscord | <aMOPel> Interesting. The error gets thrown way before that, though. So the problems remains |
13:51:10 | FromDiscord | <Bung> you may try boot nim compiler from this https://github.com/nim-lang/Nim/pull/20659 |
13:51:50 | FromDiscord | <Bung> borrow is buggy I can't figure out the problem by eye |
13:55:36 | FromDiscord | <aMOPel> The problem is that `+` etc of the original type are defined in a template in the library `vmath`. |
13:56:03 | FromDiscord | <aMOPel> borrowing `==` for example works just fine, since it isn't defined in a template |
13:56:54 | FromDiscord | <aMOPel> My question is: is there some way to control the evaluation time of a template? Like a pragma that delays a template or forces an early evaluation of a template? |
13:58:19 | * | xet7 joined #nim |
14:01:59 | FromDiscord | <Bung> I just tried https://play.nim-lang.org/#ix=4iFv in devel |
14:02:16 | FromDiscord | <Bung> compiles fine, so the problem may not related to template |
14:02:30 | FromDiscord | <aMOPel> curious |
14:03:32 | FromDiscord | <aMOPel> you happen to know, when that code is expected to be merged? |
14:05:51 | FromDiscord | <Bung> probably after v2 release |
14:06:48 | FromDiscord | <ringabout> v2rc has been almost frozen, I don't think more PRs will be merged. |
14:07:13 | FromDiscord | <aMOPel> In reply to @Bung "probably after v2 release": Thanks for your help |
14:09:10 | * | moonlit quit (Ping timeout: 256 seconds) |
14:11:20 | FromDiscord | <aMOPel> In reply to @Bung "compiles fine, so the": does work indeed |
14:16:33 | FromDiscord | <BenitzCoding> In reply to @Isofruit "Things that haven't been": Cool! Thank you for the information!!! |
14:24:04 | FromDiscord | <albassort> o uh on evil |
14:24:08 | FromDiscord | <albassort> (edit) "o" => "so" |
14:24:18 | FromDiscord | <albassort> does uhhhhh is there no more defects? |
14:24:22 | FromDiscord | <albassort> (edit) "evil" => "devil" |
14:24:34 | * | disso_peach quit (Quit: Leaving) |
14:24:37 | FromDiscord | <albassort> because my program is breaking crashing and it wont tell me where :) |
14:26:50 | FromDiscord | <auxym> is it compiled with -d:debug? if so it should produce a stack trace |
14:27:08 | FromDiscord | <albassort> nothin |
14:28:02 | FromDiscord | <albassort> on danger it gives me more info |
14:29:27 | FromDiscord | <albassort> something in json is broken on devel |
14:29:44 | FromDiscord | <albassort> not a revolutionary sentence i know |
14:35:16 | * | moonlit joined #nim |
14:36:14 | * | xet7 quit (Quit: Leaving) |
14:42:45 | * | pro left #nim (#nim) |
14:46:09 | FromDiscord | <albassort> yea its broken |
14:46:26 | FromDiscord | <albassort> looking for a new json parser |
14:50:23 | FromDiscord | <auxym> there's a few on nimble. But if the issue isn't reported you should definitely open an issue on the nim GH. especially since the current devel will be released as v2 very soon |
15:00:20 | FromDiscord | <albassort> In reply to @auxym "there's a few on": opened an issue on jsony because treeformed forgot that not all json begin with { |
15:00:30 | FromDiscord | <albassort> (edit) "treeformed" => "treeform" |
15:00:45 | FromDiscord | <albassort> In reply to @auxym "there's a few on": sounds like a pita, probably wont do shit |
15:01:30 | FromDiscord | <ringabout> https://github.com/nim-lang/Nim/pull/21108 the devel branch is going to use csource_v2 |
15:03:23 | FromDiscord | <ringabout> (edit) "csource_v2" => "csources_v2" |
15:05:59 | FromDiscord | <albassort> nevermind my code is borked in strange and eldritch ways |
15:06:41 | FromDiscord | <albassort> unless its an illusive bug |
15:08:49 | FromDiscord | <albassort> hmmm |
15:10:11 | FromDiscord | <albassort> oh god this bug is insane |
15:11:03 | FromDiscord | <Phil> In reply to @albassort "nevermind my code is": This is why every programmer should carry with them the holy sword of refactor |
15:11:22 | FromDiscord | <albassort> well |
15:11:27 | FromDiscord | <Phil> Only this legendary blade enables you to slay the beast and turn it into a well-ordered and easily understandable program |
15:11:27 | FromDiscord | <albassort> i was implementing new code into old code |
15:11:33 | FromDiscord | <albassort> already refactored |
15:11:50 | FromDiscord | <Phil> One never can stab the best with refactor enoguh |
15:11:52 | FromDiscord | <Phil> (edit) "enoguh" => "enough" |
15:12:01 | FromDiscord | <Phil> ~~only when the money runs out~~ |
15:13:06 | FromDiscord | <albassort> so the json parser is mutating based on what im doing with it next |
15:13:11 | FromDiscord | <albassort> so i think this is a GC issue |
15:15:33 | FromDiscord | <albassort> https://media.discordapp.net/attachments/371759389889003532/1052967156796641381/Peek_2022-12-15_10-15.mp4 |
15:15:35 | FromDiscord | <albassort> @Phil |
15:19:29 | * | moonlit quit (Remote host closed the connection) |
15:19:47 | * | moonlit joined #nim |
15:23:59 | FromDiscord | <@thatrandomperson5-6310e3b26da03> I get type mistmatch for `fieldPairs` on a object of an object of RootObj |
15:24:02 | FromDiscord | <@thatrandomperson5-6310e3b26da03> how do fix |
15:24:22 | FromDiscord | <Phil> Why in the name of all that is holy aren't you splitting that into more sub-procs |
15:25:13 | FromDiscord | <albassort> I G N O R E T H E C O D E |
15:25:30 | FromDiscord | <albassort> how am i gonna improve my code when my compiler is being a big ole bitch |
15:26:17 | FromDiscord | <albassort> i rewrote it to be all pretty |
15:26:20 | FromDiscord | <albassort> and it was like 200x slower |
15:26:21 | FromDiscord | <Phil> I am like 10% certain that you missunderstood jsony |
15:26:26 | FromDiscord | <Phil> (edit) "missunderstood" => "misunderstood" |
15:26:30 | FromDiscord | <Phil> Can't really say for sure |
15:26:31 | FromDiscord | <albassort> this is json |
15:26:39 | FromDiscord | <albassort> jsony doesn't work for this situation |
15:26:47 | FromDiscord | <albassort> i owned an issue for it |
15:26:49 | FromDiscord | <Phil> Ahhh okay |
15:27:04 | FromDiscord | <albassort> (edit) "owned" => "opened" |
15:27:06 | FromDiscord | <Phil> the jsony variable in between threw me off |
15:27:08 | FromDiscord | <planetis> Maybe you don't close the file |
15:27:26 | FromDiscord | <albassort> what do you mean |
15:27:46 | FromDiscord | <planetis> You write to a file? |
15:28:01 | FromDiscord | <albassort> no |
15:28:08 | FromDiscord | <planetis> Nvm |
15:28:16 | FromDiscord | <albassort> the only thing different is the extra lines of me capturing the data |
15:36:04 | FromDiscord | <Scuffi> Does anyone know how to change the nim compiler version/platform? My compiler uses amd64 but I'm actually running arm64 (m1 chip)? |
15:39:59 | * | moonlit quit (Remote host closed the connection) |
15:40:16 | * | moonlit joined #nim |
15:42:13 | FromDiscord | <albassort> https://nim-lang.org/docs/nimc.html |
15:42:30 | FromDiscord | <albassort> @Scuffi |
15:42:39 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4iFT |
15:43:19 | FromDiscord | <albassort> In reply to @albassort "": so the issue was in os.walkdir |
15:43:39 | FromDiscord | <Scuffi> sent a code paste, see https://play.nim-lang.org/#ix=4iFU |
15:43:49 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4iFV |
15:45:46 | FromDiscord | <albassort> i don't know to open an issue :think: |
15:56:17 | FromDiscord | <auxym> In reply to @Scuffi "Thank you": for arm64 it should be `--cpu:aarch64` |
15:56:23 | FromDiscord | <auxym> arm is arm 32bit |
15:57:04 | FromDiscord | <Scuffi> In reply to @auxym "for arm64 it should": ah okay thank you |
15:57:43 | FromDiscord | <Scuffi> I specified arm64 as the compiler is telling me that aarch64 is unknown |
15:59:18 | FromDiscord | <auxym> sent a code paste, see https://play.nim-lang.org/#ix=4iG1 |
15:59:23 | FromDiscord | <auxym> In reply to @Scuffi "I specified arm64 as": yes right sorry arm64 is correct |
16:00:21 | FromDiscord | <Scuffi> okay thanks i'll try that as i'm trying to use nimpy to import compiled nim but keep getting a mismatch in architectures so i'll try edit some config stuff |
16:03:07 | FromDiscord | <@thatrandomperson5-6310e3b26da03> > I get type mistmatch for `fieldPairs` on a object of an object of RootObj↵help? |
16:08:29 | FromDiscord | <Phil> Could you show a code sample |
16:08:31 | FromDiscord | <Phil> ? |
16:09:08 | FromDiscord | <Phil> Because `type A = object of object of RootObj` shouldn't even be a valid definition in the first place so I'm not 100% |
16:10:18 | FromDiscord | <@thatrandomperson5-6310e3b26da03> > Because `type A = object of object of RootObj` shouldn't even be a valid definition in the first place so I'm not 100%↵My type\: |
16:10:46 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iG8 |
16:11:08 | FromDiscord | <Phil> In reply to @@thatrandomperson5-6310e3b26da03 "> Because `type A": The bridge appears to be dying a sad death, could you post a link to the playground with your code? https://media.discordapp.net/attachments/371759389889003532/1052981144439758878/image.png |
16:14:02 | FromDiscord | <@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4iGa |
16:14:50 | NimEventer | New thread by DougT: Odd timings using threads, see https://forum.nim-lang.org/t/9726 |
16:17:44 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iGe |
16:28:38 | FromDiscord | <sOkam!> @exelotl I'm documenting my project with `##` and markdown syntax, but I'm not ready to adopt the natu-docs workflow yet. Is this a good enough pattern to start documenting with, so that later on I can adopt the tool into the project without trouble? Or should I be doing something else? |
16:31:45 | * | junaid_ joined #nim |
16:31:57 | FromDiscord | <exelotl> mmh so my sphinx extension so far is only made with RST syntax in mind. I'd imagine it's possible to make it work with markdown syntax but I don't know how yet, would need to look into it some more. |
16:32:21 | FromDiscord | <exelotl> but yes generally you're just writing normal procs and types with ## comments |
16:40:19 | FromDiscord | <exelotl> I really need to get enums and object field documentation working 😭 |
16:42:34 | FromDiscord | <auxym> sphinx extension? tell me more... |
16:43:26 | FromDiscord | <exelotl> https://git.sr.ht/~exelotl/natu-docs |
16:45:21 | FromDiscord | <exelotl> not properly released yet but basically I wrote a crappy parser in Python to extract the docs from a "normal" nim codebase (i.e. one with simple types/vars/procs, not one that's doing crazy compile-time shenanigans to generate public symbols) |
16:48:55 | FromDiscord | <exelotl> Once it's set up you can just write in your docs e.g. `.. autonim:: backgrounds.loadTiles` and it will generate the signature & description for that symbol https://media.discordapp.net/attachments/371759389889003532/1052990649126887466/Screenshot_from_2022-12-15_16-49-05.png |
16:49:40 | * | disso_peach joined #nim |
16:50:40 | FromDiscord | <exelotl> it's still pretty rough right now though, and I have limited time to work on it |
17:03:06 | NimEventer | New thread by DougT: Strange timings for threads, see https://forum.nim-lang.org/t/9728 |
17:03:38 | FromDiscord | <auxym> In reply to @exelotl "not properly released yet": Cool. I haven't actually properly written nim docs yet, but I have a project I want to document in the near future, and I'm somewhat familiar with sphinx (or I was, 10 years ago, at least). Out of curiosity, instead of parsing nim directly, couldn't you use the output the jsondoc? |
17:17:59 | * | moonlit quit (Remote host closed the connection) |
17:18:34 | * | moonlit joined #nim |
17:21:07 | * | disso_peach quit (Ping timeout: 265 seconds) |
17:31:20 | * | rockcavera joined #nim |
17:33:34 | FromDiscord | <exelotl> kind of, but it doesn't output in an ideal format for use with other documentation systems: https://nim-lang.org/docs/docgen.html#document-types-json |
17:34:32 | FromDiscord | <exelotl> the descriptions are pre-converted to HTML so you have to convert them back. And the args & fields aren't exposed in a programmer-friendly way, so you still have to parse them yourself anyways |
17:41:51 | FromDiscord | <@thatrandomperson5-6310e3b26da03> Both of mine a ref objects, not object↵(@Phil) |
17:43:18 | FromDiscord | <Phil> In reply to @@thatrandomperson5-6310e3b26da03 "Both of mine a": Field pairs only works on objects directly. If you want to use it on a ref object you need to dereference it with [] first |
17:45:15 | FromDiscord | <@thatrandomperson5-6310e3b26da03> Idk how to make it just object from within a macro |
17:49:17 | NimEventer | New thread by DougT: Odd timings for threads, see https://forum.nim-lang.org/t/9729 |
17:51:54 | FromDiscord | <メッリーレイムー 🎄> sent a code paste, see https://play.nim-lang.org/#ix=4iGH |
17:52:00 | FromDiscord | <メッリーレイムー 🎄> sent a code paste, see https://play.nim-lang.org/#ix=4iGI |
17:52:24 | FromDiscord | <@thatrandomperson5-6310e3b26da03> Ok, i fixed it, thanks |
17:57:26 | FromDiscord | <メッリーレイムー 🎄> sent a code paste, see https://play.nim-lang.org/#ix=4iGL |
18:00:38 | FromDiscord | <@thatrandomperson5-6310e3b26da03> What is the difference between ref object and object. Becuase if it is not ref object it can’t find the proc from the parent |
18:03:26 | FromDiscord | <@thatrandomperson5-6310e3b26da03> Here is the example of the issue\: https://play.nim-lang.org/#ix=4iGQ |
18:04:41 | FromDiscord | <Phil> In reply to @@thatrandomperson5-6310e3b26da03 "What is the difference": Ref object is in heap memory, so a random piece of memory somewhere in your ram .↵Direct objects are in stack memory, they're faster but always create a copy whenever you reassign a variable, which can be slow for large objects etc.↵↵Basically it comes down to stack Vs heap memory |
18:06:08 | FromDiscord | <Phil> The proc from the parent? What output would you expect? |
18:06:11 | FromDiscord | <@thatrandomperson5-6310e3b26da03> How come in the example i provided it does not work.↵(@Phil) |
18:06:33 | FromDiscord | <@thatrandomperson5-6310e3b26da03> > The proc from the parent? What output would you expect?↵The output of the provided $ proc |
18:07:13 | FromDiscord | <Phil> To me the output looks correct.↵Do you not expect to see the field of type B because you are typing initially for A? |
18:08:09 | FromDiscord | <@thatrandomperson5-6310e3b26da03> Im trying to understand why it only works with “ref” |
18:08:37 | FromDiscord | <@thatrandomperson5-6310e3b26da03> But i get another error |
18:11:28 | FromDiscord | <@thatrandomperson5-6310e3b26da03> > To me the output looks correct.↵> Do you not expect to see the field of type B because you are typing initially for A?↵I expect it to take the $ for type A becuase that is after RootObj |
18:12:04 | FromDiscord | <メッリーレイムー 🎄> In reply to @メッリーレイムー 🎄 "how do i take": so how do i fix this? |
18:13:02 | FromDiscord | <Phil> https://play.nim-lang.org/#ix=4iGR↵The compiling version for ref objects.↵I'm actually surprised it's not printing the field of B |
18:17:18 | FromDiscord | <@thatrandomperson5-6310e3b26da03> > https://play.nim-lang.org/#ix=4iGR↵> The compiling version for ref objects.↵> I'm actually surprised it's not printing the field of B↵It does not echo anything, also don’t use [], it only gives the attributes of the parent |
18:18:21 | FromDiscord | <メッリーレイムー 🎄> can i get some help? |
18:19:01 | FromDiscord | <Phil> I'm on phone and doing reps in between, for anything more substantial you'll need to wait |
18:19:34 | * | junaid_ quit (Remote host closed the connection) |
18:21:59 | FromDiscord | <Phil> In reply to @@thatrandomperson5-6310e3b26da03 "> https://play.nim-lang.org/#ix=4iGR > The": You'll have to as [] dereferences the ref object, can't use any of the iterators otherwise |
18:22:39 | * | neceve joined #nim |
18:23:03 | * | neceve quit (Remote host closed the connection) |
18:23:04 | FromDiscord | <Phil> What you're trying to do may require a generic rather than just using the parent class |
18:26:04 | FromDiscord | <Phil> I can whip up an example in 2h or so, I'm not typing out generics via phone |
18:40:40 | * | neceve joined #nim |
18:41:02 | FromDiscord | <Phil> In reply to @メッリーレイムー 🎄 "how do i take": Why not just write the function that you want to accept without the name? |
18:41:02 | * | neceve quit (Remote host closed the connection) |
18:41:55 | FromDiscord | <Phil> A proc declaration is, in a sense, just a type declaration that also assigns the instructions underneath it to the name you provide in the proc declaration |
18:43:02 | FromDiscord | <Phil> Here an example of how norm accepts a func to create dB connections ↵https://norm.nim.town/pool.html |
18:43:06 | FromDiscord | <albassort> is there any alternative to OS.walkdir |
18:43:17 | FromDiscord | <albassort> im tired of my life being wasted on whatever the fuck is happening here |
18:44:08 | FromDiscord | <Phil> Best ask beef I think, I'm not aware of one.↵Maybe there's a nimble package? |
18:44:43 | * | neceve joined #nim |
18:45:02 | * | neceve quit (Remote host closed the connection) |
18:45:06 | FromDiscord | <albassort> i cant think anything else thats causing this |
18:46:12 | FromDiscord | <Phil> In reply to @メッリーレイムー 🎄 "how do i take": Ah, in my norm link the example is at the very bottom |
18:47:22 | FromDiscord | <albassort> how do i even report this bug |
18:47:51 | FromDiscord | <Phil> Minimal example possible?↵I assume no... Try to anyway? |
18:48:39 | * | neceve joined #nim |
18:49:02 | * | neceve quit (Remote host closed the connection) |
18:51:45 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4iGZ |
18:56:27 | FromDiscord | <メッリーレイムー 🎄> In reply to @Isofruit "Why not just write": how would i do this? |
18:56:31 | FromDiscord | <メッリーレイムー 🎄> im confused ngl |
18:58:08 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4iH1 |
18:58:48 | FromDiscord | <albassort> its hideous |
19:00:55 | FromDiscord | <Phil> In reply to @メッリーレイムー 🎄 "how would i do": Already checked out the linked norm docs? |
19:00:56 | * | neceve joined #nim |
19:09:35 | FromDiscord | <albassort> https://github.com/nim-lang/Nim/issues/21111 |
19:28:27 | FromDiscord | <Phil> Finally back in front of a keyboard |
19:28:35 | FromDiscord | <Gumbercules> were you behind it earlier? |
19:29:10 | FromDiscord | <Gumbercules> I'm kidding by the way |
19:29:23 | FromDiscord | <Gumbercules> having some fun 🙂 |
19:29:27 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iH9 |
19:30:15 | FromDiscord | <Gumbercules> you could also just do `let x = proc() = echo "Hello World"` |
19:30:17 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iHa |
19:30:38 | FromDiscord | <Phil> In reply to @Gumbercules "you could also just": The point was around how to pass a proc, so the first thing is about type annotations for proc variables |
19:30:42 | FromDiscord | <Gumbercules> gotcha |
19:31:05 | FromDiscord | <Gumbercules> and thanks for the context |
19:32:23 | FromDiscord | <@thatrandomperson5-6310e3b26da03> What. Idk what that is↵(@Phil) |
19:33:04 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iHb |
19:33:20 | FromDiscord | <Phil> In reply to @@thatrandomperson5-6310e3b26da03 "What. Idk what that": Alrighty, in that case first what background knowledge you've got so far? Python? |
19:33:32 | FromDiscord | <Phil> So I know where to make analogies to |
19:36:38 | FromDiscord | <Gumbercules> In reply to @albassort "https://github.com/nim-lang/Nim/issues/21111": didn't you say `std/json` was broken on devel? |
19:36:42 | FromDiscord | <Gumbercules> I just compiled my project with it and it works fine |
19:36:50 | FromDiscord | <メッリーレイムー 🎄> sent a code paste, see https://play.nim-lang.org/#ix=4iHc |
19:36:51 | FromDiscord | <メッリーレイムー 🎄> like a callback |
19:37:10 | FromDiscord | <Phil> In reply to @メッリーレイムー 🎄 "I just want to": See my last example 😉↵Just trying to show you all examples including throwing it into a variable |
19:38:21 | FromDiscord | <Phil> In reply to @@thatrandomperson5-6310e3b26da03 "What. Idk what that": Here an example of how this would work via generic that requires that any type passed to it is inherited from A:↵https://play.nim-lang.org/#ix=4iHe |
19:38:25 | FromDiscord | <メッリーレイムー 🎄> sent a code paste, see https://paste.rs/4L1 |
19:38:31 | FromDiscord | <メッリーレイムー 🎄> @Phil |
19:38:46 | FromDiscord | <Phil> One sec, throwing it in an editor to look at it closer |
19:39:39 | FromDiscord | <Phil> What's the type definition of Parser? |
19:40:44 | FromDiscord | <Phil> @メッリーレイムー 🎄 |
19:41:15 | FromDiscord | <メッリーレイムー 🎄> one sec |
19:45:41 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iHh |
19:45:49 | FromDiscord | <Phil> Will print out "Potato" and an empty seq |
19:52:19 | * | tiorock joined #nim |
19:52:19 | * | tiorock quit (Changing host) |
19:52:19 | * | tiorock joined #nim |
19:52:19 | * | rockcavera quit (Killed (tantalum.libera.chat (Nickname regained by services))) |
19:52:19 | * | tiorock is now known as rockcavera |
20:12:15 | FromDiscord | <@thatrandomperson5-6310e3b26da03> Python↵(@Phil) |
20:12:52 | FromDiscord | <Phil> In reply to @@thatrandomperson5-6310e3b26da03 "Python (<@180601887916163073>)": Ahh perfect.↵So you know how in python you can pass any sort of value into any kind of function? |
20:13:30 | FromDiscord | <Phil> You could pass a string into a function just as well as a number or whatever, you'll find out at runtime if it breaks or not |
20:14:34 | FromDiscord | <メッリーレイムー 🎄> In reply to @Isofruit "I can't make an": that is so cursed |
20:14:40 | FromDiscord | <Phil> In reply to @@thatrandomperson5-6310e3b26da03 "Python (<@180601887916163073>)": Nim insists that you specify what type everything is.↵However, often you want to do the same type of operation for multiple different datatypes just like in python, that's where generics come into play.↵You can define one proc and it'll work for all types that meet the criteria you define |
20:14:43 | FromDiscord | <メッリーレイムー 🎄> lemme get on pc and then send u the gypes |
20:15:12 | FromDiscord | <Phil> In reply to @メッリーレイムー 🎄 "that is so cursed": In my defense, I had no choice 😛 |
20:18:36 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iHn |
20:20:40 | FromDiscord | <treeform> In reply to @albassort "opened an issue on": I replied to your issue https://github.com/treeform/jsony/issues/55 |
20:21:51 | * | pro joined #nim |
20:23:21 | FromDiscord | <@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4iHp |
20:23:39 | * | pro left #nim (#nim) |
20:25:58 | FromDiscord | <Phil> In reply to @@thatrandomperson5-6310e3b26da03 "This is my proc": Could you try the playground again?↵THe bridge really doesn't like when you post code, I'm getting HTML all over the place |
20:26:10 | FromDiscord | <Phil> https://media.discordapp.net/attachments/371759389889003532/1053045320155660319/image.png |
20:34:29 | * | moonlit quit (Remote host closed the connection) |
20:34:46 | * | moonlit joined #nim |
20:49:10 | * | pro joined #nim |
20:49:34 | * | pro left #nim (#nim) |
20:53:15 | * | arkurious joined #nim |
21:00:03 | * | neceve quit (Quit: ZNC - https://znc.in) |
21:11:40 | * | neceve joined #nim |
21:12:02 | * | neceve quit (Remote host closed the connection) |
21:16:46 | * | neceve joined #nim |
21:17:01 | * | neceve quit (Remote host closed the connection) |
21:34:46 | * | neceve joined #nim |
21:35:02 | * | neceve quit (Remote host closed the connection) |
21:37:32 | FromDiscord | <メッリーレイムー 🎄> sent a code paste, see https://play.nim-lang.org/#ix=4iHz |
21:38:35 | * | neceve joined #nim |
21:39:01 | * | neceve quit (Remote host closed the connection) |
21:41:13 | FromDiscord | <Phil> Ahh, the f needs to be a closure but "parseFuncParam" doesn't appear to be one (?)↵How are you defining the func? In-line with some help from std/sugar? |
21:41:41 | FromDiscord | <Elegantbeef> They're calling a procedure instead of passing a procedure |
21:41:53 | FromDiscord | <Phil> You can read that from the error? |
21:42:01 | FromDiscord | <Elegantbeef> > but expression 'parseFuncParam(parser)' is of type\: AstNode |
21:42:21 | FromDiscord | <Elegantbeef> > required type for f\: proc (i0\: Parser)\: AstNode{.closure.} |
21:43:07 | FromDiscord | <Phil> That's how I got that it's not a closure but should be, inferring the next step that thus what is being passed as a call of the proc instead of .... ohhhh you saw that given the proc should return an AstNode |
21:43:28 | FromDiscord | <Elegantbeef> Correct |
21:43:54 | FromDiscord | <Phil> See, this is why you're beef |
21:45:05 | FromDiscord | <Elegantbeef> Cause my parents didnt love me? |
21:45:57 | FromDiscord | <Phil> If that's what gave you the ability to learn nim and understand problems that quickly, then yes |
21:47:41 | * | neceve joined #nim |
21:48:02 | * | neceve quit (Remote host closed the connection) |
22:01:41 | * | neceve joined #nim |
22:19:07 | * | disso_peach joined #nim |
22:26:51 | FromDiscord | <Scuffi> If I had an instance of a type that I want to be global, i.e. shared across all threads, how could I write it? Every time I've attempted to it's given me the error of the variable not being gc-safe, which makes sense, I'm just not sure of the syntactical method of writing it correctly? |
22:33:16 | FromDiscord | <Elegantbeef> Thread analysis can be overidden if what you're doing you know is safe |
22:34:05 | FromDiscord | <Elegantbeef> Perhaps `SharedPtr` in nim-lang/threading might work with `ref`s |
22:34:08 | FromDiscord | <Elegantbeef> But i do not know |
22:37:30 | FromDiscord | <Phil> ... I just copiously apply "cast gcsafe" tbh |
22:37:51 | FromDiscord | <Phil> and make sure the type has a lock somewhere |
22:38:10 | FromDiscord | <Elegantbeef> Yea that works with arc/orc |
22:38:17 | FromDiscord | <Phil> not with refc? |
22:38:20 | FromDiscord | <Elegantbeef> It's not a good design to force upon users |
22:38:26 | FromDiscord | <Phil> Okay thats fair |
22:38:28 | FromDiscord | <Elegantbeef> refc doesnt have a shared heap |
22:38:47 | FromDiscord | <Phil> Wait so every thread under refc has its own heap? |
22:38:48 | FromDiscord | <Phil> Huh |
22:43:49 | FromDiscord | <ajusa> Is there a way for me to avoid writing out all of these generic params and instead use varargs somehow? I want this template to take any number of arguments, and those arguments to be of any type at compile time. https://github.com/ajusa/rowdy/blob/master/src/rowdy.nim#L29-L52↵↵At the moment I'm planning on duplicating this code by hand, but that seems a bit tiresome |
22:44:07 | FromDiscord | <ajusa> (edit) "hand," => "hand (T1, T2, T3)," |
22:44:54 | FromDiscord | <@thatrandomperson5-6310e3b26da03> ? |
22:45:38 | FromDiscord | <! Nilts> The gitter link sucks, but now i'm on discord. |
22:47:30 | FromDiscord | <Phil> In reply to @@thatrandomperson5-6310e3b26da03 "?": The bridge seriously is dying, I didn't see that post and its still not there when I'm Looking for it ↵I'll take a look at it one sec https://media.discordapp.net/attachments/371759389889003532/1053080892299559033/image.png |
22:48:02 | FromDiscord | <Phil> (edit) "↵I'll" => "(see screenshot jumps from 22:45 to after 23:00 seamlessly)↵I'll" |
22:49:18 | FromDiscord | <Phil> In reply to @@thatrandomperson5-6310e3b26da03 "?": Your error is ` Error: the field 'catName' is not accessible.`? |
22:50:05 | FromDiscord | <Phil> Then you're running into one of nims ways to keep fields private.↵If you want to make a field accessible to code outside of the module that said field is defined in, you also need to annotate it with `` just like you would the type itself or a proc |
22:50:27 | FromDiscord | <Phil> Just because put taht `` onto the type doesn't mean all its fields are public, just that the type can be used outside of the module where its defined |
22:50:33 | FromDiscord | <Phil> (edit) "taht" => "that" |
22:50:52 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iHI |
22:51:45 | FromDiscord | <Phil> (edit) "Just because ... put" added "you" |
22:56:26 | FromDiscord | <! Nilts> In reply to @Isofruit "Basically, this fixes it:": It is suddenly working, but thanks, btw this is the discord account for thatrandomperson5 |
22:56:41 | FromDiscord | <メッリーレイムー 🎄> sent a code paste, see https://play.nim-lang.org/#ix=4iHK |
22:56:44 | FromDiscord | <Phil> In reply to @not logged in "It is suddenly working,": Ohhhhhhhh I was mildly confused already 😄 |
22:56:47 | FromDiscord | <メッリーレイムー 🎄> seperated by _ |
22:56:50 | FromDiscord | <Phil> Webcord works okay btw |
22:57:32 | FromDiscord | <Phil> In reply to @メッリーレイムー 🎄 "playing around w/ doing": So like... If I were to feed in A and B it would generate `A_B`? |
22:58:19 | FromDiscord | <Phil> As for how to generate that, I'm pretty sure you can just make a string like that and then turn the string into a symbol |
22:58:30 | FromDiscord | <Phil> I remember stealing a macro for that from beef as a general "getter" kind of thing |
22:59:24 | FromDiscord | <メッリーレイムー 🎄> In reply to @Isofruit "So like... If I": yeah |
23:00:13 | FromDiscord | <メッリーレイムー 🎄> sent a code paste, see https://play.nim-lang.org/#ix=4iHL |
23:00:30 | FromDiscord | <メッリーレイムー 🎄> yes, i am adding a scuffed form of typeclasses to nim, dont @ me |
23:00:51 | FromDiscord | <! Nilts> How do i check if the value of a var is a proc? |
23:01:23 | FromDiscord | <Phil> In reply to @not logged in "How do i check": In what context would you not know the type of a variable ? |
23:01:53 | FromDiscord | <! Nilts> In reply to @Isofruit "In what context would": `fieldPairs` |
23:02:17 | * | pech joined #nim |
23:02:21 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iHN |
23:03:14 | FromDiscord | <メッリーレイムー 🎄> so is this possible? @Phil |
23:03:33 | FromDiscord | <! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4iHO |
23:03:37 | FromDiscord | <Phil> In reply to @メッリーレイムー 🎄 "so is this possible?": It is, but my macro knowledge is somewhere below sea level, so your only option is to try and steal from beef |
23:04:03 | FromDiscord | <メッリーレイムー 🎄> can i not just have it generate a class and then insert my own manually written code below it? |
23:04:07 | FromDiscord | <メッリーレイムー 🎄> or is that not how macros work |
23:05:10 | FromDiscord | <Elegantbeef> `let myName = ident($one & $two)` |
23:05:15 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iHP |
23:05:34 | * | disso_peach quit (Ping timeout: 272 seconds) |
23:06:07 | * | ksqsf joined #nim |
23:06:30 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iHQ |
23:06:40 | FromDiscord | <Elegantbeef> Inside the macro you dunce |
23:07:09 | FromDiscord | <Phil> In my defence, it's like really late and I guess I should really go to sleep |
23:10:21 | FromDiscord | <メッリーレイムー 🎄> im curious how cursed i can make this thing |
23:10:29 | FromDiscord | <jmgomez> Hey beef, now you are here.. can you pass a parameter from a macro (static) to a static parameter from a proc? Faced that today and had to do a workaround |
23:11:00 | FromDiscord | <! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4iHT |
23:12:52 | FromDiscord | <Phil> Could you paste the next 5-6 lines of the error as well? |
23:13:10 | FromDiscord | <Phil> And indicate where line 19 is |
23:13:47 | FromDiscord | <Phil> Ohhhhhhhhh wait |
23:14:03 | FromDiscord | <Phil> In reply to @not logged in "Can someone please explain": You want to do that kind of stuff compile-time, not runtime.↵If only works on runtime. You want to use when |
23:14:40 | FromDiscord | <! Nilts> ??? |
23:14:48 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iHW |
23:15:14 | FromDiscord | <Phil> Imagine when as being a pair of scissors that cuts one of these pieces (either what is under when or what is under else) out of your code at compile-time depending on the circumstances |
23:15:36 | FromDiscord | <Phil> Wait, right, compiletime and loop unrolling is something you're likely not yet familiar with |
23:15:50 | FromDiscord | <! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4iHX |
23:16:34 | * | Phytolizer joined #nim |
23:17:20 | FromDiscord | <Elegantbeef> Nope they're considered runtime values afaik↵(@jmgomez) |
23:18:11 | FromDiscord | <demotomohiro> `fieldPair` iterator generates a code that repeat iterator body to each fields at compile time and when statement runs at compile time. |
23:18:42 | * | Phytolizer quit (Remote host closed the connection) |
23:19:20 | FromDiscord | <! Nilts> In reply to @demotomohiro "`fieldPair` iterator generates a": nice ok |
23:19:31 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iHZ |
23:20:03 | FromDiscord | <Phil> That's what's meant when anything talks of "unrolling a loop" |
23:20:21 | FromDiscord | <! Nilts> ok, thanks |
23:22:05 | * | ksqsf quit (Remote host closed the connection) |
23:51:15 | * | ksqsf joined #nim |
23:52:21 | FromDiscord | <! Nilts> In a macro can i create a unused Ident? For making a type? Also what is a symbol |
23:52:52 | * | ksqsf left #nim (#nim) |