100% found this document useful (1 vote)
485 views58 pages

Pro .NET 5 Custom Libraries: Implementing Custom .NET Data Types 1st Edition Roger Villela - The ebook is available for quick download, easy access to content

The document promotes a collection of ebooks focused on .NET programming, including titles by Roger Villela and Andrew Troelsen. It highlights the availability of resources for developing custom data types and libraries using .NET 5, as well as other related topics in .NET Framework and Core. Readers can download these ebooks in various formats from textbookfull.com.

Uploaded by

cemernania2a
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
485 views58 pages

Pro .NET 5 Custom Libraries: Implementing Custom .NET Data Types 1st Edition Roger Villela - The ebook is available for quick download, easy access to content

The document promotes a collection of ebooks focused on .NET programming, including titles by Roger Villela and Andrew Troelsen. It highlights the availability of resources for developing custom data types and libraries using .NET 5, as well as other related topics in .NET Framework and Core. Readers can download these ebooks in various formats from textbookfull.com.

Uploaded by

cemernania2a
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 58

Explore the full ebook collection and download it now at textbookfull.

com

Pro .NET 5 Custom Libraries: Implementing Custom


.NET Data Types 1st Edition Roger Villela

https://textbookfull.com/product/pro-net-5-custom-libraries-
implementing-custom-net-data-types-1st-edition-roger-
villela/

OR CLICK HERE

DOWLOAD EBOOK

Browse and Get More Ebook Downloads Instantly at https://textbookfull.com


Click here to visit textbookfull.com and download textbook now
Your digital treasures (PDF, ePub, MOBI) await
Download instantly and pick your perfect format...

Read anywhere, anytime, on any device!

Pro .NET Framework with the Base Class Library:


Understanding the Virtual Execution System and the Common
Type System Roger Villela
https://textbookfull.com/product/pro-net-framework-with-the-base-
class-library-understanding-the-virtual-execution-system-and-the-
common-type-system-roger-villela/
textbookfull.com

Exploring the .NET Core 3.0 Runtime: Through Code


Generation and Metadata Inspection 1st Edition Roger
Villela
https://textbookfull.com/product/exploring-the-net-core-3-0-runtime-
through-code-generation-and-metadata-inspection-1st-edition-roger-
villela/
textbookfull.com

Pro C# 7 with .NET and .NET Core Andrew Troelsen

https://textbookfull.com/product/pro-c-7-with-net-and-net-core-andrew-
troelsen/

textbookfull.com

Pro ASP NET Core Identity Under the Hood with


Authentication and Authorization in ASP NET Core 5 and 6
Applications 1st Edition Adam Freeman
https://textbookfull.com/product/pro-asp-net-core-identity-under-the-
hood-with-authentication-and-authorization-in-asp-net-
core-5-and-6-applications-1st-edition-adam-freeman/
textbookfull.com
Building Custom Tasks for SQL Server Integration Services:
The Power of .NET for ETL for SQL Server 2019 and Beyond
2nd Edition Andy Leonard
https://textbookfull.com/product/building-custom-tasks-for-sql-server-
integration-services-the-power-of-net-for-etl-for-sql-server-2019-and-
beyond-2nd-edition-andy-leonard/
textbookfull.com

Building Custom Tasks for SQL Server Integration Services


The Power of NET for ETL for SQL Server 2019 and Beyond
Second Edition Andy Leonard
https://textbookfull.com/product/building-custom-tasks-for-sql-server-
integration-services-the-power-of-net-for-etl-for-sql-server-2019-and-
beyond-second-edition-andy-leonard/
textbookfull.com

Pro C 9 with NET 5 Foundational Principles and Practices


in Programming Tenth Edition Andrew Troelsen Phillip
Japikse
https://textbookfull.com/product/pro-c-9-with-net-5-foundational-
principles-and-practices-in-programming-tenth-edition-andrew-troelsen-
phillip-japikse/
textbookfull.com

Pro C 9 with NET 5 Foundational Principles and Practices


in Programming Tenth Edition Andrew Troelsen Phillip
Japikse
https://textbookfull.com/product/pro-c-9-with-net-5-foundational-
principles-and-practices-in-programming-tenth-edition-andrew-troelsen-
phillip-japikse-2/
textbookfull.com

Mobile Development with NET Build cross platform mobile


applications with Xamarin Forms 5 and ASP NET Core 5 2nd
Edition Can Bilgin
https://textbookfull.com/product/mobile-development-with-net-build-
cross-platform-mobile-applications-with-xamarin-forms-5-and-asp-net-
core-5-2nd-edition-can-bilgin/
textbookfull.com
Roger Villela

Pro .NET 5 Custom Libraries


Implementing Custom .NET Data Types
1st ed.
Roger Villela
Sao Paulo, Sã o Paulo, Brazil

Any source code or other supplementary material referenced by the


author in this book is available to readers on GitHub via the book’s
product page, located at www.​apress.​com/​978-1-4842-6390-7. For
more detailed information, please visit www.​apress.​com/​source-code.

ISBN 978-1-4842-6390-7 e-ISBN 978-1-4842-6391-4


https://doi.org/10.1007/978-1-4842-6391-4

© Roger Villela 2020

This work is subject to copyright. All rights are reserved by the


Publisher, whether the whole or part of the material is concerned,
specifically the rights of translation, reprinting, reuse of illustrations,
recitation, broadcasting, reproduction on microfilms or in any other
physical way, and transmission or information storage and retrieval,
electronic adaptation, computer software, or by similar or dissimilar
methodology now known or hereafter developed.

The use of general descriptive names, registered names, trademarks,


service marks, etc. in this publication does not imply, even in the
absence of a specific statement, that such names are exempt from the
relevant protective laws and regulations and therefore free for general
use.

The publisher, the authors and the editors are safe to assume that the
advice and information in this book are believed to be true and accurate
at the date of publication. Neither the publisher nor the authors or the
editors give a warranty, expressed or implied, with respect to the
material contained herein or for any errors or omissions that may have
been made. The publisher remains neutral with regard to jurisdictional
claims in published maps and institutional affiliations.

Distributed to the book trade worldwide by Springer Science+Business


Media LLC, 1 New York Plaza, Suite 4600, New York, NY 10004. Phone
1-800-SPRINGER, fax (201) 348-4505, email orders-ny@springer-
sbm.com, or visit www.springeronline.com. Apress Media, LLC is a
California LLC, and the sole member (owner) is Springer Science +
Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a
Delaware corporation.
This book is dedicated to my mother, Marina Roel de Oliveira.
January 14, 1952 to March 17, 2017 (†)
Introduction
This book covers programming with .NET 5 to develop custom data
types and custom libraries for use on Microsoft Windows, Linux, and
Apple macOS. These custom libraries can be used in different operating
system platforms because they are written using .NET 5 (a cross-
platform implementation of the ECMA-335 specification) and because
all source code is written in the C# programming language and uses
only cross-platform Base Class Library (BCL) types.
This book focuses on how to best exploit the .NET 5 custom data
types for software libraries so that companies and software engineers
can design and implement internal/commercial tools for various
scenarios on myriad target platforms. Contextual modeling and
planning is difficult without a fundamental understanding of the .NET 5
platform, which this book seeks to provide. The book also covers
internal aspects of the BCL .NET types and APIs, with walkthroughs
covering the implementation process of custom .NET data types and
.NET custom libraries.
You will also learn about .NET assembly and .NET module
structures, the inner workings of the BCL implementation on the .NET
platform, custom data types available through the .NET platform, and
how to write a custom library that incorporates .NET APIs available
through the .NET BCL.
Acknowledgments
I want to thank to the Apress team who worked with me on this book:
Smriti Srivastava (Acquisitions Editor), Shrikant Vishwakarma
(Coordinating Editor), Matthew Moodie (Development Editor),
Welmoed Spahr (Managing Director), and Carsten Thomsen (Technical
Reviewer). It was a pleasure and an honor to work with such a highly
professional team.
I also want to thank my parents, with a special nod to my dad
(Gilberto), my two brothers (Eder and Marlos and his wife Janaína), my
nephew Gabriel, my nieces Lívia and Rafaela, and my cousin Ariadne
Villela.
I must also express special thanks to my friends Paula Carolina
Damasio, Alessandro Augusto de Jesus, and Neide Pimenta. I also want
to acknowledge and thank all the people who work really hard on team
Praxio Tecnologia developing one of the greatest specialized enterprise
resource planning (ERP) products on the market; congratulations to all
of you for your efforts.
I also want to thank my professional colleagues and friends who
have worked with me throughout the years.
Table of Contents
Chapter 1:​.​NET Platform
Acronyms
ECMA-335 and .​NET
ECMA-335
.​NET Platform
About the Common Type System
Fundamental Types and Hardware Platform
The Organization of Fundamental Data Types
CTS for Fundamental Types
Virtual Execution System
.​NET Module
.​NET Assemblies
Chapter 2:​Custom .​NET Data Type
Management of Data Types
Working with System.​Object, the Root of .​NET Reference Types
System.​ValueType, the Root of .​NET Value Types
Methods
Chapter 3:​.​NET Methods:​Implementation Details
Methods
About the Use of Operators
Operator Overloading:​Programming Language Semantics
and Syntaxes
Working with System.​Object.​GetType()
Constructors in a .​NET Data Type
Chapter 4:​.​NET Special Members:​Constructors in a Managed
Environment
Acronyms
Special Members
About Constructors in a Managed Execution Environment
Default Constructor
Summary
Chapter 5:​Finalizer Method:​The .​NET Special Member
Special Members
Special Member Destructor
Special Member Finalizer Method (Destructor)
Chapter 6:​.​NET Manifest and Versioning for Managed Libraries
Assemblies, Modules, Manifest, Versioning
Assembly
Manifest
Module
Versioning
Chapter 7:​.​NET Assemblies in a Managed Execution Environment
Managed Libraries
Data Types, Components, and Functionalities
Native Code and Managed Code
Index
About the Author
Roger Villela
is a software engineer and entrepreneur
with almost 30 years of experience in the
industry and works as an independent
professional. Currently, he is focused on
his work as a book author and technical
educator and specializes in the inner
workings of orthogonal features of the
following Microsoft development
platforms and specialized application
programming interfaces (APIs):
Microsoft Windows operating system
base services
Microsoft Windows APIs architecture and engineering
Microsoft Universal Windows Platform (UWP)
Microsoft WinRT platform
Microsoft .NET Framework implementation of the runtime
environment (Common Language Runtime [CLR])
His work is based on Microsoft Windows software development kit
(SDK) tools and libraries, Microsoft Visual Studio, and platform
foundational APIs, architectures, and engineering. He works with the
Microsoft Windows operating system, incorporating the following
programming languages, extensions, and projections:
C/C++
Assembly (Intel IA-32/Intel 64 [x64/amd64])
Component extensions/projections for runtimes
C++/CLI
C++/CX
C++/WinRT
C#
Common Intermediate Language (Microsoft Intermediate
Language [MSIL]) implementation for CLR platforms
About the Technical Reviewer
Carsten Thomsen
is a back-end developer primarily, but he
works with smaller front-end bits as
well. He has authored and reviewed a
number of books, and created numerous
Microsoft Learning courses, all to do
with software development. He works as
a freelancer/contractor in various
countries in Europe, using Azure, Visual
Studio, Azure DevOps, and GitHub as
some of his tools. He is an exceptional
troubleshooter, asking the right
questions, including the less-logical ones
(in a most-logical to least-logical
fashion). He also enjoys working with
architecture, research, analysis,
development, testing, and bug fixing.
Carsten is a very good communicator with great mentoring and team-
lead skills, and he also excels at researching and presenting new
material.
© Roger Villela 2020
R. Villela, Pro .NET 5 Custom Libraries
https://doi.org/10.1007/978-1-4842-6391-4_1

