Hacker News new | past | comments | ask | show | jobs | submit login

Sounds awesome. I have some abstractions for making interfacing easier, but I don't have any auto-generated structures.

https://github.com/fwsGonzo/rvscript

I have done that here. Example:

    APICALL(api_math_smoothstep)
    {
        auto [edge0, edge1, x] = machine.sysargs <float, float, float> ();
        x = std::clamp((x - edge0) / (edge1 - edge0), 0.0f, 1.0f);
        machine.cpu.registers().getfl(10).set_float(x * x * (3 - 2 * x));
        return 0;
    }
"machine" is an argument to each system call handler, so you can have multiple machines for many purposes. For example, I suspect you can use a machine as a savegame - because they are serializable.



Oh! So the emulator i was looking at was yours, it looked damn nice for just this task and i guess i know why now :D

Good choice on using var-arg-templates for passing arguments between env and host, i think moving over all scripting bindings to va-templatized bindings is the only sane option for the future (boy have i spent time fighting binding bugs in my days)




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: