javascript

The lack of type safety was difficult to scale ... alvin July 15, 2018 - 1:36pm

From this AirBnB article about using React Native: “JavaScript is an untyped language. The lack of type safety was both difficult to scale and became a point of contention for mobile engineers used to typed languages who may have otherwise been interested in learning React Native ... A side-effect of JavaScript being untyped is that refactoring was extremely difficult and error-prone.”

Using structs in JavaScript (example, syntax)

Bearing in mind that I rarely use JavaScript and I’m not an expert in it, I like the idea of using something like a C-like “struct” in my JavaScript code, so I used the following approach on a recent project. First, I define my JavaScript struct:

function Book(title, href, imageUri, description) {
    this.title = title;
    this.href = href;
    this.imageUri = imageUri;
    this.description = description;
}

Then I define an array of Book types:

iPhone 8 vs Intel Core i5 web performance

With Twitter being Twitter, I saw this image there, and now I can’t find it again. But it shows that the new iPhone 8 is significantly faster at rendering a cnn.com page.

Actually, since I can’t find the original source, I don’t know if they both rendered mobile web pages, or whether they tried several times to make sure it wasn’t just a hiccup. But seeing that the architecture in a little phone can come anywhere near the performance of a desktop/laptop processor that’s still being sold makes one wonder about the future.

Update: I think this was the original source of the image.

Android: FLiB, a free Fast Little Browser alvin July 18, 2017 - 6:09pm

FLiB is a fast, free internet browser for Android devices. Read on for more details ...

A little Lisp interpreter alvin August 1, 2016 - 5:27pm

In the last post about Mary Rose Cook, the reason I originally found her work again today is because she wrote a Little Lisp interpreter in JavaScript. (116 lines of code.) As shown in the image, the beginning of the article is a very quick introduction to Lisp.

Learning FP: Experiences on the Elm language alvin July 31, 2016 - 4:47pm

This image is from a tutorial titled, Learning FP: Experiences on the Elm language.

I don’t know much about Elm yet, other than it’s an FP language for writing browser code, and it looks a lot like Haskell. As the tutorial author states, “Elm is a programming language that compiles to HTML5: HTML, CSS and JavaScript.” Another good quote is, “There are no worries about bugs due to weird mixed state as the state is always a direct result of input.”