Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 2592

Rescript vs ZScript

$
0
0

So I will reply one by one to your message:
1)Macro: I read the doc you showed of rescript it is good design.
My macro are somewhat different like they are function like and even they can be exported from libs also biggest thing they are basically exported comptime + args.
which means you can do anything in macro which you can in comptime also macro in ZScript can recive infinite args from user github.com/zscriptlang/zscript/blob/main/examples/showcase/v2_features.zs is logall and logargs in this
And the feature plan for which I made macro is for .dsx which will be moder alternative to tsx and jsx it will be different from them in tsx jsx tag becomes code but in ZScript tag becomes macro which will make ZScript more powerful and I will explain whole of its structure someday.
2)no defer and queue not use “using” in fact they are placed at end of block in compilied js automatically.
3)pipes into the first argument rescript style:

value |> map(fn) |> filter(pred)
// → filter(map(value, fn), pred)

4)match is fully expression-based in ZScript.
It returns a value, unlike JS switch.

let x = match v {
  1 => "one"
  2 => "two"
  _ => "other"
}

5)These are syntax sugar, not new semantics.
They compile to standard loops.
Making ZScript same as js is not main target.
6)js escape hatch is raw and unsafe.
ZScript is gradually typed, not unsound
Why my post have been flagged I recieved a message saying it is flagged by system


Viewing all articles
Browse latest Browse all 2592

Trending Articles