<< 28-03-2018 >>

00:00:13FromGitter<phrmoy> because i keep experimenting with everything i see lol
00:00:38FromGitter<zacharycarter> time to install emacs
00:00:44FromGitter<zacharycarter> and learn some lisp variant
00:01:21FromGitter<zacharycarter> I think that was the ultimate black hole of nonproductivity for me
00:01:24FromGitter<phrmoy> how are u guys findings these gems?
00:01:32FromGitter<mratsim> They come to us :P
00:01:34FromGitter<phrmoy> its like hiding there somewhere
00:02:02FromGitter<mratsim> Also shameless ad but be sure to check my own tensor library: https://github.com/mratsim/Arraymancer
00:02:14FromGitter<mratsim> OpenMP + Cuda + OpenCL
00:02:15FromGitter<zacharycarter> +1 ^
00:02:39FromGitter<zacharycarter> I've never used it in a project, but I've really wished hard that I knew how to
00:03:35FromGitter<zacharycarter> if you actually know what you're doing with ML code
00:03:40FromGitter<mratsim> I need to add docs and basic data loading beyond csv :/
00:03:45FromGitter<phrmoy> @mratsim outstanding
00:03:48FromGitter<zacharycarter> nah it's not your fault
00:04:06FromGitter<zacharycarter> I need something as easy as - load csv, choose model, get result
00:04:22FromGitter<zacharycarter> that's why I used that apple turricreate lib - it was that simple
00:04:41FromGitter<phrmoy> If Nim compiles this fast, we should still get into Jupyter
00:04:53FromGitter<zacharycarter> I think there's already a nim jupyter kernel
00:05:13FromGitter<mratsim> https://github.com/stisa/INim
00:05:17FromGitter<zacharycarter> but turricreate doesn't give you the primitives arraymancer does
00:05:19FromGitter<zacharycarter> so...
00:05:55FromGitter<mratsim> yes arraymancer is for research + production
00:06:25FromGitter<mratsim> lots of library I see only gives the neural network layers for example. You can’t slice your images or preprocess them for example.
00:06:55FromGitter<zacharycarter> yeah see - I think someone needs to write something like: https://github.com/maciejkula/spotlight - on top of arraymancer
00:07:00FromGitter<phrmoy> very nice, im impressed
00:07:07FromGitter<zacharycarter> or something like turricreate, etc...
00:07:10FromGitter<zacharycarter> that dumbs down this stuff
00:07:33FromGitter<mratsim> but i plan to add an API like this: https://github.com/t8m8/Neural-Network-in-Nim/blob/4bd06420fd7c57afb665c6b4e5148527eda6a410/examples/xor.nim#L14-L21
00:07:57FromGitter<zacharycarter> well I understand that a bit more
00:08:11FromGitter<zacharycarter> and I'm sure someone that understands it better than I do would really appreciate it :P
00:08:49FromGitter<mratsim> And then something like scikit learn “fit” (train data) + predict (test data)
00:09:22FromGitter<mratsim> so you could train in 5 lines: load -> split -> fit -> cross-validate -> predict
00:09:39FromGitter<zacharycarter> yeah that would be super sweet
00:10:35*find0x90 quit (Quit: find0x90)
00:11:36FromGitter<phrmoy> Futhark is also dope, please keep on sharing these gems with me ^^
00:12:15FromGitter<Varriount> @mratsim Your library is awesome!
00:13:39FromGitter<Varriount> @phrmoy Hey, have you heard about this language called Nim? It's pretty great. :P
00:14:53FromGitter<mratsim> thanks varriount :)
00:14:59FromGitter<mratsim> going to sleep now
00:15:45FromGitter<zacharycarter> lol
00:15:52FromGitter<zacharycarter> this blog post - https://brandur.org/rust-web
00:16:36FromGitter<phrmoy> I heard it's kinda fast and terse
00:16:42FromGitter<phrmoy> ^^
00:16:50*dddddd quit (Remote host closed the connection)
00:17:06FromGitter<zacharycarter> someone should write the equivalent code in Nim
00:17:14FromGitter<phrmoy> @mratsim gn thanks for the info
00:17:29FromGitter<mratsim> Ah
00:17:34FromGitter<mratsim> I have something for you
00:17:49FromGitter<mratsim> http://halide-lang.org/
00:18:05FromGitter<phrmoy> oh man.. let's have it
00:18:10FromGitter<mratsim> This lib uses it: https://github.com/facebookresearch/TensorComprehensions
00:18:17FromGitter<mratsim> to optimize einsum
00:18:46FromGitter<mratsim> And this one uses it as an intermediate representation for deep learning graph: https://github.com/dmlc/nnvm
00:18:57FromGitter<phrmoy> that's interesting, I'm starting to get hooked to these purpose-oriented languages
00:20:02FromGitter<zacharycarter> I want to try out - http://www.luna-lang.org/ - but not until they C support / ability to bind with Nim
00:20:31FromGitter<phrmoy> good stuff
00:20:48FromGitter<phrmoy> agreed, compilation to C is somewhat paramount for me
00:20:58*PMunch quit (Quit: leaving)
00:21:34FromGitter<mratsim> apparently they have something for C
00:21:42FromGitter<zacharycarter> they do but it's in the works I think
00:21:45FromGitter<mratsim> didn’t know about that. I’ll check it out
00:22:08FromGitter<mratsim> There is a beginning of bindings to visdom with arraymancer: https://github.com/facebookresearch/visdom
00:22:33FromGitter<mratsim> It’s there but it only displays images for now, it doesn’t plot: https://github.com/edubart/arraymancer-vision
00:22:42FromGitter<mratsim> and the lib probably doesn’t compile anymore
00:25:40FromGitter<zacharycarter> http://www.chriskrycho.com/2018/exploring-4-languages-integrity-and-consistency.html - article on the FP of HN
00:26:12FromGitter<zacharycarter> Rust, Elm, F♯, and ReasonML
00:27:27FromGitter<zacharycarter> kind of strange languages to compare against each other
00:27:45FromGitter<zacharycarter> I don't see anyone using Rust or ReasonML vs one another
00:28:16FromGitter<zacharycarter> dribble
00:43:27*gokr quit (Ping timeout: 240 seconds)
00:45:23FromGitter<cavariux> @zacharycarter in the opengl bindings for I keep the gl prefix or I strip it out of every proc?
00:47:34FromGitter<cavariux> And do you think the module should be called ```opengl``` or ```gl```
00:51:00FromGitter<cavariux> ```glClearColor(bg.r, bg.g, bg.b, 1f) ⏎ glClear(COLOR_BUFFER_BIT)``` [https://gitter.im/nim-lang/Nim?at=5abae6f435dd17022ea956b9]
01:02:11*Senketsu quit (Remote host closed the connection)
01:04:26*Senketsu joined #nim
01:11:52*sleepyqt quit (Quit: Leaving)
01:24:34FromGitter<zacharycarter> @cavariux I guess if you don't plan on supporting any other graphics APIs then the gl prefix is unnecessary
01:24:42FromGitter<zacharycarter> but people might be familiar with it
01:24:44FromGitter<zacharycarter> so I don't know...
01:25:37FromGitter<phrmoy> @zacharycarter one of the founders of Luna: "One of the early founders of Flowbox.io. Loves dogs, hates JavaScript."
01:25:57FromGitter<zacharycarter> sounds like me
01:26:01FromGitter<zacharycarter> minus the startup founder thing
01:26:25FromGitter<cavariux> we all hate JavaScript
01:26:34FromGitter<cavariux> I plan to support vulkan so I guess I will keep it
01:27:07FromGitter<cavariux> other than you @zacharycarter anyone else you know makes graphics in nim?
01:27:22FromGitter<zacharycarter> we all hate JavaScript on this blessed day :)
01:28:14FromGitter<zacharycarter> @cavariux yeah - there are quite a few people - @yglukhov does quite a bit of opengl work w/ Nim
01:28:32FromGitter<zacharycarter> I don't know how active other folks are that play with OpenGL in a gamedev / graphics capacity
01:28:53FromGitter<zacharycarter> most are inactive to my knowledge
01:28:57FromGitter<cavariux> okay okay, and to bind with opengl what have you done until now?
01:29:18FromGitter<zacharycarter> https://github.com/nim-lang/opengl
01:29:21FromGitter<zacharycarter> or
01:29:47FromGitter<zacharycarter> https://github.com/zacharycarter/bgfx.nim - what I intend on using for the next iteration of frag
01:29:57FromGitter<zacharycarter> oh
01:30:08FromGitter<zacharycarter> @krux02 is also very much into graphics stuff regarding Nim
01:30:41FromGitter<cavariux> oh okay great, still seems like a niche inside of a niche
01:30:42FromGitter<cavariux> haha
01:30:57FromGitter<zacharycarter> what's that?
01:31:29FromGitter<cavariux> a smaller group of a small group
01:31:33FromGitter<zacharycarter> no
01:31:49FromGitter<cavariux> O.o?
01:31:55FromGitter<zacharycarter> I mean what are you describing
01:32:03FromGitter<zacharycarter> as being a niche inside of a niche
01:32:15FromGitter<cavariux> did I get the idea wrong then?
01:32:20FromGitter<cavariux> I thought niche was like a small group
01:32:24FromGitter<zacharycarter> it is
01:32:45FromGitter<zacharycarter> I just don't know what you're using that descriptor to describe :)
01:33:05FromGitter<zacharycarter> what are you saying is a niche inside of a niche?
01:33:07FromGitter<zacharycarter> Nim?
01:33:07FromGitter<cavariux> ohhh, that people that like graphics inside of nim is really just few people
01:33:12FromGitter<zacharycarter> oh yes
01:33:17FromGitter<zacharycarter> you're right about that :)
01:33:35FromGitter<cavariux> tbh I have found nim to be the best language to code graphics
01:33:37FromGitter<zacharycarter> sorry for not understanding you
01:33:43FromGitter<cavariux> don't worry
01:34:09FromGitter<cavariux> It's fast and it gives you a lot of freedom when programming
01:34:09FromGitter<zacharycarter> well... I think it can alleviate some of the boilerplate w/ metaprogramming
01:34:13FromGitter<epmor> Bonjour
01:34:16FromGitter<zacharycarter> o/
01:34:23FromGitter<cavariux> Hi
01:34:28FromGitter<epmor> Haven't been on here in a while :D
01:34:34FromGitter<zacharycarter> wb
01:34:41FromGitter<epmor> How's everybody?
01:36:00FromGitter<zacharycarter> good I suppose - most folks that are usually active in here are asleep I think
01:36:27FromGitter<epmor> Yeah tis 2:30am
01:37:04FromGitter<cavariux> yep mostly because dom and araq are from eu I think so they have gather more people from there
01:37:25FromGitter<epmor> Yeah I'm EU too :D
01:37:29FromGitter<epmor> Wales specifically
01:38:35FromGitter<cavariux> nice, I'm from Mexico
01:38:59FromGitter<epmor> Hola :))
01:39:39FromGitter<cavariux> Hola :D
01:39:45FromGitter<epmor> You lads made anything crazy in Nim ?
01:40:45FromGitter<cavariux> Me not really, but I have seen other members do crazy things
01:41:10FromGitter<Varriount> I made a POC code generator for AWS API schemas
01:41:45FromGitter<epmor> Ah nice Varriount
01:42:17FromGitter<cavariux> I'm making a bindings library for nim including opengl, glfw, a linear math lib for opengl and planning on imgui
01:42:28FromGitter<epmor> Bought the Nim in Action book a week or two ago and been planning on what language to master, Lisp like Clojure and low level like Nim is kinda my comfort ability area
01:42:33FromGitter<epmor> Ah nice Leonardo
01:42:57FromGitter<cavariux> I have never touched Lisp
01:43:08FromGitter<cavariux> or languages like
01:43:23FromGitter<epmor> It's niche and fun. Pretty language aye
01:43:40FromGitter<epmor> If I didn't have rainbow parenths I probs would've said no to sticking with it :D
01:45:39FromGitter<cavariux> It's just that too many parenthesis
01:45:44FromGitter<epmor> Yeah lol
01:56:15FromGitter<gogolxdong> Anyone has the aws signature version 4 request client?
02:39:17shashlick@cavariux do check out nimgen if it helps in your bindings work
02:44:05*endragor joined #nim
03:06:34FromGitter<Varriount> @gogolxdong If you look through my gists you'll find an implementation
03:07:23FromGitter<gogolxdong> Is this https://github.com/Varriount/nimaws?
03:09:10FromGitter<gogolxdong> nimble install nimaws package not found
03:14:17*athenot quit (Ping timeout: 276 seconds)
03:14:47*athenot joined #nim
03:20:51FromGitter<gogolxdong> @Varriount where is your gists, I nimble install from the nimaws directory inside , but import hints cannot open nimaws
03:21:44FromGitter<Varriount> https://gist.github.com/Varriount/5f99f862393a186665cd454ae6137ff4
03:21:53FromGitter<Varriount> It's proof-of-concept code
03:23:32FromGitter<gogolxdong> yes, thanks ,what's difference between nimaws and this code?
03:24:37FromGitter<cavariux> thanks shashlick, but I want to keep it as hand maded as possible, for example in the opengl one I made my own parser from C to Nim to keep it exactly the way I want it
03:32:38FromGitter<gogolxdong> Doesn't the param need sorting ? @Varriount
03:34:01FromGitter<Varriount> What do you mean?
03:34:07shashlick@cavariux - you didn't use c2nim?
03:36:21FromGitter<gogolxdong> https://gist.github.com/gogolxdong/a58f794a3fab7f7fb2d92d5848a9fbf8
03:37:18FromGitter<gogolxdong> @Varriount this is our version ,cannot issue request properly ,don't know the reason
03:50:04FromGitter<cavariux> shashlick, nope haha
04:01:06*SenasOzys quit (Remote host closed the connection)
04:03:01*SenasOzys joined #nim
04:07:33FromGitter<gogolxdong> @Varriount will you help us to check this https://gist.github.com/gogolxdong/20a8cf8804ceed2935444fe39562b11f
04:07:59FromGitter<gogolxdong> response with Transfer Complete!
04:10:17*user1101 quit (Quit: user1101)
04:23:18FromGitter<gogolxdong> https://gist.github.com/gogolxdong/bc7d0cab0ff009a33a2469abfc9e0b04 hints <Response><Errors><Error><Code>AuthFailure</Code><Message>AWS was not able to validate the provided access credentials</Message></Error></Errors><RequestID>3af7dfac-25ad-4fb4-b8e7-d4296f971dee</RequestID></Response> which is the same with our client.
04:30:16FromGitter<Varriount> I wrote that code a while ago, so I'm not surprised it doesn't work
04:31:54FromGitter<Varriount> I should probably attempt to optimize that nimaws code. I helped work on it.
04:33:19FromGitter<gogolxdong> it's still sigv4, Araq and me checked the implement with official documentation several times, didn't find where to check again.
04:40:50FromGitter<Varriount> What's the difference between the two?
04:44:20*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
04:49:51*Lord_Nightmare quit (Ping timeout: 240 seconds)
04:51:53*Lord_Nightmare joined #nim
05:06:12FromGitter<gogolxdong> failed to see.
05:07:28*Lord_Nightmare quit (Ping timeout: 276 seconds)
05:07:51*Lord_Nightmare joined #nim
05:28:05*SenasOzys quit (Remote host closed the connection)
05:36:53*arnetheduck quit (Remote host closed the connection)
05:47:24*user1101 joined #nim
05:49:23*nsf joined #nim
06:19:32*arnetheduck joined #nim
06:31:38*floppydh joined #nim
06:33:28*Lord_Nightmare2 joined #nim
06:33:57*Lord_Nightmare quit (Ping timeout: 264 seconds)
06:34:27*Lord_Nightmare2 is now known as Lord_Nightmare
06:38:12*gokr joined #nim
06:42:37*yglukhov quit (Remote host closed the connection)
06:43:12*yglukhov joined #nim
06:47:33*yglukhov quit (Ping timeout: 256 seconds)
06:56:00*Lord_Nightmare2 joined #nim
06:57:05*Lord_Nightmare quit (Ping timeout: 248 seconds)
06:57:07*Lord_Nightmare2 is now known as Lord_Nightmare
07:04:56*yglukhov joined #nim
07:09:39FromGitter<Varriount> @gogolxdong Well, the failing one appears to be using the ec2 credential scope, but is calling the s3 api
07:11:45*r3d9u11 joined #nim
07:21:37*Lord_Nightmare quit (Ping timeout: 268 seconds)
07:24:13FromGitter<alehander42> @Varriount ok, next time I restart I can try that
07:26:03*Lord_Nightmare joined #nim
07:32:20*Vladar joined #nim
07:52:20*sendell joined #nim
07:54:59*r3d9u11 quit (Ping timeout: 256 seconds)
07:55:09*jaco60 joined #nim
08:02:20FromGitter<diegogub> Helloo, how can I have constructors for objects? How is the normal way of initialized a DateTime value.?
08:06:58FromGitter<gogolxdong> @Varriount even though I changed param["action"] to param["Action"], payload and url is the same ,I think.
08:08:53*rokups joined #nim
08:09:06*mjanssen left #nim (#nim)
08:10:32FromGitter<gogolxdong> signature alogrithm is the same I think.
08:10:44*Lord_Nightmare quit (Ping timeout: 256 seconds)
08:13:14*gokr left #nim (#nim)
08:17:55*jaco60 quit (Ping timeout: 276 seconds)
08:18:37*Lord_Nightmare joined #nim
08:28:43FromGitter<narimiran> @diegogub something like `__init__` in python?
08:28:50FromGitter<gogolxdong> In sigv4 ,either append X-Amz-Signature=signature to payload or set http header["Authorization"]=signature. nimaws uses the latter.
08:29:43FromGitter<narimiran> @diegogub have you checked this: https://nim-lang.org/docs/tut2.html#object-oriented-programming ?
08:43:07FromGitter<diegogub> @narimiran , yes, i checked. Yes, like *init* ...Im trying to define a proc new()
08:43:34FromGitter<diegogub> like this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5abb55b5e4ff28713a80c953]
08:43:39FromGitter<diegogub> but its not working..
08:45:00FromGitter<mratsim> probably not compiling because I didn’t try but it should be like this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5abb560c3fe1be3704ca3b0b]
08:45:39FromGitter<mratsim> convention is new+Type for ref object, and init+Type for stack objects
08:46:02FromGitter<diegogub> @mratsim will try, thanks again!
08:46:04FromGitter<mratsim> you have to do “new result” otherwise you get a null exception
08:46:07FromGitter<narimiran> oh, i didn't know about that convention, good to know!
08:46:29FromGitter<diegogub> Should be added to the documentation right?
08:46:34FromGitter<diegogub> Would be nice
08:47:04FromGitter<gogolxdong> @Varriount around ?
08:48:05FromGitter<mratsim> I think it is either the manual or the tutorial. But yeah nim documentation is one of the weak point.
08:48:27FromGitter<diegogub> Im getting this warning: tem.nim(14, 7) Warning: Cannot prove that 'result' is initialized. This will become a compile time error in the future. [ProveInit]
08:49:20FromGitter<mratsim> I think you need `result.id = “”`
08:49:45FromGitter<mratsim> otherwise it’s a nil pointer
08:56:14FromGitter<diegogub> keep having the same warning..but working now!
08:58:17*vlad1777d joined #nim
09:01:55FromGitter<diegogub> Looks like I found the solution: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5abb5a037c3a01610d81d4f5]
09:02:19FromGitter<diegogub> No warning using this form, @mratsim @narimiran
09:03:34FromGitter<wu-lee> Is there a function like succ() for enums which will wrap around at the end of the sequence?
09:08:40FromGitter<krux02> well I think you can always do cast to int and mod division and then cast back to enum
09:08:56FromGitter<krux02> as long as the enum has no holes at least
09:09:56FromGitter<mratsim> Hackers gotta be hacky :P
09:10:09FromGitter<krux02> I wouldn't call it hacky
09:10:22FromGitter<krux02> I mean that is exactly what such a succ would do anyway
09:11:11FromGitter<krux02> did you know that intiger division is one of the slowest operations on the cpu? It's even slower than float64 division
09:11:24FromGitter<mratsim> I would compare to len, if pos != len - 1, reset, otherwise advance. div/mod is super costly
09:11:29FromGitter<wu-lee> Would be a nice bonus if it deals with holes too :)
09:11:53FromGitter<krux02> yea not that costly
09:12:03FromGitter<krux02> still faster that doing anything in python :P
09:12:53FromGitter<mratsim> I’m actually working since Monday on implementing bigint division: https://github.com/status-im/mpint/blob/e4440095638d01b58da482909d90c054cf968a51/src/private/uint_binary_ops.nim#L230-L266
09:13:10FromGitter<wu-lee> anyway, sounds like the answer is no: you have to do it yourself?
09:13:20FromGitter<krux02> wu-lee, I think if you want to deal with holes, I think it's best to convert it to a hole free variant of that enum, do the wrapping operation and then convert back
09:13:33FromGitter<krux02> well I think so
09:13:51FromGitter<krux02> enums are semantically names, not integers.
09:14:06FromGitter<krux02> so I would not expect it to have any integer like operations
09:14:49FromGitter<wu-lee> looping isn't really an integer operation, mathematically it's more fundamental, a property of a sequence
09:15:31FromGitter<wu-lee> so any sequential enum supports succ(), but there's an exception when you reach the end
09:16:16FromGitter<wu-lee> wrapping around is just a nice convenience
09:17:57FromGitter<wu-lee> in principle an enum with holes can be a sequence too (like, say, prime numbers), I'm not sure how nim views that tho.
09:20:56FromGitter<krux02> I think Nim knows if an enum has holes or not.
09:21:00FromGitter<krux02> But that's it basically
09:21:14FromGitter<krux02> but I also think that you can iterate all the values in a marco
09:21:18Araqdon't use enum with holes, I consider them a mistake
09:21:31FromGitter<mratsim> enums are just int, int32, int16, int8
09:22:01FromGitter<krux02> Araq: well enums with holes are not a mistake, they help a lot when wrapping C code.
09:22:16Araqthey predate distinct ints, for C interop a distinct integer type is better
09:22:33FromGitter<krux02> ok I didn't know that
09:23:05FromGitter<krux02> I am thinking if the opengl wrapper should use a distinct int for GLenum
09:23:15AraqI think it should.
09:23:47FromGitter<mratsim> But you cannot have the text then can you? https://github.com/mratsim/Arraymancer/blob/068075dce61a88f4cf038d3c0035d5f84921983e/src/tensor/backend/blis_api.nim#L18
09:24:06FromGitter<krux02> there is only one case where it causes the code to be a bit more ugly, and that is binding textures to texture units.
09:24:49Araqkrux02: introduce an overload for these?
09:25:09Araqmratsim: pff, it's all a macro away. Nim should be based on macros, not core language features
09:25:32Araqfeatures need to be introduced if a macro is not feasible
09:25:37FromGitter<mratsim> I guess another macro to add to sugar.nim ;)
09:25:45FromGitter<krux02> Araq: In theory, I would agree, but not for a low level wrapper
09:25:51Araqwhich is more often than I would like, but that's a different topic
09:26:17Araqand also something Nim will get better at, will write an RFC.
09:26:35FromGitter<mratsim> what I linked was produced by c2nim by the way
09:26:39FromGitter<narimiran> > I would compare to len, if pos != len - 1, reset, otherwise advance. div/mod is super costly ⏎ ⏎ huh, i have regularly been using `mod` because i'm sucker for simpler/nicer code. might try to it this way to see if there are any speed improvements....
09:26:56FromGitter<krux02> Araq: one thing I still wonder is how well nim can cache the results of macros.
09:27:17FromGitter<krux02> Let's say I have a library that is generated using an expensive macro and I import this library in my code
09:27:33Araqcheck --symbolFiles:v2
09:27:36FromGitter<krux02> will this macro from the library be executed on each run?
09:27:52Araqit deals with macros implicitly.
09:28:11Araqcurrently, yes. every compilation goes through everything, macros or not.
09:28:28Araqsymbol files will fix this.
09:28:50FromGitter<mratsim> @narimiran depends on your use case. occasionally it’s very optimized, but if you do stuff like (a+b) mod n or (a^b) mod n you should look here: https://github.com/numforge/number-theory/blob/master/src/modular_arithmetic.nim
09:28:59FromGitter<krux02> ok that is very good to know that this will be better.
09:29:14Araqit's not macro specific.
09:29:24Araqwe will have incremental compilation.
09:29:33FromGitter<krux02> I just want to know, because I want to know if it is a good idea to write libraries that are internally built using such macros.
09:30:10Araqwell, instead of musing about fork() help me with symbol files :-)
09:30:27FromGitter<krux02> Araq: in the forum I suggested to use `fork()` to improve the performance of tests. What do you think is it possible?
09:30:51Araqno.
09:30:55FromGitter<krux02> I don't mean to actually do it, I am just curious if it would be possible or if I totally overlooked something
09:31:12FromGitter<krux02> I was very tired when I wrote that
09:31:20Araqfork() is to low level
09:31:27FromGitter<krux02> what's the problem?
09:31:33Araqyou need to split the address space.
09:31:39FromGitter<krux02> why?
09:31:44Araqif a module were self-contained
09:32:13FromGitter<krux02> what is a self containde module?
09:32:26Araqok, different attempt.
09:32:40Araqthe compiler uses a web of objects, aka "the module graph"
09:32:47FromGitter<krux02> ok
09:32:55Araqand you want to update some nodes in it.
09:33:04FromGitter<krux02> yes
09:33:12Araqand fork() knows nothing about this graph.
09:33:18FromGitter<krux02> yes
09:33:24FromGitter<krux02> but does it need to?
09:33:44FromGitter<krux02> each fork lives in it's own address space
09:34:32AraqI fail to see how to use fork()
09:34:35FromGitter<narimiran> @mratsim modular arithmetic might be quite useful for some of my things, thanks!
09:34:52Araqyou can load the stdlib and then fork()
09:35:01FromGitter<krux02> yes that is the idea
09:35:06Araqbut that's not done. the stdlib loading is lazy
09:35:17Araqbased on what the main nim file imports.
09:35:21FromGitter<krux02> ah ok
09:35:57FromGitter<krux02> that basically kills it
09:36:08Araqbtw the tests take 35 minutes on good days on travis, I think.
09:36:38FromGitter<krux02> well when I did them they took oven an hour I think
09:36:47FromGitter<krux02> but I didn't do a pull request recently
09:37:00Araqit's all parallelized but travis got slower, not sure why
09:37:33FromGitter<krux02> I think the tests would run faster, if a lot of the small tests would be joined to bigger tests.
09:37:41FromGitter<krux02> I mean just fewer files to compile
09:37:48FromGitter<krux02> but probably not that important
09:38:17FromGitter<krux02> I am talking about the really tiny tests here that only have a few lines of code
09:38:32FromGitter<krux02> make them into one test with a few hundred lines of code.
09:38:44Araqwe do that.
09:38:50FromGitter<krux02> ok
09:39:10Araqlots of old tests don't, but *shrug*
09:39:28Araqfeel free to clean it up. only a couple of thousand tests to look at :P
09:40:08FromGitter<krux02> yea
09:40:34FromGitter<krux02> well when I encounter those tests I actually do it, but I haven't done any new pull requests for a long time
09:41:27FromGitter<krux02> But I think the fork thing could work in compiling C/C++ though. #include "common.h", fork()
09:42:48FromGitter<krux02> but yea that is not relevant here I guess.
09:43:25Araqsomething like that could work, but seems fragile, non-portable and solves 40% of the problem
09:43:42Araqwhereas symbolfiles solve 80% and will work on Windows :P
09:43:56FromGitter<krux02> In my head that idea is amazing and nobody ever thought about it ever before and I am the hero who saved all the slow compilation of big projects in the world. But that's just in my head and probably a lot of people already had that Idea it just doesn't work out.
09:44:17FromGitter<krux02> who cares about windows
09:44:24FromGitter<krux02> it's a dying platform
09:44:37FromGitter<krux02> like AmigaOS
09:44:43Araqgamers care :P
09:45:00FromGitter<krux02> I hate that term gamer
09:46:02FromGitter<krux02> it's so "I play games, but I wanna be taken serious, so don't call it playing, call it GAMING, >:c"
09:46:33Araqok. players care.
09:46:54FromGitter<krux02> :)
09:47:53*dddddd joined #nim
09:48:10FromGitter<krux02> I saw at gamescom once a slogan from roccat: "stop playing start gaming". I thought if I ever release a Game to advertise it with "stop gaming start playing"
09:48:38FromGitter<krux02> just to point out that playing games is about having fun, and not about to be taken serious.
09:48:49FromGitter<krux02> but yea that goes off topic
09:51:21*Arrrr joined #nim
09:51:21*Arrrr quit (Changing host)
09:51:21*Arrrr joined #nim
09:54:45euantormost enterprises care about Windows too
09:54:59euantorNim's strong support for Windows is one of it's nicest features
09:55:19euantorI stay away from any language that doesn't support Windows (such as Crystal or Swift) personally
09:55:32FromGitter<krux02> hew we should not really discuss that targeting windows is important
09:56:22FromGitter<krux02> The big three desktop operationg systems are Windows/Linux/MacOS
09:57:43FromGitter<krux02> but equally important are mobile systems. By now there are more active mobiled devices on the world then there are active desktop computers.
09:58:04FromGitter<krux02> especially in Africa it is common to have a smartphone, but not to have a desktop computer.
09:58:25FromGitter<krux02> So that Linux took over Windows basically already happened.
09:58:36FromGitter<krux02> (if you count Android as Linux)
10:03:00AraqAndroid is not Linux IMO.
10:03:16*arnetheduck quit (Remote host closed the connection)
10:03:27Araqit's just the kernel with completely utterly different JVM based APIs on top
10:03:54FromGitter<krux02> that is true
10:04:05Araqit doesn't run gnome or KDE or apt-get, it doesn't give you a terminal
10:05:17*arnetheduck joined #nim
10:05:31FromGitter<krux02> well there are terminals for android
10:05:39FromGitter<krux02> but I don't know how they work
10:05:45Araqit's a sad platform.
10:06:17FromGitter<krux02> the problem is also that something like tty would not work on android, because there is no typewriter (keyboard) on android
10:06:44FromGitter<krux02> there are terminal emulators, but I don't know how they work internally
10:07:20FromGitter<krux02> what I don't like is that the core API is already based on JVM
10:07:29FromGitter<krux02> but year that is just how it is
10:08:45FromGitter<krux02> is it possible to develop android in Nim?
10:09:37Araqyes it is.
10:09:51Araqbtw fork() doesn't work on iOS either iirc. it's not just Windows.
10:10:17FromGitter<krux02> yes I know fork is a Linux only thing
10:10:30Araqno, fork() is posix.
10:10:58FromGitter<krux02> ok sorry for using those terms without proper distinction.
10:13:36FromGitter<wu-lee> var fields in objects: I infer they're not allowed?
10:14:07FromGitter<krux02> well the fields of an object are *var* when the object is var
10:14:11Araqthey are also not required. mutability is not tied to a type in Nim.
10:14:36FromGitter<krux02> I don't think nim has an equivalent of `mutable` in c++
10:15:01Araqit also doesn't have C++'s 'const'
10:15:12Araqso why would it need 'mutable'.
10:15:42FromGitter<wu-lee> My personal hangover from C/C++, which allows const fields. However, that introduces all sorts of problems when you have nested datastructures, with consts inside mutables, or vice versa.
10:15:45FromGitter<krux02> what exactly is the difference of c++ const and nim's, not var
10:16:02AraqNim is still tremendously simpler than C++. and we need to keep it this way.
10:16:29FromGitter<narimiran> +1
10:16:54FromGitter<krux02> with nim I had much less headaches that with c++ const, and I think it mostly comes from the correct default that arguments are by default immutable references.
10:17:43FromGitter<krux02> but apart from that I can't state any concrete difference of c++ const and the abcence of var in nim.
10:17:48FromGitter<wu-lee> The one thing I wonder is when you need to declare parts of your datastructure mutable, and other parts not? Is it all or nothing?
10:18:04FromGitter<krux02> it's all or nothing
10:18:25FromGitter<krux02> eather you have a mutable view on your data, or not.
10:18:37Araqyup.
10:19:28FromGitter<krux02> but you can split the view on your data into multiple arguments and only some of them are `var`. But I don't know if that's feasible in your use case.
10:20:38FromGitter<wu-lee> My case is on the drawing board, so this is just something to bear in mind in my experiments ;)
10:23:04FromGitter<wu-lee> I'm playing with a model of animated objects rendered with SDL, like bouncing balls. Trying to see if I can have core model/rendering modules, with add-on animated object types as separate modules
10:24:31FromGitter<krux02> why would you need to have partial mutability there?
10:25:48FromGitter<krux02> I would store the model with it's animations as something immutable. and then when you render the object you would combine it with some animation state parameter
10:27:13Araqin the poor toy game engine I once wrote, the animation state was a rectangle.
10:27:20FromGitter<krux02> `proc render(obj: AnimationObject; modelMat: Mat4f; animation: int; animationState: float32)`
10:27:44Araqa 2D slice into the surface that contains all the frames
10:27:45FromGitter<wu-lee> I might not need it, but part of the model might be logically constant parameters of the world
10:28:13FromGitter<krux02> well in flexible animation systems it would be possible to mix arbitray animations in various amounts.
10:28:28Araqyou proceed a frame by updating the rectangle's x coord
10:28:52FromGitter<krux02> yes but don't but parts of the words into model data
10:29:06Araqif the animation repeats you need to 'mod' the coord :-)
10:29:49FromGitter<krux02> Araq: yes, but you can't use `mod` for that, becausethen when you get negative values ... you know the rest
10:30:06AraqI don't have negative x coords.
10:30:23FromGitter<krux02> are you sure?
10:30:47FromGitter<krux02> in animation systems with looping animations it's easy to have negative arguments
10:30:52FromGitter<krux02> because why not
10:31:13Araqyes, they refer to the absolution position of the surface that contains all the possible frames
10:31:27Araqand I don't reverse my animations in time.
10:32:02Araqit's the simplest thing that can possibly work. and it worked.
10:32:36FromGitter<krux02> anyway, nim_glm has modulo for that
10:33:22FromGitter<krux02> well the simplest think that can possibly work as an animation is a bouncing ball
10:34:03*jaco60 joined #nim
10:34:07FromGitter<wu-lee> that's kind of where I'm starting: no images, just graphics primitives. bouncing balls.
10:34:57FromGitter<wu-lee> my approximate inspiration is "Ballz" a rather addictive game for Android.
10:35:55Araqgraphics primitives don't scale, write a sprite engine :-)
10:36:27FromGitter<wu-lee> I'm just a newb :)
10:36:55FromGitter<wu-lee> is there a useable/recommended nim repl?
10:37:10FromGitter<krux02> net recommended, but there is "nim secret"
10:37:22FromGitter<wu-lee> beyond "nim secret" I mean, which barfs a lot
10:37:38FromGitter<krux02> well not really
10:37:40Yardanicowu-lee but use proper compilation when you can; nim compilation is pretty fast
10:38:00Araqthere are nim REPLs. but I haven't tried them.
10:38:07YardanicoAraq, yeah, I tried INim
10:38:22Yardanicoit's a cool, but hacky solution (well, it can only be done in a 'hacky' way)
10:38:27FromGitter<krux02> I createy a shortcut in my editor to edit /tmp/scratch.nim
10:38:28YardanicoINim is pretty simple
10:38:37FromGitter<krux02> I put all my scratching in there.
10:38:37Yardanicohttps://github.com/AndreiRegiani/INim
10:39:45FromGitter<wu-lee> oh, and I should also ask, is there a nice way to debug Nim? (I tend to use emacs, and gdb got me some way, but the proc names are all mangled)
10:40:07Yardanicowu-lee you can use special script for gdb which will help in nim debugging
10:41:17Yardanicohttps://github.com/cooldome/Nim-gdb
10:41:44FromGitter<krux02> @wu-lee do you know rbreak?
10:41:55FromGitter<krux02> I use that to deal with the mageling
10:42:09FromGitter<krux02> rbreak foo breaks on all functions that contain foo
10:42:23FromGitter<wu-lee> @Yardanico, will try that, thanks
10:44:21FromGitter<wu-lee> @krux02 the gdb command rbreak? Ok, that would help. So, nothing that would appease a Java IDE addict, I assume?
10:45:02FromGitter<krux02> I am sorry.
10:45:18Yardanicowu-lee sadly no, not yet (TM)
10:45:19FromGitter<krux02> I am afraid debugging Nim quite sucks a lot.
10:45:30Yardanicoyeah, that's quite true :/
10:45:48AraqI enjoy it... writeStackTrace() + echo/dump
10:46:26Yardanicoasync debugging sucks even more, sorry :P
10:46:38Yardanicosometimes I don't have async proc where error happened in my async error stack trace
10:46:41FromGitter<wu-lee> I am thinking of what my colleagues would say if I mentioned Nim as a better X
10:46:42FromGitter<krux02> Araq: why is the stack trace in nim so weird? When I first encountered it I always thought it was off my one line and upside down.
10:46:53FromGitter<krux02> A better X?
10:47:04ArrrrBetter than porn
10:47:05Araqdebuggers are a waste of time, single stepping through some things, it is "step over" or "step into", oh no, I stepped too far, can I go back?
10:47:41FromGitter<krux02> really debuggers are not just for that
10:48:27Araqreal debuggers have super slow conditional breakpoints and fragile mouse-over-variable/expression UIs
10:48:39FromGitter<krux02> Debugging is mustly to turn down the execution speed and whatch what actually happens in a program.
10:48:45FromGitter<wu-lee> I would be like Richard Dawkins at Christmas
10:49:02FromGitter<krux02> it greatly helps to get an understanding of code that you haven't written on your own.
10:49:03Araqnever found 'real' debuggers productive.
10:49:10FromGitter<wu-lee> If I said "debuggers are a waste of time"
10:49:37FromGitter<krux02> using gdb command line does suck a lot.
10:50:13FromGitter<krux02> but to have an integrated debugger where you can watch how values change over time really does not suck a lot
10:50:42Araqwhich 'values' though? you can get lost in the data so easily.
10:51:14FromGitter<wu-lee> It does not always suck. Not having a decent debugger can certainly suck tho.
10:52:10dom96Far too many programmers rely on debuggers
10:52:46dom96I was one of those until Araq helped me see the light :P
10:53:00FromGitter<wu-lee> Certain people consider any language without IDE support out of the question, and these people are often hirers and firers
10:53:08dom96In all seriousness though, we do need to care about all those programmers that are accustomed to using GUI debuggers
10:53:26Araqagreed, but I have used C# and its debugger for years.
10:53:27Yardanicowu-lee nim has IDE support if you would call it like that
10:53:35FromGitter<diegogub> guys, which http client do you recommend for nim?
10:53:40Yardanicodefault one
10:53:44Araqand its debugger is universally seen as excellent.
10:53:48Yardanicohttpclient from stdlib
10:53:51FromGitter<krux02> well I have done c++ teaching.
10:54:06Araqand yet I don't miss it, never was productive with it.
10:54:11YardanicoVSCode + nim extension - you get code highlighting, code completion, error checking, etc...
10:54:13FromGitter<wu-lee> I think I might agree that a debugger can be a crutch in some circumstances, but I am more tolerant/persistant than those I might need to persuade
10:54:46FromGitter<krux02> and teaching the students to use a debugger so they can step through there code really helped them a lot.
10:55:28FromGitter<krux02> Sadly though the Professor that I worked for had a similar opinion about debuggers as Araq and at some point the debugger support for the ide just broke because of some changes.
10:56:16FromGitter<krux02> I didn't notice nor did he care about it. I just couldn't simply show the students anmore "run the debugger, and see here is what is happening, there is what breaks", now I had to rely on works
10:56:18FromGitter<krux02> words
10:56:30FromGitter<wu-lee> @Yardanico, that sounds like it might be worth trying.
10:56:33FromGitter<krux02> a much bigger hassle and much harder to understand
10:56:44dom96Debugging without a debugger is a skill that every programmer should have
10:56:51Yardanicowu-lee most of people coding in Nim use this combo
10:57:00FromGitter<krux02> and putting print statements everywher also doesn't really solve it because priting doesn't answer the question in which line the output happened.
10:57:04dom96You should have taken that opportunity to teach them how to debug without a debugger
10:57:42FromGitter<krux02> Well I think you should learn to debug with a debugger first.
10:57:46Yardanicodom96, in languages like C++ you can't really do much stuff without a debugger
10:58:00FromGitter<krux02> then you can improve your skill afterwards if you want to.
10:58:31dom96Yardanico: How so?
10:58:49FromGitter<krux02> and very important is to have a smart debugger.
10:59:00*SenasOzys joined #nim
10:59:15FromGitter<krux02> debugging c++ with a debugger that doesn't really know about stl types such as std::string and std::vector really is a pain
10:59:31FromGitter<wu-lee> http://dilbert.com/strip/1992-09-08
10:59:32Yardanicodom96, you don't get stack traces with line numbers like in Python or Nim. Well, you can use custom libraries but it's still not that easy
10:59:36FromGitter<krux02> and especially for young people who just want to understand their programm horribly confusing.
11:02:20*Snircle joined #nim
11:03:14dom96hrm, anyone know is the language server protocol includes debugging support?
11:03:18dom96https://langserver.org/
11:03:26dom96It mentions "Diagnostics" on the front page but not sure what that means
11:04:04Yardanicodom96, it doesn't
11:04:10Yardanico"The debug adapter protocol specification (and the generated TypeScript definitions) are independent from the VS Code implementation and live in their own repository (but that repository still uses "vscode" in its name)."
11:04:47YardanicoI didn't find anything for another languages
11:04:55dom96oh, diagnostics are just compiler messages
11:06:46*sleepyqt joined #nim
11:07:10FromGitter<krux02> dom96: I know that Jonathan Blow doesn't like that very much :P
11:07:22dom96Doesn't like what?
11:07:29dom96The language server protocol?
11:08:01*user1101 quit (Quit: user1101)
11:08:05*user1101 joined #nim
11:12:16FromGitter<krux02> https://twitter.com/Jonathan_Blow/status/931147749306896385
11:13:17Yardanicolol
11:14:38FromGitter<phrmoy> lol
11:16:38*Trustable joined #nim
11:22:11Yardanicowell I get his point - faster computers get, slower software gets
11:22:27FromGitter<krux02> recently here in the discussion was a programming language that looked a bit similar to nim, but it had a glsl and spirv backand. I just can't remember the name
11:22:42Yardanicolike instead of text editors written in C/C++ we have text editors written in JS
11:22:44FromGitter<krux02> I would like to track what will be going on with that language.
11:23:57FromGitter<krux02> A friend of mine now does his own programming language. It will have overload resolution also on the return value and type inference of function arguments.
11:24:08FromGitter<krux02> now sure how that will turn out.
11:25:38FromGitter<mratsim> @krux02 Jai?
11:27:45FromGitter<krux02> yes
11:27:50FromGitter<krux02> he the man
11:27:57FromGitter<krux02> oh sorry
11:28:00FromGitter<krux02> no I don't mean jai
11:28:14FromGitter<krux02> jai is not public and I don't think it compiles to GLSL
11:28:18FromGitter<krux02> at least not yet.
11:28:49FromGitter<zetashift> @krux02 Scopes!
11:28:51FromGitter<krux02> it was a different programming language, and it had Python syntax
11:28:56FromGitter<zetashift> http://scopes.readthedocs.io/en/latest/about.html
11:29:12FromGitter<mratsim> oh from yesterday
11:29:15*nsf quit (Quit: WeeChat 2.0.1)
11:29:23FromGitter<krux02> that one yes thanks a lot
11:29:39FromGitter<krux02> did you talk about it yesterday?
11:29:44FromGitter<krux02> I don't rememeber that
11:31:19dom96krux02: Is there a reason for this somewhere down the thread or should I not bother reading?
11:33:49dom96I guess he just thinks JSON over a socket adds too much latency
11:34:09dom96Well, he's wrong :P
11:34:31dom96The real latency is in gathering the auto complete results
11:41:38FromGitter<krux02> well I don't know the bottleneck, but I think for a project that aims to support as many backends/frontends as possible, the format should have been specified is something like Protobuf/CaptnProto.
11:42:18FromGitter<krux02> he just wants the api to be a native call. I think he might be a bit emotionally biased here.
11:43:54FromGitter<krux02> Just for curiosity I like this guy talking about programming: https://www.youtube.com/watch?v=8pTEmbeENF4
11:45:52dom96JSON is far more universally supported than Protobuf or captnproto
11:46:09FromGitter<krux02> He just pretends it's the seventies and talks about programming and how exciting the future will be, but then yea realize, yea we still program like in the seventies and not a lot has changed.
11:46:14dom96Optimising the protocol in this case is optimising the uncommon case
11:46:16dom96It doesn't make sense
11:47:00FromGitter<krux02> yea might be true, I think what Jonathan doesn't like is this network protocol in the middle.
11:47:46FromGitter<krux02> I read what he wrote and he was never specific about what actually is the problem.
11:47:52dom96yeah, that's a classic talk
11:48:15FromGitter<krux02> He also had one "Inventing on Princible". Very great.
11:48:37FromGitter<krux02> I found an old document from me called "notes" and I had a link to this video in it.
11:48:50FromGitter<krux02> haven't written anything into it for a long time.
11:48:57FromGitter<krux02> I want to rivive it now :P
11:49:15*leorize joined #nim
11:49:22dom96Based on what he's writing about VS code and the Xi editor, he seems a little arrogant
11:49:38dom96Paraphrasing: "How hard can it be to draw some text on the screen?"
11:49:49FromGitter<krux02> what did he write about VScode?
11:49:54*vlad1777d quit (Ping timeout: 256 seconds)
11:50:02FromGitter<krux02> but he is right.
11:50:28dom96https://twitter.com/Jonathan_Blow/status/931934535989825536
11:50:30FromGitter<mratsim> the devil is in the details.
11:51:05dom96The guy behind Xi says there are some interesting engineering challenges
11:51:21dom96and jon's reply is pretty arrogant IMO
11:51:29FromGitter<mratsim> “How hard can it be to process a 1GB csv file” is a question I sometime sk myself :P
11:51:57FromGitter<krux02> I think it is just twitter that lets him talk like that, when you even see him on stream or in an interview he seems like the most polite and gentle man in the world.
11:52:27dom96sure, he's a nice guy
11:52:46dom96Doesn't mean he can't be arrogant too :)
11:52:49FromGitter<krux02> I had a 200MG json file processed in Nim. It took way to long to load that.
11:53:09FromGitter<krux02> so I wrote a converter for that format that basically did a memory dump.
11:53:19FromGitter<krux02> then I could load my data in a split second.
11:53:35FromGitter<krux02> but the problem is not json, it's the json module in nim
11:53:38dom96yep
11:54:10FromGitter<mratsim> oh, I will have to load Json in the X GB or even XX GB in Arraymancer
11:54:10dom96You should write a package for loading large JSON files :)
11:54:55FromGitter<krux02> I know my memory dump dosn't care for byte order or something like that, so I just made the binary dump a cache file.
11:55:32FromGitter<krux02> @mratsim look for a json module that does not allocate a ref object per json node
11:56:05FromGitter<krux02> I think there are altearnatives already written
11:56:06dom96Also, the json module includes a parser which you can use for large files
11:56:11dom96you don't have to use the high level API
11:58:20FromGitter<krux02> I have seen XML parsers that loaded up a 6mb xml file and ended up using 200mb
11:58:31FromGitter<krux02> how horrible can a datastructure be?
11:59:44FromGitter<krux02> xml is super verbose and when you are allowed to create your own data structure you make it 30 times as verbose?
12:01:29dom96A more likely reason is that the person that wrote the parser didn't care about memory usage
12:04:55FromGitter<krux02> yea, way too often people just don't care.
12:08:25*tiocavera joined #nim
12:08:25*tiocavera quit (Changing host)
12:08:25*tiocavera joined #nim
12:08:25*rockcavera quit (Killed (wilhelm.freenode.net (Nickname regained by services)))
12:08:25*tiocavera is now known as rockcavera
12:11:18ArrrrWithin a template, is it possible to compare two ast values without astToStr?
12:12:56*Vladar quit (Quit: Leaving)
12:24:16FromGitter<krux02> not really
12:24:30FromGitter<krux02> ant even with astToStr it is not possible
12:25:00FromGitter<krux02> use a macro for ast comparison
12:25:30FromGitter<krux02> and even then you prabably write your own custom AST matching algorithm
12:27:20FromGitter<krux02> I never had the problem that an AST would have become invalid, but in Nim the generated AST from expression changed already from time to time, so I would write a flexible matching
12:36:26*Snircle quit (Ping timeout: 245 seconds)
12:37:16*Snircle joined #nim
12:49:54*athenot_ joined #nim
12:51:21*athenot quit (Ping timeout: 240 seconds)
13:00:40*user1101 quit (Ping timeout: 276 seconds)
13:02:39*user1101 joined #nim
13:13:32FromGitter<zetashift> Started to do the cryptopals challenges and in the first challenge I need to convert a string to raw bytes. I know from python that you can use binascii to convert from ASCII to binary, how would I do this in Nim?
13:13:37FromGitter<zetashift> toHex on the string?
13:17:06FromGitter<diegogub> should the compiler tell me if Im trying to import something private?
13:17:43FromGitter<diegogub> took me few minutes to figure it out.. at first
13:19:15FromGitter<zacharycarter> I guess it could potentially if that symbol is being imported somewhere else - but I imagine it'd still be somewhat of a guessing game for the compiler
13:20:55FromGitter<zacharycarter> @zetashift toHex is going to give you a hexadecimal representation of a string - not a binary one
13:29:35*SenasOzys quit (Ping timeout: 240 seconds)
13:30:54FromGitter<Varriount> @zacharycarter You'll be happy to know I'm reviewing the aws request signing process
13:32:42*yglukhov_ joined #nim
13:32:55*yglukhov_ quit (Read error: Connection reset by peer)
13:33:23*yglukhov_ joined #nim
13:33:25FromGitter<zacharycarter> \o/
13:33:44*yglukhov quit (Ping timeout: 276 seconds)
13:34:54FromGitter<zacharycarter> !eval import strutils; echo "foo".toHex.parseHexInt.toBin(8)
13:34:57NimBot01101111
13:34:58FromGitter<zacharycarter> @zetashift ^
13:37:14*r3d9u11 joined #nim
13:39:18*r3d9u11 quit (Client Quit)
13:42:52*DarkArctic quit (Read error: Connection reset by peer)
13:43:02*DarkArctic joined #nim
13:44:37*SenasOzys joined #nim
13:45:20*DarkArctic_ joined #nim
13:47:06*DarkArctic_ quit (Client Quit)
13:47:31*DarkArctic_ joined #nim
13:47:38*DarkArctic_ quit (Client Quit)
13:48:57*DarkArctic quit (Ping timeout: 265 seconds)
13:50:09*r3d9u11 joined #nim
13:55:21*r3d9u11 quit (Ping timeout: 240 seconds)
13:55:29euantorRegarding the earlier discussion about RLS, I always enjoy this video: https://www.destroyallsoftware.com/talks/the-birth-and-death-of-javascript
13:56:54*leorize quit (Quit: WeeChat 2.1)
13:59:11*DarkArctic joined #nim
14:04:41FromGitter<tim-st> Is there a way to use the following code without losing Rune(char) ?
14:04:42FromGitter<tim-st> proc Rune(rune: string): Rune = ⏎ assert rune.runeLen == 1 ⏎ result = rune.runeAt(0)
14:04:58dom96Sadly nim-lang.org will be down for a bit
14:05:19Araqdom96, what? why?
14:05:23dom96Digital Ocean is rebooting everything in Frankfurt because of Spectre and Metldown
14:05:27dom96*Meltdown
14:08:33dom96To be honest, I expected Cloud Flare to help out here
14:11:31FromGitter<alehander42> oh man my csources is huuuge
14:11:34FromGitter<alehander42> 290 mb
14:12:02FromGitter<tim-st> what is the compile time for that size?
14:12:10*endragor quit (Remote host closed the connection)
14:13:03*Vladar joined #nim
14:13:05*smt quit (Read error: Connection reset by peer)
14:14:31*endragor joined #nim
14:18:28FromGitter<phrmoy> hey have you guys thought about adding Wasm as a target compilation to Nim: http://webassembly.org/?
14:18:59*endragor quit (Ping timeout: 252 seconds)
14:19:02FromGitter<Varriount> @Araq @dom96 The website appears to be down.
14:19:25FromGitter<Varriount> @phrmoy While it would be nice, we already have compilation to JS
14:19:34dom96Varriount: It is: https://twitter.com/nim_lang/status/978997656130289664
14:19:47FromGitter<zetashift> Nim playground seems to still work
14:20:27FromGitter<Varriount> That's hosted on another server, if I recall correctly.
14:20:30FromGitter<phrmoy> @Varriount just curious, I think Wasm might change things up a bit at some point with native performance
14:20:31dom96yep
14:21:01FromGitter<phrmoy> so it could be a selling point to Nim to stay ahead and gain traction ^^
14:26:55FromGitter<zetashift> @phrmoy Nim already supports it sortof through emscripten. But for a lot of things currently the JS backend is a lot better
14:29:50FromGitter<alehander42> maybe Nim just need to market that better , e.g. a -d:wasm switch etc (it already compiles to c/c++ => this choice led to posibility of reusing wasm backends => that's a good thing)
14:31:57dom96A Nim wasm backend sounds like a fun project
14:32:00dom96we should definitely do it
14:32:09dom96somebody needs to step up though :)
14:33:55FromGitter<Varriount> @Araq Is that non-copying string slice code in the compiler complete? I saw the toOpenArray addition in the recent commits
14:34:31dom96nim-lang.org is back up
14:51:21FromGitter<Varriount> dom96: Yay! My life is once again complete. :3
14:51:55Araqvarriount: well the codegen support exists. we need some TR macros that make use of it
14:52:33Araqand of course JS and Nim's VM don't support it. and it's hard to support.
14:52:45Yardanicodom96, ok
14:52:49Araqwe need a TR macro that only applies for the C backends
14:53:09Araqnot sure how to do that. :-(
14:53:30Yardanicowhen(js) ?
14:53:44Yardanicois it possible to use when(c) and when(cpp) ?
14:54:31dom96Yardanico: mmhm
14:55:33Yardanicowait, not when js, when defined(JS)
14:55:49Yardanicowhen not defined(JS) ?
14:56:23dom96Yardanico: Nah uhh
14:56:34Yardanicodom96, ?
14:56:44dom96Yardanico: I was just replying to your "ok"
14:56:59Yardanicodom96, I forgot that nim website runs on different VPS, and I thought that I'll need to restart discord bridge, that's why I wrote "ok"
15:00:03*gokr joined #nim
15:12:03AraqYardanico, when not defined(js) and not defined(nimvm) is true in a 'static' context :P
15:12:48FromGitter<phrmoy> awesome!
15:18:51FromGitter<mratsim> wasm is just compile to C then run llvm with emscripten.
15:19:02FromGitter<mratsim> Anyway we will probably need it at Status
15:20:07FromGitter<Varriount> @Araq Well I'm going to be using it for optimization purposes in this aws code.
15:20:11FromGitter<mratsim> and Zachary has a nim game engine running on wasm, and def- has a Nes emulator running on WASM
15:21:54Araqvarriount: well I wrote a test case and the 'parallel' statement used that builtin for some time. chances are high that it works. :-)
15:22:00shashlickaraq: had a question on vmops.nim and scriptconfig.nim - scriptconfig:setupVM() calls registerAdditionalOps() but none of those ops are available in nimscript unless you add them in lib\system\nimscript.nim AND register them again in setupVM()
15:23:20shashlickcan you please help me understand why nimscript and vm require separate calls to registerCallback() for the same op?
15:23:22Araqshashlick, look at the cbos template
15:23:30*gokr quit (Quit: Leaving.)
15:23:39Araqis uses "stdlib.system."
15:24:01Araqwhich is wrong, you need to register it for "stdlib.os.getCurrentDir"
15:24:21*SenasOzys quit (Remote host closed the connection)
15:24:32Araqand then it should need no further entry in a different file
15:27:13shashlickso you really need only one entry - either in vmops or in nimscript but not both
15:27:31shashlickand it seems nimscript is perhaps the better place to add this since it will get documented as well
15:28:30Araqno no no.
15:28:32Araq:-)
15:29:12Araqvmops.nim is the file you want to edit.
15:29:19Araqno other.
15:29:59shashlickwell, only for things that make sense of course
15:30:23*user1101 quit (Read error: Connection reset by peer)
15:30:34shashlicki'd argue we don't need those math functions in vmops either since you can import math in script or vm mode
15:30:34*user1101 joined #nim
15:31:08Araqand why do you think that works?
15:31:19Araqbecause they are in vmops.
15:31:36shashlickokay, so for os functions, you don't want a duplicate entry in nimscript when you can simply import os
15:32:01Araqthere is a difference between nimscript and Nim's VM
15:32:16shashlickwell, I tried sum() which isn't in vmops and it works
15:32:24Araqnimscript is for Nim's configuration system.
15:32:37Araqbut you want to use getCurrentDir() in a macro.
15:32:49Araqand so you need to patch the VM, not the config system.
15:33:24Araqsum() is in native Nim and doesn't use the FFI.
15:33:34Araqso sum() does not have to be overriden in the VM.
15:33:52*SenasOzys joined #nim
15:34:00Araqand works. but e.g. 'sin' is importc'ed and needs to be overriden
15:34:09Araqas the VM cannot importc things.
15:34:14Araqdoes that clear it up?
15:35:00shashlickmakes sense yes
15:35:08shashlicklet me do some more testing and I'll ask some more questions accordingly
15:35:15Araqok
15:35:56shashlickit's fair to say nimscript inherits stuff from vmops but macros (compile time) doesn't inherit stuff in scriptconfig
15:36:08Araqyes
15:39:31shashlickso in nimscript, you cannot "from os import getCurrentDir" and that's why you have to add a separate entry into stdlib.system in scriptconfig
15:40:05Araqyeah and that's probably bad
15:40:38Araqinstead os.nim should just work at compile-time, bailing out for things that use .importc
15:40:48Araqlike math.nim does it
15:42:49shashlickok let me take a look at that
15:43:57*miran joined #nim
15:45:44shashlickI don't see anything magical in math.nim - how do you pull it off?
15:46:49shashlickchecks: off?
15:59:35mirancan somebody tell me if there's a better / more idiomatic / simpler way of doing this: https://gist.github.com/narimiran/ccc87223aeb319115fe3628a2cf4d2dc
16:00:26miranParsed object will have different fields/types based on the `first` (line 19), so i use different fields (lines 23, 28, 30)
16:05:41*skelett quit (Quit: WeeChat 2.0.1)
16:21:05*sleepyqt quit (Ping timeout: 240 seconds)
16:23:42Araqshashlick, there is nothing magical in math.nim
16:23:53Araqthere is some .error in os.nim that prevents it from working
16:24:11Araqand maybe some top level statements that need to be prevented from running
16:25:02*r3d9u11 joined #nim
16:27:22*Arrrr quit (Ping timeout: 268 seconds)
16:27:55*Arrrr joined #nim
16:27:55*Arrrr quit (Changing host)
16:27:55*Arrrr joined #nim
16:27:59*sleepyqt joined #nim
16:34:37shashlickfor me it dies in winlean
16:34:38shashlickwinlean.nim(527, 3) Error: cannot 'importc' variable at compile time
16:43:25*smt joined #nim
16:43:47Araqok so winlean needs to be patched too
16:44:50shashlickso how come it processes all the lines before 527 with importc in them but fails here?
16:46:18FromGitter<zacharycarter> miran: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5abbc6dae3d0b1ff2c795f94]
16:46:27FromGitter<krux02> miran: according to the alignment rules, you will have 7 padding bypes after `first` and 6 at the end of `Parsed`. You should reorder them so that all char types are in one section.
16:46:29*sendell quit (Remote host closed the connection)
16:46:35shashlickit skips all procs and types which are importc but fails on the first var declaration
16:50:11*r3d9u11 quit (Remote host closed the connection)
16:52:28miranzacharycarter: is not using `rem = instr[1 .. instr.high]` that much better? i tried to measure against my version, and i get the same speed and memory usage
16:52:43FromGitter<zacharycarter> well
16:53:00FromGitter<zacharycarter> I don't think it matters right - but there's no point in caching that value if it's not going to be used later in the execution of your program
16:53:26FromGitter<zacharycarter> it might reduce the number of allocations your program is making by one
16:53:31FromGitter<zacharycarter> but I mean - no big deal either way
16:53:45mirankrux02: so basically change the order of the fields in the type declaration? or did i misundestand and i need to do something more?
16:53:52FromGitter<zacharycarter> I was more just pointing out a way to make your code more readable / and more in the style of how Nim is generally written - you weren't far off
16:53:59FromGitter<zacharycarter> that's what he's suggesting miran
16:54:26FromGitter<zacharycarter> probably change it to this - ⏎ ⏎ ```type ⏎ Parsed = object ⏎ first: char ⏎ second: int ⏎ xa, xb: int``` [https://gitter.im/nim-lang/Nim?at=5abbc8c2c4d0ae80070f496f]
16:54:41miranzacharycarter: dividing this into two procs is definitely way to go logic/readability-wise
16:54:44*kinkinkijkin quit (Remote host closed the connection)
16:55:40FromGitter<zacharycarter> I believe you could also do something here with strscans instead of relying on a case statement
16:55:42mirani thought you guys might recommend using https://nim-lang.org/docs/tut2.html#object-oriented-programming-object-variants instead of the way i defined my object
16:55:46FromGitter<zacharycarter> but it's most likely overkill for your usecase
16:56:25FromGitter<zacharycarter> well you'd need to create some kind of compile time condition to offer variance
16:56:31FromGitter<zacharycarter> in your object definition
16:56:32Araqshashlick, because it's a top level variable
16:56:54Araqprobably vmgen should be smarter and not flag it unless used
16:57:13miranthanks for taking the time to look at my code and improving it! much appreciated!
16:58:06FromGitter<zacharycarter> sure thing
16:59:29shashlickaraq: well, so for kicks, I commented out the error and now run into "vm is only allowed to 'cast' between integers of same size" so this might be wading too deep into the pool
17:00:10*nsf joined #nim
17:01:14Araqshashlick, I'm pretty busy but I will take over eventually
17:03:17*kinkinkijkin joined #nim
17:06:50shashlickseems like the nimscript method is fine for the near term, i'll add a few procs to bridge the gap
17:07:51*user1101 quit (Quit: user1101)
17:11:01mirankrux02, zacharycarter: reordering fields has reduced memory consumption noticeably! thanks for the tip!
17:15:08FromGitter<zacharycarter> miran: http://www.catb.org/esr/structure-packing/
17:19:38FromGitter<zetashift> Trying to solve this: https://cryptopals.com/sets/1/challenges/1 with code: https://pastebin.com/JJ30T8iY (playground couldn't create a gist for me), I'm getting a different output and I think I'm missing something obvious here
17:27:51FromGitter<zacharycarter> gist functionality in the PG is broken until I get around to adding user auth
17:27:57FromGitter<zacharycarter> since github deprecated anonymous gists
17:28:24FromGitter<zetashift> ah cool good to know
17:28:58*user1101 joined #nim
17:32:23*user1101 quit (Client Quit)
17:32:37*user1101 joined #nim
17:33:46*floppydh quit (Quit: WeeChat 2.1)
17:36:02FromGitter<zacharycarter> @zetashift
17:36:11FromGitter<zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5abbd28b458cbde55786c9da]
17:36:29FromGitter<zacharycarter> you don't need to go to binary in this case
17:36:54FromGitter<zetashift> Thank you! Is it because encode() accepts string?
17:36:57FromGitter<zacharycarter> you're given a hex string - you parse that to byte string
17:37:00FromGitter<zacharycarter> and then pass that to encode
17:37:30FromGitter<zacharycarter> well the challenge says convert from hex representation to base64 encoding
17:37:41FromGitter<zacharycarter> so I just looked for procs that went from hex -> string -> base64
18:08:52FromGitter<Vindaar> Just stumbled on a compiler error due to a bug in my code. After fixing the apparent bug, I got a linker error instead. Reduced the problem to this: ⏎ https://gist.github.com/Vindaar/ea1ad0abb7134255bb8122f19b2d6b87
18:09:22FromGitter<Vindaar> In general: if I want to have such an optional arg for a proc taking a seq[T], should I simply use `nil` instead?
18:10:18FromGitter<Vindaar> running on current devel btw
18:11:21*SenasOzys quit (Ping timeout: 240 seconds)
18:17:33*user1101 quit (Quit: user1101)
18:18:42*max3 joined #nim
18:20:10*SenasOzys joined #nim
18:21:53shashlick@zacharycarter: good to know anonymous gist is deprecated - I was wondering why it stopped working in snip
18:21:56shashlickwill use ix.io or something now
18:26:04*user1101 joined #nim
18:27:19yglukhov_Am I blind or nim doesn’t provide a way to connect a socket to a known ip/port, only to a string repr of those?
18:27:38yglukhov_*AsyncSocket
18:28:16dom96What's wrong with supplying a string?
18:29:12yglukhov_Well I've got IpAddress object already. Why convert it?
18:30:29dom96Pretty sure you'd end up converting that to a string to give to the OS anyway
18:31:47yglukhov_os uses sockaddr_t + len. thats somewhat lower level.
18:34:00FromGitter<tim-st> @Vindaar as a workaround: overload the procs where you want default = @[] and then supply @[] as argument
18:34:54FromGitter<tim-st> proc linkerError*T (x: seq[T]) = ⏎ linkerErrorT (x, @[])
18:35:41*PMunch joined #nim
18:40:12*dyln joined #nim
18:40:43FromGitter<tim-st> https://pastebin.com/TW3PcKWe
18:42:20*nsf quit (Quit: WeeChat 2.0.1)
18:42:22FromGitter<Vindaar> Thanks, yeah that should work! In my case though I'll just use nil for now, due to the structure of the arguments in the real proc
18:43:06FromGitter<tim-st> yes, I also use nil for this
18:43:44FromGitter<Vindaar> I usually try to avoid the usage of nil, but maybe I need to rethink in some cases :)
18:44:36FromGitter<tim-st> sometime I can avoid these things by using `static[T]` and then with `when`
18:45:11FromGitter<matrixbot> `narimiran` test 1 2
18:46:11miranif i'm not mistaken, some of you guys are posting from matrix/riot without this matrixbot, right?
18:47:54FromGitter<Vindaar> @tim-st not quite sure how `static[T]` helps in such a case. `when` can just be used in normal generics, too, no? Care to give an example?
18:51:57FromGitter<tim-st> Yes, you can use it for generic Type attributes like `E: enum` `when E.high.ord < 256: ...; But you can only work on the param if type was static defined (thought this was related to your problem, but maybe that's not the case ;) )
18:53:05FromGitter<tim-st> Oh, no. I now remember my use case was to fix some overhead using static
18:58:51*dyln quit (Remote host closed the connection)
19:01:51FromGitter<matrixbot> `narimiran` test 3 4
19:02:12dom96miran: yes, I think Yardanico has a link
19:02:19dom96We should add it to nim-lang.org/community.html
19:03:08*jrbrt joined #nim
19:03:51mirandom96: i have just installed riot, and i can see two nim gitter rooms (one called 'nim', the other 'Nim'), but as you can see - my messages go trough the matrixbot and the delay is enormous
19:04:30*rokups quit (Quit: Connection closed for inactivity)
19:04:34*sleepyqt quit (Read error: Connection reset by peer)
19:07:00FromGitter<Vindaar> @tim-st Ah, I see, that makes sense. Not really related, no. Just rewrote Numpy's histogram function in Nim and wanted an optional `weights` sequence as argument
19:09:13*smt` joined #nim
19:11:06miranvindaar: are you doing also some other numpy features? would there be an interest for that kind of stuff?
19:11:33dom96miran: There is a way to connect to IRC via Matrix
19:12:27*smt quit (Ping timeout: 240 seconds)
19:14:36*natrys joined #nim
19:19:18Yardanicodom96, I used matrix for a while, but it's not really needed for me
19:19:25*narimiran[m] joined #nim
19:19:27YardanicoI just use bnc instead, it's easier to use
19:19:31Yardanicoand faster
19:19:42Yardanicoand I don't need to use client for matrix written in electron :D
19:20:03Yardanicomiran, https://gist.github.com/fstab/ce805d3001600ac147b79d413668770d
19:20:27FromGitter<Vindaar> miran: Well, I'm certainly interested in that kind of stuff, haha. I'm writing the stuff I need as I go. Some useful stuff is implemented in @jlp765 's seqmath. It's quite old though
19:20:49narimiran[m]test 5 6
19:20:58*natrys quit (Quit: natrys)
19:21:00miranomfg, this is even slower
19:22:35miranVIndaar: thanks, i didn't know seqmath exist, will take a look
19:22:46FromGitter<Vindaar> Honestly at the moment I'm pretty torn about whether I should implement everything on `seq`s and nested `seq`s or simply decide that I'll use arraymancer's tensors for everything instead
19:23:21miranheh, add 'neo' to that torn-list ;)
19:23:31FromGitter<Vindaar> Yeah, I know, haha
19:24:18miranfrom what i have seen/experienced - there's no clear winner
19:24:44miranbut i want to be able to relatively easy do my numerics stuff in nim
19:27:02miranfrom just skimming through the code, seqmath seems quite useful
19:27:09dom96miran: hah, how slow is it?
19:27:41mirandom96: i'll post the same message here (irc) and there, and you measure the difference in time
19:28:13mirandom irc
19:28:49FromGitter<matrixbot> `narimiran` dom riot
19:28:51miran(i have sent it half a second before irc)
19:28:58dom96wow
19:29:00FromGitter<Vindaar> woah, that's slow indeed
19:29:21miranoh, that was gitter bridge
19:29:22dom96wait, is narimiran[m] also pending?
19:29:40miranirc bridge is slower. let's now do irc-bridge vs irc
19:29:58mirandom irc
19:30:11narimiran[m]dom ircbridge
19:30:22dom962 minutes!?
19:30:44dom96or, oh, you only just did it
19:30:47mirannaaah, it is less, but still intolerable
19:30:58dom96That's not that slow :)
19:31:17FromGitter<narimiran> dom gitter
19:31:17mirandom irc
19:31:22miranthis is instant
19:31:30PMunchHmm, when I do readFile in one macro and then try to call another macro that takes a static[string] I get a type error
19:31:35PMunchIs that correct?
19:32:00miranok, enough of this offtopic, let's return back to nim (and numerics :))
19:34:36*r3d9u11 joined #nim
19:34:59*yglukhov_ quit (Remote host closed the connection)
19:35:28FromGitter<Vindaar> for now I guess I'll just add my stuff to a fork of seqmath (and create a PR if @jlp765 still wants to maintain the original project)
19:36:22miranit would be nice to see seqmath mantained/improved
19:36:44miranwhat do you plan to add?
19:37:32dom96miran: Is it, though?
19:37:46dom96Ping reply from miran: 0.36 second(s)
19:37:53dom96Close enough :)
19:37:56*Arrrr quit (Read error: Connection reset by peer)
19:37:58miran:)
19:38:11dom96I wonder why Matrix is so slow
19:38:43FromGitter<Vindaar> just some stuff I have lying around now. things like arange, linspace, argmin/max, a really dumb `findPeaks` in a 1D seq, some convenience accessors like getting elements from a seq of indices, the histogram proc and some other things I guess. Need to put it all in one file :)
19:39:06mirannice!
19:39:27miranbtw, what's with nim and 'one giant file'?
19:40:07miranmost of nim projects i see have this one 1000 LOC file
19:40:49FromGitter<Vindaar> I guess it often happens when modules are written by one person and start growing "organically"
19:41:06miranVindaar: do you maybe plan to add posibility for `min(x, axis=1)` and stuff like that?
19:41:11FromGitter<mratsim> Or when it’s painful to fit Nim “recommended package structure” ;)
19:41:38miran:D
19:41:41FromGitter<mratsim> I feel like it’s either one single file or several subdirs
19:41:58FromGitter<Vindaar> Indeed :D refactoring my HDF5 library after it became a single > 3000 LOC file was quite a pain
19:42:48FromGitter<Vindaar> @miran always a useful thing, so yeah, I'll note it
19:42:53FromGitter<zacharycarter> well - a lot of people get stuck on the whole circular reference thing with modules and Nim
19:43:19*jrbrt quit (Quit: Oíche mhaith)
19:43:20FromGitter<zacharycarter> they try to write module a and module b and then when module c needs module b but so does module a - they don't know what to do
19:43:25FromGitter<mratsim> I remember for the first 6 months I was using includes in arraymancer :P
19:43:50FromGitter<mratsim> then compilation started to get super slow when doing a single modification
19:43:53FromGitter<zacharycarter> the biggest challenge for me w/ Nim was getting over wanting to use inheritance and ref objects everywhere
19:44:39FromGitter<mratsim> never had that issue but my first language was Haskell and then Rust so no inheritance at all
19:45:10FromGitter<zacharycarter> I struggled with structuring packages as well
19:45:19FromGitter<zacharycarter> yeah - I came from OOP world
19:45:45FromGitter<zacharycarter> and learned I can survive and flourish without strict OOP
19:45:52FromGitter<mratsim> We see people asking question about getter and peters from time to time as well
19:45:59FromGitter<mratsim> setters*
19:46:05FromGitter<zacharycarter> yeah heh
19:46:08FromGitter<zacharycarter> such a dumb concept
19:46:32FromGitter<zacharycarter> but Java would have you believing this is how programming needs to be done
19:46:35FromGitter<mratsim> it makes sense if you need to validate input from user
19:46:39miranmore examples/explatations in tutorial?
19:46:49miranyeah yeah, i know, PRs are welcome :)
19:46:51FromGitter<zacharycarter> regarding what miran?
19:47:01FromGitter<mratsim> the thing is, in Nim it’s super hard to make a field private but usable in internal modules
19:47:39miranzacharycarter: OOP stuff (there were some questions earlier today about constructors)
19:47:40FromGitter<mratsim> the first hurdle it having a field name like Fname
19:47:46PMunchAnyone know how I can pass a static string to another macro that takes a static string?
19:47:57FromGitter<mratsim> and accesseors like name, name= and name which returns var T
19:48:26FromGitter<zacharycarter> well I mean constructors per se don't really exist in Nim
19:48:31FromGitter<zacharycarter> you can instantiate an object inline
19:48:53miranyeah, but stuff like that should be explained
19:49:02FromGitter<zacharycarter> it depends what background you're coming from
19:49:13FromGitter<zacharycarter> because if you're used to C - you don't deal w/ constructors either
19:49:18FromGitter<zacharycarter> or Python
19:49:27FromGitter<mratsim> @PMunch, can you treerepr the passed static string? I found out that macro passing to another macro sometimes change the internal type (seq becomes array, bool becomes int)
19:49:33FromGitter<zacharycarter> C++ or Java, etc.. - it's another story
19:50:05FromGitter<zacharycarter> there is an OOP section in the manual
19:50:14FromGitter<zacharycarter> https://nim-lang.org/docs/tut2.html#object-oriented-programming
19:50:16FromGitter<mratsim> @Pmunch so either I getAST or I pass to a compileTime proc
19:50:17PMunchWell what I want to do is have one version of the macro that takes a string, and one that takes a file
19:50:23FromGitter<zacharycarter> I guess if you wanted to elaborate on stuff there - no one would complain
19:50:31*r3d9u11 quit (Remote host closed the connection)
19:50:51PMunchSo I want to have one macro that's a simple wrapper that calls read and then calls the other macro
19:51:07shashlickmiran: I use matrix/riot as well
19:51:11shashlickhttps://riot.im/app/#/room/#freenode_#nim:matrix.org
19:51:41FromGitter<mratsim> @pMunch, maybe do a compileTime proc that returns NimNode, and that calls the macro inside?
19:51:43PMunchmacro parseProto(spec: static[string]): untyped
19:51:58PMunchmacro parseProtoFile(fname: static[string]): untyped
19:52:07narimiran[m]shashlick: i have tried that room, but i get delays....
19:52:08PMunchBasically those two, where the second calls the first
19:52:25PMunchHmm, that might be possible
19:52:25shashlicknarimiran: it's not super fast but bearable I guess
19:52:45dom96shashlick: That's the URL, any chance you could PR it into community.html? :)
19:52:46shashlickbetter than fighting with my own bouncer and stuff
19:52:57FromGitter<mratsim> or parseProto should accept static[string] or NimNode
19:53:11miranlast two messages were sent faster than those before.... i don't know, might give it another try....
19:53:59shashlickdom96: actually the correct URL is https://matrix.to/#/#freenode_#nim:matrix.org
19:54:07shashlicki have it in my backlog for the last month :(
19:54:38miranshashlick: your messages are also delayed on irc
19:57:03PMunchmratsim, but I need to get the value as a string. As I'm parsing it for the macro
19:57:52shashlickmiran: how can you tell?
19:58:22mirani have riot open in my browser, and IRC client
19:58:31*athenot_ quit (Ping timeout: 252 seconds)
19:59:04PMunchAh, it seems to work if I change the main macro to a compile-time proc. Then create two macros both with static[string] arguments and calling the compile-time proc which takes a string and returns a NimNode
19:59:50*athenot joined #nim
20:00:28FromGitter<diegogub> Guys, someone could help me with json library, is raising exception if one field of a object is not present in the json..Kind of strict, any idea?
20:06:21*athenot quit (Ping timeout: 240 seconds)
20:07:40*athenot joined #nim
20:09:56*miran quit (Quit: Konversation terminated!)
20:10:03FromGitter<zacharycarter> I think that's a limitation of the json macro
20:10:20FromGitter<zacharycarter> I don't think it supports optional fields when demarshalling
20:14:57dom96it does, using Option[T]
20:15:11dom96but maybe diegogub isn't using the 'to' macro
20:17:12Yardanicodom96, it does?!
20:17:22YardanicoI didn't know!
20:18:22dom96yep
20:22:11FromGitter<Vindaar> @miran: added most of the stuff to my seqmath fork just now: https://github.com/Vindaar/seqmath
20:23:38shashlickdom96: where is community.html?
20:23:51shashlickthere's only community.md I see
20:24:01dom96that's what I mean
20:24:49*Newwww joined #nim
20:24:57shashlickI think you mean index.html - that's where the Community section is
20:25:32dom96both
20:26:50dom96although you probably won't get an icon for index.html
20:26:55dom96so community page is good enough
20:27:35shashlickneed to figure out an icon for matrix/riot though
20:29:17shashlickguess just using # is good enough
20:30:08dom96That's IRCs icon :/
20:37:27FromGitter<stisa> shashlick: maybe you can use something from matrix.org: https://github.com/matrix-org/matrix.org/tree/master/content (the favicon maybe?)
20:37:56shashlickmatrix has no icon per se, should I use # or a generic chat icon like one of these: https://fontawesome.com/icons?d=gallery&q=chat&m=free
20:39:04shashlick@stisa: I could but it won't match the yellow scheme on nim-lang.org
20:41:00*jrbrt joined #nim
20:41:57dom96Maybe just use [m]
20:44:01*Vladar quit (Quit: Leaving)
20:54:54shashlickdom96: where does community.md get displayed?
20:54:57*PMunch quit (Quit: Leaving)
20:55:14dom96https://nim-lang.org/community.html
20:56:33shashlickoh okay join the community
21:05:12*yglukhov joined #nim
21:13:54*jrbrt quit (Quit: Oíche mhaith)
21:20:22*gokr joined #nim
21:22:52FromGitter<zetashift> Did the `func` keyword get in 0.18?
21:26:24Araqit works but it's only an alias for 'proc'
21:33:34*vlad1777d joined #nim
21:38:17FromDiscord<treeform> what would func do?
21:38:22FromDiscord<treeform> immutable?
21:41:08shashlickdang, IT update has killed hyper-v somehow, ccannot get to my VM anymore
21:50:48*Newwww quit (Quit: Page closed)
21:54:10*jaco60 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:55:07FromGitter<mratsim> @treeform: noSideEffect
21:57:00*jaco60 joined #nim
21:58:58*jaco60 quit (Client Quit)
21:59:26*yglukhov quit (Remote host closed the connection)
22:01:48*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
22:05:46*Snircle joined #nim
22:25:03*Trustable quit (Remote host closed the connection)
22:30:15*Senketsu quit (Quit: Lost terminal)
22:30:18*vlad1777d quit (Ping timeout: 260 seconds)
22:43:51FromGitter<diegogub> @dom96 yes, im using to() macro
22:44:22dom96so use Option[T]
22:45:07FromGitter<diegogub> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5abc1af35f188ccc15093d0d]
22:45:56FromGitter<diegogub> @dom96 , sorry, second day with nim..how would I use that?
22:46:24dom96What does StreamStatusResponse look like?
22:47:41FromGitter<diegogub> Sorry, basically.. I created 2 structs to avoid the to() exception.. At first I wanted to use this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5abc1b8d7c3a01610d85a2af]
22:48:05FromGitter<diegogub> so I created this to solve it: ⏎ ⏎ ```type StreamStatusRespose* = ref object of RootObj ⏎ version*: uint64 ⏎ ``` [https://gitter.im/nim-lang/Nim?at=5abc1ba5e3d0b1ff2c7af9b1]
22:48:17FromGitter<diegogub> but its not practical..
22:48:37dom96Well, if `id` is optional you'd just use `id*: Option[string]`
22:48:54*NimBot joined #nim
22:48:56dom96You'll need to `import options` as well.
22:49:44FromGitter<diegogub> I see, i will read options docs
22:49:57FromGitter<diegogub> Does it change something from the string?
22:50:10dom96You can think of it as a box
22:50:19dom96A box that may contain a piece of text or not
22:50:45dom96You can use isNone and isSome to check if the box is empty or not respectively
22:51:34FromGitter<zacharycarter> so Option works with objects as well as pointers?
22:51:56FromGitter<diegogub> @dom96 sound cool, will try it. Thanks! Falling in love with nim so far.. haha
22:52:01FromGitter<zacharycarter> also - what is the underlying allocation like for an Option type?
22:52:54FromGitter<zacharycarter> I guess I'll just rtfm :P
22:59:07FromGitter<mratsim> Surprise it contains a Shroedinger cat
22:59:34FromGitter<mratsim> Option are heap allocated iirc
22:59:59Araqno, it's a tuple
23:00:03FromGitter<mratsim> oh
23:01:28*jrbrt joined #nim
23:01:28*gokr quit (Read error: Connection reset by peer)
23:02:09FromGitter<mratsim> Since some wanted to conflate isNone with nil pointer I thought it had to do with optimizing heap alloc
23:11:04FromGitter<krux02> that someone was me,
23:11:30FromGitter<krux02> @mratsim and no I did have nothing to do with heap allocation
23:12:29FromGitter<krux02> it was just for arguing with rust people. Then I could have said, when theay talk about the option optimization, hey nim does the same thing, and it is not even a language feature.
23:12:44FromGitter<krux02> it is implemented in the library, see how awesome nim is.
23:12:58shashlickdom96: should we add https://stackoverflow.com/questions/tagged/nim to the community threaded conversations list
23:14:25FromGitter<diegogub> @dom96 now unmarshaling wokrs..the issue is coverting that object into JSON
23:17:38shashlickdom96: https://imgur.com/a/JUAZS
23:19:17*gokr joined #nim
23:19:58FromGitter<diegogub> json from object looks like this : ⏎ {"id": {"val": "tests2", "has": true}, "version": 1061, "not_found": {"val": false, "has": false}} using marshal module
23:20:06dom96shashlick: looks good
23:20:45dom96'night
23:31:58FromGitter<cavariux> is there unsigned char in nim? I cannot find it
23:34:08FromGitter<zetashift> Isn't char just an alias for uin8?
23:34:15FromGitter<zetashift> uint8*
23:34:53FromGitter<zetashift> https://nim-lang.org/docs/system.html#char
23:35:10FromGitter<cavariux> oh, and by default is unsigned
23:35:15FromGitter<cavariux> thanks
23:37:00FromGitter<diegogub> uint64 type is not supported by json module..any idea why?
23:38:07FromGitter<diegogub> BiggestUInt *
23:38:15FromGitter<zacharycarter> are you using the c backend or js backend?
23:38:53FromGitter<diegogub> c
23:39:05FromGitter<zetashift> In JS backend uint64 is a uint32
23:41:18FromGitter<diegogub> this is the error: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5abc281e270d7d37086d4fe9]
23:41:56FromGitter<diegogub> BiggestUInt is not supported
23:44:36*NimBot joined #nim
23:47:47FromGitter<zacharycarter> @diegogub - ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ compiles fine for me [https://gitter.im/nim-lang/Nim?at=5abc29a37c3a01610d85da4c]
23:48:22FromGitter<zacharycarter> oh my bad
23:48:24FromGitter<zacharycarter> you're using %
23:48:27FromGitter<zacharycarter> I see
23:49:20FromGitter<zetashift> This might a stupid suggestion but can't you do `var x = BiggestInt(foo)`?
23:50:46FromGitter<zacharycarter> well that's not the problem
23:51:04FromGitter<zacharycarter> the problem is he already has a JsonNode object and he wants to demarshall it
23:51:07FromGitter<diegogub> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5abc2a6b7c3a01610d85dcb2]
23:51:58FromGitter<diegogub> this is the issue.
23:53:44FromGitter<zacharycarter> @diegogub - this is one solution - not the best I'm sure but
23:53:49FromGitter<zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5abc2b0d2b9dfdbc3a3257ce]
23:54:23FromGitter<zacharycarter> as far as why the type isn't supported - dom96 wrote the macro so maybe ping him when he's awake tomorrow
23:54:28FromGitter<zacharycarter> he's euro time FYI
23:54:43FromGitter<diegogub> yeah, I should sleep too now..4am here
23:54:58FromGitter<diegogub> thanks!
23:55:02FromGitter<zacharycarter> np
23:55:19FromGitter<zetashift> Good night, I'm out too!
23:55:33FromGitter<diegogub> good night!