About this blog:

Ego-stimulation spot. [3dGfx,Maths,AI,Coding,...]
Blog plan: no plan.
It will be an archive of thoughts, ideas, discoverings and experiences in the various fields I find intresting. That's all, nothing special but I'm publishing this stuff because mabye there's someone that could find this stuff useful... Hahaha, well no I think that's not the reason. It's an ego-stimulation site... [more about e-s]

bout me

My name is Angelo Pesce, I'm Italian and I was born in 1981. I'm currently studing at the University of Salerno. That's enough for bio. My main interests are 3d graphic research (used to be realtime rendering but now I'm much more interested in raytracing stuff), 3d graphic modelling (sometimes I play with Lightwave or Rhino), mathematics, art, music, coding, demoscene. I'm not good in every field, but I'm curious, I enjoy learning new things.
Philosophically I'm an atheist and a mechanicist.


Math world
3d Gfx Deathfall
Grafica obscura
Karl sims evolving creatures
Photography - Man Ray
Graphics research
Mozilla browser
Demoo scene
many other things...

Hacker Kulture
Microsoft C# and CLR
Microsoft directX
Microsoft Messenger
mIrc scripts
almost everything...


July 2003 / August 2003 / September 2003 /

Using blogBuddy

Powered by Blogger Pro

Feedback by backBlog


thi s i
  menge r  
  spong e    
Blasphemus (latin): blasphemer, [adj.] reviling



                                .Thursday, August 14
Is lisp slow?
Yes, I've said that lisp is slow. I still believe in this, or better, that if you want to write fast lisp code you have to write ugly lisp code (this is quite true for java too, but java has less variance). That's mainly because lisp is more "high level" so writing low-level optimized code requires messing up the language quite a bit. The fact that lisp doesn't matter about hardware numerical support (integers in lisp are usually in infinite precision) and that it has a "bad" support for static variable scoping also helps... BUT there's something that can make lisp very fast in some projects, and I forgot to mention it, it's its capability to view functions as data, and to compile them on the fly. This gives you the possibility to create new functions in runtime and to compile them. I plan to use this feature in my genetic-programming inverse mixed-polar-ifs solver, to evolve mixed-polar-ifs descriptions and then compile them to have a fast way to evaluate the resulting iterated function fractals to establish a fitness measure for the description itself.
You can find this stuff and much more in the On Lisp book by Paul Graham. It's a GREAT lisp book, read it (it requires just a very basic lisp knowledge to be followed and enjoyed).
                                .Tuesday, August 12
Some time ago I installed the famous Seti@home background number-cruncher. For the few ppl on the net that still don't know it, it's a tiny toy that "steals" your idle (wasted) cpu cycles to help finding extraterrestial intelligence. The project was intresting, but it's too hard to have any success and so it seemed to me that I was still wasting my cycles. There are a pletheora of such projects on the net, but you'll hardly find a "useful" one. The most intresting ones are the pharmaceutical research projects but reading a bit here and there I've found that in most cases the property of the drug, if one is found, will be of the (usually private) sponsoring association. And I don't want to give my cpu cycles so others can make much money without having to spend a lot in research.
Currently I'm running foldingAThome, it's good, non-intrusive, it doesn't crash and it seems to be promising too.

If you don't want to share cpu cycles, but your knowledge, check out mindpixels or the (really good) wikipedia-
                                .Monday, August 11
My new cat
                                .Friday, August 8
Fountain pens

Lots of posts today... and if I manage to finish my new GP system they won't finish here... By the way, I was thinking that I'm talking about computer languages and programming a bit too much, as this should be a random blog and not only a programming one! Sometime I'll post something about graphics too, but for now I want to give a couple of links about another hobby of mine, fountain pens. Well to say the truth I haven't found many good sites about that, so I hope that someone can help me finding new spots too! Enough saied, now the links: grinding your own italic nib (I've tried that, it's not hard), Glenn's pen page, Pen Hospital, a never updated foutain pen page, PaperPenalia.
The picture above is the pen I currently use most of the times, I hate montblanc pens but for that one I made an exception, it's really nice. I also love the mont blanc agatha christie, but it's way too expensive for me at the moment.
Languages for the .NET CLR
Good news! Microsoft started a SML/OcaML compiler for its new .NET plattform, this could give functional programming a new boost. I really HATE .NET, as I hate every Microsoft attemp to pick up a mature, robust, widespread standard (JavaEE) and copy it making its own proprietary version. But this is really good news, mabye something will change and more people will start using those more high-level languages. Also check out other microsoft language researchs and to be fair the currently available languages for the Java plattform too.

While searching for a good image for that topic (and I haven't found anything decent as U can see) I spotted this one:

nothing to do with the topic, but HEY! Usually my images do NOT have anything to do with the topic anyway!
Languages for computer programming
Lame title for a lame post. Better if I put a good image here, to compensate...

Ok now, what I wanted to do is a little review of the programming languages I know and use, something like the Alex Champandard one on flipcode, just worse :)

