<< 03-03-2018 >>

00:01:50*Snircle_ quit (Quit: Textual IRC Client: www.textualapp.com)
00:03:54*icebattle quit (Quit: leaving)
00:05:14FromGitter<mratsim> Dunno, I tried to install Nim through Homebrew in the past and I had path issues, nimsuggest didn't work, etc ... So know I'm not installing it globally anymore
00:13:43federico3algorithm.nim(428, 51) Error: undeclared identifier: 'HSlice' ...ouch
00:16:48*couven92 joined #nim
00:20:31GitDisc<spaceghost> I guess I just prefer asdf. To remove an older nim I just `rm -rf ~/.asdf/installs/nim/<version>`
00:23:15federico3as I suspected, some steps in the install expect the binary to be in path :(
00:23:18federico3nim c doc/nimcache/tut1/tut1_snippet_101.nim
00:33:11*vlad1777d joined #nim
00:36:10*d10n-work quit (Quit: Connection closed for inactivity)
00:59:44*couven92 quit (Ping timeout: 256 seconds)
01:01:37*xkapastel joined #nim
01:26:05*Yaiyan quit (Ping timeout: 240 seconds)
01:32:40*yaiyan joined #nim
01:34:54*couven92 joined #nim
01:48:19*tefter joined #nim
01:56:43FromGitter<zetashift> oh fuck lmao I thought 7drl started monday
01:58:09FromGitter<zetashift> I'm doing it with Nim guess I'll just start now
02:12:26*S1t1Schu joined #nim
02:16:01*S1tiSchu quit (Ping timeout: 248 seconds)
02:22:59*yglukhov joined #nim
02:27:34*yglukhov quit (Ping timeout: 256 seconds)
02:33:41*endragor joined #nim
02:38:13*endragor quit (Ping timeout: 252 seconds)
02:40:25*far4ia4650 quit (Ping timeout: 252 seconds)
02:40:42*far4ia4650 joined #nim
03:04:39*natrys joined #nim
03:10:08*couven92 quit (Ping timeout: 276 seconds)
03:13:52*endragor joined #nim
03:34:05*endragor quit (Remote host closed the connection)
03:36:40*endragor joined #nim
04:13:31*xkapastel quit (Ping timeout: 245 seconds)
04:15:27*xkapastel joined #nim
04:24:01*SenasOzys quit (Ping timeout: 248 seconds)
04:37:53*natrys quit (Ping timeout: 248 seconds)
04:54:56*arthurz quit ()
05:02:34*r3d9u11 joined #nim
05:31:06*xkapastel quit (Quit: Connection closed for inactivity)
05:43:56*r3d9u11 quit (Remote host closed the connection)
06:15:19*r3d9u11 joined #nim
06:18:25FromGitter<gogolxdong> Is there any ssh library for inputting the password automatically?
06:18:48Demos[m]you can pass it on the command line
06:19:06Demos[m]and I'm sure libssh has an option
06:19:12Demos[m]but like, just use an rsa key
06:22:30*miran joined #nim
06:33:32*nsf joined #nim
06:47:32*arecacea1 quit (Remote host closed the connection)
06:47:49*arecacea1 joined #nim
06:50:27*yglukhov joined #nim
06:55:20*yglukhov quit (Ping timeout: 268 seconds)
07:18:28*yglukhov joined #nim
07:20:13*dddddd quit (Remote host closed the connection)
07:36:40*arecacea1 quit (Remote host closed the connection)
07:36:58*arecacea1 joined #nim
07:53:14*Trustable joined #nim
07:58:32*MyMind joined #nim
07:58:35*Sembei quit (Ping timeout: 240 seconds)
08:22:30*Trustable quit (Remote host closed the connection)
08:31:20FromGitter<tim-st> it seems (at least to me) that nimsuggest is much slower with 0.18. I also compiled a dev version of it from 25 days ago, which was quick. Maybe it's because of `--gc:markAndSweep` ?
08:32:14FromGitter<tim-st> or some new changes
08:35:34*rokups joined #nim
08:39:48FromGitter<tim-st> hm, not it seems quicker, maybe something like a warm up^^
08:39:52FromGitter<tim-st> *now
09:03:52def-@tim-st you didn't accidentally compile it without -d:release?
09:05:44*jaco60 joined #nim
09:13:56FromGitter<tim-st> I'm using the 0.18 release version from website (`active boot switches: -d:release --gc:markAndSweep`)
09:15:42FromGitter<tim-st> But as I said now it works good like before 0.18. Maybe this "warm up" delay occured just for me
09:16:14GitDisc<Teapotrick> hey guys, is there a way to pass the symbol name into the applied pragma? eg. `proc thisFunc*(a: int): int {. something: <the name of this function> .}`
09:25:02*Vladar joined #nim
09:39:56*r3d9u11 quit (Read error: Connection reset by peer)
09:44:12FromGitter<mratsim> Generate the proc with a template, or use a macro for your pragma
09:44:35FromGitter<mratsim> The macro can retrieve the proc name
09:45:25FromGitter<tim-st> When I use the new `runnableExamples` I cannot use a type like `Rune` in it that was imported in outer scope?
09:50:05Yardanicoyou can AFAIK
09:54:54*r3d9u11 joined #nim
09:56:48FromGitter<tim-st> Doesnt work for me, I have to `import unicode` within the `runnableExamples` block
09:57:25FromGitter<tim-st> btw should these replace tests or should there be additional test cases at the end?
10:01:36FromGitter<tim-st> but when I think about it, it's not really bad, that something from non stdlib has to be imported so that one can safely recreate the example
10:14:04*nsf quit (Quit: WeeChat 2.0.1)
10:15:42GitDisc<Teapotrick> mratsim: i'm looking into macros, i can't see so far how to do what i want. i'll keep digging.
10:32:50FromGitter<mratsim> @Teapotrick, something like this is probably the easiest: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a9a79d226a769820b2a4db8]
10:34:10FromGitter<mratsim> and you use `genProc(MyAwesomeProc)`
10:34:23*xincognito10[m]1 joined #nim
10:36:47*leorize joined #nim
10:37:09*xincognito10[m] quit (Ping timeout: 256 seconds)
10:37:10*d10n quit (Ping timeout: 256 seconds)
10:37:36*Araq quit (Ping timeout: 256 seconds)
10:37:52*Araq joined #nim
10:38:10*dyce[m] quit (Ping timeout: 256 seconds)
10:38:49*dyce[m] joined #nim
10:39:06*d10n joined #nim
10:39:06*d10n quit (Changing host)
10:39:06*d10n joined #nim
10:44:18*SenasOzys joined #nim
10:44:53*nsf joined #nim
10:47:59FromGitter<mratsim> Is there a FAQ about the community name? https://forum.nim-lang.org/t/3596
10:48:30GitDisc<Teapotrick> mratsim: interesting. i'll have to pass the args and return type in separately. that should be no problem, right?
10:50:10FromGitter<mratsim> not sure what you mean: here are full blown examples of proc generation via template: https://github.com/mratsim/Arraymancer/blob/6b1137214153d0cd8e58d9355818725032f83f8b/src/tensor/private/p_kernels_interface_cuda.nim#L23-L36
10:51:01FromGitter<mratsim> proc `binding_name` —> backtick are optional for proc, but required if you want to generate variable names on the fly
10:51:20FromGitter<mratsim> Relevant part of the manual: https://nim-lang.org/docs/manual.html#templates-identifier-construction
10:58:53GitDisc<Teapotrick> because the arg list isn't the same for each proc, so i need to pass that in separately. i then want to prepend a small string to the procname when it's in the pragma too. i'm looking over the manual.
11:00:56*jaco60 left #nim ("Textual IRC Client: www.textualapp.com")
11:01:09GitDisc<Teapotrick> oh i see. i can use backticks for that
11:02:49FromGitter<mratsim> Another proc that might be useful for you at one point is `astToStr` to convert an identifier (proc name, variable name) to string.
11:05:18FromGitter<mratsim> also besides template you can use macro as pragma like this: https://forum.nim-lang.org/t/3310
11:05:39FromGitter<mratsim> I’m pretty sure the macro can access the proc name in this case
11:09:09leorizehi, may I ask what's the current status of destructors?
11:09:57FromGitter<mratsim> @leorize, you can try them by compiling your code with —new runtime, latest development is described there: https://github.com/nim-lang/Nim/wiki/Destructors
11:10:07FromGitter<mratsim> —newruntime*
11:11:28leorizemratsim: I assume every feature listed are currently supported in HEAD?
11:11:36*wolf135 joined #nim
11:11:41FromGitter<mratsim> `sink` can be used as a modifier like `var`, it means that the parameter cannot be reused later. (Useful for closing filehandlers) it would be a compile-time error otherwise
11:12:37FromGitter<mratsim> There is a new `lent`modifier, which means you keep ownership of a param but other can access it read only (otherwise compile tie error)
11:12:57FromGitter<mratsim> Not all, it’s more a vision document
11:13:14yglukhovIs it valid for return type to be a typeclass?
11:13:40FromGitter<mratsim> @yglukhov it worked for me, but it’s a bit hacky
11:13:57FromGitter<mratsim> especially “auto"
11:14:00yglukhovIt works for me too, but i've got now idea how
11:14:12leorizemratsim: Thanks. Do you know how could I set --newruntime for an entire nimble package (lib only)?
11:14:43yglukhovwell auto i can understand. its inferred from the body. but typeclass (given that its an importcpp proc) i can't understand =)
11:15:11FromGitter<mratsim> @leorize, unfortunately I don’t think it’s possible, you can ship a nim.cfg but a package cannot enforce compilation flags
11:15:41FromGitter<mratsim> I would love to, in Arraymancer I would love to autodetect OpenMP for example
11:16:13*couven92 joined #nim
11:16:15leorizemratsim: many thanks for your help
11:16:33FromGitter<mratsim> @leorize: here is an example - https://github.com/mratsim/Arraymancer/blob/master/nim.cfg
11:18:57leorizeIIRC one could have an projectName.nims file enforcing options for the project, but I haven't got any success applying it to a package
11:20:01yglukhovmratsim, Araq, zah: it looks like typeclass can be used as a return value as long as the same typeclass is used as an argument. then its inferred from the argument. is this intended and can be relied upon?
11:20:20GitDisc<Teapotrick> https://hastebin.com/uhogerevab.nim
11:20:20GitDisc<Teapotrick>
11:20:20GitDisc<Teapotrick> As you can see: I've got no idea what i'm doing
11:21:42FromGitter<mratsim> @leorize: What Araq told me was that if every package enforces its own custom options, it would be a complete mess so we leave that to end users.
11:21:44GitDisc<Teapotrick> 1. generate whole proc dec, using name, args, and ret type.
11:21:44GitDisc<Teapotrick> 2. just generate the pragma
11:23:16FromGitter<mratsim> for wrpping libraries, you can use c2nim
11:23:22FromGitter<mratsim> it will do it for you
11:23:27leorizemratsim: I assume a nice note in the README file would work then. But it would be nice if one can bails out when detect the lack of a feature.
11:23:38FromGitter<mratsim> agreed
11:24:43FromGitter<mratsim> @teapotrick, I think you’re overcomplicating things ;)
11:25:40GitDisc<Teapotrick> mratsim: that doesn't look like any fun at all! 😛
11:25:51GitDisc<Teapotrick> complication is the spice of life.
11:26:54FromGitter<mratsim> ```code paste, see link``` ⏎ ⏎ Should work [https://gitter.im/nim-lang/Nim?at=5a9a867e012ff2bf681d1663]
11:28:11FromGitter<prollings> but that assumes the arg lisr
11:28:15FromGitter<mratsim> or use c2nim and strip the prefix ;) or nimgen: https://github.com/genotrance/nimgen
11:28:49FromGitter<Bennyelg> Hey
11:28:59FromGitter<mratsim> @prollings since he is wrapping a c library I suppose he can get the arg list from the header
11:29:08FromGitter<mratsim> hey Benny
11:29:16FromGitter<Bennyelg> Im trying to make a pull request for the first time, I am in my branch locally, I am trying to push it but I am with ` sufficient permissions `
11:29:25FromGitter<Bennyelg> any help will be great.
11:29:35GitDisc<Teapotrick> i wanna do it by hand first, just so i know how this stuff works (second day using nim)
11:30:29FromGitter<mratsim> 1) fork the Nim repo in Github ⏎ 2) clone your fork ⏎ 3) Branch your fork ⏎ 4) push your commit to your fork ⏎ 5) PR from your fork to Nim main ... [https://gitter.im/nim-lang/Nim?at=5a9a875501a2b40f382d66d0]
11:30:45FromGitter<Bennyelg> thanks
11:31:08wolf135Hi all, I have just started learning. The program in the first tutorial closes the cmd immediately after printing the second line. I figured out that "let input = readChar(stdin)" makes it wait for Enter, but I'd rather have any key close the program. How could I achieve it?
11:31:52FromGitter<mratsim> @teapotrick Cool, I would start first by getting the simple proc to work, and only then abstracting with a template. Anyway, macros on your second day, you’re quite intrepid ;)
11:33:43GitDisc<Teapotrick> suits my use cases. :D
11:33:43GitDisc<Teapotrick> Will do.
11:38:35FromGitter<mratsim> @teapotrick, here is a very simple wrapper of a C library I generated via c2nim 2 weeks ago: https://github.com/status-im/nim-rocksdb/blob/master/src/rocksdb_c.nim
11:39:52FromGitter<mratsim> remember, importc requires a string, the way to transform an identifier like procName to a string is `astToStr` in the macros module
11:41:41GitDisc<Teapotrick> mratsim: looks great. is it possible to get it to convert types from the header to nimcode, so that there's no requirement of actually having the header when building the module? D:
11:41:55*Pisuke joined #nim
11:43:29*MyMind quit (Ping timeout: 248 seconds)
11:51:02dom96wolf135: this should work: https://nim-lang.org/docs/terminal.html#getch,
11:54:00nivsooooo, are there any plans for getting official docker images on track?
11:55:01dom96niv: no
11:56:26nivnot sure how i feel about that. the nimlang/ ones are very convenient, but outdated now
11:56:52nivnext question: what about the `func` keyword? appears to be func-tional in 0.18, but documentation makes no mention of it
11:57:05wolf135dom96: that worked, thanks!
11:57:27dom96The core team doesn't have time to be maintaining these things. Contact the maintainer of that docker image.
11:57:55dom96You can also create your own docker image :)
11:59:43nivyeah, i've opened an issue with them right now. i do create my own images right now but i'd rather stick to nimlang/. maybe they want some help with keeping them updated.
12:00:14dom96it would certainly be nice if they give us access to that docker org
12:00:15nivfwiw, i think getting automated builds up on a really-official image repository would not be hard to do. i'd offer help with that too if that ever becomes a thing
12:00:27nivi think we could contact dockerhub and ask them to get the global "nim" tag
12:00:37nivand by we, i mean you
12:00:44dom96niv: sounds like a good idea
12:00:57dom96lol, why me?
12:01:02Zevvdom96: I'm chasing an occasional SIGSEGV in my code that only happens on -d:release, but does not show up without that flag. Valgrind finds a read from address 0x08. I suspect it might be something GC related, any hints on how to go on debugging this?
12:01:08nivbecause you are a nim developer/representative and i am not
12:01:15dom96Nim isn't some centralised project where I and Araq hold all the power
12:01:26nivi bet dockerhub will want verification and a official contact point for issues
12:01:29ZevvYeah, you're the benevolent dictators!
12:01:41dom96We can't do everything, it's up to the community to step in i.e. you
12:01:46dom96Especially if you want something to be done
12:02:43dom96I can certainly help out if they need "official approval" or something, but at least try to get the ball rolling, I would appreciate that
12:02:49nivreading up on it now
12:03:49*Zevv quit (Remote host closed the connection)
12:03:51*Snircle joined #nim
12:04:36dom96Zevv: Try compiling with -d:useGcAssert (hope you will see this in the IRC logs)
12:04:43nivyeah, it's a lengthy process. ugh.
12:05:21*xkapastel joined #nim
12:05:41FromGitter<dom96> Pretty sure it's @moigagoo who's the maintainer, we can ping him to update the docker image :)
12:05:54nivi've created a low-effort ticket asking them to update
12:07:02nivnim 0.18 was pleasant to upgrade, btw, even on a mid-sized codebase. just a couple of changes, none of them painful
12:09:24dom96I think you just got lucky. This release has a lot of breaking changes :)
12:09:51nivi guess :) still, it's a data point
12:17:44miranok, maybe it is time for me to upgrade too.... i've been waiting to see if any major bugs would be reported, but it seems everything's fine
12:20:42FromGitter<mratsim> @teapotrick: yes, c2nim ;), my wrapper doesn’t need the header, it only needs the shared lib
12:21:16FromGitter<mratsim> @zacharycarter don’t forget to update the playground to 0.18, printing arrays doesn’t work in the playground and it’s sad :/
12:29:25dom96!eval echo(NimVersion)
12:29:27NimBot0.17.2
12:29:48dom96!eval if NimVersion != "0.18.0": echo(":'(") else: echo("yay")
12:29:51NimBot:'(
12:30:04dom96Eventually we'll get a "yay" :P
12:33:26dom96Definitely a lot more forum threads than usual :)
12:35:25Yardanicodom96, did you ask zachary to update?
12:35:32Yardanicozacharycarter I mean :)
12:35:37dom96he knows
12:36:10mirandom96: and more new nicks here on irc, from what i've seen
12:36:29dom96yep
12:38:30federico3I wonder if FOSDEM has something to do with it :)
12:39:01miranfederico3: or threads about 0.18 on HN and reddit? ;)
12:41:15federico3miran: sure it's the release but people need to know and care about the language to notice
12:42:17Yardanicodom96, https://qiita.com/2vg/items/0e75b686800d0b27b5e9 :P
12:42:35Yardanicosomeone took their time to translate blog post to japanese
12:42:56FromGitter<ZarsBranchkin> Haha, that's pretty great!
12:43:15miranon /r/programming it received mostly positive comments and it stayed on a frontpage for a long time - i think these two things combined are enough for curious minds to notice and try a new language
12:43:33Yardanicohttps://sdtimes.com/ai/sd-times-news-digest-nim-0-18-0-intellij-idea-2018-1-learn-google-ai/
12:44:51dom96Yardanico: ooh
12:45:30Yardanicodom96, ? is this a big website?
12:45:45dom96no, that was to the japanese translation link
12:45:48Yardanicoah, yeah
12:46:00Yardanico2vg has some stuff in nim: https://github.com/2vg
12:46:10dom96Funny to see Nim at the top and Rust at the bottom of that article though
12:46:16Yardanicohttps://github.com/2vg/mofuw :P
12:47:01Yardanicothere's some benchmarks
12:47:28Yardanicoand the best thing - it only uses stdlib
12:47:35FromGitter<mratsim> > not like libuv ? ⏎ > A. No. but, tired of memory management lel.
12:47:46Yardanicowell, and also posix/winlean stuff - TCP_NODELAY
12:48:07dom96heh, I guess I'm not the only one writing a fast HTTP server
12:48:09Yardanicohttps://github.com/2vg/mofuw/blob/master/example/helloworld/minimal.nim
12:48:13Yardanicoseems pretty good
12:48:15dom96and that's good
12:48:24FromGitter<ZarsBranchkin> I love how hyped that readme is
12:48:25Yardanicodom96, competition is always good
12:48:40Yardanicowait that
12:48:44Yardanico*what - "multi-thread event-loop."
12:48:56miranzars: on the other hand, it screams "i'm 13 year old" to me :D
12:48:56Yardanicohe uses threadpool
12:49:09Yardanicomiran, he's just japanese :P
12:49:14enthus1a1tasynchttp needs to be fuzzed, it was to easy back then to spot bugs
12:49:21enthus1a1ttoo
12:49:23dom96Yardanico: Are you sure it's a he? :)
12:49:32Yardanicodom96, they :D
12:49:39FromGitter<mratsim> @miran, I agree but snapchat was built by 13yo :D
12:49:41Yardanicohttps://github.com/2vg/mofuparser his parser
12:49:45Yardanicotheir*
12:49:56federico3https://ni-vg.com/ ehm
12:50:00YardanicoIDK what is this though - https://github.com/2vg/mofuparser/blob/master/mofuparser.nim#L1
12:50:23Yardanicoand parser is sadly unsafe (uses ptr and casts)
12:50:26FromGitter<ZarsBranchkin> damn, at least has more content than my website
12:50:28Yardanicowell, for performance
12:50:56FromGitter<mratsim> we need more examples of safe DSL like the SQL one in the tutorial
12:52:00dom96snapchat wasn't built by 13 year old?
12:53:05dom96FWIW I was 14 when I started with Nim :P
12:53:23mirandom96: how old are you now? :)
12:53:36dom9622
12:53:54miranwow!! i thought you were older!
12:53:57mirani was 31 when i started with nim
12:54:12miranand i'm 31 now :D
12:54:12FromGitter<ZarsBranchkin> oh wow, started off with Nim real early
12:54:24FromGitter<ZarsBranchkin> Yeah, started with Nim this year as well
12:54:26Yardanicomiran, I was 16 when I started Nim :P
12:54:43Yardanico(one year ago)
12:55:04FromGitter<2vg> > **<Yardanico>** IDK what is this though - https://github.com/2vg/mofuparser/blob/master/mofuparser.nim#L1 ⏎ ⏎ It is used for some token check #L199 (https://github.com/2vg/mofuparser/blob/master/mofuparser.nim#L199)
12:55:11miranomg, what am i doing here among all you youngsters
12:55:15planetis[m]https://github.com/2vg/mofuw <- hey what language is he speaking? :p
12:55:32federico3ZarsBranchkin: "real early" is 9
12:55:59FromGitter<ZarsBranchkin> Well yeah, but I wasn't aware Nim was around for this long
12:56:06Yardanico@2vg , btw, maybe you can change these if statements to one statement and compare if value is in set? https://github.com/2vg/mofuparser/blob/master/mofuparser.nim#L109
12:56:11Yardanicosets are very high performacne in nim too
12:56:16Yardanico*performance
12:56:44Yardanicolike `if not(cast[ptr char](buf)[] in {'\72', '\84' etc}:
12:57:04Yardanicoif not(cast[ptr char](buf)[] in {'\72', '\84' etc}):
12:57:17planetis[m]oh sorry didn't realise the author was here no offence mate
12:57:18FromGitter<2vg> > **<Yardanico>** @2vg , btw, maybe you can change these if statements to one statement and compare if value is in set? https://github.com/2vg/mofuparser/blob/master/mofuparser.nim#L109
12:57:41dom96miran: Don't worry, plenty of seniors here :P
12:58:22Yardanico@2vg ah, I understand
12:58:29Yardanicoyou need buf +=1 between these checks
12:58:45mirandom96: seniors? SENIORS? listen to me punk! when i was your age, we treated older people with respect!!! {P
12:58:48miran:P
12:58:51FromGitter<2vg> yes
12:59:15FromGitter<ZarsBranchkin> Sounds like something that can be turned into a macro though
12:59:20federico3oh 2vg is here - youkoso
12:59:20dom96miran: lol
12:59:40YardanicoZarsBranchkin: template should be enough :)
12:59:56Yardanicoor maybe for loop
13:00:01Yardanicoyeah
13:00:10FromGitter<ZarsBranchkin> Yeah, not sure why for loop wasn't used here
13:00:41Yardanicoanyway, I'm gonna experiment with mofuw
13:00:52FromGitter<2vg> arigatou ⏎ ⏎ By the way, I'm pretty interested by httpbeast (https://github.com/dom96/httpbeast)
13:01:10dom96yeah, I need some time to work on it
13:01:32federico3that's a lot of work
13:01:34dom96I got discouraged though because I benchmarked the most barebones server and it didn't perform that much better than Rust's tokio
13:02:41Yardanico@2vg - btw, about tokio-minihttp vs your mofuw - does tokio have multi-threading?
13:03:11Yardanicoit seems it's single-threaded, but I don't know Rust
13:04:05FromGitter<2vg> > **<Yardanico>** @2vg - btw, about tokio-minihttp vs your mofuw - does tokio have multi-threading? ⏎ ⏎ maybe. ⏎ I looked at lsof but had the same number of cores as the core thread. [https://gitter.im/nim-lang/Nim?at=5a9a9d4435dd17022e1781c5]
13:05:02*federico3 goes back to packaging Nim
13:05:12dom96Pretty sure it does
13:05:20dom96I remember seeing a 'spawn' in its source code somewhere
13:06:26mirandom96: just upgraded using choosenim, and now i get "Warning: Nimble v0.8.1 is not supported by choosenim, using it will yield errors."
13:06:42dom96miran: update your choosenim
13:07:05miranchoosenim update choosenim?
13:07:14dom96no, just run the init.sh script again
13:07:35dom96the newest version allows self updates via `choosenim update self`
13:07:56miranwhere's that script?
13:08:26dom96curl https://nim-lang.org/choosenim/init.sh -sSf | sh
13:08:27dom96Just run this
13:09:03miranError: unhandled exception: cannot open: /home/miran/.nimble/bin/nimsuggest [IOError]
13:09:30dom96is it running?
13:10:08miranheh, vscode was running. closed it, now it seems ok
13:10:29*couven92 quit (Ping timeout: 260 seconds)
13:12:43miraneverything updated. it's testing time :) thanks for the help
13:13:31FromGitter<zacharycarter> @mratsim - updating the playground is going to be difficult without the docker image repo getting updated :/
13:13:42FromGitter<zacharycarter> that or I can update the playground to use devel - but I'm not sure we want that
13:13:56FromGitter<mratsim> the one from @yglukhov ?
13:14:15FromGitter<zacharycarter> I'm using these - https://hub.docker.com/r/nimlang/nim/
13:15:02FromGitter<zacharycarter> I guess this is the repo behind it https://github.com/moigagoo/nimage
13:15:14FromGitter<mratsim> oh, check this one: https://github.com/yglukhov/nim-docker
13:15:58FromGitter<zacharycarter> looks like that one only supports devel...
13:16:12FromGitter<zacharycarter> maybe I'll just write my own :P
13:16:15FromGitter<mratsim> https://github.com/moigagoo/nimage/issues/10
13:17:05FromGitter<zacharycarter> ah - there we go
13:17:48FromGitter<zacharycarter> If he doesn't - I'll just fork his and update it and switch the playground to use my images instead
13:20:01Yardanico@zacharycarter: just make a pr?
13:20:02Yardanicohttps://github.com/moigagoo/nimage/commit/3238fc9cd3f17cb43cef1c9b241145ab0d4085cd
13:20:06Yardanicoit seems easy enough :P
13:24:02dom96I wonder how many people don't say "yes" to the choosenim analytics prompt
13:25:15FromGitter<zacharycarter> @Yardanico - I can make a PR - but if he's not actively maintaining the repo, what good will it do? I fit's that easy to fix - an issue should be just fine I think.
13:27:01Yardanicozacharycarter: I'll try to contact him on VK (russian social network)
13:27:13FromGitter<zacharycarter> sweet - thank you!
13:29:23YardanicoHe said he's busy on work, but he'll try his best to update it today
13:31:17*momf joined #nim
13:31:40FromGitter<mratsim> Yet Another Concurrent lock free data structure: https://www.reddit.com/r/programming/comments/81d5hc/cachetries_a_new_lockfree_concurrent_data/ not sure about the use cases
13:33:15dom96not what I wanted to do lol
13:35:30FromGitter<zacharycarter> Yardanico: sweet! thank you!
13:42:17*Vladar quit (Read error: Connection reset by peer)
13:48:27*r3d9u11 quit (Remote host closed the connection)
13:49:11*r3d9u11 joined #nim
13:56:54*r3d9u11 quit (Remote host closed the connection)
13:58:04*r3d9u11 joined #nim
13:58:53FromGitter<alehander42> I am probably missing something obvious: how can I compile a nim file to js "lib", so all `*` functions are actually generated (even if not invoked)
13:59:06FromGitter<alehander42> (the same way it works for c)
13:59:50Yardanicoturn off deadCodeElim?
14:00:10FromGitter<alehander42> nope, still not generated
14:01:26*dddddd joined #nim
14:02:01FromGitter<alehander42> e.g. ⏎ ⏎ ```proc a*(e: int) = ⏎ echo e ⏎ ⏎ proc b*(x: int) = ⏎ a(x)``` ⏎ ⏎ always generates 0 function defs [https://gitter.im/nim-lang/Nim?at=5a9aaad9e4d1c63604b8d5ac]
14:02:49*wolf135 quit (Quit: Leaving)
14:02:52*couven92 joined #nim
14:03:59*momf quit (Ping timeout: 260 seconds)
14:04:33dom96alehander42: you need to {.exportc.} them
14:06:59Yardanicoyeah, you can just do {.push exportc.} at the start of the file and {.pop exportc.} and the end AFAIK
14:09:16*r3d9u11 quit (Remote host closed the connection)
14:09:53FromGitter<alehander42> thank you, guys, that's working great
14:10:51FromGitter<alehander42> still, I bit puzzled: why `exportc` makes it generate the functions, but not `*` ? (also, it seems the functions are always generated in C, even if they're not `*`)
14:11:15FromGitter<alehander42> `{.pop.}` btw
14:12:14FromGitter<alehander42> ah, I guess because it generates <name>_stuff which wouldn't be usable in another js module ?
14:17:25dom96because the export marker is for Nim only
14:19:42Yardanicoalehander42: nim generates unique names by default to not clash with functions from other libraries
14:20:00FromGitter<alehander42> yeah, I figured that out , makes sense
14:32:34FromGitter<alehander42> ah fuck
14:32:56FromGitter<alehander42> my asyncjs macro replaces all other pragmas of a function
14:33:16FromGitter<alehander42> I have a patch, but I should've found that a little bit earlier
14:52:20*r3d9u11 joined #nim
15:00:40*natrys joined #nim
15:03:51FromGitter<zacharycarter> It looks like - https://github.com/aidansteele/aws_sdk.nim - has quite a few API bindings now
15:04:16FromGitter<zacharycarter> Has anyone tried doing anything with it? I have a prototype I need to build for work - and I was going to use golang
15:05:33FromGitter<zacharycarter> assuming the aws bindings work for dynamodb - the only other missing piece for me to be able to advocate for being able to use Nim, would be the lack of an elasticsearch client
15:08:56FromGitter<ZarsBranchkin> Uhh, how can I get the name of the application being compiled?
15:09:21FromGitter<zacharycarter> https://nim-lang.org/docs/os.html#getAppFilename,
15:10:02FromGitter<ZarsBranchkin> Hmm, what about compile time? I wanted to use it in macro
15:11:06FromGitter<zacharycarter> not sure about that
15:20:00miran@mratsim: "Package 'arraymancer' has an incorrect structure. It should contain a single directory hierarchy for source files, named 'arraymancer', but file 'ufunc.nim' is in a directory named 'tensor' instead. This will be an error in the future."
15:21:20FromGitter<mratsim> yes, but it’s a pain to move that to subdirectories, already told that in the relevant RFC: https://github.com/nim-lang/Nim/issues/6700
15:24:09miranok, i didn't know you know :)
15:24:24FromGitter<zacharycarter> miran: what are doing with arraymancer just ooc?
15:25:21miranzachary: i have just installed it right now, because 'neo' was very slow and impractical for one problem i'm trying to translate from python
15:25:27FromGitter<zacharycarter> @mratsim - what is the functional use case for arraymancer? Is it to provide the building blocks for another lib like tensorflow? Or is it meant to replace such a library?
15:25:30FromGitter<zacharycarter> miran: gotcha
15:25:31mirani'll see if i can do it in arraymancer
15:26:33*r3d9u11 quit (Ping timeout: 268 seconds)
15:27:34miran@mratsim: i have just started - wanted to create a constant tensor, i have seen in docs i should use 'ones' for that - and i get deprecation warning!?
15:29:00leorizehi, is it possible for one to interact with C va_list?
15:29:05miranwarning doesn't say what should be used instead....
15:32:07FromGitter<mratsim> mmmh ones is not deprecated, but there was a version that offered to choose a backend that is
15:32:37FromGitter<mratsim> `ones(3,3)`should work
15:33:52miran@mratsim: how to declare with the new syntax i want ones of type float?
15:33:54FromGitter<mratsim> well onesfloat32 (3,3)
15:35:14miranok, i created with `ones[float](spaceSteps, timeSteps`, and it still raises a warning
15:38:10FromGitter<mratsim> I don’t have any warning with that: ⏎ ⏎ ```import ../src/arraymancer ⏎ let a = ones[float](10, 20) ⏎ echo a``` ⏎ ⏎ What version are you using? #head or a stable one? [https://gitter.im/nim-lang/Nim?at=5a9ac1623fe1be3704c9611e]
15:38:34miranstable, installed with `nimble install arraymancer`
15:39:15FromGitter<mratsim> oh, i know, there is a bug in Nim
15:39:55FromGitter<mratsim> https://github.com/nim-lang/Nim/issues/6436
15:40:11*r3d9u11 joined #nim
15:40:48FromGitter<mratsim> I mentionned it in the PR that introduced the syntax change, the only way is to completely remove the deprecated proc: https://github.com/mratsim/Arraymancer/pull/72
15:42:11miranok, i'll keep using newer syntax
15:42:28miranwould you recommend to install devel version of AM?
15:45:33FromGitter<mratsim> The difference between devel and the latest stable are: ⏎ ⏎ 1) MNIST data loader ⏎ 2) CSV file reader ⏎ 3) Neural net: softmax loss, maxpool, reshape, flatten layers ... [https://gitter.im/nim-lang/Nim?at=5a9ac31d01a2b40f382d67bc]
15:45:39*smt` joined #nim
15:45:48FromGitter<mratsim> There is no change to the pure tensor/Numpy like part
15:46:19miranok
15:47:20miranhow should i declare tensor parameters in functions? is it enough `t: Tensor`? should i give it a type? anything else?
15:48:56*smt quit (Ping timeout: 265 seconds)
15:49:18FromGitter<mratsim> Either t: Tensor[T] or t:Tensor if you never used the T
15:53:02FromGitter<zacharycarter> leorize: something like - https://play.nim-lang.org/?gist=4af33d4dcb7e4324a0718ea53ae662af - I imagine
15:53:15mirani'm getting an error here: `Ts[1..^2, t]` - i want to get elements of column `t`, from the second to the second-last
15:54:14miransimilar error here: `Ts[^2, t+1]`
15:55:36leorizezacharycarter: I mean working with the va_list object itself. Some C func have callback that takes a va_list as a param
15:56:26FromGitter<zacharycarter> oh...
15:57:02FromGitter<mratsim> @miran: https://gist.github.com/mratsim/c03fe1ce187f4b0cb23ad694c06fcfe4
15:57:56FromGitter<zacharycarter> leorize: maybe take a look at these search results: https://github.com/search?l=&q=va_list+language%3ANim&ref=advsearch&type=Code&utf8=%E2%9C%93
15:59:30miran@mratsim: your example works. i'll try to see what am i doing wrong
16:01:10mirancan it have something to do with trying to assign it to a column next to it?
16:01:47mirane.g. `Ts[^1, t+1] = Ts[^2, t+1]`
16:02:55miranok, found the error
16:03:06miranas usual - i'm stupid :D
16:03:32leorizezacharycarter: none seems to implement any way to access the contents :/
16:04:40leorizeanyone know if it's possible to pass a type name from Nim to C?
16:04:44leorizehttp://www.cplusplus.com/reference/cstdarg/va_arg/
16:06:29miran@mratsim: managed to run my program! from this basic example, i must say - arraymancer is very nice/easy/intuitive to use! well done!!
16:07:28FromGitter<mratsim> Thanks :)
16:09:33FromGitter<ZarsBranchkin> Hmm, I tried getAppFilename, but that didn't work for me. Somehow I want to find out the name of the dynamic library that is compiled from Nim
16:12:12*r3d9u11_ joined #nim
16:12:12*r3d9u11 quit (Read error: Connection reset by peer)
16:12:12federico3Nim 0.18.0 is in Debian \o/
16:12:33FromGitter<mratsim> wow, bleeding edge :P
16:12:41*Trustable joined #nim
16:12:44federico3yep
16:13:19*smt` is now known as smt
16:13:31dom96federico3: yay, great work :)
16:13:41FromGitter<ZarsBranchkin> heh, arch is still on 0.17, but at least already flagged as out of date
16:14:04FromGitter<mratsim> @ZarsBranchkin I’m pretty sure I saw a ModuleInfo proc somewhere for that
16:14:10miran@mratsim there is a gotcha with `[5 .. ^5]` vs `[5..^5]` (with and without whitespace). i didn't seen it mentioned in documentation/tutorial. should i make a pr?
16:14:17federico3it should land in Ubuntu soon
16:14:20FromGitter<ZarsBranchkin> hmm, will try looking for it
16:14:29FromGitter<mratsim> @miran oh, yes please
16:15:03miranok, i'll try to play some more to see if something else needs to be added/clarified
16:15:18federico3dom96: it was quite a bit of work... and now it's on the new VCS e.g. https://salsa.debian.org/debian/nim/commits/master
16:15:33FromGitter<mratsim> @zrs
16:15:43FromGitter<mratsim> @ZarsBranchkin it’s instantiationInfo in system
16:16:11FromGitter<mratsim> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a9aca4a7685a046389c37bf]
16:16:43*wolf135 joined #nim
16:19:24FromGitter<ZarsBranchkin> Ah, neat. That's something, but kind of worried about library being renamed, thus name of the source file wouldn't really cut it
16:19:35*kunev quit (Ping timeout: 268 seconds)
16:19:40FromGitter<ZarsBranchkin> I basically get `libtestModule.so` and I want to get that string in Nim
16:21:35*MJCaley joined #nim
16:21:55*kunev joined #nim
16:22:55*r3d9u11_ quit (Remote host closed the connection)
16:24:40*r3d9u11 joined #nim
16:30:27YardanicoI think this can be closed? https://github.com/nim-lang/Nim/issues/7290
16:48:10*r3d9u11 quit (Read error: Connection reset by peer)
16:49:43*endragor quit (Remote host closed the connection)
16:51:05*r3d9u11 joined #nim
16:54:51GitDisc<Teapotrick> I'm back from a long stint of procrastination:
16:54:52GitDisc<Teapotrick> https://thepasteb.in/p/oYhLc6D9B44XgF8
16:54:52GitDisc<Teapotrick>
16:54:52GitDisc<Teapotrick> pls help. I know I can use c2nim and others, but this is a learning experience. I will use them eventually.
16:54:52GitDisc<Teapotrick> My aim is to call this template with a proc name, a list of its arguments (preferably named), and its return type. The args list is of variable length and types.
16:57:55*r3d9u11 quit (Remote host closed the connection)
16:58:52*r3d9u11 joined #nim
17:16:58dom96Teapotrick: I'm afraid you will need to use a macro for this
17:18:47GitDisc<Teapotrick> waheee. back to macros. i'm okay with that.
17:18:58GitDisc<Teapotrick> any...hints? 😛
17:19:32dom96echo args.treeRepr
17:19:52dom96dumpTree: <the proc you want to generate>
17:20:02dom96figure out how to create the AST shown by `dumpTree`
17:20:10dom96and use the info from 'args' to do it
17:26:06*MJCaley quit (Quit: MJCaley)
17:38:28*miran quit (Quit: Konversation terminated!)
17:41:03*r3d9u11 quit (Read error: Connection reset by peer)
17:42:54*r3d9u11 joined #nim
17:43:20*miran joined #nim
17:44:03GitDisc<Teapotrick> ah okay. that seems to be on the right tracks. it might take me a while to work out though. 😛 thank you!
17:47:25Yardanico@zacharycarter, dom96 - nimage has 0.18.0 added
17:47:26Yardanico30 mins ago
17:47:33Yardanicohttps://github.com/moigagoo/nimage/commit/cf58d560e8b72ba2377efed3d062ac05bce2a449
17:47:49Yardanicodom96 https://github.com/moigagoo/nimage/issues/11 :)
17:49:48*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
17:49:49*r3d9u11 quit (Read error: Connection reset by peer)
17:49:49*r3d9u11_ joined #nim
18:05:32*r3d9u11_ quit (Remote host closed the connection)
18:06:39*SenasOzys quit (Remote host closed the connection)
18:10:46*SenasOzys joined #nim
18:17:42*r3d9u11 joined #nim
18:17:48couven92Haha, I just watched a YouTube video where someone pranked a "Microsoft Tech Support"-Scammer... Because these scammers often use TeamViewer for RemoteAccess, TeamViewer now just flat out denies any connection to an IP in India! LOL!
18:18:02couven92https://www.youtube.com/watch?v=DFRbUhhQmZs
18:18:30dom96couven92: #nim-offtopic
18:18:43couven92dom96, yeah, sorry
18:18:44couven92:P
18:18:50couven92I forgot myself
18:26:20*r3d9u11 quit (Remote host closed the connection)
18:29:44*MJCaley joined #nim
18:35:46dom96I submitted Nim to lobste.rs :) https://lobste.rs/s/gwzrlh/nim_v0_18_0_formatted_string_literals
18:39:07*PMunch joined #nim
18:48:29Yardanicodom96, Araq https://github.com/nim-lang/Nim/issues/7291
18:48:50Yardanicothis is intended, right?
18:48:51Yardanicoor not?
18:49:41Yardanicowait, "a" < "" and "a" > "" both output false
18:49:53PMunchThat sounds like a bug :P
18:50:14PMunchOtherwise "a" == "" should evaluate to true
18:51:27Yardanicobut we have a lot of tests, how can this sneak into a major release? :D
18:51:55dom96I doubt our test coverage is even at 10%
18:55:13*ofelas joined #nim
18:55:50miranwell, another priority before 1.0 :)
18:57:59Yardanicodom96, 0.18.0 docker images are uploaded to docker hub
18:58:41dom96Yardanico: okay, great, but why highlight me?
18:59:49FromGitter<moigagoo> Hi guys!
19:00:03FromGitter<moigagoo> I've just pushed Docker images for Nim 0.18.0 to Docker Hub.
19:00:20Yardanicodom96, well, IDK :P
19:00:31Yardanico@zacharycarter 0.18.0 images are on docker hub
19:03:24FromGitter<moigagoo> Unfortunately, I'm very busy at work and can't update the images as soon as a new release is ready.
19:04:00FromGitter<moigagoo> But adding a new version is pretty easy, anyone can do it. Just add a line to config.json and rebuild `build.nim` in Linux.
19:04:19FromGitter<moigagoo> All images will be rebuild on Travis CI after push to master.
19:04:34FromGitter<moigagoo> Which makes me think if we could automate that.
19:04:46*miran quit (Quit: Konversation terminated!)
19:04:56FromGitter<moigagoo> Should be pretty easy.
19:07:22*miran joined #nim
19:07:58dom96moigagoo: thanks for updating :)
19:09:22FromGitter<moigagoo> @dom96 Thanks for the great new release ;-)
19:09:43FromGitter<moigagoo> @dom96 Who's in charge of Nim's CI routine?
19:09:57dom96CI routine?
19:10:25FromGitter<moigagoo> I mean, Nim does use some sort of CI service to automate stuff on release, doesn't it?
19:10:35dom96no
19:10:50FromGitter<moigagoo> Oh, now I see :-)
19:14:09FromGitter<moigagoo> Maybe we should discuss introducing one. I'm sure there are tasks other then building and uploading Docker images that could be automated. Even if it's the only one, I'd still like to get it automated. It's not a good situation when the availability of Nim's Docker images depend on my schedule and current workload.
19:18:13avsejhi guys, what revision has been released as 0.18.0?
19:18:43avsejwhen I download tarball, i see different code than at https://github.com/nim-lang/Nim/blob/v0.18.0/lib/pure/uri.nim for example
19:19:01avsejand tests are failing on the version from tarball
19:19:48avsejtarball version of uri.nim has parseQuery*, while on github there is no such function
19:20:17FromGitter<moigagoo> I guess I'll open a discussion issue on GitHub.
19:21:42FromGitter<mratsim> Give commit rights to dom96 :)
19:21:56avsejmaster and devel branches also do not have this function
19:22:20FromGitter<mratsim> or maybe have nimage be part of Nim repo
19:22:20avsejI wonder whether the source tarball was really tested at all
19:22:54dom96oh that's bad
19:23:24dom96but only uri.nim is affected
19:23:29avsejit was some PR branch? :)
19:23:33avsejI'm not sure
19:23:50dom96no, I have non-committed changes which got pulled into the tarball
19:23:52avsejI have two failures at least, and right now it is only about failing "lib" tests
19:24:09avsejcould you replace tarball with proper one?
19:24:18dom96yeah, I will
19:24:26avsejalso I have nimble tests failure, but I haven't looked into it yet
19:25:04avsejcould you also check that "nimble-all" category passes on the release? thanks
19:26:57dom96I'm just fixing the uri.nim
19:27:02dom96any other issue are likely something else
19:28:16dom96*likely caused by
19:29:47dom96This is why we need definitely need to automate this
19:30:04dom96*we definitely
19:30:07*dom96 can't write today
19:33:28FromGitter<tim-st> What is an example where `x <% y ` is different from `x < y` for x,y int64? I saw this op the first time today. It says `Returns true iff ``unsigned(x) < unsigned(y)`
19:33:54FromGitter<mratsim> negative int
19:34:12FromGitter<krux02> I just read through the changelog of version 18. I would have liked to see list comprehension to be deprecated without replacement.
19:34:58FromGitter<krux02> @tim-st the `<%` operators are a relic from the past. You should not use them.
19:35:15avsejthanks dom96
19:35:32dom96packeger's won't be happy
19:35:35FromGitter<tim-st> @mratsim does it have better peformance compared to `<` when I know of x >= 0 ?
19:35:35FromGitter<krux02> it is to threat singed integers as unsigned integers, but that is what converting to unsigend integers is for.
19:35:50FromGitter<tim-st> ok, thanks!
19:36:05FromGitter<mratsim> “threat” at gun point
19:36:09FromGitter<mratsim> :P
19:36:15FromGitter<krux02> and no it does not have better performance
19:36:21FromGitter<tim-st> @krux02 I'm currently porting the strutils procs like you said and it's used there
19:36:27FromGitter<tim-st> ok, thanks!
19:36:38avsejdom96, have you uploaded new tarball already?
19:36:42FromGitter<tim-st> (fixing `\0`)
19:36:59FromGitter<krux02> @tim-st my memory is corrupted, what did I say about the strutils procs?
19:37:15dom96avsej: no, uploading now
19:38:05avsejwow
19:38:16FromGitter<tim-st> @krux02 that it would be good to have the `\0` bugs fixed in strutils and that you would have a look at a pull request when I would fix it 😄
19:38:18avsejfrom 4.1MB to 31MB?
19:38:34dom96yeah, i'm not sure what happened there
19:38:34avsejdom96, I guess something wrong again
19:38:46avsejcould you package it on the clean tree?
19:38:53FromGitter<krux02> ah that one. Yes I can take a look at the pull request.
19:38:59FromGitter<tim-st> 👍
19:39:46dom96avsej: it's probably just the xz compression level
19:40:09avsejafair niminst has -9 level hardcoded
19:40:42dom96I recompressed it manually
19:40:42avsejhttps://github.com/nim-lang/Nim/blob/devel/tools/niminst/niminst.nim#L688
19:40:55avsejcould you recompress with -9
19:41:06dom96I tried
19:41:14avsej31M is not acceptable for source archive, so it still big?
19:41:23FromGitter<krux02> today I wrote a two people chat application in bash that worked with pipes to send messages. It was a single line of code
19:41:26avsejmaybe some binary sneaked into archive?
19:42:20dom96let me try again with the same command niminst uses
19:42:49FromGitter<mratsim> So D lang removed dependencies on Visual Studio on Windows: https://dlang.org/blog/2018/03/03/dmd-2-079-0-released/. It’s raining release today
19:44:33dom96avsej: ok, that worked
19:44:38avsejthanks
19:49:00federico3and takes forever to decompress
19:49:36*Mat4 joined #nim
19:50:50dom96yeah, but 4mb!
19:50:57dom96I wish I could get the tar.gz that far down
19:51:53Mat4hello
19:52:23federico3c_code is by far the biggest dir
19:55:52federico3dom96: after hardlinking duplicate files in c_code it went from 396MB to 152MB
20:01:26avsejbetter keep it smaller, because it will save space on mirrors and all derived packages (like SRPMs), and also saves network traffic. CPU spent on decompression is not that important, as releases are not done every day
20:01:52FromGitter<mratsim> +1, if you want to save CPU, kill Javascript ;)
20:02:08federico3compressing c_code only led to 10MB tho
20:03:10Mat4is it planed to support multiple return values ?
20:03:17YardanicoMat4, it's already supported
20:03:19Yardanicojust use a tuple
20:03:40FromGitter<mratsim> you’re too fast Yarda :P
20:04:05Yardanicofederico3, well, I use zstd compression on my btrfs fs and csource uses 87mb (zstd compressed it with 5x ratio)
20:07:06Mat4well, I would prefer a direct possibility to manipulate return values
20:07:48FromGitter<mratsim> @mat4, do you use `result.a = …` and `result.b = …`
20:07:57FromGitter<mratsim> or give us a pseudo code snippet
20:19:58Mat4I must declare global variables as interface to specific machine-code routines which are compiled at runtime. I want to replace this variabes though functions to be called at demand because such way the JIT compiler generating this code woukd be executable as independent process.
20:23:25Mat4using a tuple just complicate the call overhead without reason
20:26:55dom96Mat4: is there an equivalent in another language that you want in Nim?
20:27:11FromGitter<mratsim> Do you have any snippet? ⏎ If you don’t want any overhead you shouldn’t use result but pass alredy allocated buffers as var to your procs. ⏎ You can use the tuple destructuring to easily assign tuples to variables like `let (a, b) = MyFooTupleProc(foo)` ⏎ You can also use a tuple of pointers if passing var buffers is overkill [https://gitter.im/nim-lang/Nim?at=5a9b051e26a769820b2a5006]
20:27:14dom96tuples are literally multiple return values
20:27:54FromGitter<mratsim> Also as far as I know, all languages that have multiple return values uses tuples.
20:29:40*ipjk joined #nim
20:29:59*PMunch quit (Quit: leaving)
20:30:12FromGitter<krux02> not the go language
20:31:17Mat4I just evaluate possibilities at moment.
20:31:29FromGitter<mratsim> @Mat4: this is an example of globals retrieved at runtime: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/backend/opencl_global_state.nim#L29
20:32:03FromGitter<mratsim> Proc is defined here: https://github.com/unicredit/nimcl/blob/e47dfa77c30dfd56694f591bafbc8e563e5c45c8/nimcl.nim#L111-L117
20:33:22FromGitter<mratsim> @krux02 I’m reading that but I think it’s tuples no? https://gobyexample.com/multiple-return-values
20:34:38FromGitter<krux02> it looka like it. but there is no tuple type in the language.
20:35:20FromGitter<krux02> just functions with n aruments and m return values.
20:35:59FromGitter<cabhishek> Hi everyone, I think the "search" feature on the docs is broken. Steps to reproduce 1) goto https://nim-lang.org/docs/tut1.html 2) type "json" (works) 3) On the actual json doc page typing anything in the search box doesn't seem to work.
20:36:33FromGitter<cabhishek> console says ```dochack.js:1448 Uncaught TypeError: Cannot read property 'toLowerCase' of undefined ⏎ ⏎ ```at dosearch_28190 (dochack.js:1448) ⏎ at wrapper_28415 (dochack.js:1527)`````` [https://gitter.im/nim-lang/Nim?at=5a9b0750888332ee3af63cb2]
20:36:47Mat4mratsim: thanks, good example
20:37:08FromGitter<cabhishek> I am seeing that in chrome Version 64.0.3282.186
20:37:47dom96cabhishek: yeah, please report it on GitHub
20:38:21FromGitter<cabhishek> @dom96 will do thanks
20:38:24Mat4ciao
20:38:27*Mat4 quit (Quit: Leaving)
20:41:54*r3d9u11 joined #nim
20:54:42*MJCaley quit (Quit: MJCaley)
20:59:40miran@mratsim: been playing with arraymancer some more.... it seems it is memory-hungry :) the same example takes twice as many RAM as python/numpy :/
21:00:43FromGitter<krux02> miran: I haven't been using arraymancer, but that surely is suspicious, because generally I would expect Nim to have more compact data structures that python could have.
21:01:22mirankrux02: it might be because of my mishandling....
21:02:20dom96wow, Elm language drama: https://www.reddit.com/r/elm/comments/81bo14/do_we_need_to_move_away_from_elm/
21:02:31*rokups quit (Quit: Connection closed for inactivity)
21:04:32FromGitter<mratsim> @miran post the code as a bug report. As far as I know the only memory issue in Arraymancer is converting to strings, the function is recursive and allocates a lot but for computation it should be far more efficient
21:05:26*S1t1Schu is now known as SitiSchu
21:05:35miranno strings here, just big 2d arrays (tested on 10k x 10k and larger)
21:06:26SitiSchuHow would I go about dynamically importing a dll provides as CLI argument ? I cant use a variable in the dynlib pragma
21:07:18*r3d9u11 quit (Remote host closed the connection)
21:07:40*r3d9u11 joined #nim
21:07:50SitiSchuoh nvm
21:07:53miranmratsim, krux02: here's a quick example: https://gist.github.com/anonymous/5c8766cc3f5b8eb6eb08cfb1c5a39c75
21:08:04SitiSchuinstead of using a var I can just use paramStr(1) which works
21:08:14miranif there's something i'm doing wrong and needs to be changed, please let me know
21:11:09FromGitter<krux02> @mratsim you can make a few little changes to make string generation without a lot of allocaitons.
21:11:27miranbtw, this example is also 2x slower than python version....
21:12:03FromGitter<krux02> insted of ``proc `$`(arg: Tensor)`` you write ``proc add(result: string; arg: Tensor)``
21:12:59FromGitter<krux02> ``proc `$`(arg: Tensor): string`` will be implemented as ``result = ""; result.add(arg)``
21:13:52FromGitter<krux02> and all instanceces of ``result.add($child)``you change to ``result.add(child``
21:13:58FromGitter<krux02> that's it
21:14:47FromGitter<mratsim> @miran did you compile with -d:release? it indeed use a lot of memory but it doesn’t seem slow
21:14:52*Trustable quit (Remote host closed the connection)
21:15:15mirani did. it takes 8GB of ram and runs in 13.8 sec on my computer
21:15:32FromGitter<krux02> oh, then I can't run it without swapping
21:15:33miranpython version is 3.9GB and runs in 6.1 sec
21:15:52FromGitter<mratsim> I’m tracing it
21:17:34mirankrux: lower `timeSteps` to 10000 - it takes 2.5GB here and runs in 2.7 sec (python: 700MB, 1.3 sec)
21:18:42FromGitter<mratsim> (https://files.gitter.im/nim-lang/Nim/ys1n/2018-03-03_22-18-27.png)
21:19:34federico3mratsim: where's that tracer coming from?
21:19:37FromGitter<mratsim> btw does Python use float64 by default
21:19:48FromGitter<mratsim> Apple Instruments.app
21:21:23*natrys quit (Quit: natrys)
21:22:00FromGitter<krux02> miran: I looked at the code, and for my personal taste the amount of used Ram should not depend on the amount of timesteps at all.
21:22:22miranmratsim: now i tried to give float64 explicitly (`Ts = starting_temp * np.ones((time_steps, space_steps), dtype=np.float64)`) - still the same ram usage and speed
21:22:24FromGitter<krux02> These operations all seem to create intermediate tensors on the heap
21:22:56FromGitter<krux02> float is just an alias for float64
21:23:13mirankrux02: anything i can do to make this nicer?
21:23:34FromGitter<mratsim> @krux02 normally it shouldn’t, Arraymancer uses reference semantics since a while ago and same for Python
21:23:53FromGitter<krux02> I once had a project that compiled expression like this:
21:24:02FromGitter<mratsim> so slicing shouldn’t create intermediate tensors
21:24:15FromGitter<krux02> tensorMagic: ⏎ ⏎ ```Ts[t+1, 1..^2] = Ts[t, 1..^2] + dt * f(Ts[t, _])``` [https://gitter.im/nim-lang/Nim?at=5a9b127f35dd17022e19903c]
21:24:56FromGitter<krux02> into loops and calls to blas. No aloocations
21:25:33FromGitter<krux02> but at some point I did not continue on the project
21:25:45FromGitter<krux02> the syntax was also a bit different
21:27:24FromGitter<krux02> ``X[i,j] = A[i] * B[j]`` would be an outer product and ``X = A[i] * B[i]`` would be a dot product. And I could do all combinations and stuff
21:27:55FromGitter<mratsim> ah that would be interesting, I’d like to add einsum with a similar syntax
21:28:26FromGitter<krux02> yes einstein notation
21:28:50FromGitter<krux02> But I don't have anything personally to do with tensors.
21:29:32FromGitter<krux02> But I peeked into Einsteins relativity theory to read his introduction of Einstein notation (he din't call it that way, he just declared to use it that way)
21:31:20*couven92 quit (Remote host closed the connection)
21:32:02*couven92 joined #nim
21:36:54FromGitter<mratsim> @miran I have some idea of what is going on
21:37:01FromGitter<mratsim> (https://files.gitter.im/nim-lang/Nim/GEoP/2018-03-03_22-36-42.png)
21:38:04mirannow i tried to create an array (`array[timeSteps, Tensor[float]]`) with 1d tensors
21:41:00FromGitter<mratsim> I have some heap allocations somewhere, I think maybe in the metadata, like taking a slice of strides of shape
21:41:57FromGitter<Bennyelg> why I see ''no side effects'' twice ? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a9b16a5f3f6d24c68329ffa]
21:44:03miranusing array and 1d tensor: 12 seconds (instead of 13), and 6 GB ram (instead of 8)
21:46:42miranfor example with 10000 timeSteps: 900MB (instead of 2.5 GB)
21:47:55FromGitter<Bennyelg> ```code paste, see link``` ⏎ ⏎ any example? [https://gitter.im/nim-lang/Nim?at=5a9b180b35dd17022e19a6ad]
21:49:27*miran quit (Quit: Konversation terminated!)
21:50:05FromGitter<mratsim> @miran: I think this is also slow in Arraymancer: assignment to slices `Ts[t+1, 1..^2] = Ts[t, 1..^2] + dt * f(Ts[t, _])`
21:52:55*r3d9u11 quit (Remote host closed the connection)
21:54:01FromGitter<zacharycarter> !eval echo NimVersion
21:54:04NimBot0.18.0
21:54:12FromGitter<zacharycarter> \o/
21:54:39FromGitter<zacharycarter> playground is g2g for 18.0 thank you @moigagoo !
21:55:19FromGitter<mratsim> =)
21:57:56FromGitter<mratsim> @miran, I’ve commented stuff out and found the issue: https://github.com/mratsim/Arraymancer/issues/190#issuecomment-370183068
21:58:29FromGitter<mratsim> Not sure how to solve it though, it’s assigning to a slice in a loop
21:59:13FromGitter<Bennyelg> @mratsim how do you debug ?
21:59:16FromGitter<Bennyelg> I like it
21:59:34Yardanicoanother big issue with docs (regression) - https://github.com/nim-lang/Nim/issues/7294#issue-302034307
21:59:53Yardanico(well probably it's a regression)
22:00:18FromGitter<mratsim> @bennyelg I use Apple Instruments.App for profiling, check the offending proc, check the C source
22:01:05FromGitter<mratsim> then I deactivate stuff until the issue disappears to narrow down the offender
22:01:31*rockcavera quit (Remote host closed the connection)
22:01:46FromGitter<mratsim> The only thing I can’t debug is when code is uniformly slow: http://wiki.c2.com/?UniformlySlowCode
22:03:12dom96!eval if NimVersion != "0.18.0": echo(":'(") else: echo("yay")
22:03:14NimBotyay
22:03:18dom96:D
22:03:47Yardanico!eval "a" > ""
22:03:49NimBotCompile failed: in.nim(1, 5) Error: expression 'false' is of type 'bool' and has to be discarded
22:03:52FromGitter<Bennyelg> !eval if NimVersion == "0.18.0": echo("OMG")
22:03:54NimBotOMG
22:05:40*fredrik92 joined #nim
22:06:20*freddy92 joined #nim
22:09:30*couven92 quit (Ping timeout: 256 seconds)
22:10:04*fredrik92 quit (Ping timeout: 256 seconds)
22:14:04FromGitter<mratsim> @miran @krux02 I’ve think I’ve narrowed down the issue to Nim allocation: https://github.com/mratsim/Arraymancer/issues/190#issuecomment-370184078
22:16:01dom96maybe it's a bug in the new allocator algorithm?
22:16:13dom96can you try it with 0.17.2?
22:18:25FromGitter<mratsim> it’s even slower because it does not incorporate edubart seq creation fixes
22:19:10FromGitter<mratsim> The slowness is in the newSeqWith proc I think, when I use “zeros” instead of “ones” it’s 5x faster
22:43:28*nsf quit (Quit: WeeChat 2.0.1)
22:46:46FromGitter<mratsim> https://github.com/nim-lang/Nim/issues/7295
23:18:38*smt quit (Ping timeout: 256 seconds)
23:31:05*MJCaley joined #nim
23:55:38dom96invalid type in format string for string, expected 's', but got X [ValueError]
23:55:47dom96This should really happen at compile-time...