News for hackers. Stuff that matters.
Re:A Zig Diary by lloydatkinson on Wednesday January 11, 2023 @08:14AM (#34338009)
I hope one day Zig is capable of targeting AVR microcontrollers, all anyone seems to target with new languages for embedded these days is ARM. Great, exactly what we need, another homogeneity in CPU architectures.
Re:A Zig Diary by Ristovski on Wednesday January 11, 2023 @08:41AM (#34338281)
Re:A Zig Diary by grawp on Wednesday January 11, 2023 @11:39AM (#34340451)
Sry but that is just some completely optional 3rd party library.

Zig has been compiling to AVR targets sucessfully for a very long time.

Re:A Zig Diary by ikskuh on Wednesday January 11, 2023 @08:52AM (#34338423)
Zig is not perfect on targeting AVR, but it's capable enough to not be a PITA.

Since we've made microzig supporting AVR targets (currently atmega328p only, feel free to add more), i'm not using anything else.

Oh and: We can target an ATtiny1616 without problems. avr-libc doesn't officially support the Tiny2 family yet.

Re:A Zig Diary by lloydatkinson on Wednesday January 11, 2023 @10:40AM (#34339652)
328p is what I was thinking of when writing this!
Re:A Zig Diary by ikskuh on Wednesday January 11, 2023 @03:26PM (#34344162)
Then you definitly should check out MicroZig!

I will push my bugfixes for current master branch tomorrow or later, so you can directly play around!

Re:A Zig Diary by audunw on Wednesday January 11, 2023 @09:02AM (#34338541)
> all anyone seems to target with new languages for embedded these days is ARM

.. and RISC-V. Zig does work with RISC-V, to some degree at least.

I hope Zig support for AVR improves. For legacy reasons. But I don't think we need more AVR going forward. It's rather proprietary, no?

Re:A Zig Diary by ikskuh on Wednesday January 11, 2023 @03:41PM (#34344394)
If everything goes according to plan, Zig will be the only language that is capable of actually utilizing the AVR 24 bit address space properly, while also allowing you to make nice optimizations with the smaller 16 bit address spaces (Zig has first class address spaces on memory)

Also, RISC-V support is working quite fine, and i don't see much problems with that.

> But I don't think we need more AVR going forward. It's rather proprietary, no?

AVR is Arduino. It would be a bad action to basically say: "well, zig is not going to support the most widespread maker hardware on the market"

Re:A Zig Diary by grawp on Wednesday January 11, 2023 @09:24AM (#34338773)
Zig doesn't support AVR? It's news to me since I was using Zig on Atemega328p a whole year ago and even with true debugging via debugwire in VSCode.
Re:A Zig Diary by kuon on Wednesday January 11, 2023 @10:06AM (#34339210)
Zig will have a C back-end which will provide support for many of this kind of hardware. And I think you can make avr work at present but I do not know the state of the support.