Jun 07, 2019

Nondeterministic Evaluation

We recently looked into a simple metacircular evaluator interpreting a part of Lisp. We saw that it was possible to reimplement some of the functionalities by parsing Lisp expressions. We also saw that by slightly changing the order of application, we were able to turn our language into a lazy language. Today we will look into nondeterministic evaluation, also called ambiguous evaluation, another concept which can be made available to the language by re-modeling our evaluator in the same way as we did to introduce laziness.

Racket

May 31, 2019

Lazy Evaluation

Last week we implemented a metacircular evaluator in Racket, evaluating a subset of Racket language. We saw that the main functions part of an evaluator are eval evaluating the meaning of an expression and apply, applying a procedure to arguments. We wrote the evaluator following the order of execution of arguments and procedures from Lisp. Lisp being an applicative-order language, when provided a procedure with parameters, the parameters get evaluated before the procedure is applied. As opposed to normal-order languages, also called lazy languages, which delay the evaluation of arguments until the result of the procedure application is required. Today we will see the implication of this slight change in order of application by modifying our evaluator created last week, transforming it into a lazy evaluator.

Racket

May 23, 2019

Metacircular Evaluator In Lisp

In previous posts, we explored the concepts of abstraction, mutability, and closure. A common point to all of them is that they were made available by programming languages. In fact, programming languages can themselves be seen as a very low level abstraction composed by a set of expressions. A programming language is written by composing functions together, like any other program, and interpreting the meaning of expressions given. Today we will look at how we can create an evaluator by implementing a metacircular evaluator supporting a subset of the syntax of Lisp.

Racket

May 17, 2019

Algorithm Optimization With Dynamic Programming

Dynamic programming (DP), is an algorithm design technique used to turn exponential complexity problems into polynomial complexity problems. Described as careful brute force (Erik Demaine - MIT course 6.006), problems are deconstructed into overlaping subproblems, solved indepedently with brute force, subproblems solutions are then cached and reused. The reusability aspect being a major contributor to the optimization due to the overlapping nature of the subproblems.

Mathematics

May 10, 2019

Nginx Proxy Pass

In a previous post, we saw how we could host an ASP.NET Core application behind Nginx. We saw that Kestrel works as a selfhost webserver and that in order to get request forwarded to it, we need to proxy them using the location and proxy_pass directives. Today we will look into some details regarding path handling, ensuring that our requests are forwarded properly.

NGINX

May 03, 2019

Nginx Gzip

When building single page applications, like Angular applications, where the entire application is sent over HTTP, compressing static files before serving them can provide a major boost in performance, drastically reducing latency. One of the most common compression algorithm widely supported by reverse proxies and browsers is Gzip. Today we will see how we can enable gzip compression on Nginx.

NGINX

Apr 26, 2019

Angular Webpack Proxy Dev Server

Angular CLI provides an easy way to host Angular applications during development by using Webpack dev server. Due to the fact that Webpack dev server is a web server, our frontend gets hosted on a separate web server which causes CORS issues if we want to call endpoints on a backend which we also host locally for development. Today we will see how we can use one of the features of Webpack dev server to setup a proxy during development which will proxy calls from the Angular application to our local backend hence by passing the CORS issue.

Angular

Apr 19, 2019

Delayed Evaluation And Infinite Stream

In our previous post on mutability, we discussed the fact that time was to be taken into consideration when mutability was involved. We observed objects lifetime as instant by instant, computing and assigning objects states for each instant. Another way to look at time is to consider the state as a discrete set of values. From this perspective, we can see the time as being an infinite sequence, a stream, and the state can also be seen as a stream computed out of time.

Racket

Apr 12, 2019

Powershell

PowerShell is versatile command line shell which comes with a powerful scripting language. It is now even more available than before with the new PowerShell Core which makes it available on Linux. Even though the main commands in the scripting language have been around for ages, I always see myself having to re-learn how to use it every time I need to write a script.

Azure

Apr 05, 2019

The Cost And Benefit Of Mutability

Mutability is a topic of high interest in the view of developers adventuring themselves in functional programming languages where it is generally unwelcomed and, in some instances, made voluntarily hard to implement. In contrast, object oriented programming has assignment at its core. Objects are represented as entity with a state modifiable over the lifetime of the application.

Racket

Mar 29, 2019

Understand Data Abstraction With Examples

Data abstraction allows us to think about complex systems in term of their properties rather than their implementations. Reasoning in term of properties provides a ground of assumptions which can be used to create new systems. In common programming languages, abstraction is present everywhere, as interfaces, as abstract and regular classes, as functions, as function signatures, as user interfaces, etc. All of theses tools provide a way to build layers of abstraction which we can work on top of to create new functionalities by manipulating data on the appropriate layer.

Racket

Mar 22, 2019

Angular Progressive Web App

Progressive Web App allows an Angular website to be installed locally and be available on the app drawer and on the home screen of a phone. Today we will see how to use Angular Progressive Web App module to transform our app into a mobile app.

Angular

Mar 06, 2019

Cycle Detection With Floyd Tortoise And Hare

Floyd’s Tortoise and Hare is a cycle detection algorithm operating on a linked list. The algorithm is based on two pointers, the tortoise and the hare, moving on the linked list at a different speed. The algorithm can be used to find cycle existence, deduces the beginning of the cycle, and the length of a cycle. Today we will explore the mathematical proof behind the algorithm and we will implement it in Racket.

Racket Python

Mar 01, 2019

The Basket Of Apples Problem With Tree

Working with trees is an interesting task. Today we will look into the Basket of Apples problem, which can be solved using a tree structure. This deep dive will allow us to explore how we can reason around trees and understand concepts allowing us to vocalize ideas.

Mathematics