Skip to content

Commit 8442e94

Browse files
committed
update
0 parents  commit 8442e94

File tree

129 files changed

+2154
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+2154
-0
lines changed

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.mp4 filter=lfs diff=lfs merge=lfs -text
2+
videos/2024-03-26/huawei_and_rust.mp4 filter=lfs diff=lfs merge=lfs -text

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
_site
2+
.bundle
3+
vendor

Gemfile

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
source "https://rubygems.org"
2+
gem "jekyll", "~> 4.3.1"
3+
4+
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
5+
# and associated library.
6+
platforms :mingw, :x64_mingw, :mswin, :jruby do
7+
gem "tzinfo", ">= 1", "< 3"
8+
gem "tzinfo-data"
9+
end
10+
11+
# Performance-booster for watching directories on Windows
12+
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
13+
14+
# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
15+
# do not have a Java counterpart.
16+
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]

Gemfile.lock

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
addressable (2.8.1)
5+
public_suffix (>= 2.0.2, < 6.0)
6+
colorator (1.1.0)
7+
concurrent-ruby (1.2.0)
8+
em-websocket (0.5.3)
9+
eventmachine (>= 0.12.9)
10+
http_parser.rb (~> 0)
11+
eventmachine (1.2.7)
12+
ffi (1.15.5)
13+
forwardable-extended (2.6.0)
14+
google-protobuf (3.21.12)
15+
http_parser.rb (0.8.0)
16+
i18n (1.12.0)
17+
concurrent-ruby (~> 1.0)
18+
jekyll (4.3.2)
19+
addressable (~> 2.4)
20+
colorator (~> 1.0)
21+
em-websocket (~> 0.5)
22+
i18n (~> 1.0)
23+
jekyll-sass-converter (>= 2.0, < 4.0)
24+
jekyll-watch (~> 2.0)
25+
kramdown (~> 2.3, >= 2.3.1)
26+
kramdown-parser-gfm (~> 1.0)
27+
liquid (~> 4.0)
28+
mercenary (>= 0.3.6, < 0.5)
29+
pathutil (~> 0.9)
30+
rouge (>= 3.0, < 5.0)
31+
safe_yaml (~> 1.0)
32+
terminal-table (>= 1.8, < 4.0)
33+
webrick (~> 1.7)
34+
jekyll-sass-converter (3.0.0)
35+
sass-embedded (~> 1.54)
36+
jekyll-watch (2.2.1)
37+
listen (~> 3.0)
38+
kramdown (2.4.0)
39+
rexml
40+
kramdown-parser-gfm (1.1.0)
41+
kramdown (~> 2.0)
42+
liquid (4.0.4)
43+
listen (3.8.0)
44+
rb-fsevent (~> 0.10, >= 0.10.3)
45+
rb-inotify (~> 0.9, >= 0.9.10)
46+
mercenary (0.4.0)
47+
pathutil (0.16.2)
48+
forwardable-extended (~> 2.6)
49+
public_suffix (5.0.1)
50+
rake (13.0.6)
51+
rb-fsevent (0.11.2)
52+
rb-inotify (0.10.1)
53+
ffi (~> 1.0)
54+
rexml (3.2.5)
55+
rouge (4.0.1)
56+
safe_yaml (1.0.5)
57+
sass-embedded (1.58.0)
58+
google-protobuf (~> 3.21)
59+
rake (>= 10.0.0)
60+
terminal-table (3.0.2)
61+
unicode-display_width (>= 1.1.1, < 3)
62+
unicode-display_width (2.4.2)
63+
webrick (1.8.1)
64+
65+
PLATFORMS
66+
x64-mingw-ucrt
67+
x86_64-linux
68+
69+
DEPENDENCIES
70+
http_parser.rb (~> 0.6.0)
71+
jekyll (~> 4.3.1)
72+
tzinfo (>= 1, < 3)
73+
tzinfo-data
74+
wdm (~> 0.1.1)
75+
76+
BUNDLED WITH
77+
2.3.5

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Trusted Programming
2+
3+
If you want to run it locally, install it first. Then:
4+
5+
```bash
6+
$ bundle config set --local path 'vendor/bundle'
7+
$ bundle install
8+
```
9+
10+
When it's all done, you can run it locally like this:
11+
12+
```bash
13+
$ bundle exec jekyll serve
14+
```

_config.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
title: Trusted Programming
2+
description: >-
3+
As a leading telecommunications company on a global scale, Huawei is
4+
dedicated to the development of dependable software systems. To achieve this
5+
goal, our team of developers relies heavily on the support provided by Rust
6+
programming language. As a founding member of the Rust Foundation, Huawei is
7+
fully committed to the growth and prosperity of the Rust community. To
8+
demonstrate our commitment, we have created automated tools to transform C code
9+
into a safer Rust code, and are continuously contributing to the improvement
10+
and expansion of Rust's features.
11+
baseurl: ""
12+
url: "https://trusted-programming.github.io"
13+
14+
collections:
15+
contributions:
16+
output: false
17+
projects:
18+
output: false
19+
team:
20+
output: false
21+
research_labs:
22+
output: false

_contributions/async-drop.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Async Drop
3+
area: compiler
4+
status:
5+
label: in-progress
6+
css_class: attention
7+
buttons:
8+
---
9+
Support asynchronous destruction of objects running out of scope:
10+
11+
1. Implement code generation for asynchronous drop
12+
13+
2. Implement prevention measures for running asynchronous drop synchronously
14+
15+
3. Implement type system pre-requisites for (2) if necessary - type system refactoring, linear types
16+
17+
4. Implement any other features in rustc compiler that will help Rust language team to make a decision about including async drop to the language

