00:03:36 | * | rockcavera joined #nim |
00:30:53 | * | stefanos82 quit (Quit: Quitting for now...) |
00:31:50 | FromGitter | <dm1try> > Error: illegal capture 'result' ⏎ ⏎ I think you cannot mix nim closure proc(they have implicit for environment) with the callback of used lib. I might use proc suitable for native callback and provide the created object as argument to this callback |
00:34:20 | FromGitter | <dm1try> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b9ef68cd655361f760d657c] |
00:35:08 | FromGitter | <dm1try> feel free to ignore, it just my assumption =) |
00:35:44 | FromGitter | <dm1try> I never did such things |
00:41:02 | FromGitter | <dm1try> if Knob is defined as `ref` this^ should work seamlessly if I not missing something |
00:47:33 | * | abm quit (Ping timeout: 245 seconds) |
00:52:24 | * | x023 joined #nim |
00:56:03 | * | x023 quit (Remote host closed the connection) |
00:56:19 | * | dddddd quit (Remote host closed the connection) |
01:07:18 | * | SenasOzys quit (Remote host closed the connection) |
01:09:24 | * | SenasOzys joined #nim |
01:09:46 | krux02 | is someone here online using emacs in nim? |
01:11:18 | * | SenasOzys quit (Remote host closed the connection) |
01:11:26 | zestyr | yep |
01:13:15 | * | SenasOzys joined #nim |
01:15:48 | * | SenasOzys quit (Remote host closed the connection) |
01:16:38 | * | SenasOzys joined #nim |
01:18:22 | krux02 | zestyr, do you have problems with the performance of nim-mode? |
01:19:09 | zestyr | not particularly, but I can't get the flycheck part working, it just constantly gives a large amount of errors starting at the imports |
01:19:43 | krux02 | zestyr, I got that part working. But it is a mess to get it right. |
01:19:50 | krux02 | and then it is horribly slow |
01:20:00 | krux02 | blocking your input |
01:21:20 | zestyr | yeah I've seen your PRs, shame the maintainer seems to be gone |
01:21:37 | krux02 | I think so, too. |
01:21:56 | krux02 | I wrote an e-mail asking if I could take over maintaining the project. |
01:22:38 | krux02 | But I think I hurt the feelings of yuutayamada |
01:23:08 | FromGitter | <kaushalmodi> krux02: Why did he say so in a reply? Or didn't reply at all? |
01:23:30 | FromGitter | <kaushalmodi> I have couple of my PRs hanging for nim-emacs-module too for a while |
01:23:42 | FromGitter | <kaushalmodi> Looks like he's missing in action on GitHub for a while now |
01:23:49 | FromGitter | <kaushalmodi> may be some other priorities? |
01:24:10 | krux02 | I opened several issues "permoremacs issues made feature X unusable and therefore I have to disable it to keep the mode usable" |
01:24:24 | krux02 | and I did so with almost all features including syntax highlighting. |
01:24:34 | krux02 | at least syntax highlighting is fixed in my PR. |
01:24:49 | krux02 | but that doesn't help other people if it doesn't get merged. |
01:25:25 | krux02 | kaushalmodi: basically yuutayamada stopped replying to my issues at all. |
01:25:38 | krux02 | I think I was just too annoying. |
01:26:18 | FromGitter | <kaushalmodi> I think he has just stopped using Nim (and/or emacs) and so is not interested? |
01:26:24 | zestyr | He hasn't really been active on github since late October though |
01:26:26 | krux02 | and on top of that, I had no idea of emacs. So I had sorts of problems that have nothing to do with nim mode but are general emacs usability quirks. |
01:27:13 | krux02 | well he is not getting payed, but I wrote an e-mail, too aking if I can take over maintaining nim-mode. But also no reply. |
01:27:57 | FromGitter | <kaushalmodi> well, let's hope he's doing fine physically |
01:28:38 | krux02 | well yes, let's hope he just can't stand me anymore and that is the reason he doesn't answer to me at all. |
01:28:52 | krux02 | :P |
01:29:42 | krux02 | but since I fixed syntax highlighting performance issues, I am now in the vibe to improve nimsuggest performance problems as well. |
01:29:58 | krux02 | I also want it to work by default. |
01:30:04 | krux02 | no weired error messages |
01:30:11 | zestyr | nimsuggest could definitely use some love |
01:30:37 | krux02 | you mean nimsuggest or nimsuggest emacs integration? |
01:30:58 | krux02 | currently I have no idea how nimsuggest is integrated in emacs. |
01:31:13 | krux02 | but at least by now elisp isn't a totally strange language to me anymore. |
01:31:23 | krux02 | it is maintainable. |
01:31:44 | FromGitter | <kaushalmodi> elisp is awesome! Looks like you are starting to see that "light" :) |
01:31:46 | krux02 | developing elisp in emacs is quite fun |
01:32:23 | krux02 | well, not sure about "awesome" but it certainly has some greats aspects of it. |
01:32:54 | krux02 | I really like for example that it is an always running lisp maching where I can add and reload functions arbitrarily. |
01:33:29 | krux02 | a very hacky language that allows to change functions from a library. |
01:33:47 | krux02 | you shouldn't do it, but it works and that is great. |
01:33:50 | FromGitter | <kaushalmodi> that's what's awesome; you can hijack anything in emacs using elisp |
01:34:07 | FromGitter | <kaushalmodi> make 'a' type 'b' and 'b' type 'c' if you want :P |
01:34:45 | FromGitter | <kaushalmodi> wait till you learn about the nadvice system (if you haven't already) |
01:34:55 | krux02 | there are still things in emacs that I simply can't stand and I won't change my opinion. |
01:35:02 | krux02 | but that has nothing to do with elisp |
01:35:05 | FromGitter | <kaushalmodi> you can advise whole functions, just the return value or just the arguments, whatever |
01:36:02 | krux02 | I have no idea what you mean |
01:38:22 | krux02 | the thing that I can't stand it emacs is that by default it his it's own idea of how to abuse your frames for displaying stuff. |
01:39:11 | FromGitter | <kaushalmodi> krux02: You have mentioned that before |
01:39:24 | FromGitter | <kaushalmodi> You configure that behavior as you like using the display-buffer-alist |
01:39:33 | krux02 | for example helm shows a list of buffers and does so picking a random window/frame and showing a buffer with tha list of buffers. |
01:39:50 | FromGitter | <kaushalmodi> If that's too low level, look into the shackle package (that I also mentioned earlier) |
01:40:12 | FromGitter | <kaushalmodi> shackle is like sugar syntax for display-buffer-alist |
01:40:20 | FromGitter | <kaushalmodi> it's not random |
01:40:54 | krux02 | to me it's random |
01:41:06 | zestyr | try ivy instead of helm |
01:41:15 | krux02 | maybe I will do. |
01:41:38 | krux02 | I never used anything else than helm |
01:41:48 | zestyr | it uses the minibuffer to display stuff |
01:41:53 | FromGitter | <kaushalmodi> +1 for ivy |
01:41:57 | krux02 | does ivy have fuzzy finding as well? |
01:42:00 | zestyr | yes |
01:42:04 | krux02 | ok |
01:42:09 | krux02 | is ivy built into emacs? |
01:42:14 | zestyr | no |
01:42:26 | FromGitter | <kaushalmodi> About advice system, if interested, you can find examples in my config: https://github.com/kaushalmodi/.emacs.d/search?o=desc&q=advice-add&s=indexed |
01:42:32 | krux02 | but it does have tab completion doesn't it? |
01:42:40 | krux02 | that is what was most disturbing in helm. |
01:43:06 | FromGitter | <kaushalmodi> krux02: that's why helm never stuck for me, and also the way it used windows instead of minibuffer |
01:44:35 | krux02 | well sometimes there is a lot of stuff to complete. |
01:45:06 | FromGitter | <kaushalmodi> minibuffer is just fine.. you never scroll and manually sort through hundreds of entries |
01:45:22 | krux02 | for example helm git grep is quite nice |
01:45:37 | krux02 | does that exist in ivy as well? |
01:45:41 | FromGitter | <kaushalmodi> yes |
01:46:06 | FromGitter | <kaushalmodi> replace helm-* stuff with counsel-* |
01:46:20 | FromGitter | <kaushalmodi> replace helm-\* stuff with counsel-\* |
01:46:35 | krux02 | counsel? |
01:46:52 | FromGitter | <kaushalmodi> ivy is the engine, the low level component |
01:47:02 | FromGitter | <kaushalmodi> counsel is the user-facing library that uses ivy |
01:47:17 | FromGitter | <kaushalmodi> both are by the same ivy developer Abo Abo |
01:49:39 | krux02 | ok, sounds cool |
01:51:06 | krux02 | kaushalmodi: I have a strange error in emacs/nim-mode btw |
01:51:21 | krux02 | for some reason nim-mode was not loaded |
01:51:34 | krux02 | the mode was not set automatically |
01:51:54 | FromGitter | <kaushalmodi> you need to set the auto load alist correctly |
01:51:59 | FromGitter | <kaushalmodi> (and I think it is, already) |
01:52:19 | krux02 | then I put some linebreaks here: https://github.com/nim-lang/nim-mode/pull/201/commits/63d4315429c54f5edd92d2a6b328c9b4e7f50642 |
01:52:32 | krux02 | after the autoload and then everything worked |
01:53:09 | FromGitter | <kaushalmodi> this is what causes .nim files to autoload nim-mode |
01:53:10 | FromGitter | <kaushalmodi> https://github.com/nim-lang/nim-mode/blob/35f4b2cb2d4c142f6f7f0e3ffb06c87b81bb8c26/nim-mode.el#L237 |
01:53:18 | krux02 | just the changes in the file nim-mode.el are relevant |
01:53:51 | krux02 | yea but I needed to add the newline there, otherwise the mode wasn't loaded correctly. |
01:54:00 | FromGitter | <kaushalmodi> hmm.. yeah.. the ###autoload cookies should be on their own lines |
01:54:18 | FromGitter | <kaushalmodi> the reason I never caught that issue is that I set the autoloads for nim myself in use package |
01:54:20 | FromGitter | <kaushalmodi> .. let me check |
01:54:22 | krux02 | and now all of a sudden tests are failing on the server, because the language is not set |
01:54:32 | krux02 | but that didn't happen on that change |
01:54:43 | krux02 | it happened many commits later |
01:55:00 | FromGitter | <kaushalmodi> yep, I let those auto-loads myself :D |
01:55:01 | FromGitter | <kaushalmodi> https://github.com/kaushalmodi/.emacs.d/blob/master/setup-files/setup-nim.el#L8 |
01:55:06 | FromGitter | <kaushalmodi> so I never caught that bug |
01:56:45 | FromGitter | <kaushalmodi> actually I take it back |
01:56:51 | FromGitter | <kaushalmodi> your refactoring is wrong |
01:57:00 | krux02 | ah never mind I found the error |
01:57:09 | FromGitter | <kaushalmodi> the autoload cookies are by themselves on a line only on top of fn definitions |
01:57:14 | krux02 | I renamed a defvar and now it is causing problems |
01:57:17 | FromGitter | <kaushalmodi> in your case, that line has to be executed |
01:57:21 | krux02 | even though locally I did not have that problem |
01:57:36 | FromGitter | <kaushalmodi> so revert that autoload on its own line first of all |
01:58:05 | krux02 | ok thanks a lot |
01:58:08 | krux02 | I have to sleep now |
01:58:16 | krux02 | it is already 4:00 in the morning |
01:58:39 | krux02 | but thank you I now know where i have to look |
01:58:59 | * | krux02 quit (Remote host closed the connection) |
02:00:02 | FromGitter | <kaushalmodi> actually I take back what I asked to take back, hehe |
02:00:13 | FromGitter | <kaushalmodi> looking at the source: http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/progmodes/elisp-mode.el#n948 |
02:00:48 | FromGitter | <kaushalmodi> looks like it's OK to have autoload on its own line even when executing a lisp form |
02:21:34 | * | ebx1000 quit (Read error: Connection reset by peer) |
02:39:35 | * | epon11 joined #nim |
02:41:51 | * | gangstacat joined #nim |
02:42:31 | * | epon11 quit (Remote host closed the connection) |
02:47:02 | FromGitter | <gogolxdong> @zacharycarter How is your hyperHTML porting? |
03:28:51 | * | harrynoob joined #nim |
03:35:07 | * | harrynoob quit (Ping timeout: 240 seconds) |
04:22:15 | * | rkeene17 joined #nim |
04:27:30 | * | rkeene17 quit (Ping timeout: 252 seconds) |
04:35:08 | zestyr | Is there a way to handle optional return types? I'm dealing with an API that either returns a "Message" object, or "true" depending on the input, and need to make a function that returns either value |
04:35:32 | zestyr | I could use a tuple but that kinda seems like a hack |
04:35:43 | FromGitter | <bung87> options module |
04:35:58 | zestyr | that only allows for one type though |
04:37:02 | * | nsf joined #nim |
04:37:08 | FromGitter | <bung87> then use a custom object |
04:39:48 | * | SenasOzys quit (Remote host closed the connection) |
04:40:34 | * | SenasOzys joined #nim |
04:40:37 | FromGitter | <jrfondren> an API that either returns a Message object, or true ⏎ so: either some(Message), or none(Message) |
04:41:02 | FromGitter | <jrfondren> is there a third kind of return that you need to handle? |
04:42:04 | narimiran[m] | return a tuple (bool, Message)? |
04:42:47 | FromGitter | <bung87> I think it’s a API design problem. |
04:42:49 | zestyr | I think it'll have to be (bool, Option[Message]), as I can't use nil for the message field. |
04:43:11 | zestyr | It's a bad design I agree. |
04:43:13 | zestyr | https://core.telegram.org/bots/api#editmessagetext |
04:43:18 | * | SenasOzys quit (Remote host closed the connection) |
04:43:20 | zestyr | "On success, if the edited message was sent by the bot, the edited Message is returned, otherwise True is returned." |
04:43:21 | FromGitter | <jrfondren> the API *sounds* fine. You get something or you get nothing. It's just confusing because the nothing is 'true' |
04:43:22 | FromGitter | <bung87> tuple seems good enough |
04:43:41 | FromGitter | <jrfondren> the tuple lets you encode absurd states, like (bool, some(Message)) |
04:43:48 | FromGitter | <jrfondren> er, (false, some(Message)) |
04:43:49 | * | SenasOzys joined #nim |
04:46:07 | zestyr | that works, thanks |
04:46:48 | * | SenasOzys quit (Remote host closed the connection) |
04:47:18 | * | SenasOzys joined #nim |
04:53:15 | * | miran joined #nim |
05:06:57 | * | kapil___ joined #nim |
05:28:33 | * | leorize quit (Ping timeout: 252 seconds) |
05:35:50 | FromGitter | <Bennyelg> VS-Code yield undefined identifier but source code compile well. looks like the errors shown only when Thread module is used or Threadpool |
05:50:23 | * | leorize joined #nim |
05:56:58 | FromGitter | <bung87> it doesnot know you compile with thread:on |
05:59:45 | FromGitter | <bung87> I have not read nim cfg manual, if I get enough info I can fix that for vscode-nim |
06:14:54 | * | miran quit (Ping timeout: 264 seconds) |
06:41:30 | Tanger | bung87: Hey mate, I'm not too familiar with VSCode, but if you can get it to read a .nims or .nim.cfg (which it should by default if one is present in the path of the file you're compiling, you can try putting in `switch("threads", "on")` on |
06:45:18 | FromGitter | <bung87> ah so I can read the config file and send args to nimsuggest ⏎ (not sure whether nimsuggest support currently) I’ll try it |
06:45:27 | FromGitter | <bung87> thanks ! |
06:49:10 | FromGitter | <Bennyelg> I'lll try too thanks |
06:54:49 | * | skelett joined #nim |
07:00:02 | * | hcsiftrewq is now known as qwertfisch |
07:00:38 | FromGitter | <Bennyelg> Works Like magic |
07:03:08 | * | xet7 quit (Quit: Leaving) |
07:04:49 | FromGitter | <Bennyelg> it has disappeared for a moment but then came back :/ |
07:14:38 | FromGitter | <alehander42> so, what is the best way to get a "shared" view of a subseq? |
07:14:54 | FromGitter | <alehander42> e.g. a[1 .. ^1] without making a copy (just data pointing to original data[1]) |
07:23:54 | FromGitter | <alehander42> I mean i remember the view/slice discussions I and found a lot of them right now, but I can't seem to find what happened in the end |
07:24:24 | FromGitter | <alehander42> e.g. https://github.com/nim-lang/Nim/pull/5957 |
07:24:55 | FromGitter | <alehander42> (with shared, I meant, non-copying, sorry) |
07:33:01 | * | kapil___ quit (Quit: Connection closed for inactivity) |
07:46:19 | * | PMunch joined #nim |
08:03:27 | * | leorize quit (Ping timeout: 240 seconds) |
08:03:29 | * | floppydh joined #nim |
08:03:49 | * | gmpreussner_ joined #nim |
08:05:20 | * | gmpreussner quit (Ping timeout: 272 seconds) |
08:05:48 | * | leorize joined #nim |
08:07:21 | * | TheLemonMan joined #nim |
08:12:27 | * | ftsf joined #nim |
08:16:22 | * | xet7 joined #nim |
08:19:37 | * | abm joined #nim |
08:24:26 | * | ftsf quit (Quit: Leaving) |
08:28:31 | * | NimBot joined #nim |
08:39:32 | * | Vladar joined #nim |
08:58:06 | * | Ipsilon12 joined #nim |
09:00:02 | * | Ipsilon12 quit (Killed (Sigyn (Spam is off topic on freenode.))) |
09:05:34 | c15ade4 | where has nim been hiding all my life |
09:05:36 | c15ade4 | its so much fun |
09:06:56 | * | ftsf joined #nim |
09:08:28 | FromGitter | <codenoid> as nim user, are you more prefer todo with camel-case or snak-case |
09:08:58 | FromGitter | <Vindaar> camelCase |
09:09:51 | * | leorize quit (Ping timeout: 250 seconds) |
09:13:30 | PMunch | That being said Nim is style insensitive, so someCase is the same identifier as some_case |
09:13:56 | PMunch | So if you write your code in snake case it's still possible to use it in camel case |
09:14:20 | PMunch | Only character that is case-sensitive is the first one |
09:14:40 | PMunch | So SomeCase is not the same identifier as someCase or some_case |
09:14:48 | PMunch | But it is the same as Some_case |
09:15:03 | PMunch | This is to allow you to have classes with upper case letters |
09:15:04 | FromGitter | <alehander42> yeah you can write a lib in snake_case and it wouldn't matter for your users |
09:18:39 | PMunch | Hmm, would it be possible to make a Nim proc that takes a procedure ignore optional parameters? |
09:18:54 | PMunch | I tried to map the procedure strip over a sequence of strings |
09:19:35 | PMunch | But it doesn't work since strip is not a proc (x: T): S |
09:19:50 | PMunch | However if you ignore the optional parameters it is |
09:21:00 | FromGitter | <narimiran> but shouldn't optional parameters be.... well.... optional? |
09:22:13 | PMunch | Yes, but I'm opting not to use any here |
09:22:22 | PMunch | What I have to do: for key in toggleExpand.split('+').map(proc (x: string): string = x.strip): |
09:22:34 | PMunch | What I'd want to do: for key in toggleExpand.split('+').map(strip): |
09:22:55 | PMunch | I have to wrap strip in a procedure that hides the optional parameters |
09:23:35 | FromGitter | <alehander42> ahh |
09:24:14 | FromGitter | <narimiran> strange, `strip` without optional parameters works for a single string, but i doesn't work when it is used inside of a map/mapIt |
09:24:42 | PMunch | Yeah, that's my point |
09:24:56 | FromGitter | <narimiran> is this a bug? |
09:25:11 | PMunch | I don't know, might be intentional, but I'm not sure why |
09:25:40 | FromGitter | <alehander42> i guess map just expects a proc with one T argument |
09:25:48 | FromGitter | <alehander42> and the signatures don't match on a type level |
09:25:49 | PMunch | I mean strip doesn't strictly have the proc (x: T): S signature, event though it can have it |
09:26:19 | FromGitter | <alehander42> proc types are very delicate to match |
09:26:36 | FromGitter | <alehander42> i feel like every little difference resulted in mismatch for me before |
09:29:38 | FromGitter | <narimiran> PMunch will you open an issue (or will i)? |
09:30:30 | PMunch | I'm currently looking at the issue tracker to see if there is one |
09:42:26 | PMunch | https://github.com/nim-lang/Nim/issues/8987 |
09:47:14 | * | Vladar quit (Remote host closed the connection) |
09:47:38 | * | Vladar joined #nim |
09:48:34 | * | hjko joined #nim |
09:55:53 | * | hjko quit (Quit: Page closed) |
10:03:00 | PMunch | http://ix.io/1mRz/Nim |
10:03:12 | PMunch | Any idea what's wrong? |
10:09:35 | FromGitter | <narimiran> not the same types in the seq? |
10:10:03 | FromGitter | <bung87> how to have iterator param that as default value, I always get type didnot match,like this ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b9f7d7abe4f300626a74844] |
10:10:28 | PMunch | narimiran, but as you can see they are the same type.. |
10:10:37 | FromGitter | <bung87> `proc initMinHasher*T (num_seeds:int, tokenizer:iterator (x:string) : (string,int)):MinHasher[T]=` |
10:10:53 | FromGitter | <bung87> ```code paste, see link``` |
10:12:21 | PMunch | Hmm @narimiran, apparently this works: "actions.add (modmask: modmask, keysym: keysym, call: proc (ev: TXKeyEvent) {.closure.} = toggleExpandHandler(ev))" |
10:12:26 | PMunch | So it's just the pragmas.. |
10:12:37 | FromGitter | <narimiran> PMunch: first `call` is "proc (ev: TXKeyEvent){.closure.}", the second one is "proc (ev: TXKeyEvent){.gcsafe, locks: 0.}" |
10:12:42 | FromGitter | <alehander42> btw do you guys use `~` for something? |
10:12:58 | FromGitter | <alehander42> i want to use it in a dsl but i wonder if people hate it |
10:13:36 | FromGitter | <narimiran> @alehander42 numerical libs use it in combination with `=` for "almost the same" in `=~` or `~=`. i haven't seen it used on its own |
10:13:41 | PMunch | alehander42, it's a pain to type on my keyboard.. |
10:14:00 | PMunch | narimiran, yeah but why does that matter.. |
10:14:11 | PMunch | I never specified that it had to be a closure in the first place.. |
10:14:22 | FromGitter | <narimiran> PMunch: i have no idea. no experience with pragmas here |
10:15:07 | PMunch | var actions = newSeq[tuple[modmask: int, keysym: TKeySym, call: proc (ev: TXKeyEvent)]]() |
10:15:34 | PMunch | That's how the sequence is defined, but for some reason it says that call has to be a closure |
10:16:05 | PMunch | Even if I add a {.gcsafe, locks: 0.} pragma tag to it it converts it to {.closure, gcsafe, locks: 0.} |
10:16:15 | FromGitter | <alehander42> @narimiran yeah i use it like `~name` so it doesn't clash |
10:16:34 | FromGitter | <alehander42> @PMunch ugh that sucks, how do people write destructors with your keyboard ? |
10:16:47 | * | zachcarter quit (Ping timeout: 240 seconds) |
10:16:47 | FromGitter | <alehander42> is it typical to your country layout? |
10:16:59 | FromGitter | <narimiran> i guess `AltGr+ something`? |
10:17:17 | FromGitter | <alehander42> yeah but I mean that `~` is relatively popular in some prog languages |
10:17:21 | FromGitter | <bung87> @alehander42 if you dont do something like this ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b9f7f31a56b215c974deb9c] |
10:17:45 | FromGitter | <narimiran> btw, my colleague uses croatian keyboard and he has trouble with a backtick |
10:18:02 | FromGitter | <alehander42> haha ~ and backtick are on the same key for me |
10:18:03 | FromGitter | <narimiran> (...and with square brackets, and lots of other 'normal' stuff) |
10:18:28 | FromGitter | <alehander42> well that's very sad, I'd use `%` or `^` but it adds much more noise |
10:18:29 | PMunch | @alehander42, yes it's like this by default on our keyboard. You have to do AltGr + <key with tilde on> and then hit a space |
10:18:46 | FromGitter | <alehander42> hm for me it's just shift + backtick |
10:19:02 | FromGitter | <alehander42> backtick is literally first class on my kb dunno why |
10:19:03 | PMunch | backtick is already shift+\ for me :P |
10:19:16 | PMunch | Which kinda makes sense |
10:19:16 | FromGitter | <narimiran> oh and \ is also altgr combination on croatian layout |
10:19:19 | FromGitter | <alehander42> § |
10:19:31 | FromGitter | <alehander42> i have this weird symbol too as shift + bulgarian key |
10:19:48 | PMunch | The idea with tilde is to be able to create things like ñ and õ |
10:19:57 | PMunch | Not that they are used in Norwegian though.. |
10:20:21 | FromGitter | <narimiran> and he writes a lots of latex, where \ is used quite a lot, but he refuses to use international standard layout |
10:21:23 | PMunch | Hmm, apparently adding {.nimcall.} to the proc in the tuple works.. |
10:21:26 | FromGitter | <alehander42> well , if he finds it ok, no problem |
10:22:48 | FromGitter | <narimiran> PMunch: that's good to know. i'll probably stumble on that one day, and ask you if you remember how did you fix it (instead of writing it down right now ;)) |
10:23:16 | FromGitter | <alehander42> ugh `^` looks weird |
10:24:04 | FromGitter | <narimiran> @alehander42 what is there left? `*`? `@`? |
10:25:43 | FromGitter | <alehander42> `*` wouldn't work for my case |
10:25:47 | FromGitter | <alehander42> `@` too |
10:26:14 | FromGitter | <alehander42> i match stuff, so i already use them: `*` for multiple matches etc |
10:32:53 | PMunch | &%¤#£¡§¦±«þ¥ªç®€ıß×µ unused characters that only require a single modifier to type on my layout :P |
10:46:13 | * | Arrrr joined #nim |
10:46:57 | * | stefanos82 joined #nim |
10:50:08 | Arrrr | Can't nim infer the type of an enum inside a set/array? For example: {A, B, C}, if a is of type Letter and B can be of type Letter/Button, if should be able to disambiguate |
10:51:37 | * | dddddd joined #nim |
10:52:23 | PMunch | Arrrr, what do you mean? This works fine http://ix.io/1mRG/Nim |
10:52:40 | FromGitter | <alehander42> @PMunch yeah but `&` and `%` already are a bit ambigious :( |
10:53:12 | PMunch | Yeah I was just trying to highlight how silly my layouts symbol choices are.. |
10:53:41 | PMunch | Best is shift+4 which gives ¤ |
10:53:45 | FromGitter | <alehander42> yeah :D |
10:53:51 | PMunch | I've never seen that used in my life! |
10:53:52 | FromGitter | <alehander42> honestly i am sticking with `~` for now |
10:54:10 | * | vivus joined #nim |
10:54:29 | FromGitter | <alehander42> maybe they use it for the city square-s |
10:54:38 | FromGitter | <alehander42> maybe you live on that symbol |
10:55:11 | Arrrr | I don't see muhc in that snippet. In devel, my example would complain |
10:58:14 | PMunch | alehander42, nope. It's a "currency" symbol. Back before Unicode they had an issue that if I type $100 in an e-mail and you opened it on a computer with a british character encoding it would show £100. To circumvent this confusion they came up with a generic "currency" symbol, the ¤ which was intended to take the character code-point of £, $, and other currency symbols. This would mean that it was up to the reading to decide which currency was most like |
10:58:14 | PMunch | ly intended. |
11:07:42 | * | Cthalupa quit (Ping timeout: 252 seconds) |
11:09:57 | * | Cthalupa joined #nim |
11:20:30 | * | ahiknsr23 joined #nim |
11:21:17 | * | ahiknsr23 quit (Remote host closed the connection) |
11:25:01 | FromGitter | <bung87> how to give a API let user provide a iterator? |
11:27:06 | FromGitter | <alehander42> you can always use a concept |
11:27:06 | FromGitter | <bung87> or should I let user provide a iterator factory proc? |
11:28:04 | * | krux02 joined #nim |
11:32:26 | FromGitter | <bung87> ```type ⏎ MinHasher*[T] = object ⏎ ⏎ tokenizer:SomeConecpt ???``` [https://gitter.im/nim-lang/Nim?at=5b9f90ca1ee2ca65022bb3a3] |
11:32:53 | FromGitter | <alehander42> I guess you can do |
11:33:32 | FromGitter | <alehander42> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b9f910cfcba1254facaeb6d] |
11:34:30 | FromGitter | <alehander42> but actually i have no idea if the c generation can put "an iterator" in a field |
11:35:49 | FromGitter | <bung87> well, make more complicated |
11:36:30 | FromGitter | <bung87> in python or js it’s just a function.. |
11:37:15 | TheLemonMan | what is `tokenizer` supposed to do? |
11:37:39 | FromGitter | <bung87> `iterator (x:string) : (string,int)` |
11:38:31 | TheLemonMan | make it a closure iterator if you really want it to be an iterator |
11:39:35 | FromGitter | <bung87> when it’s closure it just iterate once |
11:39:43 | TheLemonMan | no? |
11:46:38 | krux02 | yay a PR on nim-mode got merged |
11:53:21 | FromGitter | <bung87> https://github.com/Nim-NLP/minhash/blob/master/src/minhash.nim#L63 if I use direcly `slide ` this will work |
11:59:15 | * | enthus1ast joined #nim |
11:59:53 | enthus1ast | which module would you use for syntax highlighting nim code for a website? |
12:00:00 | enthus1ast | rstgen? |
12:01:34 | * | SenasOzys quit (Ping timeout: 240 seconds) |
12:01:47 | FromGitter | <bung87> generally it’s about js lib |
12:07:21 | TheLemonMan | bung87, uh that's weird, it should work the same |
12:07:30 | * | zachcarter joined #nim |
12:07:38 | TheLemonMan | way it does if you declare it as inline |
12:08:06 | zachcarter | it's not possible to resolve a value generated at runtime inside of a macro - is it? krux02 showed me something the other day - but I don't think that was a runtime value |
12:08:23 | zachcarter | since macros are resolved at compile time |
12:08:48 | krux02 | macros are compile time only |
12:08:51 | FromGitter | <bung87> when it’s in global namespace it has no diffriences between inline or closure, |
12:08:59 | krux02 | they don't exist at runtime anymore |
12:09:12 | zachcarter | okay |
12:09:13 | krux02 | so they can't access any runtime value |
12:09:21 | zachcarter | gotcha that makes sense - thank you |
12:09:27 | FromGitter | <bung87> in mine case , I declare all closure, but didnot work |
12:09:30 | zachcarter | I guess what I've been trying to do is impossible then |
12:09:42 | zachcarter | I'll need to figure out another way |
12:09:45 | krux02 | zachcarter, what do you try to yo then? |
12:10:00 | krux02 | I macros are for compile time code generation. |
12:10:22 | zachcarter | well - I am using emerald, but with some modifications to generate templates at compile time for HTML using a DSL |
12:10:23 | krux02 | so I don.t understand how you got to the idea to access a runtime value from there |
12:10:43 | krux02 | that is a bit meta |
12:10:47 | zachcarter | haha |
12:11:15 | krux02 | emaralds are mostly a sonic the Hedgehog thing to me. |
12:11:16 | zachcarter | yeah - I haven't really used macros extensively so it was my naievety / not realizing what emerald was producing wasn't going to be available at compile time |
12:11:20 | zachcarter | :P |
12:11:21 | zachcarter | http://flyx.github.io/emerald/ |
12:12:03 | krux02 | with html you have two categries of templates |
12:12:42 | krux02 | you have the nim templates that are evaluated at nim compilation time, and you have the html templates that are evaluated at html generation time (runtime) |
12:13:14 | krux02 | so talking about "templates" in a nim chat when you mean html-templates can be very confusing. |
12:13:19 | krux02 | maybe that is what confused you, too. |
12:13:20 | zachcarter | ah sorry |
12:14:06 | FromGitter | <Bennyelg> @zacharycarter wonderful |
12:15:08 | zachcarter | Bennyelg: what's that? |
12:15:21 | FromGitter | <Bennyelg> http://flyx.github.io/emerald/ |
12:15:37 | zachcarter | ah - that's flyx's library not mine |
12:15:42 | zachcarter | but it is a very nice library |
12:15:49 | FromGitter | <Bennyelg> yes indeed |
12:17:43 | * | SenasOzys joined #nim |
12:18:01 | * | SilentX joined #nim |
12:19:36 | * | SilentX quit (Remote host closed the connection) |
12:31:14 | FromGitter | <alehander42> i really underestimated nim's `if` until now |
12:31:27 | FromGitter | <alehander42> i didn't know i can define a local variable in it and use it in the branch |
12:31:39 | FromGitter | <alehander42> I mean, that's horrible for normal code, but it's helpful for macros |
12:31:50 | FromGitter | <alehander42> (define it in the condition) |
12:32:37 | FromGitter | <bung87> I ‘ve seen some example in `case`{| expr |} |
12:32:49 | FromGitter | <alehander42> also `if (when stuff: .. )` is a beautiful pattern |
12:33:01 | FromGitter | <alehander42> .. almost beautiful :D |
12:34:08 | FromGitter | <bung87> if when, why combines two? |
12:34:52 | FromGitter | <alehander42> because my macro needs it :( |
12:35:49 | FromGitter | <alehander42> but sometimes it's useful in macros: when you don't know much about your untyped args and you just generate two cases and let the compiler choose in the near future between them |
12:36:00 | FromGitter | <alehander42> so eg |
12:36:16 | FromGitter | <alehander42> `if (when a: b else: c)` |
12:36:22 | FromGitter | <alehander42> where b and c are different NimNode |
12:38:01 | FromGitter | <bung87> eh, what happen `if` a NimNode |
12:38:57 | FromGitter | <alehander42> basically the macro generates different code depending on the when |
12:39:27 | FromGitter | <alehander42> it doesn't really makes sense without context, if i finish my macro, i'll show an example |
12:40:13 | FromGitter | <bung87> I’m curious |
12:52:19 | * | leorize joined #nim |
12:53:12 | FromGitter | <tim-st> @bung87 https://github.com/tim-st/nim-zim/blob/79a3c7bd789b61aef61354158dbe44b840a5816b/zim.nim#L210 |
12:55:24 | FromGitter | <bung87> ah left value depends on CT |
12:56:02 | FromGitter | <tim-st> yes |
12:56:26 | FromGitter | <bung87> thanks! |
12:56:40 | * | dddddd quit (Ping timeout: 272 seconds) |
13:05:14 | * | ritchie_ joined #nim |
13:16:51 | * | opi_ quit (Quit: ZNC - http://znc.in) |
13:17:30 | * | opi_ joined #nim |
13:34:04 | * | enthus1ast quit (Ping timeout: 240 seconds) |
13:38:00 | * | kapil___ joined #nim |
13:56:34 | TheLemonMan | hmm, choosenim runs the whole testsuite each time it is run... that's bad for CI |
14:01:39 | krux02 | alehander42: I think for that case I use typed templates |
14:02:09 | krux02 | I generate expressions with template calls. And the templates are resolved during type checking phase. |
14:02:33 | TheLemonMan | welp, according to the benchmark results the machines used by travis are quite faster than this laptop heh |
14:05:05 | * | SenasOzys quit (Remote host closed the connection) |
14:06:36 | FromGitter | <kaushalmodi> I recently got this tip from @arnetheduck that you can cache the Nim installs on Travis. |
14:06:45 | FromGitter | <kaushalmodi> Ref: https://gitter.im/nim-lang/Nim?at=5b9ad06c8909f71f75ccf768 |
14:07:03 | FromGitter | <kaushalmodi> I use that tip here: https://github.com/kaushalmodi/hello_musl/blob/master/.travis.yml |
14:09:05 | * | SenasOzys joined #nim |
14:09:08 | TheLemonMan | oh I see.. |
14:10:03 | * | SenasOzys quit (Remote host closed the connection) |
14:10:20 | * | SenasOzys joined #nim |
14:12:13 | TheLemonMan | kaushalmodi, thank you for the nightly docs, just wanted to tell ya :) |
14:13:23 | FromGitter | <kaushalmodi> You are welcome! Though.. there's hardly anything in there that I can take credit for.. I just set up a travis job, that's it. |
14:14:12 | FromGitter | <kaushalmodi> It's send a PR for that to nim repo soon. @Araq will only need to get Github API token and set it to a `$GITHUB_API_TOKEN` env var in travis |
14:14:23 | FromGitter | <kaushalmodi> (not publicly revealed, of course) |
14:23:17 | FromGitter | <alehander42> @krux02 i think i've done that too, but in some cases the when solution is simpler |
14:25:54 | * | PMunch quit (Quit: Leaving) |
14:31:53 | * | trfl joined #nim |
14:33:56 | FromGitter | <alehander42> it would be cool if nimble init could work in `.` |
14:34:36 | * | brainproxy quit (Quit: WeeChat 2.2) |
14:35:27 | * | ftsf quit (Ping timeout: 240 seconds) |
14:36:46 | * | trfl quit (Remote host closed the connection) |
14:46:31 | FromGitter | <kaushalmodi> @Araq I meant `$GITHUB_OAUTH_TOKEN` env var in my prev message |
14:50:54 | zachcarter | if I have a macro that calls a proc that returns a NimNode, how can I take that NimNode and have the macro return it as AST (or another NimNode)? Is this possible? |
14:51:54 | FromGitter | <alehander42> so you want to return it as a result of your macro? |
14:52:04 | zachcarter | yes |
14:52:19 | zachcarter | but not as concrete Nim syntax - as abstract syntax - so it can be passed to another macro |
14:52:20 | FromGitter | <alehander42> but it seems you want something different |
14:52:23 | zachcarter | if that makes any sense |
14:52:25 | zachcarter | possibly |
14:52:33 | zachcarter | I'm still very new to a lot of this |
14:52:47 | FromGitter | <alehander42> so this macro : |
14:52:51 | FromGitter | <alehander42> is it ever called by the user |
14:52:57 | FromGitter | <alehander42> or only by your other macro |
14:53:23 | zachcarter | I'm thinking it will be called by my other macro |
14:53:25 | zachcarter | and not by the user |
14:53:35 | FromGitter | <alehander42> well, then you can just make it a compile time proc |
14:53:50 | FromGitter | <alehander42> which also returns a NimNode |
14:53:52 | zachcarter | okay - let me try that - thank you |
14:54:03 | * | miran joined #nim |
15:09:04 | * | Vladar quit (Remote host closed the connection) |
15:16:31 | * | noonien joined #nim |
15:27:47 | * | Vladar joined #nim |
15:28:04 | FromGitter | <bung87> TheLemonMan that still not work even I try to pass a iterator factor, some test pass, some failure,it gets more weird. |
15:29:48 | FromGitter | <bung87> if pass a iterator none get pass, before all these (when not provide tokenizer API), all works. |
15:37:28 | TheLemonMan | bung87, is the code available anywhere? |
15:38:01 | FromGitter | <bung87> yeh https://github.com/Nim-NLP/minhash |
15:42:17 | pigmej | krux02: awesome work with the prs to nim-mode :) |
15:42:37 | FromGitter | <bung87> I updated something ,now if just use `slide` directly all test will be passed |
15:42:48 | * | Trustable joined #nim |
15:44:06 | * | Vladar quit (Remote host closed the connection) |
15:45:26 | TheLemonMan | what test should I try to run? |
15:45:47 | FromGitter | <bung87> test1.nim enough |
15:47:34 | TheLemonMan | it fails with and without the closure annotation |
15:49:07 | * | Vladar joined #nim |
15:49:29 | FromGitter | <bung87> I remember I tried both |
15:52:37 | FromGitter | <bung87> this time I tried switch two blocks ,each block works but two will fails.. |
15:53:15 | TheLemonMan | oh well, the test works if I change the second block assertion from `low_j < high_j` to `low_j <= high_j` |
15:54:26 | * | S3l3ct3d joined #nim |
15:56:35 | * | S3l3ct3d quit (Killed (Sigyn (Spam is off topic on freenode.))) |
15:56:54 | FromGitter | <bung87> that doest make sense |
15:58:07 | TheLemonMan | I have no idea what I'm looking at, sorry |
15:59:50 | FromGitter | <bung87> is there some code apparently wrong? |
16:01:08 | TheLemonMan | no idea, the ngrams iteration looks fine here |
16:02:08 | FromGitter | <bung87> ok, thank you ! guess we need a break. |
16:03:13 | * | floppydh quit (Quit: WeeChat 2.2) |
16:07:08 | * | kapil___ quit (Quit: Connection closed for inactivity) |
16:11:40 | FromDiscord | <treeform> Hey guys can you help me out with this error: https://github.com/nim-lang/Nim/issues/8994 Can you run the simple script couple of times and see if you get crashes? |
16:13:45 | TheLemonMan | yeah, it's truncated |
16:14:05 | FromDiscord | <treeform> if you run it ever and over again? do you get it right? |
16:14:11 | FromDiscord | <treeform> For me parts in the middle are missing |
16:14:26 | FromDiscord | <treeform> but its random probably based on net speed or some thing... |
16:14:58 | TheLemonMan | yeah, random chunks |
16:15:05 | FromDiscord | <treeform> what OS do you have? Can you append that info to the bug ticket? |
16:15:23 | FromDiscord | <treeform> the nim -v stuff |
16:15:23 | TheLemonMan | linux |
16:15:33 | FromDiscord | <treeform> neat, I am on windows |
16:15:37 | FromDiscord | <treeform> so we got most OSes covered |
16:18:24 | AlexMax | Is there a limit to the amount of "type" lookahead in Nim? |
16:19:50 | AlexMax | I have a function pointer type very early in this file (line 197) that takes a ptr "text_edit" as a parameter, and nim complains about not being able to find the "text_edit" type |
16:21:28 | AlexMax | text_edit is implemented on line 1380, within the same type block |
16:23:45 | FromGitter | <mratsim> there is no limit, are you sure you didn’t switch to another type section? |
16:24:05 | AlexMax | Reasonably sure. Let me dump the entire nim file |
16:29:19 | AlexMax | hrm, I started from scratch and now I can't replicate the error... |
16:31:22 | AlexMax | okay yeah I'm no longer getting the error *shrug* |
16:38:52 | krux02 | pigmej, thank you |
17:02:42 | FromGitter | <Vindaar> is there some documentation about testament? I'm a little confused what the `file` should be used for |
17:03:28 | * | gangstacat quit (Read error: Connection reset by peer) |
17:03:33 | * | gangstacat_ joined #nim |
17:08:49 | FromGitter | <bung87> TheLemonMan news,the release mode whether pass a iterator or iterator factor all works ! |
17:09:43 | TheLemonMan | hmm, are you using a devel compiler? |
17:10:13 | FromGitter | <bung87> yeah ,I prefer use devel branch |
17:11:35 | FromGitter | <bung87> ah it is simple as in python and js, but don’t know what happen in debug mode. |
17:12:59 | TheLemonMan | that's extremely weird, can you upload the latest version of the code plus some brief and detailed instructions of how to make the tests fail/pass ? |
17:14:12 | FromGitter | <unreadable> hey, anyone familiar with nginx that could help me? |
17:15:34 | FromGitter | <bung87> yeah, let me trace the changes. |
17:19:33 | * | gangstacat_ quit (Ping timeout: 250 seconds) |
17:30:40 | FromGitter | <bung87> https://github.com/Nim-NLP/minhash/issues/1 |
17:32:54 | * | MrTrick29 joined #nim |
17:34:16 | FromGitter | <bung87> `clang: error: no such file or directory: '/Users/bung/.cache/nim/test2_r/murmur3.c.o’` seems devel branch also have a cache problem . |
17:35:41 | * | MrTrick29 quit (Remote host closed the connection) |
17:42:01 | TheLemonMan | bung87, is `hasher.jaccard("This is a doc", "This is a doc")` supposed to return 1? |
17:42:35 | FromGitter | <bung87> yes , since same content |
17:43:08 | FromGitter | <bung87> do I describe the problem clearly? (worried about my english level) |
17:43:09 | TheLemonMan | well fuck, it outputs 0.5 here |
17:44:08 | FromGitter | <bung87> hmm when replace `tokenizer` to `slide` in hash function I can have brief of the results. |
17:44:54 | TheLemonMan | yeah, it works if you do that replacement |
17:46:15 | FromGitter | <bung87> so, this looks very weird, especially swich the test1.nim blocks case. |
17:47:34 | * | SenasOzys quit (Ping timeout: 240 seconds) |
17:51:54 | FromGitter | <tim-st> what happens when I use `Stream.readData` and the position+length > fileSize ? |
17:52:29 | FromGitter | <tim-st> the docs say "low level proc that reads data into an untyped `buffer` of `bufLen` size." |
17:53:08 | FromGitter | <tim-st> oh, I see the number is returnt |
17:55:12 | * | preaction3 joined #nim |
17:57:10 | * | Superdawg5 joined #nim |
17:57:50 | * | Superdawg5 quit (Remote host closed the connection) |
17:58:52 | TheLemonMan | bung87, here's your problem: once your closure iterator is consumed you won't get anything out of it for any of the following uses |
17:59:54 | * | preaction3 quit (Remote host closed the connection) |
18:01:25 | * | stefanos82 quit (Quit: Quitting for now...) |
18:02:16 | FromGitter | <bung87> so the debug mode is right results? |
18:05:11 | TheLemonMan | yeah, if I rewind the iterator using some dirty low-level magic the tests pass |
18:06:01 | TheLemonMan | haha, wanna know why the tests pass with -d:release? |
18:06:10 | TheLemonMan | because `assert` are compiled out :D |
18:06:30 | FromGitter | <bung87> that’s funny.. |
18:08:07 | FromGitter | <bung87> then do I still need provide iterator as API? |
18:10:06 | FromGitter | <bung87> or make it behave as python’s generator. |
18:11:49 | FromGitter | <kaushalmodi> doAssert don't get compiled out, right? |
18:12:37 | TheLemonMan | if you don't mind some dirty trick there's https://gist.github.com/77f15d708b59877d26f6c3e2edc30793, call this after you're done with the iterator and it'll be usable again |
18:12:44 | TheLemonMan | kaushalmodi, yep |
18:20:32 | * | MyMind quit (Ping timeout: 244 seconds) |
18:21:26 | FromGitter | <bung87> ah… can’t figure out where to place it... |
18:22:06 | TheLemonMan | bung87, after `result[s] = curHash` |
18:24:09 | FromGitter | <bung87> the args proc int what to pass? |
18:25:00 | TheLemonMan | tokenizer and n = 0 |
18:25:20 | TheLemonMan | all it does is reset the state machine the closure compiler gets compiled down to |
18:25:29 | * | Arrrr left #nim (#nim) |
18:26:34 | FromGitter | <bung87> wow , I like this, makes like a python generator. |
18:28:02 | * | Vladar quit (Remote host closed the connection) |
18:28:03 | * | MyMind joined #nim |
18:28:21 | * | SenasOzys joined #nim |
18:30:08 | FromGitter | <bung87> seems `slide` with closure also acts like this. |
18:36:20 | * | xet7 quit (Quit: Leaving) |
18:41:07 | * | tefter joined #nim |
18:43:45 | * | vivus quit (Remote host closed the connection) |
18:44:13 | federico3 | who wants to nimify https://github.com/s-macke/Interplanetary-Postal-Service ? :) |
19:00:09 | * | stefanos82 joined #nim |
19:04:49 | * | mephinet15 joined #nim |
19:05:29 | * | mephinet15 quit (Remote host closed the connection) |
19:07:44 | FromGitter | <bung87> I can sleep now,tanks to lemonman |
19:14:12 | TheLemonMan | it's a dirty workaround, you should really think of a better API :P |
19:15:42 | * | ldlework[MIA] is now known as ldlework |
19:17:40 | FromGitter | <bung87> yeah Seems prefer use macro provide a inline iterator as param |
19:19:20 | TheLemonMan | or maybe not, maybe we should just slap this snippet in the stdlib |
19:23:07 | FromGitter | <bung87> then that user can intend pass a closure iterator,works as expected |
19:25:05 | FromGitter | <bung87> I want provide both version.allow pass inline or closure iterator also other iterable type |
19:25:52 | TheLemonMan | well you can't pass around inline iterators |
19:26:28 | * | gangstacat joined #nim |
19:27:31 | FromGitter | <bung87> the manual says can pass to macro,template? |
19:27:44 | * | dddddd joined #nim |
19:28:16 | TheLemonMan | oh sure, but not procedures |
19:32:42 | FromGitter | <bung87> think about if I can just convert inline to closure |
19:34:32 | FromGitter | <kayabaNerve> Petition to make every single Nim proc/iterator/template/macro... inline unless the new {.outline.} pragma is used. |
19:34:49 | FromGitter | <kayabaNerve> 🤔 |
19:35:25 | * | enen27 joined #nim |
19:40:21 | FromGitter | <bung87> I’d prefer get the generator keyword,that will simple solve my problem:) |
19:41:16 | * | aerth joined #nim |
19:41:27 | * | enen27 quit (Ping timeout: 240 seconds) |
19:41:37 | aerth | whats goin on here |
19:45:52 | TheLemonMan | nothing much |
19:48:41 | FromGitter | <arnetheduck> @kayabaNerve here's an example of that line of thought: https://github.com/status-im/nim-chronicles/issues/29 :) |
20:01:39 | * | mcc joined #nim |
20:08:50 | * | Trustable quit (Remote host closed the connection) |
20:10:42 | * | zachcarter quit (Ping timeout: 252 seconds) |
20:10:44 | * | Vladar joined #nim |
20:10:45 | * | miran quit (Ping timeout: 252 seconds) |
20:12:33 | aerth | 213kb hello world, not too shabby! |
20:13:00 | FromGitter | <kaushalmodi> It can be 16kb ;-) |
20:13:40 | FromGitter | <kaushalmodi> on GNU/Linux type OSes |
20:13:41 | aerth | ah i just stripped it and its 175k, im guessing theres a compiler option for smaller |
20:13:53 | FromGitter | <kaushalmodi> yes, `--opt:size` |
20:14:11 | FromGitter | <kaushalmodi> See the config.nims in https://github.com/kaushalmodi/hello_musl |
20:14:13 | TheLemonMan | or 142 bytes http://timelessname.com/elfbin/ |
20:14:59 | FromGitter | <kaushalmodi> TheLemonMan: Is that Nim generated? |
20:15:20 | TheLemonMan | ofc not :) |
20:15:28 | aerth | got down to 111k after --opt:size && strip, not sure about no 16kb! |
20:15:35 | FromGitter | <kaushalmodi> see upx |
20:15:57 | * | abm quit (Quit: Leaving) |
20:16:01 | FromGitter | <kaushalmodi> https://github.com/kaushalmodi/hello_musl/blob/master/.travis.yml#L49-L57 |
20:16:09 | FromGitter | <kayabaNerve> @arnetheduck Use a template that then calls a proc. :thinking: |
20:17:15 | FromGitter | <kaushalmodi> aerth: In summary, use `-d:release --opt:size` and then `strip -s` + `upx --best` |
20:19:27 | aerth | kaushalmodi: woah upx looks neat , thank you |
20:25:26 | dom96 | aerth: https://hookrace.net/blog/nim-binary-size/ |
20:27:24 | * | aerth faints |
20:31:54 | aerth | what can't you write with nim? and is there anything that seems to be kind which most nim programs are? |
20:32:09 | aerth | good for reverse proxys? |
20:37:17 | * | nsf quit (Quit: WeeChat 2.2) |
20:45:11 | stefanos82 | with -d:release --opt:size I got it from 106K to 44K; not bad |
20:45:53 | aerth | yup 44k here too |
20:47:28 | stefanos82 | dom96: since we use -d:release and --opt:size, shouldn't "strip -s" be used somehow to reduce the size even further? |
20:48:30 | aerth | yeah strip -s 30960 bytes |
20:48:49 | aerth | after upx , 15580 bytes |
20:48:53 | stefanos82 | with strip -s, I reduce my already reduced binary from 44k to 32k |
20:49:27 | stefanos82 | aerth: sometimes binaries that got compressed with upx can be considered as false positives |
20:49:31 | stefanos82 | especially under windows |
20:50:04 | aerth | stefanos82: ah because virii like to use upx i bet! |
20:50:30 | stefanos82 | I have no idea what they use |
20:54:51 | * | gangstacat quit (Read error: Connection reset by peer) |
20:59:07 | * | Jesin quit (Quit: Leaving) |
21:03:22 | * | Jesin joined #nim |
21:07:49 | FromGitter | <kaushalmodi> How do I get the value of compile-time defines.. example `nim c -d:foo=abc test.nim` |
21:08:14 | FromGitter | <kaushalmodi> How do I check for the defined foo's value in test.nim? |
21:08:42 | FromGitter | <kaushalmodi> `defined(foo)` tells only if I set the `-d:foo` switch or not |
21:10:36 | FromGitter | <kaushalmodi> got it: https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compile-time-define-pragmas |
21:16:31 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
21:16:45 | * | craigger quit (Quit: bye) |
21:17:00 | * | craigger joined #nim |
21:36:27 | * | Vladar quit (Remote host closed the connection) |
21:57:10 | * | gangstacat joined #nim |
22:15:38 | AlexMax | Hrm, it looks to me like 'or' has to be implemented for enums |
22:16:35 | AlexMax | Is there a more...acceptable pattern for when enums are espected to be combined like bitfields? |
22:21:44 | FromGitter | <kaushalmodi> You can or the `ordinal` of the enums |
22:25:58 | AlexMax | what if I just implement `or` for the specific enum type? |
22:29:22 | FromGitter | <kaushalmodi> You can do that. I think the reason or'ing of enums isn't implemented is, what if the or'ed ordinal value doesn't have a corresponding enum? So it's better if the user does the ordinal back to enum convertion themselves and catch such errors. |
22:29:30 | AlexMax | That makes a ton of sense actually |
22:29:56 | AlexMax | I wonder if enum's representing a bitfield might convince somebody to have a shorthand special case of enum to signify a bitfield |
22:29:59 | AlexMax | I think C# has this |
22:30:24 | AlexMax | https://stackoverflow.com/questions/8447/what-does-the-flags-enum-attribute-mean-in-c |
22:33:55 | AlexMax | perhaps not necessary though, imho - the `or` proc definition already exists |
22:37:22 | FromGitter | <kaushalmodi> This might be not relevant to your application. But based on that example, I can think of using enum sets. Adding enums to a set would be kind of the or'ing in that example. You'd then need to interpret those sets of multiple enum values. |
22:44:24 | * | zachcarter joined #nim |
23:11:11 | AlexMax | yay, i finally got something to render |
23:11:18 | AlexMax | ....and by something I mean nothing, nothing renders :P |
23:11:31 | AlexMax | but at least there are no crashes |
23:13:34 | * | ftsf joined #nim |
23:29:02 | AlexMax | zachcarter: I have made good on my promise, but I'm still working on it :P |
23:29:41 | FromGitter | <zetashift> the nuklear bindings? |
23:30:30 | AlexMax | Yessir |
23:31:10 | AlexMax | https://github.com/AlexMax/nimnuklear |
23:31:31 | AlexMax | Currently the demo compiles and runs and doesn't crash |
23:31:37 | AlexMax | still trying to get something to render though :P |