4 ms·
> - Waiting for Cross-Platform standardized SIMD vector datatypes which language has standardized SIMD vector datatypes ? most languages don't even have any ab
by jcelerier 6y ago
> - Waiting for Cross-Platform standardized SIMD vector datatypes
which language has standardized SIMD vector datatypes ? most languages don't even have any ability to express SIMD while in C++ I can just use Vc (https://github.com/VcDevel/Vc https://github.com/VcDevel/Vc), nsimd (https://github.com/agenium-scale/nsimd https://github.com/agenium-scale/nsimd) or one of the other ton of alternatives, and have stuff that JustWorksTM on more architectures than most languages even support
- Using nonstandard extensions, libraries or home-baked solutions to run computations in parallel on many cores or on different processors than the CPU
what are the other native languages with a standardized memory model for atomics ? and, what's the problem with using libraries ? it's not like you're going to use C# or Java's built-in threadpools if you are doing any serious work, no ? Do they even have something as easy to use as https://github.com/taskflow/taskflow https://github.com/taskflow/taskflow ?
- Debugging cross-platform code using couts, cerrs and printfs
because people never use console.log in JS or System.println in C# maybe ?
- Forced to use boost for even quite elementary operations on std::strings.
can you point to non-trivial java projects that do not use Apache Commons ? Also, the boost string algorithms are header-only so you will end up with exactly the same binaries that if it was in some std::string_algorithms namespace:
https://gcc.godbolt.org/z/43vKadbde https://gcc.godbolt.org/z/43vKadbde
- vlovich123 6y agoMost of what you said is a fair retort, but boost isn't quite as rosy as you make it seem. It's great but it has serious pitfalls which is why many C++ developers really hate it: A) Boosts supports an enormous amount of compilers & platforms. To implement this support is an enormous amount of expensive preprocessor stuff that slows down the build & makes it hard to debug. B) Boost is inordinately template heavy (often even worse than the STL). This is paid for at compile time. Some times at runtime and/or binary size if the library maintainers don't do a good job structuring their templates so that the inlined template API calls a non-templated implementation. The first C++ talk I remember talking about this problem was about 5-7 years ago & I doubt boost has been cleaned up in its wake across the board. C) Library quality is highly variable. It's all under the boost umbrella but boost networking is different from boost filesystem, different from boost string algorithms, different from boost preprocessor, boost spirit, etc. Each library has its own unique cost impact on build, run, & code size that's hard to evaluate a priori. Boost is like the STL on steroids but that has its own pitfalls that shouldn't be papered over. Maybe things will get better with modules. That's certainly the hope anyway.
- WalterBright 6y ago> which language has standardized SIMD vector datatypes ? D does: https://dlang.org/spec/simd.html https://dlang.org/spec/simd.html
- aidenn0 6y agoThat's quite well thought out; without the compile-time checks for operations existing, you end up with code either needing to target a very small subset of the operations that are widely supported or something that is not really cross-platform -- I've seen too much of the following using what is theoretically portable code because software-fallback will typically be an order of magnitude worse than using a different set of datatypes and operators #if defined(__NEON__) "portable" SIMD goes here #elif defined(__ALTIVEC__) different "portable" SIMD goes here ...
- WalterBright 6y agoThere was some discussion about what to do with vector types and operations that weren't supported by the hardware. We decided on compiler error instead of emulation, because the emulation would be terribly slow and the user may be unaware that he's getting emulation. With a compiler error, the user unambiguously knows if the SIMD hardware is being used or not.
- rbobby 6y ago> which language has standardized SIMD vector datatypes C# https://docs.microsoft.com/en-us/dotnet/standard/simd https://docs.microsoft.com/en-us/dotnet/standard/simd and https://devblogs.microsoft.com/dotnet/hardware-intrinsics-in-net-core/ https://devblogs.microsoft.com/dotnet/hardware-intrinsics-in...
- cogman10 6y ago> which language has standardized SIMD vector datatypes ? Java is getting it soonish. https://openjdk.java.net/jeps/338 https://openjdk.java.net/jeps/338 Rust has it (but it's fairly platform specific) https://doc.rust-lang.org/edition-guide/rust-2018/simd-for-faster-computing.html https://doc.rust-lang.org/edition-guide/rust-2018/simd-for-f... Dart has it https://www.dartcn.com/articles/server/simd https://www.dartcn.com/articles/server/simd Javascript has it https://01.org/node/1495 https://01.org/node/1495 It's actually a bit impressive how many languages have it at this point. > what are the other native languages with a standardized memory model for atomics Rust, C, Go? > It's not like you're going to use C# or Java's built-in threadpools if you are doing any serious work, no ? Define "serious". By most metrics JVM apps run at 1->2x the speed of C++, that's really not terribly slow for a managed language. On top of that, there are a lot of places java can outperform C++ (high heap memory allocation rates). Java's threadpools and concurrency model is, IMO, superior to C++'s. > Do they even have something as easy to use as taskflow Several internal and external libs do. Java's completable futures, kotlin's/C#'s (and several other languages) async/await. I really don't see anything special about taskflow. > can you point to non-trivial java projects that do not use Apache Commons Yes? It's a fairly dated lib at this point as the JDK has pulled in a lot of the functionality there and from guava. We've got a lot of internal apps that don't have Apache commons as a dependency. I think you are behind the times in where Java as an ecosystem is now.
- jcelerier 6y ago... I just checked your link and wouldn't say that any of these languages have SIMD more than C++ has it currently: - Java: incubation stage (how is that different from https://github.com/VcDevel/std-simd https://github.com/VcDevel/std-simd). Also Java is only getting it soonish for... amd64 and aarch64 ?? - Rust: those seem to be just the normal intrinsics which are available in every C++ compiler ? - Dart: seems to not go beyond SSE2 atm ? But it looks like the most "officially supported" of the bunch - Javascript: seems to be some intel-specific stuff which isn't available here on any of my JS environments ? * Standardized memory model - Literally false for Rust : https://doc.rust-lang.org/reference/memory-model.html https://doc.rust-lang.org/reference/memory-model.html - The C11 one directly comes from C++: https://stackoverflow.com/a/8877562/1495627 https://stackoverflow.com/a/8877562/1495627 - The Go one does not seem to support acquire-release semantics, which makes it quite removed from e.g. ARM and NVidia hardware from what I can read here ? https://golang.org/pkg/sync/atomic/ https://golang.org/pkg/sync/atomic/
- oblio 6y ago> what's the problem with using libraries? Spot the difference: C++: Conan (barely adopted), vcpkg (barely adopted), single header file libraries (!!!) Java: Maven (de facto standard), Gradle (compatible with Maven), Ivy (compatible with Maven), heck Ant (compatible with Maven). C#: Nuget.