1. Explain
2. Templates
3. Simplicity should be left to the programmer. The language itself should be able to do whatever the programmer needs. If lisp can't do what the programmer needs (which may often be imperative programming), then simplicity in a language merely means less features. You can write simple programs in C++, but were C++ a simple language, it would not be nearly as popular because it would not be able to achieve everything a programmer needs.
Name:
Anonymous2011-12-07 14:33
>>7
1. Use of the same data structure for everything.
2. Templates are static -> not general engough.
3. C++ lefts no simplicity to the programmer. It's standard is much biggers than Scheme's.
Name:
Anonymous2011-12-07 14:37
>>7 You can write simple programs in C++, but were C++ a simple language, it would not be nearly as popular because it would not be able to achieve everything a programmer needs.
Simplicity/complexity has nothing to with C/C++'s popularity. C/C++ became popular due to its legacy-compatibility, which makes C/C++ bloatware by default.
>>13 All serious CL implementations have hash-table, arrays, and vector types.
There's a similar opposition between the use of lists to represent things and the use of "objects" with named, typed fields. I went through a stage, after I'd been programming in Lisp for 2 or 3 years, where I thought the old way of using lists to represent everything was just a hack. If you needed to represent points, surely it was better to declare a proper structure with x and y fields than to use a list of two numbers. Lists could contain anything. They might even have varying numbers of elements.
I was wrong. Those are the advantages of using lists to represent points.
Over the years my appreciation for lists has increased. In exploratory programming, the fact that it's unclear what a list represents is an advantage, because you yourself are unclear about what type of program you're trying to write. The most important thing is not to constrain the evolution of your ideas. So the less you commit yourself in writing to what your data structures represent, the better.
that might work for small things like points, but seems to fall apart on larger structures.
you have to know what position the thing you want is in the list. for points, knowing that "y" is at index 1 is obvious and you don't have to think about it. but for some other data structure -- say a "user" with an "email" property -- a dict/map/hash/object is a lot nicer because you can just say user.email and not be concerned with the order of things inside your data!
Name:
Anonymous2011-12-07 20:27
I'd recommend you use Scheme or Lisp as opposed to one of the 3 most mainstream languages(C++, C#, Java), but that would be completely and utterly RETARDED.
>>31 >>30-san meant to say, thats what balanced immutable red black trees are for, or alternatively, thats what immutable almost complete binary trees are for
Name:
Anonymous2011-12-08 16:54
>>32 New /prog/ challenge: find a compiler (AOT or JIT) that is able to optimize (immutable) cons into destructive operations on arrays or hash tables, depending on their use, without any kind of hint on the part of the programmer.
Deadline: Heat death of the universe.
Name:
Anonymous2011-12-08 17:02
>>34
You can use Finger Trees to implement Lists. FTs allow fast access to the hot points, called "fingers".
>>41 Still wasting memory on each operation due to immutability.
Suppose you pay a programmer $60,000 per year as a salary. That's $230 per day. For that price, it is cheaper to buy more RAM than it is to pay him to maintain buggy bullshit caused by your gay effectful language.
>>41
Immutable structures take less memory to copy and dynamic typing already suggests that you spend some memory on type-tags.
Name:
Anonymous2011-12-08 17:59
>>46
For example, a video game design goes like that: one creates a basic prototype game-object, then copies it, changing only a few fileds (like name, model and hit-points), gets projectiles, scenery, mobs, player-characters and npcs.
Except happiness from having too many choices has nothing to do with program efficiency. Sure, you may experience less stress from only having to use lists, but my program's not going to run like shit when I combine vectors, linked lists and other data structures in my program. Quite frankly, if you're having trouble using multiple data structures, you shouldn't be programming.
Name:
Anonymous2011-12-09 1:22
I enjoy writing in Lisp. I'm straight, have a girlfriend, and I have an above average IQ. I'm also successful by my own standards (I make $85k per year and I enjoy my job). However, I am not a professional programmer nor am I a computer science major, so I present to you this gem of logic:
-----Programs In Lisp-----|---Gay?---|
Professional Programmer | YES |
Comp Sci Major | YES |
Professional Engineer | NO |
Hobby Programmer | NO |
Homosexual | NO |
Plumber | YES |
Name:
F r o z e n V o i d !!mJCwdV5J0Xy2A212011-12-09 2:12
1. Eval
performance costs aside, this is writing a extra program to compile.
2. Continuation
Castrated gotos are and advantage? it not even computed goto.
3. Macro
C preprocessor is enough to write any C macro, and most of LISP macros which don't abuse LISP(the latter is like writing a layer of C to compile(since C is not usually interpreted,using a embedded C interpreter to parse your "C macro writer code" is incredibly bloated) extra C programs at runtime:which is retarded enough to avoid using in any real code(outside of toy languages or specific interpreters, which both do not use C syntax usually))
4. GC
If using GC is advantage its only because the code quality which is requiring to be GC'ed is mediocre, trading speed for safety, while surrendering control of the computer to the garbage collector.
In a Java Police State, all objects must be "searched" and if found "expired" will be executed for being garbage, non-contributing part of a system. In C Freedom Federation all objects can decide when to contribute, when to exit and free and you can construct anything you like without expecting to be searched by the "garbage collector" annually.
Name:
Anonymous2011-12-09 2:32
>searched by the "garbage collector" annually.
anusally searched you mean.
>>56
4. Smart coders know that their manual memory management WILL be broken, increase development time and perform worse than GC, but they're willing to trade that off for some other benefit that the language has. Only idiots think they can produce actually correct and efficient manual memory management in a non-trivial system. It's almost 2012, we can do GC correctly and efficiently these days, stop being stuck with the old, obsolete arguments.
Name:
F r o z e n V o i d !!mJCwdV5J0Xy2A212011-12-09 5:22
>>60
Call me when your GC doesn't make every program slower. The quest for proper GC is far from over.
If you write GC system which is superior or near-equal to performance of manual memory allocation,I could write program which preallocate the structures at compile time, making the entire program static or chunked to buffers or even writing my own memory allocator.
Your GC systems will always one step behind because they lack control.
Name:
Anonymous2011-12-09 5:29
>>61 making the entire program static
hahahahahahahaha
No.
writing my own memory allocator. they lack control.
Enjoy wasting your time seeking where you freed 0x001A658F. At least you can get faster programs, even 1% is a plus.
Name:
F r o z e n V o i d !!mJCwdV5J0Xy2A212011-12-09 5:32
>>62
With proper design 99% of the program code can be made static.
Name:
F r o z e n V o i d !!mJCwdV5J0Xy2A212011-12-09 5:34
In fact, malloc is often a bottleneck, and static programs don't need malloc in any form.
>>63 With proper design 99% of the program code can be made static.
Don't you mean program data? Maybe echo or cat don't need malloc and therefore are fine with static buffers, but how can you write anything that needs to hold arbitraty quantities of data (such as browsers, editors, debuggers)?
Name:
F r o z e n V o i d !!mJCwdV5J0Xy2A212011-12-09 8:12
>>65
>hold arbitraty quantities of data
You can either malloc or put a hard precompiled limit on how much data your browser,editor,debugger can access at once.
It won't look as flexible as the malloc-based version though.
>>65
You can only display one screen at a time, champaroo.
Name:
F r o z e n V o i d !!mJCwdV5J0Xy2A212011-12-09 9:25
>>67
He refers to the fact the parsed DOM, text trees/ropes/lists, will have an arbitrary limit(maximum size of buffer)
and program which are static will be limited to swapping stuff in a static structure, preallocated to maximum size(i.e it would take the maximum memory a program would use, but will not grow or shrink). Here is example from windows:
Notepad makes use of a built-in window class named "EDIT". In older versions such as those included with Windows 95, Windows 98, Windows Me and Windows 3.1, there is a 64k limit on the size of the file being edited, an operating system limit of the EDIT class.
Name:
F r o z e n V o i d !!mJCwdV5J0Xy2A212011-12-09 9:32
if course proper design just swap the notepad buffer content from disk, but this is much slower than loading the entire file in memory at once.
However for 99% of cases, static structure will be faster(even in notepad since most of files are <64K).
Name:
Anonymous2011-12-09 9:50
>>69 However for 99% of cases ... most of files are <64K
However the other 1% of cases regarding large documents, database indexes/cache, multimedia content and game assets needs big chunks of memory.
Name:
F r o z e n V o i d !!mJCwdV5J0Xy2A212011-12-09 9:58
>>70
You can make the buffer 1MB, and swap 1MB chunks from disk. The limitation of 64K is arbitrary: it could be a program which allocates the 4GB at once, if you don't care about wasting this much RAM.
Name:
F r o z e n V o i d !!mJCwdV5J0Xy2A212011-12-09 10:09
The idea is is type of design is better on performance when you malloc objects much smaller than typical use case of notepad(many calls to malloc).
I don't advocate to use all the memory for your program(unless you program in DOS), i just point out that you own the memory you malloc
and can structure it as you see fit: you have complete control to write your own malloc for that 4GB to maximize performance and memory use.
Name:
Anonymous2011-12-09 10:14
>>74 Sir! Sorry sir! I don't want to spend my short life doing such duplicated work sir! But I praise your courage and strength sir!
Name:
F r o z e n V o i d !!mJCwdV5J0Xy2A212011-12-09 10:20
>>75
If performance was not a concern, like in some toy programs and test apps, i'd happily use malloc(and i use it when its convenient).
However theoretical performance of each malloc call is inferior to statically allocated arrays of bytes, this is easily noticable with many such calls, typically malloc inside a loop. When i'm optimizing an algorithm which uses malloc intensively, first thing i'll do is to remove malloc entirely, even if the static version seems more bloated.
Name:
Anonymous2011-12-09 10:29
>>76 When i'm optimizing an algorithm ... even if the static version seems more bloated. Implying you'll use whatever language that gives you the best performance, even if it seems more bloated.
You don't seem to know what readable means. IHBT. Roughly.
“If performance was not a concern, I would like to write programs with colorful crayons in fresh painted walls.” Because it's fucking EASY and FUN.
It's clear you have no experience of real complex systems. In real life GC systems beat manually managed systems all the time. What you think you could theoretically do in your hobby project is very different from what could actually be done in a real system that's too complex for you to even understand completely in any reasonable amount of time.
Name:
F r o z e n V o i d !!mJCwdV5J0Xy2A212011-12-09 10:45
>>78
Such "enterprise systems" aren't something i'll ever write or maintain, and i don't have any desire understanding megabytes of "Enterprise Code" which has the functionality of a peanut.
Name:
Anonymous2011-12-09 10:51
>>78 real complex systems >>79 “enterprise” systems
HahahahahaHAHAHA!