Andrew Lentvorski <[EMAIL PROTECTED]> writes:

> If it's to bang bits, C structs are pretty close to optimal, and no
> matter how good you are at Perl/Python/etc. you generally find
> yourself wishing for C.  Only Erlang has bit manipulation comparable
> to C in efficiency, in my opinion.

Since we're still on-topic to mention Lisp here, Common Lisp has ldb,
dpd, byte, and friends¹, allowing one to do every bit manipulation
operation available in C with equivalent efficiency. The code just
looks more verbose:

Take the low 3 bits from an integer:
  o C
      255 & 0x7

  o Common Lisp
      (logand 255 #x7)
    or 
      (ldb (byte 3 0) 255))

> Java takes them to the mat for more than it's share.

Java /the language/ isn't interesting, but Java /the platform/ is a
wonderful thing. I imagine that most people using Java just say they
"like Java", but there's a distinction missing there. If one could
take the entire Java platform and make it accessible just the same
from some other language (a la .NET), most of the appreciated facets
would be retained. I do know of several such efforts to host other
languages in the JVM, such as Armed Bear Common Lisp, but I have never
experimented with them.


Footnotes: 
¹ http://www.lispworks.com/documentation/HyperSpec/Body/f_ldb.htm#ldb
  http://www.lispworks.com/documentation/HyperSpec/Body/f_dpb.htm#dpb
  http://www.lispworks.com/documentation/HyperSpec/Body/f_by_by.htm#byte
  http://www.lispworks.com/documentation/HyperSpec/Body/c_number.htm

-- 
Steven E. Harris


-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to