00:07:36 | * | jhorwitz_ joined #nim |
00:07:36 | * | jhorwitz_ quit (Client Quit) |
00:12:55 | tsaka__ | no, define:"blas=openblas"' |
00:13:17 | tsaka__ | excluding last ' |
00:13:36 | tsaka__ | how to print the type of something |
00:16:18 | tsaka__ | let e = newTensor[bool]([2, 3]) |
00:16:19 | tsaka__ | echo type e |
00:16:28 | tsaka__ | not working |
00:23:34 | FromGitter | <rayman22201> @treeform have you seen either of these articles? IDK if they are useful. Code formatting is a fun/hard problem :-) ⏎ http://xxyxyz.org/line-breaking/ ⏎ http://journal.stuffwithstuff.com/2015/09/08/the-hardest-program-ive-ever-written/ |
00:23:43 | * | lainon quit (Remote host closed the connection) |
00:43:48 | * | dddddd quit (Remote host closed the connection) |
00:44:52 | FromGitter | <Quelklef> @rayman22201 interesting articles |
00:48:51 | * | cspar quit (Ping timeout: 260 seconds) |
00:53:50 | * | yglukhov[i] joined #nim |
00:58:08 | * | yglukhov[i] quit (Ping timeout: 256 seconds) |
00:59:03 | FromGitter | <rayman22201> Thanks. I like to read and share interesting articles when I'm procrastinating. Sometimes they are appropriate 😄 |
01:01:20 | * | data-man quit (Quit: Konversation terminated!) |
01:17:20 | * | cspar joined #nim |
01:17:23 | FromGitter | <Quelklef> Hello all |
01:17:29 | FromGitter | <Quelklef> Is the following a bug: |
01:18:14 | FromGitter | <Quelklef> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b2c4e550168e70c08e24914] |
01:18:41 | FromGitter | <Quelklef> complains that in `a: A[X]`, "Error: type expected", referring to `X`. |
01:21:48 | * | kinkinkijkin joined #nim |
01:22:18 | FromGitter | <Quelklef> ```proc g[X: static[int]](a: A[X]) = echo "_" ⏎ g[2](a)``` ⏎ ⏎ also has an error [https://gitter.im/nim-lang/Nim?at=5b2c4f490168e70c08e24a15] |
01:24:10 | FromGitter | <Quelklef> Wait, no it doesn't. What's the issue with the first example, though? |
01:29:28 | FromGitter | <Quelklef> wait, something's fucky. possible bug incoming |
01:33:37 | * | yglukhov[i] joined #nim |
01:38:22 | * | yglukhov[i] quit (Ping timeout: 268 seconds) |
01:45:58 | * | kinkinkijkin quit (Quit: Leaving) |
01:51:31 | * | lainon joined #nim |
01:57:35 | * | find0x90 joined #nim |
02:15:22 | * | find0x90 quit (Quit: find0x90) |
02:45:42 | * | NimBot joined #nim |
02:50:51 | * | endragor joined #nim |
03:19:35 | * | kinkinkijkin joined #nim |
03:28:26 | * | rauss quit (Read error: Connection reset by peer) |
03:28:43 | * | rauss joined #nim |
03:38:06 | FromGitter | <codenoid> hi araq |
03:41:54 | * | lainon left #nim ("Leaving") |
04:03:56 | * | kinkinkijkin quit (Remote host closed the connection) |
04:08:55 | * | lompik joined #nim |
04:18:31 | FromGitter | <7sDream> do you mean cut 123456789 to [123, 45, 6789] |
04:18:55 | FromGitter | <7sDream> and result is random, can be [1, 2345, 6789] or other |
04:19:31 | * | Entropic quit (Changing host) |
04:19:31 | * | Entropic joined #nim |
04:19:58 | * | xkapastel quit (Quit: Connection closed for inactivity) |
04:38:50 | * | yglukhov[i] joined #nim |
04:43:33 | * | yglukhov[i] quit (Ping timeout: 264 seconds) |
05:26:53 | * | nsf joined #nim |
05:39:55 | * | Vladar joined #nim |
06:05:27 | bozaloshtsh | tsaka__: echo repr(type(e)) |
06:49:51 | * | Ven`` joined #nim |
07:10:15 | FromGitter | <7sDream> @codenoid https://glot.io/snippets/f27s4vcq6u, may meet your needs |
07:25:54 | * | yglukhov[i] joined #nim |
07:27:55 | * | zahary joined #nim |
07:35:36 | * | Ven`` quit (Read error: Connection reset by peer) |
07:35:42 | * | Ven` joined #nim |
07:41:06 | * | PMunch joined #nim |
07:45:37 | * | Ven` quit (Read error: Connection reset by peer) |
07:45:44 | * | Ven`` joined #nim |
08:01:44 | * | floppydh joined #nim |
08:05:21 | * | natrys joined #nim |
08:12:36 | FromGitter | <mratsim> @tsaka__, import typetraits echo foo.type.name |
08:17:19 | * | Ven` joined #nim |
08:17:19 | * | Ven`` quit (Read error: Connection reset by peer) |
08:39:33 | * | Zevv joined #nim |
08:47:13 | * | dddddd joined #nim |
08:52:24 | * | Ven` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
08:54:56 | FromGitter | <mratsim> I really think name should be in system |
08:56:20 | * | yglukhov[i] quit (Remote host closed the connection) |
09:03:38 | * | Ven`` joined #nim |
09:05:05 | Araq | yeah yeah yeah, told dom I'll accept this PR |
09:17:45 | * | arecaceae quit (Remote host closed the connection) |
09:18:10 | * | arecaceae joined #nim |
09:21:07 | * | yglukhov[i] joined #nim |
10:05:35 | dom96 | Last chance to give feedback: https://forum.nim-lang.org/t/3930 |
10:10:09 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
10:19:11 | FromGitter | <alehander42> the ready made answers is a good idea |
10:23:21 | dom96 | We do have ready made answers already though, not sure what this person means |
10:32:04 | * | noonien joined #nim |
10:36:23 | * | zahary quit (Quit: Leaving.) |
10:43:33 | FromGitter | <mratsim> I don’t agree with ready-made answers for opinion-based questions |
10:48:52 | * | zahary joined #nim |
10:52:48 | euantor | Also Nim version 0.18.0 is missing from the question about which Nim version you use |
11:10:30 | * | elrood joined #nim |
11:12:06 | dom96 | Well, yes, I just made a copy of the last year's survey |
11:12:09 | dom96 | I didn't make any changes yet |
11:12:47 | dom96 | yeah, mratsim, they are often leading |
11:12:55 | dom96 | Last year's survey had a mix of both |
11:19:03 | FromGitter | <kaushalmodi> Araq: You mean foo.type.name will work without having to import typetraits? Awesome! |
11:19:19 | FromGitter | <mratsim> or maybe even echo foo.type ;) |
11:20:40 | FromGitter | <kaushalmodi> 👍 |
11:21:21 | FromGitter | <kaushalmodi> Araq: Talking about foo.type.name, can you please look at this: https://github.com/nim-lang/Nim/issues/7975 |
11:21:46 | FromGitter | <kaushalmodi> foo.type.name doesn't work if foo is a type with a field called "name" |
11:22:03 | FromGitter | <kaushalmodi> *foo is a tuple |
11:22:11 | FromGitter | <kaushalmodi> Yes, that works |
11:22:16 | FromGitter | <kaushalmodi> I have that in that issue |
11:22:37 | FromGitter | <mratsim> well, that’s true for method call syntax with any proc / feld collision unfortunately |
11:22:45 | FromGitter | <mratsim> field* |
11:23:01 | FromGitter | <mratsim> the compiler should put a warning though |
11:23:12 | FromGitter | <codenoid> thankyou |
11:23:17 | FromGitter | <codenoid> @7sDream |
11:23:53 | FromGitter | <kaushalmodi> Another strange typetraits issue: https://github.com/nim-lang/Nim/issues/7976 |
11:24:49 | FromGitter | <kaushalmodi> Btw it was great to finally get the Nim/Emacs Module integration working yesterday! |
11:25:10 | FromGitter | <mratsim> btw, I only use typetraits for debugging, what do you use it for? |
11:25:31 | FromGitter | <kaushalmodi> Debugging and writing notes |
11:25:50 | FromGitter | <kaushalmodi> It's in the process of notes writing that I end up with such issues |
11:26:03 | FromGitter | <mratsim> ah I see |
11:28:20 | FromGitter | <kaushalmodi> @mratsim see this for example: https://scripter.co/notes/nim/#issue-7976 |
11:29:53 | FromGitter | <kaushalmodi> Those are very trivial examples that I took from Nim Tutorial 1 and I'm just echoing them. |
11:31:16 | FromGitter | <mratsim> yeah, awesome notes :) |
11:36:51 | * | craigger_ joined #nim |
11:37:17 | * | Zevv left #nim (#nim) |
11:37:35 | * | craigger quit (Ping timeout: 256 seconds) |
11:38:09 | * | Maui joined #nim |
11:39:59 | * | Ven`` joined #nim |
11:41:17 | * | Maui quit (Client Quit) |
11:48:00 | * | Ven`` quit (Read error: Connection reset by peer) |
11:48:34 | * | Ven`` joined #nim |
12:09:33 | * | Zevv joined #nim |
12:11:57 | Zevv | Hi; it seems that using 'import' implicitly defines a variable with the name of the module; what is the reason for this, and is there a way to avoid this? |
12:19:45 | FromGitter | <mratsim> it’s for namespacing, if you want to call foo.`$` vs system.`$` for example |
12:20:43 | Zevv | ah of course |
12:20:44 | FromGitter | <mratsim> don’t name things with the same name |
12:21:02 | Zevv | I've never seemed to need that until now |
12:21:48 | Zevv | The problem is that I have no control over this name - importing a module defines a global variable, if I like it or not |
12:22:00 | Zevv | but that's fine, thanks |
12:22:01 | Yardanico | Zevv, well, you can import a module under a different name |
12:22:10 | Yardanico | "import tables as tbls" |
12:22:40 | Yardanico | hmm, but that's strange |
12:22:44 | Zevv | ah look, that's what I was looking for |
12:23:05 | Yardanico | ah, so you can define the proc with the name of a module you've imported |
12:23:10 | Yardanico | but not a variable |
12:23:51 | Zevv | yeah, I ran into that |
12:23:53 | Zevv | that confused me |
12:24:34 | Zevv | is the 'import ... as ...' in the manual? |
12:24:49 | Yardanico | ofc |
12:24:59 | Yardanico | https://nim-lang.org/docs/manual.html#modules-module-names-in-imports |
12:26:37 | FromGitter | <mratsim> if you define a proc with the same name, you will get weird errors |
12:26:51 | FromGitter | <mratsim> “Something cannot be called” iirc |
12:29:28 | Yardanico | it works for me |
12:32:08 | * | Ven` joined #nim |
12:34:32 | * | Ven`` quit (Ping timeout: 276 seconds) |
13:05:33 | * | floppydh quit (Remote host closed the connection) |
13:06:21 | * | floppydh joined #nim |
13:10:59 | * | natrys quit (Quit: natrys) |
13:18:11 | * | endragor quit (Remote host closed the connection) |
13:18:32 | * | vegax87 quit (Ping timeout: 245 seconds) |
13:19:50 | * | pigmej quit (Ping timeout: 245 seconds) |
13:20:21 | Araq | kaushalmodi, I'm aware of this issue and I'm sure it's easy to fix but can't fix it right now |
13:30:47 | * | pigmej joined #nim |
13:35:30 | * | pigmej quit (Ping timeout: 260 seconds) |
13:36:57 | * | Ven` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:37:43 | * | pigmej joined #nim |
13:58:21 | * | natrys joined #nim |
14:01:50 | * | vegax87 joined #nim |
14:20:11 | * | Ven`` joined #nim |
14:22:47 | * | vegax87 quit (Ping timeout: 255 seconds) |
14:35:26 | tsaka__ | I'm getting type errors on array assignments, can anyone point me in the right direction? |
14:35:27 | tsaka__ | https://paste.fedoraproject.org/paste/wGWmC2asrHHrYvu9HNhIrg |
14:37:11 | Yardanico | cc @mratsim |
14:37:49 | FromGitter | <mratsim> looking |
14:37:58 | * | zahary quit (Quit: Leaving.) |
14:38:06 | * | PMunch quit (Quit: Leaving) |
14:39:01 | tsaka__ | I had to use var instead of let when declaring the array. How to combine the two array assignments, something along the lines of "neighs1[r1, c1, 0] = [r1, c1]" ? |
14:39:42 | FromGitter | <mratsim> you should directly use result instead of neighs1 by the way |
14:40:19 | FromGitter | <mratsim> neighs1\[r1, c1, 0, 0..1\] = [r1, c1] |
14:41:32 | tsaka__ | If using result instead of neighs1, how to declase array dims? can't use "var result = newTensor .." |
14:42:10 | FromGitter | <mratsim> you can use result = newTensor |
14:42:31 | FromGitter | <mratsim> don’t use var before result otherwise you will create a a shadow variable |
14:42:51 | FromGitter | <mratsim> the syntax supported is this for slicing: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/accessors_macros_syntax.nim#L30-L56 |
14:43:21 | * | vegax87 joined #nim |
14:46:28 | tsaka__ | @mratsim you sure about that assignment? https://paste.fedoraproject.org/paste/SjIxWg9qRq5fCTJEeh~O1g |
14:46:43 | FromGitter | <mratsim> it seems like the proper way at the moment is this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b2d0bd30168e70c08e40b59] |
14:47:24 | FromGitter | <mratsim> there is no assignment broadcasting, strange, I’m pretty sure there was. |
14:48:12 | FromGitter | <tsoernes> *shudders* |
14:48:39 | FromGitter | <tsoernes> numpy would be `result[r1, c1, 0] = [r1, c1]` |
14:51:02 | * | yglukhov[i] quit (Ping timeout: 276 seconds) |
14:52:29 | FromGitter | <mratsim> Not too sure about sub slicing. |
14:53:33 | FromGitter | <mratsim> you can already do \[r1, c1, 0, _\] = [r1, c1] or use `…` as ellipsis (though I might change it to triple underscore |
14:54:46 | FromGitter | <tsoernes> ` result[r1, c1, 0, _] = [r1, c1]` ⏎ gives ⏎ `Error: unhandled exception: Your tensors or openarrays do not have the same shape: [1, 1, 1, 2] and [2] [IndexError]` |
14:56:49 | FromGitter | <mratsim> yes, that’s the assignment broadcasting part |
14:59:46 | FromGitter | <ephja> of course blas.dll doesn't load. a lot of dll's can't be loaded for some reason |
15:01:06 | FromGitter | <ephja> defining nimDebugDlOpen gives me no additional information |
15:02:41 | * | themagician quit () |
15:08:34 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:09:09 | FromGitter | <tsoernes> @ephja try to set blas library when you compile eg `--define:blas=openblas` or w/e |
15:11:33 | * | yglukhov[i] joined #nim |
15:12:46 | FromGitter | <tsoernes> @mratsim how to do this assignment: ⏎ `var n_neighs = newTensorint ([4, rows, cols])` ⏎ `n_neighs[_, r1, c1] += 1` |
15:13:03 | FromGitter | <tsoernes> gives type error, tried `+= [1,1,1,1]` but no luck |
15:14:25 | FromGitter | <ephja> I'm not sure where the openblas binaries are supposed to be located on sourceforge |
15:16:37 | FromGitter | <mratsim> @ephja, there are on github |
15:17:39 | FromGitter | <mratsim> apply_inline(n_neighs[_, r1, c1]): x += 1 |
15:18:08 | FromGitter | <mratsim> @tsoernes ^ |
15:20:35 | FromGitter | <tsoernes> @mratsim not quite. ⏎ `gridfuncs.nim(28, 19) Error: type mismatch: got <AnyTensor[system.int], void> ⏎ but expected one of: ⏎ template apply_inline(t: var Tensor; op: untyped): untyped ⏎ for a 'var' type a variable needs to be passed, but 'slicer(n_neighs, [Span, r1 .. r1 | 1, c1 .. c1 | 1])' is immutable` [https://gitter.im/nim-lang/Nim?at=5b2d13c3467bd7268c2a8489] |
15:24:37 | FromGitter | <ephja> @mratsim that takes me to the same zip file. what binary format exactly? |
15:24:56 | FromGitter | <ephja> All I can seem to find is sources |
15:28:07 | * | Trustable joined #nim |
15:31:27 | FromGitter | <mratsim> ah, mmm I don’t know about the binaries, I use the one packaged in homebrew on Mac, in the repo for linux, and in NuGet for Windows |
15:33:10 | FromGitter | <kayabaNerve> What do y'all think about how friendly Rust's compiler is? |
15:33:29 | FromGitter | <mratsim> @tsoernes, I have to revamp the apply/map/for loop, the most efficient at the moment would be this ⏎ ⏎ ```var n_neighs = newTensor[int]([4, rows, cols]) ⏎ n_neighs[_, r1, c1] .+= 1``` [https://gitter.im/nim-lang/Nim?at=5b2d16c9479ca26689760002] |
15:34:00 | FromGitter | <mratsim> broadcasted operations are prefixed with a dot |
15:34:10 | FromGitter | <mratsim> sorry forgot about it |
15:34:51 | FromGitter | <ephja> Oh I thought I was just being dumb. I've installed it with nuget |
15:35:28 | FromGitter | <mratsim> @kayabaNerve I think it’s too friendly with the remainders ;), but I blame Rust paradigm, not the emulator. |
15:35:54 | FromGitter | <kayabaNerve> That's probably my most wanted feature of Nim right now. Better error messages. I feel that even g++ is friendlier. That might be my higher experience with C++/C though. |
15:36:11 | FromGitter | <kayabaNerve> I admire it's high friendliness but wouldn't use it just for that. |
15:36:26 | FromGitter | <tsoernes> @mratsim That still yields a type error for me |
15:36:42 | FromGitter | <kayabaNerve> I'm just saying if Nim is a 10, g++ is a 5, and Brainfuck was a 1, Nim is a 3. |
15:36:51 | FromGitter | <kayabaNerve> Especially with all the templated types. |
15:37:16 | FromGitter | <kayabaNerve> *Brainfuck is 1 because it doesn't have compiler errors. At all. |
15:37:24 | FromGitter | <kayabaNerve> Really should be a -2 lol |
15:37:52 | * | yglukhov[i] quit (Remote host closed the connection) |
15:38:33 | FromGitter | <kayabaNerve> That's kinda nice now that I think of it. You always have a valid program. Gives me a warm feeling to my heart... |
15:38:52 | FromGitter | <tsoernes> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b2d180c8a0a354b38a0394a] |
15:39:18 | FromGitter | <kayabaNerve> For anyone who doesn't follow, BF has 8 valid commands. They're 1 character each. Any character not one of those 8 commands is ignored. Anyways. I do think Nim is subpar with it's error messages and that's my current most wanted feature. |
15:39:31 | FromGitter | <ephja> it works now, but I need to solve the mingw dll loading *beep* once and for all some time :p |
15:39:44 | FromGitter | <kayabaNerve> That said, I won't complain too much until I get my own language up with better error messages. |
15:42:04 | FromGitter | <mratsim> @tsoernes , ah yes, slicing doesn’t return a var tensor because as of now var return values are too fragile. You can go around like this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b2d18cc59799e701738a420] |
15:50:39 | * | PMunch joined #nim |
16:09:33 | * | xkapastel joined #nim |
16:17:37 | * | floppydh quit (Quit: WeeChat 2.1) |
16:26:08 | FromGitter | <krux02> did someone mess with repr is Nim? |
16:27:45 | * | Ven`` joined #nim |
16:28:47 | * | Ven`` quit (Client Quit) |
16:29:10 | * | lompik quit (Ping timeout: 260 seconds) |
16:51:05 | * | nsf quit (Quit: WeeChat 2.1) |
16:58:37 | * | cryptocat1094 joined #nim |
16:59:01 | * | yglukhov[i] joined #nim |
17:08:01 | * | data-man joined #nim |
17:09:41 | * | data-man quit (Client Quit) |
17:09:50 | shashlick | need some help with imports - do all module imports happen prior to any code execution? like if you do `echo "hello"` and then `import package`, does the import happen before in the generated C code? |
17:13:34 | * | Vladar quit (Quit: Leaving) |
17:19:28 | dom96 | import isn't actually a thing that happens as far as I know |
17:19:43 | dom96 | It happens in the compiler |
17:19:57 | dom96 | and the compiler output C code that includes both modules code and their dependencies |
17:35:42 | FromGitter | <kayabaNerve> So then it depends on if you're C compiler requires pre declarations? |
17:35:48 | FromGitter | <kayabaNerve> C++ does; C doesn't. |
17:35:49 | cryptocat1094 | So basically it's done during pre-processing. |
17:36:07 | FromGitter | <kayabaNerve> Well. That might be practice. not an actual standard.... |
17:36:29 | FromGitter | <kayabaNerve> int main(){myFunc()} void myFunc(){} <- That's valid C, but not valid C++ |
17:37:01 | FromGitter | <kayabaNerve> As most of the time Nim compiles with a C compiler, that means it shouldn't matter where you import |
17:39:26 | FromGitter | <kayabaNerve> Nim says undeclared identifier |
17:39:45 | FromGitter | <kayabaNerve> *when I try to call a function from a latter import module |
17:40:06 | FromGitter | <kayabaNerve> So Nim has C++ style checks for this, even if C might not care and allow |
17:42:42 | * | natrys quit (Ping timeout: 245 seconds) |
17:45:28 | shashlick | dom96: reason I ask is that i'm working on nimdeps which allows bundling app dependencies like DLLs into the binary at compile time and then extracts it at run time |
17:45:59 | shashlick | i have the code such that the deps are managed before importing re which dynamically loads pcre32.dll |
17:46:20 | shashlick | but even though that's the code order, they dynamic load happens before my code gets called |
17:47:15 | shashlick | even if I simplified it - extract libsodium before importc of a proc from it also doesn't work |
17:47:31 | shashlick | so i'm wondering if dynlib gets done at the top before any code runs |
17:56:43 | * | natrys joined #nim |
17:56:43 | * | sz0 joined #nim |
17:59:00 | * | rockcavera quit (Remote host closed the connection) |
18:02:34 | * | jjido joined #nim |
18:05:47 | shashlick | from the generated code, it looks the dynlib imports are done much earlier then actual code execution - PreMainInner() / xxxDatInit() |
18:05:49 | * | Bevo quit (Ping timeout: 260 seconds) |
18:06:53 | shashlick | so unless i can get my code to run in the DatInit() phase somehow, this isn't going to work |
18:08:08 | FromGitter | <kayabaNerve> So you're trying to control how a dll is loaded? |
18:08:16 | FromGitter | <kayabaNerve> Could you use emit and do it in C? |
18:08:36 | FromGitter | <ephja> I created a naive patch for using a compile time variable at runtime, but it needs to be improved |
18:08:44 | FromGitter | <ephja> what is your end goal? |
18:09:18 | * | fvs left #nim ("ERC (IRC client for Emacs 25.3.1)") |
18:09:29 | shashlick | so an example - I am bundling libsodium.dll into the app executable at compile time and have code to extract it out at runtime |
18:10:23 | shashlick | and I also importc some procs from libsodium |
18:10:39 | shashlick | but the loadLibrary() happens before my code has a chance to extract the dll |
18:11:20 | shashlick | even though in the nim code, I have it in the right order, the compiler runs the loadLibrary steps before my code runs since that's treated as module data which should be initialized before any code runs |
18:11:56 | shashlick | if i could run the extraction as part of my module's DatInit() step somehow, i could pull it off |
18:17:16 | shashlick | araq ^^ if you have any tips on how to do this |
18:19:02 | * | xkapastel quit (Quit: Connection closed for inactivity) |
18:19:38 | shashlick | https://github.com/genotrance/nimdeps <= initial version |
18:19:52 | shashlick | works fine with any type of files except DLLs at this point |
18:20:16 | shashlick | ephja - I am using compile time variables in nimdeps, do let me know your feedback |
18:22:24 | FromGitter | <ephja> using those variables at runtime too is a problem right now. sometimes that can be solved by writing to a file at compile time and then reading it at runtime |
18:23:23 | shashlick | ephja: I got it to work in nimdeps for any files except DLLs |
18:23:41 | shashlick | i save the file contents as a const during compile time and extract it out at runtime if file doesn't exists already |
18:25:43 | shashlick | been working on this for over a year in increments |
18:59:41 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:10:58 | * | yglukhov[i] quit (Remote host closed the connection) |
19:12:40 | * | jjido joined #nim |
19:14:07 | * | rockcavera joined #nim |
19:15:28 | Araq | shashlick: what do you need? |
19:21:45 | * | zahary joined #nim |
19:21:52 | * | xkapastel joined #nim |
19:38:51 | * | yglukhov[i] joined #nim |
19:39:13 | * | yglukhov[i] quit (Remote host closed the connection) |
19:39:25 | * | yglukhov[i] joined #nim |
19:39:34 | * | jjido quit (Ping timeout: 256 seconds) |
19:43:11 | shashlick | whoops |
19:43:41 | shashlick | so I want to run some code during the DatInit() phase so that I can extract a DLL before it gets loadLibrary()'d |
19:44:15 | shashlick | that's specific, I want to be able to run some code before a module attempts to loadLibrary() a DLL |
19:44:43 | shashlick | I understand the loadLibrary() calls are all performed in the DatInit() phase during PreMainInner() |
19:48:58 | shashlick | here's a simple snippet: http://ix.io/1eoJ <= during compile time, nimdeps:setupDepFile() bundles pcre32.dll into the generated executable |
19:49:03 | shashlick | nimdeps.nim = https://github.com/genotrance/nimdeps/blob/master/nimdeps.nim |
19:49:41 | shashlick | at runtime, it needs to write out pcre32.dll before nre loadLibrary() call |
19:51:43 | shashlick | but the way Nim generates the C, the loadLibrary happens before the call to writeDepFile() since DLL loads happen during DatInit() |
19:56:31 | * | ipjk joined #nim |
19:57:05 | ipjk | dom96: Are you planning on supporting something similar to cargo, like build --release/debug? |
19:57:16 | ipjk | dom96: in nimble, that is. |
19:57:57 | * | cryptocat1094 quit (Quit: WeeChat 1.6) |
20:00:35 | dom96 | sure, we can support that |
20:00:47 | dom96 | as a workaround you can use `nimble c -d:release <file.nim>` btw |
20:00:51 | FromGitter | <tim-st> is there any nim k:v db store that supports custom cmp functions without investing more than 5 hours wrapping? |
20:01:10 | dom96 | ipjk: feel free to make an issue for this (or better yet, a PR :)) |
20:07:08 | Araq | tim-st: redis? not sure |
20:07:29 | * | sz0 quit (Quit: Connection closed for inactivity) |
20:08:04 | shashlick | araq: replied to you above, hope there's some way to do the dll extraction before loadLibrary() |
20:08:14 | FromGitter | <tim-st> Araq: hm, could work, thanks, will have a look at it |
20:08:18 | federico3 | tim-st: local or remote? LMDB? |
20:08:46 | Araq | shashlick: yeah, well this is fragile. maybe we should have some nimscript codegen hook for that... |
20:09:15 | Araq | I remember supporting .dynlib: procCallHere() but it's not tested and never worked well |
20:09:18 | Araq | bbl |
20:09:53 | FromGitter | <tim-st> No, redis has no cmp proc implemented. I don't understand why so many rely on ascii comparison... |
20:10:10 | FromGitter | <tim-st> (at least the nim package has not) |
20:11:16 | FromGitter | <tim-st> federico: I would prefer lmdb at first place. I looked at your package but it seems to rely on a c cmp proc. I have a pure nim like: `proc cmp(a, b: string): int` |
20:11:43 | shashlick | araq: okay i've put in a disclaimer that DLLs are not supported yet in nimdeps, I agree it is fragile and I don't want to hack it in. Also, dynlib: xyz won't work since nimdeps cannot require changes in modules that do the dynlib, e.g. stdlib pcre |
20:12:12 | FromGitter | <tim-st> I'm not skilled enough to wrap pure nim with c and at the same time know that no memory leaks appear |
20:13:10 | federico3 | tim-st: perhaps there's a way to set a cmp implemented in Nim |
20:13:48 | FromGitter | <tim-st> yes, I thought so, too. but this would take hours for me to find out :\ |
20:16:40 | * | adeohluwa joined #nim |
20:17:29 | * | gb00s quit (Quit: The Lounge - https://thelounge.github.io) |
20:18:44 | FromGitter | <tim-st> btw @federico3 it would be easier if your lmdb package would compile the c code instead of wrapping the dll like here: https://github.com/NimCompression/nimsnappyc/blob/master/nimsnappyc/snappyc.nim |
20:18:51 | federico3 | do you specifically need a custom cmp? |
20:18:52 | adeohluwa | I wonder what Machine Learning looks like in Nim right now |
20:19:20 | FromGitter | <tim-st> yes, I implemented the fastest unicode collation algorithm that exists and I need it for German |
20:19:58 | Yardanico | adeohluwa, check arraymancer :) |
20:21:28 | adeohluwa | Yardanico bless you man! |
20:22:07 | federico3 | tim-st: oh interesting |
20:22:07 | ipjk | dom96: I can try, otherwise I make an issue. |
20:22:13 | shashlick | @ephja: https://github.com/nim-lang/packages/pull/733 |
20:25:57 | FromGitter | <kaushalmodi> I have an extra module for a pkg foo which I have in the foo/ dir. But if I try to do `export foo/extra`, I get the error "cannot export foo / bar" |
20:26:12 | FromGitter | <kaushalmodi> I meant "cannot export foo / extra" |
20:26:34 | FromGitter | <kaushalmodi> If I move extra.nim in the same dir as foo.nim, and do "export extra", that works |
20:26:46 | FromGitter | <kaushalmodi> But then nimble install will complain |
20:29:14 | FromGitter | <kaushalmodi> Taking this as example: https://github.com/nim-lang/nimble#private-modules, `export foobar/utils` will not work. |
20:30:03 | FromGitter | <kaushalmodi> .. neither does `export "foobar/utils"` |
20:30:30 | Araq | paths are for imports, export just takes the module name |
20:32:37 | * | rauss quit (Read error: Connection reset by peer) |
20:32:59 | Araq | good night |
20:33:12 | FromGitter | <kaushalmodi> thanks, I'll try that. Good night |
20:34:12 | FromGitter | <kaushalmodi> thanks, that worked: ⏎ ⏎ ```import foobar/helpers ⏎ export helpers``` [https://gitter.im/nim-lang/Nim?at=5b2d5d440168e70c08e4e9a1] |
20:34:55 | * | rauss joined #nim |
20:38:16 | * | rauss quit (Read error: Connection reset by peer) |
20:39:56 | * | rauss joined #nim |
20:51:36 | * | noonien quit (Quit: Connection closed for inactivity) |
20:59:55 | * | thomasross quit (Quit: Leaving) |
21:02:10 | * | cspar quit (Ping timeout: 260 seconds) |
21:04:37 | bozaloshtsh | is the only way to get code coverage numbers to use the coverage package and modify literally all of my proc definitions? |
21:05:16 | Yardanico | you can use "push" to apply a pragma to all procs in the module |
21:05:35 | bozaloshtsh | I'll try that, thanks |
21:06:52 | bozaloshtsh | is push's effect local to the current module or does it affect imported modules? |
21:10:03 | dom96 | I believe it's the former |
21:11:59 | FromGitter | <rayman22201> Trying to build the website locally and some example asserts are failing. Is this a known issue? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b2d661e479ca2668976d14f] |
21:13:27 | * | rockcavera quit (Remote host closed the connection) |
21:13:32 | dom96 | Yes, it's known |
21:13:39 | dom96 | There is an issue in the Nim repo about it somewhere |
21:13:41 | FromGitter | <kaushalmodi> @rayman22201 That's a known bug, see the workaround here: https://github.com/nim-lang/Nim/issues/8032#issuecomment-397086115 |
21:14:22 | FromGitter | <kaushalmodi> .. or you need to move to the east of Greenwich to bypass that bug :P |
21:19:28 | FromGitter | <rayman22201> lol. a good excuse for a vacation. Thanks guys |
21:19:59 | * | tsaka__ left #nim ("Konversation terminated!") |
21:25:34 | FromGitter | <kaushalmodi> How can I parse the doc-string to a template in that template? Or can I? |
21:25:51 | FromGitter | <kaushalmodi> This is the template: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b2d695f7d3bca737a0238f1] |
21:26:10 | FromGitter | <kaushalmodi> and here is an example use of that: ⏎ ⏎ ```emacs.defun(return_t, 1): ⏎ ## Returns ``t``, always. ⏎ env.intern(env, "t")``` [https://gitter.im/nim-lang/Nim?at=5b2d6972479ca2668976d975] |
21:27:32 | FromGitter | <kaushalmodi> I'd like to capture "Returns ``t``, always." and save it to a var inside that `template defun`. I plan to pass that as a new argument to that `pushFunction` proc. |
21:28:03 | FromGitter | <ephja> shashlick: thanks for reminding me |
21:28:11 | FromGitter | <ephja> apathetic coder at your service |
21:30:28 | shashlick | 👍 |
21:42:13 | * | nsf joined #nim |
21:47:19 | * | Trustable quit (Remote host closed the connection) |
21:51:28 | * | cspar joined #nim |
21:56:13 | * | natrys quit (Quit: natrys) |
21:57:11 | FromGitter | <ephja> done. man, that was intense |
22:00:03 | * | elrood quit (Quit: Leaving) |
22:02:47 | * | xet7 joined #nim |
22:21:57 | * | cspar quit (Ping timeout: 240 seconds) |
22:36:11 | * | adeohluwa quit (Quit: Connection closed for inactivity) |
22:40:46 | * | cspar joined #nim |
23:00:15 | * | find0x90 joined #nim |
23:03:27 | * | find0x90 quit (Client Quit) |
23:21:07 | * | nsf quit (Quit: WeeChat 2.1) |
23:24:00 | * | yglukhov[i] quit (Remote host closed the connection) |
23:36:16 | * | xet7 quit (Quit: Leaving) |
23:36:33 | * | yglukhov[i] joined #nim |
23:40:57 | * | yglukhov[i] quit (Ping timeout: 240 seconds) |