Apple: No, you didn't hate me, I hated you. And the second time we met, you didn't even remember me.
IBM: I did too, I remembered you. The third time we met, we became friends.
Apple: We were friends for a long time.
IBM: And then we weren't.
Apple: And then we fell in love.
Speaking of Meg Ryan romantic comedies, in You've Got Mail, the bitter business rivalry was echoed in their choice of computers: Joe used an IBM, and Kathleen used a Mac.
In fact, short of actually using technology to predict the outcome or to affect the outcome of the spin, there is NO betting scheme, algorithm, pattern or method of placing bets on a roulette wheel that leads to any difference in the house's advantage over you.
Sure there is. The five-number bet (only available in the US) gives the house an extra 2% or so of your cash, compared to the other bets.
I can't speak for bersl2, but I think you may have mistaken his point.
When Stallman originated (ie, named) the Free Software movement in '84, he did it for political reasons. Later, ESR and others said that if people want this stuff to be accepted in corporate society, they need to focus on practical and not political ideals. Political statements make suits nervous. (If you were on slashdot, certain Usenet groups, etc in '98 or so, you saw the discussions.)
One big sticking point was the name. "Free software" had two problems. First, ESR &co wanted to get away from the whole "Freedom!" issue, as I described.
Second, it's too easy to think "free" as in "free beer", not "free speech". (I first saw that meme at about the same time, I think.) When people think "free" in that sense, they may think of the plethora of stuff on Tucows etc that cost $0, but have no source. Since source access, modification, and distribution are a big part of what this new movement was about, they didn't want the free-as-in-beer association to be part of the new name either.
Hence, "open source" became the new term. So what bersl2 said has some merit: one big reason for coining the term "open source" is because ESR &co didn't want people to think that things like Spybot S&D were part of this new movement.
From a practical point of view, yes, the two movements generally support the same set of software. The guidelines are similar. But the philosophies are different, and those that care about the philosophy (such as Stallman) distinguish between the two, sometimes more subtly than others.
But the issue of unmodifiable source was one of the reasons that the name "Open Source" was formed: they wanted it, and felt that the term "free software" didn't emphasize that point enough.
I've listended to PL-encoded sound that I've converted to MP3s, and compared them to originals. The surround effect, IMHO, gets considerably washed out. I suspect (but haven't confirmed) that some of the phase detail is getting lost.
Yes, it was fun when computer networks were only available to the smart folks. But that doesn't mean that it should have stayed that way. Free flow of information is a good thing. Open access to the Internet means you can't be leeter than thou anymore, but it doesn't mean that J. Random AOLer shouldn't be let into the playground. Do you use Amazon? Pricewatch? Google? Do you think these would be around if the net were composed of only a technical elite?
Imagine:
I can't tell if you're kidding or not, but the written word has definitely been circling the drain since kings and peasants got involved with it. I've been literate for a long time -- since the early 90s in fact -- and am thus quite aware of the ruinous activities the written word has been subjected to by the typical writer since then. You know, things like people writing off a bunch of gripes and nailing them to a church door, or in the larger picture basically assuming the entire body of written work is there to serve as some form of Piers Plowmanesque entertainment.
If you want to set up exclusive, techhead-only forum, one that requires you to use a custom client that you build from source, then do it. Ignore the web if you want; nobody forces you to open your browser. Start a new Usenet if you feel like it; it's designed to allow more than one in parallel you know. You can be living in the 90s again, where it's just you and a few other eggheads in a circle-jerk about how leet you are, and all the while isolating yourself from the rest of the world.
I develop Lisp code for FreeBSD. The current version uses CMUCL because it's blazing fast, at least on the x86. (I would use SBCL but it wasn't ready when I started the project.) The new version is being developed with Lispworks, mostly because of KnowledgeWorks and CommonSQL.
In general (and in my own opinion only), Allegro is pretty, but Xanalys has a better Lisp implementation. If you're just getting started in Lisp, never used Emacs, and have usually dealt with IDEs, that's probably the least traumatic way to go.
But I do recommend Lisp programmers use Emacs+Slime to do their general coding. If you don't need GUIs or other libraries that the commercial Lisps provide, then there's no reason not to use SBCL for that. I only speak of the commercial versions because somebody who doesn't know Emacs, Slime, or Lisp can be overwhelmed by the new environment, powerful as it is.
Why am I giving general Lisp impl advice, instead of Mac-specific stuff? Well, because I don't get my Mac for another three hours. But I did some homework studying Mac development; one of the first things I did when I decided to get a Mac was see if XCode can handle Lisp.
OpenMCL seems to be very good. It has Cocoa support, and is the only free-source Lisp I've used that can produce executables. (This is because most Lisps need multiple files for an executable-- the runtime and the image-- and Mac applications are multiple files, unlike on most other OSs.) No IDE, but as I said, Emacs+Slime is the way to go.
So if you don't know Emacs, you may want to look at Lispwork's free trial, so you have an IDE. Maybe play with (non-Open) MCL and Allegro if you want to test drive a few. But if you're comfortable with Emacs, then it looks like Emacs+Slime+OpenMCL looks to be a good thing.
I'd like to compare SBCL and OpenMCL. It like OpenMCL has better native facility support (native threads, ObjC interfaces, Cocoa, app building), but SBCL has been around longer and has a great compiler.
Remember, this is all advice from somebody who has never actually used Lisp on a Mac (other than helping students). But I am a reasonably experienced Lisp coder who recently did some preliminary research. So take it for what it's worth.
In fact, it amazes me that (AFAIK) none of the megacorps has yet tried to assimilate AnyGPL'd code on the basis that the licence under which it was distributed was GPL version 19,754, as defined by MegaCorp, Inc., and they therefore have full rights (and no-one else has any).
You're making a classic confusion between the name of a thing and the thing itself. (Lewis Carroll makes light of this in Through the Looking Glass, when Alice first meets the White Knight.) Just because something is named "GPL" doesn't make it what people are talking about when they talk about the GPL.
To draw an analogy, consider a company based in England. They call their building "The United States of America". Would they be able to claim offers that say they're only valid in the US?
It's a moot issue anyway. The language used is quite clear that it's referring to the FSF's GPL. From the GPL:
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
So the license that MegaCorp Inc got the code under clearly stated what "later version" means.
Typically, the "later version" clause is at the top of the source code. The actual "later version" clause typically used reads like this:
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
So again, it's quite clear that the "later version" means one published by the FSF.
While we won't know yet, a big issue with all this is how compatible the licences will be with each other. While there is a fair amount of software that says it's compatible with GPL 2 or greater, much is specifically locked to a specific version.
The last sentence of the article:
The primary goal is ensuring that code licensed under the current version of the GPL, Version 2, can be combined with code licensed under Version 3, said officials of the Boston-based FSF.
you want it? You already have it Mission statement Generator
At one point I built the same idea into an Alicebot and called it "Virtual CEO". It would attempt to have a rational conversation (using the normal Alice tables), but when it got confused-- which would happen often-- it would spout off some meaningless managementbabble.
but the majority of hunters I encounter seem to be pissed idiots, blasting away at roadsigns and leaving beer cans and rubbish everywhere.
How do you know?
I mean, do you ask everybody you meet if they're a hunter?
I have friends who do and don't hunt. There's not a test that I can apply, other than asking "do you hunt?" I expect it's the same with you, unless you have a "hunter seeker" that tells you when you're talking to a hunter. So you have the following sample of the hunting population: (1) people whom you've asked if they hunt, (2) people whom you find out hunt through other means (such as, they mention it in conversation), and (3) pissed idiots that you assume are hunting, or observe hunting.
I'm going to make a guess here, and assume that you probably don't have a lot of conversations about hunting. So most of your sample is probably from #3. That's a skewed sample.
I have never knowingly had a conversation with the "pissed idiot" variety of hunter, and I've talked with many hunters. I have seen people getting pissed and blasting away at roadsigns, but I haven't ever known them to be hunting. Just being dangerous idiots.
I've seen multiple comments mirroring your sentiment in this thread, and I'm surprised. If you walked through a school and saw 98% that were dressed normally, and 2% that were dressed in too-tight white shirts with pocket protectors, would you assume that all computer types are thusly dressed? Or would you consider that perhaps computer types come in different shapes and sizes, and that perhaps there are computer geeks in that 98%? Stereotypes are always dangerous when you try to evaluate a social class.
Do you mean, the disk is suffering from the so called "Click of Death", or just that you can't get it to mount? If it's the former, then your best bet is to something like dd or SpinRite to try and pull as much data off the disk as possible.
I have a HDD that's got some rare software on it, and it's suffering from what, as far as I can tell, is advanced Click of Death. It'll boot, sometimes get all the way to the Finder (old Mac), make a loud click, then spin down. Spin up, click, spin down, repeat every few seconds. Would a dd work for this advanced case, or do I need to investigate extreme measures?
Do not fall into the error of the artisan who boasts of twenty years experience in his craft while in fact he has had only one year of
experience-- twenty times.
-- Otake, Shibumi, p105. Trevanian
I'm not really sure what your goal here is. Are you wanting to write a compiler for the sheer joy of writing a compiler? That's a good goal, for sure, and I recommend that every programmer write a compiler or two during their careers, or at least some interpreters.
On the other hand, maybe you want to extend an existing language because you need some specific language feature. Also a good goal, but I do want to caution you to evaluate existing languages first; you may find that some language does what you want, or makes it easy to write a language library that does what you want.
Or maybe you want to write an interpreter to script a bigger program. Then I'd say that you may be better off using something that's already there.
In the first case, if you want to learn how to write a compiler, I generally recommend writing Scheme, or some other simple Lisp. Scheme has advantages in that its parse tree representation is obvious (that's why Lisp looks like it does), the structure of an interpreter and of a compiler are quite similar, and it covers the fundamentals of compilers without burdening you with a bunch of cruft. (If this is your first compiler, you may want to leave out continuations and garbage collection for now.) The very excellent book Structure and Interpretation of Computer Programming has what you need: chapter 4 is about writing interpreters (for Scheme, some modified Schemes, and Prolog), and chapter 5 is all about writing a compiler. All the code in SICP is in Scheme, but the book starts from the beginning with (+ 1 1).
SICP may be too academic for your taste, so you may prefer Paradigms of Artificial Intelligence Programming instead. It uses Common Lisp, and has a little bit more practical feel that SICP. Chapter 22 is about writing a Scheme interpreter, and chapter 23 is about writing a Scheme compiler. Unlike SICP, PAIP doesn't cover the garbage collector. PAIP uses Common Lisp, and although it has enough of an introduction to be a "refresher" for somebody already familiar with Lisp, it's not really suitable for learning the language.
It's really simple to write Lisp in Lisp. Indeed, a month ago I wrote one for a comp.lang.lisp post, just to get a silly quine to work! That's why I keep talking about Lisp and Scheme: it's easy to do.
If Scheme isn't your thing, then Pascal may be a good alternative. Don't try to get fancy with heap allocation, pointers, objects, and other new add-ons; I'd start with plain old Wirth-designed Pascal, and get fancy later if you want. Pascal is really designed for a classroom setting. I have a dim memory of Ada being used for this purpose in some books, but I can't speak very authoratively there.
Of course, the definitive book on writing compilers is the Dragon Book. But you may want to be familiar with some basic CS theory about FSMs first.
Now, that's if you want to learn about compilers for the joy of learning about compilers. But what if you just need one particular language feature for your problem, and that's why you want to write a compiler? Well, then I'd suggest you make sure you've looked at a lot of different languages first. Some languages have surprising features that may let you write a small in-language library to do what you need, instead of needing to extend the compiler.
Lisp is a good candidate for this. John Foderaro once described Lisp as "a programmable programming language". You can alter the language to suit the problem at hand, instead of having to work the other way around. At work now, I use Lisp as a bridge between two very different programming languages because I can extend it in both directions to cover what I nee
I'm using hashcash in its basic form, not with Camram. I wasn't aware of Camram until just now, but will probably look into it.
All my emails are sent out with hashcash, and I have SpamAssassin lower the score of emails with hashcash.
The recommended hash length is at least 20 bits. I calculate hashes of 23 bits (per recepient), which takes about 2/3 sec on my Athlon 800. My SpamAssassin config requires at least 20 bits to lower the score, and lowers it more and more up to 26 bits (at which point it has -5).
I think that this is the most effective use of hashcash: once it becomes widely used, then spam rules can become tougher with less chance of false positives.
From reading the article, it looks like Camram is mostly a recipient-side addon to basic hashcash, which involves automated whitelisting and sending challenges to senders of "maybe-spam". Somebody sending hashcash like me will (from the look of things) get past Camram recipients without problems.
Camram seems a bit less cooperative than I'd like, such as using its own Bayesian filter instead of letting the user have an external one like SpamAssassin take a crack at the email. But these are implementational issues, not problems with the Camram concept.
Tired of the boring ol' "Spot the Fed" game at Defcon? In this article, we can play "Spot the Astroturfer"! No t-shirts, just pride, but then again you don't have to try to expense a Vegas trip to an increasingly suspicious finance dept. So I think it works out even.
Pay special attention to phrases repeated by supposedly different posters (even though that's also a staple of genuine Slashdotters), and ACs replying to themselves with "I agree!".
Get spotting, and post your Astroturfer-spotting tips here!
You want a specific example? Okay, the kernel process queues. These are linked lists that store information about which process is waiting on what: there's a queue for processes that are waiting for a CPU to become free, a queue for processes that are waiting for activity on a filehandle (for example, all the preforked web servers waiting on the accepting filehandle), etc.
They cause memory fragmentation
You can use a free list of processes, or have the processes in an array and just link them onto the queues as needed without pulling them from the array.
screw up your cache
I have no idea how you come to that conclusion
add two pointers of overhead per item (quite possibly in a different memory location from the data)
The link field is in the process data structure, so it's one pointer per item, and always in the same location as the data.
are slow to access thanks to all that dereferencing
Ah, that's a big deal there. For example, the run queue is a sorted list. You almost always pull elements off from the head. Moreover, you put elements on in the middle, sorting on their PRI.
If the run queue were implemented as an array, you'd have to move stuff on every insert. If you're smart, you're putting the soonest-run process at the end, so you don't have to move everything when you delete. But now you're also having to track the length so you can find the last one, instead of just having a pointer straight to the element you're about to access (ie, the head).
Also, you can move processes between queues quickly. When a SYN comes into your HTTP socket, you can move one of the preforked processes from the accept queue to the run queue by changing a few pointers, instead of having to do laborious copies of array chunks.
In general, arrays are good for indexed access, and changes at the end. But they suck at changes in the middle. They also don't let you walk a list as it's changing, at least, not as easily as a linked list does. Also, linked lists let you very easily move items between multiple lists. There's lots of reasons to go one way or another. You implied that you've read Knuth; I find it surprising that you didn't pick up that there are different structures for different needs.
This is just one example; there's many others. Don't make sweeping assumptions about what the right data structure is in all cases. If the interviewer tells you to write a linked list, then write a linked list; don't argue that no-one would ever use a linked list.
It's like, When Harry Met Sally!
Speaking of Meg Ryan romantic comedies, in You've Got Mail, the bitter business rivalry was echoed in their choice of computers: Joe used an IBM, and Kathleen used a Mac.
In fact, short of actually using technology to predict the outcome or to affect the outcome of the spin, there is NO betting scheme, algorithm, pattern or method of placing bets on a roulette wheel that leads to any difference in the house's advantage over you.
Sure there is. The five-number bet (only available in the US) gives the house an extra 2% or so of your cash, compared to the other bets.
I can't speak for bersl2, but I think you may have mistaken his point.
When Stallman originated (ie, named) the Free Software movement in '84, he did it for political reasons. Later, ESR and others said that if people want this stuff to be accepted in corporate society, they need to focus on practical and not political ideals. Political statements make suits nervous. (If you were on slashdot, certain Usenet groups, etc in '98 or so, you saw the discussions.)
One big sticking point was the name. "Free software" had two problems. First, ESR &co wanted to get away from the whole "Freedom!" issue, as I described.
Second, it's too easy to think "free" as in "free beer", not "free speech". (I first saw that meme at about the same time, I think.) When people think "free" in that sense, they may think of the plethora of stuff on Tucows etc that cost $0, but have no source. Since source access, modification, and distribution are a big part of what this new movement was about, they didn't want the free-as-in-beer association to be part of the new name either.
Hence, "open source" became the new term. So what bersl2 said has some merit: one big reason for coining the term "open source" is because ESR &co didn't want people to think that things like Spybot S&D were part of this new movement.
From a practical point of view, yes, the two movements generally support the same set of software. The guidelines are similar. But the philosophies are different, and those that care about the philosophy (such as Stallman) distinguish between the two, sometimes more subtly than others.
But the issue of unmodifiable source was one of the reasons that the name "Open Source" was formed: they wanted it, and felt that the term "free software" didn't emphasize that point enough.
I've listended to PL-encoded sound that I've converted to MP3s, and compared them to originals. The surround effect, IMHO, gets considerably washed out. I suspect (but haven't confirmed) that some of the phase detail is getting lost.
There's a strange quirk of irony here.
The first big worm was in 1988. I remember it made Time magazine (or some similar publication), and for the net to get press in 1988 was a big deal.
The worm was written by Robert T. Morris <RTM>.
RTM's father, Robert Morris, was a high-ranking official in the NSA; if you've read Cuckoo's Egg then you've heard of him.
Yeah, yeah, we've heard it already. And in case you missed it the first time, people that joined in the early 90s were the first big leak in the dike.
Yes, it was fun when computer networks were only available to the smart folks. But that doesn't mean that it should have stayed that way. Free flow of information is a good thing. Open access to the Internet means you can't be leeter than thou anymore, but it doesn't mean that J. Random AOLer shouldn't be let into the playground. Do you use Amazon? Pricewatch? Google? Do you think these would be around if the net were composed of only a technical elite?
Imagine:
If you want to set up exclusive, techhead-only forum, one that requires you to use a custom client that you build from source, then do it. Ignore the web if you want; nobody forces you to open your browser. Start a new Usenet if you feel like it; it's designed to allow more than one in parallel you know. You can be living in the 90s again, where it's just you and a few other eggheads in a circle-jerk about how leet you are, and all the while isolating yourself from the rest of the world.
Just for another data point:
I develop Lisp code for FreeBSD. The current version uses CMUCL because it's blazing fast, at least on the x86. (I would use SBCL but it wasn't ready when I started the project.) The new version is being developed with Lispworks, mostly because of KnowledgeWorks and CommonSQL.
In general (and in my own opinion only), Allegro is pretty, but Xanalys has a better Lisp implementation. If you're just getting started in Lisp, never used Emacs, and have usually dealt with IDEs, that's probably the least traumatic way to go.
But I do recommend Lisp programmers use Emacs+Slime to do their general coding. If you don't need GUIs or other libraries that the commercial Lisps provide, then there's no reason not to use SBCL for that. I only speak of the commercial versions because somebody who doesn't know Emacs, Slime, or Lisp can be overwhelmed by the new environment, powerful as it is.
Why am I giving general Lisp impl advice, instead of Mac-specific stuff? Well, because I don't get my Mac for another three hours. But I did some homework studying Mac development; one of the first things I did when I decided to get a Mac was see if XCode can handle Lisp.
OpenMCL seems to be very good. It has Cocoa support, and is the only free-source Lisp I've used that can produce executables. (This is because most Lisps need multiple files for an executable-- the runtime and the image-- and Mac applications are multiple files, unlike on most other OSs.) No IDE, but as I said, Emacs+Slime is the way to go.
So if you don't know Emacs, you may want to look at Lispwork's free trial, so you have an IDE. Maybe play with (non-Open) MCL and Allegro if you want to test drive a few. But if you're comfortable with Emacs, then it looks like Emacs+Slime+OpenMCL looks to be a good thing.
I'd like to compare SBCL and OpenMCL. It like OpenMCL has better native facility support (native threads, ObjC interfaces, Cocoa, app building), but SBCL has been around longer and has a great compiler.
Remember, this is all advice from somebody who has never actually used Lisp on a Mac (other than helping students). But I am a reasonably experienced Lisp coder who recently did some preliminary research. So take it for what it's worth.
In fact, it amazes me that (AFAIK) none of the megacorps has yet tried to assimilate AnyGPL'd code on the basis that the licence under which it was distributed was GPL version 19,754, as defined by MegaCorp, Inc., and they therefore have full rights (and no-one else has any).
You're making a classic confusion between the name of a thing and the thing itself. (Lewis Carroll makes light of this in Through the Looking Glass, when Alice first meets the White Knight.) Just because something is named "GPL" doesn't make it what people are talking about when they talk about the GPL.
To draw an analogy, consider a company based in England. They call their building "The United States of America". Would they be able to claim offers that say they're only valid in the US?
It's a moot issue anyway. The language used is quite clear that it's referring to the FSF's GPL. From the GPL:
So the license that MegaCorp Inc got the code under clearly stated what "later version" means.
Typically, the "later version" clause is at the top of the source code. The actual "later version" clause typically used reads like this:
So again, it's quite clear that the "later version" means one published by the FSF.
ObIANAL: I'm not a lawyer.
While we won't know yet, a big issue with all this is how compatible the licences will be with each other. While there is a fair amount of software that says it's compatible with GPL 2 or greater, much is specifically locked to a specific version.
The last sentence of the article:
FWIW, 4KB = 4096 bytes.
Off by one. The range N to N+M consumes M+1 bytes. Consider a trivial case: N=0, M=1. It consumes bytes 0 and 1, so 2 bytes. That's why he said 4095.
I guess you might say that I was on the bleeding edge of "play by e-mail."
My goodness, my group gripes about how long RPG combat takes in normal sessions. It must have taken a month to resolve a single combat that way!
I believe the term you were looking for was "Hunt-Dar".
Yeah, that may have been better, but I just wanted to get in the Alpha Centauri reference. (One of the discoveries was the Hunter-Seeker Algorithm.)
you want it? You already have it
Mission statement Generator
At one point I built the same idea into an Alicebot and called it "Virtual CEO". It would attempt to have a rational conversation (using the normal Alice tables), but when it got confused-- which would happen often-- it would spout off some meaningless managementbabble.
I think I lost the code, though. *sigh*
but the majority of hunters I encounter seem to be pissed idiots, blasting away at roadsigns and leaving beer cans and rubbish everywhere.
How do you know?
I mean, do you ask everybody you meet if they're a hunter?
I have friends who do and don't hunt. There's not a test that I can apply, other than asking "do you hunt?" I expect it's the same with you, unless you have a "hunter seeker" that tells you when you're talking to a hunter. So you have the following sample of the hunting population: (1) people whom you've asked if they hunt, (2) people whom you find out hunt through other means (such as, they mention it in conversation), and (3) pissed idiots that you assume are hunting, or observe hunting.
I'm going to make a guess here, and assume that you probably don't have a lot of conversations about hunting. So most of your sample is probably from #3. That's a skewed sample.
I have never knowingly had a conversation with the "pissed idiot" variety of hunter, and I've talked with many hunters. I have seen people getting pissed and blasting away at roadsigns, but I haven't ever known them to be hunting. Just being dangerous idiots.
I've seen multiple comments mirroring your sentiment in this thread, and I'm surprised. If you walked through a school and saw 98% that were dressed normally, and 2% that were dressed in too-tight white shirts with pocket protectors, would you assume that all computer types are thusly dressed? Or would you consider that perhaps computer types come in different shapes and sizes, and that perhaps there are computer geeks in that 98%? Stereotypes are always dangerous when you try to evaluate a social class.
Chuck Jones once said everyone has 100,000 bad drawing inside of them,
Sure, but he was doing hand animation. At 30fps, 100,000 drawings is about an hour-long reel, plus credits.
Go to http://www.ms.unimelb.edu.au/~paradox/archive/ for the magazine, these proofs appeared in issue 2 of 2002.
Do you mean, the disk is suffering from the so called "Click of Death", or just that you can't get it to mount? If it's the former, then your best bet is to something like dd or SpinRite to try and pull as much data off the disk as possible.
I have a HDD that's got some rare software on it, and it's suffering from what, as far as I can tell, is advanced Click of Death. It'll boot, sometimes get all the way to the Finder (old Mac), make a loud click, then spin down. Spin up, click, spin down, repeat every few seconds. Would a dd work for this advanced case, or do I need to investigate extreme measures?
Do a search for uranium hexafluoride, and look at the Sponsored Links
I didn't get any sponsored links.
Do not fall into the error of the artisan who boasts of twenty years experience in his craft while in fact he has had only one year of experience-- twenty times.
-- Otake, Shibumi, p105. Trevanian
I'm not really sure what your goal here is. Are you wanting to write a compiler for the sheer joy of writing a compiler? That's a good goal, for sure, and I recommend that every programmer write a compiler or two during their careers, or at least some interpreters.
On the other hand, maybe you want to extend an existing language because you need some specific language feature. Also a good goal, but I do want to caution you to evaluate existing languages first; you may find that some language does what you want, or makes it easy to write a language library that does what you want.
Or maybe you want to write an interpreter to script a bigger program. Then I'd say that you may be better off using something that's already there.
In the first case, if you want to learn how to write a compiler, I generally recommend writing Scheme, or some other simple Lisp. Scheme has advantages in that its parse tree representation is obvious (that's why Lisp looks like it does), the structure of an interpreter and of a compiler are quite similar, and it covers the fundamentals of compilers without burdening you with a bunch of cruft. (If this is your first compiler, you may want to leave out continuations and garbage collection for now.) The very excellent book Structure and Interpretation of Computer Programming has what you need: chapter 4 is about writing interpreters (for Scheme, some modified Schemes, and Prolog), and chapter 5 is all about writing a compiler. All the code in SICP is in Scheme, but the book starts from the beginning with (+ 1 1).
SICP may be too academic for your taste, so you may prefer Paradigms of Artificial Intelligence Programming instead. It uses Common Lisp, and has a little bit more practical feel that SICP. Chapter 22 is about writing a Scheme interpreter, and chapter 23 is about writing a Scheme compiler. Unlike SICP, PAIP doesn't cover the garbage collector. PAIP uses Common Lisp, and although it has enough of an introduction to be a "refresher" for somebody already familiar with Lisp, it's not really suitable for learning the language.
It's really simple to write Lisp in Lisp. Indeed, a month ago I wrote one for a comp.lang.lisp post, just to get a silly quine to work! That's why I keep talking about Lisp and Scheme: it's easy to do.
If Scheme isn't your thing, then Pascal may be a good alternative. Don't try to get fancy with heap allocation, pointers, objects, and other new add-ons; I'd start with plain old Wirth-designed Pascal, and get fancy later if you want. Pascal is really designed for a classroom setting. I have a dim memory of Ada being used for this purpose in some books, but I can't speak very authoratively there.
Of course, the definitive book on writing compilers is the Dragon Book. But you may want to be familiar with some basic CS theory about FSMs first.
Now, that's if you want to learn about compilers for the joy of learning about compilers. But what if you just need one particular language feature for your problem, and that's why you want to write a compiler? Well, then I'd suggest you make sure you've looked at a lot of different languages first. Some languages have surprising features that may let you write a small in-language library to do what you need, instead of needing to extend the compiler.
Lisp is a good candidate for this. John Foderaro once described Lisp as "a programmable programming language". You can alter the language to suit the problem at hand, instead of having to work the other way around. At work now, I use Lisp as a bridge between two very different programming languages because I can extend it in both directions to cover what I nee
Just to give some practical information:
I'm using hashcash in its basic form, not with Camram. I wasn't aware of Camram until just now, but will probably look into it.
All my emails are sent out with hashcash, and I have SpamAssassin lower the score of emails with hashcash.
The recommended hash length is at least 20 bits. I calculate hashes of 23 bits (per recepient), which takes about 2/3 sec on my Athlon 800. My SpamAssassin config requires at least 20 bits to lower the score, and lowers it more and more up to 26 bits (at which point it has -5).
I think that this is the most effective use of hashcash: once it becomes widely used, then spam rules can become tougher with less chance of false positives.
From reading the article, it looks like Camram is mostly a recipient-side addon to basic hashcash, which involves automated whitelisting and sending challenges to senders of "maybe-spam". Somebody sending hashcash like me will (from the look of things) get past Camram recipients without problems.
Camram seems a bit less cooperative than I'd like, such as using its own Bayesian filter instead of letting the user have an external one like SpamAssassin take a crack at the email. But these are implementational issues, not problems with the Camram concept.
Tired of the boring ol' "Spot the Fed" game at Defcon? In this article, we can play "Spot the Astroturfer"! No t-shirts, just pride, but then again you don't have to try to expense a Vegas trip to an increasingly suspicious finance dept. So I think it works out even.
Pay special attention to phrases repeated by supposedly different posters (even though that's also a staple of genuine Slashdotters), and ACs replying to themselves with "I agree!".
Get spotting, and post your Astroturfer-spotting tips here!
I'm very skeptical of this claim. He's essentially claiming any magnetic media has an infinite capacity.
Didn't Hawking recently lose a bet over this basic idea?
Bob: "Like I said, with the magic of Gentoo..."
Or the magic of lowest-bidder RAM.
Why would anyone ever use a linked list?
You want a specific example? Okay, the kernel process queues. These are linked lists that store information about which process is waiting on what: there's a queue for processes that are waiting for a CPU to become free, a queue for processes that are waiting for activity on a filehandle (for example, all the preforked web servers waiting on the accepting filehandle), etc.
They cause memory fragmentation
You can use a free list of processes, or have the processes in an array and just link them onto the queues as needed without pulling them from the array.
screw up your cache
I have no idea how you come to that conclusion
add two pointers of overhead per item (quite possibly in a different memory location from the data)
The link field is in the process data structure, so it's one pointer per item, and always in the same location as the data.
are slow to access thanks to all that dereferencing
Ah, that's a big deal there. For example, the run queue is a sorted list. You almost always pull elements off from the head. Moreover, you put elements on in the middle, sorting on their PRI.
If the run queue were implemented as an array, you'd have to move stuff on every insert. If you're smart, you're putting the soonest-run process at the end, so you don't have to move everything when you delete. But now you're also having to track the length so you can find the last one, instead of just having a pointer straight to the element you're about to access (ie, the head).
Also, you can move processes between queues quickly. When a SYN comes into your HTTP socket, you can move one of the preforked processes from the accept queue to the run queue by changing a few pointers, instead of having to do laborious copies of array chunks.
In general, arrays are good for indexed access, and changes at the end. But they suck at changes in the middle. They also don't let you walk a list as it's changing, at least, not as easily as a linked list does. Also, linked lists let you very easily move items between multiple lists. There's lots of reasons to go one way or another. You implied that you've read Knuth; I find it surprising that you didn't pick up that there are different structures for different needs.
This is just one example; there's many others. Don't make sweeping assumptions about what the right data structure is in all cases. If the interviewer tells you to write a linked list, then write a linked list; don't argue that no-one would ever use a linked list.