3 ms·
I’ve always liked the idea of Ada, but never had a place to use it. Though someone on HN pointed out that NVidia was using Spark for secure code sections. Quite
by elcritch 7y ago
I’ve always liked the idea of Ada, but never had a place to use it. Though someone on HN pointed out that NVidia was using Spark for secure code sections. Quite interesting!
Personally while D seems a great tool, I really keep running into situations where a language that lives on top of C/C++ is useful. So I’ve been trying out Nim for those use case, using the ARC GC which appears to work well for embedded. It’s deterministic but with move semantics for performance optimization. Interesting approach IMHO. But the biggest advantage is being able to directly interface with any C or C++ natively. D/Rust both seem to have difficulty being 100% onboard with C++ (for good reasons).
- pjmlp 7y agoMost likely me, or not. In any case here are the latest news on the subject, "GTC 2020: Exterminating Buffer Overflows and Other Embarrassing Vulnerabilities with SPARK Ada on Tegra" https://developer.nvidia.com/gtc/2020/video/s21122-vid https://developer.nvidia.com/gtc/2020/video/s21122-vid Another well know project that is now adopting Ada/SPARK is GenodeOS, https://genode.org/about/road-map https://genode.org/about/road-map
- e12e 7y ago> I really keep running into situations where a language that lives on top of C/C++ is useful. > the biggest advantage is being able to directly interface with any C or C++ natively. D/Rust both seem to have difficulty being 100% onboard with C++ I thought one of the centerpieces of D was seamless c++ interop? Where does it fall down?
- VHRanger 7y agoYou just need to do a bit of tiresome explicit declarations to statically link the code. For libraries with a large API that can be an annoyance.
- e12e 7y agoSo, more than for using c++ with c++ -- in your build/link setup?
- elcritch 7y agoAFAICT, D requires the C++ types be exported, included any predefined template objects or functions. E.g. you can’t dynamically wrap `std::map<K,V>`, unless it’s already been instantiated in C++ library you’re linking. The same in Rust as well. See D Lang manual: Note that all instantiations used in D code must be provided by linking to C++ object code or shared libraries containing the instantiations. Whereas Nim is one of the few languageS that can dynamically wrap C++ template types into its type system. Maybe Zig can do it too? See Nim manual [2]. type StdMap {.importcpp: "std::map", header: "<map>".}[K, V] = object proc ... var x: StdMap[cint, cdouble] x[6] = 91.4 ... std::map<int, double> x; x[6] = 91.4; This makes it nice to wrap C++ libraries. :-) 1: https://dlang.org/spec/cpp_interface.html#cpp-templates https://dlang.org/spec/cpp_interface.html#cpp-templates 2: https://nim-lang.org/docs/manual.html#importcpp-pragma-importcpp-for-objects https://nim-lang.org/docs/manual.html#importcpp-pragma-impor...