• Complain

Henry S. Warren Jr. - Hackers Delight

Here you can read online Henry S. Warren Jr. - Hackers Delight full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2002, publisher: Addison-Wesley, genre: Home and family. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Henry S. Warren Jr. Hackers Delight

Hackers Delight: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Hackers Delight" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

A collection useful programming advice the author has collected over the years; small algorithms that make the programmers task easier. * At long last, proven short-cuts to mastering difficult aspects of computer programming * Learn to program at a more advanced level than is generally taught in schools and training courses, and much more advanced than can be learned through individual study/experience. * An instant cult classic for programmers! Computer programmers are often referred to as hackers -- solitary problem solvers engrossed in a world of code as they seek elegant solutions to building better software. While many view these unique individuals as madmen, the truth is that much of the computer programmers job involves a healthy mix of arithmetic and logic. In Hackers Delight, veteran programmer Hank Warren shares the collected wisdom -- namely tips and tricks -- from his considerable experience in the world of application development. The resulting work is an irresistible collection that will help even the most seasoned programmers better their craft. Henry S. Warren Jr. has had a 40-year career with IBM, spanning the computer field from the IBM 704 to PowerPC. He has worked on various military command and control systems, and on the SETL project under Jack Schwartz at NYU. Since 1973 he has been in IBMs Research Division at Yorktown Heights, New York. Here he has done compiler and computer architecture work on the 801 computer and its several variants through PowerPC. Presently he is working on the Blue Gene petaflop computer project. He received his Ph.D. in Computer Science from the Courant Institute at New York University in 1980.

Henry S. Warren Jr.: author's other books


Who wrote Hackers Delight? Find out the surname, the name of the author of the book and a list of all author's works by series.

Hackers Delight — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Hackers Delight" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Copyright

Many of the designations used bymanufacturers and sellers to distinguish their products are claimed astrademarks. Where those designations appear in this book, and Addison-Wesleywas aware of a trademark claim, the designations have been printed with initialcapital letters or in all capitals.

The author and publisher have taken care inthe preparation of this book, but make no expressed or implied warranty of anykind and assume no responsibility for errors or omissions. No liability isassumed for incidental or consequential damages in connection with or arisingout of the use of the information or programs contained herein.

The publisher offers discounts on this bookwhen ordered in quantity for special sales. For more information, pleasecontact:

U.S. Corporate and Government Sales

(800) 382-3149

For sales outside of the U.S., pleasecontact:

International Sales

(317) 581-3793

Visit Addison-Wesley on the Web: www.awprofessional.com

Library of Congress Cataloging-in-PublicationData

Warren, Henry S.

Hacker's delight / Henry S. Warren, Jr.

p. cm.

Includes bibliographical references andindex.

1. Computer programming. I. Title.

QA76.6 .W375 2002

005.1dc21

2002066501

Copyright 2003 by Pearson Education, Inc.

All rights reserved. No part of thispublication may be reproduced, stored in a retrieval system, or transmitted, inany form, or by any means, electronic, mechanical, photocopying, recording, orotherwise, without the prior consent of the publisher. Printed in the United States of America . Publishedsimultaneously in Canada .

For information on obtaining permission foruse of material from this work, please submit a written request to:

Pearson Education, Inc.

Rights and Contracts Department

75 Arlington Street, Suite 300

Boston , MA 02116

Fax: (617) 848-7047

Text printed on recycled paper

1 2 3 4 5 6 7 8 9 10MA0605040302

First printing, July 2002

Dedication

To Joseph W. Gauld,my high school algebra teacher, for sparking in me a delight in the simplethings in mathematics.

Foreword

When I first got a summer job at MIT'sProject MAC almost 30 years ago, I was delighted to be able to work with theDEC PDP-10 computer, which was more fun to program in assembly language thanany other computer, bar none, because of its rich yet tractable set ofinstructions for performing bit tests, bit masking, field manipulation, andoperations on integers. Though the PDP-10 has not been manufactured for quitesome years, there remains a thriving cult of enthusiasts who keep old PDP-10hardware running and who run old PDP-10 softwareentire operating systems andtheir applicationsby using personal computers to simulate the PDP-10instruction set. They even write new software; there is now at least one Website whose pages are served up by a simulated PDP-10. (Come on, stoplaughingit's no sillier than keeping antique cars running.)