1. .NET Platform
Roger Villela1
(1) Sao Paulo, Sã o Paulo, Brazil

This chapter provides an overview of .NET 5 (previously .NET Core) and describes the fundamental
architectural and the engineering features that you should expect in any implementation of .NET 5
(regardless of hardware, operating system, or execution system).

Acronyms
The following acronyms are introduced in this chapter:
Base Class Library (BCL)
Common Intermediate Language (CIL)
Common Language Infrastructure (CLI)
Common Language Runtime (CLR)
Common Type System (CTS)
Framework Class Library (FCL) (Although not specific to the .NET Framework implementation, the
term is used for the full range of .NET types available in an official distribution of .NET.)
Intermediate Language (IL)
Microsoft Intermediate Language (MSIL)
Virtual Execution System (VES)
Windows Presentation Foundation (WPF) (a.k.a. execution engine)

ECMA-335 and .NET


ECMA-335
The ECMA-335 standard specification defines the Common Language Infrastructure (CLI) , which
includes a set of conceptual definitions and rules to be followed and engineering mechanisms to be
implemented, independent of the target operating system and hardware platforms. The CLI ensures
that applications, components, and libraries can be written in multiple high-level languages and can
be executed in different target system environments without needing to be rewritten.
We can access the ECMA-335 specification at www.ecma-
international.org/publications/standards/Ecma-335.htm. Figure 1-1 shows an
excerpt. The download link is www.ecma-international.org/publications/files/ECMA-
ST/ECMA-335.pdf, and the XML specification download link is www.ecma-
international.org/publications/files/ECMA-ST/ECMA-335.zip.
Figure 1-1 Excerpt of web page with information about the ECMA-335 standard specification
More objectively, the CLI is an open specification that describes executable code and an execution
environment that enables multiple high-level languages to be used on different architectural
platforms without being rewritten.
This execution environment must follow the architectural infrastructure described by the
following:
Base Class Library (BCL): Foundational library defined by and part of the CLI standard
specification. It is implemented by .NET Framework, .NET Core, .NET 5, and .NET 6 (early stages,
available on Github.com), and is the main reason for the existence of the .NET standard.
Common Language Specification (CLS): Rules (restrictions and models) required for language
interoperability. The detailed information on the CLS group is a subset of what is in the CTS, but the
content is primarily for language designers and class library designers (frameworks). So, learning
about CTS will offer a great base of knowledge for you and your team for when we start working
with the rules in the CLS.
Common Type System (CTS): The CTS is a set of data types and operations that are shared by all
languages that support the CTS, and learning about the CTS will offer a great base of knowledge to
you and your team when we start working with the rules in the CLS.
Metadata: The metadata describes the program structure, enabling languages and tools to work
together. Detailed understanding of the metadata group is not a requisite for a component
developer or application developer. Instead, detailed information about such is primarily for tool
builders and compiler writers.
Virtual Execution Engine (VES): How code is executed (and how types are instantiated),
interacts, and dies. More abstractly, it is also known as an execution engine or execution
environment. This execution system is responsible for loading, instantiating, executing, and
ensuring the cohesiveness of the interactions between the instances. In brief, it offers entire
lifecycle support for the instance of the types. The execution engine understands concepts,
architecture, and implementation details of two fundamental areas of the platform: the CTS and the
VES.
Semantics:
Capability to recognize contextuality (semantics), meaning mechanisms to constantly observe
your own environment and ways to guarantee advanced security rules, data integrity (acting
based on more flexible or disciplined rules), dynamic extensibility and expandability. In addition,
we have the capability to interact with highly specialized environments (advanced data
management systems, for example), development software environment systems (for instance,
Microsoft Visual Studio), different target operating systems and hardware platforms (for
example, the Microsoft Windows operating system implementations and UNIX-based operating
system implementations, including Linux distributions, Apple MacOS, Apple iOS, Google Android,
FreeBSD, IBM AIX, Red Hat Linux, Intel x86/Intel x64, ARM 32-bit, ARM 64-bit, IoT high-
specialized environment for embedded systems, web development, desktop development, mobile
development, game development, artificial intelligence development, machine-learning
development, quantum computing environments, supercomputing highly specialized
environments, scientific highly specialized research and development environments, research
and development for enterprise and government at any level of complexity [local to global], and
many more).
Capable of hosting, and be hosted by, other environments (such as Microsoft SQL Server
advanced data management system, Microsoft Visual Studio 2017, Microsoft Visual Studio 2019,
and the Microsoft Azure set of advanced cloud products and services).
The CLI standard specification also includes an intermediate assembly language , and it is the
Common Intermediate Language (CIL). Here is a necessary distinction:
Intermediate Language: An IL is an abstract language used by a compiler as a step between
program code and assembly code.
CIL: The CIL is a formal instruction set to the CIL described in the CLI standard specification.
Microsoft Intermediate Language (MSIL) : MSIL is Microsoft’s implementation of the formal
instruction set based on the ECMA-335 CIL described in the CLI standard specification.
When writing code using a programming language that adheres to the CLI standard specification,
the result of the compiled code is a sequence of instructions of the CIL instruction set, as examples
show in Listing 1-1 and Listing 1-2.
Open the sample solution RVJ.Core.sln at
<install_dir_on_your_local_computer>\Sources\APIs\DotNET\5.0\ProCustomLi
bs\Ch01\RVJ.Core\.
In the first sample project (Buffers_Console_Client), we have in the Program.cs C# file a .NET
custom data type named Program derived from System.Object, the .NET root data type for every
kind of .NET concrete or abstract class or struct data type, directly or indirectly, as shown in Figure 1-
2, Figure 1-3, and Figure 1-4, respectively.
Figure 1-2 Every .NET data type inherits, directly or indirectly, from the System.Object root data type. In .NET, we have
a reference type and a value type

Figure 1-3 Some .NET types (for example, System.Array) are abstract data types and are implemented partially by code
generation of the compiler (for example, a C# compiler)
Figure 1-4 System.ValueType is a reference type, and System.Int32 is a value type derived from System.ValueType, which
inherits from the System.Object reference type
In the C# programming language, because C# treats System.Object as the base class, we do not
need to use the System.Object root data type explicitly when we do not have another class as the
base data type.
In fact, the execution environment of the CLR (the VES) assumes this; therefore, most
programming languages do not require that System.Object be informed explicitly in this scenario.
However, it is good programming practice to explicitly use the base data type in such cases. Otherwise,
this can become error prone when using more than one programming language in a project,
potentially resulting in erroneous perceptions about the inheritance model supported by the .NET
execution environment and the transfer of the desired feature to the programming language and the
adoption of different programming languages (all because of basic resources of syntax).

#region Namespaces
using System;
#endregion

namespace ConsoleClient {
public static class Program : System.Object {
public static void Main() {
return;
}
};
};
Listing 1-1 Typical Source Code in the C# Programming Language for a Console Application with an Entry-Point
Member Method Called Program.Main()

.class public abstract auto ansi sealed beforefieldinit


ConsoleClient.Program
extends [System.Runtime]System.Object {
.method public hidebysig static void Main() cil managed {

.entrypoint
// Code size 1 (0x1)
.maxstack 8
ret

} // end of method Program::Main

} // end of class ConsoleClient.Program


Listing 1-2 Source Code in MSIL Generated in the Binary File, .EXE, or .DLL
These instructions are not for real hardware or processors. Instead, the CLI standard specification
describes a virtual environment that includes some characteristics and functionalities of the elements
available in a real computer.

.NET Platform
Microsoft .NET is the official commercial name for the group of technologies and tools designed and
implemented based on what is in the ECMA-335 standard specification.
Common Language Runtime, as the name suggests, is an implementation based on the CLI
standard specification, and an implementation of the CLR has a set of elements for a fundamental
architectural model. Each element has a fundamental set of conceptual definitions and rules to be
followed, and engineering mechanisms to be implemented, independently of the target operating
system and hardware platforms.
When we are implementing a CLR environment and technologies of a .NET platform, we are
creating software elements for a platform that is a nonspecific hardware-based computer (more
specifically, a software-only computer, and more commonly known as a virtual computer ). This
description includes when planning and implementing custom data types, custom components,
custom controls, custom libraries, and specialized tools and frameworks.
For this text, we are using a .NET 5 implementation of the CLR for the sample projects and
respective source code.
You can check for the most up-to-date versions of .NET 5 at the official Microsoft website:
https://dotnet.microsoft.com/download/dotnet/5.0.
You can also use GitHub to access the source code of the runtime, libraries, and frameworks made
using the CLR components and technologies and BCL fundamental library, as we have with Windows
Forms (Microsoft Windows only), Windows Presentation Foundation (Microsoft Windows only),
ASP.NET Core (Windows, Apple MacOS, Linux), and the .NET SDK Installer:
https://github.com/dotnet/runtime
https://github.com/dotnet/aspnetcore
https://github.com/dotnet/winforms
https://github.com/dotnet/wpf
https://github.com/dotnet/installer
Independently or together, these abstract aspects focus on management of data types. So,
reasonably, that form of environment and its components is known as a managed environment .
As mentioned previously, in this book we use a .NET 5 implementation of the CLR for the sample
projects and respective source code. So, whenever you see CLR mentioned, this means the .NET 5
running on Microsoft Windows 10 2004 and Microsoft Visual Studio 2019 16.7.3 or more recent
(Community, Professional, Enterprise). The following programming languages are used in this book:
C#
MSIL
For example, when we are developing some application and choose the System.String
reference type, we are using one of the fundamental types available through the BCL.
However, the string reference type exists only because the CTS has the string fundamental built-
in type defined on it, which is one of the platform-specific fundamental built-in types upon which
string operations are built. In fact, the string content (value of) in any instance is made up of a
sequence of values of the CTS char platform fundamental built-in type, which is System.Char
fundamental data type in the BCL. These platform fundamental built-in types, BCL fundamental types,
and any other types derived or based on them follow the rules described by the unified type system.
In the CLI specification, this unified type system is the CTS, which describes rules about
conceptual, structural, and behavioral elements that must be followed by the CLI itself and specialized
tools (such as compilers and runtime environments).
You’ll learn more information about these types in Chapter 2 and in discussions about the CLR
throughout this book. For now, though, Table 1-1 shows the types defined by the CTS and described by
the metadata.

Table 1-1 Fundamental Types Defined Through CTS

BCL Types CTS Types


C# CIL/MSIL
System.Boolean bool
System.Char char

System.Object object

System.String string
System.Single float32

System.Double float64

System.SByte int8
System.Int16 int16

System.Int32 int32

System.Int64 int64
System.IntPtr native int

System.UIntPtr native unsigned int

System.TypedReference typedref
System.Byte unsigned uint8

System.UInt16 unsigned uint16


System.UInt32 unsigned uint32

System.UInt64 unsigned uint64

Table 1-2 Fundamental Data Types

Numeric Data Type Description


Byte unsigned integer All bits used to represent the value.
Values range from 0 to 255.
(2^8-1)
Word unsigned integer All bits used to represent the value.
Values range from 0 to 65,535.
(2^16-1)
Numeric Data Type Description
Doubleword unsigned All bits used to represent the value.
integer Values range from 0 to 4,294,967,295.
(2^32-1)
Quadword unsigned All bits used to represent the value.
integer Values range from 0 to 18,446,744,073,709,551,615.
(2^64-1)
Byte signed integer The first 7 bits (6…0) used to represent the value, the most significant bit (MSB) used as the
signed bit.
When the MSB has value 0, the number is positive. When the MSB has value 1, the number
is negative.
Values range from -128 to +127.
Word signed integer The first 15 bits (14…0) used to represent the value, he MSB used as the signed bit .
When the MSB has value 0, the number is positive. When the MSB has value 1, the number
is negative.
Values range from -32,768 to +32,767.
Doubleword signed integer The first 31 bits (30…0) used to represent the value, the MSB used as the signed bit.
When the MSB has value 0, the number is positive. When the MSB has value 1, the number
is negative.
Values range from -2^31 to +2^31-1.
Quadword signed integer The first 63 bits (62…0) used to represent the value, the MSB used as the signed bit
When the MSB has value 0, the number is positive. When the MSB has value 1, the number
is negative.
Values range from -2^63 to +2^63-1.

Table 1-3 CTS System.Object (Root Managed Object Type)

BCL Types CTS Types


C++/CLI projection C# programming language CIL
System::Object^ (same root C# object is the keyword used for CTS/BCL object (same root
managed object type) System.Object (same root managed object type) managed object type)

