On Saturday, 19 March 2016 at 08:38:20 UTC, Basile B. wrote:
On Saturday, 19 March 2016 at 01:22:19 UTC, Piotr Szturmaj
wrote:
https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md
Looks like it has some features that D has too, for instance
CTFE and default value initialization that can be disabled.
Not that it's a superior language, but I like its
fresh/innovative approach.
https://a.thumbs.redditmedia.com/eo8ea7bl1ZrGQBovtU4jAmHzETH8-4xxfbt6rA5xEU4.png
"Not planned
- [...]
- Constructors and Destructors
"
seriously ?! constructors and destructors are always needed for
manual memory managment !
Otherwise there's something that's pretty in the syntax:
identifier : type = initializer; // straight declaration
identifier : type; // no init
identifier := initializer; // infered type
However later in the function declaration:
"sum := (x: float, y: float, z: float) -> float {
return x + y + z;
};"
I would expect the same system as for variables:
"sum : float = (x: float, y: float, z: float) {
return x + y + z;
};"
or return type inference:
"sum := (x: float, y: float, z: float) {
return x + y + z;
};"
I actually find syntax the weakest point of Jai. Things like
`it`, `#run`, etc. are extremely ugly and bad design, IMO.
D's syntax is much cleanner, IMO:
enum str1 = "manifest constant";
auto str2 = " run-time variable";
alias sum = (x, y, z) => x + y + z;
immutable float[SRGB_TABLE_SIZE] srgb_table =
generate_linear_srgb();
foreach (idx, ref value; arr)
value += idx;
Otherwise there are many good ideas like more powerful CTFE,
Data-oriented structures, Integrated build process, structs with
pointer ownership and better control over inlining.
The "Other Cool Stuff", bounds checking, here strings sections
looks like directly but poorly copied from D.