News for hackers. Stuff that matters.
Re:Guide to Advanced Programming in C by sdegutis on Thursday February 06, 2014 @05:17PM (#7193302)
I like the idea behind this article, but I'm a little skeptical of some of its advice.

For instance, I don't think it's a good idea to recommend using Boehm GC as a general solution to avoid memory management. It can't really tell the difference between pointers and pointer-sized integers, which means it usually leaks memory.

Re:Guide to Advanced Programming in C by zurn on Friday February 07, 2014 @04:11AM (#7195437)
> it usually leaks memory

Citation needed.

Integers matching valid pointers to allocated objects are rare - only common on 32-bit when running near limits of virtual memory space. Which is a bad idea anyway.

Language runtimes that eventually move off Boehm, such as Mono, usually cite other reasons.

Re:Guide to Advanced Programming in C by pfacka on Thursday February 06, 2014 @05:31PM (#7193362)
I see, but could you please provide better alternative? I couldn't find anything more alive and representative than Boehm GC.
Re:Guide to Advanced Programming in C by sdegutis on Thursday February 06, 2014 @05:33PM (#7193366)
C is inherently not suitable for a GC. If you want automatic memory management, it's better to use something like Go. I'm not saying this is a bad GC library, just that I'm not sure I would recommend it for general use when writing C code.
Re:Guide to Advanced Programming in C by TheCoelacanth on Friday February 07, 2014 @03:25PM (#7198504)
So to avoid using a conservative GC, you should instead use Go, a language which also has a conservative GC.
Re:Guide to Advanced Programming in C by 616c on Thursday February 06, 2014 @06:05PM (#7193527)
This is not to troll, but Nimrod (which has been mentioned a few times on list) is a language that looks something like mainly Pascal or Python and builds C code that will be subsequently compiled with a soft-realtime garbage collector or without (it does code elimination, GC included, if you are clever). If you are nuts you can opt to force using the Boehm GC with it, but do not expect great things out of it. There is also Rust. I am sure if you spend time on HN you have heard a lot about the latter.