<< 26-05-2017 >>

00:05:28*vlad1777d quit (Ping timeout: 240 seconds)
00:11:45*Jesin joined #nim
00:42:11*yglukhov joined #nim
00:46:27*yglukhov quit (Ping timeout: 240 seconds)
00:58:44*Etheco quit (Quit: Leaving)
01:13:25*def-pri-pub joined #nim
01:17:48*chemist69 quit (Ping timeout: 240 seconds)
01:28:38*PMunch quit (Quit: leaving)
01:31:13*libman quit (Quit: Connection closed for inactivity)
01:31:28*chemist69 joined #nim
01:43:34*daaf quit (Quit: Konversation terminated!)
01:43:53*daaf joined #nim
01:59:20*Trioxin2 joined #nim
02:02:05*Trioxin quit (Ping timeout: 268 seconds)
02:03:48*Trioxin2 quit (Ping timeout: 240 seconds)
02:03:52*Trioxin joined #nim
02:14:21*WhiskyRyan joined #nim
02:16:48*brson quit (Quit: leaving)
02:25:47*smt_ joined #nim
02:29:10*smt quit (Ping timeout: 255 seconds)
02:32:07*WhiskyRyan quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
02:37:28*dddddd quit (Remote host closed the connection)
02:47:53*pilne quit (Quit: Quitting!)
02:50:05*rauss joined #nim
02:54:06*Elronnd left #nim (#nim)
03:12:02*smt_ quit (Read error: Connection reset by peer)
03:12:28*smt_ joined #nim
03:17:59*daaf quit (Ping timeout: 272 seconds)
03:42:04*vlad1777d joined #nim
04:00:09*Jesin quit (Quit: Leaving)
04:08:26*Neomex quit (Quit: Leaving)
04:31:26*mawkish quit (Ping timeout: 272 seconds)
04:50:13*def-pri-pub quit (Quit: Lost terminal)
05:16:56*Neomex joined #nim
05:18:13*alxf joined #nim
05:21:08*chemist69 quit (Ping timeout: 246 seconds)
05:25:50*chemist69 joined #nim
05:33:21*Nobabs27 quit (Quit: Leaving)
06:03:49FromGitter<mratsim> Is `nimprof` still working. I get a line with a “total executions of each stack trace:” but then it’s EOF.
06:04:39FromGitter<mratsim> Note: I’m on OSX with Clang if it'srelevant
06:10:38FromGitter<Varriount> @mratsim It's unmaintained
06:10:46FromGitter<mratsim> okay
06:11:01FromGitter<Varriount> Try using a C profiler. Since you're on OSX, you can use Instruments
06:11:21FromGitter<Varriount> You can use `--debugger:native`
06:12:49FromGitter<mratsim> okay, thanks
06:14:51FromGitter<mratsim> How can I shut up XDeclareButNotUsed for enums. It’s an error enum to interface with a C lib and I’m flooded. http://img.ctrlv.in/img/17/05/26/5927c7bb18139.png
06:29:26*nsf joined #nim
06:30:02*mawkish joined #nim
06:30:43FromGitter<mratsim> @Varriount Instruments is working great, thanks ;)
06:46:50*Vladar joined #nim
06:48:07*yglukhov joined #nim
07:07:59FromGitter<Varriount> @brechtm make it public
07:08:12FromGitter<Varriount> Or try using the size pragma
07:15:15*Kingsquee joined #nim
07:16:26*rokups joined #nim
07:17:57*rauss quit (Quit: WeeChat 1.8)
07:19:12*mawkish quit (Quit: WeeChat 1.7.1)
07:21:59*xet7 joined #nim
07:28:37*Arrrr joined #nim
07:28:37*Arrrr quit (Changing host)
07:28:37*Arrrr joined #nim
07:30:04FromGitter<mratsim> This is the dream, if we could have a REPL, we could use Nim in Jupyter like that: https://github.com/QuantStack/xtensor/blob/fb7589d2a255b5687547977998719075f7decbb1/notebooks/xtensor.ipynb
07:38:05*Vladar quit (Quit: Leaving)
07:39:19*Andris_zbx joined #nim
07:40:10FromGitter<abijahm> hello guys, has anyone successfully wrapped this library https://github.com/svn2github/ta-lib.git am a noob at c
07:47:30*Arrrr quit (Ping timeout: 240 seconds)
07:49:42*Arrrr joined #nim
07:49:42*Arrrr quit (Changing host)
07:49:42*Arrrr joined #nim
07:51:14ArrrrWrapping is not too complicated https://github.com/ephja/nim-glfw/blob/master/src/glfw/wrapper.nim
07:51:34*sz0 joined #nim
08:05:55*lenstr quit (Ping timeout: 268 seconds)
08:15:45euantorThanks for posting that libman!
08:23:51*couven92 joined #nim
08:28:54*Neomex quit (Quit: Leaving)
08:53:51*chemist69 quit (Ping timeout: 240 seconds)
08:54:32*Trustable joined #nim
08:58:52*chrisheller quit (Ping timeout: 260 seconds)
09:00:58*chrisheller joined #nim
09:06:30*gokr quit (Ping timeout: 240 seconds)
09:09:55*Neomex joined #nim
09:12:05*Arrrr quit (Ping timeout: 240 seconds)
09:18:52*Trioxin2 joined #nim
09:19:51*Trioxin quit (Quit: Konversation terminated!)
09:20:00*Matthias247 joined #nim
09:20:12*Etheco joined #nim
09:20:25*Trioxin joined #nim
09:21:03*chemist69 joined #nim
09:21:59*Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif)
09:23:20*Trioxin2 quit (Ping timeout: 246 seconds)
09:29:53FromGitter<ephja> I dunno why I named it "wrapper" btw. the other module is the wrapper
10:25:34*PMunch joined #nim
10:35:46*Arrrr joined #nim
10:48:14FromGitter<zacharycarter> Still fighting a memory corruption issue - https://gist.github.com/zacharycarter/255dd7fc6cbf12ce3e9ad424ff5fdaca ⏎ ⏎ If anyone is willing to help me
10:48:21FromGitter<zacharycarter> https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-c/spine-c/src/spine/Skeleton.c#L84
10:52:12PMunchIt's seems like you have an infinite recursion?
10:52:46FromGitter<zacharycarter> damn
10:54:07PMunchIf you look at the stack trace at the end of the log
10:57:16*chemist69 quit (Ping timeout: 246 seconds)
11:00:36*chemist69 joined #nim
11:03:19*skrylar joined #nim
11:05:53skrylarbeep boop.
11:06:43*nsf quit (Quit: WeeChat 1.7.1)
11:09:51*bjz joined #nim
11:10:33FromGitter<zacharycarter> PMunch: Hrmmm I'm worried about the heap overflow
11:11:31PMunchYeah, heap overflows can be hard to debug.
11:12:06FromGitter<zacharycarter> Agreed, I've been at this one for the past 3 days
11:12:12PMunchDid you look at the traceback though to check if it was indeed an infinite recursion?
11:12:29FromGitter<zacharycarter> I don't think it's a case of infinite recursion
11:12:35FromGitter<zacharycarter> something is wrong in my bindings I'm guessing
11:12:48skrylarthat is usually the case
11:12:58PMunchBut what is all the reprAux stuff?
11:12:58skrylarwell, when something is one type and that does not match the other type
11:13:27FromGitter<zacharycarter> PMunch: I'm not sure but even if I don't use repr there I still get the error
11:13:28*skrylar wonders if should port the delta debugger to nim. hm
11:13:53FromGitter<zacharycarter> I just used repr to get it to throw it
11:14:08PMunchAha
11:14:19FromGitter<zacharycarter> I'm trying to minify this example - right now it could be compiled with just libspine
11:14:41FromGitter<zacharycarter> hoping someone will jump on board to help me as this is a blocker for spine integration with frag
11:20:05*Neomex quit (Ping timeout: 240 seconds)
11:24:19*Vladar joined #nim
11:25:01skrylaras in the proprietary animation suite Spine?
11:26:13FromGitter<zacharycarter> yessir
11:26:49FromGitter<zacharycarter> skrylar: http://fragworks.io/
11:26:56FromGitter<zacharycarter> you can see an example of raptor boy running in the engine there
11:27:08FromGitter<zacharycarter> it works, it's just you start moving code around and things crash as usual with memory corruption
11:28:22skrylarits just my spiny cynicism about supporting tools that have activation in them
11:28:31skrylarthat being said if you have the header files i might look at it
11:28:39FromGitter<zacharycarter> all the header files are here
11:28:50FromGitter<zacharycarter> https://github.com/EsotericSoftware/spine-runtimes/tree/master/spine-c/spine-c/include/spine
11:29:01FromGitter<zacharycarter> If you do, I greatly appreciate it
11:29:14FromGitter<zacharycarter> skrylar: I was going to support Dragon Bones but they don't have a C runtime :/
11:29:34skrylardragon bones?
11:30:04FromGitter<zacharycarter> http://dragonbones.com/en/index.html
11:30:38skrylarintriguing
11:30:42FromGitter<zacharycarter> basically a Chinese rip off of spine
11:30:48skrylari've only ever used blender and godot for such things
11:30:50FromGitter<zacharycarter> but open source and free
11:31:27*skrylar shakes fist at lack of linux version. bah
11:31:36FromGitter<zacharycarter> I don't really mind Spine being proprietary to be honest. The libgdx founders built the product and they deserve their comeuppance I suppose
11:31:40skrylarwell i'm sure its a neat tool
11:31:52FromGitter<zacharycarter> it probably is I haven't played around with it yet
11:32:00skrylarmmm i dont have a problem with proprietry. i have a problem with web activation
11:32:01FromGitter<zacharycarter> If they ever write a C runtime or if I ever have time to write a Nim runtime I might
11:32:12FromGitter<zacharycarter> Oh I see what you mean
11:32:27skrylari have a happily paid license to 3d coat, allegorithmic and tons of stuff
11:32:36skrylarjust not if they treat me like a thief from the word go
11:32:39skrylaranyway
11:32:47FromGitter<zacharycarter> right
11:33:00skrylarit's not so bad to port C++ stuff *depending* on how much of a template hell it is
11:33:06skrylaryou can do some basic stuff with m4
11:33:33FromGitter<zacharycarter> mm interesting I hadn't heard of m4 before
11:33:35skrylari had a little test rig that was like, func(int, something, int(param))
11:33:58skrylarthen you have one file that defines macros to do the C++ to C binder and another that does the C to nim binder
11:34:16FromGitter<zacharycarter> interesting
11:34:30skrylarsome would argue swig is better
11:35:51skrylari'll leave the tab open for a bit and see how i feel. not entirely against doing a hand-wrapper for libspine (i've done a few for nim already)
11:35:53FromGitter<zacharycarter> I haven't played with either but I'm going to now
11:36:12FromGitter<zacharycarter> :D okay
11:37:51skrylarwell thing with m4 is its weird and ugly
11:37:56skrylarbut every unix terminal has it
11:38:54skrylarIf someone wanted to be extreme maximum effort they would be better served by taking libclang and using that to introspect the C, make xml or something, and go from there. but that's significantly more work
11:39:16skrylaronly thing i can suggest is to minimize the code you are having issues with
11:39:53skrylarah crap i didn't put diascia on github
11:40:22skrylara delta debugger is nice if you can find one. removes lines until you have the smallest thing that still crashes
11:40:41skrylarotherwise make sure structs are packed the same in both the c and nim modules
11:40:59skrylaronce had a bug where freepascal was doing heinous things to structure packing when floats were in a struct
11:42:46skrylar@zacharycarter if you do decide to use M4 on something, make sure to save the outputs in git or your windows users will hate you
11:45:48FromGitter<zacharycarter> thank you advice well taken
11:46:30FromGitter<zacharycarter> how can I ensure the structs are packed the same?
11:47:29PMunchWorking with some Arduino C++ code and I really miss Nims extended Lisp-like support for ternary operations...
11:48:35skrylar@zacharycarter look at your wrapper and at the .h file, make sure the .h doesn't have any weird pragmas
11:48:45skrylarmake sure your ints are cints and the like
11:51:10FromGitter<zacharycarter> okay yeah I think I've done that for the most part already
11:51:14FromGitter<zacharycarter> but I'll do another run over
11:52:50skrylardid you hand-bind or use c2nim?
11:53:13*skrylar has never c2nim'd anything, so
11:53:30FromGitter<zacharycarter> I used both
11:53:40FromGitter<zacharycarter> I ran the header file through the gcc preprocessor first
11:53:54FromGitter<zacharycarter> which basically concatenated all the .h files into one large .h file
11:54:06FromGitter<zacharycarter> then I ran c2nim
11:54:24FromGitter<zacharycarter> then I moved things around / had to implement a few functions the library expects you to implement
11:54:48FromGitter<zacharycarter> c2nim seemed to have done a pretty decent job - I've wrapped quite a few libs at this point both with c2nim and by hand
11:55:01FromGitter<zacharycarter> this one is giving me fits though
11:57:35*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
11:57:38skrylarand thats why i dont bother with them x.x
12:04:03FromGitter<zacharycarter> skrylar - bother with what?
12:05:15skrylar@zacharycarter autowrapper tools
12:06:18FromGitter<zacharycarter> ah gotcha
12:09:58skrylarconsidering a macro for state machines
12:10:09skrylarwonder if that could be done in a single sitting.. i don't see why not
12:12:50fr1enda sitting can be arbitrary long but bedsores are probably a limiting factor
12:13:36fr1end*arbitrarily
12:13:38FromGitter<zacharycarter> alright I have the bindings down to 455 loc and the crash is preserved. I don't think I can remove anything else
12:13:58skrylarare you doing that by hand o_o
12:14:25*bjz joined #nim
12:14:43FromGitter<zacharycarter> yup
12:15:47FromGitter<zacharycarter> I just removed a bunch of proc signatures and data structures that weren't used in the code that produces the crash
12:32:13*Neomex joined #nim
12:36:05FromGitter<zacharycarter> C float arrays should translate to ptr cfloat correct?
12:40:58PMunchIsn't C floats 32-bits while Nim floats are 64-bit?
12:41:39PMunchOh wait
12:42:03PMunchYou're mapping the other way round, then I guess it's fine
12:47:38skrylari don't know if float and double have set names
12:47:44skrylartechnically "int" doesn't mean much in C
12:47:59PMunchYeah, the datatypes in C are quite messy :P
12:48:05skrylarits sort of assumed to mean 32-bit now, but it technically means "machine width" and it was never as well defined as pascal
12:48:11skrylari know pascal actually DOES name the bit lengths
12:48:49skrylarcolloqially floats are 32-bits and double are 64. though nimrod doesn't seem to like double and wants float64
12:49:08ftsffloats are float64 by default i believe
12:49:13skrylarpossibly
12:49:13PMunchYes
12:49:29skrylari intentionally use 32-bit floats still
12:50:07PMunchIf you don't need the extra precision why spend 2x the storage
12:50:17skrylarpeople think they need the precision
12:50:20skrylarbut its more than storage
12:50:45skrylarwhen they upgrade the processors they add 64-bit registers and the 32-bit ones get more space
12:50:58skrylarSo under AVX2 you can almost do an entire convolution in a single cpu op
12:51:12skrylarwell a convolution is 9 cells and avx2 can only fit 8 floats
12:51:30skrylarso yeah if you don't need the precision you also get a significant boost on paralell stuff
12:52:27skrylarhad a short discussion with someone about how the only difference between an old Core Duo and a modern i7 is honestly just the avx opcodes
12:52:40PMunchIf your compiler manages to optimize it in that is
12:53:12PMunchDidn't the i series also cut out some pipeline stages?
12:53:18skrylarit might
12:53:31skrylarmy tensor stuff seems to optimize okay enough in gcc
12:53:47skrylarhaven't checked clang, they have some autovectorizing as well
12:53:57PMunchOh yeah, but those who wrote that probably knew what they were doing :P
12:54:22skrylarwell you have to give the compiler some mental help
12:54:31PMunchYou probably wont notice the biggest benefit for something not specifically optimised for avx
12:54:55skrylargcc will do it but you have to either explicitly use vector pragma types or fiddle with switches
12:56:07skrylarin my case i just have a flat array of floats and simple for loops. if you tell it -ffast-math and -funroll-loops and turn on avx2 it will actually unroll and replace with the right opcodes
12:56:43skrylarit actually tries to do it without loop unrolling but its a hilariously sad bit of assembly
12:57:08skrylarit will just go one by one packing the floats in the register until it has eight and then call it, unless you use the unroll flag
12:57:20skrylaranyway
13:01:03skrylarcompiling nim to shaders would be worth a chuckle :p
13:01:29fr1endhuh wasn't someone doing exactly that?
13:01:50fr1endhttps://forum.nim-lang.org/t/1868/1
13:02:35fr1endoh hm I think there was something that did the actual shader part in nim too
13:03:16skrylari see some people put msgpack code in nimble
13:03:20skrylarought to see if they did good jobs
13:03:30fr1endhttps://github.com/yglukhov/nimsl yeah
13:03:40fr1endcrazy stuff! \o/
13:04:29skrylari would say that isn't hard, but actually, yeah its not trivial
13:04:52skrylarits basically reimplementing All The Things
13:06:17skrylarbgfs just uses glsl and does some silly preprocessor stuff to make it hlsl
13:07:58FromGitter<kirk86> hi everyone, I was wondering if I could ask a question to the nim developers. It seems that there is a lot of interest and traction of using nim for scientific computation but I don't know if the developers will push the language down that road. For instance we would love to see multidimensional arrays in nim like in other languages julia, numpy. Is that sth of interest to the developers?
13:15:27FromGitter<andreaferretti> it is certainly of interest to me :-)
13:15:33FromGitter<andreaferretti> but I am not a NIm core developer
13:15:59FromGitter<andreaferretti> @mratsim is working on https://github.com/mratsim/Arraymancer
13:16:05skrylari thought we had multidimensional arrays?
13:16:15FromGitter<andreaferretti> no, we don't
13:16:21FromGitter<andreaferretti> at least not in the stdlib
13:16:45skrylardoes that mean something different from the foo[3,2] kind of thing
13:17:14FromGitter<andreaferretti> no, it is exactly that thing
13:17:27FromGitter<andreaferretti> you *can* nest arrays if you happen to know the dimensions statically
13:17:43FromGitter<andreaferretti> but for things where the dimension is not known at compile time
13:17:55FromGitter<mratsim> It is the same but ndarrays can do computations efficiently
13:17:56FromGitter<andreaferretti> you need seqs
13:18:05FromGitter<andreaferretti> and seqs of seqs are not contiguous
13:18:23*arnetheduck quit (Remote host closed the connection)
13:19:55skrylarok so you meant more of a numpy type lib
13:20:17*arnetheduck joined #nim
13:20:18skrylarthose are pretty boring to write tbh
13:20:21FromGitter<mratsim> Yes, you can do Matrix computations efficiently, slicing, etc
13:20:49skrylari have some nubile tensor stuff
13:21:05FromGitter<mratsim> What do you mean by boring? (and what is nubile)
13:21:31skrylarnubile = young, immature
13:22:39skrylarby boring i mean its a solved problem (so, not much curiosity) and the work is just piling solved formulas in to a module and doing benchmarks
13:22:47FromGitter<mratsim> ah I see. Quite a few tensor/ndarray lib ideas popping up in the past months :O
13:23:15skrylartensors are hmm
13:23:43skrylari've been using a basic one for some AI stuff
13:23:51FromGitter<mratsim> mmh, I don’t think it’s a solved problem. I found numpy code quite inefficient to be honest. It needs 1000+ lines for lot of core stuff, most of those for Python-C boilerplate and reference counting
13:24:49skrylardonno if someone could yoink the tensor code from torch7 for that
13:24:59skrylari think a lot of its in C?
13:25:30skrylari agree it would be cool. i just think its going to be hard to convince someone to do it
13:25:41FromGitter<mratsim> I’m using PyTorch, Numpy, Nervana Neon, Ndimage code as reference
13:25:51FromGitter<mratsim> Well I’m doing it and I don’t need convincing ;)
13:26:11FromGitter<mratsim> oh and Chainer’s as well
13:26:13skrylarshiny.
13:26:38skrylarmost of my time has been filled with UI/UX derp
13:26:43FromGitter<mratsim> I just implemented, reshaping, broadcasting (explicit), permutating today
13:36:11*TheLemonMan joined #nim
13:39:01skrylarbleh decision time
13:39:15skrylartime to decide if signals and slots or just regular callbacks are better
13:42:29FromGitter<mratsim> I already have my plate full with returning views or copies, thankfully I don’t have to think about GUI stuff
13:42:59FromGitter<mratsim> @kirk86 What will be your use case?
13:52:28skrylarmratsim: gui stuff is just tedium lol
13:55:14FromGitter<ephja> didn't Qt rely on them because of the absence of closures in past versions of C++?
13:58:28FromGitter<mratsim> Btw: no idea on how to chain inline iterator with zip/enumerate? https://forum.nim-lang.org/t/2972. I can’t believe I’m the only one with that question
13:58:59skrylarephja, not just that
13:59:34skrylarthey also allow you to put multiple watchers on objects
14:00:26skrylarany window that uses a data source can also connect to said data source and be told when it disconnects or such, instead of having to route it all through an event pump
14:00:54skrylaralthough it seems nim is taking offense to my use of generics for it
14:01:08*Jesin joined #nim
14:04:52skrylardisregard i'm an idiot
14:04:57skrylarthe error is because it wasn't a var type
14:06:04skrylareeeh might just cheat with this and say like, use a seq type (uninitialized) and a "first" field
14:06:23skrylarSo you pay for two pointers but if you only ever have one receiver, you don't pay for any allocs
14:09:55FromGitter<ephja> skrylar: wait. wasn't it mostly because of lack of certain metaprogramming features?
14:14:01*dddddd joined #nim
14:14:13skrylardonno. they're useful though
14:14:40*ftsf quit (Quit: Leaving)
14:14:44skrylarGTK also uses that model
14:14:53FromGitter<mratsim> Can we use the method call syntax for pattern matching in term-rewriting macro ? {a.proc1.proc2(arg2)} ?
14:15:14skrylari *think* so
14:15:28skrylarcall syntax is just the .() operator according to the docs
14:15:50FromGitter<ephja> actually, boost.signals did not rely on variadic templates
14:16:30skrylarvariadic templates are wonderful
14:16:42FromGitter<ephja> maybe the Qt people never thought of manually adding variations. there's probably no need for more than 9 parameters anyway
14:17:00skrylarwell the thing is Qt is very old and also they had more targets than just GCC
14:17:32skrylarI see people talk about some magical version of C++ that doesn't suck but in reality not everyone can use the C++0xBEEF features all the time :(
14:17:39FromGitter<ephja> good ol' complicated C++
14:17:42FromGitter<mratsim> @skrylar It works with the “normal” syntax but doesn’t match with the method call so I guess it’s not supported
14:17:45shmupso i compiled nim on linux subsystem. in nim root is koch, so I ./koch install nimble. the readme says: "This will clone the Nimble repository, compile Nimble and copy it into Nim's bin directory."
14:18:12shmupnow what I do see is a new nimble directory, with a nim/bin/nim which threw me off
14:18:13FromGitter<mratsim> C++0xDEADBEEF
14:18:14skrylarmratsim: you could always use regular macros if desperate
14:18:34FromGitter<mratsim> I didn’t mean that
14:18:44shmupcan't find a nimble.exe anywhere
14:18:50shmuper nimble
14:19:36skrylari should probably do more work and do less of the being bitter in the chat lol
14:19:47FromGitter<mratsim> ```template rewriteToTensorReshape*{oa.toTensor(B).reshape(dims)}``` [https://gitter.im/nim-lang/Nim?at=59283983f3001cd3425f8bb2]
14:20:10skrylarbut yes the nice thing is that even if you can't get some of the template magic working you always have the nuclear option of writing a ful-on macro
14:20:45skrylarwhich is nice because then you can even have dplyr syntax ^^
14:21:03FromGitter<mratsim> I already pushed the button for my slicing syntax :P to support stuff like foo[_, *], foo[0..*, 1..4|2]
14:21:31FromGitter<mratsim> R syntax is meh >_>
14:22:13FromGitter<ephja> A lot of people seem to think that there's no need for another language now that there's c++11
14:22:35skrylarthose people thought that before there was c++11
14:22:52skrylarc++ promotes brain damage
14:23:24shmupwell whether this is encouraged or not, I just ended up nim c nimble.nim from the nimble src that was created after doing a ./koch nimble
14:23:25skrylarthe sheer amount of effort needed to understand anything about how it works invokes the ikea effect and sunk cost fallacies to the point people believe nothing else can be better because they already spent effort learning it
14:24:36*TheLemonMan left #nim (#nim)
14:24:56skrylarnevermind you can train someone on ST-80 in an evening
14:25:02skrylarand C++ takes years
14:25:08skrylaranyway i said i'd stop being bitter :3
14:26:21FromGitter<ephja> Oh and the obligatory disclaimer about subjectivity
14:27:31*rauss joined #nim
14:31:48skrylarephja, there's a lot of psychology issues behind it yeah
14:32:01FromGitter<Varriount> skrylar: Keep going! I might be able to use you to flavor my recipes
14:32:03FromGitter<mratsim> There is C++17
14:32:06skrylaranchoring effect applies heavily to syntax
14:32:08FromGitter<Varriount> :P
14:32:26skrylaractually there is that one weird language
14:32:40skrylarforget the name. the gimmick is that every feature has to have a qualitative study done on it
14:32:50FromGitter<zacharycarter> Okay I figured out if I replace my unchecked arrays with pointers I don't get the buffer overflow exception
14:32:50Xeskrylar: is it any better than the one that corrodes?
14:32:53FromGitter<mratsim> Hence Mozilla people created Rust syntax because they coded in C++ all the time
14:32:55FromGitter<ephja> well, the ecosystems are arguably more important than the languages themselves, so those cognitive biases do not always apply
14:32:55skrylarso their syntax was decided by all these academic papers
14:32:56FromGitter<zacharycarter> so the problem is the unchecked arrays
14:33:08FromGitter<ephja> industry support matters
14:33:29skrylarephja, the anchoring effects matters more for syntax than anything else
14:33:40FromGitter<zacharycarter> skrylar: I think you're talking about ponylang
14:34:12FromGitter<mratsim> Skrylar, it seems like Haskell is mostly driven by academics, but I actually like Haskell syntax
14:34:14shmuppony sounds right
14:34:36FromGitter<mratsim> but ponylang is only developed in the University of Oxford iirc?
14:34:59FromGitter<zacharycarter> not sure I just know it has mathematical proofs behind its safety
14:35:02skrylarephja, i say this because like with ex. lua its a common complaint that it doesn't look like C
14:35:16FromGitter<mratsim> Mmmmh then it’s probably Idris?
14:35:22skrylareven though it has all those other things that people like :)
14:35:26skrylaranyway
14:35:28FromGitter<mratsim> or Coq
14:35:41skrylari heard about coq today. haven't figured out how to use it yet
14:36:01*Matthias247 quit (Ping timeout: 246 seconds)
14:36:19FromGitter<ephja> my only concern is whether or not the syntax in question is overly verbose
14:36:30*Matthias247 joined #nim
14:36:32FromGitter<mratsim> Try J or K :P
14:37:30FromGitter<ephja> and that is why I've been using moonscript instead (compiles to lua). it has some neat shortcuts
14:38:49FromGitter<mratsim> Regarding Lua, before diving into Nim, I looked also at Terralang which seems to have a similar philosophy: http://terralang.org/ and is using Lua metaprogramming
14:39:27*mwbrown quit (Ping timeout: 240 seconds)
14:42:29*mwbrown joined #nim
14:43:01FromGitter<zacharycarter> sweet fixed my binding problem I think
14:43:04FromGitter<zacharycarter> only took 3 days
14:43:36skrylarit would be neat if varargs in a template would pass to function calls without being silly
14:43:55skrylartemplate(..., varargs[untyped]) = <if i try to pass the varargs to a function it doesn't splice them>
14:58:05FromGitter<zacharycarter> nm still hunting :/
15:03:18*smt joined #nim
15:03:53*chemist69 quit (Ping timeout: 246 seconds)
15:04:02FromGitter<zacharycarter> hrm I think it's this one data structure I have that is recursive in nature
15:06:36*smt_ quit (Ping timeout: 260 seconds)
15:06:48*chemist69 joined #nim
15:10:23*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
15:13:46*bjz joined #nim
15:16:29FromGitter<Varriount> Fun.
15:20:47FromGitter<zacharycarter> @Varriount seems maybe if you have a data structure that has an unchecked array of a pointer to another data structure with an unchecked array, things get hairy
15:20:48*smt quit (Ping timeout: 240 seconds)
15:21:01*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
15:21:33FromGitter<Varriount> Hm. You know that unchecked arrays have a size of 0, right?
15:21:54FromGitter<Varriount> Could that be messing up things?
15:23:09FromGitter<zacharycarter> maybe
15:23:37skrylarhum
15:23:59skrylarthis is going to sound silly. is there a way to access a closure's current situation?
15:24:22skrylarwas just thinking of if a closure is put on a list, and wants to remove itself, it couldn't just say &myself because that wouldn't include the environemnt
15:26:00*Andris_zbx quit (Remote host closed the connection)
15:26:15*Matthias247 quit (Read error: Connection reset by peer)
15:40:08*arnetheduck quit (Ping timeout: 240 seconds)
15:59:42FromGitter<mratsim> Is there an equivalent OpenMP pragma to 0||n for custom iterators?
16:00:48FromGitter<Varriount> Not that I know of.
16:01:10FromGitter<Varriount> To be honest, I believe the built-in OpenMP iterator was mainly a proof-of-concept
16:05:25skrylarhttps://github.com/skrylar/skEasing i bring gifts
16:05:55FromGitter<zacharycarter> @Araq / @dom96 : any idea how to deal with nested unchecked arrays?
16:07:47FromGitter<zacharycarter> or recursive unchecked arrays
16:08:36*nsf joined #nim
16:12:54FromGitter<mratsim> I need to learn about multiprocessing for numerical computing >_>. I guess long weekend ahead. Is it possible to do shared memory multiprocessing in Nim (copying 5000x5000 matrices is costly), where should I look for that?
16:13:52FromGitter<Varriount> @mratsim It's possible to pass pointers to Nim's various threading facilities
16:14:16*Sentreen quit (Ping timeout: 260 seconds)
16:16:13FromGitter<dom96> @zacharycarter no idea I'm afraid
16:16:34FromGitter<zacharycarter> @dom96: @Araq is probably the only one who can help me at this point I think :P
16:16:47FromGitter<zacharycarter> I think the problem is the size of the unchecked array is obviously unknown
16:17:00FromGitter<zacharycarter> so the malloc call fails thus the heap-buffer-overflow
16:17:11skrylarmratsim: createdShared is your friend
16:17:13FromGitter<zacharycarter> it's trying to allocate more memory than is available since the inner unchecked array's size isn't correct
16:17:54skrylaryou will have to make memory outside of the GC, so that multiple threads can work on it. that allows you to spin up one thread per CPU and give them a separate portion of the mathy bits to do things to
16:18:13skrylaror if you're handing it to a gpgpu
16:20:59skrylarsome day i will know how to do the metadata for nimble
16:21:06skrylaruntil then the easing functions will just sit on github
16:28:19*Sentreen joined #nim
16:30:32*brson joined #nim
16:31:12FromGitter<zacharycarter> https://gist.github.com/zacharycarter/5f91e79110251221b43ad869ad26ec35
16:31:14FromGitter<zacharycarter> this fails
16:31:25FromGitter<zacharycarter> pretty trivial example of the problem I'm facing
16:31:47*foxcub joined #nim
16:31:53FromGitter<zacharycarter> @dom96 should I create an issue?
16:33:17foxcubI want to call a C function with the signature int f(const void *buf, int count, …), where on the Nim side I want the argument to be openarray[T].
16:33:32foxcubIs there a way to get const void* pointer to the beginning of the array?
16:33:51foxcub(And is it safe to assume that any openarray uses contiguous memory.)
16:34:20FromGitter<Varriount> foxcub: For the C backend, yes.
16:34:37FromGitter<Varriount> An openarray is a (int, *T) pair
16:34:44foxcubWhat would be the proc signature on the Nim side?
16:35:14foxcubThings like addr(arr[0]) don’t seem to work.
16:35:28FromGitter<Varriount> foxcub: Try unsafeAddr
16:35:57FromGitter<Varriount> addr won't work on immutable parameters by default.
16:36:13foxcubAnd when creating a declaration for the C function, what do I put for buf type? pointer?
16:36:25FromGitter<Varriount> One moment
16:40:29foxcubLooking at the C code, this is almost working. Using pointer, produces a cast to a (void*). So now I just need to figure out how to make it const void*
16:42:28FromGitter<Varriount> foxcub: Something like this: https://gist.github.com/Varriount/95809a65daae8bfd330580153454d585
16:42:50FromGitter<Varriount> Wait, C has const? I thought only C++ had that.
16:43:00FromGitter<zacharycarter> no C def has const
16:46:37demi-yeah
16:47:51FromGitter<zacharycarter> https://gist.github.com/zacharycarter/02fdd992426f73e28fa7b674883fe466
16:48:06FromGitter<zacharycarter> that's a better example of the problem I'm facing I think
16:48:38skrylarand then i broke nim ._.
16:50:37FromGitter<mratsim> @skrylar, after (not careful) consideration, I think OpenMP is the best way for my use case (also all numerical lib are using either OpenMB or Intel Thread Building Blocks). ⏎ ⏎ So the only difficulty is understanding how to emit OpenMP pragma like ⏎ ⏎ ```code paste, see link``` ... [https://gitter.im/nim-lang/Nim?at=59285cdceec422e415f03b22]
16:51:46skrylarthere is a pragma that lets you put arbitrary C code in the output
16:51:50skrylardepending on the kind of pragmas
16:52:03FromGitter<mratsim> yeah the emit pragma
16:52:38skrylarapparently if a template function attempts to call a closure, Badness ensues
16:53:17skrylarwell, in a weirdly complicated way
16:53:37skrylarIt works just fine in the original module. Then a second one imports that module, and uses the template. Then nim gets deeply confused
16:56:14skrylaraaaaand nim .17 is broken on arch. lovely
16:56:20FromGitter<mratsim> I saw several inconsistencies with template, when called from another file I had to use template(args) instead of args.template otherwise I get undeclared routine
16:57:20FromGitter<Varriount> foxcub: Perhaps you need importcpp?
16:57:46foxcubI think I’ve figured it out. What you gave me works. I don’t actually need the const void*, or rather passing void* is Ok.
16:57:48FromGitter<Varriount> I don't think Nim bothers with generating 'const' in any of its declarations, mostly for compatibilities sake.
16:58:17foxcubI need to play around with it more, but for now I’m good. Thanks for your help.
17:02:20skrylarAraq, dom96: i broke your compiler again http://ix.io/va9 :(
17:02:29FromGitter<Varriount> foxcub: Actually, let me try something
17:02:53dom96skrylar: report it
17:03:12skrylardidn't i just do that :f
17:04:28FromGitter<Varriount> foxcub: Does this work? https://gist.github.com/Varriount/95809a65daae8bfd330580153454d585
17:04:52FromGitter<Varriount> I've never tried mixing imported C procedures with generics.
17:05:25foxcubWon’t ptr array[L, int] give me an int*, not a void*?
17:06:34couven92foxcub, in C, there is no difference between int* and void*. On paper yes, but in reality: no
17:07:08FromGitter<Varriount> foxcub: I don't mean literally.
17:07:19FromGitter<Varriount> I mean, what happens if you use a generic type in an imported procedure
17:08:11FromGitter<Varriount> I predict that either it will work, or the C compiler will raise a redefinition error.
17:08:59*WhiskyRyan joined #nim
17:09:19foxcubcouven92: sure, but what happens when it’s looking for a function to import from the library? Doesn’t it make a distinction?
17:10:17foxcubVarriount: I’m not sure. I’d have to try it, but I think it’s getting further away from what I’m after.
17:10:36FromGitter<kirk86> @mratsim thanks for the reply. I'm completely new to nim and haven't explored it properly but from reading on different forums I've found that people have had some concerns regarding array slicing, broadcasting and multidimensional array creation in a non statically typed fashion. Now I don't know if all of those are true that's why I asked the previous question.
17:10:49*chemist69 quit (Ping timeout: 240 seconds)
17:11:29couven92foxcub, not really, what happens is that the imported function is looked for in the library export table (it's its own section in the binary file) and sets a function pointer in your binary's import table (that's another section in the binary)
17:11:59foxcubcouven92: interesting. Thanks for the explanation. I’ll play with it more.
17:12:08couven92and the only way the OS does the matching is by name...
17:12:25*WhiskyRyan quit (Client Quit)
17:12:26foxcubI have a different question. If I declare a proc f[T](), can I somehow call it as f[int]()?
17:12:39foxcubI.e., no arguments of f depend on T.
17:12:57couven92then why need T? for naming?
17:13:27foxcubNo, the function does different things depending on the type.
17:13:29FromGitter<mratsim> @kirk86 My lib supports all of that (though I choose not to make broadcasting automatic for now). ⏎ Torch (C) and Tensorflow (C++) also support those as far as i know so it’s not an issue of being statically typed. The issue they have is the ergonomics, you have to use torch.add, torch.mul or tf.dot everywhere in the code instead of the mathematical symbols
17:15:19FromGitter<mratsim> It’s still in a pretty rough shape with not enough tests, and no example/docs so I don’t put it on Nimble. Also 3d arrays and more should work fine but the display is broken >_>
17:15:36couven92foxcub, by the way: https://msdn.microsoft.com/en-us/library/windows/desktop/ms683212(v=vs.85).aspx this is how functions are imported from a library on Windows (nim calls this function at runtime when you use dynlib). On Linux this works exactly the same, just with the corresponding POSIX function. And if you use statically linked libraries, the same happens, but is done directly by the OS kernel when it starts up your process
17:15:50*chemist69 joined #nim
17:16:16foxcubcouven92: thanks for the link
17:16:50*krux02 joined #nim
17:20:04*xaxisx quit (Quit: Leaving)
17:25:38*yglukhov quit (Remote host closed the connection)
17:25:44*foxcub quit (Quit: foxcub)
17:26:56*yglukhov joined #nim
17:27:34*WhiskyRyan joined #nim
17:29:59FromGitter<Varriount> foxcub: Yes, you can do that.
17:30:37skrylarhm.. weird
17:30:42FromGitter<Varriount> foxcub: Be sure to use 'when T is ...' for branches though
17:31:10FromGitter<Varriount> If you use 'if', the compiler will semantically check all branches
17:31:43*yglukhov quit (Ping timeout: 272 seconds)
17:32:25*krux02 quit (Remote host closed the connection)
17:38:25*krux02 joined #nim
17:38:44*Neomex quit (Ping timeout: 260 seconds)
17:43:16*WhiskyRyan quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:48:25*sz0 quit (Quit: Connection closed for inactivity)
17:50:49*nsf quit (Quit: WeeChat 1.7.1)
17:51:54skrylareh.. well updated the report and found a workaround
17:52:06skrylarturns out its returning closures from an iterator that makes it confused
17:52:13*Nobabs27 joined #nim
17:52:44Nobabs27I get this error every time I save with VS Code: No 'nim' binary could be found in PATH: '/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl'
17:53:17Nobabs27Alas I do indeed have it installed and added to my path. Anyway I can just turn off the error educate VS Code to reality?
17:54:51dom96Nobabs27: You must be running VS Code in a way that your PATH isn't set
17:55:01dom96It even displays your PATH
17:55:14Nobabs27Well if it wasn't in my path I couldn't run nim -v ...
17:55:57Nobabs27I installed it using choosenim
17:56:17Nobabs27I added the export command to my .bashrc
17:57:24Nobabs27if I do echo $PATH it's actually this: /home/babs/.nimble/bin:/home/babs/.nvm/versions/node/v6.10.2/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
18:00:32*dddddd_ joined #nim
18:01:29*dddddd quit (Ping timeout: 240 seconds)
18:11:05*Trioxin quit (Read error: Connection reset by peer)
18:12:14*Trioxin joined #nim
18:13:13couven92Nobabs27, do `which nim` to confirm that it finds it in your PATH
18:13:59Nobabs27couven92: /home/babs/.nimble/bin/nim
18:14:45couven92have you closed and reopened VS code after you edited the .bashrc?
18:14:51*Trioxin2 joined #nim
18:14:57Nobabs27yes, I edited the .bashrc yesterday lol
18:16:38*Trioxin quit (Read error: Connection reset by peer)
18:17:19Nobabs27@ couven92 ^
18:19:47FromGitter<mratsim> Nobabs27, There was a very specific release of vscode-nim (in Feb-March though) where I had something similar.
18:20:16FromGitter<mratsim> https://github.com/pragmagic/vscode-nim/issues/46
18:20:17*Trioxin2 is now known as Trioxin
18:22:27*yglukhov joined #nim
18:26:46*yglukhov quit (Ping timeout: 255 seconds)
18:30:56*yglukhov joined #nim
18:31:17*krux02 quit (Remote host closed the connection)
18:35:11Nobabs27mratsim: I tried and ln -s that didnt fix it
18:39:17*yglukhov quit (Remote host closed the connection)
18:41:23*vlad1777d quit (Ping timeout: 272 seconds)
18:48:35*yglukhov joined #nim
19:00:19*pilne joined #nim
19:02:03*Sentreen quit (Ping timeout: 268 seconds)
19:02:52*yglukhov quit (Remote host closed the connection)
19:02:54*sz0 joined #nim
19:07:24*yglukhov joined #nim
19:11:44*yglukhov quit (Remote host closed the connection)
19:15:13*Sentreen joined #nim
19:26:52*Arrrr quit (Read error: Connection reset by peer)
19:27:34*Neomex joined #nim
19:28:09*Kingsquee joined #nim
19:31:14*Sentreen quit (Ping timeout: 245 seconds)
19:32:02*rauss quit (Quit: WeeChat 1.8)
19:32:08*Neomex quit (Read error: Connection reset by peer)
19:44:31*Sentreen joined #nim
19:52:54dom96Nobabs27: can you run 'nim' from the VS code command line?
19:53:16*yglukhov joined #nim
19:53:53*rokups quit (Quit: Connection closed for inactivity)
19:54:13Nobabs27dom96: yes I can
20:01:56*yglukhov quit (Remote host closed the connection)
20:02:51*yglukhov joined #nim
20:11:10*yglukhov quit (Remote host closed the connection)
20:16:33dom96Varriount: thanks for the PR merges/reviews :)
20:28:24*yglukhov joined #nim
20:29:20*Vladar quit (Quit: Leaving)
20:29:59*Kingsquee quit (Excess Flood)
20:31:51*Kingsquee joined #nim
20:35:16*Kingsqueee joined #nim
20:37:29*Kingsquee quit (Ping timeout: 245 seconds)
20:38:39*Kingsqueee quit (Excess Flood)
20:39:08*Kingsqueee joined #nim
20:54:29*Kingsqueee quit (Excess Flood)
20:54:58*Kingsqueee joined #nim
20:57:12*WhiskyRyan joined #nim
20:59:23*WhiskyRyan quit (Client Quit)
21:02:23*WhiskyRyan joined #nim
21:12:57FromGitter<Varriount> @dom96 Your welcome. I hope I didn't pull in anything too extreme
21:13:10FromGitter<Varriount> I generally don't touch anything that modifies the compiler source.
21:13:29*Matthias247 joined #nim
21:15:35*WhiskyRyan quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:19:31*WhiskyRyan joined #nim
21:23:23*skrylar ponders if functional reactive programming works in nim
21:23:28*WhiskyRyan quit (Client Quit)
21:24:22*WhiskyRyan joined #nim
21:24:45FromGitter<Varriount> skrylar: You mean like react?
21:25:36skrylarnot familiar with react
21:26:09skrylari donno. might not bother for a bit
21:26:15skrylarreading about FRP is neat but its like eeeeh wut
21:26:37skrylarhonestly it seems a bit like syntactic sugar on top of signals and slots
21:33:52*sz0 quit (Quit: Connection closed for inactivity)
21:39:16*Trioxin2 joined #nim
21:42:32*Sentreen quit (Ping timeout: 246 seconds)
21:43:05*Trioxin quit (Disconnected by services)
21:43:08*Trioxin2 is now known as Trioxin
21:44:57FromGitter<mratsim> I’ve dabbled a bit in React and React Native, it’s quite nice. Much more sane that jquery, if only we could kill CSS with fire ...
21:48:02FromGitter<mratsim> Can we transform an openarray to a varargs? I don’t know the size of the openarray
21:48:34FromGitter<mratsim> or just pass the openarray to a varargs proc
21:50:03*daaf joined #nim
21:50:06*couven92 quit (Quit: Client disconnecting)
21:54:47*dexterk_ joined #nim
21:55:08*dexterk quit (Ping timeout: 246 seconds)
21:56:06*Sentreen joined #nim
21:57:23FromGitter<Varriount> @mratsim Alas, no. You need to create two overloads
21:58:31*WhiskyRyan quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:00:24FromGitter<mratsim> It’s 4 overloads >_>, I want to pass a seq of slices to my []= macro but all the chain (5 functions/templates/macros) only takes varargs ewww
22:01:46FromGitter<Varriount> Template time
22:01:59*WhiskyRyan joined #nim
22:02:11FromGitter<Varriount> Make the functions take openarrays
22:02:24FromGitter<Varriount> @mratsim Can I see the code?
22:06:11FromGitter<mratsim> I can probably arrange the input to not need the full macro and use this `slicerMut`proc: https://github.com/mratsim/Arraymancer/blob/master/src/arraymancer/accessors_slicer.nim#L386
22:06:32skrylarhuh, wasn't there a function that ran the gc up to a set time limit
22:07:07skrylaroh. requires a flag.
22:08:26FromGitter<mratsim> @Varriount I hope to use `slicerMut` in a loop with a seq input generated during the loop
22:09:35FromGitter<mratsim> the end goal is to concatenate n tensor, I create an empty result shell and then I copy each tensors to the appropriate slice of the result
22:10:31FromGitter<Varriount> @mratsim The general technique is to create a template or generic procedure that contains the implementation, then use it in various overloads, converting where necessary
22:11:04PMunchPuh, just done with my IoT assignment
22:11:15PMunchI have to say, writing the server in Nim was a great choice!
22:12:58PMunchHowever I would have liked to see a better MySQL binding. Maybe something that can generate types based on a schema and then have automatic type conversion? But that would be hard to do with SQL..
22:15:08PMunchAnd I'm a bit concerned with security and Jester
22:17:28*Trustable quit (Remote host closed the connection)
22:18:38FromGitter<mratsim> @Varriount, Actually I’ve tested you can pass a seq to a varargs, not sure if feature or bug but I’m happy :P
22:23:23*chemist69 quit (Ping timeout: 260 seconds)
22:25:32*chemist69 joined #nim
22:35:01*bjz joined #nim
22:41:18*brson quit (Quit: leaving)
22:57:21*ftsf joined #nim
23:01:00*Matthias247 quit (Read error: Connection reset by peer)
23:01:27*skrylar quit (Remote host closed the connection)
23:02:06*brson joined #nim
23:02:59*brson quit (Client Quit)
23:03:15*brson joined #nim
23:07:56*brson quit (Client Quit)
23:13:36*WhiskyRyan quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:26:02*yglukhov quit (Remote host closed the connection)
23:35:44*yglukhov joined #nim
23:38:31*daaf quit (Ping timeout: 260 seconds)
23:39:48*yglukhov quit (Ping timeout: 240 seconds)
23:48:25*daaf joined #nim
23:49:04*daaf quit (Read error: Connection reset by peer)
23:49:18*daaf joined #nim
23:49:31*daaf quit (Remote host closed the connection)
23:53:46demi-i think i'm going to build a wrapper for the graphql c library this weekend; mainly so i can look at the new github APIs