I figure closures would be hard to do in a programmer-friendly way without GC.
How to design a replacement for C++
21–30 of 75 posts
Re: How to design a replacement for C++
#22http://www.tiobe.com/index.php/content/paperinfo/tpci/index....
Outstanding.
Re: How to design a replacement for C++
#23"(Talking about C++ macro) [...] Well fuck you. If you take it out, I can't #include stdio.h, and I can't implement awesome assert-like macros. End of discussion." This statement is simply wrong, and saying "End of discussion" is useless, if not plain stupid. It's like saying: 1+1 = 3, End of discussion.
I honestly can't begin to contemplate how you expect stdio.h to work (without writing extra wrappers) if you don't support macros and a preprocessor. Some of the "functions" in there are macros.
You can import C headers without your language being a superset of C.
Re: How to design a replacement for C++
#24Written by Mozilla employees, and very much like Go, except that shared state is immutable by default, no global GC, and no null pointers. It does have fine struct layout control, RAII always, and type-parametric user code (purely structural too!).
It does have a real module system for grownups, which even if it doesn't preclude your fetish for #include, it will at least make you feel bad about it.
Re: How to design a replacement for C++
#25An immediate issue with the article: the author takes issue with the liberal attitude taken by C++ in adding features and then proceeds to state: Maybe you like [lambdas], maybe you don't, maybe you think they're God's gift to programming and any language without them is an infidel. But adding them would be harmless, anyway. Well I agree on this point, it seems like a poor argument. You can't just declare a feature h…
If your language isn't completely terrible, then you can choose to use a named function anywhere an anonymous function will do. The libraries can never force you to not give your functions a name or not put them in a global context. That's why it's a harmless feature. Templates might have been harmless if there was a way to do basic obvious stuff (callback functions, strings) without using them.
Re: How to design a replacement for C++
#26Thank you. I am not looking forward to the day when people begin to advocate Java or something like that for these applications, and I am glad to see this explicitly acknowledged.
Re: How to design a replacement for C++
#27Re: How to design a replacement for C++
#28Re: How to design a replacement for C++
#29I figure closures would be hard to do in a programmer-friendly way without GC.
closure int foo(int x) {return x + y;}
int(*foo_p)(int) = malloc(sizeof(foo));
memcpy(foo_p,&foo,sizeof(foo));
return foo_p;
So, you can add working closures in one keyword (and possibly a special case for function pointer decay).Re: How to design a replacement for C++
#30Earlier quoted context omitted.
I honestly can't begin to contemplate how you expect stdio.h to work (without writing extra wrappers) if you don't support macros and a preprocessor. Some of the "functions" in there are macros.
import_c You can import C headers without your language being a superset of C.