You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/pages/comparisons.md
-7Lines changed: 0 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,6 @@ Kit aims to provide a superset of the capabilities of C. With that said, there a
27
27
28
28
C's type system is weaker than Kit's; this means that some things that would be valid from C will throw compile-time errors in Kit. As an example, Kit features a true `Bool` type, and other types cannot be implicitly cast to bools, so `if 1 {}` will not compile in Kit. Kit's stance is that generally these usage patterns are more likely to be mistakes, so forbidding them reduces bugs.
29
29
30
-
31
30
## C++
32
31
33
32
C++ is an early example of a "better C" and is widely used in game development. Some comparisons:
@@ -36,7 +35,6 @@ C++ is an early example of a "better C" and is widely used in game development.
36
35
* C++ provides object-oriented programming features, including classes; Kit provides traits and boxes (fat pointers.) A trait in Kit is similar to an interface, but can be implemented externally to type definitions, and can be implemented by even basic types (e.g. numeric types or tuples.) A box pointer must be explicitly created, so the overhead that boxes/objects add is entirely opt-in.
37
36
* C++ leverages much of the same build infrastructure as C. Kit provides its own compiler and build tool to make the build process simpler.
38
37
39
-
40
38
## Rust
41
39
42
40
[Rust](https://www.rust-lang.org/) is a safe systems programming language developed at Mozilla. Many features in Kit are inspired by Rust. In general, Rust is much stricter than Kit, which can result in a tradeoff of fewer bugs but longer iteration cycles.
@@ -46,7 +44,6 @@ C++ is an early example of a "better C" and is widely used in game development.
46
44
* Rust disallows implementing external traits for external types, which closes off a big advantage of a trait system. For example, it's impossible to implement `Show` for `Path`, because the creators of `Path` decided they don't want you to treat it as a string. There is a valid argument against this, but in Kit the developer has the final say. As long as implementations are unambiguous, in Kit traits can be implemented for types arbitrarily.
47
45
* Rust uses a global allocator by default. Kit is designed to allow easy use of multiple custom allocators within the same codebase.
48
46
49
-
50
47
## Zig
51
48
52
49
If you want a safer, modern alternative to C, [Zig](https://ziglang.org/) is a great option. Like Kit, Zig features seamless C interop - just include a header and use it directly in your code. This means there's very little risk to trying Zig in place of C.
@@ -63,7 +60,6 @@ A couple key differences:
63
60
64
61
* Zig is mature; Kit is pre-alpha.
65
62
66
-
67
63
## Haxe
68
64
69
65
[Haxe](https://www.haxe.org) is a high-level language that compiles (or "transpiles") to 10+ other language targets, including C++, JavaScript and bytecode for various VMs. Haxe has been used for numerous successful games, and its use cases also include settop boxes, websites, and more.
@@ -76,17 +72,14 @@ A couple key differences:
76
72
77
73
* Haxe is an object-oriented language. Kit's type system uses traits, and has no objects; [boxes](/examples#boxes) must be created explicitly.
78
74
79
-
80
75
## Swift
81
76
82
77
TODO
83
78
84
-
85
79
## Nim
86
80
87
81
TODO
88
82
89
-
90
83
## Jai
91
84
92
85
As soon as it's publicly available, let's revisit.
0 commit comments