<< 28-12-2018 >>

00:09:13*vlad1777d quit (Ping timeout: 245 seconds)
00:14:16FromGitter<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:22FromGitter<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:49FromGitter<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:45shashlicknimterop 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:12shashlickalso, 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:17shashlickfeedback 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:04FromDiscord_<has1> hi
05:52:40FromDiscord_<has1> I was trying to look for the getEnv function in nim
05:52:59FromDiscord_<has1> And it shows me this
05:53:00FromDiscord_<has1> https://nim-lang.org/docs/nimscript.html#getEnv%2Cstring%2Cstring
05:53:24FromDiscord_<has1> under the module name "nimscript"
05:54:45FromDiscord_<has1> but importing that gives me
05:54:50FromDiscord_<has1> "main.nim(2, 8) Error: cannot open file: nimscript"
05:56:09FromDiscord_<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:08shashlickhttps://nim-lang.github.io/Nim/os.html#getEnv%2Cstring%2Cstring
06:13:13shashlickospaths 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:11FromGitter<gogolxdong> is codeReordering a topology ordering?
07:53:10FromGitter<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:11OrganicAnywhereIf 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:31OrganicAnywhereAh, I forgot to say new r after var r: ref int.
08:41:04*narimiran quit (Remote host closed the connection)
08:44:40leorizeOrganicAnywhere: either you use unsafe pointer `var r = addr i`
08:44:50leorizeor you make `i` a ref int
08:47:15FromGitter<mratsim> ref int is pretty wasteful
08:47:42OrganicAnywhereOkay, 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:55FromGitter<mratsim> ptr int is C pointers
08:48:00OrganicAnywhereright
08:48:01FromGitter<mratsim> ref int is through Nim GC
08:48:53FromGitter<mratsim> once a ref is not referenced anymore it will be collected
08:49:02FromGitter<mratsim> also the GC will ensure the lifetime of a ref int
08:49:37FromGitter<mratsim> with ptr int, the int pointed to can disappear and the ptr int will point to invalid memory
08:49:45OrganicAnywhereSo 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:17OrganicAnywheremratsim: Invalid memory is the same as unallocated memory?
08:50:42OrganicAnywheresorry, var n: NodeObj
08:50:46FromGitter<mratsim> it might be allocated memory to another program if the memory was released to the OS
08:50:58OrganicAnywhereI see.
08:51:19FromGitter<mratsim> in the example NodeObj contains another Node
08:51:38FromGitter<mratsim> for cyclic types like trees you need to use a ref type
08:52:05FromGitter<mratsim> actually the example would be better like this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c25e4356649aa1f82e189d1]
08:52:42OrganicAnywhereNot sure if I've understood... does a reference always point to the same place in memory?
08:53:06FromGitter<mratsim> it works like this
08:53:14FromGitter<mratsim> ref —> GC cell —> actual memory
08:53:28FromGitter<mratsim> the GC can move the “actual memory” location
08:53:41OrganicAnywhereAlright
08:53:57FromGitter<mratsim> it does that for cyclic types to detect cycles
08:54:14*bevo joined #nim
08:55:03FromGitter<mratsim> note that the ref points directly to the actual memory location, there is no double indirection.
08:55:27FromGitter<mratsim> well it’s implementation detail there.
08:55:43OrganicAnywhereRight, just that the GC can decide to move that actual memory location?
08:56:00FromGitter<mratsim> yes
08:56:14FromGitter<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:22FromGitter<mratsim> —> value semantics or reference semantics
08:56:54OrganicAnywhereIs this the same thing as shallow copy or deep copy?
08:57:03FromGitter<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:17FromGitter<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:52OrganicAnywheremratsim: 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:02FromGitter<mratsim> you’re welcome
09:55:48*OrganicAnywhere quit (Ping timeout: 252 seconds)
10:08:27FromGitter<gogolxdong> Anyone used websocket in karax?
10:09:12FromGitter<alehander42> I think karax and websocket are orthogonal
10:09:25FromGitter<alehander42> karax takes care of the DOM / events
10:09:39FromGitter<alehander42> you can do whatever you like in event handlers
10:10:32FromGitter<gogolxdong> Uncaught DOMException: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.
10:10:34FromGitter<alehander42> e.g. sending stuff (and then invoking karax redraw when you receive stuff)
10:10:45FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c25f6a50b7fc97caaafdc81]
10:11:19FromGitter<gogolxdong> not sure it has issues.
10:12:33FromGitter<alehander42> well this has nothing to do with karax
10:12:45FromGitter<alehander42> how is newWebSocket defined
10:12:59FromGitter<gogolxdong> using the jwebsockets in karax.
10:13:19FromGitter<alehander42> oh ... Araq, why are they included inside ..
10:13:25*quipa_ quit (Read error: Connection reset by peer)
10:14:17FromGitter<alehander42> i think they should be in the stdlib if they are predefined
10:14:28FromGitter<alehander42> (e.g. jsffi )
10:14:40FromGitter<alehander42> ok, in this case
10:16:28FromGitter<gogolxdong> Is this the issue of client or server?
10:18:18FromGitter<gogolxdong> I am using the serverws.nim in ormin.
10:19:28FromGitter<alehander42> well, no, I think it's fundamentally how web sockets work
10:19:37FromGitter<alehander42> it takes some time for the connection to start
10:19:56FromGitter<alehander42> look at ws.readyState
10:20:02FromGitter<alehander42> it should be 1
10:20:14FromGitter<alehander42> but immediately after you create it, its' still 0
10:20:56FromGitter<alehander42> basically that's why you have onopen
10:21:08FromGitter<alehander42> when onopen happens: then it's ready to send stuff
10:22:34FromGitter<alehander42> does onopen happen at some point?
10:24:18FromGitter<alehander42> you can always test your client side with something like "wss://echo.websocket.org"
10:24:25FromGitter<alehander42> it just echoes back whatever you send
10:29:47FromGitter<gogolxdong> sure, thanks, might be the reason of server firewall. will check later.
10:30:04FromGitter<alehander42> yes, this can be tricky
10:30:12FromGitter<alehander42> good luck
10:32:24FromGitter<gogolxdong> Can nimterop improve the compiling time of C++ project?
10:35:20*NimBot joined #nim
10:37:08FromGitter<gogolxdong> yeah, the firewall, solved.
10:49:27FromGitter<mratsim> @gogolxdong I found that Nim compiles C++ faster than CMake
10:49:56FromGitter<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:27FromGitter<gogolxdong> by how much.
13:30:08FromGitter<mratsim> I didn’t measure but noticeably faster, so I guess in the 30% to 70%
13:30:36*abm joined #nim
13:30:56FromGitter<mratsim> just clone my repo and time both
13:31:51FromGitter<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:21FromGitter<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:05FromGitter<mratsim> I didn’t say that
15:04:19FromGitter<arnetheduck> *nim!
15:04:26FromGitter<mratsim> I said that using Nim to compile a C++ project was faster than using Cmake
15:04:52FromGitter<mratsim> Nim was faster at getting a binary than CMake
15:04:56FromGitter<mratsim> I don’t know the reason
15:06:07FromGitter<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:56FromGitter<arnetheduck> ie you use cmake to get a c++ development environment that handles rebuilds, dependency tracking etc etc
15:07:19FromGitter<mratsim> cmake dependency tracking is poor
15:07:51FromGitter<mratsim> the rebuild works fine with Nim as well
15:08:01FromGitter<arnetheduck> indeed - it doesn't do that at all - it leaves that part up to `ninja`
15:09:52FromGitter<arnetheduck> ie nim doesn't trach header changes, transitive deps, changes to build flags etc - `ninja` does
15:10:40FromGitter<mratsim> the vast majority of C++ projects are not using ninja
15:12:40FromGitter<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:10FromGitter<arnetheduck> you can also generate ordinary `make` files, visual studio `msbuild` files etc etc
15:14:24FromGitter<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:51FromGitter<mratsim> the project I’m wrapping doesn’t use ninja
15:14:56FromGitter<mratsim> opencv doesn’t use ninja
15:15:14FromGitter<mratsim> PyTOrch doesn’t use ninja
15:15:31FromGitter<mratsim> plenty of high profile project don’t use ninja
15:15:31FromGitter<gogolxdong> oh, I find `var db {.global.} = open("chat.db", "", "", "")`, does global pragma works for threads?
15:17:18FromGitter<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:08FromGitter<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:08FromGitter... 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:32FromGitter<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:42FromGitter<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:32FromGitter<mratsim> that’s overengineering
15:31:32FromGitter<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:29FromGitter<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:58FromGitter<arnetheduck> just to verify my claim, just built `opencv` with `ninja` - works just fine :)
15:41:23Calinouhey, I wonder if there's an equivalent to https://plumbum.readthedocs.io/en/latest/ in Nim
15:41:44Calinouusing the standard library is probably not too bad but I wonder if it can be made more convenient for quick scripts
15:43:38FromGitter<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:45FromGitter<mratsim> and twice at that
15:45:12*Tyresc joined #nim
15:59:33Araqnot that I disagree but plenty of C++ project build faster when joined into a single .cpp file ;-)
16:01:30shashlick@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:42FromGitter<arnetheduck> well, with that's kind of LTO.. at least half of it :)
16:13:10shashlick@arnetheduck I fiddled with llvm wrapping a bit yesterday
16:13:10FromGitter<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:55shashlickDid you generate the def files in Config without cmake
16:14:33FromGitter<arnetheduck> I built llvm first - there's a `make-llvm.sh` script for that
16:15:06shashlickOk and you are linking to the dll, not compiling in
16:15:15FromGitter<arnetheduck> yeah
16:15:38shashlickI just saw target.h which had a bunch of proc defines
16:15:49shashlickPresume that's what you were talking about
16:16:04FromGitter<arnetheduck> llvm incidentally uses.. `cmake`, and guess which backend they recommend :)
16:17:21shashlickI got lazy real quick since you already have a working setup but nimterop did fairly well processing the files
16:17:44FromGitter<arnetheduck> there's a `#define LLVM_FOR_EACH_VALUE_SUBCLASS(macro)` which is troublesome, then there's the target def files
16:18:12shashlickDo you end up calling it in your Nim code?
16:18:27FromGitter<arnetheduck> that's `Core.h`
16:19:20FromGitter<arnetheduck> no, what it does is generate functions like `LLVMIsAConstant` etc - I don't use those in `nlvm`
16:19:45FromGitter<arnetheduck> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c264d21db5b5c68831df4b5]
16:20:20FromGitter<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:58FromGitter<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:29shashlickAre there any specific flags to pass cmake
16:23:41FromGitter<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:47shashlickAlso which os you working on
16:24:04FromGitter<arnetheduck> https://github.com/arnetheduck/nlvm/blob/master/make-llvm.sh#L17
16:24:06FromGitter<arnetheduck> linux
16:24:33shashlickAny intention of getting this to work on windows
16:25:10shashlickSorry for the interview, I can wrap llvm and improve the tools as I go
16:25:23shashlickBut want to understand the requirements
16:25:33FromGitter<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:01FromGitter<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:56shashlickSo the biggest challenge I face with wrappers is writing good test cases to verify it works
16:31:15shashlickWould you be able to extract a good test bed that I could test against
16:31:35FromGitter<arnetheduck> what exactly do you need to test?
16:32:38shashlickWhen I create wrappers, I create some Nim test code that uses the procs and data types that are wrapped
16:33:15shashlickThis then gets tested across multiple Nim versions and os every day to ensure the wrapper still works
16:33:44shashlickAll nimgen wrappers have this though the test bed could do with more elaborate test cases
16:34:03shashlickThis is mainly because I create wrappers for people and rarely for myself
16:35:28shashlickThe tree-sitter wrapper is heavily used by nimterop so I know that one well but many others have limited tests in place
16:35:43shashlickSo for something like llvm-c, you'd want good test cases
16:38:23FromGitter<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:57shashlickSo typically I compile the wrapped lib as part of wrapping
16:40:25shashlickGiven llvm is complex, I presume wrapping their binary is a safer bet
16:41:45*smitop quit (Quit: Connection closed for inactivity)
16:43:09FromGitter<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:39shashlick@nothratal: welcome :)
16:49:22shashlickMost devs use vscode, some use sublime, vim and emacs
16:49:55shashlickThere's some work going on with a language server for Nim which @PMunch will know best
16:50:10shashlickBut completion is in early times
16:50:58shashlickI'm using notepad++ for now since I'm picky on mem usage
16:58:48*kapil____ joined #nim
17:12:58FromGitter<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:11FromGitter<nothratal> It will be the language :P
17:13:44FromGitter<nothratal> In which editor is the support most mature? Or doesn't make it a difference because of the language server?
17:17:23shashlickThat's what I feel
17:17:41shashlickBut PMunch has gotten lsp working in vim and sublime I think
17:17:45shashlickHaven't tried though
17:18:08shashlickhttps://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:27FromGitter<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:45shashlickis it possible to iterate through all consts declared in a nim file somehow
18:52:35*quipa quit (Max SendQ exceeded)
18:53:54Araqarnetheduck: 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:19Araqmy search about this topic lead no results
18:55:02*quipa quit (Max SendQ exceeded)
18:55:08FromGitter<arnetheduck> you mean stuff like copy elision and the like?
18:56:28Araqyes
18:56:55*quipa joined #nim
18:57:19*quipa quit (Remote host closed the connection)
18:57:45*quipa joined #nim
18:57:46Araqor 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:16shashlickI 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:16FromGitter<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:16FromGitter... .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:43FromGitter<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:53FromGitter<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:13shashlick@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:27shashlickcause in the wrapper install process with nimble, i'd like to cover the binaries too
19:06:47FromGitter<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:44nc-xshashlick: there is this - https://github.com/ziglang/zig/wiki/Building-Zig-on-Windows
19:07:45FromGitter<arnetheduck> well, they're on the release page: http://releases.llvm.org/download.html#7.0.0
19:08:00nc-x"Here is llvm and clang x64 built with MSVC in release mode"
19:08:20FromGitter<arnetheduck> you have a bunch of platforms there, mac included
19:09:31shashlickya but those binaries are huge and contain everything
19:09:42FromGitter<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:44shashlickwhen all you really need is a specific dll
19:10:33shashlickokay 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:47shashlickno need to take on compiling all the files in
19:10:54shashlickbut i still need to figure out what those def files should look like
19:11:14shashlickunless they are pretty standard across OS/compiler
19:11:45FromGitter<arnetheduck> they're tied to the build options you provided when building llvm (or when the binary packages were built - whatever)
19:12:29FromGitter<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:10shashlickbut 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:57FromGitter<arnetheduck> no, but they'll be part of the binary download most likely
19:22:10shashlickokay, off to download 100MB
19:22:26FromGitter<arnetheduck> well, I can give you mine for testing if you like
19:24:14shashlickwell i need to check what's different across win/lin/osx
19:25:24FromGitter<arnetheduck> ah, no, then I can't help you :/
19:27:31shashlickwhat do you link against? libclang?
19:29:27shashlickprobably lto.dll - there's no lto.lib in this windows package
19:29:47shashlickalso, the def files aren't in here
19:32:59shashlickokay, 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:36FromGitter<arnetheduck> what did you download?
19:37:44FromGitter<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:25Zevvis 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:47shashlick@arnetheduck I downloaded the win32 executable
20:24:08shashlickI guess we have to build it ourselves
20:26:00shashlickBut I don't have visual studio nor the motivation to install it
20:40:24AraqZevv: you can use different names for different fields or pull the field out of the 'case' section
20:52:15Zevvok
21:11:12Araqand I'm trying to do some kind of statistic here so please tell me:
21:12:11Araqdo you need the field to be 'shared' per object instance or is ML-like good enough?
21:12:58Zevvshared would be nice, I have quite a lot on them on a low memory system
21:13:30ZevvI recently had these problems with generic multimethods, so I am now rewriting my system to use object variants
21:13:37Zevvsome of my node types have children, some do not
21:14:15Zevvnow I have a reference on all object types to point to children, even on nodes that never use this field
21:14:51Zevvor some ugly code to use different named fields for different variants which all do the same
21:15:09Araqwell inheritance still works ok, just don't use the 'method' keyword
21:42:03*hoijui quit (Ping timeout: 264 seconds)
21:56:46FromDiscord_<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:14rayman22201You should be able to just define your own $ proc. There is overloading resoloution: https://nim-lang.org/docs/manual.html#overloading-resolution
22:08:52rayman22201you could also exclude the $ proc if you think it's causing an issue : import lists except `$`
22:10:48FromDiscord_<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:32FromDiscord_<DarkArctic> well i guess i could read the resolution and figure it out 😃
22:13:25FromDiscord_<DarkArctic> thanks
22:13:42rayman22201np. Could be a bug in the resolution algorithm. hard to tell without seeing a code sample :-)
22:14:03FromDiscord_<DarkArctic> no worries, i'll fiddle around a bit first
22:14:27rayman22201:thumbsup:
22:23:23*shpx joined #nim
22:35:36*endragor joined #nim
22:35:51Calinoushashlick: https://scoop.sh/ can be used on Windows as an equivalent to Homebrew
22:36:05Calinouyou 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:14Calinouor 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:33FromGitter<zetashift> I use scoop for a few things
22:41:37FromGitter<zetashift> pretty solid
22:56:34shashlickI actually wrote AppSnap several years ago
22:56:59shashlickand even ported it to Nim when I was evaluating Nim a couple years ago
22:58:01shashlickscoop and chocolatey are interesting nonetheless
23:01:55*xace quit (Remote host closed the connection)
23:02:31FromGitter<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:39FromGitter<Varriount> @kayabaNerve 😉
23:51:53*abm quit (Quit: Leaving)
23:52:16*nsf quit (Quit: WeeChat 2.3)
23:52:18*abm joined #nim