Table 1-4 Contextual Resources and Their Fundamental Purposes

Your .NET Applications, services, components, libraries, and frameworks.


specialized
applications
.NET Software development kit (SDK, a specialized tools for software development, analysis,
deployment, and some types of management)
Specialized components, libraries, and frameworks
CLR Implementation of a specialized managed environment based of CLI specification
Uses the resources of the underlying hardware and operating system platform (for example,
Microsoft Windows operating system)
Adaptable and capable of using the specialized resources of the underlying hardware and
operating system (for example, Microsoft Windows 10, Microsoft Windows Server 2016, Linux
distributions, Apple iOS, and Apple MacOS.
Remember that this is not a one-to-one mapping between reserved words, data structures,
specialized resources, or anything else in the programming languages. That is, what is formalized
through the instructions in CIL, what is defined in the CLI specification, and what is implemented by
the mechanisms on the platform is what prevails.
As a reminder, unmanaged code means executable and nonexecutable code that is not in CIL and is
not under management and the rules of the CLR environment. Erroneously, the unmanaged code is
often considered synonymous with native code; this is incorrect. For example, the CIL instruction set
includes the following attributes:
cil is a code implementation attribute that specifies that the method declaration and
implementation consist only of CIL code (that is, managed code).
native is a code implementation attribute that specifies that the method declaration and
implementation consist only of native code (that is, native instructions of a specific
hardware/processor platform). Currently, this functionality of the managed environment CLR
implementation is used specifically as one of the base technologies of Platform Invoke (P/Invoke).
P/Invoke is one of the mechanisms of the platform, and it is described in the CLI specification.
runtime is a code implementation attribute that specifies that the implementation of the
method be provided automatically by the runtime.
Two more of these attributes are available and can be combined with them:
managed is a code implementation attribute that is used with methods for which
implementation is written using only CIL code.
unmanaged is a code implementation attribute that is used to describes that the
implementation is not external. Currently, this code implementation attribute is used by P/Invoke
technology, but it is not restricted to just that use.
The following implementation attributes are properly categorized as code implementation
attributes:
cil
native
runtime
managed
unmanaged
When unmanaged code needs to be used from the managed code, the unmanaged code
implementation attribute must be applied on the method implementation. In the specific case of the
P/Invoke mechanism, the use of the unmanaged code implementation attribute is required.
The pinvokeimpl method attribute is used to indicate that the runtime will switch from a
managed state to an unmanaged state when executing the unmanaged code.
Listing 1-3 shows an example of a managed code implementation that uses an unmanaged code
implementation of a well-known Windows application programming interface (API) HeapAlloc()
function . The method has been applied the unmanaged and native code implementation
attributes.
A switch from a managed state to an unmanaged state, and vice-versa, is performed automatically
by the P/Invoke.

.method assembly static pinvokeimpl( lasterr stdcall)


void*
modopt([mscorlib]System.Runtime.CompilerServices.CallConvStdcall)
HeapAlloc(void* A_0,
uint32
modopt([mscorlib]System.Runtime.CompilerServices.IsLong) A_1,
uint32
modopt([mscorlib]System.Runtime.CompilerServices.IsLong) A_2) native
unmanaged preservesig
{
.custom instance void
[mscorlib]System.Security.SuppressUnmanagedCodeSecurityAttribute::.ctor()
= ( 01 00 00 00 )
// Embedded native code
}
Listing 1-3 Excerpt in MSIL of Unmanaged Code (Using P/Invoke to Call the HeapAlloc() Function of Windows
Memory Management, the Windows API)
At this point, we have the following sequence of elements: the CLI standard specification that is
composed by and describes the CTS group, the metadata group, the CLS and VES group, and the CLI
itself.

About the Common Type System


When working with a sequence of bits, it is necessary to define the organization of these bits to do
something useful. So, the data signified by the bit pattern should identify the data type (or a
contextualized type based on the data).
The data type must have a purpose and contextually well-defined characteristics. For example,
with regard to structural terms, the data type must have the required number of bits as defined and
the fundamental operations that the type supports.
A type’s conceptual, structural, and behavioral fundamental characteristics create a model as to
what can be done and what cannot be done with any particular type: a type system model. Because
the number of types is constantly increasing, a type system model is necessary to enforce rules to
ensure that the environment works as designed and expected.

A type system model describes the necessary rules related to each type’s conceptual, structural,
and behavioral characteristics.

Fundamental Types and Hardware Platform


For this discussion, we use Intel IA-32/x64 and Intel 64 fundamental built-in data types (or
fundamental built-in types), and we use some defined assembly instructions (implemented and
supported) that derive the hardware architecture and the contextual interpretation of the bits on the
data type.
The fundamental built-in data types are those defined as integral elements of the platform (in this
case, the Intel IA-32/x64 and Intel 64 processor hardware architecture). Therefore, these types are
integral elements of the hardware architecture and are not defined by an external library or execution
environment.
These are the fundamental types:
Byte (8 bits) (1 byte)
Word (16 bits) (2 bytes)
Doubleword (32-bits) (4 bytes)
Quadword (64 bits) (8 bytes)
Double quadword (128 bits) (16 bytes)
Although these fundamental built-in data types are supported by a common set of assembly
instructions (such as MOV) that perform a common set of operations such move data from one place
to another, some assembly instructions support additional interpretation of fundamental built-in data
types.
The purpose of this additional interpretation is to allow numeric operations to be performed, and
within this context these fundamental built-in data types are viewed and manipulated as numeric data
types.
The Intel IA-32/x64 and Intel 64 processors recognize two integer types: signed and unsigned.
Assembly instructions such as ADD and SUB can perform operations on both signed integers and
unsigned integers, but some assembly instructions can perform operations only with one type.

The Organization of Fundamental Data Types


Here are the bits as a single pattern, without additional rules or interpretation, except for the
fundamental requirements of the hardware platform:
Byte (8 bits)
Bits 7…0
Word (16 bits)
Bits 15…0
Bits 15…8 (high byte)
Bits 7…0 (low byte)
Doubleword (32 bits)
Bits 31…0
Bits 31…16 (high word)
Bits 15…0 (low word)
Quadword (64 bits)
Bits 63…0
Bits 63…32 (high doubleword)
Bits 31…0 (low doubleword)
Double quadword (128 bits)
Bits 127…0
Bits 127…64 (high quadword)
Bits 63…0 (low quadword)
Table 1-2 describes the bits in more detail, including information about fundamental hardware
requirements and integer types (signed and unsigned).

CTS for Fundamental Types


The CTS supports types that describe values and types that specify contracts (behaviors that the type
supports), and the support for these types must be present in an implementation of a CLR. These two
types are supported because one of the principles of the CTS is to support object-oriented
programming (OOP), procedural, and functional programming languages.

A value is a bit pattern used to represent types such as numbers (for example, integer numbers and
float-pointing numbers).

Listing 1-4 shows examples in C# for two variables for instances of the System.UInt32 BCL
value type (and not a simple value).

const uint LimitOne = 72; // C# code.


const System.UInt32 LimitTwo = 144; // C# code.

Console.WriteLine( "{0}", LimitTwo.ToString() );


Listing 1-4 C# Examples Declaring Variables Using uint and System.UInt32, the Same Kind of Object (An Instance of
the Value Type of System.UInt32 Data Type of BCL)
A value type is not an object type, but it is defined using a class definition (declaration and
implementation).

Remember that this way of work is defined by CTS and supported by VES in the CLR. From the
perspective of the type system and execution environment, it is necessary that an object be declared,
defined, and implemented to work within the CLR.
Table 1-3 describes the fundamental built-in types defined by CTS. As the table shows, the root
object type is accessible through the object keyword of the CIL. So that programming languages
such as C#, C++/CLI projection, F#, VB.NET, and others can access this root object type of the
platform, there is a library of fundamental types that is part of the CLI specification. This foundational
library is the BCL.
This root object type is the System.Object reference type. When declaring a variable of the
object type (CTS model definition) or System.Object (BCL) reference type using any high-level
programming language such as C#, C++/CLI projection, F#, VB.NET, and so on, the compiler generates
an intermediate code using the object keyword of the CIL. Table 1-4 summarizes and helps you
understand and memorize this sequence in a straightforward way.