_contributions/atomic-memcpy.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Atomic memcpy
3+
area: library
4+
status:
5+
label: in-progress
6+
css_class: attention
7+
buttons:
8+
- label: Atomic memcpy RFC
9+
link: https://github.com/m-ou-se/rfcs/blob/atomic-memcpy/text/3301-atomic-memcpy.md
10+
---
11+
It's currently not possible to implement an efficient and strictly correct *sequence lock* in Rust,
12+
which is a very important low level synchronization primitive.
13+
14+
Reading the data from a sequence lock relies on the ability to read data that might be
15+
concurrently modified, checking afterwards if a data race occured (by checking an atomic sequence counter),
16+
and only then *using* the data after the check.
17+
(See [the RFC](https://github.com/m-ou-se/rfcs/blob/atomic-memcpy/text/3301-atomic-memcpy.md#the-problem) for a detailed explanation.)
18+
19+
However, in the memory model of Rust (and C++),
20+
reading data that is concurrently modified results in a data race (undefined behavior) *immdiately*,
21+
not just when using the data later.
22+
23+
Crates like `seqlock` work around this by using `ptr::read_volatile`, but the correctness is debatable.
24+
25+
C++'s [P1478](https://wg21.link/p1478r7) adds
26+
`atomic_load_per_byte_memcpy` and `atomic_store_per_byte_memcpy` to provide a solution for that problem.
27+
Rust should have something similar, but something that fits better into Rust's type and safety system.
28+
29+
[Rust RFC 3301](https://github.com/m-ou-se/rfcs/blob/atomic-memcpy/text/3301-atomic-memcpy.md) is
30+
a proposal for a generic type `AtomicPerByte<T>` that allows for concurrent reads and writes that do not result in undefined behavior,
31+
while still allowing tearing to allow reads and writes of any size.
32+
It leverages the `MaybeUninit<T>` type to represent types in potentially invalid (teared) state.

_contributions/btreemap-cursors.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Cursor support for BTreeMap
3+
area: library
4+
status:
5+
label: in-progress
6+
css_class: attention
7+
buttons:
8+
- label: API Change Proposal
9+
link: https://github.com/rust-lang/libs-team/issues/141
10+
---
11+
One of the fundamental properties of `BTreeMap` is that it maintains elements in sorted order and
12+
enables efficient element lookup in `O(log(N))` time. However the current API is overly fitted
13+
towards a key-value API like a HashMap and fails to expose the ability to make queries about
14+
"nearby" keys. For example, finding the first element whose key is greater than X.
15+
16+
This proposal adds `Cursor` and `CursorMut` types to `BTreeMap` based on [similar][cursor]
17+
[types][cursor_mut] for `LinkedList`.
18+
19+
[cursor]: https://doc.rust-lang.org/nightly/std/collections/linked_list/struct.Cursor.html
20+
[cursor_mut]: https://doc.rust-lang.org/nightly/std/collections/linked_list/struct.CursorMut.html

_contributions/cg_gcc.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: rustc_codegen_gcc
3+
area: compiler
4+
status:
5+
label: in-progress
6+
css_class: attention
7+
buttons:
8+
---
9+
10+
`rustc_codegen_gcc` adds support for GCC as backend for the Rust compiler. It'll allow to support a lot more of compilation targets while also benefiting from GCC advantages.

_contributions/const-generics.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Constant Generics
3+
area: compiler
4+
status:
5+
label: blocked by trait system rewrite
6+
css_class: accent
7+
buttons:
8+
- label: Tracking Issue for complex Generic Constants (rust-lang/rust#76560)
9+
link: https://github.com/rust-lang/rust/issues/76560
10+
- label: Tracking Issue for complex Constant Parameter Types (rust-lang/rust#95174)
11+
link: https://github.com/rust-lang/rust/issues/95174
12+
- label: Tracking Issue for _ as a const argument (rust-lang/rust#85077)
13+
link: https://github.com/rust-lang/rust/issues/85077
14+
---
15+
Const generics allows the use of values in the type system. Most often used for arrays with a
16+
generic size: [u32; N] where N can be an arbitrary usize. It improves code clarity, reusability
17+
and the general experience of working with arrays. This can reduce heap allocations and increase
18+
performance. Changes to the standard library relying on const generics also increased the
19+
compilation speed and documentation quality.

_contributions/cstr.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: C strings
3+
area: language and library
4+
status:
5+
label: in-progress
6+
css_class: attention
7+
buttons:
8+
- label: RFC for C string literals (merged)
9+
link: https://github.com/rust-lang/rfcs/pull/3348
10+
- label: Tracking Issue
11+
link: https://github.com/rust-lang/rust/issues/105723
12+
- label: RFC for UTF-8 in C and byte strings
13+
link: https://github.com/rust-lang/rfcs/pull/3349
14+
- label: Issue to make `&CStr` a thin pointer
15+
link: https://github.com/rust-lang/rust/issues/59905
16+
---
17+
The `&std::ffi::CStr` type is used to represent (null terminated) C strings in Rust.
18+
Currently, this type has some subtle issues and is in many ways less ergonomic than the regular string type.
19+
20+
Some of the areas of potential improvement:
21+
22+
- There is no syntax for a `&CStr` literal. (Update: We now have the experimental `c"…"` syntax.)
23+
24+
- Due to a language limitation, `&CStr` is currently represented as a pointer+size pair.
25+
It should instead be just a pointer without a size, since the size is already determined by the null terminator.
26+
27+
- Because of this, conversion from `*const c_char` requires scanning the whole string to find its size.
28+
That should be a free/nop conversion instead.
29+
See the note in [this documentation](https://doc.rust-lang.org/stable/std/ffi/struct.CStr.html#method.to_bytes).
30+
31+
- For the same reason, `&CStr` cannot be passed through a C FFI boundary.
32+
Ideally, `&CStr` should have the same ABI as a `*const c_char`.
33+
34+
- `CStr` has far fewer useful methods than `str` (e.g. finding, splitting, replacing, etc.) making it hard to work with directly.
35+
36+
- `format!()` can only produce a `String`, not a `std::ffi::CString`.
37+
38+
- All bytes in a `CStr` (before the terminator) are non-zero, but none of the
39+
methods use `NonZeroU8` to leverage the type system for this invariant.

_contributions/delegation.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Delegation
3+
area: compiler
4+
status:
5+
label: in-progress
6+
css_class: attention
7+
buttons:
8+
---
9+
Support syntactic sugar for conveniently delegating implementation to other types.
10+
11+
1. Implement a compiler pass detecting delegation-like patterns in code
12+
13+
2. Run the pass on code from crates.io, analyze found delegation patterns, analyze previous delegation proposals
14+
15+
3. Implement syntactic sugar for common delegation patterns as a procedural macro or a built-in language feature
16+
17+
4. Write an RFC that proposes including delegation into Rust language
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: Diagnostic Locations
3+
area: devtools
4+
status:
5+
label: in-progress
6+
css_class: attention
7+
buttons:
8+
---
9+
Accurate diagnostic locations for tools like linters in presence of macro expansions.
10+
11+
1. Discuss specific cases that need improvements
12+
13+
2. Formalize the suggested improvements and implement them
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: Diagnostic Translation
3+
area: compiler
4+
status:
5+
label: in-progress
6+
css_class: attention
7+
buttons:
8+
- label: Tracking Issue (rust-lang/rust#100717)
9+
link: https://github.com/rust-lang/rust/issues/100717
10+
- label: Announcement Blog Post
11+
link: https://blog.rust-lang.org/inside-rust/2022/08/16/diagnostic-effort.html
12+
---
13+
Rust's diagnostics working group is leading an effort to add support for internationalization
14+
of error messages in the compiler, allowing the compiler to produce output in languages other than
15+
English.
16+
17+
Translated error messages will allow non-native speakers of English to use Rust in their preferred
18+
language.

_contributions/docs-rs.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: docs.rs features and maintenance
3+
area: development tools
4+
status:
5+
label: in-progress
6+
css_class: attention
7+
buttons:
8+
- label: Add GUI tests
9+
link: https://github.com/rust-lang/docs.rs/pull/1698
10+
---
11+
`docs.rs` is a crucial part of the Rust developer's toolbelt and Huawei sponsor
12+
continued development of `docs.rs` features and of maintenance of the project.

_contributions/feature-detection.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: CPU feature detection in core
3+
area: library
4+
status:
5+
label: in-progress
6+
css_class: attention
7+
buttons:
8+
---
9+
10+
Currently, CPU feature detection macros such as `is_x86_feature_detected!` are only available in
11+
`std`. This is because, on most platforms, feature detection requires information from the
12+
operating system, which is not available in `core` by design.
13+
14+
However, an alternative design would be to expose an API for manually enabling features: the set of
15+
enabled features would be available in `core`, but code in `std` would be responsible for querying
16+
the set of supported features from the OS on startup and marking them as enabled in `core`.
17+
18+
This will allow code in `core` and `alloc` to take advantage of CPU-specific optimizations such as
19+
using string processing instructions to accelerate certain functions.

_contributions/fmtarg.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Reduce binary size impact of formatting machinery
3+
area: library
4+
status:
5+
label: in-progress
6+
css_class: attention
7+
buttons:
8+
- label: Tracking Issue (rust-lang/rust#99012)
9+
link: https://github.com/rust-lang/rust/issues/99012
10+
---
11+
The `format_args!()` macro and underlying `std::fmt::Argument` type form the
12+
basis of all printing and formatting machinery in the Rust standard library,
13+
such as `println!()`, `format!()`, and `write!()`.
14+
15+
By improving the macro and the in-memory representation of the `fmt::Arguments`
16+
type, a significant reduction in binary size can be achieved. This is
17+
especially important for embedded software running on devices with limited
18+
storage and memory.
19+
20+
To be more flexible, currently working on the lifetime of hygenic macros to
21+
ensure safe expansion of unsafe code in the macros.

_contributions/hashbrown.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: hashbrown features and maintenance
3+
area: library
4+
status:
5+
label: in-progress
6+
css_class: attention
7+
---
8+
`hashbrown` is the hash table implementation used in Rust's standard library.
9+
This crate is performance-critical for both the Rust compiler and many Rust programs.
10+
Huawei sponsors the continued developement of hashbrown features and maintenance of the project.

0 commit comments

Comments
 (0)