4 ms·
Have you considered D? It's pretty much supposed to be a successor to C++ and has GC (can be turned off) and is compiled as well. I feel like I'm writing compil
by giancarlostoro 11y ago
Have you considered D? It's pretty much supposed to be a successor to C++ and has GC (can be turned off) and is compiled as well. I feel like I'm writing compiled Java when I code in D if that gives you a nicer perspective of D.
- meddlepal 11y agoWhat is the tooling and library ecosystem like for D compared to Java?
- giancarlostoro 11y agoThere's a Visual Studio plugin available, and I know VS Code has a nice plugin as well ( you need to install certain tools yourself in that case ), as well as other editors with their own feature set. There is also Dub[0] which is a build tool for D and gives you access to all sorts of D packages. I'm still a beginner to D so forgive me if my answer doesn't suffice. [0]: https://code.dlang.org/getting_started https://code.dlang.org/getting_started
- Ace17 11y agoD programs can make direct (=zero overhead) calls to C functions (like we do in C++). Which basically means you have access to any C library. The D standard library is very dense (it makes C++14 standard library look ridiculously incomplete), so most things are available out of the box (threads, processes, filesystem, network, random, algorithms) ... in a portable way.
- dikaiosune 11y agoAFAIK, turning off GC in D is not feasible whenever using large portions of the standard library, but there were efforts underway to change that. Do you know if there's been much progress?
- atilaneves 11y agoLots of progress, but there's still work to do. If the GC is unacceptable for your application, slap `@nogc` on your `main` function and you're guaranteed to not use it.
- levemi 11y agoI'm writing OpenGL code. I know lots of languages claim support for OpenGL, but in my opinion dealing with gpu stuff is something best written in C or C++. All the guides, all the answers to questions, all the popular books, everything out there assumes you're using C or C++ when you're working with GPU code. It's fine. I like using C++ for this. OpenGL in any other language and you're a second class citizen at best.
- giancarlostoro 11y agoD much like C++ interfaces to C see: https://dlang.org/spec/interfaceToC.html https://dlang.org/spec/interfaceToC.html D was at one point a C++ compiler but Walter Bright decided to break backward compatibility with C syntactically to allow the language to evolve in ways that C restricts, while still allowing it to interface with C. Sorry if I worded this poorly, but you may want to reconsider D and see for yourself if it feels like a second class citizen or what? There are sample projects interfacing to C projects (LuaD comes to mind).
- hauleth 11y agoHave you tried https://github.com/tomaka/glium https://github.com/tomaka/glium?
- douche 11y agoI first heard about D from Gamedev.net, so you can certainly do OpenGL with it. I believe there have even been commercial games written in D.
- david-given 11y agoKenta Cho's shooter _Torus Trooper_ is written in D and might make a good example. (It's a damn good game, too.) https://www.youtube.com/watch?v=PJMTQmqxBqg https://www.youtube.com/watch?v=PJMTQmqxBqg http://www.asahi-net.or.jp/~cs8k-cyu/windows/tt_e.html http://www.asahi-net.or.jp/~cs8k-cyu/windows/tt_e.html Also, ported to Linux: http://www.emhsoft.com/ttrooper/ http://www.emhsoft.com/ttrooper/