99 karma · joined Jan 3, 2018 (8y ago) · 67 submissions
comment 1y ago · link · parent
But how those languages still need to carry around some runtime of their own, and I don't think it's obvious how much a given language will benefit.
comment 1y ago · link · parent
At this point, I don't think it matters if the V programming language has actually fixed all of those issues and its marketing is completely truthful now. The language's perception is tainted, and it'll take a herculean effort to fix that.
comment 1y ago · link · parent
None of this is Linux's fault. I'd argue this is both C's and GNU's fault. The need for a copy of the library, seems to be just a tooling convention. GCC's linker requires it, so others do the same thing. The executable itself doesn't need to know where a given symbol is in a shared library's memory at runtime (or even what shared library a symbol comes from, just that it's inside one of the libraries declared as needed in its dynamic section), because that's the (runtime) linker's job to figure out. Regardless, you don't actually need a full copy of the library—a stub will suffice.
I don't know a ton about compilers, but as far as I know, there's no reason clang's linker (LLD) couldn't just not require an existing copy of the shared library you're linking to. Can't do anything about requiring a version of the libc headers you need for every platform though.
comment 1y ago · link · parent
For Zig users, adopting this same mindset for Io is not really anything new. It's just another parameter that occasionally needs to be passed into an API.
comment 1y ago · link · parent
comment 2y ago · link · parent
[0]: https://ziglang.org/documentation/master/std/#std.os.linux
comment 2y ago · link · parent
Given the whole ecosystem is built around the Allocator interface, it's entirely feasible for the consumer of a library to pass in a Garbage Collecting allocator, and let it do the job of deciding what gets dropped or not.
Downside is that this is all at runtime, and you don't get the compile-time memory management that Rust has.
comment 2y ago · link · parent
Zig hasn't ditched LLVM, nor does it really plan to. What's planned is for the main Zig executable to not directly depend on LLVM, that way contributors to the compiler can still develop on the code base without needing to set up and compile LLVM on their systems. Zig does plan to eventually supersede LLVM's functions with their own custom backends, but in the short term, this only means using the new backend as a debug compiler (for faster compilations, to allow for a better developer feedback loop) and it won't be until the distant future that LLVM could feasibly be dropped as a dependency entirely, if the devs ever decide to actually go through with that.
comment 3y ago · link · parent
Not linking to LLVM would also make the barrier to entry on contributing to Zig itself lower, because now you can just compile Zig with Zig, and not worry about other dependencies.
comment 3y ago · link · parent
const c = @cImport({
@cDefine("SOME_MACRO", "1");
@cInclude("raylib.h");
});
Which translates the header files directly into Zig and allows you to call into them under whatever namespace you assigned them under. You even get completions (assuming you're using the language server)