The Typestate Pattern in Rust
The typestate pattern is an API design pattern that encodes information about an object’s run-time state in its compile-time type . In particular, an API using the typestate pattern will have:
Topics /
The most popular blog posts about programming languages on Hacker News. 5,634 posts.
The typestate pattern is an API design pattern that encodes information about an object’s run-time state in its compile-time type . In particular, an API using the typestate pattern will have:
This PEP suggests to support non-ASCII letters (such as accented characters, Cyrillic, Greek, Kanji, etc.) in Python identifiers.
(This article has been translated into Spanish (PDF, with some additions) by Jorge Amado Soria Ramirez — thanks!) Preface I’m cranky. I complain about a lot of things. There’s a lot in the world of technology I don’t like, and that’s really to be expected—programming is a hilariously young discipline, and none of us
This PEP is a tutorial for the pattern matching introduced by PEP 634.
Clojure is a dynamic development environment where you interact with your program while you write it, growing and adding to it while it’s running. To work with Clojure you need an editor that supports evaluation in source files and structural editing (working with nested forms in addition to character editing).
I recently posted an entry in my Python History blog on the origins of Python's functional features . A side remark about not supporting ta...
Context free grammars (CFGs) are a valuable theoretical tool on which the modern compilation theory relies for parsing the code of programming languages. For example, the most popular tool used for parsing – YACC , generates parsers for CFGs. What most people don’t know 1 is that the vast majority of programming…
Tuple parameter unpacking is the use of a tuple as a parameter in a function signature so as to have a sequence argument automatically unpacked. An example is:
I’ve been doing a lot of work, lately, with JavaScript inheritance – namely for my work-in-progress JavaScript book – and in doing so have examined a number of different JavaScript classical-inheritance-simulating techniques. Out of all the ones that I’ve looked at I think my favorites were the implementations…
The spec library ( API docs ) specifies the structure of data, validates or conforms it, and can generate data based on the spec.
One of the greatest feature of the Rebol language has always been its parsing engine, simply called Parse. It is an amazing piece of des...
I hate Booleans! But isn’t everything “just bits”? Aren’t computers built from gates? And aren’t gates just the logical connectives? How can a Computer Scientist p…
(These are some notes I made for a panel discussion on programming language design at MIT on May 10, 2001.) 1. Programming Languages Are for People. Programming languages are how people talk to computers. The computer would be just as happy speaking any language that was unambiguous. The reason we have high level…
To dwellers in a wood, almost every species of tree has its voice as well as its feature. Thomas Hardy, Under the Greenwood Tree
A bit over a year ago, I wrote some notes on a “smaller Rust” - a higher level language that would take inspiration from some of Rust’s type system innovations, but would be simpler by virtue of targeting a domain with less stringent requirements for user control and performance. During my time of unemployment this…
This PEP introduces generator expressions as a high performance, memory efficient generalization of list comprehensions PEP 202 and generators PEP 255.
In this blog post, I will present one of the most interesting additions to the community 2019 version of SPARK: pointer support. One of the core…
Urbit is a static functional namespace : a programming environment specified as a single stateless, frozen function. The Urbit function is ...
An introduction to Go errors.
Please see our Visual Studio 2019 version 16.8 Preview 3 release notes for more of our latest features. Update: Windows 10 SDK version 2104 has been
A more permanent version of this article is stored at GitHub . Please link to that rather than to here. If you hadn't guessed, this is about...
This PEP describes an addition to the standard library called Data Classes. Although they use a very different mechanism, Data Classes can be thought of as “mutable namedtuples with defaults”. Because Data Classes use normal class definition syntax, y...
This PEP outlines the behavior of Python scripts when the python command is invoked. Depending on a distribution or system configuration, python may or may not be installed. If python is installed its target interpreter may refer to python2 or python3. ...
This document gives coding conventions for the Python code comprising the standard library in the main Python distribution. Please see the companion informational PEP describing style guidelines for the C code in the C implementation of Python.
Visit the post for more.
How to implement type classes in terms of term-level data structures