Monday, October 14, 2013

Scheme as embeddable language for C

Tried guile 2.0.9, tinyScheme, chibi-scheme and lua 5.2.

On MacOSX 10.8.5 memory footprint of default interpreter is:

guile 12.4 MB,
tinyScheme 984 KB,
chibi-scheme 2.7 MB,
lua 760 KB.

Executing 'hello world' with 'time' takes:

time guile -c '(display "hello, world!\n")' --- real 0m0.027s
time ./scheme -c '(display "hello, world!\n")' --- real 0m0.007s
time ./chibi-scheme -e '(display "hello, world!\n")' --- real 0m0.046s
 time lua -e 'print("hello, world!\n")' --- real 0m0.004s

 To sum up, for config files tiny-scheme or lua are perfect. Taking into account that lua is a full-featured language while tiny-scheme is a shrinked down one, lua is a clear winner.

Wednesday, September 4, 2013

Inkscape and lessons for 2d art.

Inkscape and lessons for 2d art. http://2dgameartforprogrammers.blogspot.com/

Saturday, June 22, 2013

What every programmer should know about memory

http://lwn.net/Articles/250967/ Software optimization resources http://www.agner.org/optimize/

Friday, May 31, 2013

2D math, fixed point, angles etc.

http://www.helixsoft.nl/articles/circle/sincos.htm

Wednesday, May 29, 2013

Multithreading in FLTK

The very smart way: http://www.fltk.org/doc-1.3/advanced.html
int main() {
      Fl::lock();
      /* run thread */
      while (Fl::wait() > 0) {
        if (Fl::thread_message()) {
          /* process your data */
        }
      }
    }

//////////////
void *msg;       // "msg" is a pointer to your message
Fl::awake(msg);  // send "msg" to main thread

//////////////

void do_something(void *userdata) {
      // running with the main thread
    }

    // running in another thread
    void *data;       // "data" is a pointer to your user data
    Fl::awake(do_something, data);  // call something in main thread

Thursday, May 2, 2013

Smart GUI layout

MiG layout is fun. (java) http://www.miglayout.com/QuickStart.pdf

Tuesday, April 30, 2013

Linux low-level GUI graphics

X11: xlib for window and events, XCB for low-level asynchronous, XRender extension for modern 2D graphics, Xft library for fonts rendering. More to read: http://blog.mecheye.net/2012/06/the-linux-graphics-stack/

Monday, March 18, 2013

lock-free library in c

http://www.concurrencykit.org/