News for hackers. Stuff that matters.
Re:Biscuit: A monolithic, POSIX-subset operating system kern... by robot on Wednesday September 23, 2020 @07:34PM (#24573540)
This is interesting in that if you can use channels as described by the CSP book[1] you could build a kernel that is guaranteed to be free of concurrency bugs.

This would be important because even if you have proven the functional correctness of a kernel, that typically excludes the concurrency aspect.

[1] (https://www.cs.cmu.edu/~crary/819-f09/Hoare78.pdf)

Re:Biscuit: A monolithic, POSIX-subset operating system kern... by arianvanp on Wednesday September 23, 2020 @07:46PM (#24573626)
But go doesn't provide channels in the CSP way nor does it do any model checking on it right?

Like one thing it already gets wrong is that you can send mutable pointers around without clear ownership.

Re:Biscuit: A monolithic, POSIX-subset operating system kern... by sythe2o0 on Wednesday September 23, 2020 @08:20PM (#24573885)
If it's 'wrong' to be able to pass around mutable pointers, is the only language that is 'right' Rust? (and some Lisps maybe?)
Re:Biscuit: A monolithic, POSIX-subset operating system kern... by remexre on Wednesday September 23, 2020 @09:32PM (#24574405)
I think you can do "real" ownership in ATS; or check ownership with a static analysis tool in many languages, including C; and you should be able make a hacky version as a library that dies at runtime in any language with parametric polymorphism and modules. "Modern C++" too, ish.

Which Lisps are you thinking of? CL and Scheme both allow having multiple copies of mutable objects.

Re:Biscuit: A monolithic, POSIX-subset operating system kern... by arianvanp on Thursday September 24, 2020 @07:53AM (#24577682)
No. For example Erlang only allows you to send immutable values around. For very good reason.
Re:Biscuit: A monolithic, POSIX-subset operating system kern... by pcwalton on Wednesday September 23, 2020 @09:34PM (#24574420)
If "concurrency bugs" includes deadlocks, no, such a kernel would not be free of concurrency bugs. Any blocking receive operation on a channel can create deadlocks.
Re:Biscuit: A monolithic, POSIX-subset operating system kern... by robot on Thursday September 24, 2020 @07:56PM (#24585061)
It will be free of concurrency bugs including deadlocks. This is the promise of CSP. The requirement is data is shared only via blocking IPC and never directly using a lock. (and similarly one must not share a pointer to private data, as another poster has pointed out)

You can compose small systems, even with multiple parties, prove they cannot deadlock, then make them a 'black box' with defined IO, and build larger, more complex systems with equal properties.

The downside is you must guard every piece of shared data with a separate thread, but there may be ways to reduce the performance penalty.

Re:Biscuit: A monolithic, POSIX-subset operating system kern... by pcwalton on Friday September 25, 2020 @12:31PM (#24591547)
How do you prevent process A from waiting on a receive from process B while process B waits on a receive from process A?