-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchanges.txt
More file actions
79 lines (46 loc) · 1.47 KB
/
changes.txt
File metadata and controls
79 lines (46 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
Incremental features for the C programming language
@ core language
1. ownership/borrowing based memory management model
2. smart pointers
3. generics
4. modern fixed-length type system, references
basic types: (mutable by default, const)
ints- int8, uint8, int16, uint16, int32, uint32, int64, uint64, int128, uint128
floats- float64, float128, float256
chars- char8, char16, char32
derived types:
arrays- type var[len]
strings- string var = "Hello, World! \n"
cstrings- char8 var[len], cstrlen = len - 1, cstring[-1] = '\0'
n-tuples- tuple var[len] = (type var1, type var2, ...)
negative_index allowed => index = neg_index + len
pointers- type *ptr => dereferencing not allowed when possibly/surely NULL
references- type [mut] &ref = var (const by default)
implicit type conversions not allowed
5. function syntax
fn function_name(type arg1, type arg2, ...) -> (type ret1, type ret2, ...) {
function_code;
...
return (ret1, ret2, ...);
}
6. extended struct capabilities - for building abstractions
8. improved error handling
9. improved inline (assembly, llvm ir) syntax - no_opt
set syntax = att, intel
[no_opt] asm {
movl $1, %eax
...
}
[no_opt] llvm_ir {
mov 1, %1
...
}
############################################
@ std library
1. extended standard library with -
C++ STL like DSA containers and functions
regex
JSON Parsing etc.
cryptography
features borrowed from C++ and Rust standard libraries
2. modular library allowing modular linking