2 ms·
This is weird. As soon as I thought about the subject the relevant article showed up on HN. I was thinking about how to embed custom high level language into m
by FpUser 8mo ago
This is weird. As soon as I thought about the subject the relevant article showed up on HN.
I was thinking about how to embed custom high level language into my backend application written in C++. Each individual script would compile to native shared lib loadable on demand so that the performance stays high. For this I was contemplating exactly this approach. Compile this high level custom language with very limited feature set to plain C and then have compiler that comes with Linux finish the job.
- drivebyhooting 8mo agoWhat’s your use case for this? I’ve done a few such things for compiling ML models, but in the end I always regretted it.
- FpUser 8mo agoThe software calculates a whole bunch of parameters based again on whole bunch of input variables, The logic looks like if A is 1 and B is 2 then make X = Z + 0.5xB - Y but if B is from 3 to 6 then here comes some other formula. So if we we call bunch of these a Package then there are literally hundreds of such packages and some people are doing nothing but adjusting those for some specific cases and customers. So my backend is busy constantly executing those requests and no I can not cache the values for whatever reason. Currently the formulas are encoded as arrays of in memory structures and backend goes through those and executes. The performance is ok but can be increased more than 10 fold if replaced with the native code. More than that people who write the initial riles can easily comprehend what they write but have mental problems with the visual editor that creates rules as the intermediate representation.