Basic Hahaha, this one is funny. I learned it on the glorious commodore 64 when I was 9. It's not usefull for anything, it used to be a beginner (all-purpose symbolic instruction code) language. Nowadays I wouldn't recommend it for any task, even not for learning or for elementary schools. You will learn to code the bad way, doing spaghetti code and it's not really that easy by the way. It's better to start with a real language (C) or with some "educational" one (Logo, Pan#, Haskell, Scheme). I don't want to talk about Visual Basic at all. After c64 basic (made by Microsoft) I used microsoft QBasic/QuickBasic (good ide, good library) and PowerBasic. PowerBasic had an 8086 (only realmode) inline assembler, so I switched to:

Assembly I started to use 8086 assembly as I wanted to code realtime graphic effects and PowerBasic was simply too slow for that. Nothing to say, it's the most low-level language in the world, I used it only to squeeze some more cycles from my old hardware, and I learned to optimize it very well for the 80x86 family of processors mainly thanks to the Agner Fog's tutorial. Nowadays asm optimization is the last thing to do (if even), and noone writes 100% asm programs on a Pc anymore. It's still kinda usefull for small devices, with low performance or memory. After 80x86 asm I learned c64 asm (6510), mips asm for the university (and I wrote a mips assembler/debugger/virtualmachine), a bit of z80 and 68000 asm and java bytecode (!!!) Advantages: Speed, Size, Lowlevel hardware access - Disadvantages: Difficult to learn, code, read, debug, maintain, extend

C This is the first REAL language I learned. It's the most widespread language in the world (with C++). There should be a reason (and in fact there is, maybe it's not a GOOD reason btw). Definitely it's a must-know, you'll find a C compiler everywhere. It's still a very low-level language, it's easy to learn, as easy as Pascal (and that is considered by many people an educational language), VERY fast and it has a decent syntax. You will learn imperative programming with it, but I would not use it for a big project as it's unsafe, hard to maintain and basically it's not really much more advanced than assembly. Good to learn imperative style of programming and how a computer works, good if U have to make fast code or have lowlevel hardware access, bad for everything else.

Pascal If U know it maybe the only real use you can make of it is with Delphi (an object pascal rapid application development environment by borland). Otherwise, don't learn it, is as easy as C, as powerful as C, but much less used.

C++ Surprise, surprise, this is the language i learned after C. Some people think that C++ is just like C with a couple of feature added (C++ is backward compatible with C), and so it's not hard to learn C++ if you know C. Maybe it is, I learned most of C++ syntax in a week. But learning its syntax is not the point, with C++ you'll get an Object Oriented language, and this is the BIG step, starting to think in OOP. More advanced C programmers tend to write in and OO style even if they use a non OOP language, because this is the only way to make big programs in C without going mad. Learning C++ is not that hard, learning it WELL it's REALLY hard. C++ is big, complex and powerful, do not underestimate it. It's also a "new" language, the C++ Ansi standard is recent and still many compilers aren't 100% standard. However this one, like C, is a must-know. Advantages: Object Oriented, Powerful, Fast - Disadvantages: it's not a pure OO language, it's complex, it's still kinda low-level and unsafe

Java Java is a language that I really love. It's simpler than C++ (much simpler, it's even used as a beginners language), it's almost as powerful as C++ (it still lacks templates-generics but they will be added soon) and it's much more safe. If you learn Java after C++ it may seem that it isn't really a different language, it's just like C++ but less complex and more secure (java is much less low-level than C++). But when you start coding in java you'll find that those little differences make it a much easier and more productive language. Java has some unique features too, it's a portable language, java applications are not compiled to machine-code, but to an intermediate form called java bytecode, this bytecode is then compiled just in time by a java virtual machine (and now most JavaVMs are mature enough to not cause big problems between different implementations), it's designed for internet, it's secure (there's no way to have a direct hardware access, so the only hacks that are possible are the ones based on some bugs in the virtual machine) and safe, it runs on many different plattforms (from enterprise servers to celluar phones), it has an automatic memory management (garbage collection or GC). Some people still believe that Java is slow, well that's not true anymore, I have made many benchmark and with recent JVM/JITs you'll get an executable that's usually only 25% slower than the pure-C version. Of course it's not a language for the ones that need to squeeze every cycle out of the CPU, but it is fast enough for most uses, even for many realtime applications.Advantages: purely OOP, Secure, Safe, Easy, Mature, Portable, Internet support, GC - Disadvantages: No lowlevel hardware access, it's still a purely imperative language

ML family Now those are good. When I learned about functional programming I tried many different languages but nothing seemed as good as ML ones. ML is a family of languages like most functional programming ones. The best members of this family are SML/NJ and OcaML and those are the one I used most. If you already know C/C++/Java you have to give a try at functional programming, even if you won't use a functional language for any serious project (there's no reason to not use them, it's just an example) the knowledge of functional programming will change your style of thinking and coding. It's not something that I can fully explain there but this is really a better way of coding. Imperative programming is limited by the fact that it works just like the underlying computer, using instructions that modify the environment (side-effects). This is NOT how we think about computations, that's what the VonNeumann style of computers do to compute things (this is to say, that ALL imperative programming languages are really low-level ones, because even if they abstract from a specific hardware, like Java, they still work like the hardware does). Nowadays we should abstract from how the machine works, and start thinking about how we can code better, because we have to find different paradigms imho, the current ones show clearly their limits. It's impossible to make a bug-free program, it's impossible to make a secure program, it's damn hard to extend and maintain code. We are developing some complex techniques to push our actual language technology further (like OOP and GC) and make our life easier, but those are only "addons", not really new ways to do things. If you want to know something more about that, start with why functional programming matters and then try to learn SML or OcaML. OcaML is more used, it's one of the best known functional languages (after lisp and scheme I think) and it has a very good library and a good compiler (it generates code that's actually faster than the Gnu C Compiler!), also it's not a purely functional language, it still allows some side-effects (imperative programming). Advantages: Fast, High-level, Nice syntax, Safe (strictly typed with type inference), GC - Disadvantages: A bit hard to learn for an imperative programmer (that's why you don't have to learn just a new syntax, but a new way of thinking), not much used, it's not a lazy functional language (check out Haskell for that)

