Lightning Talk: Write Valid C++ and Python in One File - Roth Michaels - CppCon 2023
Vložit
- čas přidán 18. 04. 2024
- cppcon.org/
---
Lightning Talk: Write Valid C++ and Python in One File - Roth Michaels - CppCon 2023
github.com/CppCon/CppCon2023
A demo of a neat/horrifying hack to use the preprocessor to define a constants file that can be consumed by C++ and Python.
---
Roth Michaels
Roth Michaels is a Principal Software Engineer at Native Instruments, an industry leader in real-time audio software for music production and broadcast/film post-production. In his current role he is involved with software architecture and bringing together three merged engineering organizations and legacy codebases: Brainworx, iZotope, and Native Instruments. He also supports the Audio Research team to help accelerate moving research to productization and developing fast prototyping tools for product teams. Before merging with Native Instruments, when he joined iZotope, Roth was the lead library designer of a new internal cross-platform "Glass", part of which is now available as open-source. More recently in his former role as Mix/Master Software Architect, Roth helped develop the reference implementation to move iZotope's products to subscription and led the team that launched the company’s first SaaS offering for music producers. Roth studied music composition at Brandeis University and continued his studies in the Dartmouth Digital Musics program. Roth began his career in software development writing software for his own compositions, and the works of other composers and artists, and teaching MaxMSP to composers and musicians; both private instruction and designing university courses. Before joining iZotope, he was working as a consultant for small startups working on mobile applications specializing in location services and Bluetooth.
---
Videos Filmed & Edited by Bash Films: www.BashFilms.com
CZcams Channel Managed by Digital Medium Ltd: events.digital-medium.co.uk
---
Registration for CppCon: cppcon.org/registration/
#cppcon #cppprogramming #cpp #pythonprogramming - Věda a technologie
this looks like the kind of "temporary workaround" solution you find in your project and git blame will date it like 6 years back, truly beautiful
I like it. I feel this is exactly why C had the preprocessor in the first place, and they limit it to one file so it doesn't get out of hand. 👍
This is pretty clever. Personally, I would create a tiny python binding with a function to return the version number, and let c++ be the source of truth.
The preprocessor just keeps on giving!
That was genius!!!
clever. the same logic can be used in cmake as well. thanks for idea
horrible (i love it)
lol wtf this is genius, we need to implement this for the entire language
hilarious 🤣🤣🤣
ever heard of JSON?
Just because you can doesn't mean you should
Sadly I have an experience working with code that used this approach. It was some serialization code, and it was not pretty.
It my seem cool, but it is disgusting.
Correct way? Brace yourself, write a generator which takes JSON or something and outputs normal C++ and python files.
disgusting😂