C interpreter in Lisp/scheme/python

nanothermite911fbibustards nanothermite911fbibustards at gmail.com
Sun Jun 13 21:58:45 EDT 2010


On Jun 13, 4:07 pm, bolega <gnuist... at gmail.com> wrote:
> I am trying to compare LISP/Scheme/Python for their expressiveness.
>
> For this, I propose a vanilla C interpreter. I have seen a book which
> writes C interpreter in C.
>
> The criteria would be the small size and high readability of the code.
>
> Are there already answers anywhere ?
>
> How would a gury approach such a project ?
>
> Bolega

Take a look at this

When I first got a summer job at MIT’s Project MAC almost 30 years
ago, I was
delighted to be able to work with the DEC PDP-10 computer, which was
more fun
to program in assembly language than any other computer, bar none,
because of
its rich yet tractable set of instructions for performing bit tests,
bit masking, field
manipulation, and operations on integers. Though the PDP-10 has not
been manufactured
for quite some years, there remains a thriving cult of enthusiasts who
keep old PDP-10 hardware running and who run old PDP-10 software—
entire
operating systems and their applications—by using personal computers
to simulate
the PDP-10 instruction set. They even write new software; there is now
at
least one Web site whose pages are served up by a simulated PDP-10.
(Come on,
stop laughing—it’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 eclectic potpourri of technical
trivia.1 The
subject matter ranged from electrical circuits to number theory, but
what intrigued
me most was its small catalog of ingenious little programming tricks.
Each such
gem would typically describe some plausible yet unusual operation on
integers or
bit strings (such as counting the 1-bits in a word) that could easily
be programmed
using either a longish fixed sequence of machine instructions or a
loop, and then
show how the same thing might be done much more cleverly, using just
four or
three or two carefully chosen instructions whose interactions are not
at all obvious
until explained or fathomed. For me, devouring these little
programming nuggets
was like eating peanuts, or rather bonbons—I just couldn’t stop—and
there was a
certain richness to them, a certain intellectual depth, elegance, even
poetry.
“Surely,” I thought, “there must be more of these,” and indeed over
the years I
collected, and in some cases discovered, a few more. “There ought to
be a book of
them.”
I was genuinely thrilled when I saw Hank Warren’s manuscript. He has
systematically
collected these little programming tricks, organized them
thematically,
and explained them clearly. While some of them may be described in
terms of
machine instructions, this is not a book only for assembly language
programmers.
The subject matter is basic structural relationships among integers
and bit strings
in a computer and efficient techniques for performing useful
operations on them.

These techniques are just as useful in the C or Java programming
languages as
they are in assembly language.
Many books on algorithms and data structures teach complicated
techniques
for sorting and searching, for maintaining hash tables and binary
trees, for dealing
with records and pointers. They overlook what can be done with very
tiny
pieces of data—bits and arrays of bits. It is amazing what can be done
with just
binary addition and subtraction and maybe some bitwise operations; the
fact that
the carry chain allows a single bit to affect all the bits to its left
makes addition a
peculiarly powerful data manipulation operation in ways that are not
widely
appreciated.
Yes, there ought to be a book about these techniques. Now it is in
your hands,
and it’s terrific. If you write optimizing compilers or high-
performance code, you
must read this book. You otherwise might not use this bag of tricks
every single
day—but if you find yourself stuck in some situation where you
apparently need
to loop over the bits in a word, or to perform some operation on
integers and it just
seems harder to code than it ought, or you really need the inner loop
of some integer
or bit-fiddly computation to run twice as fast, then this is the place
to look. Or
maybe you’ll just find yourself reading it straight through out of
sheer pleasure.

source
http://www.hackersdelight.org./foreword.pdf

=======
Standard Disclaimer, nothing personal

http://www.youtube.com/watch?v=lX18zUp6WPY

http://www.youtube.com/watch?v=XQapkVCx1HI

http://www.youtube.com/watch?v=tXJ-k-iOg0M

Hey Racist and INcompetent FBI Bustards, where is the ANTHRAX Mailer ?
Where are the 4 blackboxes ? Where are the Pentagon Videos ? Why did
you release the 5 dancing Israelis compromising the whole 911
investigation ? If the Dubai Police can catch Mossad Murderers and put
the videos and Iranian Police can why cant you put the Pentagon
Videos ? If Iran police can put the AMERICAN TERRORIST, Riggi and
puting on INTERNATIONAL MEDIA a day after catching him without
TORTURE, why cant you put the INNOCENT patsies on the MEDIA. Why did
you have to LIE about Dr Afiya Siddiqui and torture that Innocent
little mother of 3 and smashing the skull of her one child ?

http://www.youtube.com/watch?v=DhMcii8smxk
http://www.youtube.com/watch?v=0SZ2lxDJmdg

There are CRIMINAL cases against CIA CRIMINAL Bustards in Italian
courts.

FBI bustards paid a penalty of $5.8 million to Steven Hatfill, but
only because he was a white. They got away with MURDER of thousands of
Non-whites in all parts of the world.

Daily 911 news : http://911blogger.com

http://www.youtube.com/watch?v=tRfhUezbKLw

http://www.youtube.com/watch?v=x7kGZ3XPEm4

http://www.youtube.com/watch?v=lX18zUp6WPY




More information about the Python-list mailing list