Hacker News new | ask | show | jobs
by jvanderbot 1298 days ago
I would love to see a world in which a system is designed and built from multiple languages, so that the "right" tool could be used for each part. Does this even make sense? The modern distributed web seems to be leading us there. Slowly, slowly.

I would also love to see a world where all C, C++ dependencies magically port themselves to Rust without FFI or a first-cut rewrite that a hobbyist did. 10-20 years maybe?

Unless:

> One of the concerns is that C and C++ are being discouraged for new projects by several branches of the US government[1], which makes memory safety important to address.

Reading these posts really does make it seem like C and C++ are a derided, ancient construct of better days when we trusted software engineers and didn't write code for connected systems. It's just not possible to go back to those times.

While I'm extremely interested in Rust, the ecosystem for my entire industry is based on C++ with no change in sight, and built on C operating systems. Because, to date, we write code that executes on a machine that is not taking input from a user, and so does not have the brand of security concerns that make Rust attractive (for the most part). Here, static analyzers get us what we need at the 80/20 level.

1. https://media.defense.gov/2022/Nov/10/2003112742/-1/-1/0/CSI...

4 comments

It only makes things slighly better, but Windows, Android, macOS, iOS, mbed, and plenty of others have enough C++ into them, even in kernel space.

And yes, it will either take decades to purge IT ecosystems from them, or they finally get some #pragma enable-bounds-checking, #pragma no-implicit-conversions (yes there are compiler specific ways to get things like this), and similar, so that they can stay in the game of safe computing.

I shall preface this with that I'm a beginner at C++.

I really like your idea of building a language from multiple parts.

Or multiple DSLs.

Maybe you could have a DSL for scheduling the code, a DSL for memory management and a DSL for multithreading. A DSL for security or access control And the program is weaved together with those policies.

One of my ideas lately would be how to bootstrap a language fast. The most popular languages are multi paradigm languages. What if the standard library could be written with an Interface Description Language and ported and inherited by any language by interoperability

Could you transpile a language's standard library to another language? You would need to implement the low level functionality that the standard library uses for compatibility.

I started writing my own multithreaded interpreter and compiler that targets its own imaginary assembly language.

https://GitHub.com/samsquire/multiversion-concurrency-contro...

I like Python's standard library, it works

I feel I really enjoy Java's standard library for data structures and threading.

Regarding the article, I hope they resolve coroutines completely. I want to use them with threads similar to an Nginx/nodejs event loop.

I tried to get the C++ coroutine code on GCC 10.3.1 working from this answer to my Stackoverflow post but I couldn't get it to compile. I get co_return cannot turn int into int&&.

https://stackoverflow.com/questions/74520133/how-can-i-pass-...

>"I would also love to see a world where all C, C++ dependencies magically port themselves to Rust without FFI or a first-cut rewrite that a hobbyist did. 10-20 years maybe?"

10-20 years sound as a pipe dream.

I've been dreaming about idiomatic interop for a while but by definition it's out of scope for any given language