<< 19-12-2018 >>

00:17:31PrimHeliosrayman22201: Thanks again! Just got it working and it's perfect :)
00:20:35*krux02 quit (Remote host closed the connection)
00:30:04*kinkinkijkin joined #nim
00:35:05FromGitter<rayman22201> awesome! glad I could help
00:39:20*rockcavera joined #nim
00:44:44*ghost64 quit (Read error: Connection reset by peer)
01:01:52*zachk quit (Quit: Leaving)
01:19:09*ghost64 joined #nim
01:19:36*abm quit (Ping timeout: 250 seconds)
01:23:22FromGitter<gogolxdong> How to use nimscript to ssh login?
01:23:47FromGitter<gogolxdong> exec "ssh [email protected] -p x"
01:24:13FromGitter<gogolxdong> comes to the password inputting step.
01:26:43*theelous3__ quit (Ping timeout: 268 seconds)
01:30:14*theelous3__ joined #nim
01:30:20FromGitter<sotrhRaven> How do you go about installing nim on Haiku?
01:32:58FromGitter<sotrhRaven> Never mind, I see it now. Version 0.19.0-1 is in HaikuDepot.
01:47:18PrimHeliosgogolxdong: I'd recommend using publickey login if possible. If not, you can call startProcess from the osproc module and use the inputHandle proc to get a file pointer to the process' stdin. https://nim-lang.org/docs/osproc.html#startProcess%2Cstring%2Cstring%2CopenArray[string]%2CStringTableRef%2Cset[ProcessOption]
01:47:37*rayman22201 quit (Ping timeout: 256 seconds)
01:50:39FromGitter<zetashift> pretty cool that Nim is on Haiku. I wanted to try it out in a VM for a while now. Wonder how much effort it took to port it over
01:50:41FromGitter<gogolxdong> thanks, I used that module, thought there is a easier way to do that with nims.
01:52:34PrimHeliosah, missed the nimscript part, my bad
01:53:57*Tyresc quit (Quit: WeeChat 2.3-dev)
01:54:40FromGitter<sotrhRaven> @zetashift I just tried it in a vm I had from the recent release. I kind of want to add a drive to my machine to install it on physical hardware.
01:56:37FromGitter<sotrhRaven> Just the hello world type example. but it works as expected. I like Haiku only I believe it would throw the family for a loop. Was hard enough when I switched to Linux on the main pc years ago.
02:01:49bozaloshtshhow come nre.toSeq now returns seq[Option[string]] instead of seq[string]?
02:03:25bozaloshtshthe commit is here: https://github.com/nim-lang/Nim/commit/c0a47f7e22039100123eea34a3cb2c956a9eb829 but I can't understand why it should return a list of Option[string]... would it ever be the case that some of them were present and some not?
02:04:12bozaloshtshoh, it's because nil string is the same as
02:04:12bozaloshtsh"
02:04:16bozaloshtsherr, empty string*
02:05:21FromGitter<gogolxdong> @PrimHelios open a file after getting a FileHandle, then write?
02:07:27*fthe quit (Ping timeout: 240 seconds)
02:09:06PrimHeliosgogolxdong: Yeah, I think this is the proc you want: https://nim-lang.org/docs/system.html#open%2CFile%2CFileHandle%2CFileMode
02:14:17FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c19a97941637902414fef94]
02:14:31FromGitter<gogolxdong> index out of bounds: (i:-1) <= (n:-1) [IndexError]
02:18:10FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c19aa624303512ab468d6de]
02:22:39bozaloshtshIf the nim compiler type checks the program but the C compiler throws an error, that's surely a bug right?
02:24:18bozaloshtshThe C compiler thinks that myFunction_mangled is of type `int` when in fact it's not.
02:24:28bozaloshtshs/is of type/returns/
02:29:15bozaloshtshOf course, I'm going to try to come up with a minimal reproducible example, but for the time being, here are the errors. I'd really appreciate any ideas for a workaround.
02:29:20bozaloshtshhttps://gist.github.com/sid-code/cb82b18d1d8b7bfd7fc45bcc02b989e3
02:45:54bozaloshtshwelp, back to master it is... this is a heisenbug.
02:46:07bozaloshtshhope whoever runs into it next is luckier than I am.
02:46:24*theelous3__ quit (Ping timeout: 244 seconds)
02:52:08bozaloshtshshould I still report the bug on GitHub if (a) I can't begin to understand why it happens and (b) I can't reproduce it outside of my project ?
03:00:26PrimHeliosI definitely would. It's a compiler bug, and a bug report, even if unreproducible, provides a record that it exists in case anyone runs into it in the future
03:02:48bozaloshtshPrimHelios: yeah, you're right. I don't even know what to title it outside of "compiler generates code with type error" :/
03:05:18PrimHeliosThat's probably good enough for now. You can always rename it if y'all find out more info about the bug
03:08:50*banc quit (Quit: Bye)
03:23:13*dddddd quit (Remote host closed the connection)
03:24:54*banc joined #nim
03:32:32FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c19bbcff40433141931eb14]
03:32:54FromGitter<gogolxdong> this is not interactive
03:33:27FromGitter<gogolxdong> http://ix.io/1wlJ
03:52:02*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
04:28:16*kapil____ joined #nim
04:51:15bozaloshtshgogolxdong: you want the ssh process to take input from stdin?
04:54:53*endragor joined #nim
04:56:41*nsf joined #nim
05:41:58*narimiran joined #nim
05:48:54FromGitter<gogolxdong> yes
05:57:18*plushie quit (Quit: plushie)
06:03:59FromGitter<gogolxdong> Is LockFreeHash.nim usable? proc set[K,V] overlays with identifier set.
06:04:14FromGitter<gogolxdong> overlaps
06:06:41FromGitter<gogolxdong> LockFreeHash.nim(169, 27) Error: undeclared identifier: 'atomic_load_n'
06:07:50FromGitter<gogolxdong> Is LockFreeHash usable?
06:27:45FromGitter<gogolxdong> http://ix.io/1wlP
06:28:15FromGitter<gogolxdong> cannot get Process interactive
06:44:52FromGitter<xmonader> @gogolxdong just do ssh credentials info 'CMD_TO_EXECUTE' other than that it'd be pretty messy, otherwise you will need a pty .. here's what you will be doing if going with the handling file descriptors https://github.com/xmonader/expectless/blob/master/expect.py
06:49:40FromGitter<AchalaSB> How to call byte32 address in Nim? How to declare it?
06:54:02FromGitter<AchalaSB> Can I upload any kind of files here? ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Is this `data["uploaded_file"] = ("test.html", "text/html", ... [https://gitter.im/nim-lang/Nim?at=5c19eb0ab4ef82024856f40d]
06:56:30leorizeyes, it's required. How are you going POST data without data?
06:57:15*narimiran quit (Ping timeout: 268 seconds)
06:57:30FromGitter<AchalaSB> what is structre for upload `.png` file?
06:57:48Araqgogolxdong: lockfreehash is abandoned
06:59:09FromGitter<gogolxdong> https://github.com/cheatfate/asynctools
06:59:14FromGitter<gogolxdong> ok
07:01:54FromGitter<gogolxdong> said there is asyncpty, might be helpful, also find a nimssh2 wrapper
07:03:52Araqnimble search ssh2
07:05:13FromGitter<gogolxdong> sure, have got one. It should be found, my bad.
07:05:44*krux02 joined #nim
07:13:02FromGitter<xmonader> @AchalaSB don't you just base64 encode it in your form?
07:15:22krux02http://ix.io/1wlW
08:17:10*kapil____ quit (Quit: Connection closed for inactivity)
08:23:02*kapil____ joined #nim
08:29:32*nc-x joined #nim
08:32:07*lritter joined #nim
08:32:35nc-xAraq: if you have time can you please review my PR's https://github.com/nim-lang/Nim/pulls/nc-x this week? Next week I have holidays so I would like to fix the PR's then if there are any problems
08:33:41*nc-x quit (Client Quit)
09:07:39*floppydh joined #nim
09:10:04*stefanos82 joined #nim
09:11:53FromGitter<gogolxdong> @shashlick , how to convert the ssh2.c file under libssh2/example?
09:13:51FromGitter<gogolxdong> need some changes for nimssh2.cfg file?
09:14:03*whaletechho quit (Quit: ha det bra)
09:16:39*ftsf joined #nim
09:20:56*abm joined #nim
09:21:59*PMunch joined #nim
09:29:01FromGitter<mratsim> @alehander42 I’ve updated the text generator to ignore unknown tokens, and added another example with training on Pride and Prejudice. https://github.com/mratsim/Arraymancer/blob/master/examples/ex06_shakespeare_generator.nim ⏎ ⏎ @Vindaar I really need to save NN models, i.e. dozens of tensors. Think nimhdf5 is up for it? ⏎ ⏎ While protobuf is quite popular (and Pickle :/) and probably needed for ONNX and
09:29:01FromGitter... interoperability. I think the Nim ecosystem is a bit messy at the moment. [https://gitter.im/nim-lang/Nim?at=5c1a0f5d9f431114186413c4]
09:32:11FromGitter<alehander42> ah char-rnn, I remember I was trying to reuse some kind of lua or python implementation of it years ago
09:32:28FromGitter<timotheecour> @mratsim ya, protobuf would be a good fit
09:34:20FromGitter<xmonader> what is the idiomatic way for developing plugins? something like go plugin https://golang.org/pkg/plugin/ ?
09:34:27FromGitter<alehander42> so is it actually working on char, or on token level?
09:35:10FromGitter<mratsim> yes, char by char: https://github.com/mratsim/Arraymancer/blob/master/examples/ex06_shakespeare_generator.nim#L32
09:35:48FromGitter<mratsim> @timotheecour, I read up on ONNX spec, I will add it but probably with a custom parser/serializer so later on :P
09:36:00FromGitter<alehander42> nice, does it only work on a cpu tho
09:36:07FromGitter<mratsim> hdf5 is already there in Arraymancer, + this would allow loading Keras models
09:36:44FromGitter<mratsim> at the moment yes. I still need to add deep learning on Cuda OpenCL.
09:37:08FromGitter<timotheecour> question related to that: is there a way to write Nim and output coda/opencl ?
09:37:31FromGitter<mratsim> but next steps is to remove all those deprecated warning, rebuild docs, release a new version before breaking the backend in a non-backward compatible way
09:37:54FromGitter<timotheecour> (btw, very cool you release that RNN demo, will look at it when I get to it)
09:37:56FromGitter<mratsim> @timotheecour there was a summer of code for that in 2015, 2014? but no one took up the challenge
09:38:18FromGitter<mratsim> https://github.com/nim-lang/Nim/wiki/GSoC-2015-Ideas
09:38:35FromGitter<mratsim> and 2016: https://github.com/nim-lang/Nim/wiki/GSoC-2016-Ideas
09:38:39FromGitter<timotheecour> so there’s nothing at all in the space of cuda/opencl from nim ? Awww :( what would be best option?
09:38:52FromGitter<mratsim> Actually there is
09:39:02FromGitter<mratsim> but I don’t understand what is happening: https://github.com/jcosborn/cudanim
09:39:31FromGitter<mratsim> it’s like 200 lines of macros to do this: https://github.com/jcosborn/cudanim/blob/master/demo1/ex1.nim#L28-L31
09:39:45FromGitter<mratsim> awesome proof of concept but I can’t debug it :P
09:39:46FromGitter<alehander42> is this relevant https://twitter.com/NimTorch/status/1052077869168451584
09:39:54FromGitter<alehander42> i remember the tweet, but no idea if it means the same
09:40:38FromGitter<mratsim> I’m using those inline templates: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/private/incl_kernels_cuda.nim
09:40:56FromGitter<mratsim> and call them like this: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/private/p_kernels_interface_cuda.nim
09:41:11FromGitter<mratsim> and for opencl: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/private/p_kernels_interface_opencl.nim
09:41:41FromGitter<Vindaar> @mratsim In principle certainly. I store all my data using nimhdf5 (~15 GB files) and it works fine. The library has some problems and the code is ugly in parts (thanks to me learning Nim, first time writing a "high level interface" for a library and learning HDF5 internals).
09:42:14FromGitter<Vindaar> With the different use case maybe probably new bugs will appear, but I'll be there to fix them :)
09:42:53FromGitter<timotheecour> @mratsim thanks for the links! curious whether https://twitter.com/NimTorch/status/1052077869168451584 uses those ugly emit’s or something cleaner
09:43:25FromGitter<mratsim> cudaGlobal, pretty sure it comes from cudanim
09:43:53FromGitter<timotheecour> (seems like the right level of abstraction also, flexible + simple enough to use)
09:43:54FromGitter<mratsim> I plan to rework that as well with Laser.
09:44:17*Calinou quit (Remote host closed the connection)
09:44:43FromGitter<mratsim> Basically the pragma will go over the nim AST and strip everything: https://github.com/jcosborn/cudanim/blob/master/inline.nim
09:44:48FromGitter<timotheecour> so would that allow writing, say, inference in deep net in Nim such that the entire inference runs in GPU?
09:45:25FromGitter<mratsim> have to check, I checked that code when I was 4 months into Nim and didn’t write a single macro so I didn’t understand a quarter of what was going on
09:45:41FromGitter<timotheecour> (avoiding cpu <=> gpu within a batch which would slow things down a lot)
09:45:42*Calinou joined #nim
09:46:26FromGitter<mratsim> I think the hardest part is to generate GPU code, once that’s done, avoiding data mocement is easy since you just pass pointers to GPU mem
09:46:47FromGitter<timotheecour> mocement ?
09:46:51FromGitter<timotheecour> movement, ok
09:46:52FromGitter<mratsim> movement
09:47:27FromGitter<timotheecour> your shakespear demo should get a nice speedup with that
09:47:45FromGitter<timotheecour> btw have u played w running it on AWS or google compute engine ?
09:48:02FromGitter<mratsim> yes, I want to make it easy to go use it in prod
09:48:16FromGitter<mratsim> The shakespeare demo is slow for various reason.
09:48:33FromGitter<mratsim> 1) I don’t use OpenMP, I have a false sharing issue, either in my GRU or embedding layer
09:49:24FromGitter<mratsim> 1) max is slow: https://github.com/nim-lang/Nim/issues/9514
09:49:41FromGitter<mratsim> (actually even the SIMD max is slow in my benchmark but it’s still faster
09:49:59FromGitter<timotheecour> a friend of mine (yaroslav bulatov) wrote some tools to facilitate training models on AWS (using distributed training on X machines) ; he obtained the fastest training of imaginet and open sourced it
09:50:08FromGitter<timotheecour> maybe some insight could be reused?
09:50:16FromGitter<mratsim> 1) exp and log from <math.h> could be improved 10x: https://github.com/numforge/laser/blob/master/benchmarks/vector_math/bench_exp_avx2.nim
09:50:35FromGitter<mratsim> Was he a fast.ai student?
09:51:33FromGitter<mratsim> direct link to benches: https://github.com/numforge/laser/blob/master/benchmarks/vector_math/bench_exp_avx2.nim#L256-L295 math.h 160M exponentials per second and with math 1.3G exponentials
09:51:41FromGitter<mratsim> fmath*
09:52:00FromGitter<timotheecour> > max is slow ⏎ that one can be fixed with a patched nim that does inline or a locally redifined max, no?
09:52:36FromGitter<mratsim> I need to redefine it, the compiler only vectorize is into vmaxss with -march=native and -ffast-math
09:52:37FromGitter<timotheecour> No, he worked at openai and google before
09:53:49FromGitter<mratsim> and lastly, for GRU I need to iterate on 4 tensors at the same time. Since I only implemented up to map3/apply3 I have to use temporaries
09:54:18FromGitter<timotheecour> are these performance issues (log, max, exp etc) relevant in any way if/when we move to GPU?
09:54:22FromGitter<mratsim> and I’m pretty sure exp/log/tanh in such loops are not vectorised. THis should be addressed in Laser: https://github.com/numforge/laser#loop-fusion-and-strided-iterators-for-matrix-and-tensors
09:54:26FromGitter<mratsim> nop
09:54:52FromGitter<mratsim> not sure about OpenCL but for Cuda and AMD Hip it’s not relevant.
09:55:06FromGitter<mratsim> unless Nvidia has poor implementation of exp/log/max
09:55:37FromGitter<timotheecour> the performance gains one would get form gpu would likely dwarf these improvements (not saying these shouldn’t improve, I guess it’s nice for debugging locally without using a GPU)
09:56:44FromGitter<mratsim> I still like to have a very efficient processing on CPU. I don’t remembr which article, probably someone complaining about Amazon prices that says that CPU processing is still cheaper. (though certainly not for research)
09:57:06FromGitter<timotheecour> 1 area where GPU could be slower compared to CPU is sequential algorithms, eg matrix inverse, or certain linear algebra routines that dont’ parallelize well
09:57:33FromGitter<mratsim> and on many small devices CPU is best.
09:57:37FromGitter<timotheecour> right, debugging is a good use case anyway
09:58:53FromGitter<timotheecour> btw, do u know any nim stuff in the space of distributed / cloud computing? eg, mapreduce on N machines
09:59:43krux02timotheecour: The most popular framework in general that I know is MPI
09:59:49krux02it is for fortran and C/C++
10:00:07krux02I don't know how well it works with Nim
10:00:19krux02but with some effort, it should be possible to use
10:00:22FromGitter<mratsim> I don’t think there are any, though @bluenote10 compared NimData to distributed workflow in his repo
10:00:38FromGitter<mratsim> easiest would probably be to wrap something like Nvidia RAPIDS: https://rapids.ai/community.html
10:01:15FromGitter<mratsim> see: https://github.com/bluenote10/nimdata#basic-operations-small-data
10:02:26krux02from what I learned GPU accelerated computing is the cheapest in €/flop
10:02:28FromGitter<timotheecour> > NimData is currently non-distributed ⏎ ⏎ (from https://github.com/bluenote10/nimdata#basic-operations-small-data)
10:02:56krux02but very expensive in power consumption flop/W
10:03:28krux02MPI is distributed and low level
10:03:31FromGitter<mratsim> @krux02 it really depends. For research that’s for sure because you save on the researcher time, but for 24/7 computing there was some analysis on Google TPUs that showed that a similarly powerful CPU array was cheaper
10:04:02FromGitter<timotheecour> ya i’m skeptical about cpu being cheaper per unit of work, probably depends on problem domain though.
10:04:06FromGitter<alehander42> but who does 24/7 training
10:04:14FromGitter<mratsim> not training
10:04:17FromGitter<mratsim> serving models
10:04:27FromGitter<alehander42> but isn't serving way less computationally taxing
10:04:34FromGitter<mratsim> yes
10:04:36FromGitter<alehander42> ugh, running
10:04:51FromGitter<mratsim> I’ll find the article
10:05:07FromGitter<alehander42> so can one train models on the gpu which can be ran on a cpu
10:05:33FromGitter<mratsim> that’s what is done yeah. Intel even has an “inference” stick dedicated to running pretrained model
10:05:48FromGitter<mratsim> and Apple “strategy” in ML is also that. Just serving the models
10:06:12FromGitter<alehander42> I see
10:06:39FromGitter<mratsim> @timotheecour @alehander42 I think it was this article: https://minimaxir.com/2017/07/cpu-or-gpu/
10:07:00krux02while everybody is hyped about AI, I still try to improve data visualization to train the neural network behind my eyes.
10:07:24FromGitter<mratsim> Can we distribute krux02 to the cloud though? ;)
10:07:27*MyMind quit (Ping timeout: 240 seconds)
10:07:33*Pisuke joined #nim
10:07:37krux02but output speed through a keyword isn't very fast
10:07:55krux02nope, I don't distribute
10:08:16krux02and I only work for myself or when I get payed directly.
10:09:30krux02But I think it is much more valuable to me, when my neural network is trained rather than an artificial neural networ on some computer that I don't own.
10:11:11FromGitter<mratsim> arraymancer can run on your computer
10:11:38krux02still, but the training effect is unavaiable as soon as the computer is turned off.
10:11:58FromGitter<mratsim> same thing when you sleep
10:12:08krux02not really
10:15:00krux02the only problem is, the neural network never stops training and it might drop important information
10:16:37FromGitter<mratsim> you can stop training it and even keep multiple version around.
10:17:15FromGitter<mratsim> When we do ML we version our models just in case a modification we do introduces some regression
10:17:43FromGitter<mratsim> and during training we also do “chackpointing” in case further training worsen the results
10:17:47FromGitter<mratsim> checkpointing*
10:18:16FromGitter<alehander42> I think krux02's neural network never stops
10:18:37FromGitter<alehander42> but I'd love if he versions himself .. think about it where is krux03
10:20:01FromGitter<timotheecour> that would be nice
10:24:37*rockcavera quit (Remote host closed the connection)
10:35:59*dddddd joined #nim
11:05:12*synthmeat joined #nim
11:18:18*theelous3 joined #nim
11:37:33*theelous3__ joined #nim
12:10:29FromGitter<xmonader> I got a very weird message during build ⏎ https://pastebin.com/yxqqi0L9 ⏎ ⏎ ``` ... Error: invocation of external compiler program failed. Cannot allocate memory 12``` [https://gitter.im/nim-lang/Nim?at=5c1a3534b8760c21bbf14c33]
12:10:31*theelous3 quit (Ping timeout: 268 seconds)
12:13:40*theelous3 joined #nim
12:21:42Araqxmonader: use a swap partition?
12:27:14FromGitter<xmonader> yup
12:27:31FromGitter<xmonader> when i ran the build process again it worked, but no idea why that happened in the first place?
12:27:51FromGitter<xmonader> is it something local to my machine or something can happen randomly?
12:28:11FromGitter<xmonader> ^ i'm working on a 9 years old laptop atm
12:30:24*odc quit (Ping timeout: 250 seconds)
12:32:34*nc-x joined #nim
12:32:53*odc joined #nim
12:34:48nc-x@dom96: Regarding https://github.com/nim-lang/Nim/pull/9981, what should I write in the TODO? Because I don't see those magic typed/untyped procs going away from system.nim/stdlib any time soon.
12:35:26dom96Why not?
12:37:19nc-xHow will those procs be implemented then? AFAIK magics don't work with macros/templates.
12:37:51Araq^ we can introduce .magic templates
12:38:00Araqbut I dunno how much work it would be
12:42:13nc-xOkay I added the todo
12:44:39dom96also, in the future, it would be nice to explain in the code why the code is disabled for stdlib
12:45:49dom96(if you ever create a similar PR/change)
12:46:22nc-xOkay
12:47:05*nc-x quit (Quit: Page closed)
12:58:11*nsf quit (Quit: WeeChat 2.3)
13:03:09FromGitter<alehander42> Araq, can I test many compiler err-msgs in the same file somehow
13:03:28*Vladar joined #nim
13:04:48*fthe joined #nim
13:16:49*fthe quit (Ping timeout: 250 seconds)
13:25:00*Snircle joined #nim
13:27:35krux02nc-x: nice work on the typed/untyped on procs.
13:34:08*nc-x joined #nim
13:34:18nc-xkrux02: Thank you!
13:36:12krux02I wanted to implement it as well, but then got stuck on it, did something else and then forgot about it.
13:52:23*nc-x quit (Ping timeout: 256 seconds)
13:57:08*endragor quit (Remote host closed the connection)
13:57:37*endragor joined #nim
14:02:16*endragor quit (Ping timeout: 250 seconds)
14:03:59Araqalehander42: yes, use a cmd: "nim check $file" nimout: '''stuff here'''
14:46:07*lritter quit (Ping timeout: 244 seconds)
15:02:56*ftsf quit (Ping timeout: 250 seconds)
15:16:27*theelous3 quit (Ping timeout: 240 seconds)
15:20:14*omgbbq joined #nim
15:20:23omgbbqHeavenO
15:20:45omgbbqIt it possible to have tables within tables?
15:21:49Araqcertainly
15:24:09FromGitter<mratsim> @timotheecour re distributed computing, maybe you can use nimpy for https://github.com/ray-project/ray/ (apparently it’s use as a backend for https://github.com/modin-project/modin)
15:24:36omgbbqThanks Araq
15:38:25omgbbqI'm a little daft. Shouldn't something like thing work?
15:38:26omgbbqvar a = initTable["label", Table]()
15:38:49FromGitter<mratsim> label should be a type not a string
15:39:19FromGitter<mratsim> `initTablestring, Table[int, string ()` for example
15:39:59*levix joined #nim
15:40:40omgbbqAha! Thank you very much FromGitter
15:41:04FromGitter<mratsim> FromGitter is a relay bot ;)
15:41:29omgbbqArigato mr roboto
15:41:58omgbbqor thankyou mratsim ;)
15:53:22omgbbqGot it to work!
15:55:02*levix quit (Remote host closed the connection)
15:56:56FromDiscord_<Diogo> Hi everyone! I'm new to Nim, can you tell me if it's possible to built multiple "modules" each as a single dlls and some modules uses other modules? Like including headers in C++ for each dll. I'm building a game and want it to be very modular to be easy to build mods later on.
15:57:11FromDiscord_<Diogo> Hi everyone! I'm new to Nim, can you tell me if it's possible to build multiple "modules" each as a single dlls and some modules uses other modules? Like including headers in C++ for each dll. I'm building a game and want it to be very modular to be easy to build mods later on.
15:57:42*omgbbq quit (Quit: Page closed)
15:58:50*nsf joined #nim
16:03:46PMunch@Diogo, in theory yes. But there are some issues with the GC and DLLs at the moment
16:04:12PMunchLoading non-GC DLLs works just fine though
16:05:29*PMunch quit (Remote host closed the connection)
16:05:55FromDiscord_<Diogo> I see, the GC (and standard libraries?) would be present in all dll's?
16:08:46*Trustable joined #nim
16:09:06FromGitter<mratsim> you can strip the gc
16:09:32FromGitter<mratsim> unused proc/types are not imported, only system.nim is in by default
16:09:46FromGitter<mratsim> https://nim-lang.org/docs/system.html
16:10:13FromGitter<mratsim> compile with gc:none and nim will warn you when you want to use the gc
16:10:48FromGitter<mratsim> but mostly the issue is that you need to call “nimMain” when loading a nim lib.
16:11:32FromGitter<mratsim> when linking to multiple nim libs you would have a conflict, so better have one nim interface that imports all the nim modules.
16:12:14FromGitter<mratsim> alternatively gc:destructors (experimental) will replace strungs and seqs with non-gc’ed version
16:13:25FromGitter<mratsim> otherwise if your pure nim, plenty of game devs are fine with at ost tuning the max pause allowed by the gc
16:13:35FromGitter<mratsim> you're
16:13:35*narimiran joined #nim
16:13:41FromGitter<mratsim> at most*
16:15:07FromDiscord_<Diogo> ok, thank you. But regarding types that are an the main game, like a GameObject, the "mod" will have to include it, is there a way to tell the compiler to not copy the code and to just expect the code to be there?
16:17:59FromDiscord_<Diogo> or is it ok to have duplicated code?
16:18:37FromDiscord_<Diogo> it's probably not a problem I guess, it's going to be the same version
16:19:24FromGitter<mratsim> you can have the compiler produce a header
16:19:34*kinkinkijkin quit (Remote host closed the connection)
16:19:39FromDiscord_<Diogo> oh
16:19:47FromDiscord_<Diogo> ok, thank you 😃
16:19:52FromGitter<mratsim> https://nim-lang.org/docs/backends.html#backend-code-calling-nim-nim-invocation-example-from-c
16:21:01AraqPMunch: I need something reproducible in order to fix the DLL issues
16:21:22Araqas I said, the test suite covers it, it's green, it uses the GC and the GC does collect stuff without crashing
16:21:45FromGitter<mratsim> even importing multiple nim dlls in the same project?
16:21:51FromGitter<mratsim> no nimMain conflicts?
16:22:17Araqthe nimrtl.dll contains the GC, other DLLs don't
16:22:48*endragor joined #nim
16:22:50Araqbut the test only has a "client" and a "server", so maybe we need to expand it
16:24:51FromDiscord_<Diogo> Just to be clear, the header is to invoke nim from C, and not Nim from one dll to Nim in other, right? that would mean if I needed classes from the Game in Mod1, Mod1 would export everything from Mod1 and Game to Dll1 ?
16:27:04*endragor quit (Ping timeout: 246 seconds)
16:30:16FromDiscord_<Diogo> therefore (in case I did not misunderstand that) my question is, is there a way to exclude the Game code, during compilation and use the generated headers only? (that would mean the C code would not have the all the Game code, only the headers)
16:30:46FromDiscord_<Diogo> therefore (in case I did not misunderstand that) my question is, is there a way to exclude the Game code, during compilation and use the generated headers only? (that would mean the resulting C code would not have the all the Game code, only the headers)
16:39:57FromDiscord_<Diogo> therefore (in case I did not misunderstand that) my question is, is there a way to exclude the Game code, during compilation and use the generated headers only? (that would mean the resulting C code would not have all the Game code, only the headers)
16:42:42FromGitter<mratsim> I’m not sure, I didn’t play much with Nim DLL/FFI.
16:43:51*whaletechho joined #nim
16:45:50FromGitter<alehander42> Diogo, btw, if you're changing your message, please try to just add a new one with `fixed words and stuff*` , because in gitter/irc we receive the whole message again
16:46:30leorizeDiogo: so, you mean you want the game to be it's own library instead?
16:47:35FromDiscord_<Diogo> @mratsim Ok, but thank you for the help!
16:48:12FromDiscord_<Diogo> @alehander42 you are right, sorry, I will do that next time
16:51:19FromDiscord_<Diogo> @leorize I want to have the game I develop to be a normal executable, but each game mod produced by other people that will potentially add other functionality will be a dll
16:52:37FromDiscord_<Diogo> and I will load each of them and then start the game
16:59:44*vlad1777d joined #nim
17:04:53*abm quit (Quit: Leaving)
17:25:12*d10n-work joined #nim
17:53:00FromGitter<mratsim> @Diogo if something is possible in C, it’s possible in Nim ;)
17:56:30*plushie joined #nim
17:56:34ZevvFor the AoC players on #nim, I learned macros today, please admire my solution: https://github.com/zevv/aoc2018/blob/master/a19c.nim
18:05:41FromDiscord_<Diogo> @mratsim I really like Nim! The optional GC and the possibility of configuring the GC max pause makes it awesome for game dev. I will keep on learning and try to do what I need, thanks 😃
18:08:49ZevvIs there a way to represent a NimNode as human readable and indentet Nim code? treeRepr and lispRepr are both not quite what I'm looking for
18:10:20*crem quit (Read error: Connection reset by peer)
18:10:48*crem joined #nim
18:12:37*Trustable quit (Remote host closed the connection)
18:17:54FromGitter<mratsim> @Zevv `toStrLit`
18:18:47leorizeZevv: `repr` is your friend
18:18:48FromGitter<mratsim> elven code looks lembler
18:19:00FromGitter<mratsim> looks like assembler
18:19:11FromGitter<mratsim> repr doesn’t work on NimNode, you need treerepr
18:19:28leorizeit does for me, it actually print out the Nim code
18:19:33FromGitter<mratsim> but toStrLit generates Nim code that you can copy paste
18:19:36leorizelooks horrible w the gensym symbols though
18:19:42Zevvleorize: well look at that, thanks for pointing out
18:19:55Zevvworks like a charm
18:19:56FromGitter<mratsim> oh, repr never worked for me :P
18:20:06leorizemust have been a new thing then :P
18:20:19FromGitter<mratsim> I’ve always used toStrLit
18:20:48Zevvah toStrLit also works, and is actually in the documentation
18:21:04ZevvI was looking for a somethingRepr() function
18:21:23*narimiran quit (Ping timeout: 246 seconds)
18:21:25leorizewell, `repr` is supposed to be the universal debugging tool :)
18:21:55FromGitter<mratsim> repeat after me 100 times `echo is not a debugger`
18:21:59Zevvyes, but I expected (wrong) that it would a lot of brackets and nested stuff
18:22:17Zevvfor i in 1..100: echo "echo is a great debugger"
18:25:00leorize`echo` is the best debugger
18:25:19leorize!eval for _ in 1..100: echo "echo is the best debugger"
18:25:21NimBotecho is the best debugger↵echo is the best debugger↵echo is the best debugger↵echo is the best debugger↵echo is the best debugger↵echo is the best debugger↵echo is the best debugger↵echo is the best debugger↵echo is the best debugger↵echo is the best debugger↵echo is the best debugger↵echo is the best debugger↵echo is the best debugger↵echo is the best debugger↵echo is the best debugger↵echo is the best debugger↵ech...
18:41:06*NimBot joined #nim
18:47:17*kinkinkijkin joined #nim
18:59:36*zachk joined #nim
19:01:35*zachk quit (Read error: Connection reset by peer)
19:02:07*zachk joined #nim
19:02:27*zachk quit (Changing host)
19:02:28*zachk joined #nim
19:24:59FromGitter<alehander42> Echo is an ok debugger
19:25:31FromGitter<alehander42> Far from the best possible debugger
19:43:54*McSoFake joined #nim
19:50:05*floppydh quit (Quit: WeeChat 2.3)
19:50:51*Perkol joined #nim
20:02:05Araqyuriy: nim cpp -r tests\async\tasynctry.nim fails
20:02:13AraqI wonder if you know why
20:20:37*nsf quit (Quit: WeeChat 2.3)
20:24:11*Tyresc joined #nim
20:51:13*narimiran joined #nim
20:51:44*narimiran quit (Remote host closed the connection)
20:54:37*Perkol quit (Remote host closed the connection)
21:03:57*Vladar quit (Remote host closed the connection)
21:17:11*kapil____ quit (Quit: Connection closed for inactivity)
21:32:52ZevvI have a SIGSEGV in the compiler that goes away with -d:obj_check:off, how I debug this?
21:42:52FromGitter<mratsim> ../Nim/koch temp c --debugger:native build/yourfile.nim
21:43:14FromGitter<mratsim> assuming Nim directory is at the same level as your working directory
21:43:23FromGitter<mratsim> you need to git clone Nim repo
21:44:22ZevvI have that, let me try
21:50:56ZevvError: unhandled exception: sym is not accessible [FieldError]
21:52:10FromGitter<mratsim> sounds fun :P, if you have a repro code open an issue on Github
21:52:52Zevvyeah there's even more happening: compiling the same file sometimes crashes and sometimes doesnt
21:53:24Zevvbut only if I pass -d:obj_check:off
21:54:45FromGitter<deech> Further findings on the recent `Showstopper` bug: https://github.com/nim-lang/Nim/issues/10033.
22:02:23ZevvWell, shoot. It depends where my source file is located, compiling in one directory crashes the compiler, in another there is no problem
22:02:26Zevvstrace to the rescue
22:05:34Zevvcompiles fine when run under strace, crashes without
22:13:19ZevvI now have two strace -f outputs of the exact same command, one failing and one working
22:14:19ZevvThe last thing happening is lstat("/home/ico/external/Nim/lib/core/macros.nim", {st_mode=S_IFREG|0644, st_size=52647, ...}) = 0
22:19:52FromGitter<mratsim> heisenbug
22:20:07*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
22:23:15*vlad1777d quit (Ping timeout: 250 seconds)
22:34:06*whaletechho quit (Remote host closed the connection)
22:36:35*whaletechho joined #nim
23:01:52*theelous3__ quit (Ping timeout: 246 seconds)
23:04:07*fthe joined #nim
23:15:03*fthe quit (Ping timeout: 246 seconds)
23:20:06*fthe joined #nim
23:35:42*McSoFake quit (Read error: Connection reset by peer)
23:37:59*stefanos82 quit (Remote host closed the connection)
23:51:35bozaloshtshHere be a regression: b1ad5fd7d
23:51:38bozaloshtshhttps://github.com/nim-lang/Nim/commit/b1ad5fd7da0d5b93b260ddd62f98f7331cc801fb
23:52:27bozaloshtshwith sufficiently complicated recursive dependencies, this commit causes bad codegen
23:52:51bozaloshtshrecursive dependencies + forward declarations to band-aid the real problems in my code :/