TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

ICPP – Run C++ anywhere like a script

83 pointsby davikr10 months ago

7 comments

bsenftner9 months ago
Why interpret at all? Back in the mid to early 90&#x27;s I started embedding C++ compilers into the game engines I wrote, where the &quot;game scripting language&quot; was just #define macros hiding the C++ syntax so the game level developers, who worked in this script, could be basically anyone that could code. Their &quot;script&quot; would compile to a DLL that was hot loaded. What they were doing in their scripts would compile in under 5 seconds, and they were good to go. If they ran into problems, one of the game engine developers would just run their &quot;script&quot; in the IDE debugger.<p>Borrowed this idea from Nothing Real, the developers of Shake, the video&#x2F;film compositing system.
评论 #41194304 未加载
评论 #41191279 未加载
评论 #41192088 未加载
评论 #41191254 未加载
mindblah9 months ago
Folks who like this kind of thing should definitely check out CERN&#x27;s Root framework. I&#x27;ve been using its C++ interpreter in a Jupyter notebook environment to learn C++. It&#x27;s probably also quite a bit more mature than this project. <a href="https:&#x2F;&#x2F;root.cern&#x2F;" rel="nofollow">https:&#x2F;&#x2F;root.cern&#x2F;</a>
评论 #41197973 未加载
Jeaye9 months ago
Along the lines of scripting is interactive programming. I&#x27;m working on a native Clojure dialect on LLVM with C++ interop, qalled jank. It can JIT compile C++ code, can be embedded into any C++-compatible application, and is a full Clojure dialect which doesn&#x27;t hid any of its C++ runtinme. So you can do inline C++, compile C++ sources alongside your jank. and require them like a normal Clojure namespace. Worth a look if you&#x27;re using C++ but you&#x27;re craving something more interactive. <a href="https:&#x2F;&#x2F;jank-lang.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;jank-lang.org&#x2F;</a>
bobajeff9 months ago
I wonder if I can use this to learn a large c++ codebase like Chromium. One of the issues I had trying to learn chromium was that in order to play and experiment with their classes&#x2F;functions I needed to spend several minutes to link my little test code with their static libraries just to be able to see if my understanding of them was correct. Which is just too long of time for such experiments so I gave up.
评论 #41193119 未加载
评论 #41194359 未加载
celrod9 months ago
How feasible would it be for something like gdb to be able to use a C++ interpreter (whether icpp, or even a souped up `constexpr` interpreter from the compiler) to help with &quot;optimized out&quot; functions?<p>gdb also doesn&#x27;t handle overloaded functions well, e.g. `x[i]`.
评论 #41194270 未加载
评论 #41191521 未加载
评论 #41193810 未加载
ranger_danger9 months ago
This is really cool...<p><a href="https:&#x2F;&#x2F;github.com&#x2F;vpand&#x2F;icpp-qt">https:&#x2F;&#x2F;github.com&#x2F;vpand&#x2F;icpp-qt</a><p>Ok <i>now</i> things are getting interesting. I think this could be used to add easily shareable&#x2F;hackable plugins to existing C++ projects.
评论 #41194752 未加载
Klasiaster9 months ago
Related is cargo script for Rust: <a href="https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;cargo&#x2F;reference&#x2F;unstable.html#script" rel="nofollow">https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;cargo&#x2F;reference&#x2F;unstable.html#scri...</a> (nightly only)
评论 #41194343 未加载