forked from hsutter/cppfront
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Herb Sutter edited this page Mar 20, 2023
·
33 revisions
Welcome to the cppfront wiki!
This wiki collects some Cpp2 language design notes, and links to related projects.
The beginnings of documentation...
-
operator=
,this
&that
. Unification of { copy, move, convert } x { construction, assignment }, with notes about how they are related and the specialthis
andthat
parameters.
These Cpp2/cppfront design notes cover things like rationale for a given design choice, and alternatives considered. They are not intended to be exhaustive, but to give a basic answer to why something is the way it is, always subject to "this is an experiment! we'll learn."
- Design note: UFCS. Why does UFCS use fallback semantics (prefer a member function)? Doesn't that mean that adding a member function later could silently change behavior of existing call sites?
-
Design note: const objects by default. Should objects be
const
? Mostly yes. - Design note: unsafe code. Yes, I intend that we should be able to write very-low-level facilities in Cpp2. No, that doesn't mean a monolithic "unsafe" block... I think we can do better.
- Design note: ABI. Cpp2 is ABI-neutral, but its immunity from backward compatibility constraints presents an opportunity for link-level improvements, not just source-level improvements.
-
Design note: Postfix operators. Why are unary
*
and&
postfix? What about++
? Why does the->
operator naturally disappear? -
Design note: Postfix unary operators vs binary operators. What about examples like
a**b
? -
Design note: Unambiguous parsing. How does Cpp2 parse things that seem ambiguous and/or challenging, like
a<b>c,d>
? -
Design note: Replacing the preprocessor with reflection and generation. How will we handle cross-platform code without the preprocessor? For example,
#if WIN32 > use this
, and#if LINUX > use that
? - Design note: Namespaces. Should namespaces be their own standalone feature, as in Cpp1? Maybe, but I'm going to see if we can do better using metaclass functions and partial types.
-
Design note: Capture. Should the syntax be suffix
$
or something else?
Here are some projects related to cppfront. Note that these are created and maintained by other people, and I generally don't know much about them. If you think I'm linking to one that shouldn't be linked to, please open an issue and explain why; thanks!
- Conan recipe for cppfront. By Fernando Pelliccioni. A cppfront Conan recipe/package in the Conan Center Index (the official package index for Conan). Here is a sample for using cppfront with Conan and CMake.
-
/modern-cmake/cppfront. A modern CMake (3.23+) build for cppfront, complete with automatic cpp2-to-cpp1 translation. Compatible with
find_package
,add_subdirectory
, andFetchContent
. - /JohelEGP/jegp.cmake_modules/#jegpcpp2. A CMake module to build Cpp2 source files.
- Meson support for cppfront. By Jussi Pakkanen, creator of Meson.
- Sublime syntax highlighting for Cpp2. By Andrew Feldman.
- Visual Studio Code syntax highlighting for Cpp2. By Elazar Cohen. The source code is available on GitHub.