How to write C++ replacement
There are several programming languages that are “better C/C++”: zig, odin, jai, D.
The problem is adoption: it’s hard to break from all the code already written in C/C++.
It’s too expensive to rewrite large code bases in new language.
My idea on how to improve adoption: perfect integration into C/C++ ecosystem.
It should be possible to call C/C++ code from new language. That mostly works in those languages, although typically not as easily as it could be.
It should also be possible to integrate the other way: to e.g. add just one .zig file to C code base and be able to call zig functions from C.
This would require some code generation i.e. generating .h files with C declarations for zig code and compiling .zig code to C-compatible object files.
That would allow incremental adoption and incremental porting of C to new language. It would still be difficult and time consuming but at it wouldn’t require cost-prohibitive porting of everything at once.
activity
- SumatraPDF : use temporary allocator few more times
- blog: writing more posts
- I want to make a very fast viewer for git history. A list of checkins, searchable by subject, extended commit message, file, author, a fast diff, keyboard navigable. Today was a small start: wrote a Go parser for output of
git log
, assisted by AI
- Edna is a fork of Heynote and they did a lot of work since I’ve forked it. So I spent several hours porting changes using dual strategy. I’m looking at their checkins and porting the changes that interest me. Or I use winmerge to diff the codebases and merge changes. I’m trying to minimize diffs between repos even though I would have done some things differently. There’s a limit to that given they use Vue and I ported those to Svelte.