00:07:33 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
01:55:33 | * | rockcavera joined #nim |
03:11:13 | * | ehmry quit (Ping timeout: 252 seconds) |
03:16:23 | * | ehmry joined #nim |
03:56:04 | * | arkurious quit (Quit: Leaving) |
03:59:52 | FromDiscord | <hcorion> Does Nim have consts for max int32/int64 sizes? |
04:01:58 | FromDiscord | <Elegantbeef> `int32.high` |
04:08:53 | FromDiscord | <hcorion> Excellent, thanks! |
04:10:58 | FromDiscord | <hcorion> Hmm, I guess what I'm looking for wasn't the int max size 🤔 |
04:11:27 | FromDiscord | <hcorion> Any idea if there's a const that points to `360287970189639688` |
04:11:44 | FromDiscord | <hcorion> (edit) "`360287970189639688`" => "`36028797018963968`" |
04:12:26 | FromDiscord | <Elegantbeef> What's special about that number? |
04:12:58 | FromDiscord | <Elegantbeef> What's so special about 2^55? |
04:13:20 | FromDiscord | <hcorion> sent a code paste, see https://play.nim-lang.org/#ix=4glW |
04:13:45 | FromDiscord | <Elegantbeef> What's the code? |
04:14:09 | FromDiscord | <huantian> In reply to @Elegantbeef "What's so special about": it's like the max safe integer in js iirc? |
04:15:08 | FromDiscord | <huantian> aka max safe int for a float64 |
04:16:10 | FromDiscord | <huantian> wait no that's 2^53 |
04:19:47 | FromDiscord | <hcorion> The code is a bit uhh |
04:21:31 | FromDiscord | <hcorion> It's not my code, so I don't full understand what's going on, but it's some fancy macro code |
04:21:45 | FromDiscord | <hcorion> sent a code paste, see https://play.nim-lang.org/#ix=4glY |
04:22:32 | FromDiscord | <Elegantbeef> Well luckily i know that's not my macro code 😛 |
04:22:40 | FromDiscord | <hcorion> The try except isn't working for whatever reason |
04:22:53 | FromDiscord | <Elegantbeef> `typ(ord(a))` looks suspect, i imagine it's someone passing in a range |
04:23:01 | FromDiscord | <Elegantbeef> Well the code isnt getting to runtime |
04:25:10 | FromDiscord | <hcorion> The problematic converter is the toName, not the toValName one |
04:25:51 | FromDiscord | <Elegantbeef> well `echo converters.repr` |
04:33:05 | * | xcodz-dot joined #nim |
04:36:16 | * | xcodz-dot quit (Remote host closed the connection) |
04:36:39 | * | xcodz-dot joined #nim |
04:45:35 | FromDiscord | <hcorion> Figured out where the const was coming from, thanks for the help! |
05:05:10 | * | xcodz-dot quit (Quit: Leaving) |
05:27:26 | FromDiscord | <Prestige> How's IC going? |
05:27:48 | FromDiscord | <Elegantbeef> Most work is going towards 2.0 release |
05:28:04 | FromDiscord | <Elegantbeef> IC is not apart of 2.0's initial release |
05:28:16 | FromDiscord | <Prestige> Dang I thought most work like 18 months ago was going into IC so we could have better dev tooling |
05:28:58 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/pull/20540 is the present PR for it |
05:29:19 | FromDiscord | <Elegantbeef> Though that doesnt make it suddenly work everywhere, it's just a stepping stone |
05:30:16 | FromDiscord | <Prestige> I'm still surprised IC isn't the priority |
05:35:49 | FromDiscord | <Elegantbeef> IC isnt as much of a change to the compiler/language as 2.x is |
05:36:05 | FromDiscord | <Elegantbeef> Like yes it should be a priority but there are more important changes that are required for 2.0 |
05:44:36 | FromDiscord | <Prestige> I thought we were supposed to be focused on developer tooling 🤔 |
05:47:15 | FromDiscord | <Elegantbeef> That's not a breaking change |
05:47:20 | FromDiscord | <Elegantbeef> Which is the crux i think |
05:56:01 | FromDiscord | <Prestige> What do you mean? |
05:57:12 | FromDiscord | <Elegantbeef> With orc being very developed making it the default is important for the future of the language, which is one major change. While at it it's also best to remove redundant or poorly designed parts of the language |
05:57:48 | FromDiscord | <Elegantbeef> IC and tooling should isnt a breaking change so it can be backported |
05:58:05 | FromDiscord | <Elegantbeef> shouldnt be a breaking change\ |
05:58:06 | FromDiscord | <ieltan> I'm pretty sure IC would come after 2.0 release right? |
05:58:20 | FromDiscord | <Elegantbeef> That's the idea is to finish IC after 2.0 and backport to a 1.x version |
05:58:22 | FromDiscord | <Prestige> It's going to because that's what they're working on instead of IC |
05:58:46 | FromDiscord | <Elegantbeef> Personally i'm more interested in orc being default than IC |
05:59:03 | FromDiscord | <Prestige> I just want the tooling to not suck |
05:59:05 | FromDiscord | <ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4gmk |
05:59:06 | FromDiscord | <Elegantbeef> But i'm biased cause my code doesnt take forever to compile |
06:00:06 | FromDiscord | <ieltan> I think people might have missed it because it's was a subtle edit you had to re-read it all if you didn't want to miss it |
06:00:32 | FromDiscord | <Elegantbeef> 2.0 is planned to be release this year |
06:00:39 | FromDiscord | <Elegantbeef> So IC will be a focus soon |
06:01:45 | FromDiscord | <Elegantbeef> I dont even know if i believe that IC will vastly improve tooling, it very much should, but whether the implementation does will be another thing |
06:02:55 | FromDiscord | <Prestige> Everyone I know turns it down for other languages because the tooling is so sub par, I really hope that changes relatively soon |
06:03:07 | FromDiscord | <Prestige> but I think I've been saying that for 2 years already |
06:03:42 | FromDiscord | <Elegantbeef> Status does seem to want to focus on tooling so hopefully they continue with nimsuggest v3 |
06:04:02 | FromDiscord | <ieltan> In reply to @Elegantbeef "I dont even know": Well I think there was a time when IC sort of worked but then didn't? Gotta look at how well it did during that time |
06:06:08 | FromDiscord | <Elegantbeef> Havent really used nimlangserver with kate, but it does use the new version and should be more reliable to nimlsp |
06:06:08 | FromDiscord | <Elegantbeef> I know I know you dislike LSP |
06:06:33 | FromDiscord | <Elegantbeef> Well the tooling needs to change |
06:06:44 | FromDiscord | <Elegantbeef> nimsuggest compiles the code presently, it doesnt need to with IC |
06:06:53 | FromDiscord | <Elegantbeef> Nimsuggest just needs to say "regenerate the IC" |
06:07:03 | FromDiscord | <Elegantbeef> IC cache\ |
06:08:03 | FromDiscord | <Elegantbeef> In theory when you have IC all operations are "regenerate cache if needed, attempt to fetch this thing" |
06:20:58 | FromDiscord | <emanresu3> And exits with status 1. The html does generate but I'm wondering if there is an issue |
06:20:58 | FromDiscord | <emanresu3> Everytime I try to run `nim doc file.nim` I'm getting \` |
06:21:01 | FromDiscord | <emanresu3> sent a code paste, see https://play.nim-lang.org/#ix=4gmr |
06:21:44 | FromDiscord | <Elegantbeef> Seems it's attempting to copy the css but it doesnt exist in `/usr/doc/nimdoc.css` |
06:22:01 | FromDiscord | <emanresu3> Has that happened to anyone? I'm just using the example in Nim documentation |
06:22:12 | FromDiscord | <Elegantbeef> Which distro are you on and how did you install it? |
06:22:16 | FromDiscord | <Elegantbeef> Nim that is |
06:22:24 | FromDiscord | <emanresu3> Oh interesting, I'll check |
06:22:31 | FromDiscord | <emanresu3> In Arch Linux |
06:22:47 | FromDiscord | <emanresu3> Maybe here it doesn't ship with that file |
06:23:21 | FromDiscord | <Elegantbeef> I'd say use choosenim to install it |
06:23:26 | FromDiscord | <Elegantbeef> But i also hop versions a lot |
06:24:57 | FromDiscord | <Elegantbeef> Using the system package manager to install languages is lackluster |
06:25:51 | FromDiscord | <emanresu3> I create that file, empty, and now it works ok, an empty `nimdoc.out.css` file is also generated |
06:28:02 | FromDiscord | <emanresu3> So a couple of things, that error message was a bit confusing, it didn't put the missing filename besides the 'No such file or directory', but in a new line as 'Additional info' |
06:29:07 | FromDiscord | <emanresu3> And there's no directory `/usr/doc` in Arch Linux, I had to create it, does anyone know if that's a common directory in other Linuxes? |
06:30:03 | FromDiscord | <Elegantbeef> I think debian might have it |
06:30:10 | FromDiscord | <emanresu3> The error should also state that no `nimdoc.out.css` is generated as a cause of the error |
06:32:00 | FromDiscord | <Elegantbeef> It's an uncaught exception so it's not the compiler adding information it's just crashing |
06:34:57 | FromDiscord | <Elegantbeef> It doesnt excuse that it's not helpful |
06:35:00 | FromDiscord | <Elegantbeef> Just a reason it's not |
06:35:24 | FromDiscord | <emanresu3> I checked my debian boxes, I think `/usr/doc` doesn't exist there either, the Nim package in Debian installs in `/usr/lib/nim/doc/nimdoc.css` instead |
06:36:16 | FromDiscord | <emanresu3> So I'm trying to figure out if it's my Arch's packaging bug or if this happens elsewhere |
06:36:37 | FromDiscord | <Elegantbeef> Most people dont use the package manager package, but it's likely |
06:37:58 | FromDiscord | <emanresu3> Do you install nim through your OS package manager btw? Elegantbeef |
06:38:02 | FromDiscord | <Elegantbeef> Nope |
06:38:04 | FromDiscord | <Elegantbeef> I use choosenim |
06:38:30 | FromDiscord | <emanresu3> And where does the nimdoc.css file live? |
06:39:09 | FromDiscord | <Elegantbeef> `.choosenim/toolchains/$version/doc/` |
06:40:37 | FromDiscord | <emanresu3> Interesting, is there a config file where `nim doc` check for that file? |
06:41:10 | FromDiscord | <Elegantbeef> Not that i know of |
06:41:51 | FromDiscord | <emanresu3> So maybe the paths are harcoded when compiling nim? |
06:42:32 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/088487f652638a745e8e7e440a8a3b381239597b/compiler/nimpaths.nim#L27-L37 |
06:47:59 | * | tanami quit (Ping timeout: 260 seconds) |
06:48:07 | * | tanami joined #nim |
06:49:28 | FromDiscord | <emanresu3> Thanks! So I take it that's a yes, then I'll inform packagers in Arch about it, I rechecked and `/usr/lib/nim/doc/nimdoc.css` also ships in Arch, but that path is not configured correctly |
07:01:23 | * | wallabra quit (Ping timeout: 256 seconds) |
07:08:01 | FromDiscord | <huantian> Yk I always wondered why we don’t initialize refs by default |
07:08:32 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gmC |
07:10:01 | FromDiscord | <huantian> Ok fair |
07:10:20 | FromDiscord | <huantian> Maybe we should do static analysis to make sure you initialize it before you use it! |
07:11:05 | * | wallabra joined #nim |
07:11:23 | FromDiscord | <Elegantbeef> You mean `{.requiresInit.}`? |
07:11:32 | FromDiscord | <Elegantbeef> Or Araq's new DFA logic |
07:11:52 | FromDiscord | <huantian> Araq has new dfa logic? |
07:12:19 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/70d179ed007c7c077ca7845974fa89a9d184c01c/tests/init/tinitchecks_v2.nim |
07:12:30 | FromDiscord | <Elegantbeef> `strictDefs` that annoy me a bit |
07:13:32 | FromDiscord | <huantian> Huhhh |
07:15:49 | FromDiscord | <huantian> That is kinda interesting |
07:16:01 | FromDiscord | <huantian> Feels unnecessary for value types tho |
07:16:04 | FromDiscord | <Elegantbeef> Goes completely against `var a: MyType` |
07:16:15 | FromDiscord | <huantian> Yeah |
07:16:20 | FromDiscord | <Elegantbeef> and also against the new default logic |
07:16:48 | FromDiscord | <huantian> I feel like having per-type opt in forced initializing moght be useful |
07:16:55 | FromDiscord | <Elegantbeef> So `requiresInit` |
07:17:02 | FromDiscord | <huantian> Mhm yeah |
07:18:06 | FromDiscord | <huantian> Maybe all refs should have forced init before usage tho lmao |
07:20:50 | FromDiscord | <huantian> Init checking is kinda tricky tho |
07:22:07 | FromDiscord | <Elegantbeef> It only works on value types sadly |
07:22:09 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gmD |
07:22:25 | FromDiscord | <huantian> Dang |
07:22:46 | FromDiscord | <huantian> Yeah I feel like accidentally not initializing refs is kinda a stumbling block sometimes |
07:24:04 | FromDiscord | <huantian> Maybe while we fix that we can get nil tracking perfect too :p |
07:24:07 | FromDiscord | <Elegantbeef> I feel like that enables noobs to misues refs more |
07:24:40 | FromDiscord | <huantian> I don’t think that’s a good excuse to not have better safety for refs tho |
07:25:58 | FromDiscord | <Elegantbeef> I'm all for not nil |
07:26:13 | FromDiscord | <huantian> Yeah same |
07:26:29 | FromDiscord | <huantian> One thing C# is doing right is their nullable ref types |
07:26:43 | FromDiscord | <Elegantbeef> I dont think making all refs initialised by default a good solution |
07:27:02 | FromDiscord | <Elegantbeef> Sometimes you really want nil by default 😛 |
07:27:30 | FromDiscord | <huantian> Mmm perhaps |
07:28:04 | FromDiscord | <huantian> But I do like the idea of not nil being used more |
07:28:56 | FromDiscord | <huantian> How C# does it with `Type` always being not null, and `Type` being maybe null is also interesting |
07:29:06 | FromDiscord | <huantian> It has to be opt in ofc cus of old code |
07:32:34 | FromDiscord | <huantian> I think once we have that witn Nim ref becomes a lot more ergonomic |
07:36:23 | * | tanami quit (Ping timeout: 260 seconds) |
07:37:19 | * | tanami joined #nim |
07:45:39 | * | tanami quit (Ping timeout: 268 seconds) |
07:53:09 | * | tanami joined #nim |
07:54:34 | FromDiscord | <Tuatarian> is there a type of all procs with any inps/returns? |
07:54:53 | FromDiscord | <Tuatarian> aim here is to create a table associating strings to (pointers to) proc |
07:55:32 | FromDiscord | <Elegantbeef> you can do `proc` but that's a generic |
07:55:37 | FromDiscord | <Elegantbeef> There is no run time all procs |
07:55:47 | FromDiscord | <Elegantbeef> You'd need an object variant for storing all types you support |
07:56:26 | FromDiscord | <Tuatarian> trying to make this work `var whatever : Table[string, proc]` |
07:56:42 | FromDiscord | <Elegantbeef> You cannot |
07:56:43 | FromDiscord | <Tuatarian> ok I'd need a union type for all procs I'm using? |
07:56:46 | FromDiscord | <Tuatarian> that's really unfortunate |
07:56:47 | FromDiscord | <Elegantbeef> `proc` is a generic constraint |
07:56:47 | FromDiscord | <Elegantbeef> Correct |
07:56:53 | FromDiscord | <Tuatarian> yeah that's really unfortunate |
07:56:59 | FromDiscord | <Elegantbeef> It's required in a static typed language |
07:57:07 | FromDiscord | <Tuatarian> can I hack this with raw pointers |
07:57:32 | FromDiscord | <Elegantbeef> Of course you can cast to `pointer` |
07:58:01 | FromDiscord | <Elegantbeef> But how do you know which to call with which arguments? |
07:58:53 | FromDiscord | <Tuatarian> the goal here is to associate the names + argtypes of functions with the actual functions |
07:59:00 | FromDiscord | <Tuatarian> I'm writing a (basically) programming language |
07:59:10 | * | jjido joined #nim |
07:59:21 | FromDiscord | <Tuatarian> so I'd build a string with the funcname and argtypes, and lookup the pointer in the table, then deref based off that |
07:59:35 | FromDiscord | <Elegantbeef> Then do that |
08:00:03 | FromDiscord | <Tuatarian> ok |
08:00:24 | FromDiscord | <Tuatarian> this is a surefire method of getting some really horrible errors later |
08:00:29 | FromDiscord | <Tuatarian> but probably better than the alternative |
08:00:47 | FromDiscord | <Tuatarian> could we not use concepts or something to create a generic typeclass over all procs? |
08:00:52 | FromDiscord | <Tuatarian> oh but you can't put it into a variable |
08:00:55 | FromDiscord | <Tuatarian> yeah that's unfortunate |
08:00:59 | FromDiscord | <Tuatarian> what's the syntax for creating a raw pointer? |
08:01:00 | FromDiscord | <Elegantbeef> generic typeclasses are not runtime |
08:01:04 | FromDiscord | <Tuatarian> yeah |
08:01:05 | FromDiscord | <Elegantbeef> `proc` is a generic typeclass for all types |
08:01:11 | FromDiscord | <Elegantbeef> `cast[pointer](myPRocName)` |
08:01:24 | FromDiscord | <Tuatarian> if we have several procs of the same name? |
08:01:30 | FromDiscord | <Tuatarian> with different args |
08:03:45 | FromDiscord | <Elegantbeef> you convert to the type you want |
08:03:53 | FromDiscord | <Elegantbeef> Or use a macro to convert to what you want |
08:08:38 | FromDiscord | <Tuatarian> how do I do that? |
08:19:37 | FromDiscord | <Elegantbeef> Which one |
08:19:52 | FromDiscord | <Elegantbeef> the former is jusut `(proc(a: int): int)(myProcName)` |
08:25:34 | FromDiscord | <Tuatarian> so `cast[pointer](proc(a : int) : int)(thename)`? |
08:27:29 | FromDiscord | <Elegantbeef> `cast[pointer]((proc(a : int) : int)(thename))` |
08:30:32 | FromDiscord | <Elegantbeef> Might be able to just do `pointer(...)` instead of a cast |
08:30:35 | FromDiscord | <Elegantbeef> dont recall if proc can be converted |
08:33:35 | * | krux02 joined #nim |
08:35:57 | FromDiscord | <Tuatarian> In reply to @Elegantbeef "`cast[pointer]((proc(a : int) :": ,thanks |
08:35:59 | FromDiscord | <Tuatarian> will test |
08:37:35 | * | krux02 quit (Remote host closed the connection) |
08:38:18 | * | krux02 joined #nim |
08:40:18 | * | derpydoo joined #nim |
08:58:43 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=4gmQ |
08:59:23 | FromDiscord | <haxscramper> Request text is apparently the same at least as far as properties are concerned, so it must be something else |
08:59:43 | FromDiscord | <haxscramper> (edit) "else" => "else, like request being constructed differently" |
09:05:16 | FromDiscord | <Bung> doesn't the wget use query string |
09:05:30 | FromDiscord | <haxscramper> with query string |
09:05:31 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=4gmS |
09:05:36 | FromDiscord | <haxscramper> and that's 1:1 copy-paste of request |
09:07:56 | FromDiscord | <Bung> no idea, need the server side information |
09:12:36 | FromDiscord | <Bung> sent a code paste, see https://play.nim-lang.org/#ix=4gmV |
09:18:52 | FromDiscord | <haxscramper> > Error: This module only works on the JavaScript platform |
09:21:14 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=4gmX |
09:21:17 | FromDiscord | <haxscramper> this was the solution |
09:22:36 | FromDiscord | <Bung> https://nim-lang.org/docs/uri.html#encodeQuery%2CopenArray%5B%5D nim version is this |
09:25:45 | FromDiscord | <haxscramper> I'm also using nim in my code |
09:34:55 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
09:38:14 | * | jjido joined #nim |
10:26:59 | FromDiscord | <albassort> @treeform hey I want to PR some stuff to print, I would like to add some options, how do you recommend I do that or should i fork it |
10:27:07 | FromDiscord | <albassort> wtf why is wave there |
10:27:19 | FromDiscord | <albassort> whatever |
10:27:41 | FromDiscord | <albassort> I was thinking about a global init function with a context type |
10:29:24 | NimEventer | New Nimble package! convertKana - Convert Japanese Kana, see https://github.com/z-kk/convertKana |
10:30:20 | FromDiscord | <albassort> woah that package is extremely relevant to me |
10:30:31 | FromDiscord | <albassort> why didn't I think of making my own repository for that |
10:34:38 | FromDiscord | <DarkSky> sent a code paste, see https://play.nim-lang.org/#ix=4gn7 |
10:34:38 | FromDiscord | <DarkSky> whats wrong with the code? |
10:35:08 | FromDiscord | <DarkSky> trying to parse a `"2"` (or any other number) from `var cards` as a string to an int |
10:37:24 | FromDiscord | <Rika> It’s backwards? |
10:37:38 | FromDiscord | <Rika> cards[0].parseInt |
10:37:40 | FromDiscord | <Bung> `parseInt.cards[0]` |
10:37:57 | FromDiscord | <DarkSky> In reply to @Rika "cards[0].parseInt": oooooh lol |
10:38:05 | FromDiscord | <DarkSky> wait let me try |
10:38:37 | FromDiscord | <DarkSky> sent a code paste, see https://play.nim-lang.org/#ix=4gn8 |
10:39:13 | FromDiscord | <Rika> Ah you’re using parse utils |
10:39:17 | FromDiscord | <DarkSky> ye |
10:39:31 | FromDiscord | <DarkSky> is it possible to parse it to a number? |
10:39:33 | FromDiscord | <DarkSky> i mean to an integer |
10:39:42 | FromDiscord | <Rika> If you want it to return the number and not the index, use the one in strutils instead |
10:39:53 | FromDiscord | <Rika> (edit) "If you want it to return the number and not the ... index," added "next" |
10:40:33 | FromDiscord | <albassort> yo, Rika |
10:41:01 | FromDiscord | <Rika> Who |
10:41:20 | FromDiscord | <DarkSky> In reply to @Rika "If you want it": i thought parseInt was from strutils already? which one is it from strutils? |
10:41:41 | FromDiscord | <Rika> In reply to @DarkSky "i thought parseInt was": There’s two versions, one in strutils one in parseutils |
10:41:50 | FromDiscord | <Rika> You’re using parseutils |
10:42:43 | FromDiscord | <DarkSky> oh I confused the names then, alright thanks |
10:58:57 | * | krux02 quit (Quit: Leaving) |
11:06:32 | FromDiscord | <DarkSky> is it possible to parse int to string? |
11:07:43 | FromDiscord | <qb> parseInt, in strutils again |
11:07:53 | FromDiscord | <Rika> Converting integers to strings isn’t parsing |
11:07:58 | FromDiscord | <qb> oh |
11:08:00 | FromDiscord | <Rika> Just put $ before the integer |
11:08:00 | FromDiscord | <qb> $5 |
11:13:48 | FromDiscord | <hmmm> thats five dollars |
11:19:50 | FromDiscord | <Rika> Five bucks for us to tell you the answer smh |
11:23:13 | FromDiscord | <Yardanico> In reply to @Rika "Converting integers to strings": or intToStr if you want to control padding |
11:23:22 | FromDiscord | <Yardanico> intToStr(1, 4) == "0001" |
11:23:24 | FromDiscord | <Yardanico> or even strformat |
11:27:41 | FromDiscord | <ShalokShalom> @Rika How are you doing with Elixir? |
11:27:54 | FromDiscord | <Rika> I’m still figuring out how to do T/DDD |
11:27:57 | FromDiscord | <Rika> Slow progress |
11:28:10 | FromDiscord | <Rika> Documentation isn’t hard, the testing is blocking me |
11:28:20 | FromDiscord | <Rika> I don’t know how I’d be testing my authentication system |
11:28:38 | FromDiscord | <Rika> Also #offtopic lol didn’t notice |
12:30:31 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
12:56:29 | * | pro joined #nim |
13:03:59 | * | jmdaemon quit (Ping timeout: 260 seconds) |
13:16:26 | FromDiscord | <DarkSky> In reply to @Rika "Five bucks for us": I'll give you 5$ to make proper Documentation lol |
13:16:58 | FromDiscord | <Rika> i mean i think the manual is barely good enough |
13:17:02 | FromDiscord | <DarkSky> i have been learning Python, C, a bit of C++ ↵↵never have i ever asked that many questions about either of those because i had to make one search to find the answer to it |
13:17:08 | FromDiscord | <Rika> but yeah still needs improvement |
13:17:18 | FromDiscord | <DarkSky> it needs a LOT of improvement |
13:17:30 | FromDiscord | <DarkSky> my opinion anyways |
13:17:50 | FromDiscord | <DarkSky> i mean sometimes i can be blind too lol but i think there could be a lot of things changed in the documentation |
13:23:18 | FromDiscord | <haywireSSC> how would I not have my macro add all the gensym stuff for each identifier |
14:18:31 | * | lumo_e joined #nim |
14:24:26 | NimEventer | New post on r/nim by mishokthearchitect: Best way to fix `could not import: SSL_get_peer_certificate` error, see https://reddit.com/r/nim/comments/z05dbg/best_way_to_fix_could_not_import_ssl_get_peer/ |
14:30:40 | FromDiscord | <@thatrandomperson5-6310e3b26da03> Anyone know of a graphic library like this\: has window control, like size and locking the window, and can draw pixel to screen |
14:32:05 | * | pro left #nim (#nim) |
14:35:48 | FromDiscord | <Array in a Matrix> cant any graphics lib do this? |
14:40:27 | NimEventer | New thread by RodSteward: Are OpenArrays memory safe?, see https://forum.nim-lang.org/t/9639 |
14:47:11 | FromDiscord | <@thatrandomperson5-6310e3b26da03> It should, but i can’t find anything on nimble |
14:48:20 | * | arkurious joined #nim |
14:50:22 | * | lumo_e quit (Quit: Quit) |
15:03:47 | FromDiscord | <dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4go3 |
15:04:03 | FromDiscord | <dlesnoff> (edit) "https://play.nim-lang.org/#ix=4go3" => "https://paste.rs/JoH" |
15:04:41 | FromDiscord | <dlesnoff> (edit) "https://play.nim-lang.org/#ix=4go7" => "https://play.nim-lang.org/#ix=4go6" |
15:21:04 | FromDiscord | <haywireSSC> In reply to @@thatrandomperson5-6310e3b26da03 "Anyone know of a": have you tried boxy/windy? |
15:21:13 | FromDiscord | <haywireSSC> idk if they can lock the window and stuff |
15:21:29 | FromDiscord | <haywireSSC> also nim sdl2 wrapper should be fine |
15:27:42 | FromDiscord | <dlesnoff> https://github.com/treeform/boxy↵https://github.com/treeform/windy↵https://github.com/nim-lang/sdl2 (or https://github.com/Vladar4/sdl2_nim) |
15:34:37 | FromDiscord | <@thatrandomperson5-6310e3b26da03> And where do i find this?↵(@haywireSSC) |
15:35:23 | FromDiscord | <haywireSSC> dlensnoff linked them all |
15:37:11 | FromDiscord | <auxym> more generally, www.nimble.directory |
15:38:50 | FromDiscord | <Generic> sent a code paste, see https://play.nim-lang.org/#ix=4goe |
15:39:32 | FromDiscord | <Generic> the cast of 0 to int is unnecessary, you could also just write `= 0` |
15:41:21 | FromDiscord | <Generic> because integer literals will end up being infered as type int by default |
15:41:40 | FromDiscord | <Generic> I personally would write this as |
15:41:58 | FromDiscord | <Generic> sent a code paste, see https://play.nim-lang.org/#ix=4goh |
16:12:56 | NimEventer | New post on r/nim by Belluz: Unable to send a file over TCP, see https://reddit.com/r/nim/comments/z07xxa/unable_to_send_a_file_over_tcp/ |
16:48:28 | FromDiscord | <Horizon [She/Her]> How am i supposed to read JVM class files? It uses big endian but idk how to check if the system the code is running on is BE or LE |
16:48:45 | FromDiscord | <Horizon [She/Her]> Or if there's a way to bypass this need completely, rn I'm just reading from a stream directly |
16:49:19 | FromDiscord | <EyeCon> In reply to @Event Horizon "How am i supposed": Maybe check https://github.com/status-im/nim-stew/blob/master/stew/endians2.nim |
16:49:45 | FromDiscord | <EyeCon> It has endian-dependent read methods at least |
16:51:01 | FromDiscord | <Horizon [She/Her]> Nim has a way to convert between endians, idk if it's better for me to use that now or just get the endianness of the system |
16:51:23 | FromDiscord | <Horizon [She/Her]> `system.cpuEndian` is a thing |
16:51:44 | FromDiscord | <Horizon [She/Her]> And google gave nothing... i should really remember to search in the index instead |
17:07:15 | FromDiscord | <Horizon [She/Her]> Funny little detail, but the magic number for JVM class files in hex is `CAFEBABE` |
17:14:40 | * | krux02 joined #nim |
17:17:49 | FromDiscord | <treeform> and can only contain 2^16 things |
17:25:07 | FromDiscord | <Horizon [She/Her]> Hm? |
17:34:34 | FromDiscord | <DarkSky> sent a code paste, see https://play.nim-lang.org/#ix=4goO |
17:37:30 | * | derpydoo quit (Ping timeout: 240 seconds) |
17:41:26 | FromDiscord | <nixfreak> Curious Nim will ever get a language help like python or Elixir |
17:43:13 | FromDiscord | <ShalokShalom> Like? |
17:43:18 | FromDiscord | <ShalokShalom> Language help? |
17:47:13 | * | pech joined #nim |
17:48:39 | * | disso_peach quit (Ping timeout: 260 seconds) |
17:48:54 | FromDiscord | <nixfreak> sent a code paste, see https://play.nim-lang.org/#ix=4goR |
17:50:09 | FromDiscord | <nixfreak> sent a code paste, see https://play.nim-lang.org/#ix=4goS |
17:51:13 | FromDiscord | <ShalokShalom> @nixfreak#0000 You mean context driven error messages, when you compile and get an error? |
17:52:11 | FromDiscord | <nixfreak> No thats just using the elixir REPL called iex |
17:52:21 | FromDiscord | <ShalokShalom> Ah, yeah. Still |
17:53:02 | FromDiscord | <ShalokShalom> sent a long message, see http://ix.io/4goT |
17:54:05 | FromDiscord | <@thatrandomperson5-6310e3b26da03> How does jester work on windows? |
17:54:15 | FromDiscord | <nixfreak> yeah I looked at gleam also , but not much on web programming right now. I am more into booloader , security |
17:54:55 | FromDiscord | <nixfreak> Be nice just to call a nim std library helper function offline |
17:56:28 | FromDiscord | <ShalokShalom> I see. |
17:56:36 | FromDiscord | <ShalokShalom> Yeah, Nim is very fitting for that use case. |
18:18:26 | FromDiscord | <nixfreak> Like where can I find everything about the nim subtype "Positive" -- I tried here https://nim-lang.org/docs/system.html#Positive |
18:21:43 | * | q0ee0ez joined #nim |
18:22:31 | * | q0ee0ez quit (Client Quit) |
18:26:16 | FromDiscord | <.tochka> In reply to @nixfreak "Like where can I": positive is just a subrange type |
18:26:30 | FromDiscord | <.tochka> https://nim-lang.org/docs/manual.html#types-subrange-types |
18:32:44 | FromDiscord | <nixfreak> thank you |
18:32:46 | FromDiscord | <nixfreak> So its not a subtype its a subrange type |
18:38:39 | FromDiscord | <.tochka> wording is such, yes |
18:55:01 | * | derpydoo joined #nim |
19:03:50 | * | junaid__ joined #nim |
19:11:16 | * | junaid__ quit (Remote host closed the connection) |
19:38:06 | FromDiscord | <System64 ~ Flandre Scarlet> Hi, I have a question↵Is it possible to make a backend in Nim that communicates with an SQL database and listen to a certain port for packets? |
19:53:06 | FromDiscord | <.tochka> should be |
20:01:55 | FromDiscord | <@thatrandomperson5-6310e3b26da03> How would i modify jester logging to fit my needs? |
20:02:41 | FromDiscord | <@thatrandomperson5-6310e3b26da03> Like log to a file instead of the terminal |
20:05:13 | * | kenran joined #nim |
20:05:20 | * | kenran quit (Remote host closed the connection) |
20:16:50 | FromDiscord | <luteva> In reply to @System64 "Hi, I have a": yes of course. why shouldn't that be possible? if you mean it should be in parallel (using threads) or asynchronious (using async IO): yes, both is possible. |
20:19:14 | FromDiscord | <luteva> there are some libs for DB communication like wrapper and ORM Mapper etc. for the socket communication, have a look at https://nim-lang.org/docs/net.html#Socket |
20:33:58 | FromDiscord | <Tuatarian> In reply to @Elegantbeef "`cast[pointer]((proc(a : int) :": how do I deref this? |
20:35:22 | FromDiscord | <albassort> whats up with Channels locking/ |
20:35:24 | FromDiscord | <albassort> (edit) "locking/" => "locking?" |
20:35:38 | FromDiscord | <Tuatarian> like how do I convert this back to a proc |
20:37:49 | FromDiscord | <albassort> do i need to lock the channel now? |
20:37:50 | FromDiscord | <albassort> hmmmm |
20:38:54 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @luteva "yes of course. why": very interesting↵Does it support something like Promises too? |
20:39:24 | FromDiscord | <hmmm> sent a code paste, see https://play.nim-lang.org/#ix= |
20:39:25 | * | jmdaemon joined #nim |
20:39:25 | FromDiscord | <hmmm> wot? |
20:39:38 | FromDiscord | <hmmm> beefy halp plz |
20:40:39 | FromDiscord | <albassort> nah lock didn't do anything |
20:40:51 | FromDiscord | <albassort> @ElegantBeef is there a known issue with channels locking? |
20:41:42 | FromDiscord | <luteva> yes. there's async await in the standard lib. And there are Futures. Just search for futures instead of promises. |
20:42:09 | FromDiscord | <Tuatarian> lmao everyone's dying in the 5 minutes without beef online |
20:42:23 | FromDiscord | <Tuatarian> really puts how helpful he is into perspective |
20:42:36 | FromDiscord | <Tuatarian> thanks beef |
20:42:47 | FromDiscord | <albassort> In reply to @iWonderAboutTuatara "how do I deref": do you mean get its output? |
20:43:02 | FromDiscord | <Tuatarian> how do I get the procback from the pointer |
20:43:02 | FromDiscord | <albassort> like & |
20:43:04 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4gpw |
20:43:05 | FromDiscord | <albassort> ah |
20:43:07 | FromDiscord | <albassort> yea |
20:43:10 | FromDiscord | <albassort> [] |
20:43:18 | FromDiscord | <Tuatarian> even for an untyped pointer? |
20:43:23 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4gpx |
20:43:53 | FromDiscord | <albassort> In reply to @iWonderAboutTuatara "even for an untyped": you would need to cast it because nim cant evaluate something without a type |
20:45:02 | FromDiscord | <albassort> so cast it to ptr x type |
20:45:07 | FromDiscord | <albassort> then do [] |
20:45:12 | FromDiscord | <albassort> and hope no sysfault |
20:45:58 | FromDiscord | <albassort> alright channels being a bitch time to see if openmp works |
20:46:15 | FromDiscord | <@thatrandomperson5-6310e3b26da03> ## HOW WOULD I CONFIGURE THE JESTER LOGGING |
20:47:27 | FromDiscord | <albassort> i would love to help you here but what the fuck is jester |
20:47:51 | FromDiscord | <Tuatarian> ok so I can `therawpointer.cast[ptr (int) -> int][]`? |
20:47:58 | FromDiscord | <Tuatarian> jester is a frameowkr |
20:48:00 | FromDiscord | <albassort> no |
20:48:02 | FromDiscord | <albassort> you cannot |
20:48:05 | FromDiscord | <Tuatarian> then? |
20:48:18 | FromDiscord | <albassort> not -> int |
20:48:21 | FromDiscord | <albassort> just to ptr int |
20:48:23 | FromDiscord | <albassort> then do [] |
20:48:28 | FromDiscord | <albassort> think about it like this |
20:48:30 | FromDiscord | <Tuatarian> these are raw pointers to procs |
20:48:37 | FromDiscord | <albassort> oh ok |
20:48:38 | FromDiscord | <albassort> then ye |
20:48:45 | FromDiscord | <albassort> but either way, try it and see |
20:48:56 | FromDiscord | <albassort> and wait for beef because i'm no expert in cursed code |
20:49:15 | FromDiscord | <Tuatarian> beef is a legend |
20:49:21 | FromDiscord | <Tuatarian> his knowledge is amazing |
20:49:44 | FromDiscord | <luteva> In reply to @@thatrandomperson5-6310e3b26da03 "**## HOW WOULD I": i didn't do that yet, sorry! btw. logging to std.out should be default anyway. 🙂 |
20:51:02 | FromDiscord | <albassort> @Tuatarian i love my bud, but no offense, no way your code is so cursed you need unsafe pointers to procs |
20:51:20 | FromDiscord | <albassort> please show me! |
20:51:34 | FromDiscord | <hmmm> sent a code paste, see https://play.nim-lang.org/#ix=4gpz |
20:51:42 | FromDiscord | <albassort> well |
20:52:05 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4gpA |
20:52:10 | FromDiscord | <hmmm> wot |
20:52:24 | FromDiscord | <albassort> ' ' is for characters |
20:52:32 | FromDiscord | <albassort> you're creating a characters |
20:52:34 | FromDiscord | <albassort> (edit) "characters" => "character" |
20:52:49 | FromDiscord | <hmmm> but "\qq" is stringish |
20:52:51 | FromDiscord | <Tuatarian> In reply to @albassort "<@284835054633353226> i love my": I have a table to procs with any return type and any arg types |
20:52:52 | FromDiscord | <albassort> wait what |
20:53:00 | FromDiscord | <albassort> that dont compile |
20:53:03 | FromDiscord | <Tuatarian> this is to store functions for a programming language I'm writing |
20:53:10 | FromDiscord | <Tuatarian> this seems to be the best way given static typing constraints |
20:53:21 | FromDiscord | <albassort> https://media.discordapp.net/attachments/371759389889003532/1043992467604779088/image.png |
20:53:26 | FromDiscord | <albassort> what even is \qq |
20:53:29 | FromDiscord | <albassort> what are you trying to do |
20:53:56 | FromDiscord | <albassort> In reply to @iWonderAboutTuatara "this seems to be": alright, thats beautiful. |
20:54:11 | FromDiscord | <albassort> though i kinda think implementing dynamic typing for a language would be safer in C |
20:54:17 | FromDiscord | <albassort> .-, |
20:54:20 | FromDiscord | <albassort> (edit) ".-," => ".-." |
20:55:03 | FromDiscord | <luteva> In reply to @@thatrandomperson5-6310e3b26da03 "**## HOW WOULD I": I think there's a common logging lib used in several nim web/server projects?!? Maybe it is/can be also used in jester??↵It's here: https://github.com/status-im/nim-chronicles↵but not sure about it.... |
20:55:03 | FromDiscord | <Tuatarian> idkbro I like nim so I'm using it |
20:55:15 | FromDiscord | <@thatrandomperson5-6310e3b26da03> https://github.com/dom96/jester↵(@albassort) |
20:55:32 | FromDiscord | <Tuatarian> this fails to compile, why? |
20:55:32 | FromDiscord | <Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=4gpB |
20:55:47 | FromDiscord | <albassort> whats the compiler error |
20:55:49 | FromDiscord | <Tuatarian> I get an invalid indentation error on the rawp line, char 56 |
20:56:02 | FromDiscord | <albassort> also |
20:56:11 | FromDiscord | <albassort> why dont you use addr |
20:56:14 | FromDiscord | <albassort> oh wait |
20:56:15 | FromDiscord | <albassort> typed |
20:56:16 | FromDiscord | <albassort> i forgot |
20:56:19 | FromDiscord | <Tuatarian> I get it at the end actually |
20:56:24 | FromDiscord | <Tuatarian> invalid indentation at the end of the expr |
20:56:37 | FromDiscord | <Tuatarian> char 56 is the last char |
20:56:40 | FromDiscord | <@thatrandomperson5-6310e3b26da03> jester user std/logging i think↵(@luteva) |
20:56:59 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4gpC |
20:57:10 | FromDiscord | <Tuatarian> lmao I'm a genius |
20:57:25 | FromDiscord | <Tuatarian> it now says expression cannot be cast to pointer |
20:57:26 | FromDiscord | <Tuatarian> which is odd |
20:57:34 | FromDiscord | <albassort> @Tuatarian let rawp = cast[ptr (proc(a : int) : int)](garbacao) |
20:57:43 | FromDiscord | <albassort> in nim its ptr not pointer |
20:57:44 | FromDiscord | <Tuatarian> no these need to be untyped pointers |
20:57:46 | FromDiscord | <Tuatarian> raw pointers |
20:57:52 | FromDiscord | <albassort> god |
20:57:56 | FromDiscord | <albassort> im sorry |
20:57:56 | FromDiscord | <Tuatarian> since they don't all point to the same type |
20:58:00 | FromDiscord | <Tuatarian> lmao |
20:58:09 | FromDiscord | <Tuatarian> raw pointer type is `pointer` right? |
20:59:27 | FromDiscord | <albassort> i dont think theres a rawer pointer than pointer |
20:59:30 | FromDiscord | <albassort> i might be wrong |
20:59:33 | FromDiscord | <albassort> unsafeaddr returns ptr |
21:00:26 | FromDiscord | <Tuatarian> I just need a raw pointer |
21:00:31 | FromDiscord | <Tuatarian> don't really need much else here |
21:00:40 | FromDiscord | <Tuatarian> I want to get a raw pointer to this function |
21:00:43 | FromDiscord | <Tuatarian> and manually dereference later |
21:00:48 | FromDiscord | <tope> how do I invert a bitset? (of e.g. `set[range(0..63)]` so assume it's representation-compatible with an `uint64`, but the VM does not allow me to cast from set to ints -- and this needs to be run at compile time in macros. |
21:01:07 | FromDiscord | <Tuatarian> replacing pointer gives the same error `expression cannot be cast to ptr` |
21:01:41 | FromDiscord | <albassort> this compiles for me |
21:01:41 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4gpE |
21:01:50 | FromDiscord | <Tuatarian> that's fine, but this is not the thing i want right? |
21:01:54 | FromDiscord | <Tuatarian> this would be a `ptr T` |
21:02:14 | FromDiscord | <Tuatarian> and you can't mix it with `ptr V` where `not(V is T)` |
21:02:17 | FromDiscord | <Tuatarian> in a single variable |
21:02:37 | FromDiscord | <albassort> researches intensely |
21:03:04 | FromDiscord | <Tuatarian> armchair complaining but |
21:03:22 | FromDiscord | <Tuatarian> I think we need better docs for lower level memory operations and the type system |
21:04:39 | FromDiscord | <albassort> https://media.discordapp.net/attachments/371759389889003532/1043995310189465690/image.png |
21:04:43 | FromDiscord | <albassort> alright founder |
21:04:47 | FromDiscord | <albassort> (edit) "founder" => "found 'er" |
21:04:51 | FromDiscord | <Tuatarian> does this work with procs? |
21:04:57 | FromDiscord | <albassort> nooooo clue |
21:05:05 | FromDiscord | <Tuatarian> also, if I have two procs of the same name, how do I specify which? |
21:05:23 | FromDiscord | <albassort> let rawp = cast[pointer](garbacao) |
21:05:26 | FromDiscord | <Tuatarian> beef told me to use `cast[pointer]((proc(a : int) : int)(procname))` |
21:05:37 | FromDiscord | <Tuatarian> no but the problem with that is alba |
21:05:55 | FromDiscord | <Tuatarian> that if I have `garbacao(a : int) : int` and `garbacao(a : float) : void` |
21:06:04 | FromDiscord | <Tuatarian> how do I know which one I'm taking a pointer to here |
21:07:01 | FromDiscord | <albassort> ok love you want a pointer |
21:07:08 | FromDiscord | <albassort> that you can both mix up with other pointers |
21:07:11 | FromDiscord | <albassort> but also has a typ |
21:07:13 | FromDiscord | <albassort> (edit) "typ" => "type" |
21:07:28 | FromDiscord | <albassort> what i would do is this |
21:08:09 | FromDiscord | <Tuatarian> pointer should not have a type |
21:08:12 | FromDiscord | <Tuatarian> pointer should be raw pointer |
21:08:23 | FromDiscord | <albassort> pointers cant be T |
21:08:29 | FromDiscord | <albassort> have you considered this |
21:08:43 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4gpF |
21:08:55 | FromDiscord | <Tuatarian> not sure what this does |
21:10:11 | FromDiscord | <albassort> let test = passFunction[proc(a : int) : int](pointy : rawp) |
21:10:30 | FromDiscord | <albassort> pointy has no type, you can do whatever you want with it |
21:10:38 | FromDiscord | <albassort> but, passFunction is of its own type |
21:10:43 | FromDiscord | <albassort> so you know what it was |
21:11:32 | FromDiscord | <Tuatarian> the issue is that I can't get rawp |
21:11:42 | FromDiscord | <Tuatarian> knowing which type the function was isn't too difficult |
21:11:52 | FromDiscord | <Tuatarian> since it's a programming language, I can read the specifics off the AST |
21:11:55 | FromDiscord | <Tuatarian> (more or less) |
21:12:07 | FromDiscord | <Tuatarian> (ast for my language, not the nim ast) |
21:12:25 | FromDiscord | <albassort> alright, I've tried <a:ghost_pog:782378888315273216>. Beef come home |
21:12:29 | FromDiscord | <Tuatarian> lmao yeah |
21:12:44 | FromDiscord | <Tuatarian> really puts into perspective how comprehensive beef's knowledge is |
21:12:48 | FromDiscord | <Tuatarian> and how helpful his explanations are |
21:17:09 | FromDiscord | <tope> In reply to @tope "how do I invert": (kinda figured out my own question: can do `{R.low .. R.high} - x` for set inversion (and pray it compiles to a `not` instruction)) |
21:19:56 | FromDiscord | <albassort> idk in my day to day occurrences i never need beef |
21:20:02 | FromDiscord | <albassort> but whenever im working with C im like |
21:20:05 | FromDiscord | <albassort> "BEEF HELP" |
21:33:26 | FromDiscord | <.tochka> will setLen reallocate for smaller block if lesser len given? |
21:34:42 | FromDiscord | <.tochka> In reply to @albassort "but whenever im working": beef is like leagues better with nim than with c tbh 😜 |
21:42:04 | FromDiscord | <albassort> In reply to @.tochka "beef is like leagues": No whenever I'm using C I'm binding it to Nim |
21:42:08 | FromDiscord | <albassort> And Nim as a bunch of weird features for it |
21:42:35 | FromDiscord | <.tochka> ah |
21:46:09 | FromDiscord | <Elegantbeef> Given i dont know C, yes↵(@.tochka) |
21:47:04 | FromDiscord | <Elegantbeef> yea there is `setutils.complement` that does does that for you↵(@tope) |
21:47:41 | FromDiscord | <Elegantbeef> It's a 64bit set which means it's an array of 4 uint8s so it likely will not use not, but it might |
21:47:43 | FromDiscord | <.tochka> In reply to @Elegantbeef "Given i dont know": you know a lot about what it doesnt have |
21:48:31 | FromDiscord | <Elegantbeef> The type conversion returns the one you want↵(@Tuatarian) |
21:49:59 | FromDiscord | <Elegantbeef> That's what the purpose of the type conversion is for it tells Nim "Yes i know this is an overloaded pointer procedure but i want this specific one" |
21:50:05 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gpM |
21:55:05 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gpO |
21:55:22 | FromDiscord | <Elegantbeef> Like i said @Tuatarian you do not need to cast to pointer a pointer conversion works |
21:55:50 | FromDiscord | <Tuatarian> thanks |
21:55:55 | FromDiscord | <Tuatarian> in theory, could I do this with a cast? |
21:56:05 | FromDiscord | <Elegantbeef> Nim doesnt allow casting from that expression |
21:56:05 | FromDiscord | <Elegantbeef> So no |
21:56:10 | FromDiscord | <Tuatarian> why not? |
21:56:21 | FromDiscord | <Elegantbeef> I guess nevermind it does |
21:56:26 | FromDiscord | <Elegantbeef> I dont know why you'd use a cast |
21:56:47 | FromDiscord | <Tuatarian> I don't intend to, but I don't really understand what's happening here lmao and I want to |
21:56:56 | FromDiscord | <Elegantbeef> Well ask questions |
21:57:03 | FromDiscord | <Elegantbeef> `pointer x` is a conversion to pointer |
21:57:06 | FromDiscord | <Elegantbeef> it's the same as `pointer(x)` |
21:57:13 | FromDiscord | <Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=4gpP |
21:57:16 | FromDiscord | <Tuatarian> this gives an error, why? |
21:57:17 | FromDiscord | <Elegantbeef> Any pointer type is convertible to `pointer` as it's a void pointer |
21:57:25 | FromDiscord | <Tuatarian> `void` in C? |
21:57:43 | FromDiscord | <Elegantbeef> Yes |
21:57:53 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gpQ |
21:57:54 | FromDiscord | <Elegantbeef> Cause it's a closure proc you converted it to |
21:58:01 | FromDiscord | <Elegantbeef> All nim proc types are closure by default |
21:58:14 | FromDiscord | <Tuatarian> is there a way to leave out the `{.nimcall.}` pragma? |
21:58:22 | FromDiscord | <Tuatarian> there's a stdlib proc I saw |
21:58:36 | FromDiscord | <Tuatarian> https://nim-lang.org/docs/system.html#rawProc%2CT |
21:59:05 | FromDiscord | <Elegantbeef> That's for closures |
21:59:25 | FromDiscord | <Tuatarian> yeah that's why I didn't use it |
21:59:51 | FromDiscord | <Tuatarian> is the proc itself getting converted to a closure? |
21:59:57 | FromDiscord | <Tuatarian> if so, should I be able to use that? |
22:00:12 | FromDiscord | <Tuatarian> also, is there a way to do this without the ugly `{.nimcall.}` |
22:00:14 | FromDiscord | <Elegantbeef> There's no reason to use closures unless you need that |
22:00:58 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gpT |
22:01:06 | FromDiscord | <Elegantbeef> Ah i think i see why |
22:01:14 | FromDiscord | <Elegantbeef> It's cause you dont overload the symbol |
22:01:23 | FromDiscord | <Tuatarian> so I have to overload to do this? |
22:01:27 | FromDiscord | <Tuatarian> that's odd... |
22:01:32 | FromDiscord | <Elegantbeef> If you dont overload the symbol it takes `proc(a: int): int` as a conversion to a closure |
22:01:34 | FromDiscord | <Elegantbeef> Eh it makes sense |
22:01:44 | FromDiscord | <Tuatarian> it makes sense I guess |
22:01:48 | FromDiscord | <Tuatarian> still feels a little bit inconsistent |
22:01:52 | FromDiscord | <Elegantbeef> `(proc(a: int): int)(unoverloadedSymbol)` is a conversion to the left hand |
22:01:57 | FromDiscord | <Tuatarian> Is there way to automate some of this with macros? |
22:02:04 | FromDiscord | <Elegantbeef> Of course |
22:02:10 | FromDiscord | <Elegantbeef> with macros you dont even need to know the type |
22:02:11 | FromDiscord | <Tuatarian> can I check if a symbol is overloaded? |
22:02:19 | FromDiscord | <Elegantbeef> Of course |
22:02:24 | FromDiscord | <Tuatarian> how? |
22:02:38 | FromDiscord | <Elegantbeef> By checking if the symbol is a `nnkOpenSymChoice` |
22:02:40 | FromDiscord | <Tuatarian> manual is hard to search |
22:02:52 | FromDiscord | <Elegantbeef> You dont learn macros from the manual |
22:02:52 | FromDiscord | <Tuatarian> `nnkOpenSymChoice` means overloaded symbol? |
22:03:10 | FromDiscord | <Tuatarian> how do you learn macros? |
22:03:10 | FromDiscord | <Elegantbeef> That's what the name is |
22:03:25 | FromDiscord | <Elegantbeef> You learn macros by looking at the ast of code and replicating it |
22:03:41 | FromDiscord | <Elegantbeef> A good source of how to navigate AST is https://github.com/beef331/micros |
22:05:31 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gpV |
22:05:56 | FromDiscord | <Tuatarian> thank you |
22:07:02 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gpW |
22:07:32 | FromDiscord | <Elegantbeef> Actually `NimNode(routine)[0].getType` i guess |
22:07:43 | FromDiscord | <Elegantbeef> or `NimNode(routine.name).getType.repr` |
22:07:49 | FromDiscord | <albassort> yo beef how often should i be using || |
22:07:53 | FromDiscord | <albassort> as in openmp loop |
22:08:05 | FromDiscord | <Elegantbeef> What? |
22:08:17 | FromDiscord | <albassort> i wrote some threading code, channels were deadlocking, didn't wanna debug |
22:08:21 | FromDiscord | <albassort> so i use used || |
22:08:27 | FromDiscord | <albassort> and i got like a 300% speed increase |
22:08:36 | FromDiscord | <Elegantbeef> I dont even know what you're talking about |
22:09:00 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4gpX |
22:09:22 | FromDiscord | <Elegantbeef> How would i? |
22:09:44 | FromDiscord | <albassort> https://nim-lang.org/docs/system.html#%7C%7C.i%2CS%2CT%2CPositive%2Cstaticstring |
22:09:51 | FromDiscord | <Elegantbeef> I dont do multi threading |
22:09:57 | FromDiscord | <Elegantbeef> Or when i do i use `createThread` |
22:10:35 | FromDiscord | <albassort> Channels were doing that cool thing where they dont send |
22:10:44 | FromDiscord | <albassort> for some reason |
22:10:45 | FromDiscord | <Elegantbeef> Sounds like user error |
22:10:48 | FromDiscord | <Elegantbeef> Did you forget to `open` them |
22:10:48 | FromDiscord | <albassort> never |
22:10:51 | FromDiscord | <albassort> I did not |
22:11:04 | FromDiscord | <Elegantbeef> Well without a reproduction i blame you |
22:11:15 | FromDiscord | <etra> what's the difference for using `{. something}` vs `{. something .}`(notice the ending point)? |
22:11:33 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4gq0 |
22:11:44 | FromDiscord | <Elegantbeef> Nothing↵(@etra) |
22:11:52 | FromDiscord | <Elegantbeef> That's not a reproduction↵(@albassort) |
22:12:09 | FromDiscord | <albassort> ok getting you do to a reproduction is what i would call a PITA |
22:13:20 | FromDiscord | <Elegantbeef> You do realize you allocate like 20 channels right? |
22:13:33 | FromDiscord | <Elegantbeef> You also dont open the channel |
22:13:35 | FromDiscord | <albassort> no |
22:13:35 | FromDiscord | <Tuatarian> how do you echo a pointer? |
22:13:41 | FromDiscord | <albassort> cant |
22:13:43 | FromDiscord | <albassort> use print |
22:13:46 | FromDiscord | <Tuatarian> what is print |
22:13:48 | FromDiscord | <Elegantbeef> `echo cast[int](myPointer)` |
22:13:51 | FromDiscord | <Elegantbeef> or `echo myPtr[]` |
22:13:53 | FromDiscord | <Tuatarian> thanks |
22:13:57 | FromDiscord | <albassort> ok you can do that but use print nayway |
22:13:57 | FromDiscord | <Elegantbeef> Or define a `$` for your pointer |
22:14:00 | FromDiscord | <Tuatarian> can I make it hex instead of decimal |
22:14:01 | FromDiscord | <albassort> (edit) "nayway" => "anyway" |
22:14:16 | FromDiscord | <albassort> In reply to @Elegantbeef "You do realize you": where |
22:14:17 | FromDiscord | <Elegantbeef> `echo cast[int](pointer).toHex` |
22:14:26 | FromDiscord | <Elegantbeef> ` let output = createShared(Channel[Jword], sizeof(Channel[Jword]))` |
22:14:31 | FromDiscord | <Elegantbeef> Create takes in a number of elements |
22:14:40 | FromDiscord | <Elegantbeef> Not size of bytes, it's a higher level abstraction ontop of allocate |
22:14:42 | FromDiscord | <albassort> i thought it took in the byte siz |
22:14:49 | FromDiscord | <albassort> sob |
22:14:57 | FromDiscord | <Elegantbeef> so you allocate `sizeOf(Channel[Jword])` channels |
22:15:01 | FromDiscord | <Elegantbeef> But again you do not do `output[].open` |
22:15:16 | FromDiscord | <Elegantbeef> So of course it doesnt fucking work 😄 |
22:15:16 | FromDiscord | <albassort> i forgot that line, but when i was testing i did |
22:16:06 | FromDiscord | <albassort> aye |
22:16:08 | FromDiscord | <albassort> it still dont work nerd |
22:16:20 | FromDiscord | <Tuatarian> why is this failing to compile? |
22:16:33 | FromDiscord | <Tuatarian> sent a code paste, see https://paste.rs/JnU |
22:16:35 | FromDiscord | <Tuatarian> gives error `/usercode/in.nim(12, 6) Error: expression cannot be cast to proc (i0: ptr int): int{.closure.}` |
22:16:51 | FromDiscord | <Elegantbeef> Remember how i said all type defs are closures |
22:16:52 | FromDiscord | <albassort> https://media.discordapp.net/attachments/371759389889003532/1044013483571826799/image.png |
22:17:10 | FromDiscord | <albassort> wheres the user error now |
22:17:12 | FromDiscord | <Tuatarian> oh man |
22:17:13 | FromDiscord | <albassort> >gun |
22:17:21 | FromDiscord | <albassort> (edit) ">gun" => "🔫" |
22:17:23 | FromDiscord | <Elegantbeef> It's still user error imo |
22:17:25 | FromDiscord | <.tochka> :D https://media.discordapp.net/attachments/371759389889003532/1044013623888056390/image.png |
22:17:26 | FromDiscord | <Tuatarian> I have to specifyc `{.nimcall.}` here? |
22:17:36 | FromDiscord | <Elegantbeef> Yes↵(@Tuatarian) |
22:17:45 | FromDiscord | <albassort> In reply to @Elegantbeef "It's still user error": buuutttttt whereeeeeeee |
22:17:58 | FromDiscord | <Tuatarian> is there a way of avoiding that in this instance? |
22:18:28 | FromDiscord | <Elegantbeef> Hard to say where↵(@albassort) |
22:18:36 | FromDiscord | <Elegantbeef> as i've said before no↵(@Tuatarian) |
22:18:36 | FromDiscord | <albassort> yea, because there is none |
22:18:40 | FromDiscord | <Elegantbeef> .... |
22:19:24 | FromDiscord | <albassort> this is not the first time this has happened to me, dunno. I'm probably doing something wrong |
22:19:38 | FromDiscord | <Tuatarian> why does this sefgault? |
22:19:43 | FromDiscord | <Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=4gq4 |
22:19:59 | FromDiscord | <Tuatarian> line 12 |
22:20:03 | FromDiscord | <Tuatarian> (obviously) |
22:20:09 | FromDiscord | <Tuatarian> the echo works fine |
22:20:26 | FromDiscord | <Elegantbeef> Nim procs are `ptr proc` |
22:20:32 | FromDiscord | <Elegantbeef> remove `ptr` |
22:20:43 | FromDiscord | <Tuatarian> oh procs are ptr types by default? |
22:20:52 | FromDiscord | <Elegantbeef> I'm always amazed at how people ignore details |
22:20:58 | FromDiscord | <Tuatarian> so doing `ptr proc` is `ptr ptr proc` |
22:20:59 | FromDiscord | <Tuatarian> got it |
22:20:59 | FromDiscord | <Elegantbeef> Like you converted to a pointer implicitly |
22:21:11 | FromDiscord | <Tuatarian> it's not very easy to find docs or tutorials on this stuff |
22:21:15 | FromDiscord | <Elegantbeef> I said "all pointers can be converted to `pointer`" |
22:21:25 | FromDiscord | <Elegantbeef> Yet you still miss out that procs are pointers 😄 |
22:21:41 | FromDiscord | <Tuatarian> I'm curious why the first implies the second? |
22:21:58 | FromDiscord | <Tuatarian> oh got it |
22:22:04 | FromDiscord | <Tuatarian> so line 8 is a type conversion |
22:22:08 | FromDiscord | <Elegantbeef> Yes |
22:22:14 | FromDiscord | <Tuatarian> since i've got a `proc` which is already a `ptr T` |
22:22:21 | FromDiscord | <Tuatarian> and that's why it works without a cast |
22:22:29 | FromDiscord | <Elegantbeef> Yep |
22:22:36 | FromDiscord | <Tuatarian> yeah I just didn't really understand that |
22:22:41 | FromDiscord | <.tochka> time to make a lang with value passed functions |
22:22:42 | FromDiscord | <Elegantbeef> You're abusing generics, stop it!↵(@.tochka) |
22:22:47 | FromDiscord | <Tuatarian> though it still segfaults |
22:22:53 | FromDiscord | <Elegantbeef> It does not |
22:23:00 | FromDiscord | <Elegantbeef> Works fine |
22:23:01 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gq5 |
22:23:19 | FromDiscord | <Elegantbeef> Tuatara saying code that works doesnt work, name a more iconic duo 😛 |
22:23:29 | FromDiscord | <.tochka> In reply to @Elegantbeef "You're abusing generics, stop": that's all i do :c https://media.discordapp.net/attachments/371759389889003532/1044015149142511718/image.png |
22:23:31 | FromDiscord | <valerga> drake and josh |
22:23:40 | FromDiscord | <Tuatarian> lmao |
22:23:58 | FromDiscord | <Elegantbeef> Ah default static parameter type seems like a fun bug |
22:24:00 | FromDiscord | <Tuatarian> I had an extraneous `[]` |
22:24:04 | FromDiscord | <Elegantbeef> just make the result `auto` tochka |
22:24:25 | FromDiscord | <Elegantbeef> then do `result = default(Storage[l, t]` and see if that works |
22:24:27 | FromDiscord | <Tuatarian> since I thought I had a `ptr proc` which I was dereferencing to get a `proc` |
22:24:38 | FromDiscord | <albassort> In reply to @valerga "drake and josh": josh and drake |
22:24:40 | FromDiscord | <Tuatarian> and didn't change it when you showed me that was not what was happening |
22:24:42 | FromDiscord | <Elegantbeef> I know you were trying to derference |
22:24:56 | FromDiscord | <Tuatarian> yeah |
22:25:06 | FromDiscord | <Tuatarian> can you not hold `ptr ptr T` btw? |
22:25:28 | FromDiscord | <Elegantbeef> Tochka `template indirect(i: auto): auto = i` also might work if you do `Storage[l.indirect, t]` |
22:25:32 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4gq6 |
22:26:02 | FromDiscord | <.tochka> In reply to @Elegantbeef "then do `result =": that works |
22:26:15 | FromDiscord | <.tochka> funky |
22:27:13 | FromDiscord | <Elegantbeef> Return types are uh.... buggy with generics that depend on parameters |
22:27:21 | FromDiscord | <Elegantbeef> Its ugh, but it works |
22:30:14 | FromDiscord | <.tochka> In reply to @.tochka "will setLen reallocate for": might i get an answer |
22:30:22 | FromDiscord | <Elegantbeef> Hmph i cannot reproduce, how do you call this↵(@.tochka) |
22:30:25 | FromDiscord | <Elegantbeef> setLen does not realloc |
22:30:59 | FromDiscord | <.tochka> is there a way to shrink |
22:31:30 | FromDiscord | <.tochka> In reply to @Elegantbeef "Hmph i cannot reproduce,": https://media.discordapp.net/attachments/371759389889003532/1044017166292373515/image.png |
22:31:34 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gq7 |
22:32:32 | FromDiscord | <Elegantbeef> I guess you need `a[0..a.high] = ...` |
22:32:43 | FromDiscord | <.tochka> might be it |
22:33:27 | FromDiscord | <Elegantbeef> The funny part is that string/seq impls have a comment about `setLen` often being used for reducing allocations |
22:34:06 | FromDiscord | <.tochka> lol this works https://media.discordapp.net/attachments/371759389889003532/1044017821295849513/image.png |
22:34:09 | FromDiscord | <Elegantbeef> Atleast iirc `newSeq` allocates precisely what you need, if it doesnt one can use `newSeqOfCap` or is it 'withCap' always forget |
22:34:26 | FromDiscord | <Elegantbeef> What's that parameter's constraint? |
22:34:50 | FromDiscord | <Elegantbeef> Is it an `int` or `Positive`? |
22:35:33 | FromDiscord | <Elegantbeef> Might be the static evaluation for that specific type is a bit buggy |
22:36:22 | FromDiscord | <.tochka> storage is distinct for ptr array |
22:37:29 | FromDiscord | <Elegantbeef> Just give me the type definition and that constructor's header plox |
22:38:53 | FromDiscord | <.tochka> https://play.nim-lang.org/#ix=4gq9 |
22:39:02 | FromDiscord | <.tochka> here, this breaks |
22:39:09 | FromDiscord | <Elegantbeef> Thanks |
22:42:34 | FromDiscord | <.tochka> In reply to @Elegantbeef "The funny part is": system docs are kinda not clear enough imo, and having in-place shrink to length is something i would expect in std |
22:43:04 | FromDiscord | <Elegantbeef> I can only jokingly say "PRs welcome" |
22:43:27 | FromDiscord | <.tochka> #destroyed |
22:44:14 | FromDiscord | <Elegantbeef> It's a nice first contribution! |
22:44:52 | FromDiscord | <.tochka> ok maybe |
22:47:59 | * | krux02 quit (Remote host closed the connection) |
22:48:40 | FromDiscord | <Elegantbeef> Hmph `internalAssert cl.c.config, idx.kind != tyStatic` |
22:49:11 | FromDiscord | <Elegantbeef> oh wait i'm blind |
22:49:40 | FromDiscord | <Elegantbeef> ` Storage[IDX: static Positive; T] = distinct ptr array[IDX, T]` |
22:50:29 | FromDiscord | <Elegantbeef> Static parameters need to be static, even though i think bung is working on a PR to reduce this bug |
22:52:11 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gqa |
22:57:25 | FromDiscord | <.tochka> thanks, thats better |
22:58:54 | FromDiscord | <Elegantbeef> The cast to storage is redundant |
22:59:01 | FromDiscord | <Elegantbeef> I is smert |
23:02:38 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @luteva "<@380360389377916939> yes. there's": Oh alright! Thanks a lot! |
23:15:04 | FromDiscord | <ChocolettePalette> This is why I'm into the C programming language\:#define Storage void\ |
23:17:37 | FromDiscord | <Elegantbeef> `type Storage = pointer` |
23:17:40 | FromDiscord | <Elegantbeef> There your meme is dead |
23:20:00 | FromDiscord | <ChocolettePalette> o h |
23:28:07 | NimEventer | New thread by grd: How can nimqml being used with docker?, see https://forum.nim-lang.org/t/9640 |
23:32:47 | FromDiscord | <Tuatarian> beef, if it' |
23:33:00 | FromDiscord | <Tuatarian> if it's an nnkSym how would I know what the args are and what the return is? |
23:33:09 | FromDiscord | <Tuatarian> using your macro |
23:33:15 | FromDiscord | <Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=4gqg |
23:33:31 | FromDiscord | <Tuatarian> (edit) "https://play.nim-lang.org/#ix=4gqg" => "https://play.nim-lang.org/#ix=4gqh" |
23:33:57 | FromDiscord | <Tuatarian> (edit) "https://play.nim-lang.org/#ix=4gqh" => "https://play.nim-lang.org/#ix=4gqi" |
23:35:12 | FromDiscord | <Tuatarian> ok it explicitly gives voids and the first thing is the return type, the next ones are the args in order? |
23:35:18 | FromDiscord | <Tuatarian> how do we walk the tree though |
23:38:42 | FromDiscord | <Elegantbeef> you iterate the `getType` |
23:39:43 | FromDiscord | <Tuatarian> macros give particularly unhelpful errors |
23:39:52 | FromDiscord | <Tuatarian> what's wrong with this? |
23:39:56 | * | adium quit (Read error: Connection reset by peer) |
23:40:00 | FromDiscord | <Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=4gqk |
23:40:22 | FromDiscord | <darth> sent a long message, see http://ix.io/4gql |
23:40:47 | FromDiscord | <Elegantbeef> No one actually uses it |
23:40:48 | FromDiscord | <Elegantbeef> So take that |
23:40:50 | FromDiscord | <huantian> wait nim has hot code reloading? |
23:41:28 | FromDiscord | <Tuatarian> the error I got for that was something like line 553 of macros.nim |
23:41:29 | FromDiscord | <darth> In reply to @Elegantbeef "No one actually uses": is it because it doesn't work or because people write stateful programs tho? |
23:41:43 | FromDiscord | <Tuatarian> saying `"cannot get child of node kind: nnkSym"` |
23:41:51 | FromDiscord | <Elegantbeef> I think it's buggy↵(@darth) |
23:41:54 | FromDiscord | <Tuatarian> (edit) "`"cannot" => "`cannot" | "nnkSym"`" => "nnkSym`" |
23:41:57 | FromDiscord | <Elegantbeef> Well what are you indexing↵(@Tuatarian) |
23:42:00 | FromDiscord | <darth> oh :\ |
23:42:10 | FromDiscord | <huantian> I mean you can always go ahead and try to use if |
23:42:14 | FromDiscord | <huantian> (edit) "if" => "it" |
23:42:15 | FromDiscord | <Tuatarian> ideally, the children of the getType node |
23:42:19 | FromDiscord | <Tuatarian> not sure exactly how to do that |
23:42:20 | FromDiscord | <huantian> if it works for you it doesn't matter lol |
23:42:33 | FromDiscord | <Elegantbeef> `echo myType.treeRepr` |
23:42:50 | FromDiscord | <Tuatarian> I did that earlier |
23:42:59 | FromDiscord | <Tuatarian> I'll show the output again one sec |
23:43:45 | FromDiscord | <Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=4gqn |
23:43:58 | FromDiscord | <Tuatarian> (edit) "https://play.nim-lang.org/#ix=4gqn" => "https://play.nim-lang.org/#ix=4gqo" |
23:44:26 | FromDiscord | <Elegantbeef> So there you go |
23:44:45 | FromDiscord | <Elegantbeef> `[1]` is return `[2...]` are arg types |
23:44:50 | FromDiscord | <Tuatarian> yeah |
23:44:53 | FromDiscord | <Tuatarian> how do I iterate over this though? |
23:45:09 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gqp |
23:45:38 | FromDiscord | <Tuatarian> does this work? |
23:45:38 | FromDiscord | <Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=4gqq |
23:45:53 | FromDiscord | <Elegantbeef> Probably |
23:45:56 | FromDiscord | <Elegantbeef> I'm not a compiler |
23:46:09 | FromDiscord | <Tuatarian> it does not appear to |
23:46:15 | FromDiscord | <Tuatarian> wait no it does |
23:46:20 | FromDiscord | <Elegantbeef> I avoid `[a..b]` in macros as it copies though |
23:46:27 | FromDiscord | <Tuatarian> is there a better way? |
23:47:02 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gqr |
23:47:24 | FromDiscord | <Tuatarian> `.len` works? |
23:48:47 | FromDiscord | <Elegantbeef> ... |
23:48:52 | FromDiscord | <Elegantbeef> RTFM please |
23:49:10 | FromDiscord | <Tuatarian> I gave up on the manual a while ago, honestly |
23:49:20 | FromDiscord | <Tuatarian> it's enormous and basically unsearchable |
23:49:33 | FromDiscord | <Tuatarian> the best way to search the manual is googling the thing and hoping it gives the relevant manual page |
23:49:48 | FromDiscord | <Tuatarian> but I think I mostly got it |
23:50:25 | FromDiscord | <Tuatarian> yep I got it |
23:50:26 | FromDiscord | <Tuatarian> thanks |
23:50:51 | FromDiscord | <Horizon [She/Her]> In reply to @iWonderAboutTuatara "I gave up on": The index will likely help if you're looking for something in particular? |
23:51:19 | FromDiscord | <Tuatarian> the things often don't have long enough descriptions to be findable if you don't already know they exist |
23:52:12 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/macros.html |
23:52:16 | FromDiscord | <Tuatarian> the descriptions don't consistently have enough keywords to be findable by what's basically grep |
23:52:32 | FromDiscord | <Elegantbeef> I dont know what you're talking about |
23:52:57 | FromDiscord | <Tuatarian> I don't think any of the pointer stuff from above was findable in the manual |
23:53:11 | FromDiscord | <Elegantbeef> Sure but we're not talking about that stuff |
23:53:18 | FromDiscord | <Elegantbeef> you were asking about whether `len` worked on a `NimNode` |
23:53:27 | FromDiscord | <Tuatarian> oh |
23:53:31 | FromDiscord | <Tuatarian> that was more surprise than anything |
23:53:39 | FromDiscord | <Tuatarian> since I had it, and I thought that was what was causing the issue, but it was not |
23:54:09 | FromDiscord | <Tuatarian> what was causing the issue was that I forgot to iterate over `x.getType` instead of `x` |