Show HN: Loop macros, label break, slices in C with the Cedro preprocessor

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

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
  • cedro

    C programming language extension: Cedro pre-processor

  • Hi, when I presented the first release here 8 months ago (https://news.ycombinator.com/item?id=28166125) it got interesting comments and today I’ve made a new release with additional features:

    - Break out of nested loops: break label; (https://sentido-labs.com/en/library/cedro/202106171400/#labe...)

    - Notation for array slices: array[start..end] (https://sentido-labs.com/en/library/cedro/202106171400/#slic...)

    - Loop macros: #foreach { ... #foreach } (https://sentido-labs.com/en/library/cedro/202106171400/#loop...)

    The possibility of loop macros was discussed in this thread: https://news.ycombinator.com/item?id=28166698

    At the time I hadn’t figured out how to make it useful without type information, but now it works. The same for the array slice notation: it took me a while to figure out how to make it do something useful without reflection, with a purely syntantical transformation.

    Loop macros are useful for the kind of things for which you would use x-macros (https://en.wikipedia.org/wiki/X_Macro), with the advantage that it does not pollute the global namespace with macro names and the body of the macro stays more similar to the final result, which makes big macros easier to read.

    Since it runs before the standard C preprocessor it can do things like building up `_Generic` macros as shown in the loop macro vec example: https://sentido-labs.com/en/library/cedro/202106171400/#loop...

    Source code (Apache 2.0 license): https://sentido-labs.com/en/library/ or https://github.com/Sentido-Labs/cedro

  • 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
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