Virtual Execution System


The VES provides an environment for running managed code, security boundaries, and memory
management.
Two fundamental built-in types (string and array) are used as a starting point in this discussion to
explain various aspects of CTS and VES.
These platform built-in fundamental types are present in any kind of software, so they stand as
orthogonal elements.
However, the .NET platform also has a special foundational library, also part of the CLI
specification, that supplies specialized types necessary to design and implement any kind of software:
the BCL.
As we explore the the organization of the BCL, we’ll use the System.Object, System.String,
and System.Array reference types as starting points and deconstruct many aspects of their
implementation. This discussion will then enable us to explore the interface types implemented by
these types in various specialized frameworks (such as Windows Forms, Windows Presentation
Foundation [WPF], Universal Windows Platform [UWP] applications, and ASP.NET).
The VES provides direct support for a set of platform-specific built-in fundamental types, defines a
hypothetical machine with an associated machine model and state, and provides a set of control flow
constructs and an exception-handling model.
To a considerable extent, the purpose of the VES is to provide the support required to execute the
MSIL instruction set.
The VES is the system that implements and enforces the CTS model. For example, the VES is
responsible for loading and running programs written to CLI.
The VES provides the services needed to execute managed code and data using the metadata to
connect separately generated modules together at runtime. The VES is also known as the execution
engine.

.NET Module
When we use C++ to write code, the result of the compiled and linked code is a binary file in a specific
format. In this case, we are working with PE/COFF (Portable Executable / Common Object File
Format), which is used by the Microsoft Windows operating system. When we use C# to write code, or
when we use any other programming language or group of extensions that adhere to the CLI
specification, the resulting binary file is in the same PE/COFF format. However, that resulting binary
file has some data structures changed/included to support the requirements described by CLI
specification and aspects of the Microsoft Windows operating system. This is called the CLI PE/COFF
module.
Currently, on Microsoft Windows, the CLI PE/COFF module can have .EXE, .DLL, .netmodule,
.WinMD, and .UWP extensions created and recognized by the operation system or development tools.
In addition, it can have any other extension that can be registered and recognized by the operating
system or specialized tools (for software development or not).
In fact, the use of an extension is not required, but it is a good practice and the accepted standard.
If we are using .NET 5 or .NET Core (not the old Windows-only .NET Framework) in a different
operating system and on a different hardware platform, the extensions and file formats used are
specific to such software and hardware environments. However, the fundamental structural resources
defined in CLI as a starting point are the same.
One VES responsibility is to load the CLI PE/COFF modules. Doing so includes verifying some
structural rules about the file format and guaranteeing that all information is as expected. The VES
uses the metadata information in the CLI PE/COFF modules to verify that the structural aspects are
recognized by the rules that it knows as valid, required, or optional. If the structural elements exist
and are valid, the next step is to apply the rules based on the nature of the elements and the context of
use.
For example, if the element is a managed type, the execution system needs to verify whether it is a
value type or a reference type.
If the element is an assembly reference type, one responsibility of this type is to describe various
characteristics of the managed module (structural and behavioral), such as the relationships it has
with other managed modules and what managed types are in it (and in any other managed module).

.NET Assemblies
People often wonder what a .NET assembly is exactly. Put simply, and as defined and described by the
CLI, an assembly is a logical unit for management and deployment of resources designed to work
together. In an implementation of CLR, assemblies can be static or dynamic.

Static Assemblies
Static assemblies are those stored in a storage device, such as a typical hard disk. In Microsoft
Windows, the file format of each module is the CLI PE/COFF. These assemblies have typical .NET 5
types and other specialized resources (audio/video files, localization support files, images, and
custom files created specifically for the application), depending on the purpose of each application.
.NET 5 and .NET Core include the following assemblies and modules, for example:
Assembly mscorlib
Module mscorlib.dll
Module System.Runtime.dll
Module netstandard.dll
Assembly System.Activities (part of Microsoft Windows Workflow Foundation)
Module System.Activities.dll
Assembly System.Diagnostics.Debug
Module System.Diagnostics.Debug.dll
Module System.dll
Module netstandard.dll

Dynamic Assemblies
Dynamic assemblies are created dynamically at runtime and are created via specialized API calls of
.NET 5/Core. These dynamic assemblies are created and executed directly in memory. However, the
dynamic assembly can be saved in a storage device, but only after being executed.
In a typical project, though, we have many files—binary files with executable code or binary files
with other types of data (for example, images)—that are part of the software. Therefore, the
description, verification, and reinforcement of the relations and dependencies among them are made
in part by the metadata.

Metadata is partly responsible for making resources available to perform these tasks.

Working with Assemblies and Modules


For a static assembly or a dynamic assembly, the principles prevails, a way of keep the cohesiveness of
the types and resources designed to work together. Deployment, Execution and Management. The
information stored in the modules and created through assemblies is what helps the runtime
environment understand and apply the rules to the relations among the elements.
Let’s use a typical static assembly.
There are four elements:
CIL that implements all the types and required logic to the module
Metadata
The resources (audio/video files, localization support files, images and custom files created
specifically for the application)
The assembly manifest
From the perspective of the runtime environment and basic structural rules described in the CLI,
of these four elements, only the assembly manifest is a required item. However, considering even the
simplest application or component, if we do not have the other elements, the application or
component does not have a practical use (except for learning about the assemblies and modules,
which I consider a quite practical use).

Organization of Elements in a Module (Physical File)


We start with a basic example here and continue with more details in Chapter 2.
Follow these steps:
1. Using the code editor of your preference, create a simple file and save it with the name
RVJ.ProDotNETCustomLibs.il in the directory of your choice that can be used to build source
code.

2. Open (as administrator) one of the developer command prompts installed and configured by
Microsoft Visual Studio 2019.

3. Copy the following sequence of MSIL code into the file RVJ.ProDotNETCustomLibs.il and save the
file:

.assembly extern System.Runtime {


.ver 5:0:0:0
}

.assembly RVJ.ProDotNETCustomLibs.Buffers {

.ver 1:0:0:0

}
4. In the developer command prompt, write the following command:

ilasm /DLL /Output=RVJ.ProDotNETCustomLibs.dll


RVJ.ProDotNETCustomLibs.il

If the code compiles without error, the output will be a binary file with the name
RVJ.ProDotNETCustomLibs.dll.
By following these steps, we have created a single-file static assembly, with only the assembly
manifest.

Using the ILDASM Tool


With the code compiled and the binary generated, we now can use the Intermediate Language
Disassembler (ILDASM) tool. (ISLASM , in contrast, stands for Intermediate Language Assembler.) On
the same command prompt that we used to compile the code, write the following command:

ildasm RVJ.ProDotNETCustomLibs.dll

With the module RVJ.ProDotNETCustomLibs.dll loaded by the ILDasm.exe tool, we see the
screen shown in Figure 1-5.

Figure 1-5 ILDASM showing a single-file static assembly

Now double-click in the manifest. A new window will open with information about the assembly
manifest, as shown in Figure 1-6.

Figure 1-6 ILDASM showing the assembly manifest of a single-file static assembly
Implementing the entrypoint Method
We have created a single-file static assembly, with only the assembly manifest. If we want to create an
.EXE, we need to change the source code. Using the same RVJ.ProDotNETCustomLibs.il, update the
source code to include a managed method that is the entry point:

