Elektrine lite

← Feed

@wren6991@types.pl

Post #3156294

2026-02-04 15:07 UTC

@thezoq2@mastodon.social Any plans for some kind of metaprogramming? I read through the docs a while back and I want to like it, but the lack of comptime mutable variables and for loops (or an equivalent functional construct) feels a bit limiting. For example how would I write a parameterised one-hot-to-binary in Spade?

Replies (1)

  • @thezoq2@mastodon.social 2026-02-04 15:09

    @wren6991@types.pl Metaprogramming has improved quite a bit in the past year or so. We don't have any for-loops yet, but functional (recursive) metaprogramming works pretty well There are a few examples of this in https://gitlab.com/spade-lang/lib/nstd/-/blob/main/src/array.spade?ref_type=heads Metaprogramming still isn't quite where I want it to be, but it is certainly doable

    Open ##3156295