Updated hero
This commit is contained in:
+42
-31
@@ -15,15 +15,15 @@ export const mistShowcase = [
|
|||||||
title: "Rust.. With ergonomics?",
|
title: "Rust.. With ergonomics?",
|
||||||
description:
|
description:
|
||||||
"C/C++/Java style syntax for comfort. Mist is designed for fast, readable systems code with minimal friction compared to raw Rust.",
|
"C/C++/Java style syntax for comfort. Mist is designed for fast, readable systems code with minimal friction compared to raw Rust.",
|
||||||
code: `void main() {
|
code: `fn main() {
|
||||||
println!("Hello, World!");
|
println!("Hello, World!");
|
||||||
|
|
||||||
greet("Developer");
|
greet("Developer");
|
||||||
}
|
}
|
||||||
|
|
||||||
pub void greet(str* name) {
|
pub fn greet(name *str) {
|
||||||
// Familiar pointer ergonomics with Rust safety
|
let greeting String = name.to_string();
|
||||||
String greeting = name.to_string();
|
|
||||||
println!("Hello, {}!", greeting);
|
println!("Hello, {}!", greeting);
|
||||||
}`,
|
}`,
|
||||||
cta: true,
|
cta: true,
|
||||||
@@ -33,11 +33,11 @@ pub void greet(str* name) {
|
|||||||
title: "Fast and works with Rust",
|
title: "Fast and works with Rust",
|
||||||
description:
|
description:
|
||||||
"All of your favorite Rust libraries work with Mist. It compiles directly into efficient Rust code with zero-cost abstractions and no runtime overhead.",
|
"All of your favorite Rust libraries work with Mist. It compiles directly into efficient Rust code with zero-cost abstractions and no runtime overhead.",
|
||||||
code: `use <std::vec::Vec>;
|
code: `use std::sync::Arc;
|
||||||
use <external_lib>;
|
use external_lib;
|
||||||
|
|
||||||
void process_data() {
|
void process_data() {
|
||||||
var list = new Vec(); // Zero-cost abstraction
|
let list = Arc::new(Vec::new());
|
||||||
external_lib::perform_task(list);
|
external_lib::perform_task(list);
|
||||||
}`,
|
}`,
|
||||||
},
|
},
|
||||||
@@ -45,21 +45,19 @@ void process_data() {
|
|||||||
{
|
{
|
||||||
title: "Class and Type System",
|
title: "Class and Type System",
|
||||||
description:
|
description:
|
||||||
"Classes are syntactic sugar for Rust structs. Using 'extends' provides inheritance-style syntax over struct composition, compiling into the underlying Rust type system.",
|
"Classes are syntactic sugar for Rust structs. Using ':' provides inheritance-style syntax over struct composition, compiling into the underlying Rust type system.",
|
||||||
code: `pub struct PluginInfo {
|
code: `pub class Dog : Animal {
|
||||||
pub String name,
|
constructor() {
|
||||||
pub String version,
|
super -> Super::new();
|
||||||
}
|
|
||||||
|
|
||||||
pub class PluginRegistry<T> {
|
|
||||||
T plugins;
|
|
||||||
|
|
||||||
pub constructor(T plugins) {
|
|
||||||
self.plugins = plugins;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub T plugins(self) {
|
pub override fn speak(*self) {
|
||||||
return self.plugins;
|
println!("Woof!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Explicit override is useful for super inheritance
|
||||||
|
pub override(Animal) fn legs(*self) u32 {
|
||||||
|
println!("4 legs");
|
||||||
}
|
}
|
||||||
}`,
|
}`,
|
||||||
},
|
},
|
||||||
@@ -67,22 +65,35 @@ pub class PluginRegistry<T> {
|
|||||||
{
|
{
|
||||||
title: "Better Developer Experience",
|
title: "Better Developer Experience",
|
||||||
description:
|
description:
|
||||||
"While Rust can already be a great DX, Mist implements concepts that are proven to improve structure.",
|
"While Rust can already be a great DX, Mist implements concepts that are proven to improve modular structure.",
|
||||||
code: `pub class Logger {
|
code: `pub class Animal {
|
||||||
String prefix;
|
pub name String;
|
||||||
|
|
||||||
pub constructor(str* prefix) {
|
constructor() {
|
||||||
self.prefix = prefix.to_string();
|
self.name = "Rex".to_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
void log(self*, LogLevel level, str* message) {
|
pub fn speak(*self) {
|
||||||
println!("{level} {} {}", self.prefix, message);
|
println!("Unknown");
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display {
|
pub fn legs(*self) {
|
||||||
std::fmt::Result fmt(self*, std::fmt::Formatter<'_> mut* f) {
|
println!("Unknown");
|
||||||
return write!(f, "logger ({})", self.prefix);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub class Dog : Animal {
|
||||||
|
constructor() {
|
||||||
|
super -> Super::new();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub override fn speak(*self) {
|
||||||
|
println!("Woof!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Explicit override is useful for super inheritance
|
||||||
|
pub override(Animal) fn legs(*self) {
|
||||||
|
println!("4 legs");
|
||||||
}
|
}
|
||||||
}`,
|
}`,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user