<< 28-02-2017 >>

00:01:40*TheManiac quit (Ping timeout: 245 seconds)
00:01:40*erwana[m] quit (Ping timeout: 245 seconds)
00:02:05*euantor quit (Ping timeout: 245 seconds)
00:02:30*MightyJoe quit (Ping timeout: 245 seconds)
00:02:30*jivank[m] quit (Ping timeout: 245 seconds)
00:03:14*erwana[m] joined #nim
00:03:14*TheManiac joined #nim
00:03:50*euantor joined #nim
00:05:20*cyraxjoe joined #nim
00:12:57*jivank[m] joined #nim
00:13:45*FromGitter quit (Ping timeout: 240 seconds)
00:20:54*Matthias247 quit (Read error: Connection reset by peer)
00:22:14*rauss joined #nim
00:22:26libmanPicking up from last night: the problem of some pages on the Nim web-site (ref https://archive.is/uJfZG#selection-1257.15-1257.37 ), setting User-Agent request header same as my Chromium makes no difference.
00:26:19libmanAlso, I thought I observed this 404 problem affecting all pages on the site, but I could have been mistaken. At present it doesn't seem to affect the main site (ex `curl -I https://nim-lang.org/question.html` => "HTTP/1.1 200 OK")
00:27:24*FromGitter joined #nim
00:28:16libmanBut any page on any subdomain I tried (forum, irclogs, any others?) returns "HTTP/1.1 404 Not Found"
00:31:08ftsf_libman, seems to be a problem with HEAD requests
00:36:10libmanI don't mean to annoy anybody with this, but some crawlers (ex archive.org) can't access those anymore...
00:37:05libmanSo this isn't about figuring out what headers to add to curl to get it working on my end.
00:51:24zachcarteralright the first tutorial is done - https://gist.github.com/zacharycarter/846869eb3423e20af04dea226b65c18f
00:51:55zachcarterfor osx anyway
00:52:08zachcarterI still need linux / windows build instructions but I’ll work on those this weekend when I have access to more machines
00:52:48zachcarterfeedback more than welcome :)
00:54:38*xet7 quit (Quit: Leaving)
01:11:48*Vladar quit (Quit: Leaving)
01:20:27*def-pri-pub joined #nim
01:54:05*brson joined #nim
02:30:03*brson quit (Quit: leaving)
02:30:50*chemist69 quit (Disconnected by services)
02:30:55*chemist69_ joined #nim
02:43:43zachcarterhttp://imgur.com/a/evOIC
02:57:32rausszachcarter: Looks great-
02:57:35rauss!
02:57:40zachcarterthank you!
02:58:18raussI will probably use your nuklear stuff once I get there in my game engine
02:58:28zachcarterawesome :)
02:58:29raussand will start helping at that point where I can
02:58:56zachcarterI’m working on a 2d game framework myself
02:59:10raussMine is a framework as well
02:59:21zachcarterah cool, what are you using for rendering?
02:59:26raussa la LÖVE
02:59:41rausscurrently sdl2, but only because I can't use bgfx on linux yet
02:59:59zachcartergotcha, yeah bgfx is nice that’s what I’m using atm
03:00:09zachcarterwhat’s the hangup on linux with bgfx?
03:00:11rausshttps://github.com/Halsys/nim-bgfx/issues/2#issuecomment-280234794
03:00:24raussRather,
03:00:47raussI can use bgfx with glfw currently (and will probably do that), but not sdl2+bgfx
03:00:57zachcarterah okay yeah I’m using glfw
03:02:25zachcarterI was using SDL2 but I ditched it, it seemed to be taking over a lot of my application when all I really wanted it for was windowing
03:02:38zachcarternot necessarily taking over, but crepeing into
03:02:42zachcartercreeping*
03:03:46raussWhat are you using for controls?
03:04:46zachcarterI haven’t really touched input yet to be honest
03:04:57raussAh. I'm using SDL2 for that
03:05:07zachcartereverything works through callbacks in GLFW
03:05:16zachcarterso when a key is pressed a C callback is fired which I can hook into
03:05:46zachcarterrather trivially
03:05:54zachcarterjust need to define a proc with a cdecl pragma
03:06:39zachcarterI just haven’t gotten around to actually coding any games, right now I’m working on tooling - I figure any 2d game library / framework is going to need some way to create texture atlases and then render them
03:06:49zachcarterI can already render textures and regions of textures, so texture atlases are next
03:07:40zachcarterI’ve written a sprite batch class which submits draw calls in batches to BGFX, I haven’t done any sorting yet which apparently you handle with views in BGFX, so I’ll eventually get to that once I actually start making my game
03:11:21raussI should really prioritize switching to bgfx before doing any more in my drawing module... =\ doesn't make sense to implement everything in SDL2 since I plan on using bgfx ultimately. I've just been lazy I guess.
03:11:59zachcarterwell I can tell you the SDL2 renderer is quite a bit higher level compared to BGFX
03:12:30zachcarterhere’s some sample code from my sprite batch / texture stuff -
03:13:14zachcarterhttps://gist.github.com/zacharycarter/f13d61268971dfe385c7663bb74b7ece
03:14:19zachcarterjust be prepared for some linear algebra and submitting draw calls to buffers etc
03:14:30zachcarterit’s not as simple as SDL draw rect and stuff
03:14:46zachcarternot sure if you’ve used a drawing API like OpenGL / DirectX before
03:14:57zachcarterwith shaders etc
03:15:12*zaquest joined #nim
03:23:54*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
03:48:23*zaquest quit (Quit: Leaving)
03:51:49zachcarterthese nuklear bindings definitely need an abstraction layer now that I’ve used them a bit
03:52:04*zaquest joined #nim
03:52:16zachcarterI think I understand enough to write one
03:52:25zachcarteronce I finish this texture packer thing I will
04:00:24raussYeah I'm no stranger to OpenGL and linear algebra :)
04:01:31zachcartergood :)
04:02:04zachcartera few tips - if you’re doing 2d look into transient vertex and index buffers
04:02:31zachcarteryou’ll want to use those whenever you don’t need draw state to persist across frames
04:02:47zachcarterI use them for my sprite batch as well as in my bgfx nuklear backend
04:03:07zachcarterthe bgfx nuklear backend was quite the pain to write
04:03:17zachcartereven with an example C++ / SDL one
04:03:20raussYou mean fun!
04:03:24zachcarterright!
04:03:38zachcarterYou can definitely have mine
04:03:46zachcarterwhen you get to that point
04:03:55raussThanks man. This looks great
04:04:12raussNice job
04:04:12zachcarterthere are a few quirks I need to explain with its use though - mostly due to shortcomings with the nuklear API
04:04:15zachcarterthank you
04:19:05*zachcarter_ joined #nim
04:20:28*zachcarter quit (Ping timeout: 240 seconds)
04:20:28*zachcarter_ is now known as zachcarter
04:48:10*Nobabs27 quit (Quit: Leaving)
05:12:58*arnetheduck joined #nim
05:35:18*yglukhov joined #nim
05:36:13*def-pri-pub quit (Quit: leaving)
05:37:34*yglukhov quit (Remote host closed the connection)
06:30:55*libman quit (Quit: Connection closed for inactivity)
06:31:24*nsf joined #nim
06:33:25*chemist69_ quit (Ping timeout: 240 seconds)
06:56:29*butchster quit (Ping timeout: 255 seconds)
07:04:30*chemist69 joined #nim
07:04:46*rauss quit (Quit: WeeChat 1.7)
07:19:28*bjz joined #nim
07:32:00*djellemah quit (Read error: Connection reset by peer)
07:37:16*yglukhov joined #nim
07:37:27*yglukhov quit (Remote host closed the connection)
07:37:41*yglukhov joined #nim
07:43:50*djellemah joined #nim
07:56:44*zachcarter quit (Quit: zachcarter)
08:14:47*Vladar joined #nim
08:14:47*ofelas quit (Read error: Connection reset by peer)
08:15:14*rokups joined #nim
08:15:16*ofelas joined #nim
08:41:40*Andris_zbx joined #nim
08:51:08yglukhovAraq: hi, there's a regression resulting in c compile error because of bad identifiers in a c struct. e.g. NimStringDesc* 555013;
09:09:44*TheManiac quit (Remote host closed the connection)
09:09:44*M-Quora quit (Remote host closed the connection)
09:09:45*jivank[m] quit (Remote host closed the connection)
09:09:45*hohlerde quit (Read error: Connection reset by peer)
09:09:45*Jipok[m] quit (Read error: Connection reset by peer)
09:09:46*MrAxilus[m] quit (Remote host closed the connection)
09:09:46*Guest73656[m] quit (Read error: Connection reset by peer)
09:09:46*dyce[m] quit (Write error: Connection reset by peer)
09:09:46*stisa quit (Read error: Connection reset by peer)
09:09:46*erwana[m] quit (Read error: Connection reset by peer)
09:09:47*ehmry quit (Write error: Connection reset by peer)
09:15:09*flyx quit (Quit: ZNC - http://znc.in)
09:19:34*flyx joined #nim
09:22:51*Learath2 quit (Quit: WeeChat 1.4)
09:30:14*couven92 joined #nim
09:45:25*shashlick quit (Ping timeout: 240 seconds)
09:58:13*shashlick joined #nim
10:33:19*dyce[m] joined #nim
10:36:00cheatfaterokups, ping
10:36:07rokupspong
10:36:37cheatfaterokups, i found a problem in coroutines
10:36:52rokupsim all ears
10:36:54cheatfatethis is theoretical problem
10:37:36cheatfatethere functions like `alive` which using `proc` as identifier
10:38:10cheatfatewith such approach its not possible to start like N coroutines which have same procedure
10:38:30cheatfateits possible to start but not possible to check if some of them are alive
10:38:44cheatfatebecause `proc` will be same for all coroutines
10:39:34cheatfatewhat do you think?
10:39:43rokupsdamn. this is not theoretical but very much practical. i think only idiot could write that code ;)
10:40:51rokupsfix could be start() returning some coroutine identifier and we could wait on that
10:41:05cheatfateyep
10:41:19cheatfatei think stack address will be nice identifier
10:41:40cheatfateor Coroutine object address
10:41:59cheatfateor maybe its better to return Coroutine object itself
10:42:33cheatfateand make some fields of the Coroutine object as `public`
10:43:20cheatfatei think it would be nice to have access to `state` field of Coroutine object.
10:43:38rokupsthere was some talk about coroutines running on different threads. if someone set out to implement that returing coroutine object would be obstacle for them since it would require copying and address would change while in reality new object would represent same coroutine
10:44:32cheatfaterokups, then stack address would be the best variant
10:44:51rokupsyes i agree
10:45:07rokupsunless someone thinks of making auto-expanding stack support
10:45:23rokupsbut i have no idea how that is implemented in glibc so idk if it reallocates stack or what
10:45:38rokupsi doubt anyone would do this though
10:45:52cheatfaterokups, then you need to generate unique IDs
10:46:10cheatfatebecause self-growing stacks is a nice feature too
10:47:53rokupsincrementing id might get messy when coroutines get moved to another thread, unless its global
10:49:41cheatfatebut we don't need globals
10:50:35cheatfatethen maybe some kind of `thread_id + stack_address + proc_address`.
10:52:46rokupswouldnt that pose a danger of `5 + 3` == `3 + 5` kind of problem?
10:53:31cheatfaterokups, when i mean some kind i mean F(thread_id, stack_address, proc_address) which can be MD5(thread_id + stack_address + proc_address)
10:53:49rokupstrue that
10:54:40rokupsill search info on how self-growing stacks are implemented. maybe stack address is ok after all.
10:57:06*Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif)
10:58:04cheatfaterokups, it will be implemented like realloc(), but in nim we dont have access to realloc, so for us it will be alloc/copymem/free(old)
10:58:37cheatfateso on stack change everything will be changed
11:00:40cheatfateand to achieve this you will need to handle signal on posix systems and VEH on windows
11:01:08rokupshttps://gcc.gnu.org/wiki/SplitStacks says that new stack is slipped in for new function call when expansion is needed and only parameters may be copied. old stack is left intact
11:01:29rokupsnever heard of this being supported on windows
11:02:14cheatfaterokups, you can allocate stack as 2 pages, for example 1st (low) guard page, 2nd (high) exactly stack page
11:02:31cheatfateguard page is protected via PAGE_NOACCESS
11:02:45cheatfateso if coroutine access this page
11:02:55cheatfateyour VEH handler will be invoked
11:04:29cheatfatein VEH handler you are checking if code invoked exception are inside of coroutine and guard page is belongs to this coroutine, if so you allocate new stack and modify execution context with new RSP
11:04:34rokupsi do not think it is even safe to copy entire stack to new place and use that as a stack. there may be references to the old stack. new copy would invalidate them. there would be boom
11:06:07cheatfateyep, you are right, then self-growing stacks not possible
11:06:18cheatfateso you can use stack address as identifier
11:06:49rokupsthey are possible, and using stack address is ok ;)
11:07:09rokupsread that gcc page i linked, it describes the process on how they do it. its pretty clever
11:08:55cheatfateyou will need to modify GC structures
11:09:03cheatfateso it will not access this stack anymore
11:09:08cheatfateold stack i mean
11:10:13*krux02 joined #nim
11:11:47rokupswhy? new stack is extension of the old one. old stack does not go anywhere, its just that when application runs out of stack space it slips in new stack pointer. returning from such function puts back in old stack pointer. and we are perfectly ok yielding across these stack boundaries as execution context including stack pointer is saved
11:13:39cheatfateok
11:14:33*jivank[m] joined #nim
11:14:35*MrAxilus[m] joined #nim
11:14:36*M-Quora joined #nim
11:14:36*ehmry joined #nim
11:14:40*erwana[m] joined #nim
11:14:41*hohlerde joined #nim
11:14:41*stisa joined #nim
11:14:42*Guest73656[m] joined #nim
11:14:42*Jipok[m] joined #nim
11:14:42*TheManiac joined #nim
11:14:50cheatfaterokups, do you like your `alive` function? because it O(n)
11:15:13cheatfatemaybe its better to have it O(1)?
11:16:35rokupstotally, though im not sure how exactly
11:16:49rokups(without getting in a way to multithreading)
11:19:57cheatfatecurrently you allocating stack in `ptr memory` and Coroutine object in `ref memory`, you can allocate everything in `ptr memory` so make Coroutine object include stack as array.
11:20:44cheatfateso in memory it can be `header` + `stack` or `stack` + `header`.
11:21:05cheatfateso if you have stack address you can obtain header address
11:21:42cheatfatealso only one allocation will be done on coroutine creation, so it gives some more performance
11:24:03cheatfatebut header must not be on the way of stack expansion
11:34:41rokupshmm thats a good idea. then start() could return ptr to coroutine object even. and since it is memory unmanaged by gc then having coroutine scheduled in another thread would not require copying coroutine structure
11:34:58rokupssounds like its all only good things
11:37:46cheatfateok, i'm waiting for your work, i want to build asynchronous framework on base of your coroutines
11:45:46rokupscool, will make a patch in coming day or two
11:50:12*sz0 joined #nim
11:50:15*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
11:58:38*djellemah_ joined #nim
11:58:47*djellemah_ quit (Remote host closed the connection)
12:04:42*libman joined #nim
12:13:47libmanShould I file a bug report regarding the aforementioned problem that archive.org/etc can no longer access nim-lang.org subdomains due to HEAD requests returning 404, bring it up on the forum, or just ignore it? // attn dom96
12:15:13*jivank[m] quit (Ping timeout: 252 seconds)
12:29:49*jivank[m] joined #nim
12:39:55krux02libman: when you noticed it, you should create an issue that describes what you realized, and what it causes. Then the Nim developers can decide what to do with it.
12:40:19krux02They still have the option to put it on low priority or fix it.
12:40:58libmanOn the GitHub repo for the Website?
12:42:23*zachcarter joined #nim
12:42:52libmanI guess I'll just have to overcome my allergy towards using GitHub for things other than copyfree license nagging...
12:44:31krux02libman: probably for the website: What is your problem with github?
12:45:47libmanNothing that seriously warrants polluting this channel...
12:50:24*stisa quit (Ping timeout: 252 seconds)
12:51:50*tankfeeder joined #nim
12:55:16*stisa joined #nim
13:01:25*MrAxilus[m] quit (Ping timeout: 252 seconds)
13:04:00*MrAxilus[m] joined #nim
13:12:01*ftsf_ quit (Quit: :q!)
13:13:06krux02libman: I don't know what the problem is, so just meniton it, I guess I can google the rest.
13:23:20*rupil joined #nim
13:23:54*PMunch joined #nim
13:33:53*zachcarter quit (Quit: zachcarter)
13:42:24FromGitter<andreaferretti> hi, a question about nimsuggest
13:44:16FromGitter<andreaferretti> is there a way (say in atom) to figure out what is the root file where nimsuggest starts
13:45:00FromGitter<andreaferretti> I always have the problem where I have a library file in the root directory I am opening
13:45:09FromGitter<andreaferretti> and tests in a subdirectory
13:45:31FromGitter<andreaferretti> the nimble file configures `path:"."` in each task
13:45:46FromGitter<andreaferretti> still, I get spurious errors in nimsuggest
13:46:12FromGitter<andreaferretti> I guess the problem is that nimsuggest is not able to figure out that the test I am writing
13:46:25FromGitter<andreaferretti> should be able to import the library, which lives one level up
13:46:48FromGitter<andreaferretti> I am not sure how to fix this
13:48:00*tyler569 joined #nim
13:49:29demi-andreaferretti, yeah it is the one that has an associated .nim.cfg file or .nimble file iirc
13:50:26FromGitter<andreaferretti> the problem is
13:50:30FromGitter<andreaferretti> I have a .nimble file
13:50:46FromGitter<andreaferretti> but source is configured in nimble tasks
13:51:08demi-i don't know the answer to that then
13:51:25FromGitter<andreaferretti> like this https://github.com/unicredit/emmy/blob/master/emmy.nimble#L35
13:52:22demi-ah i see, yeah, sorry i don't know how to get nimsuggest to work with that
13:52:32demi-(also your github avatar is really cool)
13:54:27FromGitter<andreaferretti> :-)
13:56:37demi-presumably you should configure the nimsuggest plugin for atom to select based on the initial file that gets opened, so that way when you open the tests it will pick up that?
13:56:48demi-or i guess change how nimble is configured?
13:57:19demi-neither of those sound great but I don't know if the tooling is built out enough to handle this?
13:57:30*stisa quit (Ping timeout: 252 seconds)
14:00:32*stisa joined #nim
14:01:44*Jesin quit (Ping timeout: 255 seconds)
14:03:56FromGitter<andreaferretti> I would do an of these
14:03:58FromGitter<andreaferretti> any
14:04:03FromGitter<andreaferretti> if I knew how
14:04:12FromGitter<andreaferretti> essentially all my libraries have this structure
14:04:19FromGitter<andreaferretti> hence I cannot rely on nimsuggest at all
14:05:11demi-ah i see, i would offer to help but i know very little about nimsuggest beyond what i already said as i'm currently blocked on implementing it for the editor i use as i need socket access for communication with it
14:08:46*Jesin joined #nim
14:12:40FromGitter<andreaferretti> thank you anyway
14:19:49*yeeve quit (Remote host closed the connection)
14:24:40*yeeve joined #nim
14:26:13*tankfeeder quit (Quit: Leaving)
14:34:32rokupsare symlinks allowed in compiler repo?
14:46:26*zachcarter joined #nim
14:48:07*jivank[m] quit (Ping timeout: 252 seconds)
14:51:26*jivank[m] joined #nim
15:00:23*hohlerde quit (Ping timeout: 264 seconds)
15:08:23*rauss joined #nim
15:09:15*PMunch quit (Quit: leaving)
15:09:37*hohlerde joined #nim
15:22:45*M-Quora quit (Ping timeout: 252 seconds)
15:24:50krux02rokups: unrelated to whether they are allowed or not, they do work on NTFS
15:25:09rokupsyou are so misinformed
15:25:46krux02last time I did test ls -s on an ntfs filesystem, I was surprised that it actually produced a link
15:26:26*M-Quora joined #nim
15:26:32krux02but anyway, when you think it does not work on NTFS hard drives, you should have your answer
15:27:11rokupsyou just said you saw yourself symlinks work and you still claim they do not work. amazing :)
15:36:55*rupil left #nim (#nim)
15:39:21*djellemah quit (Ping timeout: 260 seconds)
15:39:59*djellemah joined #nim
15:42:16flyxdemi-: so your editor is not able to open sockets?
15:42:30enthus1astkrux02 rokups used git on windows lateley? : )
15:42:49enthus1astthey do symlinks afaik
15:44:07rokupsthen maybe ill get the blessing. i could save duplicating bunch of files and get coroutines tested in multiple configurations that way
15:45:59demi-flyx: not from the API it currently has
15:46:13demi-that is probably going to be changing though
15:46:54*yglukhov quit (Remote host closed the connection)
15:50:03*yglukhov joined #nim
15:51:07*dexterk joined #nim
15:51:22*dexterk__ quit (Ping timeout: 268 seconds)
15:52:01*nsf quit (Quit: WeeChat 1.7)
15:54:39*yglukhov quit (Ping timeout: 252 seconds)
15:58:59krux02enthuslast: I haven't used windows lately, I just used ``bash$ ln -s`` on an NTFS hd.
16:03:48*PMunch joined #nim
16:06:04*tobacco_joe joined #nim
16:06:15zachcarterI’m trying to bind to an inline C function and failing miserabily, can anyone help? https://gist.github.com/zacharycarter/9a765bb81e1493ec3324d1037f40b0d0
16:06:32*tobacco_joe left #nim ("('Out')")
16:07:40zachcarterwhoops sorry
16:07:44zachcarterthat example is bad I’ll fix it
16:08:06zachcarterfixed
16:11:42*MrAxilus[m] quit (Ping timeout: 252 seconds)
16:14:54zachcarterremoving the static inline seems to work...
16:15:00*hohlerde quit (Ping timeout: 252 seconds)
16:17:24*hohlerde joined #nim
16:17:35zachcarterthat’s not a solution though I don’t believe...
16:18:00krux02zachcarter: static makes a function local
16:18:09krux02the function will not be seen from the linke
16:18:12krux02r
16:18:14zachcarterah okay thanks
16:18:22*MrAxilus[m] joined #nim
16:18:25krux02and it will not clash with other functions with the same name
16:19:00zachcarterhrm if I remove static and keep the inline keyword in C I still can’t seem to bind to them
16:19:40krux02why do you need it te be inline?
16:20:06zachcarterI don’t necessarily, they were just inlined in C
16:21:27krux02normally inlined functions in C are also declared in function scope, so that the compiler can inline them
16:21:37krux02otherwise the function could only be inlined from the linker
16:21:46krux02and that is a much more complicated problem
16:22:41krux02So this is a bit half knowledge here, but afaik inlined functions in C are declared in headers as static, so that each compilation unit knows about them, and can then inline them
16:22:59krux02and then the function is just not exported at all to the linker
16:23:06krux02therefore you can't bind them
16:23:10zachcarterokay this makes sense
16:24:13zachcarterthank you for that explanation
16:24:17krux02and when you bind to them there is also little guarantee, that it will be inlined from the linker
16:24:39krux02so my guess would be to port that inlined function to a template or an inline function in Nim
16:24:52krux02ah wait
16:24:55krux02it's printf
16:25:52zachcarterthere’s a bunch of static inlines here I’ll probably need to port
16:30:36*Trustable joined #nim
16:30:51*derlafff quit (Quit: No Ping reply in 180 seconds.)
16:33:30*derlafff joined #nim
16:34:04krux02yea and it's the horrible C varargs
16:34:16krux02varargs that can basically do nothing more than printf
16:34:35zachcarteryeah
16:34:40zachcarterso annoying
16:37:55krux02well you know it's used from nim
16:38:18krux02therefore, you could cheat and only support a single string parameter
16:38:51krux02strutils.format can do all the fuzz that these C marcros are supposed to solve
16:39:38krux02What I want to say is that you are not really missing out on something, when you do not support an printf interface
16:40:24krux02you just need provide one print function in your bind.c that just prints a string
16:40:27krux02and that one you bind
16:44:19*sz0 quit (Quit: Connection closed for inactivity)
16:44:38zachcarterright
16:47:45*Andris_zbx quit (Remote host closed the connection)
16:48:23*jmkr quit (Ping timeout: 264 seconds)
16:52:12*jmkr joined #nim
17:00:24*yglukhov joined #nim
17:01:22*yglukhov quit (Remote host closed the connection)
17:01:34*yglukhov joined #nim
17:03:15yglukhovCan anyone remind me how to use memtracker option?
17:05:35krux02zachcarter: can you leave a comment here https://github.com/nim-lang/Nim/issues/5437 when you think that it would actually help you to write your wrapper?
17:05:43zachcartersure
17:06:20*yglukhov quit (Remote host closed the connection)
17:07:32*Matthias247 joined #nim
17:11:49*ehmry quit (Remote host closed the connection)
17:11:50*erwana[m] quit (Read error: Connection reset by peer)
17:11:50*Jipok[m] quit (Read error: Connection reset by peer)
17:11:50*Guest73656[m] quit (Read error: Connection reset by peer)
17:11:51*dyce[m] quit (Write error: Connection reset by peer)
17:11:51*M-Quora quit (Write error: Connection reset by peer)
17:11:58*jivank[m] quit (Write error: Connection reset by peer)
17:11:59*hohlerde quit (Read error: Connection reset by peer)
17:11:59*TheManiac quit (Read error: Connection reset by peer)
17:12:00*stisa quit (Read error: Connection reset by peer)
17:12:02*MrAxilus[m] quit (Read error: Connection reset by peer)
17:17:44*brson joined #nim
17:27:24*yglukhov joined #nim
17:28:21*BitPuffin|osx joined #nim
17:34:21*Snircle joined #nim
17:39:19*yglukhov quit (Remote host closed the connection)
17:40:04*yglukhov joined #nim
17:48:20*dyce[m] joined #nim
18:04:22*yglukhov quit (Remote host closed the connection)
18:16:36zachcarterLooks like my bindings are working for : https://bitbucket.org/cfyzium/bearlibterminal - https://drive.google.com/file/d/0B2CfYyfxKriOV0Y4ZF9laGhYWWM/view?usp=sharing
18:17:29*yglukhov joined #nim
18:18:31*butchster joined #nim
18:19:37krux02is the -d:nativeStackTrace option for the nim compiler supposed to do something?
18:20:40krux02cool
18:22:59krux02zachcarter: I did not know about tha libterminal thing
18:23:30zachcarterkrux02: it’s one of the more popular terminal emulators a lot of roguelike game developers use
18:23:35krux02sounds like the library to make a rogue like
18:23:44krux02hah
18:23:45zachcarterIMO it beats the pants off of libtcod
18:23:59krux02I don't know libtcod
18:24:01zachcarterdoesn’t offer as much but it’s just a terminal emulator and that’s good
18:24:13zachcarterlibtcod tries to provide everything and doesn’t do a great job at any of it
18:24:13zachcarterone sec
18:24:22zachcarterhttp://roguecentral.org/doryen/libtcod/
18:25:04demi-oh neat, this looks better than termbox
18:26:23demi-if i wasn't so deeply invested in termbox at this point i'd switch
18:26:28krux02actually I do know libtcod
18:26:35krux02it's used in brogue
18:26:41demi-chose termbox over ncurses because ncurses is brutal to manage
18:27:27zachcarterI’m trying to get more roguelike devs looking at nim
18:27:31krux02I think it's funny, that people switch to just do ascii art, because it is supposed to be easier, and then it it actually not, because of horrible terminal things
18:28:02zachcarteragreed
18:28:15krux02easiest is 2D sprite blitting I guess
18:28:37krux02and all that I saw in the example can very easily done with 2D sprite blitting
18:28:41Vladarkeep in mind that libtcod is actually graphical, not text-mode
18:28:55krux02I know
18:29:05krux02but it can enable a text mode afaik
18:29:13krux02at least brogue the game can
18:29:20krux02but that doesn't look so good
18:29:32zachcarterprobably because of lack of square fonts
18:29:36zachcarterI’m guessing
18:29:47krux02when a game is made to support true color, rendering it in terminal colors doesn't do it a favor
18:30:03krux02the square fonts are not the problem
18:30:09zachcarterah okay
18:30:14krux02my terminal uses a square font
18:30:21VladarI guess, text-mode isn't a part of libtcod API
18:30:25*hohlerde joined #nim
18:30:26*jivank[m] joined #nim
18:30:26*MrAxilus[m] joined #nim
18:30:29*M-Quora joined #nim
18:30:30*ehmry joined #nim
18:30:32*erwana[m] joined #nim
18:30:33*stisa joined #nim
18:30:34*TheManiac joined #nim
18:30:35*Guest73656[m] joined #nim
18:30:37*Jipok[m] joined #nim
18:30:37krux02but however libtcod is, brogue is a pretty awesome game
18:30:51krux02I am not heavily invested in roguelike games
18:31:14zachcarterbrogue is a good game, I’m not sure how much of the libtcod library it uses
18:31:16krux02I just wasted some time in dwarf fortress (not the best experience) and tested brogue
18:31:24krux02it is just so simple to get started
18:31:35zachcarterI know in the roguelike I am working on, libtcod wouldn’t even scratch the surface of the procedural generatiion stuff I need
18:31:39krux02I don't know much much comes from libtcod, and how much it is brogue
18:31:51zachcarterThese were the maps I was procedurally generating in Java
18:32:03zachcarterand libgdx before switching to nim
18:32:16zachcarterhttps://github.com/zacharycarter/mapgen
18:32:17Vladarthere's some pretty neat prodedural generation stuff in libtcod, IIRC
18:32:43zachcarterthere is but it’s fairly rudimentary proc gen stuff Vladar
18:33:22zachcarterfor instance, with the maps I just linked I was generating, they wouldn’t have been possible to generate with the proc gen features in libtcod
18:33:36zachcarterno 4d perlin / simplex noise in libtgcod
18:33:40zachcarterlibtcod*
18:34:05VladarIt may be, don't remember for sure. It's pretty long ago when I messed with libtcod, writing its wrapper for Nim.
18:34:49zachcarteranother shortcoming of libtcod is it’s osx support :/
18:34:54zachcarteror lack thereof
18:35:44krux02yea, mac support
18:35:47krux02always a struggle
18:36:07krux02I also did a procedural game project in scala
18:36:26krux02It was in 2010 I think
18:36:58zachcarternice
18:36:59krux02I wanted it to be like mincraft with the qubes, but also to allow arbitrary shapes
18:37:07krux02I was looking for screenshots
18:37:11krux02I don't find them anymore
18:37:29krux02it was 3D
18:38:19krux02the wase even a live editor for the procedural world
18:38:37krux02and a prediction function for it
18:38:51*yglukhov quit (Remote host closed the connection)
18:38:51*nsf joined #nim
18:38:58zachcartersounds sweet
18:39:02demi-I don't know how you can build something like that to work on unix/linux and not get it to work on OS X
18:39:11krux02the problem for 3d world generation is that when you want to sample 3D space it is O^3
18:39:38*yglukhov joined #nim
18:40:00zachcarteragreed demi-
18:40:09zachcarterlibtcod is using sdl / sdl2 to my knowledge as well
18:40:24krux02That engine the the possibility to arbitrarily define the density function of the noise, and still keep the complexity in somewhat O(N^2*lon(N))
18:40:34demi-hmmm, yeah i don't see why that wouldn't be compatible then
18:40:51demi-almost like you had to intentionally go out of your way to make things difficult
18:41:28*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
18:41:42krux02so there was some compiler that worked on the density function symbolically and generated a range prediction function for the 3D world
18:42:16krux02and the generater used the 3D range (volume) and asked: "does this intersect 0?"
18:42:24krux02super nice stuff there
18:42:29zachcartersounds like it
18:42:45krux02brogue has a mac release tw
18:42:47krux02btw
18:42:54zachcarteryeah some people have gotten libtcod to compile on osx
18:43:15zachcarterI know it’s possible it just doesn’t work and the author has stated implicity if you want to get it working it’s on you
18:43:42zachcarterI’m pretty sure AWS East Coast services are being DDOSed right now
18:43:47zachcarterand not winning
18:44:08zachcartereverything is slow / timing out
18:44:11zachcarterhttps://status.bitbucket.org/
18:44:26zachcarterhttps://status.github.com/
18:44:27krux02yea
18:44:30krux02I see
18:44:32krux02it's slow
18:44:44*elrood joined #nim
18:45:11zachcarterwell break time then
18:47:12demi-it is pretty broken
18:47:30*xet7 joined #nim
18:48:02VladarWell, I received osx related patch recently, so libtcod surely works there at least for someone https://github.com/Vladar4/libtcod_nim/commit/2e48a05df4917329eadaf35ce3ad2734131c4a20
18:52:53krux02just to mention it, when you once want to start editing bitmaps: gimp is horrible with that. I recently found grafx2
18:53:16Vladaraseprite for me
18:53:29krux02it's a bit retro, but still very easy to use and very pixel art oriented
18:53:43krux02(supports color cycles)
18:54:36zachcarterhttps://github.com/podiki/libtcod-mac looks like maybe doryen upped his game and now libtcod is working on osx too
18:54:55zachcartersince it says that repo is no longer needed and libtcod can be built on osx provided the correct dependencies are installed
19:03:52*ehmry is now known as ehmry[m]
19:16:08*zahary_ joined #nim
19:22:05*dddddd joined #nim
19:24:43PMunchAraq, https://github.com/Araq/wxnim/pull/3
19:24:56PMunchMade a pull request to the wxWidgets bindings
19:25:25zachcarterkrux02: it doesn’t look like we’re going to have much in the way of libraries to bind to for artificial intelligence
19:25:46zachcarterthis is a hole that needs filling
19:27:41krux02zachcarter: what do you mean by that?
19:27:58zachcarterprobably going to have to write some time of AI library / framework
19:28:10zachcartersomething similar to https://github.com/libgdx/gdx-ai
19:28:56zachcarteropensteer is c++
19:29:06*Ven joined #nim
19:30:43krux02I didn't know there were AI libraries
19:30:58krux02AI is also very very broad field
19:31:02zachcarterit is
19:31:11krux02Game AI has usually very little to do with machine learning
19:31:18zachcarteragreed
19:32:28krux02I had lectures about machine learning, and I can tell you it is super hard
19:32:34krux02I mean the basics are simple
19:32:50krux02but it is all very fuzzy
19:33:07zachcarterhttps://github.com/recastnavigation/recastnavigation
19:33:31krux02it leaves the nice and defined discrete logic world that we computer scientists and programmers like so much about computers :P
19:33:57zachcarter:)
19:35:29krux02well the first thing I already see in this library is, that it is build on level pregeneration
19:35:46krux02build the level in an editor and then run it through the tool
19:35:51krux02at least that is my impression
19:35:58krux02that is very common to do
19:36:02krux02almost all games do that
19:36:08zachcarteryeah
19:36:27krux02but I am writing my own engine, because I do not want to be like almost all games
19:37:09krux02I don.t have a problem with stupid AI
19:37:18krux02games can still be fun when the AI is not
19:37:41zachcartertrue
19:37:41krux02so my choice for me here is clear
19:38:04krux02just write a trivial AI that can handle a dynamic environment
19:39:12*PMunch quit (Quit: leaving)
19:39:56*couven92 quit (Read error: Connection reset by peer)
20:02:54krux02zachcarter: But thank you for the feference material of the raycast navigator
20:03:04krux02I think I can use some information from it
20:03:06zachcarternp
20:03:18zachcarterI’m working on some higher level bindings for nuklear
20:03:46zachcarternot really sure what I’m doing but after I write one function I’ll post a gist and see what you think
20:09:39zachcarterkrux02: is this essentially what I should be doing : https://gist.github.com/zacharycarter/cb784e5fa781e7364b251c583cb8a0f8 ?
20:10:38zachcarterthat way users of the bindings don’t have to deal with pointers
20:18:30krux02when you write a binding for a c function you don't need cdecl
20:18:57krux02cdecl disables name mangling, so that you know the name when you want to call it from C
20:19:21zachcarterah okay
20:19:25zachcarterthanks for that
20:19:28krux02functions you do not intend to call from your own c code don't need that
20:19:50krux02but apart from that I don't know what that gist is supposed to do
20:19:51zachcarterthat makes sense now why it’s on callbacks from c code in GLFW and stuff okay
20:20:08zachcarterremember the other day when we were talking about how bindings should have two layers
20:20:18zachcarterone layer very close to the C code
20:20:44zachcarterthen another layer of abstraction
20:21:06zachcarterI’m essentially trying to figure out how I should be wrapping these functions with another layer of abstraction so users don’t have to deal with passing pointers
20:21:35krux02I don't think that pointer are a problem at all
20:22:29zachcarterI don’t either but one person in here was complaining about them, and I believe def-pri-pub suggested another layer of abstraction on top of the bindings
20:22:38zachcartermaybe it wasn’t the pointers he / they were referring to being the problem
20:22:52krux02when the user of the c library has to handle lifetame / deallocation / destruction of objects, nim does not provide anything working to take that away
20:23:02*tyler569 left #nim (#nim)
20:23:03krux02in C++ you would wrap in in an object with destructor
20:23:08krux02but that doesn't work in nim
20:23:11zachcarterright
20:23:34krux02and the abstraction you provided is not guaranteed to work
20:23:43krux02it will probably work, but it can also just fail
20:24:01krux02I don't know what init_default does
20:24:20krux02there are two ways you could abstract it away
20:24:24zachcarterokay
20:24:40krux02first of all, I would just call it init
20:24:50krux02unless there is an alternative buffer initializer
20:24:58zachcarterthere are a bunch
20:25:07krux02do the other ones all have arguments?
20:25:31zachcarterhttps://github.com/zacharycarter/nuklear-nim/blob/master/nuklear.nim#L1025
20:27:01krux02ok there are three
20:27:20krux02I would call them all just init
20:27:20zachcarteryeah I thought there were more
20:27:24zachcarterokay
20:27:34krux02but the default has no argument
20:27:45*Kingsquee joined #nim
20:27:47krux02wait
20:27:47zachcarterokay
20:27:53krux02they all should have the buffer as an argument
20:28:02krux02the question is how you want to pass it
20:28:08zachcarterright
20:28:09krux02the alternative to ptr is var
20:28:23zachcarterah okay so that would be the Nim way to do it
20:28:31zachcarterthat makes sense now
20:28:42krux02var is just a hidden pointer
20:28:45zachcarterright
20:29:10krux02semantically it is the same, but people don't need to wrider var buffer: Buffer; buffer.addr.init
20:29:20*elrood quit (Quit: Leaving)
20:29:25krux02they can just write buffer.init
20:29:43zachcarterokay cool thank you yeah I totally forgot I could use var here
20:30:18krux02and for the rest, you could just leave out the prefix
20:30:26krux02unless it clashes with something in system
20:30:31zachcarterright
20:30:42krux02but I don't think so because it is all with the typed first argument
20:30:56krux02the typed first argument basically removes all name clashes
20:48:23*Salewski joined #nim
20:51:02SalewskiI have a string stream from module streams. I can move position for next write backwards with setPosition(). But characters after this new position
20:51:13*Trustable quit (Remote host closed the connection)
20:51:36Salewskido still exist. How can I delete these. Something like setLen()?
20:55:49FromGitter<philip-wernersbach> How do I execute Nimscript files?
20:56:09FromGitter<philip-wernersbach> I'm trying to build the examples in @Araq 's karat repo
20:56:12SalewskiWell, string stream object exposes the data field, which is a string. Can I do arbitrary string operations on data field, so call data.setLen()?
21:03:13Salewskiphilip-wernersbach: See https://nim-lang.org/0.11.3/nims.html # Use nim e myscript.nims to run myscript.nims
21:08:11FromGitter<philip-wernersbach> @Salewski Thanks. "nim e example.nims" does nothing though :(
21:12:12*rokups quit (Quit: Connection closed for inactivity)
21:14:28*rauce quit (Ping timeout: 240 seconds)
21:16:15*rauce joined #nim
21:23:58*krux02 quit (Remote host closed the connection)
21:27:39*rauce quit (Ping timeout: 240 seconds)
21:27:57*rauce joined #nim
21:40:29Salewskiphilip-wernersbach: Works fine here. Nim Compiler Version 0.16.0 (2017-01-09) [Linux: amd64]
21:40:55SalewskiMaybe you have this old bug: http://stackoverflow.com/questions/34279446/nim-nimscript-is-not-executing-commands
21:50:13*butchster_ joined #nim
21:50:16*rauce quit (Ping timeout: 268 seconds)
21:50:58*butchster quit (Ping timeout: 240 seconds)
21:51:15*rauce joined #nim
21:51:31*butchster_ quit (Client Quit)
21:51:41*butchster joined #nim
21:56:47*zachcarter quit (Ping timeout: 264 seconds)
22:05:01*ofelas quit (Quit: Leaving)
22:05:38*aziz joined #nim
22:07:40*Vladar quit (Quit: Leaving)
22:14:08*Jesin quit (Quit: Leaving)
22:16:49*Jesin joined #nim
22:18:12*Salewski quit (Quit: Salewski)
22:18:21*Salewski joined #nim
22:19:36*krux02 joined #nim
22:19:44krux02aparently I was offline
22:19:48krux02I am back now yay
22:20:05krux02hmm, how do I make a generic over all distinct int types?
22:25:02*PMunch joined #nim
22:35:24*ofelas joined #nim
22:35:33*ofelas_ joined #nim
22:35:33*ofelas_ quit (Client Quit)
22:38:01*Salewski left #nim (#nim)
22:38:58*rauss quit (Quit: WeeChat 1.7)
22:55:02*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:55:42FromGitter<philip-wernersbach> @Salewski Might be. I'm using 0.15.2, I'll try upgrading
23:00:58*Senketsu joined #nim
23:01:18*Senketsu quit (Client Quit)
23:01:19*aziz quit (Remote host closed the connection)
23:02:00*nsf quit (Quit: WeeChat 1.7)
23:18:04*zachcarter joined #nim
23:20:17*ofelas quit (Remote host closed the connection)
23:20:42*ofelas joined #nim
23:24:28*zachcarter quit (Ping timeout: 240 seconds)
23:26:27krux02I found a way do make a function generic over all field pairs, I used a concept and a macro
23:26:32krux02does work very well
23:26:47*ofelas quit (Remote host closed the connection)
23:27:12krux02is there some mutable version of fieldPairs
23:27:30*ofelas joined #nim
23:30:17*ftsf_ joined #nim
23:42:48*couven92 joined #nim
23:50:13*Snircle joined #nim
23:59:21*themagician quit ()