00:00:31 | * | Snircle_ quit (Ping timeout: 276 seconds) |
00:00:47 | Araq | sounds awful |
00:00:56 | Araq | but it's aws, I don't know it |
00:01:09 | FromGitter | <zacharycarter> well it's compute time on demand |
00:01:11 | * | mindB quit (Ping timeout: 276 seconds) |
00:01:11 | * | Demos[m] quit (Ping timeout: 276 seconds) |
00:01:44 | FromGitter | <zacharycarter> so I pay for hundreds of seconds of compute time |
00:01:52 | FromGitter | <zacharycarter> hundredths of a second* |
00:01:57 | FromGitter | <FridgeSeal> Lambda is amazing. There's subsecond billing (in batches of 100ms) and a free tier that includes (depending on the chosen tier of hardware) nearly a million seconds a month |
00:02:05 | * | Demos[m] joined #nim |
00:02:11 | * | mindB joined #nim |
00:03:16 | FromGitter | <zacharycarter> so like my company has this problem of not building reusable things that are useful and instead, we rebuild the same useful crap over and over in a bad way |
00:03:27 | FromGitter | <zacharycarter> one thing we need and don't have is zip code to lat long translation |
00:04:27 | FromGitter | <zacharycarter> so what everyone ends up doing is standing up a DB with the mapping in it, or wasting runtime performance loading a huge dataset into memory |
00:05:13 | FromGitter | <FridgeSeal> I'm fairly sure the Google Maps API has a zip-to-gps functionality in there somewhere. |
00:05:20 | FromGitter | <zacharycarter> it does but do you want to pay for that? |
00:05:40 | FromGitter | <zacharycarter> I'm betting lambda is cheaper |
00:05:52 | FromGitter | <zacharycarter> maybe not I don't know |
00:06:02 | FromGitter | <FridgeSeal> Yeah fair enough. I use their address-to-gps api |
00:06:08 | FromGitter | <Ajusa> How well does Nim support multithreading? I am converting a program from D to nim, and D has built in multithreading for "foreach" loops. Any way to achieve the same with nim? |
00:06:18 | FromGitter | <zacharycarter> anyway n ow we have an on demand zip to lat long service |
00:06:25 | FromGitter | <FridgeSeal> But my usage is small enough that we happily fit within their free tier lol. |
00:06:28 | FromGitter | <zacharycarter> and we pay only for the copmute time |
00:06:34 | FromGitter | <zacharycarter> yeah this is going into a national product |
00:06:40 | FromGitter | <FridgeSeal> Ahhhh yeah |
00:07:19 | FromGitter | <zacharycarter> it's my sneaky (hopefully) way of getting Nim into my company |
00:07:28 | FromGitter | <FridgeSeal> Hahahaha |
00:08:53 | FromGitter | <Ajusa> Right now, the single threaded Nim version takes roughly 5-6 times longer than the D version to do the same thing. The logic is pretty much identical |
00:09:06 | FromGitter | <zacharycarter> yes nim supports multithreading |
00:09:16 | FromGitter | <zacharycarter> take a look at parallel and spawn in the manual |
00:09:31 | FromGitter | <zacharycarter> https://nim-lang.org/docs/manual.html#parallel-spawn |
00:10:36 | Araq | Ajusa, use -d:release and learn some Nim |
00:11:50 | FromGitter | <Ajusa> -d:release made it 3 times slower than D. Thanks for the advice guys! I'll get back on whether I was able to get multi threading to improve the speed. |
00:12:27 | FromGitter | <zacharycarter> you can also throw in C compiler optimization flags |
00:12:42 | FromGitter | <zacharycarter> but I'd look into parallel and spawn |
00:12:49 | FromGitter | <zacharycarter> and no problem, good luck! |
00:13:01 | * | yglukhov joined #nim |
00:13:14 | FromGitter | <zacharycarter> https://serverless.com/ is nice |
00:13:27 | FromGitter | <Ajusa> Thanks! I am still in hs, so I may not understand a lot of stuff. I'll ask you guys here if I really need help with something :D |
00:13:30 | FromGitter | <zacharycarter> I should make a github repo with an example AWS Nim app |
00:13:37 | FromGitter | <zacharycarter> @Ajusa |
00:14:20 | FromGitter | <FridgeSeal> Serverless is fantastic, but I really wish they'd named it something else lol. The number of times I've tried to look for things to do with the framework and not the technology or vice versa is insane. |
00:14:35 | FromGitter | <zacharycarter> yeah haha |
00:14:59 | * | couven92 quit (Read error: Connection reset by peer) |
00:15:19 | FromGitter | <zacharycarter> think I'm going to do gamedev tonight though instead |
00:15:23 | FromGitter | <zacharycarter> I need to start working on a game |
00:16:41 | FromGitter | <FridgeSeal> Talking of multithreading/parallelism, I'm keen to have a go with Nim's parallel - Python's approach of multi-processing is kind of silly, especially seeing as you need to serialise to disk whatever you want to pass to the worker functions... |
00:17:13 | * | yglukhov quit (Ping timeout: 240 seconds) |
00:17:37 | FromGitter | <Ajusa> Okay, I am getting this error which I don't quite understand: Error: cannot prove: i > i; required for (i)..(i) disjoint from (i)..(i) |
00:17:53 | FromGitter | <zacharycarter> can you share code please? |
00:18:10 | FromGitter | <zacharycarter> https://play.nim-lang.org has gist functionality you can share there |
00:18:25 | FromGitter | <zacharycarter> may also because you need --threads:on |
00:19:02 | FromGitter | <Ajusa> I have that enabled and the experimental pragma |
00:19:38 | FromGitter | <zacharycarter> gotcha, please post your code at your convenience then and someone will have a look at it |
00:19:47 | FromGitter | <Ajusa> https://play.nim-lang.org/?gist=ab574cd5dcb4bafbfba9c64d274515d4 |
00:19:54 | FromGitter | <Ajusa> that is only the relevant excerpt |
00:21:00 | FromGitter | <Ajusa> https://github.com/Ajusa/simtest ⏎ that is the entire source code. It isn't very large, but it is a lot of math with constants that might not make sense |
00:21:38 | FromGitter | <zacharycarter> thanks, btw you don't need to check in the nimcache directory |
00:21:42 | FromGitter | <zacharycarter> just fyi |
00:21:47 | FromGitter | <Ajusa> yeah, my bad xD |
00:22:30 | FromGitter | <zacharycarter> all good :) |
00:22:50 | FromGitter | <zacharycarter> looking at your code now i'll let you know what I find! |
00:24:10 | FromGitter | <Ajusa> Thank you very much! You guys are really helpful |
00:26:59 | FromGitter | <Ajusa> Actually, I got it to work by using sequence.high |
00:27:07 | FromGitter | <zacharycarter> ha cool :D |
00:27:09 | FromGitter | <zacharycarter> was going to say |
00:27:09 | FromGitter | <zacharycarter> https://play.nim-lang.org/?gist=7999a7f432e23e4c14a41f6d5b59eb9d |
00:27:14 | FromGitter | <zacharycarter> just got it working as well |
00:27:18 | FromGitter | <Ajusa> But now it is much, much slower. Will threading do that? |
00:27:42 | FromGitter | <Ajusa> Threading has a positive effect in D, so I wouldn't expect it to vary with the language? |
00:27:43 | FromGitter | <zacharycarter> it shouldn't |
00:28:08 | FromGitter | <zacharycarter> benchmarks are tricky though |
00:28:28 | FromGitter | <zacharycarter> and you can do something in language A that in language B might be very expensive |
00:28:42 | FromGitter | <zacharycarter> as every language is different |
00:29:02 | FromGitter | <Ajusa> I figured that Nim would be faster just because I was using gcc over D's compiler, which is dmd |
00:29:15 | FromGitter | <zacharycarter> Nim can definitely be faster than D |
00:29:18 | FromGitter | <Ajusa> In single threaded, it is much faster from what I remember |
00:29:22 | FromGitter | <FridgeSeal> Slightly off topic: Phase space and pulse size, I'm guessing you're doing something like spectrum analysis? The transformation looks sort of similar to one of the integral transforms (laplace, etc) but it's been a while since I did that sort of maths |
00:30:23 | FromGitter | <Ajusa> The math is a bit over my head, I am helping a professor with research. I am trying to model an electron beam (like one in an electron microscope) and have it move through space and lenses |
00:31:08 | FromGitter | <Ajusa> The code accounts for just splitting the beam into millions of electron phasespaces |
00:31:39 | FromGitter | <Ajusa> I am trying to optimize the split as much as possible, before moving on to the operations |
00:34:36 | Araq | Nim's float is not D's float |
00:35:18 | Araq | Nim's float is 64bits, D's is 32bits, caches are not used as effectively, 2x slowdown? just a guess though |
00:35:59 | FromGitter | <Ajusa> I compiled it with the -m64 flag for D, so it should be 64bit? |
00:36:11 | FromGitter | <Ajusa> Lemme try running it with float32 on nim |
00:39:29 | Araq | float in D is always 32bits, independent of -m64 |
00:39:41 | FromGitter | <Ajusa> Forcing everything to float32 made it actually slower than the default float464 |
00:39:45 | FromGitter | <Ajusa> *float64 |
00:40:26 | FromGitter | <Ajusa> it went from 684ms to 703ms (float to float32) |
00:41:30 | FromGitter | <Ajusa> Also, thanks for that info, I was unaware of that. ⏎ The reason I am trying to optimize this is because this could potentially be asked to calculate over 10^12 splits, which shouldn't take months ideally |
00:43:18 | FromGitter | <Ajusa> Right now, 10^6 takes 684ms on Nim, and 213ms on D. Not trying to start a language comparison here, I just want to know if it is possible for me to switch this project to Nim and preserve (at least) the speed of the D version. The D version is using multithreading to calculate value for an array. |
00:43:50 | FromGitter | <zacharycarter> it's possible if you know what you're doing |
00:44:06 | FromGitter | <zacharycarter> you have to be doing a couple of things |
00:44:13 | FromGitter | <zacharycarter> a) writing efficient Nim code |
00:44:26 | FromGitter | <zacharycarter> b) using the optimization options available to you |
00:45:53 | FromGitter | <zacharycarter> I don't know what your D code looks like or what it is doing |
00:46:33 | FromGitter | <zacharycarter> I haven't really closely read through your code but I'll do that now and see what I can produce for you |
00:48:04 | FromGitter | <Ajusa> https://github.com/Ajusa/simulator ⏎ I literally copy pasted over the split method, and then went through by hand to make it fit Nim's syntax. I have not done much optimization to the Nim one, which is my fault. I should have put in more effort before asking here, so I could be more prepared. Thank you very much for taking some time to help me, it is very much appreciated. :D |
00:49:19 | FromGitter | <zacharycarter> fyi - http://blog.johnnovak.net/2017/04/22/nim-performance-tuning-for-the-uninitiated/ |
00:49:26 | FromGitter | <zacharycarter> can read that while I'm working on this :) |
00:49:35 | FromGitter | <Ajusa> Oh wow, thanks! |
00:49:42 | FromGitter | <zacharycarter> np! |
00:50:07 | FromGitter | <Ajusa> Part of the problem with googling for help in Nim is that I end up finding tutorials for the game of Nim, and how it can be written in x language lol |
00:50:48 | FromGitter | <zacharycarter> hahaha truth |
00:57:53 | * | endragor joined #nim |
01:02:22 | * | endragor quit (Ping timeout: 260 seconds) |
01:03:33 | FromGitter | <FridgeSeal> Yeah it's either that, or something to do with Intel/processor architecture support for a weather model |
01:11:33 | FromGitter | <Ajusa> I'm an idiot |
01:11:49 | FromGitter | <codenoid> me too |
01:11:58 | FromGitter | <Ajusa> I was using an optimized version of the exp function for this, and I neglected to port that one over to nim. |
01:12:23 | FromGitter | <Ajusa> dlang multithreaded is 200ms, nim is 275ms |
01:13:08 | FromGitter | <Ajusa> That's actually amazing, seeing as how I don't have any sort of threading for the nim version. Nor have I used any crazy nim specific stuff. |
01:13:27 | FromGitter | <zacharycarter> my machine is doing a whacky and not cooperating |
01:13:34 | FromGitter | <zacharycarter> but I'm glad you figured it out :) |
01:14:43 | FromGitter | <Ajusa> Thanks! Now, I gotta read the docs and understand how to make multithreading faster, and see if there are any speed hacks I can use that Nim has. I read through the blog post you linked. It was very interesting, even though it doesn't help me with my case. The techniques that the author describes are very useful though! |
01:19:10 | * | Pisuke joined #nim |
01:23:21 | FromGitter | <Ajusa> Also, I thought that float32 would improve speed, not make it slower... Is there anything I might be doing wrong? I just went through and changed each instance of float to float32. Is there a compiler flag that I don't know about to do this? |
01:25:32 | FromGitter | <zacharycarter> I don't think so I think what you did is what you should have done |
01:25:39 | FromGitter | <zacharycarter> float32 will reserve less memory |
01:26:23 | FromGitter | <Ajusa> Yeah, I think I noticed that when testing. I read through (https://forum.nim-lang.org/t/1267/3)[this], and listened to Araq above, when expecting speed improvements. |
01:27:33 | FromGitter | <zacharycarter> Araq can and will let you know but it's late where he is, he's the author of the language |
01:29:05 | FromGitter | <Ajusa> I know :D ⏎ This isn't my first foray into Nim. I am not asking him for help, just wondering if I did what he asked me to do properly |
01:30:20 | FromGitter | <zacharycarter> oh gotcha :) well I think you did, but not 100% sure - until then you could always post a thread in the forum |
01:31:03 | FromGitter | <Ajusa> I'll do that in a few days if I am unable to optimize further |
02:15:39 | * | yglukhov joined #nim |
02:17:13 | * | relax quit (Ping timeout: 240 seconds) |
02:17:16 | * | vlad1777d quit (Remote host closed the connection) |
02:21:07 | * | yglukhov quit (Ping timeout: 260 seconds) |
02:21:57 | * | def-pri-pub joined #nim |
02:24:36 | * | Ven`` joined #nim |
02:34:05 | * | Ven`` quit (Ping timeout: 240 seconds) |
02:40:35 | * | dddddd quit (Remote host closed the connection) |
02:48:50 | * | pilne quit (Quit: Quitting!) |
03:04:24 | * | def-pri-pub quit (Quit: leaving) |
03:09:15 | * | Nobabs27 joined #nim |
03:15:23 | * | francisl joined #nim |
03:23:50 | * | Nobabs27 quit (Quit: Leaving) |
03:37:21 | * | mahmudov quit (Read error: No route to host) |
03:37:23 | * | endragor joined #nim |
03:57:28 | * | gangstacat joined #nim |
04:18:47 | * | yglukhov joined #nim |
04:23:05 | * | yglukhov quit (Ping timeout: 240 seconds) |
04:34:02 | * | BigEpsilon joined #nim |
04:42:53 | * | francisl quit (Quit: francisl) |
04:49:59 | * | rauss quit (Quit: WeeChat 1.9) |
04:50:50 | * | rauss joined #nim |
05:09:12 | FromGitter | <Varriount> Oh, an optimization challenge? Count me in. |
05:12:24 | * | cspar quit (Read error: Connection reset by peer) |
05:12:49 | * | cspar joined #nim |
05:14:14 | * | miran joined #nim |
05:22:38 | FromGitter | <BigEpsilon> Hi, I need a little help. I'm trying to add support for integer type template parameters to c2nim (ie: template<int T, size_t N> ...). ⏎ I'm almost there but on little problem remains: ⏎ A definition such ⏎ ⏎ ```code paste, see link``` ... [https://gitter.im/nim-lang/Nim?at=59a64b9e210ac26920d6ea0b] |
05:25:12 | FromGitter | <BigEpsilon> (the code is not clean I'll refactor it once it works) |
05:27:12 | * | miran quit (Ping timeout: 260 seconds) |
05:34:09 | * | Vindaar quit (Ping timeout: 252 seconds) |
05:34:35 | * | BigEpsilon quit (Ping timeout: 240 seconds) |
05:39:25 | * | miran joined #nim |
05:54:23 | * | BigEpsilon joined #nim |
06:00:58 | * | yglukhov joined #nim |
06:18:26 | FromGitter | <Araq> @BigEpsilon can you confirm it's not a "renderer" glitch? |
06:18:35 | FromGitter | <Araq> (compiler/renderer.nim) |
06:28:13 | FromGitter | <BigEpsilon> I'll check that, it may be that |
06:29:21 | * | miran quit (Ping timeout: 248 seconds) |
06:40:43 | * | yglukhov quit (Remote host closed the connection) |
06:41:39 | * | nsf joined #nim |
06:43:51 | * | tdc joined #nim |
06:44:44 | * | yglukhov joined #nim |
06:55:30 | * | Vladar joined #nim |
06:57:30 | * | endragor quit (Remote host closed the connection) |
06:59:59 | * | BitPuffin|osx joined #nim |
07:04:32 | * | PMunch joined #nim |
07:17:56 | * | endragor joined #nim |
07:23:01 | * | endragor quit (Ping timeout: 255 seconds) |
07:26:39 | * | endragor joined #nim |
07:48:18 | * | Yardanico joined #nim |
08:08:49 | * | yglukhov quit (Remote host closed the connection) |
08:08:52 | euantor | Would there be any objections to adding alternative versions of base 64 encode/decode to the base 64 module that doesn't split output into lines? I'd also like to add a verison that uses the "URL" encoding specified in RFC 4648 that uses URL safe identifiers. |
08:09:23 | Yardanico | euantor, maybe you can then use cgi.encodeUrl to encode base64 into safe url? |
08:09:30 | euantor | The version that doesn't add line breaks should also help us in this rather stupid benchmark (tested last night): https://github.com/kostya/benchmarks#base64 |
08:09:55 | euantor | I'm not sure, I've not looked at the `cgi` module |
08:10:28 | Yardanico | funny thing, all these languages are using only 1 file |
08:10:36 | Yardanico | and rust needs a separate directory :) |
08:10:42 | euantor | yep |
08:11:12 | euantor | my basic tetsing (encode only) last night showed quite a big difference in time for the version without splitting output into lines |
08:12:16 | Yardanico | euantor, hmmm, ok, maybe we can add a optional bool argument? |
08:12:18 | Yardanico | to encode/decode |
08:12:53 | euantor | Or an overloaded version that takes only 1 argument |
08:13:06 | euantor | (for encode, I've not looked at decode yet) |
08:13:13 | Yardanico | euantor, wait, did you try to pass empty newLine to encode? |
08:13:20 | Yardanico | https://github.com/nim-lang/Nim/blob/master/lib/pure/base64.nim#L110 |
08:13:42 | Yardanico | I'll test it locally now |
08:13:50 | euantor | not yet, but this is the block that I removed and saw a speed benefit: https://github.com/nim-lang/Nim/blob/master/lib/pure/base64.nim#L72 |
08:13:59 | euantor | I only tried for about 10 minutes late last night |
08:14:39 | Yardanico | Ok, with default arguments I get ~1.3 seconds both for encode/decode |
08:15:20 | Yardanico | hmm this doesn't help |
08:15:31 | euantor | Yeah, now try removing the block above - it helped quite a lot for me |
08:15:31 | Yardanico | why this behaviour was added? |
08:15:36 | Yardanico | euantor, I'll try now |
08:15:53 | euantor | Some of the RFCs define a line length. There are several different RFCs over the years for base 64 |
08:16:07 | euantor | https://en.wikipedia.org/wiki/Base64#Implementations_and_history |
08:16:17 | Yardanico | well now I have 0.86 seconds for encode and 1.31 for decode |
08:16:38 | Yardanico | it's with clang |
08:16:50 | Yardanico | with gcc it's 0.92 seconds and 1.71 seconds, lol |
08:16:55 | Yardanico | gcc seems to be slower than clang here |
08:17:18 | euantor | Yeah, I need to look at decode and see if it can be improved at all. I'm going to look at it properly tonight if there's no objections to adding some more implementations |
08:17:47 | Yardanico | well I think base64 implementation in nim is not the most optimized |
08:18:09 | Yardanico | because no one needed to optimize it before :) |
08:19:30 | euantor | I'll try and have a look at that at the same time. I looked at Go's implementaiton and it's pretty slow |
08:24:06 | Yardanico | well as I think it can be optimized with unsafe features at least :) |
08:24:09 | Yardanico | but maybe there's a better way |
08:25:23 | Yardanico | but yeah, maybe this can be made optional |
08:25:33 | Yardanico | other languages don't add line breaks usually |
08:26:14 | FromGitter | <BigEpsilon> @Araq , its definitly a bug in compile/render : https://play.nim-lang.org/?gist=27255bf05b55900d75c438a31c05a9aa ⏎ I think I found the problem, I'll do a PR after some tests |
08:34:07 | Araq | muhaha and then people ask why I don't use debuggers, I don't debug, I am all knowing. :P |
09:06:54 | * | Arrrr joined #nim |
09:06:54 | * | Arrrr quit (Changing host) |
09:06:54 | * | Arrrr joined #nim |
09:10:42 | * | BitPuffin|osx quit (Remote host closed the connection) |
09:33:58 | * | Matthias247 joined #nim |
09:34:06 | * | BitPuffin|osx joined #nim |
09:45:17 | * | livcd joined #nim |
09:46:37 | livcd | Do you guys have somewhere a comparison of Nim and Go (or any other lang?) thanks! |
09:46:44 | * | vlad1777d joined #nim |
09:47:09 | Yardanico | livcd, well there's a small comparasion of python/nim and c/nim |
09:47:27 | Yardanico | https://github.com/nim-lang/Nim/wiki/Nim-for-C-programmers and https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers |
09:48:47 | livcd | thanks! |
09:49:35 | Yardanico | livcd, main nim features (at least for me): speed, metaprogramming, C/C++ ffi |
09:49:43 | Yardanico | and python-like syntax :) |
09:50:24 | livcd | I prefer ruby like syntax but Nim seems interesting anyway :-) |
09:50:48 | livcd | What about parallelism ? |
09:51:17 | Yardanico | livcd, threads (with local-thread heap), and https://nim-lang.org/docs/manual.html#parallel-spawn |
09:52:04 | Yardanico | also there's async/await like library |
09:52:27 | Yardanico | https://nim-lang.org/docs/asyncdispatch.html |
09:53:16 | livcd | what about talking to WinAPi I found some community maintained packages |
09:53:31 | livcd | anyway thanks for spoon feeding me Yardanico :-) |
09:53:45 | Yardanico | livcd, a small wrapper https://nim-lang.org/docs/winlean.html |
09:53:52 | Yardanico | and full (very huge) wrapper - https://github.com/nim-lang/oldwinapi |
09:56:34 | euantor | And if there's just a couple of APIs you need, calling out to them is extremely easy |
09:56:42 | Yardanico | yeah |
09:57:08 | * | vlad1777d quit (Remote host closed the connection) |
09:57:26 | Araq | too bad varriount lost his work on the "newwinapi" |
09:57:59 | * | odc joined #nim |
09:58:11 | Yardanico | well maybe it shouldn't be called oldwinapi ? :) |
09:58:14 | Yardanico | maybe "hugewinapi" :D |
09:59:00 | Yardanico | please tell me that oldwinapi is not hand-written wrapper |
10:00:51 | livcd | well i have not even started with nim tutorial. I use Go on windows and translate the necessary parts for winapi manually |
10:01:00 | livcd | but yeah I'd like to try nim :-) |
10:01:11 | Yardanico | livcd, what are you using winapi for? |
10:01:59 | livcd | Yardanico: classic stuff. Adding users / removing users / getting list of users. net shares etc etc |
10:02:08 | Yardanico | livcd, ah |
10:02:25 | Yardanico | just want to say that you'll use low-level types for integrating with winapi |
10:02:29 | Yardanico | like raw pointers |
10:02:46 | Yardanico | in Nim (and I think the same in Go unless there's a high-level wrapper ) |
10:03:05 | livcd | yup it's the same in Go |
10:03:36 | * | couven92 joined #nim |
10:04:52 | Araq | hi couven92, there are problems with Nim's android support :-) |
10:05:07 | couven92 | Oooh! Do tell! :D |
10:05:26 | FromGitter | <Ajusa> I think I will make a post on the forum about my program, to optimize it. I really just don't know how to add doubles faster lol |
10:05:43 | FromGitter | <Ajusa> And 32bit doubles are slower than 64 bit doubles |
10:07:15 | Yardanico | Ajusa: can you post your code on gist ? |
10:07:20 | Yardanico | and share it here too :) |
10:08:17 | Yardanico | Araq, are you trying to make Nim compiler work on Android without Termux? |
10:08:20 | FromGitter | <Ajusa> Ah, yes. I had posted it above, so I'll just put links to the GitHub page: www.github.com/ajusa/simtest |
10:08:27 | couven92 | Araq, should I just clone devel on my Android and run, or is there sth specific you want me to have a look at? |
10:08:58 | FromGitter | <Ajusa> The D version that I am trying to be faster than using Nim is www.github.com/ajusa/simulator |
10:09:22 | * | yglukhov joined #nim |
10:10:09 | FromGitter | <Ajusa> Right now, Nim is about 20% slower than D, but the D code uses multithreading. When I added that to the Nim code, it became several times slower |
10:11:54 | Yardanico | well straight rewrites from one language to another are almost always slower :) I'm not good at optimizing Nim code, but I'll have a look |
10:11:54 | Araq | Yardanico, couven92: the termux dependency is really bad, yes but there are also other issues |
10:12:41 | Yardanico | Araq, well it would be way harder to make it work without termux |
10:12:42 | Araq | the sigtimedwait() uses a syscall that 4.x doesn't support anymore (?) |
10:13:01 | FromGitter | <Ajusa> I just don't know where to start optimizing. I need faster double math and faster loops, but those should already be optimized by the compiler :P |
10:13:03 | Yardanico | for example we'll need to provide C compiler or precompile Nim for android |
10:13:22 | couven92 | okay... Hmmm... I'll go into my thinking-box and try to figure it out |
10:13:56 | * | yglukhov quit (Ping timeout: 255 seconds) |
10:14:00 | Yardanico | Ajusa: also, ; are not needed in Nim :) |
10:14:27 | FromGitter | <Ajusa> Yeah, I know XD. You can tell I copy pasted it from D |
10:14:53 | Araq | Ajusa, just look at the generated assembler code |
10:15:18 | Yardanico | well I can't get it to compile because of disjoint check |
10:15:20 | Araq | quote from my collegue, "Also, people in those PRs test over Android 6.0, but people don't compile real apps over Android 6.0, since it means you discard 50% of the current market." |
10:16:06 | * | tdc quit (Read error: Connection reset by peer) |
10:16:07 | euantor | The android ecosystem is a mess |
10:16:15 | Yardanico | Ajusa: what number of splits to I need to enter? |
10:16:26 | FromGitter | <Ajusa> I have been doing a million |
10:16:34 | FromGitter | <Ajusa> for testing. Takes about 300ms on my laptop |
10:16:59 | * | tdc joined #nim |
10:18:15 | FromGitter | <Yardanico> Nim or D version? Takes 300ms |
10:20:01 | FromGitter | <Ajusa> Nim is 261ms, D is 219ms |
10:21:13 | * | Yardanico quit (Ping timeout: 240 seconds) |
10:21:29 | Arrrr | Do you compile with -d:release? I don't know if D has an equivalent option |
10:22:25 | FromGitter | <Ajusa> Yeah, -:release. With D, I do -O -release, which produces the fastest binaries |
10:23:25 | * | Yardanico joined #nim |
10:24:08 | FromGitter | <Yardanico> can you please test this version? |
10:24:08 | FromGitter | <Yardanico> https://gist.github.com/Yardanico/7359c34d62fb096120720f94059ef568 |
10:24:25 | FromGitter | <Yardanico> I got a ~70ms speedup by using implicit result variable |
10:24:44 | FromGitter | <Yardanico> this version doesn't use threading at all |
10:25:11 | FromGitter | <Yardanico> also what compiler are you using? |
10:25:15 | FromGitter | <Yardanico> mingw or vcc? |
10:25:20 | FromGitter | <Ajusa> Mingw |
10:25:38 | FromGitter | <Yardanico> well you should probably also try VCC, because *maybe* it can produce faster binaries |
10:25:45 | FromGitter | <Yardanico> Visual studio compiler |
10:25:55 | FromGitter | <Yardanico> but at least test this version |
10:26:05 | * | ShalokShalom_ joined #nim |
10:26:49 | * | yaiyan is now known as Ieuan |
10:26:57 | FromGitter | <Ajusa> woah |
10:27:01 | FromGitter | <Yardanico> what? |
10:27:07 | FromGitter | <Ajusa> Now its about 10 percent faster than D |
10:27:09 | FromGitter | <Yardanico> yay |
10:27:11 | FromGitter | <Ajusa> :D |
10:27:32 | FromGitter | <Yardanico> you just should use implicit "result" variable everywhere unless you need "return" statement because it exits from the current function |
10:27:48 | FromGitter | <Yardanico> so instead of creating new result variable you just use "result" |
10:27:53 | FromGitter | <Ajusa> Ah, okay. That's the main thing I noticed in your code |
10:27:59 | FromGitter | <Ajusa> Didn't know about that |
10:28:16 | FromGitter | <Yardanico> well so nim without threading is faster than D with threading, hmm |
10:28:33 | * | Ieuan is now known as Yaiyan |
10:28:49 | * | ShalokShalom quit (Ping timeout: 248 seconds) |
10:29:06 | FromGitter | <Ajusa> Yeah. And the D version is definitely much faster with threading |
10:29:53 | FromGitter | <Yardanico> ok, we need to try to make nim version parallel too |
10:30:14 | FromGitter | <Ajusa> Without threading, the D version is 650ms, while Nim is 180ms. With threading, D is about 200ms |
10:30:26 | Yardanico | lol |
10:30:31 | Yardanico | strange |
10:30:40 | Yardanico | I'll try to make nim version parallel too |
10:30:44 | FromGitter | <Ajusa> Yeah, I tried doing that earlier, but Nim slowed down by a factor of 10 |
10:31:00 | Yardanico | also you don't need to specify types everywhere in Nim :) maybe you've noticed |
10:31:10 | Yardanico | this doesn't have any impact on performance but still |
10:31:49 | FromGitter | <zacharycarter> remember you can use C optimization tricks with Nim too |
10:32:10 | FromGitter | <zacharycarter> including compiler flags, optimizing loops etc |
10:33:50 | FromGitter | <zacharycarter> sorry not for loops but if else I meant |
10:33:53 | FromGitter | <zacharycarter> and I'm not sure you can do that |
10:34:03 | FromGitter | <zacharycarter> but you can definitely pass compiler optimization flags I know that much |
10:35:36 | FromGitter | <zacharycarter> yeah you can |
10:35:41 | FromGitter | <zacharycarter> unlikely and likely are already defined - https://github.com/nim-lang/csources/blob/master/c_code/nimbase.h#L458 |
10:36:14 | FromGitter | <Ajusa> Passing in -O3 helps a bit. I'll look more into gcc compiler flags |
10:36:26 | Yardanico | well nim passes -O3 by default |
10:36:31 | Yardanico | in release mode |
10:36:49 | FromGitter | <zacharycarter> does it? oh my bad |
10:36:56 | FromGitter | <Ajusa> Without O3 it is 3ms slower, not really much of a difference |
10:37:03 | FromGitter | <zacharycarter> meh |
10:37:07 | Yardanico | well times can vary between runs |
10:37:12 | FromGitter | <Ajusa> I noticed a discussion on that when I was looking around for optimize |
10:37:14 | FromGitter | <Ajusa> Yeah |
10:37:35 | FromGitter | <zacharycarter> likely / unlikely is the only other thing I can suggest off the top of my head |
10:37:41 | FromGitter | <zacharycarter> other folks may have more |
10:38:33 | Arrrr | I'd like to see that parallel version |
10:40:36 | FromGitter | <ephja> @zacharycarter I dunno if it has a positive effect on x86 |
10:41:46 | FromGitter | <zacharycarter> gotcha @ephja |
10:42:07 | FromGitter | <zacharycarter> thanks for the tip |
10:43:07 | FromGitter | <Ajusa> I'll put up my parallel version on another branch in a few minutes |
10:43:32 | Yardanico | well maybe cost of creating thread is higher than benefits |
10:43:48 | FromGitter | <zacharycarter> here's a parallel version |
10:43:55 | Yardanico | also - why do you need two loops in split? |
10:44:03 | Yardanico | it doesn't make any difference in speed, but |
10:44:14 | FromGitter | <zacharycarter> https://gist.github.com/303e72605d16ceb4c18eb7689ac36445 |
10:44:36 | Yardanico | well yeah it would be slower |
10:44:50 | Yardanico | Ajusa: this version works for me too https://gist.github.com/Yardanico/a24062fc659bb3f10e88f3b63f533961 |
10:44:54 | Yardanico | can you try it? |
10:45:01 | Yardanico | maybe you'll have better results |
10:45:21 | Yardanico | you don't even need for loop for "ratios" in split |
10:45:28 | FromGitter | <Ajusa> I switched back to one loop |
10:45:31 | Yardanico | maybe this can result in memory usage reduction |
10:45:47 | FromGitter | <Ajusa> Check my repo again xD |
10:45:55 | FromGitter | <Ajusa> I forgot to push last night |
10:46:02 | Arrrr | Does spawn create a new thread for each computation? Can't you split the total work in 4 queues for example? |
10:46:02 | FromGitter | <Ajusa> I had it back to the one loop |
10:46:12 | Yardanico | Arrrr, well you can set max pool size |
10:46:17 | Yardanico | but it seems this doesn't have any effect |
10:46:33 | Yardanico | hmmm |
10:47:38 | Yardanico | It's like ~10-15 times slower with parallel for me |
10:47:42 | FromGitter | <Ajusa> @zachaysan I am like 90% sure that is exactly what I had done, and it had gotten slower |
10:48:16 | FromGitter | <zacharycarter> yeah it definitely slows down |
10:49:55 | Yardanico | let me try with openmp pragma |
10:51:28 | Yardanico | oh boy |
10:51:29 | Yardanico | it works! |
10:51:38 | Yardanico | I get 3x speedup |
10:51:49 | Yardanico | https://nim-lang.org/docs/system.html#|| |
10:52:00 | Yardanico | but you'll need to have openmp installed in your system |
10:52:25 | Yardanico | https://gist.github.com/Yardanico/30b14883568985399c74aab3024dd723 |
10:52:31 | Yardanico | I just changed .. to || :D |
10:52:57 | Yardanico | my command for compilation and running is: nim c --cc:gcc -d:release --passC:"-fopenmp" --passL:"-fopenmp" -r hello.nim |
10:53:09 | FromGitter | <Ajusa> Nice! I actually thought that it wasn't implemented in the language yet. There was a forum post about it a while ago. |
10:53:32 | Yardanico | well it just doesn't have proper checks on Nim side |
10:53:45 | Yardanico | it just adds specific openmp pragma to the loop |
10:54:17 | Yardanico | just try command like mine |
10:54:24 | Yardanico | if it works - you're lucky and you already have openmp |
10:55:20 | FromGitter | <Ajusa> I'll test it asap; gotta go to school in a few minutes |
10:55:31 | Yardanico | ok |
10:55:54 | Yardanico | I'll install D compiler now and check your D version for me |
10:57:05 | FromGitter | <Ajusa> Wow thanks! You guys are ridiculously helpful lol |
10:57:51 | Arrrr | He wants your upvotes |
10:57:57 | Yardanico | lol |
10:58:11 | Arrrr | You could make a post on how you optimized the program. |
10:58:27 | * | dom96|w joined #nim |
11:00:35 | FromGitter | <Ajusa> Nim: 187ms D: 500ms (The reason these are changing is because of throttling and stuff) |
11:00:46 | FromGitter | <Ajusa> That's ridiculous |
11:00:49 | Yardanico | nim with openmp? |
11:00:52 | euantor | That's pretty good :D |
11:00:55 | Yardanico | yeah it is |
11:01:04 | Yardanico | god bless "result" variable |
11:01:04 | euantor | Is that using DMD? I'd be interesed to see how LDC does |
11:01:19 | FromGitter | <Ajusa> It is DMD |
11:01:21 | Yardanico | euantor, yeah I want to try it too |
11:01:32 | FromGitter | <Ajusa> LDC was actually slower for me, but I wasn't passing in any flags |
11:01:33 | Yardanico | but both dmd and ldc are failing to compile for me |
11:01:38 | euantor | I'd expect LDC to be a lot faster. Hopefully Nim can still beat it |
11:01:48 | Yardanico | with some linker error |
11:02:00 | FromGitter | <Ajusa> rdmd -O -m64 -inline -release -noboundscheck --build-only main.d |
11:02:11 | FromGitter | <Ajusa> use rdmd over dmd |
11:02:50 | Yardanico | well it's not in arch repos :( |
11:03:00 | Yardanico | I can't even find it in AUR |
11:03:22 | FromGitter | <Ajusa> Oh. |
11:03:45 | Yardanico | ah it's only one file |
11:04:07 | Yardanico | yeah I compiled rdmd |
11:04:23 | FromGitter | <Ajusa> wait now your version is giving me application errors |
11:04:38 | Yardanico | on exit? |
11:04:47 | Yardanico | well openmp pragma isn't very stable |
11:04:58 | Yardanico | and for me D version is faster |
11:05:07 | FromGitter | <Ajusa> "the application was unable to start correctly" |
11:05:10 | Yardanico | I mean not faster |
11:05:12 | FromGitter | <Ajusa> its a windows error |
11:05:14 | Yardanico | hmm |
11:05:22 | Yardanico | probably it can't load openmp libraries |
11:05:25 | Yardanico | (dlls) |
11:05:32 | FromGitter | <Ajusa> oh |
11:05:37 | FromGitter | <Ajusa> yeah I should install those |
11:06:15 | FromGitter | <Ajusa> Okay, I really gotta go to school now. I have 1st and third hour free tho, so I can test your stuff then. :D Thanks for all the help! |
11:06:40 | Yardanico | well D version is almost as fast as Nim for me |
11:06:46 | Yardanico | D - 150ms, Nim - 130ms |
11:06:48 | Yardanico | on arch linux |
11:06:48 | euantor | Might also be worth posting somehting on the forum if you haven't already |
11:06:54 | Yardanico | he did |
11:07:01 | euantor | ok, I missed that :) |
11:07:03 | Yardanico | ah sorry |
11:07:07 | Yardanico | he didn't |
11:07:24 | euantor | too busy fighting with .net at the minute |
11:09:04 | * | dddddd joined #nim |
11:23:42 | FromGitter | <ephja> are you benchmarking with ldc, gdc etc as well? |
11:25:32 | * | ajusa joined #nim |
11:26:20 | ajusa | I have not benchmarked with GDC (didn't want to go through compiling that on Windows) and with LDC (no extra compile flags) it was slower than DMD |
11:27:13 | Araq | Yardanico, couven92: I'm making the android-glob stuff dependent on -d:termux |
11:27:34 | * | BigEpsilon quit (Quit: Leaving) |
11:27:54 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
11:28:21 | couven92 | Araq: Hmm... good idea, I'm currently looking into the Android NDK, I'm playing with the idea to cross compile Nim with the Android NDK gcc cross-compiler |
11:28:33 | couven92 | Let's see how far I get... |
11:28:52 | FromGitter | <zacharycarter> have fun! |
11:28:56 | couven92 | :D |
11:30:28 | Yardanico | well we should some time revive nim buildfarm |
11:31:00 | Yardanico | to get binary releases for windows |
11:31:05 | Yardanico | because linux distros already have nim :) |
11:32:03 | ajusa | How do I use OpenMP with nim? How do I get the dlls? |
11:32:56 | Yardanico | ajusa, well I don't really know |
11:33:00 | couven92 | ajusa, well if you were writing gcc you'd do `-lopenmp` (or sth. similar) on the command-line, right? |
11:33:08 | Yardanico | couven92, he's on windows |
11:33:09 | Yardanico | with mingw |
11:33:13 | couven92 | Oh. |
11:33:24 | Yardanico | do you have mingw-w64? |
11:33:27 | ajusa | Yes |
11:33:41 | couven92 | For that I'd actually suggest VCC, since VCC supports built-in OpenMP |
11:33:55 | Yardanico | yeah I said about that too |
11:33:59 | Yardanico | but it's not that small |
11:34:14 | couven92 | Yardanico, what's not small? VCC? |
11:34:19 | couven92 | Yeah, no shit! :P |
11:34:25 | Yardanico | couven92, yeah |
11:34:32 | Yardanico | it's more in size than mingw :D |
11:34:34 | ajusa | I don't want all of visual studio lol |
11:34:53 | couven92 | Well, the standalone tools will give you just the compiler, so you can do that |
11:35:18 | couven92 | ajusa: http://landinghub.visualstudio.com/visual-cpp-build-tools |
11:35:56 | Yardanico | ah, yes |
11:35:59 | Yardanico | Didn't knew this exists |
11:36:25 | FromGitter | <zacharycarter> would be nice to have a giant Nim logo there |
11:37:15 | couven92 | that one is actually fairly small... And iirc you still get separate compilers specialized for x86 and x64 |
11:39:35 | couven92 | ah, never mind... It's still an entire GiB :O |
11:39:47 | Yardanico | yeah |
11:40:49 | ajusa | k, I installed that |
11:41:39 | Yardanico | ajusa, openmp or vcc |
11:41:40 | Yardanico | ? |
11:41:52 | FromGitter | <zacharycarter> I don't think you install openmp |
11:41:57 | FromGitter | <zacharycarter> your compiler has to support it apparently |
11:42:23 | ajusa | I installed the visual studio package thing |
11:42:57 | Yardanico | ajusa, ok, now open "Visual studio bla-bla" from start menu |
11:43:01 | Yardanico | it has the icon of the console |
11:43:04 | ajusa | I did |
11:43:11 | Yardanico | now compile your nim app like |
11:43:18 | couven92 | hmmm... Araq, Yardanico, the current Android NDK gives us toolchains for Android 4.9... is that fine or should I go legacy for 4.0 or lower? |
11:43:19 | Yardanico | nim --cc:vcc -d:release app.nim |
11:43:41 | Yardanico | couven92, there is android 4.9? |
11:43:42 | Yardanico | wow |
11:43:46 | Yardanico | are you sure? |
11:44:08 | couven92 | C:\Program Files\Android\android-ndk-r15c\toolchains\arm-linux-androideabi-4.9 |
11:44:21 | Yardanico | maybe it's the version of linux kernel? |
11:44:32 | couven92 | yeah it is! |
11:44:46 | Yardanico | well many android phones use 3.x kernel |
11:44:50 | Yardanico | even my phone |
11:44:52 | ajusa | I am getting invalid command "main.nim" something is out of order afaik |
11:45:02 | Yardanico | ajusa, ah sorry |
11:45:07 | Yardanico | ajusa, nim c --cc:vcc -d:release app.nim |
11:45:19 | couven92 | Yardanico, really? :O I just installed an Android 7.1 custom ROM on mine yesterday! :P |
11:45:32 | Yardanico | couven92, yeah |
11:45:40 | Yardanico | 4.x kernels are not widespread |
11:45:43 | Yardanico | in android world |
11:45:50 | Yardanico | couven92, well I can install android 7 rom too :) |
11:46:08 | FromGitter | <ephja> yeah it's out of order. anyone got a wrench? |
11:46:13 | * | dddddd quit (Ping timeout: 240 seconds) |
11:46:27 | couven92 | okay... to spare myself some trouble I'll first create a stable build chain with the current NDK before I go back in time... :D |
11:46:47 | ajusa | Yardanico, now how do I go about using your multithreaded openmp code? |
11:47:03 | Yardanico | ajusa, just try to compile my version without passing any flags |
11:47:17 | Yardanico | ah |
11:47:20 | Yardanico | you should add this |
11:47:39 | Yardanico | nim c --cc:vcc --passC:"/openmp" --passL:"/openmp" -d:release main.nim |
11:47:42 | Yardanico | try this |
11:47:59 | ajusa | okay, ill try that |
11:49:32 | ajusa | Alright, that worked :D |
11:49:58 | ajusa | Speed improvement too! It is about 20 percent faster with the multithreading |
11:50:06 | Yardanico | ajusa, hmm, ok |
11:50:20 | Yardanico | there's always a lot of difference between different platforms |
11:50:26 | ajusa | 232ms vs 531ms (Nim vs D) |
11:50:43 | Yardanico | well on my arch linux I get 130ms nim vs 150ms D :) but nim is still faster |
11:50:50 | ajusa | That's amazing, there is no way I would have figured out this stuff without you guys |
11:50:54 | ajusa | Thanks! |
11:51:15 | Yardanico | so we got most of the improvement because of "result" variable |
11:51:39 | ajusa | yeah, that's what did most of it |
11:53:17 | ajusa | I changed the second method "getSplitIntensityRatio" to use result and that shaved off another 20ms or so |
11:54:24 | Yardanico | well "result" is actually useful - most of the time you'll make your procedures 2 lines shorter if you use result :) |
11:54:27 | Yardanico | sometimes 1 line shorter |
11:54:54 | Yardanico | and speed too |
11:55:15 | ajusa | yeah, since it is already part of the function, using it instead of a second var is much better for memory I guess |
11:57:09 | * | ajusa quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
11:59:18 | * | dddddd joined #nim |
12:02:38 | * | dom96|w joined #nim |
12:07:37 | * | ldleworker joined #nim |
12:08:30 | * | abeaumont quit (Ping timeout: 252 seconds) |
12:09:36 | * | mal`` quit (Ping timeout: 252 seconds) |
12:10:09 | * | xet7 quit (Ping timeout: 252 seconds) |
12:10:09 | * | oaao quit (Ping timeout: 252 seconds) |
12:10:09 | * | ldlework quit (Ping timeout: 252 seconds) |
12:10:09 | * | Shoozza quit (Ping timeout: 252 seconds) |
12:10:58 | * | Shoozza joined #nim |
12:16:05 | * | dddddd quit (*.net *.split) |
12:16:05 | * | Yardanico quit (*.net *.split) |
12:16:05 | * | Sentreen quit (*.net *.split) |
12:16:05 | * | kunev quit (*.net *.split) |
12:16:05 | * | acidx quit (*.net *.split) |
12:16:06 | * | Jesin quit (*.net *.split) |
12:16:06 | * | beatmox quit (*.net *.split) |
12:16:06 | * | niv quit (*.net *.split) |
12:16:06 | * | joshbaptiste_ quit (*.net *.split) |
12:16:06 | * | ehmry quit (*.net *.split) |
12:16:06 | * | byteflame quit (*.net *.split) |
12:16:07 | * | derlafff quit (*.net *.split) |
12:16:07 | * | dom96|w quit (*.net *.split) |
12:16:07 | * | Yaiyan quit (*.net *.split) |
12:16:07 | * | crem quit (*.net *.split) |
12:16:08 | * | watzon quit (*.net *.split) |
12:16:08 | * | flyx quit (*.net *.split) |
12:16:08 | * | Matthias247 quit (*.net *.split) |
12:16:08 | * | Demos[m] quit (*.net *.split) |
12:16:09 | * | pydsigner quit (*.net *.split) |
12:16:09 | * | TheManiac quit (*.net *.split) |
12:16:09 | * | m712 quit (*.net *.split) |
12:16:09 | * | dave24 quit (*.net *.split) |
12:16:09 | * | subsetpark quit (*.net *.split) |
12:16:09 | * | loc8_ quit (*.net *.split) |
12:16:09 | * | nsfw_ quit (*.net *.split) |
12:16:09 | * | StarBrilliant quit (*.net *.split) |
12:16:10 | * | Elronnd quit (*.net *.split) |
12:16:10 | * | jivank[m] quit (*.net *.split) |
12:16:10 | * | ShalokShalom_ quit (*.net *.split) |
12:16:10 | * | PMunch quit (*.net *.split) |
12:16:10 | * | cspar quit (*.net *.split) |
12:16:10 | * | yeeve__ quit (*.net *.split) |
12:16:11 | * | endragor quit (*.net *.split) |
12:16:11 | * | CcxWrk quit (*.net *.split) |
12:16:11 | * | Lord_Nightmare quit (*.net *.split) |
12:16:11 | * | chaosdav quit (*.net *.split) |
12:16:11 | * | GaveUp quit (*.net *.split) |
12:16:12 | * | notdekka[m] quit (*.net *.split) |
12:16:12 | * | Jipok[m] quit (*.net *.split) |
12:16:12 | * | bodie_ quit (*.net *.split) |
12:16:12 | * | adamchainz quit (*.net *.split) |
12:16:12 | * | dyce[m] quit (*.net *.split) |
12:16:12 | * | shodan45 quit (*.net *.split) |
12:16:12 | * | SunDwarf quit (*.net *.split) |
12:16:13 | * | bozaloshtsh quit (*.net *.split) |
12:16:13 | * | dom96 quit (*.net *.split) |
12:16:13 | * | Araq quit (*.net *.split) |
12:16:13 | * | Vladar quit (*.net *.split) |
12:16:13 | * | gmpreussner quit (*.net *.split) |
12:16:13 | * | Syneh_ quit (*.net *.split) |
12:16:13 | * | gsingh93 quit (*.net *.split) |
12:16:13 | * | JStoker quit (*.net *.split) |
12:16:14 | * | zielmicha_ quit (*.net *.split) |
12:16:14 | * | r4vi quit (*.net *.split) |
12:16:14 | * | mindB quit (*.net *.split) |
12:16:14 | * | MrAxilus[m] quit (*.net *.split) |
12:16:14 | * | koppeh1 quit (*.net *.split) |
12:16:14 | * | ketralnis quit (*.net *.split) |
12:16:14 | * | def- quit (*.net *.split) |
12:16:14 | * | EastByte quit (*.net *.split) |
12:16:15 | * | jonafato quit (*.net *.split) |
12:16:15 | * | joebo quit (*.net *.split) |
12:16:15 | * | pwntus quit (*.net *.split) |
12:16:15 | * | wishi quit (*.net *.split) |
12:16:15 | * | Gertm quit (*.net *.split) |
12:16:15 | * | benoliver999 quit (*.net *.split) |
12:16:15 | * | mwbrown quit (*.net *.split) |
12:16:15 | * | MonsterAbyss quit (*.net *.split) |
12:16:15 | * | couven92 quit (*.net *.split) |
12:16:15 | * | BitPuffin|osx quit (*.net *.split) |
12:16:15 | * | mahsav2 quit (*.net *.split) |
12:16:16 | * | Calinou quit (*.net *.split) |
12:16:16 | * | pigmej quit (*.net *.split) |
12:16:16 | * | Arrrr quit (*.net *.split) |
12:16:16 | * | nsf quit (*.net *.split) |
12:16:16 | * | kier quit (*.net *.split) |
12:16:16 | * | ludocode quit (*.net *.split) |
12:16:16 | * | zama quit (*.net *.split) |
12:16:16 | * | byte512 quit (*.net *.split) |
12:16:16 | * | heinrich5991 quit (*.net *.split) |
12:16:16 | * | Amrykid quit (*.net *.split) |
12:16:16 | * | federico3 quit (*.net *.split) |
12:16:16 | * | Zevv quit (*.net *.split) |
12:16:17 | * | rauss quit (*.net *.split) |
12:16:17 | * | Pisuke quit (*.net *.split) |
12:16:17 | * | oprypin quit (*.net *.split) |
12:16:17 | * | d10n quit (*.net *.split) |
12:16:17 | * | Amun_Ra quit (*.net *.split) |
12:16:17 | * | tdc quit (*.net *.split) |
12:16:17 | * | Snircle quit (*.net *.split) |
12:16:17 | * | SusWombat quit (*.net *.split) |
12:16:17 | * | Xe quit (*.net *.split) |
12:16:18 | * | cyraxjoe quit (*.net *.split) |
12:16:18 | * | livcd quit (*.net *.split) |
12:16:18 | * | gangstacat quit (*.net *.split) |
12:16:18 | * | euantor quit (*.net *.split) |
12:16:18 | * | hohlerde quit (*.net *.split) |
12:16:19 | * | surma quit (*.net *.split) |
12:16:19 | * | LyndsySimon quit (*.net *.split) |
12:16:19 | * | RushPL quit (*.net *.split) |
12:22:26 | * | couven92 joined #nim |
12:22:26 | * | mal`` joined #nim |
12:22:26 | * | oaao1 joined #nim |
12:22:26 | * | dom96|w joined #nim |
12:22:26 | * | dddddd joined #nim |
12:22:26 | * | ShalokShalom_ joined #nim |
12:22:26 | * | Yardanico joined #nim |
12:22:26 | * | tdc joined #nim |
12:22:26 | * | livcd joined #nim |
12:22:26 | * | BitPuffin|osx joined #nim |
12:22:26 | * | Matthias247 joined #nim |
12:22:26 | * | Arrrr joined #nim |
12:22:26 | * | endragor joined #nim |
12:22:26 | * | PMunch joined #nim |
12:22:26 | * | Vladar joined #nim |
12:22:26 | * | nsf joined #nim |
12:22:26 | * | cspar joined #nim |
12:22:26 | * | rauss joined #nim |
12:22:26 | * | gangstacat joined #nim |
12:22:26 | * | Pisuke joined #nim |
12:22:26 | * | mindB joined #nim |
12:22:26 | * | Demos[m] joined #nim |
12:22:26 | * | subsetpark joined #nim |
12:22:26 | * | Snircle joined #nim |
12:22:26 | * | loc8_ joined #nim |
12:22:26 | * | oprypin joined #nim |
12:22:26 | * | Sentreen joined #nim |
12:22:26 | * | nsfw_ joined #nim |
12:22:26 | * | notdekka[m] joined #nim |
12:22:26 | * | SusWombat joined #nim |
12:22:26 | * | Jesin joined #nim |
12:22:26 | * | yeeve__ joined #nim |
12:22:26 | * | StarBrilliant joined #nim |
12:22:26 | * | kier joined #nim |
12:22:26 | * | Xe joined #nim |
12:22:26 | * | ludocode joined #nim |
12:22:26 | * | beatmox joined #nim |
12:22:26 | * | mahsav2 joined #nim |
12:22:26 | * | gmpreussner joined #nim |
12:22:26 | * | Yaiyan joined #nim |
12:22:26 | * | niv joined #nim |
12:22:26 | * | kunev joined #nim |
12:22:26 | * | euantor joined #nim |
12:22:26 | * | d10n joined #nim |
12:22:26 | * | Amun_Ra joined #nim |
12:22:26 | * | joshbaptiste_ joined #nim |
12:22:26 | * | zama joined #nim |
12:22:26 | * | pydsigner joined #nim |
12:22:26 | * | TheManiac joined #nim |
12:22:26 | * | ketralnis joined #nim |
12:22:26 | * | Calinou joined #nim |
12:22:26 | * | byte512 joined #nim |
12:22:26 | * | crem joined #nim |
12:22:26 | * | m712 joined #nim |
12:22:26 | * | watzon joined #nim |
12:22:26 | * | Zevv joined #nim |
12:22:26 | * | acidx joined #nim |
12:22:26 | * | dave24 joined #nim |
12:22:26 | * | heinrich5991 joined #nim |
12:22:26 | * | Amrykid joined #nim |
12:22:26 | * | federico3 joined #nim |
12:22:26 | * | Elronnd joined #nim |
12:22:26 | * | MrAxilus[m] joined #nim |
12:22:26 | * | jivank[m] joined #nim |
12:22:26 | * | hohlerde joined #nim |
12:22:26 | * | ehmry joined #nim |
12:22:26 | * | dyce[m] joined #nim |
12:22:26 | * | byteflame joined #nim |
12:22:26 | * | Jipok[m] joined #nim |
12:22:26 | * | bodie_ joined #nim |
12:22:26 | * | adamchainz joined #nim |
12:22:26 | * | CcxWrk joined #nim |
12:22:26 | * | koppeh1 joined #nim |
12:22:26 | * | dom96 joined #nim |
12:22:26 | * | shodan45 joined #nim |
12:22:26 | * | pigmej joined #nim |
12:22:26 | * | SunDwarf joined #nim |
12:22:26 | * | def- joined #nim |
12:22:26 | * | bozaloshtsh joined #nim |
12:22:26 | * | EastByte joined #nim |
12:22:26 | * | Araq joined #nim |
12:22:26 | * | joebo joined #nim |
12:22:26 | * | jonafato joined #nim |
12:22:26 | * | pwntus joined #nim |
12:22:26 | * | benoliver999 joined #nim |
12:22:26 | * | flyx joined #nim |
12:22:26 | * | chaosdav joined #nim |
12:22:26 | * | wishi joined #nim |
12:22:26 | * | Lord_Nightmare joined #nim |
12:22:26 | * | Gertm joined #nim |
12:22:26 | * | mwbrown joined #nim |
12:22:26 | * | MonsterAbyss joined #nim |
12:22:26 | * | GaveUp joined #nim |
12:22:26 | * | derlafff joined #nim |
12:22:26 | * | surma joined #nim |
12:22:26 | * | LyndsySimon joined #nim |
12:22:26 | * | RushPL joined #nim |
12:22:26 | * | Syneh_ joined #nim |
12:22:26 | * | gsingh93 joined #nim |
12:22:26 | * | JStoker joined #nim |
12:22:26 | * | cyraxjoe joined #nim |
12:22:26 | * | zielmicha_ joined #nim |
12:22:26 | * | r4vi joined #nim |
12:27:59 | * | gangstacat quit (Quit: Leaving) |
12:30:05 | * | kunev quit (Ping timeout: 240 seconds) |
12:30:43 | * | kunev joined #nim |
12:32:39 | Yardanico | FromGitter yay |
12:33:40 | FromGitter | <krux02> @Yardanico: I actually use result in c++, too |
12:39:01 | * | BigEpsilon joined #nim |
12:40:48 | BigEpsilon | @Araq, here it is about that bug in compiler/render https://github.com/nim-lang/Nim/pull/6296 |
12:42:10 | Yardanico | krux02: oh, wait, there's result in c++? cool |
12:43:45 | Araq | BigEpsilon: nice you even wrote a test case |
12:46:07 | couven92 | Araq, basically, I can get almost the entire compiler to compile with the Android NDK... |
12:46:27 | couven92 | Except for globbing... There's no glob.h in android |
12:46:51 | couven92 | (which is why termux includes it) |
12:46:56 | couven92 | suggestions? |
12:47:02 | FromGitter | <BigEpsilon> yes :) |
12:47:27 | FromGitter | <BigEpsilon> @Araq , yes :) |
12:47:32 | FromGitter | <BigEpsilon> sry |
12:48:20 | Araq | steal from termux's glob.h implementation? |
12:49:10 | couven92 | yeah... that's what everyone else also suggests (except to steal it from FreeBSD) |
12:49:15 | * | ShalokShalom_ is now known as ShalokShalom |
12:50:55 | Yardanico | couven92, yeah it's only 1 file |
12:50:55 | Yardanico | https://github.com/termux/termux-packages/tree/master/packages/libandroid-glob |
12:50:58 | Yardanico | 1 header and 1 c file |
12:51:06 | Yardanico | only ~1kloc |
12:51:13 | Yardanico | ~800 loc |
12:51:22 | Yardanico | Lol |
12:51:28 | Yardanico | * This code is derived from software contributed to Berkeley by Guido van Rossum. |
13:05:37 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
13:07:19 | * | mahsav joined #nim |
13:09:51 | * | mahsav2 quit (Ping timeout: 248 seconds) |
13:11:37 | * | BigEpsilon quit (Quit: Leaving) |
13:14:37 | * | dom96|w joined #nim |
13:22:16 | * | mahmudov joined #nim |
13:32:58 | * | relax joined #nim |
13:37:40 | * | yglukhov joined #nim |
13:43:37 | FromGitter | <krux02> @Yardanico well when you declare a variable and call it result, then yes |
13:43:55 | Yardanico | ah :) |
13:45:39 | * | rosshadden joined #nim |
13:51:43 | * | mahsav2 joined #nim |
13:53:33 | * | mahsav quit (Ping timeout: 252 seconds) |
13:56:27 | * | endragor quit (Remote host closed the connection) |
13:58:10 | * | endragor_ joined #nim |
14:01:03 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
14:01:32 | * | miran joined #nim |
14:02:52 | * | endragor_ quit (Ping timeout: 260 seconds) |
14:05:49 | * | abeaumont joined #nim |
14:06:18 | * | yglukhov quit (Remote host closed the connection) |
14:09:04 | * | ldleworker is now known as ldlework |
14:09:05 | * | ldlework quit (Changing host) |
14:09:05 | * | ldlework joined #nim |
14:09:29 | miran | any idiomatic way to get unique characters in a string? (the python way is to convert it to a set) |
14:09:52 | * | PMunch quit (Quit: Leaving) |
14:10:33 | miran | currently i'm iterating through string, checking if a character is not in a sequence of characters and then add the character to it. |
14:13:40 | Yardanico | miran, https://nim-lang.org/docs/sets.html ? |
14:14:03 | Yardanico | yeah it works |
14:14:19 | Yardanico | but probably not for unicode |
14:14:39 | Yardanico | if you want unicode - you'll need to convert your string to runes |
14:14:51 | Yardanico | yeah that works |
14:15:05 | Yardanico | miran, https://gist.github.com/Yardanico/b4182c1391b67a0039baa809460e0432 |
14:15:28 | Yardanico | if you care only about ASCII - you don't need toRunes |
14:15:49 | miran | toSet works, thanks Yardanico |
14:16:18 | Yardanico | well if you want to create set and then add to it - you can use initSet |
14:18:40 | miran | currently i just need to iterate through the unique chars, but initSet will probably be useful in the future |
14:31:29 | * | relax quit (Ping timeout: 248 seconds) |
14:50:26 | * | nsf quit (Quit: WeeChat 1.9) |
14:51:19 | * | nsf joined #nim |
14:56:34 | * | Vladar quit (Quit: Leaving) |
15:03:57 | * | arnetheduck quit (Ping timeout: 252 seconds) |
15:04:32 | * | Trustable joined #nim |
15:07:06 | * | gangstacat joined #nim |
15:09:30 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
15:15:44 | * | dom96|w joined #nim |
15:23:52 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
15:32:37 | * | dom96|w joined #nim |
15:33:23 | * | yglukhov joined #nim |
15:41:48 | * | relax joined #nim |
15:51:53 | * | BigEpsilon joined #nim |
16:02:30 | couven92 | How do I copy the value of a Nim string into an already allocated cstring? |
16:06:09 | euantor | Could probably use `copyMem`: https://nim-lang.org/docs/system.html#copyMem,pointer,pointer,Natural |
16:08:15 | FromGitter | <BigEpsilon> @Araq , I made a PR to add support for cpp integer template parameters to c2nim: https://github.com/nim-lang/c2nim/pull/95 ⏎ non a temple of that form: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59a6e2ee9acddb2407e5b28a] |
16:09:57 | * | BitPuffin|osx quit (Remote host closed the connection) |
16:10:42 | * | BitPuffin|osx joined #nim |
16:10:52 | * | endragor joined #nim |
16:15:12 | * | endragor quit (Ping timeout: 240 seconds) |
16:19:16 | couven92 | YES! Araq, Yardanico: I got nim running on my phone WITHOUT termux! :) |
16:19:25 | Yardanico | couven92, ohhhh |
16:20:28 | couven92 | And it can run nimscript! |
16:20:41 | FromGitter | <BigEpsilon> wow great ! |
16:21:10 | couven92 | I have not cross-compiled gcc, so I can't actually compile anything with my binary, but we know that part works in termux where we have gcc |
16:21:59 | Yardanico | I've found this: https://code.google.com/archive/p/native-android-development/downloads |
16:22:06 | Yardanico | android gcc 4.4.0 |
16:22:23 | Yardanico | it's precompiled binary |
16:23:30 | couven92 | Hmm... might work :) |
16:23:53 | couven92 | from 2011! :P |
16:23:56 | Yardanico | yeah ! |
16:24:15 | Yardanico | I've found it here: https://stackoverflow.com/questions/11852187/how-to-compile-gcc-for-android |
16:24:25 | couven92 | precompiled clang would actually also be fine, but... |
16:24:44 | Yardanico | well gcc from 2011 isn't the best |
16:24:48 | couven92 | let's get this working for ONE compiler first, right :P |
16:24:54 | Yardanico | yeah |
16:28:01 | couven92 | Yardanico: "./android-gcc-4.4.0/bin/arm-eabi-gcc": error: only position independent executables (PIE) are supported. |
16:28:12 | Yardanico | couven92, ehh |
16:28:37 | couven92 | yeah... I had this with Nim as well, but I fixed it by putting -fPIE -pie into the CFLAGS |
16:28:47 | Yardanico | yeah so we'll need to compile GCC with these flags as well |
16:29:01 | couven92 | Wuhuu! No, not doing that today :P |
16:29:15 | Yardanico | cross-compile GCC to android |
16:29:21 | Yardanico | much fun :D |
16:29:38 | couven92 | well... I'd much rather fix Nim! :D |
16:30:34 | couven92 | BTW, Yardanico: cross-compiling Nim with the NDK is a pain! :D |
16:30:54 | Yardanico | couven92, well I knew it is. I heard that NDK itself is a pain :) |
16:33:22 | couven92 | Yardanico, would you mind cloning the `android-ndk` branch from https://github.com/couven92/Nim.git to test that everything still behaves nicely on termux? |
16:33:54 | Yardanico | couven92, ok |
16:34:00 | couven92 | ah, wait |
16:34:26 | Yardanico | you've removed termux entry :) |
16:34:28 | couven92 | you're on ARM64, right... okay, I probably need to include android-glob there as well... |
16:34:54 | couven92 | yeah... turns out, there's no difference (I hope) between termux and vanilla Android |
16:36:39 | couven92 | Yardanico, okay, there you go |
16:37:51 | Yardanico | Ok I'll clone it now |
16:39:15 | Yardanico | I'll compile it using my normal nim compiler (which is already installed in termux) |
16:39:28 | couven92 | that should work... hehe... |
16:40:49 | Yardanico | also git (at least github) is case-insensitive, so https://github.com/nim-lang/Nim and https://github.com/nim-lang/nim are equal |
16:41:55 | Yardanico | couven92, it seems it works in termux! |
16:46:48 | couven92 | Yardanico, Yuhuuu! :D |
16:47:33 | couven92 | Okay, then I'll try to get on the next bus home, and then Araq I'll at the sigtimedwait issue on old Android |
16:48:07 | * | sleepyqt joined #nim |
16:49:25 | couven92 | Araq, cross-compiling using the NDK and totally avoiding termux was a little bit compilicated... I should write that down for next crazy person to attempt this, right? |
16:55:59 | * | xet7 joined #nim |
16:57:47 | Yardanico | couven92, yeah, maybe as a post for nim blog ! |
16:57:59 | couven92 | :) |
17:01:10 | * | yglukhov quit (Remote host closed the connection) |
17:01:22 | couven92 | Ah Yardanico: "Since Android Lollipop, Android has required that executables be linked as position independent (-pie) to help provide ASLR." |
17:01:32 | Yardanico | couven92, yeah |
17:04:54 | couven92 | Yardanico, this might actually make cross-compiling GCC somewhat easier... |
17:04:57 | couven92 | https://gist.github.com/nddrylliog/4688209 |
17:05:42 | * | mahmudov quit (Remote host closed the connection) |
17:12:04 | * | BigEpsilon quit (Ping timeout: 255 seconds) |
17:13:59 | * | sleepyqt quit (Quit: WeeChat 1.9) |
17:14:15 | * | couven92 quit (Quit: Client disconnecting) |
17:16:10 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
17:17:56 | * | dom96|w joined #nim |
17:20:44 | * | ldlework quit (Quit: co'o ro pendo be mi) |
17:23:22 | * | BigEpsilon joined #nim |
17:24:53 | * | ldlework joined #nim |
17:24:53 | * | ldlework quit (Changing host) |
17:24:53 | * | ldlework joined #nim |
17:29:51 | * | aasaad joined #nim |
17:34:24 | * | aasaad quit (Ping timeout: 260 seconds) |
17:37:16 | * | relax quit (Ping timeout: 255 seconds) |
17:40:35 | * | BigEpsilon quit (Ping timeout: 240 seconds) |
17:41:14 | * | Trustable quit (Remote host closed the connection) |
17:43:10 | * | Nobabs27 joined #nim |
17:44:09 | * | couven92 joined #nim |
17:46:56 | * | PMunch joined #nim |
17:47:42 | couven92 | Is there a way (e.g. with a pragma) to get nim to send the right add lib argument to the linker? |
17:47:56 | couven92 | Like a smart passL pragma? |
17:48:50 | couven92 | then we could omit the -landroid-glob config and put it into lib/pure/posix.nim instead |
18:02:49 | Araq | couven92: that's worse as that config option causes problems. |
18:03:01 | Araq | however, you do not need to port glob.c |
18:04:15 | Araq | https://nim-lang.org/docs/os.html#walkPattern.i,string |
18:04:25 | Araq | "pattern is OS dependent, but at least the "*.ext" notation is supported." |
18:04:40 | Araq | Nim's stdlib is suprisingly good sometimes :P |
18:04:49 | Araq | you only need to implement the star |
18:09:13 | couven92 | Araq, ah, you mean we should write our own minimalist Android-glob to rid ourselves of the dependency? |
18:09:23 | Araq | yes! |
18:09:45 | Arrrr | I think this should be treated as a bug https://pastebin.com/x6j3w0cf really annoying |
18:10:10 | Yardanico | well there's no actual way to have usual arguments after keyword arguments |
18:10:36 | Arrrr | Why? |
18:10:44 | Yardanico | I don't know, ask Araq :) |
18:11:25 | Arrrr | He told you that? |
18:11:57 | Yardanico | no, but I think there's no way |
18:12:16 | Arrrr | Why do you believe that? |
18:12:26 | Yardanico | because I've tried myself :D |
18:12:35 | Arrrr | That's interesting. |
18:13:16 | Arrrr | I don't know how the compiler works, so i cannot say anything |
18:13:19 | Araq | that's not a bug, we don't do overloading resolution based on nondeterministic state machines |
18:13:43 | Araq | in fact, I don't think there is a single language out there that supports that |
18:14:05 | * | Nobabs27 quit (Quit: Leaving) |
18:14:35 | Arrrr | Why can't you make a fun(b: bool) which under the hood calls fun(1, b) |
18:14:56 | Yardanico | why you can't? |
18:15:02 | Yardanico | I do this |
18:15:32 | Yardanico | Araq, yeah, even python doesn't allow that |
18:15:36 | Yardanico | SyntaxError: non-default argument follows default argument |
18:15:42 | Arrrr | Of course, but would be a good idea if the compiler does it for me |
18:16:01 | Arrrr | i save 3 lines |
18:16:09 | * | nsf quit (Quit: WeeChat 1.9) |
18:24:57 | * | Nobabs27 joined #nim |
18:30:08 | * | relax joined #nim |
18:37:31 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
18:42:51 | * | pilne joined #nim |
18:43:25 | * | nsf joined #nim |
18:44:47 | Araq | 3 lines for you, 100 lines in the compiler and a never ending stream of new bugs, no thanks |
18:47:28 | * | claudiuinberlin joined #nim |
18:47:36 | claudiuinberlin | hello everyone |
18:48:02 | Yardanico | claudiuinberlin, hi |
18:48:14 | claudiuinberlin | I'm an old ruby guy, and I would like in my free time to invest in a new language, so here I'm an nim channel. I do try cristal, d, and now nim |
18:48:23 | claudiuinberlin | what is the status of the language? |
18:48:38 | claudiuinberlin | crystal is super beta, d is forever in beta, so nim? |
18:49:09 | Yardanico | claudiuinberlin, well, as Araq once said on the forum - he wanted to make nim 1.0 years ago, but community disagreed |
18:49:32 | claudiuinberlin | so, still in beta? |
18:49:58 | Araq | no, Nim 0.17.0 is Nim 2017 :P |
18:49:58 | Arrrr | Alpha wolf |
18:51:25 | Araq | kidding aside, Nim is forever in beta too. |
18:51:50 | Yardanico | claudiuinberlin, but not super beta because we have all platforms support :D |
18:52:12 | claudiuinberlin | thx for the replies |
18:52:16 | Araq | we also have very good backwards compatibility, ymmv |
18:52:18 | claudiuinberlin | what is the ecosystem? |
18:52:25 | claudiuinberlin | for example, in d is missing :) |
18:52:32 | claudiuinberlin | and in crystal is on ryby :)) |
18:52:50 | Yardanico | claudiuinberlin, well, same for Nim I guess |
18:53:22 | claudiuinberlin | ok :) |
18:53:25 | claudiuinberlin | thx guys! |
18:53:36 | claudiuinberlin | brew install nim :d |
18:53:42 | Yardanico | yeah this would work |
18:53:50 | claudiuinberlin | any editor, sublime, vim ? |
18:53:53 | Arrrr | The ecosystem is do your own bindings. but in nim is really easy. |
18:54:10 | Yardanico | claudiuinberlin, well, the most complete one - VSCode + nim plugin |
18:54:31 | Yardanico | it uses nimsuggest tool (tool built with nim compiler to provide suggestions for Nim code) to add autocompletion |
18:54:58 | Yardanico | well there's also plugins for vim/sublime/emacs etc |
18:55:13 | Yardanico | claudiuinberlin, https://github.com/nim-lang/Nim/wiki/Editor-Support |
18:56:07 | claudiuinberlin | <Yardanico> tjx |
18:56:10 | claudiuinberlin | thx* |
18:56:20 | claudiuinberlin | thx guys |
18:56:29 | claudiuinberlin | I will try doing some hello world |
18:56:35 | claudiuinberlin | then ffi with ruby :) |
18:56:42 | claudiuinberlin | that is my goal |
18:57:07 | claudiuinberlin | another question, there is any roadmap? |
18:57:21 | claudiuinberlin | and you are backed by some companies, or lonely birds like dlang? |
18:59:59 | Arrrr | https://github.com/nim-lang/Nim/blob/devel/todo.txt |
19:01:44 | * | yglukhov joined #nim |
19:05:29 | claudiuinberlin | thx |
19:05:55 | claudiuinberlin | ouch here: - try to fix as many compiler crashes as reasonable :) |
19:05:57 | * | yglukhov quit (Ping timeout: 252 seconds) |
19:07:22 | * | couven92 quit (Ping timeout: 260 seconds) |
19:07:33 | * | Nobabs27 quit (Quit: Leaving) |
19:08:37 | claudiuinberlin | how you guys evaluate with crystal or dlang? |
19:08:53 | claudiuinberlin | ffy, the vcode is amazing, and the binary is really small! |
19:09:21 | miran | claudiuinberlin: "any editor, sublime, vim ?" -> i just started with nim few days ago, but i had a nice time with nim in vs code |
19:09:36 | Yardanico | claudiuinberlin, install nim extension and "vscode-icons" to add Nim icons :) |
19:12:37 | * | relax quit (Ping timeout: 260 seconds) |
19:12:57 | claudiuinberlin | ok, what is most suitable and simple way for a champ like me to use nim and be happy? |
19:13:12 | claudiuinberlin | where nim is great and where I shloud focus |
19:13:29 | claudiuinberlin | 2 weeks of holidays in spain and I prefer do relax writing some stuff :) |
19:14:07 | Arrrr | A lot of people around here make videogames. |
19:14:24 | Arrrr | One has a game on steam |
19:14:42 | claudiuinberlin | really? |
19:14:42 | claudiuinberlin | wow |
19:14:46 | claudiuinberlin | I will but the book |
19:14:58 | claudiuinberlin | nim in action so I fell that I help the people behind |
19:17:00 | * | miran quit (Remote host closed the connection) |
19:18:27 | claudiuinberlin | done |
19:18:30 | claudiuinberlin | new book! |
19:19:20 | claudiuinberlin | ok guys |
19:19:29 | claudiuinberlin | I would like to thx a lot for the kind replies |
19:19:32 | claudiuinberlin | I have a book now |
19:19:34 | claudiuinberlin | and some spare time |
19:20:53 | PMunch | Hmm, why do seq have int as their index? And not uint |
19:23:23 | * | dom96|w joined #nim |
19:27:10 | FromGitter | <zacharycarter> can anyone explain why this doesn't work? |
19:27:22 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59a7119abc46472974dbfd58] |
19:27:35 | FromGitter | <Yardanico> one sec |
19:27:42 | FromGitter | <zacharycarter> type mismatch: got (Future[system.string]) ⏎ ⏎ but expected one of: ⏎ proc await(fv: FlowVarBase) ⏎ proc await(fv: FlowVarBase) ... [https://gitter.im/nim-lang/Nim?at=59a711aeee5c9a4c5f178550] |
19:27:59 | Yardanico | because you didn't import asyncdispatch :D |
19:28:03 | Yardanico | "import asyncdispatch" |
19:28:03 | FromGitter | <zacharycarter> oh |
19:28:07 | Yardanico | oh wait |
19:28:11 | Yardanico | do you want to use threads? |
19:28:14 | FromGitter | <zacharycarter> yeah |
19:28:15 | Yardanico | or async? |
19:28:18 | FromGitter | <zacharycarter> oh wait |
19:28:19 | FromGitter | <zacharycarter> duh |
19:28:21 | FromGitter | <zacharycarter> :P |
19:28:23 | FromGitter | <zacharycarter> thanks |
19:28:30 | Yardanico | with async you need "asyncdispatch", not "threadpool" |
19:28:47 | FromGitter | <zacharycarter> I gotcha, i'm just being stupid thanks Tiberium |
19:28:51 | Yardanico | well it would still throw an error |
19:29:01 | Yardanico | because you can use "await" only inside of a async proc |
19:29:26 | FromGitter | <zacharycarter> gotcha |
19:29:42 | FromGitter | <Yardanico> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59a71226ee5c9a4c5f1787c1] |
19:29:53 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
19:30:54 | FromGitter | <zacharycarter> awesome thank you |
19:31:08 | FromGitter | <Yardanico> and you don't need experimental too :) |
19:34:39 | FromGitter | <zacharycarter> this is really what I'm trying to do |
19:34:45 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59a71355ba0f0f6e38fd520c] |
19:34:50 | FromGitter | <zacharycarter> but I don't know if it's possible |
19:35:58 | FromGitter | <Yardanico> well you can do that with async too I think |
19:36:16 | FromGitter | <Yardanico> but only if you don't need to do heavy computations |
19:37:07 | FromGitter | <zacharycarter> hrm |
19:38:22 | FromGitter | <Yardanico> I don't know if httpclient is thread-safe |
19:38:30 | FromGitter | <Yardanico> if it is - you can use your code like this |
19:38:43 | FromGitter | <Yardanico> like you wrote it |
19:39:36 | FromGitter | <zacharycarter> gotcha |
19:40:08 | Yardanico | how can I profile memory usage of my application to see what takes RAM? |
19:43:37 | Yardanico | I've tried to use massif, but it only shows heap usage, which is ~100-200kb for my app (is this very bad?). My app usually uses 8-20mb ram, I know this is not much, but I really want to know what takes it :) |
19:50:51 | FromGitter | <zacharycarter> hmm I guess httpclient isn't gcsafe |
19:51:09 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59a7172c162adb6d2e4ed6eb] |
19:51:10 | FromGitter | <zacharycarter> doesn't work |
19:51:29 | FromGitter | <Yardanico> because you're trying to use global variable |
19:51:35 | FromGitter | <zacharycarter> oh |
19:51:38 | FromGitter | <Yardanico> global variables |
19:52:15 | FromGitter | <zacharycarter> okay yeah I got it now thanks |
19:54:05 | * | couven92 joined #nim |
19:58:54 | * | gangstacat quit (Quit: Leaving) |
20:01:18 | Yardanico | hmm, I googled a bit.. so there's no way to actually see what objects in my app take most of RAM? |
20:01:41 | * | mahmudov joined #nim |
20:01:47 | FromGitter | <zacharycarter> not sure |
20:01:58 | FromGitter | <zacharycarter> I can only help with osx :/ |
20:02:48 | FromGitter | <zacharycarter> wondering why I'm getting different output from these 2 snippets |
20:03:22 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59a71a0a9acddb2407e6c080] |
20:03:46 | * | Serenitor joined #nim |
20:04:55 | FromGitter | <zacharycarter> I think I get it |
20:06:45 | * | StephenLynx joined #nim |
20:07:04 | StephenLynx | I was curious, does nim actually compiled a binary on its own or it can just transpile to another language? |
20:07:10 | StephenLynx | actually compiles* |
20:08:01 | Yardanico | StephenLynx, compilation = transpiling |
20:08:14 | Yardanico | because you can say that Rust "transpiles" to LLVM |
20:08:18 | Yardanico | *LLVM IR |
20:08:19 | PMunch | It compiles (not transpiles) to C, which is then turned into a binary by your compiler of choice |
20:08:28 | StephenLynx | how does it compiles to C? |
20:08:42 | StephenLynx | it generates C source or binary objects? (.o)? |
20:08:45 | Yardanico | StephenLynx, no |
20:08:48 | PMunch | C source |
20:08:54 | StephenLynx | so it transpiles to C. |
20:08:54 | Yardanico | StephenLynx, it creates C/C++/Objective C source code |
20:09:01 | StephenLynx | and C++ |
20:09:04 | PMunch | Compiles* |
20:09:06 | Yardanico | and Objective C |
20:09:22 | Araq | no, it *compiles*, C does not "transpile" to Assembler either. |
20:09:34 | StephenLynx | how is it a compilation if the source code has to be compiled? |
20:09:40 | PMunch | Compiling is the general term for taking source code written in one language and transforming into another. |
20:09:40 | PMunch | Transpiling is a specific term for taking source code written in one language and transforming into another language that has a similar level of abstraction. |
20:09:58 | StephenLynx | so when you take nim code and get C code is just transpiling, right? |
20:09:59 | PMunch | Source: https://www.stevefenton.co.uk/2012/11/compiling-vs-transpiling/ |
20:10:03 | Yardanico | StephenLynx, no |
20:10:24 | Araq | "transpiling" is a verb with no sane semantics |
20:10:35 | Araq | and worse, it's super ugly. |
20:10:37 | Yardanico | A compiler is computer software that transforms computer code written in one programming language (the source language) into another computer language (the target language). |
20:10:53 | Yardanico | source language: Nim, target language: C |
20:10:55 | PMunch | Nope, when you compile to C it evaluates macros and templates, does compile time bounds checking etc. etc. etc. Thus the resulting C code is not at the same level of abstraction, it's lower |
20:11:59 | Yardanico | how many times will people ask "why nim transpiles to C?" |
20:12:07 | PMunch | Look at it this way, transpile is translating a sentence from English to French, compiling is translating a sentence from English to something a child could understand in English. |
20:13:29 | StephenLynx | please go on, all this mental gymnastic is quite the spectacle. |
20:13:51 | Araq | "transpile" is no word, there is "compile" and "translate" and translate is an umbrella term |
20:14:34 | StephenLynx | I find it funny you think its a different level of abstraction when its on the same. you give it human readable code and get human readable code. |
20:14:51 | StephenLynx | by your logic, a library is a lower level of abstraction. |
20:15:05 | Yardanico | StephenLynx, well, asm is human-readable too :) |
20:16:06 | StephenLynx | i could also argue that asm is not portable. |
20:16:08 | StephenLynx | C is. |
20:16:36 | * | StephenLynx left #nim (#nim) |
20:17:03 | Arrrr | lol |
20:17:20 | Arrrr | you transpiled him into a ban |
20:17:27 | Yardanico | xD |
20:17:30 | FromGitter | <xmonader> Do we really have to exhaustively match cases in nim? for instance parsing with parseargs2 library? |
20:17:45 | couven92 | I liked your French analogy PMunch! :) |
20:17:50 | FromGitter | <xmonader> Ocaml displays a warning if you don't match enough |
20:18:06 | Yardanico | xmonader: what library do you mean? |
20:18:18 | Araq | I have a bad headache so my tolerance for trolls is low, sorry :P |
20:18:43 | FromGitter | <zacharycarter> I could still use help here - trying to make http requests in parallel and banging my head against the wall |
20:18:47 | couven92 | Araq, that's fine... Go make youself a cup of tea! :) |
20:19:14 | FromGitter | <xmonader> @Yardanico sorry, I meant parseopts2 |
20:19:40 | Yardanico | oh, you don't need to match all cases |
20:19:42 | Araq | xmonader: use an 'else: discard' branch in your case statement? |
20:19:44 | Yardanico | just add "else: discard" |
20:19:49 | Araq | yep. |
20:20:15 | Araq | zacharycarter, hey, what's the problem? |
20:20:19 | * | Yardanico quit (Remote host closed the connection) |
20:20:36 | FromGitter | <zacharycarter> I just don't get how to do this Araq: |
20:20:45 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59a71e1dba0f0f6e38fd889f] |
20:20:48 | FromGitter | <zacharycarter> or something similar to it |
20:20:58 | * | tdc quit (Ping timeout: 246 seconds) |
20:21:00 | FromGitter | <xmonader> Really? Didn't thought that was allowed because it was practical example from the docs https://nim-lang.org/docs/parseopt2.html |
20:21:11 | FromGitter | <xmonader> but totally makes sense. Thank you guys :) |
20:21:35 | * | Sentreen quit (Ping timeout: 240 seconds) |
20:22:39 | FromGitter | <xmonader> Also, I really want to say, I love the pascal influence in the language design. It's one of the main reasons I decided to give nim a shot :) |
20:23:19 | Araq | zacharycarter: parallel likes to analyse things and that means you should wrap stuff in a main proc to help the analyser |
20:24:19 | Araq | but your code is not gcsafe at all, seems easy enough to make it so though |
20:24:36 | FromGitter | <zacharycarter> okay |
20:24:37 | FromGitter | <zacharycarter> I'll do that |
20:24:46 | FromGitter | <zacharycarter> thanks |
20:25:04 | Araq | instead of 'i' pass compCodes[index] to your getDealerProfile |
20:25:26 | Araq | so that getDealerProfile doesn't access eligibleDealerCompCodes |
20:25:41 | FromGitter | <zacharycarter> gotcha |
20:26:36 | PMunch | Haha Araq, poor guy :P |
20:26:39 | * | vlad1777d joined #nim |
20:26:40 | PMunch | couven92, thanks :) |
20:26:52 | FromGitter | <zacharycarter> thanks for the help Araq: hope the headache gets better |
20:27:25 | Araq | well it's a flu, but thanks |
20:28:34 | * | rosshadden quit (Quit: WeeChat 1.9) |
20:30:17 | couven92 | Araq, Gute Besserung! :) |
20:30:29 | Araq | danke danke |
20:30:57 | PMunch | Oh couven92, we should start preparing our talk on Nim |
20:31:06 | PMunch | Did we ever set a date for it? |
20:31:10 | FromGitter | <ephja> `static: for x in [1, 2, 3, ...]: f(x)` where `f` takes a `static[int]` is broken, right? |
20:31:21 | FromGitter | <ephja> I wonder if it works with an intermediate const |
20:31:42 | couven92 | no, but I keep telling TD that we're going to do it, I'd say aim for beginning october |
20:33:03 | PMunch | I vote for not the first week but the second |
20:33:16 | PMunch | So 9-13th |
20:33:55 | couven92 | Fine by me... But the week after that I gotta teach low-level tech to some high school teachers |
20:34:24 | couven92 | And we also need to deliver our M.Scs! Anders wants to see you! :P |
20:34:36 | PMunch | Then he should tell me -_- |
20:34:50 | * | Sentreen joined #nim |
20:34:57 | PMunch | That's why I said we should aim for second week, to give us at least one week of prep |
20:35:08 | couven92 | +1 |
20:38:46 | * | relax joined #nim |
20:39:16 | couven92 | PMunch, I was actually thinking... How do we create an easy task for people to actually learn something about macros? |
20:39:56 | PMunch | Wait, are we doing a workshop or a talk? |
20:40:41 | couven92 | both! I talk (it's what I do best) and you can pet people while they work on a workshop-task :P |
20:41:24 | couven92 | I actually dunno... workshop would be nice though... But it's... WORK! :P |
20:42:37 | couven92 | I mean, look at your Functional programming talk.... Everybody loved it and lot of people said "yeah, I should totally start to do functional programming" |
20:43:26 | couven92 | But ultimately, they still just stick to their python, because nobody feels that they have the time to learn a new language |
20:43:48 | PMunch | True |
20:44:05 | PMunch | So an hour talk as an introduction, and then some workshop stuff after that? |
20:44:22 | PMunch | Talked to the university about pizza? Or TD? |
20:44:30 | PMunch | Maybe we should move this to a PM by the way :P |
20:45:16 | couven92 | Yeha, sorry people! We aren't trolls! :P (Don't hurt us Araq :D ) |
20:45:18 | dom96 | ooh |
20:45:24 | dom96 | feel free to discuss it here |
20:45:31 | dom96 | I'm interested :) |
20:46:04 | couven92 | PMunch, TD got lot's of money, so pizza should work out fine, even if IFI didn't sponsor us :P |
20:47:09 | couven92 | "panem et circenses" it's important, right? :D |
20:47:36 | PMunch | Haha, we supply the circus, they supply the bread? |
20:47:59 | FromGitter | <zacharycarter> alright |
20:48:09 | FromGitter | <zacharycarter> I ditched threadpool and moved to async / await |
20:48:18 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59a72492162adb6d2e4f130e] |
20:48:23 | FromGitter | <zacharycarter> still not working |
20:48:36 | FromGitter | <zacharycarter> getting a sigsev error from that |
20:49:10 | couven92 | dom96, got an idea how to get an obvious but simple macro application into a beginners workshop? |
20:50:01 | PMunch | Maybe a simple DSL? |
20:50:09 | couven92 | alternatively, just do templates with OOP stuff (like in the manual) and just don't do macros |
20:50:13 | PMunch | Something like the JSON example from the docs? |
20:50:35 | dom96 | Maybe a HTML generator DSL? |
20:51:57 | couven92 | Hmm... we've had so many Web-focused workshops at UiT in the last year, so I kinda wanted to do sth not web-related... |
20:52:23 | couven92 | (But that's just me, though) |
20:52:27 | PMunch | Yeah, I think a lot of people at UiT are more focused on low-level stuff anyways |
20:52:39 | couven92 | yup |
20:53:21 | couven92 | we're teaching C from the 1st semester, so definitely low-level people! :D |
20:55:56 | PMunch | dom96, a HTML generator DSL is nice. But it only returns strings, which is a bit boring. |
20:56:12 | PMunch | The genui macro is pretty cool, but a bit complex.. |
20:58:07 | * | relax quit (Ping timeout: 248 seconds) |
20:59:03 | Araq | zacharycarter, ok but now it's dom96's turn, not mine |
21:00:05 | FromGitter | <zacharycarter> |
21:00:08 | * | livcd quit (Ping timeout: 240 seconds) |
21:00:37 | dom96 | zacharycarter: stack trace? |
21:01:11 | * | livcd joined #nim |
21:01:32 | FromGitter | <zacharycarter> I just got in the car as soon as I get home I'll post it and ping you |
21:10:28 | claudiuinberlin | I found `*` idea to mark procedures and type as public strange :) |
21:10:40 | claudiuinberlin | I was think a, look ma'am pointers |
21:10:41 | claudiuinberlin | :)) |
21:11:00 | PMunch | Yeah it takes a little bit getting used to |
21:11:19 | Araq | when I learned C, I thought "huh, multiplications everywhere" |
21:11:26 | claudiuinberlin | :)) |
21:11:31 | couven92 | Nice! :D |
21:11:34 | PMunch | Yeah, C is also very confusing with pointers :P |
21:11:59 | claudiuinberlin | also, proc instead of def like all the other people :d |
21:12:02 | claudiuinberlin | joking here |
21:12:15 | PMunch | Well, that actually makes more sense |
21:12:18 | claudiuinberlin | fn, fun, function, def, proc |
21:12:33 | PMunch | I've started calling them procedures now :P |
21:12:44 | PMunch | And reserving function for, well, functions |
21:12:53 | couven92 | don't forget Pascal and Delphi that distiguish between procedure and function! :P |
21:12:59 | claudiuinberlin | yes |
21:13:08 | claudiuinberlin | I was thinking about this |
21:13:08 | claudiuinberlin | :)) |
21:13:28 | PMunch | Araq, the func keyword is still planning to be added right? |
21:13:41 | claudiuinberlin | why not def then |
21:13:42 | claudiuinberlin | and public |
21:13:45 | couven92 | what do we want for func? |
21:13:51 | couven92 | pure functions? |
21:13:54 | claudiuinberlin | anyway, did the chat app from the book |
21:13:54 | PMunch | proc {.noSideEffect.} |
21:14:01 | claudiuinberlin | simple language |
21:14:08 | claudiuinberlin | when I do some rust |
21:14:13 | claudiuinberlin | I fell dump after 30 minutes |
21:14:32 | Araq | PMunch: I am not sure about its semantics |
21:14:46 | PMunch | Hmm, what do you mean? |
21:14:48 | dom96 | claudiuinberlin: enjoying the book? :D |
21:14:54 | claudiuinberlin | the book is really nice |
21:15:05 | dom96 | 'def' makes less sense when you consider what it stands for... define |
21:15:09 | dom96 | You defined variables too. |
21:15:10 | PMunch | I thought the idea was just that func should add the {.noSideEffect.} pragma |
21:15:12 | dom96 | *define |
21:15:12 | claudiuinberlin | the std chapter, I will ignore it |
21:15:20 | claudiuinberlin | as I can read the documentation by myself :) |
21:15:29 | dom96 | claudiuinberlin: Sure, feel free. |
21:15:40 | claudiuinberlin | but really nice |
21:16:01 | claudiuinberlin | my goal is to make some deploy tool :) |
21:16:06 | dom96 | I'd be interested to hear the gaps in knowledge that programmers who have only read my book have |
21:16:15 | dom96 | so that I can write some articles hopefully fill that gap :) |
21:16:17 | claudiuinberlin | we are using not, dokku and in the past, mina-deploy |
21:16:25 | couven92 | dom96, Sorry I am planning on stealing the book from PMunch from time to time... I have no bookshelf in my small little room... :( |
21:16:48 | PMunch | couven92, get the e-book version ;) |
21:16:55 | claudiuinberlin | yes, much better |
21:17:00 | dom96 | couven92: heh, that's fine. |
21:17:06 | PMunch | Then you can print it page by page and use the read pages as kindling for the winter :) |
21:17:12 | claudiuinberlin | :)) |
21:17:28 | claudiuinberlin | you can use kindle and use it as a book |
21:17:31 | couven92 | there is one? Yeah, ebook would be fine |
21:17:40 | claudiuinberlin | just turn the kindle, everytime you finish the page |
21:17:56 | FromGitter | <xmonader> Quick question, If I created a macro that generates data classes would be less performant than tuples? |
21:17:57 | claudiuinberlin | the book will be finishi this eyar? |
21:18:18 | PMunch | claudiuinberlin, it is finished. Have a nice physical copy right next to me |
21:18:30 | * | vlad1777d quit (Ping timeout: 252 seconds) |
21:18:31 | claudiuinberlin | well mine says MEAP |
21:18:33 | claudiuinberlin | version1- |
21:18:36 | claudiuinberlin | 10 |
21:19:00 | couven92 | yes, dom96, PMunch actually brought his copy with him the other day when he came over... And it's so nice, that I want to honor it with a proper special place which I don't have :P |
21:19:09 | claudiuinberlin | and I just take it few hour ago |
21:19:34 | PMunch | Hmm, seems like the Manning page is down :( |
21:19:57 | dom96 | couven92: :D |
21:20:35 | dom96 | xmonader: Depends what code the macro generates. |
21:20:47 | dom96 | claudiuinberlin: It's already finished. |
21:20:57 | claudiuinberlin | well it shows meap for me |
21:21:04 | dom96 | You might want to check for a new version on Manning's site |
21:21:15 | claudiuinberlin | hmm |
21:21:24 | claudiuinberlin | I get it 2 hours ago :) |
21:21:28 | FromGitter | <xmonader> @dom96 a ref object with fields/properties |
21:21:38 | claudiuinberlin | I dont think is a new versions from that time |
21:22:18 | dom96 | claudiuinberlin: weird, might want to contact Manning support |
21:22:25 | claudiuinberlin | i will |
21:22:31 | claudiuinberlin | when the site is up :) |
21:22:38 | claudiuinberlin | there is not much oop in the book |
21:22:47 | claudiuinberlin | as I can see, or in mine version of book |
21:22:58 | dom96 | yep, there is none in fact. |
21:23:14 | dom96 | xmonader: should be performant. |
21:23:43 | FromGitter | <xmonader> Perfect ^_^ |
21:23:43 | claudiuinberlin | is nim better as more to procedural and functional, than oop? |
21:24:23 | FromGitter | <xmonader> Is there a channel for the internal development of nim/contributions? or all through this channel? |
21:24:34 | couven92 | all here |
21:24:51 | couven92 | we got #nim-offtopic on IRC though |
21:25:03 | FromGitter | <xmonader> I've a high interest in Nim as I'm trying to convince my current company to embrace it |
21:25:28 | PMunch | Cool, what kind of company? |
21:25:41 | FromGitter | <xmonader> Also, I'm trying to write a book in my native language about nim "arabic" |
21:26:08 | couven92 | yeah, getting enterprise traction for Nim certainly wouldn't hurt... But beware, we're not in 1.0 yet |
21:26:14 | FromGitter | <xmonader> @PMunch It's called greenItGlobe |
21:26:36 | couven92 | waht do you do? |
21:26:39 | FromGitter | <xmonader> @couven92 actually we tried to use it for some internal project as a kickstarter, but we faced bit of problems there |
21:26:55 | couven92 | what kind of problems? |
21:27:17 | FromGitter | <xmonader> @couven92 mainly, cloud provider, also we got our own container system |
21:27:33 | PMunch | Cool, cool! Well, I'm off |
21:27:34 | * | PMunch quit (Quit: leaving) |
21:27:42 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:28:07 | couven92 | okay... cool! We were thinking about how we would go about getting Nim into an AWS lamda (or similar) |
21:28:50 | FromGitter | <xmonader> Mainly we use go, but I've people in support of nim, but not hitting 1.0 was a turn off also some problems with the maturity of the libraries, but I really appreciate the effort |
21:29:07 | FromGitter | <xmonader> @couven92 It'd be such a great idea |
21:29:36 | FromGitter | <Yardanico> couven92: I heard @zacharycarter used nim in aws lambda |
21:29:57 | * | claudiuinberlin joined #nim |
21:30:18 | couven92 | yes, but I never heard how far he had come |
21:30:32 | FromGitter | <xmonader> I wish for more success story and How the community are using it |
21:31:05 | * | vlad1777d joined #nim |
21:31:07 | couven92 | @xmonader Nim in general, or the particular cloud bit? |
21:31:26 | FromGitter | <Yardanico> https://aws.amazon.com/ru/blogs/compute/running-executables-in-aws-lambda/ |
21:31:54 | FromGitter | <Yardanico> Lambda’s built-in sandbox lets you safely run code written in any language |
21:33:10 | FromGitter | <xmonader> @couven92 we do lots of systems programming and tools which are dominated by go in the company, and I'd like to change that |
21:34:19 | couven92 | I see... so for you our work on asyn/await and multithreading is probably the most interesting? |
21:35:10 | FromGitter | <xmonader> @couven92 Yup |
21:35:20 | * | Arrrr quit (Read error: Connection reset by peer) |
21:36:31 | FromGitter | <xmonader> Also the key value store, we had lots of problems with something like sophiadb, we ran into all kinds of problems back then also with redis library .. main libraries should be stabilized :S |
21:37:37 | * | nsfw_ quit (Quit: Leaving.) |
21:37:37 | FromGitter | <xmonader> I'm off work for 4 days and I'd like to do some POCs in nim |
21:38:11 | FromGitter | <zacharycarter> @couven92 @Yardanico I got a nim program running in lambda |
21:39:10 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
21:39:13 | FromGitter | <xmonader> @zacharycarter Interesting, did you document that process? I bet many would be interested in such |
21:39:41 | FromGitter | <zacharycarter> I haven't @xmonader I could write a blog post about how I did it, although I still have some improvements to make in the overall solutioning |
21:40:08 | FromGitter | <zacharycarter> for instance right now I'm just uploading a binary file and executing it with a python script, ideally we'd do something like golang and compile the nim program to a shared library and use dlopen / dlclose to interact with it |
21:40:14 | * | relax joined #nim |
21:40:17 | FromGitter | <zacharycarter> that way we could pass around lambda job contexts as wel |
21:40:20 | FromGitter | <zacharycarter> well* |
21:41:08 | FromGitter | <xmonader> @zacharycarter It'd be great. Thank you ^_^ |
21:41:12 | * | Sentreen quit (Ping timeout: 240 seconds) |
21:41:28 | FromGitter | <zacharycarter> I need a blog :P |
21:41:56 | couven92 | damn! This is where the Nim community is so dangerous! So many exiciting things where you can be a part of! I am really diverting way too much time from my M.Sc. as it is :( |
21:42:07 | * | Zevv left #nim (#nim) |
21:43:43 | FromGitter | <zacharycarter> getting Nim into aws lambda is pretty simple |
21:43:49 | couven92 | nim was my first time ever I had worked OpenSource in a community... AND IT'S SO MUCH FUN working with you guys! :D |
21:43:52 | FromGitter | <xmonader> This is why the company paused it's nim adaption https://github.com/recoilme/pudge |
21:44:29 | FromGitter | <zacharycarter> You compile your nim program with docker against AWS linux |
21:44:57 | FromGitter | <zacharycarter> then you write a python module to execute your nim program |
21:45:29 | FromGitter | <zacharycarter> then you zip up your binary and python script and upload them :P |
21:45:56 | FromGitter | <zacharycarter> I'm trivializing these steps as they're not 100% straightforward but it's not a huge task I figured it out in an afternoon |
21:48:10 | FromGitter | <xmonader> @zacharycarter It makes sense. Thank you ^_^ |
21:50:12 | FromGitter | <zacharycarter> np! |
21:50:36 | FromGitter | <zacharycarter> soon as I get time to start a blog I'll write a post :) |
21:50:51 | FromGitter | <zacharycarter> @dom96 : |
21:50:57 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59a73341c101bc4e3a734d9d] |
21:51:45 | dom96 | xmonader: wow, what is this, it's the first time I've seen it. |
21:52:16 | dom96 | zacharycarter: no, Nim stack trace |
21:52:21 | FromGitter | <zacharycarter> there is no stack trace |
21:52:25 | FromGitter | <zacharycarter> it just segfaults :/ |
21:52:32 | dom96 | there is always a stack trace |
21:52:35 | FromGitter | <xmonader> @dom96 Are you talking about pudge? |
21:52:40 | dom96 | xmonader: yep |
21:53:07 | dom96 | xmonader: btw, if you're up for it, you could ask my publisher about translating Nim in Action into Arabic. |
21:53:41 | * | JStoker quit (Ping timeout: 255 seconds) |
21:54:16 | * | Sentreen joined #nim |
21:54:21 | FromGitter | <zacharycarter> weird previously I wasn't getting anything now I am |
21:54:34 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59a7341a210ac26920db528c] |
21:54:51 | FromGitter | <xmonader> @dom96 It's using sophiadb internally, it was nice and the original caller for nim in the company asked a team to use it for a certain project, and they ran into all kinds of errors with it for edge cases |
21:55:31 | dom96 | zacharycarter: that should help you debug it :) |
21:55:42 | * | JStoker joined #nim |
21:55:50 | FromGitter | <xmonader> @dom96, About the book, Sure, I was having in mind a fast paced tutorial/book with maybe 1 or 2 practical examples |
21:55:51 | dom96 | xmonader: it's not even written in Nim :( |
21:56:33 | FromGitter | <xmonader> pudge is, sophia is interfaced from c code |
21:57:04 | dom96 | yeah, it's just a wrapper |
21:58:43 | FromGitter | <xmonader> Do you guys have some ideas for some interesting ideas to be done in nim? |
21:59:37 | FromGitter | <zacharycarter> graphql library! |
21:59:40 | FromGitter | <zacharycarter> oh 4 days |
21:59:41 | FromGitter | <zacharycarter> hrm |
22:00:45 | FromGitter | <zacharycarter> I'd be impressed with any non trivial async / await or threading examples |
22:00:51 | * | Sentreen quit (Ping timeout: 252 seconds) |
22:00:51 | FromGitter | <zacharycarter> as that seems to be what I struggle with the most with Nim |
22:01:00 | FromGitter | <xmonader> Actually I was working with graph.cool the last couple of days and it's amazing -> definitely should try to do something with nim framework and graphql requests |
22:01:29 | FromGitter | <xmonader> Didn't try async/await in nim yet, but I really hope it's not half baked as in python :( |
22:03:42 | dom96 | zacharycarter: read my book? |
22:03:50 | FromGitter | <zacharycarter> I need to |
22:03:57 | FromGitter | <zacharycarter> I'm bringing it camping this weekend with me |
22:06:06 | dom96 | Awesome, but I'd recommend following the examples as you read it |
22:07:10 | FromGitter | <zacharycarter> gotcha |
22:07:12 | FromGitter | <zacharycarter> I'll start tonight then |
22:13:41 | * | Sentreen joined #nim |
22:16:00 | * | relax quit (Ping timeout: 248 seconds) |
22:26:49 | FromGitter | <xmonader> @dom96 what's the state of this one? https://nim-lang.org/docs/asyncdispatch.html I see lots of "doesn't work" and "doesn't support" |
22:27:48 | dom96 | State is that it's ready for production but it's still in flux. |
22:28:17 | dom96 | You have to make some sacrifices for it sometimes, like not using a `try ... catch` |
22:28:31 | dom96 | but checking for errors inside a Future using an `if` |
22:30:48 | FromGitter | <xmonader> Hmm I need to try that out |
22:31:20 | FromGitter | <xmonader> Do you consider something like monads or go error style for nim? I see you already have option data type |
22:31:40 | dom96 | I do like exceptions |
22:31:59 | FromGitter | <xmonader> Me too. If it can be used everywhere. |
22:34:39 | FromGitter | <xmonader> I've to get some sleep. Thank you guys for the amazing effort and for answering my questions. See ya tmw |
22:38:14 | * | relax joined #nim |
22:40:31 | * | BitPuffin|osx quit (Ping timeout: 248 seconds) |
22:46:11 | * | nsf quit (Quit: WeeChat 1.9) |
22:49:48 | * | vlad1777d quit (Remote host closed the connection) |
22:54:36 | * | couven92 quit (Quit: Client Disconnecting) |
23:04:21 | FromGitter | <zacharycarter> I need to figure out how to upload a file to a s3 bucket |
23:05:49 | FromGitter | <zacharycarter> should be simple enough with just http client |
23:06:02 | * | loc8 joined #nim |
23:07:33 | FromGitter | <zacharycarter> I wish https://github.com/aidansteele/aws_sdk.nim were further along |
23:08:55 | * | loc8_ quit (Ping timeout: 276 seconds) |
23:09:42 | * | relax quit (Ping timeout: 240 seconds) |
23:11:14 | * | relax joined #nim |
23:15:19 | FromGitter | <FridgeSeal> Oh yeah I'm dropping back to Python to handle doing AWS things in my lambda function. |
23:18:49 | FromGitter | <zacharycarter> hrm |
23:19:35 | FromGitter | <zacharycarter> I've written an ET... process. Trying to get the L part working |
23:19:37 | FromGitter | <zacharycarter> :P |
23:19:41 | FromGitter | <FridgeSeal> Hahahaha |
23:19:59 | FromGitter | <zacharycarter> I wonder if there's a C aws sdk library I can wrap |
23:20:12 | FromGitter | <FridgeSeal> I was just about to ask if there was a C library... |
23:20:41 | FromGitter | <zacharycarter> https://github.com/aws/aws-sdk-cpp |
23:20:46 | FromGitter | <zacharycarter> looks like this is it |
23:20:57 | FromGitter | <FridgeSeal> Just beat me to it. |
23:22:03 | FromGitter | <zacharycarter> @Varriount was working on a Nim AWS project, not sure if he's stalled on that or not, I know he has school starting up soon |
23:23:03 | FromGitter | <Varriount> As soon as someone comes up with a way to go without sleep, I can work on it again |
23:23:23 | FromGitter | <zacharycarter> :P |
23:23:45 | * | Pisuke quit (Ping timeout: 248 seconds) |
23:23:58 | FromGitter | <zacharycarter> bleh who knew uploading to s3 could be such a PITA without a client sdk library |
23:24:24 | FromGitter | <FridgeSeal> I know right |
23:24:28 | FromGitter | <Varriount> The CPP library will be very hard to wrap, as it uses boost and lots of templates |
23:24:52 | FromGitter | <Varriount> I was talking a pure-Nim approach. |
23:24:52 | FromGitter | <zacharycarter> yeah I gave up as soon as I looked at it |
23:25:01 | FromGitter | <zacharycarter> which is ideal for sure |
23:25:17 | FromGitter | <zacharycarter> I wasn't aware of - https://github.com/aidansteele/aws_sdk.nim before |
23:25:21 | FromGitter | <zacharycarter> but it's totally incomplete |
23:25:26 | FromGitter | <zacharycarter> all it can do atm I believe is list buckets |
23:25:49 | FromGitter | <Varriount> I have type generation from JSON api schemas done, however authentication is still a work in progress |
23:26:08 | FromGitter | <zacharycarter> gotcha |
23:26:58 | FromGitter | <Varriount> Did I mention that there are around 6 different ways to make API requests, and each services may only support some of those ways? |
23:27:14 | FromGitter | <zacharycarter> no but it sounds about right / as hellacious as AWS seems |
23:27:17 | FromGitter | <FridgeSeal> Wow, this already sounds like a nightmare |
23:27:49 | FromGitter | <Varriount> I still want to work on the library, but it's definitely not a one-week project |
23:28:01 | FromGitter | <zacharycarter> yeah |
23:30:06 | FromGitter | <zacharycarter> not being able to upload / retrieve from s3 though is going to kill my solution here / probable chances of using Nim at work |
23:30:07 | FromGitter | <zacharycarter> grrr |
23:31:55 | * | arnetheduck joined #nim |
23:34:07 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:35:44 | FromGitter | <Varriount> Use the AWS s3 command line tools |
23:36:18 | FromGitter | <zacharycarter> well that's an option for uploading it |
23:36:25 | FromGitter | <zacharycarter> but also introduces a huge dependency |
23:36:58 | FromGitter | <Varriount> Use a C++ program and export a function? |
23:37:10 | FromGitter | <zacharycarter> that could work |
23:38:16 | FromGitter | <Varriount> There *is* a pure C aws mini-sdk |
23:38:24 | FromGitter | <zacharycarter> oooo |
23:38:35 | FromGitter | <Varriount> It's not complete, but it's for embedded devices |
23:38:52 | FromGitter | <zacharycarter> oh duh I know what I'll do |
23:38:55 | FromGitter | <zacharycarter> muhahaha |
23:39:00 | FromGitter | <Varriount> ...? |
23:39:04 | FromGitter | <zacharycarter> nodejs to the rescue |
23:39:22 | FromGitter | <Varriount> ? |
23:39:37 | FromGitter | <zacharycarter> I already have my program to extract and transform and produce a file for loading |
23:39:50 | FromGitter | <zacharycarter> so I'll use the aws node sdk and just bind to that |
23:39:56 | FromGitter | <zacharycarter> and then run everything from nimscript |
23:39:59 | FromGitter | <zacharycarter> maybe |
23:40:47 | FromGitter | <zacharycarter> ehh |
23:40:51 | FromGitter | <zacharycarter> a better option might just be using a shell script |
23:41:27 | FromGitter | <Varriount> Python. ;D |
23:41:45 | FromGitter | <zacharycarter> Either way I'll need node or python or something else installed bleh |
23:42:39 | FromGitter | <zacharycarter> I'm more likely to have access to node than python |
23:42:57 | FromGitter | <zacharycarter> someone is just going to scream at me though "WHY DON'T YOU JUST USE JAVA?" |
23:44:03 | FromGitter | <zacharycarter> I'm actually okay with the node + nim solution because we'd be writing this in NodeJS anyway |
23:44:17 | FromGitter | <zacharycarter> and it's the performant part that's written in Nim which is the part that matters |
23:58:41 | FromGitter | <FridgeSeal> I was lucky enough that I only need to post a single thing to S3, so I could change the structure so that nim does all the work and then python just uploads the result at the end. :) |
23:59:20 | FromGitter | <zacharycarter> nice! |