<< 07-10-2019 >>

00:00:34*Hideki_ joined #nim
00:05:27FromDiscord<treeform> that we did
00:06:55disruptekanyone else here use the kitty terminal emulator?
00:08:58*laaron quit (Remote host closed the connection)
00:13:07sealmoveμε
00:13:10sealmoveme*
00:13:34sealmovebut only because it can render images with ranger wm nicely
00:13:46sealmovei don't use half of the features it provides lol
00:14:02disruptekoh, you use icat?
00:17:33disrupteki was gonna have golden output runtime graphs (PNG) to the kitty console but it looks like nimetry doesn't work.
00:18:26Pistossealmove: treeform: Yes, I found out about Nim because of posts on Lobsters and Hacker News.
00:19:02*rockcavera joined #nim
00:19:07sealmovedisruptek: probably, it says "kitty image protocol, requires python PIL or pillow library".
00:19:38disrupteki think it's treeform's font code that broke nimetry.
00:19:55sealmovenimentry?
00:20:10sealmovePistos: great :-) welcome!
00:20:20disruptekhttps://github.com/benjif/nimetry
00:21:06sealmovebut it's only ~300 loc, can't you fix it? :P
00:21:48disruptekprobably; it's seeming to hang at the moment.
00:24:59sealmoveproc addGraph*(p: Plot, d: Dataset, s: GraphStyle, c: ColorRGBA = rgba(255, 0, 0, 255)) =
00:25:01sealmove p.graphs.add(Graph(data: d, style: s, color: c))
00:25:17sealmovedoes it have to be `p: var Plot` since you use add?
00:29:05sealmovemight be related to: https://forum.nim-lang.org/t/1685
00:30:33disruptektypical in nim
00:31:48disruptekguess i will debug it.
00:34:48disrupteki dunno how people write code like this.
00:36:58disrupteki guess i'm just not smart enough. to me, it's practically garbage.
00:43:38sealmoveone thing Nim can't enforce is code quality
00:44:17disruptekit's something to do with making the x axis ticks i think.
00:47:57disruptekwell, nim could enforce code quality.
00:48:05disruptekthat'd be kinda interesting, actually.
00:48:27sealmovehow?
00:48:43disruptekrun a test on the code and don't build a binary if it fails.
00:50:25sealmoveinternally by the compiler? or user-defined tests (we already have those)?
00:50:30disruptekinternally.
00:50:40sealmovei see, hmm
00:50:57disruptekhttps://en.wikipedia.org/wiki/Cyclomatic_complexity
00:51:34sealmoveIndeed sounds interesting. I am pretty sure Araq would have no problem to hide it under a compiler switch.
00:51:41disruptekeven a very modest requirement would prevent a lot of headscratching.
00:51:45sealmoveIf someone is willing to implement it
00:52:14sealmoveSounds like a great thesis lol
00:52:18disrupteki think my problem is that my x axis values are too small.
00:52:45disruptekwhich is ridiculous.
00:53:18FromDiscord<Rika> Oh no not cyclomatic complexity
00:53:28FromDiscord<Rika> It doesn't work too well afaik
00:54:07FromDiscord<Rika> I think sonarcube's cognitive complexity works a bit better but
00:54:27disruptekit doesn't have to work well to prevent dogshit.
00:59:07FromDiscord<Rika> It doesn't just prevent dogshit, it can prevent good code too
00:59:13FromDiscord<Rika> That's why I said it doesn't work too well
00:59:22disruptekthe problem was that i was trying to graph a bar graph with one bar in it.
01:00:23FromDiscord<Rika> What happened
01:00:25sealmovehum
01:00:49disrupteki can fix it but first i gotta figure out why kitty won't output the image.
01:02:33disruptekimages in the console. such a hack, but i love it.
01:03:22sealmovevirtual terminals have come a long way
01:03:23FromDiscord<Rika> https://github.com/brentp/nim-plotly how about this one
01:03:45sealmovethey carry relic concepts but still managed to get modern features
01:04:05disrupteki read that as `mangled` and nodded my head.
01:04:30disrupteki probably should use brent's stuff.
01:04:33disruptekhe's active.
01:05:22disruptekyeah, that looks much nicer, too. thanks for digging it up.
01:05:39sealmovenim-plotly looks awesome :O
01:08:28disruptekoh, but this creates web-pages that i then have to visit.
01:08:32disruptekpfffbt.
01:09:42FromDiscord<Rika> Wtf
01:09:48FromDiscord<Rika> I thought they were just images
01:09:53FromDiscord<Rika> What the hellllllll
01:09:54sealmoveirrelevant but, is there any style guide or something for order of constructs? for example obviously imports usually go first, then types, etc.
01:10:52disruptekthere's a thing called the NEP-1 but i'm not sure it specifies order. most of the order decisions are made for you by the compiler.
01:11:17disruptekyou can use code reordering, but i don't think it makes sense in virtually all cases.
01:11:48FromDiscord<Rika> Always thought plotly was about images
01:12:12FromDiscord<Rika> Nep Nep~ Nepu
01:12:23sealmovecode reordering changes your source file?
01:12:30disrupteknah.
01:12:48sealmovei don't like code reordering
01:14:09FromDiscord<juan_carlos> Ive seen code reordering enabled on the wild. I guess is kinda stable.
01:14:54disruptekkitty images might never work. it's basically a hack that uses console escapes to forward commands to the terminal.
01:18:00sealmovebut what is really the benefit of code reordering? avoiding forward declaration? or having more freedom (invites inconsistent style)
01:18:26disruptekokay, it works, but the graph sucks. 😁
01:20:13FromDiscord<juan_carlos> Yeah, no forward declaration AFAIK, I guess thats why is behind a switch, I dunno if embebed dev can have lots of forward declaration maybe?, I dunno.
01:20:52FromDiscord<juan_carlos> Like for IoThingies
01:23:09disruptekthose are my favorite.
01:23:57*Hideki_ quit (Remote host closed the connection)
01:24:13sealmovewith good code you rarely need forward declarations. i don't know about embedded, could make sense there, yes
01:24:41*Hideki_ joined #nim
01:25:45FromDiscord<juan_carlos> I guess forward declaration can create lots of empty objects which on embedded may not be always ideal.
01:27:16*krux02__ quit (Remote host closed the connection)
01:28:22FromDiscord<juan_carlos> Something that would be really cool to do is, make a Nim GUI lib based on Godot, if you open Godot editor, thats all Godot widgets, and runs on lots of hardware, if you just ignore all game stuff, api for GUI only is simple and uses C/C++. 🤔
01:28:56*nif quit (Quit: ...)
01:29:05*nif joined #nim
01:29:31*Hideki_ quit (Ping timeout: 268 seconds)
01:29:38disrupteki don't know why we don't make better use of graphics in our development environments.
01:30:00sealmovewhat do you mean?
01:30:17FromDiscord<juan_carlos> It even has an IDE widget. Uses Vulkan.
01:31:08disrupteki want to listen to my code, for one thing.
01:31:19disruptekalso i want to be able to visualize it.
01:31:33disruptekbut, listening to it will be easier for me to impl.
01:32:09FromDiscord<juan_carlos> SuperCollider 🎶
01:33:28*krux02 joined #nim
01:34:15rayman22201@disruptek, I agree with you. We need more visualizations in coding...
01:34:26disrupteka long time ago in a job far away, i built a tool that played sounds according to network events.
01:34:55disruptekwas pretty great for just listening to my network to know that it was running "right".
01:34:57rayman22201did you write a blog about it? That sounds vaguely familiar to me?
01:35:11disruptekwe presented it at a lisa.
01:35:29*krux02 quit (Remote host closed the connection)
01:36:07disrupteklook up michael gilfix (the student) and "peep: network auralizer" or some such.
01:36:54rayman22201oh yeah! it was on HN a while back. very cool project!
01:37:05disruptekreally?
01:37:32rayman22201yeah, It was a long time ago, over a year I think, but it got some good traction IIRC
01:38:02disrupteki don't know anyone else that ran it.
01:38:35disruptekit was just something in my dept far as i know. but it was good for the student. people loved it at lisa. really fun to listen to a network.
01:38:51rayman22201It really is a clever idea
01:39:22rayman22201If anybody has a minute and a Windows box, can you run the async test suite in testament on this PR: https://github.com/nim-lang/Nim/pull/12371
01:40:34disruptekno windows, sorry.
01:41:38rayman22201thanks anyway :/
01:41:48disruptekthis was something we built in like 2002 or thereabouts.
01:42:34disruptekmaybe 2000. i dunno, a long time ago. like, early linux audio and mixing it all up ourselves. pita.
01:44:34rayman22201Sometimes older stuff gets pushed up to the top of HN. Some neat stuff comes up occasionally :-P
01:44:49disruptekthat's true, and that would definitely be a good candidate.
01:53:00shashlick@rayman22201 - still need that test?
01:54:39rayman22201yes please
01:54:55rayman22201hard to fix something I can't repro :/
01:56:06shashlickok so open PR, rebuild koch, nim and tools, then testament?
01:56:12shashlickor is it in stdlib
01:56:33rayman22201stdlib, so no need to rebuild everything
01:56:39rayman22201just use the stdlib from the PR
01:57:06rayman22201and you only need to run a single test `async/testmanyasyncevents.nim`
01:57:31rayman22201#naming is the hardest thing in programming
01:58:25disruptekheh
02:15:36*Jjp137 quit (Read error: Connection reset by peer)
02:16:23*Jjp137 joined #nim
02:19:17*theelous3 quit (Ping timeout: 240 seconds)
02:25:46*theelous3 joined #nim
02:35:21*sagax quit (Remote host closed the connection)
02:43:56*sagax joined #nim
02:46:01*rockcavera quit (Remote host closed the connection)
02:56:28*notgne2 joined #nim
03:04:40*lritter quit (Ping timeout: 265 seconds)
03:05:01*lritter joined #nim
03:07:15*Cthalupa quit (Ping timeout: 240 seconds)
03:25:54*Cthalupa joined #nim
03:34:28shashlick@rayman22201 - `PASS: tests/async/testmanyasyncevents.nim C ( 3.10961199 secs)`
03:35:18rayman22201Wth is going on with Azure?
03:35:47rayman22201Thanks @shashlick
03:37:01shashlickno problem
03:37:34shashlickazure pipelines sure looks cool
03:45:29*chemist69 quit (Ping timeout: 276 seconds)
03:46:55*chemist69 joined #nim
03:53:40rayman22201Cool, fast, beautiful... except it fails on my test for some unknown reason 😝
03:54:13rayman22201That's ok. I am now drinking my pains away lol
03:56:28shashlickjust crawled out of the nimterop / nimarchive hole I was in since @disruptek wanted a libgit2 wrapper which promptly found inefficiencies in nimterop
03:56:44shashlicknow i'm mad enough to setup a CI for nimgit2 with its own dozen failures
04:03:09rayman22201And the circle of life continues
04:03:45shashlicki'm just going to release 0.2.0 and nimarchive 0.3.0
04:03:48shashlickenough is enough
04:32:43*radsoc joined #nim
04:40:52FromGitter<kvinwang> Hi, there. I'am trying to port the GPT2 model with arraymancer. And there is a matmul OP there. Arraymancer's matmul requires tensors to be a Matrix or Vector. But the q,k,v in GPT2 are batches of matixes. It there a way to do batch matmul in arraymancer?
04:47:52*dddddd quit (Remote host closed the connection)
04:53:01*nsf joined #nim
04:53:31FromDiscord<badassiel> any idea how to decompose string to bitset of chars?
04:54:15yumaikasI don't think you could do that?
04:55:29yumaikasOr, at least, you'd probably run into bit-width issues, no?
04:58:39yumaikasbadassiel: Could you give a *little* more detail?
05:07:53FromGitter<kvinwang> > Hi, there. I'am trying to port the GPT2 model with arraymancer. And there is a matmul OP there. Arraymancer's matmul requires tensors to be a Matrix or Vector. But the q,k,v in GPT2 are batches of matixes. It there a way to do batch matmul in arraymancer? ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ The q and k are batches of n heads of matixes here. @mratsim Any idea? [https
05:07:54FromGitter... ://gitter.im/nim-lang/Nim?at=5d9ac829940b4c2fc08b762f]
05:08:34*yumaikas is not any sort of export with arraymancer
05:27:13FromGitter<kvinwang> Ohh, I can reshape them into 2 big matixes.
05:40:40*absolutejam joined #nim
05:41:11*skoude joined #nim
05:42:18*radsoc quit (Quit: radsoc)
05:43:54*solitudesf joined #nim
05:49:38*whaletechno quit (Ping timeout: 276 seconds)
05:50:36*narimiran joined #nim
06:04:35*absolutejam quit (Ping timeout: 276 seconds)
06:08:49*absolutejam joined #nim
06:14:57*oculux quit (Ping timeout: 240 seconds)
06:19:13*oculux joined #nim
06:19:37*solitudesf quit (Ping timeout: 240 seconds)
06:25:15*absolutejam quit (Ping timeout: 265 seconds)
06:33:17yumaikasSo, I gather that htmlgen isn't maintained any longer? Are there any recommendations as to what to use instead?
06:39:09Araqhtmlgen is maintained
06:39:19Araqwe updated it for v1
06:39:34Araqbut the better alternative is "native karax"
06:40:08Araqhttps://github.com/pragmagic/karax/blob/master/tests/nativehtmlgen.nim
06:40:43*Vladar joined #nim
06:40:45*Vladar quit (Remote host closed the connection)
06:41:08*Vladar joined #nim
06:43:08*actuallybatman quit (Ping timeout: 265 seconds)
06:48:45ZevvOi Araq: how are the muscles holding up today?
06:51:35FromDiscord<kameleon> Hello! Is anyone here doing graphics programming using Vulkan in Nim? If so, I would be interested in finding well maintained bindings supporting Vulkan 1.1. Or am I better off interfacing with C/C++ myself?
06:51:54FromDiscord<kameleon> Hello! Is anyone here doing graphics programming using Vulkan in Nim? If so, I would be interested in finding well maintained bindings supporting Vulkan 1.1. Or am I better off interfacing with Vulkan C/C++ API myself?
06:52:40AraqI'd update the existing Vulkan bindings
06:53:01AraqZevv: well I can walk
06:53:20Araqand nothing hurts much, everything a little
06:53:41Zevvgood job!
06:57:05*krux02 joined #nim
06:57:23Araqyeah, should have run faster, didn't touch my "limit" :P
06:57:24FromDiscord<kameleon> Araq: Thanks! That's of course a good practice. A quick search indicates that this is the most popular choice: https://github.com/nimious/vulkan. I'm actually very new to the Nim ecosystem. I'm coming from a C & Rust background looking for an alternative.
07:00:00*gmpreussner quit (Quit: kthxbye)
07:00:44Araqbll
07:00:46Araqbbl
07:01:30yumaikasAraq: native karax? That sounds interesting
07:03:03yumaikasAlso, I can make a PR, but I don't see any mention on Jester of how 1.0 affects it?
07:03:17*adeohluwa joined #nim
07:04:52*gmpreussner joined #nim
07:06:57*yumaikas will have to look into how to use the server-side parts of karaxdsl
07:17:48*theelous3 quit (Ping timeout: 245 seconds)
07:18:29*fanta1 joined #nim
07:18:40*adeohluwa quit (Ping timeout: 264 seconds)
07:19:26*absolutejam joined #nim
07:19:39*couven92 joined #nim
07:21:25*solitudesf joined #nim
07:24:41leorizerayman22201: azure is known for tripping a lot on async tests on windows
07:30:21*lritter quit (Quit: Leaving)
07:31:50*floppydh joined #nim
07:32:46*PMunch joined #nim
07:38:23FromGitter<alehander42> anything new
07:38:34FromGitter<alehander42> since saturday
07:38:54FromGitter<alehander42> i see orm talks, new users and araq running around a random german city 40 km for some reason
07:40:23FromGitter<alehander42> wow and the z3 thing looks interesting
07:42:10lqdev[m]what, somebody ported z3 over to Nim or what?
07:42:58FromGitter<alehander42> https://forum.nim-lang.org/t/5289
07:43:45FromGitter<alehander42> this might be better than a typestate pattern for some things
07:44:00FromGitter<alehander42> interesting to see an example
07:45:19FromGitter<alehander42> zah linked me some typestate links and i got interested in expressing "temporal" relationships (e.g. this type can be used only after this other thing happened changing this type to this state)
07:45:35FromGitter<alehander42> can one express that with z3
07:49:35*Vladar quit (Remote host closed the connection)
07:50:05*Vladar joined #nim
08:22:31Zevvlqdev[m]: https://github.com/zevv/nimz3
08:23:02*skoude quit (Ping timeout: 276 seconds)
08:26:28FromGitter<alehander42> zevv, what is z3 most useful for
08:27:19Zevvnasty Advent of Code puzzles
08:28:08Zevvand solving sudokus
08:33:06FromGitter<alehander42> very future
08:33:27FromGitter<alehander42> i was trying to make a z3 model for something i remember
08:34:01FromGitter<alehander42> oh no this was tla
08:39:35*skoude joined #nim
08:42:17*absolutejam quit (Ping timeout: 240 seconds)
08:44:03*skoude quit (Ping timeout: 245 seconds)
08:51:36*absolutejam joined #nim
08:54:02Zevvon a serious note; z3 should be able to help proving code, withing limitations. I did some experiments with macros unrolling bounded loops and feeding each iteration to z3, and in the end asking it "does this hold?". And it tells you yes or no. That's about it.
08:55:18FromGitter<alehander42> thanks : ) i will read a bit more and ask questions
08:55:43Zevvalehander42: start here https://www.youtube.com/watch?v=ruNFcH-KibY
08:56:03FromGitter<alehander42> dont they have a text version
08:56:53FromGitter<alehander42> ah nvm, my text fanboyism
08:57:17ZevvI hereby apologize in the name of the whole of mankind for the creation of youtube and the hiding of essential bits of information in 45-minutes long videos
08:57:20ZevvI feel you
08:58:14FromGitter<alehander42> i am just whining
08:58:51Zevvpreaching to the choir :)
08:59:16FromGitter<alehander42> ok, sat vs smt sounds useful
08:59:36*shomodj joined #nim
08:59:59FromGitter<alehander42> i have to admit something: for a while i thought sat solvers and exams cover the same types of problems
09:02:24*gangstacat quit (Quit: Ĝis!)
09:06:01PMunch"Hello everyone, welcome to this video in which I'll explain to you where to find the installation folder for node.js. But first let me give a quick shout out to all my patreon supporters, without you ..."
09:09:31*clyybber joined #nim
09:11:47*absolutejam quit (Ping timeout: 250 seconds)
09:12:28clyybberkameleon: I have updated vulkan bindings
09:12:54clyybberhttps://github.com/Clyybber/vulkanim
09:14:59*absolutejam joined #nim
09:15:09FromDiscord<Clyybber> @kameleon
09:16:33*skoude joined #nim
09:19:15FromDiscord<kameleon> @Clyybber Cool, thanks! I'll look into them. +1
09:20:22*narimiran_ joined #nim
09:20:43*narimiran quit (Ping timeout: 245 seconds)
09:24:03*skoude quit (Ping timeout: 240 seconds)
09:24:47*krux02 quit (Ping timeout: 250 seconds)
09:25:47*clyybber quit (Quit: Quit)
09:27:57*asymptotically joined #nim
09:32:57FromGitter<mratsim> @kvinwang no batch matmul. The conv2d operator does batch matmul but I didn't implement a batch matmul operator as in general it's just a for loop over mul
09:34:00*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:48:46*abm joined #nim
09:57:07*skoude joined #nim
10:02:31FromGitter<alehander42> Zevv, i wonder if interprocedural analysis
10:02:44FromGitter<alehander42> would be easily translatable to z3 formulas
10:02:46*shomodj joined #nim
10:03:06FromGitter<alehander42> it seems easier to apply it for local algorithms (still havent watched most of the talk tho)
10:03:14*gangstacat joined #nim
10:03:39*narimiran_ is now known as narimiran
10:05:30FromGitter<alehander42> about the loops, isnt it easy for some properties to model infinite loops as just having several states if you know they lead to only 2-3 invariants
10:07:31FromGitter<alehander42> its like, some analysis mostly care about loops as "after 0 runs/ 1 run/2runs..doesnt matter after that"
10:11:17ZevvThat would probably be fine as long as your promise your user you proved only a bit of it, and not all
10:11:42FromGitter<alehander42> but for some cases the invariants can be only those that arise
10:11:46FromGitter<alehander42> after 0 1 or 2 runs
10:13:32FromGitter<alehander42> e.g. "variable is isNil": variable keeps its current state after 0, maybe changes it after 1, and then maybe changes it depending on its state in iteration 1
10:27:02*solitudesf quit (Remote host closed the connection)
10:27:27*solitudesf joined #nim
10:28:19*tdc joined #nim
10:30:08ZevvYesm but can you tell these cases apart without going through the loops, that's the point of course
10:30:39Zevva good use is staticly proving that you will not run into overlows of your types - that's hard to do without going through the motions
10:37:22Zevvand I once asked Z3 if it could prove if Z3 can prove it will ever prove a proof
10:37:24Zevvit's still running
10:41:49sealmoveguys, what is the typical naming convension for "special" identifiers in nim?
10:42:08sealmovefor example in C you do _myvar, but that's not possible in Nim of course.
10:45:46*skoude quit (Ping timeout: 265 seconds)
10:48:43FromGitter<alehander42> i dont think there is one, i'd use naming , e.g. `internalMyVar` or `projectnameMyVar`, i think some people use something like `pMyVar`
10:49:08FromGitter<alehander42> if its macro generated, its different
10:54:31sealmoveI see, that's what I thought, thanks
10:55:20FromGitter<alehander42> Zevv, interesting
10:55:30FromGitter<alehander42> well i mean that sometimes bounded loop unrolling
10:55:37FromGitter<alehander42> is enough even if the original code
10:55:40FromGitter<alehander42> doesnt have a bounded loop
11:06:57*skoude joined #nim
11:13:55FromGitter<kvinwang> @mratsim OK, I'm going to use a for loop. Thanks!
11:34:06jkenWhat is the correct way to check if a proc has been instantiated and not just defined, proc != nil?
11:34:31FromDiscord<juan_carlos> Inside `macro` how do I call a `template` that returns `string` and get a `string` because I get `nnkCall` and I am appending to a preexisting `string` inside the `macro` ?.
11:36:56*absolutejam quit (Ping timeout: 268 seconds)
11:37:36*absolutejam joined #nim
11:39:28*salewski joined #nim
11:41:05salewskiCan someone understand https://forum.nim-lang.org/t/5295#33277
11:41:09salewskiHello , the example is on {table.nim complete uiTable} in github ui
11:41:29salewskiI have no idea what his {table.nim complete uiTable} may mean.
11:42:08salewskiThere is no JPLRouge on github, can not find it with goggle?
11:44:56salewskiAh, maybe he means https://github.com/nim-lang/ui/tree/master/examples
11:45:31salewskiBut what is that strange link google found?
11:47:48salewskiYes, I think he is talking about https://github.com/nim-lang/ui/blob/master/examples/table.nim
11:48:47salewskiThat is nonsense, it is in no way related to gintro/gtk. Bye.
11:49:02*salewski quit (Quit: WeeChat 2.5)
11:58:44FromGitter<alehander42> well, this depends on libui
11:58:51FromGitter<alehander42> which uses gtk
11:59:20FromGitter<alehander42> probably not related to gintro, but to gtk
11:59:29FromGitter<alehander42> i agree, hard to understand, but still related
12:05:15*rockcavera joined #nim
12:24:35ZevvWhat is the reason that C++ lambda's need an explicit [list of captures], anyone know?
12:27:39*Hideki_ joined #nim
12:28:30*Kaivo joined #nim
12:29:13FromDiscord<Generic> explict is better than implicit
12:29:42FromDiscord<Generic> and you can decide the way things are captured
12:29:51FromDiscord<Generic> either by value or by reference
12:29:55Zevvyes, but its still redundant, right?
12:30:03FromDiscord<Generic> not completely
12:30:18FromDiscord<Generic> because afaik can just do [&]
12:30:28Zevvah, that's news, thanks!
12:30:32FromDiscord<Generic> and then everything is captured by ref
12:31:56FromGitter<alehander42> i think its for capture checking
12:32:09FromGitter<alehander42> like, you can declare "i dont access this" and if you do by mistake, its an error
12:32:26FromGitter<alehander42> no ide
12:32:27FromGitter<alehander42> a
12:32:51Zevvyeah, but it's different from all other languages that support closures I worked with
12:35:27*sealmove quit (Quit: WeeChat 2.6)
12:44:50FromGitter<alehander42> it seems you can define how do you want to capture
12:44:55FromGitter<alehander42> by value or by ref
12:45:02FromGitter<alehander42> so you have fine grained control on that
12:46:46FromGitter<alehander42> it seems in nim, they're captured by ref always
12:47:20FromGitter<alehander42> but you can use a pattern like `let val = localValue, use val`
12:47:34FromGitter<alehander42> i guess, at least it seems thats what rust ppl do as workaround
12:47:50FromGitter<alehander42> i never really thought about that , nice
12:50:57*skoude quit (Ping timeout: 265 seconds)
12:51:06*rockcavera quit (Remote host closed the connection)
12:53:37*actuallybatman joined #nim
12:54:07*dddddd joined #nim
12:55:16Zevvhmm true
12:55:32Zevvthat also solves the problem of capturing loop variables, nim has a hackish way for that now
13:03:44Hideki_It may sound a ridiculous question...but when I want to get a rounded off value as an integer from a string such as 1.2, is "1.2".parseFloat.round.toInt the best way? I'm afraid there may be a more sophisticated way.
13:04:24*rockcavera joined #nim
13:07:32Hideki_If there is round(x: float32): int, it would be helpful.
13:08:02FromDiscord<Generic> you can also use https://nim-lang.org/docs/parseutils.html#parseInt%2Cstring%2Cint%2Cint to only parse the whole part of the number
13:09:28Hideki_"1.2".parseInt caused "Error: unhandled exception: invalid integer: 1.2 [ValueError]"
13:09:48YardanicoHideki_: nonono, not parseInt from strutils, parseInt from parseutils
13:10:03FromDiscord<Generic> also if you have negative numbers
13:10:09Hideki_let me check...
13:10:26FromDiscord<Generic> note that if you only take the whole part you're rounding towards zero
13:10:33FromDiscord<Generic> not towards negative infinity
13:10:54Yardanicoah, right, this would round 1.9 to 1
13:11:44YardanicoHideki_: I think using int(parseFloat("1.2").round) is fine
13:12:03FromDiscord<Generic> yes
13:12:08YardanicoAnd we can't have round(x: float32): int because there's no return type overloading in Nim (and I don't think it's generally a common language feature)
13:12:09FromDiscord<Generic> that's probably the best way
13:12:13*skoude joined #nim
13:13:10FromDiscord<Generic> though if you want to go really crazy, you can parse the whole and the fractional part separately
13:13:27FromDiscord<Generic> then compare the fraction to 10*numbersofdigitsoffraction
13:13:31FromDiscord<Generic> /2
13:13:35Yardanico:D
13:13:43Hideki_Thank you guys! parseutils and int(parseFloat("1.2").round) worked!
13:13:56FromGitter<alehander42> Zevv do you mean closureScope
13:14:31Hideki_My point was not about how to round off. I want to write float->int in the simplest way :)
13:14:32YardanicoHideki_: well, with this code you're still using strutils :P
13:14:45Yardanicobut it's fine, strutils.parseFloat is enough for your usecase
13:15:00Hideki_thanks
13:16:33*skoude quit (Ping timeout: 245 seconds)
13:21:08Zevvalehander42: right
13:21:35Zevvfirst I was 'meh', but now I am 'hmmm', with the C++ [] notation
13:22:00ZevvI do like the self-documentationess of it
13:23:08FromGitter<alehander42> i wonder if one can do that with a pragma
13:24:12ZevvI bet you can macro it away and invoke closureScope where appropriate
13:24:51Zevvbut closurescope is a catchall of course
13:26:08*theelous3 joined #nim
13:33:22FromGitter<kayabaNerve> A macro can't supply line numbers, right?
13:33:58FromGitter<kayabaNerve> Because the macro I'm working with has every single error be the function def's line number, which makes it very difficult to debug.
13:35:44FromDiscord<juan_carlos> `lineInfo`
13:35:47Zevvit can
13:35:48FromGitter<kayabaNerve> Side note, why does having a function which raises X as an argument/passing it add every single raise effect to the function passing it?
13:36:21FromGitter<kayabaNerve> Sweet, thanks for that.
13:36:24FromGitter<alehander42> https://nim-lang.org/docs/manual.html#pragmas-line-pragma
13:36:52CadeykayabaNerve: because of https://nim-lang.org/docs/manual.html#effect-system
13:37:08Zevvjuan_carlos: copyLineInfo
13:37:16FromGitter<alehander42> also you can use line info to do more custom logic but if you mean debug info not sure
13:37:27FromGitter<alehander42> zevv i mean, one can go further
13:37:29ZevvIf you create a new NimNode, you can pass it the (approximate) source node that caused the genration of your new node
13:37:46FromGitter<alehander42> {.capture: [copy a].} => generate a let aCopy and replace all a with this
13:39:51FromGitter<kayabaNerve> Right, I'm asking why `Every expression of some proc type within a call that is not a call itself (and not nil) is assumed to be called indirectly somehow and thus its raises list is added to p's raises list.`
13:40:20FromGitter<kayabaNerve> Because if I have X raising A, take X to Y, pass X from Y to Z, and Z handles all the errors, I have to add excepts in Y that literally will never be raised.
13:40:25FromGitter<kayabaNerve> ... executed?
13:40:30FromGitter<kayabaNerve> ... excepted?
13:40:34jkenIs anyone able to tell me what I am doing wrong here? https://play.nim-lang.org/#ix=1XTR
13:41:02Yardanicojken: queueEvent takes a copy of EventQueue
13:41:25Yardanicoif you want to modify the original one, you should define the argument as "queue: var EventQueue"
13:41:37FromGitter<kayabaNerve> Just about to say :P Yardanico beat me to it.
13:41:57jkenahh, thanks
13:41:58Zevvalso init your dequeue
13:42:01jkenJs habits are killing me
13:42:02Zevvthis will go boom
13:42:31FromGitter<kayabaNerve> Anyways. It's really annoying that passed functions, not called functions, behave like called functions in the effects system. It causes me to write `except X:` blocks for no reason.
13:42:49Zevvtables and seqs are automatically initialized these days, but dequeues are not :/
13:43:04FromGitter<kayabaNerve> My point with asking is if there's a valid reason for this/what valid reason this attempts to solve.
13:43:06Zevvhttps://play.nim-lang.org/#ix=1XTT
13:43:33*clyybber joined #nim
13:45:31jkenThanks guys
13:48:31shashlickany idea how to work around https://github.com/nim-lang/Nim/issues/11851
13:53:35FromGitter<alehander42> @kayabaNerve
13:53:38FromGitter<alehander42> iirc araq specifically
13:53:42FromGitter<alehander42> wanted it to work like that
13:54:45FromGitter<alehander42> i guess what you want is passed functions to behave like `func` except if they are directly called?
13:59:01FromGitter<kayabaNerve> I want to be able to pass functions without Nim acting like they may throw exceptions.
14:00:03FromGitter<kayabaNerve> Because I do handle its Exceptions; when they're able to thrown when called by the function I pass it to. Even if I didn't, the function which called them would have the raise effects, and then my call to said function would get them.
14:00:46FromGitter<kayabaNerve> So getting it by passing it doesn't help the case where I don't handle the exceptions but adds a truly pointless redundancy when I do handle them.
14:01:01FromGitter<alehander42> and you can possibly just not use them
14:01:09FromGitter<alehander42> but assign them to a field in your called function
14:01:20FromGitter<alehander42> i agree that some of those checks are very conservative
14:01:26FromGitter<kayabaNerve> It's not horrific to add except X, exceptY, doAssert, doAssert. It's just annoying. It acts like a bug when I have to handle exceptions that literally cannot be raised.
14:01:33FromGitter<alehander42> of course
14:01:44FromGitter<kayabaNerve> Yep, I use callback options a lot.
14:01:49FromGitter<kayabaNerve> *callback object
14:02:00FromGitter<alehander42> thats one of the main problems with most checked/tracked exception systems: making one catch impossible cases
14:02:00*PMunch quit (Remote host closed the connection)
14:02:18FromGitter<alehander42> i fully agree that it would be better for the analysis to not mistrack those
14:02:35FromGitter<alehander42> my guess is that it just wasnt easy to improve it for those cases
14:02:48FromGitter<kayabaNerve> I mean, they're not callbacks. They're to access various parts of the system from a single point without circular dependencies/passing every single data structure. That's just the easiest way to convey it's definition.
14:03:08FromGitter<kayabaNerve> IIRC doing x = procDef doesn't have this affect. It's x = passedProc.
14:03:21FromGitter<alehander42> yeah, they are functions
14:03:45FromGitter<kayabaNerve> Yep. procDef doesn't tell the effects system to add the raise effects. Solely passedProc.
14:03:46FromGitter<alehander42> yes, thats how its supposed to work
14:03:46FromGitter<alehander42> https://nim-lang.org/docs/manual.html#effect-system
14:03:50FromGitter<alehander42> if you read the spec
14:03:52FromGitter<alehander42> point 2
14:03:53FromGitter<kayabaNerve> I have.
14:04:00FromGitter<kayabaNerve> It was linked earlier.
14:04:09FromGitter<alehander42> oh sorry
14:04:21FromGitter<kayabaNerve> I wrote a macro which 'exploits' the effects system.
14:04:37FromGitter<kayabaNerve> I mean, it's used exactly as it should be used, arguably. I don't do a ton of weird things with it.
14:04:48FromGitter<alehander42> i guess its a bit hard to analyze
14:04:50FromGitter<kayabaNerve> But I use the effects system in the macro for personal gain.
14:05:14FromGitter<alehander42> because an alternative is to change the rule and e.g. make those noeffect
14:05:18FromGitter<kayabaNerve> I can't tell if using something as intended for personal gain as intended is exploitation or not.
14:05:37FromGitter<alehander42> do you have a repo with this macro
14:05:45FromGitter<kayabaNerve> Yeah. It's been public for months.
14:05:52FromGitter<kayabaNerve> It's called ForceCheck. It stops bubble up.
14:06:33FromGitter<kayabaNerve> It redeclares your function with a blank raises to make sure it doesn't raise anything unintentionally (with all the raises in the function itself replaced with discards).
14:06:52FromGitter<kayabaNerve> It even works with async functions, which can always raise Exception, as long as you put the forceCheck pragma before async.
14:07:04FromGitter<kayabaNerve> https://github.com/kayabaNerve/ForceCheck
14:07:09FromGitter<alehander42> sounds very interesting
14:07:12FromGitter<alehander42> a nice hack
14:07:40FromGitter<kayabaNerve> It becomes quite verbose (a lot of my except branches just reraise tbh) but it works for me. I suck at remembering to except things and I rather be verbose than forgetting.
14:08:09FromGitter<alehander42> it seems you also got to the defect/catchable error distinction
14:08:59FromGitter<alehander42> however i am not sure this is fully correct about async: i guess the reason is that the internal async closure code can actually raise indeed
14:09:18FromGitter<alehander42> so maybe this should still be somehow specified as a special internal error somewhere
14:09:24FromGitter<kayabaNerve> Oh. It also has a couple other tools. One is fcRaise which was to get around a Nim bug where C++ Exceptions weren't reraisable (fixed in 1.0 according to GitHub) and one just lets you know (naively) if you have a risk of IndexError (because a seq access is always at risk of throwing that but you don't need to annotate it in raises as the Nim spec considers it fatal despite the Nim compiler making it catchable).
14:09:40FromGitter<alehander42> the c++ should be fixed iirc
14:09:49FromGitter<kayabaNerve> You cannot make an async call and have a blank raises pragma unless you use waitFor IIRC.
14:09:56FromGitter<kayabaNerve> (so await is the problem)
14:10:23FromGitter<alehander42> i know, my point is that blank raises is more practical, but also not really *correct*
14:10:37FromGitter<kayabaNerve> I just don't think it should risk raising at all :P
14:10:40FromGitter<alehander42> as in theoretically the code implementing the awaiting might raise some rror
14:10:42FromGitter<kayabaNerve> But async is complicated and all that.
14:10:44FromGitter<alehander42> probably
14:10:51FromGitter<kayabaNerve> forceCheck, on async code, replaces all await with waitFor in the copy which is stripped out as dead code by default.
14:10:53FromGitter<alehander42> but maybe it cannot: dont count me on that
14:11:02FromGitter<kayabaNerve> As long as you apply the async pragma second, it works.
14:11:17FromGitter<kayabaNerve> I also have it working with a bunch of other types. Proc, func, method, converter....
14:11:20FromGitter<alehander42> yeah, makes sense
14:12:16FromGitter<alehander42> well, if a proc argument is only passed to a call, then that call should list any possible resulting effects in its list
14:12:17FromGitter<alehander42> indeed imo
14:12:39FromGitter<alehander42> so i agree that if there are no other usages, this shouldn't add a raise
14:13:16FromGitter<alehander42> not really sure why its implemented like that
14:13:20FromGitter<alehander42> specced
14:13:38FromGitter<alehander42> i guess we can ask the guy
14:13:44FromGitter<kayabaNerve> Hence why I came here to ask
14:13:52FromGitter<kayabaNerve> Also about LineInfo because forceCheck does not have that
14:14:06FromGitter<kayabaNerve> Quite annoying. Should be just a couple lines though
14:15:36FromDiscord<juan_carlos> Inside `macro` how do I call a `template` that returns `string` and get a `string` because I get `nnkCall` and I am appending to a preexisting `string` inside the `macro` ?. Or should I use `func` instead of `template` inside `macro` ?.
14:16:10FromGitter<alehander42> you can use proc/func i guess
14:16:18FromGitter<alehander42> usually thats what i do for helpers in macros
14:17:00FromGitter<alehander42> if it can be expressed by func, i think its better
14:18:37FromDiscord<juan_carlos> Ok, will try, it just returns a static string.
14:18:54*Connor[m] quit (Remote host closed the connection)
14:18:54*BitPuffin quit (Read error: Connection reset by peer)
14:18:55*swisscowbell[m] quit (Remote host closed the connection)
14:18:56*nc-x[m] quit (Read error: Connection reset by peer)
14:18:57*xomachine[m] quit (Read error: Connection reset by peer)
14:19:00*pigmej quit (Read error: Connection reset by peer)
14:19:01*k0mpjut0r quit (Write error: Connection reset by peer)
14:19:02*ronny quit (Write error: Connection reset by peer)
14:19:04*Miguelngel[m] quit (Write error: Connection reset by peer)
14:19:04*testgovno[m] quit (Write error: Connection reset by peer)
14:19:04*spymasterd[m] quit (Write error: Connection reset by peer)
14:19:08*planetis[m] quit (Remote host closed the connection)
14:19:09*zielmicha[m]1 quit (Read error: Connection reset by peer)
14:19:10*LEdoian[m] quit (Read error: Connection reset by peer)
14:19:12*gh0st[m] quit (Remote host closed the connection)
14:19:14*isaac[m]1 quit (Remote host closed the connection)
14:19:15*TheManiac[m] quit (Write error: Connection reset by peer)
14:19:15*macsek1911[m] quit (Remote host closed the connection)
14:19:15*encryptize[m] quit (Remote host closed the connection)
14:19:17*GitterIntegratio quit (Read error: Connection reset by peer)
14:19:19*nergal[m] quit (Read error: Connection reset by peer)
14:19:21*lqdev[m] quit (Read error: Connection reset by peer)
14:19:22*jaens[m] quit (Remote host closed the connection)
14:19:23*skrylar[m] quit (Read error: Connection reset by peer)
14:19:28*yglukhov[m] quit (Read error: Connection reset by peer)
14:19:28*muxueqz[m] quit (Read error: Connection reset by peer)
14:19:28*ee7[m] quit (Remote host closed the connection)
14:19:29*meff[m] quit (Write error: Connection reset by peer)
14:19:29*leorize[m] quit (Write error: Connection reset by peer)
14:19:30*MrAxilus quit (Read error: Connection reset by peer)
14:19:30*narimiran[m] quit (Read error: Connection reset by peer)
14:19:32*Demos[m] quit (Remote host closed the connection)
14:20:45FromGitter<alehander42> its a compile time function
14:21:15*beatmox quit (Ping timeout: 240 seconds)
14:24:10*beatmox joined #nim
14:41:40*Hideki_ quit (Remote host closed the connection)
14:46:43*Hideki_ joined #nim
14:51:57Araqshashlick: what does that mean anyway
14:52:19*Vladar quit (Remote host closed the connection)
14:52:20Araqeither you use a header or you import from a DLL, you can't do both at the same time
14:52:27federico3https://testmon.org/ this is another good use of code coverage that Nim could support
14:52:36Araqonce fixed the compiler will tell you "make up your mind"
14:52:56disruptekshashlick i don't want you losing sleep over libgit2.
14:52:56shashlick@Araq - well, we run into an issue with a few wrappers
14:53:13Araqobviously
14:53:34shashlickwell, there's a defect opened on nimterop by others as well
14:53:40shashlickhttps://github.com/nimterop/nimterop/issues/134
14:55:26Araqsame thing, it makes no sense
14:55:46AraqI don't care if nimterop users write this or you personally write it, it makes no sense
14:55:53disrupteklol
14:55:59*Hideki_ quit (Remote host closed the connection)
14:56:00Araq*either* you import the symbol from a header or from a DLL
14:56:10shashlickok then help me understand what we are doing wrong if you don't mind
14:56:37AraqI'm trying
14:56:46Araqso what is it you are trying to accomplish?
14:57:05shashlickhere's the error - http://ix.io/1XUj
14:57:12*Hideki_ joined #nim
14:57:16shashlickwhen i try to dynlib with libgit2.so
14:57:24shashlicki'll share what the wrapped git_error looks like, a sec
14:57:45disruptekit's just a struct of char* and int.
14:57:49AraqcImport("include/header2.h", "dynlib2") # ?
14:59:23shashlickhere's git_error => http://ix.io/1XUl
15:01:21*Hideki_ quit (Ping timeout: 246 seconds)
15:04:45disruptekreading libgit C actually makes me reminisce about C coding 30 years ago.
15:11:28Araqshashlick: if you .importc a type you can only really import it from a header and if you use .dynlib you don't import from a header
15:11:52Araqgit_error* {.bycopy.} = object # fine, you made the layout compatible
15:11:59Araq message*: cstring
15:11:59Araq klass*: cint
15:14:53*lqdev joined #nim
15:15:46lqdevso it seems like matrix is dead
15:16:04lqdevriot.im can't connect to the matrix homeserver
15:17:43lqdevah right, there's a major outage
15:17:45lqdevhow nice
15:18:19*absolutejam quit (Ping timeout: 268 seconds)
15:18:25*Trustable joined #nim
15:20:04leorizethat's why you shouldn't use the matrix.org homeserver :P
15:20:54*floppydh quit (Quit: WeeChat 2.6)
15:22:17lqdevleorize: well, TIL
15:22:35lqdevmy friend had a homeserver set up for a short while but it's down right now
15:23:12lqdevworst thing is, the server was hosted on a damn Orange Pi 3, so you probably know what happened after a while
15:23:20shashlick@Araq - ya figured i was messing up the wrapper - so no importc if a type and dynlib
15:24:00*zedeus quit (Quit: WeeChat 2.5)
15:24:16*zedeus joined #nim
15:26:12*zedeus quit (Client Quit)
15:26:24*zedeus joined #nim
15:27:13leorizelqdev: there are a handful of public homeservers on the 'net
15:27:27leorizethe real problem is that the freenode bridge is run by matrix.org exclusively
15:30:21lqdevhow to [not] go decentralized 101™
15:30:42lqdevI'm fine with using HexChat for the time being
15:32:18FromDiscord<juan_carlos> IRC has a draft for v3 I read, I hope they dont fuk up.
15:33:55FromGitter<alehander42> i am also interested in that
15:34:33*Hideki_ joined #nim
15:34:59lqdev@juan_carlos any notable new features?
15:37:09FromDiscord<juan_carlos> https://ircv3.net
15:40:14lqdevseems nice
15:40:23lqdevthe only thing I lack from IRC is message history
15:50:01*Hideki_ quit (Ping timeout: 250 seconds)
15:50:03lqdevpffff so the homeserver's working but now the freenode bridge is dead
15:50:35lqdevstability lvl 100
16:03:55FromDiscord<kodkuce> so bridge again down or what?
16:07:48lqdevthis time it's not the team's fault
16:08:03lqdevthe matrix↔IRC bridge is down
16:08:17lqdevwhich is matrix.org's problem
16:08:48*poopBot joined #nim
16:09:07poopBotb
16:09:27FromDiscord<kodkuce> oh matrix bridge discord one is not
16:09:36*poopBot quit (Client Quit)
16:13:25*sentreen quit (Quit: sentreen)
16:16:17*sentreen joined #nim
16:20:22*Hideki_ joined #nim
16:22:02jkenhttps://nim-lang.org/0.13.0/events.html
16:22:06jkenLooks like that was removed
16:22:16jkenAny existing event systems exist in the 1.0.0 stdlib?
16:24:28*Hideki_ quit (Ping timeout: 245 seconds)
16:25:46*superbia1 joined #nim
16:27:14FromGitter<awr1> hello all
16:27:33FromGitter<awr1> https://mun-lang.org/
16:27:44FromGitter<awr1> thoughts on this?
16:27:53Araqjken: use async
16:28:04FromGitter<awr1> seems very zig-ish
16:29:16Araqawr1: as it says itself "too early"
16:29:30FromGitter<alehander42> iirc they said they experimented with rust and hot code reloading
16:30:09FromGitter<alehander42> and then it evolved into something like a language not sure
16:31:10*lqdev[m] joined #nim
16:33:26FromGitter<awr1> to what degree was Nim "fleshed out" by the time you publicly announced it?
16:33:49FromGitter<awr1> @Araq
16:34:03Araqdunno, IMHO it changed very little throughout the years
16:34:54FromDiscord<demotomohiro> Please review and merge this PR:
16:34:54FromDiscord<demotomohiro> https://github.com/nim-lang/Nim/pull/12329
16:36:19FromGitter<awr1> `doslikeFileSystem` is a const i haven't seen before
16:36:21clyybberAraq: I think https://github.com/nim-lang/Nim/pull/12321 should be merged so that it's in the next release. Better do this earlier then later.
16:42:57FromDiscord<demotomohiro> doslikeFileSystem* = defined(windows) or defined(OS2) or defined(DOS)
16:43:15FromDiscord<demotomohiro> Anyone use Nim on OS2 or DOS?
16:46:18*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:47:33*fanta1 quit (Quit: fanta1)
16:48:38FromGitter<alehander42> Araq, do we need anything more for the isNil spec, except syntax?
16:53:03shashlick@Araq is it possible to disable rst parsing when generating docs? I'm trying to include docs when generating wrappers but C comments can have all sorts of random stuff that can throw off the rst parser
16:53:28disrupteki have the same problem.
16:53:33*lqdev quit (Quit: Leaving)
16:54:13*drewr joined #nim
16:55:07*ronny joined #nim
16:55:07*planetis[m] joined #nim
16:55:07*pigmej joined #nim
16:55:08*k0mpjut0r joined #nim
16:55:08*MrAxilus joined #nim
16:55:08*gh0st[m] joined #nim
16:55:08*GitterIntegratio joined #nim
16:55:08*leorize[m] joined #nim
16:55:08*Demos[m] joined #nim
16:55:09*Connor[m] joined #nim
16:55:09*jaens[m] joined #nim
16:55:09*swisscowbell[m] joined #nim
16:55:09*LEdoian[m] joined #nim
16:55:09*isaac[m] joined #nim
16:55:09*BitPuffin joined #nim
16:55:09*nergal[m] joined #nim
16:55:14*spymasterd[m] joined #nim
16:55:14*macsek1911[m] joined #nim
16:55:15*muxueqz[m] joined #nim
16:55:15*nc-x[m] joined #nim
16:55:15*encryptize[m] joined #nim
16:55:15*TheManiac[m] joined #nim
16:55:15*xomachine[m] joined #nim
16:55:16*ee7[m] joined #nim
16:55:16*meff[m] joined #nim
16:55:16*zielmicha[m]1 joined #nim
16:55:16*skrylar[m] joined #nim
16:55:16*narimiran[m] joined #nim
16:55:16*yglukhov[m] joined #nim
16:55:16*testgovno[m] joined #nim
16:55:17*Miguelngel[m] joined #nim
17:00:24shashlickNimterop already makes it easy to include wrapper docs and generate Nim docs. All I need to do is add a second # and perhaps some comment cleanup
17:01:09disruptekthe only problem i've had is with *foo.
17:03:06FromDiscord<kodkuce> does nim have constructor, like on object creation do something, example i have a constructor that has someint=sometint*5 , so var MyObj(someint:5) , if i read value of someint it would be 25?
17:05:11disrupteknim suggests that you implement that yourself.
17:08:20FromDiscord<demotomohiro> @kodkuce just creating a proc that return MyObj is Nim way.
17:08:23*nsf quit (Quit: WeeChat 2.5)
17:08:49FromDiscord<demotomohiro> like `proc createMyObj(x: int): MyObj) = MyObj(sometint: x*5)
17:09:26FromDiscord<demotomohiro> `proc createMyObj(x: int): MyObj) = MyObj(sometint: x*5)`
17:15:12FromDiscord<kodkuce> so there no constructor to defind in object itself , ok np
17:15:18FromGitter<alehander42> you can imitate it easily
17:15:38FromGitter<alehander42> with proc init(a: type MyType, myargs: mytypes): MyType
17:15:38FromDiscord<kodkuce> what about destructors?
17:15:47FromGitter<alehander42> MyType.init args
17:16:53*shomodj joined #nim
17:22:23FromDiscord<kodkuce> destructors?
17:23:38FromGitter<awr1> @demotomohiro OS/2 still is in use today, iirc primarily at ATMs
17:26:52clyybberkodkuce: Destructors are defined like so: proc `=destroy`(v: var MyType)`
17:28:52FromGitter<awr1> also DOS is well, it's like a quirky resurgent retro thing now.
17:48:11FromDiscord<Kiloneie> Wau did i forget Tuples were not that simple, thought this was gonna be an easy video LOL.
17:49:03clyybberKiloneie: What do you not find simple?
17:49:51FromDiscord<Kiloneie> at first glance i thought, hei they are just like arrays and sequences, except they can have multiple data types... eh... no
17:50:07FromDiscord<Kiloneie> structures actually
17:50:28FromGitter<zetashift> they can have multiple datatypes but often they are used for short(usually length 2) messages to pass around
17:52:36FromDiscord<Kiloneie> i was gonna teach block statement aswell, but now that i remembered what they are, nope, just Tuples for today.
17:55:01*nif quit (Quit: ...)
17:55:12*nif_ joined #nim
17:56:10FromGitter<zetashift> block is a nice addition to for/if/while loops
17:56:27FromDiscord<Kiloneie> Yeh, but not for today's video.
17:58:22clyybberKiloneie: Tuples are more like objects
17:58:40clyybberLike objects they compile down to C structs
17:58:58FromDiscord<Kiloneie> i know
18:04:05*superbia1 left #nim ("WeeChat 2.4")
18:05:32*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:09:18FromDiscord<Kiloneie> Would i be correct if i were to say Tuples are used for making custom data types ?
18:11:33yumaikasThey are one means of doing so, IIRC, designed to be a lightweight way to do so
18:11:46FromGitter<kayabaNerve> ... that'd apply to both objects and tuples
18:12:00FromDiscord<Kiloneie> yeh but objects have inheritance
18:12:04FromGitter<kayabaNerve> The only reason I use tuple is if I have an object I only use in a single place.
18:12:12FromGitter<kayabaNerve> ... not necessarily?
18:12:20FromGitter<kayabaNerve> Only objects of RootObj have inheritance enabled
18:12:40FromGitter<kayabaNerve> For example, if I have a function return multiple things, I use a tuple.
18:12:59FromDiscord<Kiloneie> that is a good use case yes.
18:13:58FromDiscord<kodkuce> Error: 'export' is only allowed at top level , hmm what does this mean its not allawoing me to export a proc ?
18:14:14FromGitter<kayabaNerve> Because it's inside something else
18:14:16FromDiscord<kodkuce> oh my bad indetation after copy paste
18:14:24FromGitter<kayabaNerve> There you go
18:15:00FromDiscord<Kiloneie> var anonTuple: (string, int) = ("Donkey", 22) Why is this called an anonymous tuple ? what does anonymous mean... standalone, can't be used for making other tuples ?... not data type... ?
18:15:04FromDiscord<kodkuce> blindness is magic
18:15:08FromDiscord<kodkuce> 🙂
18:15:29yumaikasKilonie: Because there are no names associated to the fields, I think
18:16:11FromGitter<kayabaNerve> Exactly what yumaikas said
18:16:19FromDiscord<Kiloneie> var someTuple = (10, 0.55, true, "Hello") This is anonymous too then ?=
18:16:21FromDiscord<kodkuce> var nonanonTuple: (word:string, num:int ) ?
18:16:38FromGitter<kayabaNerve> Yes to both of those examples
18:17:04FromDiscord<kodkuce> my is not right?
18:20:24FromGitter<kayabaNerve> ... both are right
18:20:42narimiran`myTup` is anonymous if you cannot later do `myTup.fieldName`.
18:20:51FromGitter<kayabaNerve> An anonymous tuple doesn't have named fields. A named tuple has named fields.
18:21:12FromGitter<kayabaNerve> A tuple is anonymous if it doesn't have field names so there's names to use as accesors
18:22:53FromDiscord<Kiloneie> thank you all
18:28:56*whaletechno joined #nim
18:29:11FromDiscord<kodkuce> am having trouble with exercism Allergies
18:29:11FromDiscord<kodkuce>
18:29:12FromDiscord<kodkuce> test "eggs and peanuts":
18:29:12FromDiscord<kodkuce> let allergies = Allergies(score: 3)
18:29:12FromDiscord<kodkuce> check allergies.lst == @["eggs", "peanuts"]
18:29:12FromDiscord<kodkuce>
18:29:16FromDiscord<kodkuce> so here it creates allergies, and expects me to run a function on it when it creats it so i can fill lst, i tryed changing to be proc Allergies then returns an obj Allergie but i got error Error: type expected , so hmm how to solve this
18:29:16FromDiscord<Yaymaha> Hi! : P
18:29:22FromDiscord<kodkuce> hi
18:31:13FromDiscord<kodkuce> Error: type expected , is on line let allergies = Allergies(score: 3) , so my logic is its telling me that Allergies should be type/Object not proc or am i wrong?
18:32:05FromDiscord<kodkuce> https://hastebin.com/geyibelunu.cs
18:33:11FromDiscord<kodkuce> filling list and other stuff work just this construntor thingy is an issue
18:33:51FromDiscord<kodkuce> or my brain broken
18:35:25narimiranfirst of all, just a style tip: don't use `var a ........ return a`, use `result`
18:35:45FromDiscord<kodkuce> i am stoping proc so i need to use return
18:36:01narimiranyou don't need `var a`, at least
18:36:53narimiranoh and `var a = Allergie()` is wrong :D
18:37:16narimiranthe correct syntax is `var a: Allergie`
18:38:56FromDiscord<Yaymaha> how do I run a .nimble file?
18:38:56FromDiscord<kodkuce> https://hastebin.com/edunuluceg.cs << here i added question in bot
18:38:56FromDiscord<kodkuce> i was hoping var a = Allergie() creates a new one but ok, var a: Allergie in my brain == null
18:39:35narimiranrtfm, as always, when it comes to your questions ;)
18:40:00FromDiscord<kodkuce> googling rtfm
18:40:13FromDiscord<kodkuce> oh manual
18:40:30FromDiscord<kodkuce> i went oop page
18:40:31narimirandocumentation and learning materials in general
18:40:43FromDiscord<kodkuce> https://nim-lang.org/docs/tut2.html#object-oriented-programming
18:41:27narimiranyou don't need OOP
18:41:48narimirannot for this, not for 95% stuff you'll encounter
18:42:26FromDiscord<kodkuce> sorry i come from c# so Allergy sound like an object
18:42:53FromDiscord<kodkuce> i create an object and it has constructor that fills this lst
18:43:29FromDiscord<kodkuce> type
18:43:29FromDiscord<kodkuce> Allergie* = ref object of RootObj
18:43:29FromDiscord<kodkuce> score*: int
18:43:30FromDiscord<kodkuce> lst*:seq[string]
18:43:37FromDiscord<kodkuce> isent this an object?
18:44:21FromDiscord<kodkuce> i can submit half solution and see how other solve it but thats beh
18:44:30FromDiscord<kodkuce> want to learn buy shame 🙂
18:47:23FromDiscord<Yaymaha> does anyone here use nim-csfml?
18:47:24*absolutejam joined #nim
18:50:24*nsf joined #nim
18:50:42FromDiscord<kodkuce> i dont 🙂
18:51:03FromDiscord<Kiloneie> what even is it ?
18:51:31FromDiscord<kodkuce> https://github.com/oprypin/nim-csfml
18:51:35FromDiscord<kodkuce> i guess
18:51:58FromDiscord<kodkuce> ddg is magic
18:51:59FromDiscord<Yaymaha> yes
18:52:23FromDiscord<Yaymaha> I'm thinking to use to make game in nim
18:52:32FromDiscord<Yaymaha> does anyone recommend other tool?
18:52:42FromDiscord<kodkuce> there are SDL2 i think and Godot
18:53:36FromDiscord<treeform> disruptek, I should fix nimtry if I broke its code.
18:53:38FromDiscord<kodkuce> i am still newb with Nim, Godot was wierd for me to start cuz i came from Unity3d, newer used SDL2 or any non editor gameengine
18:54:08disruptektreeform: nah, it's not you. it just breaks with certain inputs.
18:54:24*NimBot joined #nim
18:54:36FromDiscord<treeform> disruptek, about the openSSL memory, I copied a working binary from one server to the new server and it breaks there too. I build openSSL from source and used that, breaks on the HEAD of opneSSL as well. I don't know what todo.
18:55:22FromDiscord<treeform> I really hate openSSL now. Ubuntu lies some how in its versions.
18:55:41disruptekif nothing else on the server breaks, maybe the problem is with the credentials? doesn't make much sense that only this small bit of nim code doesn't work.
18:55:54FromDiscord<Yaymaha> how do I run a .nimble file?
18:56:09disruptekdo you have any version of ubuntu that works?
18:56:52FromDiscord<treeform> disruptek, credentials are the same. Yes I have an ubuntu that works. Maybe I should just make a copy of the VM. I'll do that next. My life is not worth this.
18:57:20disruptekmaybe you have a ca issue.
18:57:22FromDiscord<treeform> @Yaymaha you don't "run" a nimble file it just says what to install. You probably just want to run `nimble install lib`
18:58:14FromDiscord<Yaymaha> oh
18:58:14FromDiscord<Yaymaha> ok
18:58:18FromDiscord<Yaymaha> thanks : P
18:58:36clyybberAraq: PR for default fields is up https://github.com/nim-lang/Nim/pull/12378
18:58:49FromDiscord<Yaymaha> So how I run a .cfg file
18:58:50clyybberyet to handle case objects correctly
18:58:51FromDiscord<Yaymaha> ?
18:58:58FromDiscord<kodkuce> i know that too, just reayly thinked you wanted to read it, wanted to suggest notepad but would sound bad xD
19:00:04FromDiscord<treeform> @Yaymaha you don't "run" a "nim.cfg" file. Nim "finds" it when you compile some thing in that folder or sub folders.
19:00:24FromDiscord<Yaymaha> oh
19:00:26FromDiscord<Yaymaha> ok
19:00:29FromDiscord<Yaymaha> Thanks : P
19:00:39FromDiscord<treeform> are you trying to run some thing
19:00:44FromDiscord<treeform> and trying to figure out which files i the main file?
19:01:32FromDiscord<Yaymaha> Yes, I'm trying to use nim-csfml
19:01:43FromDiscord<Yaymaha> I have a main.nim, where the game code is
19:01:51FromDiscord<Yaymaha> but idk how to run it
19:02:00*Perkol joined #nim
19:02:20FromDiscord<Yaymaha> nim c -r main.nim?
19:02:35FromDiscord<treeform> yes
19:02:44FromDiscord<treeform> `nim c -r main.nim`
19:05:19FromDiscord<Yaymaha> Thanks!
19:05:21FromDiscord<Yaymaha> sorry for annoying questions : P
19:06:34FromDiscord<treeform> no problem, just pass forward the help you get 🙂
19:07:19FromDiscord<treeform> disruptek, I solved it by copying my old ubuntu instead of installing new ubuntu.
19:16:39FromDiscord<kodkuce> do oop setters still work or am i retarded
19:19:04FromDiscord<kodkuce> newermind i think i solved it
19:20:11FromDiscord<kodkuce> or not
19:20:40*krux02 joined #nim
19:23:41*nif_ quit (Quit: ...)
19:23:52*nif joined #nim
19:27:02FromDiscord<treeform> Sounds like you are close
19:28:20*nsf quit (Quit: WeeChat 2.5)
19:30:57*solitudesf- joined #nim
19:31:11*solitudesf- quit (Remote host closed the connection)
19:31:34*solitudesf- joined #nim
19:34:03*solitudesf quit (Ping timeout: 265 seconds)
19:44:26FromDiscord<kodkuce> ye there is only this
19:44:26FromDiscord<kodkuce> test "no allergen score parts":
19:44:26FromDiscord<kodkuce> let allergies = Allergies(score: 509)
19:44:26FromDiscord<kodkuce> check allergies.lst == @["eggs", "shellfish", "strawberries", "tomatoes",
19:44:26FromDiscord<kodkuce> "chocolate", "pollen", "cats"]
19:44:26FromDiscord<kodkuce>
19:44:29FromDiscord<kodkuce> thet removes pinuts for some reson i duno get, its not even mention in readme so will just if dump peanuts
19:46:39*absolutejam1 joined #nim
19:48:27*absolutejam quit (Ping timeout: 240 seconds)
19:55:31*absolutejam2 joined #nim
19:56:35*absolutejam1 quit (Ping timeout: 276 seconds)
19:59:31FromDiscord<Kiloneie> How to type for example "type" and NOT having it autocomplete by VS Code !?
20:01:21FromDiscord<kodkuce> duno i type it no problem just press space after
20:01:38*shomodj joined #nim
20:01:48FromDiscord<Kiloneie> it doesn't give me type as suggestion,and i already typed it so... it's annoying
20:01:51FromDiscord<Kiloneie> at times..
20:02:13*skoude joined #nim
20:02:39FromDiscord<kodkuce> w8 what , you want it to show in autocomplete or not?
20:03:29lqdev[m]he doesn't want it showing in autocomplete
20:03:32lqdev[m]the solution is simple
20:03:38lqdev[m]press return fast enough
20:03:39lqdev[m]¯\_(ツ)_/¯
20:11:28FromDiscord<kodkuce> or do "editor.quickSuggestionsDelay": 1000
20:12:14FromDiscord<kodkuce> i personaly do "editor.tabSize": 2,
20:15:37*aEverr quit (Ping timeout: 265 seconds)
20:16:07*aEverr joined #nim
20:16:52*Perkol quit (Quit: Leaving)
20:30:12*Trustable quit (Remote host closed the connection)
20:44:32*skoude quit (Ping timeout: 268 seconds)
20:50:06*narimiran quit (Ping timeout: 268 seconds)
20:53:38*lritter joined #nim
21:08:51FromDiscord<Kiloneie> i just wish SPACEBAR freaking stopped the auto complete or something
21:09:04FromDiscord<Kiloneie> i just used arrow keys in my video to go back and forth xD
21:18:33FromDiscord<Kiloneie> Another video: https://youtu.be/PLh5x5BuX2Y
21:33:24*asymptotically quit (Quit: Leaving)
21:39:09lqdev[m]@Kiloneie you can disable autocomplete on spacebar in the settings
22:06:52*clyybber quit (Quit: WeeChat 2.6)
22:21:28*onionhammer quit (Ping timeout: 246 seconds)
22:21:58*solitudesf- quit (Ping timeout: 268 seconds)
22:25:26*kungtotte quit (Ping timeout: 276 seconds)
22:39:16FromGitter<Varriount> Anyone know what is up with pull request tests? They seem to be failing randomly.
22:39:55*absolutejam3 joined #nim
22:40:43*absolutejam2 quit (Ping timeout: 245 seconds)
22:43:18*absolutejam4 joined #nim
22:44:50*absolutejam3 quit (Ping timeout: 240 seconds)
22:48:26*MaineTim joined #nim
22:48:29*oculux quit (Ping timeout: 268 seconds)
22:49:33*oculux joined #nim
22:52:05*absolutejam4 quit (Ping timeout: 276 seconds)
23:04:11*MaineTim quit (Ping timeout: 260 seconds)
23:15:56*onionhammer joined #nim
23:22:30*kungtotte joined #nim
23:25:37*krux02 quit (Remote host closed the connection)
23:27:59*oculuxe joined #nim
23:28:28*oculux quit (Ping timeout: 265 seconds)
23:45:59*theelous3_ joined #nim
23:49:39*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:50:01*shomodj joined #nim
23:50:25*shomodj quit (Client Quit)
23:50:53*shomodj joined #nim
23:51:13*shomodj quit (Client Quit)
23:51:41*shomodj joined #nim
23:52:00*shomodj quit (Client Quit)
23:52:20*shomodj joined #nim
23:52:47*shomodj quit (Client Quit)