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:32 | FromDiscord | <MapleSyrup|TagMeIfReply> hello, can someone explain how I can push a nim library to nimble |
01:36:41 | FromDiscord | <MapleSyrup|TagMeIfReply> been looking around for guides but found none |
01:38:37 | FromDiscord | <ElegantBeef> https://github.com/nim-lang/packages/ |
01:38:48 | FromDiscord | <ElegantBeef> More accurately https://github.com/nim-lang/packages/#adding-your-own-package |
01:39:55 | FromDiscord | <exelotl> You fork the Nimble repo and edit the JSON file to include an entry for your library |
01:40:53 | FromDiscord | <MapleSyrup|TagMeIfReply> thanks, first time encountering a package.json for an entire language on github! |
01:41:42 | FromDiscord | <MapleSyrup|TagMeIfReply> there's no mention ofhow to construct the .nimble file? |
01:42:54 | FromDiscord | <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:04 | FromDiscord | <exelotl> (edit) "Hehe↵About the forking and PRing iirc Nimble has a builtin 'publish' ... that" added "command" |
01:45:22 | FromDiscord | <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:43 | FromDiscord | <MapleSyrup|TagMeIfReply> hmm interesting |
02:03:26 | * | def- quit (Ping timeout: 256 seconds) |
02:04:39 | FromDiscord | <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:22 | FromDiscord | <MapleSyrup|TagMeIfReply> what's the meta nim gui library now |
03:25:32 | FromDiscord | <MapleSyrup|TagMeIfReply> cross-platform preferably |
03:30:53 | FromDiscord | <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:03 | FromDiscord | <MapleSyrup|TagMeIfReply> by pure does that mean written in nim mostly |
04:02:18 | FromDiscord | <ElegantBeef> Yes |
04:15:21 | FromDiscord | <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:57 | ForumUpdaterBot | New 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:18 | FromDiscord | <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:33 | FromDiscord | <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:49 | FromDiscord | <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:27 | FromDiscord | <haxscramper> I prefer to use `Option[T]` for functions that are expected to fail often, otherwise use exceptions |
08:54:35 | FromDiscord | <haxscramper> Different opinion is style guide from status: https://status-im.github.io/nim-style-guide/04_errors.html |
08:54:59 | FromDiscord | <Unaimend> In reply to @haxscramper "Different opinion is style": Thanks for the pointer |
08:55:41 | FromDiscord | <haxscramper> sent a code paste, see https://paste.rs/8WI |
08:55:51 | FromDiscord | <haxscramper> But I'm not sure about pattern matching stuff |
08:55:53 | FromDiscord | <Unaimend> In reply to @haxscramper "I prefer to use": So for example for wrong user input I should use exceptions? |
08:56:08 | FromDiscord | <haxscramper> I'd say yes |
08:56:19 | FromDiscord | <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:38 | Clonkk[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:45 | FromDiscord | <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:29 | FromDiscord | <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:37 | FromDiscord | <VinKer> Hi, how do i get the file name in nim ? |
09:35:38 | * | Vladar joined #nim |
09:36:14 | FromDiscord | <VinKer> I mean the nim file which is currently executing |
09:36:52 | FromDiscord | <Solitude> https://nim-lang.org/docs/system.html#currentSourcePath.t |
09:40:26 | FromDiscord | <VinKer> @dont swear Thanks but i need the file name. docs says that i can get the dfirectory. |
09:41:26 | ForumUpdaterBot | New thread by HJarausch: Array, seq : is there something in between? , see https://forum.nim-lang.org/t/7579 |
09:45:52 | FromDiscord | <Rika> @VinKer it inclides the file name. |
09:48:00 | FromDiscord | <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:57 | SebastianM | Hey, Guys does Nim have any support for **kwargs as in Python? I only found varargs... Thank you |
10:05:54 | FromDiscord | <VinKer> What i am asking is, in vb.net, we can use GetFileNameFromPath(path). Is there a similar function in nim > |
10:10:42 | Oddmonger | am i alone to use gitnim , for nim installation ? It seems stuck in 1.4.3 |
10:10:53 | FromDiscord | <haxscramper> In reply to @VinKer "What i am asking": https://nim-lang.org/docs/os.html#splitFile%2Cstring ? |
10:11:10 | FromDiscord | <haxscramper> Oddmonger: gitnim can be considered unmaintained now |
10:11:54 | FromDiscord | <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:54 | FromDiscord | <haxscramper> Though I used it for some time, and it is not complicated internally |
10:12:25 | Oddmonger | well i will switch then… |
10:12:45 | FromDiscord | <haxscramper> SebastianM: you can implement your code as a `macro` with `varargs[untyped]` arguments, this way you could write name-value pairs |
10:14:07 | FromDiscord | <VinKer> @haxscramper Thanks |
10:14:15 | Oddmonger | btw (i was looking arch packages for nim), i see i'm using community/package (from arch packages then) |
10:14:38 | FromDiscord | <VinKer> How can i convert int value to an enum ? |
10:14:41 | FromDiscord | <haxscramper> Oddmonger: I'd recommend to use `choosenim` |
10:14:53 | FromDiscord | <haxscramper> In reply to @VinKer "How can i convert": `let intVal = EnumName(123)` |
10:15:11 | FromDiscord | <VinKer> @haxscramper Thanks, let me try |
10:15:22 | FromDiscord | <haxscramper> If `123` does not correspond to any enum value it will be a compile-time error, otherwise it should work fine |
10:15:31 | Oddmonger | hum, i mean « i am using community/nimble » |
10:15:40 | Oddmonger | is it ok to use nimble with the arch package ? |
10:16:22 | FromDiscord | <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:39 | Oddmonger | héhé ok |
10:16:44 | SebastianM | mratsim, haxscramper, Thank you guys for this information. Gonna explore that |
10:16:52 | FromDiscord | <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:57 | FromDiscord | <VinKer> @haxscramper Yeah, i know that. and it worked. |
10:17:36 | SebastianM | haxscramper, Thanks for explanation |
10:17:43 | FromDiscord | <haxscramper> in addition to `varargs[untyped]`. And macro can just convert `kwargsCall(key = value)` into `kwargsCall({"key": value})` |
10:19:22 | FromDiscord | <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:36 | SebastianM | @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:56 | FromDiscord | <Unaimend> do we have default parameter for generics i.e.` proc add[T = int](a: T, b: T): T` |
10:38:58 | FromDiscord | <Rika> no, that doesnt really make sense |
10:39:17 | * | haxscram` joined #nim |
10:40:05 | m4r35n357 | PMunch, 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:21 | narimiran | m4r35n357: woohoo!! |
10:40:35 | * | haxscramper quit (Ping timeout: 240 seconds) |
10:41:27 | FromDiscord | <Unaimend> In reply to @Rika "no, that doesnt really": why not? |
10:41:37 | m4r35n357 | narimiran, yep ;) |
10:42:12 | PMunch | Oh cool! Didn't even know what you where trying to do :P |
10:43:19 | FromDiscord | <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:36 | FromDiscord | <Rika> how does it work on C++? |
10:45:10 | PMunch | Yeah what are you trying to do with that? |
10:46:45 | narimiran | PMunch: he tried to make his POC hamiltonian central force code to work, obviously |
10:46:48 | m4r35n357 | PMunch, 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:08 | FromDiscord | <haxscramper> @Unaimend https://github.com/nim-lang/RFCs/issues/85 |
10:47:25 | narimiran | PMunch: ...to the point of plotting valid data, i might add |
10:47:52 | narimiran | PMunch: that was done so he can now relax & tackle this piece by piece at leisure |
10:47:56 | FromDiscord | <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:17 | m4r35n357 | I 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:32 | FromDiscord | <haxscramper> But generally you need to specify all generic parameters when instantiating generics |
10:48:57 | FromDiscord | <Unaimend> In reply to @PMunch "Yeah what are you": sent a code paste, see https://paste.rs/r19 |
10:50:26 | FromDiscord | <Unaimend> In reply to @PMunch "Yeah what are you": sent a code paste, see https://play.nim-lang.org/#ix=2RDQ |
10:50:32 | FromDiscord | <Unaimend> (edit) |
10:50:44 | FromDiscord | <mratsim> Tree[void] |
10:50:48 | FromDiscord | <mratsim> or auto |
10:53:00 | FromDiscord | <Unaimend> In reply to @mratsim "Tree[void]": sent a code paste, see https://play.nim-lang.org/#ix=2RDS |
10:53:16 | FromDiscord | <Unaimend> (edit) "https://play.nim-lang.org/#ix=2RDS" => "https://paste.rs/5T5" |
10:53:24 | FromDiscord | <Unaimend> (edit) |
10:53:34 | FromDiscord | <mratsim> are those the error thrown? |
10:53:36 | FromDiscord | <Unaimend> (edit) "https://play.nim-lang.org/#ix=2RDT" => "https://play.nim-lang.org/#ix=2RDU" |
10:53:47 | FromDiscord | <mratsim> (edit) "error" => "errors" |
10:54:21 | FromDiscord | <Rika> stringstream doesnt take a generic |
10:54:22 | FromDiscord | <Unaimend> In reply to @mratsim "are those the errors": sry for bad formatting |
10:54:56 | FromDiscord | <Unaimend> (edit) "https://play.nim-lang.org/#ix=2RDU" => "https://play.nim-lang.org/#ix=2RDW" |
10:55:29 | FromDiscord | <Unaimend> In reply to @mratsim "Tree[void]": This works, now thx. I think generics sometimes weird error locations |
10:55:44 | FromDiscord | <Unaimend> In reply to @haxscramper "<@!287576619718279178> https://github.com/nim-lang/": Thx |
10:56:32 | PMunch | narimiran, thanks for the explanation <_< :P |
10:56:39 | narimiran | PMunch: any time :) |
11:56:35 | PMunch | Hmm, so jester has a cross-talk bug? |
11:56:52 | PMunch | Or rather HttpBeast or some other underlying part |
11:57:45 | JustASlacker | why does everbody love kubernets |
11:57:59 | JustASlacker | its just no fun running a cluster onpremise |
11:58:03 | JustASlacker | and im in the wrong channel |
11:58:18 | FromDiscord | <Rika> pmunch: i heard that even asynchttpserver has the same issue but i dont know too much |
12:00:00 | PMunch | Yeah reading the issue report and PR makes it seem like the bug might be somewhere else |
12:01:29 | PMunch | I 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:08 | FromDiscord | <Rika> i bet its in asyncdispatch 😛 |
12:10:20 | FromDiscord | <Rika> oh wait might be in asyncnet idk |
12:21:34 | m4r35n357 | OK 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:39 | m4r35n357 | if so, https://pastebin.com/Pmch5Mzr |
12:31:51 | narimiran | m4r35n357: even your link spells PMunch! wow! |
12:32:44 | PMunch | Haha, nice :P |
12:32:53 | PMunch | By the way, Nim floats are always float64 |
12:33:21 | m4r35n357 | I am the hash king ;) |
12:33:46 | m4r35n357 | now do one that spells maresnest ;) |
12:35:28 | narimiran | m4r35n357: 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:44 | m4r35n357 | nam |
12:35:46 | m4r35n357 | ri |
12:35:56 | narimiran | oooh, anagram incoming! |
12:36:01 | m4r35n357 | narimiran, oops, cheers for that |
12:36:33 | narimiran | we already had Iraq here last week. and now i'm 'Nam |
12:36:34 | m4r35n357 | think I hit enter instead of tab, twice |
12:37:02 | PMunch | For your integrator you can assign directly from a case |
12:37:15 | PMunch | So `var integrator = case order [...]` |
12:37:42 | m4r35n357 | PMunch, ooh, interesting |
12:37:46 | PMunch | https://peterme.net/tips-and-tricks-with-implicit-return-in-nim.html |
12:38:17 | narimiran | m4r35n357, PMunch: and what about the else case? currently it'll just print and continue/fail |
12:39:00 | m4r35n357 | narimiran, yes, I should bail, it is on the list . . . ;) |
12:39:10 | PMunch | Well it will continue as it is now and then immediately crash when it tries to call the integrator |
12:39:19 | PMunch | So you could just as well throw an exception there |
12:39:50 | m4r35n357 | PMunch, OK exceptions next |
12:40:10 | FromDiscord | <Rika> ngl i keep on misshortening your name as nami |
12:49:06 | narimiran | no 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:40 | FromDiscord | <arnetheduck> those running into inexplicable GC crashes might be interested in https://github.com/status-im/Nim/commit/f05ba3c667157f46f141ff700121c7aff86cf07a |
13:49:14 | PMunch | Oh damn, that bug must've been a massive pain to find |
14:01:10 | * | rockcavera quit (Remote host closed the connection) |
14:02:51 | PMunch | Hmm, 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:07 | PMunch | And how can I get the possibly repeated headers? |
14:05:45 | PMunch | Man, I love that this works: `let mime = try: request.headers["accept"] except: resp Http400` |
14:07:39 | * | xet7 quit (Quit: Leaving) |
14:16:55 | FromDiscord | <arnetheduck> yeah, it's been haunting us for months and costing quite a bit of pulled-out hair |
14:17:11 | PMunch | I'd imagine! |
14:17:56 | PMunch | How did you even manage to find that? You must've been looking at a decompiled version or something to spot that optimisation |
14:18:25 | FromDiscord | <Zachary Carter> sent a code paste, see https://play.nim-lang.org/#ix=2REX |
14:18:30 | FromDiscord | <Zachary Carter> when compiling with the cpp backend |
14:21:14 | FromDiscord | <arnetheduck> https://rr-project.org/ - reverse debugging basically, the issue was only barely reproducible under certain hardware and network conditions |
14:24:22 | FromDiscord | <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:01 | FromDiscord | <arnetheduck> https://github.com/nim-lang/Nim/pull/16761/ is interesting also for working with this |
14:26:09 | FromDiscord | <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:46 | PMunch | @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:53 | PMunch | @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:01 | PMunch | But it works surprisingly well! |
14:31:12 | FromDiscord | <mratsim> until it doesn't and then it becomes ugly |
14:32:33 | PMunch | That'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:45 | m4r35n357 | quick question: is there a ternary operator? can't find one . . . |
15:29:43 | PMunch | m4r35n357, I mention it in the article I shared earlier |
15:29:52 | PMunch | Basically you just use a normal if with implicit return |
15:30:01 | PMunch | var x = if y > 100: 200 else: 300 |
15:30:02 | FromDiscord | <gogolxdong> What impact will be brought by https://justine.lol/cosmopolitan/index.html? |
15:30:29 | PMunch | Why is everyone suddenly obsessed with Cosmopolitan? |
15:30:43 | PMunch | I mean it is pretty neat, but also super hacky |
15:30:44 | m4r35n357 | PMunch, thx, will read now (been busy making lots of things work!) |
15:31:11 | m4r35n357 | and lunch ;) |
15:31:13 | PMunch | No worries .) |
15:31:28 | FromDiscord | <gogolxdong> I see potential of changing a lot of things. |
15:35:32 | * | PMunch quit (Quit: leaving) |
15:36:20 | FromDiscord | <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:24 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2RFt |
15:38:34 | FromDiscord | <gogolxdong> cross-platform ends. |
15:38:46 | Clonkk[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:10 | FromDiscord | <haxscramper> There are multiple modules involved and everything is complicated to minimize, so if anyone got any ideas I would much appreciate |
15:40:09 | FromDiscord | <gogolxdong> Nim doesn't target WASM. |
15:40:15 | FromDiscord | <haxscramper> Callback I'm trying to evaluate has `proc (a: HLValue){.closure.}` |
15:40:21 | FromDiscord | <gogolxdong> (edit) "WASM." => "wasm." |
15:40:23 | FromDiscord | <haxscramper> In reply to @gogolxdong "Nim doesn't target wasm.": You can compile to it just fine |
15:40:34 | FromDiscord | <haxscramper> You can even compile part of nim compiler to run on wasm for example |
15:41:25 | FromDiscord | <Solitude> In reply to @haxscramper "Callback I'm trying to": and if you annotate parameter with {.closure.}? |
15:42:09 | Clonkk[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:18 | Clonkk[m] | > <@freenode_FromDiscord:matrix.org> <gogolxdong> Nim doesn't target WASM. |
15:42:18 | Clonkk[m] | * You can compile for wasm. Also, a wasm backend would make much more sense than a cosmopolitan one |
15:44:58 | FromDiscord | <gogolxdong> can wasm handle file or memory operating? |
15:47:27 | FromDiscord | <haxscramper> no IIRC WASM does not have access to OS |
15:47:31 | FromDiscord | <gogolxdong> Does wasm count system programming language? |
15:47:51 | Clonkk[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:58 | FromDiscord | <haxscramper> WASM is a target backend, similar to x86 or RISC or whatever |
15:48:26 | FromDiscord | <haxscramper> Kind of similar to java VM i think? I'm not an expert, but you don't write wasm by hand |
15:49:04 | FromDiscord | <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:35 | Oddmonger | for wasm with nim, we have to active the dong mode, if i have understood correctly the conversation of the last day |
15:49:43 | FromDiscord | <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:39 | ForumUpdaterBot | New Nimble package! gsl - gsl C Api wrapped for nim, see https://github.com/YesDrX/gsl-nim/ |
15:50:59 | Clonkk[m] | <Oddmonger "for wasm with nim, we have to ac"> The "dong" mode ? |
15:51:51 | Oddmonger | Clonkk[m]: sorry, it was a bad joke (i thought the conversation was here, but it was on the discord may be) |
15:51:53 | FromDiscord | <gogolxdong> wasm is application level language runs on vm. |
15:52:31 | Clonkk[m] | <Oddmonger "Clonkk: sorry, it was a bad joke"> I thought it was a real thing x) |
15:53:01 | Oddmonger | no no :) to sum it up, it was « llvm / wasm » vs « emscripten » discussion |
15:53:12 | FromDiscord | <gogolxdong> cosmopolitan implements build once run everywhere without vm. |
15:54:34 | FromDiscord | <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:03 | Clonkk[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:01 | FromDiscord | <konsumlamm> ^ again, what's so hard about cross-compilation? |
16:02:17 | Clonkk[m] | It's annoying to setup, |
16:02:36 | Clonkk[m] | But otherwise, yes I agree cross compiling is not such a big deal |
16:02:59 | * | xet7 joined #nim |
16:26:02 | m4r35n357 | narimiran, 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:21 | narimiran | m4r35n357: it is probably because of the `else` part |
16:26:52 | m4r35n357 | hmmm, barely following this . . . ;) |
16:27:09 | FromDiscord | <konsumlamm> what exactly are you writing? |
16:27:20 | FromDiscord | <konsumlamm> the solution is probably to just use indentation |
16:27:22 | narimiran | m4r35n357: maybe i'm referencing the wrong part of the code ;) show me what you have |
16:27:49 | m4r35n357 | OK stand by . . |
16:29:25 | m4r35n357 | https://pastebin.com/rf7WapDn |
16:29:55 | FromDiscord | <konsumlamm> `var e = if diff > 0.0: diff else: - diff` |
16:30:04 | FromDiscord | <konsumlamm> you can't just leave out the `else` :P |
16:30:20 | narimiran | ^ |
16:30:37 | m4r35n357 | ah, think I still have a bit of Python in my head ;) |
16:30:54 | narimiran | m4r35n357: that's not python's ternary either ;P |
16:30:58 | m4r35n357 | thx konsumlamm |
16:31:08 | m4r35n357 | narimiran, just a bit of it ;) |
16:31:27 | narimiran | it is closer to nim than to python ;) |
16:31:37 | m4r35n357 | possibly some of the c one as well, anyway thx I can fix now! |
16:32:42 | * | vicfred joined #nim |
16:34:39 | m4r35n357 | hehe now I can roll up some loops! |
16:44:57 | * | kevin88 joined #nim |
16:45:25 | * | kevin88 quit (Client Quit) |
17:08:32 | m4r35n357 | OK 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:06 | FromDiscord | <Yardanico> https://nim-lang.org/docs/system.html#system-module-numbers |
17:10:34 | FromDiscord | <Yardanico> manual is not the same as stdlib documentation :) |
17:12:12 | m4r35n357 | OK 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:40 | FromDiscord | <Yardanico> Manual is more or less a language "spec" |
17:12:55 | FromDiscord | <Yardanico> system is the main module that's always implicitly imported in all .nim files |
17:14:01 | m4r35n357 | Fair enough, but I don't consider logical operators part of the _library_, they are usually considered part of the language, no? |
17:14:19 | m4r35n357 | I'm a bit burned out today, got lots done though! |
17:20:49 | * | waleee-cl joined #nim |
17:21:16 | FromDiscord | <brainproxy> when you do you `spawn foo(bar)` where `bar` is a `pointer`, what does deepCopy do with the pointer? |
17:21:42 | FromDiscord | <brainproxy> it just passes to the spawned thread as a pointer or memory gets copies or...? |
17:21:48 | FromDiscord | <Yardanico> just as a pointer |
17:21:52 | FromDiscord | <brainproxy> okay good |
17:22:03 | FromDiscord | <brainproxy> (edit) "copies" => "copied" |
17:56:18 | FromDiscord | <Kiloneie> Has anyone here tried running the code from my last video? |
17:58:53 | FromDiscord | <Yardanico> not really, do you have them somewhere available to check? |
17:58:55 | FromDiscord | <Yardanico> like a github repo |
17:59:39 | FromDiscord | <Yardanico> ah I see https://play.nim-lang.org/#ix=2Prp |
18:00:44 | FromDiscord | <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:18 | FromDiscord | <Yardanico> works here (used a random png) https://media.discordapp.net/attachments/371759389889003532/817094615332552754/unknown.png |
18:02:39 | FromDiscord | <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:58 | FromDiscord | <Kiloneie> o,o... |
18:03:12 | FromDiscord | <Kiloneie> computer sorcery |
18:03:25 | FromDiscord | <Kiloneie> cosmic rays man |
18:03:39 | FromDiscord | <Yardanico> did you try using the code from your playground link in a new directory to be sure? |
18:03:46 | FromDiscord | <Kiloneie> yep |
18:04:03 | FromDiscord | <Kiloneie> 252 lines in vs code |
18:04:16 | FromDiscord | <Yardanico> and what's the error? |
18:04:53 | FromDiscord | <Kiloneie> https://media.discordapp.net/attachments/371759389889003532/817095267538305034/Capture.PNG |
18:05:05 | FromDiscord | <Kiloneie> imma just make a fresh folder somewhere else and retry |
18:05:35 | FromDiscord | <Yardanico> @Kiloneie well of course the error would be there |
18:05:41 | FromDiscord | <Yardanico> your CWD doesn't contain the img folder does it? |
18:05:49 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/817095499051434046/unknown.png |
18:05:51 | FromDiscord | <Yardanico> this is your current working directory |
18:06:27 | FromDiscord | <Yardanico> files are loaded relatively to the cwd unless absolute path is provided |
18:06:28 | FromDiscord | <Kiloneie> ughh... |
18:06:40 | FromDiscord | <Kiloneie> smthing smthing VS code directory... |
18:06:47 | FromDiscord | <Kiloneie> i just loaded the file not the folder... |
18:07:09 | FromDiscord | <Kiloneie> imma put a big note somewhere for that xD |
18:09:11 | FromDiscord | <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:28 | FromDiscord | <Yardanico> like in the load proc change `loadTexture(file)` to `loadTexture(getAppDir() / file)` (don't forget to import `std/os` too) |
18:10:40 | FromDiscord | <Yardanico> then no matter which directory you run the binary from, it'll load files in relation to its own directory |
18:11:45 | FromDiscord | <Kiloneie> Yeah, thanks a lot man. |
18:12:40 | FromDiscord | <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:48 | FromDiscord | <Yardanico> and I guess it's a bit easier to understand which modules are from std |
18:12:59 | FromDiscord | <Yardanico> and also newer modules are only available in the `std` namespace |
18:13:18 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/817097380473864232/unknown.png |
18:15:01 | FromDiscord | <Kiloneie> Aha, will keep that in mind |
18:18:03 | * | superbia quit (Quit: WeeChat 3.0) |
18:45:44 | FromDiscord | <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:51 | FromDiscord | <reilly> sent a code paste, see https://play.nim-lang.org/#ix=2RGo |
18:48:28 | FromDiscord | <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:51 | FromDiscord | <reilly> (edit) "https://play.nim-lang.org/#ix=2RGo" => "https://play.nim-lang.org/#ix=2RGp" |
19:01:21 | FromDiscord | <konsumlamm> `git add patches`? |
19:02:29 | FromDiscord | <Solitude> @Clyybber is your ternim thing working? |
19:02:50 | FromDiscord | <reilly> In reply to @konsumlamm "`git add patches`?": The problem is logging in. |
19:03:15 | FromDiscord | <konsumlamm> i feel like there's something you're not telling us |
19:03:32 | FromDiscord | <konsumlamm> are you trying to invoke git from within a Nim program? |
19:04:51 | * | superbia joined #nim |
19:05:07 | FromDiscord | <reilly> Yeah. I said I was trying to do this "in code" but I guess that's a little easy to miss. |
19:07:11 | FromDiscord | <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:18 | FromDiscord | <Yardanico> @reilly you can provide user and password via the URL itself |
19:07:29 | FromDiscord | <Yardanico> although it requires a token instead of a password |
19:07:39 | FromDiscord | <Yardanico> you can also make your own handler for authorization |
19:07:44 | FromDiscord | <Yardanico> check https://stackoverflow.com/questions/44784828/gitpython-git-authentication-using-user-and-password for Python |
19:07:48 | FromDiscord | <Yardanico> the same principles apply for Nim |
19:07:52 | FromDiscord | <Yardanico> e.g. the second answer |
19:10:40 | FromDiscord | <konsumlamm> or you enable ssh, then you don't need to enter any password in the first place |
19:11:49 | FromDiscord | <Yardanico> yep |
19:11:56 | FromDiscord | <Yardanico> I always use ssh for github |
19:12:11 | FromDiscord | <Yardanico> because with github 2fa you need to generate a personal token for https pushes |
19:26:11 | * | lritter joined #nim |
19:27:09 | ForumUpdaterBot | New 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:50 | FromDiscord | <Yardanico> yeah seems like asynchttpserver example with cosmopolitan won't easily work on windows |
19:49:28 | FromDiscord | <Yardanico> cosmopolitan on windows doesn't support F_SETFL |
19:49:33 | FromDiscord | <Yardanico> for fcntl |
19:50:12 | FromDiscord | <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:38 | FromDiscord | <dom96> how come it's not supported by cosmopolitan? |
20:14:44 | FromDiscord | <reilly> sent a code paste, see https://play.nim-lang.org/#ix=2RH5 |
20:15:30 | FromDiscord | <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:42 | FromDiscord | <Yardanico> @reilly https://forum.nim-lang.org/t/7551 |
20:16:15 | FromDiscord | <Yardanico> just as I said, cosmopolitan isn't perfect and not a silver bullet |
20:16:31 | FromDiscord | <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:06 | FromDiscord | <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:24 | ForumUpdaterBot | New 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:08 | FromDiscord | <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:18 | Clonkk[m] | I don't think anybody is stopping from making reddit thread |
21:23:02 | Prestige | Make new posts imo |
21:23:06 | FromDiscord | <Kiloneie> I got more views from sharing the video other than here, forum and youtube |
21:23:20 | FromDiscord | <ElegantBeef> Yea making new posts is smarter |
21:23:34 | FromDiscord | <ElegantBeef> Looks at this month with nim forum post |
21:23:43 | FromDiscord | <Kiloneie> Aka thread under nim lang right? |
21:23:58 | FromDiscord | <Kiloneie> Wait, you mean forum too? |
21:24:08 | FromDiscord | <Kiloneie> I saw the confusion yes |
21:24:26 | FromDiscord | <ElegantBeef> I mean if you have something new make a new post |
21:25:04 | FromDiscord | <Kiloneie> I guess yeh |
21:25:32 | FromDiscord | <Kiloneie> Im hoping for 2 videos till monday, but idk maybe just 1 |
21:25:43 | FromDiscord | <Kiloneie> These are much harder xD |
21:25:57 | FromDiscord | <Kiloneie> Gotta make some nim for beginners aswell |
21:26:02 | FromDiscord | <Kiloneie> Gotta finish that |
21:26:34 | FromDiscord | <treeform> In reply to @Kiloneie "Can i make a": I vote thread per video. |
21:27:00 | FromDiscord | <Kiloneie> okay xD, i think it does make people more compelled to check the thread |
21:27:38 | FromDiscord | <ElegantBeef> Well on reddit it wouldnt be overly visible that there was new content |
21:27:48 | FromDiscord | <ElegantBeef> Unless it was a pinned post |
22:10:49 | FromDiscord | <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:12 | FromDiscord | <Clyybber> In reply to @Solitude "<@!107882072974065664> is your ternim": yeh |
22:31:18 | * | Gustavo6046 quit (Remote host closed the connection) |
22:31:23 | FromDiscord | <Clyybber> it should at least :p |
22:31:33 | * | Gustavo6046 joined #nim |
22:32:35 | FromDiscord | <Solitude> In reply to @Clyybber "yeh": yeah, i already wrote the thing i needed wit h it |
22:32:46 | FromDiscord | <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:56 | FromDiscord | <Yardanico> https://news.ycombinator.com/item?id=26347867 |
23:02:17 | FromDiscord | <Yardanico> https://github.com/git/git/blob/master/banned.h |
23:12:28 | FromGitter | <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:24 | FromDiscord | <ElegantBeef> You cannot generate the AST you want with that |
23:26:40 | FromDiscord | <ElegantBeef> You need to return 3 bracketExprs to do that |
23:27:11 | FromDiscord | <ElegantBeef> Actually |
23:28:00 | FromDiscord | <ElegantBeef> Nope i cannot figure out a way to resolve this short of changing the syntax around |
23:31:11 | FromDiscord | <ElegantBeef> redblack3 here is my version https://play.nim-lang.org/#ix=2RIB |
23:35:35 | FromGitter | <redblack3_gitlab> Ah that syntax looks pretty elegant. Going to use it for my linear algebra stuff. Thanks! |
23:37:46 | FromDiscord | <ElegantBeef> No problem |
23:48:10 | * | Jesin quit (Quit: Leaving) |