<< 05-04-2019 >>

00:09:06*rnrwashere joined #nim
00:13:32rayman22201@arnetheduck, your cached state use case seems related to the proposed `immutable` pragrma at the bottom of Araqs blog post on owned refs: https://nim-lang.org/araq/ownedrefs.html#immutability
00:15:14rayman22201@I_Right_I, the core team of Nim is very pro exceptions. Though optionals were recently added to language to appease the more functional programmer types :-P What kind of troubles are you worried about?
00:17:59I_Right_Irayman22201: Unwrapping issue like what you would have with C++
00:18:49I_Right_Iand overhead
00:21:18*d10n-work quit (Quit: Connection closed for inactivity)
00:21:41I_Right_IBut mainly I don't know what I need to watch out for while implementing it.
00:23:45rayman22201Nim maps exceptions to C++ exceptions when using the C++ backend, and those have proven to have acceptable overhead (They are actually very performant in modern compiler implementations). Using the C backend, they are mapped to crudely to long jumps IIRC... but I don't remember exactly. They do have worse performance in the C backend though.
00:25:09rayman22201unwrapping is not as big of an issue because nim datatypes don't have most of the OOP garbage attached to a C++ class
00:26:46I_Right_Irayman22201: Okay thanks for the insight!
00:27:28rayman22201sorry I can't be more specific. It's not my area of expertise.
00:31:29I_Right_II just don't know the does and don't of exceptions in nim and I have to use them in the library I am working on. But I abstract them out of the interface.
00:35:21*rnrwashere quit (Remote host closed the connection)
00:42:18rayman22201hrmm. Well, there aren't any big usability gotchas that I know of. Though, if you can, I do recommend using `nim cpp` to get the c++ backend for performance.
00:47:31I_Right_IOkay, I doubt I even need to o that. I am not using it in any performance critical area's as of right now.
00:48:43rayman22201fair enough. At least you know you have the option. another tool in the toolbox as they say :-)
00:52:55*noeontheend quit (Read error: Connection reset by peer)
00:53:26*noeontheend joined #nim
01:05:09*kapil____ joined #nim
01:08:17FromGitter<kaushalmodi> hello all
01:09:53FromGitter<kaushalmodi> I'm coming back to Nim/C binding exercise after a while, and I have never handled mapping a C array pointer type to Nim
01:11:28FromGitter<kaushalmodi> How would I map `int *data;` from C to Nim?
01:12:28FromGitter<kaushalmodi> I looked in Nim forum but the solution there to use a `0..0` array with `{.unchecked.}` doesn't work on the latest devel. Ref: https://forum.nim-lang.org/t/567
01:13:30FromGitter<kaushalmodi> So the question is how do I map a pointer to a *dynamic* array in C (whose length I don't know at compile time) to Nim?
01:15:12FromGitter<kaushalmodi> The bigger picture is that I am exporting a Matlab code to C using Matlab and then trying to map that to Nim
01:15:30FromGitter<kaushalmodi> a snippet of Matlab exported C header: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ca6ac323ebbdc55b362b852]
01:17:46shashlickhey @kaushalmodi ltns
01:18:24FromGitter<kaushalmodi> shashlick: hello! Yeah, work, life
01:18:32shashlickuse https://nim-lang.org/docs/system.html#UncheckedArray
01:19:23FromGitter<kaushalmodi> hmm, it says unchecked is an invalid pragma
01:19:38FromGitter<kaushalmodi> also I get warning for using pragma *before* generics
01:19:42FromGitter<kaushalmodi> latest devel
01:20:50FromGitter<kaushalmodi> ok, on devel it looks different: https://nim-lang.github.io/Nim/system.html#UncheckedArray
01:21:16FromGitter<kaushalmodi> what does this mean? https://github.com/nim-lang/Nim/blob/devel/lib/system.nim#L294-L296
01:21:23FromGitter<kaushalmodi> i.e. how do I use it in my code?
01:21:35FromGitter<genotrance> working on a example
01:22:32FromGitter<kaushalmodi> from my Matlab exported example above: struct0_T type has pointer to an array of `struct emxArray_int32_T` type
01:23:06FromGitter<kaushalmodi> and in `struct emxArray_int32_T`, I have pointers to two int arrays along with other "normal" types
01:25:38FromGitter<genotrance> http://ix.io/1Flt/Nim
01:29:58FromGitter<kaushalmodi> Thanks! that's a nice and simple example
01:30:20FromGitter<kaushalmodi> btw `echo test2` doesn't work as $ isn't implemented for UncheckedArray
01:30:29FromGitter<kaushalmodi> I don't know if that's intentional or an oversight
01:30:52FromGitter<kaushalmodi> I'd have thought that that $ printed all values in the allocated space
01:31:40shashlickwell its an array of integers
01:31:46shashlickwell its an array of integers
01:31:59FromGitter<kaushalmodi> actually `test2` is the ptr right?
01:32:06FromGitter<kaushalmodi> but even `echo test2[]` doesn't work
01:32:17shashlickyep, []
01:33:02*uvegbot joined #nim
01:33:22*theelous3_ quit (Ping timeout: 245 seconds)
01:33:31*jjido quit (Quit: Connection closed for inactivity)
01:33:50FromGitter<kaushalmodi> yeah, that doesn't work
01:34:07FromGitter<kaushalmodi> but this works, so good enough to proceed with my debug for now: ⏎ ⏎ ```for i in 0 .. 3: ⏎ echo test2[i]``` [https://gitter.im/nim-lang/Nim?at=5ca6b08fa0790b29c962c174]
01:48:26*mosORadi joined #nim
01:48:41*rnrwashere joined #nim
01:54:39*ricekrispie2 joined #nim
01:56:27*ricekrispie quit (Ping timeout: 250 seconds)
02:06:46*banc quit (Quit: Bye)
02:19:23FromGitter<kaushalmodi> shashlick: are you still here?
02:20:17FromGitter<kaushalmodi> I got the Nim code to compile, but ending up with SIGSEGV .. Nim code: http://ix.io/1FlB
02:21:02FromGitter<kaushalmodi> the code calls `mean_func_1` from compiled .so of Matlab exported .c
02:21:26FromGitter<kaushalmodi> here's the mean_func_1 implementation in C: http://ix.io/1FlC
02:28:27*banc joined #nim
02:32:32FromGitter<arnetheduck> @rayman22201 - immutable is not quite it - I want to mutate state at other places - I just don't want that to be allowed while a non-owning reference to state exists
02:34:09FromGitter<arnetheduck> or maybe I'm reading it wrong. it doesn't quite say if the existence of a non-owning ref has that effect.
02:34:48FromGitter<kaushalmodi> shashlick: I cannot believe; I understood the C code myself and fixed the Nim code! :P
02:34:55FromGitter<kaushalmodi> fixed Nim code: http://ix.io/1FlE
02:35:28*rnrwashere quit (Remote host closed the connection)
02:35:42FromGitter<kaushalmodi> thanks for your help with UncheckedArray; that motivated me to try to solve this
02:41:01*rnrwashere joined #nim
02:50:20*neceve quit (Remote host closed the connection)
02:51:18*dddddd quit (Remote host closed the connection)
03:03:37*noeontheend quit (Ping timeout: 250 seconds)
03:05:07shashlickSorry was away
03:17:33*rnrwashere quit (Remote host closed the connection)
03:18:01*rnrwashere joined #nim
03:21:09*I_Right_I quit (Remote host closed the connection)
03:25:15*rnrwashere quit (Remote host closed the connection)
03:27:50*rnrwashere joined #nim
03:58:09*mosORadi quit (Quit: Connection closed for inactivity)
03:58:21*rnrwashere quit (Remote host closed the connection)
04:00:08*rnrwashere joined #nim
04:34:51*rnrwashere quit (Remote host closed the connection)
04:35:16*rnrwashere joined #nim
05:01:40*nsf joined #nim
05:15:20*narimiran joined #nim
05:20:54*solitudesf joined #nim
05:57:07*solitudesf quit (Ping timeout: 245 seconds)
05:57:23*rnrwashere quit (Remote host closed the connection)
06:12:23*PMunch joined #nim
06:12:35*krux02 joined #nim
06:31:10*Miguelngel[m] quit (Remote host closed the connection)
06:31:14*Connor[m] quit (Read error: Connection reset by peer)
06:31:16*dyce[m] quit (Remote host closed the connection)
06:31:18*junk[m] quit (Read error: Connection reset by peer)
06:31:18*planetis[m] quit (Read error: Connection reset by peer)
06:31:19*libman[m] quit (Remote host closed the connection)
06:31:19*federico3[m] quit (Remote host closed the connection)
06:31:25*Demos[m] quit (Read error: Connection reset by peer)
06:31:26*flaviut[m] quit (Remote host closed the connection)
06:31:27*macsek1911[m] quit (Remote host closed the connection)
06:31:33*lqdev[m] quit (Remote host closed the connection)
06:31:35*gh0st[m] quit (Read error: Connection reset by peer)
06:31:38*serialdev[m] quit (Read error: Connection reset by peer)
06:31:39*sg-james[m] quit (Remote host closed the connection)
06:31:39*pqflx3[m] quit (Remote host closed the connection)
06:31:43*xylef quit (Write error: Connection reset by peer)
06:31:45*yglukhov[m] quit (Remote host closed the connection)
06:31:45*narimiran[m] quit (Remote host closed the connection)
06:31:46*jugash[m] quit (Remote host closed the connection)
06:31:46*k0mpjut0r quit (Remote host closed the connection)
06:31:46*isaac[m]1 quit (Remote host closed the connection)
06:31:47*leorize quit (Remote host closed the connection)
06:31:47*sendell[m] quit (Read error: Connection reset by peer)
06:31:49*spymasterd[m] quit (Remote host closed the connection)
06:31:49*forkbomb9[m] quit (Remote host closed the connection)
06:31:49*TheManiac[m] quit (Remote host closed the connection)
06:31:50*xomachine[m] quit (Remote host closed the connection)
06:32:08*zielmicha[m] quit (Remote host closed the connection)
06:32:08*TheKing[m] quit (Write error: Broken pipe)
06:32:08*GitterIntegratio quit (Write error: Connection reset by peer)
06:32:08*ArchieT[m] quit (Write error: Connection reset by peer)
06:34:11*dom96 quit (Ping timeout: 246 seconds)
06:35:10*ricekrispie2 is now known as ricekrispie
06:36:11*dom96 joined #nim
06:36:12*dom96 quit (Changing host)
06:36:12*dom96 joined #nim
06:40:39*dyce[m] joined #nim
06:58:08*ArchieT[m] joined #nim
06:58:08*Connor[m] joined #nim
06:58:08*xylef joined #nim
06:58:08*TheKing[m] joined #nim
06:58:09*Demos[m] joined #nim
06:58:09*isaac[m]1 joined #nim
06:58:09*jugash[m] joined #nim
06:58:09*GitterIntegratio joined #nim
06:58:09*sendell[m] joined #nim
06:58:09*serialdev[m] joined #nim
06:58:10*k0mpjut0r joined #nim
06:58:10*leorize joined #nim
06:58:10*gh0st[m] joined #nim
06:58:15*TheManiac[m] joined #nim
06:58:15*forkbomb9[m] joined #nim
06:58:15*junk[m] joined #nim
06:58:15*flaviut[m] joined #nim
06:58:16*federico3[m] joined #nim
06:58:16*sg-james[m] joined #nim
06:58:16*macsek1911[m] joined #nim
06:58:16*spymasterd[m] joined #nim
06:58:16*zielmicha[m]1 joined #nim
06:58:16*xomachine[m] joined #nim
06:58:16*Miguelngel[m] joined #nim
06:58:16*yglukhov[m] joined #nim
06:58:16*pqflx3[m] joined #nim
06:58:16*narimiran[m] joined #nim
06:58:17*planetis[m] joined #nim
06:58:17*libman[m] joined #nim
06:58:18*lqdev[m] joined #nim
07:00:00*gmpreussner quit (Quit: kthxbye)
07:04:37*gmpreussner joined #nim
07:14:51*vlad1777d quit (Ping timeout: 268 seconds)
07:15:30*vlad1777d joined #nim
07:16:22*Vladar joined #nim
07:18:39PMunchHmm, I think there's something wrong with my computer case/sound card
07:19:07PMunchI can hear noise when I scroll and type things..
07:27:16*chimez joined #nim
07:30:00PMunchIt almost gives it that vinyl player feel
07:50:06*chimez1 joined #nim
07:51:11*chimez quit (Ping timeout: 252 seconds)
07:51:12*chimez1 is now known as chimez
08:00:16ZevvMy phone has that - the last stage amp is not muted when nothing is playing, so I can hear all processes and radios buzzing and cracking and whispering and shouting. It's actually a pretty nice debugging tool - I can *hear* my battery draining if some process is not behaving
08:14:44*floppydh joined #nim
08:21:41*Vladar quit (Remote host closed the connection)
08:43:33PMunchHaha, that actually does sound useful
08:43:50PMunchThis is a desktop machine though, so not much battery drain issues
08:44:05PMunchAnd the crackling is so loud I can hear it over the music..
08:45:39Zevvdebugging with sound is great. I have a little script that generates a short blip for a line of text, of which the frequency and harmonics depend on the contents. its great for piping log or wireshark output to, you can instantly hear when something is changing in the pattern - ears are good at some things that eyes can not do
08:46:21Zevvwell, you could play Autechre or Alva Noto, then you can't tell the difference
08:47:40PMunchHaha, playing different music to not notice the crackling :P
08:47:55PMunchBut yeah sound can be really helpful
09:12:04*clyybber joined #nim
09:13:38clyybberPMunch: I had the same problem when I plugged some heavy power draining stuff into the usb port next to the audio jack
09:13:56PMunchWell this is the front-panel one
09:14:09clyybberoh
09:16:49PMunchSince I cable-managed the case the audio cables run along all kinds of power cables and other internal wires..
09:17:05PMunchSo it's probably that
09:22:42clyybberUh, yeah. Audio cables curling around power cables and what not is kinda... ambient
09:23:22clyybberSomehow cligen doesn't work with my enums...
09:24:18clyybberIt just says this: https://hastebin.com/ifesegerel.cs
09:27:25*fredrik92 is now known as couven92
09:37:15*vlad1777d quit (Ping timeout: 264 seconds)
09:41:47*solitudesf joined #nim
09:43:06*JustASlacker joined #nim
09:53:12*TheKing[m] quit (Remote host closed the connection)
09:53:14*sg-james[m] quit (Read error: Connection reset by peer)
09:53:14*TheManiac[m] quit (Read error: Connection reset by peer)
09:53:15*pqflx3[m] quit (Remote host closed the connection)
09:53:15*narimiran[m] quit (Remote host closed the connection)
09:53:17*yglukhov[m] quit (Remote host closed the connection)
09:53:18*federico3[m] quit (Read error: Connection reset by peer)
09:53:19*GitterIntegratio quit (Read error: Connection reset by peer)
09:53:20*Demos[m] quit (Read error: Connection reset by peer)
09:53:20*lqdev[m] quit (Read error: Connection reset by peer)
09:53:25*junk[m] quit (Remote host closed the connection)
09:53:25*forkbomb9[m] quit (Read error: Connection reset by peer)
09:53:26*sendell[m] quit (Remote host closed the connection)
09:53:30*isaac[m]1 quit (Read error: Connection reset by peer)
09:53:30*leorize quit (Remote host closed the connection)
09:53:32*macsek1911[m] quit (Remote host closed the connection)
09:53:33*gh0st[m] quit (Remote host closed the connection)
09:53:33*serialdev[m] quit (Read error: Connection reset by peer)
09:53:33*spymasterd[m] quit (Read error: Connection reset by peer)
09:53:34*k0mpjut0r quit (Read error: Connection reset by peer)
09:53:36*dyce[m] quit (Remote host closed the connection)
09:53:38*Connor[m] quit (Remote host closed the connection)
09:53:41*planetis[m] quit (Remote host closed the connection)
09:53:41*jugash[m] quit (Read error: Connection reset by peer)
09:53:41*xylef quit (Read error: Connection reset by peer)
09:53:42*Miguelngel[m] quit (Remote host closed the connection)
09:53:42*flaviut[m] quit (Remote host closed the connection)
09:53:42*libman[m] quit (Remote host closed the connection)
09:53:43*xomachine[m] quit (Read error: Connection reset by peer)
09:53:43*zielmicha[m]1 quit (Read error: Connection reset by peer)
09:53:56*ArchieT[m] quit (Write error: Connection reset by peer)
10:01:38*dyce[m] joined #nim
10:14:12*lritter joined #nim
10:16:54*xylef joined #nim
10:16:54*ArchieT[m] joined #nim
10:16:54*Connor[m] joined #nim
10:16:54*TheKing[m] joined #nim
10:16:55*Demos[m] joined #nim
10:16:55*serialdev[m] joined #nim
10:16:55*k0mpjut0r joined #nim
10:16:56*jugash[m] joined #nim
10:16:56*GitterIntegratio joined #nim
10:16:56*sendell[m] joined #nim
10:16:56*isaac[m]1 joined #nim
10:16:56*leorize joined #nim
10:17:01*flaviut[m] joined #nim
10:17:01*federico3[m] joined #nim
10:17:02*Miguelngel[m] joined #nim
10:17:02*macsek1911[m] joined #nim
10:17:02*TheManiac[m] joined #nim
10:17:02*yglukhov[m] joined #nim
10:17:02*forkbomb9[m] joined #nim
10:17:02*zielmicha[m] joined #nim
10:17:02*sg-james[m] joined #nim
10:17:02*narimiran[m] joined #nim
10:17:02*xomachine[m] joined #nim
10:17:02*pqflx3[m] joined #nim
10:17:02*spymasterd[m] joined #nim
10:17:02*junk[m] joined #nim
10:17:03*gh0st[m] joined #nim
10:17:03*planetis[m] joined #nim
10:17:03*lqdev[m] joined #nim
10:17:03*libman[m] joined #nim
10:26:01*stefanos82 joined #nim
10:31:36*dddddd joined #nim
10:32:28FromGitter<mratsim> Invalid type <T>, expected <T> :P
10:34:11FromGitter<mratsim> Best news of the day! https://github.com/nim-lang/Nim/pull/10968
10:36:42narimiran:)
10:37:14narimiran@mratsim and it is because i've run some arraymancer tests and was greeted with lots of those warnings :)
10:38:29FromGitter<mratsim> I'm pretty sure that slows down my tests compilation time as well
10:44:34Zevvyay, away go all my pragma pushes \o/
10:48:08narimiransome day in the future: "what was my most famous contribution to nim? well, i've removed one warning and the crowd went wild"
10:50:47FromGitter<kayabaNerve> My contribution is probably quality error reports for all the weird bugs I find (a lot more months ago than now) and getting paths standardized for some pragmas
10:51:44FromGitter<kayabaNerve> https://github.com/nim-lang/Nim/issues/8408
10:51:48FromGitter<kayabaNerve> I like that issue tbh.
10:52:11ZevvI have some software projects I'm kind of proud of, but the most popular thing I ever made was a thingy playing 80's IBM buckle spring keyboard sounds when you use your keyboard. My legacy to the world is annoing coworkers.
10:52:31FromGitter<kayabaNerve> Amazing
10:52:33FromGitter<kayabaNerve> Link?
10:52:56Zevvwhat, to the ibmsounds?
10:53:33Zevvnot to all the projects I *am* proud of?
10:53:41Zevvhttps://github.com/zevv/bucklespring or apt-get install bucklespring
10:54:39FromGitter<kayabaNerve> The fact it's an apt package makes it infinitely better
10:54:49Zevv:)
10:55:45PMunchHahaha
11:02:45FromGitter<mratsim> @narimiran, you were also the one who introduced that warning ;)
11:03:00narimiranhmmm, not sure about that
11:03:08Zevvooooh, and the plot thickens
11:05:02ZevvWhen is the next nim dev blog video due?
11:05:03FromGitter<mratsim> mmm I'm pretty sure there was another issue besides this one: https://github.com/nim-lang/Nim/issues/7582
11:05:45FromGitter<mratsim> maybe this: https://github.com/nim-lang/Nim/issues/7685
11:11:25*Vladar joined #nim
11:11:29Zevvnarimiran: the warning message is now not strictly right anymore. Well, it is, but it is not.
11:13:23narimiranZevv: re video: next week(end), probably
11:13:51narimiranmratsim: ok, you got me there :)
11:15:10PMunchYeah the wording of the error should probably change
11:15:56Zevvwell, it's not *wrong*
11:19:08PMunchTrue, but it isn't complete
11:20:07*kapil____ quit (Quit: Connection closed for inactivity)
11:31:50PMunchHmm, regex might not be the best choice after all
11:32:18PMunch1234567 will match [0-9]{6} on "123456" which is obviously not what I want
11:32:52PMunch(^|[^0-9])([0-9]{6})([^0-9]|$) avoids that, but it will leave you with extra characters
11:41:34FromGitter<mratsim> no you have two problems - famous quote
11:41:38FromGitter<mratsim> now*
11:46:43PMunchThe peg that Zevv gave me yesterday unfortunately doesn't do much better http://ix.io/1FmW/Nim
11:47:18Zevvtrue :)
11:47:21Zevvjust fixed that
11:47:38PMunchWhat do you mean by just?
11:47:42Zevvhere locally
11:47:44Zevvwhen I saw your remakr
11:47:46PMunchAh
11:47:46PMunch :P
11:47:55Zevvnow you have three problems
11:47:56Zevv number <- (1-Digit) * >Digit[6] * ((1-Digit) | !1)
11:49:31PMunchHmm, better
11:50:08Zevvwill miss the very first one if it is at start of document, though
11:50:38PMunchYeah that is an issue
11:57:32*neceve joined #nim
11:58:20Zevvthis works, but it doesn't give me a fuzzy and warm feeling: http://paste.debian.net/plain/1076288
11:59:20Zevvso its "optionally, six digits followed by a non digit or end of file", followed by one or more searchers for a non digit, followed by six digits followed by a nondigit or an end of file
11:59:27ZevvYou might want to change the + in the 3d rule to a *
12:03:43PMunchZevv, well it leaves me with a better feeling than this..
12:03:46PMunchhttp://ix.io/1FmY/Nim
12:04:58narimiranPMunch: have you seen my PM? :)
12:05:53PMunchAh no, sorry
12:22:18*theelous3_ joined #nim
12:36:58WilhelmVonWeiner`iterator getJson(c: Socket): string {.closure.} = yield c.recvLine()`
12:37:01WilhelmVonWeinershould a `fir
12:37:32WilhelmVonWeiner*should a 'for' loop on this not run as long as the socket can recieve lines? it stops after one iteration.
12:38:06*solitudesf quit (Ping timeout: 250 seconds)
12:39:25*shashlick quit (Remote host closed the connection)
12:39:51*shashlick joined #nim
12:39:56*shashlick quit (Read error: Connection reset by peer)
12:40:46PMunchTechnically that should run forever I think
12:40:58PMunchrecvLine just returns "" when the socket is close
12:41:02*shashlick joined #nim
12:41:06*shashlick quit (Read error: Connection reset by peer)
12:42:01*shashlick joined #nim
12:42:05*shashlick quit (Remote host closed the connection)
12:43:44clyybberWilhelmVonWiener: Thats because you only yielded one time.
12:43:56WilhelmVonWeineroh, I see.
12:44:20clyybber`iterator getJson(c: Socket): string {.closure.} = while true: yield c.recvLine()` should do the trick
12:45:18WilhelmVonWeineryeah, that works. I also don't need to declare it as a closure (it isn't)
12:47:01*abm joined #nim
12:50:26*shashlick joined #nim
12:50:30*shashlick quit (Read error: Connection reset by peer)
13:00:35disruptekan audio-as-sysadmin-feedback tool i worked on: https://www.usenix.org/techsessionssummary/peep-network-auralizer-monitoring-your-network-sound
13:02:56Zevvhehe that's very cool
13:03:43disruptekyeah, i dunno why it never caught on.
13:04:26disruptekhard to believe futures are fully-baked in nim right now. i cannot figure out the idiom.
13:15:18*rnrwashere joined #nim
13:19:50*rnrwashere quit (Ping timeout: 268 seconds)
13:24:24livcdhttps://picheta.me/snake/ lets play snake
13:24:43FromGitter<liquid600pgm> ohhh yesssss
13:25:14PMunchdisruptek, Zevv, now I want to program a Alexa style thing with a command "Sing me the song of your people" and it would auralize it's logs :P
13:25:48FromGitter<mratsim> @disruptek, I know that the IT guys at Deutsche Bahn are using neural networks to monitor escalators in train station. And they are recruiting
13:26:08FromGitter<mratsim> escalators sounds*
13:26:28disruptekeveryone is using neural networks to monitor everything. :-(
13:26:47disruptekhttps://www.grassland.network/
13:28:12FromGitter<mratsim> there's neural networks and there's hype, DB is not doing hype. ;)
13:28:42FromGitter<mratsim> And I'm like the first one to tell that there are plenty of domains where NNs don't apply
13:28:58disruptekwhat's the take-away from listening to escalators? identify mtbf?
13:30:27FromGitter<mratsim> maintenance before actual failure
13:30:37livcdwhat are they monitoring ? what's the use case in general that is actually beneficial ?
13:30:38FromGitter<mratsim> meaning less downtime and no emergency pulling of maintenance teams
13:31:04narimiransounds exciting :D (pun intended)
13:31:07FromGitter<mratsim> Talk is here: https://fosdem.org/2019/schedule/event/condition_monitoring/
13:31:16disruptekyeah, that's common. mtbf is one of the main domains.
13:31:18PMunchlivcd, 72
13:31:41livcdPMunch: i got 76
13:32:06FromGitter<mratsim> I've talk with the guys at the end, CNNs is not just a buzzwords they threw in their presentation ;)
13:32:11disruptekalso stuff like tool lifetime in machining, identifying tool paths, etc.
13:32:57livcdis not it actually more expensive than regular maintenance and replacements?
13:33:22FromGitter<mratsim> downtime in manufacturing is millions lost per day
13:33:29disruptekit lets you go longer between maintenance when you have mechanical "headroom".
13:33:41FromGitter<mratsim> for machining I have friends working at this startup but they focus on vision: https://scortex.io
13:33:55livcdmanufacturing but they are not manufacturing escalators
13:34:02*shashlick joined #nim
13:34:03FromGitter<kaushalmodi> has someone worked on creating Matlab equivalent functions that return vectors?
13:34:11FromGitter<kaushalmodi> *I'd guess @mratsim has?*
13:34:23FromGitter<kaushalmodi> e.g. the `ones` `zeroes` functions in matlab
13:34:42FromGitter<mratsim> also in power plants for example, les than a hundred of people per country are able to work on certain part and they are all booked a year in advance so emergency are much more expensive than developer/data scientist time
13:34:46FromGitter<kaushalmodi> https://www.mathworks.com/help/matlab/ref/zeros.html
13:35:09FromGitter<mratsim> @kaushalmodi Arraymancer or if you want seq[float] compatible things use neo
13:35:23FromGitter<kaushalmodi> thank you
13:35:26FromGitter<kaushalmodi> will have a look
13:35:34livcdbut are not escalators prone to all kind of litter and that's why they break so often ?
13:35:45FromGitter<mratsim> @livcd, closing a train entrance, or helping people with disabilities is costly
13:35:48FromGitter<mratsim> yes
13:36:11livcdi dont understand that domain i am just curious. Not arguing for the sake of argument
13:36:11FromGitter<kaushalmodi> @mratsim I have no idea what tensors are
13:36:31disrupteklivcd: no, you understand it perfectly.
13:36:36FromGitter<mratsim> @kaushalmodi any sufficiently advanced technology is indistinguishable from magic
13:36:45FromGitter<kaushalmodi> heh
13:36:48disruptek-- Arthur C. Clarke.
13:36:49FromGitter<mratsim> a matrix is a 2D tensor
13:36:50narimiran@kaushalmodi i can also recommend Neo, i've used it in my numerical simulation stuff i did where i needed linear algebra
13:36:52livcdto me it seems like it would be pointless to monitor anything else than "it works/it does not work" and arrange replacements / maintenance
13:37:00livcdbut what do I know
13:37:11FromGitter<mratsim> tensors are generalisations of matrices to more than 2 dimensions
13:37:20FromGitter<kaushalmodi> Any quick pointer on how I can relate a tensor to a matlab matrix?
13:37:33FromGitter<mratsim> an 2D images is actually a 3D tensors because the RGB colors are a third dimension
13:37:34disruptekthe idea is to listen for the grinding noise of litter in the escalator. ;-)
13:37:37narimiranuse Neo for matrices and vectors
13:38:05FromGitter<mratsim> in arraymancer zerosfloat (3, 4) to create a 3x4 matrix
13:38:23FromGitter<kaushalmodi> @mratsim that didn't show up right in Gitter
13:38:32FromGitter<mratsim> yeah
13:38:40FromGitter<kaushalmodi> may be wrap in `` ` ``
13:38:45FromGitter<mratsim> zeros\int\ (3, 4)
13:39:02FromGitter<mratsim> there are some tutos and recipes here: https://mratsim.github.io/Arraymancer/tuto.first_steps.html
13:39:16FromGitter<kaushalmodi> thanks, so a vector would be `zerosint (3, 1)` ..
13:39:24FromGitter<kaushalmodi> I'll give that a try
13:39:27FromGitter<mratsim> the 1 is not necessary
13:39:32FromGitter<kaushalmodi> ok
13:39:40FromGitter<kaushalmodi> narimiran: will look at neo too
13:39:59FromGitter<kaushalmodi> @mratsim I saw that link and I saw `toTensor` .. and so came back here to ask what that was
13:40:00FromGitter<kaushalmodi> :)
13:40:33FromGitter<mratsim> tensor is like a matrix but generalized to more then 2 dimensions
13:40:53FromGitter<kaushalmodi> cool
13:40:55narimiran@kaushalmodi what exactly you have to do, what are you translating from matlab?
13:41:04FromGitter<mratsim> actually the first line came up bad but tells you about 0 dim = scalar, 1 dim = vector, 2 dim = matrix
13:41:15FromGitter<kaushalmodi> narimiran: convolution
13:41:16narimiran...and in a similar analogy, Arraymancer is a generalized Neo :)
13:41:22FromGitter<kaushalmodi> modeling a digital FIR filter
13:41:51FromGitter<mratsim> are you doing 2d convolution or 1d convolution?
13:42:36FromGitter<kaushalmodi> it's a convolution of two vectors
13:42:38FromGitter<kaushalmodi> https://www.mathworks.com/help/matlab/ref/conv.html
13:43:17FromGitter<mratsim> so 1d, I didn't implement those yet. (and they are not implemented in neo as well afaik)
13:43:46FromGitter<kaushalmodi> hmm, but this is good, nice to have options to experiment with
13:44:14FromGitter<kaushalmodi> yesterday I made a breakthrough in Nim+C FFI experimentation
13:44:43FromGitter<kaushalmodi> Matlab -> C -> a.so; Nim + a.so -> b.so; b.so + DPI-C + Systemverilog :P
13:44:43FromGitter<zacharycarter> Just accepted an offer from Wargaming.net! Moving to Helsinki Finland :)
13:45:04FromGitter<mratsim> @zacharycarter didn't you change job like a month ago?
13:45:27FromGitter<zacharycarter> A few weeks ago haha - but it was contract work doing UI / HUD Development on a game in early access
13:45:42FromGitter<mratsim> oh ok
13:45:45FromGitter<zacharycarter> this is a full time role with a well known studio
13:45:59FromGitter<mratsim> @kaushalmodi is the convolution speed important?
13:46:31FromGitter<kaushalmodi> it might be if it takes in the order of seconds
13:46:50FromGitter<kaushalmodi> the data has around 100,000 samples that need to pass through the filter model
13:47:20disruptekcongrats, zachary. that's cool. tough business, gaming.
13:49:10FromGitter<alehander42> wow @zacharycarter
13:49:14FromGitter<alehander42> welcome to europe!
13:49:20Zevvcongrats indeed!
13:49:26FromGitter<mratsim> In that case, you will probably need to take the raw pointers to do the computation and and avoid intermediate allocations. Or maybe the iterators both neo and Arraymancer provides are enough, have to check how to implement 1d convolution
13:49:27FromGitter<zacharycarter> @alehander42 thank you!
13:49:33FromGitter<zacharycarter> thanks Zevv!
13:49:41FromGitter<alehander42> hope to meet ya one day now if you live closer :D
13:49:43FromGitter<mratsim> @zacharycarter just don't get into a mess like Anthem
13:49:53FromGitter<zacharycarter> @alehander42 likewise!
13:49:53FromGitter<alehander42> you're almost a neighbour of @PMunch
13:49:56FromGitter<kaushalmodi> @mratsim thanks
13:50:09FromGitter<zacharycarter> @mratsim haha going to be working on a mobile title first so I hope not
13:50:17FromGitter<kaushalmodi> coincidentally I figured out how to directly access array pointers yesterday
13:50:26FromGitter<zacharycarter> going to be programming tools :)
13:51:56FromGitter<kaushalmodi> @zacharycarter congrats! good luck with the move
13:52:28FromGitter<mratsim> @kaushalmodi here is a super raw implementation of 2d convolution (cross-correlation to be precise), I'm using for benchmarking: https://github.com/numforge/laser/blob/master/benchmarks/convolution/conv2d_direct_convolution.nim
13:52:47FromGitter<mratsim> for benchmarking Tensor[T] is just an alias of seq[T]
13:53:04FromGitter<mratsim> all the other types are tuples of ints
13:53:19FromGitter<zacharycarter> @kaushalmodi thank you!
13:53:31PMunchCongrats zacharycarter!
13:53:42FromGitter<zacharycarter> PMunch thank you buddy!
13:56:32ZevvDo they also still have 2.5 meters of snow in Helsinki?
13:56:52FromGitter<zacharycarter> heh - I have no idea, I just know it's going to be cold
13:57:07narimiranZevv: ha, you fell for that elaborate country-wide April fools joke?
13:57:32PMunchalehander42, well it's still over 1000km from Helsinki to Tromsø
13:57:35PMunchBy air
13:58:07ZevvCan't be. It's all high-up-there-somewhere, and everybody knows the world gets smaller and smaller the upper you get. So it must be closer
13:58:16narimiranPMunch: but convert that to miles, and to an american mind it is quite close :D
14:00:35PMunchDifference is that America has roads
14:01:31ZevvFinland has Surströmming!
14:01:47PMunchIt would take me longer to drive to Helsinki than for someone to drive from New York to Orlando
14:02:11PMunchZevv, isn't that mainly a Swedish thing?
14:02:11ZevvYou know the about the Surströmmingritual for finish citizenship, right?
14:02:15Zevvoh is it :)
14:02:29PMunchWell the word is Swedish :P
14:02:56PMunchThen again the Finns do have Swedish in school
14:03:05PMunchAlong with Finnish and English
14:03:13PMunchBut most Finns I've come across don't really like speaking Swedish
14:07:16*Trustable joined #nim
14:08:27*rnrwashere joined #nim
14:10:00clyybberzacharycarter: Congrats \o/
14:11:08ZevvDoes that come with new Nim infiltration in the gaming world?
14:11:16*theelous3_ quit (Ping timeout: 250 seconds)
14:12:30clyybberzacharycarter Zevv Incidentally I'm working on a texturepacker in nim as we speak
14:17:15PMunchclyybber, ooh nice
14:17:42PMunchI added support for reading the files generated by TexturePacker (the program) to my gamelib
14:17:54PMunchWould be nice to have a fully Nim solution :)
14:18:10*PMunch quit (Remote host closed the connection)
14:18:19FromGitter<liquid600pgm> Nim's definitely going to gain some traction in game dev, it just needs more mature libraries and tools
14:18:35WilhelmVonWeineryeah
14:18:44WilhelmVonWeinerthat's the only reason I'm learning nim
14:18:58WilhelmVonWeinerI wanted to write games in Python buuuuuut
14:19:08*JustASlacker quit (Remote host closed the connection)
14:19:08WilhelmVonWeinerNim looks dope
14:19:29FromGitter<liquid600pgm> Python's performance and lack of standalone executable creation is not really suitable for game development
14:19:57WilhelmVonWeinerexactamundo, and types help avoid errors
14:20:01FromGitter<mratsim> well also Python GC makes it hard to embed Python in your probably C++ codebase
14:20:41FromGitter<liquid600pgm> I was actually working on a game engine for Nim, with support for game scripting in *some language*, and because Lua doesn't satisty me (every single major game engine uses Lua), I seeked out for a different language. Because I couldn't find one that worked for me, I just decided to make my own
14:20:47FromGitter<mratsim> and shipping Python and its dependency with a game is probably painful as well
14:21:00FromGitter<mratsim> especially for support, DirectX is already painful :p
14:21:09WilhelmVonWeiner@liquid600pgm what was your own?
14:21:24FromGitter<liquid600pgm> https://github.com/liquid600pgm/rod
14:21:58FromGitter<mratsim> I wonder when Beamdog will release Neverwinter Nights 1 Enhanced Edition (the tooling is written in Nim)
14:22:18FromGitter<liquid600pgm> currently working on better locals (storing them directly on the stack, and not in some array)
14:22:24shashlicknim's pretty light weight, why not build plugin dlls instead of a script engine
14:22:31shashlickworks super fast
14:22:42WilhelmVonWeinerplugin dlls?
14:22:48FromGitter<liquid600pgm> a scripting language is easier to use for modders
14:22:48FromGitter<mratsim> Nim dll's are a bit of a pain due to NimMain conflicts
14:23:01shashlickI've had no problems with dll plugins in feu
14:23:03shashlickfeud
14:23:20shashlickand everything is blazing fast
14:23:42FromGitter<liquid600pgm> Yeah I was considering DLLs, and I might add them as a first solution, but I want to add scripting support nevertheless
14:24:18shashlicksounds fair
14:24:26Araqwe got hot code reloading in the meantime
14:24:37Araqno need for a scripting environment
14:24:43shashlicki've written the plugin infrastructure fairly independently so you can pull it into a project
14:24:54clyybberI've used HCR in my game
14:24:57Araqbut of course, ymmv
14:25:05disrupteklua isn't going away any time soon. it's pretty well thought out, and performant.
14:25:09clyybberIt works pretty great in my experience
14:25:47FromGitter<liquid600pgm> Lua's great, but its simplicity led me to this disaster: https://github.com/liquid600pgm/planet-overgamma
14:25:47shashlicki wasn't in the mood to learn lua, and since most of my code is in the plugins, i wanted nim
14:25:53FromGitter<liquid600pgm> mainly because I wasn't used to it
14:26:20clyybberI once implemented a skiplist in lua, just to figure out that using tables is still faster
14:26:50clyybberbecause lua allocates around 40 bytes for every table, regardless if you use it as a pointer or an array or everything at once
14:27:06shashlickclyybber: how do you recompile plugins with HCR? the docs don't cover that aspect
14:27:18shashlicknot plugins, code
14:27:39FromGitter<liquid600pgm> that game I sent was made for a game jam in about 7 days (even though the jam was a month long, I wanted to challenge myself), but because I didn't know that much of Lua at the time, my code got **very** messy
14:29:25clyybbershashlick: just use --hotCodeReloading:on
14:29:41clyybberthat should do
14:30:00clyybberOr do you mean completely recompile?
14:30:03shashlickso it detects your code changed and recompiles?
14:30:33clyybberYou run it while it runs and it works.
14:30:39*rnrwashere quit (Remote host closed the connection)
14:30:52shashlickdo you have code I can look at?
14:31:07*kapil____ joined #nim
14:31:28clyybbersure, I didn't adapt my code for HCR though.
14:31:37clyybberIt just worked, AFAICT
14:31:37shashlickalso, do you need nim or can your compile exe hcr in isolation
14:33:27clyybberI havent tried it out on windows,
14:34:12clyybberBut you need nim, yes
14:35:06clyybberIt's just an extra compiler flag, which will make it generate dlls or sos or whatever in which changes are then detected by the HCR system.
14:35:16clyybberWhich then relaods them on the fly
14:35:52clyybberI just noticed that my code doesn't compile anymore using HCR...
14:36:15clyybberI'm not sure what I changed though since I last tried it.
14:36:42FromGitter<mratsim> where is the blog post showcasing Nim HCR for gaming?
14:37:56clyybbermratsim Huh, show me! show me!
14:39:15FromGitter<mratsim> well it was meant to be read like "hey clyybber, why don't youw rite a blog post about using Nim HCR for gaming?" ;)
14:39:20clyybbershashlick: I just inserted performCodeReload in my game loop.
14:39:55clyybbermratsim: Oh :D
14:43:34*rnrwashere joined #nim
14:49:12*rnrwashere quit (Remote host closed the connection)
15:00:16*Xe quit (Quit: WeeChat 1.9.1)
15:00:25*Xe joined #nim
15:06:06FromGitter<alehander42> Id read this blog post
15:06:19FromGitter<alehander42> It's amazing : just one line and you're ready
15:07:49clyybberWell, to be performant its three lines of code, but yeah. It really is amazing
15:08:38clyybbers/three/two
15:12:06*floppydh quit (Quit: WeeChat 2.4)
15:13:26*stefanos82 quit (Remote host closed the connection)
15:16:18*chimez quit (Quit: chimez)
15:21:43FromGitter<liquid600pgm> does anyone have some dynlib loading examples?
15:29:58clyybberThis glfw wrapper is using it: https://github.com/rafaelvasco/nimrod-glfw/
15:30:07clyybberAnd I can confirm it works :D
15:30:39FromGitter<liquid600pgm> what a coincidence, I was looking at the other, more recent GLFW wrapper: https://github.com/ephja/nim-glfw
15:30:48FromGitter<liquid600pgm> not for dynlib loading though
15:32:24clyybberrafaels wrapper is more low level, and more simple IMO, so thats my I chose this one.
15:32:52*solitudesf joined #nim
15:33:07FromGitter<liquid600pgm> also, the dynlib loading used by the wrapper you provided isn't really what I need. I was asking about loading with the `dynlib` module, not how to load a lib with the FFI. Should've mentioned that.
15:40:31shashlick@liquid600pgm: https://github.com/genotrance/feud/blob/master/src/plugin.nim#L268
15:40:45shashlicki use dynlib to load/unload and recompile in feud
15:41:18FromGitter<liquid600pgm> does it "just work" with DLLs from Nim?
15:41:24shashlickthere's a thread monitoring file changes, etc.
15:41:30shashlickyes that's what i'm doing
15:41:36shashlickthere's code to recompile as well
15:41:37FromGitter<liquid600pgm> do you have to exportc procs or something?
15:41:46FromGitter<liquid600pgm> from the DLL, that is
15:41:53shashlickyes, see pluginapi.nim for how I made that generic
15:42:07shashlickI have a pragma {.feudCallback.} which does all the requisite stuff
15:42:17shashlickappreciate feedback to make this more generic
15:42:34shashlicki also have code to not rebuild in -d:release mode so you can ship without the auto-rebuilding
15:42:55FromGitter<kaushalmodi> shashlick: can I ask you a question about nimterop?
15:43:01shashlicksure
15:43:10FromGitter<kaushalmodi> I ported few Matlab based structs yest manually
15:43:29FromGitter<kaushalmodi> now trying with nimterop but it fails to read a struct from one of the included .h files
15:43:36FromGitter<kaushalmodi> let me share some files .. 1 min
15:44:00shashlickit doesn't yet support nested structs
15:44:18shashlickthat's one known limitation
15:45:00FromGitter<kaushalmodi> hmm
15:45:03FromGitter<kaushalmodi> nim code: http://ix.io/1FnR
15:45:46FromGitter<kaushalmodi> main .h file: http://ix.io/1FnS; included .h file with all types: http://ix.io/1FnT
15:45:52*abm quit (Ping timeout: 244 seconds)
15:45:59FromGitter<kaushalmodi> pointer to what kind of override I would need?
15:51:00shashlickwhat's the error
15:51:28FromGitter<kaushalmodi> Error: undeclared identifier: 'struct0_T'
15:51:53FromGitter<kaushalmodi> also, looks like we cannot automatically know if a pointer is pointer to an array and not a scalar, right?
15:52:13*Vladar quit (Remote host closed the connection)
15:52:19FromGitter<kaushalmodi> e.g. nimterop creates: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ca779b3a84e0c501adf5f38]
15:52:51FromGitter<kaushalmodi> I did this (with slightly better named type): ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ca779d37ecbdc29ca055473]
15:53:22shashlickyes, no way to know how a pointer is being used
15:53:48shashlickcould be a single int or an array or something else
15:56:12shashlickalso, need rtwtypes.h to test this
15:58:49FromGitter<kaushalmodi> http://ix.io/1FnZ
15:58:55FromGitter<kaushalmodi> oops, forgot that
16:01:28*arecacea1 quit (Remote host closed the connection)
16:01:46*arecacea1 joined #nim
16:03:43shashlicknimterop understands that struct
16:03:49shashlickbut it isn't getting included for some reason
16:04:01federico3can I get the compiler to list unused procs in a imported module?
16:10:53FromGitter<kaushalmodi> shashlick: yeah I don't get why that #include isn't effective
16:11:21FromGitter<kaushalmodi> I ended up with this: http://ix.io/1Fo4 but it's more code than if I mapped everything manually ..
16:11:32*arecacea1 quit (Remote host closed the connection)
16:11:45*Perkol joined #nim
16:11:48FromGitter<kaushalmodi> nimterop does `ptr struct0_T` .. and I do `ref` of that same struct
16:11:51*arecacea1 joined #nim
16:13:46FromGitter<kaushalmodi> is using ref of objects a better way, or should I change my code to use ptr instead of ref
16:13:59FromGitter<kaushalmodi> if I use ptr, I think I will need to use unsafeAddr at some place
16:15:41shashlickif you can pull off ref, better
16:15:46shashlickthere's some bug, i'm looking into it
16:17:45clyybberarnetheduck: Nice, now nlvm can do wasm32. \o/
16:18:52*Perkol quit (Read error: Connection reset by peer)
16:26:21FromGitter<arnetheduck> has been able to for months :) there's still plenty to do though
16:27:02*abm joined #nim
16:28:52FromGitter<arnetheduck> ie half the std lib, including system.nim, is useless.. `--os:standalone` isn't maintained and wasm falls somewhere in between, depending on what system interface you're targeting (browsers, standalone, emscripen, wasi etc).. ie lots of stuff that's really more in nim-land than nlvm purely
16:35:57FromGitter<kaushalmodi> shashlick: thanks the code is functional with ref
16:36:18FromGitter<kaushalmodi> just that I need to override the nimterop created proc signature with ptr, with ref version
16:37:10shashlickwhat does it look like with ref
16:37:33FromGitter<kaushalmodi> nimterop version: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ca7844d016a930a456b4359]
16:37:53FromGitter<kaushalmodi> I made it inp and outp so that I don't need to backquote
16:38:17FromGitter<kaushalmodi> and `InputObjRef` is simply `ref struct0_T`
16:38:52FromGitter<kaushalmodi> *I never understood what `cdecl` does .. seems to work without it too
16:39:45clyybberafaik cdecl only does it's thing on windows.
16:40:04FromGitter<kaushalmodi> clyybber: good to know, thanks
16:40:23clyybberand even there it only means: use the c calling convention
16:40:31shashlickhonestly not sure if ref struct == ptr struct
16:40:38clyybberso not much really. I believe compilers nowadays would do this automatically
16:41:53FromGitter<kaushalmodi> shashlick: they are probably not .. thing is that I am using ref object in implementation too: http://ix.io/1Fof
16:43:17shashlickya but i mean when passing it to C from Nim, is ref X the same as ptr X
16:43:34FromGitter<kaushalmodi> it's not, it fails compilation
16:44:00FromGitter<kaushalmodi> oh
16:44:17FromGitter<kaushalmodi> actually here when I pass ref instead of ptr on the C side, it works
16:44:46FromGitter<kaushalmodi> I am sending a struct containing a struct containing an array to C side
16:45:03FromGitter<kaushalmodi> there it returns a struct containing mean, max, min vals calc from that array
16:45:07FromGitter<kaushalmodi> and everything works
16:45:16FromGitter<kaushalmodi> it's ptr on C side and ref objects on Nim side
16:48:55*kapil____ quit (Quit: Connection closed for inactivity)
16:49:48shashlickokay no idea - i've always used ptr for C interop
16:49:58shashlickwho knows if ref brings some additional safety
16:50:01clyybberkaushalmodi ref (for now) introduces runtime overhead.
16:50:20clyybbershashlick refs get collected by the GC
16:50:44FromGitter<liquid600pgm> what does `discard <proc>` do?
16:50:55clyybberIt throws the proc away.
16:50:59clyybberIt does nothing.
16:51:21clyybberIt's used when you don't care about the result of <proc>
16:51:26FromGitter<kaushalmodi> shashlick: actually I just tried this .. this does not compile: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ca7878ef851ee043d68c0fb]
16:51:49FromGitter<liquid600pgm> no, I'm talking like ⏎ ⏎ ```proc abc = discard ⏎ ⏎ discard abc``` [https://gitter.im/nim-lang/Nim?at=5ca787a525686a7dc3dec8d6]
16:52:13FromGitter<liquid600pgm> it seems this behavior is illegal on 0.19.9, but works on 0.19.4
16:52:32clyybberliquid500pgm If just calls the proc
16:52:46clyybberwhen the proc doesnt return anything its the same as calling the proc without discard
16:52:59FromGitter<liquid600pgm> aahh
16:53:30clyybberdiscard is just a function which takes a parameter and doesn't return anything.
16:53:39FromGitter<liquid600pgm> I'm reading this: https://github.com/ephja/nim-glfw/blob/master/glfw.nim#L6 and it just confuses me
16:53:50FromGitter<liquid600pgm> wtf does this do!?
16:54:11clyybberHe is using discard because he doesn't care about the result of the proc
16:54:24clyybberbecause he only uses it to initalize something
16:54:28FromGitter<liquid600pgm> yes, but the weird thing is, that the procs accept arguments
16:54:29clyybberand assumes it just works.
16:54:41clyybberliauid600pgm Yeah thats weird
16:54:55FromGitter<liquid600pgm> and that's what confuses me
16:55:09FromGitter<liquid600pgm> I know how discard works and what it's for, but this is just weird
16:55:21clyybberI agree
16:55:26clyybberthats really weird
16:55:48clyybberthat wrapper in general is very complicated and "weird"
16:56:10FromGitter<liquid600pgm> I was thinking about writing my own, minimal SDL2 wrapper for my game engine
16:56:20FromGitter<liquid600pgm> I just don't know where to start
16:56:27clyybberc2nim?
16:56:31clyybberI guess
16:57:13clyybberliauid600pgm Are you planning on using opengl/vulkan directly or using the sdl2 graphics apis?
16:57:32FromGitter<liquid600pgm> I'm going to use OpenGL directly
16:57:45FromGitter<liquid600pgm> is there any good c2nim wrapper tutorial? reading c2nim's docs, it seems it's primarily made for transpiling C to Nim, not generating wrappers
16:58:08shashlickwhat are you looking at wrapping?
16:59:00clyybberliquid600pgm If you plan on using vulkan sometime in the future, check out: https://github.com/Clyybber/vulkanim
16:59:11FromGitter<liquid600pgm> I just want to wrap SDL's basic windowing and events
16:59:38shashlickwhich .h file - link?
16:59:41*noeontheend joined #nim
16:59:48shashlickyou can just run it by nimterop since it looks like pure C
17:08:13Zevvliquid600pgm: which SDL wrapper are you using?
17:09:13Zevv'sdl2' or 'sdl2_nim'?
17:12:39shashlick@kaushalmodi: fixed your issue
17:12:47shashlickstruct0 will now show up
17:13:23FromGitter<kaushalmodi> shashlick: wow, thanks!
17:13:36FromGitter<kaushalmodi> let me update (I haven't updated nimterop in past 2 months)
17:14:45shashlickokay, just pushed the code, will run through CI
17:18:18FromGitter<kaushalmodi> I confirm the fix. Thanks!
17:18:38FromGitter<kaushalmodi> Now to truly use nimterop, I will experiment with using ptr everywhere instead of ref
17:18:57*noeontheend quit (Ping timeout: 250 seconds)
17:19:24FromGitter<kaushalmodi> because I am still doing: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ca78e1ca84e0c501adfeabe]
17:20:15FromGitter<kaushalmodi> I'll definitely need to override that struct with UncheckedArray .. but using ptr will remove 1/2 of the above overrides
17:21:22FromGitter<genotrance> well, you can leave the struct as is
17:21:38clyybbershashlick: You are genotrance right?
17:21:44FromGitter<genotrance> you can always cast it in your code
17:21:46FromGitter<genotrance> yep
17:21:52clyybberk :)
17:22:14shashlicki switch to my gitter bridge on slack when I want to see snippets
17:22:18shashlickbut then forget to switch back
17:22:25*stefanos82 joined #nim
17:22:38FromGitter<kaushalmodi> shashlick: which struct can I leave as is?
17:22:45FromGitter<kaushalmodi> the DataObj?
17:22:49shashlicki mean use the nimterop output as is
17:23:06shashlickbut in your code, when you want to work with that array, cast it into the data type you want
17:23:36shashlickof course, no harm having static wrapped code if you don't expect it to chang
17:23:45shashlickmakes things cleaner
17:24:17shashlickthat's the limitation A-raq mentioned - automated wrappers have to be dumb since you cannot always decipher what the programmer's intention is
17:25:01FromGitter<kaushalmodi> shashlick: this just worked! ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ca78f6d7ecbdc29ca05e90f]
17:25:09FromGitter<kaushalmodi> working on trimming more :)
17:26:09shashlicknarimiran: what do I do with this - latest devel - https://travis-ci.org/nimterop/nimterop/jobs/516294339
17:27:35narimiranshashlick: is seems introduced by https://github.com/nim-lang/Nim/commit/3a5a0f6d46fa0b43ec223d60b2e0f600305eb5f8
17:27:45narimiranwhat do you do? you ping krux02 :)
17:28:12FromGitter<liquid600pgm> @Zevv I'm not using any wrapper, I want to create my own
17:29:59*Perkol joined #nim
17:30:31shashlick@liquid600pgm - let me know which file and I can get you started
17:30:40FromGitter<kaushalmodi> shashlick: well looks like I was in the wrong dir .. getting this error: ⏎ ⏎ > /home/kmodi/usr_local/apps/6/nim/devel/lib/system/fatal.nim(37, 5) Error: unhandled exception: /home/kmodi/.nimble/pkgs/nimterop-0.1.0/nimterop/cimport.nim(271, 14) `found` File or directory not found: mean_func_1.h gStateCT.searchDirs: @[]
17:31:02FromGitter<liquid600pgm> let's say, just SDL.h to get started
17:31:55shashlick@kaushalmodi: best to use currentSourcePath to get to the dir
17:32:01shashlickrelative paths
17:32:23shashlickliquid600pgm - that has many #includes
17:33:43FromGitter<liquid600pgm> dang, that includes pretty much everything
17:33:46FromGitter<kaushalmodi> shashlick: as I am investigating .. this looks like a regression in nimterop
17:33:47FromGitter<liquid600pgm> let me pick something simpler
17:34:32FromGitter<kaushalmodi> shashlick: if you remember the svdpi wrapper that I had worked on earlier: http://ix.io/1Foy
17:35:35FromGitter<liquid600pgm> shashlick: how about SDL_video.h? it seems like a good place to start, since I'd like to begin with windowing
17:35:53FromGitter<kaushalmodi> in that wrapper, the `doAssert fileExists(xlmIncludePath / "svdpi.h")` passes, there are no relative paths involved, and still it fails
17:36:18FromGitter<kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ca79212759abc043c707be3]
17:36:19*theelous3_ joined #nim
17:43:24*Perkol quit (Quit: Leaving)
17:44:59*Perkol joined #nim
17:45:53FromGitter<kaushalmodi> shashlick: strange things are happening .. if I do git pull on nimterop repo and do `nimble install`, it builds fine, but `nimble install nimterop@#head` crashes
17:48:32*rnrwashere joined #nim
17:49:11FromGitter<kaushalmodi> shashlick: so the 2 issues are separate .. I got the latest nimterop to install using git clone + nimble install (instead from head using nimble does not work)
17:49:12*cyraxjoe quit (Ping timeout: 245 seconds)
17:49:53*cyraxjoe joined #nim
17:50:03FromGitter<kaushalmodi> the second issue .. the one where svdpi wrapper stopped compiling .. the workaround is to not use `cSearchPath` for now .. after the below change svdpi wrapper works too: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ca7954bbd70a40d5fff3c1b]
17:54:56*cyraxjoe quit (Ping timeout: 246 seconds)
17:55:28*cyraxjoe joined #nim
17:56:40shashlickOk I'll take a look
17:56:49shashlickAre you on devel
18:00:34FromGitter<kaushalmodi> yes
18:03:14Zevvliquid600pgm: wrapping sdl is fairly trivial, but the callbacks can be tricky. SDL might call your code from its own threads, messing up nims bookkeeping
18:04:51*ng0 joined #nim
18:05:55clyybberliquid600pgm Are you set on SDL2? I'm using glfw and wonder what advantages sdl might bring
18:06:20FromGitter<liquid600pgm> yeah I'm not sure about if I want to use SDL2 for sure, still considering that
18:06:28FromGitter<liquid600pgm> compiling it seems really complex
18:06:35FromGitter<liquid600pgm> while GLFW is fairly small
18:07:24clyybberyeah.
18:14:31*rnrwashere quit (Remote host closed the connection)
18:15:39*rnrwashere joined #nim
18:18:00FromGitter<Varriount> Araq: With the new runtime, how would removing elements from something like a hash structure work?
18:19:23*natrys joined #nim
18:20:59*rnrwashere quit (Remote host closed the connection)
18:22:24FromGitter<Varriount> Normally one would write a procedure `proc removeT (hashSet: HashSet[T], element: T)`. Consider the case where `T` is a reference. `element` could then be either an unowned reference, with the owned reference being stored in `hashSet`, or `element` could be an owned reference, with the hashSet either containing an unowned reference to the same data, or an owned instance to a copy of the data (since hashSets operate on
18:22:24FromGitter... whether a value is 'equal' to another element, rather than if it actually is the other element.
18:22:41*rnrwashere joined #nim
18:31:34rayman22201This is the same as any other container really. Either the container takes ownership or it doesn't. If the hashSet makes a copy, it owns the copy, and thus has full control over removing it. If the hashSet *moves* the ref, then that is just an ownership transfer. Again the hashSet becomes the owner of the element. If the hashSet stores only `unowned refs`, then it does not have the "permission" to delete the element anyway.
18:31:34rayman22201It would simply "unlink" the ref from it's internal store.
18:32:23livcdis there a git wrapper in nim ?
18:32:25livcdi cant find it
18:33:24rayman22201livcd: https://nimble.directory/search?query=git
18:33:36livcdgee i always forget about nimble.directory
18:33:51rayman22201not as cool as npm, but we are trying lol
18:34:20*rnrwashere quit (Remote host closed the connection)
18:34:23livcdwas not there also a wrapper by shashlick ?
18:37:17rayman22201maybe something based on nimterop (since that's shashlick's thing) but I don't remember
18:37:18*rnrwashere joined #nim
18:38:24rayman22201I don't see anything on his github for a git wrapper though.
18:38:31rayman22201https://github.com/genotrance?utf8=%E2%9C%93&tab=repositories&q=&type=&language=
18:38:46rayman22201shashlick == genotrance on github. b/c he likes to confuse people :-P
18:49:09*al_t joined #nim
18:49:09*al_t is now known as al_
19:04:49*Xe quit (Quit: WeeChat 1.9.1)
19:04:58*Xe joined #nim
19:06:20*rnrwashere quit (Remote host closed the connection)
19:13:40disruptekit's like futures are designed to be used by async code but are completely incompatible with async themselves. is this by design?
19:14:28dom96disruptek: what? Context?
19:14:58disruptekeg. let's say i want to download 3 files at once, as per araq's "async voodoo" talk.
19:15:10disruptekbut the files are 5g/ea.
19:15:30disrupteki want to use the future on bodyStream in the AsyncHttpResponse.
19:16:02disruptekto get at the response, i want to be in, say, a future callback. but, from there, i cannot issue async calls or chain to a new future on the body stream...
19:17:12shashlickI never got around to wrapping libgit2
19:17:16disruptekso i can waitFor all the responses, but then i don't have the streams, and i have to perform a synchronous step to wait on those. what am i missing? i don't want to abuse scope.
19:18:05shashlickI think there was another wrapper already though
19:19:01shashlickLooks like there are a couple
19:19:58dom96you can issue async calls from a future callback
19:22:11disruptekhttps://gist.github.com/disruptek/69417a96f16402c2e3e93962eb32c02d
19:22:53FromGitter<kaushalmodi> shashlick: looking at the git blame: https://github.com/nimterop/nimterop/blame/master/nimterop/cimport.nim#L315 , ..
19:23:29FromGitter<kaushalmodi> would making `cAddSearchDir` compile time proc be the cause of this issue?
19:24:00FromGitter<kaushalmodi> but then why would it be .. because I am passing it a const string
19:24:12dom96disruptek: if you want to do something after a future finishes then use `await` and an async proc
19:24:16dom96don't mess with callbacks
19:24:50disruptekcallbacks seem pretty weak unless you reach outside scope.
19:25:38disruptekat least that should help me arrive at a pattern. thanks for the pointer.
19:27:20*rnrwashere joined #nim
19:30:51*rnrwashere quit (Remote host closed the connection)
19:31:10*rnrwashere joined #nim
19:32:09*al_ quit (Quit: al_)
19:32:35FromGitter<deech> Are there examples of Nim -> C/C++ bindings that produce a static and use the static version of the C/C++. The use case is a standalone binary without shared lib. dependencies.
19:33:22*narimiran quit (Ping timeout: 245 seconds)
19:37:00*mosORadi joined #nim
19:43:32shashlick@kaushalmodi - ya it needs to be in a static block
19:44:25shashlickhttps://nimterop.github.io/nimterop/cimport.html#cAddSearchDir%2Cstring
19:50:47disruptekdom96: working well, thanks. o7
19:52:06FromGitter<kaushalmodi> shashlick: but I am back to the earlier issue .. creating a minimal example repo
19:52:50FromGitter<kaushalmodi> here's the minimal file: http://ix.io/1Fpo See the comments in there
19:53:00FromGitter<kaushalmodi> I am pushing a minimal repo with the .h files too
20:00:05FromGitter<kaushalmodi> done: https://gitlab.com/kaushalmodi/nimterop_include_issue
20:20:44*Jesin quit (Quit: Leaving)
20:29:22*Jesin joined #nim
20:33:54shashlickhow come doAssert doesn't print the msg in -d:release
20:35:41shashlickno stack trace or msg comes out
20:36:48*I_Right_I joined #nim
20:37:47rayman22201I'm pretty sure release strips asserts. Release definitely strips stack stracing iirc.
20:40:10disruptekrelease builds are for releases. ;-)
20:40:13shashlickyep, since stackTrace is off, even the message goes away
20:40:22shashlickoh well
20:42:20*clyybber quit (Quit: WeeChat 2.4)
20:42:36*Perkol quit (Remote host closed the connection)
20:43:02*clyybber joined #nim
21:16:05*nsf quit (Quit: WeeChat 2.4)
21:18:40FromGitter<kaushalmodi> the idea of `doAssert` vs `assert` was that they always work
21:18:57FromGitter<kaushalmodi> `assert` gets disabled in release builds, `doAssert` should not
21:19:36shashlicki've enabled --stackTrace:on for now in nimterop
21:20:25shashlicklooking at your issue now @kaushalmodi
21:20:32*abm quit (Quit: Leaving)
21:21:15shashlickI think the #head issue is because # comments out the rest of the line
21:21:53FromGitter<kaushalmodi> but wouldn't `#head` be part of a string?
21:22:03FromGitter<kaushalmodi> thanks for looking into this
21:22:25FromGitter<kaushalmodi> narimiran: I just realized that doAssert doesn't should up in TheIndex or search on devel docs
21:23:11shashlick@kaushalmodi - it is being sent to the shell in that cd command
21:23:52FromGitter<kaushalmodi> shashlick: hmm
21:24:22FromGitter<kaushalmodi> narimiran: looks like after the assertions.nim was split out of system.nim, it's doc is not generated at all
21:25:18FromGitter<kaushalmodi> all sub-sections of system.nim docs return 404 here: https://nim-lang.github.io/Nim/system.html
21:25:46FromGitter<kaushalmodi> https://nim-lang.github.io/Nim/iterators.html, https://nim-lang.github.io/Nim/assertions.html, etc
21:28:56*solitudesf quit (Ping timeout: 268 seconds)
21:35:38*Trustable quit (Remote host closed the connection)
21:36:10*luis_ joined #nim
21:42:57shashlickhey @kaushalmodi - just pushed a fix for #124 but not able to test
21:42:59shashlickcan you please try
21:45:01FromGitter<kaushalmodi> shashlick: sorry to say that it's still not fixed
21:45:05FromGitter<kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ca7cc61a84e0c501ae19360]
21:46:36*mosORadi quit (Quit: Connection closed for inactivity)
21:47:32shashlickis that the full output?
21:47:38shashlickor same result?
21:52:28shashlickregarding your other issue - you need recurse = true
21:53:27FromGitter<kaushalmodi> yes, that's the full output
21:53:37shashlickokay i'll debug the previous one at home
21:53:49FromGitter<kaushalmodi> thanks
21:54:02FromGitter<kaushalmodi> let me read on the recurse=true setting
21:55:09shashlickhold on that
21:55:13shashlicki tried and it didn't work yet
22:01:31*NimBot joined #nim
22:01:34*dom96 joined #nim
22:01:58*shadowbane joined #nim
22:02:01*so joined #nim
22:02:04*dom96 quit (Changing host)
22:02:04*dom96 joined #nim
22:02:09FromGitter<kaushalmodi> yeah ..
22:02:23*sentreen joined #nim
22:02:26*luis_ quit (Quit: luis_)
22:02:54FromGitter<kaushalmodi> I need to remember to have `cDisableCaching()` otherwise I get false passes :)
22:03:01*GaveUp joined #nim
22:09:23*natrys_ quit (Quit: natrys_)
22:16:50*stefanos82 quit (Remote host closed the connection)
22:23:11*ng0 quit (Quit: Alexa, when is the end of world?)
22:31:51*luis_ joined #nim
22:43:22*I_Right_I quit (Remote host closed the connection)
22:46:52shashlick@kaushalmodi: okay #124 is really fixed now
22:50:46*clyybber quit (Quit: WeeChat 2.4)
22:51:28*rnrwashere quit (Remote host closed the connection)
22:53:50*rnrwashere joined #nim
22:57:08*oculux quit (Ping timeout: 245 seconds)
23:10:50*oculux joined #nim
23:17:46*krux02_ joined #nim
23:20:54*krux02 quit (Ping timeout: 264 seconds)
23:25:30*krux02_ quit (Read error: Connection timed out)
23:25:48*krux02_ joined #nim
23:42:37FromGitter<Varriount> rayman22201: Yes, but how would that work from an implementation perspective? Wouldn't the runtime need to check whether the reference is owned or not?
23:45:46*rnrwashere quit (Remote host closed the connection)
23:45:47FromGitter<Varriount> Or would procedures need to have multiple implementations for owned and unowned references?
23:51:31*noeontheend joined #nim