HAC for native targets - blog post

A few details about the newest development of HAC for native targets:

Gautier's blog: HAC for native targets

Enjoy!

4 Likes

That’s interesting.
Any roadmap on the supported targets ?

Would LLVM-based tech be useful?

Again thank you for this! I do have a question about what the purpose of emit_push_discrete_literal(s) specifically are for in this context? I’m playing around with the PIC24 on it which is a 16 bit target, so registers are naturally 16bit but it can still handle variables of 32 bit size. For efficiency I feel like I want to make emit_push_discrete_literal(s) work only with 16bits but don’t know if that will hurt me later when I want to support 32bit variables and operations. I don’t have a good feel what those two target operations are meant to do. Looking through the code I seem some things that make me think it is for hidden fields on certain types like strings and such? Any pointers on what I should be thinking about when I implement those ops?

Great work so far! thank you again

I would like first to go more in depth in the first target, in order to set up more details in the interface. For instance the stack is byte-wise for a real target, but a stack element, in the HAC VM, wraps everything “atomic”.

Possibly we need emit_push_discrete_literal for the default bit size (64 for the HAC VM, 16 for PIC24) and emit_push_discrete_literal_16, emit_push_discrete_literal_32, etc. to push precisely values with those bit sizes.
Does it look like a reasonable idea?

As long as you don’t make HAC depend on LLVM, it is certainly something to consider.

Yes, that does sound reasonable. I guess it depends on what kind of rabbit hole you want to go down with this. I would say see what your interface needs in order to distinguish different scenarios. The interface is still in infancy so we can always adjust as you morph it towards your needs. On my end just understanding the purpose of each of the functions with respect to the compiler logic helps a lot.