01:13:28 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
01:15:26 | * | abm quit (Ping timeout: 250 seconds) |
01:29:40 | FromDiscord_ | <exelotl> What will destructors mean for embedded? Will it be possible to have as fine control over memory and use as few resources as `--gc:none` currently does? |
01:30:37 | FromDiscord_ | <exelotl> I've checked `--gc:regions` and it's really not cutting it for me, uses too much memory doing things I never wanted in the first place |
01:43:51 | * | skellock joined #nim |
01:48:25 | * | zachk quit (Quit: Leaving) |
02:00:19 | rayman22201 | I expect it will be closer to `--gc:none`, but idk for sure. `--gc:destructors` is implemented in the latest devel, so you can try it now. |
02:02:33 | rayman22201 | destructors is actually fully implemented afaik (modulo possible bugs), the parts still missing are the stdlib support; specifically destructor based `seq` and `string` are still wip. |
02:03:16 | * | dddddd quit (Ping timeout: 268 seconds) |
02:06:51 | FromDiscord_ | <exelotl> Oh okay thanks, I'll give it a try |
02:06:51 | * | zyklon_ quit (Read error: Connection reset by peer) |
02:09:16 | zestyr | Is the github wiki page on destructors up to date, or is there better documentation now? |
02:10:14 | rayman22201 | the wiki and reading the source are probably your best bet atm. |
02:10:33 | rayman22201 | Still too early for good docs :-) |
02:10:43 | rayman22201 | use at your own risk lol |
02:15:58 | * | dddddd joined #nim |
02:17:04 | * | Snircle quit (Read error: Connection reset by peer) |
02:17:38 | * | Snircle joined #nim |
02:24:58 | * | zyklon_ joined #nim |
03:01:11 | FromGitter | <arnetheduck> hey @genotrance, you around? care to run that one-liner again? |
03:02:06 | * | banc quit (Quit: Bye) |
03:03:49 | * | skellock quit (Quit: WeeChat 2.3) |
03:10:14 | FromGitter | <arnetheduck> or anyone else on linux, if you could try the following line in an empty directory: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c468996c45b986d119beb20] |
03:14:22 | FromGitter | <qqtop> @arnetheduck it works here , says: space mutants |
03:14:46 | zestyr | works, compiles and outputs space mutants |
03:15:12 | FromGitter | <arnetheduck> @qqtop ooh, nice, thanks :) that's the new continuous build of `nlvm` in action |
03:16:39 | zestyr | tried compiling some other code but got this (not sure if relevant): /tmp/.mount_nlvmKuhMTL/Nim/lib/system/gc.nim(31, 10) Error: cannot open file: sharedlist |
03:23:18 | * | banc joined #nim |
03:36:42 | * | zachcarter quit (Ping timeout: 250 seconds) |
04:03:46 | * | nsf joined #nim |
04:05:32 | FromGitter | <arnetheduck> oh, that's a bummer, thanks.. I think I know what it is, think I forgot some config file |
04:06:13 | * | darithorn quit (Quit: Leaving) |
04:06:41 | * | zachcarter joined #nim |
04:10:53 | * | zachcarter quit (Ping timeout: 245 seconds) |
04:12:48 | * | zachcarter joined #nim |
04:17:26 | * | zachcarter quit (Ping timeout: 250 seconds) |
04:23:36 | shashlick | Sorry was out |
05:11:29 | ldlework | http://www.ccs.neu.edu/home/stchang/pubs/ckg-popl2017.pdf |
05:15:43 | FromGitter | <arnetheduck> hey @zestyr or @shashlick, mind trying that again with a freshly downloaded version? should be fixed |
05:16:00 | zestyr | same link? |
05:17:52 | FromGitter | <arnetheduck> yeah |
05:18:47 | * | narimiran joined #nim |
05:18:59 | FromGitter | <arnetheduck> points to https://github.com/arnetheduck/nlvm/releases/tag/continuous which I'm setting up as an experimental build.. feedback welcome |
05:27:26 | shashlick | Hey @arnetheduck what are you testing here |
05:35:14 | FromGitter | <arnetheduck> nlvm binary that also has the stdlib built in, so have a single executable with everything needed, basically, to compile nim programs (well, still need gcc to link) @shashlick |
05:38:12 | ldlework | dom96: you might find that paper pretty interesting |
05:48:25 | * | ryukoposting quit (Quit: WeeChat 1.6) |
05:49:21 | shashlick | Nice - are you using something like holy build box to make it cross distro? |
05:57:48 | * | lritter joined #nim |
06:04:39 | * | dddddd quit (Ping timeout: 244 seconds) |
06:06:59 | * | ftsf joined #nim |
06:07:56 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
06:13:41 | * | zachcarter joined #nim |
06:17:47 | * | zachcarter quit (Ping timeout: 240 seconds) |
06:18:47 | * | kapil____ joined #nim |
06:32:03 | * | absolutejamPhone quit (Ping timeout: 246 seconds) |
06:32:22 | * | absolutejamPhone joined #nim |
06:45:16 | * | donlzx joined #nim |
07:06:23 | zestyr | arnethedock: works now! but my programs segfault on exit |
07:06:34 | zestyr | it's using C FFI, not sure if that matters |
07:10:21 | * | krux02 joined #nim |
07:11:45 | * | ftsf quit (Quit: Leaving) |
07:11:45 | * | zyklon_ quit (Read error: Connection reset by peer) |
07:29:32 | * | absolutejamPhone quit (Read error: Connection reset by peer) |
07:29:48 | * | zyklon_ joined #nim |
07:40:54 | * | zachcarter joined #nim |
07:41:58 | * | Jesin quit (Ping timeout: 250 seconds) |
07:45:36 | * | zachcarter quit (Ping timeout: 268 seconds) |
07:47:08 | Araq | https://github.com/nim-lang/RFCs/issues/122 |
07:47:21 | Araq | worth discussing. |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:02:13 | * | absolutejamPhone joined #nim |
08:04:45 | * | gmpreussner joined #nim |
08:04:50 | * | absolutejamPhone quit (Client Quit) |
08:05:08 | * | absolutejamPhone joined #nim |
08:25:15 | * | absolutejam joined #nim |
08:38:18 | * | absolutejamPhone quit (Read error: Connection reset by peer) |
09:01:26 | FromGitter | <mratsim> replied |
09:04:54 | * | Vladar joined #nim |
09:08:09 | * | Cthalupa quit (Ping timeout: 246 seconds) |
09:09:32 | * | Cthalupa joined #nim |
09:10:07 | * | donlzx quit (Quit: Leaving) |
09:17:45 | * | kapil____ quit (Quit: Connection closed for inactivity) |
09:24:23 | * | abm joined #nim |
09:25:02 | * | zachcarter joined #nim |
09:28:17 | * | PMunch joined #nim |
09:29:16 | * | zachcarter quit (Ping timeout: 246 seconds) |
09:29:47 | * | FromGitter quit (Remote host closed the connection) |
09:29:48 | * | oprypin quit (Quit: Bye) |
09:31:43 | * | abm quit (Ping timeout: 245 seconds) |
09:32:17 | * | FromGitter joined #nim |
09:33:20 | * | zachcarter joined #nim |
09:35:27 | * | vonHabsi1 quit (Ping timeout: 244 seconds) |
09:35:34 | * | vonHabsi__ quit (Ping timeout: 246 seconds) |
09:40:17 | * | vonHabsi joined #nim |
09:46:23 | * | vonHabsi quit (Ping timeout: 268 seconds) |
09:50:27 | * | vonHabsi joined #nim |
09:53:14 | * | vonHabsi_ joined #nim |
10:00:46 | * | vonHabsi_ quit (Ping timeout: 244 seconds) |
10:00:53 | * | vonHabsi quit (Ping timeout: 245 seconds) |
10:09:38 | * | vonHabsi joined #nim |
10:13:24 | * | vonHabsi_ joined #nim |
10:16:06 | PMunch | Hmm, did the defer at top level limitation get re-instated in devel? |
10:18:14 | * | nc-x joined #nim |
10:18:25 | nc-x | PMunch: yes |
10:18:55 | nc-x | actually it was a regression that the error for top level defer was not being given |
10:19:54 | * | vonHabsi quit (Ping timeout: 246 seconds) |
10:19:55 | nc-x | https://github.com/nim-lang/Nim/issues/10186 araq asked here to forbid it |
10:20:03 | * | vonHabsi_ quit (Ping timeout: 245 seconds) |
10:20:22 | * | nc-x quit (Client Quit) |
10:21:08 | * | floppydh joined #nim |
10:21:19 | PMunch | Yeah I was wondering about that, I think it was causing some strange issues in my code |
10:21:23 | Araq | I still think 'defer' sucks |
10:22:09 | Araq | try finally is much cleaner and not eternally confused about its scopes |
10:24:10 | PMunch | Well, I use defer for SDL stuff. I want to keep my renderer, sdl2 instance, image and TTF subsystems, and my window around until I quit my application. I would need to put essentialy my entire program in nested try catches for that if I wasn't using defer |
10:24:27 | PMunch | Well maybe not nested, but I would still need to put them all in a new scope |
10:24:39 | Araq | or you use a helper proc. |
10:25:17 | PMunch | http://ix.io/1yVA/Nim |
10:25:22 | PMunch | Take that as an example |
10:25:39 | * | stefanos82 joined #nim |
10:25:55 | PMunch | The logic surrounding those defers and whan to clean up what would be a bit tricky with a try catch |
10:26:19 | * | nc-x joined #nim |
10:26:20 | PMunch | Say that it fails the nil check for the window, I must then release the things allocated before that, but not after |
10:26:26 | nc-x | is defer still required after destructors? |
10:27:02 | PMunch | Hmm, I guess not |
10:27:20 | PMunch | As long as the library properly implements them |
10:27:27 | PMunch | Or there is a way to do it yourself |
10:27:41 | PMunch | Hei, nimlsp now has 50 stars on GitHub :) |
10:27:49 | nc-x | so IMO it would be better to remove defer from the language. |
10:28:00 | FromGitter | <likemik60537659_twitter> @2vg Hi why did you stop working on mofuw ? |
10:28:12 | nc-x | PMunch: great.. how usable is it? |
10:29:32 | * | nc-x quit (Client Quit) |
10:29:41 | PMunch | Well, I use it every day. So pretty usable I'd say :) |
10:30:01 | leorize | If it has all the suggestion features I'd just direct my neovim plugin users to it :P |
10:30:55 | PMunch | Define "all the suggestion features" |
10:31:04 | leorize | basically autocomplete |
10:31:19 | FromGitter | <alehander42> does it work for other backends |
10:31:26 | FromGitter | <alehander42> i often had problems with my previous plugin |
10:31:31 | leorize | I'm rather skeptical to pick an async completion plugin to implement that on |
10:31:46 | FromGitter | <alehander42> when using it on jsbackend stuff |
10:32:16 | PMunch | alehander42, well it uses nimsuggest. So whatever that supports nimlsp supports |
10:32:18 | * | dom96_w joined #nim |
10:32:33 | PMunch | leorize, autocomplete works yes |
10:33:00 | PMunch | github.com/PMunch/nimlsp#supported-protocol-features |
10:33:09 | FromGitter | <alehander42> hm, i'll check |
10:34:28 | FromGitter | <alehander42> if nimsuggest can deal with `defined` stuff, that's an important thing to fix there |
10:45:14 | FromGitter | <alehander42> @PMunch i don't undestand something about nimlsp |
10:45:28 | PMunch | What don't you understand about it? |
10:45:34 | FromGitter | <alehander42> i can't see how can i hint the nim folder in sublime settings |
10:45:38 | FromGitter | <alehander42> and looking at the source |
10:45:48 | FromGitter | <alehander42> it seems if it doesnt get an explicit command arg |
10:45:56 | FromGitter | <alehander42> it uses currentSourcePath which sounds wrong |
10:46:18 | FromGitter | <alehander42> (or does this mean it uses its own nim submodule) |
10:46:26 | PMunch | You need to pass it as an argument |
10:46:43 | FromGitter | <alehander42> in the "command" |
10:46:45 | FromGitter | <alehander42> hm ofc |
10:46:50 | PMunch | If you compile it from it's own sources it will default to that, otherwise it will need to be passed as an argument when the process is launched |
10:47:13 | PMunch | Typically your editor has some way of sending command line arguments to the program in the LSP configuration |
10:47:47 | FromGitter | <alehander42> yeah |
10:47:56 | FromGitter | <alehander42> i didnt realize i can also pass the args there |
10:49:49 | PMunch | Saves the hassle of having yet another config file :) |
10:53:46 | FromGitter | <alehander42> wtf sublime has inline css color pickers |
10:53:58 | FromGitter | <alehander42> now |
10:54:00 | FromGitter | <alehander42> the future has arrived |
10:54:38 | * | vlad1777d quit (Ping timeout: 245 seconds) |
11:07:36 | * | vlad1777d joined #nim |
11:08:14 | PMunch | What? |
11:10:20 | * | dddddd joined #nim |
11:10:57 | FromGitter | <alehander42> for a long time sublime didnt really have good custom inline style/gadgets api support |
11:11:19 | FromGitter | <alehander42> so e.g. color pickers worked by spawning a separate native window with separate ui |
11:11:24 | PMunch | Aaah |
11:11:31 | PMunch | Yeah I can see how that would suck |
11:11:43 | FromGitter | <alehander42> it seems they added new abilites to the view api |
11:11:53 | FromGitter | <alehander42> vscode competition is good after all |
11:12:31 | FromGitter | <alehander42> btw now nimlsp starts fine |
11:12:32 | Araq | please keep me updated, I keep flirting with Sublime |
11:12:57 | FromGitter | <alehander42> but i never find it in the LSP "choose a server" list |
11:13:32 | FromGitter | <alehander42> Araq, have you tried SublimeMerge btw: they made a git client not a long ago |
11:15:18 | PMunch | alehander42, do you have NimLime installed? |
11:15:24 | * | zyklon_ quit (Read error: Connection reset by peer) |
11:15:58 | FromGitter | <alehander42> yes |
11:16:41 | PMunch | Hmm, strange |
11:16:59 | PMunch | And NimLime sees the .nim file as a valid file and runs syntax highlighting and such on it? |
11:17:36 | PMunch | It should just be a matter of enabling the LSP server for Nim globally |
11:17:40 | PMunch | IIRC |
11:20:05 | FromGitter | <alehander42> yes, i usually use only nimlime |
11:20:58 | FromGitter | <alehander42> i'll play with the completion options |
11:21:00 | FromGitter | <alehander42> just in cas |
11:21:08 | narimiran | PMunch: i'm not familiar with LSP — is there any benefit of using your package in vscode compared to the current nim plugin? |
11:21:58 | * | zachcarter quit (Ping timeout: 268 seconds) |
11:22:35 | PMunch | Hmm, probably not much |
11:22:47 | FromGitter | <alehander42> waiit |
11:22:48 | FromGitter | <alehander42> yeah |
11:22:49 | FromGitter | <alehander42> i see |
11:22:56 | FromGitter | <alehander42> the problem is that if i add enabled: true |
11:22:58 | PMunch | The benefit of LSP is mostly that you will get the same level of support for any IDE that supports LSP |
11:23:02 | FromGitter | <alehander42> it's actually enabled already |
11:23:09 | PMunch | But a tailored plug-in will probably always be better |
11:23:14 | FromGitter | <alehander42> so sublime doesnt show it in the 'enable' list obviously |
11:23:19 | PMunch | alehander42, aha |
11:23:21 | narimiran | PMunch: thanks |
11:23:29 | PMunch | That makes sense I guess |
11:24:04 | Araq | pfff tailored plugins, that's heresy. We're after an equally mediocre experience for every editor. Praise LSP! |
11:24:14 | PMunch | narimiran, that being said many of the Nim plugins out there are a bit out of date, so having one consolidated effort on making nimlsp work is probably the best long-term solution |
11:24:58 | PMunch | Araq, haha. Yeah I'm not touting LSP as the be all, end all of plug-ins. But it's a nice way to allow people to write Nim in pretty much any editor. |
11:26:10 | PMunch | Still has the slight issue of requiring some way of syntax highlighting and document recognition though, things which I don't think are included in the LSP spec |
11:26:10 | Araq | yeah, you convinced my months ago, I haven't changed my mind |
11:26:11 | FromGitter | <alehander42> PMunch: so what should be possible currently in e.g. sublime: autocompletion / hovering seeing definition? |
11:27:07 | PMunch | Autocompletion, hovering to see the definition and doc-comment, then you have three buttons (in Sublime) that can show you references to that function, jump to the defenition, and one more thing (rename?) |
11:27:21 | FromGitter | <alehander42> yeah i saw those while trying |
11:27:24 | FromGitter | <alehander42> the typescript lsp |
11:27:27 | FromGitter | <alehander42> to compare |
11:27:30 | PMunch | It also supports error checking on save (which will highlight errors in the document) |
11:28:12 | Araq | does LSP support a "mini map" / code folding? |
11:28:44 | PMunch | I don't think so, unless I misunderstand what you mean |
11:28:55 | PMunch | Those would be more syntactic/display features |
11:28:59 | Araq | pity |
11:29:21 | Araq | does it support 'dus'? |
11:29:41 | narimiran | PMunch: "(...) references to that function, jump to the definition" --> well, the current nim plugin for vscode has (sometimes) trouble with that, so LSP might be better already |
11:29:47 | FromGitter | <alehander42> what does minimap / code folding have to do with lsp, they're editor token/grammar based features |
11:30:10 | narimiran | it is ok, if it is a function that you have defined in that file, but if it is in some other file - bummer |
11:30:11 | PMunch | alehander42, exactly. |
11:30:22 | FromGitter | <alehander42> i fold nim code often |
11:30:43 | Araq | rigtht... and editors are known to provide good Nim parsers on their own |
11:30:43 | FromGitter | <alehander42> i always have a minimap of it too |
11:30:50 | PMunch | narimiran, it works pretty well, can even take you to the body of a macro that generated a procedure. But other times it fails, not entirely sure why |
11:31:16 | Araq | 'dus' is one of my favourite features, no editor has it though. :-/ |
11:31:25 | PMunch | Araq, well that is what I was saying. Along with nimlsp editors also need syntax highlighting and document recognition |
11:31:31 | FromGitter | <alehander42> Araq, in any case, this should be part of the same abstraction that deals with giving highlighting info |
11:31:31 | PMunch | What does dus do again? |
11:31:33 | FromGitter | <alehander42> not with lsp |
11:31:42 | narimiran | ok, i might give it a try some day :) i'll probably spend too much trying to make it work (that's on me, not on you ;)), so i need a weekend for that :D |
11:32:03 | Araq | 'dus': goto definition unless you're on the definition then it's goto usages |
11:32:13 | * | zyklon_ joined #nim |
11:32:22 | Araq | basically "jump to what I think" |
11:32:33 | PMunch | Hmm, I don't think that's supported.. |
11:32:41 | FromGitter | <alehander42> well, lsp provides all the needed primitives |
11:32:43 | PMunch | But I guess an editor could support that |
11:32:59 | FromGitter | <alehander42> a plugin/editor can add dus to context menu/shortcut |
11:33:14 | FromGitter | <alehander42> e.g. the general lsp plugins |
11:33:17 | PMunch | narimiran, it's gotten a lot easier to use. alehander42, just got it up and running in minutes |
11:33:20 | FromGitter | <alehander42> sounds useful indeed |
11:33:27 | FromGitter | <alehander42> PMunch, careful there .. |
11:33:27 | FromGitter | <alehander42> :D |
11:33:36 | PMunch | Doesn't it work yet? |
11:33:53 | FromGitter | <alehander42> it starts and logs events correctly now |
11:34:04 | PMunch | Well that's a start :P |
11:34:12 | FromGitter | <alehander42> but the problem is, i can't really see any effect |
11:34:40 | FromGitter | <alehander42> e.g. i can see `../hover` when i hover over a function name |
11:35:02 | FromGitter | <alehander42> but no info box or anything |
11:35:14 | FromGitter | <alehander42> same with completion and didChange |
11:35:30 | FromGitter | <alehander42> maybe my nimsuggest is old? |
11:35:54 | PMunch | nimlsp uses nimsuggest as a library |
11:35:59 | PMunch | So it's compiled into the nimlsp binary |
11:36:08 | PMunch | So that's not the issue |
11:36:17 | PMunch | But that is indeed strange |
11:36:30 | PMunch | Is this Sublime 2 or 3 by the way? |
11:36:34 | FromGitter | <alehander42> sublime3 |
11:36:49 | FromGitter | <alehander42> (3.1.1) |
11:37:19 | PMunch | I think that's the version I tried it with.. |
11:37:29 | PMunch | At least 3, not sure about the subversion |
11:37:32 | FromGitter | <alehander42> i am usually in a branch in my nim folder, i will check with devel & new install |
11:38:10 | PMunch | You could also try to compile nimlsp in debug mode, it get's a lot more verbose that way |
11:39:01 | FromGitter | <alehander42> ok |
11:40:32 | * | vlad1777d quit (Remote host closed the connection) |
11:41:50 | FromGitter | <alehander42> i can just copy the nimsuggest folder right |
11:42:17 | PMunch | Well it doesn't use nimsuggest, so for all nimlsp cares you can delete it :P |
11:43:24 | PMunch | I don't quite understand why it's so hard to install nimlsp.. When I did it it was quite straight forward.. |
11:43:43 | PMunch | I guess I'll have to spin up a clean VM of some sort and try it myself.. |
11:44:28 | FromGitter | <alehander42> no, I guess it worked in the beginning, but it wasnt obvious, because i couldn't actually "enable" it , maybe this should be clarified in the readme |
11:45:47 | PMunch | Yeah I want it to be as simple to install as possible.. |
11:45:54 | * | zyklon_ quit (Read error: Connection reset by peer) |
11:51:37 | Zevv | Araq: you said varargs[SomeInteger] is not efficient, should I make it just vararg[int] then |
11:54:08 | * | kapil____ joined #nim |
12:00:11 | FromGitter | <alehander42> PMunch: i found the issue |
12:00:22 | FromGitter | <alehander42> getProjectFile is entering an infinite loop |
12:00:24 | FromGitter | <alehander42> for my file |
12:02:35 | * | zyklon_ joined #nim |
12:10:35 | dom96_w | PMunch: Still depending on the compiler sources? |
12:10:45 | dom96_w | if so, an easy installation will be really painful |
12:17:13 | * | Snircle joined #nim |
12:17:26 | * | zachcarter joined #nim |
12:18:57 | PMunch | alehander42, well that's not good |
12:19:02 | PMunch | Any idea what's causing it? |
12:19:16 | * | skellock joined #nim |
12:19:21 | * | vonHabsi joined #nim |
12:19:30 | PMunch | dom96_w, it still relies on compiler sources. But the .nimble file automatically pulls them so all you need to get the binary is "nimble install nimlsp" :) |
12:20:05 | PMunch | So that part is easy enough. But you still need to point it to where it can find the Nim stdlib and you need to set up your editor to execute it properly. |
12:20:20 | dom96_w | Yeah, I've been there. It's very easy to get compiler version mismatches |
12:20:43 | dom96_w | Make sure to pin the compiler package commit |
12:20:57 | * | donlzx joined #nim |
12:21:40 | PMunch | Yeah I think it does that already, but I might've forgotten |
12:22:14 | FromGitter | <alehander42> @PMunch well the path becomes `/` sometimes |
12:22:20 | FromGitter | <alehander42> and it doesnt change after that |
12:22:40 | FromGitter | <alehander42> this is easy to check, but not sure what's the right behavior then (just reusing the default config?) |
12:22:42 | PMunch | Hmm, that's strange |
12:23:24 | PMunch | Well it requires to get the correct project path to work correctly |
12:23:56 | PMunch | I guess implementing the show notification thing would be a good idea. That way it could show this as an error in the UI at least. |
12:26:31 | FromGitter | <alehander42> yeah, sounds reasonabl |
12:27:04 | PMunch | But why does it enter an infinate loop in the first place? Do you have a very strange project structure? |
12:31:47 | Araq | Zevv, no, it's the varargs/openarray that turns stuff into an array construction |
12:31:59 | Araq | that neither Nim nor the C compiler are able to optimize away. |
12:32:06 | Araq | well that's my educated guess |
12:32:15 | Araq | didn't look at the asm |
12:39:47 | * | zyklon_ quit (Ping timeout: 240 seconds) |
12:43:03 | Zevv | ok I'll drop those |
12:45:18 | FromGitter | <alehander42> PMunch, well I started with a single file in my `~` folder |
12:46:04 | FromGitter | <alehander42> later it seemed to work with the nimlsp repo(still no completion tho, but this is because sublime wasnt firing completion events for some reason) |
12:46:27 | FromGitter | <alehander42> but in any case, those loops should terminate cleanly |
12:48:50 | PMunch | Yeah that is definitely not great.. |
12:51:32 | livcd | Does jester still workk on Windows ? |
12:53:14 | FromGitter | <alehander42> PMunch well otherwise it seems great, does it support renaming already |
12:53:36 | * | oprypin joined #nim |
12:54:03 | PMunch | Yes |
12:54:24 | PMunch | But at least in Vim it requires that the cursor is on the first character |
12:54:31 | PMunch | Don't think that's a general limitation though |
13:00:28 | * | Perkol joined #nim |
13:00:45 | Zevv | the bitops multibit operations now unroll in a macro, PR updated |
13:01:24 | * | PrimHelios joined #nim |
13:01:53 | * | PrimHelios quit (Remote host closed the connection) |
13:03:39 | Zevv | adds dependency of bitops on macros, though, not sure if that is bad |
13:11:48 | FromGitter | <arnetheduck> @zestyr not sure - most ffi works fine, but there are some subtle mem handling / gc issues left to fix in nlvm still, could be that.. cool, thanks for trying :) if you wanna compile with --debuginfo, then run through gdb and grab a call stack, feel free to report a bug on https://github.com/arnetheduck/nlvm |
13:28:28 | Araq | hmm what should the switch be that turns off exceptions for sysFatal |
13:28:51 | Araq | we already have -d:noSignalHandler to turn off signal handlers |
13:29:19 | Araq | and we have --opt:size. and --gc:regions and --gc:none. and --os:standalone |
13:29:46 | Araq | all of which try to attack the same problem, strip out stuff so that Nim runs with 32K of RAM |
13:30:48 | Araq | should we go on with this path of individual switches or do we want higher level switches that declare more of the intend |
13:32:59 | FromGitter | <Varriount> SysFatal? |
13:39:55 | Araq | the stuff the spec says are strictly speaking not catchable errors |
13:40:03 | Araq | like IndexError |
13:56:59 | * | abm joined #nim |
14:03:29 | * | donlzx quit (Quit: Leaving) |
14:08:13 | dom96_w | livcd: there is a bug that causes it to break on Windows sadly |
14:10:25 | livcd | dom96_w: oh :/ |
14:13:31 | Zevv | "Sorry, one more thing: Produce a single ``setBit`` call with or'ed bits.". Is that better? The current macro is fully optized away by my compiler, setBits(1,3,5,7) results in a nice 0xAA being or'ed |
14:13:52 | Zevv | Or I didn't understand your comment, also possible |
14:16:35 | Araq | no that's what I meant |
14:17:06 | Zevv | so that's ok now |
14:20:03 | Zevv | thanks |
14:22:33 | * | zachcarter quit (Ping timeout: 245 seconds) |
14:38:46 | * | vlad1777d joined #nim |
14:51:07 | narimiran | dom96_w: hey, you here? |
14:51:48 | dom96_w | yes |
14:52:50 | narimiran | i've cleaned up asyncftpclient's types, as you instructed. the tests are passing, but i'd like to check with you too if i didn't clean it up too much :) https://github.com/nim-lang/Nim/pull/10401/commits/0fa0808fda4b02be146edb2e6a7a9cdb06b95910 |
15:00:29 | dom96_w | Seems good |
15:01:45 | * | JnR joined #nim |
15:02:52 | narimiran | thanks |
15:02:55 | JnR | Is anyone here? Noone else has used Nim |
15:03:12 | JnR | This is the only source for info |
15:03:41 | narimiran | JnR: yes, there are plenty of us here :) |
15:06:51 | JnR | Fantastic. I'm fairly unexperienced with programming(still haven't left Python) and I ran across Nim yesturday for the first time and it looks like it has limitless potential. As far as a macro I guess. All I've seen are the flawless example interpreters from the site. Is there some kind of serious limitations to it's ability that I'm not seeing? |
15:08:04 | JnR | Alot of it's benefit I see ad educational too, like interpreting languages and such |
15:08:19 | narimiran | just start using nim :) |
15:09:13 | * | MyMind quit (Ping timeout: 245 seconds) |
15:09:19 | * | Pisuke joined #nim |
15:09:20 | JnR | Well each language is a huge commitment in my opinion. I've spent a year working with Python now and there so much I haven't done yet |
15:11:01 | JnR | Nim could be run out of some guys garage and I honestly would have no idea because it |
15:11:09 | JnR | because it's so unpopular |
15:12:09 | Zevv | There's no google or netscape or other big organization behind Nim |
15:12:24 | Zevv | which unfortunately makes a lot of difference in exposure |
15:13:27 | absolutejam | just saw the nimpy post on reddit & hn |
15:13:32 | absolutejam | that's pretty cool |
15:13:43 | absolutejam | Leveraging nim to do Python's heavy-lifting |
15:13:45 | JnR | I'm don't normally just hop on bandwagons but computer programming is one subject where popularity HAS to be taken into account |
15:14:14 | absolutejam | JnR: I've been playing with Nim for a about a week, and while you need a bit of time to play with it, you'll only do yourself good by learning it |
15:14:57 | absolutejam | I know what you mean, you don't want to learn something seriously limited, but maybe look at the stlid |
15:15:00 | leorize | Zevv: well status.im is pretty big :P |
15:15:08 | absolutejam | and search nimble, the package manager |
15:15:13 | leorize | but yea, they don't have a huge influence on devs |
15:15:35 | absolutejam | It's not Go level, but it also doesn't make you feel gross when writing it, like Go does |
15:15:43 | FromGitter | <kaushalmodi> JnR: See if Nim works for you/your pet projects |
15:15:53 | absolutejam | (Go level of popularity/hotness and packages I mean) |
15:15:56 | FromGitter | <kaushalmodi> Once you convince yourself to use it, you can convince your peers |
15:16:20 | JnR | I was actually thinking of starting with GUI programming. Only because writing GUIs with Python just never feels right |
15:16:59 | PMunch | JnR, there are some interesting GUI offerings in Nim :) |
15:17:43 | absolutejam | I actually ventured into Nim and wen't back to Python for the project I'm writing |
15:17:54 | absolutejam | but that's because the I need the dynamic nature of Python vs. any static language |
15:17:59 | JnR | PMunch Do you think I could port QT fairly easily with Nim? |
15:18:14 | absolutejam | but I'm happy to add (beginner) Nim to my skillset, because the next _appropriate_ project will be in Nim |
15:18:28 | leorize | JnR: someone already wrapped QML iirc |
15:18:50 | absolutejam | That's nothing against Nim, that's because I done goofed with the way I want to implement said project |
15:18:56 | PMunch | Yeah there's this: github.com/filcuc/nimqml |
15:19:21 | PMunch | And this: github.com/ba0f3/qml.nim although it's a bit older so it might not quite work |
15:21:55 | JnR | Thanks for your opinions. I'll probably start by using it like a Tool for python applications rather than jumping in headfirst |
15:23:40 | JnR | PMunch I was kinda looking forward to having the opportunity to prove I can improve everything I find faulty |
15:23:43 | FromGitter | <kaushalmodi> talking of GUI libraries, I happen to just learn about http://www.ir.isas.jaxa.jp/~cyamauch/eggx_procall/ |
15:23:54 | FromGitter | <kaushalmodi> has anyone heard of that one/used that? |
15:24:09 | FromGitter | <kaushalmodi> I might need to create a wrapper for EGGX |
15:24:58 | PMunch | JnR, you might also want to check out my genui macro: github.com/PMunch/wxnim#the-genui-macro |
15:25:22 | PMunch | kaushalmodi, that looks horrible.. |
15:26:41 | FromGitter | <kaushalmodi> heh, what would be a better library today? I have zero experience with GUI stuff |
15:27:50 | JnR | PMunch Thanks! I was just about to start looking for a solid working reference program to look around |
15:28:22 | PMunch | kaushalmodi, well I tend to use wxWidgets or Gtk |
15:28:38 | PMunch | Qt is of course always an option, the licensing issues are much better now |
15:29:07 | PMunch | I should get cracking on my own library as well.. |
15:29:25 | FromGitter | <kaushalmodi> PMunch: I am looking at creating this from the EGGX examples: https://ptpb.pw/ee5u/c |
15:29:26 | JnR | I hate to say it but Qt5 is ad good as it gets for Python |
15:29:28 | dom96_w | nimx! |
15:29:53 | dom96_w | Not complete but a pretty nice start |
15:30:00 | JnR | I wish I knew JS so I could use Electron |
15:30:16 | skellock | friends dont let friends use electron |
15:30:18 | dom96_w | Sadly I still believe Electron/libcef is best |
15:30:30 | leorize | there's gintro for pygtk lovers |
15:31:04 | JnR | I googled Nimx and got Natnl Institute of mental healthj |
15:31:26 | PMunch | Electron is horrid.. |
15:31:31 | skellock | JnR: osnap |
15:31:32 | FromGitter | <kaushalmodi> search "nimx nim" |
15:31:52 | PMunch | kaushalmodi, well if you're only drawing pixels and such I guess you could use SDL2 |
15:31:55 | leorize | or look for it in nimble.directory |
15:32:00 | PMunch | Or try to wrap that lib |
15:32:03 | FromGitter | <kaushalmodi> JnR: huh searching just "nimx" returns the correct result for me |
15:32:06 | FromGitter | <kaushalmodi> on google |
15:32:11 | JnR | Ok this time i got FEMA.gov |
15:32:16 | PMunch | Google does a lot of profiling |
15:32:20 | FromGitter | <kaushalmodi> PMunch: thanks, that's what I need |
15:32:33 | PMunch | Since you've googled for Nim stuff before then it's more likely to find a nim lib for you |
15:32:37 | JnR | wait a minute... |
15:32:39 | FromGitter | <kaushalmodi> If you followed my yesterday's messages, I am still working on systemverilog/nim integration |
15:32:45 | JnR | Why is my search bar using Yahoo?!? |
15:32:53 | PMunch | Haha :P |
15:33:03 | FromGitter | <kaushalmodi> now looking into having the arrays, etc. from SV side to plot to graphs, etc. |
15:33:07 | FromGitter | <kaushalmodi> like in Matlab |
15:33:23 | PMunch | JnR, while I still hold that Electron is horrid you don't actually need to know JS to use it. You can do it in Nim |
15:33:37 | FromGitter | <zetashift> what there are nim electron bindings? |
15:34:02 | FromGitter | <zetashift> https://github.com/PMunch/nim-electron oh snap that's neato |
15:34:02 | PMunch | zetashift, yes.. https://github.com/PMunch/nim-electron |
15:34:16 | FromGitter | <zetashift> haha :P |
15:34:19 | PMunch | Also with Karax if you want: github.com/bluenote10/nim-electron-karax |
15:34:57 | FromGitter | <zetashift> Well I'm not a big fan of electron but vscode and discord make it seem really okay |
15:35:13 | PMunch | Until you check their RAM usage.. |
15:35:18 | JnR | PMunch what could possibly be so bad about Electron? It's universal, relatively simple. Some apps I tried were very resource heavy but that might be the creators fault |
15:35:47 | zestyr | They're inherently heavy, it's essentially a glorified Chromium wrapper |
15:36:19 | zestyr | having your program run in what's essentially a full browser is really unnecessary |
15:36:26 | PMunch | Well as you say it's a resource hog. It also plays really bad with accesibility options, offer little to no desktop integration, and is generally just a bad idea.. |
15:36:29 | skellock | table stakes is 150mb on disk; 2 processes - one running node.js / another chromium; -- then you get to start building your app |
15:36:33 | FromGitter | <zetashift> @PMunch yea it isn't great, ~170mb for discord and 140 for vscode but all in all for the experience I get it's kind of word it |
15:36:41 | * | PMunch quit (Remote host closed the connection) |
15:36:57 | * | PMunch joined #nim |
15:37:07 | FromGitter | <zetashift> also vscode only got big because of a nimsuggest memory leak but that doesn't really happen all that often |
15:37:39 | JnR | Why can't chromium be limited further? |
15:37:42 | FromGitter | <zetashift> worth it* man my spelling is really bad today |
15:37:48 | PMunch | It's really a case of having a hammer making everything look like a nail |
15:37:48 | JnR | As far as the resources it's using |
15:38:02 | * | Geezus42 joined #nim |
15:38:15 | PMunch | Poor web devs only knowing JS and wanting to create some actual applications. |
15:38:21 | zestyr | well, why do you even want to write a desktop application in a browser environment? web development is bad enough as it is lol |
15:38:24 | PMunch | And then node, and later electron was born.. |
15:39:22 | JnR | Well before trying it it sounded like an easy platform to put python onto.... And then I realized I was so, sooo wrong |
15:39:26 | FromGitter | <zetashift> because before QML I think Qt was really hard to get into |
15:39:35 | PMunch | Isn't Electron also bundled into every application, meaning that you essentially have multiple copies of chromeium installed on your machine? |
15:39:37 | FromGitter | <zetashift> and that was the only solid cross platform api |
15:39:47 | FromGitter | <zetashift> yep |
15:40:17 | PMunch | wxWidgets is pretty solid IMO |
15:40:27 | FromGitter | <mratsim> I'm pretty sure this is the same with zlib on Windows ;) |
15:40:47 | PMunch | Well, Windows is it's own flavour of special.. |
15:40:54 | JnR | I don't know HTML or CSS but they sound like great ways to add structure |
15:41:07 | PMunch | Without any real package management system having libraries just doesn't work all that well |
15:41:15 | PMunch | JnR, they're not |
15:41:39 | PMunch | Their initial uses are very different from what they are used for today, and it shows |
15:42:10 | PMunch | Plus 30 years of different browsers have made the spec a bit hairy |
15:43:27 | JnR | Couldn't I just hypothetically put C in Chromium and run apps natively? |
15:43:57 | PMunch | That's essentially what my nim-electron project does, but with Nim creating the C code |
15:44:10 | PMunch | It has a small JS part that essentially just works as a bridge for the C code |
15:44:39 | JnR | Does Nim interpret C as Js or actually run C on the Browser? |
15:45:17 | PMunch | Well the way it works is that Nim creates C code which is compiled into a native binary. Then another part of the project is compiled from Nim to JS. |
15:45:48 | PMunch | The JS part then interfaces with Electron, and the C part interfaces with the JS part over a socket. |
15:46:01 | PMunch | So you can implement the business logic in C and the GUI logic in JS |
15:46:18 | PMunch | Not that you should of course |
15:46:25 | narimiran | JnR: did you check out the nim telegram channel? ;) |
15:46:43 | PMunch | It's really quite ironic that I'm the person with the nim-electron library since I'm so opposed to using Electron.. |
15:46:54 | FromGitter | <zetashift> yea ;P |
15:47:16 | FromGitter | <zetashift> but honestly cross platform gui libraries are insanely hard to do |
15:47:41 | PMunch | I know, tried to make one |
15:47:51 | PMunch | Still want to complete it though. It certainly had some promise |
15:48:00 | zestyr | Gtk and Qt are both cross-platform |
15:48:10 | PMunch | Well, not really |
15:48:31 | PMunch | They run across multiple platforms, doesn't integrate all that well though |
15:48:49 | PMunch | Qt on Linux for example doesn't integrate with the notification system |
15:49:04 | JnR | PMunch That's exactly the type of Nim implementation I've been looking for. If it's actually more efficient than the standard Election application than that's a huge plus |
15:49:57 | PMunch | Well, the GUI logic would still be in JS. And the RAM usage of Electron isn't going away. But at least you can do heavy computations in native code |
15:50:19 | JnR | narimiran Nim telegram channel? Is telegram something I should know about or is it literally a telegram? |
15:50:19 | PMunch | And interface with C libraries, which might help with desktop integration |
15:50:32 | PMunch | Haha, Telegram is a chat applications |
15:50:50 | PMunch | We haven't set up an actual telegram chain for Nim :P |
15:51:46 | JnR | Ohhhhh |
15:52:21 | JnR | Wait isn't a Web Browser basically a glorified markup text editor? |
15:52:40 | JnR | I actually have no idea |
15:52:51 | zestyr | web browsers are huuuuge these days |
15:52:55 | narimiran | JnR: your style reminded me of one telegram user so i had a deja vu ;) |
15:53:24 | PMunch | JnR, in a way yes |
15:53:42 | PMunch | HTML stands for Hyper-Text Markup Language |
15:54:07 | FromGitter | <alehander42> @PMunch: what you were describing sounded a bit like https://github.com/atom/xray |
15:54:20 | PMunch | Then someone figured out they wanted to have things in different colours and such, so CSS was born. And then someone figured they could add some fun dynamic content, and JS was born |
15:54:27 | JnR | I learned about Nim from that one text editor that runs Qscintilla. Nim was in charge of the high speed text formatting |
15:54:30 | FromGitter | <alehander42> they use a rust process which does most of the work / maintains internal data strcutures while using electron for rendering |
15:54:37 | FromGitter | <alehander42> are you talking abiout sm similar |
15:55:50 | PMunch | Yeah, it would be something similar to that. |
15:55:58 | PMunch | The basic example I have made is of course much simpler |
15:56:40 | JnR | narimiran I'm glad I have a style and it's not being hunted down by an angry mob for once. This is a great channel lol |
15:56:56 | PMunch | JnR, which one? |
15:57:03 | PMunch | The editor you mentioned |
15:57:39 | JnR | Hold on I'm looking it up... |
15:57:56 | PMunch | The Nim community is pretty friendly :) Despite some people not agreeing :P |
15:58:02 | JnR | https://matkuki.github.io/ExCo/index.html |
15:58:39 | JnR | The editor is rediculous it has about 1000 features |
15:58:56 | Zevv | Vim has 2000, and emacs 3000 - that's how editors go |
15:59:16 | JnR | But it claims you can optionally use Nim to add really high speed formatting procedures |
15:59:39 | zestyr | meh, Emacs already has all these features :) |
15:59:55 | Zevv | Emacs does not have hexagon toolboxes! |
16:00:06 | JnR | But this one puts them all in the GUI |
16:00:17 | zestyr | Emacs is a GUI, unless you use the inferior terminal version |
16:00:35 | JnR | Like they're not all keyboard commands, theres a hude GUI menu |
16:00:38 | zestyr | It even has xwidgets, you can embed browsers inside it |
16:00:52 | PMunch | zestyr, inferior? |
16:01:05 | PMunch | GUIs are over-rated |
16:01:16 | zestyr | worse colors, limited keycodes, no GUI features like images (displaying PDFs etc) |
16:01:29 | zestyr | and slower |
16:01:35 | Zevv | take it easy guys, lets finish the editor wars first before we go to GUI/desktop wars |
16:01:36 | PMunch | Ah, well those things I can get behind |
16:01:38 | JnR | I thought Emacs and Vim were useless when I first tried them because they didn't assist me with the controls |
16:01:58 | PMunch | The terminal definitely isn't perfect. When I think of GUI apps it's the more common kind |
16:02:18 | PMunch | JnR, oh yeah. Vim and Emacs can be pretty hard to get into |
16:02:51 | JnR | Actually I got into Vim and I must admit it's pretty fun once you learn the controls |
16:02:58 | FromGitter | <zetashift> but once you do, oh damn |
16:03:09 | JnR | But when I really wanted to get work done I opened another editor |
16:03:30 | FromGitter | <zetashift> I can't ctrl+S anymore it's either :w(q) or space+f+s |
16:03:37 | zestyr | lol |
16:03:42 | PMunch | Huh, I like how that editor uses Nim for extra lexer stuff. Interesting application |
16:04:00 | FromGitter | <zetashift> never heard of it either looks solid |
16:04:01 | * | abm quit (Quit: Leaving) |
16:04:09 | PMunch | Yeah, I'm broken whenever I try to use other editors |
16:04:23 | PMunch | Try to jump around, run commands etc. |
16:04:41 | Zevv | I have this signature on my email for the last 20 years: |
16:04:41 | JnR | Well if you've heard of Qscintilla, this is the Editor featured on their website |
16:04:41 | Zevv | -- |
16:04:41 | Zevv | :wq |
16:04:41 | Zevv | ^X^Cy^K^X^C^C^C^C |
16:04:44 | zestyr | Then there's this: https://github.com/yuutayamada/nim-emacs-module |
16:04:58 | FromGitter | <zetashift> lol |
16:05:05 | PMunch | Zevv, solid joke :) |
16:05:25 | PMunch | JnR, I've heard of Qscintilla. Not quite sure what it is though |
16:06:33 | JnR | PMunch As far as I understand It's a really advanced text formatting engine. It's open source for C and Python |
16:07:34 | * | darithorn joined #nim |
16:07:54 | JnR | PMunch I didn't realize how complicated text editing was before I tried using Scintilla |
16:08:28 | PMunch | Yeah if you want to do it right it's hard |
16:08:37 | PMunch | That's true for most things though |
16:08:45 | Zevv | :) |
16:08:58 | Zevv | story of my life. |
16:10:06 | JnR | I don't care I'm determined that there's an easy way no ones found yet |
16:10:11 | JnR | Just one more hour |
16:10:51 | FromGitter | <kaushalmodi> someone said Emacs? |
16:11:03 | FromGitter | <zetashift> how is the nim support in emacs now btw? |
16:11:07 | FromGitter | <kaushalmodi> I am all ears, Not reading the whole thread, yeah, it's the best editor |
16:11:16 | FromGitter | <zetashift> haha |
16:12:22 | Zevv | Vim support has improved significatanly over the last few days thanks to leorize btw: https://github.com/alaviss/nim.nvim |
16:13:05 | JnR | What is NeoVim? is it better than Vim? |
16:13:11 | PMunch | zetashift, as long as the syntax highlighter works and it has LSP support it should be fine |
16:13:15 | Zevv | JnR: it's a rewrite |
16:13:43 | leorize | the ui, yes, but the core was based on vim |
16:13:46 | Zevv | vim is decades of legacy and compatibilty, and some people felt that slowed down progress. |
16:14:20 | FromGitter | <kaushalmodi> @zetashift the nim-mode has been working great for me |
16:14:39 | zestyr | I still haven't been able to fix flycheck, so I just disabled it |
16:14:46 | FromGitter | <kaushalmodi> I've heard there's lsp-mode for emacs too, but I need to learn what lsp is all about and then I can configure it to use PMunch's Nim lsp work |
16:14:47 | JnR | Well, nothing ruins progress like some weird sentimental pride of the good ol days |
16:15:05 | FromGitter | <kaushalmodi> zestyr: I live without flycheck |
16:15:11 | zestyr | lol |
16:15:30 | FromGitter | <kaushalmodi> zestyr: I use Org Babel a lot! |
16:15:33 | Zevv | JnR: you should ask Araq (the lead nim developer) about C and legacy and "good old days" one day :) |
16:15:42 | FromGitter | <kaushalmodi> I quickly type in a snippet, C-c C-c and I see the result |
16:16:01 | zestyr | ya literate programming in org is pretty nice |
16:16:48 | FromGitter | <kaushalmodi> here's a quick peek of what it looks like |
16:16:57 | FromGitter | <kaushalmodi> (https://files.gitter.im/nim-lang/Nim/lA40/image.png) |
16:17:16 | FromGitter | <kaushalmodi> (for folks who don't know Org mode / Emacs / Org babel and the nim support in there) |
16:17:24 | JnR | Zevv lol Some of the channels are seriously too hostile to discuss an opinion in because of those damn "Old days" |
16:18:02 | Zevv | Here people with opinions are usually just banned, that's pretty effective |
16:18:11 | narimiran | :) |
16:18:49 | FromGitter | <tweenietomatoes> Narimiran <3 |
16:19:06 | JnR | I've learned that every channel as an army of memers waiting to jump on an outsider with something new to say |
16:19:07 | PMunch | Zevv, what has changed with Nim support in Vim? |
16:19:20 | narimiran | @tweenietomatoes yes? |
16:19:29 | FromGitter | <tweenietomatoes> im biggest fan of you |
16:19:30 | Zevv | PMunch: I switched to the leorize's indenter |
16:19:50 | narimiran | @tweenietomatoes should i start to worry? |
16:20:00 | FromGitter | <kaushalmodi> hehe |
16:20:12 | Zevv | I have pretty low requirements for language support for editors and I don't do highlightign, but a good indenter makes me happy |
16:20:22 | FromGitter | <tweenietomatoes> Netbeans 10 is best IDE ever. |
16:20:27 | FromGitter | <tweenietomatoes> use it. |
16:21:05 | PMunch | Zevv, I've been using Vim with only a syntax highlighter until I made nimlsp |
16:21:33 | * | absolutejam quit (Ping timeout: 244 seconds) |
16:22:20 | Zevv | nimlsp, that's new to me, reading up... |
16:22:33 | JnR | I wish I could just steal Sublimes easy and simple formatting tools |
16:22:42 | JnR | I don't like the editor |
16:22:46 | FromGitter | <kaushalmodi> PMunch: you need to blog about this |
16:23:36 | FromGitter | <kaushalmodi> If someone understand the LSP stuff and uses Emacs, look into https://github.com/joaotavora/eglot |
16:23:55 | PMunch | kaushalmodi, hmm that is a good idea |
16:24:00 | PMunch | Been a while since my last post |
16:24:09 | FromGitter | <kaushalmodi> My understanding is that PMunch's nimlsp will pair with that eglot client in Emacs |
16:24:45 | * | Geezus42 quit (Ping timeout: 268 seconds) |
16:24:51 | FromGitter | <kaushalmodi> PMunch: may be also include an LSP primer |
16:24:52 | PMunch | Pretty much yes |
16:24:56 | FromGitter | <kaushalmodi> what is it all about :) |
16:25:02 | PMunch | Good idea |
16:25:24 | PMunch | langserver.org has a nice briefing on it |
16:25:33 | FromGitter | <kaushalmodi> PMunch: I hope these make sense to you https://github.com/joaotavora/eglot#commands-and-keybindings |
16:26:07 | PMunch | Yup |
16:26:44 | * | Geezus42 joined #nim |
16:28:24 | JnR | Oh damn I didn't even realize there was a language server option |
16:29:44 | * | Trustable joined #nim |
16:31:43 | JnR | So the Language Server runs externally from the editor? |
16:32:19 | PMunch | Yup |
16:32:34 | JnR | That doesn't slow anything down? |
16:32:52 | leorize | most editors do the communication asynchronously |
16:33:02 | leorize | you wouldn't feel a thing |
16:33:23 | PMunch | Well the LSP protocol is pretty terrible |
16:33:29 | Araq | XD |
16:33:36 | PMunch | So it's definitely not the fastest thing in the world |
16:34:10 | * | vlad1777d quit (Ping timeout: 246 seconds) |
16:34:17 | JnR | I mean I don't plan of like diffing files with it or something |
16:35:09 | FromDiscord_ | <Generic> ß |
16:35:34 | JnR | I've spend too much time trying to program text formatting into an editor directly. It's really complex |
16:36:03 | JnR | And Python will eventually struggle to handle the load |
16:38:41 | * | floppydh quit (Quit: WeeChat 2.3) |
16:45:18 | dom96_w | PMunch: in what ways is it terrible? |
16:47:00 | shashlick | dom96_w: can you look at the choosenim init script PR? |
16:47:15 | dom96_w | I'll look tonight |
16:47:32 | shashlick | once that's in, we can enable windows in travis |
16:49:33 | PMunch | dom96_w, the LSP protocol? |
16:49:40 | dom96_w | yeah |
16:49:56 | PMunch | Well it sends all data as UTF-8, but sends all indices and slices as UTF-16 offsets.. |
16:50:17 | PMunch | That's probably the worst part |
16:50:35 | dom96_w | hah, that's indeed terrible |
16:50:41 | dom96_w | Any idea how they came up with this? |
16:50:45 | JnR | Somebody recommended using Nim with Crystal but I can't find a single thing on the two working together |
16:51:17 | PMunch | C# saves strings as UTF-16, because that's what Microsoft but their money on back in the days |
16:51:38 | PMunch | Java does as well IIRC |
16:52:01 | PMunch | I guess it made sense to whoever prototyped it for VSCode.. |
16:52:15 | PMunch | But the fact that it's essentially a weird HTTP/JSON hybrid for same-machine communication is already a red flag |
16:52:16 | narimiran | JnR: less comparing, more using ;) |
16:52:31 | PMunch | Should've used a binary format of some kind.. |
16:52:54 | dom96_w | bleh, binary protocols suck |
16:52:56 | PMunch | Instead the editor has to encode something as JSON which the LSP server then needs to decode back into values |
16:53:38 | dom96_w | It's not like you're sending hundreds of these messages a second, serialization won't have a big impact on the performance. |
16:54:00 | PMunch | I know, it's just the principal of it :P |
16:54:16 | PMunch | And you could potentially send a didChange with every keystroke |
16:54:22 | JnR | narimiran I have to do all the research first! I'm always afraid I missed something crucial and waste time |
16:54:34 | dom96_w | JSON is far easier to debug too :P |
16:55:16 | PMunch | Well that's fair, but using a defined binary protocol they probably have a formatter of some kind |
16:55:25 | narimiran | JnR: ok, then continue on doing what you do, and report back to us when you find something crucial :P |
16:55:32 | PMunch | Like BSON for example (disclaimer, never actually used BSON) |
16:56:43 | PMunch | Oh well, I'm off now |
16:56:45 | * | PMunch quit (Remote host closed the connection) |
16:57:08 | JnR | narimiran What's crucial is that I've hit a dead end looking for Nim support. This chat is probably better than Google right about now... |
16:57:35 | Araq | binary protocols ftw, no clusterfuck of escaping rules, and with length prefixes you can pre-allocate buffers |
16:57:41 | FromGitter | <kaushalmodi> JnR: this chat is great, and also Nim Forum |
16:58:05 | narimiran | JnR: youdontsay.gif :P |
16:59:09 | narimiran | JnR: now if you start writing some nim, you might hit some (crucial) wall, and we might help you with it. for now it is all just theoretical and not very helpful (to you) |
17:07:43 | * | ng0 joined #nim |
17:11:06 | dom96_w | Araq: try parsing raw WiFi packets and then get back to me :P |
17:11:15 | dom96_w | I'll take JSON any day |
17:11:40 | Araq | you think they become easier with random "cannot parse json, missing "]}"" errors? |
17:16:52 | livcd | kaushalmodi: i am too stupid / too lazy to dig into lisp and if I do not find a working pkg I give up. I think I eventually might migrate to VS Code. |
17:21:52 | FromGitter | <kaushalmodi> livcd: sure, different strokes for different folks |
17:22:04 | FromGitter | <kaushalmodi> but what's the reference? |
17:22:48 | FromGitter | <kaushalmodi> is this the canonical way to mimic binary math (doing 4-bit addition below): ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c475168dab15872ced62cbc] |
17:23:15 | livcd | kaushalmodi: just showerthoughts. I was surprised I did not find good enough powershell babel pkg. |
17:23:29 | FromGitter | <kaushalmodi> ah ok |
17:23:53 | * | Jesin joined #nim |
17:23:58 | FromGitter | <kaushalmodi> hmm, I use emacs on RHEL 6.8, so ob-shell works great |
17:24:02 | FromGitter | <kaushalmodi> never needed powershell |
17:24:34 | livcd | mostly popular ob-<popular> work fine :) |
17:25:19 | FromGitter | <kaushalmodi> it's not babel, but have you looked at powershell.el? |
17:25:46 | livcd | idk i think i tried to hook it in and failed |
17:25:51 | FromGitter | <kaushalmodi> the repo looks pretty active: https://github.com/jschaf/powershell.el |
17:25:58 | FromGitter | <kaushalmodi> open an issue there |
17:26:02 | FromGitter | <kaushalmodi> if you don't ask, you don't get |
17:26:26 | FromGitter | <kaushalmodi> *that turned out to be too philosophical* |
17:26:56 | livcd | strange I think i have tried different powershell.el... |
17:44:13 | * | aguspiza joined #nim |
17:46:51 | * | zyklon_ joined #nim |
17:47:10 | FromDiscord_ | <Mage> How do you lexographically sort a table? |
17:49:52 | FromGitter | <kaushalmodi> I cannot figure out how to pass a var by ref |
17:50:22 | FromGitter | <kaushalmodi> If I have a `cint`, `foo`, how do I pass it to a proc that expects `ref cint`? |
17:50:52 | FromGitter | <kaushalmodi> `addr foo` doesn't work, and `ref foo` doesn't because `ref` expects a type identifier after it |
17:52:28 | JnR | PMunch You have alot of great Nim stuff on your GitHub. I didn't realize how much you used Nim |
17:55:46 | leorize | kaushalmodi: you need to make a ref |
17:56:02 | leorize | but why would there be a Nim proc that take ref cint? |
17:56:13 | leorize | are you sure you're not mistaking it with `ptr cint`? |
17:56:17 | FromGitter | <kaushalmodi> the same .. SV/nim interface |
17:56:40 | FromGitter | <kaushalmodi> hmm, I could probably use ptr |
17:56:55 | leorize | ref implies the GC |
17:57:13 | FromGitter | <kaushalmodi> leorize: I was converting this bit: https://ptpb.pw/ENDC/c |
17:57:18 | FromGitter | <kaushalmodi> see the c_answer in there |
17:57:23 | leorize | then it's `ptr` |
17:57:29 | leorize | C don't have the GC :P |
17:57:33 | FromGitter | <kaushalmodi> ok |
17:57:35 | leorize | actually you could use `var` |
17:57:42 | leorize | IIRC c2nim generates them like that |
17:57:47 | FromGitter | <kaushalmodi> yes, var was work there |
17:57:49 | FromGitter | <kaushalmodi> but then .. |
17:58:05 | FromGitter | <kaushalmodi> there's this other bit: ` t_add(&vl_hw_answer, inp1, inp2);` |
17:58:18 | FromGitter | <kaushalmodi> that calls the `t_add` within C from SV |
17:58:36 | FromGitter | <kaushalmodi> there I can use `ptr` .. trying out |
17:58:47 | leorize | ? |
17:59:15 | FromGitter | <kaushalmodi> that `t_add` function is not implemented in C but in systemverilog |
17:59:27 | FromGitter | <kaushalmodi> An API connects the two |
18:00:23 | leorize | if I understand this correctly you're implementing this C file in Nim? |
18:01:02 | FromGitter | <kaushalmodi> I am doing both |
18:01:21 | FromGitter | <kaushalmodi> having Nim proc implementation run in SV and have an SV task/function run in Nim/C |
18:02:03 | Zevv | dom96_w: about the raw wifi packets: there's a certain field in WPA2 with the endianess the wrong way around. That is my fault, and I'm actually proud of it :) |
18:02:14 | leorize | well, I don't really understand that... |
18:02:16 | leorize | but here's a tip |
18:02:42 | leorize | if you pass stack object to the function a lot, use `var` |
18:02:51 | leorize | otherwise go for `ptr` |
18:02:56 | leorize | that's for Nim->C |
18:03:01 | FromGitter | <kaushalmodi> understood |
18:03:11 | FromGitter | <kaushalmodi> TIL to use `ptr` for C stuff |
18:03:33 | FromGitter | <kaushalmodi> leorize: FYI this is the working code: https://ptpb.pw/17Wf/nim |
18:03:52 | FromGitter | <kaushalmodi> see how I depend on the `t_add` implementation from SV side |
18:04:09 | leorize | well you can certainly use `var` in that `t_add` |
18:04:19 | FromGitter | <kaushalmodi> hmm, trying that now |
18:04:21 | leorize | it's generally the same as `ptr` for C interop |
18:04:33 | FromGitter | <kaushalmodi> the `&` in C-code made me believe that they always need to be pointers |
18:04:47 | * | abm joined #nim |
18:05:01 | leorize | `var` is our fancy abstraction on that :P |
18:05:36 | leorize | in C they don't have anything similar to `var`, so they pass pointers around |
18:05:59 | FromGitter | <kaushalmodi> .. and of course `var` works |
18:06:00 | FromGitter | <kaushalmodi> thanks! |
18:06:05 | FromGitter | <kaushalmodi> and it looks a bit cleaner too |
18:09:20 | FromGitter | <kaushalmodi> leorize: what does `static int` in C signify? |
18:09:28 | FromGitter | <kaushalmodi> `static int` function return type |
18:09:45 | FromGitter | <kaushalmodi> In Nim implementation, I left out the static bit and it still worked |
18:10:53 | FromGitter | <kaushalmodi> e.g. from this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c475cac35350772cf71c3d8] |
18:10:55 | Zevv | it limits the visibility of the function to the file |
18:10:56 | FromDiscord_ | <exelotl> static means that the function is private to the current file |
18:11:05 | FromDiscord_ | <exelotl> ^ |
18:11:09 | FromGitter | <kaushalmodi> thanks |
18:11:22 | Zevv | static keyword is a strange beast in C, it can mean a handful of different things depending on where it is used. |
18:11:26 | FromGitter | <kaushalmodi> but Nim procs are private by default |
18:11:37 | FromGitter | <kaushalmodi> so I don't need to do anything about that |
18:11:45 | Zevv | the C comittee seems to jump through funny hoops to avoid adding new keywords |
18:11:49 | FromGitter | <kaushalmodi> right? |
18:12:04 | leorize | you don't really have to care about them with Nim |
18:12:06 | Zevv | nim scope and C scope are not really related |
18:13:11 | leorize | static is more of a way to hide the symbol iirc |
18:13:42 | leorize | useful when you're writing a C program, where symbol collisions just wait to happen |
18:14:03 | FromGitter | <kaushalmodi> understood, thanks guys |
18:15:54 | * | lritter quit (Ping timeout: 246 seconds) |
18:35:10 | FromGitter | <arnetheduck> woot, a bug of mine from 2015 is getting attention :) kudos @rayman22201! (and the rest of the team for not closing it!) |
18:35:15 | FromGitter | <arnetheduck> https://github.com/nim-lang/Nim/issues/3011 |
18:36:21 | FromGitter | <mratsim> "BigBoneDaddy: Nope" ? |
18:36:30 | rayman22201 | lol. Call me crazy, but I just like good error messages. :-P |
18:36:58 | FromGitter | <mratsim> "Go to Elm" ;) |
18:37:19 | rayman22201 | lol. I also like practical languages. |
18:38:18 | dom96_w | Zevv: your fault?! :O |
18:39:00 | * | dom96_w quit (Quit: Textual IRC Client: www.textualapp.com) |
18:44:00 | Zevv | I did a first reference implementation of the cient side, and at the plugfset things didnt work. so the engineer on the other side glances at the hexdump and sais "oh I see it, the endianess is wrong" and adjus his code |
18:44:26 | Zevv | so thats my heritage :) |
18:44:59 | Zevv | s/plugfset/plugfest/ |
18:48:23 | Zevv | oh that was WPA, not WPA2 |
18:49:48 | * | powerbit joined #nim |
18:53:08 | * | kapil____ quit (Quit: Connection closed for inactivity) |
18:55:02 | shashlick | i have a question for the community |
18:55:18 | shashlick | say you have `typedef struct _STRUCT6 { char name; } STRUCT6;` |
18:55:54 | shashlick | you need a type for `struct _STRUCT6` as well as STRUCT6 in Nim since C could refer to both types in the code |
18:56:03 | shashlick | what's the best way to disambiguate |
18:56:56 | Araq | you translate 'struct _FOO' to Foo and FOO to Foo |
18:56:59 | shashlick | hold, make that `typedef struct _STRUCT6 { char name; } *STRUCT6;` <= note the * in the second STRUCT6 |
18:57:16 | Araq | FooPtr |
18:57:45 | shashlick | in the previous example, you can have just one Foo and call it since they both get mapped correctly by Nim |
18:58:01 | shashlick | good, i was thinking FooPtr |
18:59:29 | shashlick | challenge though is that when someone refers to STRUCT6 further down in the code, they mean STRUCT6Ptr and not the other struct _STRUCT6 |
19:01:20 | shashlick | here's another one - `typedef struct { char name; } *STRUCT6;` |
19:02:31 | shashlick | here you need `type STRUCT6 = ptr object`? |
19:02:33 | Araq | can't you take over c2nim maintainance instead? |
19:02:43 | Araq | all these problems are solved. |
19:03:28 | Araq | it's just a parser with arbitrary token lookahead, it's not *that* hard |
19:03:53 | shashlick | c2nim doesn't like the *STRUCT6 - errors out |
19:04:27 | Araq | cases like these are in its test suite |
19:04:38 | Araq | and the syntax is STRUCT6* btw |
19:04:50 | Araq | the pointer star follows the type |
19:06:42 | Araq | https://nim-lang.org/docs/c2nim.html#embedding-nim-code it was designed with the workflow in mind "ok, edit the C code, but at least you don't have to touch the produced Nim code" |
19:07:02 | Araq | then you can diff&patch your modified header files whenever a new version comes out |
19:07:46 | shashlick | but that's the difference with nimterop - you don't have to touch the C headers |
19:07:47 | Araq | and the wrappers are at least somewhat idiomatic Nim without a 'ptr ptr cchar' where it should be a cstringArray |
19:08:09 | shashlick | you let gcc and tree-sitter handle all that complexity |
19:08:13 | Araq | it's impossible to not touch anything, C's type system is too broken for that |
19:08:51 | Araq | and stripping away the #defines is *wrong*, it doesn't "handle all that complexity", it throws away information. |
19:10:17 | Araq | and let me clear. Maybe your nimterop is already superior, if so, more power to you. But then why do you ask me about basic C struct handling. |
19:10:30 | Araq | ;-) |
19:10:36 | shashlick | that's where i diverge in the thinking process - we had the same conversation around nimgen |
19:11:22 | shashlick | as a user, i'm not interested in dealing with C, but I want leverage it |
19:11:53 | shashlick | i'm doing this so that others can just work with nim and not have to look at C |
19:12:04 | Araq | as a user I don't want generated Nim code with wrong types, I want high quality wrappers. |
19:12:49 | shashlick | well that's my aspiration and i've just had two months on this |
19:12:49 | * | zyklon_ quit (Read error: Connection reset by peer) |
19:12:59 | Araq | that means somebody actually read the results, removed the typedef int MA_INT; crap and maybe even added default values for parameters |
19:13:46 | Araq | shashlick, again, I should take a look at nimterop before we discuss this any further |
19:13:51 | Araq | I don't want to be unfair. |
19:14:03 | shashlick | i totally get your input Araq, don't get me wrong |
19:15:20 | shashlick | i would want to maintain c2nim as well, but I don't think I get it after building on it with nimgen |
19:15:40 | Araq | Urho 3D, Unreal Engine 4, wxWidgets were wrapped with c2nim. Was it automatic? No, it was semi-automatic. Would I pick a different tool today for it? No. |
19:16:00 | Araq | Am I terribly biased? Yes. ;-) |
19:17:15 | Araq | so ... give me something to read, source code or docs |
19:17:33 | Araq | so that we can finally start a more productive discussion afterwards |
19:18:25 | Araq | btw SWIG uses c2nim's approach too, I'm not alone. |
19:18:52 | shashlick | here's my logic - I believe gcc should deal with preprocessing and not me because there's no way I can compete with it |
19:19:05 | shashlick | no doubt it loses information if you checkin your results but that's not what I'm advocating |
19:19:19 | shashlick | second, I don't want to write a parser since there's again no way to keep up |
19:19:48 | shashlick | i'd have picked clang but have compromised with tree-sitter since it is a lighter dep - might never be good enough but oh well |
19:20:04 | shashlick | gcc itself could have given me a nice AST but i don't see any decent api |
19:20:16 | shashlick | that part can be replaced anyway since an AST is an AST |
19:20:21 | * | nsf quit (Quit: WeeChat 2.3) |
19:20:33 | shashlick | once I have this, I can translate that AST into Nim's and let renderer do the work |
19:20:43 | * | Perkol quit (Quit: Leaving) |
19:21:03 | shashlick | but since I'm only interested in translating headers, it doesn't seem worth it |
19:21:15 | shashlick | maybe that changes too but for now, it works fine |
19:21:34 | Araq | it works fine for you, c2nim worked fine for me. |
19:21:42 | Araq | the problems start when somebody else use it :P |
19:22:05 | FromGitter | <mratsim> the issue with editing C headers is that every time upstream change you need to redo it. |
19:23:05 | Araq | mratsim: I just explained how this can be handled. |
19:23:29 | Araq | and the good headers rarely change btw, it's a public interface |
19:24:01 | FromGitter | <mratsim> the diff/patching is a pain, I'm doing that already when handling packaging for dumb OpenCV2, OpenCV3, OpenCV4, Cuda 9, Cuda 10 ... |
19:24:03 | Araq | innovation happens under the hood, not as an eternal bikeshed over the "perfect API" (hmmm, reminds me of something...) |
19:25:30 | Araq | well I don't know OpenCV2-4 nor Cuda |
19:25:54 | Araq | but unless they don't ever use #define, how could nimterop work with it? |
19:26:05 | shashlick | so my goal is to allow cImport("header.h") and it just works - provide helpers to pull in the code over github/download/pkgconfig, etc. |
19:26:10 | FromGitter | <mratsim> they use define all over the place |
19:26:45 | shashlick | nimterop simply passes everything thru gcc and gets platform specific code |
19:26:57 | shashlick | it allows gcc to recurse thru all include files and processes that output |
19:27:13 | FromGitter | <mratsim> but mainly it's monkey patching their Cmake for distribution packaging. It's different from headers, but monkey-patching is soso |
19:27:47 | shashlick | now, here's the thing, I can easily throw out the tree-sitter => nim engine and pull in c2nim for that piece |
19:27:57 | shashlick | rest of it can sit in place |
19:28:05 | FromGitter | <mratsim> I think tree-sitter is very impressive |
19:28:18 | shashlick | but getting fixes in c2nim isn't easy, very few people understand the AST and renderer |
19:28:31 | Araq | I do and you're talking with me |
19:28:32 | shashlick | I don't and that's why I stay away from deep compiler fixes |
19:28:48 | * | aguspiza quit (Ping timeout: 245 seconds) |
19:28:50 | Araq | and I can move ast.nim and renderer.nim to c2nim to make it free of deps |
19:29:05 | Araq | probably a good idea, I can always backport renderer.nim from time to time |
19:29:09 | FromDiscord_ | <jos> hi i have a nim porlbem!!!!! |
19:29:33 | FromDiscord_ | <jos> i used to do #include "nimcache/whatever.h" in my native C (which i linked with nim) |
19:29:40 | FromDiscord_ | <jos> but now nimcache is gone, is there a better way? |
19:29:43 | Araq | and again, I'm not married to c2nim, if you have something better, I don't mind |
19:29:53 | shashlick | but when we hit syntax limitations in c2nim, getting fixes is not easy |
19:29:59 | * | zyklon_ joined #nim |
19:30:10 | Araq | but if you *start* with throwing away #define I don't believe it's something better, sorry |
19:30:30 | FromDiscord_ | <exelotl> @jos you can use the --nimCache compiler option to get back the old behavior if you want |
19:30:32 | Zevv | jos: nimcache moved to ~/.local/cache on unix, you're free to provide you location with the --nimcache:PATH option |
19:30:40 | shashlick | again I am letting gcc process it at compile time - why do you think that is throwing out anything? |
19:30:43 | FromDiscord_ | <jos> that way seemed terrible anyway, so i'm happy to switch |
19:31:01 | FromDiscord_ | <jos> is there a way to do it without using --nimCache because that seems dumb |
19:31:06 | shashlick | you get a wrapper that is specific to the platform being built on |
19:31:16 | FromDiscord_ | <jos> like can i have some directive in nim to generate declarations for c to its own file? |
19:31:20 | FromDiscord_ | <jos> that'd be much nicer |
19:31:23 | shashlick | and the method works cross-platform |
19:31:23 | Araq | #define MYCONST 34 |
19:31:34 | Araq | ^ what does nimterop do with it? |
19:31:41 | shashlick | const MYCONST = 34 |
19:31:49 | Araq | ok, how does it do it? |
19:31:52 | shashlick | using -dD I get that info from gcc |
19:32:09 | shashlick | i also get #define function prototypes though don't do anything with it yet |
19:32:16 | Araq | #define MY_ACCESSOR(x) x._fieldName |
19:32:25 | Araq | would be my next question |
19:33:08 | shashlick | i get that too - just a question of mapping it |
19:33:22 | Araq | interesting, I wasn't aware of -dD |
19:33:28 | shashlick | all the complicated #ifdef stuff is lost but that isn't as useful |
19:33:47 | shashlick | so I guess I understand what you mean by throwing away things |
19:34:05 | shashlick | that is still available to nimterop and stuff that I don't recognize, I just skip |
19:34:19 | shashlick | since tree-sitter is the one parsing it, I don't get stuck with syntax |
19:34:46 | shashlick | no doubt there are tree-sitter issues too but they have been moving slowly |
19:36:16 | shashlick | given they are backed by github, I am hoping for improvements |
19:36:41 | shashlick | but with Microsoft acquiring github and hence Atom, not sure with the vscode competition |
19:38:15 | shashlick | https://github.com/genotrance/nimterop/blob/master/nimterop/getters.nim#L167 <= is the proc to get output from gcc |
19:38:35 | shashlick | you can run any h file with `toast -p header` and it will spit out the preprocessed headers |
19:39:15 | shashlick | use `toast -pr header` to recurse thru include files as well - e.g. required for readline.h - you cannot process each h file separately and get the same results |
19:39:45 | Zevv | -r still pulls in half the world sometimes, though |
19:40:09 | shashlick | yep and we could improve it to filter out headers not of interest |
19:41:33 | shashlick | maybe we maintain a list of standard C/C++ headers and skip those always |
19:41:58 | FromGitter | <kaushalmodi> Chiming in about nimterop vs c2nim. Nimterop now works flawlessly for me for wrapping svdpi.h. There was a bug but shashlick already fixed that. With c2nim I wasn't able to proceed much further (I have opened an issue for that). |
19:43:07 | Araq | can you show me both the header file and the produced .nim code? |
19:43:26 | FromGitter | <kaushalmodi> Produced Nim code by nimterop? |
19:43:31 | Araq | yes |
19:43:33 | FromGitter | <kaushalmodi> Header file is in that issue |
19:43:52 | FromGitter | <kaushalmodi> OK, will send once I am at computer |
19:44:22 | FromGitter | <kaushalmodi> shashlick: I guess the Nim file is what I see on stdout on doing `cDebug()`? |
19:44:38 | shashlick | i can run that snippet thru toast and see what we get |
19:47:53 | Araq | btw if it translates svBitVec32* d to ptr svBitVec32 it's wrong, or not, you never know. Now to be fair, that's exactly what c2nim does too and it's terrible |
19:48:20 | Araq | but at least c2nim doesn't even try to make it 100% "automatic, no thinking involved" |
19:48:21 | shashlick | @kaushalmodi: need svdpi_compatibility.h as well though |
19:49:02 | Araq | int svGetCallerInfo(const char** fileName, int *lineNumber); |
19:49:05 | Araq | is |
19:49:25 | Araq | proc svGetCallerInfo(fileName: var cstring; lineNumber: var cint) |
19:49:48 | Araq | or ptr cstring, but not cstringArray, these things matter in a Nim wrapper... |
19:50:00 | FromGitter | <kaushalmodi> shashlick: yes, I will link the compatibility header too |
19:51:46 | shashlick | Araq: agreed and nimterop doesn't even understand ** yet so I'm yet to cross that boat |
19:52:56 | shashlick | but you could define it the right way and once https://github.com/genotrance/nimterop/issues/52 is possible, nimterop won't overwrite something that is already defined |
19:53:31 | shashlick | so ya, no good answers, and like I was asking earlier, with Nim's _ restriction and duplicate names, it isn't trivial or obvious what to do |
19:53:58 | FromGitter | <kaushalmodi> Araq: ⏎ ⏎ 1) svdpi.h: https://ptpb.pw/9z4q/c ⏎ 2) svdpi_compatibilty.h: https://ptpb.pw/8La-/c ⏎ 3) nimterop output: https://ptpb.pw/-vx0/nim [https://gitter.im/nim-lang/Nim?at=5c4774d6c45b986d11a20cdd] |
19:55:17 | shashlick | svGetCallerInfo() isn't even in there since nimterop didn't recognize it |
19:55:53 | FromGitter | <kaushalmodi> shashlick: so far I haven't run into it |
19:56:09 | FromGitter | <kaushalmodi> everyday I am gradually adding tests for each of the svdpi.h API funcs |
19:56:19 | * | Tyresc joined #nim |
19:59:12 | Araq | I get the same results with c2nim :-) |
19:59:41 | Araq | well not really, c2nim respects --nep1 |
20:00:00 | FromGitter | <kaushalmodi> Then I wonder why https://github.com/nim-lang/c2nim/issues/149 happened |
20:00:13 | FromGitter | <kaushalmodi> I probably missed out some arguments |
20:02:21 | Araq | you need to look at the #defines and tweak them, as c2nim's manual tries to explain |
20:02:32 | Araq | that's what I did, took 5 minutes |
20:02:50 | Araq | and I also used |
20:02:52 | Araq | #define DLLNAME "svdpi.dll" |
20:02:52 | Araq | #dynlib DLLNAME |
20:02:52 | Araq | #cdecl |
20:03:13 | Araq | so that the wrapper accesses the DLL directly, the header file is not required at all then |
20:06:22 | Araq | I mean, this header has "DEPRECATED PORTION OF FILE STARTS FROM HERE." |
20:06:31 | Araq | " DEPRECATED PORTION OF FILE ENDS HERE." |
20:06:50 | Araq | seems to be a good idea to touch the file and wrap only what's relevant, I dunno. |
20:07:40 | Araq | but good job at nimterop, shashlick, no irony implied. |
20:07:44 | Araq | *on |
20:07:57 | Araq | looks quite nice |
20:09:44 | shashlick | thanks 🙂 |
20:10:12 | shashlick | as always, open to feedback, if there's a better way, I'm all for it, as long as it is within my ability to comprehend! |
20:11:44 | * | a_b_m joined #nim |
20:12:32 | * | zachcarter joined #nim |
20:12:40 | * | a__b__m joined #nim |
20:15:22 | * | abm quit (Ping timeout: 246 seconds) |
20:16:18 | * | a_b_m quit (Ping timeout: 245 seconds) |
20:17:19 | * | zachcarter quit (Ping timeout: 268 seconds) |
20:22:14 | FromGitter | <kaushalmodi> Araq: good catch on the "DEPRECATED PORTION OF FILE STARTS FROM HERE." portion .. I wonder why they didn't wrap that in some define |
20:23:14 | * | a__b__m quit (Quit: Leaving) |
20:24:42 | * | zachk joined #nim |
20:25:19 | * | miran joined #nim |
20:27:51 | * | narimiran quit (Ping timeout: 246 seconds) |
20:31:25 | Zevv | I get to do a short (+/-30m) Nim introduction presentation at one of my customers - I was wondering of anyone has some slides or other presentation material which I can abuse/reuse? |
20:34:16 | FromGitter | <kaushalmodi> Zevv: I had seen some online |
20:34:19 | FromGitter | <kaushalmodi> give me a min |
20:34:19 | miran | Zevv: i know that @juancarlospaco from telegram channel did some presentations and has some slides |
20:34:54 | FromGitter | <kaushalmodi> miran: yup, those: https://github.com/juancarlospaco/nim-presentation-slides |
20:37:25 | Zevv | that's a good start already, thanks! |
20:38:20 | FromGitter | <kaushalmodi> Zevv: https://fervent-euler-388819.netlify.com/#/0 |
20:38:51 | FromGitter | <kaushalmodi> @juancarlospaco I just deployed your repo to Netlify, and copied the English version to index.html |
20:39:10 | * | aguspiza joined #nim |
20:39:24 | FromGitter | <kaushalmodi> though .. I am getting a bit dizzy after few slides :) |
20:39:56 | Zevv | my fan is going WHEEEEEE from the transitions :) |
20:43:38 | * | zachcarter joined #nim |
20:45:00 | * | MightyJoe quit (Ping timeout: 250 seconds) |
20:45:15 | * | cyraxjoe joined #nim |
20:48:02 | * | zachcarter quit (Ping timeout: 250 seconds) |
20:49:02 | * | abm joined #nim |
21:01:00 | * | zyklon_ quit (Quit: WeeChat 1.9) |
21:06:21 | * | Trustable quit (Remote host closed the connection) |
21:06:55 | federico3 | Zevv: https://github.com/FedericoCeratto/nim-slides if you want to contribute to a shared slide deck. No tooling needed |
21:10:58 | JnR | Now why would Nim have me go through this extensive guide to create an interpreter and never even suggest how I should organize my source code? |
21:11:45 | Zevv | federico3: thanks, looks good! These go well with a parallel live code&show |
21:12:28 | FromGitter | <kaushalmodi> JnR: Look at nimble README |
21:12:53 | FromGitter | <kaushalmodi> do `nimble init foo` and follow the structure auto-created for you |
21:13:03 | JnR | FromGlitter Thanks. Maybe there's hope after all |
21:13:11 | FromGitter | <kaushalmodi> https://github.com/nim-lang/nimble#project-structure |
21:14:02 | FromGitter | <kaushalmodi> JnR: umm The "FromGitter" you see would be for every message coming from Gitter |
21:14:12 | FromGitter | <kaushalmodi> not just me :) |
21:15:16 | JnR | kaushalmodi Lol let me fix one problem at a time |
21:15:34 | * | krux02 quit (Remote host closed the connection) |
21:17:26 | JnR | Wait so this chat room is just connected to multiple external Apps to allow it to exist everywhere? |
21:17:54 | shashlick | Discord <=> IRC <=> Gitter |
21:17:54 | JnR | Telegram, Glitter |
21:18:03 | shashlick | Telegram isn't linked yet |
21:18:40 | JnR | This is one seriously progressive IRC channel |
21:40:39 | JnR | Will nimble just load up C files like Nim files? |
21:41:02 | * | oculux quit (Quit: blah) |
21:41:58 | * | oculux joined #nim |
21:49:49 | * | miran quit (Ping timeout: 268 seconds) |
22:02:51 | * | zachcarter joined #nim |
22:04:44 | * | aguspiza quit (Ping timeout: 250 seconds) |
22:07:15 | * | zachcarter quit (Ping timeout: 246 seconds) |
22:07:50 | * | Vladar quit (Remote host closed the connection) |
22:15:55 | * | stefanos82 quit (Remote host closed the connection) |
22:35:53 | * | skellock quit (Ping timeout: 245 seconds) |
22:36:51 | * | zachk quit (Changing host) |
22:36:51 | * | zachk joined #nim |
22:38:39 | rayman22201 | The one problem with this channel. Most nimmers are European, so they start to go to sleep :-P |
22:39:46 | rayman22201 | I don't really understand your question @JnR. What do you mean "load up"? |
22:40:58 | * | smitop joined #nim |
22:48:32 | smitop | I'm getting ``Address already in use [OSError]`` errors everytime I run my server, except for the first time I boot up my development VM |
22:48:35 | smitop | Why |
22:49:29 | rayman22201 | Your server is trying to bind to the same port and the port didn't get properly released. |
22:50:57 | smitop | I've tried killing every process with `nim` in the name |
22:51:08 | rayman22201 | killing a process does not release the port |
22:51:13 | smitop | How do I release a port |
22:51:42 | smitop | `socket.close()`? |
22:51:48 | rayman22201 | in fact, the opposite lol. The OS will do it eventually, but you should do it properly in the exit code of your app |
22:52:02 | rayman22201 | let me double check. I think so |
22:52:54 | rayman22201 | yup. socket.close should do it |
22:55:26 | FromGitter | <Varriount> JnR: what do you mean? |
22:58:00 | rayman22201 | @smitop, one more thing you might want to do: `socket.setSockOpt(OptReusePort, true)` |
22:58:11 | rayman22201 | because this: https://stackoverflow.com/questions/5106674/error-address-already-in-use-while-binding-socket-with-address-but-the-port-num |
23:04:02 | * | vegax87 quit (Changing host) |
23:04:03 | * | vegax87 joined #nim |
23:04:03 | * | vegax87 quit (Changing host) |
23:04:03 | * | vegax87 joined #nim |
23:13:38 | * | skellock joined #nim |
23:14:34 | FromGitter | <dandevelo> Does anyone know why --noMain is not working like mentioned here: https://forum.nim-lang.org/t/4434 ? |
23:16:46 | JnR | Varriount I'm reffering to the DMI Parser tutorial on the Nim website. At the end of the tutorial I have both Nim and C code that has to be run to format this Interpreter |
23:17:50 | JnR | Varriount The tutorial actually gave me the C code to run so I know it's not a mistake |
23:23:38 | JnR | It's no big deal I just haven't ever had a reason to build any of my Python projects so this is a different format. I'm gonna hold off on jumping into compiling an entire project |
23:27:04 | * | skellock quit (Ping timeout: 250 seconds) |
23:33:25 | JnR | I found this solution on the Nim site https://nim-lang.org/docs/c2nim.html |
23:45:54 | FromGitter | <dandevelo> Has anyone here used Nim to create a static library? |
23:52:38 | federico3 | dandevelo: you mean you compile againts the C code generated by Nim? |
23:53:55 | FromGitter | <dandevelo> @federico3: yes, compile the C code generated by Nim in a static library and use that static library in another Nim or C application |
23:54:41 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
23:57:39 | * | zachcarter joined #nim |
23:57:41 | * | leorize quit (Quit: WeeChat 2.3) |
23:59:07 | * | Jjp137 quit (Ping timeout: 240 seconds) |