<< 04-03-2021 >>

00:17:01*teiresias joined #nim
01:06:01*pbb_ quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
01:09:18*pbb joined #nim
01:16:30*grobe0ba quit (Quit: ZNC 1.7.5 - https://znc.in)
01:16:41*grobe0ba joined #nim
01:34:20*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
01:34:39*njoseph joined #nim
01:36:32FromDiscord<MapleSyrup|TagMeIfReply> hello, can someone explain how I can push a nim library to nimble
01:36:41FromDiscord<MapleSyrup|TagMeIfReply> been looking around for guides but found none
01:38:37FromDiscord<ElegantBeef> https://github.com/nim-lang/packages/
01:38:48FromDiscord<ElegantBeef> More accurately https://github.com/nim-lang/packages/#adding-your-own-package
01:39:55FromDiscord<exelotl> You fork the Nimble repo and edit the JSON file to include an entry for your library
01:40:53FromDiscord<MapleSyrup|TagMeIfReply> thanks, first time encountering a package.json for an entire language on github!
01:41:42FromDiscord<MapleSyrup|TagMeIfReply> there's no mention ofhow to construct the .nimble file?
01:42:54FromDiscord<exelotl> Hehe↵About the forking and PRing iirc Nimble has a builtin 'publish' that automates the process? I've never used it myself tho
01:43:04FromDiscord<exelotl> (edit) "Hehe↵About the forking and PRing iirc Nimble has a builtin 'publish' ... that" added "command"
01:45:22FromDiscord<exelotl> Hmm, you best use `nimble init` in a new dir to get an example of an empty project. And then try to adapt the nimble file to suit your project I guess
01:49:21*kitech1- quit (Quit: ZNC 1.7.5 - https://znc.in)
01:49:39*kitech1 joined #nim
01:53:43FromDiscord<MapleSyrup|TagMeIfReply> hmm interesting
02:03:26*def- quit (Ping timeout: 256 seconds)
02:04:39FromDiscord<MapleSyrup|TagMeIfReply> aaaand my package is pending a pr now, thanks @exelotl
02:13:52*def- joined #nim
02:29:20*lritter joined #nim
02:30:17*abm quit (Read error: Connection reset by peer)
03:02:10*rockcavera quit (Remote host closed the connection)
03:25:22FromDiscord<MapleSyrup|TagMeIfReply> what's the meta nim gui library now
03:25:32FromDiscord<MapleSyrup|TagMeIfReply> cross-platform preferably
03:30:53FromDiscord<ElegantBeef> Depends what you're after, Nimx/Fidget are the most pure but also not the most polished, Nigui is an easy abstraction for cross platform system gui's. Wxwidgets, gtk, and qt also have bindings
03:42:28*asdflkj quit (Ping timeout: 276 seconds)
04:00:03FromDiscord<MapleSyrup|TagMeIfReply> by pure does that mean written in nim mostly
04:02:18FromDiscord<ElegantBeef> Yes
04:15:21FromDiscord<MapleSyrup|TagMeIfReply> I remember someone here mentioned many months ago that they were using nim to follow along with the book "Crafting Interpreters". Who are you and how is it going?
04:25:27*spiderstew joined #nim
04:27:17*spiderstew_ quit (Ping timeout: 272 seconds)
05:35:23*narimiran joined #nim
05:50:33*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
05:50:41*njoseph joined #nim
05:51:28*njoseph quit (Client Quit)
05:51:35*njoseph joined #nim
05:51:35*njoseph quit (Client Quit)
05:51:41*njoseph joined #nim
05:51:41*njoseph quit (Client Quit)
05:51:47*njoseph joined #nim
06:22:09*Tuatarian quit (Ping timeout: 260 seconds)
06:37:24*waleee-cl quit (Quit: Connection closed for inactivity)
06:50:15*superbia joined #nim
06:55:57ForumUpdaterBotNew Nimble package! moss_nim - Moss (Measure of Software Similarity) implementation in Nim., see https://github.com/D4D3VD4V3/moss_nim
07:16:01*haxscramper joined #nim
07:36:33*lritter quit (Ping timeout: 264 seconds)
07:59:18FromDiscord<mratsim> In reply to @MapleSyrup|TagMeIfReply "I remember someone here": people in the langdev channel, there is lqdev and someone else.
08:20:00*Tuatarian joined #nim
08:29:44*stefantalpalaru_ joined #nim
08:29:51*kinkinkijkin_ joined #nim
08:29:55*r4vi_ joined #nim
08:29:58*robertmeta_ joined #nim
08:29:59*euantorano_ joined #nim
08:30:03*astronavt joined #nim
08:30:07*npgm_ joined #nim
08:30:21*Adeon_ joined #nim
08:31:25*oprypin_ joined #nim
08:32:03*Xena joined #nim
08:32:31*skelett1 joined #nim
08:43:31*stefantalpalaru quit (*.net *.split)
08:43:31*jess quit (*.net *.split)
08:43:31*oprypin quit (*.net *.split)
08:43:31*r4vi quit (*.net *.split)
08:43:31*Cadey quit (*.net *.split)
08:43:31*astronavt___ quit (*.net *.split)
08:43:31*robertmeta quit (*.net *.split)
08:43:31*FromGitter quit (*.net *.split)
08:43:31*kinkinkijkin quit (*.net *.split)
08:43:31*euantorano quit (*.net *.split)
08:43:31*npgm quit (*.net *.split)
08:43:32*Adeon quit (*.net *.split)
08:43:32*skelett quit (*.net *.split)
08:43:33*r4vi_ is now known as r4vi
08:43:36*robertmeta_ is now known as robertmeta
08:43:40*kinkinkijkin_ is now known as kinkinkijkin
08:43:42*euantorano_ is now known as euantorano
08:43:45*Adeon_ is now known as Adeon
08:43:51*npgm_ is now known as npgm
08:44:18*FromGitter joined #nim
08:52:33FromDiscord<Unaimend> So what is your opinion on signaling errors in nim, do your prefer Option[T], or exception? Should a library use exceptions since that seems to be they way that the standard is working?
08:52:49FromDiscord<Unaimend> (edit) "So what is your opinion on signaling errors in nim, do your prefer Option[T], ... oranother" added " exceptions" | "exception?" => "another type?"
08:54:27FromDiscord<haxscramper> I prefer to use `Option[T]` for functions that are expected to fail often, otherwise use exceptions
08:54:35FromDiscord<haxscramper> Different opinion is style guide from status: https://status-im.github.io/nim-style-guide/04_errors.html
08:54:59FromDiscord<Unaimend> In reply to @haxscramper "Different opinion is style": Thanks for the pointer
08:55:41FromDiscord<haxscramper> sent a code paste, see https://paste.rs/8WI
08:55:51FromDiscord<haxscramper> But I'm not sure about pattern matching stuff
08:55:53FromDiscord<Unaimend> In reply to @haxscramper "I prefer to use": So for example for wrong user input I should use exceptions?
08:56:08FromDiscord<haxscramper> I'd say yes
08:56:19FromDiscord<Unaimend> In reply to @haxscramper "But I'm not sure": I love it, its the stuff i am used from haskell and I think it works like a dream there
08:56:38Clonkk[m]Hello, does anybody knows if Python hot code reloading when executing a python script with Nimpy in a ``while loop`` is possible (and how) ?
08:57:45FromDiscord<haxscramper> I use `Option[T]` for functions that are expected to deal with data that is optional by itself. Otherwise, missing value is an unexpected sutation and therefore the exception is more sutable
08:58:29FromDiscord<Unaimend> In reply to @haxscramper "I use `Option[T]` for": Sounds like a good idea, I try to use your method
09:18:55*vicfred quit (Quit: Leaving)
09:20:54*jess joined #nim
09:35:37FromDiscord<VinKer> Hi, how do i get the file name in nim ?
09:35:38*Vladar joined #nim
09:36:14FromDiscord<VinKer> I mean the nim file which is currently executing
09:36:52FromDiscord<Solitude> https://nim-lang.org/docs/system.html#currentSourcePath.t
09:40:26FromDiscord<VinKer> @dont swear Thanks but i need the file name. docs says that i can get the dfirectory.
09:41:26ForumUpdaterBotNew thread by HJarausch: Array, seq : is there something in between? , see https://forum.nim-lang.org/t/7579
09:45:52FromDiscord<Rika> @VinKer it inclides the file name.
09:48:00FromDiscord<Solitude> In reply to @VinKer "@dont swear Thanks but": its full filepath, you can get whatever you want
10:01:44*SebastianM joined #nim
10:04:57SebastianMHey, Guys does Nim have any support for **kwargs as in Python? I only found varargs... Thank you
10:05:54FromDiscord<VinKer> What i am asking is, in vb.net, we can use GetFileNameFromPath(path). Is there a similar function in nim >
10:10:42Oddmongeram i alone to use gitnim , for nim installation ? It seems stuck in 1.4.3
10:10:53FromDiscord<haxscramper> In reply to @VinKer "What i am asking": https://nim-lang.org/docs/os.html#splitFile%2Cstring ?
10:11:10FromDiscord<haxscramper> Oddmonger: gitnim can be considered unmaintained now
10:11:54FromDiscord<mratsim> In reply to @SebastianM "Hey, Guys does Nim": you would have to show what kind of code you want to write. Nim has a static type system so you need proper types for all your arguments.
10:11:54FromDiscord<haxscramper> Though I used it for some time, and it is not complicated internally
10:12:25Oddmongerwell i will switch then…
10:12:45FromDiscord<haxscramper> SebastianM: you can implement your code as a `macro` with `varargs[untyped]` arguments, this way you could write name-value pairs
10:14:07FromDiscord<VinKer> @haxscramper Thanks
10:14:15Oddmongerbtw (i was looking arch packages for nim), i see i'm using community/package (from arch packages then)
10:14:38FromDiscord<VinKer> How can i convert int value to an enum ?
10:14:41FromDiscord<haxscramper> Oddmonger: I'd recommend to use `choosenim`
10:14:53FromDiscord<haxscramper> In reply to @VinKer "How can i convert": `let intVal = EnumName(123)`
10:15:11FromDiscord<VinKer> @haxscramper Thanks, let me try
10:15:22FromDiscord<haxscramper> If `123` does not correspond to any enum value it will be a compile-time error, otherwise it should work fine
10:15:31Oddmongerhum, i mean « i am using community/nimble »
10:15:40Oddmongeris it ok to use nimble with the arch package ?
10:16:22FromDiscord<haxscramper> I guess it is okay probably, but I'm not sure exactly. If this doesn't blow up instantly then it is fine I suppose
10:16:39Oddmongerhéhé ok
10:16:44SebastianMmratsim, haxscramper, Thank you guys for this information. Gonna explore that
10:16:52FromDiscord<haxscramper> But as mratsim already said nim is statically typed, so you need to know in advance number of arguments and their types. If you want to pass some kind of simple data you can do `args: varargs[WrapperType]` and then check for each separately. In addition to
10:16:57FromDiscord<VinKer> @haxscramper Yeah, i know that. and it worked.
10:17:36SebastianMhaxscramper, Thanks for explanation
10:17:43FromDiscord<haxscramper> in addition to `varargs[untyped]`. And macro can just convert `kwargsCall(key = value)` into `kwargsCall({"key": value})`
10:19:22FromDiscord<VinKer> @haxscramper I am just creating a MsgBox wrapper. It worked. https://media.discordapp.net/attachments/371759389889003532/816978113870954526/unknown.png
10:20:42*JustASlacker joined #nim
10:21:19*Gustavo6046 quit (Ping timeout: 272 seconds)
10:22:36SebastianM@haxscramper thanks
10:30:28*PMunch joined #nim
10:31:08*krux02 joined #nim
10:31:59*SebastianM quit (Quit: -a- IRC for Android 2.1.59)
10:36:56FromDiscord<Unaimend> do we have default parameter for generics i.e.` proc add[T = int](a: T, b: T): T`
10:38:58FromDiscord<Rika> no, that doesnt really make sense
10:39:17*haxscram` joined #nim
10:40:05m4r35n357PMunch, narimiran Hi guys, got my POC hamiltonian central force code (from yesterday) working (with hard-coded input parameters) to the point of plotting valid data! I can now relax & tackle this piece by piece at leisure. Thanks again for the help yesterday! https://pastebin.com/7radYS0K
10:40:21narimiranm4r35n357: woohoo!!
10:40:35*haxscramper quit (Ping timeout: 240 seconds)
10:41:27FromDiscord<Unaimend> In reply to @Rika "no, that doesnt really": why not?
10:41:37m4r35n357narimiran, yep ;)
10:42:12PMunchOh cool! Didn't even know what you where trying to do :P
10:43:19FromDiscord<Unaimend> In reply to @Rika "no, that doesnt really": C++ has them, too. But I am a little bit confused by nim generics atm so maybe there is another mechanism I could use
10:44:36FromDiscord<Rika> how does it work on C++?
10:45:10PMunchYeah what are you trying to do with that?
10:46:45narimiranPMunch: he tried to make his POC hamiltonian central force code to work, obviously
10:46:48m4r35n357PMunch, it was really only the automatic differentiation at that point, I didn't want to confuse the issue by having to explain the objective in detail whilst struggling with the implementation ;) But now I've seen the plots!
10:47:08FromDiscord<haxscramper> @Unaimend https://github.com/nim-lang/RFCs/issues/85
10:47:25narimiranPMunch: ...to the point of plotting valid data, i might add
10:47:52narimiranPMunch: that was done so he can now relax & tackle this piece by piece at leisure
10:47:56FromDiscord<haxscramper> You can have workarounds via constructor procs for types sometimes, but there is no default parameters for generics in any other form
10:48:17m4r35n357I need to get the parameters from the command arguments, add more integrators, and structure the code into modules (already done with the AD code). But no rush now!
10:48:32FromDiscord<haxscramper> But generally you need to specify all generic parameters when instantiating generics
10:48:57FromDiscord<Unaimend> In reply to @PMunch "Yeah what are you": sent a code paste, see https://paste.rs/r19
10:50:26FromDiscord<Unaimend> In reply to @PMunch "Yeah what are you": sent a code paste, see https://play.nim-lang.org/#ix=2RDQ
10:50:32FromDiscord<Unaimend> (edit)
10:50:44FromDiscord<mratsim> Tree[void]
10:50:48FromDiscord<mratsim> or auto
10:53:00FromDiscord<Unaimend> In reply to @mratsim "Tree[void]": sent a code paste, see https://play.nim-lang.org/#ix=2RDS
10:53:16FromDiscord<Unaimend> (edit) "https://play.nim-lang.org/#ix=2RDS" => "https://paste.rs/5T5"
10:53:24FromDiscord<Unaimend> (edit)
10:53:34FromDiscord<mratsim> are those the error thrown?
10:53:36FromDiscord<Unaimend> (edit) "https://play.nim-lang.org/#ix=2RDT" => "https://play.nim-lang.org/#ix=2RDU"
10:53:47FromDiscord<mratsim> (edit) "error" => "errors"
10:54:21FromDiscord<Rika> stringstream doesnt take a generic
10:54:22FromDiscord<Unaimend> In reply to @mratsim "are those the errors": sry for bad formatting
10:54:56FromDiscord<Unaimend> (edit) "https://play.nim-lang.org/#ix=2RDU" => "https://play.nim-lang.org/#ix=2RDW"
10:55:29FromDiscord<Unaimend> In reply to @mratsim "Tree[void]": This works, now thx. I think generics sometimes weird error locations
10:55:44FromDiscord<Unaimend> In reply to @haxscramper "<@!287576619718279178> https://github.com/nim-lang/": Thx
10:56:32PMunchnarimiran, thanks for the explanation <_< :P
10:56:39narimiranPMunch: any time :)
11:56:35PMunchHmm, so jester has a cross-talk bug?
11:56:52PMunchOr rather HttpBeast or some other underlying part
11:57:45JustASlackerwhy does everbody love kubernets
11:57:59JustASlackerits just no fun running a cluster onpremise
11:58:03JustASlackerand im in the wrong channel
11:58:18FromDiscord<Rika> pmunch: i heard that even asynchttpserver has the same issue but i dont know too much
12:00:00PMunchYeah reading the issue report and PR makes it seem like the bug might be somewhere else
12:01:29PMunchI mean it's still not great..
12:08:22*stefantalpalaru_ is now known as stefantalpalaru
12:08:25*stefantalpalaru quit (Changing host)
12:08:26*stefantalpalaru joined #nim
12:10:01*rockcavera joined #nim
12:10:08FromDiscord<Rika> i bet its in asyncdispatch 😛
12:10:20FromDiscord<Rika> oh wait might be in asyncnet idk
12:21:34m4r35n357OK I now read all parameters from command arguments (in two stages, that is for future work!), and have a choice of two symplectic integrators, is anyone up for eyeballing what I have so far?
12:23:39m4r35n357if so, https://pastebin.com/Pmch5Mzr
12:31:51narimiranm4r35n357: even your link spells PMunch! wow!
12:32:44PMunchHaha, nice :P
12:32:53PMunchBy the way, Nim floats are always float64
12:33:21m4r35n357I am the hash king ;)
12:33:46m4r35n357now do one that spells maresnest ;)
12:35:28narimiranm4r35n357: pro tip: instead of `m: float64, gm: float64, q_r: float64, ...`, you can do `m, gm, q_q: float64`. and while at it, you can remove all those `64` in the whole program and have just `float`
12:35:44m4r35n357nam
12:35:46m4r35n357ri
12:35:56narimiranoooh, anagram incoming!
12:36:01m4r35n357narimiran, oops, cheers for that
12:36:33narimiranwe already had Iraq here last week. and now i'm 'Nam
12:36:34m4r35n357think I hit enter instead of tab, twice
12:37:02PMunchFor your integrator you can assign directly from a case
12:37:15PMunchSo `var integrator = case order [...]`
12:37:42m4r35n357PMunch, ooh, interesting
12:37:46PMunchhttps://peterme.net/tips-and-tricks-with-implicit-return-in-nim.html
12:38:17narimiranm4r35n357, PMunch: and what about the else case? currently it'll just print and continue/fail
12:39:00m4r35n357narimiran, yes, I should bail, it is on the list . . . ;)
12:39:10PMunchWell it will continue as it is now and then immediately crash when it tries to call the integrator
12:39:19PMunchSo you could just as well throw an exception there
12:39:50m4r35n357PMunch, OK exceptions next
12:40:10FromDiscord<Rika> ngl i keep on misshortening your name as nami
12:49:06narimiranno problem with that, @Raki
12:49:51*Xena is now known as Cadey
12:53:32*NimBot joined #nim
12:57:14*Vladar quit (Remote host closed the connection)
13:12:59*Vladar joined #nim
13:46:40FromDiscord<arnetheduck> those running into inexplicable GC crashes might be interested in https://github.com/status-im/Nim/commit/f05ba3c667157f46f141ff700121c7aff86cf07a
13:49:14PMunchOh damn, that bug must've been a massive pain to find
14:01:10*rockcavera quit (Remote host closed the connection)
14:02:51PMunchHmm, in Jester echoing out the headers shows a table of sequences. But trying to get one of them returns a single value. Is this some weird overload?
14:03:07PMunchAnd how can I get the possibly repeated headers?
14:05:45PMunchMan, I love that this works: `let mime = try: request.headers["accept"] except: resp Http400`
14:07:39*xet7 quit (Quit: Leaving)
14:16:55FromDiscord<arnetheduck> yeah, it's been haunting us for months and costing quite a bit of pulled-out hair
14:17:11PMunchI'd imagine!
14:17:56PMunchHow did you even manage to find that? You must've been looking at a decompiled version or something to spot that optimisation
14:18:25FromDiscord<Zachary Carter> sent a code paste, see https://play.nim-lang.org/#ix=2REX
14:18:30FromDiscord<Zachary Carter> when compiling with the cpp backend
14:21:14FromDiscord<arnetheduck> https://rr-project.org/ - reverse debugging basically, the issue was only barely reproducible under certain hardware and network conditions
14:24:22FromDiscord<arnetheduck> notably, there are several other GC issues in nim that have been known for years, stuff l ike https://github.com/nim-lang/Nim/issues/4851 and https://github.com/nim-lang/Nim/issues/10625 that people should probably be aware of as well
14:25:01FromDiscord<arnetheduck> https://github.com/nim-lang/Nim/pull/16761/ is interesting also for working with this
14:26:09FromDiscord<arnetheduck> In reply to @arnetheduck "https://rr-project.org/ - reverse debugging": this basically allows replaying crashes and disassembling the compiled code (which incidentally also depends on compiler options, versions etc)
14:26:46PMunch@Zachary, that's because NCSTRING doesn't have the const I believe. I remember there was some talk about this, but I'm not sure if there ever was a good solution.
14:29:53PMunch@arnetheduck, yeah the whole field of GCing is a bit of a hack so there is bound to be things like this popping up. I remember the first time I read about how GCs worked by searching the stack and picking out things that looked like pointers and thought to myself that it seemed brittle.
14:30:01PMunchBut it works surprisingly well!
14:31:12FromDiscord<mratsim> until it doesn't and then it becomes ugly
14:32:33PMunchThat's the innate nature of the hack
14:50:55*Gustavo6046 joined #nim
14:52:50*Gustavo6046 quit (Remote host closed the connection)
15:00:16*Gustavo6046 joined #nim
15:20:06*Clonkk[m] sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/NKckjfKtHUPzdhDkrcFsLsHr/message.txt >
15:26:45m4r35n357quick question: is there a ternary operator? can't find one . . .
15:29:43PMunchm4r35n357, I mention it in the article I shared earlier
15:29:52PMunchBasically you just use a normal if with implicit return
15:30:01PMunchvar x = if y > 100: 200 else: 300
15:30:02FromDiscord<gogolxdong> What impact will be brought by https://justine.lol/cosmopolitan/index.html?
15:30:29PMunchWhy is everyone suddenly obsessed with Cosmopolitan?
15:30:43PMunchI mean it is pretty neat, but also super hacky
15:30:44m4r35n357PMunch, thx, will read now (been busy making lots of things work!)
15:31:11m4r35n357and lunch ;)
15:31:13PMunchNo worries .)
15:31:28FromDiscord<gogolxdong> I see potential of changing a lot of things.
15:35:32*PMunch quit (Quit: leaving)
15:36:20FromDiscord<MapleSyrup|TagMeIfReply> In reply to @ForumUpdaterBot "New Nimble package! moss_nim": Heeey, that's my package! But looks like the underscore was stripped from the name...
15:38:24FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2RFt
15:38:34FromDiscord<gogolxdong> cross-platform ends.
15:38:46Clonkk[m]<FromDiscord "<gogolxdong> I see potential of "> Cross-compilation isn't that big of a problem. Wasm can already do a similar thing. Also there is usually a cost associated with losing platform specific thing.
15:39:10FromDiscord<haxscramper> There are multiple modules involved and everything is complicated to minimize, so if anyone got any ideas I would much appreciate
15:40:09FromDiscord<gogolxdong> Nim doesn't target WASM.
15:40:15FromDiscord<haxscramper> Callback I'm trying to evaluate has `proc (a: HLValue){.closure.}`
15:40:21FromDiscord<gogolxdong> (edit) "WASM." => "wasm."
15:40:23FromDiscord<haxscramper> In reply to @gogolxdong "Nim doesn't target wasm.": You can compile to it just fine
15:40:34FromDiscord<haxscramper> You can even compile part of nim compiler to run on wasm for example
15:41:25FromDiscord<Solitude> In reply to @haxscramper "Callback I'm trying to": and if you annotate parameter with {.closure.}?
15:42:09Clonkk[m]<FromDiscord "<gogolxdong> Nim doesn't target "> You can compile for wasm. Also, a wasm would make much more sense than a cosmopolitan one
15:42:18Clonkk[m]> <@freenode_FromDiscord:matrix.org> <gogolxdong> Nim doesn't target WASM.
15:42:18Clonkk[m] * You can compile for wasm. Also, a wasm backend would make much more sense than a cosmopolitan one
15:44:58FromDiscord<gogolxdong> can wasm handle file or memory operating?
15:47:27FromDiscord<haxscramper> no IIRC WASM does not have access to OS
15:47:31FromDiscord<gogolxdong> Does wasm count system programming language?
15:47:51Clonkk[m]No, but does a binary that tries to open file without distinction of the platform or file system it runs on is that useful ?
15:47:58FromDiscord<haxscramper> WASM is a target backend, similar to x86 or RISC or whatever
15:48:26FromDiscord<haxscramper> Kind of similar to java VM i think? I'm not an expert, but you don't write wasm by hand
15:49:04FromDiscord<haxscramper> Most of the time. Like you don't write assembly manually (most of the time, though it has it's own uses. wasm doesn't, so you just compile to it)
15:49:35Oddmongerfor wasm with nim, we have to active the dong mode, if i have understood correctly the conversation of the last day
15:49:43FromDiscord<haxscramper> In reply to @haxscramper "I get `Error: expression": Actually nevermind, it actually was a problem elsewhere with weird error that got me to belive this was the reason
15:50:39ForumUpdaterBotNew Nimble package! gsl - gsl C Api wrapped for nim, see https://github.com/YesDrX/gsl-nim/
15:50:59Clonkk[m]<Oddmonger "for wasm with nim, we have to ac"> The "dong" mode ?
15:51:51OddmongerClonkk[m]: sorry, it was a bad joke (i thought the conversation was here, but it was on the discord may be)
15:51:53FromDiscord<gogolxdong> wasm is application level language runs on vm.
15:52:31Clonkk[m]<Oddmonger "Clonkk: sorry, it was a bad joke"> I thought it was a real thing x)
15:53:01Oddmongerno no :) to sum it up, it was « llvm / wasm » vs « emscripten » discussion
15:53:12FromDiscord<gogolxdong> cosmopolitan implements build once run everywhere without vm.
15:54:34FromDiscord<haxscramper> Does it support OS operations for all targets too? LIke windows/mac/linux/BSD/etc APIs?
15:57:51*rockcavera joined #nim
16:00:03Clonkk[m]<FromDiscord "<gogolxdong> cosmopolitan implem"> I still doubt it will be such a "game changer". Cross compilation isn't that hard and having a multi-platform binary does not solve the usual multi platform issues.
16:01:08*tane joined #nim
16:02:01FromDiscord<konsumlamm> ^ again, what's so hard about cross-compilation?
16:02:17Clonkk[m]It's annoying to setup,
16:02:36Clonkk[m]But otherwise, yes I agree cross compiling is not such a big deal
16:02:59*xet7 joined #nim
16:26:02m4r35n357narimiran, sorry to bother you, but I've been trying to use PMunch's "ternary trick" and it seems to be broken - Error: attempting to call routine: 'diff'. The compiler seems to want an actual function call rather than a statement. Am I missing something?
16:26:21narimiranm4r35n357: it is probably because of the `else` part
16:26:52m4r35n357hmmm, barely following this . . . ;)
16:27:09FromDiscord<konsumlamm> what exactly are you writing?
16:27:20FromDiscord<konsumlamm> the solution is probably to just use indentation
16:27:22narimiranm4r35n357: maybe i'm referencing the wrong part of the code ;) show me what you have
16:27:49m4r35n357OK stand by . .
16:29:25m4r35n357https://pastebin.com/rf7WapDn
16:29:55FromDiscord<konsumlamm> `var e = if diff > 0.0: diff else: - diff`
16:30:04FromDiscord<konsumlamm> you can't just leave out the `else` :P
16:30:20narimiran^
16:30:37m4r35n357ah, think I still have a bit of Python in my head ;)
16:30:54narimiranm4r35n357: that's not python's ternary either ;P
16:30:58m4r35n357thx konsumlamm
16:31:08m4r35n357narimiran, just a bit of it ;)
16:31:27narimiranit is closer to nim than to python ;)
16:31:37m4r35n357possibly some of the c one as well, anyway thx I can fix now!
16:32:42*vicfred joined #nim
16:34:39m4r35n357hehe now I can roll up some loops!
16:44:57*kevin88 joined #nim
16:45:25*kevin88 quit (Client Quit)
17:08:32m4r35n357OK maybe I can't. Struggling with logical operators & expressions, is "if i mod 2 == 0" a valid test for if i is even? The section on operators in the language manual doesn't actually describe them AFAICT
17:10:06FromDiscord<Yardanico> https://nim-lang.org/docs/system.html#system-module-numbers
17:10:34FromDiscord<Yardanico> manual is not the same as stdlib documentation :)
17:12:12m4r35n357OK thanks, there are so many different bits of documentation it's a bit of a lottery whether any one of them contains useful info on a subject . . .
17:12:40FromDiscord<Yardanico> Manual is more or less a language "spec"
17:12:55FromDiscord<Yardanico> system is the main module that's always implicitly imported in all .nim files
17:14:01m4r35n357Fair enough, but I don't consider logical operators part of the _library_, they are usually considered part of the language, no?
17:14:19m4r35n357I'm a bit burned out today, got lots done though!
17:20:49*waleee-cl joined #nim
17:21:16FromDiscord<brainproxy> when you do you `spawn foo(bar)` where `bar` is a `pointer`, what does deepCopy do with the pointer?
17:21:42FromDiscord<brainproxy> it just passes to the spawned thread as a pointer or memory gets copies or...?
17:21:48FromDiscord<Yardanico> just as a pointer
17:21:52FromDiscord<brainproxy> okay good
17:22:03FromDiscord<brainproxy> (edit) "copies" => "copied"
17:56:18FromDiscord<Kiloneie> Has anyone here tried running the code from my last video?
17:58:53FromDiscord<Yardanico> not really, do you have them somewhere available to check?
17:58:55FromDiscord<Yardanico> like a github repo
17:59:39FromDiscord<Yardanico> ah I see https://play.nim-lang.org/#ix=2Prp
18:00:44FromDiscord<Kiloneie> Im so confused the file i used for the video from the same folder wont load the image, but the exe from last time does
18:02:18FromDiscord<Yardanico> works here (used a random png) https://media.discordapp.net/attachments/371759389889003532/817094615332552754/unknown.png
18:02:39FromDiscord<Yardanico> the .nim file is in the root of the project, and then there's a `img` directory with the png, works fine
18:02:58FromDiscord<Kiloneie> o,o...
18:03:12FromDiscord<Kiloneie> computer sorcery
18:03:25FromDiscord<Kiloneie> cosmic rays man
18:03:39FromDiscord<Yardanico> did you try using the code from your playground link in a new directory to be sure?
18:03:46FromDiscord<Kiloneie> yep
18:04:03FromDiscord<Kiloneie> 252 lines in vs code
18:04:16FromDiscord<Yardanico> and what's the error?
18:04:53FromDiscord<Kiloneie> https://media.discordapp.net/attachments/371759389889003532/817095267538305034/Capture.PNG
18:05:05FromDiscord<Kiloneie> imma just make a fresh folder somewhere else and retry
18:05:35FromDiscord<Yardanico> @Kiloneie well of course the error would be there
18:05:41FromDiscord<Yardanico> your CWD doesn't contain the img folder does it?
18:05:49FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/817095499051434046/unknown.png
18:05:51FromDiscord<Yardanico> this is your current working directory
18:06:27FromDiscord<Yardanico> files are loaded relatively to the cwd unless absolute path is provided
18:06:28FromDiscord<Kiloneie> ughh...
18:06:40FromDiscord<Kiloneie> smthing smthing VS code directory...
18:06:47FromDiscord<Kiloneie> i just loaded the file not the folder...
18:07:09FromDiscord<Kiloneie> imma put a big note somewhere for that xD
18:09:11FromDiscord<Yardanico> @Kiloneie if you want to always load related to the binary and not the cwd, you need to use https://nim-lang.org/docs/os.html#getAppDir
18:10:28FromDiscord<Yardanico> like in the load proc change `loadTexture(file)` to `loadTexture(getAppDir() / file)` (don't forget to import `std/os` too)
18:10:40FromDiscord<Yardanico> then no matter which directory you run the binary from, it'll load files in relation to its own directory
18:11:45FromDiscord<Kiloneie> Yeah, thanks a lot man.
18:12:40FromDiscord<Yardanico> Also when you make the next video about an stdlib module please try to use the `std` namespace prefix :) Like `import std/os` and `import std/[strutils, strscans]`. It's not a requirement and old imports aren't deprecated, it just helps if the user has a module with the same name as the stdlib one
18:12:48FromDiscord<Yardanico> and I guess it's a bit easier to understand which modules are from std
18:12:59FromDiscord<Yardanico> and also newer modules are only available in the `std` namespace
18:13:18FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/817097380473864232/unknown.png
18:15:01FromDiscord<Kiloneie> Aha, will keep that in mind
18:18:03*superbia quit (Quit: WeeChat 3.0)
18:45:44FromDiscord<reilly> I'm having a hard time working out how to add files, commit, and push to a Github repository in code. I need this to work on just one folder that exists within the same repository as the project itself.
18:46:51FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=2RGo
18:48:28FromDiscord<reilly> I've done something similar before, wherein I just called the `git` command with `execProcess()`, but that doesn't give me an obvious way of logging in.
18:48:51FromDiscord<reilly> (edit) "https://play.nim-lang.org/#ix=2RGo" => "https://play.nim-lang.org/#ix=2RGp"
19:01:21FromDiscord<konsumlamm> `git add patches`?
19:02:29FromDiscord<Solitude> @Clyybber is your ternim thing working?
19:02:50FromDiscord<reilly> In reply to @konsumlamm "`git add patches`?": The problem is logging in.
19:03:15FromDiscord<konsumlamm> i feel like there's something you're not telling us
19:03:32FromDiscord<konsumlamm> are you trying to invoke git from within a Nim program?
19:04:51*superbia joined #nim
19:05:07FromDiscord<reilly> Yeah. I said I was trying to do this "in code" but I guess that's a little easy to miss.
19:07:11FromDiscord<reilly> I'm trying an alternative to my end goal that'll be more work, but might be better in the end.
19:07:17*acidx left #nim (#nim)
19:07:18FromDiscord<Yardanico> @reilly you can provide user and password via the URL itself
19:07:29FromDiscord<Yardanico> although it requires a token instead of a password
19:07:39FromDiscord<Yardanico> you can also make your own handler for authorization
19:07:44FromDiscord<Yardanico> check https://stackoverflow.com/questions/44784828/gitpython-git-authentication-using-user-and-password for Python
19:07:48FromDiscord<Yardanico> the same principles apply for Nim
19:07:52FromDiscord<Yardanico> e.g. the second answer
19:10:40FromDiscord<konsumlamm> or you enable ssh, then you don't need to enter any password in the first place
19:11:49FromDiscord<Yardanico> yep
19:11:56FromDiscord<Yardanico> I always use ssh for github
19:12:11FromDiscord<Yardanico> because with github 2fa you need to generate a personal token for https pushes
19:26:11*lritter joined #nim
19:27:09ForumUpdaterBotNew thread by Mantielero: Template - Error: in expression 'p.some(n)': identifier expected, but found 'some(n)', see https://forum.nim-lang.org/t/7580
19:48:50FromDiscord<Yardanico> yeah seems like asynchttpserver example with cosmopolitan won't easily work on windows
19:49:28FromDiscord<Yardanico> cosmopolitan on windows doesn't support F_SETFL
19:49:33FromDiscord<Yardanico> for fcntl
19:50:12FromDiscord<Yardanico> (F_SETFL is used in `setBlocking`)
19:59:46*haxscram` quit (Remote host closed the connection)
20:02:28*asdflkj joined #nim
20:13:38FromDiscord<dom96> how come it's not supported by cosmopolitan?
20:14:44FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=2RH5
20:15:30FromDiscord<Yardanico> @dom96 don't ask me :P you can of course use win32 APIs when on windows, but this will require dirty changes for stdlib, not just defines
20:15:42FromDiscord<Yardanico> @reilly https://forum.nim-lang.org/t/7551
20:16:15FromDiscord<Yardanico> just as I said, cosmopolitan isn't perfect and not a silver bullet
20:16:31FromDiscord<Yardanico> https://github.com/jart/cosmopolitan/blob/master/libc/calls/fcntl-nt.c#L37
20:21:18*narimiran quit (Ping timeout: 245 seconds)
20:26:52*rockcavera quit (Read error: Connection reset by peer)
20:27:20*rockcavera joined #nim
20:29:11*xet7 quit (Remote host closed the connection)
20:54:43*JustASlacker quit (Ping timeout: 265 seconds)
21:08:29*JustASlacker joined #nim
21:11:06FromDiscord<treeform> In reply to @reilly "Never seen this error": Its a new nim thing, take a look at https://forum.nim-lang.org/t/7581#48091
21:11:24ForumUpdaterBotNew thread by Treeform: Show Nim: Puppy - Easy HTTP(S) requests without DLLs, --d:ssl or cacerts.pem., see https://forum.nim-lang.org/t/7581
21:14:10*JustASlacker quit (Ping timeout: 276 seconds)
21:19:08FromDiscord<Kiloneie> Can i make a new thread in the nim lang subredit for every video or should i update the series threads? Does posting a reply or... Refresh it back to the top or smthing...?
21:22:18Clonkk[m]I don't think anybody is stopping from making reddit thread
21:23:02PrestigeMake new posts imo
21:23:06FromDiscord<Kiloneie> I got more views from sharing the video other than here, forum and youtube
21:23:20FromDiscord<ElegantBeef> Yea making new posts is smarter
21:23:34FromDiscord<ElegantBeef> Looks at this month with nim forum post
21:23:43FromDiscord<Kiloneie> Aka thread under nim lang right?
21:23:58FromDiscord<Kiloneie> Wait, you mean forum too?
21:24:08FromDiscord<Kiloneie> I saw the confusion yes
21:24:26FromDiscord<ElegantBeef> I mean if you have something new make a new post
21:25:04FromDiscord<Kiloneie> I guess yeh
21:25:32FromDiscord<Kiloneie> Im hoping for 2 videos till monday, but idk maybe just 1
21:25:43FromDiscord<Kiloneie> These are much harder xD
21:25:57FromDiscord<Kiloneie> Gotta make some nim for beginners aswell
21:26:02FromDiscord<Kiloneie> Gotta finish that
21:26:34FromDiscord<treeform> In reply to @Kiloneie "Can i make a": I vote thread per video.
21:27:00FromDiscord<Kiloneie> okay xD, i think it does make people more compelled to check the thread
21:27:38FromDiscord<ElegantBeef> Well on reddit it wouldnt be overly visible that there was new content
21:27:48FromDiscord<ElegantBeef> Unless it was a pinned post
22:10:49FromDiscord<mratsim> My minimal API / spec proposal for threadpools and channels is out: https://github.com/nim-lang/RFCs/issues/347
22:20:10*xet7 joined #nim
22:28:16*tane quit (Quit: Leaving)
22:31:12FromDiscord<Clyybber> In reply to @Solitude "<@!107882072974065664> is your ternim": yeh
22:31:18*Gustavo6046 quit (Remote host closed the connection)
22:31:23FromDiscord<Clyybber> it should at least :p
22:31:33*Gustavo6046 joined #nim
22:32:35FromDiscord<Solitude> In reply to @Clyybber "yeh": yeah, i already wrote the thing i needed wit h it
22:32:46FromDiscord<Clyybber> oh nice
22:42:20*theelous3 joined #nim
22:45:07*quantimnot joined #nim
22:48:37*superbia quit (Quit: WeeChat 3.0)
23:01:56FromDiscord<Yardanico> https://news.ycombinator.com/item?id=26347867
23:02:17FromDiscord<Yardanico> https://github.com/git/git/blob/master/banned.h
23:12:28FromGitter<redblack3_gitlab> Hi guys. Is there a trick to make this work? Was curious if it was possible to implement a "spread" operator. I know there is an `unpackVarargs`, but that seems less elegant: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=6041695ca3a2f04f1fd40c9b]
23:18:28*Vladar quit (Quit: Leaving)
23:26:24FromDiscord<ElegantBeef> You cannot generate the AST you want with that
23:26:40FromDiscord<ElegantBeef> You need to return 3 bracketExprs to do that
23:27:11FromDiscord<ElegantBeef> Actually
23:28:00FromDiscord<ElegantBeef> Nope i cannot figure out a way to resolve this short of changing the syntax around
23:31:11FromDiscord<ElegantBeef> redblack3 here is my version https://play.nim-lang.org/#ix=2RIB
23:35:35FromGitter<redblack3_gitlab> Ah that syntax looks pretty elegant. Going to use it for my linear algebra stuff. Thanks!
23:37:46FromDiscord<ElegantBeef> No problem
23:48:10*Jesin quit (Quit: Leaving)