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

Pages: 1-

Bored

Name: Anonymous 2012-07-24 23:15

I'm incredibly bored, so I thought I'd write 2 probably incredibly bad ideas.

1. Indentation instead of braces
2. For memory management, we use either a manual memory management, or a garbage collector. But what if instead, we used both? Having the compiler determine if some data should be allocated using alloca, malloc, an object cache, arena allocator, etc, and if it should be freed using deference, deletion, refcounter, or garbage collection, and if garbage collection, to create mutexes for "entry points" for which to search from. Then have GCs run in their own threads while the other stuff in running.

I can think of more bad ideas too.

Name: Anonymous 2012-07-24 23:17

3. To have the compiler detect bufferoverflows by assigning at each point in the program, a "max" value to each int etc, and a "min" value, then warn if "max" for the int at various position, is over the buffer's min size etc.

Name: Anonymous 2012-07-24 23:30

>>1-2
1. Both are necessary.  Imposing either leads to unusable syntactic diarrhoea (just look at Python and Lisp).
2. Compilers (especially JIT compilers) will generate manual allocations and frees if possible.
3. Buffer overflows are a language flaw for anything other than assembly.

Name: Anonymous 2012-07-24 23:34

4. Everything which isn't I/O should be precalculated by the compiler.

>>3
3. But, although many languages stop bufferoverflows, they usually use runtime checking, not compile time. Actually, I'm not aware of any languages with compile time buffer checking. Are there any?

Name: Anonymous 2012-07-24 23:45

Call it Python

Name: Anonymous 2012-07-24 23:59

>>3
will generate manual allocations and frees if possible.
That's wrong, probably they will use the stack, but malloc and free are slower than a good garbage collector.

Name: Anonymous 2012-07-25 0:03

>>6
That's wrong, probably they will use the stack
Right, sorry, that's what I meant.

malloc and free are slower than a good garbage collector.
Maybe less space efficient due to fragmentation, but slower?  Come on.

Name: Anonymous 2012-07-25 1:01

malloc and free are slower than a good garbage collector.
How do you expect to implement a garbage collector without malloc and free?

Name: Anonymous 2012-07-25 1:06

>>7
It's probably more space efficient, actually, but it is slower.
I'm assuming a generational copying GC. Allocation is as free as stack allocation (bump a pointer) and deallocation is O(alive), but you need 2 times or so the size of your heaps of space.
Allocation with malloc is expensive, deallocation is O(dead), but the space needed is just the size of the heap.

Name: Anonymous 2012-07-25 1:06

>>8
Really, really carefully.

Name: Anonymous 2012-07-25 4:02

>>8
subleq

Name: Anonymous 2012-07-25 4:07

qUICK asm question!! can i use the rep prefix before a funtcion to call it repeatedly?

Name: Anonymous 2012-07-25 4:18

x86 architecture is crap.

ALL HAIL THE LISP MACHINE

Name: Anonymous 2012-07-25 4:20

>>12
hOW about you tyr!!

Name: Anonymous 2012-07-25 13:03

>>12
No.

Name: Anonymous 2012-07-25 18:41

>>12
No, because x86 is ``non-orthogonal''.

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