00:09:13 | * | vlad1777d quit (Ping timeout: 245 seconds) |
00:14:16 | FromGitter | <gogolxdong> Will try after getting office.Thanks in advance. |
00:15:51 | * | shpx joined #nim |
00:16:36 | * | OrganicAnywhere quit (Quit: Get schwifty) |
00:28:51 | * | kapil____ joined #nim |
01:09:07 | * | Ven`` quit (Ping timeout: 240 seconds) |
01:30:11 | * | xace quit (Ping timeout: 250 seconds) |
01:33:08 | * | xace joined #nim |
01:51:06 | * | Ven`` joined #nim |
01:56:13 | * | dddddd quit (Remote host closed the connection) |
02:10:26 | * | shpx quit (Ping timeout: 250 seconds) |
02:23:52 | * | Ven`` quit (Ping timeout: 250 seconds) |
02:34:22 | FromGitter | <gogolxdong> it works, thanks @rayman22201 |
02:47:38 | * | kapil____ quit (Quit: Connection closed for inactivity) |
03:00:09 | * | banc quit (Quit: Bye) |
03:05:25 | * | kapil____ joined #nim |
03:15:56 | * | banc joined #nim |
03:25:40 | * | Tyresc quit (Quit: WeeChat 2.4-dev) |
03:35:49 | FromGitter | <rayman22201> đ |
03:37:32 | * | abm quit (Remote host closed the connection) |
03:37:55 | * | abm joined #nim |
03:40:01 | * | zachk quit (Quit: Leaving) |
03:51:09 | * | abm quit (Remote host closed the connection) |
03:51:34 | * | abm joined #nim |
03:54:04 | * | abm quit (Remote host closed the connection) |
03:54:25 | * | abm joined #nim |
04:04:27 | * | abm quit (Ping timeout: 268 seconds) |
04:30:54 | * | smitop quit (Quit: Connection closed for inactivity) |
04:45:45 | shashlick | nimterop now supports arrays and function pointers as well - check out http://ix.io/1wXy/nim for the output for https://github.com/floooh/sokol/blob/master/sokol_app.h |
04:47:12 | shashlick | also, if you only want to run C/C++ code through the preprocessor and get the output for that file, use the -p flag |
04:47:17 | shashlick | feedback appreciated as always |
05:30:00 | * | quipa_ quit (Remote host closed the connection) |
05:30:28 | * | quipa_ joined #nim |
05:33:00 | * | quipa_ quit (Max SendQ exceeded) |
05:33:57 | * | quipa_ joined #nim |
05:37:30 | * | quipa_ quit (Max SendQ exceeded) |
05:37:59 | * | quipa_ joined #nim |
05:39:30 | * | quipa_ quit (Remote host closed the connection) |
05:39:54 | * | quipa_ joined #nim |
05:46:07 | * | nsf joined #nim |
05:52:04 | FromDiscord_ | <has1> hi |
05:52:40 | FromDiscord_ | <has1> I was trying to look for the getEnv function in nim |
05:52:59 | FromDiscord_ | <has1> And it shows me this |
05:53:00 | FromDiscord_ | <has1> https://nim-lang.org/docs/nimscript.html#getEnv%2Cstring%2Cstring |
05:53:24 | FromDiscord_ | <has1> under the module name "nimscript" |
05:54:45 | FromDiscord_ | <has1> but importing that gives me |
05:54:50 | FromDiscord_ | <has1> "main.nim(2, 8) Error: cannot open file: nimscript" |
05:56:09 | FromDiscord_ | <has1> importing it via ospaths works, but the docs for ospaths https://nim-lang.org/docs/ospaths.html doesn't show a getEnv proc |
06:11:50 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
06:13:08 | shashlick | https://nim-lang.github.io/Nim/os.html#getEnv%2Cstring%2Cstring |
06:13:13 | shashlick | ospaths is deprecated |
06:13:15 | * | narimiran joined #nim |
06:42:09 | * | azuri5 joined #nim |
06:51:31 | * | shashlick quit (Remote host closed the connection) |
06:51:55 | * | shashlick joined #nim |
07:12:30 | * | Vladar joined #nim |
07:51:11 | FromGitter | <gogolxdong> is codeReordering a topology ordering? |
07:53:10 | FromGitter | <gogolxdong> it's useful when generating code has order dependencies with macros if so. |
07:57:38 | * | kapil____ quit (Quit: Connection closed for inactivity) |
08:05:04 | * | vlad1777d joined #nim |
08:26:00 | * | OrganicAnywhere joined #nim |
08:36:11 | OrganicAnywhere | If I do this: ```var i: int = 10; var r: ref int;``` and I want to tell my program that r should refer to i change the value of i through r, how do I do that? |
08:38:31 | OrganicAnywhere | Ah, I forgot to say new r after var r: ref int. |
08:41:04 | * | narimiran quit (Remote host closed the connection) |
08:44:40 | leorize | OrganicAnywhere: either you use unsafe pointer `var r = addr i` |
08:44:50 | leorize | or you make `i` a ref int |
08:47:15 | FromGitter | <mratsim> ref int is pretty wasteful |
08:47:42 | OrganicAnywhere | Okay, so unsafe pointers is like the usual C pointers. What, then, is a reference in Nim? The manual says traced references (so a ref) points to objects of a garbage collected heap. |
08:47:55 | FromGitter | <mratsim> ptr int is C pointers |
08:48:00 | OrganicAnywhere | right |
08:48:01 | FromGitter | <mratsim> ref int is through Nim GC |
08:48:53 | FromGitter | <mratsim> once a ref is not referenced anymore it will be collected |
08:49:02 | FromGitter | <mratsim> also the GC will ensure the lifetime of a ref int |
08:49:37 | FromGitter | <mratsim> with ptr int, the int pointed to can disappear and the ptr int will point to invalid memory |
08:49:45 | OrganicAnywhere | So in the example here <https://nim-lang.org/docs/manual.html#types-reference-and-pointer-types> why Node = ref NodeObj and then var n: Node? Why not just var n: NodeObject? |
08:50:17 | OrganicAnywhere | mratsim: Invalid memory is the same as unallocated memory? |
08:50:42 | OrganicAnywhere | sorry, var n: NodeObj |
08:50:46 | FromGitter | <mratsim> it might be allocated memory to another program if the memory was released to the OS |
08:50:58 | OrganicAnywhere | I see. |
08:51:19 | FromGitter | <mratsim> in the example NodeObj contains another Node |
08:51:38 | FromGitter | <mratsim> for cyclic types like trees you need to use a ref type |
08:52:05 | FromGitter | <mratsim> actually the example would be better like this: â â ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c25e4356649aa1f82e189d1] |
08:52:42 | OrganicAnywhere | Not sure if I've understood... does a reference always point to the same place in memory? |
08:53:06 | FromGitter | <mratsim> it works like this |
08:53:14 | FromGitter | <mratsim> ref â> GC cell â> actual memory |
08:53:28 | FromGitter | <mratsim> the GC can move the âactual memoryâ location |
08:53:41 | OrganicAnywhere | Alright |
08:53:57 | FromGitter | <mratsim> it does that for cyclic types to detect cycles |
08:54:14 | * | bevo joined #nim |
08:55:03 | FromGitter | <mratsim> note that the ref points directly to the actual memory location, there is no double indirection. |
08:55:27 | FromGitter | <mratsim> well itâs implementation detail there. |
08:55:43 | OrganicAnywhere | Right, just that the GC can decide to move that actual memory location? |
08:56:00 | FromGitter | <mratsim> yes |
08:56:14 | FromGitter | <mratsim> the question you need to ask yourself to choose between ref and non-ref is what behaviour do I want when copying |
08:56:22 | FromGitter | <mratsim> â> value semantics or reference semantics |
08:56:54 | OrganicAnywhere | Is this the same thing as shallow copy or deep copy? |
08:57:03 | FromGitter | <mratsim> if your type is a scarce resource not trivially copyable (say allocated memory, database connection, socket, file handle) it should probably be a reference type |
08:57:13 | * | bevo009 joined #nim |
08:57:17 | FromGitter | <mratsim> you can say that. |
09:12:50 | * | xet7 joined #nim |
09:24:26 | * | azuri5 quit (Quit: azuri5) |
09:26:12 | * | narimiran joined #nim |
09:36:06 | * | kapil____ joined #nim |
09:37:25 | * | stefanos82 joined #nim |
09:47:52 | OrganicAnywhere | mratsim: Ok, I wrote some toy code to test some things and I think I understand refs and ptrs in Nim better now. Thank you. |
09:48:02 | FromGitter | <mratsim> youâre welcome |
09:55:48 | * | OrganicAnywhere quit (Ping timeout: 252 seconds) |
10:08:27 | FromGitter | <gogolxdong> Anyone used websocket in karax? |
10:09:12 | FromGitter | <alehander42> I think karax and websocket are orthogonal |
10:09:25 | FromGitter | <alehander42> karax takes care of the DOM / events |
10:09:39 | FromGitter | <alehander42> you can do whatever you like in event handlers |
10:10:32 | FromGitter | <gogolxdong> Uncaught DOMException: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state. |
10:10:34 | FromGitter | <alehander42> e.g. sending stuff (and then invoking karax redraw when you receive stuff) |
10:10:45 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c25f6a50b7fc97caaafdc81] |
10:11:19 | FromGitter | <gogolxdong> not sure it has issues. |
10:12:33 | FromGitter | <alehander42> well this has nothing to do with karax |
10:12:45 | FromGitter | <alehander42> how is newWebSocket defined |
10:12:59 | FromGitter | <gogolxdong> using the jwebsockets in karax. |
10:13:19 | FromGitter | <alehander42> oh ... Araq, why are they included inside .. |
10:13:25 | * | quipa_ quit (Read error: Connection reset by peer) |
10:14:17 | FromGitter | <alehander42> i think they should be in the stdlib if they are predefined |
10:14:28 | FromGitter | <alehander42> (e.g. jsffi ) |
10:14:40 | FromGitter | <alehander42> ok, in this case |
10:16:28 | FromGitter | <gogolxdong> Is this the issue of client or server? |
10:18:18 | FromGitter | <gogolxdong> I am using the serverws.nim in ormin. |
10:19:28 | FromGitter | <alehander42> well, no, I think it's fundamentally how web sockets work |
10:19:37 | FromGitter | <alehander42> it takes some time for the connection to start |
10:19:56 | FromGitter | <alehander42> look at ws.readyState |
10:20:02 | FromGitter | <alehander42> it should be 1 |
10:20:14 | FromGitter | <alehander42> but immediately after you create it, its' still 0 |
10:20:56 | FromGitter | <alehander42> basically that's why you have onopen |
10:21:08 | FromGitter | <alehander42> when onopen happens: then it's ready to send stuff |
10:22:34 | FromGitter | <alehander42> does onopen happen at some point? |
10:24:18 | FromGitter | <alehander42> you can always test your client side with something like "wss://echo.websocket.org" |
10:24:25 | FromGitter | <alehander42> it just echoes back whatever you send |
10:29:47 | FromGitter | <gogolxdong> sure, thanks, might be the reason of server firewall. will check later. |
10:30:04 | FromGitter | <alehander42> yes, this can be tricky |
10:30:12 | FromGitter | <alehander42> good luck |
10:32:24 | FromGitter | <gogolxdong> Can nimterop improve the compiling time of C++ project? |
10:35:20 | * | NimBot joined #nim |
10:37:08 | FromGitter | <gogolxdong> yeah, the firewall, solved. |
10:49:27 | FromGitter | <mratsim> @gogolxdong I found that Nim compiles C++ faster than CMake |
10:49:56 | FromGitter | <mratsim> Example https://github.com/numforge/agent-smith/blob/master/third_party/ale_build.nim vs https://github.com/mgbellemare/Arcade-Learning-Environment/blob/b2f755781cda57a984b6e3f3b6ef00c1f518b622/CMakeLists.txt |
10:56:59 | * | quipa joined #nim |
10:58:13 | * | quipa quit (Max SendQ exceeded) |
10:59:49 | * | quipa joined #nim |
11:13:39 | * | endragor joined #nim |
11:19:47 | * | hoijui joined #nim |
11:22:26 | * | Trustable joined #nim |
11:46:40 | * | narimiran quit (Remote host closed the connection) |
11:47:51 | * | narimiran joined #nim |
11:48:29 | * | narimiran quit (Remote host closed the connection) |
11:49:51 | * | narimiran joined #nim |
11:55:20 | * | endragor quit (Remote host closed the connection) |
11:55:47 | * | smitop joined #nim |
12:28:07 | * | dddddd joined #nim |
12:53:02 | * | xace quit (Ping timeout: 244 seconds) |
13:02:21 | * | xace joined #nim |
13:19:27 | FromGitter | <gogolxdong> by how much. |
13:30:08 | FromGitter | <mratsim> I didnât measure but noticeably faster, so I guess in the 30% to 70% |
13:30:36 | * | abm joined #nim |
13:30:56 | FromGitter | <mratsim> just clone my repo and time both |
13:31:51 | FromGitter | <mratsim> you can use `nimble build_ale` to automate the nim build: https://github.com/numforge/agent-smith/blob/master/agent_smith.nimble#L34 |
14:00:26 | * | hoijui quit (Ping timeout: 246 seconds) |
14:13:23 | * | Vladar quit (Remote host closed the connection) |
15:03:21 | FromGitter | <arnetheduck> @mratsim not sure what you mean by "cmake compiles c++ faster" - you generally use `ninja` in conjunction with cmake - the two together have remarkably good dependency tracking for c++ as well |
15:04:05 | FromGitter | <mratsim> I didnât say that |
15:04:19 | FromGitter | <arnetheduck> *nim! |
15:04:26 | FromGitter | <mratsim> I said that using Nim to compile a C++ project was faster than using Cmake |
15:04:52 | FromGitter | <mratsim> Nim was faster at getting a binary than CMake |
15:04:56 | FromGitter | <mratsim> I donât know the reason |
15:06:07 | FromGitter | <arnetheduck> which part? you writing it or cmake recompiling? ie for a one-time compile, yeah, because cmake first generates a build system etc.. but with ale_build, you're comparing apples and pears - it's like saying "running gcc *.cpp" is faster than cmake |
15:06:56 | FromGitter | <arnetheduck> ie you use cmake to get a c++ development environment that handles rebuilds, dependency tracking etc etc |
15:07:19 | FromGitter | <mratsim> cmake dependency tracking is poor |
15:07:51 | FromGitter | <mratsim> the rebuild works fine with Nim as well |
15:08:01 | FromGitter | <arnetheduck> indeed - it doesn't do that at all - it leaves that part up to `ninja` |
15:09:52 | FromGitter | <arnetheduck> ie nim doesn't trach header changes, transitive deps, changes to build flags etc - `ninja` does |
15:10:40 | FromGitter | <mratsim> the vast majority of C++ projects are not using ninja |
15:12:40 | FromGitter | <arnetheduck> er,.. no, they tend to use autoconf.. but those that use `cmake` also use ninja - you do `cmake -GNinja` to generate ninja build files from the cmake descriptions, then use `ninja` for the actual builds.. cmake is a meta-build system, you don't build directly with it |
15:13:10 | FromGitter | <arnetheduck> you can also generate ordinary `make` files, visual studio `msbuild` files etc etc |
15:14:24 | FromGitter | <arnetheduck> that said, if you're doing a wrapper, of course it's easier to use nim - assuming you get all the compile flags right |
15:14:51 | FromGitter | <mratsim> the project Iâm wrapping doesnât use ninja |
15:14:56 | FromGitter | <mratsim> opencv doesnât use ninja |
15:15:14 | FromGitter | <mratsim> PyTOrch doesnât use ninja |
15:15:31 | FromGitter | <mratsim> plenty of high profile project donât use ninja |
15:15:31 | FromGitter | <gogolxdong> oh, I find `var db {.global.} = open("chat.db", "", "", "")`, does global pragma works for threads? |
15:17:18 | FromGitter | <arnetheduck> I don't understand what you mean, "don't use ninja".. `ninja` is a backend for `cmake` - you, as a developer, choose which `cmake` backend to use - not the upstream developers, generally |
15:23:08 | FromGitter | <arnetheduck> that's kind of the whole point of `cmake` (and `meson`, its slightly more modern cousin) - you use it to generate a build system compatible with your environment.. on windows, you'll use it to generate project files for visual studio - on old unix'es, you'll generate classic `Makefile`'s, while most people go with `ninja`.. the reason you were seeing faster build times with `Nim` is likely because you didn't |
15:23:08 | FromGitter | ... parallelize your build - by default it uses `make` as backend because it's the most supported, and if you didn't know all that and didn't make sure to choose ninja, you likely got a single-core build which naturally will be slower on a modern machine |
15:27:32 | FromGitter | <arnetheduck> now, to speed up c++ builds, what you generally do is: parallelize aggressively (distcc for example), pre-compiled headers (requires some setup) and unity builds (merge several c++ files into a big one - this works well for infrequent compiles).. oh yeah, and you make sure you're using something like ninja - `makefiles` work well up to maybe 100'sh files if you remember to do `-j` to get the parallelization.. |
15:28:42 | FromGitter | <arnetheduck> it's also important that your tool of choice does dep tracking well so as to minimize what is rebuilt, but never forget to rebuild something (when a transitively included header changes for example) |
15:29:32 | FromGitter | <mratsim> thatâs overengineering |
15:31:32 | FromGitter | <arnetheduck> well, depends on the size of the project.. for most cmake projects, you just make sure to use `ninja` and that's it.. you get correct builds for free (unlike nim passc which is suitable for wrappers but not much else) |
15:33:29 | FromGitter | <arnetheduck> ie imagine writing openoffice or llvm or any other slightly larger project in nim - not doable, with the current approach of full recompiles - in c++, you also need to take a little bit more care |
15:34:37 | * | kapil____ quit (Quit: Connection closed for inactivity) |
15:37:22 | * | Snircle joined #nim |
15:37:58 | FromGitter | <arnetheduck> just to verify my claim, just built `opencv` with `ninja` - works just fine :) |
15:41:23 | Calinou | hey, I wonder if there's an equivalent to https://plumbum.readthedocs.io/en/latest/ in Nim |
15:41:44 | Calinou | using the standard library is probably not too bad but I wonder if it can be made more convenient for quick scripts |
15:43:38 | FromGitter | <mratsim> Iâm pretty sure I saw a reference about some shell magic package in C/Unix that has been in existence for 20 years and people asking if Nim had something similar in power |
15:43:45 | FromGitter | <mratsim> and twice at that |
15:45:12 | * | Tyresc joined #nim |
15:59:33 | Araq | not that I disagree but plenty of C++ project build faster when joined into a single .cpp file ;-) |
16:01:30 | shashlick | @gogolxdong: I think you mentioned nimterop above, was it a typo? It generates wrappers, not sure what it has to do with compile time |
16:06:38 | * | abm quit (Read error: Connection reset by peer) |
16:06:42 | FromGitter | <arnetheduck> well, with that's kind of LTO.. at least half of it :) |
16:13:10 | shashlick | @arnetheduck I fiddled with llvm wrapping a bit yesterday |
16:13:10 | FromGitter | <arnetheduck> @mratsim the unity build is actually one of the things I tried to resolve our rocksdb woes, they have it in their makefile.. it's broken though, unfortunately: https://github.com/facebook/rocksdb/issues/4688 |
16:13:55 | shashlick | Did you generate the def files in Config without cmake |
16:14:33 | FromGitter | <arnetheduck> I built llvm first - there's a `make-llvm.sh` script for that |
16:15:06 | shashlick | Ok and you are linking to the dll, not compiling in |
16:15:15 | FromGitter | <arnetheduck> yeah |
16:15:38 | shashlick | I just saw target.h which had a bunch of proc defines |
16:15:49 | shashlick | Presume that's what you were talking about |
16:16:04 | FromGitter | <arnetheduck> llvm incidentally uses.. `cmake`, and guess which backend they recommend :) |
16:17:21 | shashlick | I got lazy real quick since you already have a working setup but nimterop did fairly well processing the files |
16:17:44 | FromGitter | <arnetheduck> there's a `#define LLVM_FOR_EACH_VALUE_SUBCLASS(macro)` which is troublesome, then there's the target def files |
16:18:12 | shashlick | Do you end up calling it in your Nim code? |
16:18:27 | FromGitter | <arnetheduck> that's `Core.h` |
16:19:20 | FromGitter | <arnetheduck> no, what it does is generate functions like `LLVMIsAConstant` etc - I don't use those in `nlvm` |
16:19:45 | FromGitter | <arnetheduck> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c264d21db5b5c68831df4b5] |
16:20:20 | FromGitter | <arnetheduck> then there's the other one for targets - I import those manually instead: https://github.com/arnetheduck/nlvm/blob/master/llvm/llvm.nim#L51 |
16:21:58 | FromGitter | <arnetheduck> basically, when you configure llvm (call `cmake` to generate the build files), you choose which backends it should compile / include.. that creates the `.def` file that's used by the target macro to create `initialize*` functions - that's why it's a bit of a strange process |
16:23:29 | shashlick | Are there any specific flags to pass cmake |
16:23:41 | FromGitter | <arnetheduck> so in `make-llvm` I enable only the x86 and wasm backends for now, so I can kind of cheat and add the initialize things by hand and it works.. it's a hack though - given there's only one llvm release per year, it's good enough for `nlvm`'s needs, but obviously not satisfactory if you want to create "proper" llvm bindings |
16:23:47 | shashlick | Also which os you working on |
16:24:04 | FromGitter | <arnetheduck> https://github.com/arnetheduck/nlvm/blob/master/make-llvm.sh#L17 |
16:24:06 | FromGitter | <arnetheduck> linux |
16:24:33 | shashlick | Any intention of getting this to work on windows |
16:25:10 | shashlick | Sorry for the interview, I can wrap llvm and improve the tools as I go |
16:25:23 | shashlick | But want to understand the requirements |
16:25:33 | FromGitter | <arnetheduck> I'd love for someone to contribute that :) it would make a lot of sense on windows, would be much easier to distribute Nim that way |
16:26:13 | * | m712 quit (Quit: bye-nyan!) |
16:26:30 | * | m712 joined #nim |
16:28:01 | FromGitter | <arnetheduck> the groundwork has been all laid recently to support the windows ABI, it's just a matter of testing and making a few adjustments here and there etc, I just don't have time to do that (nor do I have time to maintain a windows development machine etc) |
16:30:56 | shashlick | So the biggest challenge I face with wrappers is writing good test cases to verify it works |
16:31:15 | shashlick | Would you be able to extract a good test bed that I could test against |
16:31:35 | FromGitter | <arnetheduck> what exactly do you need to test? |
16:32:38 | shashlick | When I create wrappers, I create some Nim test code that uses the procs and data types that are wrapped |
16:33:15 | shashlick | This then gets tested across multiple Nim versions and os every day to ensure the wrapper still works |
16:33:44 | shashlick | All nimgen wrappers have this though the test bed could do with more elaborate test cases |
16:34:03 | shashlick | This is mainly because I create wrappers for people and rarely for myself |
16:35:28 | shashlick | The tree-sitter wrapper is heavily used by nimterop so I know that one well but many others have limited tests in place |
16:35:43 | shashlick | So for something like llvm-c, you'd want good test cases |
16:38:23 | FromGitter | <arnetheduck> well, it's hard to extract something meaningful without building llvm itself - that's how you know that the wrapper didn't mess up the types |
16:39:57 | shashlick | So typically I compile the wrapped lib as part of wrapping |
16:40:25 | shashlick | Given llvm is complex, I presume wrapping their binary is a safer bet |
16:41:45 | * | smitop quit (Quit: Connection closed for inactivity) |
16:43:09 | FromGitter | <nothratal> Hi folks, recently I decided to give nim a try. â Is there already a IDE/Editor+Plugins combination supporting things like intellisense? I read this site here: https://github.com/nim-lang/Nim/wiki/Editor-Support but how good is the code ompletion on methods and types and chaining methods and so on? This would make the learning process much much simpler. |
16:48:39 | shashlick | @nothratal: welcome :) |
16:49:22 | shashlick | Most devs use vscode, some use sublime, vim and emacs |
16:49:55 | shashlick | There's some work going on with a language server for Nim which @PMunch will know best |
16:50:10 | shashlick | But completion is in early times |
16:50:58 | shashlick | I'm using notepad++ for now since I'm picky on mem usage |
16:58:48 | * | kapil____ joined #nim |
17:12:58 | FromGitter | <nothratal> I don't mind to switch to a different editor. Especially from aton to vscode. The bottleneck in learning won't be the editor at the beginning for me |
17:13:11 | FromGitter | <nothratal> It will be the language :P |
17:13:44 | FromGitter | <nothratal> In which editor is the support most mature? Or doesn't make it a difference because of the language server? |
17:17:23 | shashlick | That's what I feel |
17:17:41 | shashlick | But PMunch has gotten lsp working in vim and sublime I think |
17:17:45 | shashlick | Haven't tried though |
17:18:08 | shashlick | https://github.com/PMunch/nimlsp |
17:35:15 | * | narimiran quit (Remote host closed the connection) |
17:45:47 | * | banc quit (Ping timeout: 240 seconds) |
17:55:38 | * | leorize quit (Ping timeout: 268 seconds) |
17:57:27 | * | leorize joined #nim |
17:58:34 | * | xet7 quit (Ping timeout: 250 seconds) |
18:21:45 | * | xet7 joined #nim |
18:34:50 | * | quipa quit (Remote host closed the connection) |
18:35:16 | * | quipa joined #nim |
18:39:08 | * | quipa quit (Max SendQ exceeded) |
18:39:38 | * | quipa joined #nim |
18:41:35 | * | dorelix quit (Remote host closed the connection) |
18:43:19 | * | quipa quit (Remote host closed the connection) |
18:43:54 | * | quipa joined #nim |
18:47:27 | FromGitter | <zetashift> @nothratal I've used spacemacs and vscode for Nim both worked nicely. I think most people are on VSCode though |
18:48:16 | * | quipa quit (Max SendQ exceeded) |
18:48:42 | * | quipa joined #nim |
18:48:45 | shashlick | is it possible to iterate through all consts declared in a nim file somehow |
18:52:35 | * | quipa quit (Max SendQ exceeded) |
18:53:54 | Araq | arnetheduck: do you know which C++ specific optimizations clang/llvm implement? (aside from the ones the C++ standard requires, I mean) |
18:54:08 | * | quipa joined #nim |
18:54:19 | Araq | my search about this topic lead no results |
18:55:02 | * | quipa quit (Max SendQ exceeded) |
18:55:08 | FromGitter | <arnetheduck> you mean stuff like copy elision and the like? |
18:56:28 | Araq | yes |
18:56:55 | * | quipa joined #nim |
18:57:19 | * | quipa quit (Remote host closed the connection) |
18:57:45 | * | quipa joined #nim |
18:57:46 | Araq | or more general stdlib optimizations like s = s[0..^3] --> s.setLen(s.len-2) |
18:58:11 | * | quipa quit (Read error: Connection reset by peer) |
19:02:16 | shashlick | I want to convert a bunch of consts into a table since i want to use the name at runtime dynamically - any tips appreciated |
19:02:16 | FromGitter | <arnetheduck> not too sure to be honest - I know they both do elision, (n)rvo and tco - c++17 even requires copy elision in some specific cases.. then there's a whole bunch of those stdlib optimizations and builtins (difference being that the latter is chosen by glibc headers, the former being autodetected by gcc), but which they are specifically varies from version to version - https://gcc |
19:02:16 | FromGitter | ... .gnu.org/onlinedocs/gcc-8.2.0/gcc/Optimize-Options.html hints at strlen, strchr and strcpy - I know llvm does memcpy and memset as well |
19:04:43 | FromGitter | <arnetheduck> shashlick, llvm isn't that complex, it just takes a lot of time to build.. what I'd probably do if I was building a serious wrapper would be to make sure to version it in tandem with llvm, and yeah, go with prebuilt binaries |
19:05:53 | FromGitter | <arnetheduck> also, if I was making binary releases of `nlvm` I'd probably compile/link statically - only reason I'm not doing that is that is that it takes so long to link, when working on it |
19:06:13 | shashlick | @arnetheduck: what's the best place to download prebuilt binaries? linux is okay with package managers, mac, probably brew - windows is the pain |
19:06:27 | shashlick | cause in the wrapper install process with nimble, i'd like to cover the binaries too |
19:06:47 | FromGitter | <arnetheduck> so basically, high quality llvm wrappers would have two variants for every llvm version released - static and dynamic |
19:07:20 | * | nc-x joined #nim |
19:07:44 | nc-x | shashlick: there is this - https://github.com/ziglang/zig/wiki/Building-Zig-on-Windows |
19:07:45 | FromGitter | <arnetheduck> well, they're on the release page: http://releases.llvm.org/download.html#7.0.0 |
19:08:00 | nc-x | "Here is llvm and clang x64 built with MSVC in release mode" |
19:08:20 | FromGitter | <arnetheduck> you have a bunch of platforms there, mac included |
19:09:31 | shashlick | ya but those binaries are huge and contain everything |
19:09:42 | FromGitter | <arnetheduck> but for that particular project, I'd expect the wrappers to be able to use my own supplied llvm as well - for example, I use a slightly custom release-with-asserts build which is handy during development |
19:09:44 | shashlick | when all you really need is a specific dll |
19:10:33 | shashlick | okay that's fair, so in theory, this wrapper could do with supporting both static and dynamic linking to a lib provided by the user |
19:10:47 | shashlick | no need to take on compiling all the files in |
19:10:54 | shashlick | but i still need to figure out what those def files should look like |
19:11:14 | shashlick | unless they are pretty standard across OS/compiler |
19:11:45 | FromGitter | <arnetheduck> they're tied to the build options you provided when building llvm (or when the binary packages were built - whatever) |
19:12:29 | FromGitter | <arnetheduck> actually, if you take the upstream def files, I suspect everything will just work because nim only references used symbols - so even if a local llvm build doesn't have those symbols, it'll be fine |
19:13:10 | shashlick | but github doesn't have those stored - https://github.com/llvm-mirror/llvm/tree/master/include/llvm/Config |
19:15:03 | * | nc-x quit (Ping timeout: 256 seconds) |
19:20:57 | FromGitter | <arnetheduck> no, but they'll be part of the binary download most likely |
19:22:10 | shashlick | okay, off to download 100MB |
19:22:26 | FromGitter | <arnetheduck> well, I can give you mine for testing if you like |
19:24:14 | shashlick | well i need to check what's different across win/lin/osx |
19:25:24 | FromGitter | <arnetheduck> ah, no, then I can't help you :/ |
19:27:31 | shashlick | what do you link against? libclang? |
19:29:27 | shashlick | probably lto.dll - there's no lto.lib in this windows package |
19:29:47 | shashlick | also, the def files aren't in here |
19:32:59 | shashlick | okay, looks like you are linking to libLLVM-7.so, but there's no such file in the windows package - guessing it is lto.dll but hm |
19:36:36 | FromGitter | <arnetheduck> what did you download? |
19:37:44 | FromGitter | <arnetheduck> I'd expect there to be an llvm.dll or something like that |
19:54:39 | * | kapil____ quit (Quit: Connection closed for inactivity) |
20:00:37 | * | zachk joined #nim |
20:02:36 | * | zachk quit (Changing host) |
20:02:36 | * | zachk joined #nim |
20:05:15 | * | nsf quit (Quit: WeeChat 2.3) |
20:10:25 | Zevv | is there a way to use the same field in multiple 'kind' cases of an object variant? For example, id like to have field A in case kind1 and kind2, and field B in case kind2 and kind3. |
20:16:30 | * | hoijui joined #nim |
20:23:47 | shashlick | @arnetheduck I downloaded the win32 executable |
20:24:08 | shashlick | I guess we have to build it ourselves |
20:26:00 | shashlick | But I don't have visual studio nor the motivation to install it |
20:40:24 | Araq | Zevv: you can use different names for different fields or pull the field out of the 'case' section |
20:52:15 | Zevv | ok |
21:11:12 | Araq | and I'm trying to do some kind of statistic here so please tell me: |
21:12:11 | Araq | do you need the field to be 'shared' per object instance or is ML-like good enough? |
21:12:58 | Zevv | shared would be nice, I have quite a lot on them on a low memory system |
21:13:30 | Zevv | I recently had these problems with generic multimethods, so I am now rewriting my system to use object variants |
21:13:37 | Zevv | some of my node types have children, some do not |
21:14:15 | Zevv | now I have a reference on all object types to point to children, even on nodes that never use this field |
21:14:51 | Zevv | or some ugly code to use different named fields for different variants which all do the same |
21:15:09 | Araq | well inheritance still works ok, just don't use the 'method' keyword |
21:42:03 | * | hoijui quit (Ping timeout: 264 seconds) |
21:56:46 | FromDiscord_ | <DarkArctic> is there a way to have my own `$` proc used for a SinglyLinkedList? it looks like there's already one defined, but Nim looks like it doesn't resolve it as more specialised (not sure if that's a thing) |
22:05:14 | rayman22201 | You should be able to just define your own $ proc. There is overloading resoloution: https://nim-lang.org/docs/manual.html#overloading-resolution |
22:08:52 | rayman22201 | you could also exclude the $ proc if you think it's causing an issue : import lists except `$` |
22:10:48 | FromDiscord_ | <DarkArctic> i tried it with an int and i was able to overload it. the import worked. would it be because there's a generic involved? |
22:11:32 | FromDiscord_ | <DarkArctic> well i guess i could read the resolution and figure it out đ |
22:13:25 | FromDiscord_ | <DarkArctic> thanks |
22:13:42 | rayman22201 | np. Could be a bug in the resolution algorithm. hard to tell without seeing a code sample :-) |
22:14:03 | FromDiscord_ | <DarkArctic> no worries, i'll fiddle around a bit first |
22:14:27 | rayman22201 | :thumbsup: |
22:23:23 | * | shpx joined #nim |
22:35:36 | * | endragor joined #nim |
22:35:51 | Calinou | shashlick: https://scoop.sh/ can be used on Windows as an equivalent to Homebrew |
22:36:05 | Calinou | you can create your own Scoop bucket, or specify a JSON manifest to use directly as an URL (automatic updates won't be available this way though) |
22:36:14 | Calinou | or get your package into one of the official Scoop buckets |
22:36:26 | * | rockcavera quit (Remote host closed the connection) |
22:40:20 | * | xet7 quit (Quit: Leaving) |
22:41:33 | FromGitter | <zetashift> I use scoop for a few things |
22:41:37 | FromGitter | <zetashift> pretty solid |
22:56:34 | shashlick | I actually wrote AppSnap several years ago |
22:56:59 | shashlick | and even ported it to Nim when I was evaluating Nim a couple years ago |
22:58:01 | shashlick | scoop and chocolatey are interesting nonetheless |
23:01:55 | * | xace quit (Remote host closed the connection) |
23:02:31 | FromGitter | <kayabaNerve> Figured the Nim crowd may enjoy this http://aras-p.info/blog/2018/12/28/Modern-C-Lamentations/ |
23:03:10 | * | kapil____ joined #nim |
23:05:48 | * | shpx quit (Ping timeout: 244 seconds) |
23:06:14 | * | vlad1777d quit (Ping timeout: 250 seconds) |
23:18:05 | * | endragor quit (Remote host closed the connection) |
23:24:57 | * | xace joined #nim |
23:33:30 | * | Trustable quit (Remote host closed the connection) |
23:36:56 | * | darithorn joined #nim |
23:39:40 | * | abm joined #nim |
23:40:33 | * | nsf joined #nim |
23:45:39 | FromGitter | <Varriount> @kayabaNerve đ |
23:51:53 | * | abm quit (Quit: Leaving) |
23:52:16 | * | nsf quit (Quit: WeeChat 2.3) |
23:52:18 | * | abm joined #nim |