Slashdot Mirror


User: ratboy666

ratboy666's activity in the archive.

Stories
0
Comments
1,665
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 1,665

  1. Home directories on How Do You Sync & Manage Your Home Directories? · · Score: 1

    Multiple?

    I use automount, with nis and nfs. Linux and Solaris. New machine comes on, it just has the login/home directory. Naturally, it doesn't work on any of the inferior OSs. Neither Windows nor Mac OS X work with this setup "out of the box". Windows can mount my home directory with CIFS. And I just haven't bothered with Macs, though I suspect it would be the same.

    On the road, I use unison to sync my home directory into work files, and then resync on return, if I know I will have limited connectivity. I use fuse sshfs if I know I will have reasonable connectivity, mounting my real home directory onto a subdirectory.

    All this to keep a SINGLE home directory, under my control, with minimal effort (zero) needed to bring up additional machines.

  2. Re:Clarification? on Blu-ray Adoption Soft, More Still Own HD DVD · · Score: 2, Interesting

    These figures show something but I am not sure I like it.

    People who have stand-alone players probably want to buy media in that format. Even when the gaming systems are included, the numbers are roughly equivalent. But, there is a sizable lead HD-DVD over BluRay.

    I have an HD-DVD player. A few movies for it (although, its mostly just a DVD player for me). Would I buy HD-DVD movies? Hell, yes, I keep getting marketing literature for Hi-def movies, to which I reply "Yes, I would be interested, please give me HD-DVD format".

    The demand is there (30% greater install base) -- where is the media?

    Yes, I believe there is a conspiracy to eliminate HD-DVD. Personally, I don't give a hoot if players are no longer available, but, given the install base, it WOULD make sense to make HD-DVD releases.

    But, no new HD-DVDS: http://hddvd.highdefdigest.com/releasedates.html

    No HD-DVD rentals, no HD-DVD "classic" sales at Walmart. EVEN THOUGH THERE ARE MORE INSTALLED HD-DVD PLAYERS. Sounds like cartel behaviour to me. Certainly no market forces at work. Why doesn't someone get into the business of mastering "bargain" HD-DVDs to sell for $15? If one in ten US households have an HD-DVD player, it certainly sounds like a business opportunity to me. At least I should be seeing HD-DVDs in the second-tier retailers "XS Cargo". Simply run more of the movies already mastered!

  3. Re:Where's India's domestic economy? on Indian CEO Says Most US Tech Grads "Unemployable" · · Score: 2, Insightful

    Talk about missing the point...

    The point is that such disparity should be exploitable. The parent poster DOESN'T CARE why there is an order of magnitude price difference. If it does exist, he wants to exploit it.

    That disparity could not exist in a free market. Since it does, the market IS being controlled, and the people being screwed are the ones on the "high side".

    Got it now? You ended up making his point for him.

  4. Re:Sorry NewYorkCountryLawyer on How RIAA Case Should Have Played Out · · Score: 4, Insightful

    Well...

    You shouldn't concentrate so much on that verdict, but as to what that verdict does to foreign perception of the US. I live but two hours from the US border, and what Jamie did doesn't even qualify as a civil issue, let alone a crime, where I live. Unfortunately, US lobbyists are trying to change the law here, but, so far, with little success (except for the typical lip service; love to see politicos at work sucking hard!).

    Tough luck on the verdict, USA. I am laughing at you.

    Now, for a practical matter. If a friend from the US comes and visits, and makes copies (or downloads) of music, is she liable for copyright infringement when she returns to the US? Now, further, if she downloads exclusively from me, and yet is resident in the US, is she guilty?

    Tough questions, but these SHOULD be resolved in a hurry. After all, the difference between $0 and $1.92 million is, well, $1.92 million! Comparisons to cocaine smuggling are welcome... You can get 500 songs on the cheapest mp3 player these days, which is 400 times what Jamie is accused of, with a potential fine of 1/2 billion dollars now -- Say this out loud, and try not to break out laughing. "a $20 investment can result in $500 million in fines".

    Nope, couldn't keep a straight face, sorry.

  5. Well Done! on In Round 2, Jammie Thomas Jury Awards RIAA $1,920,000 · · Score: 5, Funny

    Well done, RIAA, and a hearty thank you to your minions at MediaSentry.

    I now feel that I am REALLY getting my monies worth from my Internet connection. Just downloaded 1,000 songs in a collection "Best Rock Songs Ever".

    Used Bittorrent, so I figure that, at 80,000 per song, I just copped 80 MILLION DOLLARS last month!That theft took just 5% of my transfer cap, so I *could* go for 1.6 BILLION if I really got cracking!

  6. Different Laws on Anonymous Newspaper Commenters Subpoenaed In Tax Case · · Score: 1

    The value of a US Gold Coin is, to the government, precisely what was marked on that coin. Since it is not legal for citizens to physically destroy that coin, rendering it into bullion, its value remains that.

    Now, you could sell that coin elsewhere (I am sure that the coins can be converted to bullion in other countries), and thus achieve a profit, but that is dealt with by other provisions.

    The ONLY danger in the US itself is paying in such currency is a severe de-valuing of paper currency. Given that an ounce of gold runs $900 or so in paper currency, 10 to 20 coins will pay for a car! That values the car at $500 to $1000, and not $9000 to $18000. An order of magnitude.

    The taxes from this transaction are now severely limited - a mere tenth of what they were. Think of it - two different prices, depending on what currency is used. This is not unusual, pricing is set according to currency value by all international companies.

    The error made by the US was to fix a face value on the American Eagle. The Krugerrand, directly comparable, has no such face value. Its value is the value of 1oz of gold bullion. That same car also costs 10 to 20 coins. But, there is no disparity between face value and "paper value".

    Introducing the face value means that a section of the economy could choose to "live in the past" and simply accept that valuation. Which is why the government attacks -- people just "shouldn't" be doing that sort of thing. It's almost as if, you know, the government could be held to task for the valuation!

    Let's use a "J. Random" quote we find on the Internet (actually from a user aikitrader, but who really cares?):

            "OK...take Americans for instance....we know with reasonable certainty that a 1 oz Gold American Eagle contains one ounce of Gold. Now if I were trading a car for Gold and my car is worth $1120...I would ask for 2 Gold Eagles in return today. How many $20 Swiss Francs would I ask for? I am not sure of the Gold content in the $20 Swiss Franc? So I don't want to trade my car for a Swiss Franc because I am not sure of it's value. I am not familiar with it."

    We can plainly see that aikitrader is converting paper US currency, gold content, and Swiss currency. As we also note, all of these have a marked face values. aikitrader will use face value for paper, and for swiss currency. But for American Eagle coins contemplates the transaction in terms of NUMBER OF COINS, and not really face value. What is the price of the car? Simple enough, it is $1120 in paper, two American Eagle coins, or the equivalent in face conversion in Swiss Francs. What is the face value (US government valuation) of the American Eagles? $100. As long as aikitrader is NOT destroying the coin, she can value it as she chooses, and the government values it at $50.

    A tax issue? I think not. And, if you (presuming you live in the US) think it IS, I would recommend another revolution. Simply because you can't trust your government anymore. The issue shouldn't even come up -- even if the government wanted to control it, there are much better remedies than tax law. Simply buy up the damn coins. The government issued, they should be able to de-issue. It's done all the time with other currency.

    I can give a clue to the US Government here - stop minting the damn things! Face value of $50 and initial sale of $1000 paper, with a continued valuation of $800 or so... the government is really screwing with your heads.
       

  7. Re:Change the system on Better Tools For Disabled Geeks? · · Score: 1

    You're just a bit late -- MVC. Note that MVC is not considered the best approach to the problem, but it was conceived when the first Smalltalk systems were created (in the 1972 - 1980 time frame).

    MVC: Model/Viewer/Controller

    The Model contains the specific application class(es). The Viewer queries the Model, and displays the state of the application (as appropriate). The Model can also "broadcast" to Viewer (generally, the Viewer registers an interest in updates to the Model). There may be multiple Viewers for a single Model.

    The Controller supplies new data to the Model. Again, there may be multiple Controllers.

    As to implementation: the Model should not have any concept of "UI". It should accept commands from the Controller, and be able to broadcast state changes that MAY be of interest. It should also support a query interface.

    There should not be ANY "mutable" objects in the controller, and only "cache" objects (if REALLY needed) in the Viewer.

    To continue with your example of an editor. The Model is the editor. It accepts commands, and perhaps has the idea of a "point". The "point" is probably going to be maintained as an association between the Model and a particular registered Viewer, because there may be multiple Viewers, and we would like each of these to have an independent "point". If the GUI informs the Viewer that a redraw is needed, the Viewer retrieves the needed information from the Model. If the editor is NOT using a GUI, the Viewer may well just be retrieving and displaying lines.

    MVC Failure?

    GUI programming environments (exemplified by early Visual Basic), made it easy to create UI elements and attach or modify code snippets associated with actions on those elements. This can result in rapid prototyping of applications, but completely loses the distinction between M, V and C. The Controller no longer exists outside of the Viewer -- it is directly bound into the Viewer. Since "normal" constructs in the programming language did not respond to messages (that is, an ARRAY did not respect the messaging protocol), it was easier to store application state in visible, and sometimes, invisible elements, that eliminating any distinction between Viewer and Model. Thus, it was not convenient to consider MVC as a design (except in name only).

    Of course, the eventual loss is that these applications can no longer be easily modified for other UIs, including disability provisions. Note that a "general purpose" platform can only suggest a MVC methodology. If this was FORCED by the platform, the platform would be quite restrictive. Because of this, current platforms did NOT enforce the paradigm, and the lossage was allowed to occur.

    (An Exercise left to the Reader: Compare and contrast MVC history to Web Browser history, with an emphasis on available development tools. How did the available Web development tools influence the direction of HTML?).

  8. It is reasonable on DTV Transition Mostly Smooth, Windows Media Center Problems · · Score: 4, Informative

    A bit thin skinned?

    First, Microsoft has in excess of 80 to 90% of the market, and Linux is "desktop irrelevant" at 1 to 5%. Given those figures, isn't Media Center the ONLY TV application that matters? If there is a problem, it really only affects Media Center, right?

    So, it's not "Microsoft Bashing". It's simple reporting. And, on a tech oriented website, I would certainly expect some tech slanted coverage.

  9. Re:DRM on DRM Group Set To Phase Out "Analog Hole" · · Score: 1

    Don't buy the blu-ray. Buy the DVD. The material you are downloading is usually of no better quality anyway. And, if you get the DVD you can rip it yourself.

    Let the blue-rays rot on the shelf.

  10. Re:Okay, enough already on EC To Pursue Antitrust Despite Microsoft's IE Move · · Score: 0, Troll

    Enough already?

    What, exactly, is enough? Microsoft is a convicted monopolist. Convicted of illegally extending the monopoly. Which made them a lot of money.

    An argument can be raised that enough would be "reasonable" fine, in line with EU practice and law. We could argue about the amount, but EU fines allow up to 10% of a companies annual global turnover for each year of the behaviour. Microsoft boasts in excess of $50B in annual sales. Given the behaviour lasted a few years, the fine could be well in excess of 10 to 15B dollars.

    Given other recent EU activities (vs. Intel), they may reduce the fine to 1%. But, it needs discussion. We are talking BILLIONS here.

    Somewhere between 1 and 15 billion is the "truth"; it doesn't sound like simply un-bundling to me...

  11. Re:Thottle Capability on Linux Kernel 2.6.30 Released · · Score: 1

    "ESX Server uses a proportional share mechanism to allocate CPU, memory, and disk resources when multiple virtual machines are contending for the same resource. Network bandwidth is controlled with network traffic shaping.

    CPU and memory resource each offer an additional dimension of control. For CPU management, you can specify a minimum and maximum percentage of a single physical CPU's processing power for each virtual machine. You may also specify CPU shares and restrict a virtual machine to run on a certain set of physical CPUs (CPU scheduling affinity). For more information, see Admission Control Policy."

    Which is, of course, NOT "SLA Provisioning". To achieve SLA provisioning, you need a QoS history, SLA policies, an evaluator, allocator, and supervisor. For one, QoS history is Unix classically is "sar" data, but beyond collection of certain kernel data, this is beyond the kernel. SLA policies are similarly NOT in the kernel domain. Basically, the kernel provides information and limits, which can then be utilized to provide SLA provisioning. Linux does not offer this base functionality (and control), whereas it is available in Solaris and ESX.

    VMware also offers warm/hot migration which can aid in the implementation of your SLAs. Is supporting an SLA expensive? Sure, it is. But what I was referring to was the availability of the kernel level features needed to base the feature on. *I* didn't mention SLA Provisioning and controlled DOS boxes for games in the same post. Since the GP *did* mention both of these, I assumed that it wasn't REALLY about SLA Provisioning, but about being able to control virtual machines to a finer degree.

  12. Re:Thottle Capability on Linux Kernel 2.6.30 Released · · Score: 1

    Here we have a disconnect. If the OS you are using DOESN'T support a feature you need, use one that DOES.

    If you want to run POSIX/Unix mostly server applications in a way that allows resources to be controlled at this level, don't use Linux. Oracle/SUN has this nice open-source OS called Solaris that supports containers (zones) that will do what you want.

    VMware has this nice product called ESX that can do the same thing https://www.vmware.com/support/esx2/doc/esx20admin_res.html except that you still need another OS.

    Which leaves you with ESX + Linux, or ESX + Solaris, or Solaris. Of course the ESX solution allows ESX + Windows as a possibility, although Orcle/SUN has another product called VirtualBox.

    Now, it can be difficult choosing -- because there are even OTHER solutions that would work. Remember, Linux (though good, and my preferred desktop and small server platform) is not necessarily the end-all and be-all in OS's.

    Also, remember that, even if a platform is "free" (as in freedom, and even, sometimes, as in beer), there are people out there who can help you architect a solution (usually, not so "free" as in beer).

    Your personal use would not be met by these solutions, though. Sorry about that (the accurate DOS machine including timing). But you did mention LPARs; and that idea can be supported.

  13. Re:Transparency. You keep using that word. on Eric Baptiste Weighs In On Copyright Summit Issues · · Score: 1

    How do performers become famous? I really don't know any who DON'T give away their music. Now, that music MAY become valuable, in which case there would be an "economy" surrounding that exact product.

    Honestly, it doesn't happen a lot.

  14. I Love this guy! Such Chutpah on Eric Baptiste Weighs In On Copyright Summit Issues · · Score: 3, Insightful

    Manages to contradict himself!

    "It happened with YouTube here in the UK.

    We have a dialog with them to try and understand what they need - because they are very relevant. But based on what I know, when they decided to pull all the UK premium content - despite the PRS not requesting that - that was not helpful. It gives the impression that rights societies are difficult to work with and willing to withdraw works from the public. But nothing could be further from the truth. This content is worth nothing without an audience, and our intention is to make it widely available - but at the right price, a price that rewards the labour of people who are producing those great works."

    and a little further...

    "We need to rely on a mix of understanding licensing terms, and being able to experiment, and if the business has no turnover the rights owners should not subsidize the business by giving the content away for free. If you don't pay your electricity bill you'll get cut off."

    I guess that HE wants the power to turn it off, but doesn't want to let others make the decision. But I just love the direct contradiction.

    And I just love this -- in reference to ISPs and the pricing of broadband:

    "That's another aspect of the destruction of value. If you wanted to price them at fair value you would at least need to be an order of magnitude higher than it is now."

    So, I guess my broadband should be $400 a month, and $360 of that should go to him?

    Wow, just... wow... Unbelievable.

  15. Re:The HORROR! on MS Issued a Fix For Its Unwanted FireFox Extension · · Score: 0, Flamebait

    So, I'm a "wingbat freetard". In two words "fuck you".

    This, of course, doesn't affect me. I wouldn't be arsed to comment about it, except for YOUR particular comment. Just to let you know -- we "wingbat freetards" also go crazy if a Firefox extension modifies ANOTHER extension with permission (Noscript vs Adblock). (Grrr... Don't presume that you know what's better for me. If you make that assumption, prepare to be flamed.)

    On the other hand -- this is the most brilliant troll I have seen in months! Congratulations, I responded!

    I wouldn't have bothered replying, except that Slashdot doesn't have a Troll+1 moderation (Troll-1 isn't applicable here; this one is pure genius).

  16. Re:It's feeling like a trap on Apple Bans RSS Reader Due To Bad Word In Feed Link · · Score: 1

    Sure, why would you imagine that is particularly difficult? "find -atime" for access time, the rest according to your organization -- the ctime may be the release date, for example, and the "stars" may be encoded into the name.

    Or, whatever. Maybe you want to use those fancy "ID3 tags" and put the information there. In which case the "find" can drive a ID3 extract and grep.

    May I suggest the next argument? "But, that's too difficult to use". Three answers -- (1) Difficult for who? Me? I have been using Unix for almost 30 years. (2) The commands can be reorganized to achieve other searches. If you had database access, you would be able to reorganize the searches as well. Probably by expressing the native imperatives as well. (3) If I want a GUI, I'll throw something up in Tcl/Tk.

    The filesystem I used is capable of expressing graphs. With cycles in them. With arbitrary information in the node descriptions and nodes. Certain node description data is standardized: name, atime, ctime, mtime, permissions, ownership. As is any modern Unix box (the cycles and general graphs had to wait for Unix to get symbolic links).

  17. Re:and the pirates win again on Empirical Study Shows DRM Encourages Infringement · · Score: 1

    I subscribe to Rogers Cable. The digital service (which will be the only service offered in a year or two) encrypts ALL channels. Even those that are carried over the air.

    Because of this, it is "impossible" to use my home-brew PVR. It is also not possible to tune and decode the digital from my old VCR, either. I don't want to rent a reduced function PVR from Rogers (that won't let me share the occasional show with friends, or piece things together for media education, or build a library of Spongebob for the kids; you know, "normal usage"). So, instead of recording programs, I simply switched from cable TV to piracy. Bought the highest end internet package to download the shows I want to watch.

    I guess I could record over-the-air, but why bother?

    The benefit? Better quality, and no more commercials. DRM leads to "piracy", in this case. In fact, it's the ONLY reason for the "piracy". If the channels were not encrypted, I would still use cable, and my PVR. I used to have a recording schedule -- now I have a download schedule instead.

  18. Re:REPOST - with correction on World's "Fastest" Small Web Server Released, Based On LISP · · Score: 2, Insightful

    Aw shucks, you caught me out! You AC guys...

    Sure, since Gambit-C uses C as its "assembler" level, it is possible to micro-optimize. In Post #2, I illustrate how to deal with that. In Post #3 you see how I deal with the "low-level advantage" issue.

    And, in response to you: I challenge that YOU cannot beat Gambit-C, even given six months implementing this stupid little useless program. Without resorting to pre-written code, that is, in which case *I* get to use the same libraries.

    To WIN, you have to show a 5% advantage in run-time. Otherwise, Scheme takes it. Simply because it IS a true HLL, and can represent stuff at a reasonable level, and is completely "safe".

    Go for it.

  19. Re:"functional programming languages can beat C" on World's "Fastest" Small Web Server Released, Based On LISP · · Score: 1

    Yes, quite a few of these systems target C -- using it as a sort of assembler. This doesn't mean that the generated C is anything a human would have written. For example, in my answer to this "challenge" I used the factorial function. Part of the (temporary) C code generated by the scheme compiler looks like this:

    ___BEGIN_P_COD
    ___BEGIN_P_HLBL
    ___DEF_P_HLBL_INTRO
    ___DEF_P_HLBL(___L0__20_x_2e_o3)
    ___END_P_HLBL
    ___BEGIN_P_SW
    ___DEF_SLBL(0,___L0__20_x_2e_o3)
          ___IF_NARGS_EQ(0,___NOTHING)
          ___WRONG_NARGS(0,0,0,0)
    ___DEF_GLBL(___L__20_x_2e_o3)
          ___SET_GLO(1,___G_factorial,___PRC(3))
          ___SET_R1(___VOID)
          ___JUMPPRM(___NOTHING,___R0)
    ___END_P_SW
    ___END_P_COD

    Not something a human would code at all. Indeed, these systems are used to stress-test the C compiler, resulting in improvements there.

  20. Re:"functional programming languages can beat C" on World's "Fastest" Small Web Server Released, Based On LISP · · Score: 1

    Of course you can

    VM based systems are free to recompile and optimize code at run-time.

    C compilers? Not so much. Unless... The compiled C code can recompile and optimize at run-time as well. The Helium Flame project at HP was one such an effort.

    But the C language is just not expressive enough. Some things that could be exploited just won't be. Others -- well, run-time information may give clues. As an example:

    if (condition) {
        code1...
    } else {
        code2...
    }

    The COMPILER has no clue as to which branch is important. Say, code2 is a branch which is NEVER TAKEN (its an obscure error report). There is no construct in C that allows this to be specified (well, SUN has #pragma rarely_used).

    You say, so what? Branch prediction takes care of it. But that isn't the whole story -- code2 is actually rather small (say: fprintf(stderr, "error: bad return"); exit(1);) It overlaps the cacheline with code1, and forces a cache line reload. The Laws of Thermodynamics. Energy will be expended loading the code, simply to ignore it.

    Wouldn't it be better to MOVE code2, along with all the other snippets that aren't used into a demand load page that is simply not loaded? This requires either 1) more expressiveness in C, or 2) some really smart run-time optimizations.

    VM based systems can apply those optimizations, and can support higher level constructs, resulting in even more optimization opportunities. Of course, we live in a "C-centric" world; even processors that COULD do better don't, simply because C won't support it (witness the tuning of instructions in the x86 world).

  21. Re:Make it work with Active Directory first, then on Red Hat Challenges Swiss Government Over Microsoft Monopoly · · Score: 1

    melted

    Color me "slightly confused".

    Why aren't you using RDP, then? Even my Linpus netbook supports it (from acer).
    What "group policy" would be useful to you on Linux?
    What scanner? I'm not sure "spotty" is a reasonable description. My workflow involves scanners on "all-in-one" units. They seem to work -- for bigger scanning projects, there is usually a dedicated machine machine.

    Now, color my "concerned".

    Can you clarify your issues with single sign-on and multi-factor authentication?

    Not that I care about Linux (or, for that matter Windows(tm)). Generally, use whatever floats your boat. But the sign-on/authentication issues are of concern.

  22. Horse to water... on World's "Fastest" Small Web Server Released, Based On LISP · · Score: 2, Insightful

    We now come to the final post in this series.

    The speed in C comes from the direct hardware "low-level" thing. In the domain of "int" types on a 32 bit machine, I would say that the most efficient (well, one of the most efficient) implementations of factorial() would be:

    #define factorial(n) ((n) 0 ? 1 : fact_table[n])
    int fact_table[] = { 1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 39916800, 479001600 };

    Can you hear the l33t-speak? I codez the C r3al g00d! My factorial function only takes a nanosecond or so! And, it ONLY takes two instructions! No, let's do better. We can DOUBLE the speed of this puppy. Just assume that negative numbers will never be passed in.

    #define factorial(n) fact_table[n]

    That's one fast function now!

    This is 32 bit int type only. Not a very interesting or useful case. 64 bits? Brings us to 20! or so. It is certainly a major benefit to Scheme to have the bignum built-in. Have you finished the C version without gmp yet?
     

  23. A Faster LISP version on World's "Fastest" Small Web Server Released, Based On LISP · · Score: 2, Insightful

    And now for the grand unveil - the SCHEME (LISP) version, with integrated C code for the "super-speedy" inner loop. Just to illustrate that the SAME optimizations are available for the LISP programmer. This can be further micro-optimized.

    Note that it isn't much different from a "C" implementation that has the same optimization. Note the ease of moving between data types (we only worry about in a very cursory way). I am waiting for your pure C implementation.

    # In "normal" scheme syntax. Note escape to six syntax (for the C
    # developer. Replace [lt] with less-than before compiling

    # Define in-line C function for fast factorial within 32 bit constraint
    (c-declare #[lt][lt]c-end

    int fast_factorial(int n) {
        if (n [lt]= 0)
            return 1;
        return n * fast_factorial(n - 1);
    }

    c-end
    )

    (define fast-factorial
        (c-lambda (int) int "fast_factorial"))

    # The constant 12 is the largest factorial that can be computed in a 32 bit int.
    # Notice the function fast-factorial is also escaped: fast-factorial is actually a C expression.
    \int factorial(int n) {
        if (n [lt]= 12) {
            \fast-factorial(n);
        } else {
            n * factorial(n - 1);
        }
    }

  24. IGNORE ABOVE POST -- INCORRECT, LOOK FOR REPOST on World's "Fastest" Small Web Server Released, Based On LISP · · Score: 1

    Subject says it all. I goofed, and used a less-than sign in the code sample.

  25. REPOST - with correction on World's "Fastest" Small Web Server Released, Based On LISP · · Score: 4, Interesting

    Repost - lt should be replaced by lessthan sign...

    Trolling sure sounds easy, but...

    Gambit-C Scheme vs. C

    I'll make it easy for you. It's the two minute litmus test. Even easier -- I'll give you the pseudo-C code:
    Task: compute n! for n >= 1000.

    In Scheme (Gambit 4.2.8, using infix):

    int factorial(int n) {
    if (n lt= 0) {
    1;
    } else {
    n * factorial(n - 1);
    }
    }

    compile with: gsc f.six
    and run it:

    gsi
    Gambit v4.2.8

    > (load "f")
    "/home/user/f.o1"
    >(factorial 1000)
    4023...0000

    Your challenge? Write a C version in two minutes, tested and compiled. Now, as the final icing, run the C version on smaller numbers, and compare the performance -- did you forget to compile in small integer versions? (try factorial(12) a million times).

    I'll wait (another two minutes). Compare the performance against the LISP version. Did you have to write two versions -- one for big integers and one for small integers? That is pretty well the only way to keep a speed advantage... I hope you wrote it that way. Did you remember to put in 32/64 bit conditionals to retain your advantage on a 64 bit platform?

    I think your C code now looks like this (it should):

    #define FACT_LIMIT 12 -- for 32 bit int type, I don't know what the cutoff is for 64 bit.
    #include bignum.h -- I don't want to bother with quoting assume angle brackets /* This only gets executed a maximum of FACT_LIMIT times; leave it recursive */
    int fact_integer(int n) {
    if (n lt= 0) {
    return 1;
    } else {
    return n * factorial(n - 1);
    }
    } /* May wish to rewrite to an iterative form */
    bignum factorial(bignum n) {
    if (compare_lt(n, FACT_LIMIT)) {
    return int_to_bignum(fact_integer(bignum_to_int(n)));
    }
    return bignum_mult(n, bignum_dec(n));
    }

    You choose the bignum package to use. Or, for more fun, write it yourself. If you wrote it yourself, you remembered to switch to FFT style multiplication at bigger sizes? Or Karatsuba?

    Now, we have only coded to a recursive form, but, since bigints are not first-class in C, we don't know about memory reclamation (leakage). I hope you know the gmp library, or can roll up a gee-whiz allocator on your own. The gmp library would be cheating, by the way -- YOU DID CLAIM YOUR IMPLEMENTATION IN C.

    If recursion is viewed as a problem, the Gambit-C version can be recoded as:

    int factorial(int n) {
    int i;
    int a;
    if (n lt= 0) {
    1;
    } else {
    a = 1;
    for (i = 1; i lt= n; ++i) {
    a *= i;
    }
    a;
    }
    }

    I am sure that something equivalent can be done in the C version. But the normal flow of control stuff doesn't know about bignums. We COULD make the incoming parameter an int, I guess... which works for factorial() but may not be as workable for other functions.

    Answers:
    - gmp does better than Gambit-C on bigint multiply, using FFTs.
    - breaking the result into two separate functions is needed for C to come ahead.
    - yes, C is faster, at the expense of a lot more programming.
    - if I want to, I can simply drop C code into my Gambit-C program on an as-needed basis. The Gambit-C code still looks a
    whole lot cleaner than the C version, and ties it for small integer performance. The bigint performance is still a "win" for
    gmp, but I can use THAT package directly as well in Gambit-C.

    Win:
    - Gambit-C. The prototype was finished to spec in two minutes. Optim