Кресты / Говнокод #26794 Ссылка на оригинал

0

  1. 1
Rust лучше крестов?

Запостил: OlegUP OlegUP, (Updated )

Комментарии (12) RSS

  • Ну он не настолько безумен, как кресты. И не пытается отстрелить тебе ногу на каждом шагу.

    Но насчёт практичности - х.з. Есть мнение, что без unsafe и адовой ёбли с borrow checker'ом там ничего интересного не запилить.
    Ответить
    • Костя когда-то говорил что пuтух: это штука прямо противоположная Сишке.
      Точнее это Анти-Фортран.

      Irritating things that can probably be fixed

      * Macros system is lacking. It’s great for code but if you want to use macros to have more compact data representation—tough luck. For example, in Indeo3 codebooks have sequences like (a,b), (-a,-b), (b,a), (-b,-a) which would be nice to shorten with a macro. But the best solution I saw in Rust was to declare whole array in a macro using token tree manipulation for proper submacro expansion. And I fear it might be the similar story with implementing motion compensation functions where macros are used generate required functions for specific block sizes and operations (simple put or average).
      * Also the tuple assignments. I’d like to be able to assign multiple variables from a tuple but it’s not possible now. And maybe it would be nice to be able to declare several variables with one let;
      * There are many cases where compiler could do the stuff automatically. For example, I can’t take a pointer to const but if I declare another const as a pointer to the first one it works fine. In my opinion compiler should be able to generate an intermediate second constant (if needed) by itself. Same for function calling—why does bitread.seek(bitread.tell() - 42); fail borrow check while let pos = bitread.tell() - 42; bitread.seek(pos); doesn’t?
      * Borrow checker and arrays. Oh, borrow checker and arrays.

      This is probably the main showstopper for implementing complex video codecs in Rust effectively.
      Rust is anti-FORTRAN in a sense that FORTRAN was all about arrays and could operate arrays safely while Rust safely prevents you from operating arrays.


      Именно поэтому «Царь» против «Пuтyха»
      Ответить
      • А что это за Костя Кодеков такой?
        Ответить
  • * Compilation time is too large IMO. And any time above five seconds is irritating to wait. I understand why it is so and I hope it will be improved in the future but for now it’s irritating;
    And, on the similar note, benchmarks. While overall built-in testing capabilities in Rust are good (file it under good things too), the fact that benchmarking is available only for limbo nightly Rust is annoying;

    * No control over allocation. On one hoof I like that I can not worry about it, on the other hoof I’d like to have an ability to handle it.

    * Poor primitive types functionality. If you claim that Rust is systems programming language then you should care more about primitive types than just relying on as keyword. If you care about systems programming and safety you’d have at least one or two functions to convert type into a smaller one (e.g. i16/u16 -> u8) and/or check whether the result fits.
    Ответить
    • >* No control over allocation.
      это как, как в джаве чтоли? это точно про системный язык?

      Я питуха не зна, но звучит страшно
      Ответить

Добавить комментарий

Я, guest, находясь в здравом уме и твердой памяти, торжественно заявляю:

    А не использовать ли нам bbcode?


    8