00:00:13 | FromGitter | <phrmoy> because i keep experimenting with everything i see lol |
00:00:38 | FromGitter | <zacharycarter> time to install emacs |
00:00:44 | FromGitter | <zacharycarter> and learn some lisp variant |
00:01:21 | FromGitter | <zacharycarter> I think that was the ultimate black hole of nonproductivity for me |
00:01:24 | FromGitter | <phrmoy> how are u guys findings these gems? |
00:01:32 | FromGitter | <mratsim> They come to us :P |
00:01:34 | FromGitter | <phrmoy> its like hiding there somewhere |
00:02:02 | FromGitter | <mratsim> Also shameless ad but be sure to check my own tensor library: https://github.com/mratsim/Arraymancer |
00:02:14 | FromGitter | <mratsim> OpenMP + Cuda + OpenCL |
00:02:15 | FromGitter | <zacharycarter> +1 ^ |
00:02:39 | FromGitter | <zacharycarter> I've never used it in a project, but I've really wished hard that I knew how to |
00:03:35 | FromGitter | <zacharycarter> if you actually know what you're doing with ML code |
00:03:40 | FromGitter | <mratsim> I need to add docs and basic data loading beyond csv :/ |
00:03:45 | FromGitter | <phrmoy> @mratsim outstanding |
00:03:48 | FromGitter | <zacharycarter> nah it's not your fault |
00:04:06 | FromGitter | <zacharycarter> I need something as easy as - load csv, choose model, get result |
00:04:22 | FromGitter | <zacharycarter> that's why I used that apple turricreate lib - it was that simple |
00:04:41 | FromGitter | <phrmoy> If Nim compiles this fast, we should still get into Jupyter |
00:04:53 | FromGitter | <zacharycarter> I think there's already a nim jupyter kernel |
00:05:13 | FromGitter | <mratsim> https://github.com/stisa/INim |
00:05:17 | FromGitter | <zacharycarter> but turricreate doesn't give you the primitives arraymancer does |
00:05:19 | FromGitter | <zacharycarter> so... |
00:05:55 | FromGitter | <mratsim> yes arraymancer is for research + production |
00:06:25 | FromGitter | <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:55 | FromGitter | <zacharycarter> yeah see - I think someone needs to write something like: https://github.com/maciejkula/spotlight - on top of arraymancer |
00:07:00 | FromGitter | <phrmoy> very nice, im impressed |
00:07:07 | FromGitter | <zacharycarter> or something like turricreate, etc... |
00:07:10 | FromGitter | <zacharycarter> that dumbs down this stuff |
00:07:33 | FromGitter | <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:57 | FromGitter | <zacharycarter> well I understand that a bit more |
00:08:11 | FromGitter | <zacharycarter> and I'm sure someone that understands it better than I do would really appreciate it :P |
00:08:49 | FromGitter | <mratsim> And then something like scikit learn “fit” (train data) + predict (test data) |
00:09:22 | FromGitter | <mratsim> so you could train in 5 lines: load -> split -> fit -> cross-validate -> predict |
00:09:39 | FromGitter | <zacharycarter> yeah that would be super sweet |
00:10:35 | * | find0x90 quit (Quit: find0x90) |
00:11:36 | FromGitter | <phrmoy> Futhark is also dope, please keep on sharing these gems with me ^^ |
00:12:15 | FromGitter | <Varriount> @mratsim Your library is awesome! |
00:13:39 | FromGitter | <Varriount> @phrmoy Hey, have you heard about this language called Nim? It's pretty great. :P |
00:14:53 | FromGitter | <mratsim> thanks varriount :) |
00:14:59 | FromGitter | <mratsim> going to sleep now |
00:15:45 | FromGitter | <zacharycarter> lol |
00:15:52 | FromGitter | <zacharycarter> this blog post - https://brandur.org/rust-web |
00:16:36 | FromGitter | <phrmoy> I heard it's kinda fast and terse |
00:16:42 | FromGitter | <phrmoy> ^^ |
00:16:50 | * | dddddd quit (Remote host closed the connection) |
00:17:06 | FromGitter | <zacharycarter> someone should write the equivalent code in Nim |
00:17:14 | FromGitter | <phrmoy> @mratsim gn thanks for the info |
00:17:29 | FromGitter | <mratsim> Ah |
00:17:34 | FromGitter | <mratsim> I have something for you |
00:17:49 | FromGitter | <mratsim> http://halide-lang.org/ |
00:18:05 | FromGitter | <phrmoy> oh man.. let's have it |
00:18:10 | FromGitter | <mratsim> This lib uses it: https://github.com/facebookresearch/TensorComprehensions |
00:18:17 | FromGitter | <mratsim> to optimize einsum |
00:18:46 | FromGitter | <mratsim> And this one uses it as an intermediate representation for deep learning graph: https://github.com/dmlc/nnvm |
00:18:57 | FromGitter | <phrmoy> that's interesting, I'm starting to get hooked to these purpose-oriented languages |
00:20:02 | FromGitter | <zacharycarter> I want to try out - http://www.luna-lang.org/ - but not until they C support / ability to bind with Nim |
00:20:31 | FromGitter | <phrmoy> good stuff |
00:20:48 | FromGitter | <phrmoy> agreed, compilation to C is somewhat paramount for me |
00:20:58 | * | PMunch quit (Quit: leaving) |
00:21:34 | FromGitter | <mratsim> apparently they have something for C |
00:21:42 | FromGitter | <zacharycarter> they do but it's in the works I think |
00:21:45 | FromGitter | <mratsim> didn’t know about that. I’ll check it out |
00:22:08 | FromGitter | <mratsim> There is a beginning of bindings to visdom with arraymancer: https://github.com/facebookresearch/visdom |
00:22:33 | FromGitter | <mratsim> It’s there but it only displays images for now, it doesn’t plot: https://github.com/edubart/arraymancer-vision |
00:22:42 | FromGitter | <mratsim> and the lib probably doesn’t compile anymore |
00:25:40 | FromGitter | <zacharycarter> http://www.chriskrycho.com/2018/exploring-4-languages-integrity-and-consistency.html - article on the FP of HN |
00:26:12 | FromGitter | <zacharycarter> Rust, Elm, F♯, and ReasonML |
00:27:27 | FromGitter | <zacharycarter> kind of strange languages to compare against each other |
00:27:45 | FromGitter | <zacharycarter> I don't see anyone using Rust or ReasonML vs one another |
00:28:16 | FromGitter | <zacharycarter> dribble |
00:43:27 | * | gokr quit (Ping timeout: 240 seconds) |
00:45:23 | FromGitter | <cavariux> @zacharycarter in the opengl bindings for I keep the gl prefix or I strip it out of every proc? |
00:47:34 | FromGitter | <cavariux> And do you think the module should be called ```opengl``` or ```gl``` |
00:51:00 | FromGitter | <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:34 | FromGitter | <zacharycarter> @cavariux I guess if you don't plan on supporting any other graphics APIs then the gl prefix is unnecessary |
01:24:42 | FromGitter | <zacharycarter> but people might be familiar with it |
01:24:44 | FromGitter | <zacharycarter> so I don't know... |
01:25:37 | FromGitter | <phrmoy> @zacharycarter one of the founders of Luna: "One of the early founders of Flowbox.io. Loves dogs, hates JavaScript." |
01:25:57 | FromGitter | <zacharycarter> sounds like me |
01:26:01 | FromGitter | <zacharycarter> minus the startup founder thing |
01:26:25 | FromGitter | <cavariux> we all hate JavaScript |
01:26:34 | FromGitter | <cavariux> I plan to support vulkan so I guess I will keep it |
01:27:07 | FromGitter | <cavariux> other than you @zacharycarter anyone else you know makes graphics in nim? |
01:27:22 | FromGitter | <zacharycarter> we all hate JavaScript on this blessed day :) |
01:28:14 | FromGitter | <zacharycarter> @cavariux yeah - there are quite a few people - @yglukhov does quite a bit of opengl work w/ Nim |
01:28:32 | FromGitter | <zacharycarter> I don't know how active other folks are that play with OpenGL in a gamedev / graphics capacity |
01:28:53 | FromGitter | <zacharycarter> most are inactive to my knowledge |
01:28:57 | FromGitter | <cavariux> okay okay, and to bind with opengl what have you done until now? |
01:29:18 | FromGitter | <zacharycarter> https://github.com/nim-lang/opengl |
01:29:21 | FromGitter | <zacharycarter> or |
01:29:47 | FromGitter | <zacharycarter> https://github.com/zacharycarter/bgfx.nim - what I intend on using for the next iteration of frag |
01:29:57 | FromGitter | <zacharycarter> oh |
01:30:08 | FromGitter | <zacharycarter> @krux02 is also very much into graphics stuff regarding Nim |
01:30:41 | FromGitter | <cavariux> oh okay great, still seems like a niche inside of a niche |
01:30:42 | FromGitter | <cavariux> haha |
01:30:57 | FromGitter | <zacharycarter> what's that? |
01:31:29 | FromGitter | <cavariux> a smaller group of a small group |
01:31:33 | FromGitter | <zacharycarter> no |
01:31:49 | FromGitter | <cavariux> O.o? |
01:31:55 | FromGitter | <zacharycarter> I mean what are you describing |
01:32:03 | FromGitter | <zacharycarter> as being a niche inside of a niche |
01:32:15 | FromGitter | <cavariux> did I get the idea wrong then? |
01:32:20 | FromGitter | <cavariux> I thought niche was like a small group |
01:32:24 | FromGitter | <zacharycarter> it is |
01:32:45 | FromGitter | <zacharycarter> I just don't know what you're using that descriptor to describe :) |
01:33:05 | FromGitter | <zacharycarter> what are you saying is a niche inside of a niche? |
01:33:07 | FromGitter | <zacharycarter> Nim? |
01:33:07 | FromGitter | <cavariux> ohhh, that people that like graphics inside of nim is really just few people |
01:33:12 | FromGitter | <zacharycarter> oh yes |
01:33:17 | FromGitter | <zacharycarter> you're right about that :) |
01:33:35 | FromGitter | <cavariux> tbh I have found nim to be the best language to code graphics |
01:33:37 | FromGitter | <zacharycarter> sorry for not understanding you |
01:33:43 | FromGitter | <cavariux> don't worry |
01:34:09 | FromGitter | <cavariux> It's fast and it gives you a lot of freedom when programming |
01:34:09 | FromGitter | <zacharycarter> well... I think it can alleviate some of the boilerplate w/ metaprogramming |
01:34:13 | FromGitter | <epmor> Bonjour |
01:34:16 | FromGitter | <zacharycarter> o/ |
01:34:23 | FromGitter | <cavariux> Hi |
01:34:28 | FromGitter | <epmor> Haven't been on here in a while :D |
01:34:34 | FromGitter | <zacharycarter> wb |
01:34:41 | FromGitter | <epmor> How's everybody? |
01:36:00 | FromGitter | <zacharycarter> good I suppose - most folks that are usually active in here are asleep I think |
01:36:27 | FromGitter | <epmor> Yeah tis 2:30am |
01:37:04 | FromGitter | <cavariux> yep mostly because dom and araq are from eu I think so they have gather more people from there |
01:37:25 | FromGitter | <epmor> Yeah I'm EU too :D |
01:37:29 | FromGitter | <epmor> Wales specifically |
01:38:35 | FromGitter | <cavariux> nice, I'm from Mexico |
01:38:59 | FromGitter | <epmor> Hola :)) |
01:39:39 | FromGitter | <cavariux> Hola :D |
01:39:45 | FromGitter | <epmor> You lads made anything crazy in Nim ? |
01:40:45 | FromGitter | <cavariux> Me not really, but I have seen other members do crazy things |
01:41:10 | FromGitter | <Varriount> I made a POC code generator for AWS API schemas |
01:41:45 | FromGitter | <epmor> Ah nice Varriount |
01:42:17 | FromGitter | <cavariux> I'm making a bindings library for nim including opengl, glfw, a linear math lib for opengl and planning on imgui |
01:42:28 | FromGitter | <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:33 | FromGitter | <epmor> Ah nice Leonardo |
01:42:57 | FromGitter | <cavariux> I have never touched Lisp |
01:43:08 | FromGitter | <cavariux> or languages like |
01:43:23 | FromGitter | <epmor> It's niche and fun. Pretty language aye |
01:43:40 | FromGitter | <epmor> If I didn't have rainbow parenths I probs would've said no to sticking with it :D |
01:45:39 | FromGitter | <cavariux> It's just that too many parenthesis |
01:45:44 | FromGitter | <epmor> Yeah lol |
01:56:15 | FromGitter | <gogolxdong> Anyone has the aws signature version 4 request client? |
02:39:17 | shashlick | @cavariux do check out nimgen if it helps in your bindings work |
02:44:05 | * | endragor joined #nim |
03:06:34 | FromGitter | <Varriount> @gogolxdong If you look through my gists you'll find an implementation |
03:07:23 | FromGitter | <gogolxdong> Is this https://github.com/Varriount/nimaws? |
03:09:10 | FromGitter | <gogolxdong> nimble install nimaws package not found |
03:14:17 | * | athenot quit (Ping timeout: 276 seconds) |
03:14:47 | * | athenot joined #nim |
03:20:51 | FromGitter | <gogolxdong> @Varriount where is your gists, I nimble install from the nimaws directory inside , but import hints cannot open nimaws |
03:21:44 | FromGitter | <Varriount> https://gist.github.com/Varriount/5f99f862393a186665cd454ae6137ff4 |
03:21:53 | FromGitter | <Varriount> It's proof-of-concept code |
03:23:32 | FromGitter | <gogolxdong> yes, thanks ,what's difference between nimaws and this code? |
03:24:37 | FromGitter | <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:38 | FromGitter | <gogolxdong> Doesn't the param need sorting ? @Varriount |
03:34:01 | FromGitter | <Varriount> What do you mean? |
03:34:07 | shashlick | @cavariux - you didn't use c2nim? |
03:36:21 | FromGitter | <gogolxdong> https://gist.github.com/gogolxdong/a58f794a3fab7f7fb2d92d5848a9fbf8 |
03:37:18 | FromGitter | <gogolxdong> @Varriount this is our version ,cannot issue request properly ,don't know the reason |
03:50:04 | FromGitter | <cavariux> shashlick, nope haha |
04:01:06 | * | SenasOzys quit (Remote host closed the connection) |
04:03:01 | * | SenasOzys joined #nim |
04:07:33 | FromGitter | <gogolxdong> @Varriount will you help us to check this https://gist.github.com/gogolxdong/20a8cf8804ceed2935444fe39562b11f |
04:07:59 | FromGitter | <gogolxdong> response with Transfer Complete! |
04:10:17 | * | user1101 quit (Quit: user1101) |
04:23:18 | FromGitter | <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:16 | FromGitter | <Varriount> I wrote that code a while ago, so I'm not surprised it doesn't work |
04:31:54 | FromGitter | <Varriount> I should probably attempt to optimize that nimaws code. I helped work on it. |
04:33:19 | FromGitter | <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:50 | FromGitter | <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:12 | FromGitter | <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:39 | FromGitter | <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:13 | FromGitter | <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:20 | FromGitter | <diegogub> Helloo, how can I have constructors for objects? How is the normal way of initialized a DateTime value.? |
08:06:58 | FromGitter | <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:32 | FromGitter | <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:43 | FromGitter | <narimiran> @diegogub something like `__init__` in python? |
08:28:50 | FromGitter | <gogolxdong> In sigv4 ,either append X-Amz-Signature=signature to payload or set http header["Authorization"]=signature. nimaws uses the latter. |
08:29:43 | FromGitter | <narimiran> @diegogub have you checked this: https://nim-lang.org/docs/tut2.html#object-oriented-programming ? |
08:43:07 | FromGitter | <diegogub> @narimiran , yes, i checked. Yes, like *init* ...Im trying to define a proc new() |
08:43:34 | FromGitter | <diegogub> like this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5abb55b5e4ff28713a80c953] |
08:43:39 | FromGitter | <diegogub> but its not working.. |
08:45:00 | FromGitter | <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:39 | FromGitter | <mratsim> convention is new+Type for ref object, and init+Type for stack objects |
08:46:02 | FromGitter | <diegogub> @mratsim will try, thanks again! |
08:46:04 | FromGitter | <mratsim> you have to do “new result” otherwise you get a null exception |
08:46:07 | FromGitter | <narimiran> oh, i didn't know about that convention, good to know! |
08:46:29 | FromGitter | <diegogub> Should be added to the documentation right? |
08:46:34 | FromGitter | <diegogub> Would be nice |
08:47:04 | FromGitter | <gogolxdong> @Varriount around ? |
08:48:05 | FromGitter | <mratsim> I think it is either the manual or the tutorial. But yeah nim documentation is one of the weak point. |
08:48:27 | FromGitter | <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:20 | FromGitter | <mratsim> I think you need `result.id = “”` |
08:49:45 | FromGitter | <mratsim> otherwise it’s a nil pointer |
08:56:14 | FromGitter | <diegogub> keep having the same warning..but working now! |
08:58:17 | * | vlad1777d joined #nim |
09:01:55 | FromGitter | <diegogub> Looks like I found the solution: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5abb5a037c3a01610d81d4f5] |
09:02:19 | FromGitter | <diegogub> No warning using this form, @mratsim @narimiran |
09:03:34 | FromGitter | <wu-lee> Is there a function like succ() for enums which will wrap around at the end of the sequence? |
09:08:40 | FromGitter | <krux02> well I think you can always do cast to int and mod division and then cast back to enum |
09:08:56 | FromGitter | <krux02> as long as the enum has no holes at least |
09:09:56 | FromGitter | <mratsim> Hackers gotta be hacky :P |
09:10:09 | FromGitter | <krux02> I wouldn't call it hacky |
09:10:22 | FromGitter | <krux02> I mean that is exactly what such a succ would do anyway |
09:11:11 | FromGitter | <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:24 | FromGitter | <mratsim> I would compare to len, if pos != len - 1, reset, otherwise advance. div/mod is super costly |
09:11:29 | FromGitter | <wu-lee> Would be a nice bonus if it deals with holes too :) |
09:11:53 | FromGitter | <krux02> yea not that costly |
09:12:03 | FromGitter | <krux02> still faster that doing anything in python :P |
09:12:53 | FromGitter | <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:10 | FromGitter | <wu-lee> anyway, sounds like the answer is no: you have to do it yourself? |
09:13:20 | FromGitter | <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:33 | FromGitter | <krux02> well I think so |
09:13:51 | FromGitter | <krux02> enums are semantically names, not integers. |
09:14:06 | FromGitter | <krux02> so I would not expect it to have any integer like operations |
09:14:49 | FromGitter | <wu-lee> looping isn't really an integer operation, mathematically it's more fundamental, a property of a sequence |
09:15:31 | FromGitter | <wu-lee> so any sequential enum supports succ(), but there's an exception when you reach the end |
09:16:16 | FromGitter | <wu-lee> wrapping around is just a nice convenience |
09:17:57 | FromGitter | <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:56 | FromGitter | <krux02> I think Nim knows if an enum has holes or not. |
09:21:00 | FromGitter | <krux02> But that's it basically |
09:21:14 | FromGitter | <krux02> but I also think that you can iterate all the values in a marco |
09:21:18 | Araq | don't use enum with holes, I consider them a mistake |
09:21:31 | FromGitter | <mratsim> enums are just int, int32, int16, int8 |
09:22:01 | FromGitter | <krux02> Araq: well enums with holes are not a mistake, they help a lot when wrapping C code. |
09:22:16 | Araq | they predate distinct ints, for C interop a distinct integer type is better |
09:22:33 | FromGitter | <krux02> ok I didn't know that |
09:23:05 | FromGitter | <krux02> I am thinking if the opengl wrapper should use a distinct int for GLenum |
09:23:15 | Araq | I think it should. |
09:23:47 | FromGitter | <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:06 | FromGitter | <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:49 | Araq | krux02: introduce an overload for these? |
09:25:09 | Araq | mratsim: pff, it's all a macro away. Nim should be based on macros, not core language features |
09:25:32 | Araq | features need to be introduced if a macro is not feasible |
09:25:37 | FromGitter | <mratsim> I guess another macro to add to sugar.nim ;) |
09:25:45 | FromGitter | <krux02> Araq: In theory, I would agree, but not for a low level wrapper |
09:25:51 | Araq | which is more often than I would like, but that's a different topic |
09:26:17 | Araq | and also something Nim will get better at, will write an RFC. |
09:26:35 | FromGitter | <mratsim> what I linked was produced by c2nim by the way |
09:26:39 | FromGitter | <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:56 | FromGitter | <krux02> Araq: one thing I still wonder is how well nim can cache the results of macros. |
09:27:17 | FromGitter | <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:33 | Araq | check --symbolFiles:v2 |
09:27:36 | FromGitter | <krux02> will this macro from the library be executed on each run? |
09:27:52 | Araq | it deals with macros implicitly. |
09:28:11 | Araq | currently, yes. every compilation goes through everything, macros or not. |
09:28:28 | Araq | symbol files will fix this. |
09:28:50 | FromGitter | <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:59 | FromGitter | <krux02> ok that is very good to know that this will be better. |
09:29:14 | Araq | it's not macro specific. |
09:29:24 | Araq | we will have incremental compilation. |
09:29:33 | FromGitter | <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:10 | Araq | well, instead of musing about fork() help me with symbol files :-) |
09:30:27 | FromGitter | <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:51 | Araq | no. |
09:30:55 | FromGitter | <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:12 | FromGitter | <krux02> I was very tired when I wrote that |
09:31:20 | Araq | fork() is to low level |
09:31:27 | FromGitter | <krux02> what's the problem? |
09:31:33 | Araq | you need to split the address space. |
09:31:39 | FromGitter | <krux02> why? |
09:31:44 | Araq | if a module were self-contained |
09:32:13 | FromGitter | <krux02> what is a self containde module? |
09:32:26 | Araq | ok, different attempt. |
09:32:40 | Araq | the compiler uses a web of objects, aka "the module graph" |
09:32:47 | FromGitter | <krux02> ok |
09:32:55 | Araq | and you want to update some nodes in it. |
09:33:04 | FromGitter | <krux02> yes |
09:33:12 | Araq | and fork() knows nothing about this graph. |
09:33:18 | FromGitter | <krux02> yes |
09:33:24 | FromGitter | <krux02> but does it need to? |
09:33:44 | FromGitter | <krux02> each fork lives in it's own address space |
09:34:32 | Araq | I fail to see how to use fork() |
09:34:35 | FromGitter | <narimiran> @mratsim modular arithmetic might be quite useful for some of my things, thanks! |
09:34:52 | Araq | you can load the stdlib and then fork() |
09:35:01 | FromGitter | <krux02> yes that is the idea |
09:35:06 | Araq | but that's not done. the stdlib loading is lazy |
09:35:17 | Araq | based on what the main nim file imports. |
09:35:21 | FromGitter | <krux02> ah ok |
09:35:57 | FromGitter | <krux02> that basically kills it |
09:36:08 | Araq | btw the tests take 35 minutes on good days on travis, I think. |
09:36:38 | FromGitter | <krux02> well when I did them they took oven an hour I think |
09:36:47 | FromGitter | <krux02> but I didn't do a pull request recently |
09:37:00 | Araq | it's all parallelized but travis got slower, not sure why |
09:37:33 | FromGitter | <krux02> I think the tests would run faster, if a lot of the small tests would be joined to bigger tests. |
09:37:41 | FromGitter | <krux02> I mean just fewer files to compile |
09:37:48 | FromGitter | <krux02> but probably not that important |
09:38:17 | FromGitter | <krux02> I am talking about the really tiny tests here that only have a few lines of code |
09:38:32 | FromGitter | <krux02> make them into one test with a few hundred lines of code. |
09:38:44 | Araq | we do that. |
09:38:50 | FromGitter | <krux02> ok |
09:39:10 | Araq | lots of old tests don't, but *shrug* |
09:39:28 | Araq | feel free to clean it up. only a couple of thousand tests to look at :P |
09:40:08 | FromGitter | <krux02> yea |
09:40:34 | FromGitter | <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:27 | FromGitter | <krux02> But I think the fork thing could work in compiling C/C++ though. #include "common.h", fork() |
09:42:48 | FromGitter | <krux02> but yea that is not relevant here I guess. |
09:43:25 | Araq | something like that could work, but seems fragile, non-portable and solves 40% of the problem |
09:43:42 | Araq | whereas symbolfiles solve 80% and will work on Windows :P |
09:43:56 | FromGitter | <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:17 | FromGitter | <krux02> who cares about windows |
09:44:24 | FromGitter | <krux02> it's a dying platform |
09:44:37 | FromGitter | <krux02> like AmigaOS |
09:44:43 | Araq | gamers care :P |
09:45:00 | FromGitter | <krux02> I hate that term gamer |
09:46:02 | FromGitter | <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:33 | Araq | ok. players care. |
09:46:54 | FromGitter | <krux02> :) |
09:47:53 | * | dddddd joined #nim |
09:48:10 | FromGitter | <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:38 | FromGitter | <krux02> just to point out that playing games is about having fun, and not about to be taken serious. |
09:48:49 | FromGitter | <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:45 | euantor | most enterprises care about Windows too |
09:54:59 | euantor | Nim's strong support for Windows is one of it's nicest features |
09:55:19 | euantor | I stay away from any language that doesn't support Windows (such as Crystal or Swift) personally |
09:55:32 | FromGitter | <krux02> hew we should not really discuss that targeting windows is important |
09:56:22 | FromGitter | <krux02> The big three desktop operationg systems are Windows/Linux/MacOS |
09:57:43 | FromGitter | <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:04 | FromGitter | <krux02> especially in Africa it is common to have a smartphone, but not to have a desktop computer. |
09:58:25 | FromGitter | <krux02> So that Linux took over Windows basically already happened. |
09:58:36 | FromGitter | <krux02> (if you count Android as Linux) |
10:03:00 | Araq | Android is not Linux IMO. |
10:03:16 | * | arnetheduck quit (Remote host closed the connection) |
10:03:27 | Araq | it's just the kernel with completely utterly different JVM based APIs on top |
10:03:54 | FromGitter | <krux02> that is true |
10:04:05 | Araq | it doesn't run gnome or KDE or apt-get, it doesn't give you a terminal |
10:05:17 | * | arnetheduck joined #nim |
10:05:31 | FromGitter | <krux02> well there are terminals for android |
10:05:39 | FromGitter | <krux02> but I don't know how they work |
10:05:45 | Araq | it's a sad platform. |
10:06:17 | FromGitter | <krux02> the problem is also that something like tty would not work on android, because there is no typewriter (keyboard) on android |
10:06:44 | FromGitter | <krux02> there are terminal emulators, but I don't know how they work internally |
10:07:20 | FromGitter | <krux02> what I don't like is that the core API is already based on JVM |
10:07:29 | FromGitter | <krux02> but year that is just how it is |
10:08:45 | FromGitter | <krux02> is it possible to develop android in Nim? |
10:09:37 | Araq | yes it is. |
10:09:51 | Araq | btw fork() doesn't work on iOS either iirc. it's not just Windows. |
10:10:17 | FromGitter | <krux02> yes I know fork is a Linux only thing |
10:10:30 | Araq | no, fork() is posix. |
10:10:58 | FromGitter | <krux02> ok sorry for using those terms without proper distinction. |
10:13:36 | FromGitter | <wu-lee> var fields in objects: I infer they're not allowed? |
10:14:07 | FromGitter | <krux02> well the fields of an object are *var* when the object is var |
10:14:11 | Araq | they are also not required. mutability is not tied to a type in Nim. |
10:14:36 | FromGitter | <krux02> I don't think nim has an equivalent of `mutable` in c++ |
10:15:01 | Araq | it also doesn't have C++'s 'const' |
10:15:12 | Araq | so why would it need 'mutable'. |
10:15:42 | FromGitter | <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:45 | FromGitter | <krux02> what exactly is the difference of c++ const and nim's, not var |
10:16:02 | Araq | Nim is still tremendously simpler than C++. and we need to keep it this way. |
10:16:29 | FromGitter | <narimiran> +1 |
10:16:54 | FromGitter | <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:43 | FromGitter | <krux02> but apart from that I can't state any concrete difference of c++ const and the abcence of var in nim. |
10:17:48 | FromGitter | <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:04 | FromGitter | <krux02> it's all or nothing |
10:18:25 | FromGitter | <krux02> eather you have a mutable view on your data, or not. |
10:18:37 | Araq | yup. |
10:19:28 | FromGitter | <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:38 | FromGitter | <wu-lee> My case is on the drawing board, so this is just something to bear in mind in my experiments ;) |
10:23:04 | FromGitter | <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:31 | FromGitter | <krux02> why would you need to have partial mutability there? |
10:25:48 | FromGitter | <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:13 | Araq | in the poor toy game engine I once wrote, the animation state was a rectangle. |
10:27:20 | FromGitter | <krux02> `proc render(obj: AnimationObject; modelMat: Mat4f; animation: int; animationState: float32)` |
10:27:44 | Araq | a 2D slice into the surface that contains all the frames |
10:27:45 | FromGitter | <wu-lee> I might not need it, but part of the model might be logically constant parameters of the world |
10:28:13 | FromGitter | <krux02> well in flexible animation systems it would be possible to mix arbitray animations in various amounts. |
10:28:28 | Araq | you proceed a frame by updating the rectangle's x coord |
10:28:52 | FromGitter | <krux02> yes but don't but parts of the words into model data |
10:29:06 | Araq | if the animation repeats you need to 'mod' the coord :-) |
10:29:49 | FromGitter | <krux02> Araq: yes, but you can't use `mod` for that, becausethen when you get negative values ... you know the rest |
10:30:06 | Araq | I don't have negative x coords. |
10:30:23 | FromGitter | <krux02> are you sure? |
10:30:47 | FromGitter | <krux02> in animation systems with looping animations it's easy to have negative arguments |
10:30:52 | FromGitter | <krux02> because why not |
10:31:13 | Araq | yes, they refer to the absolution position of the surface that contains all the possible frames |
10:31:27 | Araq | and I don't reverse my animations in time. |
10:32:02 | Araq | it's the simplest thing that can possibly work. and it worked. |
10:32:36 | FromGitter | <krux02> anyway, nim_glm has modulo for that |
10:33:22 | FromGitter | <krux02> well the simplest think that can possibly work as an animation is a bouncing ball |
10:34:03 | * | jaco60 joined #nim |
10:34:07 | FromGitter | <wu-lee> that's kind of where I'm starting: no images, just graphics primitives. bouncing balls. |
10:34:57 | FromGitter | <wu-lee> my approximate inspiration is "Ballz" a rather addictive game for Android. |
10:35:55 | Araq | graphics primitives don't scale, write a sprite engine :-) |
10:36:27 | FromGitter | <wu-lee> I'm just a newb :) |
10:36:55 | FromGitter | <wu-lee> is there a useable/recommended nim repl? |
10:37:10 | FromGitter | <krux02> net recommended, but there is "nim secret" |
10:37:22 | FromGitter | <wu-lee> beyond "nim secret" I mean, which barfs a lot |
10:37:38 | FromGitter | <krux02> well not really |
10:37:40 | Yardanico | wu-lee but use proper compilation when you can; nim compilation is pretty fast |
10:38:00 | Araq | there are nim REPLs. but I haven't tried them. |
10:38:07 | Yardanico | Araq, yeah, I tried INim |
10:38:22 | Yardanico | it's a cool, but hacky solution (well, it can only be done in a 'hacky' way) |
10:38:27 | FromGitter | <krux02> I createy a shortcut in my editor to edit /tmp/scratch.nim |
10:38:28 | Yardanico | INim is pretty simple |
10:38:37 | FromGitter | <krux02> I put all my scratching in there. |
10:38:37 | Yardanico | https://github.com/AndreiRegiani/INim |
10:39:45 | FromGitter | <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:07 | Yardanico | wu-lee you can use special script for gdb which will help in nim debugging |
10:41:17 | Yardanico | https://github.com/cooldome/Nim-gdb |
10:41:44 | FromGitter | <krux02> @wu-lee do you know rbreak? |
10:41:55 | FromGitter | <krux02> I use that to deal with the mageling |
10:42:09 | FromGitter | <krux02> rbreak foo breaks on all functions that contain foo |
10:42:23 | FromGitter | <wu-lee> @Yardanico, will try that, thanks |
10:44:21 | FromGitter | <wu-lee> @krux02 the gdb command rbreak? Ok, that would help. So, nothing that would appease a Java IDE addict, I assume? |
10:45:02 | FromGitter | <krux02> I am sorry. |
10:45:18 | Yardanico | wu-lee sadly no, not yet (TM) |
10:45:19 | FromGitter | <krux02> I am afraid debugging Nim quite sucks a lot. |
10:45:30 | Yardanico | yeah, that's quite true :/ |
10:45:48 | Araq | I enjoy it... writeStackTrace() + echo/dump |
10:46:26 | Yardanico | async debugging sucks even more, sorry :P |
10:46:38 | Yardanico | sometimes I don't have async proc where error happened in my async error stack trace |
10:46:41 | FromGitter | <wu-lee> I am thinking of what my colleagues would say if I mentioned Nim as a better X |
10:46:42 | FromGitter | <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:53 | FromGitter | <krux02> A better X? |
10:47:04 | Arrrr | Better than porn |
10:47:05 | Araq | debuggers 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:41 | FromGitter | <krux02> really debuggers are not just for that |
10:48:27 | Araq | real debuggers have super slow conditional breakpoints and fragile mouse-over-variable/expression UIs |
10:48:39 | FromGitter | <krux02> Debugging is mustly to turn down the execution speed and whatch what actually happens in a program. |
10:48:45 | FromGitter | <wu-lee> I would be like Richard Dawkins at Christmas |
10:49:02 | FromGitter | <krux02> it greatly helps to get an understanding of code that you haven't written on your own. |
10:49:03 | Araq | never found 'real' debuggers productive. |
10:49:10 | FromGitter | <wu-lee> If I said "debuggers are a waste of time" |
10:49:37 | FromGitter | <krux02> using gdb command line does suck a lot. |
10:50:13 | FromGitter | <krux02> but to have an integrated debugger where you can watch how values change over time really does not suck a lot |
10:50:42 | Araq | which 'values' though? you can get lost in the data so easily. |
10:51:14 | FromGitter | <wu-lee> It does not always suck. Not having a decent debugger can certainly suck tho. |
10:52:10 | dom96 | Far too many programmers rely on debuggers |
10:52:46 | dom96 | I was one of those until Araq helped me see the light :P |
10:53:00 | FromGitter | <wu-lee> Certain people consider any language without IDE support out of the question, and these people are often hirers and firers |
10:53:08 | dom96 | In all seriousness though, we do need to care about all those programmers that are accustomed to using GUI debuggers |
10:53:26 | Araq | agreed, but I have used C# and its debugger for years. |
10:53:27 | Yardanico | wu-lee nim has IDE support if you would call it like that |
10:53:35 | FromGitter | <diegogub> guys, which http client do you recommend for nim? |
10:53:40 | Yardanico | default one |
10:53:44 | Araq | and its debugger is universally seen as excellent. |
10:53:48 | Yardanico | httpclient from stdlib |
10:53:51 | FromGitter | <krux02> well I have done c++ teaching. |
10:54:06 | Araq | and yet I don't miss it, never was productive with it. |
10:54:11 | Yardanico | VSCode + nim extension - you get code highlighting, code completion, error checking, etc... |
10:54:13 | FromGitter | <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:46 | FromGitter | <krux02> and teaching the students to use a debugger so they can step through there code really helped them a lot. |
10:55:28 | FromGitter | <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:16 | FromGitter | <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:18 | FromGitter | <krux02> words |
10:56:30 | FromGitter | <wu-lee> @Yardanico, that sounds like it might be worth trying. |
10:56:33 | FromGitter | <krux02> a much bigger hassle and much harder to understand |
10:56:44 | dom96 | Debugging without a debugger is a skill that every programmer should have |
10:56:51 | Yardanico | wu-lee most of people coding in Nim use this combo |
10:57:00 | FromGitter | <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:04 | dom96 | You should have taken that opportunity to teach them how to debug without a debugger |
10:57:42 | FromGitter | <krux02> Well I think you should learn to debug with a debugger first. |
10:57:46 | Yardanico | dom96, in languages like C++ you can't really do much stuff without a debugger |
10:58:00 | FromGitter | <krux02> then you can improve your skill afterwards if you want to. |
10:58:31 | dom96 | Yardanico: How so? |
10:58:49 | FromGitter | <krux02> and very important is to have a smart debugger. |
10:59:00 | * | SenasOzys joined #nim |
10:59:15 | FromGitter | <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:31 | FromGitter | <wu-lee> http://dilbert.com/strip/1992-09-08 |
10:59:32 | Yardanico | dom96, 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:36 | FromGitter | <krux02> and especially for young people who just want to understand their programm horribly confusing. |
11:02:20 | * | Snircle joined #nim |
11:03:14 | dom96 | hrm, anyone know is the language server protocol includes debugging support? |
11:03:18 | dom96 | https://langserver.org/ |
11:03:26 | dom96 | It mentions "Diagnostics" on the front page but not sure what that means |
11:04:04 | Yardanico | dom96, it doesn't |
11:04:10 | Yardanico | "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:47 | Yardanico | I didn't find anything for another languages |
11:04:55 | dom96 | oh, diagnostics are just compiler messages |
11:06:46 | * | sleepyqt joined #nim |
11:07:10 | FromGitter | <krux02> dom96: I know that Jonathan Blow doesn't like that very much :P |
11:07:22 | dom96 | Doesn't like what? |
11:07:29 | dom96 | The language server protocol? |
11:08:01 | * | user1101 quit (Quit: user1101) |
11:08:05 | * | user1101 joined #nim |
11:12:16 | FromGitter | <krux02> https://twitter.com/Jonathan_Blow/status/931147749306896385 |
11:13:17 | Yardanico | lol |
11:14:38 | FromGitter | <phrmoy> lol |
11:16:38 | * | Trustable joined #nim |
11:22:11 | Yardanico | well I get his point - faster computers get, slower software gets |
11:22:27 | FromGitter | <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:42 | Yardanico | like instead of text editors written in C/C++ we have text editors written in JS |
11:22:44 | FromGitter | <krux02> I would like to track what will be going on with that language. |
11:23:57 | FromGitter | <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:08 | FromGitter | <krux02> now sure how that will turn out. |
11:25:38 | FromGitter | <mratsim> @krux02 Jai? |
11:27:45 | FromGitter | <krux02> yes |
11:27:50 | FromGitter | <krux02> he the man |
11:27:57 | FromGitter | <krux02> oh sorry |
11:28:00 | FromGitter | <krux02> no I don't mean jai |
11:28:14 | FromGitter | <krux02> jai is not public and I don't think it compiles to GLSL |
11:28:18 | FromGitter | <krux02> at least not yet. |
11:28:49 | FromGitter | <zetashift> @krux02 Scopes! |
11:28:51 | FromGitter | <krux02> it was a different programming language, and it had Python syntax |
11:28:56 | FromGitter | <zetashift> http://scopes.readthedocs.io/en/latest/about.html |
11:29:12 | FromGitter | <mratsim> oh from yesterday |
11:29:15 | * | nsf quit (Quit: WeeChat 2.0.1) |
11:29:23 | FromGitter | <krux02> that one yes thanks a lot |
11:29:39 | FromGitter | <krux02> did you talk about it yesterday? |
11:29:44 | FromGitter | <krux02> I don't rememeber that |
11:31:19 | dom96 | krux02: Is there a reason for this somewhere down the thread or should I not bother reading? |
11:33:49 | dom96 | I guess he just thinks JSON over a socket adds too much latency |
11:34:09 | dom96 | Well, he's wrong :P |
11:34:31 | dom96 | The real latency is in gathering the auto complete results |
11:41:38 | FromGitter | <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:18 | FromGitter | <krux02> he just wants the api to be a native call. I think he might be a bit emotionally biased here. |
11:43:54 | FromGitter | <krux02> Just for curiosity I like this guy talking about programming: https://www.youtube.com/watch?v=8pTEmbeENF4 |
11:45:52 | dom96 | JSON is far more universally supported than Protobuf or captnproto |
11:46:09 | FromGitter | <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:14 | dom96 | Optimising the protocol in this case is optimising the uncommon case |
11:46:16 | dom96 | It doesn't make sense |
11:47:00 | FromGitter | <krux02> yea might be true, I think what Jonathan doesn't like is this network protocol in the middle. |
11:47:46 | FromGitter | <krux02> I read what he wrote and he was never specific about what actually is the problem. |
11:47:52 | dom96 | yeah, that's a classic talk |
11:48:15 | FromGitter | <krux02> He also had one "Inventing on Princible". Very great. |
11:48:37 | FromGitter | <krux02> I found an old document from me called "notes" and I had a link to this video in it. |
11:48:50 | FromGitter | <krux02> haven't written anything into it for a long time. |
11:48:57 | FromGitter | <krux02> I want to rivive it now :P |
11:49:15 | * | leorize joined #nim |
11:49:22 | dom96 | Based on what he's writing about VS code and the Xi editor, he seems a little arrogant |
11:49:38 | dom96 | Paraphrasing: "How hard can it be to draw some text on the screen?" |
11:49:49 | FromGitter | <krux02> what did he write about VScode? |
11:49:54 | * | vlad1777d quit (Ping timeout: 256 seconds) |
11:50:02 | FromGitter | <krux02> but he is right. |
11:50:28 | dom96 | https://twitter.com/Jonathan_Blow/status/931934535989825536 |
11:50:30 | FromGitter | <mratsim> the devil is in the details. |
11:51:05 | dom96 | The guy behind Xi says there are some interesting engineering challenges |
11:51:21 | dom96 | and jon's reply is pretty arrogant IMO |
11:51:29 | FromGitter | <mratsim> “How hard can it be to process a 1GB csv file” is a question I sometime sk myself :P |
11:51:57 | FromGitter | <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:27 | dom96 | sure, he's a nice guy |
11:52:46 | dom96 | Doesn't mean he can't be arrogant too :) |
11:52:49 | FromGitter | <krux02> I had a 200MG json file processed in Nim. It took way to long to load that. |
11:53:09 | FromGitter | <krux02> so I wrote a converter for that format that basically did a memory dump. |
11:53:19 | FromGitter | <krux02> then I could load my data in a split second. |
11:53:35 | FromGitter | <krux02> but the problem is not json, it's the json module in nim |
11:53:38 | dom96 | yep |
11:54:10 | FromGitter | <mratsim> oh, I will have to load Json in the X GB or even XX GB in Arraymancer |
11:54:10 | dom96 | You should write a package for loading large JSON files :) |
11:54:55 | FromGitter | <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:32 | FromGitter | <krux02> @mratsim look for a json module that does not allocate a ref object per json node |
11:56:05 | FromGitter | <krux02> I think there are altearnatives already written |
11:56:06 | dom96 | Also, the json module includes a parser which you can use for large files |
11:56:11 | dom96 | you don't have to use the high level API |
11:58:20 | FromGitter | <krux02> I have seen XML parsers that loaded up a 6mb xml file and ended up using 200mb |
11:58:31 | FromGitter | <krux02> how horrible can a datastructure be? |
11:59:44 | FromGitter | <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:29 | dom96 | A more likely reason is that the person that wrote the parser didn't care about memory usage |
12:04:55 | FromGitter | <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:18 | Arrrr | Within a template, is it possible to compare two ast values without astToStr? |
12:12:56 | * | Vladar quit (Quit: Leaving) |
12:24:16 | FromGitter | <krux02> not really |
12:24:30 | FromGitter | <krux02> ant even with astToStr it is not possible |
12:25:00 | FromGitter | <krux02> use a macro for ast comparison |
12:25:30 | FromGitter | <krux02> and even then you prabably write your own custom AST matching algorithm |
12:27:20 | FromGitter | <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:32 | FromGitter | <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:37 | FromGitter | <zetashift> toHex on the string? |
13:17:06 | FromGitter | <diegogub> should the compiler tell me if Im trying to import something private? |
13:17:43 | FromGitter | <diegogub> took me few minutes to figure it out.. at first |
13:19:15 | FromGitter | <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:55 | FromGitter | <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:54 | FromGitter | <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:25 | FromGitter | <zacharycarter> \o/ |
13:33:44 | * | yglukhov quit (Ping timeout: 276 seconds) |
13:34:54 | FromGitter | <zacharycarter> !eval import strutils; echo "foo".toHex.parseHexInt.toBin(8) |
13:34:57 | NimBot | 01101111 |
13:34:58 | FromGitter | <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:29 | euantor | Regarding 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:41 | FromGitter | <tim-st> Is there a way to use the following code without losing Rune(char) ? |
14:04:42 | FromGitter | <tim-st> proc Rune(rune: string): Rune = ⏎ assert rune.runeLen == 1 ⏎ result = rune.runeAt(0) |
14:04:58 | dom96 | Sadly nim-lang.org will be down for a bit |
14:05:19 | Araq | dom96, what? why? |
14:05:23 | dom96 | Digital Ocean is rebooting everything in Frankfurt because of Spectre and Metldown |
14:05:27 | dom96 | *Meltdown |
14:08:33 | dom96 | To be honest, I expected Cloud Flare to help out here |
14:11:31 | FromGitter | <alehander42> oh man my csources is huuuge |
14:11:34 | FromGitter | <alehander42> 290 mb |
14:12:02 | FromGitter | <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:28 | FromGitter | <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:02 | FromGitter | <Varriount> @Araq @dom96 The website appears to be down. |
14:19:25 | FromGitter | <Varriount> @phrmoy While it would be nice, we already have compilation to JS |
14:19:34 | dom96 | Varriount: It is: https://twitter.com/nim_lang/status/978997656130289664 |
14:19:47 | FromGitter | <zetashift> Nim playground seems to still work |
14:20:27 | FromGitter | <Varriount> That's hosted on another server, if I recall correctly. |
14:20:30 | FromGitter | <phrmoy> @Varriount just curious, I think Wasm might change things up a bit at some point with native performance |
14:20:31 | dom96 | yep |
14:21:01 | FromGitter | <phrmoy> so it could be a selling point to Nim to stay ahead and gain traction ^^ |
14:26:55 | FromGitter | <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:50 | FromGitter | <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:57 | dom96 | A Nim wasm backend sounds like a fun project |
14:32:00 | dom96 | we should definitely do it |
14:32:09 | dom96 | somebody needs to step up though :) |
14:33:55 | FromGitter | <Varriount> @Araq Is that non-copying string slice code in the compiler complete? I saw the toOpenArray addition in the recent commits |
14:34:31 | dom96 | nim-lang.org is back up |
14:51:21 | FromGitter | <Varriount> dom96: Yay! My life is once again complete. :3 |
14:51:55 | Araq | varriount: well the codegen support exists. we need some TR macros that make use of it |
14:52:33 | Araq | and of course JS and Nim's VM don't support it. and it's hard to support. |
14:52:45 | Yardanico | dom96, ok |
14:52:49 | Araq | we need a TR macro that only applies for the C backends |
14:53:09 | Araq | not sure how to do that. :-( |
14:53:30 | Yardanico | when(js) ? |
14:53:44 | Yardanico | is it possible to use when(c) and when(cpp) ? |
14:54:31 | dom96 | Yardanico: mmhm |
14:55:33 | Yardanico | wait, not when js, when defined(JS) |
14:55:49 | Yardanico | when not defined(JS) ? |
14:56:23 | dom96 | Yardanico: Nah uhh |
14:56:34 | Yardanico | dom96, ? |
14:56:44 | dom96 | Yardanico: I was just replying to your "ok" |
14:56:59 | Yardanico | dom96, 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:03 | Araq | Yardanico, when not defined(js) and not defined(nimvm) is true in a 'static' context :P |
15:12:48 | FromGitter | <phrmoy> awesome! |
15:18:51 | FromGitter | <mratsim> wasm is just compile to C then run llvm with emscripten. |
15:19:02 | FromGitter | <mratsim> Anyway we will probably need it at Status |
15:20:07 | FromGitter | <Varriount> @Araq Well I'm going to be using it for optimization purposes in this aws code. |
15:20:11 | FromGitter | <mratsim> and Zachary has a nim game engine running on wasm, and def- has a Nes emulator running on WASM |
15:21:54 | Araq | varriount: well I wrote a test case and the 'parallel' statement used that builtin for some time. chances are high that it works. :-) |
15:22:00 | shashlick | araq: 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:20 | shashlick | can you please help me understand why nimscript and vm require separate calls to registerCallback() for the same op? |
15:23:22 | Araq | shashlick, look at the cbos template |
15:23:30 | * | gokr quit (Quit: Leaving.) |
15:23:39 | Araq | is uses "stdlib.system." |
15:24:01 | Araq | which is wrong, you need to register it for "stdlib.os.getCurrentDir" |
15:24:21 | * | SenasOzys quit (Remote host closed the connection) |
15:24:32 | Araq | and then it should need no further entry in a different file |
15:27:13 | shashlick | so you really need only one entry - either in vmops or in nimscript but not both |
15:27:31 | shashlick | and it seems nimscript is perhaps the better place to add this since it will get documented as well |
15:28:30 | Araq | no no no. |
15:28:32 | Araq | :-) |
15:29:12 | Araq | vmops.nim is the file you want to edit. |
15:29:19 | Araq | no other. |
15:29:59 | shashlick | well, only for things that make sense of course |
15:30:23 | * | user1101 quit (Read error: Connection reset by peer) |
15:30:34 | shashlick | i'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:08 | Araq | and why do you think that works? |
15:31:19 | Araq | because they are in vmops. |
15:31:36 | shashlick | okay, so for os functions, you don't want a duplicate entry in nimscript when you can simply import os |
15:32:01 | Araq | there is a difference between nimscript and Nim's VM |
15:32:16 | shashlick | well, I tried sum() which isn't in vmops and it works |
15:32:24 | Araq | nimscript is for Nim's configuration system. |
15:32:37 | Araq | but you want to use getCurrentDir() in a macro. |
15:32:49 | Araq | and so you need to patch the VM, not the config system. |
15:33:24 | Araq | sum() is in native Nim and doesn't use the FFI. |
15:33:34 | Araq | so sum() does not have to be overriden in the VM. |
15:33:52 | * | SenasOzys joined #nim |
15:34:00 | Araq | and works. but e.g. 'sin' is importc'ed and needs to be overriden |
15:34:09 | Araq | as the VM cannot importc things. |
15:34:14 | Araq | does that clear it up? |
15:35:00 | shashlick | makes sense yes |
15:35:08 | shashlick | let me do some more testing and I'll ask some more questions accordingly |
15:35:15 | Araq | ok |
15:35:56 | shashlick | it's fair to say nimscript inherits stuff from vmops but macros (compile time) doesn't inherit stuff in scriptconfig |
15:36:08 | Araq | yes |
15:39:31 | shashlick | so 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:05 | Araq | yeah and that's probably bad |
15:40:38 | Araq | instead os.nim should just work at compile-time, bailing out for things that use .importc |
15:40:48 | Araq | like math.nim does it |
15:42:49 | shashlick | ok let me take a look at that |
15:43:57 | * | miran joined #nim |
15:45:44 | shashlick | I don't see anything magical in math.nim - how do you pull it off? |
15:46:49 | shashlick | checks: off? |
15:59:35 | miran | can somebody tell me if there's a better / more idiomatic / simpler way of doing this: https://gist.github.com/narimiran/ccc87223aeb319115fe3628a2cf4d2dc |
16:00:26 | miran | Parsed 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:42 | Araq | shashlick, there is nothing magical in math.nim |
16:23:53 | Araq | there is some .error in os.nim that prevents it from working |
16:24:11 | Araq | and 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:37 | shashlick | for me it dies in winlean |
16:34:38 | shashlick | winlean.nim(527, 3) Error: cannot 'importc' variable at compile time |
16:43:25 | * | smt joined #nim |
16:43:47 | Araq | ok so winlean needs to be patched too |
16:44:50 | shashlick | so how come it processes all the lines before 527 with importc in them but fails here? |
16:46:18 | FromGitter | <zacharycarter> miran: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5abbc6dae3d0b1ff2c795f94] |
16:46:27 | FromGitter | <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:35 | shashlick | it 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:28 | miran | zacharycarter: 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:43 | FromGitter | <zacharycarter> well |
16:53:00 | FromGitter | <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:26 | FromGitter | <zacharycarter> it might reduce the number of allocations your program is making by one |
16:53:31 | FromGitter | <zacharycarter> but I mean - no big deal either way |
16:53:45 | miran | krux02: 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:52 | FromGitter | <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:59 | FromGitter | <zacharycarter> that's what he's suggesting miran |
16:54:26 | FromGitter | <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:41 | miran | zacharycarter: 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:40 | FromGitter | <zacharycarter> I believe you could also do something here with strscans instead of relying on a case statement |
16:55:42 | miran | i 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:46 | FromGitter | <zacharycarter> but it's most likely overkill for your usecase |
16:56:25 | FromGitter | <zacharycarter> well you'd need to create some kind of compile time condition to offer variance |
16:56:31 | FromGitter | <zacharycarter> in your object definition |
16:56:32 | Araq | shashlick, because it's a top level variable |
16:56:54 | Araq | probably vmgen should be smarter and not flag it unless used |
16:57:13 | miran | thanks for taking the time to look at my code and improving it! much appreciated! |
16:58:06 | FromGitter | <zacharycarter> sure thing |
16:59:29 | shashlick | araq: 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:14 | Araq | shashlick, I'm pretty busy but I will take over eventually |
17:03:17 | * | kinkinkijkin joined #nim |
17:06:50 | shashlick | seems 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:01 | miran | krux02, zacharycarter: reordering fields has reduced memory consumption noticeably! thanks for the tip! |
17:15:08 | FromGitter | <zacharycarter> miran: http://www.catb.org/esr/structure-packing/ |
17:19:38 | FromGitter | <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:51 | FromGitter | <zacharycarter> gist functionality in the PG is broken until I get around to adding user auth |
17:27:57 | FromGitter | <zacharycarter> since github deprecated anonymous gists |
17:28:24 | FromGitter | <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:02 | FromGitter | <zacharycarter> @zetashift |
17:36:11 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5abbd28b458cbde55786c9da] |
17:36:29 | FromGitter | <zacharycarter> you don't need to go to binary in this case |
17:36:54 | FromGitter | <zetashift> Thank you! Is it because encode() accepts string? |
17:36:57 | FromGitter | <zacharycarter> you're given a hex string - you parse that to byte string |
17:37:00 | FromGitter | <zacharycarter> and then pass that to encode |
17:37:30 | FromGitter | <zacharycarter> well the challenge says convert from hex representation to base64 encoding |
17:37:41 | FromGitter | <zacharycarter> so I just looked for procs that went from hex -> string -> base64 |
18:08:52 | FromGitter | <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:22 | FromGitter | <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:18 | FromGitter | <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:53 | shashlick | @zacharycarter: good to know anonymous gist is deprecated - I was wondering why it stopped working in snip |
18:21:56 | shashlick | will use ix.io or something now |
18:26:04 | * | user1101 joined #nim |
18:27:19 | yglukhov_ | 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:38 | yglukhov_ | *AsyncSocket |
18:28:16 | dom96 | What's wrong with supplying a string? |
18:29:12 | yglukhov_ | Well I've got IpAddress object already. Why convert it? |
18:30:29 | dom96 | Pretty sure you'd end up converting that to a string to give to the OS anyway |
18:31:47 | yglukhov_ | os uses sockaddr_t + len. thats somewhat lower level. |
18:34:00 | FromGitter | <tim-st> @Vindaar as a workaround: overload the procs where you want default = @[] and then supply @[] as argument |
18:34:54 | FromGitter | <tim-st> proc linkerError*T (x: seq[T]) = ⏎ linkerErrorT (x, @[]) |
18:35:41 | * | PMunch joined #nim |
18:40:12 | * | dyln joined #nim |
18:40:43 | FromGitter | <tim-st> https://pastebin.com/TW3PcKWe |
18:42:20 | * | nsf quit (Quit: WeeChat 2.0.1) |
18:42:22 | FromGitter | <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:06 | FromGitter | <tim-st> yes, I also use nil for this |
18:43:44 | FromGitter | <Vindaar> I usually try to avoid the usage of nil, but maybe I need to rethink in some cases :) |
18:44:36 | FromGitter | <tim-st> sometime I can avoid these things by using `static[T]` and then with `when` |
18:45:11 | FromGitter | <matrixbot> `narimiran` test 1 2 |
18:46:11 | miran | if i'm not mistaken, some of you guys are posting from matrix/riot without this matrixbot, right? |
18:47:54 | FromGitter | <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:57 | FromGitter | <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:05 | FromGitter | <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:51 | FromGitter | <matrixbot> `narimiran` test 3 4 |
19:02:12 | dom96 | miran: yes, I think Yardanico has a link |
19:02:19 | dom96 | We should add it to nim-lang.org/community.html |
19:03:08 | * | jrbrt joined #nim |
19:03:51 | miran | dom96: 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:00 | FromGitter | <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:06 | miran | vindaar: are you doing also some other numpy features? would there be an interest for that kind of stuff? |
19:11:33 | dom96 | miran: 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:18 | Yardanico | dom96, I used matrix for a while, but it's not really needed for me |
19:19:25 | * | narimiran[m] joined #nim |
19:19:27 | Yardanico | I just use bnc instead, it's easier to use |
19:19:31 | Yardanico | and faster |
19:19:42 | Yardanico | and I don't need to use client for matrix written in electron :D |
19:20:03 | Yardanico | miran, https://gist.github.com/fstab/ce805d3001600ac147b79d413668770d |
19:20:27 | FromGitter | <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:49 | narimiran[m] | test 5 6 |
19:20:58 | * | natrys quit (Quit: natrys) |
19:21:00 | miran | omfg, this is even slower |
19:22:35 | miran | VIndaar: thanks, i didn't know seqmath exist, will take a look |
19:22:46 | FromGitter | <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:21 | miran | heh, add 'neo' to that torn-list ;) |
19:23:31 | FromGitter | <Vindaar> Yeah, I know, haha |
19:24:18 | miran | from what i have seen/experienced - there's no clear winner |
19:24:44 | miran | but i want to be able to relatively easy do my numerics stuff in nim |
19:27:02 | miran | from just skimming through the code, seqmath seems quite useful |
19:27:09 | dom96 | miran: hah, how slow is it? |
19:27:41 | miran | dom96: i'll post the same message here (irc) and there, and you measure the difference in time |
19:28:13 | miran | dom irc |
19:28:49 | FromGitter | <matrixbot> `narimiran` dom riot |
19:28:51 | miran | (i have sent it half a second before irc) |
19:28:58 | dom96 | wow |
19:29:00 | FromGitter | <Vindaar> woah, that's slow indeed |
19:29:21 | miran | oh, that was gitter bridge |
19:29:22 | dom96 | wait, is narimiran[m] also pending? |
19:29:40 | miran | irc bridge is slower. let's now do irc-bridge vs irc |
19:29:58 | miran | dom irc |
19:30:11 | narimiran[m] | dom ircbridge |
19:30:22 | dom96 | 2 minutes!? |
19:30:44 | dom96 | or, oh, you only just did it |
19:30:47 | miran | naaah, it is less, but still intolerable |
19:30:58 | dom96 | That's not that slow :) |
19:31:17 | FromGitter | <narimiran> dom gitter |
19:31:17 | miran | dom irc |
19:31:22 | miran | this is instant |
19:31:30 | PMunch | Hmm, 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:35 | PMunch | Is that correct? |
19:32:00 | miran | ok, 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:28 | FromGitter | <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:22 | miran | it would be nice to see seqmath mantained/improved |
19:36:44 | miran | what do you plan to add? |
19:37:32 | dom96 | miran: Is it, though? |
19:37:46 | dom96 | Ping reply from miran: 0.36 second(s) |
19:37:53 | dom96 | Close enough :) |
19:37:56 | * | Arrrr quit (Read error: Connection reset by peer) |
19:37:58 | miran | :) |
19:38:11 | dom96 | I wonder why Matrix is so slow |
19:38:43 | FromGitter | <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:06 | miran | nice! |
19:39:27 | miran | btw, what's with nim and 'one giant file'? |
19:40:07 | miran | most of nim projects i see have this one 1000 LOC file |
19:40:49 | FromGitter | <Vindaar> I guess it often happens when modules are written by one person and start growing "organically" |
19:41:06 | miran | Vindaar: do you maybe plan to add posibility for `min(x, axis=1)` and stuff like that? |
19:41:11 | FromGitter | <mratsim> Or when it’s painful to fit Nim “recommended package structure” ;) |
19:41:38 | miran | :D |
19:41:41 | FromGitter | <mratsim> I feel like it’s either one single file or several subdirs |
19:41:58 | FromGitter | <Vindaar> Indeed :D refactoring my HDF5 library after it became a single > 3000 LOC file was quite a pain |
19:42:48 | FromGitter | <Vindaar> @miran always a useful thing, so yeah, I'll note it |
19:42:53 | FromGitter | <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:20 | FromGitter | <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:25 | FromGitter | <mratsim> I remember for the first 6 months I was using includes in arraymancer :P |
19:43:50 | FromGitter | <mratsim> then compilation started to get super slow when doing a single modification |
19:43:53 | FromGitter | <zacharycarter> the biggest challenge for me w/ Nim was getting over wanting to use inheritance and ref objects everywhere |
19:44:39 | FromGitter | <mratsim> never had that issue but my first language was Haskell and then Rust so no inheritance at all |
19:45:10 | FromGitter | <zacharycarter> I struggled with structuring packages as well |
19:45:19 | FromGitter | <zacharycarter> yeah - I came from OOP world |
19:45:45 | FromGitter | <zacharycarter> and learned I can survive and flourish without strict OOP |
19:45:52 | FromGitter | <mratsim> We see people asking question about getter and peters from time to time as well |
19:45:59 | FromGitter | <mratsim> setters* |
19:46:05 | FromGitter | <zacharycarter> yeah heh |
19:46:08 | FromGitter | <zacharycarter> such a dumb concept |
19:46:32 | FromGitter | <zacharycarter> but Java would have you believing this is how programming needs to be done |
19:46:35 | FromGitter | <mratsim> it makes sense if you need to validate input from user |
19:46:39 | miran | more examples/explatations in tutorial? |
19:46:49 | miran | yeah yeah, i know, PRs are welcome :) |
19:46:51 | FromGitter | <zacharycarter> regarding what miran? |
19:47:01 | FromGitter | <mratsim> the thing is, in Nim it’s super hard to make a field private but usable in internal modules |
19:47:39 | miran | zacharycarter: OOP stuff (there were some questions earlier today about constructors) |
19:47:40 | FromGitter | <mratsim> the first hurdle it having a field name like Fname |
19:47:46 | PMunch | Anyone know how I can pass a static string to another macro that takes a static string? |
19:47:57 | FromGitter | <mratsim> and accesseors like name, name= and name which returns var T |
19:48:26 | FromGitter | <zacharycarter> well I mean constructors per se don't really exist in Nim |
19:48:31 | FromGitter | <zacharycarter> you can instantiate an object inline |
19:48:53 | miran | yeah, but stuff like that should be explained |
19:49:02 | FromGitter | <zacharycarter> it depends what background you're coming from |
19:49:13 | FromGitter | <zacharycarter> because if you're used to C - you don't deal w/ constructors either |
19:49:18 | FromGitter | <zacharycarter> or Python |
19:49:27 | FromGitter | <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:33 | FromGitter | <zacharycarter> C++ or Java, etc.. - it's another story |
19:50:05 | FromGitter | <zacharycarter> there is an OOP section in the manual |
19:50:14 | FromGitter | <zacharycarter> https://nim-lang.org/docs/tut2.html#object-oriented-programming |
19:50:16 | FromGitter | <mratsim> @Pmunch so either I getAST or I pass to a compileTime proc |
19:50:17 | PMunch | Well what I want to do is have one version of the macro that takes a string, and one that takes a file |
19:50:23 | FromGitter | <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:51 | PMunch | So I want to have one macro that's a simple wrapper that calls read and then calls the other macro |
19:51:07 | shashlick | miran: I use matrix/riot as well |
19:51:11 | shashlick | https://riot.im/app/#/room/#freenode_#nim:matrix.org |
19:51:41 | FromGitter | <mratsim> @pMunch, maybe do a compileTime proc that returns NimNode, and that calls the macro inside? |
19:51:43 | PMunch | macro parseProto(spec: static[string]): untyped |
19:51:58 | PMunch | macro parseProtoFile(fname: static[string]): untyped |
19:52:07 | narimiran[m] | shashlick: i have tried that room, but i get delays.... |
19:52:08 | PMunch | Basically those two, where the second calls the first |
19:52:25 | PMunch | Hmm, that might be possible |
19:52:25 | shashlick | narimiran: it's not super fast but bearable I guess |
19:52:45 | dom96 | shashlick: That's the URL, any chance you could PR it into community.html? :) |
19:52:46 | shashlick | better than fighting with my own bouncer and stuff |
19:52:57 | FromGitter | <mratsim> or parseProto should accept static[string] or NimNode |
19:53:11 | miran | last two messages were sent faster than those before.... i don't know, might give it another try.... |
19:53:59 | shashlick | dom96: actually the correct URL is https://matrix.to/#/#freenode_#nim:matrix.org |
19:54:07 | shashlick | i have it in my backlog for the last month :( |
19:54:38 | miran | shashlick: your messages are also delayed on irc |
19:57:03 | PMunch | mratsim, but I need to get the value as a string. As I'm parsing it for the macro |
19:57:52 | shashlick | miran: how can you tell? |
19:58:22 | miran | i have riot open in my browser, and IRC client |
19:58:31 | * | athenot_ quit (Ping timeout: 252 seconds) |
19:59:04 | PMunch | Ah, 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:28 | FromGitter | <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:03 | FromGitter | <zacharycarter> I think that's a limitation of the json macro |
20:10:20 | FromGitter | <zacharycarter> I don't think it supports optional fields when demarshalling |
20:14:57 | dom96 | it does, using Option[T] |
20:15:11 | dom96 | but maybe diegogub isn't using the 'to' macro |
20:17:12 | Yardanico | dom96, it does?! |
20:17:22 | Yardanico | I didn't know! |
20:18:22 | dom96 | yep |
20:22:11 | FromGitter | <Vindaar> @miran: added most of the stuff to my seqmath fork just now: https://github.com/Vindaar/seqmath |
20:23:38 | shashlick | dom96: where is community.html? |
20:23:51 | shashlick | there's only community.md I see |
20:24:01 | dom96 | that's what I mean |
20:24:49 | * | Newwww joined #nim |
20:24:57 | shashlick | I think you mean index.html - that's where the Community section is |
20:25:32 | dom96 | both |
20:26:50 | dom96 | although you probably won't get an icon for index.html |
20:26:55 | dom96 | so community page is good enough |
20:27:35 | shashlick | need to figure out an icon for matrix/riot though |
20:29:17 | shashlick | guess just using # is good enough |
20:30:08 | dom96 | That's IRCs icon :/ |
20:37:27 | FromGitter | <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:56 | shashlick | matrix 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:04 | shashlick | @stisa: I could but it won't match the yellow scheme on nim-lang.org |
20:41:00 | * | jrbrt joined #nim |
20:41:57 | dom96 | Maybe just use [m] |
20:44:01 | * | Vladar quit (Quit: Leaving) |
20:54:54 | shashlick | dom96: where does community.md get displayed? |
20:54:57 | * | PMunch quit (Quit: Leaving) |
20:55:14 | dom96 | https://nim-lang.org/community.html |
20:56:33 | shashlick | oh 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:52 | FromGitter | <zetashift> Did the `func` keyword get in 0.18? |
21:26:24 | Araq | it works but it's only an alias for 'proc' |
21:33:34 | * | vlad1777d joined #nim |
21:38:17 | FromDiscord | <treeform> what would func do? |
21:38:22 | FromDiscord | <treeform> immutable? |
21:41:08 | shashlick | dang, 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:07 | FromGitter | <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:51 | FromGitter | <diegogub> @dom96 yes, im using to() macro |
22:44:22 | dom96 | so use Option[T] |
22:45:07 | FromGitter | <diegogub> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5abc1af35f188ccc15093d0d] |
22:45:56 | FromGitter | <diegogub> @dom96 , sorry, second day with nim..how would I use that? |
22:46:24 | dom96 | What does StreamStatusResponse look like? |
22:47:41 | FromGitter | <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:05 | FromGitter | <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:17 | FromGitter | <diegogub> but its not practical.. |
22:48:37 | dom96 | Well, if `id` is optional you'd just use `id*: Option[string]` |
22:48:54 | * | NimBot joined #nim |
22:48:56 | dom96 | You'll need to `import options` as well. |
22:49:44 | FromGitter | <diegogub> I see, i will read options docs |
22:49:57 | FromGitter | <diegogub> Does it change something from the string? |
22:50:10 | dom96 | You can think of it as a box |
22:50:19 | dom96 | A box that may contain a piece of text or not |
22:50:45 | dom96 | You can use isNone and isSome to check if the box is empty or not respectively |
22:51:34 | FromGitter | <zacharycarter> so Option works with objects as well as pointers? |
22:51:56 | FromGitter | <diegogub> @dom96 sound cool, will try it. Thanks! Falling in love with nim so far.. haha |
22:52:01 | FromGitter | <zacharycarter> also - what is the underlying allocation like for an Option type? |
22:52:54 | FromGitter | <zacharycarter> I guess I'll just rtfm :P |
22:59:07 | FromGitter | <mratsim> Surprise it contains a Shroedinger cat |
22:59:34 | FromGitter | <mratsim> Option are heap allocated iirc |
22:59:59 | Araq | no, it's a tuple |
23:00:03 | FromGitter | <mratsim> oh |
23:01:28 | * | jrbrt joined #nim |
23:01:28 | * | gokr quit (Read error: Connection reset by peer) |
23:02:09 | FromGitter | <mratsim> Since some wanted to conflate isNone with nil pointer I thought it had to do with optimizing heap alloc |
23:11:04 | FromGitter | <krux02> that someone was me, |
23:11:30 | FromGitter | <krux02> @mratsim and no I did have nothing to do with heap allocation |
23:12:29 | FromGitter | <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:44 | FromGitter | <krux02> it is implemented in the library, see how awesome nim is. |
23:12:58 | shashlick | dom96: should we add https://stackoverflow.com/questions/tagged/nim to the community threaded conversations list |
23:14:25 | FromGitter | <diegogub> @dom96 now unmarshaling wokrs..the issue is coverting that object into JSON |
23:17:38 | shashlick | dom96: https://imgur.com/a/JUAZS |
23:19:17 | * | gokr joined #nim |
23:19:58 | FromGitter | <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:06 | dom96 | shashlick: looks good |
23:20:45 | dom96 | 'night |
23:31:58 | FromGitter | <cavariux> is there unsigned char in nim? I cannot find it |
23:34:08 | FromGitter | <zetashift> Isn't char just an alias for uin8? |
23:34:15 | FromGitter | <zetashift> uint8* |
23:34:53 | FromGitter | <zetashift> https://nim-lang.org/docs/system.html#char |
23:35:10 | FromGitter | <cavariux> oh, and by default is unsigned |
23:35:15 | FromGitter | <cavariux> thanks |
23:37:00 | FromGitter | <diegogub> uint64 type is not supported by json module..any idea why? |
23:38:07 | FromGitter | <diegogub> BiggestUInt * |
23:38:15 | FromGitter | <zacharycarter> are you using the c backend or js backend? |
23:38:53 | FromGitter | <diegogub> c |
23:39:05 | FromGitter | <zetashift> In JS backend uint64 is a uint32 |
23:41:18 | FromGitter | <diegogub> this is the error: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5abc281e270d7d37086d4fe9] |
23:41:56 | FromGitter | <diegogub> BiggestUInt is not supported |
23:44:36 | * | NimBot joined #nim |
23:47:47 | FromGitter | <zacharycarter> @diegogub - ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ compiles fine for me [https://gitter.im/nim-lang/Nim?at=5abc29a37c3a01610d85da4c] |
23:48:22 | FromGitter | <zacharycarter> oh my bad |
23:48:24 | FromGitter | <zacharycarter> you're using % |
23:48:27 | FromGitter | <zacharycarter> I see |
23:49:20 | FromGitter | <zetashift> This might a stupid suggestion but can't you do `var x = BiggestInt(foo)`? |
23:50:46 | FromGitter | <zacharycarter> well that's not the problem |
23:51:04 | FromGitter | <zacharycarter> the problem is he already has a JsonNode object and he wants to demarshall it |
23:51:07 | FromGitter | <diegogub> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5abc2a6b7c3a01610d85dcb2] |
23:51:58 | FromGitter | <diegogub> this is the issue. |
23:53:44 | FromGitter | <zacharycarter> @diegogub - this is one solution - not the best I'm sure but |
23:53:49 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5abc2b0d2b9dfdbc3a3257ce] |
23:54:23 | FromGitter | <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:28 | FromGitter | <zacharycarter> he's euro time FYI |
23:54:43 | FromGitter | <diegogub> yeah, I should sleep too now..4am here |
23:54:58 | FromGitter | <diegogub> thanks! |
23:55:02 | FromGitter | <zacharycarter> np |
23:55:19 | FromGitter | <zetashift> Good night, I'm out too! |
23:55:33 | FromGitter | <diegogub> good night! |