Info
This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Imagining a Rusty scripting language
From time to time I've a little curiosity with Rusty scripting languages.
I've seen this Karina language recently which is a Rusty one that targets the JVM, but it's far from complete.
What I would like in a Rusty scripting language is...
Variant = "variant"
) and a number simultaneously (e.g. Variant = ("variant", 0)
).
<s:Component1 variant="normal"/>
) and occasional type inference, too.struct
inheritance is said to be an anti-pattern, but it's useful for certain corner cases (like implementing DOM nodes and their event model (e.g. to avoid an additional "detail" parameter on event listeners)).
For a compiler to work, it may have to rely on specific host APIs. For example, TypeScript tsc
supports React.js-tied JSX markup which targets the React.js API (by default specifically for the WHATWG DOM). A potential scripting Rusty compiler would need to target a number of different technologies as well with its own markup capabilities.
As to markup syntax, people seem to argue that Dioxus's default template engine looks more efficient to type:
rsx! {
Component1 {
x = 10
}
}
I prefer a XML-like or JSX-like way because its structure seems a little cleaner, although it requires closing tags when an element is non-empty. (Here's where is required a nice IDE support.)
Unlike React.js, I'd rather not rely on a separate styled-components
package and support multiple CSS blocks out of the box, scoped to a markup's tag.
xml! {
<w:HGroup>
<w:Style>
r###"
:host {
background: red;
}
"###
</w:Style>
</w:HGroup>
}
In this case w
would be a native prefix identifying the framework (e.g. Whack) and other prefixes are simply identifying Rusty modules.
More native as possible. For a framework target wasm and rely on things like skia-safe
and wgpu
.
No, I don't understand bidirectional type checking at all, so I'm paralyzed for now, and I also am not sure I want a "Rusty" language (too complex to implement (e.g. decl and proc macros) and there are some feature tradeoffs compared to the other dialect I like).
1 post - 1 participant
🏷️ Rust_feed