Construction of ITER fusion reactor is nearing it's completion

Construction of the ITER project is nearing it's completion

To boldly Go and isolate

  • By Artem V. Shamsutdinov
  • August 7th, 2021

The solution to natural DAO logic

For quite a while now I've been dreading having to write Firebase-like rules for mutation logic. I have a number of reservations about writing a custom syntax engine:

  • Developers have to learn yet another domain specific language
  • It will be more limited than TypeScript
  • It would take time to write and get right

So, I've been searching for a way to run server side DAOs. Based on what I found all JavaScript sandboxes (apparently there are only a couple of them out there) are both slow and can be compromized. So after initial surge of excitement I had to give up on an easy way sandbox JavaScript. Yet the idea of just running DAO logic to do server-side validation and server side transactions was just too natural and convenient to give up on so I finally determined that I would write an engine that would take parsed TypeScript, serialized the AST to JSON and another engine that would take that AST and re-generate JavaScript on the server side and do an "eval" call to re-construct safe DAO logic on the server-side. Of course this solution would (at least initially) be very limited in the syntax it would support and would take a bunch of time to write and get right (just like the Firebase-like rule engine, though probably a bit simpler).

Then during a design review at my day-time contract Golang came up and I was joyfully explaining how easy it is to learn and use. A couple of days later it hit me (thank God): Shouldn't I be able to run the V8 engine isolates and should Go (being compiled to binary) be runnable on mobile platforms, just like SqLite can be run in Cordova? Well, it turns out that the hard work of making it possible has already been done:

Having these 3 projects, along with a fast GoLang web server makes writing a mobile app that uses V8 Isolates feasible for me (last time I used C was in a Scientific Computing course about 20 years ago).

JavaScript isolation in Browser

One of the goals of AIRport is to provide a zero-install environment for user trial. This is the main reason why it's written it TypeScript (it can run entirely in Web Browser, with either WebSql or SqlJs). So it took a bit more thinking that DAO isolation can be done in the browser with cross-domain iframes. The main AIRport frame will contain one child frame for every schema. The child frame will run on a different domain than the main frame and won't be able to call main framework code directly (only via postMessage).

The future is bright

Anyway, I'm very exited about where the DAO code will be headed with these fundings. Essentially this means that the developers are now free to write whatever logic the choose to see fit (and include whatever libraries they need for processing). This make possible to write reusable server-side domain logic, which will allow to reuse much more than the underlying schema and further simplifies writting specialies add-on apps (while giving the original application creator more assurances about their work being used properly).