5 ms·
> It's diffeq solvers will almost certainly be worse than Julia (Julia is SOTA there) Worse in what sense? Speed? Almost certainly not, since you would be impl
by melissalobos 4y ago
> It's diffeq solvers will almost certainly be worse than Julia (Julia is SOTA there)
Worse in what sense? Speed? Almost certainly not, since you would be implementing the solution directly in C++, so it will be as fast as you need(since you can use inline ASM). In Julia the really good diffeq libraries are not built in and this is not a diffeq solving library, so you would have to implement them yourself if you were just using this(so you can use almost exactly the same algorithms, and with more control over memory management in C++ you can maybe have it be a bit faster).
- pjmlp 4y agoI also imagine that with C++17 or higher tooling, alongside something like CINT, it starts to feel quite productive.
- adgjlsfhk1 4y agoHave you seen DifferentialEquations.jl? It's an incredibly fast suite of solvers that pretty consistently is faster than Sundials/CVODE/lsoda or any of the other C++ solver. (for a bunch of benchmarks vs pretty much everything else, see https://github.com/SciML/SciMLBenchmarks.jl https://github.com/SciML/SciMLBenchmarks.jl)
- melissalobos 4y agoIndeed, that particular implementation is very fast. One of the goals of the C++ language is to leave no space for a lower level language than C++. A motivated person could just re-implement those algorithms in C++, in the absolute worst case using inline Assembly and at the very worst exactly match their performance. One of the nice things about Julia is you get good performance without going through a huge amount of effort. However you could always do as good or better in C++(with maybe more effort).
- adgjlsfhk1 4y agoJulia is pretty much the same but a few levels higher. Julia gives you some really powerful tools like @code_native (basically godbolt), inline assembly (or @code_llvm) something that , powerful macros, and better code reuse. If you look at the size of Julia libraries compared to similar C++ alternatives, the Julia ones are often about as fast (or faster), but typically around 10x less code. (my favorite example is that Julia's reader for Arrow files is more complete than the C++ one while being smaller than the makefiles for the C++ one (https://twitter.com/MoseGiordano/status/1489255661728796679 https://twitter.com/MoseGiordano/status/1489255661728796679)