Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
seanbax
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
5 ms
·
1.
▲
by
seanbax
1y ago
Lifetime parameters are necessary for borrow checking. And you need a special operator for initiating a borrow. You need immutability by default, because mutability everywhere violates exclusivity.
2.
▲
by
seanbax
1y ago
Which ideas aren't strictly necessary to achieve safety in C++?
3.
▲
by
seanbax
1y ago
template<typename _RandomAccessIterator> _GLIBCXX20_CONSTEXPR inline void sort(_RandomAccessIterator __first, _RandomAccessIterator __last) { // concept requirements __glibcxx_function_requir
4.
▲
by
seanbax
1y ago
Python doesn't have lvalues in the way that C++ and Rust do. You can't refcount everything and still pass lvalues to subobjects. If lvalues to subobjects are important, you need borrow checking.
5.
▲
by
seanbax
1y ago
I illustrate why it won't work with a number of examples here: https://www.circle-lang.org/draft-profiles.html To address your points: 1. The safe subset of C++ is too small to do anything with. 2. The Standard Library
6.
▲
by
seanbax
1y ago
The Profiles authors are the ones claiming this uses local analysis only: https://news.ycombinator.com/item?id=41942126 They are clear that Profiles infers everything from function types and not function bodies. Obviously t
7.
▲
by
seanbax
1y ago
I would have implemented profiles if profiles had a chance of working. But they will not ever work. I present many examples of why they fail here: https://www.circle-lang.org/draft-profiles.html People who say Profiles are
8.
▲
by
seanbax
2y ago
You do solely rely on the declaration. From P3465: "why this is a scalable compile-time solution, because it requires only function-local analysis" Profiles uses local analysis, as does borrow checking. Whole program analysis is s
9.
▲
by
seanbax
2y ago
If the vector has to be resized in push_back, the implementation copy-constructs a new object from x. It resizes the buffer. Then it move-constructs the copy into the buffer. The cost is only a move construct per resize... So it's on t
10.
▲
by
seanbax
2y ago
From P3465: "why this is a scalable compile-time solution, because it requires only function-local analysis" From P1179: "This paper ... shows how to efficiently diagnose many common cases of dangling (use-after-free) in C++
11.
▲
by
seanbax
2y ago
Presenting a familiar syntax certainly makes it easier to follow.
12.
▲
by
seanbax
4y ago
https://itanium-cxx-abi.github.io/cxx-abi/abi.html See all the stuff there? exceptions, vtable layout, rtti, mangling, etc. There's a Windows equivalent for all of that. That's what I want access to.
13.
▲
by
seanbax
4y ago
Yes, interfaces open that up, and to a lesser extent choice types open that up. If your choice type supports all the alternatives from the original overload set, then you can reduce to one function.
14.
▲
by
seanbax
4y ago
That's right. I'm fine with normal C++ syntax. But other people have other opinions. And there is an allure of getting to a CFG so that non-compiler tooling could build a parse tree and do useful transformations. That's a goo
15.
▲
by
seanbax
4y ago
I'd like to target Windows. Windows does impose a specific C++ ABI, but it's completely undocumented. It's really just whatever Visual C++ does. C++ ABI is very complex, especially vtable layout and RTTI and EH. I am looking
16.
▲
by
seanbax
5y ago
My favorite use is putting user-defined attributes on data members, and using reflection to generate a UI to manipulate those values. I do it with these shadertoys: https://github.com/seanbaxter/shaders#reflection-and-a
17.
▲
by
seanbax
5y ago
Enum to string is a one-line expression in Circle: https://godbolt.org/z/93f5o77zv Circle has dozens of special traits for accessing useful stuff about types, packs, etc. Don't need to overengineer such a simple t