News for hackers. Stuff that matters.
Re:Fish (shell) porting to Rust from C++ by xigoi on Tuesday January 31, 2023 @08:31AM (#34594774)
Ranges: kind of, there is the very awkwardly named std::ranges::iota_view, but it doesn't support random access and who knows if the compiler can optimize iteration over it into a simple loop.

Modules are not supported by most compilers (in g++ you have to enable them as an experimental feature with -fmodules-ts, and if you want to import the standard library as modules, you need to pre-compile them into your project directory with some arcane commands).

Re:Fish (shell) porting to Rust from C++ by pjmlp on Tuesday January 31, 2023 @09:48AM (#34595634)
Ranges: they are there, naming is a matter of taste.

Modules: GCC and clang will eventually get there, I am already enjoying them on VC++

Re:Fish (shell) porting to Rust from C++ by jstimpfle on Tuesday January 31, 2023 @01:25PM (#34599397)

    #define RANGE(type, name, last) type name = 0, last__ = (last); name != last__; name++

    for (RANGE(i32, i, foo->count))
        ...
That solves the problem even in C. But why care much, typing a few plain loops isn't among the hard problems to solve.