4 ms·
I don’t have any experience with Lisp. But I think C++ templates and Rust macros are both super bad and impoverished compared to what can be done in Jai. https
by forrestthewoods 2y ago
I don’t have any experience with Lisp. But I think C++ templates and Rust macros are both super bad and impoverished compared to what can be done in Jai.
https://www.forrestthewoods.com/blog/using-jais-unique-and-powerful-compiler-for-typesafe-units/ https://www.forrestthewoods.com/blog/using-jais-unique-and-p...
- SkiFire13 2y agoThe `#modify` thing looks pretty cool, but I can't help but think how a compiler/ide is supposed to analyze the body of such function and provide suggestions. Rust macros have a similar issue, but it's offsetted by the fact that generics are pretty powerful too and can be fully analyzed by the compiler.
- pjmlp 2y agoExcept Jai is never going to get the use any of them have, so we use what is there.
- forrestthewoods 2y agoThat is not a coherent sentence. I share it not to say “use Jai instead of C++/Rust”. But to instead say “templates and macros suck and it’d be great if Rust or other language copied good ideas into their ecosystem”.
- pjmlp 2y agoFirst we need to be able to use Jai, so that those folks can validate in practice how it works, not watching videos about someone using their creation.
- forrestthewoods 2y agoSomeone has to lead by example. Jai is trying things no one else is doing. No reason that Rust or other more widely available regions can’t lead. Rust certainly led the charge with the borrow checker. Why not do better than macros and templates and generics?
- pjmlp 2y agoLike D, which predated it, and everyone can use, with three available compilers.
- gpderetta 2y ago> I can't find a decent C++ units system. If one existed it would involve similarly grotesque templates full of std::enable_if and assorted wizardry. Boost.Units is 20 years old. There is an unit system built in in c++11 just for duration, but shows what it can be done. There is no reason ever to use enable_if since C++20. > Here's where Jai has a feature I've never seen before. I'm sure it exists in some language, but certainly not C++ or Rust! The feature is #modify which is not needed in C++; for historical reasons, typically type level metaprogramming still different from value level, but it is not hard: https://gcc.godbolt.org/z/PbzKeh38a Boost.Hana adds a lot of the required infrastructure.