8 ms·
I have a request. Somebody needs to make matplotlib, but with a C API and lots of language bindings instead of only a python API. For example when I'm writing r
by whatshisface 7y ago
I have a request. Somebody needs to make matplotlib, but with a C API and lots of language bindings instead of only a python API. For example when I'm writing rust, my best option is to use a Python interop library that calls matplotlib...
- GeorgeTirebiter 7y agoMatplotlib is better than nothing, but... as I understand it, it was inspired by Matlab's plotting - and therefore is a bit quirky when translated to the Python paradigm. I use it tho. I think having a built-in web server via a visualization library that shows the graphs etc in a browser is 'optimal' -- because then, the whole crap of e.g. dealing with Tkinter to make your windows goes away. You achieve OS independence, and could even use lynx for text-only. The Python visualization space is vast. I believe 'something better' will shake out in the next few years.
- whatshisface 7y agoLocking it down to the web platform is IMO too restrictive - if it was instead a low-level library you could access it anywhere, including the browser (if you wrote the server on top of the library). Sometimes, you want to use GtK, for example if you want lightning quick startup times, or weird portability, or anything else like that.
- sitkack 7y agoProbably not what you want to hear, but putting a matplotlib REST service inside of a container would be a pretty good start. Apps can talk over a local IP, the interface should be usable from curl.
- whatshisface 7y agoThat's really close to how gnuplot is used.
- sitkack 7y agoUnix pipelines are the REST services of 1978.
- deleted 7y ago[deleted]
- randomsearch 7y agoOh god yes how did I forget. Bury Matplotlib forever, please, someone, for the love of science.
- H8crilA 7y agoPython is kind of the gold standard in many areas of research, no? Why would you use Rust, or even anything but Python? I'd only touch Rust (or C/C++) when I need to implement some fast numerical computation that does not already exist in Numpy or Tensorflow, but still call it from Python.
- whatshisface 7y agoPeople who mostly do that weird numeric stuff find themselves wishing they could be free from that python interop, for example when 99% of your code is unique rust and at the end all you want is a graph. Another use case is when you want to write an application like ImageJ, to be used by (not necessarily computer-y) scientists other than yourself, where you want fast startup times and all-around good performance. Being able to do away with the python interop won't shatter the Earth but it would be nice. Besides, I love Python, everybody loves Python, but it's not the final end state of programming language evolution (isn't Haskell? ;).
- gpm 7y agoI've sped up a simulation 100 fold by porting a 20 line function to rust (which had a terrible access pattern for numpy), and could probably sped it up another 10 (which was closer to reasonable for numpy). If the thing could have been written in rust in the first place, tons of time would have been saved on trying to optimize python, waiting for simulations to complete before (and to a lesser extent after) I ported a portion of it to rust. Dealing with language interop and build systems. The main reason I can't suggest that for future similar problems to the person who I did this for is because of the lack of libraries like plotting (plotting is by far the most important one, numpy is second but rust comes a lot closer in that regard).
- ChrisFoster 7y agoHave you seen https://github.com/sciapp/gr https://github.com/sciapp/gr ?
- deleted 7y ago[deleted]