Endianness of date and address formats in Europe and the US
seen from United States
seen from China

seen from United States
seen from United States
seen from Yemen
seen from United States

seen from Türkiye

seen from United States

seen from United States
seen from Aruba

seen from United States
seen from United States
seen from United States

seen from United States

seen from United States
seen from United States

seen from United States
seen from United States
seen from China
seen from China
Endianness of date and address formats in Europe and the US
lets talk about... bi-endianness
Backend Serialization — JSON, Pickle Opcodes & The Universal Type Fallacy (2026)
Mastering Data Exchange: A Deep Dive into Serialization and Deserialization
The process of sending data over a network or storing it on a hard drive is a complex one, involving the dismantling of intricate memory structures into a linear stream of bytes. This process, known as serialization, is a crucial aspect of backend architecture, enabling the efficient exchange of data between disparate systems.
The Challenges of Data Exchange
When dealing with complex data objects, such as a Python User object, the memory addresses and pointers that comprise the object are unique to the local system. Attempting to send these memory addresses over a network would be futile, as the receiving system would be unable to interpret them. Instead, the data must be serialized, or flattened, into a format that can be easily transmitted and reconstructed on the receiving end.
The Importance of Standardization
The concept of universal types, where an integer is an integer regardless of the programming language or hardware platform, is a myth. In reality, different languages and platforms store data in distinct ways, making standardization a critical aspect of data exchange. Serialization protocols like JSON serve as a universal translator, bridging the gap between these disparate systems.
The Limitations of JSON
While JSON is a widely adopted and versatile serialization format, it is not without its limitations. The process of parsing JSON strings can be computationally intensive, particularly when dealing with large payloads. This is because JSON is a text-based format, requiring the receiving system to read and interpret every character in the string.
Alternative Serialization Protocols
In homogeneous environments, where the sending and receiving systems share the same underlying memory engine, alternative serialization protocols like Structured Clone (in JavaScript) or Pickle (in Python) can offer significant performance advantages. These protocols bypass the need for string parsing, instead using highly optimized, binary formats that map closely to the language's internal C-structures.
Real-World Applications
In Python, both JSON and Pickle are commonly used serialization protocols. JSON is often preferred for its universality and security, while Pickle is used for its speed and efficiency in homogeneous environments. The choice of protocol ultimately depends on the specific use case and requirements of the application.
Example Use Cases
import json import pickle import datetime # JSON Serialization data = {"user_id": 99, "role": "admin"} json_payload = json.dumps(data) print(f"JSON String: {json_payload}") # JSON Deserialization parsed_data = json.loads(json_payload) print(f"Restored: {parsed_data['role']}") # Pickle Serialization pickle_payload = pickle.dumps(data) print(f"Pickle Bytes: {pickle_payload}") # Pickle Deserialization restored_data = pickle.loads(pickle_payload) print(f"Restored: {restored_data['role']}")
Understanding the Trade-Offs
When choosing a serialization protocol, it is essential to consider the trade-offs between universality, security, and performance. While JSON offers a high degree of universality and security, it may not be the most efficient choice for large payloads or homogeneous environments. On the other hand, protocols like Pickle offer superior performance but may be less secure or less universal. Ultimately, the choice of protocol will depend on the specific requirements of the application and the trade-offs that are acceptable.
Read the full technical breakdown on my blog
DataType in C
Datatype in C:- Data type Size (Bytes) Range Format SpecifiersChar 1 – 128 to 127 %c Unsigned char 1 0 to 255 %c Short or int 2 – 32,768 to z32, 767 %i or %d Unsigned int 2 0 to 655355 %u Float 4 3.4e – 38 to +3.4e +38 %f or %g Long 4 2147483648 to 2147483647 %ld Unsigned long 4 0 to 4294967295 %lu Double 8 1.7e – 308 to 1.7e+308 %lf Long double 10 3.4e – 4932 to 1.1e+4932 %lf
View On WordPress
How to: Detecting endianness programmatically in a C++ program
How to: Detecting endianness programmatically in a C++ program
Detecting endianness programmatically in a C++ program
Is there a programmatic way to detect whether or not you are on a big-endian or little-endian architecture? I need to be able to write code that will execute on an Intel or PPC system and use exactly the same code (i.e. no conditional compilation).
Answer: Detecting endianness programmatically in a C++ program
As pointed out by Coriiander,…
View On WordPress
How to: How do I convert between big-endian and little-endian values in C++?
How to: How do I convert between big-endian and little-endian values in C++?
How do I convert between big-endian and little-endian values in C++?
How do I convert between big-endian and little-endian values in C++?
EDIT: For clarity, I have to translate binary data (double-precision floating point values and 32-bit and 64-bit integers) from one CPU architecture to another. This doesn’t involve networking, so ntoh() and similar functions won’t work here.
EDIT #2: The…
View On WordPress
C code to check your system's endianness
/* if you don't know what is "Endianness", here is a wikipedia article about the topic: Endianness */
#include <stdio.h> int main(){ unsigned short s = 0x0001; unsigned char c; /*point to 's' using a char pointer, then dereference it, this will access the first byte of 's' and copy it to 'c'.*/ c = *(unsigned char *) &s;
if(c == 0x01){ printf("this is a little endian system.\n"); }else{ printf("this is a big endian system.\n"); } return 0; }