00:01:35 | * | relax quit (Ping timeout: 240 seconds) |
00:34:11 | * | SusWombat quit (Remote host closed the connection) |
00:34:46 | * | SusWombat joined #nim |
00:39:04 | FromGitter | <zacharycarter> got signed distance field font rendering working with zengine |
00:42:33 | * | renarc joined #nim |
01:05:37 | * | gokr quit (Ping timeout: 260 seconds) |
01:16:52 | * | couven92 quit (Quit: Client Disconnecting) |
01:25:53 | * | arnetheduck quit (Ping timeout: 248 seconds) |
01:34:33 | * | zachk joined #nim |
01:35:02 | * | zachk quit (Quit: night) |
01:50:25 | * | Serenitor joined #nim |
01:52:15 | Serenitor | is there something like isInf similar to isNil to check for infinite? |
01:53:14 | * | Nobabs27 joined #nim |
01:57:21 | * | Nobabs27 quit (Client Quit) |
01:57:45 | * | chemist69 quit (Ping timeout: 246 seconds) |
02:08:39 | Serenitor | nvm, I can do val == Inf |
02:10:24 | * | chemist69 joined #nim |
02:16:28 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
02:43:17 | * | dddddd quit (Remote host closed the connection) |
02:58:01 | * | Serenit0r joined #nim |
03:01:21 | * | Serenitor quit (Ping timeout: 240 seconds) |
03:10:00 | * | endragor joined #nim |
03:20:15 | * | vlad1777d quit (Remote host closed the connection) |
03:29:25 | Demos[m] | is there a way to tell nimble to not install dependencies? |
04:08:13 | * | jsgrant left #nim (#nim) |
04:08:50 | * | jsgrant joined #nim |
04:17:57 | * | haha_ quit (Quit: haha_) |
04:33:10 | * | renarc quit (Remote host closed the connection) |
04:37:21 | * | Ven`` joined #nim |
04:39:35 | * | shashlick quit (Ping timeout: 255 seconds) |
04:46:42 | * | Ven`` quit (Ping timeout: 260 seconds) |
04:47:35 | * | SusWombat quit (Quit: Leaving) |
04:48:39 | * | BigEpsilon joined #nim |
04:59:19 | * | Serenit0r quit (Quit: Leaving) |
05:07:40 | * | Vladar joined #nim |
05:20:13 | * | renarc joined #nim |
05:37:35 | * | BigEpsilon quit (Ping timeout: 240 seconds) |
06:02:26 | * | BigEpsilon joined #nim |
06:05:24 | * | chemist69 quit (*.net *.split) |
06:05:24 | * | crem quit (*.net *.split) |
06:05:25 | * | Jipok[m] quit (*.net *.split) |
06:05:25 | * | MrAxilus[m] quit (*.net *.split) |
06:05:25 | * | beatmox quit (*.net *.split) |
06:05:25 | * | zielmicha_ quit (*.net *.split) |
06:05:26 | * | Nikky quit (*.net *.split) |
06:05:26 | * | Lord_Nightmare quit (*.net *.split) |
06:05:26 | * | JStoker quit (*.net *.split) |
06:05:26 | * | euantor quit (*.net *.split) |
06:05:26 | * | surma quit (*.net *.split) |
06:05:26 | * | LyndsySimon quit (*.net *.split) |
06:05:42 | * | Lord_Nightmare joined #nim |
06:05:48 | * | Nikky joined #nim |
06:05:49 | * | JStoker joined #nim |
06:06:45 | * | zielmicha_ joined #nim |
06:06:58 | * | euantor joined #nim |
06:07:39 | * | voiceftp joined #nim |
06:08:34 | * | dyce[m] quit (Ping timeout: 240 seconds) |
06:08:41 | * | Demos[m] quit (Ping timeout: 255 seconds) |
06:08:58 | * | planetis[m] quit (Ping timeout: 240 seconds) |
06:08:59 | * | jivank[m] quit (Ping timeout: 240 seconds) |
06:09:09 | * | watzon quit (Ping timeout: 255 seconds) |
06:09:09 | * | byteflame quit (Ping timeout: 246 seconds) |
06:09:22 | * | TheManiac quit (Ping timeout: 264 seconds) |
06:09:24 | * | mindB quit (Ping timeout: 246 seconds) |
06:09:41 | * | notdekka[m] quit (Ping timeout: 252 seconds) |
06:09:41 | * | hohlerde quit (Ping timeout: 252 seconds) |
06:09:45 | * | ehmry quit (Ping timeout: 246 seconds) |
06:10:52 | * | chemist69 joined #nim |
06:10:52 | * | crem joined #nim |
06:10:52 | * | beatmox joined #nim |
06:10:52 | * | surma joined #nim |
06:10:52 | * | LyndsySimon joined #nim |
06:11:19 | * | voice_ftp joined #nim |
06:13:24 | * | voice_ftp quit (Client Quit) |
06:15:22 | * | voiceftp quit (Ping timeout: 260 seconds) |
06:22:34 | * | sz0 joined #nim |
06:29:42 | * | mahsav quit (Ping timeout: 246 seconds) |
06:30:44 | * | tax quit (Ping timeout: 255 seconds) |
06:30:54 | * | nsf joined #nim |
06:31:03 | * | rauss quit (Quit: WeeChat 1.9) |
06:31:30 | * | solitudesf joined #nim |
06:31:57 | * | mahmudov joined #nim |
06:40:12 | * | PMunch joined #nim |
06:43:08 | * | Arrrr joined #nim |
06:43:08 | * | Arrrr quit (Changing host) |
06:43:08 | * | Arrrr joined #nim |
07:02:30 | * | yglukhov joined #nim |
07:05:37 | * | gmpreussner quit (Ping timeout: 248 seconds) |
07:14:32 | FromGitter | <mratsim> there is a noNimblePath flag if the dependency/package is installed but you don’t want to use it for testing |
07:15:20 | FromGitter | <mratsim> wow the C++ options is really hidden in plain sight @zacharycarter |
07:16:02 | FromGitter | <mratsim> yep working fine, cool! |
07:17:15 | * | Jipok[m] joined #nim |
07:25:44 | * | Ven`` joined #nim |
07:26:10 | * | MrAxilus[m] joined #nim |
07:26:11 | * | Demos[m] joined #nim |
07:26:11 | * | watzon joined #nim |
07:26:11 | * | ehmry joined #nim |
07:26:11 | * | mindB joined #nim |
07:26:12 | * | dyce[m] joined #nim |
07:26:17 | * | TheManiac joined #nim |
07:26:18 | * | planetis[m] joined #nim |
07:26:18 | * | notdekka[m] joined #nim |
07:26:18 | * | hohlerde joined #nim |
07:26:18 | * | jivank[m] joined #nim |
07:26:19 | * | byteflame joined #nim |
07:28:45 | * | claudiuinberlin joined #nim |
07:36:57 | * | PMunch quit (Quit: Leaving) |
07:41:22 | * | PMunch joined #nim |
07:41:31 | * | gmpreussner joined #nim |
07:48:28 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
07:48:32 | * | rusua joined #nim |
07:56:03 | * | claudiuinberlin joined #nim |
07:57:21 | * | Ven`` quit (Ping timeout: 240 seconds) |
08:00:24 | * | skrylar joined #nim |
08:01:56 | FromGitter | <Bennyelg> Gooooooooooooood Morning |
08:02:45 | FromGitter | <Bennyelg> I started today Chapter 6 in my printed Nim In Action today :) |
08:03:48 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
08:15:10 | skrylar | they don't hand out trophies for doing trivial shit |
08:15:17 | * | claudiuinberlin joined #nim |
08:15:32 | FromGitter | <Grabli66> Is there a good book about how to develop applications, which is suitable for Nim language? |
08:19:04 | FromGitter | <Grabli66> Sorry. About how to design applications. With diagrams and etc. :) |
08:23:24 | * | couven92 joined #nim |
08:23:42 | Araq | grabli66: what kind of applications? business? games? |
08:24:57 | FromGitter | <Grabli66> Client-server applications. Like web server, web service. |
08:25:25 | * | rokups joined #nim |
08:25:59 | Araq | I'm working on making karax+ormin the winning combination for these |
08:27:32 | Araq | but dom's book covers that as well |
08:29:02 | FromGitter | <Grabli66> I think, Dom's book not about how to design applications, written in Nim. |
08:29:43 | Araq | I think it does cover that and I read it 3 times... |
08:31:53 | * | sz0 quit (Quit: Connection closed for inactivity) |
08:40:22 | FromGitter | <raydf> Hi @Araq what is ormin? |
08:41:09 | FromGitter | <raydf> ok, found it in your repos |
08:42:30 | Tanger | Hey fellas. Do you all organise your code similar to how you would a C project? Are there any resources available that anybody knows of which can offer tips or methodology on the subject? |
08:44:08 | Araq | Tanger: nimble these days pretty much tells you how to setup your project |
08:45:14 | Tanger | Araq: Awesome, thanks man! |
08:51:00 | skrylar | nimble also works in mysterious ways |
08:51:45 | * | skrylar quit (Remote host closed the connection) |
08:54:35 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
08:59:30 | * | claudiuinberlin joined #nim |
09:01:05 | * | dddddd joined #nim |
09:18:49 | * | madmalik joined #nim |
09:27:56 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:29:21 | * | claudiuinberlin joined #nim |
09:49:09 | * | Yardanico joined #nim |
09:51:05 | * | Pisuke quit (Ping timeout: 240 seconds) |
09:52:26 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:53:01 | FromGitter | <Yardanico> *put_any_package_manager_here* also works in mysterious ways :) |
09:57:42 | FromGitter | <krux02> well there are magical mysterious box package managers, and there are package managers that seem simple |
10:00:00 | * | claudiuinberlin joined #nim |
10:00:54 | * | Pisuke joined #nim |
10:04:35 | Araq | krux02: I adapted your not-nil branch but it still produces weird GC problems :-) |
10:04:55 | Araq | that said, I triggered one with devel too so I think it's actually unrelated to the nil changes |
10:05:14 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
10:05:23 | FromGitter | <krux02> Oh, cool |
10:05:44 | FromGitter | <krux02> I did not do anything, that should have affected the GC |
10:06:09 | FromGitter | <krux02> but on the other side, I have no Idea how the GC works and how it knows what to collect, so I wouldn't know |
10:07:33 | FromGitter | <krux02> I actually have two not-nil branch |
10:08:26 | FromGitter | <krux02> I think I did the second brach, because in the first one I also encountered weired GC problems and in the second branch where I only changed the string functions, I was more careful |
10:08:47 | FromGitter | <krux02> but still I have no idea what could have been the cause for these problems |
10:11:19 | Araq | my guess is that the compilers get ever more aggressive at removing/hiding stack roots for us |
10:12:11 | Araq | *from us |
10:22:55 | FromGitter | <krux02> Araq: https://github.com/rokups/nim-ustring/blob/master/ustring.nim#L29 |
10:23:12 | FromGitter | <krux02> he uses the same pattern as I did to include C sources in a nim project |
10:23:18 | FromGitter | <krux02> it is just a bit better that I did |
10:38:29 | FromGitter | <zacharycarter> making convincing roguelike graphics is hard |
10:41:39 | FromGitter | <krux02> well I think that ! really looks like a potion |
10:41:57 | FromGitter | <zacharycarter> lol |
10:42:04 | FromGitter | <zacharycarter> what I mean is |
10:42:41 | FromGitter | <zacharycarter> https://imgur.com/a/rkaCP |
10:42:44 | FromGitter | <zacharycarter> looks like shit :P |
10:43:12 | FromGitter | <zacharycarter> I'm just drawing rectangles and trying to overlay text on top of them |
10:43:36 | FromGitter | <zacharycarter> using signed distance field font shaders |
10:43:44 | FromGitter | <zacharycarter> but maybe my approach sucks |
10:43:58 | FromGitter | <krux02> where do you get your signed distance field from |
10:44:04 | FromGitter | <krux02> I tried to implement one on my own |
10:44:14 | FromGitter | <krux02> but somehow it was always bugged |
10:45:29 | FromGitter | <krux02> https://sites.google.com/site/broguegame/home/Torchlit%20staircase.png?attredirects=0 |
10:45:57 | FromGitter | <zacharycarter> https://github.com/libgdx/libgdx/wiki/Distance-field-fonts has the shaders I used |
10:46:14 | FromGitter | <zacharycarter> and then my buddy that works on roguelikes has a bunch of fonts I test with |
10:46:21 | FromGitter | <zacharycarter> https://github.com/SquidPony/SquidLib/tree/master/assets |
10:47:09 | * | Yardanico quit (Remote host closed the connection) |
10:47:32 | FromGitter | <zacharycarter> one of my main problems is with font alignment |
10:47:38 | FromGitter | <zacharycarter> over the rectangles |
10:48:00 | FromGitter | <krux02> I recommend pixel fonts |
10:48:09 | FromGitter | <zacharycarter> I'm using bitmap fonts |
10:48:14 | FromGitter | <krux02> hmm |
10:48:15 | FromGitter | <zacharycarter> are those the same? |
10:48:56 | FromGitter | <krux02> what we mean is probably different |
10:49:23 | FromGitter | <krux02> what I mean is, that the font source is not a TTF or something like that, but a font that defines it characters in pixels |
10:49:41 | FromGitter | <krux02> for example my font for programming is Terminus |
10:50:02 | FromGitter | <krux02> it is not a scalable font it is a bitmap font |
10:50:29 | FromGitter | <krux02> with that font you know the axact width |
10:50:35 | FromGitter | <zacharycarter> in pixels? |
10:50:41 | FromGitter | <krux02> with ttf fonts the with is often subpixel |
10:50:51 | FromGitter | <krux02> width |
10:50:53 | FromGitter | <zacharycarter> well I'm definitely using non ttf fonts |
10:50:58 | FromGitter | <krux02> ok |
10:51:12 | FromGitter | <zacharycarter> here's an example font I'm using |
10:51:23 | FromGitter | <zacharycarter> https://github.com/SquidPony/SquidLib/blob/master/assets/Iosevka-distance.fnt |
10:51:32 | FromGitter | <zacharycarter> https://github.com/SquidPony/SquidLib/blob/master/assets/Iosevka-distance.png |
10:52:30 | FromGitter | <ephja> so that's where the heart goes |
10:53:02 | FromGitter | <zacharycarter> :P |
10:54:51 | FromGitter | <krux02> but why do you need signed distance field fonts for a roguelike? |
10:55:48 | FromGitter | <zacharycarter> it was recommended to me to use them |
10:57:41 | FromGitter | <zacharycarter> @krux02 I made some map generation stuff over the weekend |
10:58:13 | FromGitter | <zacharycarter> https://github.com/zacharycarter/nimrl |
10:58:18 | FromGitter | <krux02> well for a 3d engine, yes, for a 2D game without free zooming, no not really |
11:00:06 | FromGitter | <krux02> My recommendation is, not to use ASCII art |
11:00:12 | FromGitter | <krux02> it is ugly |
11:00:23 | FromGitter | <ephja> https://te4.org/ |
11:00:38 | FromGitter | <krux02> use some minimal graphics that also give you a unique style but on the other had is not too time consuming |
11:00:56 | FromGitter | <zacharycarter> it can be pretty |
11:00:58 | FromGitter | <zacharycarter> check out this |
11:01:20 | FromGitter | <zacharycarter> https://i.redd.it/wjcwjn6rrbkz.gif |
11:01:25 | FromGitter | <krux02> well pretty in the eyes of computer scientists who look at characters all day? |
11:01:49 | FromGitter | <zacharycarter> I think most folks would find that aesthetic appealing |
11:01:53 | FromGitter | <krux02> ok, that is pretty |
11:02:09 | FromGitter | <krux02> but that is closer to what I see as minimal graphics than to ascii art |
11:02:17 | FromGitter | <zacharycarter> well that's what I want to aim for |
11:02:21 | FromGitter | <zacharycarter> still ascii art |
11:02:22 | FromGitter | <zacharycarter> but looks good |
11:02:29 | PMunch | Wow, that's really cool |
11:02:39 | FromGitter | <krux02> well then signed distance fonts is just a waste of time |
11:02:51 | FromGitter | <zacharycarter> it took like five minutes to implement |
11:02:55 | FromGitter | <zacharycarter> so screw it :P |
11:03:10 | FromGitter | <zacharycarter> writing the bitmap font loader took way longer |
11:03:32 | FromGitter | <zacharycarter> I need to find a font that has tiles like that |
11:03:35 | FromGitter | <krux02> don't focus on fonts |
11:03:49 | FromGitter | <krux02> you want to render sprites |
11:03:51 | FromGitter | <BigEpsilon> @Araq , I was developing wrapper generator for opencv, which basically cleaned the opencv headers from every bit that is not supported by c2nim. ⏎ But it started to look ugly, so I'm changing my plans. ⏎ I will try to make c2nim support every thing that can be supported (and ignore what cannot be supported instead of failing). ⏎ So I may make a lot of PRs for c2nim in the next weeks, hope you don't mind. ⏎ |
11:03:51 | FromGitter | ... Here are two by the way: https://github.com/nim-lang/c2nim/pulls [https://gitter.im/nim-lang/Nim?at=59c0f997c101bc4e3ae5944e] |
11:04:10 | FromGitter | <krux02> that style that you want to aims for as binary images that are tinted |
11:05:15 | FromGitter | <zacharycarter> okay |
11:05:50 | FromGitter | <krux02> and then eventually the pictures you use are very close to characters |
11:06:53 | FromGitter | <krux02> @zacharycarter I wonder where that gif is from that you posted |
11:06:55 | FromGitter | <krux02> it looks cool |
11:07:04 | * | RcdChen joined #nim |
11:07:47 | FromGitter | <zacharycarter> reddit.com/r/roguelikedev |
11:07:55 | FromGitter | <zacharycarter> https://www.reddit.com/r/roguelikedev/comments/6yieqt/testing_nonsquare_tiles_on_a_square_grid_what_do/ |
11:08:06 | FromGitter | <zacharycarter> he definitely says in there it's a font :P |
11:08:10 | FromGitter | <zacharycarter> an 8x12 font on a 8x8 grid |
11:08:34 | FromGitter | <zacharycarter> maybe I just need to make my own font of images |
11:08:34 | * | mahsav joined #nim |
11:09:01 | * | gokr joined #nim |
11:09:11 | PMunch | That's really cool |
11:09:21 | FromGitter | <zacharycarter> PMunch: I agree |
11:09:33 | * | sz0 joined #nim |
11:10:11 | FromGitter | <krux02> I can recommend you a tile rendered :P https://github.com/krux02/opengl-sandbox/blob/master/examples/retro_tiling.nim |
11:10:29 | * | mahsav2 joined #nim |
11:10:37 | FromGitter | <krux02> it uses a 2D texture as a tilemap |
11:10:50 | FromGitter | <krux02> changing a pixel changes the tile being displayed |
11:11:29 | * | RcdChen quit (Ping timeout: 260 seconds) |
11:12:20 | * | Snircle joined #nim |
11:12:35 | FromGitter | <zacharycarter> hehe I may end up going down that route |
11:12:58 | * | mahsav quit (Ping timeout: 264 seconds) |
11:13:17 | FromGitter | <krux02> and the texture can be arbitrarily big |
11:15:59 | Araq | can you please stop creating eye cancer inducing "rogue-likes" and instead give me a new decent RTS? |
11:16:11 | FromGitter | <zacharycarter> if you make graphics for me sure |
11:16:23 | Araq | ah the old problem. |
11:16:36 | Araq | that was what stopped me back then too :P |
11:16:46 | FromGitter | <zacharycarter> hehe |
11:16:55 | FromGitter | <zacharycarter> actually maybe I can get started with just colored primitives |
11:16:58 | FromGitter | <Grabli66> Need more rogulike games :) |
11:17:38 | FromGitter | <zacharycarter> it'd be cool to do a lockstep networking demo for a rts with nim and zengine |
11:18:10 | FromGitter | <zacharycarter> need a networking library first |
11:18:40 | FromGitter | <Grabli66> Sockets? :) |
11:18:48 | FromGitter | <zacharycarter> yeah but something on top of that |
11:23:37 | PMunch | What kind of RTS Araq? |
11:35:00 | PMunch | Hmm, zacharycarter wouldn't lockstep networking mean quite a bit of jitter? |
11:35:36 | FromGitter | <zacharycarter> nope |
11:35:51 | FromGitter | <zacharycarter> you basically have to implement lockstep networking for RTS games |
11:36:38 | FromGitter | <krux02> I would like the Total Annihilation syle of RTS |
11:37:34 | FromGitter | <zacharycarter> from my understanding anyway |
11:37:35 | * | claudiuinberlin joined #nim |
11:37:58 | PMunch | But you'd have to synchronize the players inputs, so that they are ordered |
11:38:07 | FromGitter | <krux02> when lockstep networking means to synchronize the player actions and Simulate the game on each platfor independently, then I agree |
11:38:26 | PMunch | I was reading this: https://gafferongames.com/post/deterministic_lockstep/ |
11:38:38 | PMunch | But it only talks about input -> simulation |
11:38:48 | PMunch | And not Input <-> Input |
11:38:52 | FromGitter | <krux02> that approach has a disadvantage though, floating point math is not associatiive |
11:39:12 | FromGitter | <krux02> (a + b) + c ≠ a + (b + c) |
11:39:24 | PMunch | Oh yeah, the floating point thing would probably not be required for an RTS though |
11:39:30 | FromGitter | <krux02> this can lead to a lot of nondeternimism in multithreaded code |
11:39:36 | PMunch | At least not for the game logic |
11:39:51 | FromGitter | <krux02> for rendering, floating point is normally used |
11:39:55 | FromGitter | <krux02> yes |
11:40:06 | FromGitter | <krux02> fix point math |
11:40:15 | FromGitter | <krux02> as a lot of nice mathematicaly properties |
11:40:28 | FromGitter | <krux02> (a + b) + c = a + (b + c) |
11:41:19 | PMunch | Yeah, but it probably won't matter too much if the player sees the game a tad differently. As long as all the units/buildings/etc. are the same |
11:41:33 | PMunch | As long as the game is not dependent on it |
11:42:09 | FromGitter | <krux02> butterfly effect |
11:42:19 | FromGitter | <krux02> small changes have a huge impact at the end |
11:42:20 | * | qwertfisch quit (Ping timeout: 240 seconds) |
11:42:27 | FromGitter | <krux02> the game desynchronizes |
11:44:10 | * | qwertfisch joined #nim |
11:45:42 | * | yglukhov quit (Remote host closed the connection) |
11:47:22 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
11:47:41 | FromGitter | <mratsim> integer math is usually slower than floating points though (only SSE2 and AVX 2 have integer specific instructions while all the other SSE/AVX add floating points optic) |
11:47:52 | * | vlad1777d joined #nim |
11:48:39 | FromGitter | <mratsim> Except probably on AMD Bulldozer/Excavator etc that had 2 integer units per core |
11:50:11 | * | nattefrost joined #nim |
11:50:35 | * | claudiuinberlin joined #nim |
11:52:13 | * | ShalokShalom_ joined #nim |
11:55:11 | * | ShalokShalom quit (Ping timeout: 255 seconds) |
12:00:52 | * | yglukhov joined #nim |
12:02:48 | * | yglukhov quit (Remote host closed the connection) |
12:02:54 | * | ShalokShalom_ is now known as ShalokShalom |
12:03:02 | * | yglukhov joined #nim |
12:08:13 | FromGitter | <krux02> @mratsim I know, even though that integer math is generally simpler in logic |
12:08:41 | FromGitter | <krux02> But I would argue that it is generally fast enoguh for most stuff |
12:09:38 | FromGitter | <krux02> but NaN inf and subnormal floating point numbers can kill performance |
12:14:14 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:15:01 | * | nohusuro quit (Ping timeout: 240 seconds) |
12:16:08 | * | Yardanico joined #nim |
12:16:52 | * | claudiuinberlin joined #nim |
12:17:00 | Arrrr | https://www.quora.com/In-CPUs-how-much-slower-is-floating-point-arithmetic-than-integer-arithmetic-Is-the-main-difference-in-divisions |
12:17:55 | * | claudiuinberlin quit (Client Quit) |
12:20:24 | * | claudiuinberlin joined #nim |
12:22:58 | * | nohusuro joined #nim |
12:33:34 | * | renarc quit (Remote host closed the connection) |
12:34:52 | * | nexxus quit (Quit: leaving) |
12:35:07 | * | voiceftp joined #nim |
12:35:31 | * | gokr quit (Read error: Connection reset by peer) |
12:38:05 | * | vlad1777d quit (Ping timeout: 240 seconds) |
12:47:34 | FromGitter | <edubart> is there a way to create a seq with no initialization? (for performance reasons) |
12:47:46 | FromGitter | <krux02> no |
12:47:47 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:48:04 | FromGitter | <krux02> but you can minimize initialization costs |
12:48:36 | FromGitter | <krux02> newSeqOfCap for example creates a seq with the specified internal length |
12:50:02 | FromGitter | <edubart> but I do want it to have a length, just no initialization to avoid unnecessary processing (I will set all its values) |
12:50:16 | PMunch | https://www.gamasutra.com/view/feature/131503/1500_archers_on_a_288_network_.php <- if anyone is interested in the lockstep networking thing for RTS games we talked about earlier. AoE had a "solution" |
12:50:40 | PMunch | edubart, then newSeqOfCap and .add() is what you want |
12:50:56 | PMunch | Assuming you are going to initialize the elements in order |
12:51:24 | FromGitter | <edubart> I wont initialize in order |
12:51:25 | PMunch | That will allocate "cap" amount of elements and each add call will simply be to initialize an element |
12:51:57 | FromGitter | <zacharycarter> apparently c2nim can't handle - |
12:51:57 | FromGitter | <krux02> Well I am not so sure that you really need this super duper optimal initialization |
12:52:20 | FromGitter | <krux02> @edubart are you 100% sure that you need the last 0.1% of performance |
12:52:23 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59c113077b7d98d30d135ff2] |
12:53:21 | * | kunev quit (Ping timeout: 248 seconds) |
12:53:42 | FromGitter | <zacharycarter> I'm attempting to generate bindings to steamworks using https://github.com/rlabrecque/CSteamworks |
12:54:22 | * | claudiuinberlin joined #nim |
12:54:38 | Yardanico | why you wouldn't try wrapping Steamworks itself? :) |
12:54:54 | FromGitter | <zacharycarter> because I have no idea how to interop with C++ code with Nim |
12:54:55 | FromGitter | <krux02> @edubart I think you are too focused on this last bit of performance that you loose the bigger picture. And then you probably don't know that not initializing in order can actually cause a lot of cache misses, wich is a much bigger hit on performance that initializing everything with 0 |
12:55:45 | FromGitter | <krux02> @zacharycarter I haven't done it myself, but you would be required to compile the entire project with c++ |
12:55:45 | * | kunev joined #nim |
12:56:03 | FromGitter | <zacharycarter> yeah |
12:56:04 | FromGitter | <krux02> so instead of ``nim c -r `` you would need to call ``nim cpp -r`` |
12:56:06 | FromGitter | <zacharycarter> yuck |
12:56:34 | FromGitter | <zacharycarter> I figured steamworks would have a C API but nooooo |
12:56:59 | Araq | on top of what krux02 said write barriers/refcounting does not work with uninitalized memory, never has, never will. |
12:57:10 | FromGitter | <ephja> everyone knows that you only really need C++ ;) |
12:57:11 | FromGitter | <edubart> @krux02 well this initializations can make a difference because I am working with a large chunk of memory (GBs of memory) |
12:57:51 | Araq | edubart: it's not an optimization, it doesn't work. even in C++. |
12:58:51 | FromGitter | <krux02> @edubart then cache misses can really cost you a lot |
12:59:05 | FromGitter | <krux02> worst case is a swap on each write |
12:59:43 | FromGitter | <krux02> A cache miss around 200 wasted CPU cycles |
13:00:01 | FromGitter | <krux02> depends on the CPU |
13:01:27 | FromGitter | <krux02> and initialization can make a measurable difference, but I really doubt that it can make an important difference in performance |
13:01:28 | FromGitter | <edubart> I know, but my algorithm I can't initialize in order, however I could avoid this extra initialization |
13:02:03 | FromGitter | <krux02> well you can use alloc |
13:02:09 | FromGitter | <krux02> if you really really want |
13:02:20 | dom96 | Offtopic: For those in academia here, what do you guys recommend for an undergraduate final year CS project? Should I be picking something easy or challenging? :) |
13:02:24 | Araq | GBs of memory means your seq is too large |
13:02:38 | Araq | use a BTree instead, perhaps |
13:02:48 | Araq | damn I need to make my bree a nimble package |
13:03:05 | FromGitter | <edubart> I am working with large batch of images (like 16GBs of image in ram) and reprocessing them all the time, flipping them, rotation them, processing them, each image is a huge seq |
13:03:08 | euantor | dom96: #nim-offtopic exists for a reason ;) |
13:03:20 | dom96 | euantor: Not enough people there. |
13:04:17 | euantor | Fair enough |
13:04:20 | * | relax joined #nim |
13:04:45 | FromGitter | <edubart> @Araq unfortunately I cant work with small seqs in this case |
13:05:33 | Araq | you can always work with BTrees, they are the foundation of most DBs out there |
13:05:38 | PMunch | dom96, simple that way you have more time for Nim :) |
13:06:08 | Araq | and they do not consist of "small" seqs either |
13:06:30 | PMunch | Just kidding. Simple is good though, hidden complexities always crop up and having a simple project that turns hard is better than a hard problem turning impossible. |
13:06:46 | dom96 | PMunch: :) |
13:06:58 | dom96 | Yeah, that's my thinking too. |
13:07:09 | PMunch | I choose a hard one, and I'm not happy about it :P |
13:07:17 | PMunch | s/choose/chose |
13:07:49 | dom96 | PMunch: oh? if you don't mind my asking, what did you choose? |
13:07:58 | FromGitter | <ephja> "Opening the file.............." oh VS |
13:08:19 | dom96 | There is a C++ obfuscation project that doesn't sound too difficult which I'm tempted to grab. |
13:08:49 | FromGitter | <krux02> there isn't even a c++ refactoring tool that works |
13:09:02 | def- | @krux02 they added one today |
13:09:10 | FromGitter | <edubart> @Araq my tensor (multidimensional matrix) can be the size in the order of 64x256x128x128x4 which for float32 equals in 1073741824 bytes = ~1GB |
13:09:22 | * | relax quit (Ping timeout: 264 seconds) |
13:09:38 | dom96 | I'm thinking I can just grab the clang parser, modify some AST nodes, and write the file. Job done. |
13:09:43 | dom96 | But maybe I'm completely wrong :) |
13:09:44 | PMunch | dom96, DDoS detection on outgoing traffic on a router with extreme limitations in RAM and CPU. Basically trying to run a self-training classifier to detect if the traffic of a unit deviates from it's normal and flag that traffic as malicious |
13:09:52 | FromGitter | <edubart> and in my case initialize a seq of 1GB to zeros is uneeded, there is no hacky way? |
13:09:53 | def- | http://www.phoronix.com/scan.php?page=news_item&px=Clang-Refactor-Lands |
13:10:29 | FromGitter | <krux02> @edubart well you can work in chunks of smaller size |
13:11:13 | FromGitter | <krux02> are you doing computer vision? |
13:11:23 | dom96 | PMunch: Sounds challenging, in a good way :) |
13:11:47 | dom96 | Araq: What do you think, is obfuscating C++ code easy? |
13:12:15 | def- | dom96: what's the motivation for obfuscating c++? |
13:12:16 | FromGitter | <edubart> @krux02 yep, I'm doing computer vision in nim |
13:12:26 | PMunch | Challenging indeed.. |
13:12:40 | PMunch | Looking forward to being done with it |
13:12:45 | FromGitter | <krux02> well considering the fact tha c++ is already unreadable to most people and even considered unteachable in some areas by the designers |
13:12:53 | dom96 | def-: To hide proprietary information and intellectual property. |
13:13:04 | PMunch | Then I can do some fun stuff like implementing lock-step networking for RTS games :P |
13:14:35 | def- | dom96: Compile it without debug info? |
13:14:46 | FromGitter | <krux02> maybe you get some luck when you do a low level obfuscater that just replaces identifiers with new random identifiers |
13:14:58 | dom96 | def-: lol |
13:15:04 | * | arnetheduck joined #nim |
13:15:08 | FromGitter | <krux02> some obfuscator that doesn't even understand c++ it just knows literals |
13:15:12 | dom96 | I guess I would have to ask for more details |
13:15:42 | def- | dom96: but clang ast is fun to work with |
13:15:51 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:15:57 | FromGitter | <krux02> is it? |
13:16:09 | dom96 | oh ok: " so that the |
13:16:09 | dom96 | source code may be disseminated widely while making it vi |
13:16:09 | dom96 | rtually impossible for the underlying |
13:16:09 | dom96 | algorithms or other IP in the code to be easily understood or recreated in its original form. " |
13:16:23 | dom96 | bah, sorry, stupid PDF reader can't copy. |
13:16:24 | def- | yeah, even complex pattern matchers are easy to register |
13:17:02 | def- | But I'm just doing static analysis, dunno about outputting new nodes |
13:17:10 | dom96 | so the idea is to send someone the source code ... but then what's even the point in that. |
13:17:37 | def- | dom96: yeah, i wouldn't want to work on a project that can't convince that it makes sense |
13:18:21 | def- | but it's probably for some obscure platforms, so users of the lib can compile it on their own |
13:19:15 | dom96 | yeah, it explains later that this makes it more flexible than having to issue object files for each target platform/compiler. |
13:19:25 | FromGitter | <krux02> @edubart have you measured that initializing to zero is costing you too much performance |
13:19:33 | dom96 | but meh. |
13:20:23 | FromGitter | <edubart> @krux02 if I could disable initialization I would measure.. |
13:20:25 | dom96 | Another project that caught my eye is "Automated Refactoring". I was considering to implement it for Nim (it could use a nice refactoring tool) |
13:20:43 | Yardanico | revive nimfix? |
13:21:06 | FromGitter | <krux02> well you can measure the time it takes to call ``newSeq`` |
13:21:19 | dom96 | I think the best thing to do is to make a note of these projects and go talk to the professors about them directly. |
13:21:26 | FromGitter | <krux02> compared to the loop that initializes it |
13:24:44 | * | claudiuinberlin joined #nim |
13:25:35 | * | gmpreussner quit (Ping timeout: 240 seconds) |
13:31:17 | FromGitter | <edubart> @krux02 I used linux perf tool, one of the top functions is __memset_erms with 7% cpu usage |
13:32:09 | FromGitter | <edubart> and there is almost no case that I need __memset_erms to be called |
13:32:35 | FromGitter | <krux02> well maybe you can reuse old seq values instead of reallocating them |
13:32:40 | FromGitter | <edubart> having this 7% for other tasks could make a difference for me |
13:33:03 | FromGitter | <krux02> that is considered memory pooling |
13:33:36 | FromGitter | <krux02> my guess is that you create a lot of new seq values |
13:33:37 | FromGitter | <edubart> this would need to make an "allocator", would be too much burden, nim already have a good allocator |
13:33:48 | FromGitter | <krux02> how much does the allocation cost you? |
13:35:21 | FromGitter | <krux02> It could be a good idea to have a Tensor type that does not store a seq, but just an offset and a seq for a common seq of all temporary tensors |
13:35:31 | FromGitter | <krux02> then you can really skip initialization |
13:35:49 | FromGitter | <krux02> you still do it once at program start, but that's it |
13:35:57 | FromGitter | <krux02> no additional initialization costs |
13:40:20 | FromGitter | <edubart> could work, but that would be much more complex than simple creating a newSeq method with no initialization, I've created issue #6401 I could trydiving in the nim sources and make a PR for that if @Araq is okay with that being have added to the nim's system API |
13:41:29 | FromGitter | <krux02> well I doubt it, because he already mentioned it would cause problems with the GC |
13:42:43 | * | yglukhov quit (Remote host closed the connection) |
13:43:28 | * | yglukhov joined #nim |
13:45:21 | Araq | 'seq of float' is fine |
13:45:30 | Araq | 'seq of string' would never work |
13:46:43 | * | relax joined #nim |
13:46:43 | FromGitter | <edubart> I'am work with seq of numbers in general, specifically, uint8, int or float |
13:48:08 | * | yglukhov quit (Ping timeout: 255 seconds) |
13:48:49 | * | rauss joined #nim |
13:57:28 | * | yglukhov joined #nim |
13:59:03 | * | sz0 quit (Quit: Connection closed for inactivity) |
14:00:09 | * | gmpreussner joined #nim |
14:04:01 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:06:45 | Araq | newSeqOfCap can skip initialization for types that are not GC'ed |
14:06:51 | Araq | I mean it "could" |
14:06:57 | Araq | no language change required |
14:07:02 | Araq | no new API required |
14:07:30 | Araq | and it's not hard to implement either, PRs welcome |
14:12:28 | * | yglukhov quit (Remote host closed the connection) |
14:12:28 | * | TjYoco joined #nim |
14:15:25 | * | claudiuinberlin joined #nim |
14:16:23 | FromGitter | <edubart> Just did #6402 |
14:24:30 | FromGitter | <zacharycarter> @stisa I guess https://github.com/stisa/jswebsockets doesn't work with nodejs? |
14:26:03 | FromGitter | <stisa> @zacharycarter probably not |
14:26:13 | FromGitter | <zacharycarter> :/ |
14:27:00 | FromGitter | <stisa> PRs are welcome :D |
14:27:31 | FromGitter | <zacharycarter> well I'm trying to get https://github.com/websockets/ws |
14:27:32 | FromGitter | <zacharycarter> and |
14:27:39 | FromGitter | <zacharycarter> https://github.com/niv/websocket.nim |
14:27:42 | FromGitter | <zacharycarter> to play nice atm but failing |
14:29:34 | * | PMunch quit (Quit: Leaving) |
14:37:45 | * | yglukhov joined #nim |
14:37:48 | * | yglukhov quit (Remote host closed the connection) |
14:42:55 | * | askatasu1 joined #nim |
14:43:37 | Yardanico | edubart: AFAIK it would work not only for numbers, but for any value types |
14:44:19 | * | askatasu1 quit (Client Quit) |
14:45:17 | FromGitter | <zacharycarter> sweet got websockets working |
14:45:25 | FromGitter | <zacharycarter> and a node steamworks client |
14:45:27 | * | yglukhov joined #nim |
14:45:29 | FromGitter | <zacharycarter> time to write a multiplayer game server :D |
14:47:33 | federico3 | using websockets or 0mq? |
14:47:48 | FromGitter | <zacharycarter> websockets |
14:49:14 | FromGitter | <zacharycarter> heh I should just bind to - https://github.com/gamestdio/colyseus |
14:49:17 | FromGitter | <zacharycarter> going to get coffee and try that |
14:49:29 | FromGitter | <zacharycarter> only reason I'm using node is because I can use steamworks easily |
14:49:41 | * | yglukhov quit (Ping timeout: 240 seconds) |
14:50:05 | * | PMunch joined #nim |
14:50:36 | * | nsf quit (Quit: WeeChat 1.9) |
14:57:45 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:01:17 | * | sz0 joined #nim |
15:04:43 | * | claudiuinberlin joined #nim |
15:06:35 | * | yglukhov joined #nim |
15:07:43 | FromGitter | <Yardanico> @edubart it would work for any value type, not only for numbers |
15:08:31 | * | couven92 quit (Quit: Client disconnecting) |
15:10:51 | * | yglukhov quit (Ping timeout: 246 seconds) |
15:12:20 | * | endragor quit (Remote host closed the connection) |
15:13:36 | * | Trustable joined #nim |
15:14:41 | * | endragor joined #nim |
15:18:48 | * | endragor quit (Ping timeout: 240 seconds) |
15:21:26 | * | yglukhov joined #nim |
15:23:47 | * | yglukhov quit (Remote host closed the connection) |
15:26:23 | * | endragor joined #nim |
15:30:35 | * | endragor quit (Ping timeout: 240 seconds) |
15:32:19 | * | yglukhov joined #nim |
15:32:41 | * | yglukhov quit (Remote host closed the connection) |
15:35:01 | * | EastByte joined #nim |
15:41:42 | * | yglukhov joined #nim |
15:41:53 | * | yglukhov quit (Remote host closed the connection) |
15:42:27 | * | yglukhov joined #nim |
15:45:49 | * | PMunch quit (Quit: leaving) |
15:46:50 | * | yglukhov quit (Ping timeout: 240 seconds) |
15:47:48 | * | relax quit (Ping timeout: 240 seconds) |
15:49:19 | * | relax joined #nim |
15:54:57 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:55:22 | * | yglukhov joined #nim |
15:58:39 | * | claudiuinberlin joined #nim |
16:02:02 | FromGitter | <Grabli66> How to install ornim ? It does not have .nimble file :) |
16:02:49 | Yardanico | yes it doesn't |
16:03:15 | Yardanico | and it's orMin, not orNim :) |
16:03:48 | Yardanico | just clone it and see example |
16:04:10 | FromGitter | <Grabli66> ok |
16:05:50 | * | BigEpsilon quit (Ping timeout: 240 seconds) |
16:05:51 | Yardanico | but it probably would have a nimble package in the future |
16:13:56 | subsetpark | Araq: did you ever consider adding a bind proc to the Options module? |
16:14:59 | subsetpark | https://www.irccloud.com/pastebin/aB77rjui/ |
16:18:20 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
16:21:55 | FromGitter | <zacharycarter> how do you bind a UDP socket to a port with the net module? |
16:22:49 | Yardanico | you can't ? udp is connection-less |
16:23:18 | * | solitudesf quit (Remote host closed the connection) |
16:24:05 | FromGitter | <zacharycarter> https://github.com/MultiplayerBook/MultiplayerBook/blob/master/Chapter%206/RoboCatRTS/RoboCatRTS/Src/NetworkManager.cpp#L96-L98 |
16:24:42 | * | BitPuffin|osx quit (Ping timeout: 246 seconds) |
16:25:08 | * | relax quit (Ping timeout: 246 seconds) |
16:25:46 | Yardanico | maybe try bindAddr? |
16:26:01 | * | arnetheduck quit (Ping timeout: 240 seconds) |
16:26:11 | FromGitter | <zacharycarter> yeah I was thinking that the docs say - ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59c14522b59d55b823161eee] |
16:26:17 | FromGitter | <zacharycarter> so I dunno |
16:29:00 | Yardanico | well you don't need to bind UDP socket in Nim |
16:29:11 | Yardanico | because recvFrom accepts IP and port |
16:29:39 | Yardanico | Receives data from socket. This function should normally be used with connection-less sockets (UDP sockets). |
16:30:00 | FromGitter | <zacharycarter> ah okay |
16:30:22 | FromGitter | <zacharycarter> thanks @Yardanico |
16:32:37 | subsetpark | zacharycarter, you should switch to irccloud... your nick is too long to have no autocomplete |
16:33:58 | FromGitter | <zacharycarter> i'll have to consider it subsetpark |
16:34:48 | FromGitter | <zacharycarter> hrm interesting I just found asyncnet but i guess there's no udp support? |
16:35:23 | FromGitter | <Bennyelg> Anyone use amazon aws services with nim? |
16:35:38 | FromGitter | <Bennyelg> I know boto3 for python, but I couldn't find something that actually work well on nim |
16:35:55 | Yardanico | I think there's no such thing yet |
16:36:29 | Yardanico | there's only this - https://github.com/aidansteele/aws_sdk.nim |
16:36:33 | Yardanico | but it's low-level |
16:36:45 | FromGitter | <zacharycarter> what are you trying to do @Bennyelg |
16:36:51 | FromGitter | <zacharycarter> I've written lambda jobs in Nim |
16:36:57 | FromGitter | <zacharycarter> but that's about all I've figured out how to do |
16:37:32 | FromGitter | <Bennyelg> Nice, ⏎ Im trying to manage services for example raise an emr , ec2's interact with s3 file storage |
16:37:36 | FromGitter | <zetashift> You should make a blogpost/small article how it was using Nim with AWS, I think it might be good for exposure |
16:38:20 | FromGitter | <zacharycarter> you mean for the lambda job @zetashift ? |
16:38:29 | FromGitter | <Bennyelg> yes, ⏎ once we have strong interaction with aws and their services this will encourage many others to investigate nim. |
16:38:51 | FromGitter | <zacharycarter> @Varriount is working on a aws api for Nim but I think it's stalled out atm because he has school |
16:38:56 | FromGitter | <Bennyelg> most of the audions (the bigs tech companies) are on aws/google |
16:39:11 | FromGitter | <Bennyelg> How old is he? |
16:39:18 | FromGitter | <Bennyelg> can I find it on git? |
16:39:28 | FromGitter | <Bennyelg> Maybe I'll continue to do so |
16:39:42 | FromGitter | <zacharycarter> I don't think it's on git |
16:39:49 | FromGitter | <Bennyelg> too bad :( |
16:39:54 | FromGitter | <zacharycarter> I'd ping him if you're curious about it but he's usually on late(r) |
16:40:19 | FromGitter | <zacharycarter> he's going the approach of generating bindings from the jsondocs I believe |
16:40:59 | FromGitter | <zacharycarter> so it's a large effort |
16:41:00 | FromGitter | <Bennyelg> Of course I'm curious, |
16:41:00 | FromGitter | <Bennyelg> Ic, yea, I'll dig first on amazon botocore written in python and see how they implemented stuff |
16:42:04 | FromGitter | <Jipok> Is there a beautiful way to compare floats? |
16:42:08 | FromGitter | <Jipok> not like float1 <= (float2 + 0.000001) |
16:42:47 | Yardanico | round? :) |
16:43:06 | Yardanico | or this |
16:43:34 | * | yglukhov quit (Remote host closed the connection) |
16:44:15 | Yardanico | abs(f0-1) < 1E-7 to compare if f0 equals to f1 |
16:46:00 | FromGitter | <zacharycarter> hmmm apparently - https://github.com/zielmicha/reactor.nim has async udp sockets |
16:46:06 | FromGitter | <zacharycarter> but the build is broken |
16:46:11 | FromGitter | <Jipok> round to the fifth sign? will it be slower than just adding 0.000001? |
16:46:39 | FromGitter | <zacharycarter> and no windows support ugh |
16:46:53 | FromGitter | <zacharycarter> I guess websockets are my best option atm |
16:52:44 | * | Jesin quit (Quit: Leaving) |
16:56:28 | FromGitter | <zetashift> @zacharycarter yea! |
16:57:45 | * | nsf joined #nim |
17:05:14 | FromGitter | <Jipok> I think I found a beautiful solution for myself |
17:05:19 | FromGitter | <Jipok> https://gist.github.com/Jipok/3f59d36c8e537db0949fb3f17cad538b |
17:09:03 | * | sz0 quit (Quit: Connection closed for inactivity) |
17:11:19 | Araq | jipok: it's better to define a different operator for this like =~ |
17:12:14 | FromGitter | <Jipok> good idea, thx |
17:12:28 | Araq | also you usually need to do a numerical analysis about the possible error intervals :P |
17:12:33 | * | krux02 joined #nim |
17:14:05 | FromGitter | <ephja> https://github.com/BitPuffin/linagl/blob/master/src/linagl/vector.nim#L32 |
17:14:21 | Yardanico | oh |
17:14:23 | Yardanico | 2013 :) |
17:14:41 | FromGitter | <Jipok> It's not a problem. 1E-7 is enough. ⏎ Is `=~` in the standard library? |
17:14:54 | Yardanico | no |
17:16:49 | FromGitter | <ephja> ✈ |
17:17:13 | Yardanico | yay unicode |
17:17:28 | Yardanico | lol, first character wasn't displayed in hexchat :P |
17:17:44 | Yardanico | (but it works in other programs tho) |
17:17:48 | * | Jesin joined #nim |
17:18:05 | krux02 | well that's a hexchat problem |
17:18:16 | krux02 | on emacs it works :P |
17:18:25 | FromGitter | <ephja> old font and no fallbacks? |
17:18:30 | Yardanico | well it seems it's not a problem with hexchat |
17:18:36 | FromGitter | <ephja> or old font and old fallbacks |
17:18:38 | Yardanico | I just use different font in browser and terminal/hexchat |
17:19:38 | FromGitter | <ephja> is anyone interested in font ligatures? https://github.com/tonsky/FiraCode |
17:19:57 | krux02 | I know that project |
17:20:57 | Yardanico | well it wouldn't be hard to add them in nim |
17:21:15 | Yardanico | templates with unicode characters as names ? :) |
17:21:28 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
17:21:28 | krux02 | would be nice |
17:21:51 | krux02 | ¬∨∧ for not or and |
17:22:15 | krux02 | but if then Nim should have full unicode support |
17:22:50 | FromGitter | <ephja> template ↻(x: untyped) = while true: x |
17:23:04 | krux02 | and unicode and askii symbols should be composable in operators like ~¬∧∧&++ |
17:23:24 | krux02 | template ℤ = int |
17:23:55 | krux02 | but mathematically it's wrong, so I wouldn't vote for it |
17:25:05 | krux02 | template ∞ = inf |
17:25:30 | * | Snircle joined #nim |
17:26:24 | krux02 | template `:=`(a,b): untyped = let a = b |
17:26:27 | FromGitter | <ephja> the only problem is the difficulty of typing such characters. perhaps there are some editors that don't make it too difficult |
17:26:45 | krux02 | there are keyboard layouts :P |
17:26:53 | krux02 | and there is emacs |
17:27:40 | FromGitter | <ephja> yeah but there are so many characters to choose from |
17:27:59 | FromGitter | <ephja> how does emacs make it easier? |
17:28:47 | FromGitter | <krux02> well emacs supports input methods, and emacs supports hetkeys for any character |
17:30:34 | * | claudiuinberlin joined #nim |
17:30:47 | * | djiin joined #nim |
17:31:11 | * | djiin quit (Client Quit) |
17:32:04 | * | manjaro-kde5- joined #nim |
17:32:04 | FromGitter | <ephja> ok |
17:32:59 | * | yglukhov joined #nim |
17:34:12 | FromGitter | <ephja> identifiers containing characters from certain ranges could be added to some kind of list :p |
17:34:26 | * | Ven`` joined #nim |
17:34:37 | Yardanico | is there any information when "using" will become an official language feature? e.g. without {.experimental.} pragma |
17:34:42 | Yardanico | *about |
17:34:59 | * | relax joined #nim |
17:36:07 | Arrrr | Also, i think araq wanted to make {.self.} default for first arguments |
17:37:14 | FromGitter | <Varriount> Arrr: I wouldn't want {.self.} to be default |
17:37:22 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
17:37:54 | FromGitter | <krux02> me neither |
17:37:58 | FromGitter | <Varriount> @Bennyelg Regarding AWS, I only have bits and pieces. |
17:38:02 | Yardanico | and also "future" module - when will procs from it get into system? |
17:38:17 | Yardanico | or it will always be like future? |
17:38:58 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
17:39:25 | FromGitter | <Varriount> @Bennyelg I have code that generates 'types' from the API description provided by Boto3, and some code that used to do the basic authorization work for sending requests. |
17:39:40 | FromGitter | <Varriount> However the authorization code seems to be broken. Hm. |
17:40:02 | FromGitter | <Bennyelg> Ic, if you can share it will be greate |
17:40:08 | FromGitter | <Bennyelg> its something to starts with |
17:40:20 | * | olwi joined #nim |
17:42:07 | * | nsf quit (Quit: WeeChat 1.9) |
17:42:44 | FromGitter | <ephja> how readable is implicit passing of 'self' anyway? |
17:43:00 | * | claudiuinberlin joined #nim |
17:43:08 | FromGitter | <krux02> how well does the implicit this work in c++? |
17:45:45 | * | Snircle joined #nim |
17:50:30 | * | tax joined #nim |
17:51:45 | * | Elronnd is now known as Rivenndel |
17:51:53 | * | Rivenndel is now known as Elronnd |
17:53:27 | * | krux02 quit (Remote host closed the connection) |
17:56:06 | Araq | Yardanico: do you like 'using'? |
18:00:21 | * | gokr joined #nim |
18:01:57 | * | olwi left #nim ("Leaving") |
18:09:52 | Yardanico | Araq, yeah, I do, it allows to write less code! (e.g. sometimes you need to have a lot of procs with first argument like self: MyObject) |
18:10:25 | Araq | since it's an explict keyword anyway I'll make it non-experimental with the next version |
18:11:08 | Yardanico | but AFAIK using doesn't support generic types |
18:11:20 | * | nsf joined #nim |
18:11:47 | Yardanico | and also I finally can understand the meaning of ";" vs "," in proc arguments :) |
18:12:50 | Arrrr | I thought there was none |
18:12:56 | Yardanico | well there is |
18:13:02 | FromGitter | <Varriount> ";" and "," aren't the same? |
18:13:06 | Yardanico | yes, they aren't |
18:13:14 | Yardanico | for example, in generic types |
18:14:43 | Yardanico | I can't find it in manual :P |
18:15:25 | Yardanico | ah |
18:15:26 | Yardanico | found it |
18:15:34 | Yardanico | https://nim-lang.org/docs/manual.html#procedures |
18:15:44 | Yardanico | ';' stops type propagation. |
18:16:08 | * | nsf quit (Client Quit) |
18:16:18 | Yardanico | It's the same in "a: int; b: int", but not the same in "a; b: int" |
18:17:09 | Arrrr | Noice |
18:19:21 | * | Guest89124 quit (Quit: Leaving) |
18:19:41 | * | scriptum joined #nim |
18:20:43 | dom96 | yay, I'm improving the osinfo module (which is one of the first Nim modules I've written!) |
18:21:29 | Yardanico | it's a module in stdlib? |
18:21:39 | Yardanico | ah, no |
18:24:38 | * | PMunch joined #nim |
18:49:29 | Yardanico | Araq, 0.18.0 is the next version, right? or 0.17.4? |
18:49:38 | Yardanico | or 1.0 ? :P |
18:49:56 | Araq | 0.18 == v1 release candidate ... |
18:50:01 | * | Araq is allowed to dream |
18:50:55 | Yardanico | 1.0 RC1 |
18:51:56 | FromGitter | <Bennyelg> :D |
18:56:00 | Yardanico | yeah, indeed, why nim versions are 0.x? |
18:56:11 | Yardanico | they should've been 1.0 RC1, 1.0 RC2, 1.0 RC3 :D |
18:56:15 | Yardanico | 1.10 RC 17.2 |
18:56:18 | Yardanico | *1.0 |
19:01:41 | FromGitter | <ephja> yeah why not have 68 release candidates :p |
19:02:25 | FromGitter | <krux02> yay |
19:03:03 | dom96 | https://github.com/dom96/analytics/tree/master |
19:03:21 | Yardanico | yay! |
19:03:50 | Yardanico | uh, "only generate this once per user", this is the way how google analytics works? |
19:04:17 | Yardanico | well I think you can make some user-specific ID, we should make a package for that! :P |
19:04:41 | dom96 | this package already provides this proc |
19:04:45 | Yardanico | oh, yes, sory |
19:05:02 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:05:14 | dom96 | so far this package uses the most packages, I think. |
19:05:25 | dom96 | as far as my own packages go. |
19:08:14 | * | claudiuinberlin joined #nim |
19:11:10 | Yardanico | dom96, also, you may want this proc for encoding parameters: https://gist.github.com/Yardanico/f7e0e0b7ae179f5f80aeb29638aca1b9 |
19:11:27 | * | yglukhov quit (Read error: Connection reset by peer) |
19:11:31 | Yardanico | ah, you also have conditions |
19:11:45 | Yardanico | well you can use tables and rewrite this procedure a bit :) |
19:12:00 | dom96 | Yardanico: you should submit something similar into the `uri` module |
19:12:03 | * | yglukhov joined #nim |
19:12:37 | Yardanico | hmm, but then I would add "cgi" dependency to uri :) |
19:12:59 | FromGitter | <ephja> the parser libs are neat |
19:13:18 | dom96 | Yardanico: that stuff should be moved to uri anyway |
19:13:39 | Yardanico | dom96, well yeah, I personally agree since encodeUrl is not useful only in CGI apps |
19:14:12 | dom96 | yep, PR would be awesome for this :) |
19:14:26 | FromGitter | <ephja> I wonder what the equivalent interface is in java |
19:15:38 | * | ipjk joined #nim |
19:17:07 | * | zachk joined #nim |
19:21:13 | Yardanico | https://stackoverflow.com/questions/10786042/java-url-encoding-of-query-string-parameters |
19:21:22 | Yardanico | URLEncoder.encode(q, "UTF-8") |
19:21:50 | Yardanico | oh, and other one says that it's better to use URIBuilder |
19:23:41 | Yardanico | sorry for java (I've never actually used it :P) |
19:27:25 | * | Vladar quit (Quit: Leaving) |
19:27:41 | * | salewski joined #nim |
19:28:58 | salewski | Is it possible to pass a proc to a macro and then to investgate the proc parameter list? |
19:29:40 | Yardanico | salewski, yes |
19:30:41 | salewski | I tried for more than one hour to find an example or a starting point -- no success. |
19:30:49 | Yardanico | well yeah, it's not very straightforward |
19:31:04 | Yardanico | salewski, https://gist.github.com/Yardanico/48a52f4d49245983ea0103d1b5096126 |
19:31:15 | Yardanico | with prc.symbol.getImpl() you get your procedure implementation |
19:31:42 | Yardanico | and it has to be "typed" |
19:32:13 | FromGitter | <Jipok> How to display a float? ⏎ I wanna get 0.00000023 ⏎ but got 2.2e-07 |
19:32:29 | Yardanico | formatFloat from strutils? |
19:32:45 | salewski | Yardanico thanks! |
19:34:54 | * | Trustable quit (Remote host closed the connection) |
19:35:26 | Yardanico | it's sad that you can't specify the language of a gist without specifying file name |
19:35:40 | Yardanico | it's hard to name files :D |
19:35:49 | * | skrylar joined #nim |
19:35:59 | skrylar | well, who knows if i'll be around to write more nim modules /shrug |
19:36:03 | skrylar | probably going to end up homeless |
19:38:27 | subsetpark | dom96: is there a convention for giving a prefix and infix name to the same proc, or do we generally only have one or the other? |
19:44:17 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:47:22 | FromGitter | <zacharycarter> I'm trying to rip apart the snake example, can anyone explain to me why this won't compile? |
19:47:43 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59c1745e210ac269204f2303] |
19:47:58 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59c1746e7b7d98d30d15a06d] |
19:48:49 | FromGitter | <Yardanico> try to rename req to request :P |
19:48:54 | FromGitter | <Yardanico> proc onRequest(gameServer: Server, req: Request) {.async.} = |
19:49:02 | FromGitter | <Yardanico> or change it to ⏎ proc onRequest(gameServer: Server, req: Request) {.gcsafe, async.} = |
19:49:08 | FromGitter | <Yardanico> this *might* helop |
19:50:48 | FromGitter | <zacharycarter> thanks I'll try both |
19:51:36 | FromGitter | <zacharycarter> the {.gcsafe, async.} pragma did the trick |
19:52:26 | dom96 | subsetpark: can you elaborate, I'm not following |
19:54:51 | subsetpark | dom96: is it the case that most procedures which are implemented as operators - `&`, `+` - have equivalent named bindings - eg, concat, add? |
19:56:23 | Yardanico | hmm, actually true |
19:56:28 | Yardanico | even ints have "inc" procedure |
19:56:37 | Yardanico | e.g. i + 1 equals to i.inc(1) |
19:56:53 | Yardanico | but I don't know if it's the convention |
19:58:07 | subsetpark | In other words: I have a PR to nim-lang/nim that implements an operator. Should I add a synonym as a named proc? |
20:01:17 | Yardanico | YAY, yglukhov release his game! |
20:01:36 | Yardanico | https://forum.nim-lang.org/t/3180 |
20:04:03 | dom96 | subsetpark: no |
20:04:30 | Yardanico | oh, it also uses nimx |
20:04:37 | dom96 | Took yglukhov long enough :) |
20:05:11 | FromGitter | <superfunc> whats the .01%? |
20:05:31 | Yardanico | ? |
20:05:45 | FromGitter | <superfunc> Oh, from the post it said its 99.99% Nim code |
20:06:00 | Yardanico | well other code is probably JS |
20:06:05 | Yardanico | also it uses nimx |
20:06:10 | Yardanico | https://github.com/yglukhov/nimx |
20:06:20 | Yardanico | but I have a feeling that JS generated code is hand-modified |
20:06:31 | FromGitter | <superfunc> Nimx is cool, I wrote my personal todo app in it |
20:06:51 | Yardanico | it seems it's an nim in asm.js + some code in JS |
20:06:57 | PMunch | A Facebook game written in *pure* Nim? |
20:07:17 | * | claudiuinberlin joined #nim |
20:07:20 | Yardanico | nim can compile to JS, so it seems.. yes :) |
20:07:45 | * | rokups quit (Quit: Connection closed for inactivity) |
20:09:20 | Yardanico | yglukhov, I saw on talk in 2015 what you had early prototype of 3D city ? :) now it's 2d it seems |
20:11:57 | * | nattefrost quit (Remote host closed the connection) |
20:13:08 | PMunch | That's pretty cool |
20:13:38 | yglukhov | Yardanico: true, 3d map turned out to be much slower in production. still we might reconsider this when other things settle down a bit. =) |
20:14:01 | Yardanico | yglukhov, well I only saw this talk on youtube :P |
20:15:34 | yglukhov | the other 0.1% is js, c, and shell scripts for the gitlab-ci =) |
20:15:54 | Yardanico | C? |
20:15:59 | Yardanico | yglukhov, did you use emscripten? |
20:16:11 | yglukhov | yup |
20:16:13 | Yardanico | ah |
20:16:38 | yglukhov | oh, and there's around 500loc java for android =) |
20:16:58 | Yardanico | it's not only on facebook? |
20:17:01 | * | vlad1777d joined #nim |
20:17:19 | Yardanico | ah, iOS and Android coming soon |
20:17:27 | Yardanico | google is the best https://onsetgame.com/static/presskit/Reel_Valley_Press_Kit.pdf |
20:28:45 | * | PMunch quit (Quit: leaving) |
20:29:40 | FromGitter | <zacharycarter> does this make sense? |
20:29:44 | FromGitter | <zacharycarter> `````` |
20:29:47 | subsetpark | second convention question: should I be writing `proc foo[T, T2]` or `proc foo[A, B]`? |
20:30:16 | Yardanico | probably A, B |
20:30:33 | FromGitter | <Yardanico> @zacharycarter ehm? |
20:31:00 | FromGitter | <Yardanico> you're creating a JSON from some string, and then getting a string from this JSON? |
20:31:32 | FromGitter | <Yardanico> also for some reason IRC bridge completely removed your code |
20:31:45 | FromGitter | <zacharycarter> %* creates a JSONNode not a string right? |
20:32:01 | * | manjaro-kde5- quit (Quit: Konversation terminated!) |
20:32:12 | FromGitter | <zacharycarter> basically I have a object I want to marshall into a string |
20:32:15 | FromGitter | <zacharycarter> how do I do that? |
20:32:47 | FromGitter | <Yardanico> well if you would read it in Nim after that, use marshal module? |
20:32:55 | FromGitter | <Yardanico> https://nim-lang.org/docs/marshal.html |
20:33:05 | FromGitter | <zacharycarter> this is just for sending over websockets |
20:33:09 | FromGitter | <Yardanico> ah, maybe use it then |
20:33:15 | FromGitter | <Yardanico> https://nim-lang.org/docs/marshal.html |
20:33:51 | * | Yardanico quit (Remote host closed the connection) |
20:33:56 | FromGitter | <zacharycarter> thanks |
20:34:27 | dom96 | yglukhov: awww, emscripten? Where did Nim's JS backend fall short? |
20:37:05 | yglukhov | dom96: 1 missing feature - finalizers =). but the real reason is performance. js is order of magnitudes slower. |
20:38:29 | yglukhov | we're using js backend, just not for the game itself. |
20:40:53 | FromGitter | <Yardanico> Ah yes, browsers can speed up asm.js code |
20:41:17 | dom96 | I see |
20:41:21 | subsetpark | dom96: i'm trying to `c -r lib/pure/options.nim` to run the tests in the `whenIsMainModule` section, but I get this error message: "module names need to be unique per Nimble package; module clashes with /home/zax/code/lang/nim/Nim/lib/pure/strutils.nim". It's claiming a file clashes with itself. Any ideas why? |
20:42:17 | dom96 | check the paths that the compiler adds |
20:42:25 | dom96 | it should print them out at the start |
20:43:15 | subsetpark | hm, only that it's using the config file from my choosenim distro |
20:43:33 | subsetpark | should i use koch to build a local copy of the binary and call that instead? |
20:45:53 | * | tax quit (Ping timeout: 246 seconds) |
20:48:14 | * | rusua quit (Quit: Connection closed for inactivity) |
20:48:22 | dom96 | maybe try turning up the verbosity: --verbosity:3 |
20:49:25 | * | gangstacat quit (Ping timeout: 255 seconds) |
20:49:56 | FromGitter | <zetashift> @yglukhov does it use Rod as the engine? |
20:50:05 | yglukhov | yup |
20:50:07 | subsetpark | oh well, boostrapping the compiler and using that worked anyway. |
20:50:54 | dom96 | yglukhov: I replied to the forum thread, but I may as well ask here as well. It would be awesome to put this game in our "Featured Projects" section on the Nim website, would you be interested in that? |
20:52:00 | yglukhov | dom96: sure, that would be awesome, i guess =) it's just... the source code is not on github :D |
20:52:17 | FromGitter | <zetashift> @dom96, trying out choosenim, using choosenim stable gets me version 0.17.0 and not 2 |
20:52:25 | FromGitter | <zetashift> 1) 17.2* |
20:53:59 | dom96 | yglukhov: that's okay, we can link to the game on FB :) |
20:54:16 | yglukhov | cool |
20:55:00 | dom96 | yglukhov: if we're in agreement then would you be able to get a square logo for me? in the same style as the current ones on the website :) |
20:55:47 | dom96 | zetashift: choosenim update stable? |
20:56:34 | FromGitter | <zetashift> ah man that's so smart I should read README's completely before typing |
20:58:03 | FromGitter | <zacharycarter> https://gist.github.com/zacharycarter/b1eb4cce330ada585b25567bb1532d88 |
20:58:06 | yglukhov | dom96: hrm... do current ones have style? :P |
20:58:18 | yglukhov | ill try to find something thoug |
20:58:32 | FromGitter | <zacharycarter> I could use some help here - for some reason my reader proc never receives any messages |
20:58:51 | dom96 | current ones don't have any logos |
21:01:03 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
21:01:07 | yglukhov | dom96: does it necessarily have to be a square with smth? or just a transparent png with appropriate size would do? |
21:01:34 | dom96 | zacharycarter: your SDL loop never gives the async loop any time to do work it seems |
21:01:39 | FromGitter | <zacharycarter> oh it does read data but only once I've killed the process :P |
21:01:54 | FromGitter | <zacharycarter> @dom96: how can I do that? |
21:02:00 | dom96 | You should call asyncdispatch.poll after limitFramerate |
21:02:04 | dom96 | instead of using runForever |
21:02:10 | FromGitter | <zacharycarter> thank you |
21:02:25 | dom96 | yglukhov: that should be fine |
21:02:39 | yglukhov | zacharycarter, dom96: i dont think that would be THAT easy ;) |
21:03:40 | yglukhov | sdl and async do not cooperate nicely, if we're talking performance/efficiency. |
21:04:56 | dom96 | perhaps not, but it's a good hint to get zacharycarter on track |
21:05:45 | FromGitter | <zacharycarter> hrm if I don't do runForever my game loop instantly quits |
21:06:18 | FromGitter | <zacharycarter> https://gist.github.com/zacharycarter/11720329f7a84236d4a55be8c712b999 |
21:07:22 | yglukhov | zacharycarter: if you really want to make asyncdispatch+sdl work no matter what, you should do sdl poll with smallish timeout, and then poll with smallish timeout in while-true. |
21:07:42 | yglukhov | but like i said, you can regret =) |
21:07:48 | FromGitter | <zacharycarter> hehe |
21:08:27 | yglukhov | zacharycarter: nimx provides http request function that plays nicely with the rest of nimx runloop |
21:08:39 | yglukhov | be it sdl or js or whatever internally |
21:08:48 | FromGitter | <zacharycarter> does it support websockets? |
21:09:19 | yglukhov | no persistent connections. its just a request-response api. |
21:09:29 | yglukhov | no full-blown asyncdispatch |
21:09:38 | FromGitter | <zacharycarter> gotcha |
21:09:58 | FromGitter | <zacharycarter> I'm trying to write a client with websockets for my sdl2 game |
21:10:15 | FromGitter | <zacharycarter> probably obvious |
21:10:43 | yglukhov | sdl2 sucks, unfortunately. this is one of the reasons i want nimx to get away from it. |
21:11:06 | yglukhov | i mean, sdl2 is nice, just not the runloop related stuff in it. |
21:11:47 | yglukhov | zacharycarter: you could consider background communication thread as an option. |
21:12:13 | yglukhov | in background threads you can do full-blown asyncdispatch, just not the main thread. |
21:12:14 | FromGitter | <zacharycarter> ugh then I'm dealing with channels or shared heap |
21:12:29 | FromGitter | <zacharycarter> it's not a terrible idea |
21:12:46 | yglukhov | in fact thats how nimx handles http |
21:12:54 | FromGitter | <zacharycarter> do you use channels or a shared heap? |
21:12:58 | yglukhov | but your case is a bit more complex |
21:13:07 | FromGitter | <zacharycarter> aye |
21:13:12 | yglukhov | neither of those. |
21:13:29 | FromGitter | <zacharycarter> how do you communicate between threads then? |
21:14:53 | yglukhov | i'm spawning a thread with its arguments (input). at the end it sends sdl message with its result (output). + a bit of GC_refs, and unsafe casts. |
21:15:24 | yglukhov | gotta be careful with those. =) |
21:15:28 | dom96 | For a persistent connection you'd need a channel. |
21:15:33 | FromGitter | <zacharycarter> gotcha |
21:15:45 | FromGitter | <zacharycarter> I'll play around with channels and try it out |
21:15:51 | yglukhov | and a channel will not work again ( |
21:15:54 | dom96 | sucks that sdl needs this |
21:16:03 | FromGitter | <zacharycarter> why won't a channel work? |
21:16:19 | yglukhov | * if we're talking performance/efficiency =)) |
21:16:26 | FromGitter | <zacharycarter> I guess createShared it is! |
21:16:33 | yglukhov | because you'll end up with the same problem again |
21:16:42 | yglukhov | polling from 2 different sources |
21:17:50 | * | relax quit (Ping timeout: 240 seconds) |
21:18:24 | yglukhov | zacharycarter: i've been already thinking about it. you might want to implement your own semi-async-one-way-channel-monster. |
21:18:35 | yglukhov | it will work in the following way: |
21:18:57 | yglukhov | open a pipe between main and background thread. |
21:19:05 | * | gangstacat joined #nim |
21:19:15 | yglukhov | main thread sends messages by writing to the pipe |
21:19:21 | dom96 | You should test the performance using async and sdl2 like I described first IMO |
21:19:34 | dom96 | Perhaps for your use case it will be fast enough |
21:19:45 | yglukhov | background thread uses asyncdispatch on the read end of the pipe |
21:20:06 | yglukhov | background thread sends messages to the main thread with sdl_sendmessage |
21:20:18 | yglukhov | and that completes the cycle |
21:20:26 | FromGitter | <zacharycarter> interesting |
21:21:03 | FromGitter | <zacharycarter> dom96: I'm willing to try I'm just not sure how to fix my example |
21:22:04 | yglukhov | zacharycarter: put asyncdispatch.poll into your sdl event loop |
21:22:15 | yglukhov | not after. but into. |
21:22:24 | FromGitter | <zacharycarter> oh okay |
21:22:45 | yglukhov | give it some small timeout. e.g. 1 |
21:23:04 | yglukhov | and make sure sdl_poll doesnt block either |
21:24:51 | FromGitter | <zacharycarter> yeah that's pretty slow |
21:25:00 | FromGitter | <zacharycarter> it worked though :P |
21:27:22 | * | gangstacat quit (Ping timeout: 264 seconds) |
21:27:36 | yglukhov | zacharycarter: well what did i tell you? =) |
21:27:41 | * | Arrrr quit (Read error: Connection reset by peer) |
21:28:26 | dom96 | did you ensure that SDL's poll isn't blocking? |
21:28:44 | FromGitter | <zacharycarter> I don't know how to do that |
21:28:49 | dom96 | I'm guessing it's only returning when an event occurs (you move the mouse etc.) |
21:29:04 | FromGitter | <zacharycarter> ah let me verify that |
21:29:36 | yglukhov | yes, by default it blocks afair |
21:29:40 | FromGitter | <zacharycarter> seems that way |
21:30:30 | FromGitter | <zacharycarter> SDL_PollEvent() is the favored way of receiving system events since it can be done from the main loop and does not suspend the main loop while waiting on an event to be posted. |
21:30:40 | FromGitter | <zacharycarter> but it seems it does :/ |
21:31:15 | yglukhov | try SDL_WaitEventTimeout |
21:31:39 | FromGitter | <krux02> I think a nice interface for SDL_PollEvent() would be an iterator for all queued events |
21:31:45 | FromGitter | <krux02> but yea that doesn't help |
21:32:03 | FromGitter | <krux02> I wonder wher SDL_PollEvent() suspends the main loop |
21:32:23 | yglukhov | i think a nice interface would be `await nextEvent()` =) |
21:32:31 | FromGitter | <krux02> normally buffer swapping also fills the event queues |
21:32:53 | FromGitter | <krux02> @Yardanico maybe that, too |
21:33:22 | FromGitter | <krux02> but normally on the main look you poll for events and process them |
21:33:33 | FromGitter | <krux02> loop |
21:34:02 | FromGitter | <krux02> actually waiting for an event is a rare thing |
21:34:13 | FromGitter | <krux02> but it's good that it is possible |
21:34:30 | yglukhov | true, i just wanted to emphasize that sdl should play nicely with asyncdispatch with is unlikely to happen ( |
21:34:53 | yglukhov | *which is |
21:35:27 | FromGitter | <zacharycarter> waitEventTimeout doesn't work either |
21:35:41 | FromGitter | <zacharycarter> I'll play with a background thread |
21:35:46 | yglukhov | huh? why not? |
21:35:49 | FromGitter | <krux02> @zacharycarter where is poll event blocking? |
21:35:58 | * | ipjk_ joined #nim |
21:36:40 | FromGitter | <zacharycarter> ```while sdl2.waitEventTimeout(evt, 0): ⏎ asyncdispatch.poll(1)``` [https://gitter.im/nim-lang/Nim?at=59c18de8614889d4751a933f] |
21:36:50 | FromGitter | <zacharycarter> websocket message is received as soon as I move my mouse |
21:36:58 | * | gangstacat joined #nim |
21:37:49 | FromGitter | <zacharycarter> tried with a timeout of 1000 |
21:37:51 | FromGitter | <zacharycarter> that didn't work either |
21:38:34 | yglukhov | 1 |
21:38:39 | yglukhov | set timeout to 1 |
21:38:48 | * | ipjk quit (Ping timeout: 240 seconds) |
21:39:25 | FromGitter | <zacharycarter> still doesn't process anything until I make an event happen by moving my mouse |
21:39:50 | yglukhov | windows? |
21:40:24 | FromGitter | <zacharycarter> osx |
21:43:14 | yglukhov | strange. tbh im out of ideas |
21:43:24 | yglukhov | but you're so close... =) |
21:43:35 | * | gangstacat quit (Quit: Ĝis!) |
21:43:47 | FromGitter | <krux02> @zacharycarter there are sdl functions to filter the events |
21:44:06 | FromGitter | <krux02> maybe when you are more specific about the type of events you want to receive, you have more luck |
21:44:37 | FromGitter | <zacharycarter> good idea I'll try that |
21:44:41 | FromGitter | <krux02> and you can create your own events |
21:45:53 | * | gangstacat joined #nim |
21:46:20 | * | Ven`` quit (Ping timeout: 240 seconds) |
21:46:24 | FromGitter | <krux02> https://wiki.libsdl.org/SDL_EventState |
21:47:26 | FromGitter | <krux02> simplest way to prevent events to appear in the event queue |
21:47:28 | * | nsf joined #nim |
21:48:45 | FromGitter | <krux02> and this to be more specific |
21:48:46 | FromGitter | <krux02> https://wiki.libsdl.org/SDL_SetEventFilter |
21:57:45 | FromGitter | <zacharycarter> hrm interesting |
21:57:54 | FromGitter | <zacharycarter> my application doesn't quit after calling jointhread |
21:58:33 | * | TjYoco quit (Quit: Leaving) |
22:00:47 | FromGitter | <zacharycarter> bleh I can't use another thread |
22:01:02 | FromGitter | <zacharycarter> readData from the websocket library isn't gcsafe |
22:02:28 | FromGitter | <zacharycarter> any ideas? |
22:02:40 | FromGitter | <zacharycarter> of am i screwed? |
22:02:44 | FromGitter | <zacharycarter> or* |
22:03:14 | * | salewski quit (Quit: WeeChat 1.9) |
22:03:41 | yglukhov | why isnt it gcsafe? |
22:03:58 | yglukhov | it uses global refs? |
22:04:17 | * | pilne joined #nim |
22:04:32 | FromGitter | <zacharycarter> not really sure |
22:05:04 | yglukhov | well the error should give you a hint |
22:05:09 | FromGitter | <zacharycarter> https://github.com/niv/websocket.nim/blob/master/websocket/shared.nim#L151 |
22:05:35 | FromGitter | <zacharycarter> I guess I'll clone the library and find out |
22:07:40 | FromGitter | <zacharycarter> I'll PR |
22:09:29 | FromGitter | <zacharycarter> or I'll patch for my purposes anyway, I doubt he's going to want my idea for a PR |
22:12:05 | yglukhov | making that work in a thread is something anyone would like imo |
22:13:00 | FromGitter | <krux02> @zacharycarter There is SDL_PeekEvents that does not do blocking |
22:13:10 | yglukhov | besides by contributing to original repo you make it easier for yourself, because you'll not have to maintain it once its merged ;) |
22:13:17 | FromGitter | <krux02> SDL_PollEvent does call SDL_PumpEvents implicityl |
22:14:32 | yglukhov | ah its reqPing |
22:14:39 | yglukhov | i think... |
22:16:08 | FromGitter | <zacharycarter> yeah it is |
22:19:22 | FromGitter | <Yardanico> @Araq is there a norecurse pragma now? https://forum.nim-lang.org/t/338 |
22:20:00 | * | yglukhov quit (Remote host closed the connection) |
22:20:26 | FromGitter | <zacharycarter> do I have to do something special to install a nimble project with ssl support? |
22:25:20 | FromGitter | <zacharycarter> nevermind |
22:25:31 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59c1995b614889d4751ac474] |
22:25:34 | FromGitter | <zacharycarter> is kind of working |
22:26:39 | * | gokr quit (Ping timeout: 248 seconds) |
22:29:57 | * | nsf quit (Quit: WeeChat 1.9) |
22:34:39 | * | Jesin quit (Quit: Leaving) |
22:39:43 | FromGitter | <Yardanico> It also seems that term rewriting is a very powerful thing :) Also I didn't knew that you can overload macros based on node type |
22:39:48 | * | Jesin joined #nim |
22:40:11 | FromGitter | <Yardanico> I think the features are not commonly known in Nim community :( |
22:40:31 | FromGitter | <Yardanico> *these |
22:45:42 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
23:13:45 | FromGitter | <Varriount> I wish term-rewriting had a different syntax. It means adding even more information to an already-burdened function signature. |
23:16:03 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59c1a533c101bc4e3ae915e9] |
23:16:07 | FromGitter | <zacharycarter> fails to compile |
23:17:48 | * | chemist69 quit (Ping timeout: 240 seconds) |
23:17:56 | FromGitter | <zacharycarter> also it fails on float32s |
23:20:30 | * | yglukhov joined #nim |
23:21:07 | * | jonh joined #nim |
23:22:40 | * | chemist69 joined #nim |
23:24:50 | * | yglukhov quit (Ping timeout: 240 seconds) |
23:26:04 | * | zachk quit (Quit: night) |
23:35:21 | FromGitter | <zacharycarter> how about it |
23:35:56 | FromGitter | <zacharycarter> (https://files.gitter.im/nim-lang/Nim/nz4D/Screen-Shot-2017-09-19-at-7.35.10-PM.png) |
23:41:55 | * | madmalik quit (Quit: Connection closed for inactivity) |
23:43:10 | * | renarc joined #nim |
23:44:39 | * | Snircle joined #nim |
23:44:52 | FromGitter | <krux02> well i see squares |
23:54:50 | FromGitter | <krux02> how do I use mixin with macros? |
23:54:56 | FromGitter | <krux02> I know bindSym |
23:55:03 | FromGitter | <krux02> and I know ident |
23:55:43 | FromGitter | <krux02> but ident uses the scope where the macro is expaned and bindSym uses the other scope |
23:58:23 | * | renarc quit (Ping timeout: 248 seconds) |