<< 23-03-2021 >>

00:06:39FromDiscord<Yardanico> https://isc.sans.edu/diary/27230
00:07:01FromDiscord<Yardanico> Although the script to extract strings seems to be very overengineered
00:10:46leorize[m]I'm glad they make sure to read oldruntime source instead of newruntime string literals :P
00:14:28*krux02 quit (Remote host closed the connection)
00:22:11FromDiscord<Yardanico> xdd
00:35:50*j is now known as jess
00:36:28*wasted_youth2 joined #nim
01:43:36*timdorohin_ joined #nim
01:47:03*timdorohin quit (Ping timeout: 265 seconds)
01:47:11*timdorohin_ is now known as timdorohin
01:52:29*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
01:52:48*njoseph joined #nim
02:03:17*abm quit (Quit: Leaving)
02:14:22FromDiscord<aryn> how would i go about including cacert.pem inside the binary? since its required for https requestes
02:14:25FromDiscord<aryn> (edit) "requestes" => "requests"
02:20:52FromDiscord<ElegantBeef> You can `const Cert = staticRead("cacert.pem")` then output that on runtime wherever you need
02:21:56FromDiscord<aryn> oh cool
02:24:22FromDiscord<Yardanico> @aryn don't forget you also need to ship openssl dlls on win
02:24:39FromDiscord<aryn> its designed to be a cli util for linus
02:24:40FromDiscord<aryn> (edit) "linus" => "linux"
02:24:48FromDiscord<aryn> more specifically uploading stuff to virustotall
02:24:49FromDiscord<aryn> (edit) "virustotall" => "virustotal"
02:24:51FromDiscord<Yardanico> but why do you need cacert.pem then? some custom https server?
02:25:00FromDiscord<Yardanico> (edit) "server?" => "server without a valid certificate?"
02:25:07FromDiscord<Yardanico> any modern distro ships with cacert.pem
02:25:07FromDiscord<aryn> or is cacert only needed on windows :OMEGALUL:
02:25:11FromDiscord<Yardanico> yes
02:25:21FromDiscord<aryn> welp, that solves that
02:25:28FromDiscord<aryn> windows™️
02:26:06FromDiscord<Yardanico> you can check https://github.com/nim-lang/Nim/blob/devel/lib/pure/ssl_certs.nim for the ssl certificate logic
02:26:17FromDiscord<aryn> yeah is saw that
02:26:38FromDiscord<aryn> https://media.discordapp.net/attachments/371759389889003532/823744515541434408/unknown.png
02:26:38FromDiscord<aryn> will do
02:26:55FromDiscord<Yardanico> when instead of if
02:27:10FromDiscord<Yardanico> also you can just fail compilation if it's not being compiled for a linux targetr
02:27:11FromDiscord<Yardanico> (edit) "targetr" => "target"
02:27:37FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2TOj
02:27:41FromDiscord<aryn> oh thats neat
02:27:46FromDiscord<Yardanico> put it at the top of the file for example, maybe after the imports
02:27:52FromDiscord<aryn> whats the difference between when and if here btw?
02:27:54FromDiscord<Yardanico> but why do you want to put a strict no-win check?
02:28:03FromDiscord<aryn> because cacert will break
02:28:05FromDiscord<aryn> and i cba
02:28:13FromDiscord<Yardanico> it won't "break"
02:28:13FromDiscord<Rika> compile time
02:28:18FromDiscord<Yardanico> @aryn `when` checks at compile-time, doesn't introduce a new scope
02:28:18FromDiscord<Rika> when is compile time if is runtime
02:28:26FromDiscord<aryn> ah
02:28:49FromDiscord<Yardanico> `when` branches get resolved by the compiler so the compiler binary contains at max 1 possible branch from your when statements
02:29:03FromDiscord<Yardanico> but yeah, even if you don't want to deal with cacert.pem on windows _yourself_, you don't need to
02:29:14FromDiscord<Yardanico> cacert.pem is shipped with Nim stuff on windows anyway
02:29:27FromDiscord<Yardanico> so putting this check is kind of weird, you can just say "this app has only been tested on Linux" in the readme
02:30:18FromDiscord<aryn> alright, this is weird as a java dev, since idk the ideas over there are more: you do everything so the end user doesnt have to
02:30:25FromDiscord<aryn> nim appears to think a bit differently
02:30:59FromDiscord<Yardanico> i don't think it's specific to java really, you just don't provide windows binaries and say that the app has only been tested on linux, that's all
02:31:15FromDiscord<Yardanico> a typical "end user" wouldn't install it anyway then, since it'll require him to install nim itself
02:31:24FromDiscord<Rika> you can more explicitly say no warranty for windows users hahah
02:31:35FromDiscord<aryn> hehe
02:32:08FromDiscord<Yardanico> @Rika <boring mode on>most OSS licenses already mention that</boring mode off>
02:32:28FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2TOk
02:32:38FromDiscord<Rika> no support then
02:34:36FromDiscord<aryn> the optparser is also pretty decent
04:05:00*spiderstew joined #nim
04:06:15*spiderstew_ quit (Ping timeout: 265 seconds)
04:33:06FromDiscord<ShadowElf37> is it dangerous to do `cast[ptr cint](ptr int)`
04:35:35*sixtyten quit (Quit: Leaving)
04:37:07leorize[m]yes
04:37:31FromDiscord<ShadowElf37> why
04:37:49leorize[m]on major platforms (64-bit), `cint` is shorter than `int`
04:38:33leorize[m]so casting ends up truncating the integer
04:39:32leorize[m]!eval echo "sizeof(int): ", sizeof(int), " vs sizeof(cint): ", sizeof(cint)
04:39:34NimBotsizeof(int): 8 vs sizeof(cint): 4
04:39:58leorize[m]`int` most of the time is twice as big, so you're losing half of the data if you cast
04:40:07FromDiscord<ShadowElf37> ok interesting
04:42:21leorize[m]!eval echo "high(int): ", high(int), " vs cast[cint](high(int)): ", cast[cint](high(int))
04:42:23NimBothigh(int): 9223372036854775807 vs cast[cint](high(int)): -1
04:44:34FromDiscord<ShadowElf37> !eval echo "int: ", 2 shl 34, " - cint: ", cast[cint](2 shl 34)
04:44:37NimBotint: 34359738368 - cint: 0
04:52:41FromDiscord<Yardanico> In reply to @ShadowElf37 "ok interesting": Why do you want to do that?
05:15:20*Kaivo quit (Ping timeout: 256 seconds)
05:16:02*Kaivo joined #nim
05:21:20FromDiscord<ShadowElf37> I’m doing stuff with SDL and didn’t want my abstractions littered with cints
05:21:35FromDiscord<ShadowElf37> But I guess I’ll have to 😁
05:21:58FromDiscord<Yardanico> You don't have to though
05:22:13FromDiscord<Yardanico> just show the code where you actually need that logic
05:22:26FromDiscord<Yardanico> seems like an x y problem to me
05:23:22FromDiscord<ShadowElf37> it's sdl functions that take int pointers
05:23:30FromDiscord<ShadowElf37> so i cant just convert the values right
05:24:01FromDiscord<Yardanico> just show a piece of code where you wanted to use that cast :)
05:24:37FromDiscord<Yardanico> Also, did you see https://github.com/Vladar4/sdl2_nim ?
05:25:13FromDiscord<ShadowElf37> er, im using whatever sdl2 binding is on the curated packages list
05:25:16FromDiscord<ShadowElf37> idk if thats the one
05:25:36FromDiscord<Yardanico> this one is more idiomatic kind of
05:26:10FromDiscord<Yardanico> Also "curated package list" is not really enforced or anything, anyone can add a library to it
05:26:22FromDiscord<ShadowElf37> so its not "curated" lol
05:26:46FromDiscord<Yardanico> ???
05:27:06FromDiscord<ShadowElf37> sent a code paste, see https://play.nim-lang.org/#ix=2TOO
05:27:13FromDiscord<ShadowElf37> I'd expect curated to mean someone found the best packages and put them together
05:27:20FromDiscord<Yardanico> Not really
05:30:49*lritter joined #nim
05:30:54FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2TOS
05:31:14FromDiscord<Yardanico> You can use your original way as well, it should work for most cases, but no guarantees
05:31:22FromDiscord<ShadowElf37> overhead 😳
05:31:41FromDiscord<Yardanico> it's negligible really
05:31:46FromDiscord<ShadowElf37> 😱
05:32:20FromDiscord<Yardanico> ?
05:32:44FromDiscord<ShadowElf37> lol i'll consider it, it depends how much i end up needing to convert and how much trouble it'll cause me writing the extra lines
05:32:50FromDiscord<ShadowElf37> good solution though
05:33:13FromDiscord<Yardanico> also why do you have Image as a ref object?
05:33:27FromDiscord<ShadowElf37> cause im gonna reuse it for multiple entities and stuff
05:33:36FromDiscord<Yardanico> it already contains a pointer to an sdl image, so there's no need to add yet another pointer indirection
05:33:57FromDiscord<ShadowElf37> mm i'll still be reusing it but thats a fair point
05:34:36FromDiscord<Yardanico> and you current code will fail at runtime because you didn't initialize your Image since it's a ref
05:34:48FromDiscord<ShadowElf37> i have new i just deleted it for this
06:11:28*narimiran joined #nim
06:14:08*haxscramper joined #nim
06:25:56*NimBot joined #nim
06:35:11*waleee-cl quit (Quit: Connection closed for inactivity)
06:46:15*haxscramper quit (Remote host closed the connection)
06:46:40*haxscramper joined #nim
07:03:05*a_chou joined #nim
07:03:05*a_chou quit (Remote host closed the connection)
07:29:41*xet7 quit (Quit: Leaving)
07:45:59*xet7 joined #nim
07:49:44*vicfred quit (Quit: Leaving)
08:23:54FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=2TPv
08:25:28FromDiscord<ElegantBeef> When you want to be doubly sure `result` is returned
08:40:08FromDiscord<haxscramper> https://github.com/h3rald/litestore/blob/b47f906761bf98c768d814ff124379ada24af6f6/litestore.nimble#L1 this syntax was valid for some time in nimble, or this is just broken config? I'm talking about `[Package]` part together with `@["test"]`
08:40:33FromDiscord<haxscramper> I know there is an old format that should be handled by `parseCfg`, but this looks like a mix of both variants
08:40:41*PMunch joined #nim
08:45:03FromDiscord<KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=2TPy
08:46:01FromDiscord<haxscramper> If you pass `typed` argument you can get to object implementation using `getTypeImpl`
08:46:37Clonkk[m]Does ``foreignDep`` from distros install the package ? Or is it just informative ?
08:46:42FromDiscord<KnorrFG> ty
08:48:22FromDiscord<haxscramper> In reply to @Clonkk "Does ``foreignDep`` from distros": IIRC this is just information, but we have `std/distros` that supports checking for current distribution and selecting appropriate package manager so you could print `"please install package X using 'command for specific distro'"`
08:49:22Clonkk[m]<FromDiscord "<haxscramper> In reply to @Clonk"> Okay, thanks ! And another question, are the dependencies transitive ? If package A uses package B and package B have external dependencies, will I have this information in package A ?
08:50:16PMunch@Araq, @dom96, since NimLSP uses nimsuggest as a library I will sometimes get error reports like these: https://github.com/PMunch/nimlsp/issues/76, https://github.com/PMunch/nimlsp/issues/74. I believe these are caused by a bug in the compiler or nimsuggest. Where should I tell them to raise it?
08:54:50FromDiscord<haxscramper> In reply to @Clonkk "<FromDiscord "<haxscramper> In reply": I think it is transitive in a sense that you will get hints for all your dependencies - https://github.com/nim-lang/nimble#external-dependencies. But I don't know how to actually access this information inside nimble
08:55:28Clonkk[m]Thank you, that's what I needed to know
09:00:08*vegai1 quit (Quit: Idle for 30+ days)
09:00:08*retroedgetech[m] quit (Quit: Idle for 30+ days)
09:05:58*shmorgle quit (Ping timeout: 276 seconds)
09:22:02*krux02 joined #nim
09:40:53FromDiscord<KnorrFG> is there a way to fallthrough to the next of-section in a case statement:
09:40:56FromDiscord<KnorrFG> (edit) "statement:" => "statement?"
09:41:35FromDiscord<haxscramper> no
09:41:59FromDiscord<KnorrFG> too bad 😦
09:42:30FromDiscord<haxscramper> You can always to `of expr1, expr2: if switch-expr == expr1:`
09:42:55FromDiscord<KnorrFG> ah, i didnt know that
09:42:57FromDiscord<KnorrFG> thx
10:14:27*Vladar joined #nim
10:28:56*l1x joined #nim
11:05:55*haxscram` joined #nim
11:07:45*haxscramper quit (Ping timeout: 256 seconds)
11:08:02*haxscram` left #nim (#nim)
11:20:16*Guest20418 quit (Quit: leaving)
11:20:25*WilhelmVonWeiner joined #nim
11:20:52FromDiscord<clyybber> @flywind Why does merge use a var result param?
11:21:35FromDiscord<clyybber> Ah, nevermind, I reread the convo
11:35:01ozzzTrying to understand how pass objects to threads, is it possible to pass pointer to threaded function?
11:35:32FromDiscord<Rika> which threads are we talking about, `threads`, `threadpool`, etc
11:36:32ozzzthreads, I have proc called worker: void {.thread, nimcall.}
11:37:17ozzzinside of it I use FCGX_Accept_r from C lib fcgi, it requires pointer to struct
11:40:37ozzzI got segfaults at this moment, threads not work with global defined objects, I saw there is methods how to silent warnings, etc.. but in same time I wan't to make it relatively "Safe"
11:56:49ozzzIsee that such practice considered as unsafe...
11:57:14ozzzI need to dig in to {.gcsafe.}
12:05:40PMunchozzz, welcome to the world of threading. Here be dragons
12:06:48PMunchBasically the default Nim GC doesn't work across threads. So if you simply sent a reference object (like a string or seq for example) to another thread the original thread wouldn't see that reference and could end up cleaning the reference, not good.
12:07:27PMunchThat's why threads have to be gcsafe, this ensures that they don't use globals, and don't try to access memory from other threads.
12:08:07PMunchPointers on the other hand is one way of passing data between threads, but you have to be sure that the underlying data isn't garbage collected while you're using it
12:09:11PMunchYou can use the `channels` module to create data channels which you can use to pass data between threads safely.
12:11:47PMunchThe new ARC/ORC garbage collection scheme will make this situation better. But very little documentation exists about those and threads at the moment, so it might be tricky to figure out what you can and cannot do.
12:16:09ozzzPMunch, yeah, I see it is completely different comparing to pthread lib in C
12:16:34PMunchWell, it's not that different
12:16:52ozzzlooks more like fork() for me
12:16:57PMunchThreads in Nim are quite a slim wrapper around the underlying thread concept
12:18:04PMunchHow so?
12:18:20ozzzwell, I will do some experiments
12:18:27PMunchI mean if you look at `createThread` for example you can see that it just pretty much calls pthread: https://github.com/nim-lang/Nim/blob/version-1-4/lib/system/threads.nim#L307-L328
12:20:46ozzzPMunch, yeah, I just make my conclusion based on analogy what comes on mind :)
12:20:48FromDiscord<mratsim> Nim threads are very much C threads
12:20:59FromDiscord<mratsim> same issues, same solutions
12:21:34FromDiscord<mratsim> the difficulties is when you involve ref objects/seq/strings and you use the default GC because the default GC is thread-local
12:21:48ozzzbut with limitations, global objects are null's as I see inside of thread
12:22:03FromDiscord<mratsim> no global objects are global
12:22:11FromDiscord<mratsim> they are not null
12:22:56ozzzaccess to them not allowed
12:22:58ozzzSIGSEGV: Illegal storage access. (Attempt to read from nil?)
12:23:33FromDiscord<mratsim> I can access them: https://github.com/mratsim/weave/blob/master/weave/contexts.nim#L28
12:23:50FromDiscord<mratsim> it's more likely that your code is buggy
12:24:11ozzzI tried that {.threadvar.}
12:24:27FromDiscord<mratsim> threadvar is for thread-local objects
12:24:40FromDiscord<mratsim> my global context has no threadvar pragma, it's just global
12:25:00ozzzah, so I misunderstand smth
12:25:20ozzzThanks a lot guys
12:27:16PMunchYeah {.threadvar.} basically makes a copy of that global variable per thread
12:34:30*Q-Master quit (Ping timeout: 246 seconds)
12:35:45*superbia joined #nim
12:38:35ForumUpdaterBotNew thread by Modolo: Converter string to raw, see https://forum.nim-lang.org/t/7684
12:43:46PMunchHmm, the documentation for escape seems to be incorrect
12:44:45krux02PMunch, what escape?
12:45:14PMunchstrutils.escape
12:45:45PMunchhttps://play.nim-lang.org/#ix=2TQQ
12:46:15krux02PMunch, yes, I've complained about that for years.
12:46:16PMunchIt says to see `addEscapedChar` for the escaping scheme, but it doesn't actually follow that scheme: https://nim-lang.org/docs/strutils.html#escape%2Cstring%2Cstring%2Cstring
12:47:28krux02What I complained about was, that it doesn't specify for what the escaping should be useful for.
12:47:30krux02Shell?
12:47:32krux02Bash?
12:47:34krux02Fish?
12:47:36krux02C code?
12:47:42krux02javascript?
12:48:00krux02it just does some randome escaping that might be useful for something, but isn't.
12:48:08PMunchWell it can be useful for anything. But it's not very useful when it's not clear what scheme it uses..
12:48:09superbiahow do you send data from one process (nim) to another process (lets say java)
12:48:26PMunchsuperbia, any kind of IPC
12:48:33krux02superbia, normally I would try to use a pipe for that.
12:48:46PMunchOr a socket
12:48:59superbiasocket was my first choice, but I want to explore other options
12:49:03*Q-Master joined #nim
12:49:03krux02but I am not an expert in process to process communication here at all.
12:49:18PMunchPipes work fine for certain stuff
12:49:27PMunchHaven't really tried to push them though
12:49:30superbiait has to work on Windows (TM) also
12:52:34PMunchThen sockets are probably your best bet
12:52:48PMunchWhat are you transfering?
12:53:02PMunchSimple control messages, or high volume streams of data?
12:53:46*Q-Master quit (Ping timeout: 256 seconds)
12:54:13Zoom[m]Hey all! Looking at new channels. Good stuff. Why does it err on `and not defined(nimdoc)` ?
12:54:31FromDiscord<zetashift> What is your error message?
12:55:18Zoom[m]I'm just looking at code. Line 86
12:56:38FromDiscord<zetashift> It probably wants nimdoc to generate documentation?
12:57:53Zoom[m]But it errs with an unrelated message in this case. I was just a bit confused by this line
12:58:01PMunchLink?
12:58:04*Q-Master joined #nim
12:58:22Zoom[m]https://github.com/nim-lang/Nim/blob/c27cd83265558195316e0d3b6d13ccadcaecc728/lib/std/channels.nim#L86
12:59:30superbiaPMunch: tuple (x, y, timestamp)
12:59:32PMunchAh, that's just to not throw an error when you're generating the documentation
12:59:33superbiaat 60Hz
12:59:36superbia:)
12:59:51PMunchOne way?
13:00:02superbiayeah
13:00:04PMunchJust a binary tuple over a socket should work fine for that
13:00:12PMunchJust remember that Java doesn't have unsigned integers :P
13:00:47superbiasocket it is thanks boys
13:00:53Zoom[m]Ah, thanks PMunch
13:04:53FromDiscord<sealmove> Guys, `genSym` really confuses me. I use it in a proc, and it looks like the same symbol is produced every time I call the proc. Is this normal behavior? How can I generate a new symbol with every call?
13:05:45PMunchYou use it in a proc?
13:05:50FromDiscord<sealmove> yes
13:05:58PMunchBut genSym is compile-time
13:06:40FromDiscord<sealmove> oh, this is the insight i was missing lol
13:06:46FromDiscord<sealmove> makes sense now
13:07:18FromDiscord<sealmove> so the proc will always yield the same symbol
13:08:54PMunchWell, unless it is a compile-time procedure, yes
13:09:06PMunchI wasn't even aware you could use genSym in a normal procedure
13:09:19*Q-Master quit (Ping timeout: 265 seconds)
13:15:23FromDiscord<Rika> i dont see why not
13:15:28FromDiscord<Rika> its just kinda not very useful
13:17:28FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=2TQZ
13:18:31*Q-Master joined #nim
13:18:40ForumUpdaterBotNew thread by Devosalain2: Gtk gintro , list of class objects and functions, see https://forum.nim-lang.org/t/7685
13:28:41ForumUpdaterBotNew thread by Arnetheduck: Resolving incorrectly deduced `raises` violations, see https://forum.nim-lang.org/t/7686
13:37:02FromDiscord<clyybber> @sealmove I think genSym might have a critical bug, it's probably better to create your symbols manually for now
13:37:27FromDiscord<sealmove> @clyybber thanks a lot
13:40:44ForumUpdaterBotNew thread by Miran: 2nd Nim online meetup, see https://forum.nim-lang.org/t/7687
13:41:52krux02it is a pity that I don't have time on Friday.
13:43:10PMunchI'll try to not calculate my timezones backwards this time :P
13:43:19PrestigeHaha
13:43:30Prestigeglad there's another meet happening soon, hope I can make this one
13:43:45PMunchAren't these in the middle of the night for you?
13:43:56narimiranPMunch: you were there last time at 3pm? :P
13:43:57PrestigeI'm -5 so like 11am
13:44:05PMunchAh okay
13:44:16PMunchnarimiran, yes, and I had made plans for 5PM :P
13:44:19PrestigeWill just have to slip away from work for a bit
13:44:22narimiranPMunch: :D
13:45:19FromDiscord<clyybber> @timotheecour Why does the CI for the latest commit on a PR run on your sourcehut account?
13:47:37FromDiscord<flywind> interesting, I thought timotheecour restarted my PR last week 😜
13:48:09FromDiscord<clyybber> huh, it's not even last commit
13:48:44FromDiscord<clyybber> on this PR https://github.com/nim-lang/Nim/pull/17472 freebsd is ran on timothees account and openbsd on araqs
13:49:08FromDiscord<clyybber> but if you look at the first commit in that PR it's all ran on araqs
13:49:36FromDiscord<clyybber> and on this PR https://github.com/nim-lang/Nim/pull/17474 it's all on timothees account
13:52:16FromDiscord<clyybber> and on this one https://github.com/nim-lang/Nim/pull/17471 it's only openbsd-1 thats ran on timothees account and everything else on araqs, while for the commit before the last one of that PR it's all ran on timothees account
13:52:21FromDiscord<clyybber> is this random :D ?
13:54:23FromDiscord<flywind> maybe it can relieve resource restrictions.
13:54:33FromDiscord<flywind> https://github.com/nim-lang/Nim/issues/17107
13:55:48FromDiscord<clyybber> I hope we don't do this to circumvent resource restrictions
13:58:32FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=2TR9
13:59:29FromDiscord<haxscramper> `{thread, eula}` is a bitset, it cannot be cast to `int` directly
13:59:52FromDiscord<ajusa> I'm basing this off of https://nim-lang.org/docs/manual.html#set-type-bit-fields fwiw
14:00:02Zoom[m]@flywind nice article on the new Channel! Please, see my suggested change on GH
14:00:15FromDiscord<haxscramper> In reply to @ajusa "I'm basing this off": There where is ` {.size: sizeof(cint).} `?
14:00:23FromDiscord<haxscramper> in your code
14:00:24FromDiscord<flywind> In reply to @Zoom "<@658563905425244160> nice article on": Ok, thanks
14:01:22FromDiscord<ajusa> In reply to @haxscramper "in your code": good point. After adding it though I have the same issue
14:01:44FromDiscord<ajusa> maybe that cast doesn't work if I assign explicit values to the enum?
14:03:04FromDiscord<gokr> @flywind Hey, creator of Prologue, right?
14:03:10FromDiscord<flywind> yeah
14:03:37FromDiscord<gokr> So.... I am thinking of using it for a REST backend for a game me and a friend are making
14:04:29FromDiscord<gokr> I have been working in Dart for quite some time, but the backend frameworks there... I dunno, got burnt on one (Aqueduct not maintained anymore) and now hesitate on jumping onto another.
14:05:22FromDiscord<gokr> @flywind Btw, was that... odd bug resolved (httpbeast I think)? Jester seems to have a warning right now in the github repo
14:05:37FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2TRf
14:05:43FromDiscord<flywind> In reply to @gokr "<@!658563905425244160> Btw, was that...": not yet
14:06:05FromDiscord<haxscramper> In reply to @haxscramper "Maybe. But my points": Or even `proc toNum[E: enum](f: set[E]): int = `
14:06:10FromDiscord<gokr> @flywind I am also looking at Luckyframework (Crystal) but that would introduce a third language in the project and... feels silly. Have you looked at it any?
14:07:18FromDiscord<gokr> And while I am hammering you with questions (sorry), what's the plan around Prologue - is it used in a company or?
14:09:24FromDiscord<flywind> I'm a college student. I don't spare much time to maintain `Prologue` because I focus on contributing to Nim repo. I only update or refactor it before Nim feature release.
14:10:01FromDiscord<gokr> I just realized I joined the Prologue discord - can move questions there
14:11:04FromDiscord<flywind> yeah
14:17:33*vicfred joined #nim
14:29:11*shmorgle joined #nim
14:31:02FromDiscord<Rika> @ajusa the values of enums are the "amounts of shifts" when put into a set
14:31:13FromDiscord<Rika> a value of 1 on an enum will give 1 << 1 when put into a set
14:31:37FromDiscord<Rika> if you have a 1 and 2 in a set, you get 1<<1 | 1<<2
14:31:43FromDiscord<Rika> well "ish" but not really
14:31:53FromDiscord<Rika> its a bit more nuanced than that, but the basic idea is there
14:32:24FromDiscord<Rika> (the nuance is that the first element of an enum, regardless of the value i think, will be shift 0)
14:32:34FromDiscord<Rika> ill test that
14:33:23FromDiscord<Rika> yeah
14:34:00FromDiscord<Rika> In reply to @Rika "a value of 1": ~~btw i mean 1 << 0, sorry xd~~
14:34:47FromDiscord<ajusa> hm, okay. So each one of the "custom" values I specified is getting shifted to the left based on how low it is in the definition? Like 0x20 << 1?
14:35:03FromDiscord<Rika> no, its 1 << 0x20
14:35:06FromDiscord<Rika> "ish"
14:35:09FromDiscord<ajusa> yeah, I see what you mean now
14:35:15FromDiscord<Rika> again, its not really like that
14:35:23FromDiscord<Rika> its not based on the value but the "index" of the enum
14:35:42FromDiscord<Rika> threed would be 1 << 0 and eula would be 1 << 1
14:36:05FromDiscord<Rika> prolly shouldnt be like that but oh well...
14:36:26FromDiscord<Rika> add dummy values i guess? or just manually handle the bits
14:37:52FromDiscord<ajusa> yeah, so the exact use case is that there is a bitmask that skips a few values, so I need the later ones to also skip
14:38:15FromDiscord<ajusa> so for that I would change the value of something so that it gets shifted the number of spots to skip basically
14:39:01FromDiscord<Rika> oh oh oh
14:39:01FromDiscord<Rika> wait
14:39:06FromDiscord<Rika> i didnt realize
14:39:31FromDiscord<Rika> only the first element is enforced to be "1 << 0", if you set the other elements to another value, it will skip to that value
14:40:13FromDiscord<Rika> so you can put a dummy first value and have the expected output
14:41:00FromDiscord<ajusa> awesome, thanks!
14:41:01FromDiscord<Rika> https://play.nim-lang.org/#ix=2TRv
14:44:34*rockcavera joined #nim
14:45:45*rockcavera quit (Remote host closed the connection)
14:46:34*rockcavera joined #nim
14:46:43FromDiscord<Gary M> so I'm abusing templates and I'm trying to make an initializer "proc" but I'm getting "identifier expected, but found '100'" where 100 was the first argument
14:47:05FromDiscord<Gary M> despite the fact that just using a proc is the right way to do this, I'm curious what I'm doing wrong with the template
14:47:20FromDiscord<Gary M> `template vec3(x, y, z: float32)`
14:47:39FromDiscord<Rika> nothing looks wrong? whats the body
14:47:52FromDiscord<Gary M> `Vec3(v: InternalVec4(x: x, y: y, z: z, w: 0.0f))`
14:47:55FromDiscord<Rika> im guessing theres
14:47:56FromDiscord<Rika> yeah
14:48:00FromDiscord<Rika> x: x becomes 100: 100
14:48:01FromDiscord<Rika> haha
14:48:08FromDiscord<Rika> use different names, maybe x1 or w/e
14:48:14FromDiscord<Gary M> ohhhhh fuck me
14:51:26FromDiscord<clyybber> you can just quote them
14:51:40FromDiscord<Gary M> what do you mean
14:52:56FromDiscord<Rika> You can???
14:53:22FromDiscord<clyybber> heh, ok you can't :D
14:53:23PMunchHmm, anyone knows how I can fix this error? Error: system module needs: nimErrorFlag
14:53:26FromDiscord<clyybber> I thought you could
14:54:22PMunchAh never mind
14:54:52FromDiscord<Gary M> damn that's some stinky numbers here
14:55:01FromDiscord<Gary M> https://media.discordapp.net/attachments/371759389889003532/823932853334966342/unknown.png
14:55:11FromDiscord<Gary M> 7.584 ms isn't that terrible?
14:55:44FromDiscord<clyybber> I think your Vec3 is bigger
14:55:55FromDiscord<Gary M> well, jokes on me anyways
14:55:57FromDiscord<Gary M> https://media.discordapp.net/attachments/371759389889003532/823933091273506846/unknown.png
14:56:03FromDiscord<Gary M> I still managed to make it faster.
14:56:08FromDiscord<clyybber> heh
14:56:19FromDiscord<clyybber> how big is your Vec3?
14:56:28FromDiscord<Gary M> basically a Vec4.
14:56:33FromDiscord<Gary M> I'm hogging an entire m128 for it
14:56:46FromDiscord<Gary M> so it's 1 wasted float for padding
14:56:51FromDiscord<clyybber> ah, that's fine
14:57:28FromDiscord<Gary M> I want to get creative with Vec2's though
14:57:53FromDiscord<Gary M> because 2 wasted floats is more egregious
14:59:26*rockcavera quit (Ping timeout: 240 seconds)
15:00:57ForumUpdaterBotNew thread by Jseb: Auto declaration of function prototype, see https://forum.nim-lang.org/t/7688
15:02:21*rockcavera joined #nim
15:06:33*Q-Master quit (Ping timeout: 264 seconds)
15:10:53PMunchHmm, damn it.. It seems like something has changed with how let is defined in the C output..
15:11:05PMunchWhich breaks the PROGMEM things I had for Arduinos..
15:11:17PMunchUnless I was using a custom compiler version..
15:34:38PMunchIt now outputs const PROGMEM stuff, but with uninitialised data and a nimMemCopy to copy the data into it
15:34:39*FromDiscord quit (Read error: Connection reset by peer)
15:34:57*FromDiscord joined #nim
15:35:03*madnight quit (Quit: ZNC 1.7.1 - https://znc.in)
15:35:13*madnight_ joined #nim
15:35:30*unclechu quit (Ping timeout: 265 seconds)
15:35:41*idxu quit (Quit: ZNC - https://znc.in)
15:35:47*watzon quit (Ping timeout: 246 seconds)
15:35:48*Avatarfighter[m] quit (Ping timeout: 246 seconds)
15:35:58*idxu joined #nim
15:35:58*Benjamin[m]2 quit (Ping timeout: 265 seconds)
15:35:59*j-james[m] quit (Ping timeout: 265 seconds)
15:35:59*antholop[m] quit (Ping timeout: 265 seconds)
15:36:00*reversem3 quit (Ping timeout: 246 seconds)
15:36:02*nxnl[m] quit (Ping timeout: 264 seconds)
15:36:26*leorize[m] quit (Ping timeout: 240 seconds)
15:36:27*Simon[m]4 quit (Ping timeout: 265 seconds)
15:36:38*stefantalpalaru quit (Ping timeout: 264 seconds)
15:36:39*Clonkk[m] quit (Ping timeout: 244 seconds)
15:36:51*GitterIntegratio quit (Ping timeout: 258 seconds)
15:37:03PMunchAnd that seems to trigger exception handling, which adds a bunch more code..
15:37:10*lnxw37d4 quit (Ping timeout: 244 seconds)
15:37:15*stisa quit (Ping timeout: 240 seconds)
15:37:21PMunchDamn it, I should've written this stuff down..
15:37:24*mahlon quit (Ping timeout: 246 seconds)
15:37:35*Stephen[m]2 quit (Ping timeout: 240 seconds)
15:37:35*fbpyr[m] quit (Ping timeout: 240 seconds)
15:37:41*sekao[m] quit (Ping timeout: 244 seconds)
15:37:41*Avahe[m] quit (Ping timeout: 244 seconds)
15:37:41*MTRNord quit (Ping timeout: 244 seconds)
15:37:56*ShalokShalom[m] quit (Ping timeout: 240 seconds)
15:37:56*k0mpjut0r quit (Ping timeout: 240 seconds)
15:37:56*jfondren[m] quit (Ping timeout: 240 seconds)
15:37:59*rwiser[m] quit (Ping timeout: 258 seconds)
15:37:59*drbixx[m] quit (Ping timeout: 258 seconds)
15:37:59*BitPuffin quit (Ping timeout: 258 seconds)
15:38:08*Zoom[m] quit (Ping timeout: 268 seconds)
15:38:08*ee7[m] quit (Ping timeout: 268 seconds)
15:38:08*liblq-dev quit (Ping timeout: 268 seconds)
15:38:08*Northstrider[m] quit (Ping timeout: 268 seconds)
15:38:12*i_use_arch_btw[m quit (Ping timeout: 244 seconds)
15:38:14FromDiscord<Gary M> is there an easy way to give a template 2 names without redefining it
15:38:21*Cthalupa quit (Ping timeout: 264 seconds)
15:38:28FromDiscord<clyybber> use a template lmao
15:38:48FromDiscord<Gary M> yeahhhh I know, just a lot of code repetition there
15:39:02FromDiscord<Gary M> the templated alias is 2 chars shorter
15:39:05FromDiscord<clyybber> no I mean use a template that defines your 2 templates
15:39:23FromDiscord<Gary M> 🤔
15:40:11FromDiscord<clyybber> it would have two args; the names of the templates
15:40:20*mahlon joined #nim
15:40:40FromDiscord<Gary M> can you post an example
15:40:45*Q-Master joined #nim
15:40:47*Cthalupa joined #nim
15:42:54FromDiscord<clyybber> I was about to, but I realized it can't work, cause you need to pass in the params too
15:43:04FromDiscord<clyybber> you can use a macro of course
15:45:53*Q-Master quit (Ping timeout: 245 seconds)
15:49:23FromDiscord<clyybber> sent a code paste, see https://play.nim-lang.org/#ix=2TRQ
15:49:24FromDiscord<clyybber> :D
15:50:30FromDiscord<clyybber> (edit) "https://play.nim-lang.org/#ix=2TRQ" => "https://play.nim-lang.org/#ix=2TRR"
15:51:18FromDiscord<clyybber> the hidden power of templates
15:52:52*watzon joined #nim
15:55:34*Northstrider[m] joined #nim
15:59:12*GitterIntegratio joined #nim
16:00:12*stefantalpalaru joined #nim
16:00:32*leorize[m] joined #nim
16:01:17FromDiscord<clyybber> @timotheecour, narimiran: Please see https://irclogs.nim-lang.org/23-03-2021.html#13:45:19 ; this is really becoming a problem I think https://github.com/nim-lang/Nim/issues/17479
16:02:27*Clonkk[m] joined #nim
16:03:45*clyybber joined #nim
16:04:13*clyybber quit (Client Quit)
16:04:18FromDiscord<clyybber> @Araq ^
16:04:22*unclechu joined #nim
16:04:27*lnxw37d4 joined #nim
16:04:36FromDiscord<clyybber> @Araq ^ (pinged the wrong araq it seems :D)
16:04:48*Avatarfighter[m] joined #nim
16:04:51narimiran@clyybber oooh, had no idea of the amount!
16:05:36narimiranand yeah, we could use sr.ht only for merged commits, not for PRs
16:05:52FromDiscord<clyybber> or maybe autocancel it for old commits
16:06:13FromDiscord<clyybber> narimiran: Do you know why some CI jobs for sourcehut are ran on timothees account?
16:06:46*jfondren[m] joined #nim
16:07:29narimiran@clyybber i've seen you mention it earlier, i had no prior knowledge of that. it might be his logic to circumvent the problem? (if so: i do not agree with doing it like that)
16:07:56FromDiscord<clyybber> yeah; if this is intentional circumvention this is very bad
16:08:07*j-james[m] joined #nim
16:08:17*reversem3 joined #nim
16:09:06*Benjamin[m]2 joined #nim
16:09:13*antholop[m] joined #nim
16:10:43FromDiscord<no name fits> Should I open an issue for the example code at <https://nim-lang.org/docs/asynchttpserver.html> not working? I was trying to learn async yesterday
16:12:07*Simon[m]4 joined #nim
16:13:03*MTRNord joined #nim
16:13:10*liblq-dev joined #nim
16:13:30*vicfred quit (Remote host closed the connection)
16:13:43*vicfred joined #nim
16:15:57*BitPuffin joined #nim
16:16:12*i_use_arch_btw[m joined #nim
16:16:14*sekao[m] joined #nim
16:16:15*Avahe[m] joined #nim
16:16:39narimiran"You have submitted 275 builds today alone" -- that means we also triggered ~830 github actions and ~550 azure pipelines
16:16:50*drbixx[m] joined #nim
16:16:50*rwiser[m] joined #nim
16:17:05narimiranhere's the answer when somebody asks why our CIs are so slow....
16:17:25*nxnl[m] joined #nim
16:17:25FromDiscord<no name fits> Are they considered slow?
16:18:28narimiran"why do i have to wait X hours for CIs to run for my PR?"
16:18:33*k0mpjut0r joined #nim
16:19:25FromDiscord<no name fits> I thought it was fine?↵PMunch: Did you guys figure out anything about the asynchttp after I went to bed?
16:19:27FromDiscord<clyybber> narimiran: Should we open a PR to check if it's disabled?
16:19:48FromDiscord<clyybber> Because you only disabled it for the ~araq account right?
16:19:54narimiranouch!
16:20:32narimirani disabled it in our settings-webhooks, but i guess that's just araq's account
16:20:35FromDiscord<Gary M> @clyybber how would you expand that to a 3rd alias 😄
16:20:43FromDiscord<Gary M> really cool btw didn't know that's how you'd do it
16:20:46FromDiscord<clyybber> In reply to @Gary M "<@!107882072974065664> how would you": easy, one minute
16:20:58FromDiscord<clyybber> In reply to @Gary M "really cool btw didn't": nested templates are magic :D
16:20:58*ee7[m] joined #nim
16:22:15FromDiscord<clyybber> sent a code paste, see https://play.nim-lang.org/#ix=2TS0
16:22:19*ShalokShalom[m] joined #nim
16:22:24*Zoom[m] joined #nim
16:23:04FromDiscord<no name fits> Also remember to hydrate and take a break from the screen everyone 😎
16:24:01*stisa joined #nim
16:24:22*Stephen[m]2 joined #nim
16:25:43FromDiscord<Gary M> cool
16:25:47reversem3why so Zig is faster than nim? interesting
16:25:57*fbpyr[m] joined #nim
16:25:59FromDiscord<clyybber> sent a code paste, see https://play.nim-lang.org/#ix=2TS1
16:26:08FromDiscord<Gary M> yeah, but what about 5?
16:26:11FromDiscord<Gary M> I think I'd be stumped
16:26:12FromDiscord<clyybber> In reply to @reversem3 "why so Zig is": huh? We were talking about CI
16:26:22FromDiscord<clyybber> 😩
16:26:27reversem3<FromDiscord "<lbart> ">https://benhoyt.com/writ"> Why so nim is faster than C and C++ but slower than zig ?
16:26:51FromDiscord<no name fits> Page not found?
16:26:56FromDiscord<Gary M> man I am abusing the shit out of {.union.} and I'm loving it
16:27:39*jess quit (Quit: K-Lined)
16:27:45narimiran@clyybber i've made a PR: https://github.com/nim-lang/Nim/pull/17480
16:27:46reversem3<FromDiscord "<clyybber> In reply to @reversem"> sorry , my bad I forgot to actually reply to a prior discussion
16:28:07FromDiscord<clyybber> In reply to @reversem3 "<FromDiscord "<clyybber> In reply": ah, I see, the link you sent is cut off tho :D
16:28:44reversem3https://benhoyt.com/writings/count-words/#other-languages
16:28:45FromDiscord<no name fits> Hmmm, so I would love to open an issue about the example at <https://nim-lang.org/docs/asynchttpserver.html> not working, but I have no idea how to phrase the issue correctly? I built with 1.4.4 and it just hangs the browser and my pc runs out of memory
16:28:50FromDiscord<clyybber> In reply to @narimiran "<@107882072974065664> i've made a": neat; seems to have worked; not sure what the reason for the account splitting was then
16:29:00reversem3Hows that
16:29:13FromDiscord<clyybber> @no name fits Maybe try on devel
16:30:43FromDiscord<no name fits> Sorry for asking dumb questions, but how do I try on devel?
16:31:36FromDiscord<clyybber> In reply to @no name fits "Sorry for asking dumb": Are you on linux or windows?
16:31:53FromDiscord<clyybber> In reply to @reversem3 "https://benhoyt.com/writings/count-words/#other-lan": Interesting, thanks
16:31:55FromDiscord<no name fits> Windows 10
16:32:15FromDiscord<no name fits> Some people yesterday also tried it and they had the same result. One sec
16:32:41reversem3choosenim devel
16:32:46reversem3choosenim update devel
16:32:49reversem3choosenim show
16:32:59FromDiscord<no name fits> Around here https://discord.com/channels/371759389889003530/371759389889003532/823312322852159488
16:33:16FromDiscord<no name fits> Alright I'll try
16:34:30FromDiscord<clyybber> Oh and if you do you should probably also use snippet from the devel docs: https://nim-lang.github.io/Nim/asynchttpserver
16:35:19FromDiscord<no name fits> Oh ok
16:35:36FromDiscord<no name fits> I'm also very afraid of doing anything wrong because I'm still new so
16:35:41FromDiscord<no name fits> Sorry if I'm awkward
16:36:22FromDiscord<Gary M> https://media.discordapp.net/attachments/371759389889003532/823958355205685268/unknown.png
16:36:29FromDiscord<Gary M> hey finally something vmath is worse at than glm
16:36:51FromDiscord<Gary M> cough but nglm is still faster cough cough
16:39:25FromDiscord<clyybber> In reply to @no name fits "Sorry if I'm awkward": not at all
16:39:41FromDiscord<clyybber> don't worry :)
16:39:54FromDiscord<clyybber> In reply to @Gary M "*cough but nglm is": nice
16:39:59FromDiscord<clyybber> is it on github yet?
16:40:02FromDiscord<Gary M> nope
16:40:07FromDiscord<Gary M> very smol code so far
16:40:16FromDiscord<clyybber> smol code is gud
16:40:20FromDiscord<Gary M> also I'm going to try rewriting that to use simd set
16:40:29FromDiscord<Gary M> see how much faster it might be
16:40:58FromDiscord<clyybber> I thought you use SSE already?
16:41:14FromDiscord<Gary M> specifically for the vec3.xy
16:41:20FromDiscord<Gary M> since that returns a vec2
16:41:27FromDiscord<Gary M> but I know what I need to do
16:43:09FromDiscord<Gary M> hahahaahaha fuuuuuck
16:43:13FromDiscord<Gary M> https://media.discordapp.net/attachments/371759389889003532/823960078436270100/unknown.png
16:43:33FromDiscord<Gary M> no simd needed for that one
16:43:56*waleee-cl joined #nim
16:43:59FromDiscord<Gary M> swizzling the xy is as difficult as casting it to Vec2 and calling it a day
16:44:29FromDiscord<clyybber> hehe
16:48:28FromDiscord<Gary M> but yeah the majority of simd ops are just in the actual MADS stuff
16:48:28FromDiscord<clyybber> can't wait to replace glm with your lib :D
16:48:28FromDiscord<Gary M> lol
16:48:29FromDiscord<Gary M> it's going to need a lot of testing
16:48:29FromDiscord<clyybber> good, I have some tests
16:49:40FromDiscord<clyybber> @Gary M Are you implementing this from scratch or optimizing glm ?
16:49:48FromDiscord<Gary M> from scratch
16:49:50FromDiscord<clyybber> Neat
16:50:03FromDiscord<clyybber> will wait until you have quat then :D
16:50:06FromDiscord<Gary M> sent a code paste, see https://play.nim-lang.org/#ix=2TSf
16:50:11FromDiscord<Gary M> it's one types and three types 😄
16:50:18FromDiscord<Gary M> one type even
16:50:42FromDiscord<clyybber> your pragma placement is cursed 😁
16:50:58FromDiscord<Gary M> what you want an extra space in there?
16:50:59FromDiscord<Gary M> You people are hard to please
16:51:15FromDiscord<Gary M> sent a code paste, see https://play.nim-lang.org/#ix=2TSg
16:53:19FromDiscord<clyybber> better 😌
16:53:27FromDiscord<no name fits> sent a code paste, see https://play.nim-lang.org/#ix=2TSh
16:53:28FromDiscord<clyybber> lol
16:53:54FromDiscord<clyybber> a little known fact is that these are actually the 4 things you can choose from
16:53:56FromDiscord<clyybber> pick one
16:53:58FromDiscord<clyybber> loose all the others
16:54:30FromDiscord<no name fits> I already don't have a job or a life, and having a mortgage I usually hear referred to as bad, so I'll pick Nim I guess
16:54:37FromDiscord<clyybber> haha
16:57:44FromDiscord<Gary M> time for the next little test
16:57:51FromDiscord<Gary M> backwards yx swizzle
17:00:33FromDiscord<no name fits> @clyybber won't compile
17:01:44FromDiscord<no name fits> sent a code paste, see https://play.nim-lang.org/#ix=2TSm
17:02:40FromDiscord<no name fits> sent a code paste, see https://play.nim-lang.org/#ix=2TSo
17:02:49FromDiscord<no name fits> Copy paste from the example at devel
17:05:35FromDiscord<Gary M> you might have to enable -d:ssl or something like that
17:06:02FromDiscord<clyybber> did you import asynchttpserver?
17:06:05FromDiscord<Gary M> also I'm not following the convo very well
17:06:38FromDiscord<Gary M> anyways, here's the yx swizzle
17:06:40FromDiscord<clyybber> In reply to @no name fits "Copy paste from the": have to add import asynchttpserver
17:06:41FromDiscord<Gary M> https://media.discordapp.net/attachments/371759389889003532/823965984518832169/unknown.png
17:07:05FromDiscord<clyybber> In reply to @Gary M "": huh how?
17:07:13FromDiscord<no name fits> sent a code paste, see https://paste.rs/spB
17:07:14ForumUpdaterBotNew thread by Cnerd: Search engine for free assets, see https://forum.nim-lang.org/t/7689
17:07:35FromDiscord<Gary M> In reply to @Clyybber "huh how?": because all my vec2/vec3/vec4 are internally the same stride of floats
17:08:16FromDiscord<Gary M> so I just used a simd instruction to set the fields
17:08:33FromDiscord<Gary M> sent a code paste, see https://play.nim-lang.org/#ix=2TSr
17:08:44FromDiscord<no name fits> ok now it works
17:09:03FromDiscord<Gary M> is it wasteful to have 2 floats like that? Maybe.
17:09:06FromDiscord<no name fits> Also tried with the browser
17:09:09FromDiscord<Gary M> But it's fast as fuck boy
17:11:57FromDiscord<Gary M> basically it stands for "set reverse precision: single"
17:12:58FromDiscord<Gary M> doing mm_set_ps (not reversed) lays it backwards due to not caring about endianess
17:13:07FromDiscord<Gary M> but we have setr so 🤷
17:15:55FromDiscord<no name fits> @clyybber So am I supposed to do something to help? The devel works with the extra import? Should I be learning on devel?
17:16:47*fredrikhr quit (Ping timeout: 265 seconds)
17:22:59*rockcavera quit (Remote host closed the connection)
17:24:00FromDiscord<Gary M> apparently I can't do Vec3 = Vec3 in vmath
17:24:10FromDiscord<Gary M> or even just Vec3 Vec3
17:26:09FromDiscord<no name fits> Did you mean to take the dot product?
17:27:21FromDiscord<InventorMatt> there are 3 different possible multiplications that it could represent so it kind of makes sense
17:27:32FromDiscord<no name fits> Yeah I was wondering
17:27:37FromDiscord<Gary M> hm
17:28:14FromDiscord<no name fits> There's multiplication by a scalar, dot product and cross product
17:28:26FromDiscord<no name fits> If I'm not super mistaken
17:28:59*rockcavera joined #nim
17:32:32FromDiscord<Gary M> https://media.discordapp.net/attachments/371759389889003532/823972493445300224/unknown.png
17:32:45FromDiscord<haxscramper> What is the closes alternative to a "function that returns a type"? I'm trying to figure out how to wrap C++ template metaprogramming, and the best approach I've come up with so far is something like `typeof(sizeType(StdString))` (for C++'s `std::string::size_type`)
17:33:17ForumUpdaterBotNew thread by HJarausch: Nim doc generates code with invalid indentation, see https://forum.nim-lang.org/t/7690
17:33:19FromDiscord<haxscramper> It probably is going to work, but I will just have to add trillion `typeof`s absolutely everywhere
17:40:24PMunch@no name fits, ah no I went on to do something else
17:42:00*Q-Master joined #nim
17:43:48*lritter quit (Ping timeout: 245 seconds)
17:47:02*Q-Master quit (Ping timeout: 260 seconds)
17:47:16*stefantalpalaru quit (Changing host)
17:47:16*stefantalpalaru joined #nim
17:51:19ForumUpdaterBotNew thread by Devosalain2: Gtk gintro, hello world in object oriented way., see https://forum.nim-lang.org/t/7691
17:53:49*Q-Master joined #nim
18:02:59FromDiscord<Gary M> https://media.discordapp.net/attachments/371759389889003532/823980153582387212/unknown.png
18:03:05FromDiscord<Gary M> anyways here's the last test before I sleep
18:03:14FromDiscord<Gary M> Vec3 float
18:03:55*vicfred quit (Quit: Leaving)
18:09:52*Vladar quit (Remote host closed the connection)
18:13:22*Vladar joined #nim
18:14:11*rockcavera quit (Remote host closed the connection)
18:14:26*Q-Master quit (Ping timeout: 240 seconds)
18:16:37*m4r35n357 joined #nim
18:16:42*m4r35n357_ joined #nim
18:16:55*m4r35n357 quit (Remote host closed the connection)
18:16:55*m4r35n357_ quit (Remote host closed the connection)
18:17:12*m4r35n357 joined #nim
18:20:53*rockcavera joined #nim
18:33:26FromGitter<timotheecour> @Clyybber @narimiran ⏎ ⏎ *<FromDiscord>* <clyybber> @timotheecour Why does the CI for the latest commit on a PR run on your sourcehut account? ⏎ ⏎ I don’t know, I had no interaction with https://github.com/nim-lang/Nim/pull/17472, it could be a bug on the sourcehut end or any other reason, but yes, we need to look into it. ... [https://gitter.im/nim-lang/Nim?at=605a3476c1e10242c5bb450f]
18:33:31FromDiscord<jtiai> I have bit hard time to get around nim docs. Like where I can find documentation that explains what `` means after function names and for example what `template` means instead of `proc`?
18:35:15FromDiscord<haxscramper> In reply to @jtiai "I have bit hard": https://nim-lang.org/docs/manual.html#procedures-export-marker
18:35:27FromDiscord<haxscramper> https://nim-lang.org/docs/manual.html#templates
18:35:44FromDiscord<DavidKunz> `` means that it's a public function, with a `template` you can do meta programming: https://nim-lang.org/docs/tut2.html#:~:text=Templates%20are%20a%20simple%20substitution,call%20it%20like%20a%20procedure.
18:36:08FromDiscord<haxscramper> `template` is more of a code substitution, like C macro
18:36:27FromDiscord<haxscramper> You can do some metaprogramming, but it has quite limited set of features
18:37:16FromDiscord<haxscramper> `proc` is just regular procedure like in any other language
18:39:09FromDiscord<jtiai> "regular" procedure for me means something that you call and what doesn't return anything. Functions do...
18:40:58FromDiscord<haxscramper> Minor terminological difference. nim `proc` == "function" most mainstream programming languages (like `function` in js, `fn` in rust and so on)
18:41:11FromDiscord<haxscramper> `func` in nim is a procedure with no side effects
18:41:22FromDiscord<jtiai> I don't use js or rus... 🙂
18:43:05*Q-Master joined #nim
18:46:31FromDiscord<jtiai> So if I understood correctly proc can return value by either using implicit `result` a `return` statment and if all that is missing it's implicitly last expression value...
18:47:53FromDiscord<haxscramper> Correct
18:48:37FromDiscord<haxscramper> So ``proc plus(a, b: int): int = a + b`` is the same as one with `result = a + b`, or `return a + b`
18:58:40FromDiscord<arnetheduck> "There should be three-- and preferably exactly three --obvious ways to do it."
19:02:15FromDiscord<jtiai> Not to mention that explicit is better than implicit... 😄
19:02:50FromDiscord<jtiai> Is there code formatter tool for nim?
19:04:25FromDiscord<jtiai> And while I am it (feeling like 5 year old asking all stuff): does nim has classes or do modules work like ones?
19:06:35FromDiscord<DavidKunz> Yes, there is Nimpretty
19:07:10FromDiscord<DavidKunz> Usage: `nimpretty yourfile.nim`
19:08:13FromDiscord<arnetheduck> btw PMunch how is nim null-pointer-dereference-safe?
19:09:54FromDiscord<jtiai> Given that I had first contact with nim about 3 days ago I must admit that I somewhat like it.
19:10:18FromDiscord<DavidKunz> I'm also new to Nim, immediately fell in love.
19:10:49FromDiscord<jtiai> Given that last 12 years I've been writing almost solely Python code familiarity appeals.
19:11:09FromDiscord<DavidKunz> There are no classes (which is a good thing), you still can do OOP: https://nim-lang.org/docs/tut2.html
19:16:52FromDiscord<DavidKunz> What I like most about Nim is that it's very easy to read (compared to C[++] or Rust), you can concentrate on your business logic.
19:17:29FromDiscord<jtiai> Never really wrote rust and from my C[++] times are over 30 years ago...
19:18:34FromDiscord<jtiai> Though nothing beats BASIC from my first computer ever... 🙂
19:19:47*Q-Master quit (Quit: Ушел)
19:20:29FromDiscord<hamidb80> In reply to @jtiai "Though nothing beats BASIC": try nim
19:21:00FromDiscord<haxscramper> In reply to @DavidKunz "There are no classes": To be more specific - we don't have constructors and multiple inheritance. everything else (single inheritance, methods, override) can be done in nim
19:21:29FromDiscord<haxscramper> We do have destructors, and constructors are usually just replaced with `newT` procs
19:21:38FromDiscord<DavidKunz> Nim kind of brings the fun back to programming. Even though I'm new to it (and haven't written anything meaningful yet), I catched myself looking into RFCs just to see where the language is heading, it really is exciting
19:27:30FromDiscord<jtiai> In reply to @hamidb80 "try nim": I'm trying all the time. It's just that no language can bring back that joy of finding programming that young me did. That moment passed and I'm very happy that it ever did.
19:34:03FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2TT1
19:34:33FromDiscord<haxscramper> Just any ideas, maybe it is something very stupid again, but I'm complete lost here
19:34:57FromDiscord<haxscramper> I also printed typed tree for `rebindOther` call separately, together with resolved identifiers etc
19:35:34FromDiscord<haxscramper> And `getTypeImpl` for symbole that `rebindOther` resolved to has nnkEmpty node kind in formal params return value
19:37:01FromDiscord<zidsal> I'm pretty lost on the code, but this isn't because its an ambigious type rather then a alck of type?
19:38:00FromDiscord<zidsal> nevermind I made var tmp a string and it still errors
19:38:04FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2TT3
19:38:11FromDiscord<zidsal> (edit) "nevermind I made var tmp a string ... and" added "which shouldn't be ambigious"
19:38:28FromDiscord<haxscramper> So this tree dump with `Sym 113:23` show that `rebindOther` was resolved to correct proc
19:38:51FromDiscord<haxscramper> But `Empty` in `FormalParams` show that for some unknown reason compiler decided the proc does not have a return type
19:39:00FromDiscord<haxscramper> Even though it almost certainly does
19:39:13FromDiscord<hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=2TT4
19:39:19*Q-Master joined #nim
19:39:40FromDiscord<Solitude> sent a code paste, see https://play.nim-lang.org/#ix=2TT5
19:40:18FromDiscord<hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=2TT6
19:40:26FromDiscord<Solitude> In reply to @hamidb80 "type mismatch: got <int": a[] = 3
19:40:47FromDiscord<hamidb80> In reply to @Solitude "a[] = 3": that's it, tnx
19:40:52FromDiscord<zidsal> @haxscramper clutching at straws with my limited nim knowledge and google foo, but what if you made npos and template that returns typed? or does that not do what i think it does
19:41:02FromDiscord<haxscramper> In reply to @haxscramper "But `Empty` in `FormalParams`": So main problem is it got resolved in a very weird way
19:41:37FromDiscord<haxscramper> In reply to @zidsal "<@!608382355454951435> clutching at straws": Yes, it could be done much simpler, but the problem is I think I need it exactly the way it is
19:41:40FromDiscord<haxscramper> For C++ interop
19:41:52FromDiscord<haxscramper> I'm trying to wrap C++ template metaprogramming
19:42:07FromDiscord<haxscramper> Or rather reimplement it in nim, to get all static type guarantees
19:42:16FromDiscord<haxscramper> Subtype relations and all this unholy mess
19:42:28FromDiscord<zidsal> ah, what about something like returning ` type[CharT, Traits, Alloc]` ?
19:42:32FromDiscord<haxscramper> And that's the best I've managed to come up with
19:43:10FromDiscord<jtiai> 5 year old me asks again: what does `0x00.uint8` mean and how it differs from `cast[uint8](0x00)` ?
19:43:20FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2TT7
19:44:13FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2TT8
19:44:46FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2TT9
19:45:04FromDiscord<haxscramper> (edit) "https://play.nim-lang.org/#ix=2TT9" => "https://play.nim-lang.org/#ix=2TTa"
19:45:07FromDiscord<zidsal> not going to lie, you've lost me 😛 althought I've never touched c++ before
19:46:07FromDiscord<haxscramper> Yes, I just explained what is going on, so maybe someone else can have an idea. But that is mostly a nim problem (type resolution), not `C++`
19:46:36FromDiscord<haxscramper> It doesn't really have anything to do with `C++` besides the logic behind this very weird code
19:49:13FromDiscord<haxscramper> But if this works (and my latter idea works too), I would be able to claim [almost] full compatibility with C++ template metaprogramming, and subsequently being able to handle horrors like boost/stdlib
19:51:10FromDiscord<Yardanico> In reply to @jtiai "5 year old me": safe conversion vs an unsafe cast
19:51:44FromDiscord<Yardanico> and for literals you don't need .uint8, you can just 0x00'u8
19:54:07FromDiscord<jtiai> Oooo.. (looking some example codes which had those)
19:55:05FromDiscord<Yardanico> and also if you're doing it in an array/seq, you only need to specify the type of the first literal
19:55:14FromDiscord<Yardanico> like const mydata = [0x00'u8, 0x01, 0x02]
19:57:16FromDiscord<jtiai> I'm just writing an operating system... 🙂
19:57:38FromDiscord<haxscramper> Here is a simplified code https://play.nim-lang.org/#ix=2TTf, it still has more indirection that probably necessary, but I cut out all C++-related parts
20:03:58FromDiscord<haxscramper> Oh, yeah, of course, silent error that breaks everything
20:04:34FromDiscord<haxscramper> Seems like `typedesc[SizeT]` field broke everything
20:10:10*SunDwarf joined #nim
20:13:18FromDiscord<Goel> I don't understand how to use this proc (terminal module of Nim)↵`proc setForegroundColor(f: File; color: Color) {...}`↵What do i need to use as `File`? I checked it to be more specified it says "File = ptr CFile. The type representing a file handle." That proc should just change the foreground color of the terminal when set
20:13:45FromDiscord<Yardanico> `stdout`
20:13:46FromDiscord<Yardanico> or stderr
20:13:55FromDiscord<Yardanico> or other files that you might want to write colored stuff into
20:14:48FromDiscord<Goel> Ah i see, i though i had to point at the Terminal itself, but i didn't understand exactly how to do it
20:14:56FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2TTo
20:15:16FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/824013448404009010/unknown.png
20:15:39FromDiscord<Yardanico> of course don't forget to also reset all attributes with stdout.resetAttributes() when you're done writing stuff
20:16:09*narimiran quit (Ping timeout: 264 seconds)
20:17:50FromDiscord<Goel> Does it work also if i write that parameter `stdout` inside the proc instead of `File`? Or your example is the only way to make it work?
20:18:03FromDiscord<Yardanico> wdym?
20:18:32FromDiscord<Goel> proc setForegroundColor(stdout, fgGreen)
20:18:49FromDiscord<Yardanico> you don't call procs with `proc`
20:19:23FromDiscord<Yardanico> `setForegroundColor(stdout, fgGreen)` will work, yes, because both `stdout.setForegroundColor(fgGreen)` and `setForegroundColor(stdout, fgGreen)` mean the exact same thing
20:19:45FromDiscord<Yardanico> https://nim-lang.org/docs/tut2.html#object-oriented-programming-method-call-syntax
20:20:13*cornfeedhobo quit (Quit: ZNC - https://znc.in)
20:25:18FromDiscord<zidsal> btw I've finally been able to work out https://forum.nim-lang.org/t/7669 After digging through the testament code it turns out you can pass a file param (which was documented in https://nim-lang.org/docs/testament.html)
20:28:36FromDiscord<Yardanico> the file param? or errormsG?
20:28:38FromDiscord<Yardanico> (edit) "errormsG?" => "errormsg?"
20:30:50FromDiscord<zidsal> the file param 😛
20:31:12FromDiscord<zidsal> errormsg I found plenty of examples of, in the compiler
20:36:19FromDiscord<clyybber> In reply to @no name fits "<@!107882072974065664> So am I": devel is the next release so you can just wait for that or use devel :)
20:37:03FromDiscord<clyybber> In reply to @timotheecour "<@107882072974065664> @narimiran ⏎": ah ok, thanks
21:41:18*superbia quit (Quit: WeeChat 3.1)
21:41:51*Gustavo6046 quit (Ping timeout: 265 seconds)
21:42:53*Gustavo6046 joined #nim
21:43:52ForumUpdaterBotNew thread by Lotib48819: I am confused. Javascript, WASM coroutine support ?, see https://forum.nim-lang.org/t/7692
21:53:29ozzzPMunch, mratsim, and all other, thanks a lot!
21:53:37ozzzI made it work
21:54:21ozzzhere is example, on my home's rpi(lighttp) + app server on laptop (nim_libFCGI)
21:54:23ozzzhttp://46.49.41.80/ace/
21:54:32ozzzhere is example ^
21:55:14ozzz20 threads currently for testing
22:01:54ForumUpdaterBotNew thread by Lotib48819: GlobalThis is not defined although node version is v14.4.0, see https://forum.nim-lang.org/t/7693
22:11:21*Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in)
22:16:17*Gustavo6046 joined #nim
22:16:43FromDiscord<jfmonty2> Trying to come up with a generic description of a type that behaves like a seq except that has a fixed maximum size
22:16:52FromDiscord<jfmonty2> but it seems to crash the compiler
22:16:52FromDiscord<jfmonty2> sent a code paste, see https://play.nim-lang.org/#ix=2TTV
22:17:59FromDiscord<ElegantBeef> `I: static int`
22:19:45FromDiscord<jfmonty2> sent a code paste, see https://play.nim-lang.org/#ix=2TTX
22:19:51FromDiscord<ElegantBeef> Well yea you're giving a slice for a static int
22:19:54FromDiscord<Gary M> Hello
22:19:55FromDiscord<ElegantBeef> It should just be an int of `5`
22:20:03FromDiscord<jfmonty2> ohh, ok
22:20:31FromDiscord<jfmonty2> Gotcha, thanks
22:20:38FromDiscord<Gary M> You seen my Vector3 implementation benchmarks Beef?
22:20:42FromDiscord<ElegantBeef> I did
22:20:53FromDiscord<Gary M> It's a fast-boy
22:29:46FromGitter<ynfle> Is there a Date type other than DateTime?
22:44:37FromGitter<ynfle> @haxscramper did you solve your no type issue?
22:45:40FromGitter<ynfle> You are basically using recursion on a proc that has `auto` as a return type and no base case so the type can't be determined
22:46:46FromDiscord<Solitude> it wasnt recursive
22:47:04FromGitter<ynfle> It looks like it is
22:47:05FromGitter<ynfle> Why not?
22:47:17FromDiscord<Solitude> its just overloaded
22:50:02FromGitter<ynfle> But it doesn't call the the over "version" of the proc?
22:58:04*Vladar quit (Quit: Leaving)
23:07:18*Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in)
23:14:18*Gustavo6046 joined #nim
23:16:19FromDiscord<jfmonty2> Is there an easier way to declare a generic "any integer type" other than `T: int|uint|int8|uint8|int16|uint16|int32|uint32|int64|uint64` ?
23:17:49FromDiscord<ElegantBeef> `SomeInteger`
23:18:34FromGitter<ynfle> SomeInteger is already declared, but you can use a type section like ⏎ ⏎ ```type ⏎ MyCollectionOfInts = int | unit | unit8 | int16``` [https://gitter.im/nim-lang/Nim?at=605a774a3a9448256c26729f]
23:18:52FromDiscord<ElegantBeef> Yea you can make your own typeclass
23:19:07FromDiscord<jfmonty2> Right, of course, I just figured it was pretty likely there was one already floating around
23:19:38FromDiscord<jfmonty2> Is there a list of pre-defined union types like that floating around anywhere? Or do I just have to look in the `system` module documentation?
23:20:10FromDiscord<ElegantBeef> https://nim-lang.org/docs/system.html#SomeOrdinal
23:20:17FromDiscord<ElegantBeef> They're all around there
23:20:38FromDiscord<jfmonty2> Cool, thanks.
23:21:55PMunch@arnetheduck, that was a mistake on my part. I really should update that..
23:22:19PMunchozzz, oh nice! Good to hear you made it work
23:22:20*fredrikhr joined #nim
23:31:48*zedeus quit (Ping timeout: 246 seconds)
23:50:45*PMunch quit (Quit: leaving)
23:58:20FromDiscord<ajusa> might be a bit of a weird question, but was there a nim package that would output to markdown basically? Like you could write nim code and have it be embedded/ran and export to markdown or HTML. I swear I saw a package that did this, maybe for someone's blog?
23:58:46FromDiscord<ajusa> (edit) "might be a bit of a weird question, but was there a nim package that would output ... to" added "code"