As explained by Wikipedia, small-step semantics formally describe how the individual steps of a computation take place in a computer-based system. Big-step semantics describe how the overall results of the executions are obtained.
Monthly Archives: February 2012
Coq’s Require Import vs Require Export
The difference between Require Import MyModule and Require Export MyModule is well explained in the modules tutorial:
If a required module depends on other modules then the latter’s are automatically required beforehand. However their contents are not automatically visible. If you want a module M
required in a module N
to be automatically visible when N
is required, you should use Require Export M
in your module N
.
Double-Checked Locking
I read this paper on double-checked locking. It had a great discussion of the pitfalls of using this approach for implementing the Singleton Pattern. Here is a typical example of an unsafe implementation:
public static Singleton getInstance() { if (instance == null) { synchronized(Singleton.class) { if (instance == null) instance = new Singleton(); } } return instance; }
Chromium Switched from Bsdiff
I found it interesting that Chromium developers implemented their own algorithm to replace bsdiff. I do not fully understand how (efficient) binary patching works, so this is a good starting point…
Encapsulation is not information hiding
Notes from Encapsulation is not information hiding:
- Encapsulation rule 1: Place data and the operations that perform on that data in the same class
- Encapsulation rule 2: Use responsibility-driven design to determine the grouping of data and operations into classes
- Information hiding rule 1: Don’t expose data items
- Information hiding rule 2: Don’t expose the difference between stored data and derived data
- Information hiding rule 3: Don’t expose a class’s internal structure
- Information hiding rule 4: Don’t expose implementation details of a class
Java Modeling Language (JML)
JML is a formal behavioral interface specification language for Java as documented in Design Contract With JML linked to from the University of Central Florida JML homepage. I read just the first half of the paper.
Learning Something New Every Day
Welcome to Daily Ed. The purpose of this blog is to document something new that I learn each new day. I guess I view it as a test of the common idiom…