BLAST - Performance Runtime Scripting in Unity (Bursted)


Disclaimer: THIS IS NOT MY WORK!

Hello!

I discovered some very cool project, and I don’t think author has posted it on these forums yet. Just wanted to raise awareness.

Basically, it is scripting language & engine, that runs in burst and is vectorized (via SIMD).
It is very simple language and has limitations.

I hope some of you may find it useful or maybe appreciate it for its niche. :stuck_out_tongue:

Links:

Reddit (where author claims he got job and released it for free)
GitHub Release: BLAST 1.0.4e - a ssmd script engine for unity : Unity3D (reddit.com)

Reddit (where I saw it originally)
Scripting with burst in unity with blast : Unity3D (reddit.com)

Github Repo
GitHub - nijnstein/Blast: Blast Script Engine

Github Docs
GitHub - nijnstein/BLAST-Documentation: https://blast-script.com/

Asset Store (free at time of thread creation)
BLAST - High performance runtime script interpretor, Burst and DOTS compatible | Visual Scripting | Unity Asset Store

1 Like

I wish they would explain what use cases this is preferred over using HPC and burst.

The same advantages as any run-time scripting, I guess, like being able to test code changes without recompilation and domain reloading, mod support, and the possibility for hot reloading, but with a focus on SIMD/vectorization.

Unreal’s Niagara particle system work somewhat like this too: CPU particle systems are actually script bytecode running on a SIMD-based VM.

I’ll just leave a link here to another thread made by the author of BLAST:

The thread has a somewhat obscure name, so it might be hard to find by itself.

Unfortunately the author did not update the package for quite a while, and did not follow up the roadmap that’s outlined on the Asset Store page. So I have an impression that while BLAST is already quite usable – the demos work fine, it now has only a fraction of its full capacity.

There are issues in the BLAST Github repo, and they have funding goals, so probably it’s now in that goal-oriented paymode, rather than having a price tag on the asset itself.

I wish the author created a Discord server so that we could form some community and maybe see into funding the goals.

how fast can BLAST be (for basic/advance usage)

as apparently BLAST is meant to be like, super fast for integer/float calculations (in tens of nanoseconds range) right?

how does such compare to modern JIT’s such as LuaJIT ( still the fastest JIT ? ), C#, Java, ect

and modern C/C++ compilers such as LLVM 17
(given, embedding a C++ compiler and having it function as a JIT (eg, transpile to C++, compile to LLVM IR/OBJ, link with running application + execute, all at runtime without recompiling entire application) is a large task)

https://assetstore.unity.com/packag…time-script-interpretor-burst-and-dots-210942

BLAST currently features:

  • Datatypes: float, float2, float3, float4, int, int2, int3, int4, bool32, constant length arrays
  • Control flow instructions: switch, while, for, if then else
  • External function support, with the interface defined through codegen for ultimate performance
  • The Unity Mathematics library directly accessible through script
  • Flexible datasegment mapping, you can move the data and stack pointers to directly work on the data instead of copying it.
  • Define inputs in script that map to arrays of floats.
  • Extremely compact bytecode compiled from script in milliseconds. Byte sized instructions, 7bit addressing and smart constant handling result in bytecode that make surprisingly large scripts fit in a single cache line with the resulting performance benifits.
  • Simple but powerfull compiler that flattens the input script and removes all nesting resulting in a linear execution path with minimal stack use and branching.
  • Extremely fast execution. “A = Sin(x)” takes only 40ns to interpret, this is 10x faster then a leading jit script compiler. In ssmd mode it can process the same script in 1.5 nanoseconds, 750.000.000 times per second on 1 thread.
3 Likes

I found it recently on asset store.
Works mostly fine.

Any idea, how to make it work with jobs?
Seems it works, if using system.treads.