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

Got an Idea of GC. Please CC

Name: Anonymous 2014-05-27 0:07

Segmenting GC:
- Partition heap into N segments;
- Give each segment a bitmap, keeping what memory cells the segment references;
- After collecting a segment, compare its resulting bitmap to the original, then free now unused objects (bits that went from 1 to 0, and which also have 0 in other segments).

Pros:
- Incremental;
- Parallelizable into N threads;
- Collected memory can be distributed across N machines (share your memory accross Internet);
- Each segment could be future partitioned into subsegments, which are collectible separately.

Cons:
- Write barrier required;
- Bitmap memory is proportional to N;
- Execution time is proportional to memory_size/N.

Name: Anonymous 2014-05-27 0:14

if your hand is larger than your face

Name: Anonymous 2014-05-27 0:18

Cons:
- Resolving cross-segment circular references would require compacting/collapsing cross-referenced data into single segment (which one has more references to the other).

Pros:
- GC implementation will be forced to do compaction and memory defragmentation (especially useful with shared memory residing across several machines).

Name: Got an Idea of GC. 2014-05-27 0:59

It's shit.

Name: Anonymous 2014-05-27 1:35

>>1
- Parallelizable into N threads;
Shared-nothing parallelism then?

Name: Anonymous 2014-05-27 1:59

>>5

Shared nothing greatly complicates IPC.

I really want to solve the GC problem once and for all, because I lost my last job due to it.

Name: Anonymous 2014-05-27 2:00

>>6
See >>4

Name: Anonymous 2014-05-27 2:29

>>6
The GC problem is solved by not using GC,

Name: Anonymous 2014-05-27 3:13

>>6
Shared-nothing greatly simplifies IPC for the user at least. It tends to be slower, but it's not that bad. You can use an ARC¹ for your shared objects need.
[1] http://doc.rust-lang.org/0.10/sync/struct.Arc.html

Maybe check out LVars. I don't know what a good collector would look like with LVars or if its even helpful, but at least determinism would be enforced. I suppose the resulting lattice would be huge.

>>8 is being a shit, but Rust would allow you to avoid GC most of the time without abandoning it entirely. You also don't do manual memory management the way you normally would. The extent to which you have to write lifetime annotations is fairly small, and when you do they're checked for correctness.

Name: Anonymous 2014-05-27 3:33

>>9

Shared-nothing greatly simplifies IPC for the user at least.
Nope. You have to serialize-deserialize objects and you still have GC problem.

Name: Anonymous 2014-05-27 3:35

>>9

rust-lang.org
That is one ugly C clone. Even Go looks better.

Name: Anonymous 2014-05-27 4:31

>>10
In basically all of the languages with shared-nothing, serialization is automatic. In Rust the required trait can be derived by the compiler.

>>11
It's ugly, and will remain that way until/unless higher-kinded types arrive. That's probably not going to make it pretty for you, but it will for me. Go could be pretty as you like and it wouldn't help; it's not typesafe.

Rust isn't a C clone. It's more of a sweet spot between ML and C++.

Name: Anonymous 2014-05-27 5:46

>>12

It's more of a sweet spot between ML and C++.
ML had a lot more elegant syntax.

Name: Anonymous 2014-05-27 5:53

>>13

ML has Python level shit syntax.

Name: Anonymous 2014-05-27 6:04

