News for hackers. Stuff that matters.
Re:Imposing memory security in C [video] by pizlonator on Thursday February 27, 2025 @01:01PM (#43196759)
Semantics.

You can call Fil-C’s pointers whatever you like. You can call them capabilities if that works better for you.

The point of my post is to enumerate the set of things you’d need to do to pointers to make them safe. If that then means we’ve created something that you wouldn’t call a pointer then like whatever

Re:Imposing memory security in C [video] by tredre3 on Thursday February 27, 2025 @01:20PM (#43196927)
> Semantics.

If your goal is just to redefine the word then by all means, continue.

But semantics are very important if your goal is to drive adoption of your ideas. You can't misuse a term and then get pissy when people don't understand you.

Re:Imposing memory security in C [video] by pizlonator on Thursday February 27, 2025 @01:23PM (#43196962)
Seems like bro understood me just fine.

In Fil-C, pointers are called “pointers”.

Re:Imposing memory security in C [video] by PaulDavisThe1st on Thursday February 27, 2025 @01:26PM (#43196993)
And my point is that you cannot make C pointers safe. You can make something else that is safe, and you're clearly hard at work on that, which is great.
Re:Imposing memory security in C [video] by pizlonator on Thursday February 27, 2025 @01:30PM (#43197025)
Fil-C's pointers work more like C pointers than like any other language construct I can think of, and are compatible enough that lots of C/C++ code compiles and runs with no changes.

So I think that Fil-C pointers are just pointers.

You could even get pedantic over what the spec says. If you go there, you find that Fil-C's pointers work exactly like how the spec promises pointers to work (and all of the places that the spec doesn't define either have safe semantics in Fil-C or lead to Fil-C safety errors).

Re:Imposing memory security in C [video] by pjc50 on Thursday February 27, 2025 @03:32PM (#43198156)
What behavior in the C standard requires unsafety from pointers??
Re:Imposing memory security in C [video] by pizlonator on Thursday February 27, 2025 @04:11PM (#43198549)
Not a big fan of this line of thinking since if you tried to deploy a C implementation that just implements what's in the C standard, then you'd quickly find that real world C code expects more of pointers than the C standard promises.

Fil-C supports a superset of the C standard but a subset of what contemporary mainstream C compilers support (you can't pass an integer around in memory that is really being used to represent a pointer in Fil-C, but you can in Yolo-C).

Re:Imposing memory security in C [video] by layer8 on Thursday February 27, 2025 @05:54PM (#43199480)
Does Fil-C support uintptr_t? Because I’ve written programs that I believe to be quite strictly conforming C99 programs, that make use of uintptr_t.
Re:Imposing memory security in C [video] by pizlonator on Thursday February 27, 2025 @06:15PM (#43199655)
Yes you can use uintptr_t.

You just can’t cast a pointer to uintptr_t, then store that int into memory, then load it back, then cast it back to pointer, and then dereference that pointer.

Re:Imposing memory security in C [video] by layer8 on Thursday February 27, 2025 @06:30PM (#43199767)
Okay, but the C standard does allow exactly that for void*.
Re:Imposing memory security in C [video] by pizlonator on Thursday February 27, 2025 @06:53PM (#43199976)
You can do exactly that with `void*` in Fil-C.

I just don’t let integer types carry capabilities. If I did, things would get weird (like if you said `x + y` and both happened to carry capabilities then what would you get?)