<< 20-11-2022 >>

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