8 ms·
Interactive C++ for Data Science
- choppaface 6y agoLovely to see Cling progress so much (see the CUDA+jupyter example on the page), but a major challenge remains: dependencies. It used to be that you had to use a forked LLVM just to use Cling, but major kudos they cleaned that up. However for large C++ projects with all sorts of compiler flags, include paths, etc, it’s still a major effort to get stuff running. An alternative strategy is to wrap your C++ stuff in a library and use pybind11 for lightweight bindings and python-based interactivity. This approach means more glue code, but python has much better data science tooling. I think Cling will see the greatest opportunity in algo tuning and multi-platform development. That’s a different kind of data science— focused more on benchmarking than consumer problems. I just wish the C++ build tool json ecosystem were friendlier.
- VHRanger 6y agoTo be fair dependency mgmt is a C++ issue in general, so it's not the cling teams fault
- choppaface 6y agoOh yeah sorry I'm not blaming cling at all. It might be easier if cling were completely baked into llvm, but obviously there's a debate to be had about that. I see today you can embed cling[1] which is a lot easier than when you had to use ROOT. Still not the simplest thing though. [1] https://cdn.rawgit.com/root-project/cling/master/www/index.html https://cdn.rawgit.com/root-project/cling/master/www/index.h... See "Embedding Cling"
- beojan 6y agoIn this case its more of an LLVM / no stable ABI issue.
- qsort 6y agoI really wish the data science/algo community weren't going in the direction of Jupyter/Notebooks. It's an atrocious experience from a development standpoint, several steps backwards from even just editing code in Windows notepad. With that said, this project looks amazing. Interactive/interpreted C/C++ would be great to have even outside of data science applications.
- stingraycharles 6y agoI think the whole selling point of notebooks is their literate style, and it being a kind of collaborative, shareable scratch pad. I’ve done so many demos and pitches of ideas with notebooks, it’s a super useful tool for story telling and reproducible tutorials. Having said this, for anything that goes even slightly in the direction of production (like some kind of model training and/or processing pipelines), you should absolutely not use it.
- qsort 6y ago> I think the whole selling point of notebooks is their literate style... I get this angle and I agree to an extent, demos/throwaway code is where they really shine, but I don't entirely buy the "literate" aspect (disclosure: I assist in some DS tasks but I'm mostly a developer, so that might skew my perspective). Knuth's WEB, love it or hate it, was at least arbitrarily and easily composable, notebooks on the other hand have hidden state and plenty of footguns even for those who are already familiar with the language. It's basically impossible to compose notebooks in any meaningful way. I think you could make the idea work (or at least work better) with a purely functional language, say Haskell, instead of Python. Purely functional semantics are more amenable to natural interpretations closer to the Notebook format than an OOP.
- stingraycharles 6y agoJust a random example I encountered the other day, take a look at this: https://github.com/huggingface/transformers/blob/master/notebooks/02-transformers.ipynb https://github.com/huggingface/transformers/blob/master/note... It’s a tutorial on how to use some NLP ML library. It’s a pretty excellent example of where this format shines, imho, and as you can see it’s absolutely literate. Btw I also identify as primarily a developer, but over the past few years been confronted with these notebooks more and more and I’ve learned to appreciate their use over time. But as with all good things, they’re sometimes overused.
- hellepardo 6y agomlpack, a C++ machine learning library, includes xeus-cling notebooks directly on their homepage: https://www.mlpack.org/ https://www.mlpack.org/ The xeus-cling work is awesome and has made it possible to do data science prototyping in C++. There are lots of other C++ notebook examples in the examples repository: https://github.com/mlpack/examples/ https://github.com/mlpack/examples/
- jgilias 6y agoOh wow! I had missed Cling completely. A REPL for quickly testing out how something works was one of the things I was missing when doing C++. Nice to know there are good developments in that direction.
- jarmitage 6y agoHere's a live coding music synth based on Cling https://github.com/nwoeanhinnogaehr/tinyspec-cling https://github.com/nwoeanhinnogaehr/tinyspec-cling I also managed to prototype interactive audio programming with http://bela.io http://bela.io with Cling https://gist.github.com/jarmitage/6e411ae8746c04d6ecbee1cbc1ebdcd4 https://gist.github.com/jarmitage/6e411ae8746c04d6ecbee1cbc1...
- xiaodai 6y agoStop trying to make C++ happen. It's like "fetch" in Mean Girls. It's never gonna catch on
- cozzyd 6y agocling is a marvel, especially compared to its predecessor, CINT, which was a crazy hack that kinda/sorta worked just well enough. I wonder how many users outside HEP there are though.
- phissenschaft 6y agoI find being able to directly evaluate code snippets via attaching to a jupyter kernel (running locally or in cloud) is one of the most important development efficiency booster.
- powerapple 6y agoNot related but this has trigger me thinking: for some reason, I really enjoy old things, and new things, but not changing things. I really like things as they are, and learn new things when needed. I don't like a static type checked python when I write a python script. if I need static type checking, I probably just use a different language. I am pretty happy to develop in Python and convert to C++ if needed for machine learning projects (maybe python interface for C++ library)
- pjmlp 6y agoGiven the progress of developer friendliness in C++, I rather use it directly if the underlying library is written anyway in C++.
- powerapple 6y agoIt is not a problem using Python as interface for C++ libraries. It is just easier to use. I don't go to C++ for its friendliness. I feel that everything are trying to be everything else. Programmers never had a problem switching to a new language when needed.
- pjmlp 6y agoSomeone has to have the thankless burden of writing the Python glue code. I consider that a problem, moreso the way JIT efforts tend to be downplayed in the community.
- dragonwriter 6y ago> Programmers never had a problem switching to a new language when needed. Sure, plenty of programmers always have, and the more financial draw there is to programming and the more people spend their career from education through work in an environment where a programmer is defined as “a JavaScript programmer” or a “.NET programmer”, etc., the more will. But, beyond that, even being comfortable with polyglot programming, it's still better when you've got what you need in one place.
- xgdgsc 6y agoGlad they fixed this issue: https://github.com/jupyter-xeus/xeus-cling/issues/91 https://github.com/jupyter-xeus/xeus-cling/issues/91 which made me stop trying years ago. I would like to try again. Have been happy using Julia since then.