<<16-12-2012>>

00:46:39*fowl|asus is now known as fowl|afk
01:46:53*fowl|afk quit (Ping timeout: 255 seconds)
01:58:54*q66 quit (Quit: Quit)
03:05:41*fowl joined #nimrod
03:54:04ZorAraq: do you require any particular c compiler in nimrod?
03:58:01*shevy2 is now known as shevy
04:02:25*shevy left #nimrod ("I'll be back ... maybe")
09:10:05AraqZor: we don't require any particular C compiler, but sometimes the C compiler has bugs that prevent it from building nimrod properly; officially supported are: GCC, visual C++, clang and intel C/C++'s compiler
09:11:14Araqborland's C++ compiler was buggy enough that I stopped supporting it
09:12:05AraqTiny C used to work but is not maintained and doesn't work on my linux distribution anymore anyway
11:39:58*apriori_ joined #nimrod
11:57:29*q66 joined #nimrod
12:00:24*FreeArtMan joined #nimrod
12:10:37_poncehi
12:10:57_poncewhat is the extent of what can be computed at compile-time and emit() ?
12:11:27Araqpretty much the safe subset of the language can be computed at compile-time
12:11:43Araqhowever the FFI does not work for now
12:11:49_poncegreat
12:11:59Araqyou can 'staticRead' a file into a string at compile time
12:12:18_poncemay I iterate on a const tuple array describing bit structures and generate AST with that, then emit it?
12:13:34Araqyeah but I don't know what you mean with 'emit'?
12:14:00_poncetemplate emit*(s: expr): stmt
12:14:16Araqyou can also run a process and capture its output at compile time with 'staticExec'
12:14:45_ponceI suppose there is a way to emit AST nodes directly?
12:15:06Araqyeah this 'emit' builtin is rarely needed
12:15:49_ponceuse case: all this would save SO much time if implementing a video codec
12:16:01_poncewhere syntax is quite a big undertaking
12:16:19_poncethe binary syntax
12:16:43_ponceI also love how you support ICC
12:17:07Araqwell it's been a while since I last tested ICC ;-)
12:17:34_ponceit almost support a super set of GCC and MSVC
12:17:57_ponceso it should still work :)
12:18:06Araqyeah "should" ...
12:21:38Araq_ponce: best way to learn about Nimrod's macros is perhaps this: http://forum.nimrod-code.org/t/90
12:31:08Araqbbl
12:44:05*Trix[a]r_za is now known as Trixar_za
13:29:13*FreeArtMan quit (Read error: Connection reset by peer)
14:15:02*Trixar_za is now known as Trix[a]r_za
14:49:29*Vladar joined #nimrod
15:13:00*apriori_ quit (Remote host closed the connection)
15:55:46*apriori_ joined #nimrod
16:00:06Araqoh hi Vladar
16:00:23AraqI heard 0.9.1 doesn't work with nimgame; can you please check?
16:01:30VladarHi, Araq. Checking...
16:04:51VladarAraq, works pretty well, as for me
16:05:17Araqwhich os and cpu?
16:06:32VladarDebian, Intel Core 2 Duo E6550
16:12:15Araqok
16:13:16VladarAraq, anything specific, error messages?
16:28:29Araqdom96 reported some runtime crah in the init code
16:28:32Araq*crash
16:29:09Araqbut I already have some bugs left to fix which may cause this
16:29:47dom96yeah, there seems to be an issue with the GC.
16:30:04dom96But also, Vladar I don't think you are initializing the engine's 'state' field
16:30:09dom96IIRC
16:30:26dom96Also, you should consider removing the dependency on fnt/default...
16:35:42Vladardom96, yes, you need to assign something to this field before calling engine.start()
16:36:10dom96hrm, some docs mentioning that would help :P
16:39:46Vladardom96, maybe even complete tutorial for the next release. For now, look into 'asteroids' demo code.
17:44:31apriori_fowl: did you test (c)fml with opengl?
18:46:20VladarAraq, is destructor pragma expected not to touch vars with global pragma?
18:49:02AraqVladar: good question
18:49:39Araqglobals shouldn't have their destructors invoked, yeah
18:52:26Vladarhmm...
18:52:46VladarThen, something wrong happens now
18:52:59Araqwell that's how it *should* be, but the compiler doesn't check for .global ;-)
18:53:07Araqso yep, bug here
18:53:32_poncehow should resource destruction be handled in idiomatic Nimrod?
18:54:04_poncehow to ensure eg. lock release with a RAII-like mechanism?
18:54:38Araqdestructors are implemented but not finished
18:54:52Araqbut for 'lock' I prefer a 'lock' template:
18:54:59Araqlock xyz: body
18:57:07VladarAraq: Also, is there any easy way to properly auto-destroy ptr, aside of making it field of ref-object and place descructor call in object's finalizer?
18:58:00AraqVladar: there is nothing special about 'ptr', just introduce a destructor for the type
18:59:14_ponceso... no stack unwinding?
18:59:36_ponceI would be ok with a template and a "defer" feature which inject in calling scope
18:59:59AraqI can't follow
19:00:09VladarYeah, I think I'll do so. But in that case I'll better get rid of all {.global.} vars in libtcod samples =)
19:00:20_poncewhat would be the definition of the lock template
19:00:36AraqVladar: you can also wait a few minutes until I fixed the bug
19:00:57_ponceoh, I see: a template can take any block as parameter
19:01:07_poncefine then
19:01:11Araq_ponce: the lock template can use 'try' finally, but we have standalone 'finally' too
19:01:17Araqwhich can act as 'defer'
19:01:30Araqand yes we also have destructors in addition to that
19:01:59Araqthe stdlib doesn't use these shiney new features though
19:02:13Araqand exposes 'close' operations or uses a GC finalizer
19:02:36_ponceyes you would need a kind of destructor to get an auto-destroy ptr
19:03:25_ponceI like this, it's more explicit than invisible stack unwinding
19:03:47Araqfor stuff like locks, yes
19:03:57Araqfor data abstraction nothing beats a destructor
19:05:53AraqIMO destructors are pretty hard to design properly
19:06:35Araqas you need an escape analysis for them; the C++ way of invoking destructors and copy constructors that the compiler is allowed to optimize away is just ugly
19:15:12AraqVladar: I didn't test it, please try it out :P
19:16:35Vladarlet's see
19:19:27Araqapriori_: the opengl names are not 'wrong', I prefixed the 'const' to prevent name clashes ;-) ... how come you didn't get any?
19:19:48apriori_hrm...
19:19:51apriori_ooops then..
19:20:05apriori_well, I didnt even try.. I just saw those weird constGL....
19:20:19apriori_and considered them an error when creating the wrapper
19:29:47VladarAraq, it seems to work quite nice, thanks =)
19:54:29apriori_do you guys have any problems with importc in the latest git version?
19:54:45apriori_I apparently end up with a zero function pointer for glViewport using the gl wrapper
19:58:43ZorAraq: so what do you use for inline asm? sounds like that'd be very dependent on C compiler/underlying assembler
19:59:37apriori_Zor: currently the asm statement, which generated a asm statement for the c compiler
19:59:47apriori_there is no compiler dependent transformation done, though
20:10:30Araqyou can implement asm transformations with compile-time string processing
20:11:06Araqapriori_: I made the opengl wrapper load extensions on demand, maybe that broke something for you?
20:11:36apriori_Araq: pretty much.. the generated nimLoadProcs0 of the generated opengl.c is never called
20:12:20Araqyou need to call it yourself via loadExtensions() in your main
20:12:28apriori_yeah.. found it just now
20:12:46Araqit's documented :P
20:13:01apriori_grr :P
20:13:29apriori_yup.. working..
20:13:34Araqit's pretty sick, the compiler generates the nimLoadProcs0() for you
20:13:51Araqso loadExtensions only loads the extensions you actually use in your code ;-)
20:14:05apriori_yup.. I see the generated code
20:14:11apriori_and yes.. only used functions included there
20:14:45Araqno need for 'glew' in Nimrod wonderland ... :P
20:14:59apriori_glew is a pain :P
20:15:19apriori_I ended up having a hell lot of issues with it.. in several projects
20:15:33apriori_but it was of course much better than loading each func by hand
20:16:29apriori_btw
20:16:46apriori_does the nimLoadProc importc declaration cause it not to be called automatically?
20:17:13Araqnope, {.pragma: ogl, dynlib: glGetProc(oglHandle, "0").} does the magic
20:18:15apriori_hm
20:18:17apriori_I dont get it :P
20:19:07apriori_I know that pragma is used for the funcs.. to make them dynload the respective func name..
20:19:34apriori_but I dont get how that should stop the code gen from generating a call which does the actual dynloading automatically
20:20:17Araqdynlib: callHere() has special semantics
20:20:23Araqthat's how it works
20:20:29AraqI don't think I documented it
20:20:32apriori_ok
20:22:21apriori_btw..
20:22:26apriori_about those weird constGL_*
20:22:44apriori_maybe it might be a better idea to consistently prefix all constants with something
20:23:36AraqI considered that, found it tedious and decided that nobody would ever use the clashing constants anyway ;-)
20:24:09apriori_:P
20:24:29Araqthe better way would be to put them into a new module openglconsts and then you can use the openglconsts.XYZ notation to get them
20:27:29Araqbut then if you want to improve the opengl wrapper, you should introduce proper enums and make it typesafe :P
20:28:00apriori_yeah.. and _that_ is tedious :P
20:28:20Araqand btw some people use that module so don't break it, use .deprecated. and provide a transition path
20:52:02*Vladar quit (Quit: Leaving)
21:16:24*gradha joined #nimrod
21:20:15gradhaI'm finishing an iOS example and need a splash graphic, should I take icons/nimrod.ico and expand it to ipad retina resolutions for fun value?
21:20:46gradhaalternatively I can use my github avatar
21:28:54*Zerathul joined #nimrod
21:30:01dom96gradha: Nimrod icon!
21:30:23*Zerathul quit (Client Quit)
21:32:37gradhahmm... IIRC there are websites with free icons/graphics for poor programmers with bad taste, maybe I should stroll around the net for that
21:44:46fowldom96: no on csfml+opengl but it should work fine
21:45:14dom96I think that was apriori_ asking not me ;)
21:45:26fowljust call opengl.loadextensions after you create the window
21:45:30fowloh mb
21:45:55apriori_fowl: yeah, Araq told me..
21:46:35fowlapriori_: it has to be called after the rendering context is created but before any opengl calls
21:46:44apriori_yeah, got that
21:46:50apriori_pretty much like glewInit
21:57:54gradhadom96: how are you doing on this lum dare thingy?
21:58:26dom96gradha: Not very well.
21:58:32dom96gradha: Not enough time sadly :\
21:59:24gradhait seems it's just 4h of the compo, are you doing that or the jam?
21:59:40dom96I'm doing that.
22:00:06dom96If it wasn't for school tomorrow I would most likely be able to get it done.
22:00:50dom96Also, It seems i've caught a cold. So i'm at a disadvantage :P
22:01:59gradhadon't go to school because of the cold and complete your entry then
22:02:40dom96lol
22:03:04dom96Maybe I will but my school attendance is low enough... :P
22:08:30gradhayeah, no need for further graphics, it's embarrassing enough now http://dl.dropbox.com/u/145894/t/splash.png
22:09:05dom96That looks pretty good actually
22:09:52gradhaclearly you are under the effect of an illness, take care man
22:09:58dom96hehe
22:21:22dom96ok, that's enough for today.
22:21:24dom96Good night
22:21:30gradhabye
23:09:17*gradha quit (Quit: gradha)
23:22:36*q66 quit (Quit: Quit)