<< 10-07-2019 >>

00:00:40*krux02 quit (Ping timeout: 264 seconds)
00:07:32*krux02_ quit (Remote host closed the connection)
00:19:51*dwdv quit (Ping timeout: 268 seconds)
00:39:59*shashlick quit (Remote host closed the connection)
01:13:05FromGitter<coreyleavitt> anyone have any thoughts on this? I haven't run into an issue with loading shared lib functions before https://forum.nim-lang.org/t/4999
01:38:52*seni quit (Ping timeout: 272 seconds)
01:52:23*shashlick joined #nim
01:57:47*lf-araujo joined #nim
02:08:02FromGitter<gogolxdong> Why did browser complains CORS even when `resp(Http200, {"Access-Control-Allow-Origin":"*"} ,"ok")` had been set?
02:16:16*lf-araujo quit (Remote host closed the connection)
02:17:17rayman22201@gogolxdong browsers consider that insecure and just disallow it
02:17:33rayman22201they error on wildcard
02:24:32FromGitter<gogolxdong> https://forum.nim-lang.org/t/4903#30680
02:29:40rayman22201idk. Did you check what mashingan said? are there any requests before your main request? (maybe the ico file or something?)
02:45:21*laaron- quit (Quit: ZNC 1.7.1 - https://znc.in)
02:45:35*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
02:46:13*laaron joined #nim
03:21:04FromGitter<wsdjeg> hello I am author of spacevim. to improve the nim support in spacevim ( lang#nin ) layer I hope any nim users could help to maintain the language layer. you can join https://gitter.im/SpaceVim/SpaceVim or #spacevim in irc. the messages are bridged.
03:21:47FromGitter<wsdjeg> the layer page is spacevim.org/layers/lang/nim/
03:26:25*lritter quit (Ping timeout: 248 seconds)
03:27:13*lritter joined #nim
03:39:52*fjellfras joined #nim
03:49:55*dddddd quit (Remote host closed the connection)
03:50:03*theelous3 quit (Ping timeout: 258 seconds)
04:00:37*lritter quit (Ping timeout: 268 seconds)
04:11:13FromGitter<ratiotile> Strange bug: hexadecimals become 0 https://github.com/nim-lang/c2nim/issues/159
04:40:31shashlick@zacharycarter - sorry i missed your message on nimnuklear
04:41:41FromGitter<zacharycarter> no worries
04:42:38shashlicki haven't looked at it in a while
04:42:48*lf-araujo joined #nim
04:42:58shashlickdid you get your bindings to work?
04:44:52FromGitter<zacharycarter> well sort of
04:45:29FromGitter<zacharycarter> (https://files.gitter.im/nim-lang/Nim/rLVJ/image.png)
04:45:34FromGitter<zacharycarter> something is up - not sure whether it's on the bgfx or nuklear side
04:45:39FromGitter<zacharycarter> so I'm troubleshooting that now
04:46:01shashlickokay so probably beyond the wrapper itself
04:46:04FromGitter<zacharycarter> I'm pretty sure I faced a similar issue a couple of years ago - I just don't remember how I fixed it'
04:46:06FromGitter<zacharycarter> yeah
04:46:33shashlicknimterop should be able to wrap it quickly since it is C
04:46:54shashlickbut ya build on your work
04:47:45FromGitter<zacharycarter> yeah - I have too many bindings already that I need for this project - so making them consumable for everyone else isn't really my goal
04:47:55FromGitter<zacharycarter> I mean - people can use them if they want them, but batteries not included :P
04:48:27*nsf joined #nim
04:49:13*lf-araujo quit (Remote host closed the connection)
04:50:33shashlickya nimgen is becoming a dead end since it is very hard to get a working c2nim for older versions of nim
04:53:21shashlick@Araq - can you please take a look at the c2nim PRs?
05:18:23*narimiran joined #nim
05:18:36*absolutejam1 joined #nim
05:24:41*absolutejam1 quit (Ping timeout: 244 seconds)
05:35:00*solitudesf joined #nim
05:43:16Araqshashlick: oh thanks!
05:46:02FromGitter<mratsim> @krux02: int128 support coming? https://github.com/nim-lang/Nim/pull/11701/files
05:47:46*solitudesf quit (Ping timeout: 272 seconds)
05:49:35Araqmratsim: only for the Nim compiler. :P
05:49:49FromGitter<mratsim> meh
05:50:08Araqwhy? do you need int128?
05:50:09FromGitter<mratsim> btw 0.20 broke shr for my int128 (uint128 are fine)
05:50:30Araqso ... fix your shr?
05:50:38Araqit was a documented change
05:50:54FromGitter<mratsim> we're still targeting 0.19.6
05:51:36FromGitter<mratsim> oh right, I see, I missed that one
05:53:05*solitudesf joined #nim
05:53:51FromGitter<mratsim> I checked the codebase, we use Uint256 99% of the time and there are a couple of Int256
05:53:58FromGitter<mratsim> no Int128
05:56:23FromGitter<arnetheduck> we might use int128 for nimplay
05:57:12Araqwhat's nimplay?
05:57:42FromGitter<arnetheduck> that said, I still suspect we would have been better off with operation-based integers for the EVM instead of type-based signs
05:57:47FromGitter<mratsim> A secret project to take over the WASM world by a storm :p
05:58:10FromGitter<mratsim> https://github.com/status-im/nimplay
05:59:13FromGitter<mratsim> nimplay already uses int128: https://github.com/status-im/nimplay/blob/master/nimplay/types.nim#L9
06:00:17FromGitter<arnetheduck> yeah, they put that in the eei for some reason.. using it for ETH amounts, apparently that's enough to cover all the wei (small eth denomination)
06:01:33FromGitter<mratsim> in Eth2, they changed to Gwey (1 billion wei) so that we can use uint64
06:01:39FromGitter<mratsim> Gwei*
06:04:12Araqwell the 'high(uint64)' fiasco means we need an integer type that can hold both low(int64) and high(uint64) and int128 is our answer to that
06:04:52Araqif we exposed int128 the problem would come back and we should use bigints in the compiler.
06:05:23Araqwell ok, the problem would come back with uint128
06:07:39Araqhaving said that, I don't remember the rationale for not using bigints...
06:09:37*lmariscal quit (Quit: Ping timeout (120 seconds))
06:09:58FromGitter<mratsim> either 32-bit target, or too wassteful, or error-prone/maintainability?
06:10:03*lmariscal joined #nim
06:10:06FromGitter<mratsim> or maybe Javascript:p
06:10:10Araqthank god unsigned floating point types are not in widespread use
06:12:05*absolutejam1 joined #nim
06:17:09*PMunch joined #nim
06:20:19*Vladar joined #nim
06:26:14FromGitter<arnetheduck> why do you need int128 though? ie you can store both highs in 8 bytes and interpret on use?
06:26:48Araqthat's what we keep doing inside the AST, but for computations it's nice to have more bits
06:27:03Araqso that you can catch array[high(int)*high(int), T]
06:31:46FromGitter<arnetheduck> if it's for detecting overflows, you can detect them without introducing bigint arithmetic.. with bigint, you'll have to pay the bigint price everywhere. also, you might have a hard time reconciling the two computational models when it comes to wrapping / saturiation / etc leading to suble bugs (ie `a + b - c` overflowing in one model but not in the other)
06:40:42Araqsure but I don't think it will cause problems since we keep the old intVal in the AST and in the VM
06:43:26Araqbtw natural language sucks, "I don't think it will" should have been "I think it won't"
06:44:12FromGitter<arnetheduck> like, by all means, implement bigint.. just that if it's for overflow, it's generally easier and faster to do overflow detection on uint64 or whatever than to implement multiply-and-everything-else-with-carry for int128.. feel free to use https://github.com/status-im/nim-stint if you need a lib.
06:44:53FromGitter<arnetheduck> undet a closed world assumption, they're the same
06:45:27*solitudesf quit (Ping timeout: 245 seconds)
06:45:35Araqmaybe. but it's weird, I cannot "not think" about something and yet talk about it
07:00:00*gmpreussner quit (Quit: kthxbye)
07:00:41*disruptek quit (Ping timeout: 268 seconds)
07:02:27*krux02 joined #nim
07:02:47*disruptek joined #nim
07:04:35*gmpreussner joined #nim
07:10:05FromDiscord_<Skaruts> is there any advantage in defining methods instead of just procs?
07:10:47FromDiscord_<Skaruts> (methods are a tad annoying because of the {.base.} pragma -- though I'm still using nim 0.19.4 so I may be outdated )
07:13:01FromGitter<mratsim> methods allow dynamic dispatch based on the runtime inherited type
07:13:25FromGitter<mratsim> {.base.} should still be needed on devel
07:14:50*purebadger joined #nim
07:26:19*alexander92 quit (Ping timeout: 246 seconds)
07:26:20PMunchHmm, isn't it possible to use jester and hotCodeReloading at the same time?
07:34:18FromGitter<mratsim> @Araq this is not supported anymore for function aliases? https://forum.nim-lang.org/t/1515#9448
07:34:36*absolutejam1 quit (Ping timeout: 268 seconds)
07:38:46PMunchHmm, I'm not able to use dynlib either with jester
07:39:00PMunchhttp://ix.io/1N46
07:42:42PMunchAh, without -d:useNimRtl it works
07:42:50PMunchHmmm
07:42:57FromDiscord_<Skaruts> what's dynamic dispatch?
07:43:18PMunchBut I have to use that if I want to run Nim dynamic libraries right?
07:43:34PMunchSkaruts, resolving which procedure to call on runtime
07:44:11FromDiscord_<Skaruts> it's better for performance?
07:44:20PMunchNope
07:44:22PMunchWorse
07:44:40FromDiscord_<Skaruts> so simple procs are preferable
07:45:08PMunchYes
07:45:09PMunchhttps://nim-lang.org/docs/tut2.html#object-oriented-programming-dynamic-dispatch
07:45:50FromDiscord_<Skaruts> even with inheritance?
07:46:01PMunchAs long as you can use a proc, then yes
07:46:19PMunchMethods are required for some kinds of inheritance stuff
07:46:22FromDiscord_<Skaruts> better yet, is there a situation where methods are actually preferable?
07:46:27FromDiscord_<Skaruts> ah
07:46:43FromGitter<zacharycarter> https://sciter.com/ - anyone used this / heard anything about it?
07:46:53PMunchmatthiashager.com/proc-method-nim
07:47:00PMunchSkaruts, that might be helpful
07:47:27PMunchzacharycarter, heard about it, but never tried it myself
07:47:34PMunchApparently it's pretty good
07:47:34FromDiscord_<Skaruts> I've been using methods all over the place, whenever I define a type, so... maybe I'll do away with those that can be done away with
07:47:50FromGitter<mratsim> @Skaruts, some update on your topic: https://forum.nim-lang.org/t/5000#31347
07:47:56FromGitter<mratsim> feel free to ask question
07:48:19FromDiscord_<Skaruts> oh thanks!
07:49:56FromGitter<mratsim> regarding methods: short presentation - https://nim-by-example.github.io/oop/
07:50:14FromGitter<zacharycarter> PMunch: may have to play around with it - although I think I'd have to modify bgfx slightly to get it to work
07:51:02FromDiscord_<Skaruts> seems I have quite some reading to do, will get back to you later
07:51:14FromDiscord_<Skaruts> thanks again
07:51:57FromGitter<mratsim> from PMunch link, this is the summary of proc vs methods: ⏎ ⏎ > In general, method should be used over proc when, and only when, you don't know at compile time which object type from your inheritance tree the function will be handling.
07:52:35FromGitter<mratsim> this often happens with a collection of inherited objects
07:53:39FromGitter<mratsim> in terms of speed, methods are at least 3x slower than procs
07:53:56*absolutejam1 joined #nim
07:53:59FromDiscord_<Skaruts> !
07:54:22FromGitter<mratsim> on short ones
07:54:45FromGitter<mratsim> due to the call overhead, Nim must check at run-time which method to call depending on the type.
07:55:09FromGitter<mratsim> for proc, the correct proc is directly put in the binary
07:55:38FromGitter<mratsim> https://github.com/mratsim/Arraymancer/blob/master/benchmarks/implementation/proc_method_closure_bench.nim#L43-L46
07:55:57FromDiscord_<Skaruts> from reading on the structure of JSON types gave me some ideas on how to do things differently, so I may be able to do away with a whole bunch of them
07:56:38FromGitter<mratsim> In this bench they are 4x slower for a VM implementation than a switch: https://github.com/status-im/nimbus/wiki/Interpreter-optimization-resources#nim-implementation-benchmark
07:56:52FromDiscord_<Skaruts> also because I was having the problem of not being able to store subtypes in sequences due to different size from the parent type
07:57:18FromGitter<mratsim> you need to use a ref object for that
07:57:58FromGitter<mratsim> At a low-level, with ref objects the sequence will store pointers so whatever the real object, in the sequence they will all have the same size.
07:59:22FromDiscord_<Skaruts> indeed, I noticed the JSON module `JsonNode = ref JsonNodeObj`
07:59:36FromGitter<mratsim> Anyway, Nim give you lots of flexibility, I don't think there is a huge perf bottleneck of methods here so choose according to what is most ergonomic to you and your users
08:00:05FromGitter<mratsim> yeah Json also has overhead and methods are not that slow.
08:00:10FromDiscord_<Skaruts> I made a test of my stuff with the same type of logic and it worked
08:00:24FromGitter<zacharycarter> PMunch: https://github.com/sciter-sdk/nsciter - may have to play around with this
08:02:08PMunchIt's really interesting how they seem o have a lot of antivirus products based on Sciter
08:02:13PMunchI wonder how that came about
08:02:38Araqthat explains a lot...
08:02:41Araq:-/
08:03:11PMunchWha does?
08:03:16FromGitter<mratsim> btw @PMunch, for your next Nim metaprogramming example, I think that this is quite good: https://forum.nim-lang.org/t/5000#31347
08:03:28AraqPMunch, why antivir UIs look the way they do
08:04:11FromGitter<mratsim> because your metaprogramming UI example was probably overwhelming (I don't remember the small example you gave but between that and your UI macros there was a huge jump)
08:04:49*crem quit (Ping timeout: 246 seconds)
08:06:45*crem joined #nim
08:07:54PMunchHaha yeah, that example was maybe a tad much
08:08:49PMunchI just really wanted to show some of the power of macros
08:10:07FromGitter<mratsim> Yeah I understand. We should also make the audience feel, "how, that simple, I can get there" ;)
08:10:27FromGitter<mratsim> s/oh/how
08:10:45FromGitter<mratsim> (actually the reverse but you understood what I meant)
08:11:08*floppydh joined #nim
08:17:20livcdzacharycarter: therea re nim bindings for sciter
08:17:54livcdAraq: but there are other UIs built with sciter...the AVs UI just have to look eye candy
08:20:02PMunchmratsim, yeah it's a hard balance. Wow factor and ease
08:20:06livcdPMunch: it's because Symantec contracted the sciter guy as far as i remember and the other vendors just followed the suit
08:22:47FromGitter<zacharycarter> livcd: yeah - found them just a moment ago
08:23:51livcdzacharycarter: oops missed that :) sorry
08:25:07FromGitter<zacharycarter> np :)
08:29:54*absolutejam2 joined #nim
08:32:34*absolutejam1 quit (Ping timeout: 268 seconds)
08:43:07PMunchAaah right, that makes sense
09:02:57*absolutejam2 quit (Ping timeout: 245 seconds)
09:05:31*couven92 joined #nim
09:10:41*lf-araujo joined #nim
09:14:24*leorize quit (Ping timeout: 260 seconds)
09:15:43*leorize joined #nim
09:15:50*absolutejam2 joined #nim
09:20:19PMunchHmm, is there a way to get the name of the currently compiling module
09:20:29PMunchBut from a library
09:21:17PMunchSo myprogram.nim would import coollib.nim and in coollib.nim there is a macro that can read the name "myprogram"
09:28:24*leorize quit (Ping timeout: 260 seconds)
09:28:59*leorize joined #nim
09:32:12FromGitter<zacharycarter> I don't think so - but I'm not certain either. Just taking a quick look at extcompiler.nim and it doesn't seem like it to me
09:34:39PMunchHmm, it seemed to be possible: stackoverflow.com/questions/29398377/unit-testing-in-nim-is-it-possible-to-get-the-name-of-a-source-file-at-compile
09:36:28FromGitter<zacharycarter> oh I think I misunderstood what you're trying to accomplish, okay I think I get it now
09:42:24FromGitter<zacharycarter> could you write a template in `myprogram.nim` that returns the filename and then call that template in `coollib.nim`
09:42:54*stefanos82 joined #nim
09:45:12*leorize quit (Ping timeout: 260 seconds)
09:46:41*lmariscal quit (Ping timeout: 248 seconds)
09:47:28*lmariscal joined #nim
09:50:08Araqhmm why does the compiler depend on uri.nim...
09:50:44*dwdv joined #nim
09:58:32*seni joined #nim
09:58:49*alexander92 joined #nim
10:06:22*seni quit (Remote host closed the connection)
10:07:13*clyybber joined #nim
10:09:59*alexander92 quit (Quit: WeeChat 2.4)
10:10:14*alexander92 joined #nim
10:10:29*lf-araujo quit (Quit: lf-araujo)
10:10:45*lf-araujo joined #nim
10:11:52*purebadger quit (Ping timeout: 246 seconds)
10:12:05*leorize joined #nim
10:20:10*alexander92 quit (Read error: Connection reset by peer)
10:22:26*alexander92 joined #nim
10:26:21*alexander92 quit (Read error: Connection reset by peer)
10:28:40*alexander92 joined #nim
10:29:24*purebadger joined #nim
10:31:36*alexander92 quit (Read error: Connection reset by peer)
10:32:14*alexander92 joined #nim
10:33:25*alexander92 quit (Client Quit)
10:33:48*alexander92 joined #nim
10:34:09*purebadger quit (Ping timeout: 248 seconds)
10:34:47*purebadger joined #nim
10:35:15PMunchzacharycarter, well I was hoping to make it invisible to myprogram
10:36:22*lmariscal quit (Ping timeout: 246 seconds)
10:36:22*alexander92 quit (Read error: Connection reset by peer)
10:36:46*lmariscal joined #nim
10:37:14*alexander92 joined #nim
10:37:20PMunchI guess I could tell people to include coollib instead of import it
10:38:26PMunchHmm, currentSourcePath still picks up that it is a different file..
10:39:25PMunchCan I read the value of output?
10:41:09*alexander92 quit (Read error: Connection reset by peer)
10:42:04*alexander92 joined #nim
10:46:01*alexander92 quit (Read error: Connection reset by peer)
10:46:17*tjmac joined #nim
10:47:20*alexander92 joined #nim
10:50:57*lf-araujo quit (Ping timeout: 250 seconds)
10:51:10*alexander92 quit (Client Quit)
10:51:47*alexander92 joined #nim
10:53:22*__Myst__ joined #nim
10:53:30__Myst__Is it weird to call the first parameter of a proc "self" or "this"?
10:53:39PMunchNope
10:53:44__Myst__ok
10:53:45PMunchIt's actually pretty common
10:53:47__Myst__is self or this more common?
10:53:57PMunchI'd say it's self
10:54:57PMunchThere actually used to be a pragma (think it still exists but is deprecated) named `this`. You could do `{.this: self.}` and it would allow you to use all of the fields of self without the argument name
10:56:05__Myst__that's cool
10:56:09__Myst__thank you PMunch very helpful :)
10:56:23*alexander92 quit (Ping timeout: 244 seconds)
10:58:33PMunchNo problem :)
11:00:29*fjellfras quit (Quit: Leaving)
11:01:15PMunchHmm, I keep getting: "Error: VM not allowed to do FFI, see `compiletimeFFI`"
11:01:45PMunchBut only when I compile with -d:useNimRtl
11:02:46*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
11:03:15*laaron joined #nim
11:07:09__Myst__Must multi-methods resolve left-to-right?
11:07:26__Myst__i.e. can i not do `method compile(self: Compiler, value: String)` and `method compile(self: Compiler, value: Number)`?
11:08:40PMunchHave you seen the note here: nim-lang.org/docs/tut2.html#object-oriented-programming-dynamic-dispatch
11:08:43narimiran__Myst__: can't you use `proc` instead of `method`?
11:08:49PMunch"Starting from Nim 0.20, to use multi-methods one must explicitly pass --multimethods:on when compiling."
11:09:04__Myst__narimiran: i think i'm confused about dispatching in nim
11:09:13*absolutejam2 quit (Ping timeout: 245 seconds)
11:09:28__Myst__i have a subclass and i want to dynamically call each compile variant
11:09:32__Myst__but choosing at runtime
11:09:36narimiranah, ok then, sorry
11:11:23PMunchHmm, a template that uses currentSourcePath uses the source path of module the template is in..
11:12:23ZevvHow do I mark a PR as a discussion point?
11:13:13*jxy quit (Quit: leaving)
11:13:34*jxy joined #nim
11:13:38Zevvah the little-green-error-on-the-submit-button
11:13:54narimiranZevv: you put it in https://github.com/nim-lang/RFCs ? ;)
11:14:35Zevvnope, I just made a PR.
11:15:09ZevvMy experience with RFCs is that the die of hunger and thrirst after spending lonely and bored last days with no attention.
11:18:03narimiranthat's true :)
11:32:42FromGitter<mratsim> @__Myst__ you're confusing multimethods purpose, multimethod is to dispatch depending on 2 or more dynamic types
11:33:08__Myst__@mratsim: hm?
11:33:09FromGitter<mratsim> but in your case, only Compiler is dynamic (I suppose)
11:33:30FromGitter<mratsim> unless you implemented a dynamic String and Number type?
11:34:31__Myst__compiler subclasses from value
11:34:33__Myst__Compiler is static
11:34:38__Myst__i mean String & Number subclass from Value
11:34:40__Myst__Compiler is just an object
11:34:53__Myst__There's also SExpr which has values in it that can be anything
11:35:19FromGitter<mratsim> so you only need the single dispatch methods then
11:35:48FromGitter<mratsim> ah it's PMunch remark that confused me
11:36:10FromGitter<mratsim> mmm I'm not sure about left to right resolution.
12:00:42*clyybber quit (Quit: WeeChat 2.5)
12:07:11FromDiscord_<Stuffe> im loading a table with 50k int, string pairs from a database into a table and it takes 7.5 seconds
12:08:00FromDiscord_<Stuffe> but when I split them up and load the same 50k into different tables of 1k-10k for each table, it takes 0.6 seconds
12:08:42FromDiscord_<Stuffe> So for every pair I am only inserting it into a table once, but when its all in one big table it takes more than 10 times slower. Does anyone know why this would happen?
12:10:44leorizeprobably due to multiple realloc
12:11:08leorizeinitTable() takes a parameter that let you specify the initial size
12:11:17leorizeif you know the target table size try that
12:15:08FromDiscord_<Stuffe> ok, good idea
12:19:56FromDiscord_<Stuffe> yeah, got 0.6 seconds now, thanks!
12:22:28*dmi0 joined #nim
12:23:07*Snircle joined #nim
12:23:56*lf-araujo joined #nim
12:24:54Zevvyay, sha1 is in!
12:25:25Zevvcan I add sha256 too?
12:27:23leorizesha1 has always been there...
12:27:58*purebadger quit (Ping timeout: 245 seconds)
12:28:13Zevvyeah, but not properly exposed
12:28:44Zevvonly eat-all-my-data-and-make-me-a-hex-digest style
12:29:03FromGitter<alehander42> btw does valgrind help
12:29:16FromGitter<alehander42> with detecting memory leaks in nim
12:29:35leorizeonly with newruntime I think
12:29:41leorizeyou'd also need -d:useMalloc
12:32:43*lf-araujo quit (Ping timeout: 276 seconds)
12:36:47*purebadger joined #nim
12:39:38*dmi0 quit (Quit: leaving)
12:40:38*dddddd joined #nim
12:48:12*nsf quit (Quit: WeeChat 2.4)
12:53:48*lf-araujo joined #nim
12:57:20FromGitter<mratsim> @Zevv but AFAIK sha1 is used by the compiler
12:58:47Zevvyeah I know
12:59:07FromGitter<mratsim> I'd rather have a well thought out crypto library in the standard library than a collection of small parts that don't agree on a common interface.
12:59:26FromGitter<mratsim> bonus point if it is audited for safety
13:00:07Araqer...
13:01:58*lf-araujo quit (Ping timeout: 276 seconds)
13:03:52*solitudesf joined #nim
13:10:02*Snircle quit (Ping timeout: 245 seconds)
13:19:56AraqI don't think that's where the stdlib's strengths lie :P
13:20:50FromGitter<zetashift> I just read the above thing about methods being 3x times slower than procs, is this the cost of figuring out which method to call on runtime?
13:21:12Araqa std module in Nim is an all-around 80% solution, 80% documented, gives you 80% of what you need to do and works on 80% of the supported platforms :P
13:23:11FromGitter<mratsim> Surprisingly, most of them work in the NimVM
13:24:02FromGitter<mratsim> @zetashift yes, if the proc content is small, the overhead is large, but with a big proc/method it's negligible
13:24:15FromGitter<mratsim> I'm not sure what happens with a deep nested object hierarchy though
13:24:36FromGitter<mratsim> I think I posted my 2 benchmark setups along if you want to reproduce
13:25:57*dmi0 joined #nim
13:26:21FromGitter<zetashift> is it this one? https://github.com/mratsim/Arraymancer/blob/master/benchmarks/implementation/proc_method_closure_bench.nim#L43-L46 if so I'll try it out tonight
13:29:20*dmi0 quit (Client Quit)
13:36:12*Snircle joined #nim
13:43:45FromGitter<mratsim> Yes
13:44:04FromGitter<mratsim> and there is this: https://github.com/status-im/nimbus/wiki/Interpreter-optimization-resources#nim-implementation-benchmark ⏎ though it's somewhat a different context.
13:47:13*purebadger quit (Ping timeout: 248 seconds)
13:54:47*Vladar quit (Remote host closed the connection)
14:17:41*theelous3 joined #nim
14:26:43*eterps joined #nim
14:31:17*PMunch quit (Remote host closed the connection)
14:40:26Zevvaw /me is ashamed for filing a bug on 0.20 instead of devel
14:40:30Zevvsorry for the noise arq
14:46:35*sz0 joined #nim
14:48:10disruptekwhatever happened to my buddy ryukoposting?
14:50:24*lf-araujo joined #nim
14:53:40Araqholidays?
14:59:37*lf-araujo quit (Ping timeout: 276 seconds)
15:00:04*eterps quit (Ping timeout: 264 seconds)
15:04:28*narimiran quit (Ping timeout: 246 seconds)
15:05:13*jxy quit (Quit: leaving)
15:05:43__Myst__does slice[3..4] copy ?
15:05:46__Myst__or is it just a view?
15:07:38*floppydh quit (Quit: WeeChat 2.5)
15:10:11leorizecurrently it always copies
15:10:32leorizethe only way to prevent that is via `toOpenArray()` iirc
15:10:42__Myst__ah great
15:12:30__Myst__leorize: can you not store an openarray in an object
15:12:55leorizeopenArrays are for proc parameter only
15:14:49__Myst__so there's no copy-less slicing for strings in structs
15:15:26FromGitter<mratsim> tag {.shallow.}
15:15:42FromGitter<mratsim> ah but it will only affect copies not slicing
15:15:53leorizeto this day I still don't know what `{.shallow.}` really does
15:16:12FromGitter<mratsim> it makes strings and seqs in the object shallowCopied on assignment
15:16:49leorizewhat exactly is shallow copying?
15:16:56leorizethe description in the manual is vague
15:17:06leorizeand I don't know how will this apply to new runtime
15:17:53FromGitter<mratsim> shallow copy is ref semantics
15:18:13FromGitter<mratsim> i.e. seq and strings in the object have ref semantics instead of the default value semantics
15:19:52leorizewill this be carried over to new runtime?
15:20:37FromDiscord_<Skaruts> shallow copies arrays/seqs by ref?
15:21:27FromGitter<mratsim> only seqs and strings
15:22:48leorizeiirc there was a View type proposed for copyless slicing
15:22:53leorizedunno what happened with it
15:23:04FromGitter<mratsim> stuck in RFC limbo :p
15:23:30FromGitter<mratsim> there is a RFC for openarray as lvalue type (so that it can be assigned to `let`)
15:24:01FromGitter<mratsim> mmmh closed: https://github.com/nim-lang/Nim/issues/5437
15:24:15FromGitter<mratsim> there is another one opened, have to go through issues trail
15:25:02FromGitter<mratsim> https://github.com/nim-lang/Nim/pull/5957#issuecomment-356949900
15:25:29FromGitter<mratsim> ah yes: https://github.com/nim-lang/RFCs/issues/88
15:27:13Araqleorize, new runtime doesn't have .shallow, either you move or you don't
15:28:09AraqopenArray in objects will come later, it will probably use some Rust-like borrowing like we do for 'var T' return types
15:28:36Araq(which I secretly introduced and not many noticed :P )
15:29:04FromGitter<alehander42> how will slices be solved btw
15:29:33FromGitter<alehander42> i remember you saying rust needed complications in order to support slices/parts of vec-s
15:29:39FromGitter<alehander42> but maybe i remember it wronn
15:30:02FromGitter<mratsim> I noticed: https://github.com/nim-lang/Nim/commit/4f10b5edb6a6e51da5a3f8b0156a456d6eba8727
15:30:54leorizealehander42: storing openArray and we got slices solved :p
15:31:12leorizetoOpenArray() is already there for copyless slicing
15:31:20FromGitter<alehander42> yeah so
15:31:54FromGitter<mratsim> toOpenArray can slice strings?
15:32:08AraqI think so
15:32:21FromGitter<alehander42> in this case how does openarray deal with this :D
15:32:32FromGitter<mratsim> well then @__Myst__ here you go ^
15:32:48FromGitter<alehander42> and overally the posibility to point from multiple places to the same p
15:32:54Araqmratsim: he already said openArray cannot be put into an object (and that's correct)
15:33:16__Myst__Araq: Rust <3.<3
15:33:53Araqwhat you can use today: store (a, b) indexes
15:34:10Araqworks for Nim, Pascal, Basic, C#, Python ...
15:34:40FromGitter<mratsim> ah right, then you can use nim-ranges: https://github.com/status-im/nim-ranges and store as Range of char
15:34:57FromGitter<mratsim> see: https://github.com/status-im/nim-stew/blob/master/stew/ranges/typedranges.nim
15:35:58FromGitter<mratsim> but it's very hacky as well ...
15:36:04AraqI personally still like indexes better. otherwise you get a plethora of "view" types
15:36:15AraqstringView, seqView, tableView (?)
15:36:31FromGitter<mratsim> yeah, ptr + indexes/length
15:36:37FromGitter<mratsim> TensorView :p
15:36:46Araqbut the 'ptr' is really problematic
15:36:48__Myst__Araq: does not work with using string as an iterator
15:37:05FromGitter<mratsim> but the string can be reallocated by the GC
15:37:20Araqso? the index still works
15:37:53Araq__Myst__, you cannot use strings as iterators anyway
15:39:32__Myst__Araq: you can
15:40:47*lf-araujo joined #nim
15:42:39*absolutejam quit (Quit: WeeChat 2.5)
15:53:25FromGitter<alehander42> why not generic views?
15:54:04Araqmratsim: indexes are the reason why we don't have any "memory unsafe" databases, it's the only thing that really works. You can store them to disk, you can conjure up new IDs that weren't used before, etc
15:54:51FromGitter<mratsim> views are the reason that we have fast tensor libraries ;)
15:55:21Araqlast time I checked GPU programming it was all about indexes, not "views"
15:55:23FromGitter<mratsim> (and also lots of support queries on why changing "b" mutated "a")
15:55:51FromGitter<mratsim> you have a pointer + index
15:56:11Araqhttps://cs.calvin.edu/courses/cs/374/CUDA/CUDA-Thread-Indexing-Cheatsheet.pdf
16:00:45*AlexMax_ joined #nim
16:03:49*AlexMax quit (Ping timeout: 250 seconds)
16:06:16FromGitter<mratsim> https://github.com/mratsim/Arraymancer/blob/master/src/tensor/private/incl_higher_order_cuda.nim#L38
16:19:30Araqthat's just some implementation detail :P
16:20:09*NimBot joined #nim
16:20:51Araqand it doesn't even work well; 'restrict' is a "trust me on this" annotation
16:27:26*Trustable joined #nim
16:27:51*jxy joined #nim
16:38:57*absolutejam2 joined #nim
16:40:07*lritter joined #nim
16:47:33FromGitter<mratsim> It's more "The compiler is too lazy to follow the dependency chain"
16:57:30*absolutejam3 joined #nim
16:58:55*absolutejam2 quit (Ping timeout: 246 seconds)
17:01:53*nsf joined #nim
17:03:44*absolutejam3 quit (Ping timeout: 244 seconds)
17:07:04*sz0 quit (Quit: Connection closed for inactivity)
17:22:21*absolutejam3 joined #nim
17:23:16*absolutejam3 quit (Client Quit)
17:26:18*synshroud joined #nim
17:31:40*absolutejam joined #nim
17:41:57FromGitter<arnetheduck> er, do we support ipv6 btw?
17:43:04Araqyeah
17:49:09FromGitter<zacharycarter> if I have C code I'm calling that uses malloc - do I need to do anything special?
17:49:14FromGitter<zacharycarter> I keep getting errors using copyMem
17:51:54Araqno, must be something else
17:52:19FromGitter<zacharycarter> yeah - I think it was because now it appears to be working - my mistake
17:52:21*Trustable quit (Remote host closed the connection)
17:53:10*Vladar joined #nim
17:57:43FromGitter<zacharycarter> (https://files.gitter.im/nim-lang/Nim/BRzq/image.png)
17:57:44FromGitter<zacharycarter> heyyyyyyy
18:01:17*purebadger joined #nim
18:02:04*dom96 wonders why nimble builds code in `/tmp/project-checkout-date-time/` instead of just in the directory it is in...
18:02:59dom96shashlick, why do we do this?
18:04:06*eterps joined #nim
18:05:53shashlickI don't think we are building there
18:06:08dom96it looks like we are when running `nimble c`
18:07:06dom96I've got 10 of these "checkout" dirs in my /tmp :(
18:07:18dom96and they have a copy of my code in there
18:10:48*purebadger quit (Quit: WeeChat 2.5)
18:11:08*purebadger joined #nim
18:11:17*purebadger quit (Client Quit)
18:14:37*absolutejam quit (Ping timeout: 245 seconds)
18:15:05*rockcavera quit (Remote host closed the connection)
18:15:23shashlickOk I've not looked at nimble c
18:22:13*rockcavera joined #nim
18:31:28*UNIcodeX joined #nim
18:32:17FromGitter<ratiotile> nimterop tests fail for me on 0.20.0, but when I tried to use 0.19.6, nimble stopped working: `could not read package into file` somehow it could not interpret the .nimble files. Did I miss some install step?
18:33:58*narimiran joined #nim
18:34:43shashlickWhat is failing in 0.20.0?
18:37:54FromGitter<ratiotile> something in regex.nim, then `can raise unlisted exception: ValueError` in parseutils
18:42:41shashlicksome snippets of the error or details will help
18:43:01shashlickalso might want to update nim-regex
18:43:47FromGitter<ratiotile> I thought of updating regex. Ran nimble install and it said everything was up to date
18:43:58FromGitter<ratiotile> I have regex 0.10.0
18:44:46*Vladar quit (Remote host closed the connection)
18:46:58FromGitter<ratiotile> ok , the nimterop.nimble has outdated dependencies
18:47:11shashlicknimble install doesn't update deps
18:47:20shashlickalso, latest nim-regex is 0.11.2
18:47:28FromGitter<ratiotile> yeah I just checked
18:47:50shashlicknimterop also supports older versions of nim so I cannot just set it to latest
18:47:51FromGitter<ratiotile> `requires "nim >= 0.19.2", "regex >= 0.10.0", "cligen >= 0.9.17"` is outdated
18:48:22FromGitter<ratiotile> I did try an older version of nim, and it failed to read the .nimble file
18:48:55shashlickwin/lin?
18:49:03FromGitter<ratiotile> windows
18:49:24shashlickokay the test is running - https://ci.appveyor.com/project/genotrance/nimterop-8jcj7/builds/25886119
18:50:03shashlickhow did you install 0.19.6?
18:50:11FromGitter<ratiotile> yeah the test seems to run with latest regex, but won't work for regex 0.10 which is listed in the nimterop.nimble
18:50:14shashlickand what command did you run to see the nimble failure
18:50:24FromGitter<ratiotile> `nimble test`
18:50:56FromGitter<ratiotile> the test seems to have stalled on `# Downloading pcre.h.in`
18:51:26FromGitter<ratiotile> I installed 0.19.6 from the .zip distribution
18:51:38shashlickdo you mean appveyor or on your system
18:51:45FromGitter<ratiotile> on my system
18:52:40shashlickdownload on windows is done with powershell - https://github.com/nimterop/nimterop/blob/master/nimterop/git.nim#L60
18:52:50shashlickare you behind a proxy
18:53:22FromGitter<ratiotile> no proxy
18:53:53FromGitter<ratiotile> PS 2.0
18:54:25shashlickokay just ran a full test on 0.19.6 on windows and it worked, but let's wait for appveyor
18:54:55FromGitter<ratiotile> what could cause nimble to be unable to read the .nimble file?
18:55:11lmariscaldom96 when I pull a nimble package with a specific branch it doesn't pull the correct submodules
18:55:34lmariscalit pulls the master's submodule versions
18:56:16*absolutejam joined #nim
18:56:41shashlick@ratiotile - i think 0.19.6 has a broken nimble in the zip due to a bug in koch
18:57:05shashlickyou can just copy the 0.20.0 nimble over and use that
18:57:06*lf-araujo quit (Quit: lf-araujo)
18:57:12*lf-araujo joined #nim
18:59:04shashlickor `koch nimble --latest` should work
19:00:48*jjido joined #nim
19:03:39FromGitter<ratiotile> so tmath also hangs, on `CC: tmath.nim`
19:04:03shashlickare you using mingw?
19:05:05shashlickcan you check task manager for a hung cc1.exe process and kill it - should give you some errors
19:05:10FromGitter<ratiotile> I don't see the compiler command printed out anywhere
19:06:57Araqhey! I'll stream in about one hour
19:07:36FromGitter<phrmoy> where can i watch the stream?
19:08:06FromGitter<ratiotile> @shashlick: ok, it was using vcc. gcc works
19:08:35Araqhttps://www.twitch.tv/araq4k
19:08:56shashlickya tmath.nim is a test to wrap the standard math.h and run some tests but it doesn't work on linux/osx with standard gcc, just mingw
19:09:07shashlicklooks like the math.h in vcc is also problematic
19:10:03FromGitter<ratiotile> do you think powershell version is affecting the other test, tpcre.nim?
19:10:08FromGitter<ratiotile> that one won't download
19:10:12*tjmac left #nim ("-bye")
19:10:26shashlickcan you try the powershell command standalone and see what happens
19:10:50shashlick`powershell [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; wget URLTODOWNLOAD -OutFile FILENAME
19:11:26*nsf quit (Quit: WeeChat 2.4)
19:12:48shashlickya i have powershell version 5.1.x, maybe the older version doesn't have wget
19:13:28FromGitter<ratiotile> yeah it can't find wget
19:13:48shashlickokay all tests passed - win/lin/osx on 0.19.6, 0.20.0 and devel
19:13:49FromGitter<ratiotile> also the SecurityProtocol enumeration is invalid
19:14:23shashlickokay do you need to download anything for your wrapper?
19:14:26*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:14:46FromGitter<ratiotile> probably not, I'm going to run on local files
19:15:11FromGitter<ratiotile> at least tnimterop_cpp is working
19:15:14shashlickokay then shouldn't affect you
19:15:18shashlickwhat are you planning on wrapping?
19:15:55FromGitter<ratiotile> I'm going to see how well it works compared to c2nim, just found out about nimterop
19:16:46*jjido joined #nim
19:17:49FromGitter<ratiotile> wrapping bwapi, which previously was going to have to do mostly by hand due to c2nim
19:19:31shashlicknimterop doesn't understand C++
19:20:10shashlickbut you can use it to do preprocessing which might bother c2nim
19:20:24shashlickbwapi looks like C++, but not sure which headers you want to process
19:21:17shashlickyou can use `-r` to recurse through header file includes, and `-p` to preprocess files and pass that output to c2nim
19:21:23FromGitter<phrmoy> big fan of bw, played this thing for years, real cool project to wrap it with nim
19:21:24FromGitter<phrmoy> gl
19:22:11FromGitter<ratiotile> is following includes necessary? why not just run on a list of headers?
19:22:15*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:22:51shashlickyou could do that, but it's more work when there's a header that has a bunch of includes - https://github.com/bwapi/bwapi/blob/master/bwapi/include/BWAPI.h
19:23:25FromGitter<mratsim> I was going to say, when I see BW I always think about brood war
19:23:30FromGitter<mratsim> and it's actually brood war
19:23:34FromGitter<phrmoy> yep!
19:24:08FromGitter<phrmoy> 9 pool rush at 150, good times
19:24:09FromGitter<mratsim> btw, I plan to add the sc2api (one day)
19:24:16*lf-araujo quit (Ping timeout: 244 seconds)
19:25:02FromGitter<mratsim> to this repo: https://github.com/numforge/agent-smith/
19:25:36FromGitter<phrmoy> nice
19:25:44FromGitter<mratsim> for now there is the Arcade Learning environment (for Arcade games like pong or tetris or pacman or space invaders
19:25:59*lf-araujo joined #nim
19:27:37FromGitter<mratsim> but I never found the time to finish a reinforcement learning agent
19:29:46FromGitter<ratiotile> well, running `toast -r -p BWAPI.h`didn't work so well, toast seems to have problems resolving paths
19:30:22FromGitter<ratiotile> ah, -I
19:30:42shashlicktry `toast -r -p BWAPI.h -Ic:\full\path\to\include > BWAPI_full.h`
19:31:02shashlicki get a 468k file but c2nim doesn't like the `namespace BWAPI {`
19:32:42FromGitter<mratsim> isn't it behind #IF defines that you can ignore? or it's C++ API only?
19:32:46FromGitter<ratiotile> ah, it doesn't seem to like relative paths
19:33:29shashlickright cause toast needs to know which header files should be included in the recursive output
19:34:27shashlickokay c2nim doesn't like the template stuff, i forgot the --cpp flag
19:37:38FromGitter<ratiotile> yeah it doesn't like the std::function either
19:38:04shashlickmaybe you can try https://github.com/RnDome/bwapi-c
19:38:06FromGitter<ratiotile> I also ran into trouble with constructors
19:38:24*eterps quit (Ping timeout: 252 seconds)
19:39:00FromGitter<ratiotile> that's unfortunately out of date
19:44:25FromGitter<ratiotile> @shashlick: how do I use the functions of toast from the nimterop api? I want to write a script to preprocess each header individually. I already have one for c2nim
19:46:40shashlickwell you could import toast.nim and call process, might need to change some code
19:47:03shashlickbu the API is not for calling it that way since toast needs the FFI to load tree-sitter
19:47:26FromGitter<ratiotile> I see, I'd rather just call out to execShellCmd then
19:47:27shashlickthe API is for compile time only
19:47:34shashlickyes that's the simplest thing to do
19:48:14shashlickbut ya, you might need to comment out problematic code that c2nim doesn't support
19:50:00dom96lmariscal: report that issue if you haven't already please
19:50:23lmariscaldom96, created an issue in the nimble repo 👍
19:56:50*lf-araujo quit (Quit: lf-araujo)
19:57:15*lf-araujo joined #nim
20:03:14*jjido joined #nim
20:04:51*jjido quit (Client Quit)
20:06:48Araqhttps://www.twitch.tv/araq4k I'm here
20:07:32shashlickwow I'm actually awake for a live stream!
20:09:28FromGitter<berceanu> Hi what do you guys think of Julia?
20:12:32FromGitter<berceanu> Is it true nim used to have multiple dispatch?
20:14:14FromGitter<awr1> @berceanu https://nim-lang.org/docs/manual.html#multiminusmethods
20:15:18FromGitter<berceanu> Does nim have a repl?
20:16:56FromGitter<awr1> there is this https://github.com/AndreiRegiani/INim but a better REPL is currently a TODO (the initial groundwork is kinda done already with the new hot-code reloading system)
20:17:56*jjido joined #nim
20:18:14*jjido quit (Client Quit)
20:18:16FromGitter<awr1> i had to do a double take since you both have the same name, lol
20:18:33FromGitter<awr1> *first name
20:20:01rayman22201sorry Araq, I have to miss the stream today!
20:20:20rayman22201@awr1 and @berceanu `nim secret` :-P
20:20:51FromGitter<awr1> does `nim secret` use HCR now?
20:20:58rayman22201no
20:21:48rayman22201someone should just make a proper repl using HCR... too many projects, too little time
20:28:33*UNIcodeX quit (Quit: Leaving)
20:29:22*narimiran quit (Ping timeout: 272 seconds)
20:50:14*jjido joined #nim
20:57:07*lf-araujo quit (Quit: lf-araujo)
20:58:35*lf-araujo joined #nim
21:04:43*clyybber joined #nim
21:21:44*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:26:29disruptekthis libnotify wrapper inexplicably privates the app name, defaulting it to `App`. i just don't get how these decisions get made...
21:27:01disruptekthe author literally made a commit specifically to hide it from us.
21:30:05solitudesfdisruptek, if you only care about notifications on linux, i patched nim-dbus and added example to send notifications using dbus directly
21:30:10solitudesfhttps://github.com/zielmicha/nim-dbus/blob/master/dbus/private/tests/notify.nim
21:30:52*natrys joined #nim
21:31:30disrupteki have this working, but i will gladly switch to your stuff; thanks. :-)
21:33:14AraqZevv, npeg\buildpatt.nim(44, 7) Error: invalid type for const: Table[system.string, seq[Inst]] ?
21:53:06*shomodj joined #nim
21:59:26*lf-araujo_ joined #nim
22:01:20*lf-araujo quit (Ping timeout: 244 seconds)
22:01:21*lf-araujo_ is now known as lf-araujo
22:34:13*solitudesf quit (Ping timeout: 246 seconds)
22:40:25*natrys quit (Quit: natrys)
22:41:53*AlexMax_ is now known as AlexMax
22:48:38*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:49:02*shomodj joined #nim
22:53:46*shomodj quit (Ping timeout: 272 seconds)
22:57:04*lf-araujo quit (Quit: lf-araujo)
22:57:57*lf-araujo joined #nim
23:22:23*leorize quit (Remote host closed the connection)
23:23:04*leorize joined #nim
23:24:17*absolutejam quit (Ping timeout: 248 seconds)
23:26:28*shomodj joined #nim
23:34:02*clyybber quit (Quit: WeeChat 2.5)
23:46:17*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:56:08*krux02_ joined #nim
23:58:45*krux02 quit (Ping timeout: 250 seconds)