<<15-08-2019>>

00:00:54*clyybber quit (Quit: WeeChat 2.5)
00:04:04*rockcavera quit (Remote host closed the connection)
00:23:18*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
01:16:52mfianoleorize: are you the author of nim.nvim?
01:34:08*vivus quit (Remote host closed the connection)
01:35:25FromGitter<gogolxdong> Anyone have expericence on video content analysis and research?
01:38:10*laaron quit (Remote host closed the connection)
01:38:40*nif quit (Quit: ...)
01:38:55*nif joined #nim
01:39:12*theelous3_ quit (Read error: Connection reset by peer)
01:39:12*theelous3 quit (Read error: Connection reset by peer)
01:40:42*laaron joined #nim
01:45:04*rockcavera joined #nim
01:56:13*ng0_ joined #nim
01:58:12*ng0 quit (Ping timeout: 260 seconds)
02:35:53*arecaceae quit (Remote host closed the connection)
02:36:18*arecaceae joined #nim
02:52:34*lritter quit (Ping timeout: 272 seconds)
02:53:00*lritter joined #nim
02:57:20*rockcavera quit (Remote host closed the connection)
03:10:09*rockcavera joined #nim
03:19:45*dddddd quit (Remote host closed the connection)
03:38:04*leorize quit (Ping timeout: 260 seconds)
03:59:13*rockcavera quit (Remote host closed the connection)
04:13:13*nsf joined #nim
04:13:38*leorize joined #nim
04:46:19*terps joined #nim
04:47:02*nif quit (Quit: ...)
04:47:11*nif joined #nim
04:54:25*terps quit (Ping timeout: 250 seconds)
04:56:30*terps joined #nim
04:58:31*terps quit (Read error: Connection reset by peer)
05:03:14*laaron quit (Remote host closed the connection)
05:03:41*terps joined #nim
05:05:02*nif quit (Quit: ...)
05:05:11*nif joined #nim
05:12:21*endragor joined #nim
05:14:41*laaron joined #nim
05:26:01*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
05:26:24*laaron joined #nim
05:50:36*solitudesf joined #nim
06:04:11*terps quit (Ping timeout: 250 seconds)
06:05:07*laaron quit (Remote host closed the connection)
06:06:56*couven92 joined #nim
06:07:49*laaron joined #nim
06:09:19*sagax joined #nim
06:45:15*ng0_ is now known as ng0
06:45:27*PMunch joined #nim
06:48:07*terps joined #nim
06:55:53*krux02 joined #nim
07:00:00*gmpreussner quit (Quit: kthxbye)
07:00:17*couven92 quit (Quit: Client disconnecting)
07:00:37*couven92 joined #nim
07:04:52*gmpreussner joined #nim
07:18:46FromGitter<ahcm> @gogolxdong yes, why? nim related?
07:30:47FromGitter<gogolxdong> Yes,we are going to build such thing in Nim as a killer application like Google Cloud https://cloud.google.com/video-intelligence/. And we need who has such experience
07:31:42*oalvarez joined #nim
07:37:38FromGitter<bevo009> Why do I get this warning using round()? ⏎ Warning: use strformat module instead; round is deprecated [Deprecated]
07:38:31FromGitter<bevo009> I tried 'import stformat' and got: ⏎ Warning: imported and not used: 'strformat' [UnusedImport]
07:41:30FromGitter<bevo009> it's using code from miran's book
07:44:25*rayman22201 quit (Quit: Connection closed for inactivity)
07:55:00FromGitter<gogolxdong> We are preparing presentation for Huawei and Tencent in Shenzhen, China ,after nim release 1.0. Any ideas are welcomed.
08:02:26PMunchA presentation for Huawei and Tencent?
08:02:39PMunchWhat kind of presentation?
08:03:55FromGitter<gogolxdong> What's Nim and what Nim can do.
08:05:56PMunchCool, have they requested it, or have you asked to pitch it to them?
08:06:40FromGitter<gogolxdong> This can be arranged. :)
08:07:02PMunchHuh?
08:08:19FromGitter<gogolxdong> we pitch it to them.
08:08:46PMunchAh okay
08:12:18FromGitter<gogolxdong> We pick SPA, GUI, Emebbed system and system development demonstrations, have got our own production as SPA demo.
08:13:16PMunchSounds like reasonable choices for Huawey/Tencent
08:13:21PMunchHuawei*
08:14:10FromGitter<gogolxdong> yeah , I know them.
08:56:43*ehmry joined #nim
09:04:26*clyybber joined #nim
09:09:47FromGitter<zacharycarter> Lol I didn't realize I was name dropped in that Reddit thread yesterday 😛
09:11:30*shomodj joined #nim
09:12:52PMunchWhich one?
09:14:46FromGitter<zacharycarter> I'll send the link when I get back to my desk. It was about HCR
09:19:48FromGitter<mratsim> you said, “I will be the guinea pig” :p
09:25:48FromGitter<bevo009> what is replacing math.round?
09:27:04*terps quit (Ping timeout: 264 seconds)
09:28:57*terps joined #nim
09:31:06FromGitter<zacharycarter> @mratsim true...
09:31:32FromGitter<zacharycarter> I need to spend more time on figuring out what is causing the errors I'm seeing with hcr
09:44:13PMunchbevo009, nothing?
09:44:30PMunchhttps://github.com/nim-lang/Nim/blob/master/lib/pure/math.nim#L736 <- maybe this should be added to the math module itself?
09:45:08PMunchOh, you're talking about the round version with places
09:45:17PMunchThis thing: https://nim-lang.org/docs/math.html#round,T,int
09:49:55FromGitter<bevo009> I think Miran's book needs an update with this
09:49:56FromGitter<bevo009> ```import strformat ⏎ echo &"{sin(cRadians):.2f}"`````` [https://gitter.im/nim-lang/Nim?at=5d552ac41dadc42a11746726]
09:50:19FromGitter<bevo009> to replace echo sin(cRadians).round(2)
09:51:05FromGitter<bevo009> That's what the cryptic deprecated msg means right?
09:51:52PMunchYes
09:51:56PMunchThat's what it means
09:52:22FromGitter<bevo009> All good. I like when I can figure it out myself :)
09:52:37PMunchBasically the round operation from math can't reliably work because of how floats work, so it was deprecated in favour of the string formatting versions.
09:53:43FromGitter<bevo009> yeah I was just reading the fix commits
09:54:27FromGitter<bevo009> Took me a while to find the discussion
09:55:08FromGitter<cupen> Is there a actor framework for nim? like akka for scala/java. I know it a big project, just an alpha version would be nice. ;)
09:57:57FromGitter<bevo009> @PMunch have you taken over developing the Nim Playground?
09:58:11PMunchbevo009, yes I'm the current maintainer :)
09:58:20FromGitter<bevo009> Do you plan to implement a run keyboard shortcut, or support args/user input?
09:58:52PMunchYeah I was thinking about a run keyboard shortcut, along with some other practical ones
09:58:56FromGitter<bevo009> I notice you fixed up the save gists feature, nice
09:59:02Araqif your productivity is too high and you don't spend enough time in debugging, you should switch over to use an "actor framework".
09:59:07FromGitter<zacharycarter> PMunch: https://www.reddit.com/r/ProgrammingLanguages/comments/cq4b1x/compiled_language_that_can_interpret_itself/ewwouhp/
09:59:39PMunchbevo009: Yes, not only that, but you can also link directly to the playground with your ix.io paste :)
10:00:19PMunchcupen, there is nimoy: https://github.com/evacchi/nimoy
10:00:38FromGitter<bevo009> yeah I'll have to study how ix.io works
10:00:55PMunchIt's pretty neat
10:00:55FromGitter<bevo009> pasting to the playground and save gist seems easier
10:01:04Araqok, PMunch had the better answer :P
10:01:12PMunchAraq, haha :P
10:01:15FromGitter<cupen> @PMunch it seems do not support cluster.
10:01:24AraqI still hate actors.
10:01:28FromGitter<cupen> and here is too. https://nim-lang.org/0.13.0/actors.html
10:01:30PMunchYeah I've never used it, just did a quick Google search..
10:01:47FromGitter<cupen> why? actors is nice for game backend.
10:02:00PMunchbevo009, how so?
10:02:31Araqmaybe, I never wrote a game backend.
10:03:29Araqin general if you say "message passing" I say "great, undebuggable code where everything happens somewhere else" also known as the "Smalltalk experience".
10:03:32FromGitter<bevo009> @PMunch sorry I means 'share to ix' button
10:04:02PMunchix.io is great, you can curl directly to it, so it's really easy to set up scripts that will send things to ix. And all of the options are controlled through the URL, so to get line numbers just add a / to the URL, to get syntax highlighting add /nim
10:04:23clyybberAraq: I guess thats why actor models are mostly used in applications where errors are guaranteed to pop up.
10:04:56PMunchYeah share to ix basically just sends it to ix, and since the playground supports loading from ix it gives you the direct link to do so
10:05:21FromGitter<bevo009> @PMunch I'd probably need a simple tutorial to use it correctly
10:05:39PMunchThe button?
10:05:49FromGitter<bevo009> ix.io the site
10:05:56PMunchOh :P
10:06:15FromGitter<bevo009> yeah the button is brain dead simple
10:06:26PMunchI've got this as a keyboard shortcut: xclip -o -selection -primary | curl -F 'f:1=<-' ix.io | head -c-1 | echo "$(< /dev/stdin)/" | xclip -i -selection clipboard
10:06:50PMunchIt grabs my current selection, sends it to ix, and puts the URL in my clipboard
10:07:11PMunchSo basically a regular copy-paste but I get a link instead
10:07:21FromGitter<bevo009> cheers, stealing that
10:07:26Araqproc send(msg): void
10:07:36Araqthere, I spelt out the problem with "actors"
10:07:59Araqits return type is 'void'. can't compose it.
10:08:46Araqit's the ultimate side-effect-heavy paradigm.
10:09:23FromGitter<cupen> Haha, I agree with you about this, it's hard to write code correctly in a distributed environment.
10:09:41Araqso you pass a "return address" in the message so the actor knows whom to reply to
10:10:10Araqsee also Golang's 'go' keyword.
10:10:34Araqgimme FlowVars already please, thanks.
10:27:21*laaron quit (Remote host closed the connection)
10:30:36FromGitter<cupen> ;p
10:31:29*laaron joined #nim
10:32:45federico3PMunch: what's that echo?
10:33:38FromGitter<alehander42> is nim-prompt
10:33:47*actuallybatman quit (Ping timeout: 245 seconds)
10:33:47FromGitter<alehander42> the best nim lib for repl-s
10:34:00dom96!eval echo"hello"
10:34:03NimBothello<br/>
10:34:26dom96PMunch whyyy
10:35:59clyybberAraq: We should always =sink into result, right?
10:36:12clyybberWhen its possible
10:37:43PMunchfederico3, not entirely sure, I think it was a way to replace the newline with a / or something like that
10:37:48*dddddd joined #nim
10:37:56PMunchdom96, ah..
10:38:17krux02!eval 17+4
10:38:19NimBotCompile failed: <span style="color: #66d9ef;">Hint: </span>used config file '/nim/config/nim.cfg'<span style="color: #50fa7b;"> [Conf]</span><br/><span style="color: #66d9ef;">Hint: </span>system<span style="color: #50fa7b;"> [Processing]</span><br/><span style="color: #66d9ef;">Hint: </span>widestrs<span style="color: #50fa7b;"> [Processing]</span><br/><span style="color: #66d9ef;">Hint: </span>io<span style="color: #50fa7b;"> [Processing]</span><br/><span style...
10:38:20FromGitter<alehander42> @dom96 i made a nimbox-based dsl
10:38:26dom96!eval it's worse like this
10:38:28NimBotCompile failed: <span style="color: #66d9ef;">Hint: </span>used config file '/nim/config/nim.cfg'<span style="color: #50fa7b;"> [Conf]</span><br/><span style="color: #66d9ef;">Hint: </span>system<span style="color: #50fa7b;"> [Processing]</span><br/><span style="color: #66d9ef;">Hint: </span>widestrs<span style="color: #50fa7b;"> [Processing]</span><br/><span style="color: #66d9ef;">Hint: </span>io<span style="color: #50fa7b;"> [Processing]</span><br/><span style...
10:38:36FromGitter<alehander42> do you think it make sense to include it in nimbox
10:38:42FromGitter<alehander42> or should it be another lib
10:38:47dom96alehander42: separate package IMO
10:38:48PMunchI moved the HTML conversion to the server, the idea was to have an argument in the JSON that would choose which output you wanted
10:39:10dom96PMunch okay, so please make the default as it was
10:39:18PMunchWill do
10:39:54krux02pmunch why didn't you just put an anse escape stream filter at the end?
10:40:24PMunchWhat do you mean?
10:40:51krux02well, I would have done all the ansi escape filtering as a post process.
10:41:11PMunchOn the front-end?
10:41:39krux02you wrote it for the nim playground didn't you?
10:41:49PMunchYes
10:42:26krux02how do you do the htmlification for the browser?
10:42:33PMunchI don't quite remember why I moved it to the back-end, but I think I had some reasoning for it..
10:42:46PMunchCurrently it's all done on the back end
10:42:57krux02it is ok to have it in the backend.
10:43:21PMunchThe HTML is just added directly into the site
10:43:21krux02with backend you mean "on the server"
10:43:25PMunchYes
10:43:36krux02that is a good solution.
10:43:59PMunchhttps://github.com/PMunch/nim-playground/blob/master/src/nim_playground.nim#L52-L54
10:45:22krux02ok, but that means the nimbot uses the nim playground codebase doesn't it?
10:45:46PMunchNo, it just does a call to play.nim-lang.org/compile
10:46:07krux02arg
10:46:43krux02why does everything need to be a microservice hell
10:46:53krux02that also explains why nimbot is so slow
10:47:24PMunchIt is slow because the VPS that the playground runs on is slow :P
10:47:58PMunchAnd the docker encapsulation of the execution adds a fairly big delay
10:48:51PMunchI have considered setting up a pool of running containers and just delegate tasks to them, that would save a lot of execution time
10:49:31dom96err
10:49:44dom96really? You want NimBot to run it's own playground?
10:50:20krux02I don't even know what the point of !eval is
10:50:29dom96Having two risky services that need a lot of maintenance is a bad idea
10:50:49krux02If you ask me, we don't need !eval at all.
10:51:02dom96and no, network requests to a microservice are negligible
10:51:14krux02dom96, no they are not.
10:51:25dom96they are
10:51:26krux02network requests are never neglible
10:51:48dom96both are running on a VPS, the latency is likely less than 50ms
10:52:02krux02wich is 50ms too much
10:52:04dom96the bulk of the time is compilation
10:52:23krux02compilation is also too slow, that is tre
10:52:25krux02true
10:52:27dom96This isn't a freaking real-time system
10:53:05PMunchYeah it doesn't really matter if !eval takes a while :P
10:53:11krux02I don't care if it is realtime system or not. I just think that adding network latency to anything for no real good is a bad idea.
10:53:17dom96no
10:53:21dom96there is a real good
10:53:28PMunchI mean if it took a couple of minutes it would be annoying, then discussion would have moved on
10:53:30dom96maintenance costs far more
10:53:44krux02the only reason why the latency in !eval doesn't really matter is because !eval doesn't really matter.
10:54:31FromGitter<alehander42> krux02 how would !eval work otherwise
10:54:39FromGitter<alehander42> you cant run nim code on the irc client
10:54:56krux02alehander42: do you need to?
10:54:59dom96honestly, this is just a waste of time arguing over
10:55:04FromGitter<alehander42> this can only work with some kind of web service
10:55:15dom96 !eval is a common feature in language IRC channels
10:55:26dom96stop crying about features that you don't even care about
10:55:29dom96let others use them at least
10:55:46FromGitter<alehander42> i have to agree, if people maintain and use it, it is needed
10:56:20krux02alehander42: well, an alternative is how the emacs chat does it. In emacs you can run an IRC client, and code snippents that are in emacs can be evaluated wih a key combanation. There you have 0 latencey for the answer.
10:56:26dom96people obviously use it, otherwise I wouldn't have noticed that it's broken
10:56:35PMunchHmm, dom96 should I add IRC colour output?
10:56:53FromGitter<alehander42> krux02: well people here use 10 different things, e.g. i run gitter in a browser, people use discord or weechat
10:57:03FromGitter<alehander42> this is a very obscure solution
10:57:23dom96PMunch I would prefer to do that myself, you should add a JSON output that has things like {"messages": ["color": "red", text: "Error: ... "]}
10:57:26krux02dom96: I noticed that it was broken yesterday, because I wanted to know if I can easily break it.
10:57:37FromGitter<alehander42> i'd say it would be better to have a multilang service well engineered for that
10:57:45PMunchdom96, yeah I'm already working on that
10:57:56dom96PMunch thanks :)
10:57:57FromGitter<alehander42> but otherwise it sems fine to me
10:57:57PMunchBut I was just planning on taking the output from ansiparse
10:58:10PMunchSo it would be the ANSI codes and not colour names
10:58:58dom96PMunch sure, that will work too
10:58:59krux02PMunch, Just a random question are you British?
11:00:51FromGitter<alehander42> PMunch is the third son of Charles
11:02:57PMunchHaha, no I'm Norwegian
11:03:11PMunchIs it my use of colour over color that made you wonder?
11:07:12FromGitter<cupen> @PMunch ";p" was a emoji, like 😄
11:08:40PMunch?
11:11:59FromGitter<cupen> sorry, just replay this. *<federico3>* PMunch: what's that echo?
11:16:28krux02PMunch, yes it was colour over color.
11:17:10krux02I know that British English is the original English, but American English took over to be the standard English
11:18:16krux02you also have "Colour" in the codebase of nim playground
11:18:36PMunchIn school we are taught British english, pronounciation and all. But I'm a bit back and forth
11:18:42PMunchAlways preferred colour though
11:19:36PMunchI still use my British accent from time to time, but for the most part I use my non-descript American accent
11:30:31*stefanos82 joined #nim
11:36:49ZevvIs there some "trust-my-I-know-what-I'm-doing" way to get around "cannot be captured as it would violate memory safety"? I have a nested function X that is called recursively, which is defined inside function Y. Y gets passed a var T which I like to modify from function X, but now I need to pass this closure around in all calls to X. Techincally not a problem, but it is somewhat noisy.
11:38:13krux02PMunch, I think you use your Norwegian accent for most of the time though.
11:38:22clyybberZevv: I guess replace var with ptr?
11:38:38Zevvoh right. that's dirty but that would work
11:38:59krux02Zevv, ptr is always the "trust me I know what I am doing" thing
11:39:42Zevv:)
11:40:05ZevvI guess the error is a bit too trigger happy, since this is a valid use case imho
11:40:15Zevvthere is no escaping, but maybe it is not trivialy provable for the compiler
11:41:01Zevvoh I just did a little template that silently pass the var around, that is nice. It's almost like a monad, silently passing stuff around without telling anyone
11:46:38krux02Zevv I prefer a very strict compiler that you have to turn off from time to time over a compiler that magically pretends on everything to know what you mean.
11:56:57PMunchWell yes :P Although I write more English than Norwegian I still speak more Norwegian than English on most days
11:57:52PMunchBut we have some English speaking people at work so it's not that uncommon that I speak more English than Norwegian some days :P
12:04:48*nsf quit (Quit: WeeChat 2.4)
12:08:10*rockcavera joined #nim
12:08:45leorizemfiano: yes, I'm nim.nvim's author
12:11:26Zevvkrux02: fair enough
12:12:26dom96Zevv: is this a new error?
12:12:47mfianoleorize: cool. I am just starting to learn nim, but i live in vim so was hoping this would work out despite being experimental still.
12:14:48PMunch!eval echo "Colours are gone now dom96"
12:14:50NimBotColours are gone now dom96
12:14:57dom96thx
12:15:00FromGitter<bevo009> @dom96 anyone seeing old forum threads popping up unanswered? ⏎ eg this thread says activity 23 hours ago ⏎ https://forum.nim-lang.org/t/1887 ⏎ But you click on it and it's "1 YEAR SINCE LAST REPLY" [https://gitter.im/nim-lang/Nim?at=5d554cc4029a51607f9aa09f]
12:15:11dom96bevo009: yes, it's a known bug
12:15:19PMunchSo you can add "outputFormat" to the JSON object to request different formats
12:15:22FromGitter<bevo009> ok cheers
12:15:27dom96(you can't see the post because it's moderated, or a spammer made it)
12:15:59FromGitter<bevo009> I wasn't sure if it was new or not
12:16:54PMunchHTML for the HTML output, Raw for only text (the old way, default), ANSI to get the output with the actual ANSI escape codes like they appears from the compiler, and AnsiParsed which gives an array of objects splitting the string into ANSI CSI and String blocks.
12:22:52*terps quit (Ping timeout: 264 seconds)
12:22:53*Kaivo joined #nim
12:23:30PMunchOkay, as soon as the cache catches up the online playground should get colours back as well :)
12:24:48*abm joined #nim
12:26:24*laaron quit (Remote host closed the connection)
12:28:15*laaron joined #nim
12:30:28FromDiscord_<kodkuce> can anyone explain to me how to write code to drop a websocket connection if it zoombies out( AKA just connects and sends no msg) http://niv.github.io/websocket.nim/docs/0.1.1/websocket/server.html ? i tryed first making an async proc and then doing asyncSleep(sometime) then check if connection authed , tought i head issue here passing varaible as ref and head issue killing ws from that proc crashed my server for some reason
12:34:20Zevvdom96: not sure how old or new it is
12:35:58dom96kodkuce: You should track each client's last pong, periodically send pings to each client and disconnect clients that haven't sent a message in the last 20 seconds or whatever amount you want
12:36:06*terps joined #nim
12:37:13FromDiscord_<kodkuce> hmm will try
12:37:43dom96you could also require each client to send a hello message, if they don't send one within a certain amount of time, disconnect them
12:38:26dom96In any case, this is something you need to solve by creating a protocol for your communications
12:38:30*laaron quit (Remote host closed the connection)
12:41:38FromDiscord_<kodkuce> my main issue is atm how to brunch out from webscoket, atm all code is run under while true: and from what i see it heppends evry time i recive a ws msg
12:43:08*laaron joined #nim
12:58:28*terps quit (Ping timeout: 252 seconds)
12:58:34*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
12:58:56*laaron joined #nim
13:00:38*terps joined #nim
13:04:04*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
13:04:26*laaron joined #nim
13:05:42FromDiscord_<Kiloneie> You should read about game networking, theres a ton of that out there. It seems you have taken up a project you are not ready for(or don't understand what it takes)
13:14:20Zevvwhy is naming things so hard :(
13:20:24*rockcavera quit (Remote host closed the connection)
13:20:26leorizemfiano: it's already working pretty well, according to my issues track record :) You'd need neovim though, this plugin won't run properly on vim
13:20:52mfianoof course. i do use that
13:21:27mfianoOne thing that bothers me is the need for yet another completion framework. I think I have 4 now due to various languages supporting just 1
13:22:07mfianoBut, it seems to be working
13:22:09leorizewhat frameworks are you using?
13:22:34mfianoI use ncm2 with LSP for most other languages
13:22:48leorizeoh, it should work with ncm2 I think
13:22:54leorizeI'll read up on that in a bit
13:23:11mfianoIt did not, by default anyway
13:23:26mfianoI'm not certain how to configure those completion systems yet though.
13:23:58*rockcavera joined #nim
13:24:49*terps quit (Quit: WeeChat 2.5)
13:47:22dom96kodkuce: you should have a look at how my snake game is implemented, it's old(ish) code now but should still be helpful, I'm happy to answer any questions you have as well.
13:47:29*Ven`` joined #nim
13:47:32dom96https://github.com/dom96/snake
13:47:41dom96Kiloneie: everyone's gotta start somewhere :)
13:49:15*xet7 quit (Remote host closed the connection)
13:49:25*laaron quit (Remote host closed the connection)
13:50:17*ng0 quit (Quit: Alexa, when is the end of world?)
13:51:42*laaron joined #nim
14:00:47FromGitter<iffy> In Python, there's the pattern of classes with methods named `something_X` and `something_Y`. Then your code can access available methods at runtime by looking through `dir(self)` and looking for the `something_` prefix. For instance, the cmd module https://docs.python.org/3/library/cmd.html lets you add commands to your repl by writing `do_X` methods.
14:01:25FromGitter<iffy> What's an equivalent way of adding a bunch of procs to a Table so that I can look up the procs by string name?
14:01:33*PMunch quit (Remote host closed the connection)
14:01:54FromGitter<alehander42> it would be possible for a prompt library
14:02:00FromGitter<alehander42> to do a similar thing in nim
14:02:26FromGitter<iffy> I'm actually making an RPC thing, the `cmd` module was just an example.
14:02:30FromGitter<alehander42> one would e.g. define his doX functions for the Repl type or under a template
14:02:41FromGitter<alehander42> and it would autogenerate stuff based on it
14:02:43FromGitter<iffy> I want to somehow annotate some procs for inclusion in the interface
14:02:47FromGitter<alehander42> i did a lot of similar things
14:02:51FromGitter<alehander42> for my IPC
14:03:20FromGitter<iffy> Do you have an example of what that looks like?
14:03:59FromGitter<alehander42> e.g. ⏎ exportAPI: ⏎ reload is proc(lang: Lang, data: PoolData): Future[void] ⏎ prestart is proc(wait: bool, reload: bool, events: seq[EventElement], main: SourceTextLine): Future[void] ⏎ ... [https://gitter.im/nim-lang/Nim?at=5d55664fba937704ca828bb6]
14:04:13*lritter quit (Ping timeout: 245 seconds)
14:04:49FromGitter<alehander42> is called
14:04:55FromGitter<iffy> do you have the reload and prestart bodies defined there? Or somewhere else?
14:04:57FromGitter<alehander42> oh God, wait, this doesnt look clear
14:05:11FromGitter<alehander42> no, they are separate functions defined up
14:05:14FromGitter<alehander42> but they can be inside
14:05:16FromGitter<alehander42> as well
14:05:35FromGitter<iffy> (it's clear enough)
14:05:55FromGitter<alehander42> you can have something like ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d5566c3204d3d7385de427c]
14:06:30FromGitter<iffy> and rpc is a template or a macro?
14:06:34FromGitter<alehander42> a macro
14:06:50FromGitter<iffy> so I've got to dust off my macro skills :)
14:06:56FromGitter<alehander42> which can e.g. process each function and prepare code that does .. what it needs
14:07:00*lkw quit (Quit: ZNC 1.7.3 - https://znc.in)
14:07:01FromGitter<alehander42> btw take a look at https://github.com/status-im/nim-json-rpc
14:07:02FromGitter<alehander42> as well
14:07:07FromGitter<alehander42> maybe it can work for you?
14:08:52FromGitter<iffy> it looks like it might be perfect; thank you!
14:09:07FromGitter<alehander42> with macros i usually just iterate and do ssomething like ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d556783f3c2c17e1fb4ea03]
14:09:15FromGitter<alehander42> oh great
14:09:19FromGitter<alehander42> :)
14:11:57*lkw joined #nim
14:16:35*lkw quit (Client Quit)
14:17:50*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:22:32FromGitter<iffy> Hmm... that first example in the readme doesn't work for me: `Error: undeclared identifier: 'result'`
14:25:33*endragor quit (Remote host closed the connection)
14:27:07*lkw joined #nim
14:29:22*xet7 joined #nim
14:32:34FromGitter<mratsim> that’s strange, thanks for the bug report
14:48:44*nsf joined #nim
14:50:17*laaron quit (Remote host closed the connection)
14:53:10*laaron joined #nim
15:09:22*sagax quit (Remote host closed the connection)
15:10:12*endragor joined #nim
15:12:20*endragor quit (Read error: Connection reset by peer)
15:12:31*endragor joined #nim
15:14:12FromDiscord_<Kiloneie> You know naming things is fcking me too xD... look at this shit: https://play.nim-lang.org/#ix=1RMX
15:21:39*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:25:33FromDiscord_<Kiloneie> Omg finally finished Roman numerals exercise after 3 freaking(not full) days D:
15:29:25FromDiscord_<Kiloneie> Mine is once again a mile long: https://exercism.io/tracks/nim/exercises/roman-numerals/solutions/4d5888b530634189b8f69c90e7bf5af1
15:29:25FromDiscord_<Kiloneie>
15:29:25FromDiscord_<Kiloneie> and this is the shortest? solution ? https://exercism.io/tracks/nim/exercises/roman-numerals/solutions/c30861d5613f4976af148d3a0f0ffea0
15:29:25FromDiscord_<Kiloneie>
15:29:25FromDiscord_<Kiloneie> I can't even understand it...
15:33:52*nsf quit (Quit: WeeChat 2.4)
15:35:25*laaron quit (Remote host closed the connection)
15:36:11*zedeuss is now known as zedeus
15:36:56FromGitter<mratsim> it’s just doing division until there is no rest
15:37:07FromGitter<mratsim> remainder*
15:37:47FromDiscord_<Kiloneie> I tried that, and failed miserably D:. i got the result right but the letters were mostly never matching how it actually should be
15:37:52*laaron joined #nim
15:38:19FromGitter<mratsim> probably because you need special handling on 4
15:38:31FromGitter<mratsim> and 9
15:38:49FromDiscord_<Kiloneie> yeah, i couldn't wrap my head on that one until today with gluing strings together
15:39:50FromGitter<mratsim> Gooseus just handle 4 and 9 like another 5 instead of introducing specific ordering logic
15:40:53FromDiscord_<Kiloneie> Comes with experience i lack ^,^
15:44:42clyybberkrux02: Can you help me understand something?
15:45:10clyybberAFAICT discardCheck converts calls to something with {.discardable.} to `discard call()`
15:46:07clyybberOr it should?
15:46:15clyybberBut it doesn't?
15:47:23*Ven`` joined #nim
15:49:03krux02clyybber, I am here
15:49:55clyybberHi, this branch: https://github.com/nim-lang/Nim/blob/devel/compiler/semstmts.nim#L141
15:50:19krux02discardable is something that doesn't work very well, Araq knows more about it than me, but as far as I know it is something that should only be used in rare cases because it doesn't work well with everything in Nim
15:50:52clyybberkrux02: Yeah, I have to deal with it in injectdestructors and I thought about making it a transform in sem
15:51:15clyybberSo that it just inserts a discardStmt where needed
15:51:29clyybberand it seems the logic is already there, but it is dead code rn
15:51:39krux02what do you mean, with "where needed"
15:51:59clyybberlet f be a proc with {.discardable.}
15:52:15krux02the discard stmt is needed for the semchecker. It is an artificial requirement. Theoretically it could be removed and everything would still compile.
15:52:59clyybberso a call to f like `f()` gets transformed to `discard f()`
15:53:21clyybberIf `f()` is in a stmt list and not used as an expression
15:54:22clyybberkrux02: But the thing is the branch tries to insert the discardStmt and then throws it away.
15:54:45clyybberAs in `n` doesn't get returned
15:54:48krux02yea, this is something the compiler doesn't do cleanly
15:55:16clyybberIf I fix this to insert discardStmts they will appear in macros right?
15:55:26clyybbers/in macros/to macros
15:56:17krux02I don't think it is a problem to have an autoinjected discard statement in macros.
15:56:33krux02but maybe the thing should then be renamed to autodiscard, because that is what it does.
15:56:50krux02I think my RFC here is related: https://github.com/nim-lang/RFCs/issues/149
15:57:06krux02bascally it proposes a new algorithm to do type inference.
15:57:35krux02Then it would introduce the discard statement when (void) is expected
15:57:48clyybberI see.
15:58:02krux02the RFC doesn't mention the discard statement though
15:58:10krux02but I think it would be affected and should be mentioned
15:58:30*laaron quit (Remote host closed the connection)
15:58:41clyybberkrux02: Ok, so you are ok with the autoinject discard for discardable?
15:58:59krux02yes I am.
15:59:11clyybberNice, thank you
15:59:25*rayman22201 joined #nim
15:59:46krux02But if you do that, I would like you to also add a documentation comment to ``discardable``, so that people know that the compiler will try to autoinject the discard statement.
16:00:32krux02one last question, when exactly would the discard statement be injected?
16:01:31krux02I think the discard statment somewhere in a deep ast is fine
16:02:03krux02but in short expressions, such as ``mymacro(somediscardableproccall(123,"abc"))`` there should not be a discard statement, as the macro programmer probably wants to use the value.
16:03:07clyybberkrux02: Everywhere where somediscardableproccall is used as a statement.
16:03:27krux02yea that is fine with me.
16:03:38krux02because that is what it eventually is.
16:03:43clyybberYeah
16:04:27krux02I think this discard statement is some of the distinguishing features of Nim that really turned out to be great.
16:04:55krux02so so great for wrapping C API (return int all the time often without meaning)
16:05:47clyybberYeah, I wholeheartedly agree
16:09:13krux02not so great for ...
16:10:19clyybberwell, for C API's thats what the discardable thing is for
16:12:35*shomodj joined #nim
16:12:46*shomodj quit (Client Quit)
16:18:08krux02yea
16:18:16krux02C has a weird history
16:19:05krux02I also think that the approach of Go where ever procedure has N arguments and N return values is nicer than nims single tuple result.
16:20:23krux02this ``iterator mpairs(abc): tuple[int, var T]`` is just a hack. There is no tuple type like that.
16:29:16FromGitter<Varriount> krux02: I don't quite follow? Aren't Go's return types just tuples behind the scenes?
16:30:12krux02it is not what it compiles to in the backend.
16:31:45krux02when you have different types, you can attach type attributes individually, for example var or discardable. when you have only a single tuple type, you have only one type to attach attributes. In Nim it works anyway for the pairs iterator, but if you ask me that is not the cleanest way possible.
16:44:45disruptekdiscard is great.
16:44:50disruptekvery much agree with that.
16:48:57*endragor_ joined #nim
16:49:01*actuallybatman joined #nim
16:49:32disruptekkrux02: i'm trying to grok that; so you'd like nim to be able to return a tuple that has some attributes that are immutable and others mutable?
16:49:52krux02no not really
16:49:59krux02I don't want to change what we have.
16:50:09disruptekbut, i mean in your ideal version.
16:50:17krux02It is just something that I thought about that could be better.
16:51:17krux02disruptek: what you are describing is what we already have for iterators. In my ideal version we would not need to abuse tuples for that.
16:51:42*endragor quit (Ping timeout: 245 seconds)
16:53:00FromGitter<dawkot> does anyone know why `inp.text` results in nil here? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d558deb90bba62a127fa0cd]
16:54:11disruptekkrux02: maybe you want iterator syntax to destructure an object?
16:54:32krux02disruptek, it is not about the syntax
16:55:04krux02it is about how types in the compiler how they are represented, what you are allowed to do with them etc.
16:55:32krux02having different type values would clean things up in the compiler
16:55:49disruptekso it really is bigger than that abuse in iterators.
16:55:55*abm quit (Remote host closed the connection)
16:56:17*abm joined #nim
16:56:35krux02well the abuse in iterator has consequences. It basically means that the tuple type has been hacked to support this weired interal tags
16:56:56krux02I don't really like it. But I am also not going to change anything about it until I really hit a problem with it.
16:58:02disrupteki didn't understand why tuple didn't offer `contains` or `low` or `high`. now i kinda understand why they were omitted but i'm not sure i wouldn't like to put them back in.
16:58:26disruptekit's not your python's tuple.
16:59:30*ng0 joined #nim
16:59:47disruptekmaybe what you want is partially materialized objects. it's actually not crazy.
17:00:18*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:02:10disrupteknim's return value, its result, could be a third-way magical PMO that perhaps even affords some kind of unique capability or dialog between caller/callee that is otherwise absent.
17:02:39shashlicknightlies are completely broken on windows and arm since sqlite is not available
17:05:45*Trustable joined #nim
17:16:07*terps joined #nim
17:26:47FromGitter<dawkot> this is it not valid syntax? ```nim ⏎ const form, input, button = randId() ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=5d5595d67d56bc60805c2aa9]
17:27:00FromGitter<dawkot> it's not a big deal, but pretty weird
17:29:55*Ven`` joined #nim
17:31:04*endragor_ quit (Remote host closed the connection)
17:36:35*sagax joined #nim
17:41:07*shomodj joined #nim
17:41:25*terps quit (Ping timeout: 250 seconds)
18:07:03ZevvHmm imports which have main code but no symbols which are used by others are marked as 'imported and not used'
18:12:51Zevvmessage for NPeg users: I've added a bunch of features over the last few days, much obliged if you have some time to see if your stuff does not break with latest master
18:18:41lqdev[m]Zevv: https://github.com/zevv/npeg#ast-abstract-syntax-tree-captures in the second code example, rule `number`: `>+Digit` will be parsed as a unary operator `>+` operating on `Digit`, you need parentheses here
18:19:48lqdev[m]https://github.com/zevv/npeg#code-block-captures you also forgot the 'object' in the Capture type description
18:20:16Zevvhmm dang I should make these examples in the readme testable
18:21:36Zevvlqdev[m]: and *ha* got you there, no parentheses needed. Npeg is smart and understands concatenated prefixes :)
18:21:57Zevv"smart" might end up to be "stupid" one day, but it surely seems like a good idea for now
18:22:02lqdev[m]I kind of thought you may have added that, it's a nice feature
18:33:49disruptekZevv: my npeg is fine, thank you; but, i don't do anything sophisticated with it. ;-)
18:33:50*terps joined #nim
18:34:08Zevvthanks for testing anyway!
18:41:10FromGitter<alehander42> i might stream
18:42:40Zevvsubject?
18:43:40FromGitter<alehander42> around 22;00
18:43:55FromGitter<alehander42> moving out some code of my project into a karax-like lib for termbox
18:59:28*terps quit (Ping timeout: 264 seconds)
19:00:14Zevvmight attend!
19:01:12FromGitter<alehander42> ok
19:01:15FromGitter<alehander42> installing obs
19:01:26FromGitter<alehander42> thats what people do righ
19:07:28Zevvno clue, i dont stream :)
19:08:04disruptekalehander42: which os?
19:14:49FromGitter<alehander42> i dont promise
19:14:51FromGitter<alehander42> linux
19:15:51disruptekif you're using wayland, https://github.com/schauveau/wf-recorder-x could use some extra testing.
19:24:23*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:30:43*vesper11 quit (Ping timeout: 248 seconds)
19:31:16*actuallybatman quit (Ping timeout: 244 seconds)
19:31:45FromGitter<alehander42> https://www.twitch.tv/alehander42/
19:39:31*krux02 quit (Remote host closed the connection)
19:43:13federico3what are you doing?
19:45:02federico3alehander42: [shameless plug] https://github.com/FedericoCeratto/nim-dashing
19:53:08Zevvdisruptek: how does one record wayland?
19:53:16Zevvwasn't that designed to be uninjectable & unrecordable?
19:53:47disruptekunrecordable?
19:54:23Zevvthere's no mechanism in wayland to peek in someone elses window, nor to record keystrokes or mouse events
19:55:01disrupteki dunno. i had to hack up the code a bit and it's pretty tiny; you can probably see how it does it in that project above.
19:55:11Zevvlooking :)
19:55:27disruptekit does record the mouse cursor, but i doubt it gets keyboard events.
19:57:23Zevvah its inside the weston wayland implementation
19:58:01clyybberAraq: Any problems with making lastSon a template?
20:05:50disruptekyou could write your dsl on top of dashing.
20:06:09*drewr quit (Ping timeout: 250 seconds)
20:13:45FromGitter<Varriount> Zevv: What's unique about the Weston implementation?
20:14:26*Trustable quit (Remote host closed the connection)
20:14:32Zevvnot unique probably. But the wayland protocol itself does not provide for capturing, but this particular implementation does
20:14:44Zevvbut it's not done through the wayland protocol, that's all
20:16:52*actuallybatman joined #nim
20:21:53*drewr joined #nim
20:31:56*amalek_heylel joined #nim
20:33:31*amalek_heylel left #nim ("WeeChat 2.5")
20:40:43*actuallybatman quit (Ping timeout: 246 seconds)
20:42:45FromDiscord_<strexicious> I am getting a not very informative error "invalid type: 'var seq[proc (){.closure.}]' in this context: 'Engine' for let". (How should I post more info?)
20:42:45FromDiscord_<strexicious> https://cdn.discordapp.com/attachments/371759389889003532/611661073510039552/unknown.png
20:42:51*vesper11 joined #nim
20:43:01FromDiscord_<strexicious> I am getting a not very informative error "invalid type: 'var seq[proc (){.closure.}]' in this context: 'Engine' for let". How should I post more info? Also can you see the attached image?
20:43:01FromDiscord_<strexicious> https://cdn.discordapp.com/attachments/371759389889003532/611661073510039552/unknown.png
20:43:57Zevvstrexicious: can see image, but better is to put some code on a pastbin, preferably something stand-alone that others can run to reproduce your problem
20:43:59disruptekthe attached shows up as a link to the image, so yes, that works.
20:44:27disruptekare you getting a stack trace?
20:46:38FromDiscord_<strexicious> It's a compile time error, so no stack trace. Here is the engine module: <https://pastebin.com/yQYXdPsS> Note: I am also using the result package.
20:48:17FromDiscord_<strexicious> The error showed up after recent changes (which were bunch of them). My last resort would be do Ctrl+Z until I pin point it, but I thought I'd ask about the error msg in case it was me not being able to understand a clear message.
20:48:31disruptekit sounds like the result package is swallowing stuff. did you just add that?
20:48:41disruptekwhat does it do?
20:48:54*Kaivo quit (Quit: WeeChat 2.5)
20:49:12FromDiscord_<strexicious> I did not, but I did use it's "mapErr" in the recent changes.
20:49:21FromDiscord_<strexicious> It's basically a helper Result type.
20:52:20FromDiscord_<Shield> maybe it's Result[Engine, string]?
20:52:36FromDiscord_<strexicious> What is?
20:53:09FromDiscord_<Shield> proc startEngine*(width: int32, height: int32, r: float, g: float, b: float): Result[Engine, string]
20:53:10FromDiscord_<strexicious> The Result crate for reference is: https://nimble.directory/docs/result//result.html
20:54:15FromDiscord_<strexicious> Yes, that's the return type. It was working before
20:55:02disrupteklooking at result, it seems that part is okay.
20:56:00disrupteki think the problem is `let ngn: Engine = ...` -- how does that syntax work?
20:56:18FromDiscord_<strexicious> no difference
20:56:36*sagax quit (Remote host closed the connection)
20:56:41disruptekoh i see, it's composed.
20:57:16disruptekdoes chaining like that work in nim? i guess i never tried it.
20:58:01FromDiscord_<strexicious> oh.. I would assume so.
20:58:08disruptekthat's a neat import from js. seems to work.
20:58:53FromDiscord_<strexicious> From JS? 👀 You talking about Result?
20:59:19disruptekno, just the length chain style that's so prevalent there.
21:00:31FromDiscord_<strexicious> Oh. Yeah. Also from Rust :P
21:04:11*stefanos82 quit (Quit: Quitting for now...)
21:06:25rayman22201Try making ngn var instead of let
21:07:07FromDiscord_<strexicious> Tried that too. Actually, I think the error is Engine's fields
21:08:04FromGitter<dumjyl> `var SomeType` is only valid as a parameter and return type.
21:08:27disruptekwhere are you reading that?
21:09:04FromDiscord_<strexicious> Yeah, I think I get it now
21:09:15disruptekoh i missed the paste somehow. 🙄
21:10:16*abm quit (Quit: Leaving)
21:15:53*Mister_Magister quit (Ping timeout: 245 seconds)
21:16:13*Mister_Magister joined #nim
21:18:56rayman22201That could use a better error message for sure. var is not valid in a typedef
21:23:27FromGitter<kdheepak> I have a silly question, I want to generate the following javascript code: `{ color: 0x00ff00 } `
21:24:12FromGitter<kdheepak> In nim if I use `{ "color": 0x00ff00 }` I get `([{Field0: makeNimstrLit("color"), Field1: 65280}]))` instead.
21:24:35FromGitter<kdheepak> `0x00ff00` == `65280` so that's not the issue.
21:24:53Zevvdo not use tuples but an object
21:25:44Zevvhm wait js, not even sure if objects map to js objects, let me check
21:26:29Zevvyes, that would work probably
21:28:08FromGitter<kdheepak> Thanks
21:28:17FromGitter<kdheepak> ```type ⏎ Color* = object ⏎ color: int ⏎ ``` [https://gitter.im/nim-lang/Nim?at=5d55ce711dadc42a11795f97]
21:28:21FromGitter<kdheepak> This seems to work
21:28:34Zevvright!
21:28:54*actuallybatman joined #nim
21:29:17FromGitter<kdheepak> awesome!
21:31:58*solitudesf quit (Ping timeout: 258 seconds)
21:34:13FromGitter<Riderfighter> Hello everyone!
21:49:53clyybberHi
21:57:40*ng0 quit (Quit: Alexa, when is the end of world?)
21:59:56*clyybber quit (Quit: WeeChat 2.5)
22:20:53*lritter joined #nim
22:38:41*seni joined #nim
22:40:46*dddddd quit (Ping timeout: 246 seconds)
22:50:41*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:05:52FromDiscord_<Kiloneie> Go to bed O,O
23:15:27*shomodj joined #nim
23:20:02*shomodj quit (Ping timeout: 245 seconds)
23:23:57*Jesin quit (Quit: Leaving)
23:29:12*abm joined #nim
23:29:47*sagax joined #nim
23:34:00*Jesin joined #nim
23:41:23*abm quit (Ping timeout: 248 seconds)