Examples of declarative style in Rust

This page summarizes the projects mentioned and recommended in the original post on /r/rust

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • lazy-iterators

    Lightweight iterators for various sets where the elements are computed on demand.

  • Looking at the first example about iterators. I agree that Rust's Iterator API is awesome. But is there any fundamental reason you couldn't write a similar one in C++? (Example: https://github.com/cwzx/lazy-iterators) We know the STL made different choices, and it's also just much older, when "declarative" expressions weren't quite as in vogue. The example with find_if is pretty damn close to as declarative as the Rust version. The only "loss" is that the STL algorithms are eager, so you have to combine the nth feature as part of the predicate. You could even combine the if and returns with a ternary to make it more expressiony. And as /u/MysteryManEusine wrote, C++20's ranges makes it just as declarative. Also, using the matches! macro feels little like cheating- without it, the lambda is exactly the same as the C++ version. Both are pretty declarative anyway.

  • patterns

    A catalogue of Rust design patterns, anti-patterns and idioms

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • json

    JSON for Modern C++

  • As for the serialization stuff, something kind of similar does exist in C++: https://github.com/nlohmann/json#simplify-your-life-with-macros. Remember that serde is not part of Rust. It's a third party library. As is structopt.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Show HN: Jsonpak: JSON that is not bloated for Nim

    1 project | news.ycombinator.com | 24 Apr 2024
  • JSON for Modern C++ 3.11.3 (first release since 473 days)

    1 project | /r/cpp | 30 Nov 2023
  • It is either a clever technique or a sad failure

    1 project | /r/ProgrammerHumor | 14 May 2023
  • How to compile project to separate files to prevent having single large executable as a result?

    1 project | /r/cpp_questions | 13 May 2023
  • C++ that allows tracking peer to peer multimedia streaming connections using a Flat File - NOT MySql

    1 project | /r/i2p | 14 Apr 2023