domingo, 26 de abril de 2020

7 Lin Clark on WebAssembly

Typically, we use an array of code to create a website. HTML is used for its structure, CSS for styling and Javascript for the website’s behavior. But it seems that there are better options for coding. On “Lin Clark on WebAssembly” by Software Engineering Radio with guest Lin Clark, she explains how WebAssembly gives the programmer more control over the code it will run, because Javascript was not made to be fast (it instead was made to be easy). But, with WebAssembly the code runs more consistently, and Clark gives us an example. She partnered with gaming studios like unreal engine and saw that WebAssembly ran smoother and eliminated the threat of frame drops which were common with Javascript.

WebAssembly then is a compiler that works in tandem with C, C++, or Rust to produce a smoother runtime code in the Javascript VM (virtual machine). It works with modules that provide functions. Although natively, WebAssembly only understands integers and floats. But, its compatibility with all kinds of software makes it worth it. That is because it removes a lot of the work needed to translate the code to work on each kind of operating system. With WebAssembly, the code is compiled and translated to the correct type of code for each instance.

Another interesting feature WebAssembly has is as the binary code downloads in chunks through the web, you can decode (no parsing needed) and compile it (Clark calls it ‘streaming compilation). And with the issue of security, every module is accessing its own memory object and thus cannot be accessed by third parties. If there is an attempt to do so, the module returns an error.

So, it appears that WebAssembly could become an important tool in the next few years for web developers to optimize their work. Which means, less time translating and more time creating and improving performance.

domingo, 19 de abril de 2020

6 Building Server-Side Web Language Processors


Following the thoughts of Ariel Ortiz in my previous post, we know delve into his article “Building Server-Side Web Language Processors”. This article defends the idea of teaching students to learn web language processors because they are more relevant to our current context. In other words, it is better suited for students in this day and age because they will be more prepared to face the problems of the real world via the widely used world wide web.

As stated in the article, we are focused more on the server-side of processing web language and not the client-side. Ortiz writes: “The purpose of a web language is to do some computations and then produce an output in the form of an HTML web page (or XML document, plain text, etc.). This means that a resulting page is built from two types of elements: dynamically generated elements and static content elements” (2) as the purpose of web design. This also helps students get used to using a template view which is web language code embedded in the presentation code. Or in other words, the dynamic elements are embedded in the static elements because of its similarity to the output it produces.

There are also other things to consider while building a web-based language. The HTTP (Hypertext Transfer Protocol) becomes a topic to be understood because it is fundamental to web building. It is the request/response between client and server, which are necessary to view what was coded. And related to this topic is the security issues that come with it.

Since the WWW is publicly used, your code can be found and modified if there are no security measures implemented (which would not happen in a command line shell). Therefore, students become aware of the threat lurking on the web and take steps to prevent those threats.

Ultimately, Ortiz’s idea for a web-based language processing could become a more relevant and enticing endeavor than a shell type approach.

lunes, 13 de abril de 2020

5 Ruby and the Interpreter Pattern


As stated in  “Language Design and Implementation using Ruby and the Interpreter Pattern” by Ariel Ortiz, we notice a different way to approach common code. The way Ruby approaches problems is object oriented and using interpreters, like Python. Which makes it easier to modify and expand. The SIF (S-expression Interpreter Framework) for Ruby determines a type of coding that builds up with an essential foundation: “The core of the SIF is very simple. It only supports integers, symbols, lists, and procedures.” (2)

Ruby is incredibly flexible and develops the programmer’s mind to think in an abstract way. Since there are multiple ways to extend the language, programming becomes synonymous with building. Ortiz mentions a few ways to produce new procedures to tackle problems. The code itself contains a few primitive procedures like arithmetic and it is possible to simply define a new primitive procedure to affect your code. It is also possible to create new classes with the special form function:
“For example, suppose we want to implement the if special form. Its syntax and semantics are as follows: Syntax: (if condition consequent alternative) Semantics: Evaluate condition, if the resulting value is not an empty list, evaluate and return consequent, otherwise evaluate and return alternative.” (3)

As Ortiz mentions, Ruby has the advantage of having its syntax and semantics separate. This means it is doubly important to know how to structure each of them to create a functional code. That said, that is why I believe it to be an excellent learning tool for programmers who want to delve deep into the core of code structure. Although, it is also true that if you do not understand its core procedures your code will not work. And, it develops the good habit of creating from scratch instead of copying and pasting from other code examples commonly found on opensource and alike.

7 Lin Clark on WebAssembly

Typically, we use an array of code to create a website. HTML is used for its structure, CSS for styling and Javascript for the website’s beh...