Prolog I don't know this one much. I know the basics and I have read a few books about it but I can't really code in Prolog. It's hard to understand for an imperative programmer and hard for a functional one too. Give it a try, and if you don't find it good for anything, give it another try. It's a logic programming language, it's extremely easy to use for some tasks (IA stuff and everything that requires searching or that implies logic), but it's hard for other ones. It doesn't have a true arithmetic support too. Why I tell you to try this one? Because it's a good approach to declarative programming, and declarative programming is a true high level paradigm. That's to say, it's something that in a perfect world we should use to do everything, you don't say what the computer has to do, but what the problem it has to solve, declaring the properties of the solution. It's the basis of the Japanese fifth generation language project.

Lisp Phew, this is the last one, as U can also see as most of my recent posts are about that language. It's a functional language, but it's a "strange" one. At first it seems to be really weird, it has an horrible syntax with pharentesis everywhere! But there's a reason for that, and a good one too. In Lisp data and code are expressed in the same, unifying syntax, using lists. Everything is a list. Why? Because doing so you can make code that manipulates code, modifying itself. It's something really powerful when you learn how to do that (and if you have to do that by the way). But that's not the only advantage, as there's only one kind of syntax for everything you can extend the language easily, and your extensions will be no different from the core language itself. In fact when you write lisp code you are not only writing your application, but you'll see that you'll start to actually modify the language to suit your needs, adding new features and functions. This is completely natural, and that's due the particular mix of features that make the Lisp language, so this one is another "enlightening" language, even if you won't use it for real work, it will change your mind. But be warned, it's a bit difficult to make this step, in my older posts you will find some basic tutorials that will help you, but at first is completely normal to think that Lisp is just crap. What else to say? Lisp in a symbolic language (it's better suited to manipulate symbols than number, for example it's easier to write computer algebra system with it than a numerical library), it's one of the oldest languages still used (with fortran), it's the first functional language ever made, it has a great OO system (the first one to have an ANSI standard, and for many people the most advanced one in the world) written in Lisp itself (as lisp is so flexible, there is no need to write a "Lisp++" to get an OO system) and it's much used for AI stuff. It's really a BEAUTIFUL language, after learning it in the "right" way you'll know what I mean (and if U search for a more beautiful one, but less production-ready, try Scheme). It's Slow. You'll find on the net many tutorials, benchmarks etc that say that Lisp is not slow, it's comparable in speed with C and faster than Java etc... Don't trust them this is not true. Well it's half-true. With lisp you CAN make fast code, but you have to code in a really ugly way, loosing many of lisp advantages and using weird declarations to turn it into a strictly typed language. This is also true for other languages by the way, for example if you want to optimize Java to the max you have to write bad code, doing by hand all the optimizations that current java compilers don't do and studying the transformations done by your target JavaVM, if you want to write OcaML code that is faster than C you have to use OcaML as an imperative language etc... Advantages: Code as Data, Flexible, Powerful, Mature, Safe, GC, Symbolic - Disadvantages: Slow, not suited for numerical computations

P.S. If U found this post interesting (lol) you can enjoy The Win32 Great Computer Language Shootout and the original Shootout
P.S. The image is taken from Back orifice 2000 propaganda
P.S. I hope I won't be flamed too much for this post...


I hate web design. I hate web design. Made with Macromedia DreamWeaver MX. Web design hates me. Tested with IE and Mozilla under WinXP@1280x1024. I hate web design.