00:00:01 | FromGitter | <recloser> ah, i didn't realise you were looking up the index like that |
00:01:28 | FromGitter | <recloser> of lookupIndex(match, someType): ... |
00:01:50 | FromGitter | <recloser> whee lookupIndex is a macro that takes two typed args |
00:02:17 | copygirl | That would kind of defeat the purpose of using a macro that is clean in use. |
00:02:32 | FromGitter | <recloser> you'd rewrite each `of someType` branch in your match macro |
00:02:51 | copygirl | Oooh. Hm.. |
00:02:53 | FromGitter | <recloser> `of someType` -> `of lookupIndex(value, someType)` |
00:03:24 | FromGitter | <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:24 | copygirl | Argh |
00:10:51 | copygirl | Well I'm going to need the index in the of branch's statements. |
00:12:47 | FromGitter | <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:55 | FromGitter | <kayabaNerve> We have `..<` but not `<..` :thinking: |
02:08:11 | FromGitter | <kayabaNerve> I guess it's just an usage thing? |
02:08:29 | FromGitter | <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:18 | FromGitter | <kaushalmodi> @zacharycarter I finally got that Nim code to JS; the one with import |
02:42:02 | FromGitter | <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:20 | FromGitter | <kaushalmodi> and finally it started working once I used require: https://ptpb.pw/Cwme/nim |
02:42:33 | FromGitter | <kaushalmodi> thanks to https://stackoverflow.com/questions/39436322/node-js-syntaxerror-unexpected-token-import |
02:49:45 | FromGitter | <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:06 | FromGitter | <rayman22201> though Babel is really commonly used in the JS world |
02:51:32 | FromGitter | <kaushalmodi> @rayman22201 may be the Netlify server is using an old NodeJS version? |
02:51:49 | FromGitter | <kaushalmodi> I have no idea if that error is issued by the browser or nodejs on server |
02:51:56 | FromGitter | <rayman22201> Ahhh! yes. You said browser so I was confused |
02:52:06 | FromGitter | <rayman22201> Node is behind the curve here |
02:52:11 | FromGitter | <kaushalmodi> but I wasted an embarrassing amount of time on this |
02:52:16 | FromGitter | <rayman22201> If it's a lambda function then it is Node not browsers |
02:52:28 | FromGitter | <kaushalmodi> I wish the examples I am trying to translate avoided this complication |
02:52:58 | FromGitter | <rayman22201> It is an unfortunate side effect of the fragmentation in the JS ecosystem. |
02:53:28 | FromGitter | <kaushalmodi> using `const foo = require("foo");` worked the same as the original `import foo from "foo";` in their example |
02:54:14 | FromGitter | <rayman22201> it's worse than the GCC vs. Clang vs. VSStudio C++ standard wars.... :-/ |
02:54:43 | FromGitter | <kaushalmodi> hmm (glad I never got into learning JS :P) |
02:54:47 | FromGitter | <rayman22201> lol |
02:54:55 | FromGitter | <kaushalmodi> so.. now one last example left to translate in https://github.com/netlify/netlify-functions-example/tree/master/src/lambda |
02:55:11 | FromGitter | <kaushalmodi> .. hello_fetch.js (I am ignoring the hello_slack.js in there) |
02:55:56 | FromGitter | <kaushalmodi> Nim translations of above JS funcs: https://github.com/kaushalmodi/nim-netlify-functions/tree/master/src/lambda |
02:56:32 | FromGitter | <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:58 | FromGitter | <rayman22201> *Old man shakes stick at cloud rant* :-P |
02:57:06 | FromGitter | <kaushalmodi> :) |
02:58:01 | FromGitter | <rayman22201> fetch should be easy at this point right? lol |
02:58:16 | FromGitter | <kaushalmodi> umm, no :P |
02:58:38 | * | endragor joined #nim |
02:58:41 | FromGitter | <kaushalmodi> it seems to be *fetched* from something in packages.json (and I am trying to make those examples yarn-free) |
02:58:49 | FromGitter | <kaushalmodi> looks like I will give up on that too |
02:59:20 | FromGitter | <rayman22201> https://www.npmjs.com/package/node-fetch |
02:59:23 | FromGitter | <rayman22201> it's this thing |
03:00:03 | FromGitter | <kaushalmodi> so can I just download a JS for that and put it somewhere in my assets dir or something like that |
03:00:46 | FromGitter | <rayman22201> somewhere where node can find it. yeah |
03:01:13 | FromGitter | <rayman22201> or just use the built in http. *my preferred way* |
03:01:15 | FromGitter | <kaushalmodi> but doesn't look that simple |
03:01:56 | FromGitter | <rayman22201> built in http client I mean |
03:02:14 | FromGitter | <kaushalmodi> yes, I think I can do that |
03:02:27 | FromGitter | <kaushalmodi> though the return type in that JS example looks weird |
03:02:39 | FromGitter | <kaushalmodi> `.then`, `.catch` .. |
03:02:57 | FromGitter | <rayman22201> https://nodejs.org/api/https.html#https_https_get_url_options_callback |
03:03:03 | FromGitter | <kaushalmodi> seems like some try-catch syntax built into a return type |
03:03:23 | FromGitter | <rayman22201> that function returns the JS flavor of a future |
03:03:42 | FromGitter | <rayman22201> it's an async function |
03:03:53 | FromGitter | <kaushalmodi> might be just better to not do a literal translation of that JS example |
03:04:05 | FromGitter | <kaushalmodi> .. and just do it Nim way, I guess |
03:04:46 | FromGitter | <rayman22201> I think so. |
03:05:10 | * | banc quit (Quit: ZNC - http://znc.in) |
03:06:47 | FromGitter | <kaushalmodi> I might need your help in may be one thing in that example |
03:06:55 | FromGitter | <kaushalmodi> what are the two .then's doing? |
03:07:00 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bd7cad33844923661bc5f8d] |
03:07:14 | ldlework | hi kausalmodi |
03:07:17 | FromGitter | <rayman22201> It's dangerous to go alone, take this :-P https://nim-lang.org/docs/asyncjs.html |
03:07:19 | FromGitter | <kaushalmodi> where is the "response" in first then getting used? |
03:07:21 | ldlework | kaushalmodi* |
03:07:29 | FromGitter | <kaushalmodi> ldlework: hello |
03:07:41 | FromGitter | <kaushalmodi> yes, I am using async |
03:07:48 | FromGitter | <rayman22201> each .then returns a new "future" object, that wraps the previous ones. (In JS this is called a promise) |
03:07:52 | ldlework | you added that export_hugo_section* to ox-hugo a bit ago based on an issue i opened |
03:07:57 | ldlework | thanks |
03:08:34 | FromGitter | <kaushalmodi> @rayman22201 thanks, I now have something to google by |
03:08:54 | FromGitter | <rayman22201> That example is called a promise chain |
03:09:03 | FromGitter | <kaushalmodi> ldlework: you are welcome; though not sure how helpful you would find that; I cannot implement 100% of what you suggested |
03:09:36 | FromGitter | <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:15 | FromGitter | <rayman22201> It's actually the mechanism that await/async is built on top of, but exposed to the end user |
03:10:16 | FromGitter | <kaushalmodi> but the return type has status code, body, etc. (which I thought *is* the response) |
03:10:17 | ldlework | kaushalmodi, 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:50 | FromGitter | <rayman22201> but notice on line 6, the async keyword. that means a a future of that type is returned |
03:11:25 | FromGitter | <kaushalmodi> so what is that extra "response"? I think I will try to get "something" working first |
03:11:50 | FromGitter | <kaushalmodi> @rayman22201 I kind of understood the js async in this example that I worked on: https://ptpb.pw/bkz3/nim |
03:12:07 | FromGitter | <rayman22201> The extra "response" on line 8? that is the response from the random joke website. |
03:13:13 | FromGitter | <kaushalmodi> .. and the body of that "response" has "setup" and "punchline" fields somewhere in the received JSON? |
03:13:26 | FromGitter | <rayman22201> correct |
03:14:16 | FromGitter | <kaushalmodi> thanks, now that I understand the logic, it should be easier to do that in Nim |
03:14:45 | FromGitter | <kaushalmodi> I have used http client, but not with js async, so we'll see |
03:15:04 | FromGitter | <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:22 | FromGitter | <kaushalmodi> Thanks! |
03:15:36 | FromGitter | <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:52 | FromGitter | <rayman22201> you are going to have to use the Nodejs http client through the jsffi |
03:20:37 | * | banc joined #nim |
03:21:49 | FromGitter | <kaushalmodi> oh; I was here: https://ptpb.pw/4B_T/nim |
03:22:05 | FromGitter | <kaushalmodi> I was thinking of first getting it working locally and "just compile using js" |
03:22:12 | FromGitter | <kaushalmodi> hehe |
03:23:02 | FromGitter | <kaushalmodi> "you are going to have to use the Nodejs http client through the jsffi" <-- that puts a wrench in my plan |
03:24:27 | FromGitter | <rayman22201> Sorry. lol :-( |
03:24:55 | FromGitter | <kaushalmodi> I will put this off for a rainy day |
03:25:15 | FromGitter | <kaushalmodi> I think my goal to have basic examples of using Nim for lambda functions is met |
03:25:19 | FromGitter | <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:24 | FromGitter | <kaushalmodi> while working on this, I wished the "js" backend did some auto translations |
03:26:32 | FromGitter | <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:32 | FromGitter | <kaushalmodi> like a plain `echo` to `console.log` |
03:26:59 | FromGitter | <kaushalmodi> .. yeah and esp. that I don't know JS |
03:28:24 | FromGitter | <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:30 | FromGitter | <rayman22201> more rainy day thoughts :-P |
03:29:13 | FromGitter | <rayman22201> Well, you know a lot more about JS now than you used to! |
03:29:29 | FromGitter | <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:53 | FromGitter | <gogolxdong> Does nimgen compile cpp? |
04:23:20 | FromGitter | <rayman22201> yes |
04:31:16 | * | chemist69 quit (Ping timeout: 264 seconds) |
04:32:41 | FromGitter | <gogolxdong> but failed. |
04:32:41 | * | chemist69 joined #nim |
04:33:30 | FromGitter | <gogolxdong> ```[n.global] ⏎ cpp_compiler="clang" ⏎ ⏎ [main.cpp] ⏎ preprocess = true``` [https://gitter.im/nim-lang/Nim?at=5bd7df1a435c2a518e27eee7] |
04:34:53 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bd7df6c82893a2f3b600d69] |
04:39:20 | FromGitter | <rayman22201> idk, but the first problem I see is that it is not using clang. it is using mingw. |
04:40:50 | FromDiscord_ | <🐍 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:26 | FromGitter | <rayman22201> but it should not be doing that if he set `cpp_compiler="clang"` |
04:42:23 | FromGitter | <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:39 | shashlick | @rayman22201: if its just file mangling needed, you could use nimgen still |
04:42:46 | shashlick | as long as there's no js2nim requirement |
04:43:08 | shashlick | in fact, nimgen could use any x2y backend in theory |
04:43:23 | FromGitter | <gogolxdong> shashlick , how to make this right |
04:43:41 | FromGitter | <rayman22201> @shashlick, I am confused. What is the context? |
04:44:13 | shashlick | re: Especially considering there is no "nimgen" for js 😛 |
04:44:30 | FromGitter | <rayman22201> oh!!! lol. ok. |
04:44:35 | shashlick | @gogolxdong: can you provide any details? |
04:44:37 | FromGitter | <gogolxdong> there is just a single main.cpp file. |
04:45:27 | shashlick | i've never tested with clang before |
04:45:45 | shashlick | does gcc -E still work? |
04:45:52 | shashlick | cause that's what nimgen uses for preprocessing |
04:46:47 | FromGitter | <gogolxdong> g++ or gcc is fine, question is how to compile a single cpp to nim? I though it is simple. |
04:48:35 | FromGitter | <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:17 | shashlick | if it doesn't have too much preprocessing, you might be better off using c2nim directly |
04:49:48 | shashlick | nimgen helps handle lots of #defines, etc. and if the source .cpp or generated .nim need edits |
04:50:07 | FromGitter | <gogolxdong> http://ix.io/1qq5 |
04:50:09 | shashlick | also it is about automation so that you can recreate wrappers at will |
04:51:02 | shashlick | ya I've mainly used nimgen/c2nim to make wrappers so typically just use it on header files, not source |
04:51:44 | shashlick | now that https://github.com/nim-lang/c2nim/issues/141 is fixed, you could try and see if c2nim works for you |
04:51:56 | FromGitter | <gogolxdong> stuck at std::array<float, 50> frameTimes{}; |
04:52:04 | FromGitter | <gogolxdong> Error: identifier expected, but got: { |
04:52:28 | shashlick | c2nim doesn't handle templates too well right now |
04:53:10 | shashlick | https://github.com/nim-lang/c2nim/issues/122 |
04:53:38 | shashlick | not sure if that is the same since in your case, it is in a struct |
04:54:56 | shashlick | change frameTimes{}; => frameTimes; |
04:55:25 | shashlick | not 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:28 | kobi7 | hi 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:07 | PMunch | @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:14 | PMunch | Condensed my bug from yesterday some more: http://ix.io/1qqP/Nim |
09:09:37 | PMunch | On 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:24 | PMunch | This is the diff between the two generated C files: http://ix.io/1qqR |
09:25:40 | FromGitter | <AchalaSB> How the eWASM Nim contract is deployed in browser ? What is the interpreter? https://github.com/status-im/nim-eth-contracts |
09:29:37 | PMunch | The bug is still there in the latest by the way devel |
09:31:54 | PMunch | Not quite sure what you mean AchalaSB |
09:32:32 | PMunch | That is an Ethereum smart contract, not browser based WASM (but Nim can do that too). |
09:35:52 | * | dom96_w joined #nim |
09:39:51 | PMunch | Hi 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:00 | PMunch | And if you pass -d:passTest it works |
09:40:17 | PMunch | Nim seems to confuse the distinct JsonNode for a "SomePointer" |
09:40:34 | PMunch | But 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:55 | dom96_w | PMunch: Something must be receiving your distinct type |
09:44:07 | PMunch | receiving? |
09:44:14 | dom96_w | Seems like a bug |
09:44:29 | dom96_w | Hard to say without seeing where it happens |
09:44:41 | PMunch | Yeah, but I really can't figure out what it is |
09:45:06 | PMunch | Just try to copy that and run it, should show you were in the code it fails |
09:46:07 | PMunch | http://ix.io/1qr0 |
09:46:13 | PMunch | There is an example run |
09:50:58 | * | david1 joined #nim |
09:52:35 | dom96_w | That's definitely a compiler bug |
09:52:40 | dom96_w | You should never get a C error |
09:53:24 | PMunch | Created a slightly smaller sample: http://ix.io/1qr2/Nim |
09:53:34 | PMunch | Works the same way |
09:53:56 | PMunch | I guess I should create an issue on GitHub, any idea what to call this? |
09:54:58 | PMunch | I 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:04 | FromGitter | <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:54 | PMunch | @narimiran, generally it works pretty well |
10:08:47 | FromGitter | <narimiran> PMunch: thanks, will try to use it then |
10:09:11 | PMunch | dom96_w, bug report: https://github.com/nim-lang/Nim/issues/9566 |
10:09:52 | dom96_w | narimiran: 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:23 | PMunch | @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:29 | PMunch | dom96_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:41 | PMunch | Hmm, a JsonNode is a ref JsonNodeObj |
10:12:58 | PMunch | So shouldn't an Option[JsonNode] never have the has field? |
10:13:05 | * | chemist69 joined #nim |
10:13:19 | FromGitter | <narimiran> PMunch, yeah, i remember those "hacktoberfest pull requests" :) |
10:14:37 | PMunch | Haha, that was actually coincidental. I had been putting off splitting those into different PRs for a while :P |
10:16:07 | FromDiscord_ | <Epictek> PMunch: yeah I'm here 😃 |
10:16:16 | FromGitter | <narimiran> btw, did you manage to make 5th PR? |
10:16:34 | PMunch | narimiran, yup. Even got it merged already |
10:17:00 | * | FromGitter * narimiran thumbs up |
10:17:24 | PMunch | https://github.com/nim-lang/Nim/pull/9396 |
10:17:41 | PMunch | Epictek, you asked about nimlsp after I had logged off yesterday |
10:17:54 | FromDiscord_ | <Epictek> I did indeed |
10:18:10 | PMunch | I 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:20 | FromDiscord_ | <Epictek> Ah I see |
10:18:57 | FromGitter | <alehander42> @AchalaSB maybe try the status-im / nimbus gitter |
10:19:20 | PMunch | If I can get that sorted though I think I'm good to go and start working on actually interfacing with LSP |
10:19:31 | FromDiscord_ | <Epictek> PMunch: How is your nimlsp repo related to nim-lang/langserver? |
10:19:52 | PMunch | Well, not at all really :P |
10:19:55 | FromDiscord_ | <Epictek> Will your repo merge in to that at a later date or is it a separate project? |
10:19:58 | FromDiscord_ | <Epictek> I see |
10:20:09 | PMunch | We started work about the same time, and started in completely different ends |
10:21:12 | Araq | boo, please work together. |
10:21:38 | PMunch | I started working on the JSON LSP interface, while langserver seemed to work on the internal book keeping and nimsuggest interfacing |
10:21:49 | PMunch | So 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:33 | PMunch | We 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:07 | Araq | I figured that LSP can actually help me too in improving nimsuggest if the editor strictly follows the LSP |
10:24:43 | FromGitter | <narimiran> what a difference a day made :D |
10:24:57 | FromDiscord_ | <Epictek> PMunch: fair, well it appears you are on the right track. Look forward to being able to use it |
10:26:39 | FromGitter | <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:39 | FromDiscord_ | <Epictek> Nah, we need 10 competing implementations *insert relevant xkcd here* |
10:31:59 | PMunch | https://github.com/nim-lang/Nim/issues/9566 <- think I found what causes it |
10:32:02 | Araq | there are better xkcds, like this one https://xkcd.com/538/ |
10:33:09 | Araq | or this: https://xkcd.com/936/ |
10:33:15 | PMunch | Epictek, 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:22 | PMunch | Then I'd rather implement my own idea |
10:33:34 | FromGitter | <narimiran> i cannot iterate through a tuple? (`items` is not defined for tuples?) |
10:33:39 | PMunch | What happens if both are implemented are of course another question |
10:33:41 | FromGitter | <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:04 | FromGitter | <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:13 | PMunch | @xmonader, a staticExec("git rev-parse HEAD") should be fine |
10:35:36 | FromGitter | <narimiran> nor i can do `for i in 0 ..< myTuple.len` :( |
10:35:41 | * | Vladar joined #nim |
10:35:53 | PMunch | @narimiran, yeah I don't think tuples have len defined for them do they? |
10:35:57 | Araq | narimiran: system.fields iterator |
10:36:04 | FromGitter | <xmonader> @PMunch where is that defined? https://nim-lang.org/docs/nimscript.html |
10:36:35 | FromGitter | <narimiran> as usual, Araq to the rescue! :) thanks! |
10:36:49 | PMunch | @xmonader: https://nim-lang.org/docs/system.html#staticExec%2Cstring%2Cstring%2Cstring |
10:37:15 | PMunch | Not sure if it works in nimscript though, haven't used it enough |
10:37:36 | FromGitter | <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:41 | PMunch | I was thinking just adding "const gitHash = staticExec("git rev-parse HEAD")" to the top of your file |
10:38:08 | FromGitter | <alehander42> but in the worst case, 2 impls > 0, I agree |
10:39:17 | PMunch | alehander42, 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:19 | FromGitter | <xmonader> @PMunch totally correct, i was thinking in the nimscript domain thank you |
10:39:51 | PMunch | Which I would be fine with if anyone else was working on it. But last commit was 5 months ago.. |
10:42:30 | Araq | PMunch, yeah, sometimes you need to go on on your own |
10:45:20 | PMunch | https://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:25 | PMunch | And that causes trouble |
10:45:30 | FromGitter | <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:07 | FromGitter | <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:13 | FromGitter | <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:25 | PMunch | alehander42, 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:16 | Araq | tim-st: I guess I can live with that for release building |
11:06:28 | * | fredrik92 is now known as couven92 |
11:06:33 | PMunch | I'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:58 | FromGitter | <tim-st> ok, but for windows users it would be good to have a nightly build each 2 weeks or so |
11:11:01 | FromGitter | <alehander42> @PMunch sounds good! |
11:12:18 | PMunch | As 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:06 | copygirl | I 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:57 | Araq | there are workarounds for that, copygirl, krux02 can tell you |
11:52:12 | Araq | er ... October is almost over, who am I blocking from getting the Tshirts? |
11:52:39 | Araq | or how does this work... |
11:53:14 | copygirl | I'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:27 | copygirl | I'm glad and proud I got this far in the first place. |
11:54:01 | copygirl | Now I just need to compare a type symbol with this identifier, ideally in clean way where it would respect aliases and such. |
11:54:44 | Araq | well 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:11 | FromGitter | <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:41 | FromGitter | <tim-st> `type X = enum x1 = "x.1", x2 = "x.1"` |
11:58:16 | FromGitter | <narimiran> Araq: "tshirt count" increases when you open a PR, not when it is merged |
11:58:17 | Araq | I don't know, I think it's easy enough to to $type(E) & "." & $enumValue |
11:58:29 | Araq | aha |
11:58:35 | Araq | hmmm ok |
11:58:44 | FromGitter | <narimiran> (damn, i should have been quiet, now no more merges :( :P) |
11:59:27 | FromGitter | <tim-st> If the current way is allowed then at least `parseEnum` needs a different description |
12:03:13 | Araq | sure... we need to discuss what "stdlib" means at some point |
12:03:47 | Araq | for most people it means "battle tested, best Nim code ever, covering every use case" |
12:03:47 | PMunch | Araq, 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:10 | copygirl | Btw is it a bug that you can specify an else branch in a case statement when all the cases are already covered? |
12:04:26 | PMunch | Oops, @narimiran already said that, my bad |
12:04:45 | Araq | whereas for me it always meant "easy to adapt, understandable code, covering the 80% solution most people agreed on that is worth solving" |
12:05:20 | PMunch | It should still tick the first two boxes though |
12:05:57 | PMunch | Battle tested and "best" Nim code ever. As in being easy to read, proper syntax, and uses the "right" amount of tricks. |
12:06:03 | FromGitter | <tim-st> something like a pragma `uniqueString` could solve it, does it exists already for enum? |
12:06:17 | * | platoff joined #nim |
12:06:30 | Araq | tim-st no but as you noticed you can influence its string representation |
12:06:54 | FromGitter | <tim-st> yeah, the problem is I want to make sure at compile time to not have two times the same string |
12:07:00 | Araq | which is kind of a misfeature, builtin where it could have been a macro so easily... |
12:07:19 | Araq | well enum identifiers cannot clash, Nim checks for that |
12:07:20 | copygirl | Bbl o/ |
12:07:59 | FromGitter | <tim-st> I wanted to give it a long name for the source code and a short name for repr in json |
12:08:06 | PMunch | copygirl, 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:35 | PMunch | Araq, any hints as to why a distinct ref object is not seen as a ref when doing "when SomeType is ref:"? |
12:09:54 | Araq | because 'is' doesn't look at 'distinct', it's hidden |
12:10:00 | PMunch | Aha |
12:10:07 | * | rokups quit (Quit: Connection closed for inactivity) |
12:10:12 | PMunch | So it's impossible to solve? |
12:10:24 | Araq | there is macros.skipDistinct or similar |
12:10:56 | PMunch | I'm just asking because of this: https://github.com/nim-lang/Nim/issues/9566 Makes the C compiler crash.. |
12:11:10 | PMunch | And 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:34 | FromGitter | <narimiran> why `assert not(someBool)` doesn't work? :'( |
12:52:33 | FromGitter | <narimiran> oh there is already an issue by @timotheecour: https://github.com/nim-lang/Nim/issues/8300 |
12:55:50 | FromGitter | <narimiran> heh, here is a workaround: `assert someBool.not` :D |
13:11:11 | PMunch | Hmm, tried to declare a template `is`(x: typedesc[MyInt], y): bool = int is y |
13:11:19 | PMunch | But that seems to have broken the regular is |
13:11:43 | PMunch | http://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:02 | FromDiscord_ | <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:17 | PMunch | Well |
13:33:26 | PMunch | Something like that |
13:33:40 | Araq | ref/closure/string/seq is heap, rest is stack |
13:33:49 | PMunch | I'm actually in the process of writing a deep-dive article on Nim data structures |
13:33:56 | Araq | if we're hand-wavy about it |
13:34:14 | Araq | strictly speaking 'ref' is on the stack as everything else but points to the GC'ed heap |
13:35:55 | FromDiscord_ | <Shield> an article on it would be really great, especially on objects with different field types |
13:36:51 | PMunch | Shield, 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:39 | FromDiscord_ | <Shield> thanks! |
13:43:15 | FromGitter | <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:53 | PMunch | Oh yeah, I've seen that |
13:50:03 | PMunch | Was planning on posting there once it's released |
13:50:14 | PMunch | Just have to find time for all this.. |
13:53:03 | FromGitter | <alehander42> btw which gc is recommended |
13:53:09 | FromGitter | <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:14 | FromGitter | <alehander42> Araq, is rdLoc still useful? it seems mapped to a.res always, the other logic is in `false` |
14:01:23 | PMunch | Found a serviceable workaround to my issue: https://github.com/nim-lang/Nim/issues/9566 |
14:02:04 | PMunch | Simply declare a new type as a distinct JsonNodeObj and make my wanted type a ref to that type. |
14:02:50 | PMunch | Not 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:15 | FromGitter | <tim-st> should the call syntax work? `var x = e.parseEnumX ()` |
14:27:38 | Araq | <alehander42> probably not |
14:28:36 | FromGitter | <GULPF> you can use `e.parseEnum:X ()` instead |
14:29:34 | FromGitter | <GULPF> see https://github.com/nim-lang/Nim/issues/3502 |
14:34:17 | FromGitter | <alehander42> wow, I got so far back in the git history of jsgen, I saw ecmasgen.pas |
14:42:59 | FromGitter | <tim-st> @GULPF thanks |
14:45:59 | * | platoff quit (Read error: Connection reset by peer) |
14:47:25 | FromDiscord_ | <🐍 Aareon 🐳> Are Nim's `cstring`s equivalent to C's `wchar_t`? |
14:48:18 | FromDiscord_ | <🐍 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:14 | copygirl | PMunch: Mhh okay I understand in theory but I don't know what that would look like. |
15:24:49 | PMunch | Well it depends a bit on the specific use case |
15:25:55 | PMunch | But 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:59 | FromGitter | <alehander42> nice idiom |
15:33:04 | copygirl | Ahh makes sense. |
15:33:10 | copygirl | So 2 macros, generally? |
15:37:46 | FromDiscord_ | <Shield> isOnHeap is really handy but tlRegion need to be exposed |
15:37:51 | * | elrood quit (Quit: Leaving) |
15:38:44 | FromGitter | <Clyybber> Araq https://github.com/nim-lang/Nim/pull/9568 's tests are green |
15:44:14 | Araq | ty |
15:50:43 | PMunch | copygirl, yes. |
15:51:19 | PMunch | 2 or more, depending on what you are trying to do |
15:52:14 | * | glassofethanol joined #nim |
15:57:52 | * | Vladar joined #nim |
16:00:54 | glassofethanol | Bonjour |
16:02:19 | FromDiscord_ | <🐍 Aareon 🐳> Aloha |
16:02:41 | glassofethanol | Oh neat, so I'm on IRC and it shows gitter, and discord here too. Neat |
16:04:21 | PMunch | Yup, and they can see what you write |
16:04:32 | glassofethanol | Ah 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:39 | copygirl | PMunch: Mind me asking another question? How would you pass a block from one macro through to another? |
16:13:02 | copygirl | I'm generating code using quote like so: `result.add quote do: matchBranch(`either`, `ident`, `expectedType`, `expectedType`, `branchContent`)` |
16:13:45 | copygirl | Where branchContent is a NimNode that's part of the passed-in untyped block. |
16:14:08 | copygirl | I tried it in a couple of ways like playing it into quote do as well, etc, .. |
16:15:02 | FromGitter | <alehander42> can't you ⏎ matchBranch(..): ⏎ ``branchContent`` |
16:15:50 | copygirl | That's what I tried. |
16:16:05 | copygirl | I get illformed AST error though. |
16:17:07 | leorize | you can use `getAst` to retrieve the ast generated by an another macro |
16:18:22 | FromGitter | <alehander42> copygirl: do you have a repr example |
16:18:25 | FromGitter | <alehander42> reproducable |
16:18:25 | FromGitter | <alehander42> * |
16:18:52 | FromGitter | <recloser> matchBranch(...): `branchContent` |
16:19:29 | PMunch | copygirl, easiest way is to do it like this: http://ix.io/1qsI/Nim |
16:20:50 | copygirl | Mhh that's sooorta what I'm doing. |
16:21:07 | copygirl | What's a good way to debug illformed AST? |
16:21:22 | krux02 | print it |
16:21:37 | krux02 | with repr |
16:21:49 | * | Trustable joined #nim |
16:22:29 | copygirl | I guess it might just be.. a problem because I'm trying to use it in a case statement.. |
16:22:40 | krux02 | when 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:24 | PMunch | copygirl, you might have to wrap it in a dummy case statement |
16:23:26 | * | PMunch quit (Quit: Leaving) |
16:24:53 | FromGitter | <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:22 | copygirl | The ident is not the problem, it's the expectedType. |
16:25:41 | copygirl | That I get as an ident but I need the symbol to compare it with the Either's types. |
16:26:54 | FromGitter | <recloser> of lookupIndex(`either`, `someType`): let `ident` = getValueAt(`either`, lookupIndex(`either`, `someType`)) |
16:27:12 | copygirl | Yeah I was thinking of that but that seemed wrong :/ |
16:27:31 | FromGitter | <recloser> wrong how? |
16:27:40 | copygirl | DRY I guess. |
16:27:56 | copygirl | I feel like there should be a better way. |
16:28:28 | FromGitter | <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:19 | FromGitter | <alehander42> Araq, jsgen is huge :D I just realized it's even bigger than cgen |
16:32:34 | Araq | it's not. |
16:32:36 | FromGitter | <alehander42> but maybe that's because of cgendata/etc modules |
16:32:50 | Araq | cgen is much bigger, but split up into more files |
16:34:49 | FromGitter | <alehander42> there are still some php-related procs |
16:35:01 | FromGitter | <alehander42> should I remove them? |
16:35:29 | * | leorize quit (Quit: WeeChat 2.0.1) |
16:37:38 | Araq | yeah |
16:38:57 | * | Xe joined #nim |
16:50:50 | * | nsf quit (Quit: WeeChat 2.2) |
16:55:56 | FromGitter | <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:37 | FromGitter | <tim-st> iterating and for each add? |
16:58:07 | Araq | seems a JArray would be a better fit |
16:58:30 | FromGitter | <tim-st> yes, the field is a JArray |
16:59:34 | FromGitter | <tim-st> I hoped that auto translates when I write `node["key"] = @["a", "b"]` |
17:01:19 | Araq | node["key"] = %* @["a", "b"] |
17:01:29 | FromGitter | <tim-st> nice, thanks |
17:01:42 | Araq | node["key"] = %*["a", "b"] # or maybe this |
17:02:02 | * | wildlander joined #nim |
17:02:07 | FromGitter | <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:49 | nc-x | Araq: You there? |
17:04:18 | * | njha is now known as fyber |
17:04:32 | * | petersjt014[m] joined #nim |
17:04:48 | Araq | nc-x, yeah |
17:05:09 | nc-x | Based 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:41 | FromGitter | <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:11 | FromGitter | <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:14 | FromGitter | <tim-st> the typeclass `seq` works as proc parameter, but `set` doesnt work, should `set` work too? |
17:09:15 | FromGitter | <tim-st> solved this by adding generic `[E: enum]` |
17:10:40 | * | nc-x quit (Quit: Page closed) |
17:12:02 | Araq | nc-x seems like a bug, yes |
17:17:25 | FromGitter | <alehander42> not general enough |
17:20:42 | FromGitter | <alehander42> I can instead generate a magic op handler with a macro, no other simple solution |
17:24:11 | theelous3 | is there an ordinal type for params? |
17:24:14 | * | nc-x joined #nim |
17:24:37 | nc-x | Araq: 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:21 | FromGitter | <tim-st> theelous3: `SomeOrdinal` ? |
17:35:48 | FromGitter | <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:27 | FromGitter | <xmonader> Why would rst parser /generator depend on os module ? |
17:48:59 | FromGitter | <xmonader> I'm trying to tinker with karax a bit to create Rst previewer |
17:49:46 | leorize | xmonader: http://nim-lang.github.io/Nim/rst.html#defaultFindFile%2Cstring |
17:51:30 | FromGitter | <xmonader> i think i should surround that with when defined js or something |
17:52:20 | leorize | well, `rstParse` also depends on it... |
17:54:11 | FromGitter | <alehander42> it seems parseDoc doesn't really need os |
17:55:34 | FromGitter | <alehander42> but nah |
17:55:41 | FromGitter | <alehander42> it needs findFile for `file` extension or smth |
17:55:43 | FromGitter | <xmonader> there're more @leorize writeLines, splitFile and more |
17:56:16 | FromGitter | <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:26 | FromGitter | <alehander42> doesn't require optionally* |
17:57:00 | FromGitter | <alehander42> depending on e.g. a compile time defined value |
17:57:02 | FromGitter | <alehander42> but it's some work |
17:58:13 | FromGitter | <xmonader> @alehander42 i'll report an issue for now |
17:58:27 | FromGitter | <xmonader> but i'm really in favor of pure code as much as possible |
17:58:44 | FromGitter | <alehander42> of course, me too |
17:59:04 | FromGitter | <alehander42> but here there is a reason for at least optional dependency on file handling |
17:59:30 | FromGitter | <alehander42> it just has to be optional on compile time |
18:01:38 | FromGitter | <xmonader> I guess nimdoc was the only use case in mind for it maybe |
18:03:20 | FromGitter | <alehander42> @xmonader of course temporarily you can also easily wrap a js rst parser |
18:03:42 | FromGitter | <alehander42> interop with js libs is very easy usually |
18:04:10 | FromGitter | <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:06 | Araq | nah, please improve Nim's RST parser |
18:14:16 | Araq | I'm tired of wrappers :P |
18:21:07 | * | theelous3_ quit (Ping timeout: 240 seconds) |
18:21:34 | FromGitter | <alehander42> well for the js backend a wrapper can something simple like ⏎ var rstLib = require("rst") ⏎ var node = rstLib.parse(text) |
18:22:51 | FromGitter | <alehander42> but of course, pure nim is always better |
18:24:07 | FromGitter | <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:23 | FromGitter | <alehander42> but if it seems weird, tell me, before I lose time rewriting them all |
18:29:04 | * | mech422__ joined #nim |
18:29:38 | Araq | looks ok to me |
18:32:07 | * | mech422_ quit (Ping timeout: 240 seconds) |
18:34:55 | FromGitter | <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:55 | FromGitter | ... debug what's going on? |
18:38:14 | * | narimiran quit (Remote host closed the connection) |
18:39:16 | FromGitter | <iffy> I'm guessing the proc-version gl functions don't have the context set? Maybe? |
18:43:04 | FromGitter | <iffy> afk, but I'll be back |
18:43:17 | Araq | use loadExtensions() |
18:50:16 | * | dorei joined #nim |
18:51:40 | * | platoff quit (Ping timeout: 250 seconds) |
19:01:48 | FromGitter | <tim-st> are Options complete based on Exceptions? |
19:03:17 | FromGitter | <tim-st> (is a try catch around get always needed?) |
19:03:42 | FromGitter | <tim-st> ah, I saw, there is a default one, nice |
19:03:45 | Araq | not 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:53 | FromGitter | <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:07 | FromGitter | <zurs> (https://files.gitter.im/nim-lang/Nim/cp3a/nimsuggets_crash.png) |
19:21:36 | FromGitter | <zurs> These messages is repeated a lot |
19:22:48 | FromGitter | <zurs> Anyone who had a similar issue and solved it? |
19:27:34 | * | elrood joined #nim |
19:28:39 | * | nsf joined #nim |
19:34:38 | FromGitter | <zacharycarter> I *think* nimsuggest occasionally leaks |
19:34:49 | FromGitter | <zacharycarter> not sure about those error messages though |
19:37:30 | FromGitter | <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:56 | theelous3 | if I get a depreciation warning, how can I go about looking up what the new thing to do is/ |
19:49:56 | theelous3 | ? |
19:50:27 | theelous3 | deprecation* |
19:51:33 | theelous3 | oh nvm, release notes for 018 shows ..> over .. > and pred for others |
20:02:13 | * | stefanos82 quit (Quit: Quitting for now...) |
20:08:46 | Araq | zurs: paste your nimsuggest.log please |
20:08:58 | * | nsf quit (Quit: WeeChat 2.2) |
20:09:01 | Araq | to be found in your $HOME iirc (bad style, I know I know) |
20:15:18 | FromGitter | <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:13 | Araq | it 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:38 | Araq | it'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:25 | FromGitter | <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:55 | FromGitter | <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:42 | FromGitter | <zurs> Of course! Thank you, totally forgot about gist |
20:26:54 | FromGitter | <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:09 | Araq | sorry the log doesn't contain anything that helps me |
20:31:13 | * | kapil____ joined #nim |
20:31:44 | FromGitter | <zurs> Okay, thanks anyway. Btw it just started working flawlessly now, I think it is because of jester actually |
20:33:56 | Araq | sockets 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:12 | FromGitter | <kayabaNerve> Sockets can be a pain |
20:58:20 | FromGitter | <kayabaNerve> I'm glad Nim offers a pleasant interface |
20:58:22 | FromGitter | <kayabaNerve> And async |
20:58:26 | FromGitter | <kayabaNerve> It's awesome |
21:00:24 | Araq | async can also be sped up quite a bit. I hope my moving GC works out for it |
21:00:47 | Araq | seems the perfect algorithm for this usecase |
21:02:20 | FromGitter | <kayabaNerve> I have a decent amount of async code |
21:03:11 | FromGitter | <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:22 | FromDiscord_ | <treeform> I am using the {.async.} stuff. How I would spawn or diverge the execution? |
21:07:07 | FromDiscord_ | <treeform> some thing like setTimeout in js? but you know with {.async.} stuff. |
21:07:15 | FromDiscord_ | <treeform> or go in golang |
21:07:48 | FromDiscord_ | <treeform> callSoon is kind of similar but it takes a non {.async.} proc ? |
21:09:14 | FromDiscord_ | <treeform> it looks like asynchttpserver uses https://github.com/nim-lang/Nim/blob/master/lib/pure/asynchttpserver.nim#L309 |
21:09:24 | FromDiscord_ | <treeform> `asyncCheck` for this? |
21:10:52 | FromGitter | <kayabaNerve> treeform: When you run await, it will allow other async code to execute. |
21:11:29 | FromGitter | <kayabaNerve> If you have an async proc that never calls await, it will not allow other async code to execute. |
21:11:45 | FromGitter | <kayabaNerve> You'll need to do await sleepAsync (or asyncSleep? I always forget) |
21:11:52 | FromGitter | <kayabaNerve> If you want a timeout, use callSoon |
21:12:04 | FromGitter | <kayabaNerve> asyncCheck is calling an async proc safely from a sync proc |
21:13:15 | Araq | treeform: check out how "httpbeast" does it |
21:13:30 | Araq | threading with async is tricky, but possible |
21:14:28 | FromDiscord_ | <treeform> I think asyncCheck does want I want |
21:14:31 | FromDiscord_ | <treeform> sorry! |
21:14:45 | FromDiscord_ | <treeform> I just wanted to split my async "executions"? |
21:15:38 | FromGitter | <alehander42> Araq, what is the most probable reason for os:standalone to hit missing genericAssign |
21:16:14 | FromGitter | <alehander42> use of ref objects ? or some kind of sequence? I tried to keep everything in objects with primitive fields |
21:19:51 | FromGitter | <alehander42> ha, arrays |
21:21:49 | * | narimiran joined #nim |
21:22:31 | * | platoff joined #nim |
21:22:31 | * | platoff quit (Client Quit) |
21:22:44 | narimiran | Araq: 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:53 | Araq | narimiran, probably but I'm still going through these issues |
21:38:19 | FromGitter | <alehander42> how can I provide copyString |
21:39:25 | Araq | I'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:00 | Araq | you can fake a heap with a large statically allocated C array of bytes |
21:40:42 | Araq | the people claiming "my device doesn't have a heap" are lacking some creativity |
21:41:12 | FromGitter | <alehander42> oh yeah, that's my plan for malloc/free for now |
21:41:49 | Araq | read the bottom of system/osalloc.nim |
21:43:22 | Araq | of 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:00 | FromGitter | <alehander42> ah I am stupid I didn't pass the args I want actually to the nim compiler |
21:48:28 | FromGitter | <alehander42> yeah, this seems kinda reasonable |
21:49:17 | Araq | --os:standalone is not the same as --gc:none |
21:49:41 | Araq | in theory --os:standalone is the "I'd like to develop my own OS" switch |
21:49:49 | Araq | gc:none is not required and harmful. |
21:49:59 | Araq | in practice this needs to be covered by a good test :P |
21:57:55 | FromGitter | <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:06 | FromGitter | <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:15 | Araq | I doubt it |
22:04:35 | FromGitter | <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:17 | Araq | it fixed nre's docs |
22:08:16 | Araq | hmm I need 3 monitors... |
22:08:58 | FromGitter | <timotheecour> oh, I see, just saw https://github.com/nim-lang/Nim/issues/7527#issuecomment-434483354 ; that explains the backport commit |
22:09:56 | Araq | I already updated contributing.rst with this too |
22:09:58 | FromGitter | <timotheecour> (but still, my comment is valid, the remaining issue that isn’t fixed is #9432 ) |
22:10:55 | Araq | will look at it later, I'm fixing #9235 |
22:11:03 | FromGitter | <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:54 | Araq | too many compiler refactorings I want to do that can't be handled with trunk based development |
22:15:13 | Araq | and also some nice AST changes |
22:15:57 | FromGitter | <timotheecour> exactly. trunk development prevents ever cleaning up code, leading to bad design decisions kept forever. that was always my main argument. |
22:16:06 | Aareon | AST changes :o |
22:17:50 | Aareon | Is there no way to do https://github.com/nim-lang/Nim/commit/eb03684c57089fa33c3add694841a8f7f3ad8a72 without recursing like this? |
22:18:41 | Aareon | Nvm |
22:18:44 | Aareon | Ignore me |
22:18:49 | Araq | you can probably hide the recursion in a DSL but I'm too good at recursions |
22:20:36 | Aareon | Wrap it in a loop? |
22:21:02 | Araq | if you like explicit stacks, sure |
22:23:53 | Aareon | True. Too much to track w/o recursing |
22:24:29 | Aareon | Rather it just work than to hack it forever |
22:35:11 | Araq | gah #9432 is super nasty |
22:35:55 | FromGitter | <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:15 | Araq | myabe |
22:38:43 | Araq | hmm seems impossible to make #9235 and #9432 work at the same time |
22:39:37 | FromGitter | <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:41 | Araq | it's super easy to grep for these |
22:58:33 | Araq | but as I said, fix system.nim, os:standalone is NOT gc:none |
22:58:55 | Araq | and 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:52 | Aareon | Little 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:17 | Araq | dunno what to document, it's a lexer, it runs over the input chars |
23:09:25 | ldlework | heh |
23:10:06 | Araq | I often feel like you all want me to document the raw basics of compiler development. |
23:10:10 | * | Aareon_ joined #nim |
23:10:19 | Araq | there are books for that, you know. |
23:11:00 | Aareon | Lol 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:56 | Araq | fair enough |
23:12:15 | shashlick | Araq: saw your comment on trunk based dev |
23:12:29 | shashlick | Happy to help baby sit stable |
23:13:12 | Araq | my secret plan is to make the 0.19 line v1 and keep much good stuff for v2 |
23:13:36 | Araq | if we backport fixes to 0.19 than it's good enough for a v1 |
23:14:45 | shashlick | I agree |
23:15:01 | shashlick | With branch model, you can start with 1.0 right away |
23:23:57 | Araq | great, we have nightly builds already |
23:24:18 | Araq | but I'll push my v19.2 branch tomorrow |
23:24:25 | Araq | good night |
23:25:03 | FromGitter | <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:46 | FromGitter | <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:31 | Araq | I don't use any language aside from Nim that is not v2 or later |
23:27:15 | Araq | I don't understand this obsession with v1 either, for me it's vaporware as long as v2 is not out :-/ |
23:28:30 | Araq | oh well, version 1 means we backport bugfixes, it's a good definition |
23:28:51 | FromGitter | <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:32 | Araq | well it's rigid but I don't have any better ideas |
23:32:33 | dorei | I 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:01 | FromDiscord_ | <Shield> it's less about bugfixes and more about "it's been a decade and it's still not v1 yet?" |
23:56:32 | FromDiscord_ | <Shield> i'd like to ask what kind of breaking changes are we expecting |
23:59:57 | * | vlad1777d joined #nim |