5 ms·
D and Zig could work.
by vips7L 5y ago
D and Zig could work.
- gjsman-1000 5y agoNobody really proposed these in earnest. Also, it’s a kernel, where diversity of programming languages is a nightmare. It’s not the kernel’s job to support every language people want - it’s just that Rust has enough going for it that it’s finally being considered worthwhile after years of investigation.
- infogulch 5y agoInsofar as they don't bundle a runtime (unlike the languages mentioned by GP), yes. But they don't really offer much above C in the area of resource tracking / safety that rust's novel ownership+lifetimes system provides.
- floatboth 5y agoHeh, there were plans to add ownership&borrowing to D: https://dlang.org/blog/2019/07/15/ownership-and-borrowing-in-d/ https://dlang.org/blog/2019/07/15/ownership-and-borrowing-in... but of course bolting something on as an option is not the same as having the whole language designed strictly around it.
- dralley 5y agoI would say "defer" and "errdefer" do offer a lot compared to C, but you're right that it's not comparable with the resource tracking in Rust.
- loeg 5y agoZig isn’t substantially older than Rust, and is arguably less compelling. Certainly fewer resources backing an attempt at use as a 2nd kernel language. D I think suffered from a proprietary compiler and wide use of GC. But I’m not really familiar with it.
- sanxiyn 5y agoD is upstream in GCC since 2019, so it is actually superior to Rust in that respect. Days of proprietary D compiler is long past.
- nicoburns 5y agoZig is actually quite a bit younger than Rust. The first release of Zig predates the 1.0 release of Rust by a few months, but that was also a pre-release version. The earliest versions of Rust predate Zig by around 4 years.
- badsectoracula 5y agoFree Pascal too. An example would be Ultibo[0] which, despite the completely awful site (in terms of learning what it is - it feels like a developer's cynical overjaded idea of how a modern site that tries to market something is supposed to look like), is an OS for Rasberry Pi written in Free Pascal. It is meant to be used as a base for purpose-built projects instead of a general purpose OS, but it does show that it is possible to make one using the language (it already supports pretty much all "standard" features like networking, threads, 2d/3d graphics, a few filesystems, etc). Of course it doesn't make much sense to use it in the Linux kernel but it is a low level (or low level capable) programming language that can be used for systems programming. [0] https://ultibo.org/ https://ultibo.org/
- retrac 5y agoAs an historical note, Pascal was very popular in the late 70s and 80s for systems programming. The entire Apple Lisa/Macintosh platform started out in Pascal, for example. The limits of Pascal led Apple to team up with Wirth and develop Object Pascal, which is basically the language Free Pascal implements now. The gap between Pascal with a couple extensions and C, or between Object Pascal and Objective-C, is very small, anyway. Most semantic elements have a one-to-one correspondence. There were even UNIX clones written in Pascal.
- Tozen 5y agoVery true. Many people don't realize how Pascal evolved into Object Pascal, and how it's such a strong alternative to C++, C#, Objective-C, Java, etc...