Prasanth Janardhanan

How to support custom Javascript scripting in Go Applications

Why will someone need a Javascript Parser, written natively in Go? Isn’t it a crazy, Architecture Astronauts solution that is looking for a problem? Not necessarily. There was a time when applications allowed some kind of scripting to extend them and to make them fit into any workflow. For example VBScript for Microsoft office products. However, very few Web applications have the infrastructure to allow custom scripts inside them. There are a few that does support; one example is Google Apps Script.

Continue Reading →

How to load from a JSON file to Javascript class object (Javascript/Typescript Serialization)

It is a common requirement to load a nested Javascript class from a JSON file. Sometimes you want to send the JSON across a network and load it back to a Javascript class. For better clarity, let us understand the difference between a Javascript class instance and an Object. Take this class for example: This is a class that draws a rectangle on the canvas class Rectangle{ public x:number=0 public y:number=0 public width:number=0 public height:number=0 public draw(ctx:CanvasRenderingContext2D) { ctx.

Continue Reading →