<< 19-09-2017 >>

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:04FromGitter<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:15Serenitoris 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:39Serenitornvm, 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:25Demos[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:32FromGitter<mratsim> there is a noNimblePath flag if the dependency/package is installed but you don’t want to use it for testing
07:15:20FromGitter<mratsim> wow the C++ options is really hidden in plain sight @zacharycarter
07:16:02FromGitter<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:56FromGitter<Bennyelg> Gooooooooooooood Morning
08:02:45FromGitter<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:10skrylarthey don't hand out trophies for doing trivial shit
08:15:17*claudiuinberlin joined #nim
08:15:32FromGitter<Grabli66> Is there a good book about how to develop applications, which is suitable for Nim language?
08:19:04FromGitter<Grabli66> Sorry. About how to design applications. With diagrams and etc. :)
08:23:24*couven92 joined #nim
08:23:42Araqgrabli66: what kind of applications? business? games?
08:24:57FromGitter<Grabli66> Client-server applications. Like web server, web service.
08:25:25*rokups joined #nim
08:25:59AraqI'm working on making karax+ormin the winning combination for these
08:27:32Araqbut dom's book covers that as well
08:29:02FromGitter<Grabli66> I think, Dom's book not about how to design applications, written in Nim.
08:29:43AraqI think it does cover that and I read it 3 times...
08:31:53*sz0 quit (Quit: Connection closed for inactivity)
08:40:22FromGitter<raydf> Hi @Araq what is ormin?
08:41:09FromGitter<raydf> ok, found it in your repos
08:42:30TangerHey 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:08AraqTanger: nimble these days pretty much tells you how to setup your project
08:45:14TangerAraq: Awesome, thanks man!
08:51:00skrylarnimble 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:01FromGitter<Yardanico> *put_any_package_manager_here* also works in mysterious ways :)
09:57:42FromGitter<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:35Araqkrux02: I adapted your not-nil branch but it still produces weird GC problems :-)
10:04:55Araqthat 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:23FromGitter<krux02> Oh, cool
10:05:44FromGitter<krux02> I did not do anything, that should have affected the GC
10:06:09FromGitter<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:33FromGitter<krux02> I actually have two not-nil branch
10:08:26FromGitter<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:47FromGitter<krux02> but still I have no idea what could have been the cause for these problems
10:11:19Araqmy guess is that the compilers get ever more aggressive at removing/hiding stack roots for us
10:12:11Araq*from us
10:22:55FromGitter<krux02> Araq: https://github.com/rokups/nim-ustring/blob/master/ustring.nim#L29
10:23:12FromGitter<krux02> he uses the same pattern as I did to include C sources in a nim project
10:23:18FromGitter<krux02> it is just a bit better that I did
10:38:29FromGitter<zacharycarter> making convincing roguelike graphics is hard
10:41:39FromGitter<krux02> well I think that ! really looks like a potion
10:41:57FromGitter<zacharycarter> lol
10:42:04FromGitter<zacharycarter> what I mean is
10:42:41FromGitter<zacharycarter> https://imgur.com/a/rkaCP
10:42:44FromGitter<zacharycarter> looks like shit :P
10:43:12FromGitter<zacharycarter> I'm just drawing rectangles and trying to overlay text on top of them
10:43:36FromGitter<zacharycarter> using signed distance field font shaders
10:43:44FromGitter<zacharycarter> but maybe my approach sucks
10:43:58FromGitter<krux02> where do you get your signed distance field from
10:44:04FromGitter<krux02> I tried to implement one on my own
10:44:14FromGitter<krux02> but somehow it was always bugged
10:45:29FromGitter<krux02> https://sites.google.com/site/broguegame/home/Torchlit%20staircase.png?attredirects=0
10:45:57FromGitter<zacharycarter> https://github.com/libgdx/libgdx/wiki/Distance-field-fonts has the shaders I used
10:46:14FromGitter<zacharycarter> and then my buddy that works on roguelikes has a bunch of fonts I test with
10:46:21FromGitter<zacharycarter> https://github.com/SquidPony/SquidLib/tree/master/assets
10:47:09*Yardanico quit (Remote host closed the connection)
10:47:32FromGitter<zacharycarter> one of my main problems is with font alignment
10:47:38FromGitter<zacharycarter> over the rectangles
10:48:00FromGitter<krux02> I recommend pixel fonts
10:48:09FromGitter<zacharycarter> I'm using bitmap fonts
10:48:14FromGitter<krux02> hmm
10:48:15FromGitter<zacharycarter> are those the same?
10:48:56FromGitter<krux02> what we mean is probably different
10:49:23FromGitter<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:41FromGitter<krux02> for example my font for programming is Terminus
10:50:02FromGitter<krux02> it is not a scalable font it is a bitmap font
10:50:29FromGitter<krux02> with that font you know the axact width
10:50:35FromGitter<zacharycarter> in pixels?
10:50:41FromGitter<krux02> with ttf fonts the with is often subpixel
10:50:51FromGitter<krux02> width
10:50:53FromGitter<zacharycarter> well I'm definitely using non ttf fonts
10:50:58FromGitter<krux02> ok
10:51:12FromGitter<zacharycarter> here's an example font I'm using
10:51:23FromGitter<zacharycarter> https://github.com/SquidPony/SquidLib/blob/master/assets/Iosevka-distance.fnt
10:51:32FromGitter<zacharycarter> https://github.com/SquidPony/SquidLib/blob/master/assets/Iosevka-distance.png
10:52:30FromGitter<ephja> so that's where the heart goes
10:53:02FromGitter<zacharycarter> :P
10:54:51FromGitter<krux02> but why do you need signed distance field fonts for a roguelike?
10:55:48FromGitter<zacharycarter> it was recommended to me to use them
10:57:41FromGitter<zacharycarter> @krux02 I made some map generation stuff over the weekend
10:58:13FromGitter<zacharycarter> https://github.com/zacharycarter/nimrl
10:58:18FromGitter<krux02> well for a 3d engine, yes, for a 2D game without free zooming, no not really
11:00:06FromGitter<krux02> My recommendation is, not to use ASCII art
11:00:12FromGitter<krux02> it is ugly
11:00:23FromGitter<ephja> https://te4.org/
11:00:38FromGitter<krux02> use some minimal graphics that also give you a unique style but on the other had is not too time consuming
11:00:56FromGitter<zacharycarter> it can be pretty
11:00:58FromGitter<zacharycarter> check out this
11:01:20FromGitter<zacharycarter> https://i.redd.it/wjcwjn6rrbkz.gif
11:01:25FromGitter<krux02> well pretty in the eyes of computer scientists who look at characters all day?
11:01:49FromGitter<zacharycarter> I think most folks would find that aesthetic appealing
11:01:53FromGitter<krux02> ok, that is pretty
11:02:09FromGitter<krux02> but that is closer to what I see as minimal graphics than to ascii art
11:02:17FromGitter<zacharycarter> well that's what I want to aim for
11:02:21FromGitter<zacharycarter> still ascii art
11:02:22FromGitter<zacharycarter> but looks good
11:02:29PMunchWow, that's really cool
11:02:39FromGitter<krux02> well then signed distance fonts is just a waste of time
11:02:51FromGitter<zacharycarter> it took like five minutes to implement
11:02:55FromGitter<zacharycarter> so screw it :P
11:03:10FromGitter<zacharycarter> writing the bitmap font loader took way longer
11:03:32FromGitter<zacharycarter> I need to find a font that has tiles like that
11:03:35FromGitter<krux02> don't focus on fonts
11:03:49FromGitter<krux02> you want to render sprites
11:03:51FromGitter<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:51FromGitter... Here are two by the way: https://github.com/nim-lang/c2nim/pulls [https://gitter.im/nim-lang/Nim?at=59c0f997c101bc4e3ae5944e]
11:04:10FromGitter<krux02> that style that you want to aims for as binary images that are tinted
11:05:15FromGitter<zacharycarter> okay
11:05:50FromGitter<krux02> and then eventually the pictures you use are very close to characters
11:06:53FromGitter<krux02> @zacharycarter I wonder where that gif is from that you posted
11:06:55FromGitter<krux02> it looks cool
11:07:04*RcdChen joined #nim
11:07:47FromGitter<zacharycarter> reddit.com/r/roguelikedev
11:07:55FromGitter<zacharycarter> https://www.reddit.com/r/roguelikedev/comments/6yieqt/testing_nonsquare_tiles_on_a_square_grid_what_do/
11:08:06FromGitter<zacharycarter> he definitely says in there it's a font :P
11:08:10FromGitter<zacharycarter> an 8x12 font on a 8x8 grid
11:08:34FromGitter<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:11PMunchThat's really cool
11:09:21FromGitter<zacharycarter> PMunch: I agree
11:09:33*sz0 joined #nim
11:10:11FromGitter<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:37FromGitter<krux02> it uses a 2D texture as a tilemap
11:10:50FromGitter<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:35FromGitter<zacharycarter> hehe I may end up going down that route
11:12:58*mahsav quit (Ping timeout: 264 seconds)
11:13:17FromGitter<krux02> and the texture can be arbitrarily big
11:15:59Araqcan you please stop creating eye cancer inducing "rogue-likes" and instead give me a new decent RTS?
11:16:11FromGitter<zacharycarter> if you make graphics for me sure
11:16:23Araqah the old problem.
11:16:36Araqthat was what stopped me back then too :P
11:16:46FromGitter<zacharycarter> hehe
11:16:55FromGitter<zacharycarter> actually maybe I can get started with just colored primitives
11:16:58FromGitter<Grabli66> Need more rogulike games :)
11:17:38FromGitter<zacharycarter> it'd be cool to do a lockstep networking demo for a rts with nim and zengine
11:18:10FromGitter<zacharycarter> need a networking library first
11:18:40FromGitter<Grabli66> Sockets? :)
11:18:48FromGitter<zacharycarter> yeah but something on top of that
11:23:37PMunchWhat kind of RTS Araq?
11:35:00PMunchHmm, zacharycarter wouldn't lockstep networking mean quite a bit of jitter?
11:35:36FromGitter<zacharycarter> nope
11:35:51FromGitter<zacharycarter> you basically have to implement lockstep networking for RTS games
11:36:38FromGitter<krux02> I would like the Total Annihilation syle of RTS
11:37:34FromGitter<zacharycarter> from my understanding anyway
11:37:35*claudiuinberlin joined #nim
11:37:58PMunchBut you'd have to synchronize the players inputs, so that they are ordered
11:38:07FromGitter<krux02> when lockstep networking means to synchronize the player actions and Simulate the game on each platfor independently, then I agree
11:38:26PMunchI was reading this: https://gafferongames.com/post/deterministic_lockstep/
11:38:38PMunchBut it only talks about input -> simulation
11:38:48PMunchAnd not Input <-> Input
11:38:52FromGitter<krux02> that approach has a disadvantage though, floating point math is not associatiive
11:39:12FromGitter<krux02> (a + b) + c ≠ a + (b + c)
11:39:24PMunchOh yeah, the floating point thing would probably not be required for an RTS though
11:39:30FromGitter<krux02> this can lead to a lot of nondeternimism in multithreaded code
11:39:36PMunchAt least not for the game logic
11:39:51FromGitter<krux02> for rendering, floating point is normally used
11:39:55FromGitter<krux02> yes
11:40:06FromGitter<krux02> fix point math
11:40:15FromGitter<krux02> as a lot of nice mathematicaly properties
11:40:28FromGitter<krux02> (a + b) + c = a + (b + c)
11:41:19PMunchYeah, 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:33PMunchAs long as the game is not dependent on it
11:42:09FromGitter<krux02> butterfly effect
11:42:19FromGitter<krux02> small changes have a huge impact at the end
11:42:20*qwertfisch quit (Ping timeout: 240 seconds)
11:42:27FromGitter<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:41FromGitter<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:39FromGitter<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:13FromGitter<krux02> @mratsim I know, even though that integer math is generally simpler in logic
12:08:41FromGitter<krux02> But I would argue that it is generally fast enoguh for most stuff
12:09:38FromGitter<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:00Arrrrhttps://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:34FromGitter<edubart> is there a way to create a seq with no initialization? (for performance reasons)
12:47:46FromGitter<krux02> no
12:47:47*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:48:04FromGitter<krux02> but you can minimize initialization costs
12:48:36FromGitter<krux02> newSeqOfCap for example creates a seq with the specified internal length
12:50:02FromGitter<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:16PMunchhttps://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:40PMunchedubart, then newSeqOfCap and .add() is what you want
12:50:56PMunchAssuming you are going to initialize the elements in order
12:51:24FromGitter<edubart> I wont initialize in order
12:51:25PMunchThat will allocate "cap" amount of elements and each add call will simply be to initialize an element
12:51:57FromGitter<zacharycarter> apparently c2nim can't handle -
12:51:57FromGitter<krux02> Well I am not so sure that you really need this super duper optimal initialization
12:52:20FromGitter<krux02> @edubart are you 100% sure that you need the last 0.1% of performance
12:52:23FromGitter<zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59c113077b7d98d30d135ff2]
12:53:21*kunev quit (Ping timeout: 248 seconds)
12:53:42FromGitter<zacharycarter> I'm attempting to generate bindings to steamworks using https://github.com/rlabrecque/CSteamworks
12:54:22*claudiuinberlin joined #nim
12:54:38Yardanicowhy you wouldn't try wrapping Steamworks itself? :)
12:54:54FromGitter<zacharycarter> because I have no idea how to interop with C++ code with Nim
12:54:55FromGitter<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:45FromGitter<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:03FromGitter<zacharycarter> yeah
12:56:04FromGitter<krux02> so instead of ``nim c -r `` you would need to call ``nim cpp -r``
12:56:06FromGitter<zacharycarter> yuck
12:56:34FromGitter<zacharycarter> I figured steamworks would have a C API but nooooo
12:56:59Araqon top of what krux02 said write barriers/refcounting does not work with uninitalized memory, never has, never will.
12:57:10FromGitter<ephja> everyone knows that you only really need C++ ;)
12:57:11FromGitter<edubart> @krux02 well this initializations can make a difference because I am working with a large chunk of memory (GBs of memory)
12:57:51Araqedubart: it's not an optimization, it doesn't work. even in C++.
12:58:51FromGitter<krux02> @edubart then cache misses can really cost you a lot
12:59:05FromGitter<krux02> worst case is a swap on each write
12:59:43FromGitter<krux02> A cache miss around 200 wasted CPU cycles
13:00:01FromGitter<krux02> depends on the CPU
13:01:27FromGitter<krux02> and initialization can make a measurable difference, but I really doubt that it can make an important difference in performance
13:01:28FromGitter<edubart> I know, but my algorithm I can't initialize in order, however I could avoid this extra initialization
13:02:03FromGitter<krux02> well you can use alloc
13:02:09FromGitter<krux02> if you really really want
13:02:20dom96Offtopic: 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:24AraqGBs of memory means your seq is too large
13:02:38Araquse a BTree instead, perhaps
13:02:48Araqdamn I need to make my bree a nimble package
13:03:05FromGitter<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:08euantordom96: #nim-offtopic exists for a reason ;)
13:03:20dom96euantor: Not enough people there.
13:04:17euantorFair enough
13:04:20*relax joined #nim
13:04:45FromGitter<edubart> @Araq unfortunately I cant work with small seqs in this case
13:05:33Araqyou can always work with BTrees, they are the foundation of most DBs out there
13:05:38PMunchdom96, simple that way you have more time for Nim :)
13:06:08Araqand they do not consist of "small" seqs either
13:06:30PMunchJust 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:46dom96PMunch: :)
13:06:58dom96Yeah, that's my thinking too.
13:07:09PMunchI choose a hard one, and I'm not happy about it :P
13:07:17PMunchs/choose/chose
13:07:49dom96PMunch: oh? if you don't mind my asking, what did you choose?
13:07:58FromGitter<ephja> "Opening the file.............." oh VS
13:08:19dom96There is a C++ obfuscation project that doesn't sound too difficult which I'm tempted to grab.
13:08:49FromGitter<krux02> there isn't even a c++ refactoring tool that works
13:09:02def-@krux02 they added one today
13:09:10FromGitter<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:38dom96I'm thinking I can just grab the clang parser, modify some AST nodes, and write the file. Job done.
13:09:43dom96But maybe I'm completely wrong :)
13:09:44PMunchdom96, 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:52FromGitter<edubart> and in my case initialize a seq of 1GB to zeros is uneeded, there is no hacky way?
13:09:53def-http://www.phoronix.com/scan.php?page=news_item&px=Clang-Refactor-Lands
13:10:29FromGitter<krux02> @edubart well you can work in chunks of smaller size
13:11:13FromGitter<krux02> are you doing computer vision?
13:11:23dom96PMunch: Sounds challenging, in a good way :)
13:11:47dom96Araq: What do you think, is obfuscating C++ code easy?
13:12:15def-dom96: what's the motivation for obfuscating c++?
13:12:16FromGitter<edubart> @krux02 yep, I'm doing computer vision in nim
13:12:26PMunchChallenging indeed..
13:12:40PMunchLooking forward to being done with it
13:12:45FromGitter<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:53dom96def-: To hide proprietary information and intellectual property.
13:13:04PMunchThen I can do some fun stuff like implementing lock-step networking for RTS games :P
13:14:35def-dom96: Compile it without debug info?
13:14:46FromGitter<krux02> maybe you get some luck when you do a low level obfuscater that just replaces identifiers with new random identifiers
13:14:58dom96def-: lol
13:15:04*arnetheduck joined #nim
13:15:08FromGitter<krux02> some obfuscator that doesn't even understand c++ it just knows literals
13:15:12dom96I guess I would have to ask for more details
13:15:42def-dom96: but clang ast is fun to work with
13:15:51*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:15:57FromGitter<krux02> is it?
13:16:09dom96oh ok: " so that the
13:16:09dom96source code may be disseminated widely while making it vi
13:16:09dom96rtually impossible for the underlying
13:16:09dom96algorithms or other IP in the code to be easily understood or recreated in its original form. "
13:16:23dom96bah, sorry, stupid PDF reader can't copy.
13:16:24def-yeah, even complex pattern matchers are easy to register
13:17:02def-But I'm just doing static analysis, dunno about outputting new nodes
13:17:10dom96so the idea is to send someone the source code ... but then what's even the point in that.
13:17:37def-dom96: yeah, i wouldn't want to work on a project that can't convince that it makes sense
13:18:21def-but it's probably for some obscure platforms, so users of the lib can compile it on their own
13:19:15dom96yeah, it explains later that this makes it more flexible than having to issue object files for each target platform/compiler.
13:19:25FromGitter<krux02> @edubart have you measured that initializing to zero is costing you too much performance
13:19:33dom96but meh.
13:20:23FromGitter<edubart> @krux02 if I could disable initialization I would measure..
13:20:25dom96Another 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:43Yardanicorevive nimfix?
13:21:06FromGitter<krux02> well you can measure the time it takes to call ``newSeq``
13:21:19dom96I 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:26FromGitter<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:17FromGitter<edubart> @krux02 I used linux perf tool, one of the top functions is __memset_erms with 7% cpu usage
13:32:09FromGitter<edubart> and there is almost no case that I need __memset_erms to be called
13:32:35FromGitter<krux02> well maybe you can reuse old seq values instead of reallocating them
13:32:40FromGitter<edubart> having this 7% for other tasks could make a difference for me
13:33:03FromGitter<krux02> that is considered memory pooling
13:33:36FromGitter<krux02> my guess is that you create a lot of new seq values
13:33:37FromGitter<edubart> this would need to make an "allocator", would be too much burden, nim already have a good allocator
13:33:48FromGitter<krux02> how much does the allocation cost you?
13:35:21FromGitter<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:31FromGitter<krux02> then you can really skip initialization
13:35:49FromGitter<krux02> you still do it once at program start, but that's it
13:35:57FromGitter<krux02> no additional initialization costs
13:40:20FromGitter<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:29FromGitter<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:21Araq'seq of float' is fine
13:45:30Araq'seq of string' would never work
13:46:43*relax joined #nim
13:46:43FromGitter<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:45AraqnewSeqOfCap can skip initialization for types that are not GC'ed
14:06:51AraqI mean it "could"
14:06:57Araqno language change required
14:07:02Araqno new API required
14:07:30Araqand 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:23FromGitter<edubart> Just did #6402
14:24:30FromGitter<zacharycarter> @stisa I guess https://github.com/stisa/jswebsockets doesn't work with nodejs?
14:26:03FromGitter<stisa> @zacharycarter probably not
14:26:13FromGitter<zacharycarter> :/
14:27:00FromGitter<stisa> PRs are welcome :D
14:27:31FromGitter<zacharycarter> well I'm trying to get https://github.com/websockets/ws
14:27:32FromGitter<zacharycarter> and
14:27:39FromGitter<zacharycarter> https://github.com/niv/websocket.nim
14:27:42FromGitter<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:37Yardanicoedubart: AFAIK it would work not only for numbers, but for any value types
14:44:19*askatasu1 quit (Client Quit)
14:45:17FromGitter<zacharycarter> sweet got websockets working
14:45:25FromGitter<zacharycarter> and a node steamworks client
14:45:27*yglukhov joined #nim
14:45:29FromGitter<zacharycarter> time to write a multiplayer game server :D
14:47:33federico3using websockets or 0mq?
14:47:48FromGitter<zacharycarter> websockets
14:49:14FromGitter<zacharycarter> heh I should just bind to - https://github.com/gamestdio/colyseus
14:49:17FromGitter<zacharycarter> going to get coffee and try that
14:49:29FromGitter<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:43FromGitter<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:02FromGitter<Grabli66> How to install ornim ? It does not have .nimble file :)
16:02:49Yardanicoyes it doesn't
16:03:15Yardanicoand it's orMin, not orNim :)
16:03:48Yardanicojust clone it and see example
16:04:10FromGitter<Grabli66> ok
16:05:50*BigEpsilon quit (Ping timeout: 240 seconds)
16:05:51Yardanicobut it probably would have a nimble package in the future
16:13:56subsetparkAraq: did you ever consider adding a bind proc to the Options module?
16:14:59subsetparkhttps://www.irccloud.com/pastebin/aB77rjui/
16:18:20*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
16:21:55FromGitter<zacharycarter> how do you bind a UDP socket to a port with the net module?
16:22:49Yardanicoyou can't ? udp is connection-less
16:23:18*solitudesf quit (Remote host closed the connection)
16:24:05FromGitter<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:46Yardanicomaybe try bindAddr?
16:26:01*arnetheduck quit (Ping timeout: 240 seconds)
16:26:11FromGitter<zacharycarter> yeah I was thinking that the docs say - ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59c14522b59d55b823161eee]
16:26:17FromGitter<zacharycarter> so I dunno
16:29:00Yardanicowell you don't need to bind UDP socket in Nim
16:29:11Yardanicobecause recvFrom accepts IP and port
16:29:39YardanicoReceives data from socket. This function should normally be used with connection-less sockets (UDP sockets).
16:30:00FromGitter<zacharycarter> ah okay
16:30:22FromGitter<zacharycarter> thanks @Yardanico
16:32:37subsetparkzacharycarter, you should switch to irccloud... your nick is too long to have no autocomplete
16:33:58FromGitter<zacharycarter> i'll have to consider it subsetpark
16:34:48FromGitter<zacharycarter> hrm interesting I just found asyncnet but i guess there's no udp support?
16:35:23FromGitter<Bennyelg> Anyone use amazon aws services with nim?
16:35:38FromGitter<Bennyelg> I know boto3 for python, but I couldn't find something that actually work well on nim
16:35:55YardanicoI think there's no such thing yet
16:36:29Yardanicothere's only this - https://github.com/aidansteele/aws_sdk.nim
16:36:33Yardanicobut it's low-level
16:36:45FromGitter<zacharycarter> what are you trying to do @Bennyelg
16:36:51FromGitter<zacharycarter> I've written lambda jobs in Nim
16:36:57FromGitter<zacharycarter> but that's about all I've figured out how to do
16:37:32FromGitter<Bennyelg> Nice, ⏎ Im trying to manage services for example raise an emr , ec2's interact with s3 file storage
16:37:36FromGitter<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:20FromGitter<zacharycarter> you mean for the lambda job @zetashift ?
16:38:29FromGitter<Bennyelg> yes, ⏎ once we have strong interaction with aws and their services this will encourage many others to investigate nim.
16:38:51FromGitter<zacharycarter> @Varriount is working on a aws api for Nim but I think it's stalled out atm because he has school
16:38:56FromGitter<Bennyelg> most of the audions (the bigs tech companies) are on aws/google
16:39:11FromGitter<Bennyelg> How old is he?
16:39:18FromGitter<Bennyelg> can I find it on git?
16:39:28FromGitter<Bennyelg> Maybe I'll continue to do so
16:39:42FromGitter<zacharycarter> I don't think it's on git
16:39:49FromGitter<Bennyelg> too bad :(
16:39:54FromGitter<zacharycarter> I'd ping him if you're curious about it but he's usually on late(r)
16:40:19FromGitter<zacharycarter> he's going the approach of generating bindings from the jsondocs I believe
16:40:59FromGitter<zacharycarter> so it's a large effort
16:41:00FromGitter<Bennyelg> Of course I'm curious,
16:41:00FromGitter<Bennyelg> Ic, yea, I'll dig first on amazon botocore written in python and see how they implemented stuff
16:42:04FromGitter<Jipok> Is there a beautiful way to compare floats?
16:42:08FromGitter<Jipok> not like float1 <= (float2 + 0.000001)
16:42:47Yardanico round? :)
16:43:06Yardanicoor this
16:43:34*yglukhov quit (Remote host closed the connection)
16:44:15Yardanicoabs(f0-1) < 1E-7 to compare if f0 equals to f1
16:46:00FromGitter<zacharycarter> hmmm apparently - https://github.com/zielmicha/reactor.nim has async udp sockets
16:46:06FromGitter<zacharycarter> but the build is broken
16:46:11FromGitter<Jipok> round to the fifth sign? will it be slower than just adding 0.000001?
16:46:39FromGitter<zacharycarter> and no windows support ugh
16:46:53FromGitter<zacharycarter> I guess websockets are my best option atm
16:52:44*Jesin quit (Quit: Leaving)
16:56:28FromGitter<zetashift> @zacharycarter yea!
16:57:45*nsf joined #nim
17:05:14FromGitter<Jipok> I think I found a beautiful solution for myself
17:05:19FromGitter<Jipok> https://gist.github.com/Jipok/3f59d36c8e537db0949fb3f17cad538b
17:09:03*sz0 quit (Quit: Connection closed for inactivity)
17:11:19Araqjipok: it's better to define a different operator for this like =~
17:12:14FromGitter<Jipok> good idea, thx
17:12:28Araqalso you usually need to do a numerical analysis about the possible error intervals :P
17:12:33*krux02 joined #nim
17:14:05FromGitter<ephja> https://github.com/BitPuffin/linagl/blob/master/src/linagl/vector.nim#L32
17:14:21Yardanicooh
17:14:23Yardanico2013 :)
17:14:41FromGitter<Jipok> It's not a problem. 1E-7 is enough. ⏎ Is `=~` in the standard library?
17:14:54Yardanicono
17:16:49FromGitter<ephja> ✈
17:17:13Yardanicoyay unicode
17:17:28Yardanicolol, first character wasn't displayed in hexchat :P
17:17:44Yardanico(but it works in other programs tho)
17:17:48*Jesin joined #nim
17:18:05krux02well that's a hexchat problem
17:18:16krux02on emacs it works :P
17:18:25FromGitter<ephja> old font and no fallbacks?
17:18:30Yardanicowell it seems it's not a problem with hexchat
17:18:36FromGitter<ephja> or old font and old fallbacks
17:18:38YardanicoI just use different font in browser and terminal/hexchat
17:19:38FromGitter<ephja> is anyone interested in font ligatures? https://github.com/tonsky/FiraCode
17:19:57krux02I know that project
17:20:57Yardanicowell it wouldn't be hard to add them in nim
17:21:15Yardanicotemplates with unicode characters as names ? :)
17:21:28*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
17:21:28krux02would be nice
17:21:51krux02¬∨∧ for not or and
17:22:15krux02but if then Nim should have full unicode support
17:22:50FromGitter<ephja> template ↻(x: untyped) = while true: x
17:23:04krux02and unicode and askii symbols should be composable in operators like ~¬∧∧&++
17:23:24krux02template ℤ = int
17:23:55krux02but mathematically it's wrong, so I wouldn't vote for it
17:25:05krux02template ∞ = inf
17:25:30*Snircle joined #nim
17:26:24krux02template `:=`(a,b): untyped = let a = b
17:26:27FromGitter<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:45krux02there are keyboard layouts :P
17:26:53krux02and there is emacs
17:27:40FromGitter<ephja> yeah but there are so many characters to choose from
17:27:59FromGitter<ephja> how does emacs make it easier?
17:28:47FromGitter<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:04FromGitter<ephja> ok
17:32:59*yglukhov joined #nim
17:34:12FromGitter<ephja> identifiers containing characters from certain ranges could be added to some kind of list :p
17:34:26*Ven`` joined #nim
17:34:37Yardanicois there any information when "using" will become an official language feature? e.g. without {.experimental.} pragma
17:34:42Yardanico*about
17:34:59*relax joined #nim
17:36:07ArrrrAlso, i think araq wanted to make {.self.} default for first arguments
17:37:14FromGitter<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:54FromGitter<krux02> me neither
17:37:58FromGitter<Varriount> @Bennyelg Regarding AWS, I only have bits and pieces.
17:38:02Yardanicoand also "future" module - when will procs from it get into system?
17:38:17Yardanicoor it will always be like future?
17:38:58*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
17:39:25FromGitter<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:40FromGitter<Varriount> However the authorization code seems to be broken. Hm.
17:40:02FromGitter<Bennyelg> Ic, if you can share it will be greate
17:40:08FromGitter<Bennyelg> its something to starts with
17:40:20*olwi joined #nim
17:42:07*nsf quit (Quit: WeeChat 1.9)
17:42:44FromGitter<ephja> how readable is implicit passing of 'self' anyway?
17:43:00*claudiuinberlin joined #nim
17:43:08FromGitter<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:06AraqYardanico: do you like 'using'?
18:00:21*gokr joined #nim
18:01:57*olwi left #nim ("Leaving")
18:09:52YardanicoAraq, 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:25Araqsince it's an explict keyword anyway I'll make it non-experimental with the next version
18:11:08Yardanicobut AFAIK using doesn't support generic types
18:11:20*nsf joined #nim
18:11:47Yardanicoand also I finally can understand the meaning of ";" vs "," in proc arguments :)
18:12:50ArrrrI thought there was none
18:12:56Yardanicowell there is
18:13:02FromGitter<Varriount> ";" and "," aren't the same?
18:13:06Yardanicoyes, they aren't
18:13:14Yardanicofor example, in generic types
18:14:43YardanicoI can't find it in manual :P
18:15:25Yardanicoah
18:15:26Yardanicofound it
18:15:34Yardanicohttps://nim-lang.org/docs/manual.html#procedures
18:15:44Yardanico';' stops type propagation.
18:16:08*nsf quit (Client Quit)
18:16:18YardanicoIt's the same in "a: int; b: int", but not the same in "a; b: int"
18:17:09ArrrrNoice
18:19:21*Guest89124 quit (Quit: Leaving)
18:19:41*scriptum joined #nim
18:20:43dom96yay, I'm improving the osinfo module (which is one of the first Nim modules I've written!)
18:21:29Yardanicoit's a module in stdlib?
18:21:39Yardanicoah, no
18:24:38*PMunch joined #nim
18:49:29YardanicoAraq, 0.18.0 is the next version, right? or 0.17.4?
18:49:38Yardanicoor 1.0 ? :P
18:49:56Araq0.18 == v1 release candidate ...
18:50:01*Araq is allowed to dream
18:50:55Yardanico1.0 RC1
18:51:56FromGitter<Bennyelg> :D
18:56:00Yardanicoyeah, indeed, why nim versions are 0.x?
18:56:11Yardanicothey should've been 1.0 RC1, 1.0 RC2, 1.0 RC3 :D
18:56:15Yardanico1.10 RC 17.2
18:56:18Yardanico*1.0
19:01:41FromGitter<ephja> yeah why not have 68 release candidates :p
19:02:25FromGitter<krux02> yay
19:03:03dom96https://github.com/dom96/analytics/tree/master
19:03:21Yardanicoyay!
19:03:50Yardanicouh, "only generate this once per user", this is the way how google analytics works?
19:04:17Yardanicowell I think you can make some user-specific ID, we should make a package for that! :P
19:04:41dom96this package already provides this proc
19:04:45Yardanicooh, yes, sory
19:05:02*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:05:14dom96so far this package uses the most packages, I think.
19:05:25dom96as far as my own packages go.
19:08:14*claudiuinberlin joined #nim
19:11:10Yardanicodom96, 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:31Yardanicoah, you also have conditions
19:11:45Yardanicowell you can use tables and rewrite this procedure a bit :)
19:12:00dom96Yardanico: you should submit something similar into the `uri` module
19:12:03*yglukhov joined #nim
19:12:37Yardanicohmm, but then I would add "cgi" dependency to uri :)
19:12:59FromGitter<ephja> the parser libs are neat
19:13:18dom96Yardanico: that stuff should be moved to uri anyway
19:13:39Yardanicodom96, well yeah, I personally agree since encodeUrl is not useful only in CGI apps
19:14:12dom96yep, PR would be awesome for this :)
19:14:26FromGitter<ephja> I wonder what the equivalent interface is in java
19:15:38*ipjk joined #nim
19:17:07*zachk joined #nim
19:21:13Yardanicohttps://stackoverflow.com/questions/10786042/java-url-encoding-of-query-string-parameters
19:21:22YardanicoURLEncoder.encode(q, "UTF-8")
19:21:50Yardanicooh, and other one says that it's better to use URIBuilder
19:23:41Yardanicosorry for java (I've never actually used it :P)
19:27:25*Vladar quit (Quit: Leaving)
19:27:41*salewski joined #nim
19:28:58salewskiIs it possible to pass a proc to a macro and then to investgate the proc parameter list?
19:29:40Yardanicosalewski, yes
19:30:41salewskiI tried for more than one hour to find an example or a starting point -- no success.
19:30:49Yardanicowell yeah, it's not very straightforward
19:31:04Yardanicosalewski, https://gist.github.com/Yardanico/48a52f4d49245983ea0103d1b5096126
19:31:15Yardanicowith prc.symbol.getImpl() you get your procedure implementation
19:31:42Yardanicoand it has to be "typed"
19:32:13FromGitter<Jipok> How to display a float? ⏎ I wanna get 0.00000023 ⏎ but got 2.2e-07
19:32:29YardanicoformatFloat from strutils?
19:32:45salewskiYardanico thanks!
19:34:54*Trustable quit (Remote host closed the connection)
19:35:26Yardanicoit's sad that you can't specify the language of a gist without specifying file name
19:35:40Yardanicoit's hard to name files :D
19:35:49*skrylar joined #nim
19:35:59skrylarwell, who knows if i'll be around to write more nim modules /shrug
19:36:03skrylarprobably going to end up homeless
19:38:27subsetparkdom96: 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:22FromGitter<zacharycarter> I'm trying to rip apart the snake example, can anyone explain to me why this won't compile?
19:47:43FromGitter<zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59c1745e210ac269204f2303]
19:47:58FromGitter<zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59c1746e7b7d98d30d15a06d]
19:48:49FromGitter<Yardanico> try to rename req to request :P
19:48:54FromGitter<Yardanico> proc onRequest(gameServer: Server, req: Request) {.async.} =
19:49:02FromGitter<Yardanico> or change it to ⏎ proc onRequest(gameServer: Server, req: Request) {.gcsafe, async.} =
19:49:08FromGitter<Yardanico> this *might* helop
19:50:48FromGitter<zacharycarter> thanks I'll try both
19:51:36FromGitter<zacharycarter> the {.gcsafe, async.} pragma did the trick
19:52:26dom96subsetpark: can you elaborate, I'm not following
19:54:51subsetparkdom96: is it the case that most procedures which are implemented as operators - `&`, `+` - have equivalent named bindings - eg, concat, add?
19:56:23Yardanicohmm, actually true
19:56:28Yardanicoeven ints have "inc" procedure
19:56:37Yardanicoe.g. i + 1 equals to i.inc(1)
19:56:53Yardanicobut I don't know if it's the convention
19:58:07subsetparkIn 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:17YardanicoYAY, yglukhov release his game!
20:01:36Yardanicohttps://forum.nim-lang.org/t/3180
20:04:03dom96subsetpark: no
20:04:30Yardanicooh, it also uses nimx
20:04:37dom96Took yglukhov long enough :)
20:05:11FromGitter<superfunc> whats the .01%?
20:05:31Yardanico?
20:05:45FromGitter<superfunc> Oh, from the post it said its 99.99% Nim code
20:06:00Yardanicowell other code is probably JS
20:06:05Yardanicoalso it uses nimx
20:06:10Yardanicohttps://github.com/yglukhov/nimx
20:06:20Yardanicobut I have a feeling that JS generated code is hand-modified
20:06:31FromGitter<superfunc> Nimx is cool, I wrote my personal todo app in it
20:06:51Yardanicoit seems it's an nim in asm.js + some code in JS
20:06:57PMunchA Facebook game written in *pure* Nim?
20:07:17*claudiuinberlin joined #nim
20:07:20Yardaniconim can compile to JS, so it seems.. yes :)
20:07:45*rokups quit (Quit: Connection closed for inactivity)
20:09:20Yardanicoyglukhov, 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:08PMunchThat's pretty cool
20:13:38yglukhovYardanico: 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:01Yardanicoyglukhov, well I only saw this talk on youtube :P
20:15:34yglukhovthe other 0.1% is js, c, and shell scripts for the gitlab-ci =)
20:15:54YardanicoC?
20:15:59Yardanicoyglukhov, did you use emscripten?
20:16:11yglukhovyup
20:16:13Yardanicoah
20:16:38yglukhovoh, and there's around 500loc java for android =)
20:16:58Yardanicoit's not only on facebook?
20:17:01*vlad1777d joined #nim
20:17:19Yardanicoah, iOS and Android coming soon
20:17:27Yardanicogoogle is the best https://onsetgame.com/static/presskit/Reel_Valley_Press_Kit.pdf
20:28:45*PMunch quit (Quit: leaving)
20:29:40FromGitter<zacharycarter> does this make sense?
20:29:44FromGitter<zacharycarter> ``````
20:29:47subsetparksecond convention question: should I be writing `proc foo[T, T2]` or `proc foo[A, B]`?
20:30:16Yardanicoprobably A, B
20:30:33FromGitter<Yardanico> @zacharycarter ehm?
20:31:00FromGitter<Yardanico> you're creating a JSON from some string, and then getting a string from this JSON?
20:31:32FromGitter<Yardanico> also for some reason IRC bridge completely removed your code
20:31:45FromGitter<zacharycarter> %* creates a JSONNode not a string right?
20:32:01*manjaro-kde5- quit (Quit: Konversation terminated!)
20:32:12FromGitter<zacharycarter> basically I have a object I want to marshall into a string
20:32:15FromGitter<zacharycarter> how do I do that?
20:32:47FromGitter<Yardanico> well if you would read it in Nim after that, use marshal module?
20:32:55FromGitter<Yardanico> https://nim-lang.org/docs/marshal.html
20:33:05FromGitter<zacharycarter> this is just for sending over websockets
20:33:09FromGitter<Yardanico> ah, maybe use it then
20:33:15FromGitter<Yardanico> https://nim-lang.org/docs/marshal.html
20:33:51*Yardanico quit (Remote host closed the connection)
20:33:56FromGitter<zacharycarter> thanks
20:34:27dom96yglukhov: awww, emscripten? Where did Nim's JS backend fall short?
20:37:05yglukhovdom96: 1 missing feature - finalizers =). but the real reason is performance. js is order of magnitudes slower.
20:38:29yglukhovwe're using js backend, just not for the game itself.
20:40:53FromGitter<Yardanico> Ah yes, browsers can speed up asm.js code
20:41:17dom96I see
20:41:21subsetparkdom96: 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:17dom96check the paths that the compiler adds
20:42:25dom96it should print them out at the start
20:43:15subsetparkhm, only that it's using the config file from my choosenim distro
20:43:33subsetparkshould 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:22dom96maybe try turning up the verbosity: --verbosity:3
20:49:25*gangstacat quit (Ping timeout: 255 seconds)
20:49:56FromGitter<zetashift> @yglukhov does it use Rod as the engine?
20:50:05yglukhovyup
20:50:07subsetparkoh well, boostrapping the compiler and using that worked anyway.
20:50:54dom96yglukhov: 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:00yglukhovdom96: sure, that would be awesome, i guess =) it's just... the source code is not on github :D
20:52:17FromGitter<zetashift> @dom96, trying out choosenim, using choosenim stable gets me version 0.17.0 and not 2
20:52:25FromGitter<zetashift> 1) 17.2*
20:53:59dom96yglukhov: that's okay, we can link to the game on FB :)
20:54:16yglukhovcool
20:55:00dom96yglukhov: 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:47dom96zetashift: choosenim update stable?
20:56:34FromGitter<zetashift> ah man that's so smart I should read README's completely before typing
20:58:03FromGitter<zacharycarter> https://gist.github.com/zacharycarter/b1eb4cce330ada585b25567bb1532d88
20:58:06yglukhovdom96: hrm... do current ones have style? :P
20:58:18yglukhovill try to find something thoug
20:58:32FromGitter<zacharycarter> I could use some help here - for some reason my reader proc never receives any messages
20:58:51dom96current ones don't have any logos
21:01:03*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
21:01:07yglukhovdom96: does it necessarily have to be a square with smth? or just a transparent png with appropriate size would do?
21:01:34dom96zacharycarter: your SDL loop never gives the async loop any time to do work it seems
21:01:39FromGitter<zacharycarter> oh it does read data but only once I've killed the process :P
21:01:54FromGitter<zacharycarter> @dom96: how can I do that?
21:02:00dom96You should call asyncdispatch.poll after limitFramerate
21:02:04dom96instead of using runForever
21:02:10FromGitter<zacharycarter> thank you
21:02:25dom96yglukhov: that should be fine
21:02:39yglukhovzacharycarter, dom96: i dont think that would be THAT easy ;)
21:03:40yglukhovsdl and async do not cooperate nicely, if we're talking performance/efficiency.
21:04:56dom96perhaps not, but it's a good hint to get zacharycarter on track
21:05:45FromGitter<zacharycarter> hrm if I don't do runForever my game loop instantly quits
21:06:18FromGitter<zacharycarter> https://gist.github.com/zacharycarter/11720329f7a84236d4a55be8c712b999
21:07:22yglukhovzacharycarter: 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:42yglukhovbut like i said, you can regret =)
21:07:48FromGitter<zacharycarter> hehe
21:08:27yglukhovzacharycarter: nimx provides http request function that plays nicely with the rest of nimx runloop
21:08:39yglukhovbe it sdl or js or whatever internally
21:08:48FromGitter<zacharycarter> does it support websockets?
21:09:19yglukhovno persistent connections. its just a request-response api.
21:09:29yglukhovno full-blown asyncdispatch
21:09:38FromGitter<zacharycarter> gotcha
21:09:58FromGitter<zacharycarter> I'm trying to write a client with websockets for my sdl2 game
21:10:15FromGitter<zacharycarter> probably obvious
21:10:43yglukhovsdl2 sucks, unfortunately. this is one of the reasons i want nimx to get away from it.
21:11:06yglukhovi mean, sdl2 is nice, just not the runloop related stuff in it.
21:11:47yglukhovzacharycarter: you could consider background communication thread as an option.
21:12:13yglukhovin background threads you can do full-blown asyncdispatch, just not the main thread.
21:12:14FromGitter<zacharycarter> ugh then I'm dealing with channels or shared heap
21:12:29FromGitter<zacharycarter> it's not a terrible idea
21:12:46yglukhovin fact thats how nimx handles http
21:12:54FromGitter<zacharycarter> do you use channels or a shared heap?
21:12:58yglukhovbut your case is a bit more complex
21:13:07FromGitter<zacharycarter> aye
21:13:12yglukhovneither of those.
21:13:29FromGitter<zacharycarter> how do you communicate between threads then?
21:14:53yglukhovi'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:24yglukhovgotta be careful with those. =)
21:15:28dom96For a persistent connection you'd need a channel.
21:15:33FromGitter<zacharycarter> gotcha
21:15:45FromGitter<zacharycarter> I'll play around with channels and try it out
21:15:51yglukhovand a channel will not work again (
21:15:54dom96sucks that sdl needs this
21:16:03FromGitter<zacharycarter> why won't a channel work?
21:16:19yglukhov* if we're talking performance/efficiency =))
21:16:26FromGitter<zacharycarter> I guess createShared it is!
21:16:33yglukhovbecause you'll end up with the same problem again
21:16:42yglukhovpolling from 2 different sources
21:17:50*relax quit (Ping timeout: 240 seconds)
21:18:24yglukhovzacharycarter: i've been already thinking about it. you might want to implement your own semi-async-one-way-channel-monster.
21:18:35yglukhovit will work in the following way:
21:18:57yglukhovopen a pipe between main and background thread.
21:19:05*gangstacat joined #nim
21:19:15yglukhovmain thread sends messages by writing to the pipe
21:19:21dom96You should test the performance using async and sdl2 like I described first IMO
21:19:34dom96Perhaps for your use case it will be fast enough
21:19:45yglukhovbackground thread uses asyncdispatch on the read end of the pipe
21:20:06yglukhovbackground thread sends messages to the main thread with sdl_sendmessage
21:20:18yglukhovand that completes the cycle
21:20:26FromGitter<zacharycarter> interesting
21:21:03FromGitter<zacharycarter> dom96: I'm willing to try I'm just not sure how to fix my example
21:22:04yglukhovzacharycarter: put asyncdispatch.poll into your sdl event loop
21:22:15yglukhovnot after. but into.
21:22:24FromGitter<zacharycarter> oh okay
21:22:45yglukhovgive it some small timeout. e.g. 1
21:23:04yglukhovand make sure sdl_poll doesnt block either
21:24:51FromGitter<zacharycarter> yeah that's pretty slow
21:25:00FromGitter<zacharycarter> it worked though :P
21:27:22*gangstacat quit (Ping timeout: 264 seconds)
21:27:36yglukhovzacharycarter: well what did i tell you? =)
21:27:41*Arrrr quit (Read error: Connection reset by peer)
21:28:26dom96did you ensure that SDL's poll isn't blocking?
21:28:44FromGitter<zacharycarter> I don't know how to do that
21:28:49dom96I'm guessing it's only returning when an event occurs (you move the mouse etc.)
21:29:04FromGitter<zacharycarter> ah let me verify that
21:29:36yglukhovyes, by default it blocks afair
21:29:40FromGitter<zacharycarter> seems that way
21:30:30FromGitter<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:40FromGitter<zacharycarter> but it seems it does :/
21:31:15yglukhovtry SDL_WaitEventTimeout
21:31:39FromGitter<krux02> I think a nice interface for SDL_PollEvent() would be an iterator for all queued events
21:31:45FromGitter<krux02> but yea that doesn't help
21:32:03FromGitter<krux02> I wonder wher SDL_PollEvent() suspends the main loop
21:32:23yglukhovi think a nice interface would be `await nextEvent()` =)
21:32:31FromGitter<krux02> normally buffer swapping also fills the event queues
21:32:53FromGitter<krux02> @Yardanico maybe that, too
21:33:22FromGitter<krux02> but normally on the main look you poll for events and process them
21:33:33FromGitter<krux02> loop
21:34:02FromGitter<krux02> actually waiting for an event is a rare thing
21:34:13FromGitter<krux02> but it's good that it is possible
21:34:30yglukhovtrue, i just wanted to emphasize that sdl should play nicely with asyncdispatch with is unlikely to happen (
21:34:53yglukhov*which is
21:35:27FromGitter<zacharycarter> waitEventTimeout doesn't work either
21:35:41FromGitter<zacharycarter> I'll play with a background thread
21:35:46yglukhovhuh? why not?
21:35:49FromGitter<krux02> @zacharycarter where is poll event blocking?
21:35:58*ipjk_ joined #nim
21:36:40FromGitter<zacharycarter> ```while sdl2.waitEventTimeout(evt, 0): ⏎ asyncdispatch.poll(1)``` [https://gitter.im/nim-lang/Nim?at=59c18de8614889d4751a933f]
21:36:50FromGitter<zacharycarter> websocket message is received as soon as I move my mouse
21:36:58*gangstacat joined #nim
21:37:49FromGitter<zacharycarter> tried with a timeout of 1000
21:37:51FromGitter<zacharycarter> that didn't work either
21:38:34yglukhov1
21:38:39yglukhovset timeout to 1
21:38:48*ipjk quit (Ping timeout: 240 seconds)
21:39:25FromGitter<zacharycarter> still doesn't process anything until I make an event happen by moving my mouse
21:39:50yglukhovwindows?
21:40:24FromGitter<zacharycarter> osx
21:43:14yglukhovstrange. tbh im out of ideas
21:43:24yglukhovbut you're so close... =)
21:43:35*gangstacat quit (Quit: Ĝis!)
21:43:47FromGitter<krux02> @zacharycarter there are sdl functions to filter the events
21:44:06FromGitter<krux02> maybe when you are more specific about the type of events you want to receive, you have more luck
21:44:37FromGitter<zacharycarter> good idea I'll try that
21:44:41FromGitter<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:24FromGitter<krux02> https://wiki.libsdl.org/SDL_EventState
21:47:26FromGitter<krux02> simplest way to prevent events to appear in the event queue
21:47:28*nsf joined #nim
21:48:45FromGitter<krux02> and this to be more specific
21:48:46FromGitter<krux02> https://wiki.libsdl.org/SDL_SetEventFilter
21:57:45FromGitter<zacharycarter> hrm interesting
21:57:54FromGitter<zacharycarter> my application doesn't quit after calling jointhread
21:58:33*TjYoco quit (Quit: Leaving)
22:00:47FromGitter<zacharycarter> bleh I can't use another thread
22:01:02FromGitter<zacharycarter> readData from the websocket library isn't gcsafe
22:02:28FromGitter<zacharycarter> any ideas?
22:02:40FromGitter<zacharycarter> of am i screwed?
22:02:44FromGitter<zacharycarter> or*
22:03:14*salewski quit (Quit: WeeChat 1.9)
22:03:41yglukhovwhy isnt it gcsafe?
22:03:58yglukhovit uses global refs?
22:04:17*pilne joined #nim
22:04:32FromGitter<zacharycarter> not really sure
22:05:04yglukhovwell the error should give you a hint
22:05:09FromGitter<zacharycarter> https://github.com/niv/websocket.nim/blob/master/websocket/shared.nim#L151
22:05:35FromGitter<zacharycarter> I guess I'll clone the library and find out
22:07:40FromGitter<zacharycarter> I'll PR
22:09:29FromGitter<zacharycarter> or I'll patch for my purposes anyway, I doubt he's going to want my idea for a PR
22:12:05yglukhovmaking that work in a thread is something anyone would like imo
22:13:00FromGitter<krux02> @zacharycarter There is SDL_PeekEvents that does not do blocking
22:13:10yglukhovbesides by contributing to original repo you make it easier for yourself, because you'll not have to maintain it once its merged ;)
22:13:17FromGitter<krux02> SDL_PollEvent does call SDL_PumpEvents implicityl
22:14:32yglukhovah its reqPing
22:14:39yglukhovi think...
22:16:08FromGitter<zacharycarter> yeah it is
22:19:22FromGitter<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:26FromGitter<zacharycarter> do I have to do something special to install a nimble project with ssl support?
22:25:20FromGitter<zacharycarter> nevermind
22:25:31FromGitter<zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59c1995b614889d4751ac474]
22:25:34FromGitter<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:43FromGitter<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:11FromGitter<Yardanico> I think the features are not commonly known in Nim community :(
22:40:31FromGitter<Yardanico> *these
22:45:42*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
23:13:45FromGitter<Varriount> I wish term-rewriting had a different syntax. It means adding even more information to an already-burdened function signature.
23:16:03FromGitter<zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59c1a533c101bc4e3ae915e9]
23:16:07FromGitter<zacharycarter> fails to compile
23:17:48*chemist69 quit (Ping timeout: 240 seconds)
23:17:56FromGitter<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:21FromGitter<zacharycarter> how about it
23:35:56FromGitter<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:52FromGitter<krux02> well i see squares
23:54:50FromGitter<krux02> how do I use mixin with macros?
23:54:56FromGitter<krux02> I know bindSym
23:55:03FromGitter<krux02> and I know ident
23:55:43FromGitter<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)