Search Unity

Burst Compiler use cases

Discussion in 'Burst' started by Laamato, Feb 16, 2021.

  1. Laamato

    Laamato

    Joined:
    Aug 27, 2017
    Posts:
    6
    So I've been puzzled by Burst for a while now. So am I on the right track with these thoughts?

    1. So Unity is rebuilding the core slowly but surely away from OOP to Data Oriented. Does this mean that all of the DOTS code is compiled with Burst? Does this mean that, for example, Entities 0.17, is fully compiled with Burst? Does this mean that in the future, Unity as a whole is/can be Burst compiled?

    2. Can HPC# work as a standalone language? For example, write some vanilla programs outside Unity? Does Burst include everything needed to produce IL. Or is Roslyn etc. needed to produce the IL as the first step?

    3. Using value types means we are mostly working on the stack, yes? If we get a pointer to heap, that will then be a reference type. But is this always so? Now there is pointer support to some degree in Burst. So is the pointer support comparable to C, that we ourselves manage the memory, allocate and free it. At least we see this behaviour in jobs when we allocate NativeArrays and later dispose them.


    Just curious :)
     
  2. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    4,264
    1) Most code is. Not all of it. Classical Unity will never be fully Burst compiled. Project Tiny might though.
    2) No. Burst compiles IL generated by Roslyn (or codegened by Cecil). Burst has a narrow focus and does not compile entire applications.
    3) As you point out, the difference between a pointer and a reference type is that memory is not automatically managed and there is no GC. And that's all Burst needs. It supports almost anything you would want to do with pointers, although sometimes its safety system acts like a nervous parent. :p