.assembly extern System.Runtime {


.ver 5:0:0:0
}
.assembly RVJ.ProDotNETCustomLibs.Buffers {

.ver 1:0:0:0

.method static public void MyEntryPointMethod() cil managed {

.entrypoint

ret
}

As you can see, the name of the .entrypoint method does not need to be main.
To build this code, use the following command:

ilasm /Output=RVJ.ProDotNETCustomLibs.exe RVJ.ProDotNETCustomLibs.il

After the code compiles without error and with the binary generated, we can use the ILDasm.exe
tool to load the module RVJ.ProDotNETCustomLibs.exe, and then we have more than just the
assembly manifest, as shown in Figure 1-7.

Figure 1-7 ILDASM showing a single-file static assembly

As shown in Figure 1-8, we have created a single-file static assembly, with the assembly manifest
and one method (in this case, the entry-point method). When RVJ.DotNETProCustomLibs.exe
runs, it runs like any other .NET managed executable.
Figure 1-8 ILDASM showing a single-file static assembly, with the assembly manifest and one managed method
Listing 1-5 shows an example of managed instructions from one of the sample projects that comes
with the companion content of this book. The .module directive indicates the name of the binary
module (in this case, RVJ.ProDotNETCustomLibs.exe). The .assembly directive describes
which assemblies make this a logical unit of management and deployment of resources designed to
work together. The .assembly RVJ.ProDotNETCustomLibs.Buffers (without the extern
keyword) describes that this assembly is in the current module. The use of .assembly extern
directive describes to the assembly the types that your .assembly or .module are referencing.
For example, .assembly extern System.Runtime indicates that the assembly
RVJ.ProDotNETCustomLibs.Buffers is using one or more types of the assembly mscorlib.
The highlighted CIL instructions are the same that you can read in the
RVJ.ProDotNETCustomLibs.dll or RVJ.ProDotNETCustomLibs.exe modules. Chapter 2
discusses these and other instructions in more detail (with even fuller detail following in subsequent
chapters).

.assembly extern System.Runtime {


.ver 5:0:0:0
}

.assembly RVJ.ProDotNETCustomLibs.Buffers
{
.ver 1:0:0:0
}
.module RVJ.ProDotNETCustomLibs.exe
.imagebase 0x00400000
.file alignment 0x00000200
.stackreserve 0x00100000
.subsystem 0x0003 // WINDOWS_CUI
.corflags 0x00000001 // ILONLY
.method public static void MyEntryPointMethod() cil managed {
.entrypoint
// Code size 1 (0x1)
.maxstack 8
IL_0000: ret
Discovering Diverse Content Through
Random Scribd Documents
— Teidän on kaiketi ikävä siten?

— Miksi niin? Minulla on paljon työtä ja vain yksi apulainen —


Nikon, isän entinen päivystäjäpalvelija. Hän on myöskin vanha ja
juopottelee myöskin, mutta hän on hirmuisen vahva ja taitaa
tehtävänsä. Väki pelkää häntä… hän lyö heitä, ja he pieksivät
myöskin puolestaan hänet kerran pahanpäiväisesti. Hän on
ihmeteltävän rehellinen ja kiintynyt meihin… rakastaa meitä kuin
koira isäntäänsä! Ja minä rakastan myöskin häntä. Oletteko ehkä
lukenut romaanin, jonka päähenkilö on arabialainen upseeri, kreivi
Louis Gramont, ja jolla on myöskin sotilaspalvelija nimeltään Sadi-
Koko?

— En ole lukenut, — tunnusti nuori oppinut ujosti.

— Lukekaa ehdottomasti, se on erinomainen romaani, — neuvoi


Varjenka vakuuttavasti. — Minä sanon Nikonia Sadi-Kokoksi, kun hän
on mieleeni. Ensin hän suuttui siitä minulle, mutta kerran minä luin
hänelle tuon romaanin, ja nyt hän tietää, että Sadi-Koko merkitsee
kehumista.

Ippolit Sergejevitsh katsoi tyttöön, niinkuin europalainen katsoo


hienosti tehtyä, mutta fantastisen muodotonta kiinalaista
kuvapatsasta — ihmetellen, säälien ja uteliaasti. Mutta Varjenka
kertoi innoissaan Sadi-Kokon urotöistä, jotka todistivat rajatonta
kiintymystä kreivi Louis Gramontiin.

— Suokaa anteeksi, — keskeytti Ippolit Sergejevitsh hänen


kertomuksensa, — mutta ettekö ole lukenut venäläisiä romaaneja?

— Olen kyllä, mutta minä en pidä niistä… ne ovat niin ikäviä, niin
hirmuisen ikäviä! Ja he kirjottavat aina sellaisesta, jonka minä itsekin
tunnen, enkä huonommin heitä. He eivät osaa keksiä mitään
mieltäkiinnittävää, ja kaikki on heillä pelkkää totuutta.

— Entä ettekö te pidä totuudesta sitten? — kysyi Ippolit


Sergejevitsh ystävällisesti.

— Enhän minä! Kaikille sanon totuuden päin silmiä…

Varjenka vaikeni, ajatteli ja kysyi:

— Mitä siinä on pitämistä? Kun se on minun tottumukseni, niin


kuinka voin siitä vielä pitää?

Toinen ei ennättänyt sanoa siihen sanaakaan, sillä tyttö komensi


samassa kovalla äänellä:

— Ohjatkaa vasemmalle… pikemmin! Tuonne tuon tammen luo…


Kylläpä te olette taitamaton!

Vene ei totellut ohjausta ja kävi kyljittäin rantaan, vaikka perämies


meloi kaikin voimin.

— Ei mitään, ei mitään, — virkkoi tyttö, joka oli noussut seisomaan


ja loiskahti samassa veneen laidan yli.

Ippolit Sergejevitsh huudahti kolkosti, heitti melan ja ojensi


kätensä tyttöä kohti, mutta tämä seisoi jo rannalla
vahingoittumattomana ja pitäen veneen ketjua kädessään kysyi
anteeksipyytävästi:

— Säikähytinkö minä teidät?

— Minä luulin, että te putositte veteen, — vastasi toinen hiljaa.


— Voiko siinä pudota? Sitäpaitsi on tässä vallan matalaa, — selitti
Varjenka ohjaten veneen rantaan. Mutta perämies ajatteli, että se
olisi hänen pitänyt tehdä.

— Näettekös millaista metsää? — sanoi Varjenka, kun he seisoivat


rannalla vierekkäin. — Eikö olekin kaunista? Siellä Pietarin puolessa
ei liene näin kauniita metsiä?

Heidän edessään oli kapea tie, jota erilaisten puitten rungot


kahden puolin aitasivat. Heidän jalkainsa alla luikerteli vääriä,
ratasten uurtamia puunjuuria, ja heidän yläpuolellaan kaartui sakea
lehväholvi, jonka läpi paikkapaikoin pilkisti sininen taivas. Auringon
säteet vapisivat ohuina lankoina ilmassa tunkeutuen vinoon tämän
kapean, vihreän käytävän läpi. Maatuneitten lehtien, sienten ja
koivujen tuoksu piiritti heidät joka puolelta. Toisinaan pyrähti lintu
lentämään häiriten syvää hiljaisuutta iloisilla lauluillaan ja toimeliaalla
hyppelyllä. Tikka takoi jossakin sisemmällä metsässä, mehiläinen
lentää suristeli ikäänkuin heille tietä näyttäen ja ilmassa heidän
edellään kaksi perhosta lentää lepatteli seuraten toinen toistaan.

He kävelivät hitaasti. Ippolit Sergejevitsh vaikeni antaen tytön


etsiä sanoja ajatuksilleen, joita selitti innokkaasti:

— Minä en lue mielelläni rahvaasta! Mitä intresanttia sen elämässä


voisi olla? Minä tunnen sen, elän sen kanssa ja näen, että siitä
kirjotetaan väärin eikä totuuden mukaisesti. Rahvasta kuvataan aina
säälittäväksi, mutta se on itse asiassa täynnä roistoja, joita ei
kannata sääliä ja jotka tahtovat vain yhtä: pettää teitä, varastaa
teiltä jotakin. Aina he valittavat ja napisevat, ovat inhottavia,
likaisia… ja he ovat viisaita, vieläpä viekkaita… Kuinka he kiusaavat
minua kovasti!
Varjenka oli kiihtynyt, ja hänen kasvoillaan kuvastui harmi ja ikävä.
Rahvas anasti nähtävästi suuren osan hänen elämäänsä; hän ihan
suuttui kuvatessaan sitä. Ippolit Sergejevitsh ihmetteli hänen
kiintymyksensä voimaa, mutta kun hän ei tahtonut kuulla näistä
herrain keksielmistä, hän keskeytti tytön:

— Te puhuitte ranskalaisista kirjailijoista…

— Niin! Toisin sanoen meidän venäläisistä kirjailijoistamme, —


oikaisi hän rauhottuen. — Te kysytte, miksi venäläiset kirjottavat
huonommin? Se on selvä! Sentähden, että he eivät keksi mitään
intresanttia. Ranskalaisissa romaaneissa on oikeita sankareja, jotka
eivät puhu samalla tavalla kuin muut kuolevaiset ja jotka toimivatkin
toisin. He ovat aina urhoollisia, rakastuneita, iloisia… mutta
meikäläisten sankarit ovat yksinkertaisia ihmisiä vailla rohkeutta,
tulisia tunteita, ovat jonkunlaisia rumia, surkuteltavia, jokapäiväisiä
ihmisiä, eivätkä mitään muuta! Miksi he ovat sankareja? Sitä et saa
milloinkaan tietää venäläisestä kirjasta. Venäläinen romaanisankari
on typerä ja hidas, aina hän kärsii, voi pahoin, ajattelee
käsittämättömiä asioita, säälii muita, mutta on itse mitä
surkuteltavin! Miettii, puhuu, tunnustaa rakkautensa, miettii sitten
taas, kunnes nai… ja naimisissa puhuu vaimolleen typeryyksiä ja
heittää hänet… Mikä sellaisessa on mieltäkiinnittävää? Minua ihan
suututtaa se, että sankarin sijassa on aina jokin variksenpelätti!
Venäläistä kirjaa lukiessa ei voi milloinkaan unohtaa todellista elämää
— onko se hyvä? Mutta kun lukee ranskalaista romaania, niin
vapisee sankarin tähden, kärsii ja vihaa hänen kanssaan… tekee
mieli tapella, kun hän tappelee, ja itkeä, kun hän kaatuu…
jännityksellä odottaa romaanin loppua, mutta kun on lukenut
loppuun, niin melkein itkettää harmista, että kirja on loppuun luettu.
Sellaisessa elää mukana, mutta venäläisessä romaanissa ei voi
ymmärtää, minkätähden ihmiset elävät? Miksi pitääkin kirjottaa
romaaneja, kun ei ole mitään erikoisempaa sanottavana? Merkillistä?

— Tätä vastaan voisi väittää paljonkin, Varjenka Vasiljevna, —


seisautti Ippolit Sergejevitsh hänen puhetulvansa.

— Mitäs muuta, väittäkää! — sanoi Varjenka hymyillen. — Te


todistatte minut kyllä kumoon.

— Ainakin koetan. Ensinnäkin, mitä venäläisiä kirjailijoita te olette


lukenut?

— Useita… he ovat kaikki samanlaisia. Esimerkiksi Salias… hän


jäljittelee ranskalaisia, mutta huonosti. Sitäpaitsi ovat hänenkin
sankarinsa venäläisiä, eikä heistä siis voi mitään intresanttia
kirjottaa. Vielä olen lukenut useita muita — Turgenjevia,
Markevitshia, Pasuhinia, minusta tuntuu, kuin jo nimistä voisi
päättää, etteivät he osaa kirjottaa hyvin! Mutta oletteko lukenut
Fortuné de Boisgobey'ta? Ponson de Terrail'ia? Arsène Houssaye'tä?
Pierre Zacconné'ta? Dumas'ta? Gaboriau'ta? Nämä vasta kirjottavat
hyvin! Mutta tiedättekö mitä? Romaaneissa minä eniten pidän
pahantekijöistä, sellaisista, jotka niin taitavasti kutovat pauloja,
murhaavat, myrkyttävät… he ovat viisaita, voimakkaita… ja kun he
sitten vihdoinkin joutuvat kiinni, niin minua oikein harmittaa ja
itkettää. Kaikki vihaavat pahantekijää, kaikki ovat häntä vastaan, hän
on yksin kaikkia vastaan! Sellainen pitää sankarin olla! Mutta toiset,
hyväntekijät, muuttuvat inhottaviksi heti, kun ovat päässeet
voitolle… Ja yleensä, minä pidän ihmisistä niin kauan kuin he
innokkaasti haluavat jotakin, pyrkivät johonkin, etsivät jotakin,
kituvat… mutta jos he saavuttavat päämaalinsa ja pysähtyvät, niin
heti he menettävät mielenkiintoisuutensa… muuttuvat mauttomiksi!
Innostuneena ja ylpeänä siitä, mitä oli sanonut, Varjenka astui
hitaasti hänen vieressään pää kauniisti pystyssä ja silmät säteillen.

Ippolit Sergejevitsh katsoi häntä kasvoihin ja hermostuneesti


nyhtäen partaansa koetti keksiä vastaväitteitä, jotka yhdellä kerralla
olisivat pyyhkineet pois sen tomukudoksen, joka peitti tytön järjen.
Mutta vaikka hän tunsikin velvollisuudekseen vastustaa tytön
mielipiteitä, niin hänen teki mielensä kuunnella hänen naiivia ja
omaperäistä pakinaansa ja nähdä hänen omain arvelujensa
innostamana avaavan vilpittömästi sielunsa. Ippolit Sergejevitsh ei
ollut koskaan kuullut sellaista puhetta; se oli mahdotonta ja pahaa,
mutta samalla se sopi niin erinomaisesti tytön villiin kauneuteen.
Hänen edessään oli hiomaton järki, joka loukkasi häntä
raakuudellaan, ja viettelevän kaunis nainen, joka kiihotti hänen
aistillisuuttaan. Nämä kaksi voimaa painoivat häntä kaikella
välittömyydellään, ja täytyi asettaa jotakin niitä vastaan, muuten —
hän tunsi sen — ne saattaisivat suistaa hänet omain mielipiteittensä
ja mielialojensa tavalliselta radalta, jota pitkin hänen elämänsä oli
rauhallisesti kulkenut siihen saakka, kun hän oli nähnyt Varjenkan.
Hän oli selväjärkinen ja hän piti hyvin puoliaan omasta piiristä olevia
ihmisiä vastaan. Mutta kuinka hän puhuisi tytölle ja mitä hän sanoisi
hänelle johtaakseen hänen järkensä oikealle tolalle ja jalostaakseen
hänen sieluaan, jota huonot romaanit, seurustelu rahvaan, palvelija
Nikonin ja juopon isän kanssa olivat turmelleet?

— Oh, kylläpäs minä innostuinkin puhumaan! — huudahti tyttö


hengittäen syvään. — Taisi kyllästyttää teitä?

— Ei suinkaan, mutta…

— Minä olen, nähkääs, iloinen saadessani puhua kanssanne.


Minulla ei ole ollut kenen kanssa puhua. Teidän sisarenne ei pidä
minusta ja vihottelee vain minulle… kaiketi sentähden, että minä
annan isälle viinaa ja että kerran annoin Nikonille selkään…

— Te? Nikonille selkään? Mutta kuinka te?… — ihmetteli Ippolit


Sergejevitsh.

— Se kävi aivan yksinkertaisesti, minä pehmitin häntä hiukan isäni


pampulla, siinä kaikki! Oli, näettekös, tulinen kiire, puitiin paraikaa,
mutta se nauta juopotteli vain! Minä suutuin kovasti! Juopotella
silloin, kun kiireinen työ on käynnissä ja kun hänen täytyisi pitää
silmällä kaikkea!

— Mutta kuulkaa, Varjenka Vasiljevna, — sanoi Ippolit Sergejevitsh


vakuuttavasti ja niin lempeästi kuin taisi, — onko sopivaa lyödä
palvelijaansa? Onko se jalomielistä? Ajatelkaa! Tokkohan ne sankarit,
joitten edessä te polvistutte, lyövät alamaisiaan?… Sadi-Koko?

— Tokkohan?! Kreivi Louis antoi Sadi-Kokolle kerran sellaisen


korvapuustin, että minun tuli oikein sääli vanhaa sotilasta. Ja mikä
muu minua auttaisi heidän kanssaan? Onpa hyvä, että voin niin
tehdä… sillä olenhan minä vahva! Koettakaa lihaksiani!

Hän jännitti käsivartensa ja tarjoi sen ylpeästi koeteltavaksi. Ippolit


Sergejevitsh laski kämmenensä hänen käsivarrelleen kyynärpään
yläpuolelle ja puristi lujasti, mutta samassa hän ikäänkuin havahtui
ja katsoi punastuneena hämillään ympärilleen. Puut vain kohosivat
ääneti joka puolella…

Ippolit Sergejevitsh ei yleensä ujostellut naisten seurassa, mutta


tytön yksinkertaisuus ja luottamus tekivät hänet sellaiseksi, vaikka
ne sytyttivätkin hänessä vaarallisen tunteen.
— Te olette kadehdittavan terve, — sanoi hän miettivästi katsellen
tytön pientä ruskettunutta kämmentä.

— Ja minä luulen, että teillä on erittäin hyvä sydän, — pääsi


häneltä kuin huomaamatta.

— En tiedä! — virkkoi Varjenka päätään huojuttaen. — Tuskinpa…


minussa ei ole luonnetta: toisinaan minä säälin sellaisiakin, joista en
pidä.

— Toisinaanko vain? — hymähti Ippolit Sergejevitsh. — Mutta


ansaitsevathan he aina sääliä ja myötätuntoisuutta.

— Mistä hyvästä?

— Ettekö te näe, kuinka onnettomia he ovat? Esimerkiksi nuo


teidän talonpoikanne. Kuinka raskasta on heidän elämänsä ja kuinka
paljon vääryyttä, surua ja kärsimyksiä he saavat kokea.

Tämän hän sanoi kiihkeästi. Varjenka katsoi tarkkaavasti häntä


silmiin ja sanoi:

— Te olette kaiketi erittäin hyväsydäminen, koska tuollaista


puhutte. Mutta ettehän te tunne talonpoikia, kun ette ole asunut
maalla. He ovat onnettomia, se on totta, mutta kuka on syypää
siihen? He ovat viekkaita, eikä kukaan estä heitä tulemasta
onnellisiksi.

— Mutta eihän heillä ole edes leipää sen vertaa, että saisivat
syödä kylläkseen!

— Vielä mitä! Heitä onkin paljon…


— Niin, heitä on paljon! Mutta maata on myöskin paljon, sillä on
ihmisiä, joilla on kymmeniä desjatinoja maata. Paljonko teillä,
esimerkiksi, on?

— Viisisataa seitsemänkymmentäkolme… Entä sitten? Ei suinkaan


sitä pidä jakaa heille?

Tyttö katsoi Ippolit Sergejevitshiin jotakuinkin samalla tavalla kuin


täysikasvuinen katsoo lapseen ja nauroi hiljakseen. Tämä nauru
ärsytti miestä, jossa heräsi halu saada toinen vakuutetuksi
erehdyksestään.

Ja Ippolit Sergejevitsh alkoi puhua omaisuuden epätasaisesta


jaosta, vääryydestä, jota suurin osa ihmisiä saa kärsiä, kovasta
kamppailusta tilan ja leipäpalan tähden, rikkaitten voimasta ja
köyhien heikkoudesta ja järjestä, elämän johtotähdestä, jonka
vuosisatain vääryydet ja ennakkoluulot ovat pimittäneet.

Tyttö käveli ääneti hänen vieressään katsellen häneen uteliaasti ja


ihmetellen.

Heidän ympärillään vallitsi metsän hämärä hiljaisuus, sellainen


hiljaisuus, jossa äänet ikäänkuin luiskahtavat ohi rikkomatta sen
alakuloista sopusointuisuutta.

Haapain lehdet lepattivat hermostuneesti, ikäänkuin puut olisivat


odottaneet jotakin kiihkeästi toivottua.

— Jokaisen rehellisen ihmisen velvollisuus, — jatkoi Ippolit


Sergejevitsh vakuuttavasti, — on panna järkensä ja sydämensä
alttiiksi taistelulle sorrettujen oikeuksien puolesta ja koettaa joko
lyhentää kärsimyksiä tai jouduttaa taistelun menoa. Tähän tarvitaan
todellista sankariutta, mutta juuri tästä taistelusta teidän pitää etsiä
sitä. Sen ulkopuolella ei ole sankariutta. Tämän taistelun sankarit
yksin ansaitsevat ihmetystä ja jäljittelyä… ja teidän, Varjenka
Vasiljevna, pitää kiinnittää huomionne juuri siihen, siitä etsiä
sankareja, siihen uhrata voimanne… Teistä tulisi mielestäni
erinomainen totuuden puolustaja! Mutta teidän pitää ennen kaikkea
lukea paljon, oppia tuntemaan elämää sen kaunistamattomassa
muodossa… teidän pitää heittää kaikki nuo joutavat romaanit
tuleen…

Hän vaikeni ja pyyhkien pitkästä luennosta väsyneenä hikeä


otsaltaan odotti, mitä tyttö sanoisi.

Tämä katsoi kauas eteensä silmät puoleksi ummessa.

Kevyet varjot liikkuivat hänen kasvoillaan. Viisiminuuttisen vaitiolon


keskeytti tytön hiljainen huudahdus:

— Kuinka hyvin te puhutte!… Puhuvatko yliopistossa kaikki yhtä


hyvin?

Nuori oppinut huokasi toivottomasti, ja hänen odotuksensa


muuttui kolkoksi ärtyisyydeksi Varjenkaa ja sääliksi omaa itseään
kohtaan. Miksei hän käsitä sitä, mikä on niin selvää jokaiselle edes
hiukankin ajattelevalle ihmiselle? Mitä puuttui hänen puheestaan,
koska se ei herättänyt tytössä myötätuntoa?

— Te puhutte erittäin hyvin! — sanoi tyttö huokaisten, hänen


vastaustaan odottamatta.

— Mutta puhunko minä totta?


— Ette! — vastasi tyttö harkitsematta. — Vaikka olettekin oppinut,
niin minä sittenkin uskallan väittää teitä vastaan. Kyllä minäkin
ymmärrän jotakin!… Teidän mielipiteenne on se, että ihmiset
rakentavat talon ja ovat kaikki samanarvoisia tässä työssä. Eivätkä
ainoastaan ihmiset, vaan kaikki: tiilikivet, hirret, kirvesmiehet ja itse
talon isäntä. Mutta onko se mahdollista? Työmiehen täytyy tehdä
työtä, teidän täytyy opettaa ja kuvernöörin pitää silmällä, että kaikki
tekevät tehtävänsä. Sitten te sanoitte, että elämä on taistelua…
Missä sitä on? Päinvastoin, ihmiset elävät kaikessa rauhassa. Mutta
jos se kerran on taistelua, niin täytyy olla myöskin voitetuita. Ja
yleinen hyvä — sitä minä en ymmärrä ensinkään. Te sanotte, että
yleinen hyvä on kaikkien tasa-arvoisuudessa. Se on väärin! Minun
isäni on eversti; kuinka hän voisi olla samanarvoinen kuin Nikon tai
joku talonpoika? Ja te, te olette oppinut, mutta tokkohan te olette
samanarvoinen kuin meidän venäjänkielen opettajamme, joka
ryypiskeli… ja niisti nenäänsä kuin olisi puhaltanut torveen?

Tyttö riemuitsi pitäen johtopäätöksiään kumoamattomina, mutta


Ippolit Sergejevitsh nautti tytön riemusta ja oli tyytyväinen, kun oli
voinut antaa hänelle tämän riemun.

Mutta Ippolit Sergejevitshin järki koetti ratkaista kysymystä, miksi


hänen tytössä herättämänsä ajatus työskenteli aivan päinvastaiseen
suuntaan kuin mihin hän oli antanut sysäyksen.

— Minä pidän teistä, en muista… missä sitten lienee tasa-


arvoisuus?

— Pidättekö minusta? — kysyi Ippolit Sergejevitsh yhtäkkiä.

— Pidän… kovasti! — vastasi tyttö nyökäyttäen vakuuttavasti


päätään ja kysyä tokaisi:
— Kuinka niin?

Ippolit Sergejevitsh ihan hämmästyi sitä naiivisuuden


pohjattomuutta, joka katsoi häneen noista kirkkaista silmistä.

— Olisiko tuo ehkä hänen tapansa kiemailla? — ajatteli hän.

— Miksi te sitä kysytte? — uteli tyttö katsoen häneen.

Varjenkan katse saattoi hänet hämille.

— Miksi? — hän kohautti olkapäitään. — Onhan se luonnollista. Te


olette nainen… minä mies… — selitti hän niin tyynesti kuin taisi.

— Entä sitten? Ette suinkaan te siksi kysy. Ettehän aio mennä


naimisiin kanssani?

Tyttö sanoi sen niin luonnollisesti, ettei hän edes hämmästynyt.


Mutta miehestä tuntui, kuin jokin tunne, jonka sokeata voimaa
vastaan olisi ollut hyödytöntä taistella, olisi kääntänyt hänen
ajatuksensa toiseen suuntaan, ja sanoi muka leikillisesti:

— Kuka tietää?… Ja sitäpaitsi halu miellyttää ja mennä naimisiin ei


ole sama, kuten tiedätte.

Varjenka purskahti heleään nauruun, joka heti kylmensi Ippolit


Sergejevitshiä ja saattoi hänet mielessään kiroamaan sekä itseään
että tyttöä. Mutta tytön korkea rinta vapisi terveestä, sydämellisestä
naurusta, joka pani ilmankin iloisesti väräjämään. Ippolit
Sergejevitsh vaikeni odottaen alistuvasti vastausta.

— Oh! Millainen… millainen minä olisin teidän vaimonanne! Se oli


naurettavaa… kamelikurki ja mehiläinen! Ha ha ha!
Ja Ippolit Sergejevitsh rupesi myöskin nauramaan, ei tuota
hauskaa vertausta, vaan sitä, että hän ei käsittänyt niitä ponnistimia,
jotka johtivat hänen sielunliikkeitään.

— Te olette herttainen tyttö! — tunnusti hän vilpittömästi.

— Antakaa kätenne… te kävelette niin hitaasti, minä vedän teitä!


Meidän täytyy joutua kohta kotiin… Olemme olleet poissa jo nelisen
tuntia… ja Jelisaveta Sergejevna voi suuttua, sillä taidamme
myöhästyä päivälliseltä…

He kääntyivät takaisin. Ippolit Sergejevitsh tunsi


velvollisuudekseen oikaista tytön väärinkäsityksiä, jotka eivät
antaneet hänen tuntea itseään tytön vieressä niin vapaaksi kuin olisi
tahtonut. Mutta sitä ennen oli painettava omassa itsessä alas se
epämääräinen levottomuus, joka esti häntä rauhallisesti
kuuntelemasta ja ratkaisevasti kumoamasta tytön johtopäätöksiä.
Hänen olisi ollut niin helppo leikata kylmällä järjellään tytön aivoista
pois tuo ruma kasvannainen, jollei tämä omituinen, lamauttava
tunne, jolla ei ole nimeä, olisi estänyt siitä. Mitä se oli? Se oli
jonkunlaista haluttomuutta johtaa tämän nuoren tytön henkiseen
maailmaan uusia, outoja käsitteitä… Mutta sellainen velvollisuutensa
laiminlyöminen olisi häpeäksi periaatteen miehelle… Ja sellaisena
hän piti itseään ja oli syvästi vakuutettu järjen voimasta ja sen
vallasta tunteen yli.

— Tänään on tiistai? — virkkoi Varjenka. — Niin on. Kolmen


päivän perästä saapuu siis se musta, pikkuinen herra….

— Kuka ja kenen luo?

— Musta, pikkuinen herra… Bjenkovskij saapuu teille lauvantaina.


— Minkätähden?

Varjenka rupesi nauramaan katsoen tutkivasti toveriinsa.

— Ettekö tiedä? Hän on virkamies ja…

— Niin, se on totta! Sisareni on kertonut hänestä…

— Kertonut? — innostui Varjenka. — Vai niin… Sanokaa,


luuletteko, että he piankin menevät vihille?

— Mitä? Miksi vihille? — kysyi Ippolit Sergejevitsh hajamielisesti.

— Miksi? — kummasteli Varjenka punastuen. — En minä tiedä.


Sellainen on tapa! Mutta hyvänen aika, ettekö te siitä tiennytkään?

— En ensinkään! — sanoi Ippolit Sergejevitsh vakuuttavasti.

— Ja nyt olen minä sen teille kertonut! — huudahti tyttö


epätoivoisesti. — Mainiota! Mutta rakas Ippolit Sergejevitsh, älkää
nytkään olko sitä tietävinänne… niinkuin minä en olisi hiiskunut siitä
mitään!

— Olkoon menneeksi! Mutta enhän minä itse asiassa mitään


tiedäkään. Ymmärsin vain, että sisareni menee naimisiin herra
Bjenkovskijn kanssa?…

— Niin. Mutta jollei sisarenne ole itse siitä teille puhunut… niin
ehkei siitä tulekaan mitään. Ettehän puhu hänelle tästä?

— En puhu, tietysti! — lupasi Ippolit Sergejevitsh. — Minä läksin


tänne hautajaisiin, mutta taisinkin saapua häihin. Sepä hauskaa!
— Minä pyydän, ei sanaakaan häistä! Te ette tiedä koko jutusta
mitään.

— Aivan oikein, minä en tiedä mitään. Entä kuka tuo herra


Bjenkovskij on? Jos saan kysyä?

— Saatte kyllä! Hän on tummahko, sievähkö, vakavahko. Hänellä


on pienet silmät, pienet viikset, pienet huulet, pienet kädet ja pieni
viulu. Hän pitää lempeistä lauluista ja hillosta. Minun tekee aina
mieleni taputtaa häntä pienelle nenälleen.

— Te ette näy pitävän hänestä! — huudahti Ippolit Sergejevitsh


tuntien tällaisen kuvauksen jälkeen sääliä pikku Bjenkovskijta
kohtaan.

— Eikä hän pidä minusta… Minä en voi sietää pieniä, suloisia,


kainoja miehiä. Miehen täytyy olla kookas, voimakas, puhua lujasti,
hänellä täytyy olla suuret, tuliset silmät, rohkeat tunteet, jotka eivät
tiedä mistään esteistä. Tahtoi ja teki — sellainen täytyy miehen olla!

— Sellaisia ei taida enää olla olemassa, — virkkoi Ippolit


Sergejevitsh kuivasti tuntien, että tytön miehenihanne on hänelle
vastenmielinen ja ärsyttävä.

— Täytyy olla! — huudahti tyttö.

— Mutta tehän kuvasitte jonkunlaista petoa! Mitä viehättävää voi


sellaisessa olla?

— En petoa, vaan miestä! Voima, se viehättää! Nykyaikaisissa


miehissä on jo syntymästä saakka reumatismia, yskää ja kaikenlaisia
muita tauteja. Onko sellainen viehättävää sitten? Voisinko minä olla
onnellinen, jos mieheni olisi arpinen kuin kunnallisesimies Kokovitsh?
Tai sievä kuin pikku herra Bjenkovskij? Tai käyräselkäinen
hongankolistaja kuin oikeuspristavi Muhin? Tai iso, lihava, ähkyvä ja
puhkuva, kaljupäinen ja punanenäinen kuin kauppiaan poika Grisha
Tshernonjebov? Millaisia tulisivat mokomain hylkyjen lapset? Sitä
pitää ajatella, lapsia, se on hyvin tärkeätä! Mutta he eivät ajattele,
he eivät välitä mistään. He eivät kelpaa mihinkään, ja minä löisin
miestäni, jos hän olisi sellainen kuin joku mainituista!

Ippolit Sergejevitsh hillitsi häntä todistaen, että hänen tuomionsa


miehistä on väärä, koska hän on nähnyt heitä niin muutamia. Eikä
mainituitakaan miehiä saa arvostella pelkästään ulkomuodon
mukaan, se olisi väärin. Miehellä saattaa olla ruma nenä, mutta
kaunis sielu, arpia kasvoissa, mutta selvä järki päässä. Hänen oli
ikävä ja vaikea puhua näistä alkeistotuuksista, sillä hän oli ajatellut
niin harvoin heidän olemassaoloaan, että he kaikki nyt näyttivät
hänestä ikäänkuin homehtuneilta, kuluneilta. Hän tunsi, että kaikki
tämä ei sopinut tytölle eikä vaikuttanut häneen…

— Kas tuossa on joki! — huudahti Varjenka iloisesti keskeyttäen


toverinsa puheen.

Ja Ippolit Sergejevitsh ajatteli:

— Hän on iloinen, kun lopetin.

He soutivat taas jokea pitkin istuen toinen toistaan vastapäätä.


Varjenka oli airoissa ja souti joutuisasti, voimakkaasti. Vesi kohosi
veneen alla tyytymättömästi, pienet laineet juoksivat rantoja pitkin.
Ippolit Sergejevitsh katsoi, kuinka rannat kulkivat päinvastaiseen
suuntaan kuin vene, ja hän tunsi väsyneensä kaikesta siitä, mitä oli
tällä matkalla puhunut ja kuullut.
— Katsokaa, kuinka vene kiitää nopeasti! — sanoi Varjenka.

— Niin, — virkkoi toinen siihen lyhyesti katsomatta tyttöön;


taipuvan vartalon ja kohoavan rinnan hän siitä huolimatta näki
edessään.

Puisto tuli näkyviin… He astuivat nopeasti sen käytävää pitkin ja


näkivät kuinka solakkavartaloinen Jelisaveta Sergejevna tuli heitä
vastaan merkitsevä hymy huulilla. Hän piti joitakin papereja
kädessään ja sanoi:

— Kylläpä kävelittekin!

— Olimmeko kauan? Mutta kyllä minulla onkin sellainen ruokahalu,


että — äh! söisin teidätkin!

Ja Varjenka pyöritti häntä ympäri nauraen hänen huudoilleen.

Päivällinen oli mauton ja ikävä, sillä Varjenka tyydytti nälkäänsä ja


vaikeni, ja Jelisaveta Sergejevna kiusotteli veljeään tutkivilla
katseillaan. Heti päivällisen jälkeen Varjenka läksi pois, ja Ippolit
Sergejevitsh meni huoneeseensa, kävi sohvalle pitkäkseen ja alkoi
tehdä tiliä päivän vaikutelmista. Hän muisteli kävelymatkaa
pikkuseikkoja myöten ja tunsi, kuinka niistä muodostui hänen
sieluunsa samea sakka, joka uhkasi rikkoa hänen tunteittensa ja
järkensä välillä vallinneen tavallisen vakavan tasapainon. Hän tunsi
fyysillisestikin tunnelmansa uutuuden omituisena raskautena, joka
painoi hänen sydäntään, ikäänkuin verensä olisi käynyt sakeammaksi
ja hitaammaksi. Tämä tunne muistutti väsymystä, herätti hänessä
haaveilua ja oli ikäänkuin johdantoa johonkin haluun, joka ei vielä
ollut ottanut muotoa. Ja se kiusasi häntä vain siksi, että se oli
nimetöntä aistintaa ja pysyi sellaisena huolimatta Ippolit
Sergejevitshin ponnistuksista keksiä sille nimi.

— Täytyy antaa analyysin olla siksi, kun kuohunta asettuu… —


päätti hän.

Hän oli tyytymätön itseensä ja nuhteli samalla itseään siitä, että oli
menettänyt kykynsä hillitä mielenliikutustaan ja että oli tänään
käyttäytynyt vakavalle miehelle sopimattomalla tavalla. Kahden
kesken itsensä kanssa hän oli aina ankarampi ja periaatteellisempi
itselleen kuin ihmisten seurassa. Ja nyt hän alkoi tutkiskella itseään.

— Varjenka on todellakin hurmaavan kaunis, mutta joutua heti


ensi näkemältä epämääräisten aistintojen hämäryyteen, se on liian
suuri kunnia Varjenkalle ja häpeällistä hänelle itselleen, sillä sellainen
on siveellistä löyhyyttä, ryhdittömyyttä. Varjenka vaikuttaa
voimakkaasti aistillisuuteen, mutta sitä vastaan on taisteltava. Onko?
— pisti yhtäkkiä hänen aivoissaan.

Hän rypisti otsaansa suhtautuen tähän kysymykseen niin kuin se


ahdistaisi häntä ulkoapäin.

Joka tapauksessa se, mikä hänessä tapahtuu, ei ole hurmausta


naiseen, vaan se on pikemmin yhteentörmäyksestä loukkautuneen
järjen vastalause, josta yhteentörmäyksestä järki ei ollut astunut
voittajana, vaikka vastustaja olikin ollut heikko kuin lapsi. Tytön
kanssa täytyy puhua vertauksilla, sillä hän ei nähtävästi ymmärrä
loogillista todistelua. Hänen velvollisuutensa on hävittää tytön villit
käsitteet, särkeä kaikki nuo raa'at ja typerät mielikuvat, jotka olivat
imeytyneet hänen aivoihinsa. Täytyy vapauttaa tytön järki kaikista
noista harhaluuloista, puhdistaa hänen sielunsa, niin sitten vasta hän
kykenee vastaanottamaan totuuden.
— Voinko minä tehdä sen? — kuuli Ippolit Sergejevitsh
kysymyksen ikäänkuin ulkoapäin. Ja taas hän vältti sen… Millainen
on Varjenka silloin, kun hän on omaksunut jotakin siitä uudesta ja
päinvastaisesta? Ja Ippolit Sergejevitshistä näytti, kuin tytön sielu
harhaluuloista vapauduttuaan ja omaksuttuaan sopusointuisen
maailmankäsityksen ilman epäselvyyttä ja hämäryyttä — tulisi puolta
kauniimmaksi.

Kun kutsuttiin teetä juomaan, oli Ippolit Sergejevitsh jo lujasti


päättänyt muuttaa tytön mielipiteet, ja tätä päätöstä hän piti
suorastaan velvollisuutenansa. Nyt hän kohtelee häntä kylmästi ja
rauhallisesti ja antaa suhteelleen häneen kriitillisen luonteen.

— No, mitä sinä pidät Varjenkasta? — kysyi sisar, kun hän oli tullut
terassille.

— Hauska tyttö, — vastasi hän kulmakarvojaan kohauttaen.

— Niinkö? Vai niin… Minä luulin, että hänen kehittymättömyytensä


olisi hämmästyttänyt sinua.

— Se on totta, se puoli hänessä minua hiukan hämmästyttääkin,


— myönsi Ippolit Sergejevitsh. — Mutta suoraan sanoen hän on
monessa suhteessa yläpuolella kehittyneitä naisia tai naisia, jotka
luulevat olevansa kehittyneitä.

— Hän on hyvin kaunis… Ja edullinen morsian… viisisataa


desjatinaa mitä parhainta maata ja noin sata desjatinaa tukkimetsää.
Ja tädiltään hän tulee perimään myöskin sievoisen maatilan.
Molemmat maatilat ovat kiinnittämättömiä…
Hän huomasi, että sisarensa tahallaan ei häntä ymmärtänyt, mutta
hän ei viitsinyt tehdä itselleen selväksi, miksi hän niin menetteli.

— Minä en ota häntä siltä kannalta, — virkkoi Ippolit Sergejevitsh.

— Ota vain… neuvon sinua vakavasti.

— Kiitoksia.

— Sinä olet huonolla tuulella, nähdäkseni?

— Päinvastoin. Kuinka niin?

— Muuten vain. Tahdoin sinusta huolehtivana sisarena sen tietää.

Jelisaveta Sergejevna hymyili ystävällisesti ja mielistellen. Tämä


hymy johti veljen mieleen herra Bjenkovskijn, ja hän hymyili
myöskin.

— Mitä sinä hymyilet? — kysyi sisar.

— Entä sinä sitten?

— Minun on hauska.

— Minun on myöskin hauska, vaikka en olekaan haudannut


vaimoani kaksi viikkoa sitten, — sanoi veli nauraen.

Jelisaveta Sergejevna otti vakavan ilmeen, huokasi ja sanoi:

— Ehkä sinä mielessäsi tuomitset minut itsekkääksi? Mutta Ippolit,


sinä tiedät mikä mieheni oli, minähän olen kirjottanut sinulle millaista
avioelämäni oli. Usein ajattelin: Hyvä Jumala, en suinkaan minä ole
luotu ainoastaan tyydyttämään Nikolai Stepanovitsh Varipajevin
raakoja aistillisia himoja, kun hän on juonut itsensä niin humalaan,
ettei kykene erottamaan vaimoaan yksinkertaisesta maalaisakasta tai
katunaisesta.

— Onko se mahdollista?… — huudahti Ippolit Sergejevitsh,


muistaen samassa sisarensa kirjeet, joissa tämä oli kirjottanut
miehensä huonosta luonteesta, viinaanmeneväisyydestä,
laiskuudesta ja kaikista paheista, paitsi irstaisuudesta.

— Sinä et usko? — kysyi sisar ja huokasi. — Mutta se on totta;


hän oli usein siinä tilassa… minä en voi varmuudella vakuuttaa, että
hän olisi ollut minulle uskoton, mutta minun täytyy otaksua niin.
Mitenkä hän olisi voinut tuntea, minäkö olin hänen edessään vai joku
toinen, jos hän saattoi pitää akkunaa ovena? Niin… sillä tavalla minä
olen elänyt vuosia…

Sisar puhui kauan surullisesta elämästään, ja veli kuunteli ja


odotti, milloin hän puhuisi siitä, mikä oli hänen sydämellään. Ippolit
Sergejevitsh tuli ajatelleeksi, että Varjenka tulisi tuskin koskaan
valittamaan elämäänsä, miten hänen sitten kävikin.

— Minä arvelen, että kohtalon pitäisi palkita minua surun pitkistä


vuosista… ja kuka tietää, ehkei se olekaan kaukana, tämä
palkitseminen…

Jelisaveta Sergejevna vaikeni ja katsottuaan kysyvästi veljeensä


punastui hiukan.

— Mitä sinä sillä tarkotat? — kysyi veli ystävällisesti kumartuen


häneen päin.

— Näetkös… minä ehkä… menen uusiin naimisiin!


— Se on oikein! Onnittelen… Mutta miksi sinä noin hämille joudut?

— En tiedä.

— Kuka hän on sitten?

— Minä olen muistaakseni puhunut sinulle hänestä… Bjenkovskij…


tuleva prokuraattori… toistaiseksi runoilija ja haaveilija… Ehkä olet
lukenut hänen runojaan? Hän julkaisee niitä…

— En lue runoja. Onko hän hyvä mies? Niin, tietysti hän on hyvä.

— En sano varmasti, että on, mutta sen minä voin sanoa itseäni
imartelematta, että hän voi korvata minun menneisyyteni… Hän
rakastaa minua… Minä olen vähitellen muodostanut itselleni pienen
elämänfilosofian… ehkä se näyttää sinusta hieman julmalta.

— Filosofoi sinä vain… se on muodissa nykyään… — sanoi Ippolit


Sergejevitsh piloillaan.

— Miehet ja naiset ovat kaksi toisilleen ikuisesti vihamielistä


rotua… — selitti sisar pehmeästi. — Luottamus, ystävyys ja muut
samantapaiset tunteet ovat tuskin mahdollisia minun ja miehen
välillä. Mutta rakkaus on mahdollinen… ja rakkaus on vähemmän
rakastavan voitto siitä, joka rakastaa enemmän… Minä olen kerran
tullut voitetuksi, mutta kyllä sainkin maksaa siitä sakkoa… Nyt olen
minä voittanut ja aion nauttia voiton hedelmistä…

— Se on todellakin julmanpuoleista filosofiaa… — keskeytti Ippolit


Sergejevitsh tuntien mielihyväkseen, että Varjenka ei voi filosofoida
samalla tavalla.
— Elämä on sen minulle opettanut… Hän on neljää vuotta
nuorempi minua… päätti hiljakkoin yliopiston… Minä tiedän, että on
vaarallista minulle mennä naimisiin niinkin paljon nuoremman
kanssa… Mutta sitten minä tahtoisin järjestää niin, etteivät minun
oikeuteni omaisuuteeni nähden tulisi mitenkään vaaranalaisiksi.

— Niin… entä sitten? — kysyi Ippolit Sergejevitsh tullen


tarkkaavaksi.

— Olen aikonut kysyä sinulta neuvoa, miten järjestää asiani. Minä


en tahdo antaa hänelle minkäänlaisia juridisia oikeuksia
omaisuuteeni… enkä antaisi oikeuksia personaanikaan, jos se vain
olisi mahdollista.

— Se on luullakseni mahdollista vain siviliavioliitossa. Muuten…

— Ei, siviliavioliittoa minä en tunnusta.

Ippolit Sergejevitsh katsoi sisareensa ja ajatteli inhoten:

— Hän on viisas! Jos Jumala on luonut ihmisiä, niin elämä


vuorostaan on luonut heidät uudestaan siihen määrään, että he
aikoja sitten ovat käyneet Hänelle vastenmielisiksi.

Mutta sisar selitti innokkaasti käsitystään avioliitosta.

— Avioliitto on oleva järkevä sopimus, jossa ei ole mitään uhalla


uskallettua. Niin minäkin olen ajatellut järjestää asiani Bjenkovskijn
kanssa. Mutta ennenkuin minä otan tämän askelen, minä tahtoisin
selvittää miesvainajani kiusallisen veljen vaatimuksen. Ole sinä hyvä
ja tarkasta kaikki paperit.

— Ehkä sallit minun ryhtyä siihen huomenna?


Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like