2 ms·
Given that this seems to be a transpiler, why go to C++ instead of C? What feature of C++ does this need that is so compelling as to cut it off from use on str
by bsder 8y ago
Given that this seems to be a transpiler, why go to C++ instead of C?
What feature of C++ does this need that is so compelling as to cut it off from use on straight C?
- m1n1 8y agoMaybe that's a solved problem so that was outside the scope/focus? https://isocpp.org/wiki/faq/compiler-dependencies#convert-to-c https://isocpp.org/wiki/faq/compiler-dependencies#convert-to...
- nakkaya 8y agoIf I were to go with C I would have to reimplement OOP machinery required for an object system. OOP also makes memory management a non issue. Functions are first class citizens in Lisp so functors/lambdas makes it real easy to create closures. std::atomic combined with Clojure semantics makes sure there no race conditions. std::thread / std::future makes multi threaded programming much easier. Templates help with picking and choosing which components to include (i.e there are multiple memory managers to pick from.). etc. etc. Non of the above is essential and can be done in C but why bother, GCC/LLVM people are much better at this then I can be including platform specific tricks for different architectures. Modern C++ is very close to Lisp after all it only takes 6 passes over the Clojure code to generate C++ code. (Compiler makes more than 6 passes but others are for optimization.)