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

About LISP

Name: Anonymous 2009-10-26 18:51

I started playing around with some LISP because you faggots never stop talking about its greatness and I'm truly amazed. At how shitty it really is.

A simple loop printing "hello world" eats up 40MB of RAM. And if you start up 10 of them it takes up 400MB. What the fuck?

No wonder no one uses this garbage.

Name: Anonymous 2009-10-27 14:01

>>78
Why's that?

Name: Anonymous 2009-10-27 15:02

LISP

Name: Anonymous 2009-10-27 16:48

>>62
100.65% CPU

wat

Name: Anonymous 2009-10-27 17:27

>>83
Lisp is that good.

Name: Anonymous 2009-10-27 19:40

Name: Anonymous 2009-10-27 20:18

>>85
Must be a pretty cool guy to make his own shitty avatar eh.

Name: Anonymous 2009-10-27 20:30

>>86
I think MrVacBob is a pretty cool guy, eh makes his own avatards and doesn't afraid of nothing.

Name: Anonymous 2009-10-27 20:38

Good greif, 20 MiB just to execute this simple hello world solution?! This is why lisp will never be ready for the desktop. I'll just keep coding in .NET 4.0, thank you very much.
(dotimes [x 10] (prn "Hello, world!"))

Name: Anonymous 2009-10-27 20:52

>>88
( ≖‿≖)

Name: Anonymous 2009-10-27 20:54

>>88
Lisp will "never be ready for the desktop" is more a product of "how i parentheses? u mad?" than "this implementation uses too much memory" and will be for the foreseeable future. That said, 20 MiB is too much, even if we were using something like Sepples

Name: Anonymous 2009-10-28 2:38

bold? not bold?

Name: Anonymous 2009-10-28 3:46

>>90
It's because it contains the entire environment, including compiler and everything else available at runtime. If you want less, you need to treeshake your image.

Name: Anonymous 2009-10-28 4:13

>>88
Clojure? Doesn't that come with the entire JVM and the entire Clojure environment. I don't see how it would be less. If you want less, you'll need a real Lisp environment.

Name: Anonymous 2009-10-28 9:09

Would Dylan have been a successful, acceptable substitute for Lisp, had Apple not withdrawn their support for it?

Name: Anonymous 2009-10-28 9:10

>>94 obvious troll is obvious

Name: Anonymous 2009-10-28 9:12

>>92
That makes more sense, thank you

Name: Anonymous 2009-10-28 9:13

>>95
If you can't handle a simple, honest question, then it is you who is trolling yourself.

Name: Anonymous 2009-10-28 9:18

>>94
implying there is an acceptable substitute for Lisp
(゜Д゜)

Name: Anonymous 2009-10-28 9:23

>>94
Nothing Apple supports will ever be successful. Witness the failure of inventions like Hypercard, Firewire, PowerPC, Objective-C, multitouch, wi-fi, USB.... Hmm, I fucked up somewhere

Name: Anonymous 2009-10-28 9:27

>>99
supports or invents?
because i'm not a macfag, but i'm pretty sure macs have monitors, keyboards, and mice.
you best be trolling if you're implying apple invented wi-fi and usb.

Name: Anonymous 2009-10-28 9:29

>>100
Apple supports troll posts.

Name: Anonymous 2009-10-28 9:38

>>100
Apple never invented anything.

Name: Anonymous 2009-10-28 9:40

>>98
You know, you didn't have to resort to “implying” to convey your disbelief. Seriously, take that shit to /g/.

Name: Anonymous 2009-10-28 9:40

>>102
i wouldn't be surprised.
it's not a very innovative company

Name: Anonymous 2009-10-28 9:50

Who invented the touch wheel on the iPod?

Name: Anonymous 2009-10-28 9:51

>>105
Microsoft.
They sold the design to Apple for %5 of overall sales profit.
Keep it a secret though, it's not well known.

Name: Anonymous 2009-10-28 9:58

>>105
Don't know but I'm relatively certain I'd seen them in component catalogues before I'd even heard of the iPod

Name: Anonymous 2009-10-28 10:30

>>33
[quote]#include <stdio.h>
int main(void)
{ char s[] = "OP is a faggot"; unsigned int i = 0; while(i++ < 100000) sprintf(s, "%s", s); return 0; }
[/quote]
This is actually an UB.

Name: Anonymous 2009-10-28 10:40

sprintf(s, "%s", s);
That's pretty insecure. Use of snprintf strongly recommended!!

Name: Anonymous 2009-10-28 11:29

