<< 05-05-2018 >>

00:00:30*jrbrt quit (Quit: jrbrt)
00:04:05*pigmej quit (Ping timeout: 276 seconds)
00:30:59*xkapastel quit (Quit: Connection closed for inactivity)
00:31:06*pigmej joined #nim
00:44:23*pigmej quit (Ping timeout: 276 seconds)
00:44:30*pigmej joined #nim
00:49:24*pigmej quit (Ping timeout: 255 seconds)
00:52:18*vegax87 joined #nim
00:55:02*pigmej joined #nim
00:59:49*vegax87 quit (Ping timeout: 265 seconds)
01:01:33*pigmej quit (Ping timeout: 255 seconds)
01:04:09*pigmej joined #nim
01:04:35*noonien quit (Quit: Connection closed for inactivity)
01:18:40*darithorn joined #nim
01:20:10*MyMind joined #nim
01:22:27*Sembei quit (Ping timeout: 256 seconds)
01:24:01*MyMind quit (Max SendQ exceeded)
01:24:28*yglukhov joined #nim
01:24:34*vegax87 joined #nim
01:25:17*MyMind joined #nim
01:30:14*Pisuke joined #nim
01:30:21*yglukhov quit (Ping timeout: 264 seconds)
01:31:04*MyMind quit (Ping timeout: 260 seconds)
01:55:37*dddddd quit (Remote host closed the connection)
02:00:32FromGitter<gogolxdong> @PMunch How to make your protobuf-nim work with js?
02:02:06*xkapastel joined #nim
02:03:45FromGitter<gogolxdong> I have serialized protobuf data transfered through websocket with adjusting the data size to frontend which protobuf.js library doesn't work.
02:09:40*Sembei joined #nim
02:11:45*Pisuke quit (Ping timeout: 256 seconds)
02:12:08FromGitter<arnetheduck> Araq, reading is the main reason you want an autoformatter to begin with, people suck at writing visually beautiful code and keep arguing over it in reviews and elsewhere.. from a personal laziness perspective however, it's *so nice* to just type carelessly and let the formatter deal with everything
02:17:46FromGitter<gogolxdong> Does nim js means defined(js)?
02:28:44FromGitter<citycide> is there an equivalent to `varargs[string, `$`]` but for only a single argument?
02:30:40FromGitter<citycide> I tried `proc fn [T] (arg: T)` and then using `$` in the body but that didn't seem to work
02:42:58FromGitter<citycide> actually specifically I'm trying to overload `[]=` for a type. does `[]=` not allow anything but strings on the RHS or something? this small example fails: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5aed1a3259a0578004a70f65]
03:27:32*CodeVance quit (Quit: Leaving)
03:28:07*CodeVance joined #nim
03:32:32*CodeVance quit (Client Quit)
03:32:39*CodeVance2 joined #nim
03:32:39*CodeVance2 is now known as CodeVance
03:56:00*darithorn quit (Remote host closed the connection)
04:07:03FromGitter<citycide> ^ ah, I figured it out, as always it was user error 😆 ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5aed2de76d98e53e04533659]
04:26:01*max3 quit (Quit: Connection closed for inactivity)
04:45:13*miran joined #nim
05:10:41FromGitter<Varriount> @citycide You can also use a concept to further restrict the generic type.
05:45:33*Trustable joined #nim
05:55:25*arecaceae quit (Remote host closed the connection)
05:55:49*arecaceae joined #nim
06:03:04*CodeVance quit (Quit: Leaving)
06:11:16*gangstacat quit (Quit: Ĝis!)
06:18:56*gangstacat joined #nim
06:29:29*nsf joined #nim
06:50:33*rokups joined #nim
06:56:28*sz0 quit (Quit: Connection closed for inactivity)
06:59:01*rockcavera quit (Remote host closed the connection)
07:01:31*rockcavera joined #nim
07:27:29*rockcavera quit (Read error: Connection reset by peer)
07:28:01*rockcavera joined #nim
07:28:01*rockcavera quit (Changing host)
07:28:01*rockcavera joined #nim
07:42:24*rockcavera quit (Remote host closed the connection)
07:44:56*rockcavera joined #nim
07:49:18*Vladar joined #nim
07:50:52*rockcavera quit (Remote host closed the connection)
07:53:01*rockcavera joined #nim
08:28:49FromGitter<mratsim> I’m trying to release a new version of Arraymancer and now comes the dreaded time of documentation. I don’t suppose there is still a Sphinx-like documentation generator in Nim now (using Karax of something else).
08:54:45*jjido joined #nim
08:55:50*jjido quit (Client Quit)
09:25:39*leorize joined #nim
09:56:31FromGitter<alehander42> you can still use sphinx tho? (I thought it's fine for all pygment-supported langs)
09:59:34FromGitter<mratsim> Yes there is a way, but there are a lots of things to configure to get sphinx working iirc
10:00:18FromGitter<mratsim> My OpenCL doesn’t compile anymore on devel due to =destroy signature change :/
10:06:06Araqsignature change?
10:07:26FromGitter<mratsim> Or I think it’s the {.experimental.} change
10:07:53FromGitter<mratsim> previously there was an experimental destroy that worked on pointer
10:08:02FromGitter<mratsim> and the newruntime destroy that only worked on object
10:10:28FromGitter<mratsim> here you go: https://gist.github.com/mratsim/7f7ecf3cfc2be0f59f9075baf5d051a4
10:12:30FromGitter<alehander42> btw @mratsim I am going to use stdlib's xoroshiro-based generator for now, but I am going to add a hook for registering a custom user-defined generator which satisfies a concept, I think that should make it maximally flexible
10:26:09FromGitter<mratsim> awesome, thanks
10:27:46FromGitter<mratsim> regarding the improvement proposal it will look like this: If error report the random seed used and iteration number + use a faster PRNG.
10:32:49*nsf quit (Quit: WeeChat 2.0.1)
10:33:47*nsf joined #nim
10:34:14FromGitter<alehander42> probably it will be a subclass tho, I forgot I can't just save a concept value somewhere
10:34:51FromGitter<alehander42> yeah, iteration number is important (isn't the issue in stint repo the improvement proposal?)
10:36:42FromGitter<mratsim> yeah it will be, but I think it doesn’t have everything does it?
10:37:38FromGitter<mratsim> @Araq, raised it as a feature request: https://github.com/nim-lang/Nim/issues/7776
10:41:39*kobi joined #nim
10:41:45kobihi
10:41:57FromGitter<mratsim> hi kobi
10:42:29kobiwhat is a good library for a non-blocking CLI -- you know something to mimic gui but in command line
10:42:50kobispecifically, i need to cancel its block when a timer reaches zero
10:43:28kobiI seem to remember something good but not sure it was in nim
10:43:41kobiHow are you doing mratsim?
10:47:15FromGitter<mratsim> I’m great :)
10:47:46kobiglad to hear mate
10:48:47FromGitter<mratsim> I’m not a CLI specialist but dom96 book has a chapter about non-blocking IO with Nim async modules and an example for a CLI chat app that is non-blocking
10:49:26FromGitter<mratsim> https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/client.nim#L37
10:51:00*xkapastel quit (Quit: Connection closed for inactivity)
10:52:30kobiso, basically having two threads, one for drawing, one for input, where the input is secondary, so I can restart it?
10:52:34*PMunch joined #nim
10:53:18kobiI thought maybe there was something more mature, with line-history etc.
10:54:29kobii know there is a ncurses wrapper. is that a recommended way?
10:54:53kobii.e. a better way, than doing it from scratch?
10:56:28FromGitter<xmonader> I can serve html pages directly from github-pages right? or it needs to be markdown only?
10:56:48miranyou can do it
10:57:03PMunchYou can?
10:57:09miranhttps://github.com/narimiran/itertools
10:57:14miransee under 'docs'
10:57:26miranand then i have: https://narimiran.github.io/itertools/
10:57:32FromGitter<xmonader> thanks i'll check :)
10:57:49PMunchOh yeah, but you have to set up the github.io thingy
10:58:37miranin your repo settings you just set where GH pages should look for source, and that's it
10:59:52FromGitter<xmonader> @narimiran I did that already but can't get it to serve from /docs ⏎ https://github.com/xmonader/nimdays/tree/master/docs ⏎ ⏎ i keep getting 404s [https://gitter.im/nim-lang/Nim?at=5aed8ea7da323a7c04fb5fcf]
11:01:26miranhttps://help.github.com/articles/configuring-a-publishing-source-for-github-pages/
11:01:50FromGitter<xmonader> oops i got a build failed email ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5aed8f1eff26986d0834ea04]
11:02:37FromGitter<mratsim> @kobi better wait for a CLI interface expert
11:03:39kobiok thanks
11:03:45*kobi quit (Quit: Leaving)
11:06:33FromGitter<xmonader> https://xmonader.github.io/nimdays/index.html Hiii
11:07:06mirannice one! keep them coming!
11:07:33miranbtw, some of the lines of code are too long ;)
11:08:16FromGitter<xmonader> man pages :(
11:08:55*xet7 quit (Remote host closed the connection)
11:10:45PMunchBy the way, if you apply a 'margin: 0 auto;' style to your '<div id="book">' you will centre the page
11:12:07*xet7 joined #nim
11:12:21FromGitter<alehander42> some wromng formatting in 5.2
11:12:25FromGitter<xmonader> 👍 still getting familiar with softcover project it's very nice
11:12:31federico3https://www.slant.co/topics/6032/~systems-programming-languages go vote for Nim :)
11:12:52FromGitter<alehander42> you didnt need to put it in a code block, you already had markdown in the end of the section
11:12:57FromGitter<alehander42> otherwise amazing effort
11:13:04FromGitter<alehander42> very useful!
11:13:26FromGitter<xmonader> Thanks!! I'll try to put it in a good shape
11:14:03FromGitter<xmonader> also PRs are so much appreciated on https://github.com/xmonader/nimdays if you have the time
11:15:35miranxmonader: how it would look if code blocks are not in bold?
11:16:10PMunchfederico3, done :)
11:16:18miranalso done :)
11:17:32FromGitter<xmonader> @miran https://imgur.com/a/wuNnYj1
11:17:40FromGitter<xmonader> not cool :S
11:18:42dom96so much hate for Rust on that site heh
11:19:18dom96xmonader: where can I view the book?
11:21:39dom96as for CLIs, I suppose this is a good example: https://github.com/dom96/deauther
11:21:52dom96Hopefully kobi reads IRC logs
11:24:00PMunchError: undeclared identifier: 'private_number', what does this actually mean?
11:31:23PMunchYES!!
11:31:34PMunchI finally figured out this obscure bug!
11:32:01PMunchIn my defence that error message should be improved :S
11:32:16*Ven`` joined #nim
11:33:33*Ven` joined #nim
11:36:12PMunchhttp://ix.io/19tj/nim
11:36:27*Ven`` quit (Ping timeout: 240 seconds)
11:36:29FromGitter<mratsim> slant is a dumb bot site anyway, I wonder who uses it to choose anything
11:36:54PMunchI've used it when looking for programs for a specific task before
11:39:13FromGitter<xmonader> @dom96 here https://xmonader.github.io/nimdays/index.html
11:39:46FromGitter<xmonader> if nim-lang is willing to host it it's okay with me too
11:44:25dom96PMunch: Didn't you get an "instantiation from here" message?
11:44:36dom96do report it though please
11:59:36PMunchNo I didn't, the error message was just the position of the macro invocation
12:00:10PMunchBut the statement to call getField is created by the macro, so I guess Nim can't figure out what the instantiation site is?
12:01:25*Shield joined #nim
12:07:04dom96PMunch: Definitely requires a bug report then :)
12:07:30dom96xmonader: That looks great. We can add a link to it on nim-lang.org :)
12:07:57FromGitter<xmonader> @dom96 that'd be great thank you :)
12:08:30ShieldI just discovered concepts and I love them, is there any overhead to use them? especially for filtering objects
12:10:28dom96xmonader: in fact you can do it, just create a PR to add it here: https://github.com/nim-lang/website/blob/master/jekyll/documentation.html :)
12:14:06*Ven` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:19:04PMunchHmm, it seems like this might be related to the experimental "." and ".=" operators
12:20:59dom96Shield: There is no overhead, but they are experimental and as such may change significantly.
12:21:22PMunchAha, figured out what the actual bug is
12:22:05PMunchIt's a combination of having a "." operator and using the "." call convention
12:23:53Shieldthat's great
12:26:50FromGitter<xmonader> @dom96 in the HTML directly not in a md file?
12:27:14dom96xmonader: yes, there is no .md file for this
12:36:38PMunchdom96, https://github.com/nim-lang/Nim/issues/7777
12:36:51dom96Looks like you win the #7777 prize :)
12:37:04PMunchHaha, I was just about to say :P
12:38:59FromGitter<data-man> The next beautiful number is 7887 :)
12:39:26*xet7 quit (Read error: Connection reset by peer)
12:39:56dom96So glad this works https://github.com/nim-lang/Nim/issues/007 :D
12:40:02*xet7 joined #nim
12:46:59*Shield quit (Ping timeout: 260 seconds)
12:47:16*CodeVance joined #nim
12:50:38mirandata-man: and after that 7890?
12:52:14FromGitter<data-man> @miran: No, 8008 :)
12:52:21miran:)
12:52:31FromGitter<data-man> No, 7997 :)
12:52:52enthus1astsome recent updates broke winim
13:00:56FromGitter<data-man> @enthus1ast: And it's right.
13:02:05enthus1astit may be right but it wont compile
13:05:46dom96federico3: nvm, forum doesn't use mailgun, we only use it to relay email between *@nim-lang.org and our personal emails
13:09:00dom96Sucks that you need a paid service to deliver emails reliably :/
13:14:58FromGitter<xmonader> FYI, I added the tutorial for bencode from day 2 https://xmonader.github.io/nimdays/nimdays.html#cid4
13:15:22dom96You need to fix the overflow on those code boxes
13:16:14FromGitter<xmonader> Indeed, I need to spend some more time with softcover for customizations :(
13:16:39*dddddd joined #nim
13:18:24FromGitter<alehander42> I see you use encode_s for string, encode_i for int etc and decode_'t' too
13:18:43FromGitter<alehander42> you can just overload encode and decode in those cases
13:18:54FromGitter<alehander42> as the types already provide the needed difference
13:19:26enthus1astthe winim branch of Tormund/winim is functional
13:20:01FromGitter<xmonader> @alehander42 you're right, I guess i tend to not overload the functions due to python background and i hate using extra flags to change the behavior too :(
13:20:21FromGitter<mratsim> embrace overloading
13:20:43PMunchHmm, I know there is a procedure somewhere to make nim symbols uniform, but I can't remember what it's called
13:21:03FromGitter<mratsim> something nimCase?
13:21:07FromGitter<mratsim> look in theindex
13:21:08PMunchAs in turning "some_identifier" and "sOMeIde_ntiFIER" to the same identifier
13:21:09dom96normalize()
13:21:10FromGitter<alehander42> ok for decode you do need the the extra stuff
13:21:13FromGitter<xmonader> @mratsim i'll try :D
13:21:17FromGitter<alehander42> but encode should be great with overloading
13:21:35FromGitter<alehander42> also you can simplify the decode function a lot
13:21:37PMunchAh, thanks dom96. normalize was it :)
13:21:56FromGitter<mratsim> normalize is a non-descripive name :/
13:21:58FromGitter<alehander42> if you just compute pair in `case`
13:22:21FromGitter<alehander42> the next 4 lines are the same and you can move them out of the case
13:22:47FromGitter<alehander42> if you see repeating code, you should always try to move/abstract it way
13:23:19PMunchHmm, normalize also decapitalizes the first character..
13:24:34PMunchThat's not correct..
13:25:05FromGitter<alehander42> otherwise pretty cool, I also did bencoding as first lib in some previous langs I used :D
13:44:19FromGitter<xmonader> @alehander42 I'll try to keep it updated with more idiomatic nim ^_^
13:44:54FromGitter<xmonader> I also believe bencode is an excellent exammple to tackle new languages as it has enough concepts to work with
13:48:48FromGitter<alehander42> yeah, the last thing I'd do is maybe add some `.bencode` helpers for literals, so you can do e.g. 2.bencode for bencode int variant, "42".bencode for bencode string etc
13:48:55FromGitter<alehander42> but that's very subjective
13:50:19FromGitter<alehander42> yeah it is , I was trying to write a torrent client back then in elixir and in go :D and I remember that the go version was way harder because of their eh type system
13:50:29FromGitter<alehander42> version of bencoder*
13:50:50dom96I always write IRC bots in new languages :)
13:51:16miranfor me AoC was very helpful
13:51:16*byte512 quit (Ping timeout: 268 seconds)
13:51:55dom96AoC?
13:53:15miranadvent of code
13:54:13mirana bit of everything there... dealing with input files, strings, numbers, graphs, etc etc
13:56:01dom96ahh yes
13:56:49miranwhen i started with nim, i just tried to translate my previous python solutions. and i really learned a lot (about nim) by doing that
13:57:12*byte512 joined #nim
14:07:37FromGitter<xmonader> @alehander42 this looks very neat!!
14:08:58PMunchHmm, I have an object with many fields generated from a macro. But this object also has getters and setters so you can't initialize it like you would a normal object (cause the field names are not named the same). So I want to create an initializer for this type. Currently I have it done with a new macro that takes varargs and expects it to be a list of key value pairs that get's turned into a full initialisation. This isn't perfect however as the user now has
14:08:59PMunchto import the macros module along with my module for this to work. Any ideas?
14:12:12FromGitter<mratsim> is there a way to parse a nim source file from a .nim file like nim doc or nimsuggest are doing?
14:12:32PMunchmratsim, into what format?
14:12:39FromGitter<mratsim> The documentation for Arraymancer is getting to unwieldly :/
14:13:03FromGitter<mratsim> ideally GraphQL but I can deal with JSON or even a nim tuple.
14:13:23PMunchYou can always use "nim jsondoc" to get a JSON representation of the docs
14:13:30PMunchWhich you can then use for whatever you like
14:14:51FromGitter<mratsim> oh right
14:15:32FromGitter<mratsim> but without calling an extra nim process is it possible?
14:16:04FromGitter<mratsim> I want to avoid this basically: https://github.com/mratsim/Arraymancer/blob/master/arraymancer.nimble#L183-L186
14:17:13FromGitter<mratsim> so it would be easier with a proc that parses nim files.
14:17:33FromGitter<mratsim> rather than calling nim each time
14:18:25dom96You'll have to call something. No way you'll be able to eval the code that implements jsondoc in nimscript
14:19:25FromGitter<mratsim> I want to migrate from nimscript to something more robust that directly generate the html/JS/CSS code
14:19:47FromGitter<mratsim> so I’m not restricted to pure nimscript
14:22:32dom96damn, jester really is a landmine for compiler crashes
14:23:34dom96mratsim: well then you'll be able to just import the compiler code
14:23:44dom96although I would say calling `nim` is a better idea
14:23:49FromGitter<data-man> @mratsim: If you did not see yesterday, https://github.com/andre-simon/highlight supports Nim. There is GUI and CLI.
14:25:01FromGitter<mratsim> highlights doesn’t extract comment I suppose
14:25:29FromGitter<data-man> You can to write Lua script for this :)
14:26:12FromGitter<mratsim> @dom96, thanks, I’ll think about how to go forward. Will probably leave that for in 6 months :/
14:26:24FromGitter<mratsim> argh Lua, I don’t want to learn lua
14:30:50FromGitter<alehander42> you can have a script that calls the nim compiler as a library, but then you're better off just invoking nim
14:33:00dom96mratsim: what are you trying to do?
14:33:56FromGitter<mratsim> parsing a nim file and get the proc/iterators/template/macro/signature + comments + source/edit link + commit in any kind of data structure that I can further process to generate docs
14:34:35FromGitter<xmonader> @mratsim isn't that compiler package?
14:36:04FromGitter<mratsim> what packages are you referring too? I don’t find one on theindex
14:37:10*nsf quit (Quit: WeeChat 2.1)
14:37:26FromGitter<alehander42> there is a compiler package
14:37:42FromGitter<xmonader> https://github.com/nim-lang/Nim/tree/devel/compiler
14:38:11FromGitter<alehander42> you can do something like
14:38:27FromGitter<alehander42> `var node = parseString(s, newIdentCache(), "name", 0, handleError)`
14:39:11FromGitter<alehander42> and then recursively convert this to something
14:40:01FromGitter<alehander42> I guess it might be possible to directly use json's module to convert the structure but I haven't tried
14:40:20FromGitter<mratsim> I’ll check how nim doc and nim jsondoc are implemented
14:40:51dom96so why avoid `nim jsondoc` so much?
14:40:58dom96it gives exactly what you need
14:41:53FromGitter<mratsim> currently I’m for looping calling one nim process per file and I filter manually the file path/filename. This is super error prone
14:42:29FromGitter<mratsim> I can’t call on the whole project because nim will put everything in the same file without any tag regarding the source filename/path
14:42:43FromGitter<mratsim> basically documentation doesn’t scale at the moment
14:43:34FromGitter<mratsim> If you have only a few nim files it works but multimodule documentation is hard.
14:45:04FromGitter<mratsim> if you look into my nimdoc, it’s getting out of hand: https://github.com/mratsim/Arraymancer/blob/master/nimdoc.cfg
14:45:25FromGitter<mratsim> from my new branch*: https://github.com/mratsim/Arraymancer/blob/v0.4.0-release/nimdoc.cfg
14:46:17FromGitter<mratsim> so I need to write a new tool that generates proper menu dynamically, and also the html doc files.
14:48:38dom96perhaps it would make sense to fix Nim?
14:50:03FromGitter<data-man> New RFC?
14:50:38FromGitter<mratsim> yes maybe. At least reporting new things in jsondocs that gives the filename, current commit/master, date would help people implementing custom doc generator for Nim
14:50:45FromGitter<mratsim> jsondoc*
14:52:13FromGitter<mratsim> for the html generation+nimdoc.cfg I don’t see a way besides ompletely replacing nimdoc.cfg with a more flexible solution.
14:52:45FromGitter<mratsim> and I don’t think dynamic menu should be a part of Nim, maybe stdlib though
14:58:54FromGitter<data-man> Maybe adding several docs-oriented functions to the NimScript also can be useful.
15:10:18FromGitter<data-man> @mratsim: Why you need a commit for docs?
15:11:01FromGitter<mratsim> because when linking to the source: I need the commit, on master the location of the procs may have changed
15:11:09FromGitter<mratsim> or it may have been removed altogrether
15:12:57FromGitter<data-man> Just generate two versions: for current devel and for last release. No?
15:14:45FromGitter<mratsim> that makes the nimdoc.cfg twice the size, at first glance
15:17:10FromGitter<mratsim> I pushed the new docs: https://mratsim.github.io/Arraymancer/
15:17:45FromGitter<mratsim> don’t ask me to make it responsive :/
15:27:21PMunchI have been thinking about writing a nim document server
15:28:02federico3uh?
15:28:32*CodeVance quit (Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org)
15:29:05PMunchSo a git hook will trigger a script that runs nim jsondoc on all .nim files in the repo. This is then ingested by the server into a database. The result is being able to serve up the documentation however you wat. Function by function, module by module, allow dynamic content likes comments, or even track which version of the library introduced a function and show that in the documentation page.
15:29:13*CodeVance joined #nim
15:34:35PMunchHmm, is there a generic way to reset a variable back to its default value?
15:34:51PMunchSo var x = 10; x.reset(); echo x # 0
15:35:01federico3PMunch: nimble.directory is doing a subset of that - patches are welcome
15:35:53PMunchAnd var x = "hello world"; x.reset(); echo x # empty string
15:36:09PMunchfederico3, yeah I know :)
15:36:15PMunchThat's partially where I got the idea
15:36:34PMunchBy the way, why is it that some packages doesn't have documentation generated for them?
15:37:18federico3some fail to build
15:37:41PMunchAh
15:37:44PMunchSimple as that :P
15:37:50federico3I'd be happy to add more features if there's interest
15:38:16PMunchOne thing that would be nice to fix: https://i.imgur.com/7jlnbwy.png
15:38:24PMunchNotice the scrollbar on the right
15:38:36PMunchI see those on all entries
15:38:53federico3I tried to reproduce it - what browser are you using?
15:39:16federico3I don't see that with crome and ff
15:39:20PMunchVivaldi
15:39:24mirani see it on vivaldi
15:39:37PMunchA simple "overflow: hidden" on the panel-body removes the issue :)
15:39:52miranoh, another vivaldi user! didn't expect to see that :)
15:40:43PMunchOr remove the "overflow-y: auto" that is on it now
15:40:53PMunchHaha, I've been using Vivaldi for years :)
15:41:07PMunchUsed to use Opera, but then they basically became a skin around Chromium..
15:41:29PMunchI feel Vivaldi brings back all of the neat features of Opera :)
15:41:30miranPMunch: same here.... a big fan of opera, until it stopped being opera :)
15:44:46PMunchPhew! Finally managed to get my protobuf thing to properly do "invisible" optional fields!
15:45:11PMunchOnly thing missing is the reset thing..
15:50:59*natrys joined #nim
15:51:11CodeVancefederico3, what happened to ci.nim-lang.org
15:51:55federico3glad to see somebody is asking - there has been no interest in it in the last year
15:52:09federico3CodeVance: what are you using it for?
15:53:40CodeVanceI was just searching for it and saw it
15:54:04CodeVancedom96 wanted something similar to it though ...
15:55:05PMunchHmm, IIRC all values in Nim are by default set to binary 0
15:55:36PMunchSo it should be possible to reset an arbitrary value as well..
15:55:45PMunchBy just reassigning it to binary 0
15:56:27CodeVanceThat was my understanding as well. Apparently they want that empty array and seqs should have a value of 0 but act like an empty
15:57:24CodeVancewasn't there already reset proc in system?
15:57:49CodeVanceit sets the value to binary zero
15:58:04PMunchIs there?
15:58:15PMunchOh damn it..
15:58:19PMunchYeah, "reset"..
16:01:13PMunchWell that was easy :P
16:08:13FromGitter<mratsim> reset is a performance trap. It calls GenericReset and GenericResetAux which are super slow
16:09:23PMunchWell, this is just for explicitly resetting a field in a protobuf object. Not sure when you would use it, but I doubt it will get used often so performance isn't really an issue
16:18:47*nsf joined #nim
16:24:25*jjido joined #nim
16:41:03*jjido quit (Quit: Textual IRC Client: www.textualapp.com)
16:53:41*mwbrown quit (Ping timeout: 256 seconds)
16:55:13*mwbrown joined #nim
16:55:31*noonien joined #nim
16:57:00*jjido joined #nim
17:01:51FromGitter<Varriount> @mratsim Why are they slow?
17:02:15PMunchJust checking, but the fact that normalize also turns the first character lowercase is a bug right?
17:04:21FromGitter<mratsim> @Varriount https://irclogs.nim-lang.org/10-10-2017.html#17:16:45
17:04:45FromGitter<mratsim> also this: https://github.com/mratsim/Arraymancer/issues/104
17:05:09FromGitter<mratsim> and this: https://github.com/nim-lang/Nim/issues/6501
17:06:27FromGitter<mratsim> Have to check but I’m pretty sure this perf regression is linked to generic reset not being avoidable with noinit anymore: https://github.com/nim-lang/Nim/issues/7743
17:08:06FromGitter<mratsim> If there is one reason to avoid ref objects for me it’s that.
17:15:29*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:20:55dom96PMunch: no
17:23:12dom96Might need to update the docs though
17:28:23*flaviu quit (Read error: Connection reset by peer)
17:33:00FromGitter<mratsim> I’ve pushed a new HN update for Arraymancer: https://news.ycombinator.com/newest
17:34:02FromGitter<mratsim> A vote would be appreciated (and would probably help Nim visibility as well!)
17:36:51dom96Nice
17:36:59dom96Surprised you're not linking to your github.io site though
17:37:32FromGitter<mratsim> Show HN rules are pretty strict about it being a project so I wasn’t sure
17:39:03dom96You can link to anything as long as it's your project
17:39:29dom96Might be worth adding a comment with a link
17:41:33FromGitter<mratsim> done!
17:47:23dom96Now just sacrifice a lamb to the HN gods and you'll be on the front page :P
17:47:58federico3dom96: this came up just at the right time https://medium.com/startup-grind/fuck-you-startup-world-ab6cc72fad0e
17:47:59FromGitter<mratsim> I gave up on that :P
17:49:03dom96federico3: I'm not at that stage yet :)
17:55:39miranmratsim: upvoted! hopefully it will reach the frontpage
17:56:04FromGitter<mratsim> such frustration by that guy @federico3 :O
17:56:06FromGitter<mratsim> thanks!
18:00:09miranprobably a comment or two would also help, not only upvotes
18:00:35mirani hadn't used arraymancer enough to write something about it....
18:01:13FromGitter<mratsim> you proably used it more than 99.99999% of the people out there ;)
18:01:20FromGitter<mratsim> o talk about Nim
18:01:23FromGitter<mratsim> or*
18:01:46FromGitter<mratsim> and how you can get back the productivity of Python without the speed issue
18:01:51FromGitter<mratsim> or with tatic typing
18:03:43dom96be careful with commenting too much
18:04:07FromGitter<mratsim> “Fuck HN” :P
18:04:45*jjido joined #nim
18:06:00mirani could write something general, but then i'll probably get "nim fanboy" sticker :)
18:06:30FromGitter<mratsim> well, Rust gets away with it
18:07:11miranand i've used Neo much more than AM, not sure what to write about. i can mention that you're very involved in solving performance issues :)
18:07:41FromGitter<mratsim> they are not solved sadly :/ and the very first question asked on Reddit was what is the performance ...
18:08:26*jjido quit (Client Quit)
18:08:39miranoh, it is on reddit also. let me upvote there too :)
18:09:05*smt quit (Ping timeout: 248 seconds)
18:09:16*smt joined #nim
18:09:20miranheh, post on reddit is better than your comment on HN. can you maybe edit it to add that stuff also?
18:10:35miranor do you want me to ask a question about the performance? :D
18:12:25FromGitter<mratsim> you can.
18:12:28mirani think you should also show a short snippet of "keras-like API" - people are lazy and don't want to click on links and explore by themselves
18:12:38FromGitter<mratsim> afterwords I’m going out for 3~4 hours
18:12:47*MypMyp joined #nim
18:12:52FromGitter<mratsim> afterwards*
18:15:27FromGitter<mratsim> for the keras like part, it’s not far in the Readme
18:15:37FromGitter<mratsim> there is a big “Show me some code part"
18:15:43FromGitter<mratsim> at the very top
18:24:23miranhere you go.... a comment on HN, maybe it will attract some further discussion about speed....
18:33:30dom96At least you're #1 on the Show section of HN :)
18:35:47*MypMyp quit (Quit: Leaving.)
18:35:56PMunchdom96, yeah the doc says: "This is needed for Nim identifiers for example."
18:36:11PMunchSo you would really expect it to keep the case of the first character
18:36:42dom96perhaps, I'll let Araq decide this :)
18:37:04*dddddd quit (Remote host closed the connection)
18:37:15PMunchAt the very least there should exist one that does do what you'd expect
18:38:55CodeVanceDon't blatently Plug Nim, make a signature then comment without talking about it :|
18:40:24federico3how can I convert a JsonNode to a tuple?
18:40:50miranmratsim: how come you didn't post on /r/programming too?
18:41:00*CodeVance quit (Read error: Connection reset by peer)
18:45:00*smaug joined #nim
18:45:19smaugCan metaprogramming be used as an alternative to OOP?
18:47:55miranisn't that an overkill?
18:47:57smaug@dom96 how metaprogramming be used as an alternative to OOP?
18:49:15*xcm joined #nim
18:49:31*vivus joined #nim
18:50:55FromGitter<xmonader> btw guys, did u ever work with go-raml nim code generation? https://github.com/Jumpscale/go-raml
18:51:34FromGitter<xmonader> It'd be nice if nim community can give it a shot and report us the errors
18:53:32*MypMyp joined #nim
18:57:16*CodeVance joined #nim
19:14:22noonien@xmonader: i'd suggest including a link to what RAML is in the readme, not everyone know
19:14:24noonienknows*
19:16:23*smaug quit (Quit: Page closed)
19:16:57*CodeVance left #nim ("Leaving")
19:17:12FromGitter<xmonader> @noonien in the what is go-raml section there's a link t raml specifications
19:17:58noonienoh, i must have missed it, my bad
19:18:10FromGitter<xmonader> It's okay ^_^
19:19:07FromGitter<xmonader> nim generator was added in go-raml when the R&D was investigating nim
19:20:36*xkapastel joined #nim
19:21:04FromGitter<CodeVance> R&D?
19:21:24FromGitter<xmonader> research&development team
19:31:24*yglukhov joined #nim
19:32:58*yglukhov quit (Read error: Connection reset by peer)
19:33:30*yglukhov joined #nim
19:35:12*yglukhov_ joined #nim
19:35:12*yglukhov quit (Read error: Connection reset by peer)
19:44:46FromGitter<sherjilozair> So to learn how to use cpp in nim, I created a small toy example, and although the code compiles, I get a SIGSEGV error. Could someone help me figure out what I'm doing wrong? Here are all the files used and the error message: https://gist.github.com/sherjilozair/e289e46961169d1b883b1c93a81965f4
19:46:22FromGitter<CodeVance> @sherjilozair You didn't make counter public
19:47:09FromGitter<sherjilozair> It's declared under `public:`. What else must be done?
19:47:36FromGitter<CodeVance> oops
19:47:40FromGitter<CodeVance> sorry XD
19:58:10FromGitter<CodeVance> try removing the first say()
20:00:01*rokups quit (Quit: Connection closed for inactivity)
20:02:39*yglukhov_ quit (Remote host closed the connection)
20:03:15*yglukhov joined #nim
20:05:48dom96sherjliozair: I think you have to wrap the constructor for Animal:
20:05:55*dddddd joined #nim
20:06:12dom96proc newAnimal(): Animal {.importcpp: "new Animal(@)".}
20:06:23dom96then call it: var x = newAnimal()
20:06:56FromGitter<sherjilozair> yup, that's it!
20:07:04FromGitter<sherjilozair> thanks @dom96
20:07:17FromGitter<sherjilozair> how can I expose the public fields? How can I access counter from nim?
20:07:57dom96counter {.importc.}: cint under the `AnimalObj` should work
20:08:09*yglukhov quit (Ping timeout: 260 seconds)
20:15:07FromGitter<sherjilozair> I'm pleasantly surprised by how easy this is, once I know what needs to be done. If only this was documented better.
20:16:33FromGitter<alehander42> @dom96 is there a test with async with more complciated behavior
20:16:38FromGitter<sherjilozair> Is there any catch to doing a mixed Nim C++ codebase? What should I be careful about? Any C++ things I shouldn't be using? Templates?
20:16:56FromGitter<alehander42> e.g. "random" order of completion etc
20:17:01dom96sherjilozair: doc improvements are always welcome :)
20:17:18dom96alehander42: All async tests are in the 'async' folder
20:18:03dom96sherjilozair: During my time wrapping C++ I didn't run into any issues, but then again I didn't wrap /that/ much
20:20:01FromGitter<alehander42> oh nice, but most of them probably produce pretty reproductive behavior
20:20:31FromGitter<alehander42> I was looking for something that changes on each run , something like async "race condition"
20:21:04FromGitter<alehander42> I'll try to think of something
20:23:17FromGitter<sherjilozair> @dom96 One thing that worries me with Nim/C++ is safety. Both C++ and Nim are safe on their own, but combined we're getting SIGSEGV errors due to mistakes which are possible in practical development. Even if I add a constructor, I might forget using it, and I might have uninitialized objects. Why does Nim allow uninitialized C++ objects when it doesn't allow the same for its own native objects?
20:37:52*rockcavera quit (Remote host closed the connection)
20:47:18dom96it does allow the same for its ref objects
20:47:33dom96Unfortunately all FFI code needs to be developed carefully
20:47:42dom96It's unsafe in practically all languages though
21:10:57*MypMyp quit (Ping timeout: 268 seconds)
21:18:58*miran quit (Ping timeout: 268 seconds)
21:25:53*Vladar quit (Quit: Leaving)
21:36:36*natrys quit (Quit: natrys)
21:39:53FromGitter<sherjilozair> What does this sentence from the tutorial mean? "Since objects are value types in Nim, composition is as efficient as inheritance."
21:40:35FromGitter<sherjilozair> Isn't objects being value types less efficient, since copying copies the whole thing?
21:43:10*CodeVance joined #nim
21:52:25*CodeVance left #nim ("Leaving")
22:02:43*nsf quit (Quit: WeeChat 2.1)
22:14:14*CodeVance joined #nim
22:15:44*sz0 joined #nim
22:16:18xcmhello. given this modified snipped from nim-by-example, https://bpaste.net/show/c6635948d6c8 , is the IndexError thrown at line 12 something that might be caught at compile time in the future?
22:17:18xcm(and am i correct in reading "array[1..H, int]" as "1-indexed, up to H array"?)
22:18:45*CodeVance2 joined #nim
22:21:53*CodeVance quit (Ping timeout: 248 seconds)
22:55:25*CodeVance2 left #nim ("Leaving")
22:56:19*noonien quit (Quit: Connection closed for inactivity)
23:01:56dom96xcm: Good question. Might be worth an issue on GitHub
23:03:12*xkapastel quit (Quit: Connection closed for inactivity)
23:13:20FromGitter<mratsim> @sherjilozair At Status we are traumatized by C++ :P, libraries that provides custom destructors are a pain to work with because when casting them normally GCC/Clang tend to complain. Also we had to remove the C++ destructors to allow using them in a seq.
23:13:30FromGitter<mratsim> otherwise it works fine, including templates
23:14:28FromGitter<mratsim> See here: https://github.com/status-im/nim-ttmath it’s a stack big-int lib in C++ where the size is integer templated:
23:15:26FromGitter<sherjilozair> @mratsim Yeah, I did manage to make that example work, but I think mixed code-bases are too unsafe for practical purposes. Wrapping legacy C/C++ is great, but I think new projects should aim to be Nim-only.
23:15:38FromGitter<sherjilozair> Or rather, Nim as much as possible.
23:17:16FromGitter<sherjilozair> @mratsim Congratulations on the 0.4 release. Library looks really great. What are you planning to work on next? Any areas you'd like outsourced? :)
23:26:38FromGitter<mratsim> Either RNNs or cross-validation.
23:26:46FromGitter<mratsim> thanks :)
23:27:29FromGitter<mratsim> well anything you want to work on, feel free, there is a Gitter chat as well.
23:28:09FromGitter<mratsim> Ideally I would like to implement variadic loopfusion and mapreduce: https://github.com/numforge/loop-fusion
23:28:24FromGitter<mratsim> it should be easy as I did it for seq (except the parallel part)
23:29:29FromGitter<mratsim> because the current iteration scheme is a bit rusty I think. Only thing is this: https://github.com/nim-lang/Nim/issues/7737
23:30:36FromGitter<mratsim> Regarding ttmath, yeah tomorrow I will replace it in the whole codebase, I just finished a pure Nim replacement: https://github.com/status-im/nim-stint
23:35:26FromGitter<sherjilozair> @mratsim RNNs would be really cool. Are you going to use CUDNN's RNN for it? I'd suggest so.
23:36:05FromGitter<sherjilozair> Do you have any functionality to save/load model weights?
23:36:07FromGitter<mratsim> Yes for Cuda, for Cpu and OpenCL I will have to implement them from scratch
23:36:37FromGitter<mratsim> No: https://github.com/mratsim/Arraymancer/issues/163
23:37:04FromGitter<mratsim> I won’t do like Tensorflow/Keras and implement a slow LSTM/GRU ….
23:37:33FromGitter<sherjilozair> haha
23:38:43FromGitter<mratsim> Did you know that in Keras you had both version the slow Google one and the fast Nvidia one: https://keras.io/layers/recurrent/#cudnngru
23:38:50FromGitter<sherjilozair> I don't think it would compare to CUDNNs. It has a lot of tricks.
23:39:11FromGitter<sherjilozair> Yeah Tensorflow has like 5 types of RNNs, and the least documented one is the fastest. :facepalm:
23:42:29FromGitter<mratsim> Ah i also have to adapt the high level API for Cuda, the low-level primitive are done but you can’t use the nice “network” syntax at the moment
23:44:03FromGitter<sherjilozair> Yeah about that, can one run regular nim code inside forward? While I love the syntas sugar, it does come with having to learn a new syntax over Nim. I think regular Nim syntax should also be given same status.
23:45:02FromGitter<mratsim> forward is regular Nim code
23:45:32FromGitter<sherjilozair> Oh okay. UFCS.
23:45:45FromGitter<mratsim> the only thing I do is transform x.cv1 into x.conv2d(cv1.weight, cv1.bias)
23:46:16FromGitter<mratsim> but you can use let conv1 = x.cv1; let maxp1 = conv1.mp1.
23:46:33FromGitter<mratsim> I do have to show an example with 2 inputs that get combined.
23:46:48FromGitter<sherjilozair> oh so it's not UFCS. How would you implement a residual connection?
23:47:28FromGitter<sherjilozair> i.e. something like ((x.cv1.relu)+x).mlp`
23:47:33FromGitter<mratsim> I have to allow the network to be chained, but it’s not a problem.
23:47:42FromGitter<mratsim> you don’t have to put everything in a line
23:48:01FromGitter<mratsim> you can use temporary, let me give you an example
23:48:52FromGitter<mratsim> There is no merge layer but this show what can be done today assuming it was available: https://github.com/mratsim/Arraymancer/issues/214#issuecomment-383676199
23:49:02FromGitter<sherjilozair> let h = x.cv1.relu ⏎ let h = h.cv2.relu + h ⏎ let h = h.cv3.relu + h ⏎ and so on [https://gitter.im/nim-lang/Nim?at=5aee42ee97e5506e049e28e7]
23:49:23FromGitter<CodeVance> ```((x.cv1.relu) ⏎ +x).mlp``` [https://gitter.im/nim-lang/Nim?at=5aee43036f9af87e0446cb55]
23:50:07FromGitter<CodeVance> ```let h = h.cv2.relu + h ⏎ let h = h.cv3.relu + h``` [https://gitter.im/nim-lang/Nim?at=5aee432fff26986d0836ab7e]
23:50:08FromGitter<mratsim> your h should be var, but yes
23:50:22FromGitter<sherjilozair> No I don't think so. I'm shadowing them.
23:50:43FromGitter<sherjilozair> is it not possible to shadow them like this?
23:51:08FromGitter<mratsim> basically forward x, y is transformed into `proc forward(x, y: Tensor): Tensor =` so same rule apply
23:51:37FromGitter<mratsim> you can shadow the first, but the second/third shadow will tell you that you already have a variable of the same name
23:52:38FromGitter<sherjilozair> How do you know what x, y are? Can there not be other input output vars?
23:52:45FromGitter<sherjilozair> Does this only work with two variables right now?
23:52:50FromGitter<mratsim> any number
23:53:00FromGitter<mratsim> it can even be nothing
23:53:14FromGitter<mratsim> well I’m not sure if it works if it’s nothing
23:54:12FromGitter<mratsim> basically it’s just a shortcut to declare a proc and add syntactic sugar: https://github.com/mratsim/Arraymancer/blob/master/src/nn_dsl/dsl_forwardsugar.nim
23:55:04FromGitter<sherjilozair> I see.
23:55:56FromGitter<sherjilozair> Have you thought about how to hide the context variable from the user? It's not accessed by the user in any python framework. It's easier-to-use that wya.
23:56:57FromGitter<mratsim> Yeah, I’m not sure how to do that best right now.
23:59:53FromGitter<sherjilozair> Is there anyway to execute code during an import?