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

Pages: 1-4041-8081-120121-

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-26 18:59

And if you start up 10 of them it takes up 400MB.
Why stop there? Start up a hundred!

Name: Anonymous 2009-10-26 18:59

It's likely your fault.

Name: Anonymous 2009-10-26 19:05

What did you expect?
It's a shitty language which just happens to have a lot of ignorant fanboys on /prog/.

Name: Anonymous 2009-10-26 19:10

>>4
and reddit

Name: Anonymous 2009-10-26 19:12

>>5
That would be Factor.

Name: Anonymous 2009-10-26 19:34

>>1
Well I'm sure crying about it is going to help
You should have enough RAM that it shouldn't matter anyways.

Name: Anonymous 2009-10-26 20:01

I am going as the Lisp programming language for Halloween.  What about you guys?

Name: Anonymous 2009-10-26 20:13

>>8
I'm going as a car, and my friend as a cdr

Name: Anonymous 2009-10-26 20:14

>>9
Are you prepared for some hot cons action?

Name: Anonymous 2009-10-26 20:23

>>10
......((((*。_。)_ NOT WITH EACH OTHER!

Name: Anonymous 2009-10-26 20:28

>>7
Retarded!

Name: Anonymous 2009-10-26 20:37

>>7
How much RAM do you think you'd need if every process on your system was like that?

Name: Anonymous 2009-10-26 20:41

>>13
over 9000 jiggabytes

Name: Anonymous 2009-10-26 22:26

>>9

im going as an abstract syntax tree

Name: Anonymous 2009-10-27 0:11

I will be going as the Dich Snake for Halloween

                       _.-------.                     
     ----------------''       ,-.`-----.              
                             ( X )      `-.           
                              `-'  ,---.   |          
                                  .     `---       ,----
    -----------------------.       `-.            .   
                            `---------`   ,--+-----`----
                                         ;    :       
                       Can I suck your   +----;       
                       dich today?        `--+----,----
                                                 (    
                                                  `-----

Name: HMA FA 2009-10-27 1:10

I will be dressing up

Name: Anonymous 2009-10-27 1:12

>>17
fuck /prog/ guessed I was about to say His Name and ate my post

Name: Anonymous 2009-10-27 4:08

there are hot naked lispians in my shower

Name: Anonymous 2009-10-27 4:15

The only program that consumes more than 20mb here is Firefox.

Name: Anonymous 2009-10-27 5:01



                       _.-------.                    
     ----------------''       ,-.`-----.             
                             ( X )      `-.          
                              `-'  ,---.   |         
                                  .     `---       ,----
    -----------------------.       `-.            .  
                            `---------`   ,--+-----`----
                                         ;    :      
                       Can I suck your   +----;      
                       dich today?        `--+----,----
                                                 (   
                                                  `-----

Name: Anonymous 2009-10-27 5:27

(display "Hello, World!") takes up a negligible amount of space for me.

Name: Anonymous 2009-10-27 6:10

>>1
You're clearly trolling or just an idiot.


CL-USER> (time (loop repeat 1000000 do (format nil "OP is a faggot.")))
Evaluation took:
  0.688 seconds of real time
  0.687500 seconds of total run time (0.687500 user, 0.000000 system)
  [ Run times consist of 0.108 seconds GC time, and 0.580 seconds non-GC time. ]
  100.00% CPU
  1,662,811,389 processor cycles
  447,995,736 bytes consed

That prints "OP is a faggot" to a string and leaves it for the gc to collect, one million times. As you can see it consumes about 447 bytes on average and ~1662 CPU cycles on average per each print. Another thing to be noted here is that we're talking about the full power of the format function, which is likely one of the most advanced string formatting functions I've ever seen, and that for each instance, a new string stream is created and left for the gc to feed upon.

tl;dr: OP must be doing something very wrong, or most likely a troll. IHBT

Name: Anonymous 2009-10-27 6:15

>>23
this is cherry picked data.
either that or completely falsified.

Name: Anonymous 2009-10-27 6:19

>>24
Go and test it in SBCL or other Lisp implementations. I gave it a go in CCL, but the compiler was smart enough to just remove the dead code, making it a total of 0.000s, so I disqualified it. A good CL implementation is on average only some 3-4 times slower than C, and with proper type declarations it can easily aproach its performance.

Name: Anonymous 2009-10-27 6:26

I just gave it a go in one of the slowest CL implementations which is CLISP(interpreter, however they do have a JIT, but it wasn't used in this case):

[1]> (time (loop repeat 1000000 do (format nil "OP is a faggot.")))
Real time: 7.34375 sec.
Run time: 7.34375 sec.
Space: 384004620 Bytes
GC: 657, GC time: 1.15625 sec.
NIL

It seems to be about 10 times as slow as SBCL's performance, but consumes less memory overall. I haven't bothered trying to compile it and see how fast it would go with CLISP's JIT.

Name: Anonymous 2009-10-27 6:35

>>26
384MB???????????????
7 SECONDS?????????

Name: Anonymous 2009-10-27 6:38

>>23,26
You clearly are idiots. I used the so called "fastest" implementation around, SBCL. It took me 3 hours to compile and install this, just to prove you how wrong you are.


CL-USER(1): 'works?
WORKS!
CL-USER(2): (sb-profile:profile format)
CL-USER(3): (loop repeat 100 do (format nil "OP is a faggot"))
NIL
CL-USER(4): (sb-profile:report)

measuring PROFILE overhead..done

  seconds  | consed | calls |  sec/call  |  name 
----------------------------------------------------
     0.000 | 80,016 |   106 |   0.000000 | FORMAT
----------------------------------------------------
     0.000 | 80,016 |   106 |            | Total

estimated total profiling overhead: .000 seconds
overhead estimation parameters:
  2.e-8s/call, 1.9259999e-6s total profiling, 9.98e-7s internal profiling


80,016 CONS CELLS just for the generation of 100 C strings. Completely moronic implementation I'd say. Do you idiot lispers even know how much memory that is? A cons cell is (AT MINIMUM!) represented with this C structure in memyory:

struct cons {
    void *ptr;
    void *head;
    int size;
}

IT IS ALREADY 16 BYTES! (4*2 + 4 + offsetof) Multiply that by 80,016:

CL-USER(6): (* 80,016 16)

debugger invoked on a SB-INT:SIMPLE-READER-ERROR:
  SB-INT:SIMPLE-READER-ERROR at 6 (line 1, column 6) on #<SB-IMPL::STRING-INPUT-STREAM {LB33AD1}>:
    comma not inside a backquote

Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [ABORT] Exit debugger, returning to top level.

(SB-INT:SIMPLE-READER-ERROR
 #<SB-IMPL::STRING-INPUT-STREAM {LB33AD1}>
 "comma not inside a backquote")[:EXTERNAL]

Oh yeah, I forgot, your high level language that can do everything can't even learn how to understand both 80.016 and 80,016. Pff..., man 3 scanf.

P.S. (it's 1280.256 MiBs, I could get an OS running with that memory)

Name: Anonymous 2009-10-27 6:38

>>27
It does it 1000000 times, and measures the memory/time/CPU usage before/after. This just means ~384bytes per FORMAT call, and a truly negligible amount of time overall for a single FORMAT call. And CLISP is one of the slowest implementations out there.

Name: Anonymous 2009-10-27 6:49

>>28

CL-USER> (sb-profile:profile format)
; No value
CL-USER> (loop repeat 1000000 do (format nil "OP is a faggot"))
NIL
CL-USER> (sb-profile:report)
  seconds  |    consed   |   calls   |  sec/call  |  name 
-------------------------------------------------------------
     1.183 | 472,126,240 | 1,000,191 |   0.000001 | FORMAT
-------------------------------------------------------------
     1.183 | 472,126,240 | 1,000,191 |            | Total

estimated total profiling overhead: 0.97 seconds
overhead estimation parameters:
  3.2000003e-8s/call, 9.68e-7s total profiling, 1.24e-7s internal profiling
; No value

Besides that, PROFILE comes with its own overhead, which is quite a bit over here when we're calling it that many times.


80,016 CONS CELLS
That's not cons cells. It's bytes allocated you retard.

CL-USER(6): (* 80,016 16)
Haha, shows you don't even know the language if you type that in.

FORMAT is incredibly complex, yet it's so well optimized that it only had to alloc ~400 bytes to print that string.

Oh, and the total allocated memory at the end is just that. That memory is being free'd by the gc shortly after it is alloced. Just like you manually malloc and free your strings.

Name: Anonymous 2009-10-27 7:02

You clearly are idiots. I used the so called "fastest" implementation around, SBCL. It took me 3 hours to compile and install this, just to prove you how wrong you are.

It takes me 5 minutes total to build the latest SBCL on a Windows XP box which isn't even considered a recommended platform by SBCL devs. It just takes one single fucking command to get the build running and done.

If you have trouble doing something as trivial as running a "sh make.sh", maybe this whole programming thing isn't for you at all?

Name: Anonymous 2009-10-27 7:03

Oh, and why couldn't you pick a binary distribution, when one was available, if you couldn't build it yourself?

Name: Anonymous 2009-10-27 7:37

>>30
Besides that, PROFILE comes with its own overhead
My version doesn't. See "CALCULATE OVERHEAD"???

That's not cons cells. It's bytes allocated you retard.
Angels on a pinhead, ad hominem,

Haha, shows you don't even know the language if you type that in.
straw man argument,
FORMAT is incredibly complex, yet it's so well optimized that it only had to alloc ~400 bytes to print that string.
Yeah, it had only ~380 unecessary bytes allocated. We should be glad it didn't blow up as well? Also, like you said it's incredibly complex but misbehaves on something simple, I wonder how it'd do for complex input... CRAP!

Just like you manually malloc and free your strings.
I don't. Take a look at this code and LEARN what means to be fast

#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; }

Bytes allocated: 14 bytes for the string, 4 bytes for int and another 4 for the return value (int). I was right: lisp sucks.

Name: Anonymous 2009-10-27 7:42

It takes me 5 minutes total to build the latest SBCL on a Windows XP box which isn't even considered a recommended platform by SBCL devs. It just takes one single fucking command to get the build running and done.
We don't use the same hardware, nor the same OS.

If you have trouble doing something as trivial as running a "sh make.sh", maybe this whole programming thing isn't for you at all?
What a compelling argument.


Oh, and why couldn't you pick a binary distribution, when one was available, if you couldn't build it yourself?
Because THAT exactly is your plan. You're just trying to find an excuse for lisps inferiority, namely that it is a slow clunky piece of shit that leaks ~380 bytes in every iteration with it's "complex" tools. I don't want complexity if that is the price (FYI lisp isn't complex). If I had chosen a binary distribution, all the replies would say "Lisp performs much better in the compiled version! lisp rocks!". I'm not having that. Today, lisp and the faggots of this board was exposed.

Name: Anonymous 2009-10-27 7:43

Today, ... the faggots of this board was exposed.
How is that any different from any other day

Name: Anonymous 2009-10-27 7:50

>>35
Today is the 300th day of the year

Name: Anonymous 2009-10-27 7:54

>>36
So it is

Name: Anonymous 2009-10-27 7:54

>>33
I could easily make it not alloc any memory if I wanted it not to. If I want to write C in Lisp, I can do so, but what reason do I have to do that? For all practical purposes this is fairly fast. If I really needed to run that FORMAT 1000000 times, I would just cache the value by typing 2 extra characters to make the string loaded at readtime or perform some other sort of caching.

I'm not going to waste my time clearing up misconceptions about Lisp in your head nor how you misinterpreted the results of a simple benchmark.

You're so desperately trying to look for an excuse not learn Lisp, then don't learn it! People come to Lisp to learn something, and gain a valuable tool. If you have no need for such things, then why do it? You don't need stupid excuses like this not to learn it.

General on topic reply: tuning your Lisp application for performace isn't that hard and there's many books that go into excellent detail about this. Oh, and whoever responded to this thread seemed to be under the impression that Lisp is all Cons cells, which is just wrong, it has plenty of rich data types: http://www.lispworks.com/documentation/HyperSpec/Front/Contents.htm Arrays, Hashtables, Strings, Characters, Numbers of all kinds(integers, fixnums, bignums, ratios, complex, etc), Classes/Instances/Meta-classes, Structures, Cons cells and so on.

Name: Anonymous 2009-10-27 7:58

You're just trying to find an excuse for lisps inferiority, namely that it is a slow clunky piece of shit that leaks ~380 bytes in every iteration with it's "complex" tools.

I used one of the more complex output functions to show that even in the worst case scenario it doesn't really alloc much. And there's a huge difference between leak and alloc/free by gc.

It's easy to make this not alloc a single byte if it need be (cache it), but that wasn't the point of that example...

Name: Anonymous 2009-10-27 8:08

why the hell are you guys even allocing any memory if the text is constant?
shit is illogical

Name: Anonymous 2009-10-27 8:36

>>40
It's pointless, but the whole point of the example was to show that text output/formatting functions are pretty fast. There was no need to use FORMAT there at all, not only that but that code doesn't generate any real side-effects, so it's just garbage for the gc to feed on. In one case, one implementation just removed the entire thing as it deemed it dead code. The only reason the function was tested to output to a string and not to the console, is because then it would just be testing the operating system's console code performance. A fair benchmark would instead either output the data to a file or just discard it altogether or pipe it to nul.

Name: Anonymous 2009-10-27 8:47

I could easily make it not alloc any memory if I wanted it not to. If I want to write C in Lisp, I can do so, but what reason do I have to do that?
Well, let me see, efficiency, a ram smaller than 4GB, power.

For all practical purposes this is fairly fast. If I really needed to run that FORMAT 1000000 times, I would just cache the value by typing 2 extra characters to make the string loaded at readtime or perform some other sort of caching.
Notice how the blind lisp moron changes his position accordingly; first it was "lisp is fast" now it is "fairly fast for practical purposes". You don't need to cache anything, the compiler can use memoization, at least C compilers do.

I'm not going to waste my time clearing up misconceptions about Lisp in your head nor how you misinterpreted the results of a simple benchmark.

If you're not going to waste time trying to change something about my opinion then it makes me wonder why you argue with me. Do you just want to advocate lisp and show your lisp buddies that you're the coolest geek in the block?

General on topic reply: tuning your Lisp application for performace isn't that hard and there's many books that go into excellent detail about this. Oh, and whoever responded to this thread seemed to be under the impression that Lisp is all Cons cells, which is just wrong
No it isn't. Lisp is cons cells and atoms.

it has plenty of rich data types: http://www.lispworks.com/documentation/HyperSpec/Front/Contents.htm Arrays, Hashtables, Strings, Characters, Numbers of all kinds(integers, fixnums, bignums, ratios, complex, etc), Classes/Instances/Meta-classes, Structures, Cons cells and so on.
These can all be expressed in terms of cons cells and atoms. Another reason why lisp is slow - all the run-time mix-match and jumps from superclass to subclass lookup is no good, CLOS is the only thing lisp got right all these years and nobody uses it because they don't want to approach the rest of lisp. I can continue bashing lisp forever, but please make it at least enjoyable by arguing PROPERLY with me (something most lispers can't/won't do).

Name: Anonymous 2009-10-27 8:49

I used one of the more complex output functions to show that even in the worst case scenario it doesn't really alloc much. And there's a huge difference between leak and alloc/free by gc.
380 bytes more than needed is not "much"? You sound like a spoiled brat, and what spoiled you is moma-industry with its Moores law.

It's easy to make this not alloc a single byte if it need be (cache it), but that wasn't the point of that example...
I don't think so, but you're welcome to try.

Name: Anonymous 2009-10-27 8:50

>>42

Proceed.

Name: Anonymous 2009-10-27 9:14

This thread is fucking retarded. Morons compare performance of high-level dynamically-typed expressive multiparadigm programming language with high level assembly, e.g. C. Congratulation, idiots.

Name: Anonymous 2009-10-27 9:22

>>45
YHBT

Name: Anonymous 2009-10-27 9:23

>>46
Damn, it's difficult to be newfag these days.

Name: Anonymous 2009-10-27 9:26

>>45
As soon as I ask for some real PROOF, this is all I get from lispers.

Name: Anonymous 2009-10-27 9:27

Well, let me see, efficiency, a ram smaller than 4GB, power.
There have been embedded Lisps that used less than 48KB of RAM total. There's some modern implementations aimed at such limits, but they barely interest me as I do have 4GB of RAM and a fast CPU, and so do all my boxes that I'm going to run my software on, however in practice the Lisp image would be using between 10-30mb of RAM, and then fluctuate up and down by a few dozen MB as the application conses and gets gc'ed. You can actually write apps that cons little or not at all, but lets be fair and say that most Lisp programmers won't write such things unless they either hit a performance wall or just need to microoptimize everything from the start (in which case they might as well be using C if they're planning to specify every little detail anyway).

You don't need to cache anything, the compiler can use memoization, at least C compilers do.
Many Lisp compilers can do memoization, but if you don't trust your compiler or want to do your own? It's only a few extra characters(locally cache something at readtime) to a few lines of code to implement such a mechanism (full memoization at runtime). In Lisp, implementing all kinds of (front-end) optimizations you might want your compiler to implement is easy, and people do it all the time because of that. (Back-end optimizations are just as doable, but the implementation would no longer be portable in most cases as it depends on a specific backend...)
These can all be expressed in terms of cons cells and atoms.
Sure, but it's a waste of memory to only use cons cells. Any serious Lisp implementation tends to just use arrays and structures(memory layout) to implement more complex objects. A cons cell is just a structure with 2 elements.
If you're not going to waste time trying to change something about my opinion then it makes me wonder why you argue with me.

You showed you don't know Lisp very well in the previous examples, that nullified any interest in me arguing with you. Why would I argue about things someone doesn't fully understand? I would be fine arguing with someone who knows Lisp inside-out. Such a person can actually make valid arguments about things to dislike or that might need fixing in Lisp. Your problems are not actual issues to any real Lisp programmer. The only reason I'm arguing with you is not to change your opinion since you seem dead-set on thinking that Lisp isn't for you, but to make sure you don't misinform other readers of /prog/.

380 bytes more than needed is not "much"? You sound like a spoiled brat, and what spoiled you is moma-industry with its Moores law.
It's plenty, but it's very very little for most modern hardware. Not only that, while the case I gave doesn't need this at all, but a real use of FORMAT might need to use that memory.

Name: Anonymous 2009-10-27 9:33

maybe i should start programming in lisp.
my computer has 6GB of memory, but i hardly ever see over 3GB in use at one time :(

Name: Anonymous 2009-10-27 9:34

>>49
Feels like c.l.l

Name: Anonymous 2009-10-27 9:36

>>47
We don't “newfag” on /prog/.

back to /b/, please

Name: Anonymous 2009-10-27 9:40

>>52
get with the times, man.
memes run in loops.

1. Enjoyed by all.
2. Hated by all but newfags.
3. Abandoned by newfags.
4. Used only by oldfags (who were previously newfags).
5. Goto 1.

Name: Anonymous 2009-10-27 9:44

>>53
"newfagging" is not a meme, and we still don't do it on /prog/.

Name: Anonymous 2009-10-27 9:45

There have been embedded Lisps that used less than 48KB of RAM total.
What does THIS have to do with anything previously said? Do you realize we're discussing about SBCL and state of the art lisp implementations? (which could be more aptly characterized as state of the fart lisps). But of course, you're a lisper. Tedious as it may be, I'm going to point out every illogicy of yours.

I do have 4GB of RAM
How did I guess?

however in practice the Lisp image would be using between 10-30mb of RAM, and then fluctuate up and down by a few dozen MB as the application conses and gets gc'ed.
Misinformation, and dare I say the worst kind, for its unintentional. Just because YOUR stripped down implementation under YOUR system... Let's take a look at mine;

  i i i i i i i       ooooo    o        ooooooo   ooooo   ooooo
  I I I I I I I      8     8   8           8     8     o  8    8
  I  \ `+' /  I      8         8           8     8        8    8
   \  `-+-'  /       8         8           8      ooooo   8oooo
    `-__|__-'        8         8           8           8  8
        |            8     o   8           8     o     8  8
  ------+------       ooooo    8oooooo  ooo8ooo   ooooo   8

Welcome to GNU CLISP 2.48 (2009-10-03) <http://clisp.cons.org/>;

Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
Copyright (c) Bruno Haible, Sam Steingold 1999-2000
Copyright (c) Sam Steingold, Bruno Haible 2001-2009

Type :h and hit Enter for context help.

[1]> (room)

Number of garbage collections:            0
Bytes freed by GC:                        0
Time spent in GC:                         0
Bytes permanently allocated:        791,004
Bytes currently in use:          32,207,216
Bytes available until next GC:      401,048


Notice: bytes freed is equal 0. That's a pretty useless GC if it can't clean its own mess! the real number to look at here is the bytes in current use. Not surprising, I'm using about 32MBs just to invoke clisp, and like you said, it's the most lightweight (sic) implementation.

Let's try something now:

[7]> (prog1 t (loop repeat 1000000 collect (random 1))
t
[8]> (room)
Number of garbage collections:            2
Bytes freed by GC:                  417,784
Time spent in GC:                    10,000
Bytes permanently allocated:        791,004
Bytes currently in use:          32,894,888
Bytes available until next GC:      344,168

That's a +0.8MB increase, performance slowed down by the GC and a pending bag of bytes to slurp. I didn't even use the notorious CONS.

You can actually write apps that cons little or not at all, but lets be fair and say that most Lisp programmers won't write such things unless they either hit a performance wall or just need to microoptimize everything from the start (in which case they might as well be using C if they're planning to specify every little detail anyway).
In other words, lisp programmers should just use C if they want to be precise. Wonderful! We agree.


Many Lisp compilers can do memoization,
Excuse me, "many"? There's hardly 10 lisp implementations out there and I know at least two of them did not perform this optimization you talk about (in contrast with C - the bsd compiler, gcc, icc, lcc, pcc and the list goes on, and they all perform this kind of optimization). C has real software. Lisp does not - it was an ambitious project that sinked WTR.

Sure, but it's a waste of memory to only use cons cells.
Another confession came out. Keep 'em coming! Yes, cons cells are a waste of memory. I pointed that out first.

You showed you don't know Lisp very well in the previous examples,
You haven't provided a SINGLE example of my incompetence or yours. In fact, that is negative for you since you have the burden of proof, but I'll let you slack some more.

Your problems are not actual issues to any real Lisp programmer.
great way to treat criticism and a serious critic. what an asshole.

Name: Anonymous 2009-10-27 9:50

>>55
FFFFFFFFFFFFFFFFFFFFFFFFFFFFF YOUR A FUCKING MORON

Name: Anonymous 2009-10-27 9:51

>>55

[7]> (prog1 t (loop repeat 1000000 collect (random 1))
t
[8]> (room)
Number of garbage collections:            2
Bytes freed by GC:                  417,784
Time spent in GC:                    10,000
Bytes permanently allocated:        791,004
Bytes currently in use:          32,894,888
Bytes available until next GC:      344,168

That's a +0.8MB increase, performance slowed down by the GC and a pending bag of bytes to slurp. I didn't even use the notorious CONS.

Do you even know what CONS is? Do you know how LOOP or the COLLECT clause works?
COLLECT works by collecting elements into a list... How do you make lists? By chaining CONSes! COLLECT is a bit more advanced, as in most implementation it's implemented by keeping a reference to the tail cons and appending the last element in O(1) time as opposed to O(n) for normal appending.

As for the stripped down implementation claim. I use multiple CL implementations, from SBCL to CCL to CLISP to ECL, and they have different memory footprints, which may vary by depending on compilation settings used and of course what is loaded into them... just like normal applications do.

Name: Anonymous 2009-10-27 9:51

I find trolling Factor coders to be funnier, because all the reasons it's supposed to be better than other PLs are so obviously delusions, it's pathetic.

Name: Anonymous 2009-10-27 9:53

>>40
macroexpand-1 loop.

Name: Anonymous 2009-10-27 9:59

>>1

That's because unlike C and such, there are no static executable segments to fetch from disk on demand, and share between executables.

libc is small, but a Lisp image isn't. This is due to inclusion of the whole developer enviroment in every instance of the image: compiler, relevant debug info (source forms, xref, docstrings, you name it). Source forms take a lot, check out ROOM usage before and after loading a few systems.

Lisp wasn't traditionally meant for multiprocessing (and remains a poor choice). It's not The Lisp Way to run a Lisp program from Unix command line. The Lisp Way is to either run it from the REPL or some CLIM command prompt.

Lisp parallelism is based upon threads. I know explicit locking sucks, but there are many ways to make threads suck less: dataflow-oriented programming; message-passing; STM (or so i herd, implicit locking) and moar.

Shit like dataflow or STM that's impossible to express elegantly in this langs like Java or C++ is pretty elegant in Lisp. And yes, there are many working implementations.

>>40

(format 'nil control ...) allocates a fresh string every time.

Name: Anonymous 2009-10-27 10:02

'implicit locking' supposed to go after close-paren.
s/this langs/shit langs/

Name: Anonymous 2009-10-27 10:05

CL-USER> (time (loop repeat 1000000 do (progn (format nil "OP is a faggot"))))
Evaluation took:
  3.225 seconds of real time
  3.246455 seconds of total run time (3.186459 user, 0.059996 system)
  [ Run times consist of 0.262 seconds GC time, and 2.985 seconds non-GC time. ]
  100.65% CPU
  5,146,799,916 processor cycles
  576,125,952 bytes consed

NIL
CL-USER> (time (loop repeat 1000000 do (progn #.(format nil "OP is a faggot"))))
Evaluation took:
  0.001 seconds of real time
  0.000000 seconds of total run time (0.000000 user, 0.000000 system)
  0.00% CPU
  2,001,288 processor cycles
  0 bytes consed

NIL

Name: Anonymous 2009-10-27 10:39

I'm not sure if I like this thread. It's at least programming related, but is filled with so much bullshit and misinformation I may as well be on reddit/slashdot/stack overflow. *sigh* Downvoted

Name: Anonymous 2009-10-27 11:00

>>62
So the way to make lisp code tolerable is to not run it?  I agree.

Name: Anonymous 2009-10-27 11:04

>>62
Cheating, C can do that too.

#define dot(x) x
int main(void) { unsigned i = 0; while(i++ < 10000) dot("OP is a faggot"); return 0; }

Try to compile this with -O2 and strip unecessary information from the resulting executable.

and DON'T you dare claim it is not the same, or else you don't understand the c preprocessor nor the #. read macro.

P.S. the "2,001,288 processor cycles" number is a purely theoritical one (say, a hard bound). The truth is the processor took more cycles than that. I could probably refuse to believe any of your numbers, you biased lisp farthead.

Name: Anonymous 2009-10-27 11:05

lol at Ctard refusing to run his own benchmarks

Name: Anonymous 2009-10-27 11:08

>>66
shut up. you know I'm right.

Name: Anonymous 2009-10-27 11:08

>>65
and strip unecessary information from the resulting executable
With what flags?  You get a hell of a lot of unnecessary bullshit (like 10kb) when you compile anything with gcc/mingw on windows

Name: Anonymous 2009-10-27 11:09

you biased lisp farthead.
12 y.o. much?

Name: Anonymous 2009-10-27 11:10

>>68
Just use your compiler with the -s flag.

Name: Anonymous 2009-10-27 11:12

>>69
Oh, isn't that right? Do you want me to lose my humour now too? Hey listard, what caused you to get the blues? Don't you like being told santa claus isn't real?

Name: Anonymous 2009-10-27 11:16

>>65
you're so fucking stupid, I can't fucking believe it. here's a proper version

(let ((string "OP is a faggot"))
  (defun prog-trollan ()
    "it's dangerous to go alone. here, take this"
    (setq string string)))


I have no fucking idea where you pulled that "soft bound" from. maybe your ass.

Name: Anonymous 2009-10-27 11:24

>>71
Actually, I wasn't on anyones side. But you are the one who was throwing his toys out of the pram and calling people names. I also thought it was cute that you called him out for being biased.

Name: Anonymous 2009-10-27 11:34

>>73
run away. chicken out. lackey.

Name: Anonymous 2009-10-27 11:47

>>74
This is why we need IDs again

Name: Anonymous 2009-10-27 12:06

>>75
Oh shit I had forgotten we had IDs. Oh the lisp threads trying to get LISP match...

Name: Anonymous 2009-10-27 12:32

>>75
How do we get ID's back?  Somebody contact that MrVacuumCleaner guy or whatever who owns stuff....  I'm sure he'll do more than moot

Name: Anonymous 2009-10-27 13:00

>>75,77
Now's not a good time, I think. Maybe in a couple of years.

Name: Anonymous 2009-10-27 13:11

posting in epic thread

Name: Anonymous 2009-10-27 13:56

That's why we can't have nice things.

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

Name: Anonymous 2011-02-03 3:55

Name: Anonymous 2011-02-17 20:06

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