Monday, August 30. 2004
There are a lot of virtual machine interpreters out there. Java was the first well-known one, but VMs are also used for .NET, OCaml, Python, and the new Parrotcode VM will likely be used for Perl 6.
I started a discussion on the OCaml mailing list about some other bytecodes OCaml could target, with very interesting results. OCaml interpreters or compilers already exist for both Java and .NET.
There's more to this than meets the eye, though. There are many different languages supported by .NET even though the .NET CLR does not lend itself to many of them very well. There are also a number of languages supported by the Java JVM, and Parrot is looking to support a good number, too. So it appears that no VM is going to promise the mythical language convergence .NET was talking about. Rather, we're going to have too many choices. I wish we could standardize on a single VM and go with that.
Wednesday, August 25. 2004
Update 9/23/2004: There is now a page for this book on my homepage, Complete.Org.
My latest book, Foundations of Python Network Programming, is now available for purchase ( Amazon, bn, AllDirect, buy.com). This book is designed to show you everything from fundamentals of networking and low-level protocol design to work with higher-level protocols such as IMAP, HTTP, and FTP. For more information, please see the letter to the reader from the book's back cover.
This is not a basic reference like Python comes with. Rather, it's a hands-on guide. There are over 6600 lines of example code and the text strives to show you the big picture. For instance, there are several different ways of getting directory information from an FTP server, and some are not documented for use this way. The chapter on FTP explains them and provides example code to illustrate. There's also an Apress page with details.
Below is the book's Table of Contents along with a partial list of the examples you'll find in each chapter:
- Part I: Low-Level Networking
- Chapter 1: Introduction to Client/Server Networking
Provides basic concepts of TCP/IP networking for those new to it. Examples include very basic versions of: Gopher client, URL downloading program. - Chapter 2: Network Clients
Constructing basic network clients: setting up sockets, connecting to servers, sending/receiving data, handling errors. Covers TCP and UDP. Examples include: connecting to servers, error handling, obtaining the exact current time from a UDP network time server.
- Chapter 3: Network Servers
Constructing basic network servers: binding to a port, listening, handling connections, logging, socket options, inetd servers. Handling multiple simultaneous connections is covered in Part VI. Examples include: TCP and UDP echo servers, TCP echo client, TCP and UDP inetd servers.
- Chapter 4: DNS
Advanced DNS topics: reverse lookups, advanced forward lookups, information about the local system. Examples include various DNS query and lookup utilities.
- Chapter 5: Advanced Network Operations
Advanced network topics that are usually applicable to both client and servers: half-open sockets, timeouts, network byte order, broadcasts, IPv6. Examples include: UDP broadcast sending and receiving programs, binding to specific interfaces, IPv6 HTTP client, network byte order example, cross-protocol DNS lookups.
- Part II: Web Services
- Chapter 6: HTTP
Obtaining documents from a Web server. Examples include: obtaining information from headers, submitting GET and POST forms, handling errors, and dumping pages.
- Chapter 7: HTML
Parsing HTML documents. Examples include: basic parsing, obtaining the weather forecast for a region.
- Chapter 8: XML and XML-RPC
Handling XML documents and communicating with XML-RPC servers. Examples include: DOM tree parsing and mainpulation, XML-RPC news reader, interactive XML-RPC introspection client.
- Part III: E-Mail
- Chapter 9: Message Composition and Decoding
Generating message headers and bodies. Using MIME to represent attachments, data encodings, header languages, etc. Examples include: date parsing, MIME decoding, attachments, multipart messages, header generation and parsing, MIME and non-MIME generation.
- Chapter 10: SMTP
Using the Simple Mail Transfer Protocol to transmit messages to remote servers. Covers topics such as establishing a connection, authentication, SSL/TLS, setting recipients, etc. Examples include: mail transmission program, TLS support.
- Chapter 11: POP3
Downloading mail using the simple POP3 protocol. Examples include: mailbox information, download messages, delete messages.
- Chapter 12: IMAP
A detailed look at the IMAP protocol, including basic connections, authentication methods, folder lists and selection, message searching, flag handling, message retrieval, message storage and copying, and UID handling. Presents the Twisted IMAP4Client library and a brief coverage of the built-in imaplib. Examples include: error handling, uploading messages, downloading messages, deleting messages, message structure, searching, more.
- Part IV: General-Purpose Client Protocols
- Chapter 13: FTP
Using the popular protocol to transfer files, get directory listings, discover information about remote files, handle passive mode connects. Examples include: a basic recursive-download FTP client, directory parsing.
- Chapter 14: Database Clients
Using Python's DB-API 2.0 to connect to database servers. Provides general DB-API background and specific examples using MySQL and PostgreSQL, and the zxJDBC connector. Examples include: connecting, querying, various ways of accessing the result set.
- Chapter 15: SSL/TLS
Provides a primer on the potential attacks network programs can face and ways to help reduce them by using SSL. Covers the standard socket.ssl in Python and the more powerful PyOpenSSL. Includes coverage and example code to implement key/certificate verification. Examples include: basic use of the libraries, verification.
- Part V: Server-Side Frameworks
- Chapter 16: SocketServer
Covers this basic infrastructure for writing TCP servers. Includes coverage of BaseHTTPServer and CGIHTTPServer as well as the mix-in classes for forking and threading. Examples include: time server, IPv6 support, HTTP servers.
- Chapter 17: SimpleXMLRPCServer
Shows how to write your own XML-RPC server and interface it to new or existing code. Also covers derivitaves of SimpleXMLRPCServer. Examples include: math server, introspection support.
- Chapter 18: CGI Library
Explains how CGI fits in with a Web server, covering escaping, form processing, cookie handling, and document generation. Examples include: interactive quiz program, environment.
- Chapter 19: mod_python
This Apache module embeds a Python interpreter into the web server. It can be used not just to accelerate dynamic Web sites but also to customize the behavior of Apache itself. Examples include: interactive quiz program, escaping, versatile dispatching system.
- Part VI: Multitasking
- Chapter 20: Forking
Covers the use of forking on Unix platforms under Python. Describes the mechanics of forking, different ways to handle dying child processes, error handling, locking, performance, and implications for server authors. Examples include: echo server, zombie process examples.
- Chapter 21: Threading
Covers the use of threading on multiple supported Python platforms. Describes the mechanics of threading, error handling, locking, performance, and implications for server authors. Examples include: echo server, semaphores, thread pools, multi-threaded client.
- Chapter 22: Non-Blocking Sockets
Covers the use of poll() to achieve the appearance of a multitasking server without using either forking or threading. It goes on to cover the higher-level Twisted libraries. Examples include: echo server, an inetd server, chat server.
|
Comments
Fri, 05.09.2008 02:07
Republicans give lip service t o freedom and liberty but usua lly deliver a fascist form of socialism. Democrats tal [...]
Fri, 05.09.2008 00:43
First off, you mentioned "the Republicans know that their po licies aren't working" which i sn't actually true. The [...]
Fri, 05.09.2008 00:00
Though I ride to work in nothi ng like hurricane winds, I hav e been using an electric bike and it really helps figh [...]
Thu, 04.09.2008 21:23
Except that the Democrats aren 't talking about ending war, t hey are just looking to shift focus from Iraq to Afgha [...]
Thu, 04.09.2008 10:14
At least he didn't say, "A kan garoo!" http://forest.compl ete.org/posts/395-Kangaroos.ht ml
Wed, 03.09.2008 13:24
This sort of frustration comes into play when people don't u nderstand information manageme nt. Dell, being quite l [...]
Wed, 03.09.2008 12:20
I can't speak for John, and I (happily) haven't seen a recen t Dell catalog, but: I hav e yet to see a computer [...]
Wed, 03.09.2008 11:31
You falsely claimed that you f ound the materials sexually pr ovocative. That the supreme co urt ruled that the gover [...]