I also enjoyed, in that summer of 1972,reading a brand-new MIT research memo called HAKMEM, a bizarre and eclecticpotpourri of technical trivia. [1] Thesubject matter ranged from electrical circuits to number theory, but whatintrigued me most was its small catalog of ingenious little programming tricks.Each such gem would typically describe some plausible yet unusual operation onintegers or bit strings (such as counting the 1-bits in a word) that couldeasily be programmed using either a longish fixed sequence of machineinstructions or a loop, and then show how the same thing might be done muchmore cleverly, using just four or three or two carefully chosen instructionswhose interactions are not at all obvious until explained or fathomed. For me,devouring these little programming nuggets was like eating peanuts, or ratherbonbonsI just couldn't stopand there was a certain richness to them, a certainintellectual depth, elegance, even poetry.

[1] Why "HAKMEM"? Short for "hacks memo"; one36-bit PDP-10 word could hold six 6-bit characters, so a lot of the namesPDP-10 hackers worked with were limited to six characters. We were used toglancing at a six-character abbreviated name and instantly decoding thecontractions. So naming the memo "HAKMEM" made sense at the timeatleast to the hackers.

"Surely," I thought, "theremust be more of these," and indeed over the years I collected, and in somecases discovered, a few more. "There ought to be a book of them."

I was genuinely thrilled when I saw HankWarren's manuscript. He has systematically collected these little programmingtricks, organized them thematically, and explained them clearly. While some ofthem may be described in terms of machine instructions, this is not a book onlyfor assembly language programmers. The subject matter is basic structuralrelationships among integers and bit strings in a computer and efficienttechniques for performing useful operations on them.

These techniques are just as useful in the Cor Java programming languages as they are in assembly language.

Many books on algorithms and data structuresteach complicated techniques for sorting and searching, for maintaining hashtables and binary trees, for dealing with records and pointers. They overlookwhat can be done with very tiny pieces of databits and arrays of bits. It isamazing what can be done with just binary addition and subtraction and maybesome bitwise operations; the fact that the carry chain allows a single bit toaffect all the bits to its left makes addition a peculiarly powerful datamanipulation operation in ways that are not widely appreciated.

Yes, there ought to be a book about thesetechniques. Now it is in your hands, and it's terrific. If you write optimizingcompilers or high-performance code, you must read this book. You otherwisemight not use this bag of tricks every single daybut if you find yourself stuckin some situation where you apparently need to loop over the bits in a word, orto perform some operation on integers and it just seems harder to code than itought, or you really need the inner loop of some integer or bit-fiddlycomputation to run twice as fast, then this is the place to look. Or maybeyou'll just find yourself reading it straight through out of sheer pleasure.

Guy L. Steele, Jr.
Burlington, Massachusetts
April 2002

Preface

Caveat Emptor: The cost of softwaremaintenance increases with the square of the programmer's creativity.

First Law of Programmer Creativity, Robert D. Bliss, 1992

This is a collection of small programming tricks that I have comeacross over many years. Most of them will work only on computers that representintegers in two's-complement form. Although a 32-bit machine is assumed whenthe register length is relevant, most of the tricks are easily adapted tomachines with other register sizes.

This book does not deal with large trickssuch as sophisticated sorting and compiler optimization techniques. Rather, itdeals with small tricks that usually involve individual computer words orinstructions, such as counting the number of 1-bits in a word. Such tricksoften use a mixture of arithmetic and logical instructions.

It is assumed throughout that integeroverflow interrupts have been masked off, so they cannot occur. C, Fortran, andeven Java programs run in this environment, but Pascal and ADA users beware!

The presentation is informal. Proofs aregiven only when the algorithm is not obvious, and sometimes not even then. Themethods use computer arithmetic, "floor" functions, mixtures ofarithmetic and logical operations, and so on. Proofs in this domain are oftendifficult and awkward to express.

To reduce typographical errors andoversights, many of the algorithms have been executed. This is why they aregiven in a real programming language, even though, like every computer language,it has some ugly features. C is used for the high-level language because it iswidely known, it allows the straightforward mixture of integer and bit-stringoperations, and C compilers that produce high-quality object code areavailable.

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Hackers Delight»

Look at similar books to Hackers Delight. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Hackers Delight»

Discussion, reviews of the book Hackers Delight and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.