OTFF @ CAFF (2011-05-28)
by Leandro Lucarella on 2011- 05- 29 06:55 (updated on 2011- 05- 29 06:55)- with 0 comment(s)
Orquesta Típica Fernandez Fierro @ Club Atlético Fernandez Fierro
LO MÁS ROCKERO EN LA HISTORIA DEL TANGOLO MÁS TANGUERO EN LA HISTORIA DEL ROCK
=)
CDGC merged into Tango
by Leandro Lucarella on 2011- 01- 28 22:49 (updated on 2011- 01- 28 22:49)- with 0 comment(s)
Yai! Finally my CDGC patches has been applied to Tango [1] [2] [3]. CDGC will not be the default Tango GC for now, because it needs some real testing first (and fixing a race when using weak references). So, please, please, do try it, is as simple as compiling from the sources adding a new option to bob: -g=cdgc and then manually installing Tango.
Please, don't forget to report any bugs or problems.
Thanks!
CDGC Tango integration
by Leandro Lucarella on 2010- 10- 21 02:34 (updated on 2010- 10- 21 02:34)- with 0 comment(s)
Trying CDGC HOWTO
by Leandro Lucarella on 2010- 10- 10 19:28 (updated on 2010- 10- 10 19:28)- with 0 comment(s)
Here are some details on how to try CDGC, as it needs a very particular setup, specially due to DMD not having precise heap scanning integrated yet.
Here are the steps (in some kind of literate scripting, you can copy&paste to a console ;)
# You probably want to do all this mess in some subdirectory :) mkdir cdgc-test cd cdgc-test # First, checkout the repositories. git clone git://git.llucax.com/software/dgc/cdgc.git # If you have problems with git:// URLs, try HTTP: # git clone https://git.llucax.com/r/software/dgc/cdgc.git svn co http://svn.dsource.org/projects/tango/tags/releases/0.99.9 tango # DMD doesn't care much (as usual) about tags, so you have to use -r to # checkout the 1.063 revision (you might be good with the latest revision # too). svn co -r613 http://svn.dsource.org/projects/dmd/branches/dmd-1.x dmd # Now we have to do some patching, let's start with Tango (only patch 3 is # *really* necessary, but the others won't hurt). cd tango for p in 0001-Fixes-to-be-able-to-parse-the-code-with-Dil.patch \ 0002-Use-the-mutexattr-when-initializing-the-mutex.patch \ 0003-Add-precise-heap-scanning-support.patch \ 0004-Use-the-right-attributes-when-appending-to-an-empty-.patch do wget -O- "https://llucax.com/blog/posts/2010/10/10-trying-cdgc-howto/$p" | patch -p1 done cd .. # Now let's go to DMD cd dmd p=0001-Create-pointer-map-bitmask-to-allow-precise-heap-sca.patch wget -O- "https://llucax.com/blog/posts/2010/10/10-trying-cdgc-howto/$p" | patch -p1 # Since we are in the DMD repo, let's compile it (you may want to add -jN if # you have N CPUs to speed up things a little). make -C src -f linux.mak cd .. # Good, now we have to wire Tango and CDGC together, just create a symbolic # link: cd tango ln -s ../../../../../cdgc/rt/gc/cdgc tango/core/rt/gc/ # Since I don't know very well the Tango build system, I did a Makefile of my # own to compile it, so just grab it and compile Tango with it. It will use # the DMD you just compiled and will compile CDGC by default (you can change # it via the GC Make variable, for example: make GC=basic to compile Tango # with the basic GC). The library will be written to obj/libtango-$GC.a, so # you can have both CDGB and the basic collector easily at hand): wget https://llucax.com/blog/posts/2010/10/10-trying-cdgc-howto/Makefile make # Again add -jN if you have N CPUs to make a little faster # Now all you need now is a decent dmd.conf to put it all together: cd .. echo "[Environment]" > dmd/src/dmd.conf echo -n "DFLAGS=-I$PWD/tango -L-L$PWD/tango/obj " >> dmd/src/dmd.conf echo -n "-defaultlib=tango-cdgc " >> dmd/src/dmd.conf echo "-debuglib=tango-cdgc -version=Tango" >> dmd/src/dmd.conf # Finally, try a Hello World: cat <<EOT > hello.d import tango.io.Console; void main() { Cout("Hello, World").newline; } EOT dmd/src/dmd -run hello.d # If you don't trust me and you want to be completely sure you have CDGC # running, try the collect_stats_file option to generate a log of the # collections: D_GC_OPTS=collect_stats_file=log dmd/src/dmd -run hello.d cat log
Done!
If you want to make this DMD the default, just add dmd/src to the PATH environment variable or do a proper installation ;)
Let me know if you hit any problem...
Bicentenario
by Leandro Lucarella on 2010- 05- 26 05:00 (updated on 2010- 05- 26 21:00)- with 0 comment(s)
200 years from the Revolución de Mayo, the main parade in charge of Dicky James, creator of De La Guarda and Fuerzabruta.
More (and better) photos here.
Naive GC fixes
by Leandro Lucarella on 2009- 05- 17 22:09 (updated on 2009- 05- 17 22:09)- with 0 comment(s)
I haven't been posting very often lately because I decided to spend some time writing my thesis document (in Spanish), which was way behind my current status, encouraged by my code-wise bad weekend =P.
Alberto Bertogli was kind enough to review my Naive GC implementation and sent me some patches, improving the documentation (amending my tarzanesque English =) and fixing a couple of (nasty) bugs [1] [2].
I'm starting to go back to the code, being that LDC is very close to a new release and things are starting to settle a little, so I hope I can finish the statistics gathering soon.
Debug is hell
by Leandro Lucarella on 2009- 05- 04 03:24 (updated on 2009- 05- 04 03:24)- with 0 comment(s)
Warning
Rant ahead.
If Matt Groeing would ever written a garbage collector I'm sure he would made a book in the Life in Hell series called Debug is Hell.
You can't rely on anything: unit tests are useless, they depend on your code to run and you can't get a decent backtrace ever using a debugger (the runtime calls seems to hidden to the debugger). I don't know if the last one is a compiler issue (I'm using DMD right now because my LDC copy broken =( ).
Add that to the fact that GNU Gold doesn't work, DMD doesn't work, Tango doesn't work [*] and LDC doesn't work, and that it's already hard to debug in D because most of the mainstream tools (gdb, binutils, valgrind) don't support the language (can't demangle D symbols for instance) and you end up with a very hostile environment to work with.
Anyway, it was a very unproductive weekend, my statistics gathering code seems to have some nasty bug and I'm not being able to find it.
PS: I want to apologize in advance to the developers of GNU Gold, DMD, Tango and LDC because they make great software, much less crappier than mine (well, to be honest I'm not so sure about DMD ;-P), it's just a bad weekend. Thank you for your hard work, guys =)
[*] | Tango trunk is supposed to be broken for Linux |
Naive Garbage Collector
by Leandro Lucarella on 2009- 04- 27 01:49 (updated on 2009- 04- 27 01:49)- with 0 comment(s)
I was working in a naive garbage collector implementation for D, as a way to document the process of writing a GC for D.
From the Naive Garbage Collector documentation:
The idea behind this implementation is to document all the bookkeeping and considerations that has to be taken in order to implement a garbage collector for D.
The garbage collector algorithm itself is extremely simple so focus can be held in the specifics of D, and not the algorithm. A completely naive mark and sweep algorithm is used, with a recursive mark phase. The code is extremely inefficient in order to keep the code clean and easy to read and understand.
Performance is, as expected, horrible, horrible, horrible (2 orders of magnitude slower than the basic GC for the simple Tango GC Benchmark) but I think it's pretty good as documentation =)
I have submitted the implementation to Tango in the hope that it gets accepted. A git repository is up too.
If you want to try it out with LDC, you have to put the files into the naive directory in tango/lib/gc and edit the file runtime/CMakeLists.txt and search/replace "basic" for "naive". Then you have to search for the line:
file(GLOB GC_D ${RUNTIME_GC_DIR}/*.d)
And replace it with:
file(GLOB GC_D ${RUNTIME_GC_DIR}/gc/*.d)
Comments and reviews are welcome, and please let me know if you try it =)