Readit News logoReadit News
wucke13 commented on Why did containers happen?   buttondown.com/justincorm... · Posted by u/todsacerdoti
wucke13 · 2 months ago
My take: containers forced devepopers to declare various aspects of the application in a standardized, opinioated way:

- Persistant state? Must declare a volume. - IO with external services? Must declare the ports (and maybe addresses). - Configurable parameters? Must declare some env variables. - Trasitive dependecies? Must declare them, but using a mechanism of your choosing (e.g. via the package manager of your base image distro).

Separation of state (as in persistency) and application (as in binaries, assets) makes updates easy. Backups also.

Having most all IO visible and explicit simplifies operation and integration.

And a single, (too?!?) simple config mechanism increases reusability, by enabling e.g. lightweight tailoring of generic application service containers (such as mariadb).

Together this bunch of forced, yet leaky abstractions is just good enough to foster immense reuse & composability on to a plethora of applications, all while allowing to treat them almost entirely like blackboxes. IMHO that is why OCI containers became this big, compared to other virtualization and (application-) cuntainer technologies.

wucke13 commented on A comparison of Ada and Rust, using solutions to the Advent of Code   github.com/johnperry-math... · Posted by u/andsoitis
Sharlin · 3 months ago
What even is the most complex programming language with a fully machine-checkable spec? Are there actually practically useful ones? I know of none.
wucke13 · 3 months ago
For the seL4 proofs a subset of C was formalized, for example.

(Already mentioned) CakeML would be another example, together maybe with its Pancake sibling.

Also: WebAssembly!

wucke13 commented on A comparison of Ada and Rust, using solutions to the Advent of Code   github.com/johnperry-math... · Posted by u/andsoitis
nine_k · 3 months ago
Ideally, a compiler can statically prove that values stay within the range; it's no different than proving that values of an enumeration type are valid. The only places where a check is needed are conversions from other types, which are explicit and traceable.
wucke13 · 3 months ago
That's pohibitively expensive in the general case when external input is used and/or when arithmetic is used on the values (main differerence to sum-types).
wucke13 commented on A comparison of Ada and Rust, using solutions to the Advent of Code   github.com/johnperry-math... · Posted by u/andsoitis
plainOldText · 3 months ago
Nim was inspired by Ada & Modula, and has subranges [1]:

  type
    Age = range[0..200]

  let ageWorks = 200.Age
  let ageFails = 201.Age
Then at compile time:

  $ nim c main.nim
  Error: 201 can't be converted to Age
[1] https://nim-lang.org/docs/tut1.html#advanced-types-subranges

wucke13 · 3 months ago
I know quite some people in the safety/aviation domain that kind of dislike the subranges, as it inserts run-time checks that are not easily traceable to source code, thus escaping the trifecta of requirements/tests/source-code (which all must be traceable/covered by each other).

Weirdly, when going through the higher assurance levels in aviation, defensive programming becomes more costly, because it complicates the satisfaction of assurance objectives. SQLite (whiches test suite reaches MC/DC coverage which is the most rigorous coverage criterion asked in aviation) has a nice paragraph on the friction between MC/DC and defensive programming:

https://www.sqlite.org/testing.html#tension_between_fuzz_tes...

wucke13 commented on A comparison of Ada and Rust, using solutions to the Advent of Code   github.com/johnperry-math... · Posted by u/andsoitis
imglorp · 3 months ago
The author indicates some obvious differences, including the fact that Ada has a formal spec and rust doesn't -- rustc seems to be both in flux as well as the reference implementation. This might matter if you're writing a new compiler or analyzer.

But the most obvious difference, and maybe most important to a user, was left unstated: the adoption and ecosystem such as tooling, libraries, and community.

Ada may have a storied success history in aerospace and life safety, etc, and it might have an okay standard lib which is fine for AOC problems and maybe embedded bit poking cases in which case it makes sense to compare to Rust. But if you're going to sit down for a real world project, ie distributed system or OS component, interfacing with modern data formats, protocols, IDEs, people, etc is going to influence your choice on day one.

wucke13 · 3 months ago
Neither the Rust nor the Ada spec is formal, in the sense of consumable by a theorem prover. AFAIK for Ada Spark, there is of course assumptions on the language semantics built-in to Spark, but: these are nowhere coherently written down in a truly formal (as in machine-readable) spec.
wucke13 commented on Boeing has started working on a 737 MAX replacement   wsj.com/business/airlines... · Posted by u/bookofjoe
ViewTrick1002 · 3 months ago
> Given that outcome, I (from the peanuts gallery) would design the aircraft to handle in some ideal way using MCAS-like automation to fix any deviation from that ideal, from the beginning. Of course, that's starting to head down the road of a more-Airbus-like design.