Here's my attempt at this stupid benchmark, more close to the original Lisp version:

#include <stdlib.h>
#include <sys\timeb.h>   
#include <wchar.h>

int main ( void )
{
    wchar_t *s;
    unsigned int i;
    struct timeb time_start,time_end;
    int total_duration_sec,total_duration_ms,total_duration;

    s = L"OP is a faggot";
    ftime(&time_start);
    for (i=0;i<1000000;i++)
    {
         wchar_t *junk;
         junk = calloc(strlen(s),sizeof(wchar_t));
         sprintf(s,"%s",s);
         free(junk);
    }
    ftime(&time_end);
    total_duration_sec = time_end.time - time_start.time;
    total_duration_ms  = time_end.millitm - time_start.millitm;
    total_duration = 1000* total_duration_sec + total_duration_ms;
    printf( "Total duration %d ms.\n", total_duration);
}
// Gives result:
// Total duration 187 ms.


Lisp version:

CL-USER> (time (loop repeat 1000000 do (format nil "OP is a faggot")))
Evaluation took:
  0.687 seconds of real time
  0.687500 seconds of total run time (0.687500 user, 0.000000 system)
  [ Run times consist of 0.096 seconds GC time, and 0.592 seconds non-GC time. ]
  100.15% CPU
  1,679,401,305 processor cycles
  447,993,992 bytes consed

Lisp version is about 3.6 times as slow, however examining the disassembly of the Lisp version shows that it's actually just a simple loop overall, and the major difference is of course time taken for GC and that format is slower since it has to parse much more complex format strings than sprintf.

To get an idea about FORMAT's capabilities, look at
http://gigamonkeys.com/book/a-few-format-recipes.html
http://www.lispworks.com/documentation/HyperSpec/Body/22_c.htm

Disassembly for reference:

; disassembly for (LAMBDA ())
; 240D89D2:       BE00093D00       MOV ESI, 4000000           ; no-arg-parsing entry point
;      9D7:       EB31             JMP L1
;      9D9: L0:   8BC6             MOV EAX, ESI
;      9DB:       83E804           SUB EAX, 4
;      9DE:       8BF0             MOV ESI, EAX
;      9E0:       8975FC           MOV [EBP-4], ESI
;      9E3:       8B3DA8880D24     MOV EDI, [#x240D88A8]      ; #<FUNCTION (LAMBDA
                                                              ;                #) {240D88B5}>
;      9E9:       8D5C24F8         LEA EBX, [ESP-8]
;      9ED:       83EC0C           SUB ESP, 12
;      9F0:       BA0B001022       MOV EDX, 571473931
;      9F5:       8B05AC880D24     MOV EAX, [#x240D88AC]      ; #<FDEFINITION object for FORMAT>
;      9FB:       B908000000       MOV ECX, 8
;      A00:       892B             MOV [EBX], EBP
;      A02:       8BEB             MOV EBP, EBX
;      A04:       FF5005           CALL DWORD PTR [EAX+5]
;      A07:       8B75FC           MOV ESI, [EBP-4]
;      A0A: L1:   83FE00           CMP ESI, 0
;      A0D:       7FCA             JNLE L0
;      A0F:       BA0B001022       MOV EDX, 571473931
;      A14:       8BE5             MOV ESP, EBP
;      A16:       F8               CLC
;      A17:       5D               POP EBP
;      A18:       C3               RET

Name: Anonymous 2009-10-28 11:39

>>108
It's also a possibly infinite loop on systems where INT_MIN >= -32768.

P.S. memmove(s, s, strlen(s)+1);
P.S.2. /prog/ is a special kind of community: even trolls know programming better than you. I suggest you hesitate before posting ">>X is wrong!" because it might be the case that you sir HBT.

Name: Anonymous 2009-10-28 13:04

>>108
i++ < 100000
Undefined operation.  Calling the cops.

Name: Anonymous 2009-10-28 13:50

>>112
That is not undefined. Calling the trollpolicia.

Name: Anonymous 2009-10-28 14:10

>>112
ur an idiot

Name: Anonymous 2009-10-28 15:25

>>114
ur and idiot
fixed that for you

Name: Anonymous 2009-10-28 17:37

>>115
what about my "and idiot?"

Name: Anonymous 2009-10-28 17:47

>>116
I dunno, you should be asking >>114.

Name: Anonymous 2009-10-28 18:02

>>117
What about my "should be asking?"

Name: Anonymous 2009-10-28 18:05

>>118
LOLITROLU

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