Slashdot Mirror


User: Hasdi+Hashim

Hasdi+Hashim's activity in the archive.

Stories
0
Comments
96
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 96

  1. Re:It's slow enough already... on Perl6 Being Rewritten in C++ · · Score: 2


    Early OO systems did a lot of runtime message passing, so they _were_ slow. C++, on the other hand implements a lot of the OO paradigm at compile time for more speed.

    I have to agree with you on this one. C++ is probably the fastest OOPL around. You can code OO is C but it gets ugly. Stroustroup wants the code to be as elegant as other OOPL but can be as fast as C. That's why you have virtual, inline, const, and static keyword cluttering the class declaration.


    The other argument I've seen about C++ has to do with it somehow not being as "close to bare metal" as C. This impression comes from the fact that C++ does a lot of weird things like construct temporary objects to fit an object into an expression where it otherwise can't be used. Of course C does this too; if f takes a float and i is an int, then in the expression "f(i)", C constructs a float out of i for you. The difference is that C++ allows you to create bonafide first class types.

    You are forgetting that class==private struct! At this point, a lot of compilers optimize ints and floats using automatic register allocation. Struct and array is usually implemented as a pointer to a memory on the current stack frame (Although since struct is well-bounded, there are optimization opportunity not in arrays). A C/C++ does not *care* how many temporary ints and floats you have, it will weed them out! struct/class temporaries always are spilled! You don't believe me, encapsulate your ints into a 'class Integer' and floats into 'class Float' and overload operators accordingly. Compile -O3 an arithmetic intensive functions one using pure ints and floats and the other substitute with 'class Integer' and 'class Float'. get code size using a dump utility. QED.


    A lot of the hot opinion about C++ "inefficiency" reminds me of all my CS professors who used to say as an article of faith that "recursion is inefficient", and then go on to code elaborate ugly iterative algorithms to get around this. Well, one day I went home and ran a few algorithms through the profiler, and guess what? Most of the time there was no difference, and some of the time the recursive algorithm was a tad faster.

    I know what you mean. That's what they say at Ann Arbor too. Some professors are either misinformed or either doing a poor lip-service to real gurus. Instead of using recursion, they wrote an iterative function with handcoded stack. They made the stack dynamic, extending their sizes using malloc() and free()!

    So what is wrong with the picture? The iterative function is poorly written. 99% of the time, the reason why recursive function is slower is because of the call/ret overhead and function header/tail overhead. If you replace this with a cmp/jmp, you will get much better performance, hence the endorsement for iterative functions. If you start using malloc() and free(), you are making the problem worse!

    If you want to optimize something, don't look at the C code. Look at how the code is being generated. A smart compiler can automagically convert a recursive function into an iterative one, if it is tail recursive.

    Enough ranting for one day. Back to work.

    Hasdi

  2. C++ slower than C != C++ cannot be faster than C on Perl6 Being Rewritten in C++ · · Score: 2


    Having written in both, I can tell you that I am able to actually write faster code in C++ than in C, not to mention that I make MUCH fewer stupid mistakes because of better type
    checking etc.

    Remember that C++ is a semantic extension to C. So whatever C can do, C++ can do it too. There are two possible places where C++ can beat C: 1) inline functions and 2) using const reference parameter. The first can be solved using macros or compiler-specific inlines.

    Based on my experience, the reason why some people find C is bigger than C++ is because the C code is written in a 'neat and tidy' fashion. C will punish you for this. If you want to write elegant code and want the compiler to figure out how to generate this efficiently, sometimes it is better to use C++. This phenomenon is similar to the case when assembly coders start to heavily use macros to make their code look neat and tidy, and later found out that it is much bigger than a C equivalent. C will look through the macros, and do proper register allocation and topologically sort the expressions for you.

    You can use C++ as efficiently as C if you don't use the extensions. When you do, it MAY start to kill you. At best, it will simplify code writing and maintainence for something you can manually code in C anyway. Case in point, GTK. At worst, you end up with code bloat because compilers are either immature or there are semantic constraints that prevents it from doing further optimization, which can easily done by human inspection.

    Kernighan/Ritchie designed C based on what they can generate in assembly. Stroustroup designed C++ based on what he can generate in C. There is going to be some efficiency in C++. So you have to ask yourself what is more important, ease of coding and maintenence (C++), or efficient and deterministic code (C)?

    Hasdi


  3. I am impressed! on Massive Fiber Cut Slows Net · · Score: 1

    Kudos to the inventers of the internet which allows communications between computer networks to be automagically rerouted when a path is severed by a nuclear warhead or a trusty backhoe! :-)

    And I aint talking about no Al Gore either.

    Hasdi

  4. Too Late on Norwegian Company Claims to have Patented e-Commerce · · Score: 1


    I wouldn't be surprised if law insurance became as common as medical insurance

    My tenant insurance already cover such a thing. If somebody in my apartment neighborhood said that my dog bit me and wants to sue me for it, my insurance will cover the legal expenses. You see, I don't have a dog, but (the like my agent says) you have to prove that you don't have one, so either you spend some time in the court rather earning your usual 15/hour, or you pay a lawyer to do it.

    Yikes

    Hasdi

  5. Natural Keyboard Follow-up on Carpal Tunnel Surgery? · · Score: 1

    I've been reading some of the responses on my earlier thread and I think I should add that my advice regarding the natural keyboard is not a medical advice. Furthermore, I was not talking about using it to cure carpal tunnel syndrome but to avoid it.

    AFAIK, when you drop your forearm while typing, you cause your median nerve to be stretched in the entire duration of typing. The problem comes when the streched nerve gets squeezed back when you are not typing. So, the solution is 1) to conciously lift your forearm while typing, 2) use a keyboard rest or 3) use an egonormic keyboard. No need to bash the hardware because it has Microsoft name on it. If you insist, you can check out Datadesk Smartboard; somebody provided a link to somewhere in this thread.

    Anyway, what do I know, that is what the links are for right?

  6. Some useful links on Carpal Tunnel Surgery? · · Score: 5


    Carpal Tunnel Syndrome Home Page

    A Patient's Guide to Carpal Tunnel Syndrome

    My advise is to use Microsoft Keyboard and/or Microsoft Mouse. They may make a lame OS but they sure know how to design good hardware.

    Hasdi

  7. Re:What about CDDB? (SURE!) on Publishers Lose Database Copyright Appeal · · Score: 1


    So, does that mean that CDDB has no rights to their music database, since all the data was user-submitted

    Yes. AFAIK, CDDB started of as a non-profit thingy and most users were not compensated for submitting the information.

    But this does not mean you can take CDDB database and publish it as though it is public domain. It still belongs to users who submitted it. IOW, if you want to make your own database, you still need to start from scratch.

    Hasdi

  8. JESUX.COM on Jesux is a Bad Pun · · Score: 2

    Looks like it didn't take long for somebody to claim the domain name. The homepage is last updated on the 24th September 1999. This domain was registered on 24th September 1999 by, believe or not:

    Satan's Minions (JESUX2-DOM)
    330 Washington Blvd Suite 602
    Marina Del Rey, CA 90292
    US

    I am gonna lookup for lucifux and penix next. If you guys have nothing better to do, I suggest you sign up these domain names fast! :-)

    Hasdi

  9. Re:Is this a school? on I Am Not a Student, I Am a Number · · Score: 1
    I can't think of that many people who have been tortured and brutally murdered in the name of Athiesm, as for the well know organised religions...

    go to dailynews.yahoo.com and lookup Turkey.

    Hasdi

    PS. Okay, it's secularism... but close enough

  10. Yeah right! on Cable vs. DSL, Explained · · Score: 2
    Simson Garfinkel has a great article on Salon which explains the relative merits and disadvantages of cable modems and DSL. This should quiet the cable/DSL wars seen occasionally

    Who are you kidding, Hemos? I think we both been on slashdot.org long enough to know this is just wishful thinking. :-)

    Later

    Hasdi

  11. Are forgetting somebody? on CNN On IPv6 · · Score: 3
    How were Vint Cerf, Jon Postel and Danny Cohen supposed to know that the system they sketched out on a piece of cardboard would one day be carrying everything from international currency transactions to Marilyn Manson videos?

    Shouldn't Al Gore share some of the blame too? -Hasdi

    P.S. sorry, i couldn't resist. ;-)

  12. Why don't they just sue Microsoft on NCR Sues Netscape For Patent Infringement · · Score: 1

    This is about Web Browsers right? It could probably apply as well to Amazon.com

  13. IA=32 not emulated under Merced! on Motorola G5 - 2Ghz 64bit · · Score: 1

    That is, if you believe the IA-64 application developer's guide on intel's website (developer's section). It's a 1.9MB PDF document. For full detail, check out chapter six. You can see the glorius mapping of IA-32 registers, ala PII's MMXregs on FPregs.

    What would be interesting is how much extra silicon/cost will it take up? Will the heat dissipation levels be acceptable?

    If it makes sense, it brings us to another question, why don't Motorola have an IA-32 unit on their PowerPC chips?

    Later

    Hasdi

  14. Some pickup lines for you on Girls Like Linux Too · · Score: 1


    There's a gorgeous geek girl working for our Y2K team, but can I pluck up enough
    courage to talk to her? (the answer rhymes with "hoe")


    I misplaced my email address. Can I have yours?

    I have a harddrive. You wanna mount it for me?

    You know what the 'A' in 'A drive' stands for? That's for All Night Long.



    Seriously, dude... just say something to her. Ask her out or something. Maybe she is waiting for you to ask her. The worst she'll do is to say no.

    Hasdi

  15. LINUX DISTRIBUTION MONOPOLY on German Law Firm claims Linux Trademark · · Score: 1

    They claim that they are 'friends' of the linux community. so if this applications fails, it sends a strong signal to all would be linux distributors that nobody can trademark linux in germany. If any other company applies in the future, Channel One can counter that application because their application have been rejected before (IANAL).

    If this applications succeeds, they can position themselves to be the sole distributor of the gnu/linux operating system. They say they won't but that does not mean they will. Not very good.

    The best course of action I see is to file a counter to that application. If Channel One intention is true, failing the application would not affect them. That is, they can be sure that no other company will be able to force them to pay money for the use of linux trademark. If their intention is not.... well..

    Any volunteers? I'm not German.

    Hasdi

  16. Re:Evolution *IS* a religion! on Evolution is a Myth in Kansas · · Score: 1

    I believe it is the right of all students to be given evolutionary theory in the context of "our best guess right now"

    You are missing my point. Everybody has their own 'theories' and 'their own best guesses' on how we came to be. Why should everybody be taught your belief? Why isn't creationist's theory be a mandatory subject as well?

    Hasdi

  17. Re:The rest will accept it on Can humans create life? · · Score: 1
    Lack of belief in xxx' does not equal 'belief in the lack of xxx'.

    I am well aware of that. It's just that defensive behaviour shown by some non-theists in this forum suggests refusal to believe. It is because of past experience? Some interest at stake?

    In a book on atheism that I recently read, the author points out that all children are atheists when born- not because of refusal to believe in one thing or another, but because they do not yet have the experiences on which to base theistic beliefs.

    Fascinating. Islamic religion claims that every child is born innocent, a moslem.

  18. Atheism vs Theism OR Atheism vs Christianity? on Can humans create life? · · Score: 1

    Is it just me or it seems that whenever somebody bash down theism, I see references to Christianity? I mean, I am sure there are other religion out there. Is it possible that you don't agree with the execution rather the principle behind christianity? In addition to contact, maybe you should watch "Stigmata" or wait till it comes out on video.

    Hasdi

  19. Spontenous Generation Theory on Can humans create life? · · Score: 1

    Unless theories have changed since I was in school, no one has speculated that bam! a bacterium suddenly appeared in the primordial soup. . . I'd be much more impressed if a scientist could create, in the laboratory, a life form simple enough to have happened by instantaneous chance, and that doesn't require other life forms to survive (e.g. a virus is so simple it needs a "host"), and that can survive and reproduce. A bacterium survives because of its complexity. Please, someone, show me...


    I just wanted to note until Louis Pastuer(sp?) came around, many scientist believe in 'spontaneous generation' theory. In this theory, when you leave food in the open, with air and water, bacteria will automagically form. The scientists who claimed that bacteria came from the open air, rather spontaneously generated, were viciously shot down.

    One scientist conducted an experiment, cooked a glucose solution in a beaker and closed it with a cork. no bacteria were formed. Spontenaous theory advocates argued that when you stuffed the beaker with a cork, you cut of the air supply so the theory still holds.

    Louis Pasteur did something similar but this time stuff it with cork with an S-tube. This should supply the beaker with fresh air but the bacteria will be trapped in the S-tube. No bacteria were formed until this day.

    I can probably relate why these scientists were so defensive about the theory. It bacteria can be spontenously generated, and you add that with darwin's theory of evolution, you can show that the human species were not created by outside intelligent force(s)... just random chance.

    This brings us back to the original question: Lack of belief or refusal to believe? Are scientists like lawyers were they gather evidence to prove their side of the case or independent investigators who are just interested in figuring out what really happened? still curious...

    Hasdi

  20. Re:What does "religion" has to do with it ANYWAY?? on Can humans create life? · · Score: 1

    Since I suspect you will not accept any religious reasoning anyone have to offer to you, let me just say:

    You don't need to be religious to be zealous.

    Hasdi

  21. Re:The rest will accept it on Can humans create life? · · Score: 1

    This is bad karma but...

    I think the non-theists will accept anything of this sort forever.

    It seems to me that non-theist will believe and pursue anything that shows that the creation of the human species is independent of God or the existence of God. Which begs the question of is this lack of belief or refusal to belief? Does have anything to do with bad experience with some members the religious right? they being too imposing? curious.

    Hasdi
    - Watch Stigmata! 4/5!!

  22. Re:Communism, a FUD victim on Cybercommunism and the Gift Culture · · Score: 1

    Communism could be summed up by the phrase "from each according to his abilities, to each according to his needs". It has nothing to do with freedom or the lack of freedom according to any of the definitions often used on this board (speech, beer civil)

    I remember in the eighties when the mass media potrayed communism as something outright evil. We even get them now on some X-files episodes. The ones communism pose a threat to are the mega-corporations. They are not willing to let their properties controlled by the states, so they spent billions to spread FUD on communism, associating it with unpopular things that has nothing to do with communism. Not that I am in favor of the ideology but I think they are getting more beatings than they deserve.

    Capitalism won. With Communism, the state is control. With capitalism, the mega-corporations are in the control. The danger to individualism and freedom has not changed, only the rules of the game. If one entity is not in control, another entity will.

    Hasdi

  23. Improved Moderator History on Slashdot's Meta Moderation · · Score: 1

    Yeah, I know. It has been mentioned before. The *difference* is the moderator's name is not mentioned, maybe a silly tag like 0021321. Only Hemos and CmdrTaco knows which moderator 0021321 is associated to. If we (the readers) see this tag often, we know if this particular guy/girl is on a reign of terror. We also have his/her moderation history but don't know the name. If we don't like him/her we can tell CmdrTaco and Hemos and they can take proper action on the actual user.

    Hasdi

  24. Re:Clarification on SuSE and Siemens Release Linux Memory Extension · · Score: 1

    well i am pretty sure about the 2GB split memory model back in 1.x (or 0.x?) if I read the kernel hacker's guide correctly. I guess it came a long way since then. Back them, 2GB per process seems a lot so this is like a cheap efficiency trick.

    In any case, the limiting factor is the kernel/user memory model rather than the kernel per se. I still think we be better off with a 64-bit architecture.

    Hasdi

  25. Clarification on SuSE and Siemens Release Linux Memory Extension · · Score: 3

    Just a quick note to everybody. It is not about being able to use 4GB of physical memory. It is to enable process to use more than 2GB of memory. Traditional Linux memory model to is split the lower half for kernel memory and upper half for user memory. To check if the pointer is pointing to a kernel memory you just need to check its MSB.

    test %eax,0x8000000
    je user_mem_label

    I think they have worked on 3GB prior to this. SOrry, been a while since I checked the kernel lists.

    Anyhow, this is only of practical use to database developers. maybe some but not many. In any case, you might as well use a 64-bit architecture.

    Hasdi