00:06:19 | FromGitter | <gogolxdong> Is nimble splitted from release build? How to install nimble corresponding to 1.2.4? |
00:07:40 | FromGitter | <gogolxdong> Does jester@#head work with devel lastest? `/root/Nim/lib/system.nim(207, 11) Error: undeclared identifier: 'is'` |
00:10:12 | Yardanico | that's a problem with your nim installation |
00:11:06 | * | fredrikhr quit (Ping timeout: 256 seconds) |
00:12:55 | FromGitter | <gogolxdong> build_all with latest devel ,Jester doesn't compile, then I downloaded 1.2.4 release tar archive , switched to 1.2.4, nimble doesn't match. |
00:13:08 | FromDiscord | <Varriount> Oh hey @reilly |
00:13:24 | FromDiscord | <reilly> Don't worry, I eventually got it :7 |
00:13:44 | FromGitter | <gogolxdong> unable to nimble install jester |
00:13:54 | FromDiscord | <Varriount> reilly: Welcome to the 20 years of enterprise API design that is Windows . |
00:14:29 | FromDiscord | <Varriount> It's like open source, but with committees, meetings, and managers. Oh, and _marketing_. |
00:14:56 | * | endragor joined #nim |
00:15:57 | FromDiscord | <reilly> Oh how I long for a simple `SendInput(LEFTMOUSE_DOWN)`... |
00:16:46 | FromDiscord | <reilly> sent a code paste, see https://play.nim-lang.org/#ix=1Yy7 |
00:17:13 | FromDiscord | <reilly> (edit) '`SendInput(LEFTMOUSE_DOWN)`...' => '`SendInput(LEFTMOUSE_UP)`...' |
00:18:56 | FromDiscord | <Varriount> @reilly To be fair, it can be quite important to know where the left mouse button was released. |
00:19:42 | FromDiscord | <reilly> But there are better ways than that, of course. |
00:23:01 | * | krux02_ quit (Remote host closed the connection) |
00:25:50 | FromDiscord | <reilly> Hey, what would be the Windows API name of the "Page Forward/Backward" buttons? As in, the buttons on the side of most mice. Per https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes |
00:26:27 | FromDiscord | <reilly> They aren't called that, at least not on that page, so I don't know what else to look for. |
00:29:45 | * | Tlongir joined #nim |
00:35:08 | Yardanico | @reilly you can search "PAGE DOWN" on this page |
00:35:14 | Yardanico | VK_PRIOR and VK_NEXT |
00:35:44 | FromDiscord | <reilly> No, it's not those. Those scroll up and down the page. The ones I need go back and forward in page history. |
00:37:23 | * | oddp quit (Ping timeout: 240 seconds) |
00:37:46 | Yardanico | well, these are exactly "page down"/"page up" |
00:39:29 | * | endragor quit (Ping timeout: 258 seconds) |
00:50:15 | * | mal`` quit (Quit: Leaving) |
00:50:23 | FromDiscord | <reilly> I'll worry about it later, then. |
00:54:08 | FromDiscord | <reilly> So, `'clickLoop' is not GC-safe as it accesses 'toggleBind' which is a global using GC'ed memory`. `toggleBind = (name: "G", value: 0x47)`, and I'm doing `GetAsyncKeyState(toggleBind.value.int32)` inside the `clickLoop()`. Clearly what I have right now isn't working, so what else can I do? |
00:55:43 | FromDiscord | <reilly> In case it wasn't already obvious, I have no idea how to multithread properly. |
00:56:01 | Yardanico | well in your case can't you just move toggleBind ijnside of clickLoop ? |
01:06:40 | * | endragor joined #nim |
01:09:43 | FromDiscord | <reilly> I made a workaround for that issue- I had it in a tuple for convenience, but separating it into two separate variables solves the problem for whatever reason. And no, that wouldn't have worked since I needed `toggleBind` to be readable from both threads and modifiable by the main. |
01:11:35 | FromDiscord | <reilly> Now I have a new problem, however. I need `toggled` to be, at the very least, readable and writable from `clickLoop` and readable from the main thread, but having it readable and writable from both would be extra nice. I know Nim doesn't allow threads to modify the variables of other threads, so how else might I do that? |
01:20:22 | FromDiscord | <reilly> Actually, scratch that for now, I'm a bit more concerned with why `rand((1000/minCps).int..(1000/maxCps).int)` keeps throwing RangeErrors. both minCps and maxCps can only be 1-20. |
01:21:10 | * | endragor quit (Ping timeout: 260 seconds) |
01:23:14 | disruptek | see the div operator. |
01:23:31 | disruptek | https://nim-lang.org/docs/system.html#div,int,int |
01:25:55 | * | apahl quit (Ping timeout: 272 seconds) |
01:27:27 | * | rockcavera quit (Remote host closed the connection) |
01:27:30 | * | apahl joined #nim |
01:31:40 | * | rockcavera joined #nim |
01:33:27 | FromDiscord | <reilly> Nope, same error. `rand((1000 div minCps)..(1000 div maxCps))` produces `Error: unhandled exception: value out of range: -42 notin 0 .. 2147483647 [RangeError]`, specifically. |
01:34:39 | disruptek | try it with constants. |
01:34:47 | FromDiscord | <Rika> whats the value of min and max cps? |
01:39:38 | FromDiscord | <reilly> min and max are user input, anywhere from 1-20 |
01:39:43 | FromDiscord | <reilly> trying constants now |
01:40:21 | Yardanico | @reilly you have to be careful though |
01:40:27 | Yardanico | so that the first value is smaller than the second one |
01:40:36 | Yardanico | I don't think rand supports ranges like 40 .. 30 |
01:40:56 | disruptek | Error: expression 'discard pop(env.goto)' is of type 'NimNode' and has to be used (or discarded) |
01:41:07 | disruptek | no shit, sherlock. |
01:41:45 | Yardanico | disruptek: maybe https://github.com/nim-lang/Nim/issues/14665 |
01:41:46 | disbot | ➥ wrong error: `is of type 'NimNode' and has to be used (or discarded)` in else branch ; snippet at 12https://play.nim-lang.org/#ix=2plc |
01:41:58 | disruptek | it's due to a template. |
01:42:13 | disruptek | just kinda funny. |
01:45:02 | FromDiscord | <reilly> Yardanico: The input is in the form of sliders, and I've made sure that they cannot pass each other. The closest they can get to that is equal. |
01:47:36 | Prestige | I think I've progpammed myself into a corner with this ECS stuff |
01:50:12 | FromDiscord | <reilly> disruptek: Tried with constants, so clearly the issue has something to do with the variables since it works then. |
01:50:15 | Prestige | programmed*wa |
01:50:20 | Prestige | I |
01:50:37 | Prestige | cant type on this keyboard rip |
01:54:36 | * | vicfred quit (Quit: Leaving) |
01:57:15 | disruptek | Prestige: it doesn't seem like what you're building is very idiomatic. |
01:57:45 | disruptek | ie. you may be hiking uphill when better views are downhill from here. |
01:58:04 | Prestige | Have no idea how to structure it, just modeling it off of other frameworks |
01:58:59 | Prestige | Not knowing how to do certain things with macros is making it very challenging |
01:59:09 | disruptek | i guess you shouldn't be doing it, then. |
01:59:27 | Prestige | Nah, I'll do it |
02:00:12 | Prestige | If you stop every time you don't know something, you aren't going to get anywhere |
02:00:55 | disruptek | sure, but you may be off in the weeds trying to implement something that you don't merely not know how to implement, but you don't know how to design. |
02:02:04 | Prestige | Design isn't really the problem, just don't know how to do it in this language (yet) |
02:02:19 | FromDiscord | <Rika> maybe do another project in the sidelines |
02:02:22 | FromDiscord | <Rika> to learn more of the language |
02:02:52 | Prestige | It's just a matter of figuring out macros and what I can do with them |
02:03:00 | disruptek | he did nimdow, doh |
02:03:44 | FromDiscord | <Rika> o i c |
02:04:32 | FromDiscord | <reilly> OH, I'm so dumb, Yardanico was totally right and I was too oblivious to notice. |
02:10:12 | FromDiscord | <reilly> I'm not gonna try to describe the whole problem, so let me put this simply: How can I share data/variables between threads? In this case, I need to modify a variable with thread A and read it in Thread B. |
02:11:25 | FromDiscord | <slymilano> @Varriount so update on this asyncCheck saga lol - we nailed it down to a bug somewhere in httpbeast! https://github.com/nim-lang/Nim/issues/15019 |
02:11:27 | disbot | ➥ asyncCheck works fine on Linux and Windows - not on Mac. ; snippet at 12https://play.nim-lang.org/#ix=2s6h |
02:12:09 | Yardanico | @reilly use arc (you'll still need locks if you are not sure if two reads might write to the same variable) or channels |
02:15:57 | * | muffindrake quit (Ping timeout: 272 seconds) |
02:16:16 | FromDiscord | <reilly> I have no idea how to use either of those. |
02:16:57 | FromDiscord | <reilly> Channels seems fairly sparsely documented, and I *think* I know how Arc might work, but I'm not sure, not to mention I don't know what locks are either. |
02:16:58 | disruptek | everyone who does started off in the same position. |
02:17:53 | * | muffindrake joined #nim |
02:18:08 | FromDiscord | <reilly> Wait- I think I'm starting to understand channels now. Just took me a minute. |
02:28:11 | FromDiscord | <Anuke> Is there a way to disable all non-error compiler output when running a nim file with `nim r file.nim`? e.g. make it look as if I were running a compiled executable |
02:29:04 | FromDiscord | <Anuke> I scanned through the compiler docs and didn't see such an option, although I definitely could have missed something |
02:29:40 | FromDiscord | <Rika> --hints:off ? |
02:29:46 | FromDiscord | <Rika> (not incl the ?) |
02:31:10 | Yardanico | @Anuke easiest way is --verbosity:0 |
02:31:18 | Prestige | Going to just implement an inefficient ecs structure until I can figure this out I suppose |
02:31:23 | Yardanico | also add --hints:off |
02:32:00 | Yardanico | ah actually I guess to disable everything you might just do |
02:32:11 | Yardanico | "-w:off --hints:off --verbosity:0" that should take care of everything |
02:34:13 | FromDiscord | <Anuke> That works, thanks |
02:43:31 | * | OmegaDoug joined #nim |
02:43:55 | * | OmegaDoug left #nim (#nim) |
02:44:47 | * | kitech1 quit (Quit: ZNC 1.7.5 - https://znc.in) |
02:45:28 | disruptek | do we really dispatch on sink? |
02:45:38 | * | kitech1 joined #nim |
02:45:51 | Yardanico | wdym? |
02:46:16 | disruptek | are procs which differ only with sink annotation effectively matched differently? |
02:46:17 | * | kitech1 quit (Max SendQ exceeded) |
02:46:37 | disruptek | because it's annoying that sink inference causes my signatures to not work. |
02:46:42 | * | kitech1 joined #nim |
02:49:36 | FromDiscord | <XeroOl> is there a way to run arbitrary code when a certain object gets GC'd? I'm looking at a C interface that provides a `MakeFoo` and `DestroyFoo` for every type of object, and I'm wondering if there's a way for me to wrap that into nim's GC so I don't have to think about deallocation |
02:49:51 | Yardanico | there are finalizers but use destructors instead |
02:49:53 | FromDiscord | <XeroOl> (edit) 'is there a way to run arbitrary code when a certain object gets GC'd? I'm looking at a C interface that provides a `MakeFoo` and `DestroyFoo` ... forobject' => 'is there a way to run arbitrary code when a certain object gets GC'd? I'm looking at a C interface that provides a `MakeFoo` and `DestroyFoo`function' | 'object,' => 'object it provides,' |
02:50:00 | Yardanico | destructors get mapped to finalizers on refc |
02:50:11 | Yardanico | destructor will be called on object destruction |
02:50:44 | Yardanico | and yes, destructors are a very good way to wrap that C idiom to automatic nim memory management |
02:52:02 | FromDiscord | <XeroOl> Okay, thank you very much. I'm new to nim, so I'm not familiar with all of its features. Is there somewhere I should look to learn how to make destructors? |
02:52:24 | Yardanico | some info is in https://nim-lang.org/docs/destructors.html but it's a bit too technical for newcomers :P |
02:53:40 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
02:53:49 | FromDiscord | <XeroOl> yeah, this is a bit too technical |
02:54:01 | Yardanico | but basically you define a proc `=destroy`(x: var MyObj) = # destroy |
02:54:11 | Yardanico | if you have a ref object, you need to split it into an object and ref object |
02:54:30 | FromDiscord | <XeroOl> `MakeFoo` only gives me a pointer in this case |
02:54:35 | Yardanico | well, that's okay |
02:55:26 | Yardanico | it's basically this https://play.nim-lang.org/#ix=1YNS |
02:55:31 | Yardanico | for your case |
02:57:42 | FromDiscord | <XeroOl> That looks perfect. Thanks! |
02:57:51 | FromDiscord | <Varriount> Anyone know how to test out the new Isolated[T] stuff? Is it on a new branch, or in master? |
02:58:28 | Yardanico | its merged already |
02:58:44 | Yardanico | you just create Isolated[Stuff] variables and send/receive them via channels? |
02:59:10 | FromDiscord | <Varriount> I think so? Or whatever channels come with the implementation. |
02:59:11 | Yardanico | oh, I think the channels don't yet have send/recv for them |
02:59:20 | Yardanico | but it's not hard to do it by hand |
02:59:25 | Yardanico | see the entire pr https://github.com/nim-lang/Nim/pull/15011/files |
02:59:25 | disbot | ➥ WIP: recover builtin; refs https://github.com/nim-lang/RFCs/issues/244 |
03:00:11 | FromDiscord | <Varriount> Oh, hm. |
03:02:01 | FromDiscord | <Varriount> I was planning on testing it out with a basic worker model. |
03:02:29 | Yardanico | Isolate is just for isolating data |
03:02:32 | * | tiorock joined #nim |
03:02:33 | * | tiorock quit (Changing host) |
03:02:33 | * | tiorock joined #nim |
03:02:33 | * | rockcavera is now known as Guest31016 |
03:02:33 | * | Guest31016 quit (Killed (verne.freenode.net (Nickname regained by services))) |
03:02:33 | * | tiorock is now known as rockcavera |
03:02:33 | Yardanico | you could use channels before :P |
03:02:59 | FromDiscord | <Varriount> Sure, but presumably this will allow moving data across threads, rather than deepcopying it. |
03:03:09 | disruptek | yep. |
03:03:35 | disruptek | we could do it before, but now it can be statically proven to be safe. |
03:04:17 | FromDiscord | <Varriount> But doesn't the whole "move instead of copy" still need to be implemented? |
03:04:36 | Yardanico | no? |
03:04:49 | Yardanico | well that's just additions to channels module I think |
03:04:51 | Yardanico | not a lot of them |
03:07:07 | * | Prestige quit (Ping timeout: 240 seconds) |
03:12:30 | * | Prestige joined #nim |
03:22:48 | FromDiscord | <XeroOl> @Yardanico why do you say I should use destructors instead of finalizers. After doing more research, it looks like finalizers are what I want |
03:22:57 | FromDiscord | <XeroOl> (edit) 'why' => 'Why' | 'finalizers.' => 'finalizers?' |
03:23:07 | FromDiscord | <Yardanico> Because destructors are the better new way of doing the same thing |
03:23:33 | FromDiscord | <Yardanico> Well, not exactly the same, but really similar |
03:25:15 | FromDiscord | <Yardanico> It's just that destructors are relatively (3 years, but you couldn't use them on refc since some time ago) new |
03:26:08 | FromDiscord | <XeroOl> https://play.nim-lang.org/#ix=1YOr |
03:26:23 | FromDiscord | <XeroOl> why is this triggering the destructor twice? |
03:27:01 | FromDiscord | <Yardanico> Because there's nothing which says it'll be triggered only once :P hence the check for nil in the previous example I sent |
03:27:34 | FromDiscord | <XeroOl> I kept the nil check in the one I shared |
03:28:11 | disruptek | cps is getting close to being functional. |
03:28:29 | FromDiscord | <Yardanico> Yeah, but it triggered twice because you didn't actually destroy it |
03:29:12 | FromDiscord | <XeroOl> There must be something I don't understand going on here |
03:29:41 | FromDiscord | <XeroOl> isn't the point that the GC would determine that it needs to be destroyed once? |
03:30:13 | FromDiscord | <Yardanico> Ah well in your case that's right |
03:30:28 | FromDiscord | <Yardanico> Since you're creating copies |
03:30:48 | FromDiscord | <Yardanico> That's one of the reasons you need to do checks for nil :) |
03:31:11 | FromDiscord | <XeroOl> I'm used to java, where `=` is just making references to the same object |
03:31:27 | FromDiscord | <XeroOl> I think I see what's going on |
03:31:30 | FromDiscord | <Yardanico> In Nim we care about performance usually :P |
03:31:41 | FromDiscord | <XeroOl> even though there's only one pointer, there's still multiple objects |
03:31:47 | FromDiscord | <Yardanico> "ref object" if you want reference semantics |
03:32:08 | FromDiscord | <Elegant Beef> > even though there's only one pointer, there's still multiple objects↵Damn that's a dumb way to go around that |
03:32:30 | FromDiscord | <Elegant Beef> Instantiation should be a explicit thing in my opinion |
03:33:28 | FromDiscord | <Yardanico> What |
03:33:32 | FromDiscord | <Yardanico> ??? |
03:33:46 | FromDiscord | <Yardanico> They're objects, allocated on the stack without any overhead |
03:33:50 | FromDiscord | <Yardanico> Of course they'll do copies |
03:34:10 | FromDiscord | <Yardanico> Not sure what you meant here @Elegant Beef |
03:34:53 | FromDiscord | <XeroOl> Rust does that, where their objects don't have a copy constructor by default |
03:35:07 | FromDiscord | <XeroOl> iirc there's some issue caused by that |
03:35:23 | FromDiscord | <XeroOl> I'm sure if you want the same behavior in nim you can just turn off the copy constructor |
03:35:43 | FromDiscord | <Yardanico> There's = which you can overload yourself |
03:35:44 | FromDiscord | <Yardanico> Also =sink |
03:35:47 | FromDiscord | <XeroOl> (edit) 'I'm sure' => 'I'd guess' |
03:35:54 | FromDiscord | <Yardanico> Although not sure if they work for old runtime (refc) |
03:36:40 | * | NimBot joined #nim |
03:36:54 | FromDiscord | <XeroOl> no, ref objects are the solution to prevent the copying |
03:37:05 | FromDiscord | <Elegant Beef> Yea i know that |
03:37:06 | FromDiscord | <XeroOl> ref objects don't copy invisibly |
03:37:06 | FromDiscord | <Elegant Beef> I misread |
03:37:30 | FromDiscord | <Elegant Beef> What i read implied that in java `=` instantiated a copy 😄 |
03:38:02 | FromDiscord | <Elegant Beef> Nice zachary |
03:38:15 | FromDiscord | <Elegant Beef> 0/10 cause you didnt use a rgb cube 😛 |
03:39:06 | FromDiscord | <Zachary Carter> oh well it's a port of this example - https://magnum.graphics/showcase/primitives/ |
03:41:05 | FromDiscord | <XeroOl> what did you mean when you said I need a separate `=destroy` for the ref object vs the object? |
03:41:56 | FromDiscord | <XeroOl> oh nevermind |
03:41:59 | * | endragor joined #nim |
03:42:02 | FromDiscord | <XeroOl> I misinterpreted what you said |
03:47:41 | FromDiscord | <Yardanico> if you want a ref object, you'll have to split object definition into the object and reference to it |
03:47:51 | FromDiscord | <Yardanico> MyTypeObj = object ... |
03:48:06 | * | marnix joined #nim |
03:48:06 | FromDiscord | <Yardanico> MyType = ref MyTypeObj |
03:48:17 | FromDiscord | <Yardanico> And create a destructor for MyTypeObj |
03:54:48 | * | endragor quit (Quit: Leaving...) |
03:56:05 | * | endragor joined #nim |
04:05:06 | FromDiscord | <reilly> So, here's the deal: I have a thing that is *supposed* to click repeatedly so long as left click is held, but the problem is that it can't differentiate between a real and automated click, therefore- If I end the loop with a `mouseUpEvent`, the loop will only happen once, and if I end with a `mouseDownEvent`, the loop will continue indefinitely. Not exactly a Nim question, but would anyone just so happen to know some code witchcraft to che |
04:05:57 | FromDiscord | <XeroOl> how are you issuing the fake mouse events? |
04:06:01 | * | supakeen quit (Quit: WeeChat 2.8) |
04:06:04 | FromDiscord | <XeroOl> are you just calling the functions yourself? |
04:06:40 | * | supakeen joined #nim |
04:10:39 | FromDiscord | <reilly> sent a code paste, see https://play.nim-lang.org/#ix=1YOx |
04:11:25 | FromDiscord | <reilly> I should say, *simplified*. Should be all you need to know, though. |
04:12:50 | * | marnix quit (Ping timeout: 265 seconds) |
04:15:40 | * | marnix joined #nim |
04:22:00 | * | narimiran joined #nim |
04:25:11 | * | sagax joined #nim |
04:28:48 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
04:28:56 | * | njoseph joined #nim |
04:29:14 | * | B4s1l3 joined #nim |
04:29:19 | * | B4s1l3 is now known as opDispatch |
04:29:43 | FromGitter | <awr1> @reilly you can use raw input to do the more robust thing |
04:29:45 | FromGitter | <awr1> https://docs.microsoft.com/en-us/windows/win32/inputdev/about-raw-input |
04:29:50 | * | njoseph quit (Client Quit) |
04:29:56 | * | njoseph joined #nim |
04:30:21 | FromGitter | <awr1> that way you should be able to detect a "real" mouse click from a fake one |
04:31:03 | * | njoseph quit (Client Quit) |
04:31:11 | * | njoseph joined #nim |
04:34:22 | FromGitter | <awr1> alternatively, `MOUSEINPUT` has a `dwExtraInfo` pointer. you can have it point to something to say "hey! this message was user generated!" |
04:35:18 | FromGitter | <awr1> in this sense you should really have an actual message processor instead of polling for the key state |
04:53:55 | * | marnix quit (Read error: Connection reset by peer) |
04:55:17 | * | marnix joined #nim |
04:55:53 | * | endragor quit (Remote host closed the connection) |
04:57:13 | * | endragor joined #nim |
05:01:11 | * | marnix quit (Read error: Connection reset by peer) |
05:01:20 | * | marnix joined #nim |
05:07:45 | * | marnix quit (Ping timeout: 240 seconds) |
05:18:23 | * | opal quit (Ping timeout: 240 seconds) |
05:22:29 | * | opal joined #nim |
05:27:03 | FromDiscord | <arnetheduck> @shashlick latest nimterop changes look cool, gonna give them a shot asap 🙂 |
05:35:15 | * | maier joined #nim |
05:37:42 | * | narimiran_ joined #nim |
05:40:43 | * | narimiran quit (Ping timeout: 246 seconds) |
05:43:41 | * | Vladar joined #nim |
06:06:33 | Zevv | Where do I find the source of these GC benchmarks ar4q uses in his talks? |
06:08:25 | * | endragor quit (Remote host closed the connection) |
06:11:38 | * | letto quit (Quit: Konversation terminated!) |
06:12:21 | * | marnix joined #nim |
06:13:41 | * | letto joined #nim |
06:13:45 | * | endragor joined #nim |
06:17:01 | * | solitudesf joined #nim |
06:23:50 | * | hyiltiz quit (Quit: hyiltiz) |
06:24:12 | * | hyiltiz joined #nim |
06:24:12 | * | hyiltiz quit (Changing host) |
06:24:12 | * | hyiltiz joined #nim |
07:09:16 | * | endragor quit (Ping timeout: 246 seconds) |
07:12:09 | * | tiorock joined #nim |
07:12:09 | * | tiorock quit (Changing host) |
07:12:09 | * | tiorock joined #nim |
07:12:09 | * | rockcavera is now known as Guest19449 |
07:12:09 | * | tiorock is now known as rockcavera |
07:13:26 | * | nikita` joined #nim |
07:15:49 | * | Guest19449 quit (Ping timeout: 264 seconds) |
07:16:58 | * | dmi0 quit (Remote host closed the connection) |
07:17:21 | * | dmi0 joined #nim |
07:22:24 | * | bung joined #nim |
07:23:20 | bung | shashlick you there? |
07:28:30 | bung | send error report https://pastebin.com/04caTyZ4 |
07:31:59 | * | fredrikhr joined #nim |
07:32:46 | * | mal`` joined #nim |
07:43:34 | * | endragor joined #nim |
07:51:13 | * | marnix quit (Read error: Connection reset by peer) |
07:51:22 | * | marnix joined #nim |
07:55:03 | * | sagax quit (Remote host closed the connection) |
07:55:15 | * | marnix quit (Read error: Connection reset by peer) |
07:56:03 | * | marnix joined #nim |
07:56:08 | * | fanta1 joined #nim |
08:18:25 | * | marnix quit (Read error: Connection reset by peer) |
08:19:03 | * | marnix joined #nim |
08:31:41 | * | rockcavera is now known as Guest39921 |
08:31:41 | * | tiorock joined #nim |
08:31:41 | * | Guest39921 quit (Killed (card.freenode.net (Nickname regained by services))) |
08:31:41 | * | tiorock is now known as rockcavera |
08:33:05 | * | waleee-cl joined #nim |
08:37:59 | * | oddp joined #nim |
08:47:58 | * | leorize quit (Remote host closed the connection) |
08:48:29 | * | leorize joined #nim |
09:22:59 | * | bung quit (Quit: Lost terminal) |
09:39:09 | * | krux02 joined #nim |
09:54:37 | * | tiorock joined #nim |
09:54:37 | * | rockcavera is now known as Guest98825 |
09:54:37 | * | tiorock is now known as rockcavera |
09:58:05 | * | Guest98825 quit (Ping timeout: 240 seconds) |
10:11:29 | * | abm joined #nim |
10:14:48 | * | Vladar quit (Quit: Leaving) |
10:15:39 | * | vicfred joined #nim |
10:22:38 | * | tane joined #nim |
10:23:41 | * | bung joined #nim |
10:42:23 | * | vicfred quit (Quit: Leaving) |
11:13:54 | leorize[m] | "Zevv" (https://matrix.to/#/@freenode_Zevv:matrix.org): usually they're in the test suite |
11:14:22 | FromDiscord | <Rika> interesting ping there |
11:14:30 | leorize[m] | I only know of thavlak.nim, but for the rest ask the man himself |
11:15:51 | leorize[m] | guess matrix updated their irc bridge to do some weird stuff |
11:20:37 | koltrast_ | :q |
11:20:45 | koltrast_ | oops sorry, wrong window :) |
11:22:46 | * | Vladar joined #nim |
11:23:57 | FromDiscord | <Rika> gotta quit vim eh |
11:24:32 | * | marnix quit (Ping timeout: 256 seconds) |
11:30:26 | * | krux02 quit (Remote host closed the connection) |
11:39:21 | * | fredrikhr quit (Read error: Connection reset by peer) |
11:39:23 | FromGitter | <alehander92> today i write more C |
11:39:38 | FromGitter | <alehander92> nim ould be a good |
11:39:42 | FromGitter | <alehander92> fit for prog competitions |
11:39:47 | FromGitter | <alehander92> and interview tasks tho |
11:39:49 | * | fredrikhr joined #nim |
11:39:53 | FromGitter | <alehander92> maybe we can add it to codility |
11:40:01 | * | marnix joined #nim |
11:40:58 | FromGitter | <alehander92> i wonder if rust is actually used in topcoder/similar competitions |
11:41:00 | * | fredrikhr quit (Remote host closed the connection) |
11:41:24 | * | fredrikhr joined #nim |
11:42:30 | * | fredrikhr quit (Remote host closed the connection) |
11:42:55 | * | fredrikhr joined #nim |
11:50:01 | * | marnix quit (Ping timeout: 264 seconds) |
11:50:33 | * | marnix joined #nim |
11:50:57 | icy | wonder what happened to the whole exorcism thing |
11:54:00 | * | endragor quit (Remote host closed the connection) |
11:54:27 | * | endragor joined #nim |
11:56:21 | * | fredrikhr quit (Read error: Connection reset by peer) |
11:56:45 | * | fredrikhr joined #nim |
11:58:35 | * | endragor quit (Ping timeout: 240 seconds) |
12:02:03 | FromDiscord | <Zachary Carter> it's still there? https://exercism.io |
12:06:01 | * | supakeen quit (Quit: WeeChat 2.8) |
12:06:41 | * | supakeen joined #nim |
12:06:43 | * | marnix quit (Read error: Connection reset by peer) |
12:07:41 | * | marnix joined #nim |
12:12:57 | FromDiscord | <KingDarBoja> Nim at exercism? |
12:13:38 | FromDiscord | <KingDarBoja> https://media.discordapp.net/attachments/371759389889003532/735107213290635294/Screenshot_20200721-071330.png |
12:34:34 | icy | hmm |
12:34:43 | icy | ok guys, i need some help figuring out how to write this code |
12:34:58 | icy | so i need to maintain two stream connections (websocket) |
12:35:16 | icy | how do i do this parallely |
12:37:01 | icy | one is a local websocket server (so a client will connect to it and open a stream) |
12:37:21 | icy | and the other is a remote connection -- we're the client, and we open a stream |
12:39:07 | FromDiscord | <Zachary Carter> just open two different connections on two different ports? |
12:39:43 | icy | hm |
12:39:44 | * | couven92 joined #nim |
12:40:01 | * | fredrikhr quit (Disconnected by services) |
12:40:06 | icy | i need both streams to work simultaneously |
12:40:10 | * | couven92 is now known as fredrikhr |
12:40:20 | icy | and they share data |
12:40:28 | * | couven92 joined #nim |
12:40:30 | FromDiscord | <Zachary Carter> like - you want them both to be processed? |
12:40:32 | * | drewr quit (Ping timeout: 260 seconds) |
12:40:39 | icy | yeah. essentially, i'm writing a websocket proxy |
12:40:55 | icy | so i'm like the in-between server |
12:40:58 | FromDiscord | <Zachary Carter> you could either use an event loop or threads |
12:41:05 | icy | hmmm |
12:41:08 | FromDiscord | <Zachary Carter> I'm guessing it's I/O bound |
12:41:14 | FromDiscord | <Zachary Carter> so probably async eventl oop |
12:41:18 | FromDiscord | <Zachary Carter> (edit) 'eventl oop' => 'event loop' |
12:41:26 | icy | can you share an example? |
12:41:50 | FromDiscord | <Zachary Carter> https://nim-lang.org/docs/asyncdispatch.html |
12:41:55 | icy | ah o |
12:41:57 | icy | k |
12:42:05 | icy | most of the code rn is async |
12:42:20 | icy | i just have to get the parallel thingy down |
12:44:18 | FromDiscord | <Zachary Carter> Araq: I'm taking a time machine back to 2015 and reading about Urhonimo and specifically this announcement thread - https://forum.nim-lang.org/t/870 - you mentioned that virtual method overrides for C++ are coming, and they never came. How were you thinking about doing this? I'd like to figure out a way to do this without emitting a ton of C++ if it's possible. |
12:45:49 | FromDiscord | <Zachary Carter> I found an article about how pybind does it - maybe I could try to do something similar? https://gem5.googlesource.com/public/gem5/+/c79706ff4ce591df2151db5504d3c224f3c9965f/ext/pybind11/docs/advanced/classes.rst |
12:47:22 | icy | so doing something like: |
12:47:29 | icy | asyncCheck connectRemote() |
12:47:38 | icy | asyncCheck startLocalServer() |
12:47:43 | icy | should basically do what i want? |
12:47:58 | FromDiscord | <Rika> then a runForever() at the end |
12:48:02 | icy | ah yeah |
12:48:06 | icy | awesome |
12:48:07 | icy | lemme try this |
12:48:54 | FromDiscord | <Rika> if you're running these futures in an async proc already, you'd do `await fut1 and fut2` if you want to end when both finish, and `await fut1 or fut2` if you want to end if one ends |
12:49:56 | icy | no i'm running these outside an async proc |
12:55:08 | shashlick | @bung try -d flag to cImport, should tell you which symbol is causing problem |
12:55:24 | shashlick | Also, share the wrapper, will try locally |
12:55:51 | FromDiscord | <Recruit_main707> fuckfuckfuck i want to die↵ive spent an hour writing a rfc on my phone, and i have lost it when i had finished |
12:56:36 | FromDiscord | <Recruit_main707> kill me pls |
12:56:37 | FromDiscord | <lqdev> f |
12:56:49 | FromGitter | <alehander92> dude |
12:56:51 | FromGitter | <alehander92> why on a phone |
12:56:58 | FromDiscord | <Recruit_main707> im out |
12:57:02 | FromGitter | <alehander92> don't worry, just sit on a computer |
12:57:07 | FromGitter | <alehander92> and write it again in 15 minutes |
12:57:17 | FromDiscord | <Rika> y u no save? |
12:57:19 | FromGitter | <alehander92> first drafts are not amazing usually anyway |
12:57:19 | FromDiscord | <lqdev> or less |
12:57:32 | FromDiscord | <lqdev> than 15 minutes |
12:57:42 | * | tmp4 joined #nim |
12:57:46 | FromDiscord | <lqdev> depends on how fast you type. |
12:57:47 | FromDiscord | <Recruit_main707> > y u no save?↵@Rika wifi died when i was going to |
12:58:03 | * | tmp4 left #nim (#nim) |
12:58:04 | FromDiscord | <Rika> ...why does wifi affect your ability to save a file? |
12:58:21 | * | vicfred joined #nim |
12:58:26 | FromDiscord | <Recruit_main707> it was a github issue |
12:58:26 | icy | are you saving to an NFS |
12:58:28 | icy | lol |
12:58:39 | FromDiscord | <Rika> why did you write it all in github at first |
12:59:14 | * | vicfred quit (Max SendQ exceeded) |
12:59:30 | FromDiscord | <Recruit_main707> idk im just gonna lay on bed now |
12:59:41 | * | vicfred joined #nim |
12:59:44 | FromDiscord | <Rika> see uyou |
13:00:48 | * | vicfred quit (Max SendQ exceeded) |
13:00:50 | * | endragor joined #nim |
13:01:17 | * | vicfred joined #nim |
13:02:48 | FromGitter | <alehander92> dude just never do that |
13:02:55 | FromGitter | <alehander92> its a good lesson |
13:03:11 | FromGitter | <alehander92> copy paste it to a message or something or notes |
13:03:14 | FromGitter | <alehander92> but have a backup |
13:05:58 | FromDiscord | <Zachary Carter> Ah I guess there's already an RFC for this - https://github.com/nim-lang/RFCs/issues/174 |
13:05:59 | disbot | ➥ C++ interop: cppMethod/cppVirtual/cppOverride ; snippet at 12https://play.nim-lang.org/#ix=2rh9 |
13:06:55 | FromDiscord | <Zachary Carter> I guess I will live with emitting C++ for now |
13:10:25 | FromDiscord | <Recruit_main707> My rfc was actually about this, very similar |
13:12:41 | FromDiscord | <Zachary Carter> maybe you don't feel so bad about losing it now? |
13:15:20 | FromDiscord | <Recruit_main707> I did know about it, i just thought of a better approach to do it (imo)↵I was also more focused on wrapping c++ classes and inheriting from them in nim that other rfc is more about generating c++ classes to be inherited in the c++ side, correct? |
13:16:33 | FromDiscord | <Recruit_main707> c++ side, [which is what you are looking for,] correct? |
13:40:11 | FromDiscord | <Zachary Carter> that RFC is focused around overriding virtual functions - so if there's a C++ class with virtual functions, you can write a type in Nim that inherits from it, and override the virtual functions it defines |
13:46:44 | FromDiscord | <Recruit_main707> Ill ping you when i write it again so that you can have a look at it |
13:47:46 | icy | hmm ok so i'm trying to cross-compile for linux x86_64 |
13:47:51 | icy | and i'm getting a ton of gcc errors |
13:48:00 | icy | >gcc: error: stdlib_parseopt.nim.c.o: No such file or directory |
13:48:04 | icy | and so on |
13:58:17 | FromDiscord | <Yardanico> @zevv if you're still here - https://github.com/Araq/fosdem2020 |
14:00:02 | * | a_b_m joined #nim |
14:03:02 | * | abm quit (Ping timeout: 256 seconds) |
14:06:59 | FromGitter | <bung87> shashlick it seems it compile a .h file as c header, it is c++ header file actually, I might port a simple jpeg to pure nim first for learnning and use. |
14:10:36 | * | fanta1 quit (Quit: fanta1) |
14:27:29 | * | marnix quit (Read error: Connection reset by peer) |
14:27:37 | * | marnix joined #nim |
14:28:06 | * | vsantana joined #nim |
14:28:22 | FromDiscord | <Anuke> Is there a way to make `staticRead` in dependencies of a file resolve directories based on the compilation directory and not the specific file directory?↵.e.g if I'm compiling `dirA/A` that depends on `dirB/B`, any calls to `staticRead` in `B` will look in `dirB` instead of `dirA`.↵Prefixing all my `staticRead`s `staticExec("pwd")` is *a* solution, but is there another way to accomplish this? |
14:28:31 | FromDiscord | <Anuke> (edit) 'Is there a way to make `staticRead` in dependencies of a file resolve directories based on the compilation directory and not the specific file directory?↵.e.g if I'm compiling `dirA/A` that depends on `dirB/B`, any calls to `staticRead` in `B` will look in `dirB` instead of `dirA`.↵Prefixing all my `staticRead`s ... `staticExec("pwd")`' => 'Is there a way to make `staticRead` in dependencies of a file resolve directories based o |
14:29:16 | FromDiscord | <Anuke> (edit) 'is there another way' => 'I would like' | 'accomplish this?' => 'avoid it if possible' |
14:29:28 | * | krux02 joined #nim |
14:31:02 | * | Avatarfighter quit (Ping timeout: 260 seconds) |
14:31:02 | * | marnix quit (Read error: Connection reset by peer) |
14:31:24 | * | marnix joined #nim |
14:31:39 | bung | you can use https://nim-lang.org/docs/system.html#currentSourcePath.t |
14:33:00 | * | bacterio quit (Ping timeout: 256 seconds) |
14:33:02 | * | marnix quit (Read error: Connection reset by peer) |
14:34:49 | FromDiscord | <Anuke> thanks |
14:35:38 | * | Avatarfighter joined #nim |
14:38:30 | * | marnix joined #nim |
14:39:48 | * | maier quit (Ping timeout: 256 seconds) |
14:41:43 | * | vsantana_ joined #nim |
14:44:59 | * | vsantana quit (Ping timeout: 240 seconds) |
14:45:16 | * | marnix quit (Read error: Connection reset by peer) |
15:02:36 | bung | I cant find where is partial function using template documented |
15:02:43 | * | sagax joined #nim |
15:04:10 | shashlick | @bung don't they have a pure C header? |
15:05:36 | bung | shashlick they have only one c++ header as interface to end user, but also included in c header |
15:11:35 | shashlick | You can exclude it using cExclude |
15:12:25 | * | kungtotte quit (Read error: Connection reset by peer) |
15:13:50 | FromGitter | <bung87> I tried before cExclude not sure that's correct, still get error |
15:13:58 | FromGitter | <bung87> before cImport |
15:14:01 | * | kungtotte joined #nim |
15:19:43 | * | marnix joined #nim |
15:20:15 | FromDiscord | <FinnT730> does nim have a build-in render API? |
15:20:47 | FromGitter | <bung87> render what ? |
15:21:10 | FromDiscord | <FinnT730> like a screen and shapes and stuff like that |
15:22:13 | FromGitter | <bung87> no , that's a package's task |
15:26:25 | * | marnix quit (Read error: Connection reset by peer) |
15:26:38 | * | marnix joined #nim |
15:29:34 | * | drewr joined #nim |
15:32:37 | * | fredrikhr quit (Ping timeout: 264 seconds) |
15:33:19 | * | fredrikhr joined #nim |
15:33:45 | * | bacterio joined #nim |
15:34:35 | * | vsantana joined #nim |
15:37:25 | * | vsantana_ quit (Ping timeout: 240 seconds) |
15:37:41 | * | fredrikhr quit (Client Quit) |
15:38:28 | icy | hey so the process of cross-compiling is basically just copying over the contents of nimcache and running the shell script right? |
15:39:16 | icy | i'm trying to build my program for Linux x86_64 from an OpenBSD host |
15:39:18 | FromDiscord | <Yardanico> Well that's usually not what cross compiling is :P |
15:39:38 | FromDiscord | <Yardanico> It's when you for example build a Windows binary while being on Linux |
15:39:47 | FromDiscord | <Yardanico> But you need a C compiler which allows for that |
15:39:51 | icy | i mean, yeah lol |
15:40:04 | icy | i ran 'nim c --nimcache:nimcache --cpu:amd64 --os:linux --compileOnly --genScript --cc:gcc myprogram.nim' |
15:40:19 | FromDiscord | <Yardanico> Well that's for making the C files to compile on the target machine |
15:40:22 | icy | yeah |
15:40:37 | icy | how do i cross compile a binary that'll run on Linux x64 then? |
15:41:44 | FromDiscord | <Yardanico> You need a C compiler for OpenBSD which can make Linux binaries |
15:41:58 | icy | hmmmm |
15:42:16 | icy | can gcc do that? |
15:42:16 | FromDiscord | <Yardanico> For e.g Linux -> Windows there's mingw |
15:42:39 | icy | oh right |
15:42:45 | FromDiscord | <Yardanico> Well yes it can probably, but you'll need to recompile it so it emits Linux binaries |
15:42:58 | FromDiscord | <Yardanico> I think it would be better if you ask in a OpenBSD community |
15:43:10 | icy | yeah just shot question on #openbsd :D |
15:43:13 | FromDiscord | <Yardanico> About generally cross compiling C applications on OpenBSD to Linux |
15:43:22 | icy | alrighty |
15:43:51 | * | vsantana_ joined #nim |
15:44:29 | FromDiscord | <Yardanico> Also you could use CIs to make Linux binaries |
15:46:22 | * | vsantana quit (Ping timeout: 260 seconds) |
15:46:36 | icy | Yardanico: what about the approach i was taking initially -- just building the C files on the target host? |
15:47:01 | icy | it's not a binary, but it's still fine |
15:47:09 | FromDiscord | <Yardanico> Well that's not true cross compiling since you'll still compile C files on the Linux target |
15:47:14 | FromDiscord | <Yardanico> But if you're fine with it - use it |
15:47:21 | icy | yeah that's fine for now, i think |
15:47:34 | icy | but i'm running into issues with it |
15:47:57 | icy | i get a ton of gcc errors on the target host |
15:48:23 | icy | 'gcc: error: stdlib_system.nim.c.o: No such file or directory |
15:48:27 | icy | and so on |
15:55:39 | icy | here's the full error dump: https://termbin.com/w2uy |
16:01:24 | FromDiscord | <Zachary Carter> is there anything like fscanf which operates on a stream in Nim? I know about strscans and the scanf macro but I don't think scanf works on streams? |
16:02:17 | * | lritter joined #nim |
16:04:02 | FromDiscord | <Shucks> Do I need to call NimMain with `nim cpp`? |
16:04:24 | FromDiscord | <Zachary Carter> no |
16:04:34 | * | couven92 quit (Ping timeout: 260 seconds) |
16:05:35 | FromDiscord | <Shucks> Interesting |
16:05:44 | Yardanico | "nim cpp" is still stand-alone |
16:05:51 | Yardanico | you don't need any C++ code to use the C++ backend :P |
16:05:57 | Yardanico | most nim libs should work with C++ backend just fine |
16:06:24 | shashlick | @bung - please share your wrapper, will try locally |
16:07:46 | * | ForumUpdaterBot quit (Remote host closed the connection) |
16:07:53 | * | ForumUpdaterBot joined #nim |
16:10:14 | FromDiscord | <kodkuce> https://media.discordapp.net/attachments/371759389889003532/735166754162081822/2020-07-21_180801.png |
16:10:23 | FromDiscord | <kodkuce> what does this AsyncFD mean |
16:10:38 | Yardanico | but does it compile? :P |
16:11:45 | Yardanico | ah, in your case I think you're using the wrong proc |
16:12:07 | Yardanico | https://nim-lang.org/docs/smtp.html#connect%2CAsyncSmtp%2Cstring%2CPort you need to use this connect |
16:12:28 | Yardanico | or maybe nimsuggest is acting for you again |
16:12:39 | Yardanico | as I said - nimsuggest does have bugs where it reports errors when there are no errors |
16:12:56 | Yardanico | the only "true" way to check if your code is correct for now is to run "nim c file.nim" :) |
16:13:01 | Yardanico | well, mostly correct |
16:14:41 | * | mbuchel joined #nim |
16:15:59 | FromDiscord | <Rika> AsyncFD means asynchronous file descriptor I assume |
16:16:19 | Yardanico | yes |
16:17:12 | * | NimBot joined #nim |
16:19:23 | FromDiscord | <kodkuce> sorry was alt tab yep it compiles with no error |
16:19:32 | FromDiscord | <kodkuce> guess nimsuggest bonkers? |
16:20:23 | Yardanico | yes |
16:20:49 | FromDiscord | <kodkuce> ye i just ask cuz dont want to build up issues form start 🙂 |
16:20:59 | Yardanico | Just try to compile with nim |
16:21:02 | Yardanico | don't always trust nimsuggest |
16:21:14 | * | narimiran_ quit (Ping timeout: 256 seconds) |
16:21:52 | FromDiscord | <kodkuce> ok 1 question too , how to disable that compile itself output |
16:22:01 | Yardanico | ? |
16:22:48 | FromDiscord | <kodkuce> like all libs its compiling bla bla ... |
16:22:54 | FromDiscord | <demotomohiro> nim c foo.nim > /dev/null |
16:22:56 | FromDiscord | <demotomohiro> ? |
16:23:03 | FromDiscord | <kodkuce> nah |
16:23:31 | FromGitter | <ynfle> `--hint[Procissing]:off --hint[CC]:off` |
16:23:50 | ForumUpdaterBot | New thread by Quetzalb: ARC: Calling default destructor of embedded field from a destructor, see https://forum.nim-lang.org/t/6566 |
16:23:54 | FromDiscord | <kodkuce> CC: stdlib_assertions.nim↵CC: stdlib_io.nim↵CC: stdlib_system.nim |
16:23:56 | Yardanico | --hints:off -w:off --verbosity:0 |
16:23:58 | Yardanico | will disable everything |
16:23:59 | FromDiscord | <kodkuce> like this ones |
16:24:00 | Yardanico | for sure |
16:24:05 | FromDiscord | <kodkuce> --verbosity i guess |
16:24:30 | FromGitter | <ynfle> --verbosity won't turn of proccesing I think |
16:24:37 | Yardanico | I specified all 3 |
16:24:40 | Yardanico | "--hints:off -w:off --verbosity:0" together |
16:25:03 | Yardanico | It'll disable _all_ output unless you have an error |
16:25:39 | * | endragor quit (Remote host closed the connection) |
16:26:06 | * | endragor joined #nim |
16:28:00 | FromDiscord | <kodkuce> i want to still have waringings and hits so i have reason to cry here 🙂 |
16:28:33 | FromDiscord | <demotomohiro> On windows, `stdout.write"あ"` print "あ" correctly when compiled with `nim c` but not with `nim cpp`. |
16:28:56 | FromDiscord | <demotomohiro> I checked system/io.nim and generated .c and .cpp file. It seems they are doing same thing.↵Backend g++ Compile option can affect this bug? |
16:30:31 | FromDiscord | <demotomohiro> Anyone can echo CJK charactors on Windows that compiled with `nim cpp`? |
16:32:11 | * | endragor quit (Ping timeout: 240 seconds) |
16:35:31 | * | marnix quit (Ping timeout: 258 seconds) |
16:35:31 | * | maier joined #nim |
16:38:57 | * | marnix joined #nim |
16:41:01 | * | maier quit (Ping timeout: 264 seconds) |
16:43:55 | disruptek | !last araq |
16:43:56 | disbot | Araq spoke in 12#nim 23 hours ago 12https://irclogs.nim-lang.org/20-07-2020.html#17:29:45 |
16:44:03 | * | vsantana_ is now known as vsantana |
16:44:05 | disruptek | !last clyybber |
16:44:06 | disbot | clyybber spoke in 12#nim 24 hours ago 12https://irclogs.nim-lang.org/20-07-2020.html#16:39:35 |
16:44:34 | FromDiscord | <Yardanico> !last disbot |
16:44:35 | disbot | disbot joined 12#disruptek 3 hours ago and last spoke 718 weeks ago |
16:44:42 | FromDiscord | <Yardanico> Ok |
16:59:46 | FromDiscord | <Clyybber> !last disruptek |
16:59:47 | disbot | disruptek spoke in 12#nim 15 minutes ago 12https://irclogs.nim-lang.org/21-07-2020.html#16:44:05 |
17:00:10 | disruptek | is sinkInference expected to sometimes break code? |
17:00:26 | FromDiscord | <Clyybber> yeah, but at compile time |
17:00:53 | disruptek | lol ofc |
17:01:06 | FromDiscord | <Clyybber> I mean, if it breaks code that compiles its a bug |
17:01:08 | * | Kaivo quit (Quit: WeeChat 2.8) |
17:01:18 | FromDiscord | <Clyybber> eh, you know what I mean :p |
17:01:19 | disruptek | oh, well cps breaks it, then. |
17:01:48 | disruptek | i think the test.nim.cfg includes the switch to turn it off, so you'd want to remove that. |
17:01:56 | FromDiscord | <Clyybber> yeah, I saw that |
17:02:12 | disruptek | nice, i didn't know you were watching the repo. |
17:02:33 | FromDiscord | <Clyybber> I'm watching all your steps |
17:02:34 | FromDiscord | <Clyybber> :p |
17:02:51 | FromDiscord | <Clyybber> does it say something about type mismatch? |
17:02:59 | FromDiscord | <Clyybber> with sinkinference I mean |
17:03:07 | disruptek | yeah, due to the filter predicate. |
17:03:42 | FromDiscord | <Clyybber> hmm, maybe just add {.nosinks.} |
17:05:26 | disruptek | i guess that works. |
17:05:37 | disruptek | but i'll want to remove that ultimately. |
17:05:50 | disruptek | i mean, it's just ct shit, so it doesn't matter, really. |
17:06:02 | FromDiscord | <Clyybber> yeah |
17:07:12 | * | endragor joined #nim |
17:08:34 | disruptek | the event queue needs to work differently according to the spec. |
17:08:53 | FromDiscord | <Clyybber> your spec? |
17:09:05 | disruptek | nah, the papers. i think i can just make it an ordered table, though. |
17:09:11 | FromDiscord | <Clyybber> Araq: Regarding https://github.com/nim-lang/RFCs/issues/234#issuecomment-661987316, notice that its `ref var` not `var ref` |
17:09:12 | disbot | ➥ Add write-tracking to Nim's func ; snippet at 12https://play.nim-lang.org/#ix=2pg3 |
17:09:27 | FromDiscord | <Clyybber> disruptek: Ah |
17:09:43 | disruptek | it's pretty exciting to see this thing come together. |
17:11:43 | * | andinus quit (Quit: ERC (IRC client for Emacs 26.3)) |
17:12:13 | * | endragor quit (Ping timeout: 264 seconds) |
17:12:33 | * | andinus joined #nim |
17:13:38 | * | aenesidemus_ quit (Quit: Leaving) |
17:15:47 | * | bung quit (Quit: Lost terminal) |
17:19:01 | * | Vladar quit (Quit: Leaving) |
17:20:47 | * | Trustable joined #nim |
17:22:36 | disruptek | i thought a proc with an Empty body was a prototype. |
17:23:07 | FromDiscord | <Clyybber> is it not? |
17:23:27 | disruptek | well, it provokes an issue with my gensym'd name. |
17:23:52 | disruptek | so i'm not sure how i'm supposed to write this, though an empty statement list somehow works. |
17:24:24 | disruptek | this bozo is /still/ trying to login to my freenode account. |
17:28:29 | FromDiscord | <Zachary Carter> it's me |
17:28:34 | disruptek | well, cut it out. |
17:29:24 | FromDiscord | <Zachary Carter> man - playing with C++ interop makes me want more |
17:29:56 | FromDiscord | <Zachary Carter> overriding virtual functions would be so sweet |
17:34:03 | disruptek | that's kinda how i feel about transexuals. |
17:34:29 | FromDiscord | <Zachary Carter> let's just not |
17:36:28 | disruptek | suite yourself. |
17:36:44 | shashlick | Z if you are into c++, maybe some nimterop PRs will be cool :D |
17:37:38 | * | vsantana_ joined #nim |
17:37:58 | FromDiscord | <Zachary Carter> shashlick: I wouldn't even know where to start |
17:38:02 | * | Trustable quit (Remote host closed the connection) |
17:38:11 | FromDiscord | <Zachary Carter> I'm using nimline right now - which has been working out well |
17:38:41 | shashlick | that's good |
17:40:04 | * | vsantana quit (Ping timeout: 240 seconds) |
17:41:45 | * | buyfn joined #nim |
17:41:47 | FromDiscord | <Zachary Carter> shashlick - if you have any ideas on where to start I might be able to help - although I think a barrier to what I'm trying to make work would still be there with the whole virtual function deal |
17:43:58 | FromDiscord | <Avatarfighter> Im curious to know but how would one import/use cpp classes with nim? |
17:45:22 | FromDiscord | <Zachary Carter> importcpp |
17:45:32 | * | buyfn quit (Client Quit) |
17:47:57 | FromDiscord | <demotomohiro> @Avatarfighter https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importcpp-pragma |
17:52:22 | * | kungtotte quit (Read error: Connection reset by peer) |
17:55:06 | * | kungtotte joined #nim |
17:55:23 | FromDiscord | <Avatarfighter> Thanks guys |
17:55:38 | FromDiscord | <Avatarfighter> i wasnt sure how to so i never have |
18:01:37 | shashlick | @zachary carter well the main thing is knowing what a given c++ syntax maps to in Nim |
18:02:10 | shashlick | Then you put that in an h file, run toast with -a - mcpp and see what the tree sitter ast looks like |
18:02:16 | shashlick | Then mapping that to Nim |
18:02:50 | shashlick | Since c is already supported, there's a lot of helpers already available |
18:03:06 | shashlick | But ya if you are making progress with Nimlime, I can understand if you aren't keen |
18:06:45 | * | endragor joined #nim |
18:11:44 | FromDiscord | <Zachary Carter> well - I'll see if I have time - nimline has made not having to write much binding code nice, but it does have certain warts too |
18:12:18 | * | endragor quit (Ping timeout: 256 seconds) |
18:16:17 | ForumUpdaterBot | New thread by ShalokShalom: Compile time check for let , see https://forum.nim-lang.org/t/6567 |
18:17:48 | FromDiscord | <hugogranstrom> I've stumbled into a conflict with the `^` (https://github.com/nim-lang/Nim/blob/ddcbc1a58f82b9e3931e3ef5d1a8b4337ba50ccf/lib/pure/math.nim#L985) proc in math.nim in the stdlib and I noticed when looking at the signature that it takes an arbitrary type T as input for the base but it does on line 1005 show that T must be int-like as `result = 1`. Would it make sense to narrow it down to `T: SomeNumber` instead? |
18:19:09 | disruptek | sounds like it. |
18:19:32 | * | Vladar joined #nim |
18:22:31 | disruptek | does anyone have any evidence that condition variables work? |
18:22:45 | FromDiscord | <Clyybber> depends on what you mean by that |
18:23:20 | FromDiscord | <Clyybber> you mean wrapping CPP ones? |
18:23:28 | disruptek | no; locks.Cond |
18:24:14 | FromDiscord | <Clyybber> they should |
18:25:11 | FromDiscord | <Clyybber> threadpool uses them |
18:25:26 | disruptek | okay, cool, thanks. |
18:29:10 | * | dmi0 quit (Remote host closed the connection) |
18:29:28 | * | dmi0 joined #nim |
18:32:20 | * | vsantana joined #nim |
18:35:24 | * | vsantana_ quit (Ping timeout: 240 seconds) |
18:36:25 | * | maier joined #nim |
18:41:22 | * | maier quit (Ping timeout: 260 seconds) |
18:59:54 | * | marnix quit (Ping timeout: 256 seconds) |
19:08:45 | alehander92 | c |
19:08:52 | * | endragor joined #nim |
19:08:54 | alehander92 | i almost enjoy bit manipulation now |
19:09:18 | * | narimiran_ joined #nim |
19:13:22 | * | Vladar quit (Quit: Leaving) |
19:13:24 | * | endragor quit (Ping timeout: 240 seconds) |
19:18:12 | FromDiscord | <Recruit_main707> Can you access from a pragma in a type definition all the procs/methods that have it as argument? |
19:19:39 | alehander92 | iii doubt it |
19:20:16 | alehander92 | you can staticread files and .. try to analyze them |
19:20:22 | alehander92 | but probably not what you want? |
19:21:46 | FromDiscord | <Recruit_main707> I am basically looking forward overriding c++ functions, and without getting into the compiler internals, i want to know how far i could get it with just macros and keeping it clean |
19:22:26 | FromDiscord | <Recruit_main707> (just like Zachary)↵But i am thinking pf possible solutions, hopefully cleaner then emit |
19:22:29 | Yardanico | @Recruit_main707 I don't think so if you mean access all procs/methods which use that type |
19:22:46 | alehander92 | you probably need to define them in a block |
19:22:51 | Yardanico | well yeah, that'd work |
19:23:56 | FromDiscord | <Recruit_main707> And passing that block to the pragma/macro i guess |
19:24:36 | FromGitter | <deech> Can anyone help decipher this error? I have `UncheckedArray` I want to convert to a `seq` so I do `toSeq(toOpenArray(...))` but I get `invalid context for 'toOpenArray'; 'toOpenArray' is only valid within a call expression`. |
19:25:52 | FromDiscord | <Clyybber> toSeq is a template so thats probably why |
19:26:40 | FromGitter | <deech> So how do I fix it? |
19:26:59 | Yardanico | why do you need toOpenArray here? |
19:27:24 | FromGitter | <deech> I didn't know how else to get from `UncheckedArray` to `seq`. |
19:27:31 | Yardanico | ah, not a problem |
19:27:56 | Yardanico | var myseq = newSeqUnitialized(lenofuncheckedarray) |
19:28:12 | * | marnix joined #nim |
19:28:29 | Yardanico | and then copyMem I guess |
19:28:31 | Yardanico | for most performance |
19:28:56 | FromGitter | <deech> I see, I'll try that. What was wrong with how I had it? |
19:29:13 | Yardanico | openArray is not a "real" nim type |
19:29:20 | FromGitter | <awr1> it could be in the future though |
19:29:22 | Yardanico | e.g. right now you can't have fields in objects with openarray type |
19:29:23 | Yardanico | yes |
19:29:25 | FromGitter | <awr1> https://github.com/nim-lang/RFCs/issues/88 |
19:29:27 | disbot | ➥ make openArray first-class ; snippet at 12https://play.nim-lang.org/#ix=200S |
19:29:40 | Yardanico | yeah I know |
19:29:48 | Yardanico | I read most github notifications :D |
19:30:50 | FromDiscord | <Recruit_main707> I think OpenArray is fine as it is |
19:30:51 | FromGitter | <awr1> this is something i really want TBH, i've been waiting for a nice builtin slice/view type to work with unchecked arrays |
19:31:18 | FromDiscord | <Recruit_main707> Thats true, id like to have uncheckedArray slices |
19:31:33 | FromGitter | <awr1> the naming is slightly weird though, i think it should have been called `view[T]` or `span[T]` and `openarray` just effectively remain a typeclass |
19:32:45 | shashlick | @awr1 is that nimterop pr done? |
19:33:22 | FromGitter | <awr1> the int literal one? |
19:33:23 | FromGitter | <awr1> should be |
19:34:22 | FromGitter | <awr1> as someone who doesn't do much web programming i'm curious what percent of the nim community uses the JS backend |
19:34:48 | shashlick | Ok I'll take a look later today |
19:35:12 | * | rockcavera quit (Remote host closed the connection) |
19:35:26 | Yardanico | @awr1 I don't think it's a lot, but whose who use it, use it a lot :) |
19:35:31 | Yardanico | so it's actually pretty usable |
19:35:33 | alehander92 | i did use it |
19:35:38 | alehander92 | for a long time |
19:35:39 | * | deech quit (Read error: Connection reset by peer) |
19:36:41 | FromGitter | <deech> Ok I also found `add` in `system.nim` that can concatenate a `seq` to an `openArray`. |
19:37:12 | FromGitter | <awr1> i wonder if anyone had ever pushed for nimterop to get JS lib support. or something similar |
19:37:15 | Yardanico | but for your case newSeqUninitialized + copyMem will be the fastest |
19:37:18 | Yardanico | @awr1 what for? |
19:37:26 | Yardanico | there's emscripten if you want C libraries in the browser |
19:37:41 | alehander92 | awr1 i think this is the dts2nim idea |
19:37:52 | Yardanico | compiling C into JS (not into wasm) is far from trivial |
19:37:56 | alehander92 | there were ideas to do that in a more updated to modern nim way |
19:37:57 | Yardanico | there was asm.js which did that kinda |
19:37:59 | FromGitter | <awr1> nooo i mean like |
19:38:01 | alehander92 | no yardanico |
19:38:08 | alehander92 | it's about typescript definitions mapping to nim ones |
19:38:12 | Yardanico | ??? |
19:38:14 | alehander92 | and yes dts2nim does it |
19:38:20 | alehander92 | but this needs some update |
19:38:21 | Yardanico | ahh |
19:38:25 | Yardanico | I understood, yeah |
19:38:29 | FromGitter | <awr1> say you like want ember.js or w/e bindings in nim |
19:38:30 | FromGitter | <awr1> ya |
19:38:30 | alehander92 | and i think it can be done as more purely nim tool |
19:38:36 | alehander92 | but somebody has to do it |
19:38:47 | alehander92 | if you export the json of the ast |
19:39:11 | alehander92 | and then just reuse the compiler renderer + do the other needed mapping logic directly in (cbackend) nim binary |
19:39:45 | FromGitter | <awr1> maybe tree-sitter could be used for such a tool, like what nimterop already ddoes |
19:41:18 | alehander92 | maybe, but there seem to be very good typescript libs for that |
19:41:26 | alehander92 | but yeah treesitter might be also a good option |
19:41:32 | alehander92 | if it supports it good idea |
19:41:54 | alehander92 | it needs some ability to configure stuff |
19:42:00 | alehander92 | e.g. how to map Number for a lib |
19:42:04 | alehander92 | number |
19:43:27 | FromGitter | <awr1> github uses tree-sitter for their language integration things |
19:43:31 | FromGitter | <awr1> i'm pretty sure it works w/ typescript |
19:44:56 | FromGitter | <awr1> https://docs.github.com/en/github/managing-files-in-a-repository/navigating-code-on-github |
19:45:22 | FromGitter | <awr1> so i imagine typesitter work pretty well with TS |
19:45:27 | FromGitter | <awr1> *treesitter |
19:45:36 | alehander92 | yeah , i also thought about writing a more universal linter based on that |
19:45:51 | alehander92 | inspired by rubocop and adaptations of its cops to nim |
19:46:12 | alehander92 | i am a bit surprised |
19:46:19 | alehander92 | there isn't a ML linter startup |
19:46:26 | alehander92 | probably there is and i don't know that |
19:46:39 | FromGitter | <awr1> also i was not aware of dts2nim |
19:47:07 | alehander92 | it needs mostly |
19:47:13 | alehander92 | to also map any to JsObject |
19:47:25 | alehander92 | the promise/future stuff (not sure if it does it) |
19:47:34 | alehander92 | and maybe something more that i am missing |
19:47:48 | alehander92 | ah stuff like `{x: ..}` |
19:47:58 | alehander92 | can be mapped to something like a `jsobject(x=..)` macro |
19:48:04 | alehander92 | returning a new type |
19:48:16 | FromGitter | <awr1> also really any binding generator interface should ideally work like nimterop where you just import a handler file which figures out everything it needs to do at compiletime |
19:48:17 | alehander92 | which seems useful for apis |
19:48:26 | alehander92 | i dont like that so much |
19:48:40 | alehander92 | i think it's better to manually review/finalize such things |
19:48:45 | alehander92 | but it does sound good on theory |
19:49:01 | alehander92 | especially with ts where you dont depend on local os so much |
19:51:20 | FromDiscord | <Anuke> When I cross-compile a win32 executable with -d:release, it crashes with a SIGILL right after `return`-ing from a proc. This doesn't happen on any other platform, or when I remove the `-d:release` flag. Switching the GC doesn't affect it. Any thoughts on why this happens?↵↵(the proc: <https://github.com/Anuken/fuse/blob/master/backend/glad.nim#L185> - there's nothing special about it and the application still crashes later on if I remov |
19:52:06 | Yardanico | that's due to zig |
19:52:19 | Yardanico | it enabled ubsan with trap-on-undefined-behaviour by default |
19:52:32 | Yardanico | and apparently it thinks Nim's gc has "undefined behaviour" because it does some stack manipulation |
19:52:40 | Yardanico | enables* |
19:53:10 | Yardanico | and it won't happen without -d:release because zig cc only enables it with -O3 |
19:53:40 | Yardanico | See https://forum.nim-lang.org/t/6362 |
19:55:47 | Yardanico | see https://github.com/ziglang/zig/wiki/FAQ#why-do-i-get-illegal-instruction-when-using-with-zig-cc-to-build-c-code |
19:56:29 | FromDiscord | <Anuke> I'm using `mingw32-gcc` for compiling, is zig still somehow involved? |
19:56:33 | Yardanico | huh |
19:56:36 | Yardanico | then I don't know :D |
19:56:40 | FromDiscord | <Anuke> oh no |
19:56:44 | Yardanico | well I have a guess |
19:57:03 | Yardanico | it might be because you have -march=something and not "-march=generic" which is default |
19:57:26 | Yardanico | SIGILL can occur if you specified some minimal CPU target for compilation, but the target machine doesn't have all instructions of that CPU |
19:57:33 | Yardanico | so it fails with SIGILL because there's no such instruction on that CPU |
19:58:14 | Yardanico | also SIGILL can occur due to a C compiler bug :D |
20:00:40 | FromDiscord | <Anuke> I'm specifying `--cpu:i386` and `--os:windows`, but not much else platform specific |
20:00:44 | Yardanico | huh |
20:00:57 | Yardanico | maybe one of the libs you're using specifies march native? |
20:01:44 | FromDiscord | <ShalokShalom> How is Zig related to Nim? |
20:01:53 | Yardanico | zig cc can be used for cross-compilation of any C projects |
20:02:00 | Yardanico | so you can cross-compile nim applications with zig cc |
20:04:12 | FromDiscord | <Anuke> interestingly, it initializes a GLFW window successfully before it crashes |
20:04:30 | Yardanico | well if you don't have any -march=native I really think it's a C compiler bug |
20:04:34 | Yardanico | it's not as uncommon as you think |
20:05:13 | FromDiscord | <Anuke> guess I'll just stick with mediocre-performance win32 builds for now |
20:06:39 | Yardanico | well you can try -O23 |
20:06:41 | Yardanico | -O2 * |
20:06:50 | FromDiscord | <ShalokShalom> And why would you want to compile with Zig cc? |
20:06:58 | Yardanico | to have easier cross-compilation |
20:07:51 | Yardanico | ircord (my discord-irc bot used on this discord server) runs on the nim vps with relatively older glibc |
20:07:55 | Yardanico | and I can't natively compile it from my artix |
20:08:01 | Yardanico | so I had to use zig cc to target lower glibc |
20:08:41 | Yardanico | and no static builds because of openssl |
20:08:52 | Yardanico | of course I could statically link libressl, but that's harder and a security risk |
20:09:09 | * | Senketsu joined #nim |
20:09:14 | Yardanico | (I mean I have done it in the past anyway) |
20:10:10 | Yardanico | i don't really like zig as a language, but zig cc is a nice convenience thing |
20:11:26 | FromDiscord | <Anuke> is using an older version of glibc with zig-cc as easy as specifying the correct executable and target? |
20:11:44 | Yardanico | you just specify the correct target |
20:11:49 | Yardanico | https://github.com/Yardanico/ircord/blob/master/zig-compile-vps.sh |
20:11:55 | Yardanico | and yes I had to use -O2 because of the SIGILL thing |
20:13:48 | FromDiscord | <Anuke> interestingly, passing O2 makes it crash for me |
20:13:57 | FromDiscord | <Anuke> (with minGW) |
20:19:00 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
20:21:11 | FromGitter | <awr1> the default flags passed to `zig cc` should likely be changed then |
20:21:41 | FromDiscord | <ShalokShalom> @Yardanico[IRC]#0000 thanks |
20:21:57 | Yardanico | @awr1 yeah but nim doesn't have a concept of "zig cc" anymore really |
20:22:07 | Yardanico | because zig cc is mostly clang |
20:22:14 | Yardanico | just with a few additional options for cross-compiling |
20:22:25 | FromGitter | <awr1> why? was it removed? |
20:22:28 | Yardanico | because it's clang |
20:22:38 | Yardanico | You don't need additional support in the nim compiler for it really |
20:22:48 | Yardanico | it's basically clang with different glibc headers + musl sources + win headers + some more stuff bundled together |
20:23:17 | Yardanico | wait wtf |
20:23:18 | Yardanico | https://www.wikidata.org/wiki/Q60678874 |
20:23:35 | FromDiscord | <Avatarfighter> YOOO |
20:23:37 | * | Lord_Nightmare joined #nim |
20:23:38 | FromDiscord | <Avatarfighter> Araq is famous |
20:23:50 | Yardanico | well wikidata is actually a cool project |
20:23:58 | Yardanico | it's about facts which are easier to parse/process by machines |
20:24:01 | Yardanico | by computers |
20:24:05 | FromDiscord | <Avatarfighter> yeah ik 😛 |
20:24:18 | FromDiscord | <Avatarfighter> Still if Wikidata has Araq, he is famous |
20:24:23 | FromDiscord | <Avatarfighter> famous to humans and machines alike |
20:24:28 | Yardanico | not wikipedia tho yet :C |
20:26:30 | FromGitter | <awr1> IMO it should have stayed a distinct compiler and just instead take in the clang settings since it's a unique enough "distro" of clang. nim already kind of lumps clang and GCC together, at least as far as command line operations are considered |
20:26:31 | FromGitter | <awr1> https://github.com/nim-lang/Nim/blob/49d4b50fe52f0e961ef367a44be8b1bd79994a03/compiler/extccomp.nim#L135 |
20:26:56 | FromDiscord | <ShalokShalom> Araq is Andreas? |
20:26:56 | FromGitter | <awr1> if you want to also define `clang` for compatibility puposes, that's fine too. |
20:27:09 | FromDiscord | <ShalokShalom> Yeah.. |
20:27:19 | Yardanico | yes :P |
20:27:27 | Yardanico | @shalokShalom i meant to reply to your question |
20:27:29 | FromGitter | <awr1> imo what we should get as a new define probably is something like `gccLike`that gets added for gcc, clang, zig cc etc |
20:27:42 | Yardanico | then almost all compilers are "gccLike" |
20:27:49 | FromGitter | <awr1> MSVC is not gcc like |
20:27:53 | Yardanico | "almost" |
20:28:17 | FromGitter | <awr1> MSVC is the most important and most popular non-gcc-like compiler |
20:28:27 | Yardanico | I still like Clang more :P |
20:28:43 | FromGitter | <awr1> clang relative to what? zig cc? or gcc |
20:28:50 | Yardanico | to gcc and msvc :P |
20:29:03 | FromGitter | <awr1> well, yes. LLVM is quite nice |
20:29:06 | Yardanico | about zig addition - see https://github.com/nim-lang/Nim/pull/13757 |
20:29:07 | disbot | ➥ Add support for `zig cc` as C compiler. |
20:29:23 | Yardanico | about zig removal - see https://github.com/nim-lang/Nim/commit/1b2b32169a5d8089a50509136a31b5ceb3773994 |
20:30:00 | FromGitter | <awr1> :[ |
20:30:07 | * | hyiltiz quit (Ping timeout: 260 seconds) |
20:34:49 | FromGitter | <awr1> speaking of MSVC a side project idea in my head is to maybe get an xbox and see about getting nim to compile to WinRT so we can get official game console support (and not just switchbrew) |
20:36:25 | * | narimiran_ quit (Ping timeout: 265 seconds) |
20:37:16 | * | maier joined #nim |
20:39:25 | shashlick | Tree sitter can parse Javascript |
20:39:57 | shashlick | That's one of the reasons I use it |
20:40:14 | shashlick | Can parse a variety of languages |
20:42:32 | * | maier quit (Ping timeout: 256 seconds) |
20:42:37 | FromDiscord | <ShalokShalom> @awr1[Gitter]#0000 Why not adding that support to Godot? |
20:43:15 | FromGitter | <awr1> can you elaborate? |
20:43:51 | FromGitter | <awr1> do you mean that Godot doesn't have WinRT targets and should get them? |
20:43:54 | * | Senketsu quit (Read error: Connection reset by peer) |
20:45:04 | FromDiscord | <ShalokShalom> So far as I know, has it no console support at all |
20:45:10 | FromDiscord | <ShalokShalom> Due to licensing issues |
20:45:47 | FromDiscord | <ShalokShalom> And Godot has Nim bindings, via GodotNative |
20:47:17 | FromGitter | <awr1> i have never used Godot but IMO what godot should do, being OSS, is maintain paritally-closed-source forks with patches for supporting individual consoles. this is what the Forge does IIRC |
20:47:19 | FromGitter | <awr1> https://github.com/ConfettiFX/The-Forge |
20:47:58 | Yardanico | I heard some developers made their own godot templates for consoles |
20:48:06 | Yardanico | but they couldn't open-source them because of NDKs of course |
20:48:08 | FromGitter | <awr1> and then give these patches out for developers on request and proof of accrediting with nintendo, sony, etc. |
20:48:42 | FromDiscord | <ShalokShalom> https://docs.godotengine.org/en/stable/tutorials/platform/consoles.html |
20:48:44 | * | marnix quit (Ping timeout: 240 seconds) |
20:48:49 | FromDiscord | <ShalokShalom> @awr1[Gitter]#0000 interesting |
20:49:03 | FromGitter | <awr1> it would probably be better to have "official" first party support for an engine. e.g. a lot of switch developers do not use Vulkan, but instead NVN i believe |
20:49:19 | * | marnix joined #nim |
20:49:49 | FromDiscord | <ShalokShalom> I would actually be fine with a non open source binary that could convert my games to consoles |
20:50:01 | FromDiscord | <ShalokShalom> @awr1[Gitter]#0000 Yeah |
20:50:22 | FromGitter | <awr1> this is also what i think unreal does too, since their engine is OSS. well, partially. OSS with royalties and other stuff involved. |
20:50:25 | FromGitter | <awr1> what's the term im looking for |
20:50:30 | FromGitter | <awr1> publicly available source i think |
20:51:34 | FromGitter | <awr1> the legal implications of such a "publicly available" binary would be weird. really you need a whole toolchain plus a devkit, etc. |
20:53:48 | * | marnix quit (Read error: Connection reset by peer) |
20:56:15 | FromDiscord | <ShalokShalom> Unreal is publishing their source code, while thats about it |
20:56:33 | FromDiscord | <ShalokShalom> You are not allowed to redistribute |
20:56:39 | FromGitter | <awr1> unreal publishes their source code under a non-OSS license, yeah. |
20:56:44 | FromDiscord | <ShalokShalom> You can only fix bugs and send it to them |
20:56:55 | FromGitter | <awr1> https://en.wikipedia.org/wiki/Source-available_software |
20:57:00 | FromGitter | <awr1> this is what i was thinking of |
20:57:06 | Yardanico | huh I wonder why nim wiki page refers to github pages documentation (for devel) |
20:57:07 | FromDiscord | <ShalokShalom> Yes, exactly |
20:57:12 | Yardanico | I think I should change it so it refers to stable docs |
20:57:22 | Yardanico | I'm just doing some small changes to the nim's wiki page |
20:57:26 | Yardanico | since it's outdated in some places a bit |
20:57:37 | FromDiscord | <ShalokShalom> Any ideas how to reorder learn and documentation? |
20:58:05 | FromDiscord | <ShalokShalom> Araq just wrote an hour ago he would welcome this |
20:58:43 | FromDiscord | <Varriount> ShalokShalom: Did he give any specifics, or just "better documentation would be nice"? |
20:59:02 | FromDiscord | <ShalokShalom> No, about the split nature of learn and documentation |
20:59:32 | * | a_b_m quit (Quit: Leaving) |
20:59:56 | FromDiscord | <ShalokShalom> So that we unite them, kinda |
20:59:56 | Araq | any opinions on https://github.com/nim-lang/RFCs/issues/234 and https://github.com/nim-lang/Nim/pull/15030 ? |
20:59:57 | disbot | ➥ writing to a location counts as "side effect"; implements https://github.com/nim-lang/RFCs/issues/234 |
21:00:04 | FromDiscord | <ShalokShalom> https://forum.nim-lang.org/t/6546#40621 |
21:00:15 | Yardanico | Araq: will that change "func" to be closer to a "real" mathematical function? |
21:00:33 | Yardanico | as in "same input = same output" |
21:00:39 | Araq | I guess |
21:00:40 | FromDiscord | <ShalokShalom> I am all for more functional programming |
21:00:59 | FromDiscord | <ShalokShalom> I thought thats already the case? |
21:01:00 | Yardanico | I think I'm for it since it'll make func more different than proc |
21:01:08 | Yardanico | @Shalok it's not |
21:01:11 | FromDiscord | <ShalokShalom> Isnt proc the inpure function? |
21:01:18 | Araq | it's not about whether you like it or not, we all like it |
21:01:19 | FromGitter | <awr1> I would like it if the keyword is different imo |
21:01:28 | FromGitter | <awr1> keep func strictly side-effect-less |
21:01:33 | Araq | it's how to do a transition period etc |
21:02:35 | Yardanico | looooooool |
21:02:40 | Yardanico | found this: |
21:02:44 | Yardanico | https://i.imgur.com/84UxPIL.png |
21:03:17 | Araq | yeah, well. I'm also Indiana Jones |
21:05:52 | * | buyfn joined #nim |
21:06:29 | FromDiscord | <ShalokShalom> https://media.discordapp.net/attachments/371759389889003532/735241307806498877/Screenshot_2020-07-21-23-06-18-94.jpg |
21:06:57 | FromDiscord | <ShalokShalom> @Yardanico[IRC]#0000 So the manual is ahead of the implementation? |
21:07:06 | Yardanico | no? |
21:07:10 | Yardanico | the current implementation is this, yes |
21:07:23 | Yardanico | but currently modifying a ref or var T argument doesn't count as a side effect |
21:07:34 | FromDiscord | <ShalokShalom> Aha |
21:09:21 | * | al1ranger joined #nim |
21:09:38 | Araq | Yardanico: got a cursor inference bug for me? |
21:09:46 | Yardanico | sadly no, didn't have time :( |
21:09:59 | Yardanico | but I'll surely minimize them :P |
21:10:05 | Yardanico | or find another smaller lib which triggers it as well |
21:10:18 | Yardanico | seems like I need to test libs which do some kind of traversal |
21:10:44 | Yardanico | although I reported https://github.com/nim-lang/Nim/issues/15026 yesterday |
21:10:46 | disbot | ➥ [ARC] Weird exception behaviour from doAssertRaises ; snippet at 12https://play.nim-lang.org/#ix=204i |
21:10:48 | Yardanico | not related to cursorifier though |
21:11:00 | FromDiscord | <ShalokShalom> I should have read the actual Github issues before 😅 |
21:11:29 | FromDiscord | <ShalokShalom> But I think, it should also state in the documentation, how it does now. |
21:11:41 | Yardanico | https://nim-lang.org/docs/manual.html#pragmas-nosideeffect-pragma |
21:12:06 | FromDiscord | <ShalokShalom> The people are surprised by how it works, since the documentation tells otherwise. |
21:12:11 | Yardanico | it doesn't? |
21:12:18 | Yardanico | ". This means that the proc/iterator only changes locations that are reachable from its parameters and the return value only depends on the arguments." |
21:12:29 | FromDiscord | <ShalokShalom> As I just had shown in the screenshot. |
21:12:43 | Yardanico | right now it is 100% true |
21:12:47 | * | tane quit (Ping timeout: 246 seconds) |
21:12:49 | Yardanico | func is just sugar for noSideEffect |
21:13:00 | FromDiscord | <ShalokShalom> https://forum.nim-lang.org/t/6546#40621 |
21:13:01 | Yardanico | but after that RFC it won't be |
21:13:31 | FromDiscord | <ShalokShalom> I mean, the documentation doesnt mention anything about those exceptions |
21:13:45 | Yardanico | not sure that you mean, sorry :) |
21:13:47 | Yardanico | what* |
21:13:50 | FromDiscord | <ShalokShalom> When it says "no side-effects" I expect no side effects. |
21:13:56 | Yardanico | but then there's https://nim-lang.org/docs/manual.html#pragmas-nosideeffect-pragma |
21:14:12 | Yardanico | yeah, sure, a link to this location of the manual would be useful |
21:14:29 | Yardanico | from the func section |
21:15:04 | FromDiscord | <ShalokShalom> How long will the RFC take to take place? |
21:15:14 | FromGitter | <awr1> RE this: https://forum.nim-lang.org/t/6546#40621 |
21:15:16 | FromDiscord | <ShalokShalom> Since it might be redundant then.. |
21:15:23 | FromGitter | <awr1> we could make the front page a bit more interactive TBH |
21:15:33 | FromDiscord | <ShalokShalom> Yep |
21:15:48 | FromGitter | <awr1> maybe have tooltips on mouseover |
21:16:20 | FromDiscord | <ShalokShalom> I link the individual entries at the manual to the appropriate parts in the example |
21:16:25 | FromDiscord | <ShalokShalom> Mouse over is also nice |
21:16:35 | FromDiscord | <ShalokShalom> While I prefer actual documentation |
21:16:52 | FromGitter | <awr1> maybe you can click it and it will link to an appropiate part in nim manual |
21:16:57 | Yardanico | btw, we had "run" button to run nim code in the playground on the old forum :) |
21:17:04 | Yardanico | which we don't have on the new forum |
21:17:13 | FromGitter | <awr1> you should also have some text above it like "mouse over keywords for more information" |
21:17:14 | * | buyfn quit (Quit: buyfn) |
21:17:24 | Yardanico | I'm just saying this because at least the examples should have a link to the playground |
21:17:25 | FromGitter | <awr1> so that people don't completely miss it |
21:17:29 | Yardanico | so people can experiment with them |
21:17:44 | FromGitter | <awr1> does the nim playground have an API? |
21:17:57 | FromGitter | <awr1> if so maybe we could embed it on the front page |
21:18:04 | Yardanico | well yes it does |
21:18:07 | Yardanico | !eval echo 1 + 1 |
21:18:07 | * | vsantana quit (Quit: leaving) |
21:18:09 | NimBot | 2 |
21:18:12 | Yardanico | nimbot uses it's API |
21:18:28 | FromDiscord | <ShalokShalom> > maybe you can click it and it will link to an appropiate part in nim manual↵@awr1[Gitter]#0000 thats what I plan |
21:18:31 | Yardanico | backend sources are in https://github.com/PMunch/nim-playground |
21:18:48 | FromDiscord | <ShalokShalom> One thing that concerns me, is this: https://media.discordapp.net/attachments/371759389889003532/735244409989234808/Screenshot_2020-07-21-23-17-36-41.jpg |
21:18:53 | Yardanico | the /compile endpoint |
21:19:02 | Yardanico | @ShalokShalom wdym? |
21:19:10 | FromDiscord | <ShalokShalom> When people click on let, they might expect the article to array |
21:19:18 | Yardanico | huh |
21:19:27 | FromDiscord | <ShalokShalom> So I suggest to add a section about let arrays here: https://nim-lang.org/docs/tut1.html#the-let-statement |
21:19:30 | Yardanico | I think we shouldn't clutter examples with too much interactivity |
21:19:36 | Yardanico | since there's only a limited number of them |
21:19:36 | FromDiscord | <lqdev> then put the link at `[` |
21:19:45 | FromGitter | <awr1> if they click on `let`, show docs for `let` |
21:19:49 | FromGitter | <awr1> if they click on operator yeah |
21:19:52 | FromGitter | <awr1> show docs for array |
21:20:07 | FromDiscord | <ShalokShalom> @lqdev thats what I thought too, while it will not stop people from clicking on let and expecting let array |
21:20:09 | * | al1ranger quit (Quit: Leaving) |
21:20:30 | FromGitter | <awr1> eh |
21:20:41 | FromDiscord | <lqdev> i don't think we should design for people without common sense. |
21:20:52 | FromDiscord | <ShalokShalom> Is there something to be said against an article about let array at the mentioned place? |
21:21:05 | FromDiscord | <lqdev> `let` is `let`. |
21:21:10 | FromDiscord | <lqdev> not an array. |
21:21:13 | FromDiscord | <Elegant Beef> there is no such thing as a let array afaik |
21:21:15 | * | buyfn joined #nim |
21:21:19 | Yardanico | of course there isn't :P |
21:21:24 | * | buyfn quit (Client Quit) |
21:21:25 | FromDiscord | <Elegant Beef> there is the let keyword which gives imutabillity, and then an array |
21:21:33 | FromDiscord | <Elegant Beef> That's why it shouldnt be done |
21:21:37 | FromDiscord | <ShalokShalom> @lqdev I am new to programming and these kind of assumptions are what accumulate |
21:21:43 | FromDiscord | <lqdev> ah i see |
21:21:43 | FromDiscord | <Elegant Beef> teaching parts as a combined thing will only aid confusion |
21:21:45 | FromGitter | <awr1> if you want to do the hover over: you can do the fancy thing and have all the important documentable stuff show up with boxes around them whenever you hover over the code segment, which shows all the things you can look at it. |
21:21:47 | FromDiscord | <ShalokShalom> And hurt a lot |
21:21:57 | Yardanico | I really don't think we should clutter examples with too much interactivity |
21:22:15 | FromDiscord | <ShalokShalom> @awr1[Gitter]#0000 I can not put that side by side with my editor |
21:22:25 | FromGitter | <awr1> hm? |
21:22:26 | FromDiscord | <ShalokShalom> @Yardanico[IRC]#0000 I agree |
21:22:28 | FromGitter | <awr1> elaborate |
21:22:43 | FromDiscord | <lqdev> while we're at it, we may give more examples by creating a combo box, like D's website. |
21:22:48 | FromDiscord | <ShalokShalom> A hover over requires my mouse to be constantly over it |
21:23:24 | FromGitter | <awr1> yes, i don't understand how that is a problem |
21:23:30 | FromDiscord | <Elegant Beef> Isnt that a moot point when you're reading what it is? |
21:24:05 | FromDiscord | <ShalokShalom> @awr1[Gitter]#0000 Since I cant put docs aside on my monitor and code on the other half |
21:24:11 | FromDiscord | <ShalokShalom> And always look over |
21:24:49 | FromGitter | <awr1> what i was suggesting is, when you open the nim homepage, it looks more or less like it does now. but if you hover over the *code area*, boxes or underlines will show up where tooltips might pop up. and then you can hover over those and they will show you information. |
21:24:55 | FromGitter | <awr1> also i thought we were just talking about the home page. |
21:25:00 | FromDiscord | <ShalokShalom> Thats why I think a link is ideal |
21:25:10 | FromGitter | <awr1> are you using the homepage for "robust documentation" or something |
21:25:24 | FromDiscord | <ShalokShalom> @awr1[Gitter]#0000 I know what you mean, and I was considering that as well |
21:25:32 | FromDiscord | <ShalokShalom> I am not against it |
21:26:03 | FromDiscord | <ShalokShalom> I just think a click on object should take on the object anchor, and so on |
21:26:07 | FromDiscord | <Elegant Beef> A link is a little weird as you're opening a milliion tabs to understand what everything does |
21:26:26 | FromDiscord | <Elegant Beef> We're talking about the minimal examples on the front page |
21:26:26 | FromDiscord | <ShalokShalom> I think it could quickly become too overwhelming with too many elements |
21:26:44 | FromDiscord | <ShalokShalom> @Elegant Beef why a million? |
21:27:06 | FromDiscord | <Elegant Beef> you'd want introspection on each keyword on the examples |
21:27:08 | FromDiscord | <ShalokShalom> I open that one that I am currently interested in and then I read it |
21:27:25 | FromDiscord | <Elegant Beef> so `import let object type for echo` |
21:27:29 | FromDiscord | <ShalokShalom> At least in the first example |
21:27:30 | FromDiscord | <Elegant Beef> Well not just keywords |
21:27:31 | FromDiscord | <Elegant Beef> but eitherway |
21:27:42 | FromDiscord | <ShalokShalom> And also arrays |
21:27:51 | FromDiscord | <ShalokShalom> All that could be interesting |
21:28:01 | FromDiscord | <ShalokShalom> "Oh, what does that thing" |
21:28:06 | FromDiscord | <Elegant Beef> But having to open to a new page is quite obnoxious |
21:28:14 | FromDiscord | <Elegant Beef> I think the hover is just better and more streamlined |
21:28:17 | FromDiscord | <Elegant Beef> If anyone is going to do it |
21:28:31 | * | solitudesf quit (Ping timeout: 246 seconds) |
21:28:35 | FromDiscord | <Elegant Beef> Leaving the current page to view docs is just bad UX |
21:29:06 | FromDiscord | <ShalokShalom> I honestly find it obnoxious to crawl through a lot of documentation just to find a simple explaination what = object does |
21:29:18 | FromDiscord | <ShalokShalom> And most of the available documentation doesnt explain it at all |
21:29:30 | FromDiscord | <Elegant Beef> Part 1 of the tutorial↵https://nim-lang.org/docs/tut1.html#advanced-types-objects |
21:29:35 | FromDiscord | <ShalokShalom> I know it |
21:29:36 | FromDiscord | <ShalokShalom> Now |
21:29:44 | FromDiscord | <Elegant Beef> part 1 of the **Tutorial** |
21:29:51 | FromDiscord | <ShalokShalom> Before, I was on "documentation" |
21:30:05 | FromDiscord | <ShalokShalom> Since it is kinda, where i hoped to find .. documentation |
21:30:07 | FromDiscord | <Elegant Beef> You're new to programming, shouldnt you be reading the tutorial |
21:30:30 | FromDiscord | <ShalokShalom> I assumed the tab learn leads to books and similar stuff |
21:30:32 | FromDiscord | <Elegant Beef> Documentation is mostly dedicated to explaining modules |
21:30:38 | FromDiscord | <ShalokShalom> Yeah |
21:30:45 | FromDiscord | <ShalokShalom> This is novel |
21:31:07 | FromDiscord | <Elegant Beef> But the manual also has objects |
21:31:20 | FromDiscord | <ShalokShalom> When you put "Tutorials" to "Documentation" it would be perfectly fine |
21:31:31 | FromDiscord | <Elegant Beef> But they arent the same |
21:31:59 | FromDiscord | <Elegant Beef> Take the previous link against↵https://nim-lang.org/docs/manual.html#types-tuples-and-object-types |
21:32:08 | FromDiscord | <ShalokShalom> @Elegant Beef No, it uses objects |
21:32:18 | FromDiscord | <ShalokShalom> The manual has no explanation to them |
21:32:27 | FromDiscord | <ShalokShalom> It just assumes you know them. |
21:32:34 | Yardanico | manual is not a tutorial |
21:32:53 | Yardanico | it's kind of a language spec/explanation :P |
21:33:09 | Yardanico | "This document describes the lexis, the syntax, and the semantics of the Nim language." |
21:33:25 | Yardanico | wait, and what do you mean manual has no objects? it does |
21:33:29 | Yardanico | https://nim-lang.org/docs/manual.html#types-tuples-and-object-types |
21:33:44 | FromDiscord | <Elegant Beef> > This document is a tutorial for the programming language Nim. This tutorial assumes that you are familiar with basic programming concepts like variables, types or statements but is kept very basic. The manual contains many more examples of the advanced language features. All code examples in this tutorial, as well as the ones found in the rest of Nim's documentation, follow the Nim style guide. |
21:34:57 | FromDiscord | <ShalokShalom> Yeah, I used search function and looked for objects, and not object |
21:35:14 | FromDiscord | <ShalokShalom> @Elegant Beef The problem was not, that I didnt read that |
21:35:16 | Yardanico | if you search for "objects" that section of the manual is the third result |
21:35:33 | Yardanico | https://i.imgur.com/BTHXEjs.png |
21:35:34 | FromDiscord | <ShalokShalom> The problem was, that the tutorial was hidden under "Learn" |
21:35:45 | Yardanico | uhh |
21:35:46 | FromDiscord | <Elegant Beef> Well what are you doing |
21:35:50 | Yardanico | there's literally a "learn nim" button :P |
21:35:50 | FromDiscord | <Elegant Beef> You're learning nim? |
21:35:58 | FromDiscord | <ShalokShalom> I studied the "Documentation" page |
21:36:01 | Yardanico | I agree, the color of it isn't the best |
21:36:03 | Yardanico | https://i.imgur.com/7vSKKZI.png |
21:36:19 | Yardanico | and we already discussed making it bigger |
21:36:23 | FromDiscord | <Elegant Beef> Yard that's non normal colour 😄 |
21:36:25 | FromDiscord | <ShalokShalom> Its not about the color |
21:36:32 | FromDiscord | <Elegant Beef> https://media.discordapp.net/attachments/371759389889003532/735248874133782658/unknown.png |
21:36:40 | FromDiscord | <ShalokShalom> I expected to find everything under the documentation button |
21:36:48 | FromDiscord | <Elegant Beef> You do |
21:37:02 | FromDiscord | <ShalokShalom> I didnt thought, that there is documentation outside of the documentation page |
21:37:19 | Yardanico | well there shouldn't be links to ALL documentation pages or it would be too much |
21:37:49 | FromDiscord | <ShalokShalom> Well.... |
21:37:58 | FromDiscord | <ShalokShalom> Thats what we are thinking about now |
21:38:04 | FromDiscord | <ShalokShalom> How to improve that |
21:39:21 | FromDiscord | <ShalokShalom> And obviously, the beginner stuff is suitable to be placed upfront and most obvious |
21:39:52 | FromDiscord | <ShalokShalom> Since professionals and people who know the language, will have no problem finding more professional lecture, like the index. |
21:40:27 | FromGitter | <awr1> i made a mockup of what i was suggesting |
21:40:28 | FromGitter | <awr1> https://ibb.co/6bnmr5r |
21:40:41 | FromDiscord | <Elegant Beef> Yea awr1 i like that idea |
21:40:56 | FromDiscord | <ShalokShalom> The Nin Style Guide, as an example, is something that barley everybody will ever use |
21:41:13 | FromDiscord | <ShalokShalom> So long as I can click it... |
21:41:30 | FromDiscord | <Varriount> I would honestly prefer merging the "learn" and "documentation" pages, but that's just me. |
21:41:34 | FromDiscord | <ShalokShalom> @awr1[Gitter]#0000 thanks |
21:41:36 | Yardanico | nim style guide is something you learn to use subconsciously :P |
21:41:46 | Yardanico | @Varriount yeah that might be a good idea |
21:41:46 | FromDiscord | <ShalokShalom> @Varriount yes, totally |
21:42:10 | FromDiscord | <ShalokShalom> And I would put Index and Style guide and that like under "development" |
21:42:10 | FromDiscord | <Elegant Beef> Although it'll be relatively large page |
21:42:11 | FromDiscord | <Varriount> You can learn quite a lot of the language just by reading the manual. |
21:42:18 | FromDiscord | <ShalokShalom> And also put the source there |
21:42:40 | FromDiscord | <Varriount> @Elegant Beef that's what table-of-contents are for |
21:42:40 | FromDiscord | <ShalokShalom> @Varriount It actually caused more the desire to quite the language for me |
21:42:54 | FromDiscord | <Elegant Beef> quit? |
21:43:05 | FromDiscord | <Varriount> @ShalokShalom Why? |
21:43:06 | FromDiscord | <ShalokShalom> Yeah |
21:43:24 | FromDiscord | <ShalokShalom> @Varriount Because I assumed it was meant to be the tutorial |
21:43:32 | Yardanico | it doesn't specify that it's a tutorial |
21:43:47 | FromDiscord | <ShalokShalom> Now, as I know the true tutorial, I can see the purpose of the manual |
21:43:48 | FromDiscord | <Elegant Beef> I see what you're saying but there is a learn section you apparently didnt click |
21:43:55 | FromDiscord | <ShalokShalom> And although it looks messy, it makes sense |
21:44:11 | FromDiscord | <ShalokShalom> @Elegant Beef Yep, because I clicked on the documentation section |
21:44:31 | FromDiscord | <Elegant Beef> What were you doing, learning, why didnt you click learn? |
21:44:31 | FromDiscord | <ShalokShalom> Other pages/languages have books and courses under "learn" |
21:44:37 | Yardanico | we have that too |
21:44:46 | FromDiscord | <ShalokShalom> Tutorial and manual are actually very close to each other |
21:45:09 | FromDiscord | <ShalokShalom> @Elegant Beef because until, all projects had it under documentation |
21:45:12 | FromDiscord | <Elegant Beef> When i first found nim the first thing i did was click learn, so im trying to understand the disconnect |
21:45:25 | FromDiscord | <Elegant Beef> I guess, learned behaviour to not click learn 😛 |
21:45:31 | FromDiscord | <ShalokShalom> I honestly just saw docu first |
21:45:45 | FromDiscord | <ShalokShalom> It was on the phone, saw documentation and was happy |
21:45:47 | Yardanico | ok, I agree that we should probably merge learn and docs |
21:45:54 | Yardanico | I don't agree with some of other changes :P |
21:46:05 | FromDiscord | <ShalokShalom> Never would I have thought that there is a separate section with actual beginner friendly content |
21:46:46 | FromDiscord | <Elegant Beef> Yard you dont like the interactive code blocks on front page? |
21:46:56 | FromDiscord | <ShalokShalom> @Yardanico[IRC]#0000 I would like to rename source into development and create a page that provides the Index, Style Guide and link to Github |
21:47:21 | FromGitter | <awr1> i actually redid the downloads page to make it prettier but i never commited any of it and i lost it all when my old computer died. probably one of the few things i never backed up |
21:47:25 | FromDiscord | <ShalokShalom> All the stuff that casual people, who just use the language, dont really use |
21:47:40 | FromDiscord | <ShalokShalom> @awr1[Gitter]#0000 feel sorry for you |
21:47:42 | Yardanico | @Elegant well, I just think that adding too much of that stuff might make it harder to follow |
21:47:42 | FromDiscord | <Elegant Beef> I mean some of the style guide is nice to take |
21:47:46 | Yardanico | I like PMunch's idea much more |
21:47:50 | Yardanico | about playground interactive tours |
21:47:51 | FromDiscord | <Elegant Beef> What's his idea? |
21:47:54 | FromDiscord | <Elegant Beef> Ah |
21:47:57 | FromGitter | <awr1> this was a year or so ago lol. i never got around to redoing it |
21:47:58 | FromDiscord | <Elegant Beef> Yea that's nice too |
21:48:03 | Yardanico | that might be a much better way to introduce people to the language |
21:48:08 | Yardanico | and it offers full interactivity |
21:48:16 | Yardanico | and it can explain all keywords in each example |
21:48:33 | FromDiscord | <ShalokShalom> @Yardanico[IRC]#0000 I actually think about doing something like that for complete newbies |
21:48:39 | FromDiscord | <ShalokShalom> Once I am past that myself |
21:48:41 | FromDiscord | <Elegant Beef> sent a code paste, see https://play.nim-lang.org/#ix=209I |
21:48:44 | Yardanico | did you see https://narimiran.github.io/nim-basics/ ? |
21:48:46 | FromDiscord | <ShalokShalom> Haha |
21:48:51 | FromDiscord | <ShalokShalom> Yes |
21:49:03 | FromDiscord | <ShalokShalom> I think the tutorial is the best |
21:49:10 | Yardanico | @Elegant well not really |
21:49:13 | FromDiscord | <ShalokShalom> Of all the docu I had seem yet |
21:49:16 | FromDiscord | <ShalokShalom> For me |
21:49:30 | Yardanico | we don't really have a pure vs non-pure differentiation I think |
21:49:37 | FromDiscord | <ShalokShalom> @Yardanico[IRC]#0000 we could also incorporate videos.. |
21:49:42 | Yardanico | well yes, there are videos |
21:49:51 | FromDiscord | <Elegant Beef> What do you mean yard? |
21:49:54 | Yardanico | but I personally don't like the idea of learning something by videos |
21:49:57 | FromDiscord | <Elegant Beef> There is clearly a differentiation on there |
21:50:02 | Yardanico | @Elegant there's no reason to use some prefix anymore |
21:50:05 | FromGitter | <awr1> Also speaking of the actual code samples on the front page: the `*` suffix should really be used in the examples, even if it is all single-module. |
21:50:06 | FromDiscord | <Elegant Beef> https://media.discordapp.net/attachments/371759389889003532/735252282001588234/unknown.png |
21:50:10 | FromDiscord | <Elegant Beef> Ah |
21:50:29 | FromDiscord | <ShalokShalom> @awr1[Gitter]#0000 oh yeah |
21:50:30 | FromGitter | <awr1> just as a way to show "this is how you make things public!" |
21:50:32 | FromDiscord | <ShalokShalom> Good idea |
21:50:44 | FromGitter | <awr1> it's confused some people in the past before. |
21:51:01 | FromDiscord | <ShalokShalom> > but I personally don't like the idea of learning something by videos↵@Yardanico[IRC]#0000 there are different types of learners |
21:51:06 | Yardanico | I know |
21:51:11 | Yardanico | I didn't say "we shouldn't include the videos" |
21:51:11 | FromDiscord | <ShalokShalom> Visually, practically, etc |
21:51:27 | Yardanico | it's totally okay to add a "videos" section to learn |
21:51:33 | Yardanico | and you should probably make an RFC instead |
21:51:41 | Yardanico | this is a real-time chat after all |
21:51:50 | Yardanico | with RFC you'll get more actual feedback with pros/cons, etc |
21:51:57 | FromGitter | <awr1> if you do want to have the nim playground on the home page |
21:52:05 | FromGitter | <awr1> really it should expand to be full screen |
21:52:19 | FromGitter | <awr1> well not full screen but it should hide the ad text. |
21:52:22 | FromDiscord | <ShalokShalom> > it's confused some people in the past before.↵@awr1[Gitter]#0000 I think we should also mention it, where we introduce people to multi page interaction, so when they import their code and so on |
21:52:49 | FromDiscord | <ShalokShalom> There is at least one part in the documentation, where this is skipped |
21:53:13 | FromGitter | <awr1> have you seen haskell's front page? they have something really nice set up there |
21:53:14 | FromGitter | <awr1> https://www.haskell.org/#step2 |
21:54:17 | FromDiscord | <ShalokShalom> Well, doesnt work on my phone 😋 |
21:54:23 | FromDiscord | <ShalokShalom> It doesnt take the " |
21:54:31 | FromDiscord | <ShalokShalom> While yes, it is nice |
21:55:01 | FromDiscord | <ShalokShalom> What is to me important, is that I see immediately how the language looks like |
21:55:07 | FromDiscord | <ShalokShalom> Like, in practice |
21:55:11 | FromDiscord | <ShalokShalom> Nim already has this |
21:55:20 | FromDiscord | <ShalokShalom> Now I just want to know, what does what |
21:57:14 | FromDiscord | <ShalokShalom> And then I want to do this: |
21:57:20 | FromDiscord | <ShalokShalom> https://media.discordapp.net/attachments/371759389889003532/735254103772495953/Screenshot_20200721_235636.png |
21:57:38 | FromDiscord | <ShalokShalom> I cant do this with hover-over |
21:58:04 | FromDiscord | <ShalokShalom> And then I have again to manually look through the extensive amount of documentation.. |
21:58:18 | FromGitter | <awr1> do you mean how large the actual documentation is |
21:58:29 | FromGitter | <awr1> the ones on the front page can have a shorter blurb |
21:58:37 | FromDiscord | <ShalokShalom> How many different parts, how sorted and how extensive in total. |
21:58:55 | FromDiscord | <ShalokShalom> And I am not concerned about the bubble. |
21:58:56 | FromGitter | <awr1> and then you can link to their doc in the manual |
21:59:04 | FromDiscord | <ShalokShalom> So long as I can click a link.. |
21:59:06 | FromGitter | <awr1> for the full explanation |
21:59:10 | FromDiscord | <ShalokShalom> Yep |
21:59:13 | FromDiscord | <ShalokShalom> Exactly. |
21:59:29 | FromDiscord | <ShalokShalom> While I cant implement the bubble. |
21:59:51 | FromDiscord | <ShalokShalom> fssnip.net/ |
22:00:53 | FromDiscord | <ShalokShalom> http://fssnip.net/21/title/Active-pattern-for-let-binding-inside-patterns |
22:00:57 | FromDiscord | <ShalokShalom> that one does something |
22:01:11 | FromDiscord | <ShalokShalom> while I guess you know yourself how to do this in your language. |
22:04:43 | * | FromDiscord quit (Remote host closed the connection) |
22:05:00 | * | FromDiscord joined #nim |
22:05:12 | * | FromDiscord quit (Remote host closed the connection) |
22:05:29 | * | FromDiscord joined #nim |
22:06:38 | * | nikita` quit (Quit: leaving) |
22:08:06 | * | couven92 joined #nim |
22:08:22 | * | leorize quit (Remote host closed the connection) |
22:09:06 | * | leorize joined #nim |
22:17:29 | * | couven92 is now known as fredrikhr |
22:32:43 | FromDiscord | <KingDarBoja> Oh yes, Haskell one is neat |
22:32:48 | FromDiscord | <KingDarBoja> I mentioned that before |
22:37:39 | FromDiscord | <Varriount> Zevv: Remind me again, what changes need to be made to NPeg to support pausing/resuming/streaming? |
22:38:09 | * | maier joined #nim |
22:42:59 | * | maier quit (Ping timeout: 240 seconds) |
22:49:34 | Yardanico | @Clyybber you around? |
22:50:07 | Yardanico | anyway - I don't know if this is valid code or not (right now with --gc:arc I get a c compiler error for it) https://play.nim-lang.org/#ix=20no |
22:52:21 | Yardanico | https://github.com/nim-lang/Nim/issues/15035 |
22:52:23 | disbot | ➥ [ARC] C compiler error when passing a var openArray to a sink openArray ; snippet at 12https://play.nim-lang.org/#ix=20np |
23:00:21 | * | CcxWrk quit (Killed (card.freenode.net (Nickname regained by services))) |
23:00:22 | * | CcxWrk joined #nim |
23:01:21 | FromDiscord | <ShalokShalom> Are there any parts of Nim itself, that are implemented as objects? |
23:01:29 | Yardanico | wdym? |
23:01:51 | Yardanico | "object" is the base type of every structure containing more than 1 simple value |
23:02:02 | Yardanico | well, there are also tuples |
23:02:13 | Yardanico | even nim strings are "object"s internally of course |
23:02:20 | Yardanico | object with len, cap + pointer to data |
23:02:32 | Yardanico | "object" doesn't add any overhead unless you use inheritance with methods |
23:02:59 | FromDiscord | <ShalokShalom> Mhn |
23:03:10 | FromDiscord | <ShalokShalom> I guess thats not really comparable with other languages |
23:03:17 | Yardanico | it's comparable with C's struct |
23:03:23 | FromDiscord | <ShalokShalom> Hnn |
23:03:24 | Yardanico | nim objects map to C structs for the C backend |
23:03:36 | FromDiscord | <ShalokShalom> And functions? |
23:03:49 | Yardanico | nim procs map to C functions of course, but it's much more low-level |
23:03:59 | FromDiscord | <ShalokShalom> How would you actually guarantee side effect free functions in C? |
23:03:59 | Yardanico | e.g. all generic procedures are specialized, and there's a different C function for each specialized case |
23:04:16 | Yardanico | e.g. if you have a generic procedure which you call with two different types in different places, there will be two versions of it in the compiled C code |
23:04:27 | FromDiscord | <ShalokShalom> Aha |
23:04:32 | FromDiscord | <ShalokShalom> Guess thats too high for me |
23:04:36 | Yardanico | also it doesn't have any nim macros/templates/etc |
23:04:39 | FromDiscord | <ShalokShalom> Or low, what ever 😅 |
23:04:43 | Yardanico | all of that is expanded by the nim compiler |
23:06:16 | FromDiscord | <ShalokShalom> I have actually no idea of how Nim translates code to C |
23:06:34 | Yardanico | via it's C backend |
23:06:47 | FromDiscord | <ShalokShalom> Yeah, I mean in code |
23:07:03 | FromDiscord | <ShalokShalom> I can imagine how to translate into Javascript, some kinda |
23:07:16 | Yardanico | even nim compiled to JS is much simpler than you expect |
23:07:30 | alehander92 | it does it the same way |
23:07:31 | Yardanico | I mean as in it almost doesn't use any of JS's dynamic features |
23:07:31 | FromDiscord | <ShalokShalom> I expect it to be simple |
23:07:40 | Yardanico | the frontend makes "normal nim" into "low-level nim" |
23:07:47 | Yardanico | without generic types, generic procedures, macros, templates, et cetra |
23:07:55 | FromDiscord | <ShalokShalom> Ah, there is a mid step in between |
23:07:58 | Yardanico | of course |
23:08:02 | Yardanico | lol |
23:08:05 | FromDiscord | <ShalokShalom> Is there an official name for low level nim? |
23:08:15 | Yardanico | no, because it's just a term I made up :P |
23:08:19 | Yardanico | that's how most compilers work really |
23:08:27 | alehander92 | sometimes they call it IR |
23:08:34 | Yardanico | the frontend removes abstractions and stuff, and gives it to the frontend |
23:08:39 | alehander92 | but i think it's usually an even more low level repr |
23:08:42 | Yardanico | just fyi - there's an unofficial LLVM backend for nim too |
23:08:43 | FromDiscord | <ShalokShalom> I know IR from LLVM |
23:08:53 | alehander92 | it's intermediate representation |
23:09:01 | Yardanico | so nim is a full-fledged language, it just happens to use C as its default compilation target |
23:09:02 | alehander92 | so probably a term for many passes-s stuff |
23:09:10 | FromDiscord | <ShalokShalom> @Yardanico[IRC]#0000 Yeah, I know that most do it that way |
23:09:21 | Yardanico | well it's the same with LLVM |
23:09:21 | FromDiscord | <ShalokShalom> But I had no idea how it works in Nim's case |
23:09:26 | Yardanico | there's no difference real |
23:09:28 | Yardanico | really* |
23:09:39 | Yardanico | compilers translate high-level code of their language into LLVM IR |
23:09:46 | FromDiscord | <ShalokShalom> And I know nlvm |
23:09:52 | Yardanico | nim translates high-level nim into C or JS or LLVM or whatever backend you make |
23:10:06 | FromDiscord | <ShalokShalom> Yeah |
23:10:13 | Yardanico | and these backends like llvm or c are simple, they don't know what is a "generic type" or something like that |
23:10:16 | FromDiscord | <ShalokShalom> But I have no idea how this is actually working |
23:10:24 | FromDiscord | <ShalokShalom> In case of JS, I can at least imagine |
23:10:31 | Yardanico | well, it's the same as in JS |
23:10:39 | Yardanico | nim frontend mostly does same stuff for C or JS backend |
23:10:50 | FromDiscord | <ShalokShalom> It is using similar structures.. |
23:10:50 | Yardanico | https://github.com/nim-lang/Nim/blob/devel/compiler/cgen.nim main file of the c backend |
23:11:14 | FromDiscord | <ShalokShalom> But the C implementation is more complex or? |
23:11:20 | Yardanico | well of course it is :P |
23:11:28 | Yardanico | since it's optimized a lot, and it's the default backend for Nim |
23:12:34 | Yardanico | these all are parts of the nim's C backend - https://imgur.com/a/hw5Mxz7 |
23:13:03 | Yardanico | most of them are just to not make one big cgen.nim |
23:13:18 | Yardanico | js backend is https://github.com/nim-lang/Nim/blob/devel/compiler/jsgen.nim |
23:13:23 | Yardanico | and https://github.com/nim-lang/Nim/blob/devel/compiler/jstypes.nim |
23:13:30 | leorize | how jsgen is constructed is the future :P |
23:13:41 | * | krux02_ joined #nim |
23:13:51 | Yardanico | there's only around 2.4k cloc of Nim code for the JS backend |
23:14:33 | Yardanico | compared to ~6k cloc for the C backend |
23:14:36 | leorize | jsgen uses ast->ast transformation, super cool :P |
23:14:58 | Yardanico | well, the compiler itself is "ast->ast transformation" |
23:15:21 | leorize | except for the C codegen |
23:15:24 | Yardanico | I don't see anything about translating nim's AST to JS's AST in the js backend, not sure what you're talking about |
23:15:32 | Yardanico | nim's js backend emits JS code directly |
23:15:37 | Yardanico | line by line |
23:16:03 | Yardanico | well, it's all specialized, etc, but there's no translation to the JS ast there |
23:16:37 | * | krux02 quit (Ping timeout: 260 seconds) |
23:17:06 | FromDiscord | <ShalokShalom> Its actually kinda amazing how wide the range is between easy and super complex programs, that you can write with Nim |
23:17:18 | Yardanico | same as with any other language really :) |
23:17:33 | Yardanico | and the compiler itself is not that big if you didn't know |
23:17:43 | FromDiscord | <ShalokShalom> Seems like all between a simple Python script and Kernel code can be written |
23:18:05 | Yardanico | "compiler" directory has 61 thousand cloc (cloc is an utility for counting pure source code lines without empty lines or comment lines) |
23:18:33 | FromDiscord | <ShalokShalom> Well, I dont wanna write the small scripts in most languages |
23:18:51 | FromDiscord | <ShalokShalom> When I say the range is wide, I mean how feasible it is |
23:19:03 | FromDiscord | <ShalokShalom> Of course can use all languages for that |
23:19:06 | Yardanico | not really |
23:19:12 | FromDiscord | <ShalokShalom> But not many will look as if made for it. |
23:19:26 | Yardanico | you can't use python for making a kernel unless you use some subset of it or make a special compiler for it yourself, which will still require to make some subset of it:P |
23:19:31 | FromDiscord | <ShalokShalom> > same as with any other language really :)↵@Yardanico[IRC]#0000 I am referring to that. |
23:19:33 | Yardanico | and yeah, some simple kernels have been done in Nim |
23:19:41 | Yardanico | it's entirely possible |
23:19:42 | FromDiscord | <ShalokShalom> @Yardanico[IRC]#0000 Thats whaf I mean. |
23:20:16 | leorize | Yardanico: well it's not a full fledged AST, but it has one :P |
23:20:19 | FromDiscord | <ShalokShalom> And I think RPython is such a subset |
23:20:32 | Yardanico | I know RPython, it's part of PyPy |
23:20:41 | Yardanico | But it's still much less feasible |
23:20:47 | leorize | basically just rope + some fields to add some semantic meanings |
23:20:49 | Yardanico | since RPython takes ages to translate to C and then compile :P |
23:20:58 | leorize | meanwhile the C code gen spits out pure Rope |
23:20:58 | Yardanico | did you ever compile pypy? :D I did |
23:21:12 | Yardanico | at least they show colorized mandelbrot in the terminal while pypy is compiling lol |
23:21:16 | Yardanico | so you are not bored to death |
23:21:31 | Yardanico | well, at least they did that in 2017 |
23:21:37 | Yardanico | leorize: interesting |
23:25:39 | Yardanico | ok I'm confused |
23:25:44 | Yardanico | are you allowed to do "var cstring"? |
23:25:50 | Yardanico | in argument list |
23:25:56 | leorize | yes, it's a pointer |
23:26:05 | leorize | it means you're changing the pointer |
23:26:40 | Yardanico | leorize: this code works with refc, is it "legal" or not? |
23:26:40 | Yardanico | https://play.nim-lang.org/#ix=20rE |
23:27:02 | Yardanico | I'm asking because https://play.nim-lang.org/#ix=20rF does NOT work |
23:27:09 | Yardanico | how come the first works, but second doesn't |
23:27:19 | Yardanico | first works with refc, crashes with arc, second crashes with both |
23:27:22 | leorize | yes but you don't need `var` for that |
23:27:29 | Yardanico | well it's not my code :P |
23:27:47 | Yardanico | wait actually |
23:27:50 | Yardanico | this seems to be a regression |
23:28:08 | Yardanico | ah no it's not |
23:28:13 | leorize | this isn't anything special, the code was trying to modify r/o data |
23:28:17 | FromDiscord | <Varriount> Hm, so here's a naming question. If I have a variable "value", and I want to store a pointer to it, I might store the pointer in another variable, "valuePtr". But if I have a variable "value" and want to dereference it (because it's a pointer), I would store the dereferenced value in a variable called .... what? |
23:28:28 | Yardanico | valueDeref :P |
23:28:33 | Yardanico | leorize: what exactly? |
23:28:42 | Yardanico | "var cstring" is not needed because cstring itself is a pointer? |
23:28:48 | Yardanico | just "cstring"? |
23:28:59 | leorize | yea, even then it won't work |
23:29:12 | Yardanico | how to make it work then? :D and how come the first example (https://play.nim-lang.org/#ix=20rE) works with refc |
23:29:18 | Yardanico | it's from https://github.com/jangko/nimAES |
23:29:28 | leorize | the first work because refc always have string allocated in the heap |
23:29:31 | Yardanico | I'm just testing stuff with arc |
23:30:06 | Yardanico | so how to make it work then? :P |
23:30:11 | leorize | arc use static strings that's copied to the heap when mutation is required |
23:30:17 | Yardanico | oh, nice, interesting |
23:30:25 | Yardanico | so less RAM usage also because of that? |
23:31:32 | Yardanico | can you please open an issue in nimAES describing what you told me? :P |
23:32:02 | Yardanico | seems like that pattern is used throughout the whole nimAES lib |
23:32:06 | FromDiscord | <Varriount> Yardanico: Thanks! |
23:32:17 | Yardanico | @Varriount I just made one from the top of my head :P |
23:32:26 | leorize | sounds like it could use a switch to openArray[byte] :P |
23:32:38 | Yardanico | convenience procs accept "var string", convert it to "cstring" and pass to the main procs which do stuff |
23:35:54 | leorize | yea it definitely sound like it'd want a switch over to openArray[byte] :P |
23:40:53 | Yardanico | also I'm surprised by how the same (I presume) data structures and algorithms can be implemented in a very different way |
23:41:02 | Yardanico | e.g. https://github.com/Nycto/RBTreeNim and https://github.com/brianshannan/nim-trees/blob/master/nimtrees/trees/red_black.nim |
23:41:58 | Yardanico | well to be fair RBTreeNim seems more separated |
23:52:10 | leorize | the amount of cstrings in nimAES is insane |
23:52:15 | Yardanico | exactly |
23:52:27 | leorize | this is kinda like a C lib translated to nim |
23:53:37 | leorize | Araq: how can one force nim to recognize a string as "being mutated"? |
23:53:44 | leorize | nimAES depends on this |
23:54:37 | FromGitter | <awr1> @leorize maybe actually mutate the string in question and restore it back? |
23:54:44 | FromGitter | <awr1> compiler i think will optimize it out |
23:55:06 | leorize | Yardanico: ^ just set the first member of the string to itself |
23:55:08 | leorize | should work |
23:55:30 | leorize | but we might want to expose this API if interaction with C is wanted |
23:59:19 | FromDiscord | <Varriount> Hm, how many Windows API functions access the filesystem... I'm thinking of taking a shot at an injected Nim DLL that hooks into CreateFile, etc. to redirect programs that *hardcode* placing files in my home directory to place them elsewhere. |