<< 21-07-2020 >>

00:06:19FromGitter<gogolxdong> Is nimble splitted from release build? How to install nimble corresponding to 1.2.4?
00:07:40FromGitter<gogolxdong> Does jester@#head work with devel lastest? `/root/Nim/lib/system.nim(207, 11) Error: undeclared identifier: 'is'`
00:10:12Yardanicothat's a problem with your nim installation
00:11:06*fredrikhr quit (Ping timeout: 256 seconds)
00:12:55FromGitter<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:08FromDiscord<Varriount> Oh hey @reilly
00:13:24FromDiscord<reilly> Don't worry, I eventually got it :7
00:13:44FromGitter<gogolxdong> unable to nimble install jester
00:13:54FromDiscord<Varriount> reilly: Welcome to the 20 years of enterprise API design that is Windows .
00:14:29FromDiscord<Varriount> It's like open source, but with committees, meetings, and managers. Oh, and _marketing_.
00:14:56*endragor joined #nim
00:15:57FromDiscord<reilly> Oh how I long for a simple `SendInput(LEFTMOUSE_DOWN)`...
00:16:46FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=1Yy7
00:17:13FromDiscord<reilly> (edit) '`SendInput(LEFTMOUSE_DOWN)`...' => '`SendInput(LEFTMOUSE_UP)`...'
00:18:56FromDiscord<Varriount> @reilly To be fair, it can be quite important to know where the left mouse button was released.
00:19:42FromDiscord<reilly> But there are better ways than that, of course.
00:23:01*krux02_ quit (Remote host closed the connection)
00:25:50FromDiscord<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:27FromDiscord<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:08Yardanico@reilly you can search "PAGE DOWN" on this page
00:35:14YardanicoVK_PRIOR and VK_NEXT
00:35:44FromDiscord<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:46Yardanicowell, 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:23FromDiscord<reilly> I'll worry about it later, then.
00:54:08FromDiscord<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:43FromDiscord<reilly> In case it wasn't already obvious, I have no idea how to multithread properly.
00:56:01Yardanicowell in your case can't you just move toggleBind ijnside of clickLoop ?
01:06:40*endragor joined #nim
01:09:43FromDiscord<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:35FromDiscord<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:22FromDiscord<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:14disrupteksee the div operator.
01:23:31disruptekhttps://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:27FromDiscord<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:39disruptektry it with constants.
01:34:47FromDiscord<Rika> whats the value of min and max cps?
01:39:38FromDiscord<reilly> min and max are user input, anywhere from 1-20
01:39:43FromDiscord<reilly> trying constants now
01:40:21Yardanico@reilly you have to be careful though
01:40:27Yardanicoso that the first value is smaller than the second one
01:40:36YardanicoI don't think rand supports ranges like 40 .. 30
01:40:56disruptekError: expression 'discard pop(env.goto)' is of type 'NimNode' and has to be used (or discarded)
01:41:07disruptekno shit, sherlock.
01:41:45Yardanicodisruptek: maybe https://github.com/nim-lang/Nim/issues/14665
01:41:46disbotwrong 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:58disruptekit's due to a template.
01:42:13disruptekjust kinda funny.
01:45:02FromDiscord<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:36PrestigeI think I've progpammed myself into a corner with this ECS stuff
01:50:12FromDiscord<reilly> disruptek: Tried with constants, so clearly the issue has something to do with the variables since it works then.
01:50:15Prestigeprogrammed*wa
01:50:20PrestigeI
01:50:37Prestigecant type on this keyboard rip
01:54:36*vicfred quit (Quit: Leaving)
01:57:15disruptekPrestige: it doesn't seem like what you're building is very idiomatic.
01:57:45disruptekie. you may be hiking uphill when better views are downhill from here.
01:58:04PrestigeHave no idea how to structure it, just modeling it off of other frameworks
01:58:59PrestigeNot knowing how to do certain things with macros is making it very challenging
01:59:09disrupteki guess you shouldn't be doing it, then.
01:59:27PrestigeNah, I'll do it
02:00:12PrestigeIf you stop every time you don't know something, you aren't going to get anywhere
02:00:55disrupteksure, 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:04PrestigeDesign isn't really the problem, just don't know how to do it in this language (yet)
02:02:19FromDiscord<Rika> maybe do another project in the sidelines
02:02:22FromDiscord<Rika> to learn more of the language
02:02:52PrestigeIt's just a matter of figuring out macros and what I can do with them
02:03:00disruptekhe did nimdow, doh
02:03:44FromDiscord<Rika> o i c
02:04:32FromDiscord<reilly> OH, I'm so dumb, Yardanico was totally right and I was too oblivious to notice.
02:10:12FromDiscord<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:25FromDiscord<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:27disbotasyncCheck works fine on Linux and Windows - not on Mac. ; snippet at 12https://play.nim-lang.org/#ix=2s6h
02:12:09Yardanico@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:16FromDiscord<reilly> I have no idea how to use either of those.
02:16:57FromDiscord<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:58disruptekeveryone who does started off in the same position.
02:17:53*muffindrake joined #nim
02:18:08FromDiscord<reilly> Wait- I think I'm starting to understand channels now. Just took me a minute.
02:28:11FromDiscord<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:04FromDiscord<Anuke> I scanned through the compiler docs and didn't see such an option, although I definitely could have missed something
02:29:40FromDiscord<Rika> --hints:off ?
02:29:46FromDiscord<Rika> (not incl the ?)
02:31:10Yardanico@Anuke easiest way is --verbosity:0
02:31:18PrestigeGoing to just implement an inefficient ecs structure until I can figure this out I suppose
02:31:23Yardanicoalso add --hints:off
02:32:00Yardanicoah actually I guess to disable everything you might just do
02:32:11Yardanico"-w:off --hints:off --verbosity:0" that should take care of everything
02:34:13FromDiscord<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:28disruptekdo we really dispatch on sink?
02:45:38*kitech1 joined #nim
02:45:51Yardanicowdym?
02:46:16disruptekare procs which differ only with sink annotation effectively matched differently?
02:46:17*kitech1 quit (Max SendQ exceeded)
02:46:37disruptekbecause it's annoying that sink inference causes my signatures to not work.
02:46:42*kitech1 joined #nim
02:49:36FromDiscord<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:51Yardanicothere are finalizers but use destructors instead
02:49:53FromDiscord<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:00Yardanicodestructors get mapped to finalizers on refc
02:50:11Yardanicodestructor will be called on object destruction
02:50:44Yardanicoand yes, destructors are a very good way to wrap that C idiom to automatic nim memory management
02:52:02FromDiscord<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:24Yardanicosome 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:49FromDiscord<XeroOl> yeah, this is a bit too technical
02:54:01Yardanicobut basically you define a proc `=destroy`(x: var MyObj) = # destroy
02:54:11Yardanicoif you have a ref object, you need to split it into an object and ref object
02:54:30FromDiscord<XeroOl> `MakeFoo` only gives me a pointer in this case
02:54:35Yardanicowell, that's okay
02:55:26Yardanicoit's basically this https://play.nim-lang.org/#ix=1YNS
02:55:31Yardanicofor your case
02:57:42FromDiscord<XeroOl> That looks perfect. Thanks!
02:57:51FromDiscord<Varriount> Anyone know how to test out the new Isolated[T] stuff? Is it on a new branch, or in master?
02:58:28Yardanicoits merged already
02:58:44Yardanicoyou just create Isolated[Stuff] variables and send/receive them via channels?
02:59:10FromDiscord<Varriount> I think so? Or whatever channels come with the implementation.
02:59:11Yardanicooh, I think the channels don't yet have send/recv for them
02:59:20Yardanicobut it's not hard to do it by hand
02:59:25Yardanicosee the entire pr https://github.com/nim-lang/Nim/pull/15011/files
02:59:25disbotWIP: recover builtin; refs https://github.com/nim-lang/RFCs/issues/244
03:00:11FromDiscord<Varriount> Oh, hm.
03:02:01FromDiscord<Varriount> I was planning on testing it out with a basic worker model.
03:02:29YardanicoIsolate 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:33Yardanicoyou could use channels before :P
03:02:59FromDiscord<Varriount> Sure, but presumably this will allow moving data across threads, rather than deepcopying it.
03:03:09disruptekyep.
03:03:35disruptekwe could do it before, but now it can be statically proven to be safe.
03:04:17FromDiscord<Varriount> But doesn't the whole "move instead of copy" still need to be implemented?
03:04:36Yardanicono?
03:04:49Yardanicowell that's just additions to channels module I think
03:04:51Yardaniconot a lot of them
03:07:07*Prestige quit (Ping timeout: 240 seconds)
03:12:30*Prestige joined #nim
03:22:48FromDiscord<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:57FromDiscord<XeroOl> (edit) 'why' => 'Why' | 'finalizers.' => 'finalizers?'
03:23:07FromDiscord<Yardanico> Because destructors are the better new way of doing the same thing
03:23:33FromDiscord<Yardanico> Well, not exactly the same, but really similar
03:25:15FromDiscord<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:08FromDiscord<XeroOl> https://play.nim-lang.org/#ix=1YOr
03:26:23FromDiscord<XeroOl> why is this triggering the destructor twice?
03:27:01FromDiscord<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:34FromDiscord<XeroOl> I kept the nil check in the one I shared
03:28:11disruptekcps is getting close to being functional.
03:28:29FromDiscord<Yardanico> Yeah, but it triggered twice because you didn't actually destroy it
03:29:12FromDiscord<XeroOl> There must be something I don't understand going on here
03:29:41FromDiscord<XeroOl> isn't the point that the GC would determine that it needs to be destroyed once?
03:30:13FromDiscord<Yardanico> Ah well in your case that's right
03:30:28FromDiscord<Yardanico> Since you're creating copies
03:30:48FromDiscord<Yardanico> That's one of the reasons you need to do checks for nil :)
03:31:11FromDiscord<XeroOl> I'm used to java, where `=` is just making references to the same object
03:31:27FromDiscord<XeroOl> I think I see what's going on
03:31:30FromDiscord<Yardanico> In Nim we care about performance usually :P
03:31:41FromDiscord<XeroOl> even though there's only one pointer, there's still multiple objects
03:31:47FromDiscord<Yardanico> "ref object" if you want reference semantics
03:32:08FromDiscord<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:30FromDiscord<Elegant Beef> Instantiation should be a explicit thing in my opinion
03:33:28FromDiscord<Yardanico> What
03:33:32FromDiscord<Yardanico> ???
03:33:46FromDiscord<Yardanico> They're objects, allocated on the stack without any overhead
03:33:50FromDiscord<Yardanico> Of course they'll do copies
03:34:10FromDiscord<Yardanico> Not sure what you meant here @Elegant Beef
03:34:53FromDiscord<XeroOl> Rust does that, where their objects don't have a copy constructor by default
03:35:07FromDiscord<XeroOl> iirc there's some issue caused by that
03:35:23FromDiscord<XeroOl> I'm sure if you want the same behavior in nim you can just turn off the copy constructor
03:35:43FromDiscord<Yardanico> There's = which you can overload yourself
03:35:44FromDiscord<Yardanico> Also =sink
03:35:47FromDiscord<XeroOl> (edit) 'I'm sure' => 'I'd guess'
03:35:54FromDiscord<Yardanico> Although not sure if they work for old runtime (refc)
03:36:40*NimBot joined #nim
03:36:54FromDiscord<XeroOl> no, ref objects are the solution to prevent the copying
03:37:05FromDiscord<Elegant Beef> Yea i know that
03:37:06FromDiscord<XeroOl> ref objects don't copy invisibly
03:37:06FromDiscord<Elegant Beef> I misread
03:37:30FromDiscord<Elegant Beef> What i read implied that in java `=` instantiated a copy 😄
03:38:02FromDiscord<Elegant Beef> Nice zachary
03:38:15FromDiscord<Elegant Beef> 0/10 cause you didnt use a rgb cube 😛
03:39:06FromDiscord<Zachary Carter> oh well it's a port of this example - https://magnum.graphics/showcase/primitives/
03:41:05FromDiscord<XeroOl> what did you mean when you said I need a separate `=destroy` for the ref object vs the object?
03:41:56FromDiscord<XeroOl> oh nevermind
03:41:59*endragor joined #nim
03:42:02FromDiscord<XeroOl> I misinterpreted what you said
03:47:41FromDiscord<Yardanico> if you want a ref object, you'll have to split object definition into the object and reference to it
03:47:51FromDiscord<Yardanico> MyTypeObj = object ...
03:48:06*marnix joined #nim
03:48:06FromDiscord<Yardanico> MyType = ref MyTypeObj
03:48:17FromDiscord<Yardanico> And create a destructor for MyTypeObj
03:54:48*endragor quit (Quit: Leaving...)
03:56:05*endragor joined #nim
04:05:06FromDiscord<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:57FromDiscord<XeroOl> how are you issuing the fake mouse events?
04:06:01*supakeen quit (Quit: WeeChat 2.8)
04:06:04FromDiscord<XeroOl> are you just calling the functions yourself?
04:06:40*supakeen joined #nim
04:10:39FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=1YOx
04:11:25FromDiscord<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:43FromGitter<awr1> @reilly you can use raw input to do the more robust thing
04:29:45FromGitter<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:21FromGitter<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:22FromGitter<awr1> alternatively, `MOUSEINPUT` has a `dwExtraInfo` pointer. you can have it point to something to say "hey! this message was user generated!"
04:35:18FromGitter<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:03FromDiscord<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:33ZevvWhere 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:20bungshashlick you there?
07:28:30bungsend 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:54leorize[m]"Zevv" (https://matrix.to/#/@freenode_Zevv:matrix.org): usually they're in the test suite
11:14:22FromDiscord<Rika> interesting ping there
11:14:30leorize[m]I only know of thavlak.nim, but for the rest ask the man himself
11:15:51leorize[m]guess matrix updated their irc bridge to do some weird stuff
11:20:37koltrast_:q
11:20:45koltrast_oops sorry, wrong window :)
11:22:46*Vladar joined #nim
11:23:57FromDiscord<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:23FromGitter<alehander92> today i write more C
11:39:38FromGitter<alehander92> nim ould be a good
11:39:42FromGitter<alehander92> fit for prog competitions
11:39:47FromGitter<alehander92> and interview tasks tho
11:39:49*fredrikhr joined #nim
11:39:53FromGitter<alehander92> maybe we can add it to codility
11:40:01*marnix joined #nim
11:40:58FromGitter<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:57icywonder 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:03FromDiscord<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:57FromDiscord<KingDarBoja> Nim at exercism?
12:13:38FromDiscord<KingDarBoja> https://media.discordapp.net/attachments/371759389889003532/735107213290635294/Screenshot_20200721-071330.png
12:34:34icyhmm
12:34:43icyok guys, i need some help figuring out how to write this code
12:34:58icyso i need to maintain two stream connections (websocket)
12:35:16icyhow do i do this parallely
12:37:01icyone is a local websocket server (so a client will connect to it and open a stream)
12:37:21icyand the other is a remote connection -- we're the client, and we open a stream
12:39:07FromDiscord<Zachary Carter> just open two different connections on two different ports?
12:39:43icyhm
12:39:44*couven92 joined #nim
12:40:01*fredrikhr quit (Disconnected by services)
12:40:06icyi need both streams to work simultaneously
12:40:10*couven92 is now known as fredrikhr
12:40:20icyand they share data
12:40:28*couven92 joined #nim
12:40:30FromDiscord<Zachary Carter> like - you want them both to be processed?
12:40:32*drewr quit (Ping timeout: 260 seconds)
12:40:39icyyeah. essentially, i'm writing a websocket proxy
12:40:55icyso i'm like the in-between server
12:40:58FromDiscord<Zachary Carter> you could either use an event loop or threads
12:41:05icyhmmm
12:41:08FromDiscord<Zachary Carter> I'm guessing it's I/O bound
12:41:14FromDiscord<Zachary Carter> so probably async eventl oop
12:41:18FromDiscord<Zachary Carter> (edit) 'eventl oop' => 'event loop'
12:41:26icycan you share an example?
12:41:50FromDiscord<Zachary Carter> https://nim-lang.org/docs/asyncdispatch.html
12:41:55icyah o
12:41:57icyk
12:42:05icymost of the code rn is async
12:42:20icyi just have to get the parallel thingy down
12:44:18FromDiscord<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:49FromDiscord<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:22icyso doing something like:
12:47:29icyasyncCheck connectRemote()
12:47:38icyasyncCheck startLocalServer()
12:47:43icyshould basically do what i want?
12:47:58FromDiscord<Rika> then a runForever() at the end
12:48:02icyah yeah
12:48:06icyawesome
12:48:07icylemme try this
12:48:54FromDiscord<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:56icyno i'm running these outside an async proc
12:55:08shashlick@bung try -d flag to cImport, should tell you which symbol is causing problem
12:55:24shashlickAlso, share the wrapper, will try locally
12:55:51FromDiscord<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:36FromDiscord<Recruit_main707> kill me pls
12:56:37FromDiscord<lqdev> f
12:56:49FromGitter<alehander92> dude
12:56:51FromGitter<alehander92> why on a phone
12:56:58FromDiscord<Recruit_main707> im out
12:57:02FromGitter<alehander92> don't worry, just sit on a computer
12:57:07FromGitter<alehander92> and write it again in 15 minutes
12:57:17FromDiscord<Rika> y u no save?
12:57:19FromGitter<alehander92> first drafts are not amazing usually anyway
12:57:19FromDiscord<lqdev> or less
12:57:32FromDiscord<lqdev> than 15 minutes
12:57:42*tmp4 joined #nim
12:57:46FromDiscord<lqdev> depends on how fast you type.
12:57:47FromDiscord<Recruit_main707> > y u no save?↵@Rika wifi died when i was going to
12:58:03*tmp4 left #nim (#nim)
12:58:04FromDiscord<Rika> ...why does wifi affect your ability to save a file?
12:58:21*vicfred joined #nim
12:58:26FromDiscord<Recruit_main707> it was a github issue
12:58:26icyare you saving to an NFS
12:58:28icylol
12:58:39FromDiscord<Rika> why did you write it all in github at first
12:59:14*vicfred quit (Max SendQ exceeded)
12:59:30FromDiscord<Recruit_main707> idk im just gonna lay on bed now
12:59:41*vicfred joined #nim
12:59:44FromDiscord<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:48FromGitter<alehander92> dude just never do that
13:02:55FromGitter<alehander92> its a good lesson
13:03:11FromGitter<alehander92> copy paste it to a message or something or notes
13:03:14FromGitter<alehander92> but have a backup
13:05:58FromDiscord<Zachary Carter> Ah I guess there's already an RFC for this - https://github.com/nim-lang/RFCs/issues/174
13:05:59disbotC++ interop: cppMethod/cppVirtual/cppOverride ; snippet at 12https://play.nim-lang.org/#ix=2rh9
13:06:55FromDiscord<Zachary Carter> I guess I will live with emitting C++ for now
13:10:25FromDiscord<Recruit_main707> My rfc was actually about this, very similar
13:12:41FromDiscord<Zachary Carter> maybe you don't feel so bad about losing it now?
13:15:20FromDiscord<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:33FromDiscord<Recruit_main707> c++ side, [which is what you are looking for,] correct?
13:40:11FromDiscord<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:44FromDiscord<Recruit_main707> Ill ping you when i write it again so that you can have a look at it
13:47:46icyhmm ok so i'm trying to cross-compile for linux x86_64
13:47:51icyand i'm getting a ton of gcc errors
13:48:00icy>gcc: error: stdlib_parseopt.nim.c.o: No such file or directory
13:48:04icyand so on
13:58:17FromDiscord<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:59FromGitter<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:22FromDiscord<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:31FromDiscord<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:16FromDiscord<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:39bungyou 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:49FromDiscord<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:36bungI cant find where is partial function using template documented
15:02:43*sagax joined #nim
15:04:10shashlick@bung don't they have a pure C header?
15:05:36bungshashlick they have only one c++ header as interface to end user, but also included in c header
15:11:35shashlickYou can exclude it using cExclude
15:12:25*kungtotte quit (Read error: Connection reset by peer)
15:13:50FromGitter<bung87> I tried before cExclude not sure that's correct, still get error
15:13:58FromGitter<bung87> before cImport
15:14:01*kungtotte joined #nim
15:19:43*marnix joined #nim
15:20:15FromDiscord<FinnT730> does nim have a build-in render API?
15:20:47FromGitter<bung87> render what ?
15:21:10FromDiscord<FinnT730> like a screen and shapes and stuff like that
15:22:13FromGitter<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:28icyhey so the process of cross-compiling is basically just copying over the contents of nimcache and running the shell script right?
15:39:16icyi'm trying to build my program for Linux x86_64 from an OpenBSD host
15:39:18FromDiscord<Yardanico> Well that's usually not what cross compiling is :P
15:39:38FromDiscord<Yardanico> It's when you for example build a Windows binary while being on Linux
15:39:47FromDiscord<Yardanico> But you need a C compiler which allows for that
15:39:51icyi mean, yeah lol
15:40:04icyi ran 'nim c --nimcache:nimcache --cpu:amd64 --os:linux --compileOnly --genScript --cc:gcc myprogram.nim'
15:40:19FromDiscord<Yardanico> Well that's for making the C files to compile on the target machine
15:40:22icyyeah
15:40:37icyhow do i cross compile a binary that'll run on Linux x64 then?
15:41:44FromDiscord<Yardanico> You need a C compiler for OpenBSD which can make Linux binaries
15:41:58icyhmmmm
15:42:16icycan gcc do that?
15:42:16FromDiscord<Yardanico> For e.g Linux -> Windows there's mingw
15:42:39icyoh right
15:42:45FromDiscord<Yardanico> Well yes it can probably, but you'll need to recompile it so it emits Linux binaries
15:42:58FromDiscord<Yardanico> I think it would be better if you ask in a OpenBSD community
15:43:10icyyeah just shot question on #openbsd :D
15:43:13FromDiscord<Yardanico> About generally cross compiling C applications on OpenBSD to Linux
15:43:22icyalrighty
15:43:51*vsantana_ joined #nim
15:44:29FromDiscord<Yardanico> Also you could use CIs to make Linux binaries
15:46:22*vsantana quit (Ping timeout: 260 seconds)
15:46:36icyYardanico: what about the approach i was taking initially -- just building the C files on the target host?
15:47:01icyit's not a binary, but it's still fine
15:47:09FromDiscord<Yardanico> Well that's not true cross compiling since you'll still compile C files on the Linux target
15:47:14FromDiscord<Yardanico> But if you're fine with it - use it
15:47:21icyyeah that's fine for now, i think
15:47:34icybut i'm running into issues with it
15:47:57icyi get a ton of gcc errors on the target host
15:48:23icy'gcc: error: stdlib_system.nim.c.o: No such file or directory
15:48:27icyand so on
15:55:39icyhere's the full error dump: https://termbin.com/w2uy
16:01:24FromDiscord<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:02FromDiscord<Shucks> Do I need to call NimMain with `nim cpp`?
16:04:24FromDiscord<Zachary Carter> no
16:04:34*couven92 quit (Ping timeout: 260 seconds)
16:05:35FromDiscord<Shucks> Interesting
16:05:44Yardanico"nim cpp" is still stand-alone
16:05:51Yardanicoyou don't need any C++ code to use the C++ backend :P
16:05:57Yardanicomost nim libs should work with C++ backend just fine
16:06:24shashlick@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:14FromDiscord<kodkuce> https://media.discordapp.net/attachments/371759389889003532/735166754162081822/2020-07-21_180801.png
16:10:23FromDiscord<kodkuce> what does this AsyncFD mean
16:10:38Yardanicobut does it compile? :P
16:11:45Yardanicoah, in your case I think you're using the wrong proc
16:12:07Yardanicohttps://nim-lang.org/docs/smtp.html#connect%2CAsyncSmtp%2Cstring%2CPort you need to use this connect
16:12:28Yardanicoor maybe nimsuggest is acting for you again
16:12:39Yardanicoas I said - nimsuggest does have bugs where it reports errors when there are no errors
16:12:56Yardanicothe only "true" way to check if your code is correct for now is to run "nim c file.nim" :)
16:13:01Yardanicowell, mostly correct
16:14:41*mbuchel joined #nim
16:15:59FromDiscord<Rika> AsyncFD means asynchronous file descriptor I assume
16:16:19Yardanicoyes
16:17:12*NimBot joined #nim
16:19:23FromDiscord<kodkuce> sorry was alt tab yep it compiles with no error
16:19:32FromDiscord<kodkuce> guess nimsuggest bonkers?
16:20:23Yardanicoyes
16:20:49FromDiscord<kodkuce> ye i just ask cuz dont want to build up issues form start 🙂
16:20:59YardanicoJust try to compile with nim
16:21:02Yardanicodon't always trust nimsuggest
16:21:14*narimiran_ quit (Ping timeout: 256 seconds)
16:21:52FromDiscord<kodkuce> ok 1 question too , how to disable that compile itself output
16:22:01Yardanico?
16:22:48FromDiscord<kodkuce> like all libs its compiling bla bla ...
16:22:54FromDiscord<demotomohiro> nim c foo.nim > /dev/null
16:22:56FromDiscord<demotomohiro> ?
16:23:03FromDiscord<kodkuce> nah
16:23:31FromGitter<ynfle> `--hint[Procissing]:off --hint[CC]:off`
16:23:50ForumUpdaterBotNew thread by Quetzalb: ARC: Calling default destructor of embedded field from a destructor, see https://forum.nim-lang.org/t/6566
16:23:54FromDiscord<kodkuce> CC: stdlib_assertions.nim↵CC: stdlib_io.nim↵CC: stdlib_system.nim
16:23:56Yardanico--hints:off -w:off --verbosity:0
16:23:58Yardanicowill disable everything
16:23:59FromDiscord<kodkuce> like this ones
16:24:00Yardanicofor sure
16:24:05FromDiscord<kodkuce> --verbosity i guess
16:24:30FromGitter<ynfle> --verbosity won't turn of proccesing I think
16:24:37YardanicoI specified all 3
16:24:40Yardanico"--hints:off -w:off --verbosity:0" together
16:25:03YardanicoIt'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:00FromDiscord<kodkuce> i want to still have waringings and hits so i have reason to cry here 🙂
16:28:33FromDiscord<demotomohiro> On windows, `stdout.write"あ"` print "あ" correctly when compiled with `nim c` but not with `nim cpp`.
16:28:56FromDiscord<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:31FromDiscord<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:55disruptek!last araq
16:43:56disbotAraq 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:05disruptek!last clyybber
16:44:06disbotclyybber spoke in 12#nim 24 hours ago 12https://irclogs.nim-lang.org/20-07-2020.html#16:39:35
16:44:34FromDiscord<Yardanico> !last disbot
16:44:35disbotdisbot joined 12#disruptek 3 hours ago and last spoke 718 weeks ago
16:44:42FromDiscord<Yardanico> Ok
16:59:46FromDiscord<Clyybber> !last disruptek
16:59:47disbotdisruptek spoke in 12#nim 15 minutes ago 12https://irclogs.nim-lang.org/21-07-2020.html#16:44:05
17:00:10disruptekis sinkInference expected to sometimes break code?
17:00:26FromDiscord<Clyybber> yeah, but at compile time
17:00:53disrupteklol ofc
17:01:06FromDiscord<Clyybber> I mean, if it breaks code that compiles its a bug
17:01:08*Kaivo quit (Quit: WeeChat 2.8)
17:01:18FromDiscord<Clyybber> eh, you know what I mean :p
17:01:19disruptekoh, well cps breaks it, then.
17:01:48disrupteki think the test.nim.cfg includes the switch to turn it off, so you'd want to remove that.
17:01:56FromDiscord<Clyybber> yeah, I saw that
17:02:12disrupteknice, i didn't know you were watching the repo.
17:02:33FromDiscord<Clyybber> I'm watching all your steps
17:02:34FromDiscord<Clyybber> :p
17:02:51FromDiscord<Clyybber> does it say something about type mismatch?
17:02:59FromDiscord<Clyybber> with sinkinference I mean
17:03:07disruptekyeah, due to the filter predicate.
17:03:42FromDiscord<Clyybber> hmm, maybe just add {.nosinks.}
17:05:26disrupteki guess that works.
17:05:37disruptekbut i'll want to remove that ultimately.
17:05:50disrupteki mean, it's just ct shit, so it doesn't matter, really.
17:06:02FromDiscord<Clyybber> yeah
17:07:12*endragor joined #nim
17:08:34disruptekthe event queue needs to work differently according to the spec.
17:08:53FromDiscord<Clyybber> your spec?
17:09:05disrupteknah, the papers. i think i can just make it an ordered table, though.
17:09:11FromDiscord<Clyybber> Araq: Regarding https://github.com/nim-lang/RFCs/issues/234#issuecomment-661987316, notice that its `ref var` not `var ref`
17:09:12disbotAdd write-tracking to Nim's func ; snippet at 12https://play.nim-lang.org/#ix=2pg3
17:09:27FromDiscord<Clyybber> disruptek: Ah
17:09:43disruptekit'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:36disrupteki thought a proc with an Empty body was a prototype.
17:23:07FromDiscord<Clyybber> is it not?
17:23:27disruptekwell, it provokes an issue with my gensym'd name.
17:23:52disruptekso i'm not sure how i'm supposed to write this, though an empty statement list somehow works.
17:24:24disruptekthis bozo is /still/ trying to login to my freenode account.
17:28:29FromDiscord<Zachary Carter> it's me
17:28:34disruptekwell, cut it out.
17:29:24FromDiscord<Zachary Carter> man - playing with C++ interop makes me want more
17:29:56FromDiscord<Zachary Carter> overriding virtual functions would be so sweet
17:34:03disruptekthat's kinda how i feel about transexuals.
17:34:29FromDiscord<Zachary Carter> let's just not
17:36:28disrupteksuite yourself.
17:36:44shashlickZ if you are into c++, maybe some nimterop PRs will be cool :D
17:37:38*vsantana_ joined #nim
17:37:58FromDiscord<Zachary Carter> shashlick: I wouldn't even know where to start
17:38:02*Trustable quit (Remote host closed the connection)
17:38:11FromDiscord<Zachary Carter> I'm using nimline right now - which has been working out well
17:38:41shashlickthat's good
17:40:04*vsantana quit (Ping timeout: 240 seconds)
17:41:45*buyfn joined #nim
17:41:47FromDiscord<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:58FromDiscord<Avatarfighter> Im curious to know but how would one import/use cpp classes with nim?
17:45:22FromDiscord<Zachary Carter> importcpp
17:45:32*buyfn quit (Client Quit)
17:47:57FromDiscord<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:23FromDiscord<Avatarfighter> Thanks guys
17:55:38FromDiscord<Avatarfighter> i wasnt sure how to so i never have
18:01:37shashlick@zachary carter well the main thing is knowing what a given c++ syntax maps to in Nim
18:02:10shashlickThen you put that in an h file, run toast with -a - mcpp and see what the tree sitter ast looks like
18:02:16shashlickThen mapping that to Nim
18:02:50shashlickSince c is already supported, there's a lot of helpers already available
18:03:06shashlickBut ya if you are making progress with Nimlime, I can understand if you aren't keen
18:06:45*endragor joined #nim
18:11:44FromDiscord<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:17ForumUpdaterBotNew thread by ShalokShalom: Compile time check for let , see https://forum.nim-lang.org/t/6567
18:17:48FromDiscord<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:09disrupteksounds like it.
18:19:32*Vladar joined #nim
18:22:31disruptekdoes anyone have any evidence that condition variables work?
18:22:45FromDiscord<Clyybber> depends on what you mean by that
18:23:20FromDiscord<Clyybber> you mean wrapping CPP ones?
18:23:28disruptekno; locks.Cond
18:24:14FromDiscord<Clyybber> they should
18:25:11FromDiscord<Clyybber> threadpool uses them
18:25:26disruptekokay, 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:45alehander92c
19:08:52*endragor joined #nim
19:08:54alehander92i 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:12FromDiscord<Recruit_main707> Can you access from a pragma in a type definition all the procs/methods that have it as argument?
19:19:39alehander92iii doubt it
19:20:16alehander92you can staticread files and .. try to analyze them
19:20:22alehander92but probably not what you want?
19:21:46FromDiscord<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:26FromDiscord<Recruit_main707> (just like Zachary)↵But i am thinking pf possible solutions, hopefully cleaner then emit
19:22:29Yardanico@Recruit_main707 I don't think so if you mean access all procs/methods which use that type
19:22:46alehander92you probably need to define them in a block
19:22:51Yardanicowell yeah, that'd work
19:23:56FromDiscord<Recruit_main707> And passing that block to the pragma/macro i guess
19:24:36FromGitter<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:52FromDiscord<Clyybber> toSeq is a template so thats probably why
19:26:40FromGitter<deech> So how do I fix it?
19:26:59Yardanicowhy do you need toOpenArray here?
19:27:24FromGitter<deech> I didn't know how else to get from `UncheckedArray` to `seq`.
19:27:31Yardanicoah, not a problem
19:27:56Yardanicovar myseq = newSeqUnitialized(lenofuncheckedarray)
19:28:12*marnix joined #nim
19:28:29Yardanicoand then copyMem I guess
19:28:31Yardanicofor most performance
19:28:56FromGitter<deech> I see, I'll try that. What was wrong with how I had it?
19:29:13YardanicoopenArray is not a "real" nim type
19:29:20FromGitter<awr1> it could be in the future though
19:29:22Yardanicoe.g. right now you can't have fields in objects with openarray type
19:29:23Yardanicoyes
19:29:25FromGitter<awr1> https://github.com/nim-lang/RFCs/issues/88
19:29:27disbotmake openArray first-class ; snippet at 12https://play.nim-lang.org/#ix=200S
19:29:40Yardanicoyeah I know
19:29:48YardanicoI read most github notifications :D
19:30:50FromDiscord<Recruit_main707> I think OpenArray is fine as it is
19:30:51FromGitter<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:18FromDiscord<Recruit_main707> Thats true, id like to have uncheckedArray slices
19:31:33FromGitter<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:45shashlick@awr1 is that nimterop pr done?
19:33:22FromGitter<awr1> the int literal one?
19:33:23FromGitter<awr1> should be
19:34:22FromGitter<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:48shashlickOk I'll take a look later today
19:35:12*rockcavera quit (Remote host closed the connection)
19:35:26Yardanico@awr1 I don't think it's a lot, but whose who use it, use it a lot :)
19:35:31Yardanicoso it's actually pretty usable
19:35:33alehander92i did use it
19:35:38alehander92for a long time
19:35:39*deech quit (Read error: Connection reset by peer)
19:36:41FromGitter<deech> Ok I also found `add` in `system.nim` that can concatenate a `seq` to an `openArray`.
19:37:12FromGitter<awr1> i wonder if anyone had ever pushed for nimterop to get JS lib support. or something similar
19:37:15Yardanicobut for your case newSeqUninitialized + copyMem will be the fastest
19:37:18Yardanico@awr1 what for?
19:37:26Yardanicothere's emscripten if you want C libraries in the browser
19:37:41alehander92awr1 i think this is the dts2nim idea
19:37:52Yardanicocompiling C into JS (not into wasm) is far from trivial
19:37:56alehander92there were ideas to do that in a more updated to modern nim way
19:37:57Yardanicothere was asm.js which did that kinda
19:37:59FromGitter<awr1> nooo i mean like
19:38:01alehander92no yardanico
19:38:08alehander92it's about typescript definitions mapping to nim ones
19:38:12Yardanico???
19:38:14alehander92and yes dts2nim does it
19:38:20alehander92but this needs some update
19:38:21Yardanicoahh
19:38:25YardanicoI understood, yeah
19:38:29FromGitter<awr1> say you like want ember.js or w/e bindings in nim
19:38:30FromGitter<awr1> ya
19:38:30alehander92and i think it can be done as more purely nim tool
19:38:36alehander92but somebody has to do it
19:38:47alehander92if you export the json of the ast
19:39:11alehander92and then just reuse the compiler renderer + do the other needed mapping logic directly in (cbackend) nim binary
19:39:45FromGitter<awr1> maybe tree-sitter could be used for such a tool, like what nimterop already ddoes
19:41:18alehander92maybe, but there seem to be very good typescript libs for that
19:41:26alehander92but yeah treesitter might be also a good option
19:41:32alehander92if it supports it good idea
19:41:54alehander92it needs some ability to configure stuff
19:42:00alehander92e.g. how to map Number for a lib
19:42:04alehander92number
19:43:27FromGitter<awr1> github uses tree-sitter for their language integration things
19:43:31FromGitter<awr1> i'm pretty sure it works w/ typescript
19:44:56FromGitter<awr1> https://docs.github.com/en/github/managing-files-in-a-repository/navigating-code-on-github
19:45:22FromGitter<awr1> so i imagine typesitter work pretty well with TS
19:45:27FromGitter<awr1> *treesitter
19:45:36alehander92yeah , i also thought about writing a more universal linter based on that
19:45:51alehander92inspired by rubocop and adaptations of its cops to nim
19:46:12alehander92i am a bit surprised
19:46:19alehander92there isn't a ML linter startup
19:46:26alehander92probably there is and i don't know that
19:46:39FromGitter<awr1> also i was not aware of dts2nim
19:47:07alehander92it needs mostly
19:47:13alehander92to also map any to JsObject
19:47:25alehander92the promise/future stuff (not sure if it does it)
19:47:34alehander92and maybe something more that i am missing
19:47:48alehander92ah stuff like `{x: ..}`
19:47:58alehander92can be mapped to something like a `jsobject(x=..)` macro
19:48:04alehander92returning a new type
19:48:16FromGitter<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:17alehander92which seems useful for apis
19:48:26alehander92i dont like that so much
19:48:40alehander92i think it's better to manually review/finalize such things
19:48:45alehander92but it does sound good on theory
19:49:01alehander92especially with ts where you dont depend on local os so much
19:51:20FromDiscord<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:06Yardanicothat's due to zig
19:52:19Yardanicoit enabled ubsan with trap-on-undefined-behaviour by default
19:52:32Yardanicoand apparently it thinks Nim's gc has "undefined behaviour" because it does some stack manipulation
19:52:40Yardanicoenables*
19:53:10Yardanicoand it won't happen without -d:release because zig cc only enables it with -O3
19:53:40YardanicoSee https://forum.nim-lang.org/t/6362
19:55:47Yardanicosee https://github.com/ziglang/zig/wiki/FAQ#why-do-i-get-illegal-instruction-when-using-with-zig-cc-to-build-c-code
19:56:29FromDiscord<Anuke> I'm using `mingw32-gcc` for compiling, is zig still somehow involved?
19:56:33Yardanicohuh
19:56:36Yardanicothen I don't know :D
19:56:40FromDiscord<Anuke> oh no
19:56:44Yardanicowell I have a guess
19:57:03Yardanicoit might be because you have -march=something and not "-march=generic" which is default
19:57:26YardanicoSIGILL 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:33Yardanicoso it fails with SIGILL because there's no such instruction on that CPU
19:58:14Yardanicoalso SIGILL can occur due to a C compiler bug :D
20:00:40FromDiscord<Anuke> I'm specifying `--cpu:i386` and `--os:windows`, but not much else platform specific
20:00:44Yardanicohuh
20:00:57Yardanicomaybe one of the libs you're using specifies march native?
20:01:44FromDiscord<ShalokShalom> How is Zig related to Nim?
20:01:53Yardanicozig cc can be used for cross-compilation of any C projects
20:02:00Yardanicoso you can cross-compile nim applications with zig cc
20:04:12FromDiscord<Anuke> interestingly, it initializes a GLFW window successfully before it crashes
20:04:30Yardanicowell if you don't have any -march=native I really think it's a C compiler bug
20:04:34Yardanicoit's not as uncommon as you think
20:05:13FromDiscord<Anuke> guess I'll just stick with mediocre-performance win32 builds for now
20:06:39Yardanicowell you can try -O23
20:06:41Yardanico-O2 *
20:06:50FromDiscord<ShalokShalom> And why would you want to compile with Zig cc?
20:06:58Yardanicoto have easier cross-compilation
20:07:51Yardanicoircord (my discord-irc bot used on this discord server) runs on the nim vps with relatively older glibc
20:07:55Yardanicoand I can't natively compile it from my artix
20:08:01Yardanicoso I had to use zig cc to target lower glibc
20:08:41Yardanicoand no static builds because of openssl
20:08:52Yardanicoof course I could statically link libressl, but that's harder and a security risk
20:09:09*Senketsu joined #nim
20:09:14Yardanico(I mean I have done it in the past anyway)
20:10:10Yardanicoi don't really like zig as a language, but zig cc is a nice convenience thing
20:11:26FromDiscord<Anuke> is using an older version of glibc with zig-cc as easy as specifying the correct executable and target?
20:11:44Yardanicoyou just specify the correct target
20:11:49Yardanicohttps://github.com/Yardanico/ircord/blob/master/zig-compile-vps.sh
20:11:55Yardanicoand yes I had to use -O2 because of the SIGILL thing
20:13:48FromDiscord<Anuke> interestingly, passing O2 makes it crash for me
20:13:57FromDiscord<Anuke> (with minGW)
20:19:00*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
20:21:11FromGitter<awr1> the default flags passed to `zig cc` should likely be changed then
20:21:41FromDiscord<ShalokShalom> @Yardanico[IRC]#0000 thanks
20:21:57Yardanico@awr1 yeah but nim doesn't have a concept of "zig cc" anymore really
20:22:07Yardanicobecause zig cc is mostly clang
20:22:14Yardanicojust with a few additional options for cross-compiling
20:22:25FromGitter<awr1> why? was it removed?
20:22:28Yardanicobecause it's clang
20:22:38YardanicoYou don't need additional support in the nim compiler for it really
20:22:48Yardanicoit's basically clang with different glibc headers + musl sources + win headers + some more stuff bundled together
20:23:17Yardanicowait wtf
20:23:18Yardanicohttps://www.wikidata.org/wiki/Q60678874
20:23:35FromDiscord<Avatarfighter> YOOO
20:23:37*Lord_Nightmare joined #nim
20:23:38FromDiscord<Avatarfighter> Araq is famous
20:23:50Yardanicowell wikidata is actually a cool project
20:23:58Yardanicoit's about facts which are easier to parse/process by machines
20:24:01Yardanicoby computers
20:24:05FromDiscord<Avatarfighter> yeah ik 😛
20:24:18FromDiscord<Avatarfighter> Still if Wikidata has Araq, he is famous
20:24:23FromDiscord<Avatarfighter> famous to humans and machines alike
20:24:28Yardaniconot wikipedia tho yet :C
20:26:30FromGitter<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:31FromGitter<awr1> https://github.com/nim-lang/Nim/blob/49d4b50fe52f0e961ef367a44be8b1bd79994a03/compiler/extccomp.nim#L135
20:26:56FromDiscord<ShalokShalom> Araq is Andreas?
20:26:56FromGitter<awr1> if you want to also define `clang` for compatibility puposes, that's fine too.
20:27:09FromDiscord<ShalokShalom> Yeah..
20:27:19Yardanicoyes :P
20:27:27Yardanico@shalokShalom i meant to reply to your question
20:27:29FromGitter<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:42Yardanicothen almost all compilers are "gccLike"
20:27:49FromGitter<awr1> MSVC is not gcc like
20:27:53Yardanico"almost"
20:28:17FromGitter<awr1> MSVC is the most important and most popular non-gcc-like compiler
20:28:27YardanicoI still like Clang more :P
20:28:43FromGitter<awr1> clang relative to what? zig cc? or gcc
20:28:50Yardanicoto gcc and msvc :P
20:29:03FromGitter<awr1> well, yes. LLVM is quite nice
20:29:06Yardanicoabout zig addition - see https://github.com/nim-lang/Nim/pull/13757
20:29:07disbotAdd support for `zig cc` as C compiler.
20:29:23Yardanicoabout zig removal - see https://github.com/nim-lang/Nim/commit/1b2b32169a5d8089a50509136a31b5ceb3773994
20:30:00FromGitter<awr1> :[
20:30:07*hyiltiz quit (Ping timeout: 260 seconds)
20:34:49FromGitter<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:25shashlickTree sitter can parse Javascript
20:39:57shashlickThat's one of the reasons I use it
20:40:14shashlickCan parse a variety of languages
20:42:32*maier quit (Ping timeout: 256 seconds)
20:42:37FromDiscord<ShalokShalom> @awr1[Gitter]#0000 Why not adding that support to Godot?
20:43:15FromGitter<awr1> can you elaborate?
20:43:51FromGitter<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:04FromDiscord<ShalokShalom> So far as I know, has it no console support at all
20:45:10FromDiscord<ShalokShalom> Due to licensing issues
20:45:47FromDiscord<ShalokShalom> And Godot has Nim bindings, via GodotNative
20:47:17FromGitter<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:19FromGitter<awr1> https://github.com/ConfettiFX/The-Forge
20:47:58YardanicoI heard some developers made their own godot templates for consoles
20:48:06Yardanicobut they couldn't open-source them because of NDKs of course
20:48:08FromGitter<awr1> and then give these patches out for developers on request and proof of accrediting with nintendo, sony, etc.
20:48:42FromDiscord<ShalokShalom> https://docs.godotengine.org/en/stable/tutorials/platform/consoles.html
20:48:44*marnix quit (Ping timeout: 240 seconds)
20:48:49FromDiscord<ShalokShalom> @awr1[Gitter]#0000 interesting
20:49:03FromGitter<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:49FromDiscord<ShalokShalom> I would actually be fine with a non open source binary that could convert my games to consoles
20:50:01FromDiscord<ShalokShalom> @awr1[Gitter]#0000 Yeah
20:50:22FromGitter<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:25FromGitter<awr1> what's the term im looking for
20:50:30FromGitter<awr1> publicly available source i think
20:51:34FromGitter<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:15FromDiscord<ShalokShalom> Unreal is publishing their source code, while thats about it
20:56:33FromDiscord<ShalokShalom> You are not allowed to redistribute
20:56:39FromGitter<awr1> unreal publishes their source code under a non-OSS license, yeah.
20:56:44FromDiscord<ShalokShalom> You can only fix bugs and send it to them
20:56:55FromGitter<awr1> https://en.wikipedia.org/wiki/Source-available_software
20:57:00FromGitter<awr1> this is what i was thinking of
20:57:06Yardanicohuh I wonder why nim wiki page refers to github pages documentation (for devel)
20:57:07FromDiscord<ShalokShalom> Yes, exactly
20:57:12YardanicoI think I should change it so it refers to stable docs
20:57:22YardanicoI'm just doing some small changes to the nim's wiki page
20:57:26Yardanicosince it's outdated in some places a bit
20:57:37FromDiscord<ShalokShalom> Any ideas how to reorder learn and documentation?
20:58:05FromDiscord<ShalokShalom> Araq just wrote an hour ago he would welcome this
20:58:43FromDiscord<Varriount> ShalokShalom: Did he give any specifics, or just "better documentation would be nice"?
20:59:02FromDiscord<ShalokShalom> No, about the split nature of learn and documentation
20:59:32*a_b_m quit (Quit: Leaving)
20:59:56FromDiscord<ShalokShalom> So that we unite them, kinda
20:59:56Araqany opinions on https://github.com/nim-lang/RFCs/issues/234 and https://github.com/nim-lang/Nim/pull/15030 ?
20:59:57disbotwriting to a location counts as "side effect"; implements https://github.com/nim-lang/RFCs/issues/234
21:00:04FromDiscord<ShalokShalom> https://forum.nim-lang.org/t/6546#40621
21:00:15YardanicoAraq: will that change "func" to be closer to a "real" mathematical function?
21:00:33Yardanicoas in "same input = same output"
21:00:39AraqI guess
21:00:40FromDiscord<ShalokShalom> I am all for more functional programming
21:00:59FromDiscord<ShalokShalom> I thought thats already the case?
21:01:00YardanicoI think I'm for it since it'll make func more different than proc
21:01:08Yardanico@Shalok it's not
21:01:11FromDiscord<ShalokShalom> Isnt proc the inpure function?
21:01:18Araqit's not about whether you like it or not, we all like it
21:01:19FromGitter<awr1> I would like it if the keyword is different imo
21:01:28FromGitter<awr1> keep func strictly side-effect-less
21:01:33Araqit's how to do a transition period etc
21:02:35Yardanicolooooooool
21:02:40Yardanicofound this:
21:02:44Yardanicohttps://i.imgur.com/84UxPIL.png
21:03:17Araqyeah, well. I'm also Indiana Jones
21:05:52*buyfn joined #nim
21:06:29FromDiscord<ShalokShalom> https://media.discordapp.net/attachments/371759389889003532/735241307806498877/Screenshot_2020-07-21-23-06-18-94.jpg
21:06:57FromDiscord<ShalokShalom> @Yardanico[IRC]#0000 So the manual is ahead of the implementation?
21:07:06Yardanicono?
21:07:10Yardanicothe current implementation is this, yes
21:07:23Yardanicobut currently modifying a ref or var T argument doesn't count as a side effect
21:07:34FromDiscord<ShalokShalom> Aha
21:09:21*al1ranger joined #nim
21:09:38AraqYardanico: got a cursor inference bug for me?
21:09:46Yardanicosadly no, didn't have time :(
21:09:59Yardanicobut I'll surely minimize them :P
21:10:05Yardanicoor find another smaller lib which triggers it as well
21:10:18Yardanicoseems like I need to test libs which do some kind of traversal
21:10:44Yardanicoalthough I reported https://github.com/nim-lang/Nim/issues/15026 yesterday
21:10:46disbot[ARC] Weird exception behaviour from doAssertRaises ; snippet at 12https://play.nim-lang.org/#ix=204i
21:10:48Yardaniconot related to cursorifier though
21:11:00FromDiscord<ShalokShalom> I should have read the actual Github issues before 😅
21:11:29FromDiscord<ShalokShalom> But I think, it should also state in the documentation, how it does now.
21:11:41Yardanicohttps://nim-lang.org/docs/manual.html#pragmas-nosideeffect-pragma
21:12:06FromDiscord<ShalokShalom> The people are surprised by how it works, since the documentation tells otherwise.
21:12:11Yardanicoit doesn't?
21:12:18Yardanico". 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:29FromDiscord<ShalokShalom> As I just had shown in the screenshot.
21:12:43Yardanicoright now it is 100% true
21:12:47*tane quit (Ping timeout: 246 seconds)
21:12:49Yardanicofunc is just sugar for noSideEffect
21:13:00FromDiscord<ShalokShalom> https://forum.nim-lang.org/t/6546#40621
21:13:01Yardanicobut after that RFC it won't be
21:13:31FromDiscord<ShalokShalom> I mean, the documentation doesnt mention anything about those exceptions
21:13:45Yardaniconot sure that you mean, sorry :)
21:13:47Yardanicowhat*
21:13:50FromDiscord<ShalokShalom> When it says "no side-effects" I expect no side effects.
21:13:56Yardanicobut then there's https://nim-lang.org/docs/manual.html#pragmas-nosideeffect-pragma
21:14:12Yardanicoyeah, sure, a link to this location of the manual would be useful
21:14:29Yardanicofrom the func section
21:15:04FromDiscord<ShalokShalom> How long will the RFC take to take place?
21:15:14FromGitter<awr1> RE this: https://forum.nim-lang.org/t/6546#40621
21:15:16FromDiscord<ShalokShalom> Since it might be redundant then..
21:15:23FromGitter<awr1> we could make the front page a bit more interactive TBH
21:15:33FromDiscord<ShalokShalom> Yep
21:15:48FromGitter<awr1> maybe have tooltips on mouseover
21:16:20FromDiscord<ShalokShalom> I link the individual entries at the manual to the appropriate parts in the example
21:16:25FromDiscord<ShalokShalom> Mouse over is also nice
21:16:35FromDiscord<ShalokShalom> While I prefer actual documentation
21:16:52FromGitter<awr1> maybe you can click it and it will link to an appropiate part in nim manual
21:16:57Yardanicobtw, we had "run" button to run nim code in the playground on the old forum :)
21:17:04Yardanicowhich we don't have on the new forum
21:17:13FromGitter<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:24YardanicoI'm just saying this because at least the examples should have a link to the playground
21:17:25FromGitter<awr1> so that people don't completely miss it
21:17:29Yardanicoso people can experiment with them
21:17:44FromGitter<awr1> does the nim playground have an API?
21:17:57FromGitter<awr1> if so maybe we could embed it on the front page
21:18:04Yardanicowell yes it does
21:18:07Yardanico!eval echo 1 + 1
21:18:07*vsantana quit (Quit: leaving)
21:18:09NimBot2
21:18:12Yardaniconimbot uses it's API
21:18:28FromDiscord<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:31Yardanicobackend sources are in https://github.com/PMunch/nim-playground
21:18:48FromDiscord<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:53Yardanicothe /compile endpoint
21:19:02Yardanico@ShalokShalom wdym?
21:19:10FromDiscord<ShalokShalom> When people click on let, they might expect the article to array
21:19:18Yardanicohuh
21:19:27FromDiscord<ShalokShalom> So I suggest to add a section about let arrays here: https://nim-lang.org/docs/tut1.html#the-let-statement
21:19:30YardanicoI think we shouldn't clutter examples with too much interactivity
21:19:36Yardanicosince there's only a limited number of them
21:19:36FromDiscord<lqdev> then put the link at `[`
21:19:45FromGitter<awr1> if they click on `let`, show docs for `let`
21:19:49FromGitter<awr1> if they click on operator yeah
21:19:52FromGitter<awr1> show docs for array
21:20:07FromDiscord<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:30FromGitter<awr1> eh
21:20:41FromDiscord<lqdev> i don't think we should design for people without common sense.
21:20:52FromDiscord<ShalokShalom> Is there something to be said against an article about let array at the mentioned place?
21:21:05FromDiscord<lqdev> `let` is `let`.
21:21:10FromDiscord<lqdev> not an array.
21:21:13FromDiscord<Elegant Beef> there is no such thing as a let array afaik
21:21:15*buyfn joined #nim
21:21:19Yardanicoof course there isn't :P
21:21:24*buyfn quit (Client Quit)
21:21:25FromDiscord<Elegant Beef> there is the let keyword which gives imutabillity, and then an array
21:21:33FromDiscord<Elegant Beef> That's why it shouldnt be done
21:21:37FromDiscord<ShalokShalom> @lqdev I am new to programming and these kind of assumptions are what accumulate
21:21:43FromDiscord<lqdev> ah i see
21:21:43FromDiscord<Elegant Beef> teaching parts as a combined thing will only aid confusion
21:21:45FromGitter<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:47FromDiscord<ShalokShalom> And hurt a lot
21:21:57YardanicoI really don't think we should clutter examples with too much interactivity
21:22:15FromDiscord<ShalokShalom> @awr1[Gitter]#0000 I can not put that side by side with my editor
21:22:25FromGitter<awr1> hm?
21:22:26FromDiscord<ShalokShalom> @Yardanico[IRC]#0000 I agree
21:22:28FromGitter<awr1> elaborate
21:22:43FromDiscord<lqdev> while we're at it, we may give more examples by creating a combo box, like D's website.
21:22:48FromDiscord<ShalokShalom> A hover over requires my mouse to be constantly over it
21:23:24FromGitter<awr1> yes, i don't understand how that is a problem
21:23:30FromDiscord<Elegant Beef> Isnt that a moot point when you're reading what it is?
21:24:05FromDiscord<ShalokShalom> @awr1[Gitter]#0000 Since I cant put docs aside on my monitor and code on the other half
21:24:11FromDiscord<ShalokShalom> And always look over
21:24:49FromGitter<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:55FromGitter<awr1> also i thought we were just talking about the home page.
21:25:00FromDiscord<ShalokShalom> Thats why I think a link is ideal
21:25:10FromGitter<awr1> are you using the homepage for "robust documentation" or something
21:25:24FromDiscord<ShalokShalom> @awr1[Gitter]#0000 I know what you mean, and I was considering that as well
21:25:32FromDiscord<ShalokShalom> I am not against it
21:26:03FromDiscord<ShalokShalom> I just think a click on object should take on the object anchor, and so on
21:26:07FromDiscord<Elegant Beef> A link is a little weird as you're opening a milliion tabs to understand what everything does
21:26:26FromDiscord<Elegant Beef> We're talking about the minimal examples on the front page
21:26:26FromDiscord<ShalokShalom> I think it could quickly become too overwhelming with too many elements
21:26:44FromDiscord<ShalokShalom> @Elegant Beef why a million?
21:27:06FromDiscord<Elegant Beef> you'd want introspection on each keyword on the examples
21:27:08FromDiscord<ShalokShalom> I open that one that I am currently interested in and then I read it
21:27:25FromDiscord<Elegant Beef> so `import let object type for echo`
21:27:29FromDiscord<ShalokShalom> At least in the first example
21:27:30FromDiscord<Elegant Beef> Well not just keywords
21:27:31FromDiscord<Elegant Beef> but eitherway
21:27:42FromDiscord<ShalokShalom> And also arrays
21:27:51FromDiscord<ShalokShalom> All that could be interesting
21:28:01FromDiscord<ShalokShalom> "Oh, what does that thing"
21:28:06FromDiscord<Elegant Beef> But having to open to a new page is quite obnoxious
21:28:14FromDiscord<Elegant Beef> I think the hover is just better and more streamlined
21:28:17FromDiscord<Elegant Beef> If anyone is going to do it
21:28:31*solitudesf quit (Ping timeout: 246 seconds)
21:28:35FromDiscord<Elegant Beef> Leaving the current page to view docs is just bad UX
21:29:06FromDiscord<ShalokShalom> I honestly find it obnoxious to crawl through a lot of documentation just to find a simple explaination what = object does
21:29:18FromDiscord<ShalokShalom> And most of the available documentation doesnt explain it at all
21:29:30FromDiscord<Elegant Beef> Part 1 of the tutorial↵https://nim-lang.org/docs/tut1.html#advanced-types-objects
21:29:35FromDiscord<ShalokShalom> I know it
21:29:36FromDiscord<ShalokShalom> Now
21:29:44FromDiscord<Elegant Beef> part 1 of the **Tutorial**
21:29:51FromDiscord<ShalokShalom> Before, I was on "documentation"
21:30:05FromDiscord<ShalokShalom> Since it is kinda, where i hoped to find .. documentation
21:30:07FromDiscord<Elegant Beef> You're new to programming, shouldnt you be reading the tutorial
21:30:30FromDiscord<ShalokShalom> I assumed the tab learn leads to books and similar stuff
21:30:32FromDiscord<Elegant Beef> Documentation is mostly dedicated to explaining modules
21:30:38FromDiscord<ShalokShalom> Yeah
21:30:45FromDiscord<ShalokShalom> This is novel
21:31:07FromDiscord<Elegant Beef> But the manual also has objects
21:31:20FromDiscord<ShalokShalom> When you put "Tutorials" to "Documentation" it would be perfectly fine
21:31:31FromDiscord<Elegant Beef> But they arent the same
21:31:59FromDiscord<Elegant Beef> Take the previous link against↵https://nim-lang.org/docs/manual.html#types-tuples-and-object-types
21:32:08FromDiscord<ShalokShalom> @Elegant Beef No, it uses objects
21:32:18FromDiscord<ShalokShalom> The manual has no explanation to them
21:32:27FromDiscord<ShalokShalom> It just assumes you know them.
21:32:34Yardanicomanual is not a tutorial
21:32:53Yardanicoit's kind of a language spec/explanation :P
21:33:09Yardanico"This document describes the lexis, the syntax, and the semantics of the Nim language."
21:33:25Yardanicowait, and what do you mean manual has no objects? it does
21:33:29Yardanicohttps://nim-lang.org/docs/manual.html#types-tuples-and-object-types
21:33:44FromDiscord<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:57FromDiscord<ShalokShalom> Yeah, I used search function and looked for objects, and not object
21:35:14FromDiscord<ShalokShalom> @Elegant Beef The problem was not, that I didnt read that
21:35:16Yardanicoif you search for "objects" that section of the manual is the third result
21:35:33Yardanicohttps://i.imgur.com/BTHXEjs.png
21:35:34FromDiscord<ShalokShalom> The problem was, that the tutorial was hidden under "Learn"
21:35:45Yardanicouhh
21:35:46FromDiscord<Elegant Beef> Well what are you doing
21:35:50Yardanicothere's literally a "learn nim" button :P
21:35:50FromDiscord<Elegant Beef> You're learning nim?
21:35:58FromDiscord<ShalokShalom> I studied the "Documentation" page
21:36:01YardanicoI agree, the color of it isn't the best
21:36:03Yardanicohttps://i.imgur.com/7vSKKZI.png
21:36:19Yardanicoand we already discussed making it bigger
21:36:23FromDiscord<Elegant Beef> Yard that's non normal colour 😄
21:36:25FromDiscord<ShalokShalom> Its not about the color
21:36:32FromDiscord<Elegant Beef> https://media.discordapp.net/attachments/371759389889003532/735248874133782658/unknown.png
21:36:40FromDiscord<ShalokShalom> I expected to find everything under the documentation button
21:36:48FromDiscord<Elegant Beef> You do
21:37:02FromDiscord<ShalokShalom> I didnt thought, that there is documentation outside of the documentation page
21:37:19Yardanicowell there shouldn't be links to ALL documentation pages or it would be too much
21:37:49FromDiscord<ShalokShalom> Well....
21:37:58FromDiscord<ShalokShalom> Thats what we are thinking about now
21:38:04FromDiscord<ShalokShalom> How to improve that
21:39:21FromDiscord<ShalokShalom> And obviously, the beginner stuff is suitable to be placed upfront and most obvious
21:39:52FromDiscord<ShalokShalom> Since professionals and people who know the language, will have no problem finding more professional lecture, like the index.
21:40:27FromGitter<awr1> i made a mockup of what i was suggesting
21:40:28FromGitter<awr1> https://ibb.co/6bnmr5r
21:40:41FromDiscord<Elegant Beef> Yea awr1 i like that idea
21:40:56FromDiscord<ShalokShalom> The Nin Style Guide, as an example, is something that barley everybody will ever use
21:41:13FromDiscord<ShalokShalom> So long as I can click it...
21:41:30FromDiscord<Varriount> I would honestly prefer merging the "learn" and "documentation" pages, but that's just me.
21:41:34FromDiscord<ShalokShalom> @awr1[Gitter]#0000 thanks
21:41:36Yardaniconim style guide is something you learn to use subconsciously :P
21:41:46Yardanico@Varriount yeah that might be a good idea
21:41:46FromDiscord<ShalokShalom> @Varriount yes, totally
21:42:10FromDiscord<ShalokShalom> And I would put Index and Style guide and that like under "development"
21:42:10FromDiscord<Elegant Beef> Although it'll be relatively large page
21:42:11FromDiscord<Varriount> You can learn quite a lot of the language just by reading the manual.
21:42:18FromDiscord<ShalokShalom> And also put the source there
21:42:40FromDiscord<Varriount> @Elegant Beef that's what table-of-contents are for
21:42:40FromDiscord<ShalokShalom> @Varriount It actually caused more the desire to quite the language for me
21:42:54FromDiscord<Elegant Beef> quit?
21:43:05FromDiscord<Varriount> @ShalokShalom Why?
21:43:06FromDiscord<ShalokShalom> Yeah
21:43:24FromDiscord<ShalokShalom> @Varriount Because I assumed it was meant to be the tutorial
21:43:32Yardanicoit doesn't specify that it's a tutorial
21:43:47FromDiscord<ShalokShalom> Now, as I know the true tutorial, I can see the purpose of the manual
21:43:48FromDiscord<Elegant Beef> I see what you're saying but there is a learn section you apparently didnt click
21:43:55FromDiscord<ShalokShalom> And although it looks messy, it makes sense
21:44:11FromDiscord<ShalokShalom> @Elegant Beef Yep, because I clicked on the documentation section
21:44:31FromDiscord<Elegant Beef> What were you doing, learning, why didnt you click learn?
21:44:31FromDiscord<ShalokShalom> Other pages/languages have books and courses under "learn"
21:44:37Yardanicowe have that too
21:44:46FromDiscord<ShalokShalom> Tutorial and manual are actually very close to each other
21:45:09FromDiscord<ShalokShalom> @Elegant Beef because until, all projects had it under documentation
21:45:12FromDiscord<Elegant Beef> When i first found nim the first thing i did was click learn, so im trying to understand the disconnect
21:45:25FromDiscord<Elegant Beef> I guess, learned behaviour to not click learn 😛
21:45:31FromDiscord<ShalokShalom> I honestly just saw docu first
21:45:45FromDiscord<ShalokShalom> It was on the phone, saw documentation and was happy
21:45:47Yardanicook, I agree that we should probably merge learn and docs
21:45:54YardanicoI don't agree with some of other changes :P
21:46:05FromDiscord<ShalokShalom> Never would I have thought that there is a separate section with actual beginner friendly content
21:46:46FromDiscord<Elegant Beef> Yard you dont like the interactive code blocks on front page?
21:46:56FromDiscord<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:21FromGitter<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:25FromDiscord<ShalokShalom> All the stuff that casual people, who just use the language, dont really use
21:47:40FromDiscord<ShalokShalom> @awr1[Gitter]#0000 feel sorry for you
21:47:42Yardanico@Elegant well, I just think that adding too much of that stuff might make it harder to follow
21:47:42FromDiscord<Elegant Beef> I mean some of the style guide is nice to take
21:47:46YardanicoI like PMunch's idea much more
21:47:50Yardanicoabout playground interactive tours
21:47:51FromDiscord<Elegant Beef> What's his idea?
21:47:54FromDiscord<Elegant Beef> Ah
21:47:57FromGitter<awr1> this was a year or so ago lol. i never got around to redoing it
21:47:58FromDiscord<Elegant Beef> Yea that's nice too
21:48:03Yardanicothat might be a much better way to introduce people to the language
21:48:08Yardanicoand it offers full interactivity
21:48:16Yardanicoand it can explain all keywords in each example
21:48:33FromDiscord<ShalokShalom> @Yardanico[IRC]#0000 I actually think about doing something like that for complete newbies
21:48:39FromDiscord<ShalokShalom> Once I am past that myself
21:48:41FromDiscord<Elegant Beef> sent a code paste, see https://play.nim-lang.org/#ix=209I
21:48:44Yardanicodid you see https://narimiran.github.io/nim-basics/ ?
21:48:46FromDiscord<ShalokShalom> Haha
21:48:51FromDiscord<ShalokShalom> Yes
21:49:03FromDiscord<ShalokShalom> I think the tutorial is the best
21:49:10Yardanico@Elegant well not really
21:49:13FromDiscord<ShalokShalom> Of all the docu I had seem yet
21:49:16FromDiscord<ShalokShalom> For me
21:49:30Yardanicowe don't really have a pure vs non-pure differentiation I think
21:49:37FromDiscord<ShalokShalom> @Yardanico[IRC]#0000 we could also incorporate videos..
21:49:42Yardanicowell yes, there are videos
21:49:51FromDiscord<Elegant Beef> What do you mean yard?
21:49:54Yardanicobut I personally don't like the idea of learning something by videos
21:49:57FromDiscord<Elegant Beef> There is clearly a differentiation on there
21:50:02Yardanico@Elegant there's no reason to use some prefix anymore
21:50:05FromGitter<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:06FromDiscord<Elegant Beef> https://media.discordapp.net/attachments/371759389889003532/735252282001588234/unknown.png
21:50:10FromDiscord<Elegant Beef> Ah
21:50:29FromDiscord<ShalokShalom> @awr1[Gitter]#0000 oh yeah
21:50:30FromGitter<awr1> just as a way to show "this is how you make things public!"
21:50:32FromDiscord<ShalokShalom> Good idea
21:50:44FromGitter<awr1> it's confused some people in the past before.
21:51:01FromDiscord<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:06YardanicoI know
21:51:11YardanicoI didn't say "we shouldn't include the videos"
21:51:11FromDiscord<ShalokShalom> Visually, practically, etc
21:51:27Yardanicoit's totally okay to add a "videos" section to learn
21:51:33Yardanicoand you should probably make an RFC instead
21:51:41Yardanicothis is a real-time chat after all
21:51:50Yardanicowith RFC you'll get more actual feedback with pros/cons, etc
21:51:57FromGitter<awr1> if you do want to have the nim playground on the home page
21:52:05FromGitter<awr1> really it should expand to be full screen
21:52:19FromGitter<awr1> well not full screen but it should hide the ad text.
21:52:22FromDiscord<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:49FromDiscord<ShalokShalom> There is at least one part in the documentation, where this is skipped
21:53:13FromGitter<awr1> have you seen haskell's front page? they have something really nice set up there
21:53:14FromGitter<awr1> https://www.haskell.org/#step2
21:54:17FromDiscord<ShalokShalom> Well, doesnt work on my phone 😋
21:54:23FromDiscord<ShalokShalom> It doesnt take the "
21:54:31FromDiscord<ShalokShalom> While yes, it is nice
21:55:01FromDiscord<ShalokShalom> What is to me important, is that I see immediately how the language looks like
21:55:07FromDiscord<ShalokShalom> Like, in practice
21:55:11FromDiscord<ShalokShalom> Nim already has this
21:55:20FromDiscord<ShalokShalom> Now I just want to know, what does what
21:57:14FromDiscord<ShalokShalom> And then I want to do this:
21:57:20FromDiscord<ShalokShalom> https://media.discordapp.net/attachments/371759389889003532/735254103772495953/Screenshot_20200721_235636.png
21:57:38FromDiscord<ShalokShalom> I cant do this with hover-over
21:58:04FromDiscord<ShalokShalom> And then I have again to manually look through the extensive amount of documentation..
21:58:18FromGitter<awr1> do you mean how large the actual documentation is
21:58:29FromGitter<awr1> the ones on the front page can have a shorter blurb
21:58:37FromDiscord<ShalokShalom> How many different parts, how sorted and how extensive in total.
21:58:55FromDiscord<ShalokShalom> And I am not concerned about the bubble.
21:58:56FromGitter<awr1> and then you can link to their doc in the manual
21:59:04FromDiscord<ShalokShalom> So long as I can click a link..
21:59:06FromGitter<awr1> for the full explanation
21:59:10FromDiscord<ShalokShalom> Yep
21:59:13FromDiscord<ShalokShalom> Exactly.
21:59:29FromDiscord<ShalokShalom> While I cant implement the bubble.
21:59:51FromDiscord<ShalokShalom> fssnip.net/
22:00:53FromDiscord<ShalokShalom> http://fssnip.net/21/title/Active-pattern-for-let-binding-inside-patterns
22:00:57FromDiscord<ShalokShalom> that one does something
22:01:11FromDiscord<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:43FromDiscord<KingDarBoja> Oh yes, Haskell one is neat
22:32:48FromDiscord<KingDarBoja> I mentioned that before
22:37:39FromDiscord<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:34Yardanico@Clyybber you around?
22:50:07Yardanicoanyway - 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:21Yardanicohttps://github.com/nim-lang/Nim/issues/15035
22:52:23disbot[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:21FromDiscord<ShalokShalom> Are there any parts of Nim itself, that are implemented as objects?
23:01:29Yardanicowdym?
23:01:51Yardanico"object" is the base type of every structure containing more than 1 simple value
23:02:02Yardanicowell, there are also tuples
23:02:13Yardanicoeven nim strings are "object"s internally of course
23:02:20Yardanicoobject with len, cap + pointer to data
23:02:32Yardanico"object" doesn't add any overhead unless you use inheritance with methods
23:02:59FromDiscord<ShalokShalom> Mhn
23:03:10FromDiscord<ShalokShalom> I guess thats not really comparable with other languages
23:03:17Yardanicoit's comparable with C's struct
23:03:23FromDiscord<ShalokShalom> Hnn
23:03:24Yardaniconim objects map to C structs for the C backend
23:03:36FromDiscord<ShalokShalom> And functions?
23:03:49Yardaniconim procs map to C functions of course, but it's much more low-level
23:03:59FromDiscord<ShalokShalom> How would you actually guarantee side effect free functions in C?
23:03:59Yardanicoe.g. all generic procedures are specialized, and there's a different C function for each specialized case
23:04:16Yardanicoe.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:27FromDiscord<ShalokShalom> Aha
23:04:32FromDiscord<ShalokShalom> Guess thats too high for me
23:04:36Yardanicoalso it doesn't have any nim macros/templates/etc
23:04:39FromDiscord<ShalokShalom> Or low, what ever 😅
23:04:43Yardanicoall of that is expanded by the nim compiler
23:06:16FromDiscord<ShalokShalom> I have actually no idea of how Nim translates code to C
23:06:34Yardanicovia it's C backend
23:06:47FromDiscord<ShalokShalom> Yeah, I mean in code
23:07:03FromDiscord<ShalokShalom> I can imagine how to translate into Javascript, some kinda
23:07:16Yardanicoeven nim compiled to JS is much simpler than you expect
23:07:30alehander92it does it the same way
23:07:31YardanicoI mean as in it almost doesn't use any of JS's dynamic features
23:07:31FromDiscord<ShalokShalom> I expect it to be simple
23:07:40Yardanicothe frontend makes "normal nim" into "low-level nim"
23:07:47Yardanicowithout generic types, generic procedures, macros, templates, et cetra
23:07:55FromDiscord<ShalokShalom> Ah, there is a mid step in between
23:07:58Yardanicoof course
23:08:02Yardanicolol
23:08:05FromDiscord<ShalokShalom> Is there an official name for low level nim?
23:08:15Yardanicono, because it's just a term I made up :P
23:08:19Yardanicothat's how most compilers work really
23:08:27alehander92sometimes they call it IR
23:08:34Yardanicothe frontend removes abstractions and stuff, and gives it to the frontend
23:08:39alehander92but i think it's usually an even more low level repr
23:08:42Yardanicojust fyi - there's an unofficial LLVM backend for nim too
23:08:43FromDiscord<ShalokShalom> I know IR from LLVM
23:08:53alehander92it's intermediate representation
23:09:01Yardanicoso nim is a full-fledged language, it just happens to use C as its default compilation target
23:09:02alehander92so probably a term for many passes-s stuff
23:09:10FromDiscord<ShalokShalom> @Yardanico[IRC]#0000 Yeah, I know that most do it that way
23:09:21Yardanicowell it's the same with LLVM
23:09:21FromDiscord<ShalokShalom> But I had no idea how it works in Nim's case
23:09:26Yardanicothere's no difference real
23:09:28Yardanicoreally*
23:09:39Yardanicocompilers translate high-level code of their language into LLVM IR
23:09:46FromDiscord<ShalokShalom> And I know nlvm
23:09:52Yardaniconim translates high-level nim into C or JS or LLVM or whatever backend you make
23:10:06FromDiscord<ShalokShalom> Yeah
23:10:13Yardanicoand these backends like llvm or c are simple, they don't know what is a "generic type" or something like that
23:10:16FromDiscord<ShalokShalom> But I have no idea how this is actually working
23:10:24FromDiscord<ShalokShalom> In case of JS, I can at least imagine
23:10:31Yardanicowell, it's the same as in JS
23:10:39Yardaniconim frontend mostly does same stuff for C or JS backend
23:10:50FromDiscord<ShalokShalom> It is using similar structures..
23:10:50Yardanicohttps://github.com/nim-lang/Nim/blob/devel/compiler/cgen.nim main file of the c backend
23:11:14FromDiscord<ShalokShalom> But the C implementation is more complex or?
23:11:20Yardanicowell of course it is :P
23:11:28Yardanicosince it's optimized a lot, and it's the default backend for Nim
23:12:34Yardanicothese all are parts of the nim's C backend - https://imgur.com/a/hw5Mxz7
23:13:03Yardanicomost of them are just to not make one big cgen.nim
23:13:18Yardanicojs backend is https://github.com/nim-lang/Nim/blob/devel/compiler/jsgen.nim
23:13:23Yardanicoand https://github.com/nim-lang/Nim/blob/devel/compiler/jstypes.nim
23:13:30leorizehow jsgen is constructed is the future :P
23:13:41*krux02_ joined #nim
23:13:51Yardanicothere's only around 2.4k cloc of Nim code for the JS backend
23:14:33Yardanicocompared to ~6k cloc for the C backend
23:14:36leorizejsgen uses ast->ast transformation, super cool :P
23:14:58Yardanicowell, the compiler itself is "ast->ast transformation"
23:15:21leorizeexcept for the C codegen
23:15:24YardanicoI 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:32Yardaniconim's js backend emits JS code directly
23:15:37Yardanicoline by line
23:16:03Yardanicowell, 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:06FromDiscord<ShalokShalom> Its actually kinda amazing how wide the range is between easy and super complex programs, that you can write with Nim
23:17:18Yardanicosame as with any other language really :)
23:17:33Yardanicoand the compiler itself is not that big if you didn't know
23:17:43FromDiscord<ShalokShalom> Seems like all between a simple Python script and Kernel code can be written
23:18:05Yardanico"compiler" directory has 61 thousand cloc (cloc is an utility for counting pure source code lines without empty lines or comment lines)
23:18:33FromDiscord<ShalokShalom> Well, I dont wanna write the small scripts in most languages
23:18:51FromDiscord<ShalokShalom> When I say the range is wide, I mean how feasible it is
23:19:03FromDiscord<ShalokShalom> Of course can use all languages for that
23:19:06Yardaniconot really
23:19:12FromDiscord<ShalokShalom> But not many will look as if made for it.
23:19:26Yardanicoyou 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:31FromDiscord<ShalokShalom> > same as with any other language really :)↵@Yardanico[IRC]#0000 I am referring to that.
23:19:33Yardanicoand yeah, some simple kernels have been done in Nim
23:19:41Yardanicoit's entirely possible
23:19:42FromDiscord<ShalokShalom> @Yardanico[IRC]#0000 Thats whaf I mean.
23:20:16leorizeYardanico: well it's not a full fledged AST, but it has one :P
23:20:19FromDiscord<ShalokShalom> And I think RPython is such a subset
23:20:32YardanicoI know RPython, it's part of PyPy
23:20:41YardanicoBut it's still much less feasible
23:20:47leorizebasically just rope + some fields to add some semantic meanings
23:20:49Yardanicosince RPython takes ages to translate to C and then compile :P
23:20:58leorizemeanwhile the C code gen spits out pure Rope
23:20:58Yardanicodid you ever compile pypy? :D I did
23:21:12Yardanicoat least they show colorized mandelbrot in the terminal while pypy is compiling lol
23:21:16Yardanicoso you are not bored to death
23:21:31Yardanicowell, at least they did that in 2017
23:21:37Yardanicoleorize: interesting
23:25:39Yardanicook I'm confused
23:25:44Yardanicoare you allowed to do "var cstring"?
23:25:50Yardanicoin argument list
23:25:56leorizeyes, it's a pointer
23:26:05leorizeit means you're changing the pointer
23:26:40Yardanicoleorize: this code works with refc, is it "legal" or not?
23:26:40Yardanicohttps://play.nim-lang.org/#ix=20rE
23:27:02YardanicoI'm asking because https://play.nim-lang.org/#ix=20rF does NOT work
23:27:09Yardanicohow come the first works, but second doesn't
23:27:19Yardanicofirst works with refc, crashes with arc, second crashes with both
23:27:22leorizeyes but you don't need `var` for that
23:27:29Yardanicowell it's not my code :P
23:27:47Yardanicowait actually
23:27:50Yardanicothis seems to be a regression
23:28:08Yardanicoah no it's not
23:28:13leorizethis isn't anything special, the code was trying to modify r/o data
23:28:17FromDiscord<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:28YardanicovalueDeref :P
23:28:33Yardanicoleorize: what exactly?
23:28:42Yardanico"var cstring" is not needed because cstring itself is a pointer?
23:28:48Yardanicojust "cstring"?
23:28:59leorizeyea, even then it won't work
23:29:12Yardanicohow to make it work then? :D and how come the first example (https://play.nim-lang.org/#ix=20rE) works with refc
23:29:18Yardanicoit's from https://github.com/jangko/nimAES
23:29:28leorizethe first work because refc always have string allocated in the heap
23:29:31YardanicoI'm just testing stuff with arc
23:30:06Yardanicoso how to make it work then? :P
23:30:11leorizearc use static strings that's copied to the heap when mutation is required
23:30:17Yardanicooh, nice, interesting
23:30:25Yardanicoso less RAM usage also because of that?
23:31:32Yardanicocan you please open an issue in nimAES describing what you told me? :P
23:32:02Yardanicoseems like that pattern is used throughout the whole nimAES lib
23:32:06FromDiscord<Varriount> Yardanico: Thanks!
23:32:17Yardanico@Varriount I just made one from the top of my head :P
23:32:26leorizesounds like it could use a switch to openArray[byte] :P
23:32:38Yardanicoconvenience procs accept "var string", convert it to "cstring" and pass to the main procs which do stuff
23:35:54leorizeyea it definitely sound like it'd want a switch over to openArray[byte] :P
23:40:53Yardanicoalso I'm surprised by how the same (I presume) data structures and algorithms can be implemented in a very different way
23:41:02Yardanicoe.g. https://github.com/Nycto/RBTreeNim and https://github.com/brianshannan/nim-trees/blob/master/nimtrees/trees/red_black.nim
23:41:58Yardanicowell to be fair RBTreeNim seems more separated
23:52:10leorizethe amount of cstrings in nimAES is insane
23:52:15Yardanicoexactly
23:52:27leorizethis is kinda like a C lib translated to nim
23:53:37leorizeAraq: how can one force nim to recognize a string as "being mutated"?
23:53:44leorizenimAES depends on this
23:54:37FromGitter<awr1> @leorize maybe actually mutate the string in question and restore it back?
23:54:44FromGitter<awr1> compiler i think will optimize it out
23:55:06leorizeYardanico: ^ just set the first member of the string to itself
23:55:08leorizeshould work
23:55:30leorizebut we might want to expose this API if interaction with C is wanted
23:59:19FromDiscord<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.