00:03:51 | * | ng0 joined #nim |
00:12:02 | * | aguspiza quit (Ping timeout: 246 seconds) |
00:30:55 | * | smitop joined #nim |
01:02:38 | * | skellock quit (Quit: WeeChat 2.3) |
01:04:18 | Tyresc | Hey, is there a predefined way to get the binary values of the contents of a string? |
01:04:35 | * | skellock1 joined #nim |
01:04:42 | FromGitter | <timotheecour> cast |
01:05:38 | Tyresc | so "cast[binary](string)"? |
01:06:13 | FromGitter | <timotheecour> not clear what u mean by binary, but u can cast mastering[0].addr to whatever u like |
01:06:27 | Tyresc | FYI I need to send that value to a socket |
01:06:35 | FromGitter | <timotheecour> `castptr Foo (mystring[0].addr)` |
01:07:21 | FromGitter | <timotheecour> `mystring.cstring` is smthg u can try; it depends what ur socket takes as argument |
01:07:56 | Tyresc | I'll try it |
01:08:38 | Tyresc | it says in the docs that it wants the commands in binary format aside from a magic string at the beginning |
01:17:54 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
01:29:15 | Tyresc | hm, no that didn't seem to do the trick |
01:31:24 | * | skellock1 quit (Ping timeout: 268 seconds) |
01:39:38 | * | pagnol quit (Ping timeout: 245 seconds) |
01:41:02 | * | pagnol joined #nim |
01:42:27 | * | skellock joined #nim |
01:59:33 | * | skellock1 joined #nim |
02:00:02 | * | Snircle joined #nim |
02:05:58 | * | rockcavera joined #nim |
02:06:18 | * | pagnol quit (Ping timeout: 245 seconds) |
02:25:39 | * | Tyresc quit (Quit: WeeChat 2.4-dev) |
02:43:38 | * | skellock quit (Quit: WeeChat 2.3) |
02:51:01 | * | xet7 quit (Remote host closed the connection) |
03:02:21 | * | banc quit (Quit: Bye) |
03:14:00 | * | skellock1 quit (Ping timeout: 272 seconds) |
03:24:04 | * | banc joined #nim |
03:26:41 | FromGitter | <kaushalmodi> how do I get the directory of the file where a certain command is actually typed? |
03:27:34 | FromGitter | <kaushalmodi> i.e. I can have `os.getCurrentDir()` in a foo.nim. But that proc returns the dir where that module is actually imported |
03:29:41 | leorize | what are you trying to do? |
03:30:18 | FromGitter | <kaushalmodi> I have this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c4e774a8aa5ca5abf4227d8] |
03:30:41 | FromGitter | <kaushalmodi> But that "." gives me the dir where I import that nim file |
03:30:57 | FromGitter | <kaushalmodi> I need the "." to always return the dir containing that nim file |
03:31:35 | FromGitter | <kaushalmodi> basically that nim file and eggx.h files are always in the same dir |
03:33:39 | leorize | there's $projpath |
03:33:41 | leorize | see https://github.com/genotrance/nimterop/blob/master/tests/tnimterop_c.nim |
03:34:14 | FromGitter | <kaushalmodi> hmm .. wondering what that perl-style $projpath |
03:34:15 | FromGitter | <kaushalmodi> is |
03:34:58 | FromGitter | <kaushalmodi> found it: https://github.com/genotrance/nimterop/blob/2cec3015edb78bbaf96bf8304ef7e4697ddb1a37/nimterop/cimport.nim#L12 |
03:36:27 | FromGitter | <timotheecour> > how do I get the directory of the file where a certain command is actually typed? ⏎ ⏎ that’s vague |
03:36:49 | FromGitter | <timotheecour> u have currentSourcePath.parentDir which returns /pathto/foo.nim inside foo.nim |
03:37:33 | FromGitter | <timotheecour> and u have `getProjectPath` that retuns /pathto/main.nim even inside foo.nim if main.nim imports foo.nim and u call nim c main.nm |
03:37:54 | FromGitter | <timotheecour> 1) that retuns `/pathto/` |
03:38:11 | FromGitter | <kaushalmodi> @timotheecour yeah, I couldn't find better way to express the path I needed |
03:38:30 | FromGitter | <kaushalmodi> as leorize pointed out, `getProjectPath` would probably work |
03:38:39 | FromGitter | <kaushalmodi> *but it's still not .. so trying to figure out* |
03:39:15 | FromGitter | <timotheecour> so again, what r u trying to have? |
03:40:52 | FromGitter | <kaushalmodi> if `/a/foo.nim` imports `/a/b/bar.nim`, I need `bar.nim` to called `cInclude("/a/b")` |
03:41:11 | FromGitter | <kaushalmodi> and that `"/a/b"` of course should not be hard coded |
03:42:15 | FromGitter | <timotheecour> ```# in bar.nim ⏎ const dir = currentSourcePath.parentDir``` [https://gitter.im/nim-lang/Nim?at=5c4e7a1754f21a71a1b8ede5] |
03:42:36 | FromGitter | <timotheecour> that’ll be `/a/b` |
03:42:43 | FromGitter | <kaushalmodi> hmm, `$projpath` also does not work .. that evals to the `/a` dir too |
03:42:48 | FromGitter | <kaushalmodi> now trying out the const method |
03:42:59 | FromGitter | <timotheecour> (w `import os`) |
03:44:04 | FromGitter | <timotheecour> btw @kaushalmodi r u using nimterop? if u wanna contribute happy to chat (w genotrance), lots of cool stuff to do! |
03:46:11 | FromGitter | <kaushalmodi> @timotheecour thanks! that const trick worked! |
03:46:25 | FromGitter | <timotheecour> :) |
03:46:50 | FromGitter | <kaushalmodi> though .. I need to understand why that worked |
03:47:11 | FromGitter | <timotheecour> it’s like *FILE* in C no magic |
03:47:36 | FromGitter | <kaushalmodi> I don't know C, but I can associate that with something else |
03:48:01 | FromGitter | <kaushalmodi> was trying to understand the doc string of `getProjectPath()`: https://nim-lang.github.io/Nim/macros.html#getProjectPath |
03:49:09 | FromGitter | <kaushalmodi> getProjectPath returns the same value as getCurrentDir |
03:49:25 | FromGitter | <kaushalmodi> based on that dummy example above, it always returns `/a` |
03:49:32 | FromGitter | <timotheecour> if u got confused, maybe send a PR to add an example with a /a/main.nim that calls `import b/foo` in `/a/b/foo.nim` |
03:50:09 | FromGitter | <timotheecour> > getProjectPath returns the same value as getCurrentDir ⏎ ⏎ no |
03:50:33 | FromGitter | <kaushalmodi> ok, here's a real example |
03:50:34 | FromGitter | <timotheecour> ok then definitely consider sending a PR to help the next guy, since u got confused :) |
03:50:49 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c4e7c187b68f941022cf8cc] |
03:51:09 | FromGitter | <kaushalmodi> ```draw/draw.nim ⏎ import EGGX/eggx ⏎ ``` [https://gitter.im/nim-lang/Nim?at=5c4e7c2dceb5a2264f50e6b7] |
03:51:34 | * | skellock1 joined #nim |
03:52:10 | FromGitter | <kaushalmodi> the `cDebug()` from nimterop prints: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c4e7c6a9221b9382dd26e1c] |
03:52:27 | FromGitter | <kaushalmodi> and I got that same value when I tried `getCurrentDir()` |
03:53:51 | FromGitter | <timotheecour> `getCurrentDir` is just current dir (more or less `$PWD`); `getProjectPath` is just parentDir(abspath(foo)) where `foo` is the module in cmd line `nim c foo` |
03:55:20 | FromGitter | <kaushalmodi> hmm, thanks, so as I was doing `nim c draw.nim` while in the `draw/` dir, they ended up being the same |
03:55:27 | FromGitter | <kaushalmodi> *need to note this down* |
03:55:37 | FromGitter | <timotheecour> (Or, PR :) ) |
03:55:45 | FromGitter | <kaushalmodi> PR where? |
03:56:09 | FromGitter | <timotheecour> under `getProjectPath` in macros.nim |
03:56:33 | FromGitter | <kaushalmodi> I need to find a concise way to articulate this |
03:56:47 | FromGitter | <kaushalmodi> I was unable to explain myself without that dummy /a/b example |
03:57:09 | FromGitter | <timotheecour> best is 1 example where currentdir, getProjectPath and currentSourcePath are all different. then it’s crystal clear. |
03:57:31 | FromGitter | <timotheecour> (WITH the dummy example is best) |
03:58:03 | FromGitter | <kaushalmodi> ok, will work on it |
03:58:35 | FromGitter | <timotheecour> (or u can help w nimterop :) ) |
03:59:00 | * | nsf joined #nim |
04:00:19 | shashlick | sorry missed the conversation |
04:01:35 | shashlick | so you are having trouble pointing to the source? |
04:05:48 | FromGitter | <kaushalmodi> shashlick: @timotheecour helped me sort it out |
04:05:53 | FromGitter | <kaushalmodi> solution: https://ptpb.pw/WRzv/nim |
04:06:24 | FromGitter | <kaushalmodi> the problem was that I needed that include/search path to stay static to the dir containing that nim file regardless of from where I imported it |
04:06:48 | shashlick | i don't know why you need that cause my tsoloud.nim works fine with relative paths |
04:07:15 | shashlick | okay i see - if you import the nim wrapper, it stops working cause you are now elsewhere |
04:07:24 | FromGitter | <kaushalmodi> that eggx.h has include with `<foo.h>` |
04:07:41 | FromGitter | <kaushalmodi> so I need to add the same path to `cInclude` too |
04:08:38 | FromGitter | <timotheecour> that PR im working on is relevant for this: https://github.com/genotrance/nimterop/pull/70/files#diff-f10b365dce6d4c3a1d4093c8d9e77c65 |
04:08:50 | FromGitter | <timotheecour> i’m now using abs paths and makes code simpler |
04:09:16 | * | darithorn joined #nim |
04:09:51 | shashlick | @kaushalmodi - i used sourcepath in the tree-sitter wrapper too - https://github.com/genotrance/nimterop/blob/master/nimterop/treesitter/runtime.nim |
04:11:01 | FromGitter | <kaushalmodi> shashlick: It's just that I discovered currentSourcePath() today :) |
04:11:45 | shashlick | ya that was a big one even in nimgen days |
04:12:22 | shashlick | feel free to join https://gitter.im/nimgen/Lobby to chat about nimterop |
04:13:29 | FromGitter | <kaushalmodi> will do, thanks |
04:14:46 | FromGitter | <kaushalmodi> btw can someone point out why that second import line doesn't work? https://ptpb.pw/ObL6/nim |
04:15:04 | FromGitter | <kaushalmodi> > b/bar.nim(2, 31) Error: undeclared identifier: 'currentSourcePath' |
04:16:05 | FromGitter | <timotheecour> because of this: ⏎ [0 ] lib/system.nim:3978:10 |template currentSourcePath*: string = instantiationInfo(-1, true).filename |
04:16:12 | FromGitter | <timotheecour> it’s defined in system.nim :) |
04:16:53 | * | skellock1 quit (Ping timeout: 244 seconds) |
04:17:30 | FromGitter | <kaushalmodi> sorry, I need to sleep it seems |
04:17:44 | * | smitop quit (Quit: Connection closed for inactivity) |
04:17:51 | FromGitter | <kaushalmodi> I visited the manual like 5 times, but didn't spot that I was opening system.html |
04:18:10 | FromGitter | <kaushalmodi> and thank you |
04:18:15 | FromGitter | <timotheecour> np |
04:18:17 | shashlick | how's the actual nim render |
04:18:31 | shashlick | with nimterop? is the wrapper working? |
04:19:09 | FromGitter | <kaushalmodi> @timotheecour a minimal example showing the path differences: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c4e82bd54f21a71a1b91eeb] |
04:19:43 | FromGitter | <kaushalmodi> shashlick: if that question was for me, I just got that wrapper to compile |
04:19:56 | FromGitter | <kaushalmodi> now working on translating some C code to Nim in that wrapper |
04:20:28 | FromGitter | <timotheecour> @kaushalmodi please report all issues u encounter in the bug tracker (after checking they’re not dups :) |
04:20:58 | FromGitter | <kaushalmodi> will send a PR for this to an appropriate place in the manual |
04:21:11 | FromGitter | <kaushalmodi> (that "doesn't work" in the comment is old, doesn't apply any more) |
04:21:40 | FromGitter | <timotheecour> ya that example (prettified a bit and with doAssert instead of echo) would be fine in doc (not runnableExamples but as code block) |
04:32:36 | * | dddddd quit (Remote host closed the connection) |
05:13:06 | * | yunfan joined #nim |
05:13:30 | yunfan | hi i was on alpinelinux v3.8.1, and i met a problem while installing nim using choosenim script |
05:14:07 | yunfan | the downloaded file exsts at /tmp directory and i had gave it executing permission, but still gave me file not exist while i execute it by manual |
05:16:32 | leorize | yunfan: maybe you should try building it manually? |
05:17:38 | leorize | oh, and choosenim might have been compiled with glibc, so it wouldn't work on your device |
05:18:23 | yunfan | leorize: got it, alpine were upon on musl |
05:18:46 | leorize | I can compile you an alpine version of choosenim, if you trust binaries from strangers :) |
05:19:08 | leorize | or you could build the compiler yourself, then use it to compile choosenim :P |
05:19:13 | yunfan | leorize: that would saved lots of my time :D |
05:26:48 | leorize | yunfan: http://ix.io/1zod |
05:26:54 | leorize | that's an .xz archive |
05:27:04 | leorize | extract it and you'll get choosenim :) |
05:27:44 | yunfan | thanks |
05:28:59 | leorize | oops, you can't dlopen using a static musl binary |
05:29:09 | leorize | wait, I'll compile a shared one |
05:29:47 | leorize | http://ix.io/1zof |
05:30:04 | leorize | ^ that's the shared version of the binary (xz compressed) |
05:33:32 | yunfan | ok, the latter version works |
05:33:57 | FromGitter | <kaushalmodi> what does this in C `extern void eggx_gsetinitialparsegeometry( const char *, ... ) ;` map to in Nim? |
05:34:09 | FromGitter | <kaushalmodi> not sure how to google "..." syntax for C |
05:34:14 | leorize | that's vararg |
05:34:37 | FromGitter | <kaushalmodi> but the type of vararg is not conveyed in that sig |
05:34:39 | leorize | `proc eggx_...(a: cstring) {.varargs, ....}` |
05:34:45 | FromGitter | <kaushalmodi> oh |
05:36:00 | FromGitter | <kaushalmodi> what should I actually put in place of `....` after the varargs pragma? |
05:36:38 | leorize | it's just a placeholder :P |
05:36:49 | FromGitter | <kaushalmodi> heh, let me try |
05:39:46 | yunfan | also are there any curated list about awesome nim libararies? |
05:40:19 | leorize | https://github.com/VPashkov/awesome-nim |
05:40:22 | leorize | ^ there you go |
05:40:36 | leorize | and also check out nimble.directory |
05:40:39 | yunfan | thanks a lot |
05:41:02 | yunfan | i am very satisfied of the asynced http server :D |
05:42:59 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
05:45:57 | FromGitter | <kaushalmodi> leorize: that worked! thank you |
05:46:05 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c4e971cf04ef006449a582d] |
05:46:31 | leorize | ideally you should stay away from the `{.header.}` pragma :) |
05:46:51 | FromGitter | <kaushalmodi> no, that is just fixing the nimterop generated code |
05:47:07 | FromGitter | <kaushalmodi> I left everything as is except for the varargs bit |
05:47:21 | FromGitter | <kaushalmodi> though .. why shouldn't header pragma be used? |
05:47:28 | FromGitter | <kaushalmodi> what's the alternative? |
05:47:44 | leorize | mainly because it's not compatible with nlvm |
05:48:04 | leorize | there's no alternative :P |
05:48:56 | leorize | well, but if nlvm compatibility is not of your concern then just use that pragma :) |
05:49:43 | FromGitter | <kaushalmodi> yeah .. especially when I don't know what nlvm is :P |
05:50:10 | FromGitter | <kaushalmodi> *just trying to get the SV<>C FFI work* |
05:50:51 | yunfan | leorize: so after choosenim's intallation, where is it installed nim to? |
05:51:16 | leorize | ~/.choosenim I believe |
05:52:06 | yunfan | so it depends on PATH magic? |
05:52:17 | yunfan | i think it might be ash caused the problem |
05:53:57 | leorize | looks like for first install you'd have to run choosenim --firstInstall |
05:54:05 | leorize | according to the install script |
05:54:30 | leorize | then you'd have to add ~/.nimble/bin to your PATH |
05:54:42 | leorize | that's where choosenim saves everything I believe |
05:56:44 | yunfan | yes finally i set that by manual and works |
05:58:40 | FromGitter | <irskep> What type does the curly brace literal for data structures emit? I can't find it in the docs anywhere and I've done some pretty deep googling |
05:58:57 | FromGitter | <irskep> it looks like shorthand for a list of pairs but I'd like some certainty in my life :-) |
05:59:11 | leorize | it's a shorthand for that :) |
05:59:25 | leorize | it's in the manual |
06:00:03 | leorize | http://nim-lang.github.io/Nim/manual.html#statements-and-expressions-table-constructor |
06:00:11 | * | narimiran joined #nim |
06:00:19 | FromGitter | <irskep> found it - and it doesn't actually use the word "brace" or "bracket", which is frustrating and hilarious |
06:01:08 | FromGitter | <irskep> It's also odd because there is a module "tables" which makes hash tables, but this is called the "table constructor" which makes lists |
06:01:40 | narimiran | @irskep if you wanted to use curly brace for tables (dicts), you need to do `{......}.toTable` |
06:01:59 | FromGitter | <irskep> yes, that's where I first ran across the syntax, I just wanted to understand it better |
06:02:00 | Zevv | citicide: happy to merge it into cascade, I will make a PR. I'll have to unpublish the 'with' pkg then. |
06:02:23 | FromGitter | <irskep> one of those cases where some part of the docs mentions something "obvious" in passing that is only explained briefly in one unrelated place |
06:02:36 | narimiran | PRs welcome ;) |
06:03:27 | FromGitter | <irskep> well, now that my specific question is answered, I will do what a normal open source software user does and disappear never to be seen again... |
06:03:44 | FromGitter | <irskep> (I might end up contributing docs at some point...eventually) |
06:04:05 | narimiran | :D |
06:04:54 | narimiran | yeah, please do. we're currently working on improving the docs and any help is welcome: https://github.com/nim-lang/Nim/issues/10330 |
06:05:24 | FromGitter | <irskep> I've done major doc contributions to other projects, it just depends on a lot of random life factors which are not currently aligned |
06:05:48 | FromGitter | <irskep> this channel is great at being a backstop for things that fall through the cracks |
06:08:37 | FromGitter | <timotheecour> i second what @narimiran said, PR’s welcome; lots of newcomers hit a snag, complain, then end up sending a PR; if not controversial it gets merged pretty fast |
06:20:37 | FromDiscord_ | <citycide> Zevv: up to you, I still don't see if `with` serves a different purpose but it sounded the same |
06:22:46 | Zevv | I guess the `with` is a bit more flexible, as it recurses through a whole block. |
06:23:21 | Zevv | I just made a PR, up to you to take it in. I'm happy to merge, but also happy to put it in it's own package - no preference here. |
06:24:26 | * | absolutejam quit (Ping timeout: 240 seconds) |
06:33:10 | FromDiscord_ | <citycide> keep yours for now definitely. hopefully I can review in the next couple days - after that I'm heading out on vacation 😁 |
06:40:57 | * | darithorn quit (Remote host closed the connection) |
06:57:32 | * | absolutejam joined #nim |
07:02:20 | Zevv | ok, thanks and have a nice holiday |
07:12:54 | * | krux02 joined #nim |
07:36:12 | * | absolutejam quit (Ping timeout: 272 seconds) |
08:04:54 | * | skelett quit (Ping timeout: 252 seconds) |
08:14:20 | * | skellock1 joined #nim |
08:19:54 | * | skellock1 quit (Ping timeout: 272 seconds) |
08:21:43 | * | lritter joined #nim |
08:38:47 | * | floppydh joined #nim |
08:58:25 | * | JustASlacker joined #nim |
09:10:22 | * | absolutejam joined #nim |
09:21:09 | floppydh | is there a way yet to do `newSeq[T]()` without having to specify T? |
09:21:25 | floppydh | specifically I'm returning a result of an anonymous tuple-type |
09:21:36 | floppydh | in a proc - and I don't want to repeat the type |
09:23:29 | Araq | newSeq[type(result)]() |
09:25:47 | floppydh | Araq: thanks! |
09:26:12 | floppydh | oh wait, that would make it a seq of a seq :) |
09:26:43 | floppydh | if my proc returns a seq of something, and I do the above, result will be initialized with a seq of a seq of something |
09:27:08 | floppydh | guess this is too much unnecessary magic anyway, just gonna make a type for it |
09:28:27 | Zevv | Q: I'd like to check in a macro if a given ident is included (style insensitive) in a set. Now I need to iterate the list and do a eqIdent for each element; is there a shortcut for a hashed table here? |
09:35:29 | Araq | newSeq[type(result[0])]() |
09:36:13 | Araq | Zevv, in these cases it's fine to assume SI does not exist. :-) |
09:38:12 | Zevv | SI? |
09:43:34 | Zevv | oh style insensitivity |
09:47:24 | FromGitter | <mratsim> @timotheecour FFT convolution is has-been ;) |
09:49:47 | FromGitter | <timotheecour> Cmon; there are some applications where it’s useful no? |
09:49:54 | FromGitter | <timotheecour> (when on CPU) |
09:50:16 | Zevv | convolution is a GPU-only thing these days? |
09:51:06 | FromGitter | <mratsim> see https://github.com/numforge/laser/blob/master/research/convolution_optimisation_resources.md#direct-convolution especially intel paper "Anatomy of High-Performance Deep Learning Convolution" https://arxiv.org/pdf/1808.05567.pdf, this PhD Thesis: https://wiki.rice.edu/confluence/download/attachments/4425835/AnkushMSthesis.pdf, High perf zero overhead convolution: http://proceedi |
09:51:06 | FromGitter | ... ngs.mlr.press/v80/zhang18d/zhang18d.pdf, and intel article: https://itpeernetwork.intel.com/myth-busted-general-purpose-cpus-cant-tackle-deep-neural-network-training/#gs.pUz6VuF6 |
09:51:07 | FromGitter | <timotheecour> well the point is on GPU for small kernel size the naive version will be faster than FFT; but for on CPU, i doubt u can beat FFT for large enough kernel; |
09:52:30 | FromGitter | <mratsim> In short, there are very promising results with direct convolution, by following BLAS principles, without the need of intermediate transformation like im2col, FFT, kn2row or kn2col |
09:53:28 | FromGitter | <mratsim> And actually since to do BLAS like matrix multiplication, you have to repack the matrices with Z-ordering (Morton indexing), you can probably fuse im2col into that step. |
09:53:54 | FromGitter | <mratsim> this is the approach taken by Facebook in FBGEMM: https://github.com/pytorch/FBGEMM |
09:55:12 | FromGitter | <timotheecour> is ur claim the for any kernel and image size, `conv2(A,K)` using fft is slower than direct convolution? |
09:55:59 | FromGitter | <timotheecour> say extreme case: A:nxn, K:nxn (w, say, n=1000) |
09:56:13 | FromGitter | <mratsim> My claim is that on CPU, there is currently no implementation that reaches 90%+ of theoretical GFLOP/s peak |
09:56:36 | FromGitter | <mratsim> also the sizes that matter for Deep Learning kernel are 1x1, 3x3, 5x5, 7x7 and 11x11 |
09:57:44 | FromGitter | <mratsim> in one of the papers, I think the "Memory Efficient Convolution" or kn2row/kn2col there are FFT examples with very wild variations depending on image size and kernel size |
09:58:07 | FromGitter | <mratsim> so that's an issue as well. |
09:58:22 | * | PMunch joined #nim |
09:58:50 | FromGitter | <mratsim> but yeah, I'm interested in benchmarking everything |
09:59:20 | FromGitter | <timotheecour> that’s why i said "for large kernel size”’ ; coz i doubt direct would be fast (n*n vs n*log even for 1D, gets worse in higher dimensions); and conv is not just for deep learning :) |
09:59:52 | FromGitter | <mratsim> yeah of course, but I need some focus :p |
09:59:59 | Zevv | nerds |
10:00:12 | FromGitter | <timotheecour> look who’s callign the kettle black ;-) |
10:00:21 | Zevv | :) |
10:05:44 | FromGitter | <timotheecour> @mratsim btw Halide could be pretty relevant for ur stuff http://halide-lang.org/ ; using cache friendly optimizations for “arbitrary” tensor algorithms |
10:06:08 | FromGitter | <mratsim> I know, I've been benchmarking it, it's pretty solid |
10:06:12 | * | xet7 joined #nim |
10:06:29 | FromGitter | <mratsim> see https://github.com/halide/Halide/issues/3499 (bug in their schedule) |
10:06:32 | FromGitter | <timotheecour> curious how difficicult it would be porting that to nim ; it’s a a weird “embedded in c++” thing |
10:07:16 | FromGitter | <mratsim> I've also been discussion with PyTorch Glow Tensor compiler and the TVM tensor compiler which forked from halide: https://github.com/pytorch/glow/issues/1749 |
10:07:50 | FromGitter | <mratsim> I'm actually considering building something similar, maybe using Dask as an inspiration as well |
10:08:09 | FromGitter | <mratsim> but I prefer eager evaluation instead of having to call "compute" |
10:08:18 | FromGitter | <mratsim> so maybe using term rewriting macro |
10:08:40 | FromGitter | <mratsim> I think the most similar library in Nim would be zero functional |
10:09:01 | FromGitter | <mratsim> the only difference is that I have to split iteration in SIMD size |
10:09:15 | FromGitter | <timotheecour> (or mir in D ?) |
10:09:23 | FromGitter | <mratsim> Mir is not parallel |
10:09:38 | FromGitter | <timotheecour> is zero_functional parallel? |
10:09:42 | FromGitter | <mratsim> and as you can see in the Glow link, multithreading is actually very hard. |
10:09:46 | FromGitter | <mratsim> no |
10:10:23 | FromGitter | <mratsim> In Laser I actually have a parallelism bottleneck, I don't scale as well on many cores machine compared to OpenBLAS |
10:10:58 | FromGitter | <mratsim> I have a new 18 cores machine now instead of my paltry 2 cores laptop so I can actually test and hopefully fix that |
10:10:59 | FromGitter | <timotheecour> maybe this shd belong in arraymancer room? |
10:11:03 | FromGitter | <mratsim> yep |
10:17:43 | * | dom96_w joined #nim |
10:28:26 | PMunch | There is an arraymancer room? |
10:29:00 | FromGitter | <mratsim> yep |
10:29:19 | FromGitter | <mratsim> https://gitter.im/Arraymancer/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge |
10:29:44 | PMunch | Ah, a gitter room.. |
10:30:04 | narimiran | and you thought.... ? :D |
10:30:29 | PMunch | IRC room of course :) Although I guess the usual terminology is channel |
10:31:42 | * | Vladar joined #nim |
10:33:39 | * | Pisuke joined #nim |
10:36:18 | * | MyMind quit (Ping timeout: 245 seconds) |
10:54:00 | * | pagnol joined #nim |
11:03:19 | * | abm joined #nim |
11:05:11 | Zevv | are these public daily scrums still a thing? |
11:05:44 | narimiran | Zevv: nope, but something else is coming soon :) |
11:05:55 | Zevv | "something else" \o/ |
11:07:01 | Araq | Zevv, they are a thing but they are not public anymore :P, instead we try to produce a "this week in Nim" video. |
11:07:12 | Araq | every week. |
11:07:52 | narimiran | spoiler alert! :P |
11:10:00 | oculux | can we have the url for the weekly videos please |
11:10:22 | narimiran | oculux: you can, once they're out ;) we didn't do them yet |
11:10:54 | oculux | i see. hope it all goes well and as you wish |
11:12:13 | * | a_b_m joined #nim |
11:14:42 | * | abm quit (Ping timeout: 272 seconds) |
11:23:24 | * | a_b_m quit (Ping timeout: 268 seconds) |
11:25:37 | * | abm joined #nim |
11:28:22 | * | a_b_m joined #nim |
11:30:26 | * | abm quit (Ping timeout: 240 seconds) |
11:31:59 | * | vlad1777d joined #nim |
11:39:54 | * | skellock1 joined #nim |
11:39:54 | * | skellock1 quit (Client Quit) |
11:53:01 | * | ng0 joined #nim |
12:08:06 | livcd | yglukhov[m]: whoa thanks for opensourcing Reel Valley |
12:08:15 | * | dddddd joined #nim |
12:08:37 | * | livcd quit (Changing host) |
12:08:37 | * | livcd joined #nim |
12:09:36 | PMunch | livcd, wait what? |
12:10:42 | livcd | PMunch: refresh nimforum |
12:11:02 | PMunch | Oh neat! |
12:11:18 | PMunch | forum.nim-lang.org/t/4599 < for future reference |
12:13:26 | livcd | cant wait to build it on my mac at home |
12:13:37 | FromGitter | <mratsim> wooot |
12:15:01 | PMunch | I'm toying around with creating my own game, and I always wondered how Reel Valley was structured |
12:15:45 | PMunch | So this is great :) |
12:16:03 | PMunch | Can't wait to peruse the code when I get home |
12:18:40 | * | pagnol quit (Ping timeout: 272 seconds) |
12:20:10 | JustASlacker | a game in nim? |
12:20:45 | PMunch | Yeah Reel Valley is a game written in Nim |
12:28:55 | livcd | you cant build it on Windows can you ? |
12:31:18 | PMunch | It only gives build instructions for Linux and Mac, so I'm not entirely sure |
12:32:46 | PMunch | It does have a Windows target though: github.com/OnsetGame/falcon/blob/master/nakefile.nim#L195 |
12:32:54 | PMunch | But that might be for cross-compilation |
12:39:30 | floppydh | I guess I can't use `json.to` to convert an arbitrary dictionary into an `OrderedTable` or such of an object? |
12:42:27 | * | fanta7531 joined #nim |
12:45:10 | livcd | i cant build it on windows |
12:45:31 | PMunch | Haha, what's the issue? |
12:47:16 | livcd | https://paste.fedoraproject.org/paste/Qjzi3UckTdZBUYkJlFg07w |
12:51:50 | PMunch | Try adding "args =" before the array |
12:52:28 | FromGitter | <dom96> Wow. Awesome that reel valley was open sourced |
12:52:44 | FromGitter | <dom96> Guessing you fought for this yglukhov? Thank you! |
12:53:33 | PMunch | Uhm, livcd are you using the latest Nim version? That workingPath argument isn't part of the documentation for `execProcess`.. |
12:53:45 | PMunch | Oh yeah, thanks a lot yglukhov! |
13:00:58 | livcd | well not really the latest latest |
13:01:21 | livcd | Nim Compiler Version 0.19.9 ill update today |
13:04:16 | FromGitter | <yglukhov> no problem guys. there might be a few things missing here and there, so file issues if you find anything. and yes, windows is supported as a development platform. and build process might be somewhat involved now that the development infrastructure is changed, and we've stripped out a few tiny proprietary details |
13:07:09 | * | Snircle joined #nim |
13:12:36 | livcd | so who is posting it to HN ? |
13:17:06 | dom96_w | It needs some screenshots to be HN-worthy I think |
13:17:14 | dom96_w | Btw guys, this seems relevant to us https://news.ycombinator.com/item?id=19016869 |
13:18:51 | PMunch | That stuff about trade-offs is definitely true. One reason I like Nim so much is that I feel it makes very reasonable trade-offs |
13:24:47 | * | a_b_m quit (Ping timeout: 240 seconds) |
13:25:17 | dom96_w | hrm, I wonder, does the reel valley repo contain the assets too? |
13:25:28 | dom96_w | if so, are those also MIT licensed? :P |
13:25:47 | PMunch | Yeah I was wondering about that too |
13:26:02 | federico3 | most likely not |
13:32:24 | FromGitter | <mratsim> @yglukhov how did you ensure that ffmpeg GPL didn't spread to the whole game? |
13:38:33 | FromGitter | <yglukhov> @mratsim ffmpeg executable is called in the build script to convert audio files. we don't require it, nor ship it. |
13:38:42 | FromGitter | <mratsim> ah nice |
13:39:21 | FromGitter | <mratsim> this should probably be clarified |
13:39:42 | FromGitter | <mratsim> in the readme* |
13:39:51 | * | stefanos82 joined #nim |
13:40:07 | FromGitter | <Bennyelg> does https://github.com/yglukhov/nimpy should help when implementing functions to improve python slowness ? |
13:41:08 | PMunch | Bennyelg, you mean like this: robert-mcdermott.gitlab.io/posts/speeding-up-python-with-nim/ ? |
13:41:28 | FromGitter | <Bennyelg> what a timing |
13:41:33 | FromGitter | <Bennyelg> thanks @PMunch |
13:41:50 | PMunch | Haha |
13:41:55 | FromGitter | <yglukhov> dom96_w, PMunch, federico3: dunno, what's wrong about MIT assets? |
13:42:09 | FromGitter | <Bennyelg> 20 to January :D |
13:42:11 | PMunch | Nothings wrong about them at all, just not very usual :) |
13:42:27 | PMunch | Bennyelg, yeah you really got lucky there :P |
13:42:41 | dom96_w | It's very rare for assets to be made available for free, with no conditions for their use |
13:42:52 | dom96_w | So they are indeed MIT? |
13:43:04 | dom96_w | Pretty awesome is they are :) |
13:43:09 | * | couven92 joined #nim |
13:43:14 | dom96_w | *if |
13:46:35 | FromGitter | <yglukhov> yeah, i think they are. thing is. those assets are not erm.. "sources".. the "sources" were huge PSDs and afftereffect files, terabytes big. and those are not on github =) |
13:47:17 | FromGitter | <Bennyelg> @PMunch. ⏎ This is how Im going to slowly shifting my company from python based to Nim based. |
13:47:38 | dom96_w | ahh, yeah |
13:47:44 | dom96_w | I thought that :) |
13:47:44 | PMunch | Bennyelg, yeah it's a compelling use-case |
13:48:07 | PMunch | The company I was previously at used Ruby |
13:48:11 | * | PMunch shudders |
13:48:13 | narimiran | @Bennyelg what does your company use python for? |
13:48:36 | FromGitter | <Bennyelg> OptiBus |
13:48:57 | FromGitter | <Bennyelg> ML staff for NP-complete problem |
13:49:02 | FromGitter | <mratsim> I'm sad the speeding up ruby with Nim post disappeared |
13:49:15 | FromGitter | <Bennyelg> traveling sales man |
13:49:31 | PMunch | mratsim, there was one? |
13:49:38 | FromGitter | <mratsim> Isn't operation research and optimal control more suited to this kind of thing? |
13:50:04 | FromGitter | <mratsim> @PMunch yes, and it was better than the Python ones :P |
13:50:39 | * | couven92 quit (Read error: Connection reset by peer) |
13:50:45 | FromGitter | <mratsim> if you can find the cached version: http://www.rubyflow.com/p/1j08ef-nim-for-the-discerning-rubyist |
13:51:48 | Araq | what's the most reliable way to count the cycles an alloc/dealloc pair takes? |
13:51:57 | PMunch | mratsim, like this one? https://web.archive.org/web/20180422091304/http://www.bootstrap.me.uk/bootstrapped-blog/nim-for-the-discerning-rubyist |
13:52:03 | FromGitter | <mratsim> oh here you go: https://web.archive.org/web/20180422091304/http://bootstrap.me.uk/bootstrapped-blog/nim-for-the-discerning-rubyist |
13:52:10 | FromGitter | <mratsim> yes |
13:52:40 | PMunch | Oh wait, the article is still on the site. Just changed his URL format: http://bootstrap.me.uk/programming-languages/2017/07/09/nim-for-the-discerning-rubyist.html |
13:57:03 | * | pagnol joined #nim |
13:57:13 | * | couven92 joined #nim |
13:57:49 | * | couven92 quit (Read error: Connection reset by peer) |
14:01:21 | * | couven92 joined #nim |
14:23:58 | * | zachcarter quit (Ping timeout: 244 seconds) |
14:25:47 | * | vlad1777d quit (Ping timeout: 240 seconds) |
14:35:11 | * | NimBot joined #nim |
14:45:23 | * | nsf quit (Quit: WeeChat 2.3) |
14:53:42 | FromGitter | <Bennyelg> algo team |
14:53:52 | FromGitter | <Bennyelg> (https://files.gitter.im/nim-lang/Nim/nKgI/image.png) |
14:54:08 | FromGitter | <Bennyelg> this is what im dealing with in my current company which Im leaving in a month from now. |
14:54:13 | * | elrood joined #nim |
15:03:22 | leorize | Bennyelg: doesn't sound like a nice idea to post your co-worker numbers :P |
15:03:42 | FromGitter | <mratsim> yeah, especially given that this is archived |
15:04:11 | FromGitter | <mratsim> and numba is slow |
15:04:28 | FromGitter | <mratsim> only trivial stuff works in Numba |
15:17:39 | narimiran | dom96_w: trying to do `koch boot`, it tells me to contact you :) http://ix.io/1zpX |
15:18:13 | FromGitter | <Bennyelg> Since I m more on the data pipelining infra and my knowledge on using pandas / numba is very shallow I can actually give a good example |
15:18:30 | FromGitter | <Bennyelg> but feel free to share with me something I 'll be more than happy to show them. |
15:20:14 | FromGitter | <bung87> ```code paste, see link``` ⏎ ⏎ not working? [https://gitter.im/nim-lang/Nim?at=5c4f1dae7b68f9410231250e] |
15:22:29 | FromGitter | <mratsim> @Bennyelg I had one example trying to find the mean and standard dev RGB values of 70GB of images using the welford method |
15:22:33 | * | kapil____ joined #nim |
15:22:36 | FromGitter | <mratsim> Numba was slower than pure Numpy |
15:23:32 | FromGitter | <mratsim> The welford method is just a way to compute running mean and variance: https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Welford's_Online_algorithm |
15:24:35 | FromGitter | <mratsim> in the end both Numba and Numpy where just too slow so I open images in OpenCV, resized them so that they would be much smaller, and took normal mean and stddev by taking the sum and then dividing |
15:28:01 | FromGitter | <Bennyelg> you should write a blog about it. |
15:28:05 | FromGitter | <Bennyelg> post * |
15:29:25 | narimiran | @Bennyelg stand behind me in line! i'm still waiting/hoping that @mratsim will write about those faster min/max he did |
15:30:16 | FromGitter | <Bennyelg> hehe @narimiran sure thing but it have to be somewhere else than only on is mind. ;) |
15:30:52 | FromGitter | <mratsim> min max is not only in my mind, it's there: https://github.com/nim-lang/Nim/issues/9514 |
15:43:09 | dom96_w | narimiran: koch managed to copy ~/.nimble/bin/nim into compiler/nim |
15:43:12 | dom96_w | just remove it |
15:43:51 | dom96_w | and/or copy bin/nim into compiler/ |
15:44:10 | dom96_w | koch really shouldn't blindly copy the `nim` executable from the path |
15:44:30 | * | pagnol quit (Ping timeout: 250 seconds) |
15:44:33 | narimiran | remove which one? |
15:45:02 | dom96_w | compiler/nim |
15:45:11 | dom96_w | koch will probably copy it again from PATH though |
15:47:46 | * | PMunch quit (Remote host closed the connection) |
15:49:06 | narimiran | dom96_w: thanks, it seems that deleting did the trick |
15:58:17 | * | JustASlacker quit (Remote host closed the connection) |
15:58:28 | FromGitter | <zetashift> I really really love how the error messages have been improved! |
16:03:52 | dom96_w | oh? Example? |
16:09:02 | FromGitter | <zetashift> well basically almost all errors I got so far are more clearer about how I screwed up x) |
16:10:42 | narimiran | maybe you just screw up better? :D |
16:14:38 | FromGitter | <zetashift> improvement atleast! |
16:15:11 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:15:42 | * | solitudesf quit (Quit: ZNC - https://znc.in) |
16:16:48 | * | solitudesf joined #nim |
16:24:45 | Zevv | Is there background info somewhere about the reel valley storey? |
16:26:04 | narimiran | Zevv: https://forum.nim-lang.org/t/3180#27777 |
16:26:42 | Zevv | "financial reasons", fair enough |
16:27:32 | Zevv | very cool initiative, nice to have another large code corpus to browse, probably a lot to be learned about code organization for big projects |
16:30:36 | * | Trustable joined #nim |
16:30:53 | Araq | we can also ensure the code keeps compiling... |
16:36:45 | * | absolutejam quit (Ping timeout: 244 seconds) |
16:39:11 | FromGitter | <kaushalmodi> How do I map identifiers ending in _ in C header files to Nim? |
16:39:28 | FromGitter | <kaushalmodi> Nim doesn't allow identifiers ending in _, right? |
16:39:32 | Araq | you throw away the _ |
16:39:35 | leorize | just omit them? |
16:39:47 | Araq | if it produces clashes you replace it with _0 |
16:39:54 | FromGitter | <kaushalmodi> ok |
16:39:57 | FromGitter | <kaushalmodi> thanks |
16:40:20 | FromGitter | <kaushalmodi> something like this: `proc clsc*() {.importc: "clsc_", header: headereggx_base.}` |
16:40:45 | Araq | yes |
16:41:04 | FromGitter | <kaushalmodi> and `#define gclose eggx_gclose` become consts? |
16:41:17 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c4f30ad54f21a71a1bd927c] |
16:41:38 | leorize | since you are mapping eggx_gclose to gclose in Nim anw, that wouldn't matter anymore, would it? |
16:41:40 | Araq | don't use const for proc aliasing |
16:42:03 | FromGitter | <kaushalmodi> leorize: I am going crazy trying to map this one lib |
16:42:11 | FromGitter | <kaushalmodi> so am attempting to map all identifiers I can |
16:42:40 | FromGitter | <kaushalmodi> there is one define like this: `#define line eggx_line` |
16:42:58 | FromGitter | <kaushalmodi> but I get C compilation error: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c4f311293fe7d5ac004f0b6] |
16:43:19 | FromGitter | <kaushalmodi> even when I have `proc eggx_line*(a1: cint; a2: cfloat; a3: cfloat; a4: cint) {.importc: "$1", header: headereggx_base.}` |
16:43:44 | FromGitter | <kaushalmodi> Araq: how should those defines be mapped then? |
16:43:47 | Araq | well we use 'line' as a struct field name |
16:44:03 | Araq | #define line eggx_line ? lol |
16:44:11 | * | dom96_w joined #nim |
16:44:14 | Araq | whoever wrote this piece of C code had no clue |
16:44:21 | FromGitter | <kaushalmodi> Araq: I agreee |
16:44:33 | FromGitter | <kaushalmodi> I am just trying to convert a C code (reallly old) to Nim |
16:44:44 | FromGitter | <kaushalmodi> and I've heard that that library is terrible |
16:44:57 | Araq | proc yay_more_aliases() {.importc: "therealname".} is the basic idea |
16:45:04 | * | dom96_w quit (Client Quit) |
16:45:10 | shashlick | @kaushalmodi I can take a look now at your repo and issue |
16:45:35 | Araq | but this #define line will get you into a world of pain |
16:45:50 | Araq | you must avoid to #include this .header at all costs, wrap the DLL instead if you can |
16:45:58 | FromGitter | <kaushalmodi> shashlick: this is that terrible library: https://gitlab.com/kaushalmodi/nimterop-throwaway-1/blob/master/draw/EGGX080/eggx.h |
16:46:02 | FromGitter | <kaushalmodi> trying to map it by hand |
16:46:10 | Araq | the c2nim manual has more details. |
16:46:55 | Araq | here is a workaround: |
16:47:00 | FromGitter | <kaushalmodi> Araq: sorry I didn't understand what you meant by "#define line eggx_line ? lol" |
16:47:08 | Araq | .header: """#undef line |
16:47:14 | Araq | #include <stuff.h> |
16:47:15 | Araq | """ |
16:48:26 | shashlick | @kaushalmodi: where's the actual implementation - these are just #defines |
16:48:45 | * | dom96_w joined #nim |
16:48:50 | FromGitter | <kaushalmodi> follow the #include trail in there |
16:48:54 | FromGitter | <kaushalmodi> all the files are commited |
16:49:00 | shashlick | why not just wrap eggx_base.h |
16:49:00 | FromGitter | <kaushalmodi> the impl is in eggx_base.c |
16:49:08 | FromGitter | <kaushalmodi> that's what I am doing |
16:49:21 | FromGitter | <kaushalmodi> but the eggx_base.h has sigs with eggx_ prefix |
16:49:32 | FromGitter | <kaushalmodi> while the code is using the sigs without the eggx_prefix |
16:49:48 | FromGitter | <kaushalmodi> so I was attempting: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c4f32ab93fe7d5ac004fbed] |
16:50:07 | * | nsf joined #nim |
16:50:32 | shashlick | why does it affect you? |
16:50:47 | shashlick | you will be calling the wrapped procs |
16:50:52 | FromGitter | <kaushalmodi> because the C code I am translating is using the procs without eggx_ prefix |
16:51:22 | shashlick | ok then simply use --prefix with c2nim or the new plugin system with nimterop |
16:51:23 | FromGitter | <kaushalmodi> are you saying just the below should be enough? ⏎ ⏎ ```proc gopen*(a1: cint; a2: cint): cint {.importc: "eggx_gopen", header: headereggx_base.}``` [https://gitter.im/nim-lang/Nim?at=5c4f330bca428b064517aac5] |
16:51:45 | Araq | shashlick, plugin system? |
16:52:25 | shashlick | we just added a callback system - let me point you to the docs |
16:53:31 | Araq | does that mean you'll post a link here or does it mean RTFM? |
16:54:53 | shashlick | well neither since the docs don't seem to be rendering with nim doc |
16:55:12 | shashlick | but basically, you define what you want to do for a symbol in an onSymbol() callback |
16:55:35 | Araq | how would I call it though? |
16:56:08 | shashlick | here's an example - https://github.com/genotrance/nimterop/blob/master/tests/tnimterop_c.nim#L12 |
16:56:50 | shashlick | https://genotrance.github.io/nimterop/plugin.html - Symbol is declared here |
16:58:14 | shashlick | here's the docs for cPlugin - https://genotrance.github.io/nimterop/cimport.html#cPlugin.m%2C |
16:58:47 | shashlick | so cPlugin basically creates a nim --app:lib and toast loads it and calls any callbacks declared |
16:59:07 | shashlick | right now, it's just onSymbol but more are possible - onError is on the books |
16:59:10 | Araq | crazy stuff |
16:59:30 | Araq | need to study it. Later. |
16:59:46 | shashlick | indeed - but user can decide what he wants to do since as discussed earlier, we cannot handle every case implicitly |
16:59:53 | shashlick | appreciate any feedback/insights |
17:00:44 | Araq | you need SWIG's "type maps", c2nim also lacks it |
17:00:59 | FromGitter | <kaushalmodi> here is my attempt at creating a manual Nim wrapper: https://ptpb.pw/WJUs/nim (but of course fails) |
17:01:25 | FromGitter | <kaushalmodi> Nim code importing that wrapper: https://ptpb.pw/Tnmr/nim |
17:01:44 | FromGitter | <kaushalmodi> but C compilation fails with: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c4f357893fe7d5ac0050ff8] |
17:02:08 | shashlick | Araq: good pointer, will check that, types.nim is baby steps at that - https://github.com/genotrance/nimterop/blob/master/nimterop/types.nim |
17:02:13 | FromGitter | <kaushalmodi> draw.c: https://ptpb.pw/T6vV/C |
17:02:45 | shashlick | we are also handling primitive types - https://github.com/genotrance/nimterop/blob/master/nimterop/getters.nim#L29 |
17:03:56 | shashlick | @kaushalmodi - you need some {.compile.} calls |
17:04:00 | shashlick | need to pull in the implementation |
17:04:08 | shashlick | or link to a static lib |
17:04:19 | FromGitter | <kaushalmodi> I have .o objects containing the impl |
17:04:23 | FromGitter | <kaushalmodi> how do I link to those? |
17:04:33 | FromGitter | <kaushalmodi> e.g. I have eggx_base.o |
17:05:04 | shashlick | you can {.compile: "path/to/eggx_base.c".} |
17:05:08 | shashlick | nim will take care of the rest |
17:05:22 | shashlick | let me run this thru nimterop and see if i can get it to wokr for you |
17:05:34 | FromGitter | <kaushalmodi> shashlick: thank you! |
17:05:43 | FromGitter | <kaushalmodi> trying out that compile pragma now |
17:05:46 | Araq | show me eggx_base.h's code please |
17:06:07 | FromGitter | <kaushalmodi> Araq:https://gitlab.com/kaushalmodi/nimterop-throwaway-1/blob/master/draw/EGGX080/eggx_base.h |
17:06:14 | FromGitter | <kaushalmodi> that same dir has the .c too |
17:06:48 | Araq | that lacks the #define line |
17:06:57 | Araq | so everything will be fine, eventually. |
17:07:18 | Araq | so ... if I remove a hack in my compiler the destructor based seqs start to work... |
17:07:25 | Araq | :-) |
17:07:37 | Araq | the only question is what breaks without this hack. |
17:07:50 | shashlick | @kaushalmodi - where is the original eggx library repo |
17:08:13 | FromGitter | <kaushalmodi> shashlick: http://www.ir.isas.jaxa.jp/~cyamauch/eggx_procall/ |
17:09:25 | FromGitter | <kaushalmodi> shashlick: finally draw.nim compiles with https://ptpb.pw/SEfg/nim |
17:09:49 | FromGitter | <kaushalmodi> phew .. now more skeletons to dig as I translate more C funcs to Nim procs in that draw.nim :) |
17:10:06 | shashlick | just hold for a few |
17:10:13 | FromGitter | <kaushalmodi> ok |
17:10:14 | shashlick | which h files need translation besides base |
17:10:23 | FromGitter | <kaushalmodi> eggx_color.h |
17:10:35 | FromGitter | <kaushalmodi> eggxlib.h has some extra defines |
17:14:52 | * | elrood quit (Remote host closed the connection) |
17:25:27 | shashlick | ok done |
17:25:30 | shashlick | getting a snippet out |
17:26:36 | FromGitter | <kaushalmodi> woot! |
17:27:17 | shashlick | http://ix.io/1zqR/nim |
17:27:26 | shashlick | the hard part is making sure it works right 😄 |
17:27:35 | shashlick | had to override the proc with a vararg |
17:28:25 | shashlick | http://ix.io/1zqU/nim is the test script |
17:28:34 | shashlick | only changed one line there |
17:29:13 | shashlick | now it compiles, doesn't mean anything so have to test - cause draw_init() isn't called anywhere |
17:31:01 | FromGitter | <kaushalmodi> shashlick: thanks! I'll try that out in a min |
17:31:16 | FromGitter | <kaushalmodi> yes, this is like phase 1 of my translation process |
17:31:25 | FromGitter | <kaushalmodi> will first create draw.nim lib |
17:31:41 | FromGitter | <kaushalmodi> need to translate a mandelbrot generating C proc that call the procs from draw |
17:32:10 | FromGitter | <kaushalmodi> it's a long chain eggx -> draw -> mandel -> call mandel from systemverilog |
17:32:13 | FromGitter | <kaushalmodi> wish me luck |
17:32:13 | Araq | news: --gc:destructors is starting to work |
17:32:57 | shashlick | ya feel free to reach out |
17:33:10 | leorize | Araq: that's awesome :) |
17:33:15 | leorize | does it work with threads? |
17:33:20 | shashlick | does this address your issue you posted on nimterop? need to go catch up there |
17:33:53 | FromGitter | <kaushalmodi> shashlick: I have 2 issues there .. one regarding nimterop not adding varargs pragma |
17:34:20 | FromGitter | <kaushalmodi> another where the nested includes stop working silently because of those #defines |
17:37:01 | shashlick | ok first one is cause tree-sitter doesn't give me any info so i have a bug opened there |
17:44:58 | Zevv | and *running* :) |
17:45:05 | Zevv | wrongwin, sorry |
17:49:53 | floppydh | Araq: very cool! really looking forward to it |
17:51:36 | shashlick | Araq: that's great news - I need to get up to speed on them |
18:10:40 | FromGitter | <kaushalmodi> shashlick: I did git pull and nimble install on nimterop, but I still get cPlugin as undeclared identifier |
18:11:45 | FromGitter | <kaushalmodi> sorry pinged too soon |
18:11:52 | FromGitter | <kaushalmodi> nimble uninstall nimterop fixed it |
18:12:02 | FromGitter | <kaushalmodi> I had both v0.1.0 and head installed |
18:12:11 | FromGitter | <kaushalmodi> and probably the 0.1.0 took the priority? |
18:13:38 | FromGitter | <kaushalmodi> btw you nim wrapper snippet worked like a charm! |
18:16:13 | FromGitter | <kaushalmodi> s/you/your |
18:16:59 | * | narimiran quit (Read error: Connection reset by peer) |
18:17:38 | rayman22201 | yay destructors! Too bad I have to do real work at my job this week, so I can't play with it lol |
18:18:11 | shashlick | Awesome |
18:18:26 | shashlick | We obviously need to improve the relative path stuff |
18:18:56 | shashlick | Plus put up some more examples and blogs etc |
18:19:01 | shashlick | But still early times |
18:21:01 | * | narimiran joined #nim |
18:22:42 | FromGitter | <kaushalmodi> shashlick: looks like cOverride block needs to come before cImport? |
18:25:30 | shashlick | Yep |
18:29:45 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:47:46 | * | krux02 quit (Remote host closed the connection) |
18:54:06 | FromGitter | <mratsim> https://github.com/nim-lang/Nim/issues/10482 worth medium or even high priority tag? |
18:56:38 | narimiran | well, he is working on fixing 32-bit stuff, so it is already a priority :) |
18:58:18 | * | zachk joined #nim |
19:00:22 | * | Jjp137 quit (Ping timeout: 250 seconds) |
19:01:34 | * | Jjp137 joined #nim |
19:08:01 | * | zachk quit (Changing host) |
19:08:01 | * | zachk joined #nim |
19:19:45 | Araq | leorize: the design is based on top of an allocator indirection and works with multi-threading, yes |
19:25:48 | shashlick | Leorize: appreciate your input here https://github.com/genotrance/nimterop/issues/72 |
19:26:16 | shashlick | Especially the discussion link on gitter, @zestyr's proposal |
19:26:21 | shashlick | Thanks in advance |
19:38:36 | * | couven92 quit (Read error: Connection reset by peer) |
19:38:38 | FromGitter | <Clyybber> Araq: \o/ Did you remove the hack that prevented desctrctor based seqs to work? |
19:38:39 | * | fredrik92 joined #nim |
19:40:39 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
19:40:47 | Araq | kind of. |
19:42:14 | * | nsf quit (Quit: WeeChat 2.3) |
19:46:28 | * | freddy92 joined #nim |
19:47:26 | * | freddy92 is now known as couven92 |
19:48:05 | * | couven92 quit (Remote host closed the connection) |
19:48:31 | * | freddy92 joined #nim |
19:48:39 | * | freddy92 is now known as couven92 |
19:50:13 | * | fredrik92 quit (Ping timeout: 268 seconds) |
19:54:27 | * | Pisuke quit (Ping timeout: 240 seconds) |
19:54:52 | * | Sembei joined #nim |
20:02:29 | dom96 | narimiran: might be a good idea to write a blog post for the Reel Valley release with some screenshots/video, what do you think? |
20:04:07 | Zevv | I understand the graphics and other assets are not part of the release? So we would not have a complete working game, is that right? |
20:04:31 | dom96 | The assets are part of it, but in a compiled form AFAIK |
20:04:46 | dom96 | Zevv: You coming to FOSDEM btw? |
20:05:13 | Zevv | was kind of planning to, but something came up, sorry |
20:05:32 | Zevv | life is all about priorities :/ |
20:05:35 | dom96 | np :) |
20:07:05 | Zevv | assets compiled is also great, that means it should be in working order. |
20:07:16 | dom96 | We really need to do something about how flaky the CI is, this PR changes only CSS and fails on the CI :/ https://github.com/nim-lang/Nim/pull/10480 |
20:11:47 | * | absolutejam joined #nim |
20:15:39 | * | Marumoto joined #nim |
20:16:43 | * | fanta7531 quit (Quit: fanta7531) |
20:25:08 | FromGitter | <mratsim> miran's last 3 doc PR failed CI |
20:25:40 | * | Trustable quit (Remote host closed the connection) |
20:26:00 | FromGitter | <mratsim> and seems like it's windows/appveyor |
20:26:15 | Araq | then why was it merged |
20:26:45 | FromGitter | <mratsim> the PR passed CI$ |
20:26:56 | FromGitter | <mratsim> but the master commit didn't |
20:28:02 | FromGitter | <mratsim> actually it was Travis C++ that failed |
20:31:06 | FromGitter | <brentp> I have an error like this: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ what would I do to debug? [https://gitter.im/nim-lang/Nim?at=5c4f668a7b68f94102334353] |
20:32:03 | FromGitter | <brentp> is it something with having mutliple `when isMainModule` sections in different files? |
20:33:18 | narimiran | hey dom96, sorry for the late reply |
20:33:42 | Araq | brentp: Never got an error like that |
20:34:07 | * | lritter quit (Ping timeout: 240 seconds) |
20:34:08 | narimiran | yeah, some screenshot at least would be nice |
20:35:10 | narimiran | re PRs and tests: it happens that PR pass CI, and then they are merged, and the tests are run again (should they be?) and sometimes they fail |
20:35:50 | narimiran | but there are situations where it *looks* like they have failed, and what happened is that the build was cancelled because of some new commit |
20:38:02 | FromGitter | <brentp> @Araq, with this tree, I get the error: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c4f682aca428b06451912a4] |
20:38:32 | FromGitter | <brentp> if I rename src/slivarpkg/slivar_gnotate.nim to src/slivarpkg/sl_gnotate.nim it compiles fine. |
20:39:42 | FromGitter | <brentp> something about `slivarpkg/gnotate.nim` and slivarpkg/slivar_gnotate.nim` both getting name `slivar_gnotate` (?) |
20:40:02 | FromGitter | <brentp> anyway. The file name does not matter. so I just change it. |
20:41:32 | * | kapil____ quit (Quit: Connection closed for inactivity) |
20:52:21 | * | pagnol joined #nim |
20:53:14 | * | floppydh quit (Quit: WeeChat 2.3) |
21:16:41 | * | Tyresc joined #nim |
21:16:42 | * | abm joined #nim |
21:22:02 | Araq | brentp: ah, ok, this is something we will fix/change anyway, no need to report it |
21:24:06 | * | Vladar quit (Remote host closed the connection) |
21:28:37 | * | narimiran quit (Ping timeout: 246 seconds) |
21:32:48 | * | druonysus joined #nim |
21:32:48 | * | druonysus quit (Changing host) |
21:32:48 | * | druonysus joined #nim |
21:35:52 | FromGitter | <brentp> great! thanks. |
21:43:36 | * | vlad1777d joined #nim |
21:59:15 | * | couven92 quit (Quit: Client Disconnecting) |
22:03:50 | * | absolutejam quit (Ping timeout: 246 seconds) |
22:27:12 | * | zachcarter joined #nim |
22:36:10 | * | pagnol quit (Ping timeout: 272 seconds) |
22:46:48 | * | elrood joined #nim |
22:56:37 | * | elrood quit (Remote host closed the connection) |
23:19:49 | * | druonysus quit (Quit: druonysus) |
23:38:26 | * | vonHabsi quit (Ping timeout: 240 seconds) |
23:46:48 | * | ghost64 quit (Quit: See you!) |
23:48:08 | * | ghost64 joined #nim |