The 787 and 777 are already purely fly by wire. Their entire feel is made up.

Boeing simply has a different design philosophy on how much a pilot should feel like they are in command vs steering a system.

wucke13 · 3 months ago
I think what parent was about is open vs. closed loop control, not fly-by-wire or not. Both their and your point stand of course.
wucke13 commented on Zero ASIC releases Wildebeest, the highest performance FPGA synthesis tool   zeroasic.com/blog/wildebe... · Posted by u/stefanpie
st_goliath · 3 months ago
> ... don't require absurdly bloated development environments.

Outside hobbies, I've been mostly away from this field for little over a decade by now. Is it still that bad? I remember back then, every single professional electronics engineer that I met had this die hard belief that this was simply how things work:

You want to use DerpSemi micro controllers? You must install DerpStudio '98! Not the later 2005 version tough, that has some major UI bugs. You want to program a HerpSoft PLC? You need EasyHerpes IDE! What, command line toolchain? Text editor? You must be completely insane!

It's been somewhat of a personal fight against windmills for me back then. That, plus suggesting that we are actually developing software and the C/Assembly/VHDL maybe shouldn't be an undocumented, tested-only-once pile of spaghetti based off a circuit diagram inside one guys head (and no, a 50 line comment block with a German transcription of the code below is not documentation).

wucke13 · 3 months ago
I have dedicated a large chunk of my (arguably short) professional career on improving upon this, mostly in the safety critical software domain. What was your experience back then, what made you leave ultimately, and what do you do now?
wucke13 commented on The Weird Concept of Branchless Programming   sanixdk.xyz/blogs/the-wei... · Posted by u/judicious
FooBarBizBazz · 3 months ago
I used to do stuff like this (ok, not half as smart), but stopped around 2013 or so, as the distinction between "implementation defined" behavior (ok) and "undefined" behavior (not ok) started to matter and bite.

After thinking through this carefully, though, I do not see UB (except for signed overflow in a corner case):

Step 1, bit shift.

I understand that, until C++20, left shift of a signed int was UB. But this right shift appears to be implementation defined, which is ok if documented in the code.

Step 2: Add.

Then, (x + mask) is defined behavior (a) for positive x, since then mask=0, and (b) for most negative x, since then mask=-1. However, if x is numeric_limits::lowest, then you get signed integer overflow, which is UB.

Step 3, XOR.

Then the final XOR doesn't have UB AFAICT. It wouldn't be UB as of C++20, when signed integers became two's complement officially. It might have been implementation defined before then, which would be almost as good for something that ubiquitous, but I'm not sure.

Ok, so I think this does not involve UB except for an input of numeric_limits_lowest.

Sound about right?

To fix this, perhaps you would need to make that + an unsigned one?

It bothers me how hard you need to think to do this language lawyering. C++ is a system of rules. Computers interpret rules. The language lawyer should be a piece of software. I get it, not everything can be done statically, so, fine, do it dynamically? UBSan comes closest in practice, but doesn't detect everything. I understand formally modeled versions of C and C++ have been developed commercially, but these are not open source so they effectively do not exist. It's a strange situation.

Just the other day I considered writing something branchless and said, "nah", because of uncertainty around UB. How much performance is being left on the table around the world because of similar thinking, driven by the existence of UB?

Maybe I was supposed to write OCaml or Pascal or Rust.

wucke13 · 3 months ago
Rust in particular with miri is quite impressive at catching them. You just run your testcases via

    cargo miri run
And if your code actually touches UB, mirei will most likely point out exactly where and why.

wucke13 commented on RedoxFS is the default filesystem of Redox OS, inspired by ZFS   doc.redox-os.org/book/red... · Posted by u/doener
Rochus · 3 months ago
Genode looks interesting. As far as I understand it uses the sel4 kernel? Is it really in development since 2008?
wucke13 · 3 months ago
It doesn't necessarily, but it can. Genode/SculptOS is kind of a microkernel OS framework, and it can use seL4 as the kernel.

Here is a talk about that porting effort:

https://m.youtube.com/watch?v=N624i4X1UDw

wucke13 commented on SkiftOS: A hobby OS built from scratch using C/C++ for ARM, x86, and RISC-V   skiftos.org... · Posted by u/ksec
logicchains · 3 months ago
Microkernels are conceptually cleaner, and easier to make secure, but in practice generally slower than unikernels.
wucke13 · 3 months ago
Gernot Heiser would strongly disagree with you on the last one :D

u/wucke13

KarmaCake day138February 28, 2023View Original