<< 30-10-2018 >>

00:00:01FromGitter<recloser> ah, i didn't realise you were looking up the index like that
00:01:28FromGitter<recloser> of lookupIndex(match, someType): ...
00:01:50FromGitter<recloser> whee lookupIndex is a macro that takes two typed args
00:02:17copygirlThat would kind of defeat the purpose of using a macro that is clean in use.
00:02:32FromGitter<recloser> you'd rewrite each `of someType` branch in your match macro
00:02:51copygirlOooh. Hm..
00:02:53FromGitter<recloser> `of someType` -> `of lookupIndex(value, someType)`
00:03:24FromGitter<recloser> and lookupIndex would produce a compile time error if it can't find the index
00:08:27*cyraxjoe quit (Ping timeout: 246 seconds)
00:09:06*skellock quit (Quit: WeeChat 2.3)
00:10:24copygirlArgh
00:10:51copygirlWell I'm going to need the index in the of branch's statements.
00:12:47FromGitter<recloser> it's a very simple solution, all you need to do is extract that findIndex proc
00:14:09*cyraxjoe joined #nim
00:19:04*cyraxjoe quit (Ping timeout: 244 seconds)
00:19:19*cyraxjoe joined #nim
00:23:30*cyraxjoe quit (Ping timeout: 246 seconds)
00:23:54*cyraxjoe joined #nim
00:26:07*junland quit (Quit: Disconnected.)
00:27:49*junland joined #nim
01:21:24*zachk quit (Quit: Leaving)
01:40:23*leorize quit (Ping timeout: 276 seconds)
01:41:49*leorize joined #nim
01:54:15*leorize quit (Ping timeout: 250 seconds)
01:54:34*leorize joined #nim
02:01:53*theelous3 quit (Ping timeout: 244 seconds)
02:05:00*leorize quit (Ping timeout: 246 seconds)
02:05:47*leorize joined #nim
02:07:55FromGitter<kayabaNerve> We have `..<` but not `<..` :thinking:
02:08:11FromGitter<kayabaNerve> I guess it's just an usage thing?
02:08:29FromGitter<kayabaNerve> I've been coding in Nim almost daily for about five months now and only just had an use case for it.
02:26:07*kapil____ quit (Quit: Connection closed for inactivity)
02:41:18FromGitter<kaushalmodi> @zacharycarter I finally got that Nim code to JS; the one with import
02:42:02FromGitter<kaushalmodi> turns out Netlify was using something called Babel (I have no idea why!) to allow using an import keyword in JS; which the browsers don't support by default
02:42:20FromGitter<kaushalmodi> and finally it started working once I used require: https://ptpb.pw/Cwme/nim
02:42:33FromGitter<kaushalmodi> thanks to https://stackoverflow.com/questions/39436322/node-js-syntaxerror-unexpected-token-import
02:49:45FromGitter<rayman22201> @kaushalmodi really? most newer browsers should support import by now: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Browser_compatibility
02:50:06FromGitter<rayman22201> though Babel is really commonly used in the JS world
02:51:32FromGitter<kaushalmodi> @rayman22201 may be the Netlify server is using an old NodeJS version?
02:51:49FromGitter<kaushalmodi> I have no idea if that error is issued by the browser or nodejs on server
02:51:56FromGitter<rayman22201> Ahhh! yes. You said browser so I was confused
02:52:06FromGitter<rayman22201> Node is behind the curve here
02:52:11FromGitter<kaushalmodi> but I wasted an embarrassing amount of time on this
02:52:16FromGitter<rayman22201> If it's a lambda function then it is Node not browsers
02:52:28FromGitter<kaushalmodi> I wish the examples I am trying to translate avoided this complication
02:52:58FromGitter<rayman22201> It is an unfortunate side effect of the fragmentation in the JS ecosystem.
02:53:28FromGitter<kaushalmodi> using `const foo = require("foo");` worked the same as the original `import foo from "foo";` in their example
02:54:14FromGitter<rayman22201> it's worse than the GCC vs. Clang vs. VSStudio C++ standard wars.... :-/
02:54:43FromGitter<kaushalmodi> hmm (glad I never got into learning JS :P)
02:54:47FromGitter<rayman22201> lol
02:54:55FromGitter<kaushalmodi> so.. now one last example left to translate in https://github.com/netlify/netlify-functions-example/tree/master/src/lambda
02:55:11FromGitter<kaushalmodi> .. hello_fetch.js (I am ignoring the hello_slack.js in there)
02:55:56FromGitter<kaushalmodi> Nim translations of above JS funcs: https://github.com/kaushalmodi/nim-netlify-functions/tree/master/src/lambda
02:56:32FromGitter<rayman22201> require was the old syntax. It was ugly but widely supported and easy hack into all the JS environments. Then they decided they should have proper import syntax like the "big boy languages"... but nobody could agree on the semantics, so it's been slow to adopt. Most of the browsers have it now, but NodeJS usually lags behind.
02:56:58FromGitter<rayman22201> *Old man shakes stick at cloud rant* :-P
02:57:06FromGitter<kaushalmodi> :)
02:58:01FromGitter<rayman22201> fetch should be easy at this point right? lol
02:58:16FromGitter<kaushalmodi> umm, no :P
02:58:38*endragor joined #nim
02:58:41FromGitter<kaushalmodi> it seems to be *fetched* from something in packages.json (and I am trying to make those examples yarn-free)
02:58:49FromGitter<kaushalmodi> looks like I will give up on that too
02:59:20FromGitter<rayman22201> https://www.npmjs.com/package/node-fetch
02:59:23FromGitter<rayman22201> it's this thing
03:00:03FromGitter<kaushalmodi> so can I just download a JS for that and put it somewhere in my assets dir or something like that
03:00:46FromGitter<rayman22201> somewhere where node can find it. yeah
03:01:13FromGitter<rayman22201> or just use the built in http. *my preferred way*
03:01:15FromGitter<kaushalmodi> but doesn't look that simple
03:01:56FromGitter<rayman22201> built in http client I mean
03:02:14FromGitter<kaushalmodi> yes, I think I can do that
03:02:27FromGitter<kaushalmodi> though the return type in that JS example looks weird
03:02:39FromGitter<kaushalmodi> `.then`, `.catch` ..
03:02:57FromGitter<rayman22201> https://nodejs.org/api/https.html#https_https_get_url_options_callback
03:03:03FromGitter<kaushalmodi> seems like some try-catch syntax built into a return type
03:03:23FromGitter<rayman22201> that function returns the JS flavor of a future
03:03:42FromGitter<rayman22201> it's an async function
03:03:53FromGitter<kaushalmodi> might be just better to not do a literal translation of that JS example
03:04:05FromGitter<kaushalmodi> .. and just do it Nim way, I guess
03:04:46FromGitter<rayman22201> I think so.
03:05:10*banc quit (Quit: ZNC - http://znc.in)
03:06:47FromGitter<kaushalmodi> I might need your help in may be one thing in that example
03:06:55FromGitter<kaushalmodi> what are the two .then's doing?
03:07:00FromGitter<kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bd7cad33844923661bc5f8d]
03:07:14ldleworkhi kausalmodi
03:07:17FromGitter<rayman22201> It's dangerous to go alone, take this :-P https://nim-lang.org/docs/asyncjs.html
03:07:19FromGitter<kaushalmodi> where is the "response" in first then getting used?
03:07:21ldleworkkaushalmodi*
03:07:29FromGitter<kaushalmodi> ldlework: hello
03:07:41FromGitter<kaushalmodi> yes, I am using async
03:07:48FromGitter<rayman22201> each .then returns a new "future" object, that wraps the previous ones. (In JS this is called a promise)
03:07:52ldleworkyou added that export_hugo_section* to ox-hugo a bit ago based on an issue i opened
03:07:57ldleworkthanks
03:08:34FromGitter<kaushalmodi> @rayman22201 thanks, I now have something to google by
03:08:54FromGitter<rayman22201> That example is called a promise chain
03:09:03FromGitter<kaushalmodi> ldlework: you are welcome; though not sure how helpful you would find that; I cannot implement 100% of what you suggested
03:09:36FromGitter<rayman22201> the end result of all the ".then" calls (and the except call) is put into a final promise object. That is what is returned. If that makes sense?
03:10:15FromGitter<rayman22201> It's actually the mechanism that await/async is built on top of, but exposed to the end user
03:10:16FromGitter<kaushalmodi> but the return type has status code, body, etc. (which I thought *is* the response)
03:10:17ldleworkkaushalmodi, i was able to implement the desired site layout that i intended, but i still feel there are a lot of extra org nodes that you must use to accurately apply various org properties. not that i want to discuss that right now just to say thanks.
03:10:50FromGitter<rayman22201> but notice on line 6, the async keyword. that means a a future of that type is returned
03:11:25FromGitter<kaushalmodi> so what is that extra "response"? I think I will try to get "something" working first
03:11:50FromGitter<kaushalmodi> @rayman22201 I kind of understood the js async in this example that I worked on: https://ptpb.pw/bkz3/nim
03:12:07FromGitter<rayman22201> The extra "response" on line 8? that is the response from the random joke website.
03:13:13FromGitter<kaushalmodi> .. and the body of that "response" has "setup" and "punchline" fields somewhere in the received JSON?
03:13:26FromGitter<rayman22201> correct
03:14:16FromGitter<kaushalmodi> thanks, now that I understand the logic, it should be easier to do that in Nim
03:14:45FromGitter<kaushalmodi> I have used http client, but not with js async, so we'll see
03:15:04FromGitter<rayman22201> np. Let me know if you have any more questions. This kind of async js stuff was my specialty back when I did web dev. :-)
03:15:22FromGitter<kaushalmodi> Thanks!
03:15:36FromGitter<rayman22201> So, I don't think the Nim http client will work directly in a JS environment
03:15:48*im_jeb is now known as njha
03:15:52FromGitter<rayman22201> you are going to have to use the Nodejs http client through the jsffi
03:20:37*banc joined #nim
03:21:49FromGitter<kaushalmodi> oh; I was here: https://ptpb.pw/4B_T/nim
03:22:05FromGitter<kaushalmodi> I was thinking of first getting it working locally and "just compile using js"
03:22:12FromGitter<kaushalmodi> hehe
03:23:02FromGitter<kaushalmodi> "you are going to have to use the Nodejs http client through the jsffi" <-- that puts a wrench in my plan
03:24:27FromGitter<rayman22201> Sorry. lol :-(
03:24:55FromGitter<kaushalmodi> I will put this off for a rainy day
03:25:15FromGitter<kaushalmodi> I think my goal to have basic examples of using Nim for lambda functions is met
03:25:19FromGitter<rayman22201> If you make a nice wrapper around around the nodejs http client (and maybe some of the other nodejs apis) it would be a cool nimble project thought :-P
03:26:24FromGitter<kaushalmodi> while working on this, I wished the "js" backend did some auto translations
03:26:32FromGitter<rayman22201> but I understand if you want to put that off. It's tedious work. Especially considering there is no "nimgen" for js :-P
03:26:32FromGitter<kaushalmodi> like a plain `echo` to `console.log`
03:26:59FromGitter<kaushalmodi> .. yeah and esp. that I don't know JS
03:28:24FromGitter<rayman22201> I wonder if it makes more sense to write a macro that rewrites `echo` to `console.log` or build that into the js code generator :thinking:
03:28:30FromGitter<rayman22201> more rainy day thoughts :-P
03:29:13FromGitter<rayman22201> Well, you know a lot more about JS now than you used to!
03:29:29FromGitter<kaushalmodi> that's for sure :)
03:43:48*dddddd quit (Remote host closed the connection)
04:15:51*vlad1777d quit (Ping timeout: 252 seconds)
04:18:53FromGitter<gogolxdong> Does nimgen compile cpp?
04:23:20FromGitter<rayman22201> yes
04:31:16*chemist69 quit (Ping timeout: 264 seconds)
04:32:41FromGitter<gogolxdong> but failed.
04:32:41*chemist69 joined #nim
04:33:30FromGitter<gogolxdong> ```[n.global] ⏎ cpp_compiler="clang" ⏎ ⏎ [main.cpp] ⏎ preprocess = true``` [https://gitter.im/nim-lang/Nim?at=5bd7df1a435c2a518e27eee7]
04:34:53FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bd7df6c82893a2f3b600d69]
04:39:20FromGitter<rayman22201> idk, but the first problem I see is that it is not using clang. it is using mingw.
04:40:50FromDiscord_<🐍 Aareon 🐳> looks like it's just using the `gcc` binary from his `mingw` install. Shouldn't cause any issues I'm aware of.
04:41:26FromGitter<rayman22201> but it should not be doing that if he set `cpp_compiler="clang"`
04:42:23FromGitter<citycide> does nim inherently not support the `msys_nt-10.0` os that's installed on Travis' windows environment? it fails to build with `unknown os`
04:42:39shashlick@rayman22201: if its just file mangling needed, you could use nimgen still
04:42:46shashlickas long as there's no js2nim requirement
04:43:08shashlickin fact, nimgen could use any x2y backend in theory
04:43:23FromGitter<gogolxdong> shashlick , how to make this right
04:43:41FromGitter<rayman22201> @shashlick, I am confused. What is the context?
04:44:13shashlickre: Especially considering there is no "nimgen" for js 😛
04:44:30FromGitter<rayman22201> oh!!! lol. ok.
04:44:35shashlick@gogolxdong: can you provide any details?
04:44:37FromGitter<gogolxdong> there is just a single main.cpp file.
04:45:27shashlicki've never tested with clang before
04:45:45shashlickdoes gcc -E still work?
04:45:52shashlickcause that's what nimgen uses for preprocessing
04:46:47FromGitter<gogolxdong> g++ or gcc is fine, question is how to compile a single cpp to nim? I though it is simple.
04:48:35FromGitter<gogolxdong> It's an example file of imgui in vulkan.
04:48:54*tiorock joined #nim
04:48:54*rockcavera quit (Killed (barjavel.freenode.net (Nickname regained by services)))
04:48:54*tiorock is now known as rockcavera
04:49:17shashlickif it doesn't have too much preprocessing, you might be better off using c2nim directly
04:49:48shashlicknimgen helps handle lots of #defines, etc. and if the source .cpp or generated .nim need edits
04:50:07FromGitter<gogolxdong> http://ix.io/1qq5
04:50:09shashlickalso it is about automation so that you can recreate wrappers at will
04:51:02shashlickya I've mainly used nimgen/c2nim to make wrappers so typically just use it on header files, not source
04:51:44shashlicknow that https://github.com/nim-lang/c2nim/issues/141 is fixed, you could try and see if c2nim works for you
04:51:56FromGitter<gogolxdong> stuck at std::array<float, 50> frameTimes{};
04:52:04FromGitter<gogolxdong> Error: identifier expected, but got: {
04:52:28shashlickc2nim doesn't handle templates too well right now
04:53:10shashlickhttps://github.com/nim-lang/c2nim/issues/122
04:53:38shashlicknot sure if that is the same since in your case, it is in a struct
04:54:56shashlickchange frameTimes{}; => frameTimes;
04:55:25shashlicknot sure if it means the same but regardless, you will have to go through the .nim file line by line to verify that it is what it should be
05:35:34*nsf joined #nim
05:54:11*rockcavera quit (Read error: Connection reset by peer)
05:54:52*rockcavera joined #nim
05:54:52*rockcavera quit (Changing host)
05:54:52*rockcavera joined #nim
06:18:07*yglukhov[m] quit (Ping timeout: 250 seconds)
06:18:32*macsek1911[m] quit (Ping timeout: 250 seconds)
06:18:32*stisa[m] quit (Ping timeout: 250 seconds)
06:18:32*toofly[m] quit (Ping timeout: 250 seconds)
06:18:33*endes[m] quit (Ping timeout: 250 seconds)
06:18:36*k0mpjut0r quit (Ping timeout: 250 seconds)
06:18:40*pqflx3[m] quit (Ping timeout: 250 seconds)
06:19:37*macsek1911[m] joined #nim
06:19:37*stisa[m] joined #nim
06:20:18*endes[m] joined #nim
06:20:52*k0mpjut0r joined #nim
06:21:15*yglukhov[m] joined #nim
06:22:31*toofly[m] joined #nim
06:23:08*pqflx3[m] joined #nim
06:45:58*Vladar joined #nim
06:54:12*leorize quit (Quit: WeeChat 2.2)
06:59:32*mech422_ joined #nim
07:00:21*fredrik92 joined #nim
07:00:22*UNIcodeX_ joined #nim
07:02:27*mech422 quit (Ping timeout: 240 seconds)
07:03:07*UNIcodeX quit (Ping timeout: 240 seconds)
07:03:27*couven92 quit (Ping timeout: 240 seconds)
07:14:18*odc quit (Ping timeout: 264 seconds)
07:14:59*odc joined #nim
07:29:50*krux02 joined #nim
07:55:45*chemist69 quit (Ping timeout: 252 seconds)
07:56:53*chemist69 joined #nim
08:16:25*kobi7 joined #nim
08:16:28kobi7hi guys!
08:25:35*floppydh joined #nim
08:29:32*stefanos82 joined #nim
08:36:59*kobi7 quit (Quit: Leaving)
08:42:43*PMunch joined #nim
08:45:07PMunch@Epictek, are you around?
08:49:38*kapil____ joined #nim
08:56:54*notbot[m] quit (Ping timeout: 264 seconds)
08:59:24*notbot[m] joined #nim
09:08:14PMunchCondensed my bug from yesterday some more: http://ix.io/1qqP/Nim
09:09:37PMunchOn 0.19.0 run "nim c <filename>.nim" and it will throw an error from GCC that the struct has no "has" field (this is an option struct). Now compile with "nim c -d:passTest <filename>.nim" and it runs fine.
09:12:24PMunchThis is the diff between the two generated C files: http://ix.io/1qqR
09:25:40FromGitter<AchalaSB> How the eWASM Nim contract is deployed in browser ? What is the interpreter? https://github.com/status-im/nim-eth-contracts
09:29:37PMunchThe bug is still there in the latest by the way devel
09:31:54PMunchNot quite sure what you mean AchalaSB
09:32:32PMunchThat is an Ethereum smart contract, not browser based WASM (but Nim can do that too).
09:35:52*dom96_w joined #nim
09:39:51PMunchHi dom96_w, any idea what might cause this: http://ix.io/1qqP/Nim to fail with an error about the structure missing a has field?
09:40:00PMunchAnd if you pass -d:passTest it works
09:40:17PMunchNim seems to confuse the distinct JsonNode for a "SomePointer"
09:40:34PMunchBut only if you've never user it before
09:43:46*dom96_w quit (Changing host)
09:43:46*dom96_w joined #nim
09:43:55dom96_wPMunch: Something must be receiving your distinct type
09:44:07PMunchreceiving?
09:44:14dom96_wSeems like a bug
09:44:29dom96_wHard to say without seeing where it happens
09:44:41PMunchYeah, but I really can't figure out what it is
09:45:06PMunchJust try to copy that and run it, should show you were in the code it fails
09:46:07PMunchhttp://ix.io/1qr0
09:46:13PMunchThere is an example run
09:50:58*david1 joined #nim
09:52:35dom96_wThat's definitely a compiler bug
09:52:40dom96_wYou should never get a C error
09:53:24PMunchCreated a slightly smaller sample: http://ix.io/1qr2/Nim
09:53:34PMunchWorks the same way
09:53:56PMunchI guess I should create an issue on GitHub, any idea what to call this?
09:54:58PMunchI don't think it's really related to the options module
09:59:20*deathpoison joined #nim
10:00:34*rokups joined #nim
10:05:04FromGitter<narimiran> btw, how mature/stable is the options module? i've never used it before, but now i'm writing something where options would be the way to go
10:07:54PMunch@narimiran, generally it works pretty well
10:08:47FromGitter<narimiran> PMunch: thanks, will try to use it then
10:09:11PMunchdom96_w, bug report: https://github.com/nim-lang/Nim/issues/9566
10:09:52dom96_wnarimiran: very stable. It's an incredibly simple module. The bug that PMunch is running into is to do with `distinct` from what I can tell.
10:10:23PMunch@narimiran, I tried to flesh it out a bit with some more utility stuff. But those PRs are still not merged: https://github.com/nim-lang/Nim/pulls/PMunch (The top four ones)
10:11:29PMunchdom96_w, yeah it seems to only happen with distinct types. But it's very fickle, so it's not easy to test things out
10:12:40*chemist69 quit (Ping timeout: 264 seconds)
10:12:41PMunchHmm, a JsonNode is a ref JsonNodeObj
10:12:58PMunchSo shouldn't an Option[JsonNode] never have the has field?
10:13:05*chemist69 joined #nim
10:13:19FromGitter<narimiran> PMunch, yeah, i remember those "hacktoberfest pull requests" :)
10:14:37PMunchHaha, that was actually coincidental. I had been putting off splitting those into different PRs for a while :P
10:16:07FromDiscord_<Epictek> PMunch: yeah I'm here 😃
10:16:16FromGitter<narimiran> btw, did you manage to make 5th PR?
10:16:34PMunchnarimiran, yup. Even got it merged already
10:17:00*FromGitter * narimiran thumbs up
10:17:24PMunchhttps://github.com/nim-lang/Nim/pull/9396
10:17:41PMunchEpictek, you asked about nimlsp after I had logged off yesterday
10:17:54FromDiscord_<Epictek> I did indeed
10:18:10PMunchI actually got inspired by the discussion to resume work on it. But I've ran into some strange bug which I've been trying to debug
10:18:20FromDiscord_<Epictek> Ah I see
10:18:57FromGitter<alehander42> @AchalaSB maybe try the status-im / nimbus gitter
10:19:20PMunchIf I can get that sorted though I think I'm good to go and start working on actually interfacing with LSP
10:19:31FromDiscord_<Epictek> PMunch: How is your nimlsp repo related to nim-lang/langserver?
10:19:52PMunchWell, not at all really :P
10:19:55FromDiscord_<Epictek> Will your repo merge in to that at a later date or is it a separate project?
10:19:58FromDiscord_<Epictek> I see
10:20:09PMunchWe started work about the same time, and started in completely different ends
10:21:12Araqboo, please work together.
10:21:38PMunchI started working on the JSON LSP interface, while langserver seemed to work on the internal book keeping and nimsuggest interfacing
10:21:49PMunchSo I plan on "borrowing" some of that when I get to that part
10:22:56*dom96_w quit (Ping timeout: 250 seconds)
10:23:25*dom96_w joined #nim
10:23:33PMunchWe were talking of merged them together, but they wanted to use something else for the JSON interface. I waited to see how that would look as it would essentially mean that all my work had been for naught, but it never got updated after that. So now I'm planning to just keep going with my version and "borrow" what they have done to get up and running on that front quicker.
10:24:07AraqI figured that LSP can actually help me too in improving nimsuggest if the editor strictly follows the LSP
10:24:43FromGitter<narimiran> what a difference a day made :D
10:24:57FromDiscord_<Epictek> PMunch: fair, well it appears you are on the right track. Look forward to being able to use it
10:26:39FromGitter<alehander42> @PMunch still, try to ask @zah or somebody about the langserver repo plans, it will be really cool if all interested nimmers contribute to just one impl
10:30:39FromDiscord_<Epictek> Nah, we need 10 competing implementations *insert relevant xkcd here*
10:31:59PMunchhttps://github.com/nim-lang/Nim/issues/9566 <- think I found what causes it
10:32:02Araqthere are better xkcds, like this one https://xkcd.com/538/
10:33:09Araqor this: https://xkcd.com/936/
10:33:15PMunchEpictek, I agree. But currently we have two implementations that doesn't actually do anything. I'd be happy to flesh out something if it worked, but I'm not so willing to implement someone elses design idea that I'm not 100% sure I understood correctly
10:33:22PMunchThen I'd rather implement my own idea
10:33:34FromGitter<narimiran> i cannot iterate through a tuple? (`items` is not defined for tuples?)
10:33:39PMunchWhat happens if both are implemented are of course another question
10:33:41FromGitter<xmonader> If i want my binary to have the information of last commit in its version information? ⏎ i was thinking of executing `git rev-parse HEAD` so i'll have that information and pass it along to the compiler but not sure if it's the cleanest way?
10:34:04FromGitter<xmonader> also nimscript also supports executing with no way to retrieve the output?
10:35:06*Vladar quit (Remote host closed the connection)
10:35:13PMunch@xmonader, a staticExec("git rev-parse HEAD") should be fine
10:35:36FromGitter<narimiran> nor i can do `for i in 0 ..< myTuple.len` :(
10:35:41*Vladar joined #nim
10:35:53PMunch@narimiran, yeah I don't think tuples have len defined for them do they?
10:35:57Araqnarimiran: system.fields iterator
10:36:04FromGitter<xmonader> @PMunch where is that defined? https://nim-lang.org/docs/nimscript.html
10:36:35FromGitter<narimiran> as usual, Araq to the rescue! :) thanks!
10:36:49PMunch@xmonader: https://nim-lang.org/docs/system.html#staticExec%2Cstring%2Cstring%2Cstring
10:37:15PMunchNot sure if it works in nimscript though, haven't used it enough
10:37:36FromGitter<alehander42> @PMunch that's why it's best to discuss this with the people with the other idea, because often people find out their designs can be combined easier than they expected
10:37:41PMunchI was thinking just adding "const gitHash = staticExec("git rev-parse HEAD")" to the top of your file
10:38:08FromGitter<alehander42> but in the worst case, 2 impls > 0, I agree
10:39:17PMunchalehander42, yeah we talked about it. So far my library is 99% json schema parsing to talk over the JSON-RPC interface with LSP. They wanted to use the status-im jsonrpc library to do that. So "combining" the projects would basically mean delete everything I've done and work on their version.
10:39:19FromGitter<xmonader> @PMunch totally correct, i was thinking in the nimscript domain thank you
10:39:51PMunchWhich I would be fine with if anyone else was working on it. But last commit was 5 months ago..
10:42:30AraqPMunch, yeah, sometimes you need to go on on your own
10:45:20PMunchhttps://github.com/nim-lang/Nim/issues/9566 <- updated the issue again. A distinct type of a ref object is not considered a ref it turns out
10:45:25PMunchAnd that causes trouble
10:45:30FromGitter<xmonader> @PMunch awesome ⏎ ⏎ ```./zos --version ⏎ zos 0.1.0 (development#70e1972c6955c590eedfb0c50381d616e329d03c)``` [https://gitter.im/nim-lang/Nim?at=5bd83649ae7be94016dbfac6]
10:50:02*Snircle joined #nim
10:59:07FromGitter<alehander42> @PMunch ok, I see. outside of the json/json-rpc part, how much work is left for an initial working lsp?
10:59:59*platoff joined #nim
11:02:13FromGitter<tim-st> Araq: https://ci.appveyor.com/project/Araq/nightlies seems to work now, but it is triggered by the wrong repo, it creates new nightly builds when commits done to `https://github.com/nim-lang/nightlies`
11:03:29*theelous3_ joined #nim
11:05:25PMunchalehander42, hard to say. With what I have now I should be able to throw together some utility procedures to do the LSP communication, then it's "just" a matter of implementing the message handling specification
11:06:16Araqtim-st: I guess I can live with that for release building
11:06:28*fredrik92 is now known as couven92
11:06:33PMunchI'll probably start small with telling LSP that I can't do anything, then I'll expand that with the simplest capability with mock data, then integrate nimsuggest to get actual results, then expand to more capabilities.
11:06:58FromGitter<tim-st> ok, but for windows users it would be good to have a nightly build each 2 weeks or so
11:11:01FromGitter<alehander42> @PMunch sounds good!
11:12:18PMunchAs soon as I get past the "actual use nimsuggest" part it should be easy for other devs to help out with adding in more capabilites
11:16:49*theelous3 joined #nim
11:29:48*theelous3_ quit (Ping timeout: 252 seconds)
11:32:33*platoff quit (Ping timeout: 245 seconds)
11:49:06copygirlI really feel like it should be possible for macros to take in an identifier from an untyped block and, in the context where the macro is called, call bindSym.
11:50:57Araqthere are workarounds for that, copygirl, krux02 can tell you
11:52:12Araqer ... October is almost over, who am I blocking from getting the Tshirts?
11:52:39Araqor how does this work...
11:53:14copygirlI've been recommended having my macro generate more compile type generation using `quote do:` but I'm just confused and.. don't really know how this would work together.
11:53:27copygirlI'm glad and proud I got this far in the first place.
11:54:01copygirlNow I just need to compare a type symbol with this identifier, ideally in clean way where it would respect aliases and such.
11:54:44Araqwell if you need an 'untyped' parameter it's not clean and the compiler cannot tell you the symbols and types, you asked for untyped
11:57:11FromGitter<tim-st> currently two enum entries can get the same string value, is it a good idea?
11:57:36*couven92 quit (Ping timeout: 244 seconds)
11:57:41FromGitter<tim-st> `type X = enum x1 = "x.1", x2 = "x.1"`
11:58:16FromGitter<narimiran> Araq: "tshirt count" increases when you open a PR, not when it is merged
11:58:17AraqI don't know, I think it's easy enough to to $type(E) & "." & $enumValue
11:58:29Araqaha
11:58:35Araqhmmm ok
11:58:44FromGitter<narimiran> (damn, i should have been quiet, now no more merges :( :P)
11:59:27FromGitter<tim-st> If the current way is allowed then at least `parseEnum` needs a different description
12:03:13Araqsure... we need to discuss what "stdlib" means at some point
12:03:47Araqfor most people it means "battle tested, best Nim code ever, covering every use case"
12:03:47PMunchAraq, you get a T-shirt as long as you have 5 PRs, they don't have to be merged or anything. Just as long as they aren't marked as spam
12:04:10copygirlBtw is it a bug that you can specify an else branch in a case statement when all the cases are already covered?
12:04:26PMunchOops, @narimiran already said that, my bad
12:04:45Araqwhereas for me it always meant "easy to adapt, understandable code, covering the 80% solution most people agreed on that is worth solving"
12:05:20PMunchIt should still tick the first two boxes though
12:05:57PMunchBattle tested and "best" Nim code ever. As in being easy to read, proper syntax, and uses the "right" amount of tricks.
12:06:03FromGitter<tim-st> something like a pragma `uniqueString` could solve it, does it exists already for enum?
12:06:17*platoff joined #nim
12:06:30Araqtim-st no but as you noticed you can influence its string representation
12:06:54FromGitter<tim-st> yeah, the problem is I want to make sure at compile time to not have two times the same string
12:07:00Araqwhich is kind of a misfeature, builtin where it could have been a macro so easily...
12:07:19Araqwell enum identifiers cannot clash, Nim checks for that
12:07:20copygirlBbl o/
12:07:59FromGitter<tim-st> I wanted to give it a long name for the source code and a short name for repr in json
12:08:06PMunchcopygirl, the trick to reacting to the type of an untyped argument is to return a new macro and call it which takes the parameter that should now have a type. Or have some general macro that does what you want and just return a call to it.
12:09:35PMunchAraq, any hints as to why a distinct ref object is not seen as a ref when doing "when SomeType is ref:"?
12:09:54Araqbecause 'is' doesn't look at 'distinct', it's hidden
12:10:00PMunchAha
12:10:07*rokups quit (Quit: Connection closed for inactivity)
12:10:12PMunchSo it's impossible to solve?
12:10:24Araqthere is macros.skipDistinct or similar
12:10:56PMunchI'm just asking because of this: https://github.com/nim-lang/Nim/issues/9566 Makes the C compiler crash..
12:11:10PMunchAnd C compiler errors are generally not good
12:14:33*endragor quit (Remote host closed the connection)
12:17:19*endragor joined #nim
12:19:40*dddddd joined #nim
12:21:40*endragor quit (Ping timeout: 250 seconds)
12:28:46*kapil____ quit (Quit: Connection closed for inactivity)
12:29:03*endragor joined #nim
12:33:22*endragor quit (Ping timeout: 250 seconds)
12:35:28*rockcavera quit (Remote host closed the connection)
12:36:18*rockcavera joined #nim
12:45:37*NimBot joined #nim
12:47:15*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:47:52*dom96_w joined #nim
12:48:48*dom96_w quit (Client Quit)
12:51:34FromGitter<narimiran> why `assert not(someBool)` doesn't work? :'(
12:52:33FromGitter<narimiran> oh there is already an issue by @timotheecour: https://github.com/nim-lang/Nim/issues/8300
12:55:50FromGitter<narimiran> heh, here is a workaround: `assert someBool.not` :D
13:11:11PMunchHmm, tried to declare a template `is`(x: typedesc[MyInt], y): bool = int is y
13:11:19PMunchBut that seems to have broken the regular is
13:11:43PMunchhttp://ix.io/1qrK
13:15:27*dom96_w joined #nim
13:23:47*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:25:46*dom96_w joined #nim
13:33:02FromDiscord_<Shield> i'd like some pointers about heap and stack, strings, sequences and objects are allocated on the heap and everything else on the stack right?
13:33:17PMunchWell
13:33:26PMunchSomething like that
13:33:40Araqref/closure/string/seq is heap, rest is stack
13:33:49PMunchI'm actually in the process of writing a deep-dive article on Nim data structures
13:33:56Araqif we're hand-wavy about it
13:34:14Araqstrictly speaking 'ref' is on the stack as everything else but points to the GC'ed heap
13:35:55FromDiscord_<Shield> an article on it would be really great, especially on objects with different field types
13:36:51PMunchShield, yeah that's part of it. In the mean time you might find this helpful: https://www.reddit.com/r/nim/comments/7dm3le/tutorial_for_types_having_a_hard_time/
13:38:08*kapil____ joined #nim
13:38:29*vlad1777d joined #nim
13:39:39FromDiscord_<Shield> thanks!
13:43:15FromGitter<narimiran> PMunch: re deep-dive article: please put in some notes that when you publish that, we should close https://github.com/nim-lang/Nim/issues/2739
13:47:26*elrood joined #nim
13:49:53PMunchOh yeah, I've seen that
13:50:03PMunchWas planning on posting there once it's released
13:50:14PMunchJust have to find time for all this..
13:53:03FromGitter<alehander42> btw which gc is recommended
13:53:09FromGitter<alehander42> for os:standalone ? gc:none ?
13:53:21*david1 quit (Quit: WeeChat 1.9.1)
13:53:21*deathpoison quit (Remote host closed the connection)
13:57:14FromGitter<alehander42> Araq, is rdLoc still useful? it seems mapped to a.res always, the other logic is in `false`
14:01:23PMunchFound a serviceable workaround to my issue: https://github.com/nim-lang/Nim/issues/9566
14:02:04PMunchSimply declare a new type as a distinct JsonNodeObj and make my wanted type a ref to that type.
14:02:50PMunchNot sure what the wanted behavior of "is" and "distinct ref" would be, but I'm pretty sure it's not a C compiler error :P
14:12:15FromGitter<tim-st> should the call syntax work? `var x = e.parseEnumX ()`
14:27:38Araq<alehander42> probably not
14:28:36FromGitter<GULPF> you can use `e.parseEnum:X ()` instead
14:29:34FromGitter<GULPF> see https://github.com/nim-lang/Nim/issues/3502
14:34:17FromGitter<alehander42> wow, I got so far back in the git history of jsgen, I saw ecmasgen.pas
14:42:59FromGitter<tim-st> @GULPF thanks
14:45:59*platoff quit (Read error: Connection reset by peer)
14:47:25FromDiscord_<🐍 Aareon 🐳> Are Nim's `cstring`s equivalent to C's `wchar_t`?
14:48:18FromDiscord_<🐍 Aareon 🐳> nvm, found my answer https://nim-lang.org/docs/manual.html#types-cstring-type
14:58:17*leorize joined #nim
15:08:09*vlad1777d quit (Ping timeout: 252 seconds)
15:08:50*Vladar quit (Remote host closed the connection)
15:17:14copygirlPMunch: Mhh okay I understand in theory but I don't know what that would look like.
15:24:49PMunchWell it depends a bit on the specific use case
15:25:55PMunchBut the gist of it is that you want your initial macro to just pre-process the input into something that can be passed to a macro that takes typed input. Then output a call to that macro along with the new input
15:26:59FromGitter<alehander42> nice idiom
15:33:04copygirlAhh makes sense.
15:33:10copygirlSo 2 macros, generally?
15:37:46FromDiscord_<Shield> isOnHeap is really handy but tlRegion need to be exposed
15:37:51*elrood quit (Quit: Leaving)
15:38:44FromGitter<Clyybber> Araq https://github.com/nim-lang/Nim/pull/9568 's tests are green
15:44:14Araqty
15:50:43PMunchcopygirl, yes.
15:51:19PMunch2 or more, depending on what you are trying to do
15:52:14*glassofethanol joined #nim
15:57:52*Vladar joined #nim
16:00:54glassofethanolBonjour
16:02:19FromDiscord_<🐍 Aareon 🐳> Aloha
16:02:41glassofethanolOh neat, so I'm on IRC and it shows gitter, and discord here too. Neat
16:04:21PMunchYup, and they can see what you write
16:04:32glassofethanolAh that's quite cool. Fair play!
16:05:50*glassofethanol left #nim (#nim)
16:07:03*narimiran joined #nim
16:10:34*rokups joined #nim
16:12:39copygirlPMunch: Mind me asking another question? How would you pass a block from one macro through to another?
16:13:02copygirlI'm generating code using quote like so: `result.add quote do: matchBranch(`either`, `ident`, `expectedType`, `expectedType`, `branchContent`)`
16:13:45copygirlWhere branchContent is a NimNode that's part of the passed-in untyped block.
16:14:08copygirlI tried it in a couple of ways like playing it into quote do as well, etc, ..
16:15:02FromGitter<alehander42> can't you ⏎ matchBranch(..): ⏎ ``branchContent``
16:15:50copygirlThat's what I tried.
16:16:05copygirlI get illformed AST error though.
16:17:07leorizeyou can use `getAst` to retrieve the ast generated by an another macro
16:18:22FromGitter<alehander42> copygirl: do you have a repr example
16:18:25FromGitter<alehander42> reproducable
16:18:25FromGitter<alehander42> *
16:18:52FromGitter<recloser> matchBranch(...): `branchContent`
16:19:29PMunchcopygirl, easiest way is to do it like this: http://ix.io/1qsI/Nim
16:20:50copygirlMhh that's sooorta what I'm doing.
16:21:07copygirlWhat's a good way to debug illformed AST?
16:21:22krux02print it
16:21:37krux02with repr
16:21:49*Trustable joined #nim
16:22:29copygirlI guess it might just be.. a problem because I'm trying to use it in a case statement..
16:22:40krux02when it looks good, but nim doesn't like it reparse the repr it and print it with treeRepr and see the difference of what you are generating and how a parsable ast is generated
16:23:24PMunchcopygirl, you might have to wrap it in a dummy case statement
16:23:26*PMunch quit (Quit: Leaving)
16:24:53FromGitter<recloser> isn't all that you want to do in that matchBranch macro is bind the ident to the extracted value from the either?
16:25:22copygirlThe ident is not the problem, it's the expectedType.
16:25:41copygirlThat I get as an ident but I need the symbol to compare it with the Either's types.
16:26:54FromGitter<recloser> of lookupIndex(`either`, `someType`): let `ident` = getValueAt(`either`, lookupIndex(`either`, `someType`))
16:27:12copygirlYeah I was thinking of that but that seemed wrong :/
16:27:31FromGitter<recloser> wrong how?
16:27:40copygirlDRY I guess.
16:27:56copygirlI feel like there should be a better way.
16:28:28FromGitter<recloser> well, you can't assign the result of that 1st lookup index and pass it further
16:29:07*copygirl nods.
16:29:07*darithorn joined #nim
16:29:54*Xe quit (Ping timeout: 264 seconds)
16:32:19FromGitter<alehander42> Araq, jsgen is huge :D I just realized it's even bigger than cgen
16:32:34Araqit's not.
16:32:36FromGitter<alehander42> but maybe that's because of cgendata/etc modules
16:32:50Araqcgen is much bigger, but split up into more files
16:34:49FromGitter<alehander42> there are still some php-related procs
16:35:01FromGitter<alehander42> should I remove them?
16:35:29*leorize quit (Quit: WeeChat 2.0.1)
16:37:38Araqyeah
16:38:57*Xe joined #nim
16:50:50*nsf quit (Quit: WeeChat 2.2)
16:55:56FromGitter<tim-st> when I have `seq[string]` how would I pass that to a json JObject field?
16:56:22*leorize joined #nim
16:56:37FromGitter<tim-st> iterating and for each add?
16:58:07Araqseems a JArray would be a better fit
16:58:30FromGitter<tim-st> yes, the field is a JArray
16:59:34FromGitter<tim-st> I hoped that auto translates when I write `node["key"] = @["a", "b"]`
17:01:19Araqnode["key"] = %* @["a", "b"]
17:01:29FromGitter<tim-st> nice, thanks
17:01:42Araqnode["key"] = %*["a", "b"] # or maybe this
17:02:02*wildlander joined #nim
17:02:07FromGitter<tim-st> yes, it works, thanks
17:02:54*petersjt014[m] quit (Ping timeout: 264 seconds)
17:03:45*nc-x joined #nim
17:03:49nc-xAraq: You there?
17:04:18*njha is now known as fyber
17:04:32*petersjt014[m] joined #nim
17:04:48Araqnc-x, yeah
17:05:09nc-xBased on your comment here - https://github.com/nim-lang/Nim/pull/9226#issuecomment-428181268, I added `cppDefine = "..."` to nim.cfg. It works fine for https://github.com/nim-lang/Nim/issues/6836. But fails for https://github.com/nim-lang/Nim/issues/6282. Bug?
17:05:49*theelous3_ joined #nim
17:06:36*floppydh quit (Quit: WeeChat 2.3)
17:06:41FromGitter<alehander42> Araq, I'll convert unaryExpr / binaryExpr to templates taking blocks instead of formatting expr-s, but I wonder what to do about jsOps
17:08:11FromGitter<alehander42> it seems I can just replace the last columns with some hint if it's a call or an infix and the name/operator
17:08:14FromGitter<tim-st> the typeclass `seq` works as proc parameter, but `set` doesnt work, should `set` work too?
17:09:15FromGitter<tim-st> solved this by adding generic `[E: enum]`
17:10:40*nc-x quit (Quit: Page closed)
17:12:02Araqnc-x seems like a bug, yes
17:17:25FromGitter<alehander42> not general enough
17:20:42FromGitter<alehander42> I can instead generate a magic op handler with a macro, no other simple solution
17:24:11theelous3is there an ordinal type for params?
17:24:14*nc-x joined #nim
17:24:37nc-xAraq: Okay. I opened an issue https://github.com/nim-lang/Nim/issues/9575
17:25:36*zachk joined #nim
17:25:54*zachk quit (Changing host)
17:25:55*zachk joined #nim
17:29:03*nc-x quit (Client Quit)
17:35:21FromGitter<tim-st> theelous3: `SomeOrdinal` ?
17:35:48FromGitter<tim-st> theelous3: `SomeOrdinal`
17:37:15*kapil____ quit (Quit: Connection closed for inactivity)
17:41:43*krux02 quit (Remote host closed the connection)
17:46:25*d10n-work joined #nim
17:48:27FromGitter<xmonader> Why would rst parser /generator depend on os module ?
17:48:59FromGitter<xmonader> I'm trying to tinker with karax a bit to create Rst previewer
17:49:46leorizexmonader: http://nim-lang.github.io/Nim/rst.html#defaultFindFile%2Cstring
17:51:30FromGitter<xmonader> i think i should surround that with when defined js or something
17:52:20leorizewell, `rstParse` also depends on it...
17:54:11FromGitter<alehander42> it seems parseDoc doesn't really need os
17:55:34FromGitter<alehander42> but nah
17:55:41FromGitter<alehander42> it needs findFile for `file` extension or smth
17:55:43FromGitter<xmonader> there're more @leorize writeLines, splitFile and more
17:56:16FromGitter<alehander42> it can be refactored in a way that doesn't require file handling and raising exception for `file` rst in this case
17:56:26FromGitter<alehander42> doesn't require optionally*
17:57:00FromGitter<alehander42> depending on e.g. a compile time defined value
17:57:02FromGitter<alehander42> but it's some work
17:58:13FromGitter<xmonader> @alehander42 i'll report an issue for now
17:58:27FromGitter<xmonader> but i'm really in favor of pure code as much as possible
17:58:44FromGitter<alehander42> of course, me too
17:59:04FromGitter<alehander42> but here there is a reason for at least optional dependency on file handling
17:59:30FromGitter<alehander42> it just has to be optional on compile time
18:01:38FromGitter<xmonader> I guess nimdoc was the only use case in mind for it maybe
18:03:20FromGitter<alehander42> @xmonader of course temporarily you can also easily wrap a js rst parser
18:03:42FromGitter<alehander42> interop with js libs is very easy usually
18:04:10FromGitter<xmonader> @alehander42 that would be very cool thanks
18:10:35*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:11:12*platoff joined #nim
18:14:06Araqnah, please improve Nim's RST parser
18:14:16AraqI'm tired of wrappers :P
18:21:07*theelous3_ quit (Ping timeout: 240 seconds)
18:21:34FromGitter<alehander42> well for the js backend a wrapper can something simple like ⏎ var rstLib = require("rst") ⏎ var node = rstLib.parse(text)
18:22:51FromGitter<alehander42> but of course, pure nim is always better
18:24:07FromGitter<alehander42> Araq, I am refactoring the magic jsOp-s with a macro resulting in this ⏎ https://gist.github.com/alehander42/cccdf82cca31cdb4c5322723d71b56b6 ⏎ it's the closest thing I could do to the current array-based code
18:24:23FromGitter<alehander42> but if it seems weird, tell me, before I lose time rewriting them all
18:29:04*mech422__ joined #nim
18:29:38Araqlooks ok to me
18:32:07*mech422_ quit (Ping timeout: 240 seconds)
18:34:55FromGitter<iffy> Not sure if this is an opengl module, OpenGL library or macOS question. I've made an NSOpenGLView inside an NSWindow and am trying to call some gl functions (glClearColor and glClear in particular). If I call those functions inside my {.emit .}ed obj-c code, they work. But if I call those functions in a nim proc (that is called by obj-c code) I get an Illegal storage access error. Anyone with experience can help me
18:34:55FromGitter... debug what's going on?
18:38:14*narimiran quit (Remote host closed the connection)
18:39:16FromGitter<iffy> I'm guessing the proc-version gl functions don't have the context set? Maybe?
18:43:04FromGitter<iffy> afk, but I'll be back
18:43:17Araq use loadExtensions()
18:50:16*dorei joined #nim
18:51:40*platoff quit (Ping timeout: 250 seconds)
19:01:48FromGitter<tim-st> are Options complete based on Exceptions?
19:03:17FromGitter<tim-st> (is a try catch around get always needed?)
19:03:42FromGitter<tim-st> ah, I saw, there is a default one, nice
19:03:45Araqnot at all, Option is different from exceptions
19:10:01*rokups quit (Quit: Connection closed for inactivity)
19:19:27*theelous3_ joined #nim
19:20:53FromGitter<zurs> Hi everyone, I'm seeing some trouble with nimsuggest. I can't seem to figure out why it crashes in vscode. I checked the developer tools and there is just a lot of error messages
19:21:07FromGitter<zurs> (https://files.gitter.im/nim-lang/Nim/cp3a/nimsuggets_crash.png)
19:21:36FromGitter<zurs> These messages is repeated a lot
19:22:48FromGitter<zurs> Anyone who had a similar issue and solved it?
19:27:34*elrood joined #nim
19:28:39*nsf joined #nim
19:34:38FromGitter<zacharycarter> I *think* nimsuggest occasionally leaks
19:34:49FromGitter<zacharycarter> not sure about those error messages though
19:37:30FromGitter<zurs> Yeah, I guess that would explain why it works sometimes and doesn't other times. But today it didn't want to work at all 😟
19:39:13*Trustable quit (Remote host closed the connection)
19:49:56theelous3if I get a depreciation warning, how can I go about looking up what the new thing to do is/
19:49:56theelous3?
19:50:27theelous3deprecation*
19:51:33theelous3oh nvm, release notes for 018 shows ..> over .. > and pred for others
20:02:13*stefanos82 quit (Quit: Quitting for now...)
20:08:46Araqzurs: paste your nimsuggest.log please
20:08:58*nsf quit (Quit: WeeChat 2.2)
20:09:01Araqto be found in your $HOME iirc (bad style, I know I know)
20:15:18FromGitter<iffy> Araq: I could have sworn `loadExtensions()` failed before... I even got the same error as https://github.com/nim-lang/opengl/issues/39 Thank you, it works now!
20:23:13Araqit fails if you don't use an extension but is required once you use one
20:23:34*Vladar quit (Remote host closed the connection)
20:23:38Araqit's hard to improve the error message for this and OpenGL is a clusterfuck of terrible badness
20:24:25*Guest joined #nim
20:24:25FromGitter<zurs> @araq, if I just drop the file in here. Will it become a file or totally blow up the chat. It's about 800kb so don't want to risk anything
20:24:55FromGitter<Varriount> Please post large code snippets in gist or something
20:26:13*Guest is now known as Aareon
20:26:27*poopBot quit (Remote host closed the connection)
20:26:42FromGitter<zurs> Of course! Thank you, totally forgot about gist
20:26:54FromGitter<zurs> https://gist.github.com/zurs/708eee71fcfd8f0830042245a3a85d96
20:28:48*Aareon quit (Client Quit)
20:28:55*Aareon joined #nim
20:29:58*endragor joined #nim
20:30:09Araqsorry the log doesn't contain anything that helps me
20:31:13*kapil____ joined #nim
20:31:44FromGitter<zurs> Okay, thanks anyway. Btw it just started working flawlessly now, I think it is because of jester actually
20:33:56Araqsockets get in nimsuggest's way
20:34:16*endragor quit (Ping timeout: 244 seconds)
20:36:56*voice_ftp joined #nim
20:38:55*voiceftp quit (Ping timeout: 244 seconds)
20:42:39*voice_ftp quit (Remote host closed the connection)
20:49:32*voice_ftp joined #nim
20:53:47*voice_ftp quit (Ping timeout: 240 seconds)
20:58:09*voiceftp joined #nim
20:58:12FromGitter<kayabaNerve> Sockets can be a pain
20:58:20FromGitter<kayabaNerve> I'm glad Nim offers a pleasant interface
20:58:22FromGitter<kayabaNerve> And async
20:58:26FromGitter<kayabaNerve> It's awesome
21:00:24Araqasync can also be sped up quite a bit. I hope my moving GC works out for it
21:00:47Araqseems the perfect algorithm for this usecase
21:02:20FromGitter<kayabaNerve> I have a decent amount of async code
21:03:11FromGitter<kayabaNerve> I also have a decent amount of event based programmingg
21:04:12*platoff joined #nim
21:04:14*platoff quit (Client Quit)
21:04:17*elrood quit (Remote host closed the connection)
21:06:22FromDiscord_<treeform> I am using the {.async.} stuff. How I would spawn or diverge the execution?
21:07:07FromDiscord_<treeform> some thing like setTimeout in js? but you know with {.async.} stuff.
21:07:15FromDiscord_<treeform> or go in golang
21:07:48FromDiscord_<treeform> callSoon is kind of similar but it takes a non {.async.} proc ?
21:09:14FromDiscord_<treeform> it looks like asynchttpserver uses https://github.com/nim-lang/Nim/blob/master/lib/pure/asynchttpserver.nim#L309
21:09:24FromDiscord_<treeform> `asyncCheck` for this?
21:10:52FromGitter<kayabaNerve> treeform: When you run await, it will allow other async code to execute.
21:11:29FromGitter<kayabaNerve> If you have an async proc that never calls await, it will not allow other async code to execute.
21:11:45FromGitter<kayabaNerve> You'll need to do await sleepAsync (or asyncSleep? I always forget)
21:11:52FromGitter<kayabaNerve> If you want a timeout, use callSoon
21:12:04FromGitter<kayabaNerve> asyncCheck is calling an async proc safely from a sync proc
21:13:15Araqtreeform: check out how "httpbeast" does it
21:13:30Araqthreading with async is tricky, but possible
21:14:28FromDiscord_<treeform> I think asyncCheck does want I want
21:14:31FromDiscord_<treeform> sorry!
21:14:45FromDiscord_<treeform> I just wanted to split my async "executions"?
21:15:38FromGitter<alehander42> Araq, what is the most probable reason for os:standalone to hit missing genericAssign
21:16:14FromGitter<alehander42> use of ref objects ? or some kind of sequence? I tried to keep everything in objects with primitive fields
21:19:51FromGitter<alehander42> ha, arrays
21:21:49*narimiran joined #nim
21:22:31*platoff joined #nim
21:22:31*platoff quit (Client Quit)
21:22:44narimiranAraq: does your latest docgen fix also close https://github.com/nim-lang/Nim/issues/9432 ?
21:22:52*platoff joined #nim
21:28:12*theelous3_ quit (Ping timeout: 252 seconds)
21:33:53Araqnarimiran, probably but I'm still going through these issues
21:38:19FromGitter<alehander42> how can I provide copyString
21:39:25AraqI'm not sure, in general --os:standalone is poor and the GC can work within the kernel (untested, but it doesn't contain anything critical)
21:40:00Araqyou can fake a heap with a large statically allocated C array of bytes
21:40:42Araqthe people claiming "my device doesn't have a heap" are lacking some creativity
21:41:12FromGitter<alehander42> oh yeah, that's my plan for malloc/free for now
21:41:49Araqread the bottom of system/osalloc.nim
21:43:22Araqof course you don't really want to *depend* on these things eventually, but there is no reason to avoid them for development and debugging
21:48:00FromGitter<alehander42> ah I am stupid I didn't pass the args I want actually to the nim compiler
21:48:28FromGitter<alehander42> yeah, this seems kinda reasonable
21:49:17Araq--os:standalone is not the same as --gc:none
21:49:41Araqin theory --os:standalone is the "I'd like to develop my own OS" switch
21:49:49Araqgc:none is not required and harmful.
21:49:59Araqin practice this needs to be covered by a good test :P
21:57:55FromGitter<alehander42> yeah, my plan was to just somehow provide very basic memory primitives for now and just hope that a gc can do its job for some time
21:59:06FromGitter<timotheecour> @narimiran @araq ⏎ ⏎ > does your latest docgen fix also close nim-lang/Nim#9432 ? ⏎ ⏎ No, I just checked; it doesn’t: still shows `"is greater" operator. This is the same as y < x.` for `proc isValidT (x: T): bool` [https://gitter.im/nim-lang/Nim?at=5bd8d4295760a73eb412832a]
22:02:15AraqI doubt it
22:04:35FromGitter<timotheecour> I’m actually curous about your recent commit, because #9169 seemed already fixed, so I’m not sure what https://github.com/nim-lang/Nim/commit/eb03684c57089fa33c3add694841a8f7f3ad8a72 fixed; the remaining issue is #9432
22:07:17Araqit fixed nre's docs
22:08:16Araqhmm I need 3 monitors...
22:08:58FromGitter<timotheecour> oh, I see, just saw https://github.com/nim-lang/Nim/issues/7527#issuecomment-434483354 ; that explains the backport commit
22:09:56AraqI already updated contributing.rst with this too
22:09:58FromGitter<timotheecour> (but still, my comment is valid, the remaining issue that isn’t fixed is #9432 )
22:10:55Araqwill look at it later, I'm fixing #9235
22:11:03FromGitter<timotheecour> very glad you changed your mind on that btw
22:12:26*narimiran quit (Ping timeout: 244 seconds)
22:12:48*wildlander quit (Quit: Konversation terminated!)
22:14:54Araqtoo many compiler refactorings I want to do that can't be handled with trunk based development
22:15:13Araqand also some nice AST changes
22:15:57FromGitter<timotheecour> exactly. trunk development prevents ever cleaning up code, leading to bad design decisions kept forever. that was always my main argument.
22:16:06AareonAST changes :o
22:17:50AareonIs there no way to do https://github.com/nim-lang/Nim/commit/eb03684c57089fa33c3add694841a8f7f3ad8a72 without recursing like this?
22:18:41AareonNvm
22:18:44AareonIgnore me
22:18:49Araqyou can probably hide the recursion in a DSL but I'm too good at recursions
22:20:36AareonWrap it in a loop?
22:21:02Araqif you like explicit stacks, sure
22:23:53AareonTrue. Too much to track w/o recursing
22:24:29AareonRather it just work than to hack it forever
22:35:11Araqgah #9432 is super nasty
22:35:55FromGitter<alehander42> Araq, so what I don't get about standalone is, isn't it easier to just use the normal setup and override alloc primitives, hoping that this would be sufficient for using seq-s / strings for the beginning
22:37:15Araqmyabe
22:38:43Araqhmm seems impossible to make #9235 and #9432 work at the same time
22:39:37FromGitter<alehander42> because otherwise I just hit other missing builtins like copyString / genericSeqAssign etc (which I am not even sure where are defined)
22:45:14*Aareon quit (Ping timeout: 250 seconds)
22:47:32*darithorn quit ()
22:57:41Araqit's super easy to grep for these
22:58:33Araqbut as I said, fix system.nim, os:standalone is NOT gc:none
22:58:55Araqand the GC only needs memory for its operation, no IO subsystem
23:00:15*kapil____ quit (Quit: Connection closed for inactivity)
23:06:52*Aareon joined #nim
23:07:52AareonLittle weird that I find the old Pascal lexer easier to read. Maybe I dont know Nim well enough. Wish the Nim lexer had more docs
23:09:17Araqdunno what to document, it's a lexer, it runs over the input chars
23:09:25ldleworkheh
23:10:06AraqI often feel like you all want me to document the raw basics of compiler development.
23:10:10*Aareon_ joined #nim
23:10:19Araqthere are books for that, you know.
23:11:00AareonLol perhaps its just my lack of knowledge in Nim. Lexers are dead simple. Just Nim is a whole new beast
23:11:25*Aareon quit (Client Quit)
23:11:33*Aareon_ is now known as Aareon
23:11:56Araqfair enough
23:12:15shashlickAraq: saw your comment on trunk based dev
23:12:29shashlickHappy to help baby sit stable
23:13:12Araqmy secret plan is to make the 0.19 line v1 and keep much good stuff for v2
23:13:36Araqif we backport fixes to 0.19 than it's good enough for a v1
23:14:45shashlickI agree
23:15:01shashlickWith branch model, you can start with 1.0 right away
23:23:57Araqgreat, we have nightly builds already
23:24:18Araqbut I'll push my v19.2 branch tomorrow
23:24:25Araqgood night
23:25:03FromGitter<timotheecour> i feel like v1 is just psychological / marketing (that some ppl care about for adoption); so long we’re still allowing breaking changes for the better (eg for a v2 that is under active development now, not in 10 years), releasing a v1 is ok. But if v1 means stopping necessary breaking changes, that’s not good.
23:25:46FromGitter<timotheecour> putting nimdoc/testproject/expected/testproject.html in a test file is too rigid, I hope it’s temporary; this will lead to overly rigid doc gen
23:26:31AraqI don't use any language aside from Nim that is not v2 or later
23:27:15AraqI don't understand this obsession with v1 either, for me it's vaporware as long as v2 is not out :-/
23:28:30Araqoh well, version 1 means we backport bugfixes, it's a good definition
23:28:51FromGitter<timotheecour> ya so awesome that u fixed #9432; it’s just that the test needs to be less rigid (eg grepping for absence/presence of certain doc strings should be preferred)
23:29:32Araqwell it's rigid but I don't have any better ideas
23:32:33doreiI think nim is the future :) until v1 everything seems like a risky investment with unclear future expectations
23:35:34*d10n-work quit (Quit: Connection closed for inactivity)
23:37:14*platoff quit (Ping timeout: 250 seconds)
23:45:57*theelous3 quit (Ping timeout: 244 seconds)
23:56:01FromDiscord_<Shield> it's less about bugfixes and more about "it's been a decade and it's still not v1 yet?"
23:56:32FromDiscord_<Shield> i'd like to ask what kind of breaking changes are we expecting
23:59:57*vlad1777d joined #nim