Aphorisms on programming language design (2017)
rntz.net
rntz.net
Yeah....
> Not everything is an object (Ruby). Nor is everything a function (any FP), a string (Perl), a process (Elixir), an actor (Elixir), a value, a thunk, a message, a list (Clojure), a file (Unix), or an expression (Clojure). Not everything is data (Clojure), nor is everything code. Not everything is lazy (Haskell), immutable (Haskell), pure (Haskell), copyable, serializable, sortable, or transmissible over the network. goto is not the only control operator, and neither is call/cc.
Can you help me fill the missing ones?
Interesting enough after more than 45 years pidfds [1] got added.
Serializable and transmissible are implied by “everything is data” and “everything is an expression”.
Copyable is implied by “...immutable” and “...data”.
Function (lambda calculus, FP)
String (shell, tcl, perl)
Process, actor (the actor model, Carl Hewitt, Erlang)
Value, immutable, pure (pure FP)
Thunk, lazy (lazy FP, Haskell)
File (Unix, plan 9)
List (lisp)
Expression (lisp macros, see linked essay)
Copyable (languages without linear type systems, ie. almost everything but rust; tbf some languages have a move/copy distinction even if they don't enforce it with a type system)
Serializable, transmissible over the network (anything that tries to do transparent RPC or state saving, smalltalk images, object databases, X windows)
Sortable (anything with a generic sort function that doesn't take a comparator or similar; ditto generic collection types like maps or sets that don't take a comparator or hash function)
goto (see Dijkstra's "goto considered harmful" essay)
call/cc (Scheme; see also recent work on algebraic effects and delimited continuations)
(I'm the author)
If you think Ruby goes far with that idea, check out Pharo. In Pharo, even an object's fields are objects. Not just the value the field references. The field itself.
[0] https://en.wikipedia.org/wiki/Common_Lisp_Object_System#Meta...
>> Types are a tool of thought. They exist in the mind first, and in the machine second.
>> A statically typed language, therefore, guides your thinking. This is useful. >> A dynamically typed language lets you think freely. This too is useful.
As is this -
>> Not everything is an object. Nor is everything a function, a string, a process, an actor, a value, a thunk, a message, a list, a file, or an expression. Not everything is data, nor is everything code. Not everything is lazy, immutable, pure, copyable, serializable, sortable, or transmissible over the network. goto is not the only control operator, and neither is call/cc.
23 ...
iii Everybody loves parenthesis
With a hyperlink to someone complaining about Forth or COBOL or something.And holy three of them, if you want a cult.
Assembler
A language that doesn't let you decide what registers will be used to store data, or interleave conditional branch statements in clever ways, or carefully select which instructions you use in order to tightly synchronize the program's execution to some outside signal such as the monitor's vertical retrace[1], is a language with a lot more freedom to do things like compiler optimizations.
[1] Dated example, I realize. Unless you count playing TIS-100, it's been a minute or two since I last did anything interesting in assembler.