>>13
Yeah :(

Rust has to appeal to C++ programmers, hence the "less worse than C++" syntax. ML programmers don't need it, they can just use Haskell or whatever if they want the hottest shit.

>>14
Keep trying different combinations, eventually someone will get offended.

Name: Anonymous 2014-05-27 6:49

>>15

And C/C++ programmers don't need ML, because people code C/C++ exclusively for money and nobody would pay you for coding Rust.

Name: Anonymous 2014-05-27 6:53

>>16
code
coding
Program*
Programming*

Name: Anonymous 2014-05-27 7:46

>>16
I've already been paid to write Rust. Only a few dozen people are being paid to write it today but it isn't even 1.0 yet. In 2-3 years we can talk about how well Rust is doing. It should see 1.0 later this year.

Name: Anonymous 2014-05-27 10:06

GC

Pros
- It allows idiots and retards to do programming

Cons
- It's shit
- Idiots and retards can now be your coworkers

Name: Anonymous 2014-05-27 11:17

>>19
Fuck off.

Name: Anonymous 2014-05-27 18:04

>>8

Employer wants JavaScript, C# and Java, force the use of GC.

Name: Anonymous 2014-05-27 18:37

I dedicate these dubs to all the retards and idiots of /prog/

Name: Anonymous 2014-05-27 22:46

>>22
Thank you

Name: Anonymous 2014-05-28 9:41

TCO:

Pros
- Enables retards to write obfuscated spagetti code instead of using structured loop constructs

Cons
- it's shit
- It's basically GOTO
- Enables retards to write obfuscated spagetti code instead of using structured loop constructs

Name: Anonymous 2014-05-28 9:45

>>24
People usually only use it for state machines and simple recursive functions.

I don't use loop constructs for anything when I can help it, thanks to map, reduce, select, etc.

Name: Anonymous 2014-05-28 10:30

>>25
but those are loop constructs

Name: Anonymous 2014-05-28 11:37

>>26
let rec map f = function
| [] -> []
| x::xs -> f x :: map f xs


What loop constructs?

Name: Anonymous 2014-05-28 13:16

>>27
map iterates over the elements of a list, that's a loop construct, dolt.

Name: Anonymous 2014-05-28 17:10

>>28
recursion is a loop construct

Name: Anonymous 2014-05-28 18:05

>>27
That's just syntatic sugar for


map:
push r13
push r14
push r15
call new_list
mov r13, rax
mov r14, rdi
mov r15, rsi
call len
mov rcx, rax
iterate_elems:
mov rdi, r14
mov rsi, rcx
call get_elem
mov rdi, rax
push rcx
call [r15]
pop rcx
mov rdi, r13
mov rsi, rcx
mov rdx, rax
push rcx
call set_elem
pop rcx
loop iterate_elems
mov rax, r13
pop r13
pop r14
pop r15
ret


As you can clearly see, there is a loop here (the `loop` instruction).

Name: Anonymous 2014-05-28 18:49

>>24

structured loops are too verbose. I'm always wrapping them inside of a macros like

#define map(X,Xs,Body) ({ \
__typeof__(Xs) GENSYM(_map_Xs) = (Xs); \
__typeof__(GENSYM(_map_Xs)[0]) X; \
__typeof__(({Body;})) GENSYM(_map_Y); \
QVector<__typeof__(GENSYM(_map_Y))> GENSYM(_map_Ys); \
int GENSYM(_map_K); \
for(GENSYM(_map_K)=0; GENSYM(_map_K)<GENSYM(_map_Xs).size(); GENSYM(_map_K)++) { \
X = GENSYM(_map_Xs)[GENSYM(_map_K)]; \
GENSYM(_map_Ys).append(({Body;})); \
} \
GENSYM(_map_Ys); \
})

Name: Anonymous 2014-05-28 20:33

>>30
wtf this isn`t assembly class go back to 1980 LOL we have real languages now, high level ones, not that you`d be able to recognize one when you see it you assembler robot

Name: Anonymous 2014-05-28 21:51

>>32
Assembly will be relevant as long as machine code exists.

Name: Anonymous 2014-05-28 22:01

>>33
machine code

you mena JavaScript?

Name: Anonymous 2014-05-28 22:13

>>34
Architectures are not yet javascript interpreters.

Name: Anonymous 2014-05-28 22:18

>>29
>>24 doesn't think so.

Name: Anonymous 2014-05-28 22:58

>>32-kun never wrote a C compiler when he was 12.

Also, does javashit even have bytecode?

Name: Anonymous 2014-05-29 0:11

>>37

Also, does javashit even have bytecode?
JIT compiled to x86. Have statically typed subset, which is fast.

Name: Anonymous 2014-05-29 4:35

>>38

Except then the GC kicks in.

And the word just pauses.

GC is shit.

Name: That feel when no deaf qt gf 2014-05-29 4:37

>>39
tfw no pauseless GC
tfw GC defenders keep saying it can be done but refuse to tell you what GC algorithm works for this, they just try to intimidate you away from asking more by saying you have a lot to learn

GC fags are the worst: intellectually dishonest liars.

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