Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

Common Lisp is shit

Name: Anonymous 2012-04-18 8:54

ALL OF THIS FOR A SIMPLE ADD? HAHHAAHA


CL-USER> (disassemble #'+)
; disassembly for +
; 00682BD0:       .ENTRY +(&REST ARGS)                        ; (FUNCTION
                                                              ;  (&REST T) ..)
;      C08:       8F4508           POP QWORD PTR [RBP+8]
;      C0B:       E34C             JRCXZ L2
;      C0D:       488D5DD0         LEA RBX, [RBP-48]
;      C11:       4829CB           SUB RBX, RCX
;      C14:       488BE3           MOV RSP, RBX
;      C17:       488BD9           MOV RBX, RCX
;      C1A:       4883E918         SUB RCX, 24
;      C1E:       761C             JBE L1
;      C20:       4C8D4D10         LEA R9, [RBP+16]
;      C24:       4929D9           SUB R9, RBX
;      C27:       4D31C0           XOR R8, R8
;      C2A: L0:   4F8B1401         MOV R10, [R9+R8]
;      C2E:       4E891404         MOV [RSP+R8], R10
;      C32:       4983C008         ADD R8, 8
;      C36:       4883E908         SUB RCX, 8
;      C3A:       75EE             JNE L0
;      C3C: L1:   488BCB           MOV RCX, RBX
;      C3F:       488955C8         MOV [RBP-56], RDX
;      C43:       4883F908         CMP RCX, 8
;      C47:       7414             JEQ L3
;      C49:       48897DC0         MOV [RBP-64], RDI
;      C4D:       4883F910         CMP RCX, 16
;      C51:       740A             JEQ L3
;      C53:       488975B8         MOV [RBP-72], RSI
;      C57:       EB04             JMP L3
;      C59: L2:   488D65D0         LEA RSP, [RBP-48]
;      C5D: L3:   48894DF0         MOV [RBP-16], RCX
;      C61:       488B4DF0         MOV RCX, [RBP-16]
;      C65:       488D740CF8       LEA RSI, [RSP+RCX-8]
;      C6A:       BB17001020       MOV EBX, 537919511
;      C6F:       E35C             JRCXZ L7
;      C71:       488D1409         LEA RDX, [RCX+RCX]
;      C75:       4989AC24B8000000 MOV [R12+184], RBP
;      C7D:       4D8B5C2468       MOV R11, [R12+104]
;      C82:       4C01DA           ADD RDX, R11
;      C85:       4939542470       CMP [R12+112], RDX
;      C8A:       0F86CA000000     JBE L14
;      C90:       4989542468       MOV [R12+104], RDX
;      C95:       498D5307         LEA RDX, [R11+7]
;      C99: L4:   FD               STD
;      C9A:       488BDA           MOV RBX, RDX
;      C9D:       EB08             JMP L6
;      C9F: L5:   4883C210         ADD RDX, 16
;      CA3:       488952F1         MOV [RDX-15], RDX
;      CA7: L6:   488B06           MOV RAX, [RSI]
;      CAA:       4883EE08         SUB RSI, 8
;      CAE:       488942F9         MOV [RDX-7], RAX
;      CB2:       4883E908         SUB RCX, 8
;      CB6:       75E7             JNE L5
;      CB8:       48C7420117001020 MOV QWORD PTR [RDX+1], 537919511
;      CC0:       FC               CLD
;      CC1:       4931AC24B8000000 XOR [R12+184], RBP
;      CC9:       7402             JEQ L7
;      CCB:       CC09             BREAK 9                    ; pending interrupt trap
;      CCD: L7:   4881FB17001020   CMP RBX, 537919511
;      CD4:       0F847C000000     JEQ L13
;      CDA:       488B4B01         MOV RCX, [RBX+1]
;      CDE:       488B53F9         MOV RDX, [RBX-7]
;      CE2:       F6C207           TEST DL, 7
;      CE5:       741A             JEQ L8
;      CE7:       80FA1A           CMP DL, 26
;      CEA:       7415             JEQ L8
;      CEC:       8BC2             MOV EAX, EDX
;      CEE:       240F             AND AL, 15
;      CF0:       3C0F             CMP AL, 15
;      CF2:       7555             JNE L12
;      CF4:       8A42F1           MOV AL, [RDX-15]
;      CF7:       3C16             CMP AL, 22
;      CF9:       7606             JBE L8
;      CFB:       2C1E             SUB AL, 30
;      CFD:       3C0C             CMP AL, 12
;      CFF:       7748             JNBE L12
;      D01: L8:   EB37             JMP L10
;      D03:       90               NOP
;      D04:       90               NOP
;      D05:       90               NOP
;      D06:       90               NOP
;      D07:       90               NOP
;      D08:       90               NOP
;      D09:       90               NOP
;      D0A:       90               NOP
;      D0B:       90               NOP
;      D0C:       90               NOP
;      D0D:       90               NOP
;      D0E:       90               NOP
;      D0F:       90               NOP
;      D10: L9:   8BC1             MOV EAX, ECX
;      D12:       240F             AND AL, 15
;      D14:       3C07             CMP AL, 7
;      D16:       755D             JNE L15
;      D18:       488BC1           MOV RAX, RCX
;      D1B:       488B4001         MOV RAX, [RAX+1]
;      D1F:       488945F8         MOV [RBP-8], RAX
;      D23:       488B79F9         MOV RDI, [RCX-7]
;      D27:       4C8D1C25E0010020 LEA R11, [#x200001E0]      ; GENERIC-+
;      D2F:       41FFD3           CALL R11
;      D32:       480F42E3         CMOVB RSP, RBX
;      D36:       488B4DF8         MOV RCX, [RBP-8]
;      D3A: L10:  4881F917001020   CMP RCX, 537919511
;      D41:       75CD             JNE L9
;      D43: L11:  488BE5           MOV RSP, RBP
;      D46:       F8               CLC
;      D47:       5D               POP RBP
;      D48:       C3               RET
;      D49: L12:  488B0570FEFFFF   MOV RAX, [RIP-400]         ; 'NUMBER
;      D50:       CC0A             BREAK 10                   ; error trap
;      D52:       03               BYTE #X03
;      D53:       1F               BYTE #X1F                  ; OBJECT-NOT-TYPE-ERROR
;      D54:       95               BYTE #X95                  ; RDX
;      D55:       15               BYTE #X15                  ; RAX
;      D56: L13:  31D2             XOR EDX, EDX
;      D58:       EBE9             JMP L11
;      D5A: L14:  492B542468       SUB RDX, [R12+104]
;      D5F:       52               PUSH RDX
;      D60:       4C8D1C2570254200 LEA R11, [#x422570]        ; alloc_tramp
;      D68:       41FFD3           CALL R11
;      D6B:       5A               POP RDX
;      D6C:       488D5207         LEA RDX, [RDX+7]
;      D70:       E924FFFFFF       JMP L4
;      D75: L15:  CC0A             BREAK 10                   ; error trap
;      D77:       02               BYTE #X02
;      D78:       02               BYTE #X02                  ; OBJECT-NOT-LIST-ERROR
;      D79:       55               BYTE #X55                  ; RCX
NIL

Name: Anonymous 2012-04-18 9:13

zomg moores law lol

Name: Anonymous 2012-04-18 9:59

https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic

It's not [i]JUST[\i] an ordinary ADD.
Will my BBcode work?I bet it willnot.

Name: Anonymous 2012-04-18 10:00

That's alot of shit just to loop through and add all args. Looks like it does it recursively as well.

Name: Anonymous 2012-04-18 12:15

>>4
It also has to check the type of each argument, and do something different if it's a bignum, for example. That's why dynamic typing is shit.

Name: Anonymous 2012-04-18 13:36

lololol addition in lisp takes half seconds and then gc stalls the machine for five seconds

GC is shit.

Name: Anonymous 2012-04-18 13:49

This is why you declare types.

Name: Anonymous 2012-04-18 14:08

>>3

Because I always need to add 256-bit numbers, right?

Name: Anonymous 2012-04-18 14:13

Why is it not even consistent?


CL-USER> (time (+ 1 2))
Evaluation took:
  0.000 seconds of real time
  0.000000 seconds of total run time (0.000000 user, 0.000000 system)
  100.00% CPU
  12,132 processor cycles
  0 bytes consed
 
3
CL-USER> (time (+ 1 1))
Evaluation took:
  0.000 seconds of real time
  0.000000 seconds of total run time (0.000000 user, 0.000000 system)
  100.00% CPU
  64 processor cycles
  0 bytes consed
 
2
CL-USER> (time (+ 0 0))
Evaluation took:
  0.000 seconds of real time
  0.000000 seconds of total run time (0.000000 user, 0.000000 system)
  100.00% CPU
  14,348 processor cycles
  0 bytes consed
 
0
CL-USER> (time (+ 0 0))
Evaluation took:
  0.000 seconds of real time
  0.000000 seconds of total run time (0.000000 user, 0.000000 system)
  100.00% CPU
  12,739 processor cycles
  0 bytes consed
 
0
CL-USER> (time (+ 0 0))
Evaluation took:
  0.000 seconds of real time
  0.000000 seconds of total run time (0.000000 user, 0.000000 system)
  100.00% CPU
  7,188 processor cycles
  0 bytes consed
 
0

Name: Anonymous 2012-04-18 14:30

I didn't know Lisp was compiled/assembled.  Looks like it might actually be more efficient if it wasn't.

Name: Anonymous 2012-04-18 14:50

>>9
that weird.

Name: Anonymous 2012-04-18 14:53

>>11
that's weird. sorry

Name: Anonymous 2012-04-18 15:13

>>10
Are you still living in the 60s? It's been compiled/assembled for years...

Name: Anonymous 2012-04-18 15:15

>>13
Nah, I just don't use Lisp.  Thank goodness.

Name: Anonymous 2012-04-18 15:22

AOT compilation for a highly dynamic GC'd language?  Sure smells like retard around here.

Name: Anonymous 2012-04-18 15:35

>>9

14,348 processor cycles

What the fuck is it even doing for 14,000 odd processor cycles when you try adding 0 and 0 together?

Name: Anonymous 2012-04-18 15:39

>>15
You appear to be living in the 60s still.

Please educate yourself. Start off by looking into SBCL.

Name: Anonymous 2012-04-18 15:53

>>16
I'm pretty sure it's the timing routine that's inaccurate.

>>17
Compiling to native code can be a lot more inefficient than just interpreting bytecode and only selectively compiling hotspots at runtime (via aggressive inlining).  Manual type hints are uglier than your mom.

Name: Anonymous 2012-04-18 15:57


        (defun quicksort1 (list)
          (if (< (length list) 2) list
              (let* ((pivot (nth (random (length list)) list))
                     (less (remove-if-not (lambda (x) (< x pivot)) list))
                     (p (remove-if-not (lambda (x) (= x pivot)) list))
                     (more (remove-if-not (lambda (x) (> x pivot)) list)))
                (append (quicksort1 less) p (quicksort1 more)))))
           
        (defun quicksort2 (list)
          (if (< (length list) 2) list
              (let ((p (nth (random (length list)) list)))
                (append (quicksort2 (remove-if-not (lambda (x) (< x p)) list))
                        (remove-if-not (lambda (x) (= x p)) list)
                        (quicksort2 (remove-if-not (lambda (x) (> x p)) list))))))

        (defun test (function n)
          (let ((list (loop for a from 1 to n collect (random n))))
            (time (funcall function list))
            nil))

  CL-USER> (test #'quicksort1 180000)
        Evaluation took:
          0.513 seconds of real time
          0.508032 seconds of total run time (0.456029 user, 0.052003 system)
          [ Run times consist of 0.172 seconds GC time, and 0.337 seconds non-GC time. ]
          99.03% CPU
          1,159,623,975 processor cycles
          100,363,056 bytes consed
        NIL

        CL-USER> (test #'quicksort2 180000)
        Evaluation took:
          0.551 seconds of real time
          0.524033 seconds of total run time (0.476030 user, 0.048003 system)
          [ Run times consist of 0.156 seconds GC time, and 0.369 seconds non-GC time. ]
          95.10% CPU
          1,245,664,978 processor cycles
          104,055,744 bytes consed
        NIL



1 BILLION CYCLES MUAHAHAHAHAHA

Name: Anonymous 2012-04-18 17:08

CL-USER> (shitp LISP)
T

Name: Anonymous 2012-04-18 17:20

>>19
holy fuck!

why people is still using this shit. i guess that why old macs were so slow and jobs changed them to PC to use regular languages

Name: Anonymous 2012-04-18 17:28

>>21
0/10 be more subtle

Name: Anonymous 2012-04-18 18:16

>>22
dubs/check'em nice dubs bro

Name: Anonymous 2012-04-18 21:21

>>22
dammit, someday i will make the best troll post ever, and you will see it!

i'll see you soon my archenemy!

kukukuku♮

Name: Anonymous 2012-04-18 21:26

>>22
>>21
joking aside, I wonder the same as >>22-san, I know CL (specially SBCL) does some type-inference while compilling. but why not just use a statically version of lisp (if that exist)?

Name: Anonymous 2012-04-18 22:47

>>18
Compile time is only an issue when the user has to run the JIT just before use, and ends up waiting a long time for the compilation. If the binary is compiled once and then run an arbitrary number of times by an arbitrary number of users, long compilation times become worth the better run time performance. But whether or not that is an option depends on the medium used.

Name: Anonymous 2012-04-18 23:54

It also has to support complex numbers.

* (time (+ #C(5.3 12.7) #C(0 7.3)))

Evaluation took:
  0.000 seconds of real time
  0.000000 seconds of total run time (0.000000 user, 0.000000 system)
  100.00% CPU
  873 processor cycles
  0 bytes consed

#C(5.3 20.0)

Name: Anonymous 2012-04-19 0:37

>>26
You're wrong -- the AOT will always generate code less or equal to in optimality to the JIT generated code because it doesn't get a chance to profile the code and the most likely variable types.  Unless you put disgusting type hints all over your code, that is.

Name: Anonymous 2012-04-19 0:38

>>27
Why does adding complex numbers take less cycles than adding fixnums?

Name: Anonymous 2012-04-19 1:17

>>28
ya, but it can still do whatever it can at compile time, and there are some compilers that allow you include profiling in the compilation process. Basically, any technology employed by JIT can also be used by a regular compiler that is provided with sample executions of the program.

profiling variable types probably isn't going to be that helpful though. If the compiler can't prove that the variable will always be of type A, it will need to run code that is prepared for the case when the variable is not of type A, even if that hardly ever happens.

Name: Anonymous 2012-04-19 1:22

>>30
If the compiler can't prove that the variable will always be of type A, it will need to run code that is prepared for the case when the variable is not of type A, even if that hardly ever happens.
If it's the case that 99.9% of the time the variable is of type A, then the code should check if it isn't and fall back onto the interpreter instead.

Basically, any technology employed by JIT can also be used by a regular compiler that is provided with sample executions of the program.
Machine code takes way more space than bytecode.  Is AOT really worth it?

Name: Anonymous 2012-04-19 2:10

>>31
That's the thing though, if it still has to do a check, then it hasn't done the optimization.

Yeah, it depends. Every approach will have its advantages and disadvantages, and some will be possible when others aren't. So neither is ultimately better than the other. And multiple techniques can be combined in interesting ways. It is good to simply remain aware of the choices.

Name: Anonymous 2012-04-19 4:08

Below the current ``level of abstraction'', I don't give a shit

Name: Anonymous 2012-04-19 5:34

>>33
ASM is the necessary level of abstraction.

Name: Anonymous 2012-04-19 5:50

>>33
Checking your current ``level of dubstraction'', and I'm impressed.

Name: Anonymous 2012-04-19 7:20

And even if you don't really care how long a simple addition is as long as it works well, even then Common Lisp is fucking shit.

Different namespaces for variables and definitions? What the fuck.
Yeah, sure, why do (f x) when you can do (FUNCALL f x) instead.

Actually, fuck all those LISP2

Name: Anonymous 2012-04-19 9:17

>>36
I agree, but I use it because I like CL-style macros more than I hate Lisp-2. I need to give Clojure a try.

Name: Anonymous 2012-04-19 9:34

That's the disassembly of the + function, which works on the full numeric tower(fixnums, bignums, rationals, complex numbers, and so on). + tends to have compiler macros and all kinds of other optimizations that would generate efficient code depending on the argument's types (if they can be determined). If you were adding 2 fixnums, it would just compile to a simple add instruction in your CPU's assembly.
Even if the function is large because it has to handle that many types of arguments, this isn't that relevant because it would do the type identificiation fast enough, so even calling it as a function with 2 arguments of unknown types isn't that slow.

Name: Anonymous 2012-04-19 10:07

>>37
True, the macros are better and so is the standard library, compared to the usual suspects of LISP1 dialects.

I guess I'll just use another functional language instead.
And no, I NO MENA HASKAL.

Name: Anonymous 2012-04-19 11:50

>>30
Why doesn't Oracle have a native compiler for Java then?

Name: Anonymous 2012-04-19 12:57

ASM

If it ain't Lisp, it's shit.

Name: Anonymous 2012-04-19 17:27

>>40
Because Oracle sucks. There is a GNU native java compiler called GCJ.

Name: Anonymous 2012-04-19 17:31

>>41
The creators of Lisp ran out of funds before they could design a proper syntax.

Name: Anonymous 2012-04-19 17:34

I got 44 problems and dubs ain't one

Name: Anonymous 2012-04-19 22:07

>>9
Because you're running a kernel too, ``fagstorm''

Name: Anonymous 2012-04-19 22:14

x86 is shit. On a Lisp machine that would be a single instruction.

Name: Anonymous 2012-04-19 22:15

>>43
M-expressions were horrid looking

sexp is much better

Name: Anonymous 2012-04-20 11:50

>>47
>lispers arguing about worse syntax

get a load of this guy

Name: Anonymous 2012-04-20 13:45

>>48
back to /g/ ``please"

Name: Anonymous 2012-04-20 13:58

>>47
M-expressions were invented for the sole purpose of showing that there can be something worse than S-expressions.

>>49
fuck you faggot storm

Name: Anonymous 2012-04-20 14:22

>>50
That's once again wrong.

Now go back to /g/ and scrub your toilets you mental midget

Name: Anonymous 2012-04-20 14:36

>>51
Are you autistic? Are you unable to understand sarcasm? Are you autistic and unable to understand sarcasm?

Then shotgun mouthwash is what you need!

Name: Anonymous 2012-04-20 14:42

I find it quite amusing how /prog/ responds to such an obvious troll thread.

Name: Anonymous 2012-04-20 14:44

>>53
joke's on you, they were only pretending to be retarded xDDD

>>55
nice dubs bro

also, check my timestamp triples

Name: Anonymous 2012-04-20 17:03

>>54
I dare you to say that to my face

Name: Anonymous 2012-04-20 19:25

>>55
nice dubs bro

Name: Anonymous 2012-04-20 22:29

Machine code takes way more space than bytecode.
Only if you're using RISC shit.

Name: Anonymous 2012-04-20 22:33

All.Those.Fucking.Nops.

Name: Anonymous 2012-04-20 23:27

>>57
x86 is shit.

Name: Anonymous 2012-04-21 0:45

>>57
x86 is also horribly bloated despite not being RISC.

Name: Anonymous 2012-04-21 0:46

>>59
Fuck off and die you mental goy.

Name: Anonymous 2012-04-21 2:15

SIMPLE ADD
this is a simple add (contains no javascript, only html and css):
data:text/html,<!DOCTYPE html>%0d%0a<html><head><style>.c:checked{display:none}.s:checked {display:none}.a:checked~.a:checked~.c{display:none}.a:checked~.a:checked~.c:checked{display:inline}.a:checked~.s{display:none}.a:checked~.s:checked{display:inline}.a:checked~.a:checked~.s{display:inline}.a:checked~.a:checked~.s:checked{display:none}.a:checked~.a:checked~.a:checked~.s{display:none}.a:checked~.a:checked~.a:checked~.s:checked{display:inline}</style></head><body><p><input type="checkbox" class="a"/>+<input type="checkbox" class="a"/>+<input type="checkbox" class="a"/>=<input type="checkbox" class="c" disabled/><input type="checkbox" class="c" checked disabled/><input type="checkbox" class="s" disabled/><input type="checkbox" class="s" checked disabled/></p></body></html>

Name: Anonymous 2012-04-21 2:20

>>62
actually, here's a shorter one:
data:text/html,<!DOCTYPE html>%0d%0a<html><head><style>.c:checked,.s:checked,.a:checked~.a:checked~.c,.a:checked~.s,.a:checked~.a:checked~.s:checked,.a:checked~.a:checked~.a:checked~.s{display:none}.a:checked~.a:checked~.c:checked,.a:checked~.s:checked,.a:checked~.a:checked~.s,.a:checked~.a:checked~.a:checked~.s:checked{display:inline}</style></head><body><p><input type="checkbox" class="a"/>+<input type="checkbox" class="a"/>+<input type="checkbox" class="a"/>=<input type="checkbox" class="c" disabled/><input type="checkbox" class="c" checked disabled/><input type="checkbox" class="s" disabled/><input type="checkbox" class="s" checked disabled/></p></body></html>

Name: Anonymous 2012-04-21 11:06

;      C32:       4983C008         ADD R8, 8


oh look there it is.

Name: Anonymous 2012-04-21 11:23

>>64

Lol!

Name: Anonymous 2012-04-21 16:35

(dubs)

Name: bampu pantsu 2012-05-29 4:30

bampu pantsu

Name: Anonymous 2013-11-30 8:12

░░░░░░░▄▀▀▀▀▀▀▀▀▀▀▄▄░░░░░░░░░
░░░░▄▀▀░░░░░░░░░░░░░▀▄░░░░░░░
░░▄▀░░░░░░░░░░░░░░░░░░▀▄░░░░░ YOU HAVE BEEN VISITED BY
░░█░░░░░░░░░░░░░░░░░░░░░▀▄░░░ LE 'FEEL OF NO GF
░▐▌░░░░░░░░▄▄▄▄▄▄▄░░░░░░░▐▌░░
░█░░░░░░░░░░░▄▄▄▄░░▀▀▀▀▀░░█░░ A qt 3.14 gf will come to you,
▐▌░░░░░░░▀▀▀▀░░░░░▀▀▀▀▀░░░▐▌░ but ONLY if you post a
█░░░░░░░░░▄▄▀▀▀▀▀░░░░▀▀▀▀▄░█░ `>tfw no GF on this thread
█░░░░░░░░░░░░░░░░▀░░░▐░░░░░▐▌
▐▌░░░░░░░░░▐██▀█▄░░░░░░█▀█░▐▌
░█░░░░░░░░░░░▀▀▀░░░░░░▀▀▀▀░▀▄
░▐▌░░░░▄░░░░░░░░░░░░░▌░░░░░░█
░░▐▌░░▐░░░░░░░░░░░░░░▀▄░░░░░█
░░░█░░░▌░░░░░░░░▐▀░░░░▄▀░░░▐▌
░░░▐▌░░▀▄░░░░░░░░▀░▀░▀▀░░░▄▀░
░░░▐▌░░▐▀▄░░░░░░░░░░░░░░░░█░░
░░░▐▌░░░▌░▀▄░░░░▀▀▀▀▀▀░░░█░░░
░░░█░░░▀░░░░▀▄░░░░░░░░░░▄▀░░░
░░▐▌░░░░░░░░░░▀▄░░░░░░▄▀░░░░░
░▄▀░░░▄▀░░░░░░░░▀▀▀▀█▀░░░░░░░

Don't change these.
Name: Email:
Entire Thread Thread List