Name: Anonymous 2011-10-21 5:04
What software absolutely needs the x86 performance from the user and programmer perspective? Why can't we switch to ARM even if it was ~4 times slower but much cheaper?
(defun add-fixnums (A B)
(let* ((hash (or (shl (get-tag A) tag-bits) (get-tag B)))
(h (aref handlers hash)))
(funcall h A B)))
typedef enum {
A,
B,
C,
D,
E,
F } type_tag;
struct A {
type_tag type;
...
};
struct B {
type_tag type;
...
};
struct C {
type_tag type;
...
};
struct D {
type_tag type;
...
};
struct E {
type_tag type;
...
};
struct F {
type_tag type;
...
};
typedef void (*bin_op) (type_tag*, type_tag*, void*);
// not supported
void bin_op_ns(type_tag*, type_tag*, void* ) {
assert(0);
}
static bin_op add_handlers[][] = {
// A B C D E F
{ add_A_A, add_A_B, add_A_C , bin_op_ns, bin_op_ns, add_A_F}, // A
{ add_B_A, add_B_B, add_B_C , add_B_D, bin_op_ns, bin_op_ns}, // B
{ add_C_A, add_C_B, add_C_C , bin_op_ns, bin_op_ns, bin_op_ns}, // C
{ bin_op_ns, add_D_B, bin_op_ns, add_D_D, bin_op_ns, bin_op_ns}, // D
{ bin_op_ns, bin_op_ns, bin_op_ns, bin_op_ns, add_E_E, add_E_F}, // E
{ add_F_A, bin_op_ns, bin_op_ns, bin_op_ns, add_F_E, add_F_F} }; // F
void add(type_tag* arg1, type_tag* arg2, void* ret ) {
add_handlers[*arg1][*arg2](arg1, arg2, ret);
}
(lisp (has many legitimate) issues)
(funcall #'and (quirks that make it)
(kindof ,@difficult to 'use ,(and read)))
(I can 't speak for everyone)
but
(I think many people here have probably tried lisp)
(only to realize that many of it 's features)
(are implemented more elegantly in other ,@more mainstream and (funcall #'popular languages))
(lisp is nice but it is very old ,@and maybe (CALL-NEXT-METHOD) doesn 't seem to be very well thoughtout as whole)
(It seems more like an experimental language ,@made when current modern techniques where experimental))
quotes are not that difficult to understand. ' marks literal data, ` is just like ', but parts of it can be evaluated with unquotes: ,expr simply evaluates expr at runtime, and its result is added to the list, ,@ is just like ,, but the result must be a list whose elements are spliced inside the quasiquoted list. #' denotes a procedure used in a ``simple value'' context in CL.defmacro.
prog? Why both dolist and map?), but that's again to maintain backwards compatibility. Another problem is the naming convention, and sometimes argument order, but, again, backwards compatibility reasons.