332 points · by dharmatech · 4y ago · 308 comments
The core of the AS/400 operating system, OS/400, the Licensed Internal Code (LIC), used to be written in another IBM-only PL/I dialect, PL/MP. In, the 1990s, while porting the AS/400 from CISC to RISC, they rewrote all the PL/MP code into C++. But IBM has another private dialect of PL/I called PL/MI, which was used to write the higher level part of OS/400, the XPF - basically PL/MI compiled to the virtual machine bytecode but PL/MP compiled to the machine code of the physical hardware. From what I understand, parts of the XPF are still written in PL/MP even in the latest versions of OS/400 (now called IBM i OS), although newer components tend to be developed in C/C++ instead. Other parts of the XPF were written in Modula 2, and I believe there is still some Modula 2 code surviving in the most recent versions as well.
IBM has had even more secret proprietary PL/I variants. The long defunct IBM 8100 line’s DPPX operating system was a written in PL/DS. Another dialect, PL.8, used to be used to write IBM’s compilers (although I believe it has now been replaced by C++) and also some of the firmware for the mainframes. IBM even wrote a GCC front-end for PL.8, although it appears they never released it.
Oh, how I had hoped I had scrubbed PL.8 from my memory.
"80% of PL/I." Only missing everything that made it bearable to use PL/I. No interrupts. You get ITERATE but no LEAVE statement. No STATIC, EXPORT or PACKAGE. You do get DEFINE... But not the one in other IBM PL/? langs. Incompatible.
The two weeks I spent debugging an interbank transferring program IBM wrote for them decades ago was one of the least pleasant experiences I've had when actually having access to the source code (albeit printed on five reams of paper, rather than digital). Give me pre-standard COBOL or FORTRAN over PL.8, any day.
Though, to be fair, the version of PL.8 I was granted access to was the original compiler, only. Not the updated one used for z/Arch firmware, today. Which I think solves a lot of those things. And I do mean the original compiler. The very, very first version.
I said no interrupts? Most of IBM's PL/? langs will signal when they run out of memory, so you can do something intelligent to kick the never-allowed-to-go-down mainframe into gracefully continuing to crunch endlessly (like clearing up part of a queue, and re-requesting it from a previous point). That signal is missing. So instead, you have developers build their own systems of heuristics to guess if a memory allocation had failed. Heuristics that had begun to fail, after an old network card burned out and was replaced with a similar one... But a faster, more modern, one. Faster hardware is the bane of old, hard-coded software.
DCL IntVar INTEGER BASED (Cursed)Interesting. I didn't realise PL.8 was used to write application software. I knew about it being used to write compilers, firmware, etc. If customer applications were written in it, did this mean they actually shipped PL.8 development tools to customers? I thought it was always IBM-internal-only.
Access to the compiler was by special request, as was the source code for the project. It wasn't something generally available, but for this specific project, and there was someone whose job it was to make certain I didn't copy anything or so on. I have no reason to believe the interbank software was normal for IBM in any way, shape or form.
I do have a suspicion as to why PL.8 was used instead of another language, and it does make a little bit of sense, but I'm afraid I don't believe that I'm currently allowed to reveal that. I've given what details I currently can.
Having used both, ISIS was quite a bit more advanced than 'competitors' like DOS and CP/M at the time.
PL/M was created by Gary Kildall, creator of CP/M, and CP/M 1.x was written in PL/M. In CP/M-80 2.x, they rewrote the kernel (BDOS) and command processor (CCP) in 8080 assembly to improve performance, but utility programs were still written in PL/M. Some later CP/M ports, such as CP/M-68K and CP/M-8000, were written in C instead.
Wikipedia says that IBM used PL/M too – to write some of the firmware for the CISC AS/400s (the Service Processor).
Modern languages tend to minimize the amount of features that they provide in the language itself, and do as much as possible in their standard libraries.
(This also goes together with simplified syntax, because user-defined complex syntax is hard, slow and potentially ambiguous, whereas limiting verbose, "readable" syntax to just a handful of language-provided features is just silly.)
Speaking as someone who has delved into the
intricacies of PL/I, I am sure that only Real Men
could have written such a machine-hogging,
cycle-grabbing, all-encompassing monster.
Allocate an array and free the middle third? Sure!
Why not?
Multiply a character string times a bit string and
assign the result to a float decimal? Go ahead!
Free a controlled variable procedure parameter and
reallocate it before passing it back?
Overlay three different types of variable on the
same memory location? Anything you say!
Write a recursive macro? Well, no, but Real Men use
rescan.
How could a language so obviously designed and
written by Real Men not be intended for Real Man
use?
Heh. Heh. Heh.[Source: http://www.anvari.org/fortune/Miscellaneous_Collections/3620... ]
The idea of "basic blocks", key to optimizing compiler, was invented by the team that wrote the Fortran I compiler in Fortran I. See https://ucla-biostat-257-2020spring.github.io/readings/fortr...
(1) DB2 for VM/VSE – the first to be released, as SQL/DS in 1981, its code was descended from IBM Research's System R research project, although most of that code was rewritten in the process of productisation
(2) DB2 for z/OS – the first to be called "DB2" (the others were later rebranded to that), released for MVS in 1983. I believe this started life as a fork of the SQL/DS code base, but then evolved in a different direction
(3) DB2 for IBM i – System/38 had an integrated database, but it was non-relational. In the process of evolving System/38 into the AS/400, IBM took the SQL layer out of SQL/DS (which was written in PL/S) and ported it to OS/400 (on which it would have been PL/MI code not PL/S, although those languages are very close to each other), but the lower layers of the stack (storage, etc) were kept from the System/38 non-relational database. In 1994, this was rebranded to "DB2/400", and more recently "DB2 for IBM i"
(4) DB2 for Linux/Unix/Windows (LUW) – this began life as OS/2 Extended Edition Database Manager. It was written in C/C++ from the very start, it has never contained any PL/I dialect code, although some ideas/concepts/etc were borrowed from IBM's mainframe/midrange RDBMS products. The code base was ported from its OS/2 birthplace to Unix (including AIX, Solaris and HP/UX), Windows NT, and Linux.
From what I understand (2) is still predominantly PL/X, although I would not be surprised if it now had some components in other languages such as C++. (1) is almost certainly mostly PL/X as well. (3) probably still contains PL/I-ish code too (albeit technically PL/MI rather than PL/X.)
(Disclaimer: I have no firsthand knowledge of this – I was born around the time SQL/DS and DB2 for MVS was first released, and I've never worked for IBM. It is just what I've pieced together from publicly available sources.)
Off and on I've experimented with a small event driven real time OS for my robots that started as a Forth kernel, switched over to a C kernel, and then to a Rust kernel. The experimental part has been looking at "infinite asynchronous threading" and it was hugely influenced by Rodney Brook's subsumption architecture. My thesis being that organisms aren't driven by a single scheduler and a bunch of processes, why should an OS be. (there are arguments pro and con on that one :-)).
Anyway, not everyone is an 'OS' type. At Sun we used to joke you were either an 'OS' type, 'Language' type, or a 'GUI' type. Those were the core areas of investigation in the software organization. I tend to be an 'OS' type with a bit of 'language' thrown in :-)
Sounds like neuromorphic computing, or clockless circuits in general. Really interesting stuff, I'm working on a programming language based on macro-expansion and dependency resolution with a scheduling model of "do everything as soon as you can, and not a moment sooner!"
Have you happened upon Andy Clark's book, Being There -- Putting Brain, Body, and World Together Again ? It was very influential to me in how to think of computers as organisms that can process parallel stimulus.
Guessing that lookalive-software is your github, have you put up your thoughts anywhere? Would love to read through them.
Could you say what it means to 'project a sequence of state transitions' ? I am not hip to the CS lingo - you could say I am scanning the AST for tasks whose prerequisites include no further tasks, and replacing the branch of a completed task with its result.
Essentially all I'm doing is asking the coder to write an AST directly, except expressions can be mixed in with literals. I was just doing a kind of handlebars/mustache templating engine with JSON before realizing I had all the pieces for a general purpose language. My hello world(s) looks like:
{"body": [
{"#!cat planets.txt": [
{"h1": "#!echo hello :0"}
}]
]}
The interpreter scans the JSON for the #! token and checks if all the parameters are literals, so first it hits #!cat and sees the argument 'planets.txt', OK, nothing further to compute, pass it off to a subshell and get the result, say, `mercury\nvenus\nearth\mars`. Newline separated results get interpreted as an array, and arrays are mapped over the next branch of the tree to get: {"body": [
{"#= mercury": [
{"h1": "#!echo hello :0"}
]},
{"#= venus": [
{"h1": "#!echo hello :0"}
]},
{"#= earth": [
{"h1": "#!echo hello :0"}
]},
{"#= mars": [
{"h1": "#!echo hello :0"}
]},
]}
At this point, there are four branches of the AST that have no shared dependencies, so my interpreter can solve them in parallel: before `#!echo` is ready, the colon marks a named (in this case numbered) argument to lookup so "#!echo hello :0" gets replaced with "#!echo hello mercury", and now all four echo branches can be forked in parallel. (If you're asking why I have to use a subshell and the echo program just to concatenate two strings, it's because the language has no builtins except #=, #&, #!, and #? ((for label, lookup, solve, and switch)). You can define functions but I wanted to start off with builtins provided by the OS, communications overhead be damned.) The '#=' then collapses once it's children are all literal so the final state of the program is: {"body": [
{"h1":"hello mercury"},
{"h1":"hello venus"},
{"h1":"hello earth"},
{"h1":"hello mars"}
]}
Which can then be translated to HTML by `github.com/lookalive-software/elementary` -- besides the parallelism and declarative/functional style, my selling point is being able to step through the process, so the editor is able to rewind the state, adjust something, and resume execution. Every state is a new valid program (valid JSON too), so if you want to pause the program, upload it to a bigger computer, and resume you can do that to.Not sure if those were quite the thoughts you were looking for, but I've been meaning to start writing docs for the current implementation anyway, so thanks for the push. If you want to know more details about the queueing / scheduler, I need to write the docs for that too ;)
http://www.euroforth.org/ef00/lyakina00.pdf
Apparently they came to the syntax independently of Forth. However my research shows that some material about Forth may have showed up in a journal around the same time DSP was made. Either way the resemblance is uncanny. There is an interesting quote about the interface of the design requirements that manifested as the language: “DSP wasn’t invented, it was discovered” - I probably butchered it. But I’m pretty sure Chuck may have said it too or at least agrees.
The point is, you reach this interface following a method of reaching for something akin to “irreducible computational language that makes sense between humans and machines.”
Edit: More than just the editors missing it -- it's the same author!
However, AIUI, the Serenity kernel isn't C++ but C. I could be wrong.
As such, as this was specifically a piece about non-C OSes, I felt it didn't really fit.
Secondly, although now I've had a bit of exposure to it writing that 2nd article, nonetheless, SerenityOS -- impressive as it is -- remains a bit of a prototype sort of project, rather than anything actually deployed in production anywhere. The project pages note that there are issues getting it to run anywhere outside of QEMU.
Whereas, say, Oberon is pretty obscure, but various versions of Oberon run on bare metal, or as VMs under multiple other OSes, or both, and ETH very much ran Oberon in production on bare metal for non-technical staff for years. There are 3-4 different dialects of Oberon, it runs natively on other OSes, it has OSes designed solely to be VMs, and so on.
To draw a comparison: it straddles the spaces of Plan 9 (mainly intended as a native bare-metal OS) to Taos (primarily bare-metal but deeply cross-platform, no native binaries as such) to Inferno (deeply cross-platform, no native binaries as such, but mainly intended to run under other OSes).
Whereas in the space of, say, Rust OSes, there are so few that even niche ones that are in prototype stage are worthy of mention... IMHO.
And my point is that when you mention OS-es like Mezzano (3k stars on Github, a dozen contributors [1]) and Redox (13k stars, 80 contributors [2]), but don't mention Serenity (18k stars, over 100 contributors [3] (Github limits this view to the top 100)) it seems funny.
In any case, it's your article and you can do what you'd like. I don't like people telling me I should change my articles.
[0] https://github.com/SerenityOS/serenity/tree/master/Kernel/Ar...
[1] https://github.com/froggey/Mezzano/graphs/contributors
[2] https://github.com/redox-os/redox/graphs/contributors
[3] https://github.com/SerenityOS/serenity/graphs/contributors
SerenityOS Browser now passes the Acid3 test - https://news.ycombinator.com/item?id=30853392 - March 2022 (141 comments)
Lots more at https://news.ycombinator.com/item?id=30858768
The difficulties for me right now are:
* it's not FOSS;
* it's not well-described in the literature (yet?);
* and ISTM that the project's goals seem to keep shifting.
https://fuchsia.dev/fuchsia-src/contribute/governance/policy...
Multics, first released in 1969, was a major influence on Unix. From the Wikipedia article:
> Multics was the first operating system to provide a hierarchical file system, and file names could be of almost arbitrary length and syntax. A given file or directory could have multiple names (typically a long and short form), and symbolic links between directories were also supported. ... It was also the first to have a command processor implemented as ordinary user code – an idea later used in the Unix shell. It was also one of the first written in a high-level language (Multics PL/I), after the Burroughs MCP system written in ALGOL.
Modern GPU architectures are very much their own thing. They have more in common with Vector machines in how the ALUs are organized, but the macro control flow is more like Dataflow architectures.
[1] https://en.wikipedia.org/wiki/TILEPro64 [2] https://en.wikipedia.org/wiki/TIS-100
Tilera was very cool. Maybe too much too young, though?
It was MIPS not Transputer based, AFAIK, but maybe I am misunderstanding you.
Both the Transputer and Alpha are CPU arches I think could still be usefully resurrected.
Re the Transputer, this earlier piece of mine may interest:
CM1/2 is SIMD machine that is mostly nothing more than FPGA turned inside out and in fact just an accelerator that cannot do anything useful standalone (control flow is mostly done in software on the frontend machine). In this regard it is somewhat similar to today's GPUs.
SP/2 is more or less equivalent of the "Beowulf clusters" of the turn of certury and Slashdot fame, that is bunch of computers with full OS instances connected together with some reasonably fast network. But done few years before on somewhat specialized IBM hardware (And well, Myrinet of the early large Linux based clusters was kind of funky specialized hardware, with these 18pair Cat5 cables...).
CM5 is weird as it is cluster of more or less off the shelf SPARC nodes with several independent communications networks with one of the networks being capable of doing bunch of "collective communications" (reduce, broadcast...) operations in hardware. As with CM1/2 it does not run any kind of OS and is mostly managed by some set of frontend computers than do the job setup and network configuration for each new job.
And then transputer is not an concept, there was real hardware and solar system is full of things that are directly descended from that hardware. The issue with transputers as an HPC platform (even for the early 90's) is that the nodes are too small, slow and have too slow interconnect to be meaningfully usable as general purpose HPC platform because you end up using significant fraction of the potential performance for housekeeping tasks (notice that above mentioned CM1/2/5 has some out of band method for the frontend to manage the nodes and even directly access their local memory, on transputers this had to be done through the main communication network and supported by software running on the nodes themselves, which makes even booting the thing an interesting excercise in parallel programming).
There's one mesh each for: memory access, packet transfers, user data network, cache misses, and IPC. The Pro added a cache coherency mesh too.
Sadly, Tilera was bought by EZChip, who were bought by Mellanox, who were bought by NVIDIA, and the Tilera processors don't seem to be available or being updated.
That's not to discourage creative efforts -- it's more like "be aware this is 10x bigger than Mt. Everest"
The major conflict in Tron is also themed after Kay's thought: Whom should a computer serve, its users or the bureaucracy that administrates it? Kay believed in user-centric computing, and was profoundly influential in making that happen, but it's clear that this struggle still goes on today.
I specifically said this in the article:
> B5000's MCP or Master Control Program. (Yes, the same name as the big baddie in Tron.)
Uniquely for a machine at the time, you didn't program a Burroughs in assembly. The tools just weren't available. Everything from the kernel to user applications was written in some HLL.
[1] https://web.archive.org/web/20170506152047/http://www.paters...
> This is not intended to be a comprehensive list.
And that is because:
> There are too many such efforts to count
And that I was:
> intentionally excluding early OSes that were partly or wholly written in assembly language.
It's not all historical stuff by any means; in fact, I tried to skew it towards stuff from the recent or modern era and things that are still in maintenance, still being worked on, or actively sold.
And, yes, I did consider VMS, but the article was getting too long already and while BLISS does qualify, it's also relatively obscure. Maybe I made the wrong call there: it's in current use, on sale, and about to become generally available on x86-64. Ah, well.
VMS is alive, well, and about to ship a new version.
https://vmssoftware.com/about/openvmsv9-1/
It is exceptionally solid, it has the best clustering ever invented for any OS in history, and above all: if it ain't broke, don't fix it.
I noticed in another thread that a few people seem to think you can't implement an entire operating system in a GCd language like Java or C#, but that isn't true. You can do it like this:
1. Use an ahead of time compiler to compile the base runtime/kernel image to static machine code. In managed language operating systems like JNode or Singularity there isn't a strong distinction between kernel and language runtime, so this is the same thing. This base needs to contain at least a GC and probably a JITC, as well as some basic support services. This can itself be written in the managed language.
2. Write a very short bootstrap loader in assembly like every OS has, which sets things up enough to jump into the entry point of that runtime.
3. Writing a compiler in a managed language is easy enough but what about a GC? To do this you teach the compiler that some methods are 'magic' and shouldn't be treated as normal method calls. Instead they become either compiler intrinsics that are translated to pure assembly e.g. to read/write raw memory locations, or they are compiled in special ways for example to remove GC safe points.
The current best example of this in action is the GC in SubstrateVM, which is the "VM" compiled into any program AOT compiled with the GraalVM native image tool:
https://github.com/oracle/graal/tree/master/substratevm/src/...
If you flick through it you'll see various annotations and types you wouldn't normally see in Java, like `Pointer` and `@Uninterruptible`. These are recognized by the compiler and affects how the machine code is generated. The language is the same, so all existing tools continue to work - it's not a dialect or subset of Java, it's the full thing, just with slightly modified rules for how the final generated code behaves.
SubstrateVM has one more trick up its sleeve to break the circularity: some objects can be initialized and persisted to an "image heap" at build time. In other words, the GC code can use Java classes to structure itself, despite being unable to allocate.
And that's all it needs.
There have been efforts to do things like this in the past for full operating systems. They have nice properties: for example you can sandbox drivers, IPC overheads goes away because it's all in a single address space, capabilities actually work and are pervasive, and it's quite easy to keep ABIs stable. There are usually a few sticking points that prevent them taking off:
1. Historically, GCs have either been good at latency or throughput but not both simultaneously. Some of them also had trouble with large heaps. That's a problem because virtually all reasonable computing requires a mix of programs with wildly different sensitivity, most obviously, developers want latency to be prioritized for editing in their IDE but throughput to be prioritized for their build system. If you have one GCd heap for the entire computer then you have two options:
1a. Pick one algorithm to manage it.
1b. Do what Singularity did and come up with a quasi-process notion in which each unit has its own GCd heap. Singularity had a nice concept called an 'exchange heap' which allowed objects to be passed between these quasi-processes very fast and cheaply, whilst ensuring that object graph could only be pointed to by one unit at once. This made IPC tremendously cheap, allowed one unit to be paused for GC whilst other units ran, and let them use IPC all over the place. However it did reduce the benefits of using managed languages somewhat as it reintroduced complex data ownership rules.
NB: This is changing now with tech like HotSpot ZGC and Shenandoah (which are written in C++ though). They drive latencies through the floor, it's basically pauseless, and the new not yet released fully generational variants have very good throughput too. Also, G1 GC has monstrous throughput even with low pause times, they just aren't quite as low as ZGC/Shenandoah.
2. Overheads of managed languages are higher. The successor at MS Research to Singularity was codenamed Midori and not much was ever published about it publicly, but from what was written (by Joe Duffy) it seemed apparent that they went down a rabbithole of trying to make Midori have the same raw efficiency and overhead as C++ based Windows. They got a long way but ended up not having any interesting enough new features to justify the investment and the project was eventually canned.
3. All the same problems new operating systems always have: no apps, drivers etc.
4. Spectre attacks make single address space operating systems more complex. The new support for memory protection keys in Intel CPUs could re-awaken this area of OS research however because MPKs let you block speculation attacks within a single address space.
"RustConf 2017 - Closing Keynote: Safe Systems Software and the Future of Computing by Joe Duffy"
https://www.youtube.com/watch?v=CuD7SCqHB7k
"Safe Systems Programming in C# and .NET"
https://www.infoq.com/presentations/csharp-systems-programmi...
In one of them, he mentions that even with Midori proving its value to the Windows team, they were quite dimissive of it.
It appears to have also been yet another victim of the usual DevDiv vs WinDev politics.
I will say, unequivocally, that Spectre actually makes process isolation in single address space operating systems impossible on modern hardware. There is too much speculation and too many leaks, and it's not just branches. We wrote a whole paper about it a few years back.
For example all code from a particular vendor (origin) could share a single MPK whilst running, even if the failure domain for things like fault isolation is finer grained.
That isn't enough, because you can induce misspeculation through paths that do (or would) have access to appropriate MPKs and do almost anything you want, including disclosing information through sidechannels you do have access to. Loading an MPK is akin to changing address space protections; it has to be a hard barrier that cannot be speculated through. You cannot even have code mapped that would have access to those MPKs, as you can induce misspeculation into this code.
> It's an open research question but my gut says yes.
My gut says no. There is just too much dark stuff going on in hardware. Sidechannels are outside of models. You can't verify anything until you have not the model, but the whole design of the chip.
Also, variant 4 is not addressed much in the literature. I couldn't write what I wanted to write because of NDAs, but I have personally written PoCs that basically say hardware has to turn off memory speculation or you end up with a universal read gadget again. There is no software solution for variant 4.
Both Smalltalk and LISP were used to write operating systems decades ago.
There were clear compromises & performance degradations related to using a GC'ed language, but it definitely was interesting enough that you hope for more.
Is there a situation where if your sticking points could. E addressed or tolerated where using a GC'd language could shine vs a non one?
I think there are many cases where GC'd languages can benefit tasks traditionally thought of as 'systems' tasks (I don't personally recognize much distinction between systems programming and non-systems programming). The Graal project is probably the most successful in this area. Like Midori it came out of long term corporate R&D, but unlike Midori it successfully shipped impactful software. They also published papers which the Midori guys never did.
Graal is an implementation of a JIT and AOT compiler for many languages, both source code and byte code based. It can run not only JVM bytecode but e.g. Python, Ruby, LLVM bitcode, WASM, and a whole bunch more, which makes a JVM powered by it easily the most polyglot compiler and runtime systems in history. Languages aren't translated to JVM bytecode, which would introduce impedance mismatches, but rather input to the compiler via a rather interesting technique called partial evaluation of interpreters.
Graal came out of asking the question, what if we wrote a JVM in Java? How can we do that, and if we can, are there benefits? Well, just rewriting something in Java doesn't give any benefits to the end users, just the developers, so to justify this you really have to find ways to really boost productivity a lot and then use that to yield interesting end-user features as well. Midori seems to have failed at this, Graal succeeded.
IMO the primary benefits Graal gets out of being written in a high level statically typed managed language are:
1. All the usual benefits like GC, great libraries, rock solid refactoring IDEs.
2. Annotations and the associated annotation processing/reflection infrastructure. The part that makes Graal polyglot is called Truffle and Truffle relies on this feature extensively.
3. Medium-level program input representation. One thing the Java world got really right is the clean separation between frontend and backend compilers via a stable bytecode format. Bytecode is not too high level, so you don't have to think about the complexities of evolving syntax when reading it, but also not too low level. Graal is of course itself expressed using bytecode and the compiler exploits this all over the place, for instance, it can parse bits of itself into compiler graphs at runtime and then use them as templates. They call this snippets and they use it as a way to lower high level constructs into lower level ones. It's really neat and a boost to compiler development productivity.
4. Related to that, Truffle relies heavily on that sort of meta-circular reflection capability. Truffle is the way Graal can compile languages that aren't JVM bytecode based. You write an AST interpreter for the language in any language that can produce bytecode (but in reality it's always Java because you need fairly precise control over the output; Kotlin might also work). The interpreter uses the Truffle API to express the AST, in particular it uses lots of annotations. The resulting interpreter is a normal Java program that can run on anything that can interpret bytecode, but the Graal compiler has plugins that recognize when it's compiling a Truffle program and handle it in special ways.
This ability to construct large, complex API surfaces that trigger special compiler behavior is one of the huge productivity wins that allowed the Graal team to add so many languages with such high runtime performance, so fast and so cheaply. It's like compiler intrinsics but taken to the next level, and then the next level again. And the end result is real benefits delivered to end users, for instance, Shopify uses TruffleRuby to get better performance for components of their web app.
You can do these things with WASM, which has no GC and simply manages memory segments on a per-module basis.
WASM cannot do this because it's meant to be a target for C and C-like languages. Either you have to make one WASM address space contain all your software, in which case it can easily corrupt itself internally (the sandbox is useless because it contains everything), or, you have to re-introduce a process-like concept that gives you isolated memory spaces, at which point it's not a single address space OS anymore.
Yes this is a problem with all operating systems and it is much less likely with Java compared to C but it feels to me like you are entirely reliant on the JVM producing "verified" code. It's kinda like how the Rust gang has to do formal verification to prove that their borrow checker is actually water tight instead of just acting as if the programmer made sure it is water tight like in C land.
Comes close to another one that also predates C, IBM’s z/OS, which has parts written in their own assembly dialect, as well as PL/1 and others.
Next week we’ll probably see a new version of it with support for the new z16 (based on the Telus chip they’ve shown at the last Hot Chips).
It misses the big name of Multics, written in PL/I, and direct inspiration (both positive and negative) for Unix
* because it's not obscure
* because I don't know much about it
* because once you open the can of worms labelled "PL/?" then it sort of explodes in your face, with fun aspects touched on in other comments, such as there being at least 2 different languages called PL/M, but PL/I and PL/1 are the same, and...
It's complicated, and I don't know enough about it... yet.
Thanks to <http://multicians.org> (which gathers information about Multics including source code) and <http://ban.ai> (public access Multics system)
The latter is a bit of an exaggeration. Tripos related code written in BCPL was used for "AmigaDOS" - meaning the filesystem driver, the command line shell, a few bits of process control, and a variety of generic command line utilities. It was not used for the kernel (Exec), or graphics support, or the gui library (Intuition), or the graphical shell (Workbench), or lower level device drivers, which were all written in C or 68K assembly.
The Tripos derived parts were nice though, generally nicer than the MSDOS equivalent and somewhat friendlier than the Unix command line, if the filesystem was a little slow, comparatively speaking.
Re Tripos: see this thread of comment...
https://twitter.com/Resuna/status/1509569315892346890
You may also enjoy this earlier piece:
I tended to use MPW C and 68K in those days and recall the stack sizes been different between C and Pascal.
As I said, though, in this version, I intentionally omitted OSes partly or largely written in assembler.
I also didn't cover a load of OSes written in either very obscure languages, properietary languages, dead languages, and also languages and OSes I just don't know anything much about.
As I've said elsewhere in these comments: if I tried to cover everything in equally, it wouldn't be an article, it would be a book.
And while I'd quite like to write that book, it's be a very niche one that would sell about a dozen copies.
It also fails to mention Apollo Aegis, coded in Apollo's extended Pascal, and both at introduction and retirement was more advanced than Unix. Some key features still are not seen in Linux or most BSDs.
And, it fails to mention SerenityOS, in C++.
C++ is long in the tooth, and if you want to talk desperation, C++ is really struggling with its identity now that Rust is on the scene. Before there were some pretty good arguments to use it, but in light of Rust, the best argument for C++ is just that it has a larger ecosystem (which says more about how old C++ is than how good it is as a language). That argument becomes less convincing with each passing day.
IMO in 2022 there’s not a good reason to start a new project in C++ unless that’s all you know, or you have some constraint tied to C++.
C++ is mature, there's a difference. It's definitely not "long in the tooth" as it still has plenty of modern features & niceties and is getting more all the time.
> C++ is really struggling with its identity now that Rust is on the scene
C++'s identity struggles have nothing to do with Rust whatsoever. It's struggling to balance ABI & historical compatibility with moving the language forward, that's about it. And that's just something many mature languages face at some point (see Python3 for example).
Beyond that struggle of supporting legacy code, there's no identity crisis with C++ at all.
> the best argument for C++ is just that it has a larger ecosystem (which says more about how old C++ is than how good it is as a language). That argument becomes less convincing with each passing day.
It's still an incredibly convincing argument. Rust has decent C interop, but it's not especially seamless to do safely. But Rust's interop with C++ is rather complicated. So if you have any C++ dependencies, you're almost certainly far better off to just go with C++. Even if you just have C dependencies and someone else hasn't yet made a crate for it, you might still be better of with C++.
Particularly since many of the Rust crates that bind to popular C & C++ libraries are not owned or maintained by the library in question. So you're entering into a bit of a sketchy maintenance world. And there's already been churn & abandonware here, for example the various projects (including one from Mozilla/Servo!) to bind to libpng that were then later all abandoned, and you're supposed to migrate to rewrites of PNG support in Rust like LodePNG. This is not ignorable churn & risk.
It can be fun, and if it's a hobby project absolutely go for it. But if you're on the clock to ship & maintain something, it's a risk you must consider quite seriously.
C is mature. C++ drinks and sleeps around, but that hardly makes it mature.
However, my overall view is that Rust is the right direction. If I had to improve C++, it would look a lot like Rust: move bounds checking and ownership to the compiler not the template compiler, remove classes, introduce traits and make C++ have concepts that don't require me to type every punctuation symbol on my keyboard to use, const by default.
Getting the compiler to do some of this checking by default is exactly what I want. If we can have an Ada/Spark style subset via Kani, also done at compile time to check correctness, even better.
> It's still an incredibly convincing argument. Rust has decent C interop, but it's not especially seamless to do safely.
I would make this statement slightly stronger. If you interop with C code and there are bugs in C code, all bets are off. You don't get any magical protection because your main routine is written in Rust. Cross-language safety, e.g. C++/Javascript, for example, is a very difficult problem. Here's a discussion of C++ and Rust https://dl.acm.org/doi/fullHtml/10.1145/3485832.3485903 If you want a tl;dr of that paper, it is that memory corruptions in C or C++ code sharing the address space of safe Rust code can make safe Rust code unsafe too. There have been plenty of attempts to study for example the interactions between browser C++ and the various runtimes a browser hosts.
The compact you are making with the Rust compiler when you type 'unsafe' is that you are saying you have verified the correctness of that code: that it is in fact already safe and the compiler should not (probably because it cannot) check it. The same is true of any FFI code you use. However, this is not how many people actually _use_ Rust. Here for example is a 2 year old unfixed segfault in a Rust crate caused by interfacing with non-Rust code: https://rustsec.org/advisories/RUSTSEC-2020-0159. This a) demonstrates the issue and b) demonstrates that random crates pulled off crates.io can contain safety issues for 2+ years with no fix.
Welcome to the world of any language that the cool guys dont use anymore :-)
I personally don't agree. I can start with performance and continue with a better compiler ecosystem, and add suitability for low resource applications. I'm just not scratching the surface here.
Rust is not bad, but it's not a replacement of C++. They aspire to be different things.
Why is Rust preferred though? Is it "fearless concurrency" (or whatever the old tag line was), a more modern stdlib, or is it Rust's tooling with `cargo` rather the shitty tool-scape of C++'s make/cmake/meson and vcpkg/conan and whatever else.
Things just work, and that is a rare experience.
Yes.
> a more modern stdlib
Yes.
> is it Rust's tooling with `cargo` rather the shitty tool-scape of C++'s make/cmake/meson and vcpkg/conan and whatever else
Yes.
I don't mean to be flippant. The entire experience with Rust is just so much better than with C or C++, and that's even before you get to the actual language.
But it is (for the most part) C++ that pays the bills.
If we're thinking about University students it's very likely the ratio is even smaller by the time they graduate and are looking for employment. Rust jobs grow, there are lots of new Rust codebases, and they need maintenance people just the same as C++. You may have fewer mysterious unsafety bugs to fix but your customers still have changing requirements, other people's APIs still change, so you aren't going to go hungry any time soon programming in Rust any more than C++
And if we're talking about in-house training, whatever they are teaching pays the bills, the employer isn't sending employees to learn how to do stuff they've no use for, otherwise they'd just give you indefinite leave on full pay.
1. https://insights.stackoverflow.com/survey/2019#technology-_-...
2. https://insights.stackoverflow.com/survey/2020#technology-pr...
3. https://insights.stackoverflow.com/survey/2021#technology-mo...
In my own experience, it's allowed me to write software that pretty much doesn't have bugs, and I say this as a 25 year veteran of being an engineer. The extra bits of complexity that are in the language allow me, the developer, to not have to write code to deal with that complexity in my own projects. It's handled for me.
Rust's primary competition is C and C++. It compares favorable on the overwhelming majority of axes against either. Not every one, but most.
It's probably of the order of a year out.
The full quote is in reference to popularity. Which if you look at the stack overflow developer survey is definitely true
Wishing is totally allowed, but is not a good look.
SerenityOS is addressed elsewhere in the comments here, so I won't repeat myself. DRY is a maxim, right?
- IBM PC and apple pc are assembler if not basic
- So is the Ibm 360 which even to this day you have to use assembler macro etc
- mac is Pascal.
And one can say Mac OS is on c but objective c is not just c. It is c based but really not c all the way down.
- many embedded system …
Outside this … Application wise …
- Java and even javascript is not c, so is html and css plus well cobol and fortran !
In fact one can do a lot without touching let alone learning c in his /her professional jobs. I suspect if just know c … cf just know x where x = ? Would be an interesting question.
Part of the reason why C became so prevalent is it being created within and backed by AT&T (one of the largest companies in the world back then). They pushed C and Unix everywhere, it took hold, and here we are today.
I cut my finger quite badly while writing the article so it did involve actual blood being spilled. Does that help?
Yet, the fact that most kernels cannot do ISO C gets cleverly forgotten.
Yay, shout-out to a deep cut that once had me very excited :).
Even weird C.
Writing an OS that is compilable with that compiler (and also able to run that compiler) is ANOTHER thing.
Terry Davis was a mad genius.
(We use it in Rust via inline assembly stubs.)
They should rename Oberon to Wirth.