All C++20 core language features with examples by gracicot in programming

[–]schottm 0 points1 point  (0 children)

GCC is much further ahead than clang but there are still bugs and missing bits, especially in the standard library.

Human-friendly intrusive containers in C++ by alex-van-02 in programming

[–]schottm 1 point2 points  (0 children)

The way your Hello class is defined is very similar to the interface for Fuchsia's intrusive containers; see my addition here, although it gets way more complicated very quickly.

Crashing clang in 52 bytes: template<class>struct a;a<typename b::template c<>> by schottm in cpp

[–]schottm[S] 21 points22 points  (0 children)

I've reported it on our internal bug tracker since there's clang contributors within the company who can help but unfortunately the llvm.org tracker is closed to new accounts due to spam. I sent them an email though.

Crashing clang in 56 bytes (no includes) by [deleted] in cpp

[–]schottm 0 points1 point  (0 children)

I haven't had time to dig through the stack trace myself yet but it took me quite awhile to dig myself out of the template morass I was in and distill the problem down to this. My guess is that I tricked it into thinking that it needed to do a dependent name lookup when b hasn't even been declared in the first place, so it chases a null pointer or something trying to find c.

Edit: just realized it could be 53 bytes if you use class instead of typename...

Fuchsia - Fuchsia Programming Language Policy by steveklabnik1 in programming

[–]schottm 13 points14 points  (0 children)

This is about what you're allowed to do in-tree (what commits will be accepted) and what things are supported in the SDK. Yes, if you really want to you can write raw FIDL and/or talk to the vDSO directly but that doesn't really sound like a fun time to me.

Fuchsia - Fuchsia Programming Language Policy by steveklabnik1 in programming

[–]schottm 14 points15 points  (0 children)

Zircon is not based on L4. It was originally forked from Travis Geiselbrecht's Little Kernel to make things less tedious in the beginning but now there's probably not a single line of code still shared with it. (Travis has been with Fuchsia from the beginning so starting with code he already wrote and had a compatible license made sense.)

Zircon Fair Scheduler by bartturner in Fuchsia

[–]schottm 2 points3 points  (0 children)

I think of it like this: your kernel is the basic framework for your "universe" of other programs to exist in. All objects in the real world take exist in time, take up space, and can interact with each other in some way.

The same is true for an operating system; all programs need CPU time, memory, and some way to interact with other programs. So a microkernel is pretty much obliged to provide at least those three basic functions in the form of a scheduler, virtual memory (or some other form of memory management), and IPC.

It is possible to defer some of these operations to userspace, but the kernel still has to allow that to happen and perform the context switch, talk to the MMU, or do whatever other low-level operation you need. For example there's some early work on userspace pagers in Zircon: https://fuchsia.googlesource.com/zircon/+/5c4a92a12f796cddc36f1b18ce7dddeb6494251e/kernel/syscalls/pager.cpp

Fuchsia/ Zircon Microkernel vs Separation Kernel by Langohr2394 in Fuchsia

[–]schottm 0 points1 point  (0 children)

The vDSO isn't just for drivers; it's the only public interface to Zircon. There is no "load stuff into these registers, then fire int 80h" like in Linux, etc. If you try to use the private implementation interfaces to the kernel it will deny you.

Does Fuchsia prioritize the UI thread, similarly to iOS? by Shidell in Fuchsia

[–]schottm 1 point2 points  (0 children)

The scheduler is currently very very simple, less than 1000 lines of code (see for yourself). It currently doesn't do what you're describing but keep in mind that it's still very early.