# Introduce type-erased writers to C backend codegen · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/2b2c9c5db893c7bc0352d1738c1658a5fcd32d62)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 2b2c9c5db893c7bc0352d1738c1658a5fcd32d62

Requested commit: 2b2c9c5db893c7bc0352d1738c1658a5fcd32d62

Commit: 2b2c9c5db893c7bc0352d1738c1658a5fcd32d62

Tree: 0d044a1eb182c5705b4998e1a875e260571e0cd2

Author: Ian Johnson

Committer: Ian Johnson

## Message

````
Introduce type-erased writers to C backend codegen

This reduces generic instantiations of several write functions.

Before:

```
@as(type, io.writer.Writer(*array_list.ArrayListAligned(u8,null),error{OutOfMemory},(function 'appendWrite')))
@as(type, io.writer.Writer(*codegen.c.IndentWriter(io.writer.Writer(*array_list.ArrayListAligned(u8,null),error{OutOfMemory},(function 'appendWrite'))),error{OutOfMemory},(function 'write')))
```

After:

```
@as(type, io.GenericWriter(io.Writer,error{OutOfMemory},(function 'write')))
```

````

## Parents

- [cc25756b3f33578774b557bdf09dcc9e918c1e5a](https://git.cafe/gitcafe/zig/commit/cc25756b3f33578774b557bdf09dcc9e918c1e5a?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/2b2c9c5db893c7bc0352d1738c1658a5fcd32d62?format=markdown)
