Elektrine lite

← Feed

@cda@macaw.social

Post #2937839

2026-05-13 18:51 UTC

The more I thought about that this morning, the less I liked it compared to just exposing the internal struct fields like `a_string_var.len` and `a_string_var.bytes` and just special casing field access and pass-by-value in the compiler. No special sauce pseudo-functions.

Replies (2)

  • @cda@macaw.social 2026-05-13 18:53

    ... and then operators like + or assignment are just special cased for str...

    Open ##2937840

  • @swetland@chaos.social 2026-05-13 23:05

    @cda@macaw.social This is what I've been leaning toward... having the string/slice entities basically be structs with a couple extra rules around their usage. The thing I really need to sort out is handling larger-than-single-register/word value types, which I think may entail decomposing variables of such types into groups-of-variables. Trying to avoid having to re-engineer the entire codegen phase of things (which presently assumes 1:1 param/variable:register, one register/value result of each expr, etc)

    Open ##2937842