Features of a dream programming language: 2nd draft
Tags: programming, languages, computerscience, design
Published: 2022-02-10 15:19:00

Update: Be sure to read the [3rd draft](https://magnemg.eu/features-of-a-dream-programming-language-3rd-draft) of this article instead. It has a table of contents and everything. It's originally published on my blog https://magnemg.eu/

---

Have you ever dreamt of what features your ideal programming language would have? Have you ever tried to make a list of the best features (or non-features) of languages that are particularly inspired in some way...?

---

## Prelude:

Since I improved [the original article](https://dev.to/redbar0n/features-of-a-dream-programming-language-cio/) quite a bit, I saved the original for posterity. To respect the contents of the original URL (where it may have been shared), and to respect the ensuing [original Hacker News discussion](https://news.ycombinator.com/item?id=29716998) based on it. The original article received some [encouraging feedback](https://twitter.com/yukihiro_matz/status/1451548965019668489?s=20&t=qgCvp6ROsbH7h9Wt5MQDAA) from [Ruby](https://www.ruby-lang.org/en/)'s creator Matz, and positive feedback and excellent critique from [Roc](https://www.youtube.com/watch?v=6qzWm_eoUXM)'s creator Richard Feldman.

The article is a long read, so I suggest first skimming it and dipping into the sections where you find interest or disagreement. Then, if your curiosity is piqued by the ideas, I hope you will take time read it carefully over a few evenings, mull over the ideas presented (a few may be novel), consider your own dream language features, and contribute those, as well as your own insights and experience, in the comments below.

Even if you disagree with my wishes, you could treat the list as an overview over many of the language features you ought to consider when designing a programming language. Since this list is effectively a compiled list of a few such feature lists I've come across.

---

## TL;DR / Summary:

I long for a very constrained language for web-app + systems development, prioritizing readability (left-to-right and top-down) and reason-ability above all, which is designed for fast onboarding of complete beginners (as opposed to catering to a specific language community who already have the [curse of expertise](https://en.wikipedia.org/wiki/Curse_of_knowledge)).

The most important **familiar features** it should have:
- Functional Programming, but based on data-first piping.
- Immutability, but w/ opportunistic in-place mutation.
- Gradually typed: dynamic for development, static for production (w/ fully sound type inference).
- Concurrency via goroutines and (the async) unbounded buffered channels.
- Ecosystem: interoperable with existing languages.
- Transpiles to JS or compiles to WASM.

The most important **esoteric features** it should have:
- Crucial evolvability / backward- and forward-compatibility.
  - Content-addressable code.
  - Transparent upgrades without any breaking changes.
- Data First Functional Programming w/ SVO-syntax.
- Interpreted, for development. But compiled, incrementally, for production.
- Interactive: facilitates an IDE-plugin (VS Code) that shows the contents of data structures while coding. Enable REPL'ing into a live system.
- Aggressively parallelizable and concurrent. Inspired by Verilog and Golang.
- Scales transparently from single CPU to multi-core to distributed services, without the language necessitating refactoring of the code.

**Other features**, a short-list of some familiar ones, which it should have:

Eager evaluation (strict, call-by-value), strong & static typing with fully sound type inference, generics, algebraic data types, no null, no exceptions by default, no undefined behavior, async via a blocking/sync interface but non-blocking I/O, reliable package management, tree shakeable, serializable, helpful error messages, good interop.

---

The complete set of desirable features are detailed below (including some limited rationale).

## First, a few overarching guiding principles:

* **All programming languages are first and foremost, in actuality, built to overcome _human_ limitations.** (Not primarily for overcoming _machine_ limitations. Even though we have historically treated programming languages as tools to tinker with machine/hardware.) If they weren't, we might as well be using a lower-level language like Assembly, or typing 0's and 1's. The machine would be just as happy (or happier) with that.
  - Software architecture in general (and frameworks in specific) is _a way to organize the mind_ of the developer(s), categorising the conceptual world into what's closely or merely remotely related (giving rise to principles like 'cohesion over coupling' etc.). (This might explain OOP's popularity. Articles like those on [syntonicity](https://t.co/u0EFh15eg7) seem to confirm this suspicion.) The machine would be perfectly content with executing even spaghetti code. Inspired by [Martin Fowler](https://www.goodreads.com/quotes/6341736-any-fool-can-write-code-that-a-computer-can-understand).
  - A programming language has certain [affordances](https://www.interaction-design.org/literature/topics/affordances), allowing you to talk specifically about/with some concepts (typically the [first-class citizens](https://en.wikipedia.org/wiki/First-class_citizen) of the language), and avoid having to talk about other things (e.g. memory management, language runtime concerns). This does not only apply to [DSL](https://en.wikipedia.org/wiki/Domain-specific_language)'s.
  - "each programming language has a tendency to create a certain mind set in its programmers. ... you tend to have a mental model of how to do things based on that language. ... Such a mind set may make it difficult to conceive of solutions outside of the model defined by the language." - [Dennis J. Frailey](https://www.quora.com/What-did-Alan-Kay-mean-by-Lisp-is-the-greatest-single-programming-language-ever-designed/answer/Alan-Kay-11?comment_id=46099908&comment_type=2)
  - **Programming needs to get away from the notion that the programmer is giving instructions to the machine.** Instead, programming ought to be thought of in terms of modelling a set of things that interact with one another (causal relations). The programmer ("software engineer", really) should not need to be an inherent part of that model. The software engineer should develop software by merely supplying the machine with a description of such a model. This was foreseen by the great computer scientist Edsger Dijkstra: _«Progress is possible only if we train ourselves to think about programs without thinking of them as pieces of executable code.»_ He was thinking in terms of mathematical modeling, and [hated OOP](https://wiki.c2.com/?EwDijkstraQuotes)), but OOP became a success for a reason (human intuitiveness), and I believe it is possible to marry the two notions (mathematical modeling, through compositional FP, and modeling causal-relations of compositioned entities within a domain, in a way similar, but not equal, to OOP).

* Only by accounting for human limitations (like cognitive capacity, and familiarity), could one derive a specification for the ideal programming language.

* **A bug is an error in thinking**. Either by the developer, or the language-designer for not sufficiently accounting for human psychology ([Sapir-Whorf: the language you write/speak determine what you can/do think](https://talks.golang.org/2015/simplicity-is-complicated.slide#6)). Even [Dijkstra](https://www.cs.utexas.edu/users/EWD/transcriptions/EWD04xx/EWD473.html) himself equates programming with thinking. Programming does not simply _require_ thinking, but _structure_ thinking. [Languages guide thought](https://en.wikipedia.org/wiki/Language_and_thought), and what matters is [not only what what programming languages let you do, but what they shepherd you to do](https://nibblestew.blogspot.com/2020/03/its-not-what-programming-languages-do.html). That's why _"You can write good code in this language, you just have to be disciplined"_ isn't a good argument, even if it is commonly employed. _"If we were seeking power we would have stopped at GOTO's. ... The point is to **reduce our expressivity** in a principled way ... [to] something which is still powerful enough for our daily uses."_ -- [Cheng Lou](https://youtu.be/mVVNJKv9esE?t=914) of ReScript.
  - To reduce bugs, a language should ensure **simple, safe, and scalable _ways of thinking_**. For instance:
      - [Type systems](https://en.wikipedia.org/wiki/Type_system) are a way to use the compiler to help us [verify our beliefs](https://twitter.com/garybernhardt/status/1391800319609171968?s=20) about our own code: they help us think consistently.
      - [Closures](https://medium.com/javascript-scene/master-the-javascript-interview-what-is-a-closure-b2f0d2152b36), enables the programmer to specify and share behaviors that are already half-way thought through (i.e. already set up with some external data/state). 
      - [Transducers](https://medium.com/javascript-scene/transducers-efficient-data-processing-pipelines-in-javascript-7985330fe73d), allows the programmer to define and [compose behaviors/processes](https://youtu.be/6mTbuzafcII?t=145) without having to think explicitly about the particular thing which is behaving. (It's currently only possible for a subset of behaviors, but see the [Qi flow-oriented DSL](https://youtu.be/XkIoGmWkEpM?t=996) for Racket for a potential generalization.)
      - [Currying](https://en.m.wikipedia.org/wiki/Currying#Motivation), allows the programmer to take one grand behavior and break it down into smaller behaviors that can be reused independently, or used in sequence.
      - Composition allows the programmer to think & build piece by piece, instead of all at once, and without the context influencing too much.
      - "[Open for extension](https://youtu.be/ltCgzYcpFUI?t=1421), closed for modification": A programmer can recognize something useful, and add more pieces to it, without having to change the original thing (e.g. extension methods in C#), and without tying those new pieces too closely with the original thing (e.g. subclassing) which would limit their reuse.

* A language determines **WHAT** you can & have to think about, but also **HOW** you have to think about it.

* **"Things that are different should look different"**. Counter-inspired by [D](https://ziglang.org/learn/why_zig_rust_d_cpp/#no-hidden-control-flow). Inspired by [Lary Wall on Perl's postmodernism](http://www.wall.org/~larry/pm.html) and [my own frustrations with modern component frameworks like React](https://dev.to/redbar0n/what-happened-to-components-being-just-a-visual-thing-22hc), and my impression that Lisp/Clojure is [perceived as hard to learn](https://dwheeler.com/readable/)  because it has [so little syntax](https://dwheeler.com/readable/retort-lisp-can-be-readable.html): when everything [looks the same](https://news.ycombinator.com/item?id=21840137) it [is hard](https://rescript-lang.org/docs/manual/latest/function#labeled-arguments) to [tell things apart](https://www.codeproject.com/Articles/1186940/Lisps-Mysterious-Tuple-Problem). **Syntax matters**, so when people balk at noise like too many parentheses, you ought to listen ([like React did](https://youtu.be/5fG_lyNuEAw?t=798)), rather than ignore it ([like Clojure did and still does](https://youtu.be/nD-QHbRWcoM?t=606), even though the Lisp inventor [McCarthy didn't even like the S-expressions syntax](https://twitter.com/magnemg/status/1449005438339530754?s=20) himself), in order to [remove friction](https://youtu.be/5fG_lyNuEAw?t=965) from onboarding and growth. It can be the barrier between mass adoption and remaining niche. A language should optimize for mass adoption, due to network effects, since then _everyone wins_: learning, communication, portability, ecosystem etc. It doesn't mean pleasing everyone's ultimate desires, just avoid having most people turn at the door. Counter-inspired by Lisp/Clojure, and [Haskell](https://news.ycombinator.com/item?id=12056169). Although it is prize-worthy to **stay very frugal with syntax**, since more syntax necessitates more learning/documentation (knowledge debt, info overload), more avenues for confusion (the best code is no code), and more complications (language intricacies can lead to software intricacies, which can lead to bugs). But most importantly: less syntax enables better **composition** (all things are lego blocks that fit with each other). Inspired by Lisp/Clojure. My philosophy leans more towards [Golang](https://hackernoon.com/the-beauty-of-go-98057e3f0a7d) ([less features](https://commandcenter.blogspot.com/2012/06/less-is-exponentially-more.html), readability is reliability, simplicity scales best) and [Python](https://www.python.org/dev/peps/pep-0020/) ("explicit over implicit", "one way over multiple ways"), than [Ruby](https://m.signalvnoise.com/provide-sharp-knives/) (provide sharp knives) and [Perl](http://www.wall.org/~larry/pm.html) (postmodern plurality, coolness/[easiness](https://www.infoq.com/presentations/Simple-Made-Easy/) is justification enough in itself, aka. [the smell of a toy language](https://en.wikipedia.org/wiki/Ruby_(programming_language)#Early_concept)). Even though I come from Ruby and love it, and also cannot help admiring Lisp for its elegance and [crucial evolvability](https://www.youtube.com/watch?v=_ahvzDzKdB0).

* [Programming should be fun and painless](https://youtu.be/doZ0XAc9Wtc?t=1930). Inspired by Ruby.

## Purpose: What should this dream language of mine primarily be for?

* Webapp / app + systems development. In Rich Hickey's words: [Information-driven situated programs](https://youtu.be/2V1FtfBDsLU?t=1607). Ideally, also open to extension into [more areas of programming](https://github.com/nagydani/seedling/blob/master/RATIONALE.md).
  - Scripting and prototyping, but also scalable to production use (app/webapp)
  - Systems development (compiled)

I believe there is enough cross-over between web app (in-browser + web server) and systems development that a turing-complete language could address both successfully. The language Go / Golang tries to do that (for web servers and systems), for instance. Though the question is up for debate whether or not it is a good idea, or if we should always have specialized languages for those domains.

So, from various sources of inspiration, and the aforementioned principles in mind, here is the list of features that my dream programming language would have.

## Features:

Features in **bold** are considered most important.

* **Readability and reasonability** as top priority. Local > Global: The language should afford the developer with the ability to perform **local reasoning** (instead of global reasoning), to only focus on the code at hand (not having to jump around many places or files, and worry about potential 'spooky action at a distance'). Reduce dev mind cycles > reduce CPU cycles. Human-oriented and DX-oriented. Willing to sacrifice some performance, but not much, and not to overly gain comparability with natural language. Counter-inspired by [SQL](https://www.scattered-thoughts.net/writing/against-sql/#complexity-drag). Willing to sacrifice immediate power in the language itself, esp. if that can be achieved through abstracted-away libraries.
  - Should always be able to be read top-to-bottom, left-to-right. **The execution order should also always follow the reading order.** No `<expression> if <condititon>` like Ruby allows, since it doesn't afford a _scalable_ way of thinking (just imagine `<expression>` growing very large, and the "joy" of discovering a tiny `if` at the end, invalidating your initial assumption that reading the `<expression>` was relevant to your debugging). [Certainly](https://github.com/crystal-lang/crystal/wiki/FAQ#why-trailing-whileuntil-is-not-supported-unlike-ruby) no `<code_block> while <condition>`. The alignment between execution order and reading order was some of [Dijkstra's wisdom](http://www.dcs.gla.ac.uk/~pat/cpM/jchoco/nqueens/Goto-Harmful-Dijkstra.pdf): _"our intellectual powers to visualize processes evolving in time are relatively poorly developed, we should shorten the conceptual gap between the static program and the dynamic process, by spreading out the process in text space"_. In simpler terms: enabling the programmer to _trace the flow of execution_ (aka. 'control-flow' or 'control') by simply reading the code. To be able to point to a precise location in the code/text, and ask what state the program/machine is in _at that time_ (i.e. the [ostensibility](https://en.wikipedia.org/wiki/Ostension) of code). This is of course a feature of the [Von Neumann model of computing](https://en.wikipedia.org/wiki/Von_Neumann_programming_languages), so the language would to some extent be tied to it, but it would be a pragmatic choice, since it is the most prevalent model of computing anyway. Relatedly, it [is said](http://theory.stanford.edu/~aiken/other/backus.pdf) that: _"a core difficulty with [Von Neumann style] languages was that programmers were reduced to reasoning about a long sequence of small state changes to understand their programs, and that a much simpler and more compositional method of reasoning would be to think in terms of the net effect of a computation, where the only thing that mattered was the mapping from function inputs to function outputs."_ So there might be some dissonance with functional programming model here, which the language should aim to resolve, since we desire both the _"reasoning about a long sequence of small state changes to understand their programs"_ **and** the _"more compositional method of reasoning would be to think in terms of the net effect of a computation, where the only thing that mattered was the mapping from function inputs to function outputs"_. The programmer should be able to consider each, at both development and debugging, where each has its strength. NB: There are some arguments against paying any heed to control-flow at all (see: "4.2 Complexity caused by Control", [Out of the Tar Pit, 2006](http://curtclifton.net/papers/MoseleyMarks06a.pdf)), but unless we'd want an entirely lazy programming language, of which we are not (yet) convinced (cf. eager evaluation by default), then we're out of luck, as far as I know.
  - Reasonability and safety > Power. "In other words, when I focus on reasonability, I don’t care what my language *will* let me do, I care more about what my language *won’t* let me do. I want a language that stops me doing stupid things by mistake. That is, if I had to choose between language A that didn’t allow nulls, or language B that had higher-kinded types but still allowed objects to be null easily, I would pick language A without hesitation." -- [Scott Wlaschin](https://fsharpforfunandprofit.com/posts/is-your-language-unreasonable/).
  - [Syntax matters (and homoiconicity is a plus)](https://youtu.be/5fG_lyNuEAw?t=965): Readability should not imply a one-to-one match with natural language (counter-inspired by [SQL](https://www.scattered-thoughts.net/writing/against-sql/#complexity-drag)), since natural language is inconsistent, duplicitous, ambivalent and multi-faceted. Consistency is key to a programming language. But it should borrow some of the sub-structures from commonly used natural languages such as English (like its popular Subject-Verb-Object, SVO, structure; see also DFFP) to make adoption easier (more at-hand/intuitive) for most. Since such grammatical sub-structures are indicative of how we tend to model the world (maybe derived from our shared familiarily with physical objects acting on one another). (This can relate to [Chomsky's Universal Grammar theory](https://en.wikipedia.org/wiki/Universal_grammar) in linguistics). **The SVO syntax also aligns elegantly with the [Graph Data model of RDF](https://www.w3.org/TR/rdf-concepts/#section-data-model) (subject-predicate-object triples). So a language based on Subject-Verb-Object style could be [homoiconic](https://wiki.c2.com/?HomoiconicLanguages), since subject-predicate-object is already a data structure (RDF).** Furthermore, if code-is-data (i.e. homoiconicity or pseudo-homoiconicity is preserved) it could be interesting to have **the code map well to a graph database**, opening up avenues for analysis in the form of [advanced graph algorithms](https://youtu.be/s3HvMvyHTUY?t=280), which could be useful for, say, code complexity analysis (e.g. more straightforward [cyclomatic complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity) analysis) or deadlock detection. There is already precedence in the use of [combinator graph reductions](https://en.wikipedia.org/wiki/Graph_reduction#Combinator_graph_reduction) in FP languages. Homoiconicity (code structure mirroring a data structure) could potentially also help with respect to typing, since we want to be able to execute the same code at compile-time (statics) and run-time (dynamics), to avoid [the biformity and inconcistency of static languages](https://hirrolot.github.io/posts/why-static-languages-suffer-from-complexity): _"the ideal linguistic abstraction is both static and dynamic; however, it is still a single concept and not two logically similar concepts but with different interfaces"_. Counter-inspired by [JS & TS, which have plenty of duplicitous abstractions](https://twitter.com/anuraghazru/status/1569377505462857734?s=20&t=MEnOqCnoLfNAzCfvhbxxAQ), for talking to the runtime (JS) or talking to the compiler (TS). _I want to simply talk, once, and have the runtime and the compiler interpret what it needs_. _"One of the most fundamental features of Idris is that types and expressions are part of the same language – you use the same syntax for both."_ -- Edwin Brady, the author of Idris (Edwin Brady, n.d.). Inspired by [Idris](https://hirrolot.github.io/posts/why-static-languages-suffer-from-complexity#idris-the-way-out). But, ["Idris, however, is not a simple language"](https://hirrolot.github.io/posts/why-static-languages-suffer-from-complexity#idris-the-way-out), so the ideal solution here is wanting... Maybe [patterns as types](https://www.reddit.com/r/ProgrammingLanguages/comments/cy009u/patterns_as_types/) could be a way... Or [types defined with the same language constructs](https://github.com/brillout/research/issues/1) as the runtime language, like in Zig's [comptime concept](https://ziglang.org/documentation/0.9.1/#Introducing-the-Compile-Time-Concept)... Data types are a way to  _manually describe_ the shape of data, but it seems what you want is to _automatically derive/infer_ the shape of data (as far as you can, based on a closed-world assumption of your own code, where third party code would use [type bindings](https://rescript-lang.org/docs/manual/latest/external), and data received at runtime would need to fit into a type declared statically). In any case, the goal is to avoid duplication, avoid types being a declarative meta-language on top of the language, and potentially allow constructing custom types imperatively (within some constraints, due to the Halting problem). This is also inspired by [NexusJS](https://nexusjs.org/) and [io-ts](https://gcanti.github.io/io-ts/), which allow the inverse, namely using types at runtime (for I/O validation): _"The advantage of using io-ts to define the runtime type is that we can validate the type at runtime, and we can also extract the corresponding static type, so we don’t have to define it twice."_
  - The syntax should as much as possible favor words over special characters (like curly braces, etc., and brackets and parentheses to a lesser extent).  (This must be weighed against the desire for homoiconicity..). Plaintext words are _faster to write_ (counter-intuitively enough, but learned from the shift towards password phrases over passwords with special characters, and from the benefit of not having to use modifier keys, which are esp. cumbersome on mobile keyboards), and more _aesthetical to read_, helpful [for visually impaired users](https://news.ycombinator.com/item?id=18414562), and more self-documenting to novices. Inspired by [Ruby](https://www.ruby-lang.org/en/) (`if .. end` is vertically more symmetric than a vertically aligned `if ... }`)  and [Tailwind](https://tailwindcss.com/) (fast-to-type is a feature). The IDE should support auto-completion on language keywords (similar to how it can auto-complete references to your own code), so it's even faster to type the valid language keywords. The IDE should also allow toggling auto-compaction/tersification, for the times when you need to process a lot of information or many details of a a complex algorithm at once (though that should be a sign that you should refactor instead of writing more tersely). But the full text of language keywords should always be present, so people won't constantly need documentation to understand the gist of code that is shared online (otherwise you could get "what does `cons` and `conj` mean, now again?" scenarios). That should also ease on-boarding of novices, and thus benefit the growth of the ecosystem.
  - **Isolation / Encapsulation**. To analyze a program (i.e. break it down and understand it in detail), you need to be able to  [understand parts of the program in isolation](https://youtu.be/Gv2I7qTux7g?t=632). So everything should be able to be encapsulated (all code, whether on back-end and front-end), since **encapsulation affords reasonability** (and testability), by limiting places bugs (i.e. errors in thinking) can hide. Counter-inspired by Rails views (sharing a global scope) and instance variables. Inspired by the testability of pure functions.
  - No need to manipulate data structures in the human mind. Programmer should always be able to **_see_ the data 
structure** he/she is working on, at any given time, in the code. Inspired by [Bret Victor](http://worrydream.com), and Smalltalk. Ideally with example data, not only the data type. Also, it should be possible to visualise/animate an algorithm. Since ["An algorithm has to be seen to be believed"](https://www.goodreads.com/quotes/726152-an-algorithm-must-be-seen-to-be-believed), as D.E. Knuth said. It shouldn't be necessary for the programmer to take the effort to visualize it in his mind (with the error-proneness that entails). So the language should make such visualization and code-augmentation easy for tooling to support. But without being a whole isolated universe in its own right like a VM or an isolated [image](https://wiki.c2.com/?ImageBasedLanguage). Counter-inspired by Smalltalk. Some have described this as [REPL-driven-development](https://purelyfunctional.tv/lesson/what-is-repl-driven-development/), or interactive-programming. Especially good for debugging: getting the [exact program state from loading up an image of it](https://news.ycombinator.com/item?id=23811382) that someone sent you. Inspired by Clojure. But with the ability to see the content of the data structures within your IDE. Inspired by [QuokkaJS](https://quokkajs.com/). The REPL-driven development approach should ideally afford simply changing code in the code editor, detecting the change, and showing the result then and there, without you having to go to back-and-forth to a separate REPL-shell and copy-pasting / retyping code. Inspired by [ClojureScript](https://youtu.be/Bs44qdAX5yo?t=533). In fact, since a program is about binding values to the symbols in your code, when running your code, the IDE, enabled by the content-addressable code feature), could replace variables in the text with their bound values, successively. Effectively animating the flow of data through your code. Without you having to go to an external context like a debug window to see the bindings.
  - Params: When a function has more than 1 parameter in it's parameter list (excluding the subject/data-first parameter) then they must be named. But you shouldn't need to repeat yourself if an argument is named the same as a parameter (i.e. [keyword arguments can be omitted](https://bugs.ruby-lang.org/issues/14579)). Inspired by JS object params, and Ruby. Counter-inspired by the [Mysterious Tuple Problem](https://www.codeproject.com/Articles/1186940/Lisps-Mysterious-Tuple-Problem) in Lisp, and inspired by the [labeled arguments](https://blog.dubenko.dev/typescript-vs-reason/) in ReasonML, and the [interleaving of keywords and arguments](https://en.wikipedia.org/wiki/Smalltalk#Messages) in Smalltalk. If currying, then input params should be [explicit](https://forum.rescript-lang.org/t/uncurried-by-default/274/19) at every step (for clarity, refactorability and to aid the compiler). Counter-inspired by Point-free style in FP (since "explicit is better than implicit", inspired by Python). Should [probably not](https://news.ycombinator.com/item?id=28586862) auto-curry functions, since "curried functions makes default, optional, and keyword parameters difficult to implement", although there would be ways to solve this.
  - No [Place-oriented programming (PLOP)](https://youtu.be/YR5WdGrpoug?t=1213), iow. avoid order-dependence (aka. [positional semantics](https://ericnormand.me/article/clojure-and-types)) at almost any cost, since it isn't adaptable/scalable. Inspired by Clojure. Counter-inspired by [Haskell](ttps://ericnormand.me/article/clojure-and-types) and Elm, and [Lisp (and to some extent Clojure)](https://www.codeproject.com/Articles/1186940/Lisps-Mysterious-Tuple-Problem). This goes for [reorderability of expressions](https://youtu.be/6YbK8o9rZfI?t=3593) due to pure functions having no side-effects. Such reordering is desired (see: "4.2 Complexity caused by Control", [Out of the Tar Pit, 2006](http://curtclifton.net/papers/MoseleyMarks06a.pdf)) since it allows [designing](https://en.wikipedia.org/wiki/Top-down_and_bottom-up_design), structuring, and reading programs in a finish-to-start/high-to-low-level manner, enabling the reader to incrementally drill down into the code with the underlying implementation aka. "top-down program decomposition" aka. "call-before-declare" (the same [reason that JS has function hoisting](https://stackoverflow.com/a/59951418/380607)). Order-independence also goes for parameter lists to functions. I don't want to have to use a `_` placeholder for places where there _could_ be a parameter, just because I didn't supply one. Shouldn't have to [sacrifice piping](`[`https://sporto.github.io/elm-patterns/basic/named-arguments.html`](https://sporto.github.io/elm-patterns/basic/named-arguments.html)`) just to get named arguments, either (piping should use an [explicit pipe operator](`[`https://github.com/tc39/proposal-pipeline-operator/issues/84`](https://github.com/tc39/proposal-pipeline-operator/issues/84)`)). Counter-inspired by Elm, and inspired by Hack. Consequence (?): would need a data structure like a [record](https://elm-lang.org/docs/records) but which ideally can be accessed in an order-independent manner (similar to a map). Plus, functions should be able to take in such records but also a`rest` parameter that can represent an arbitrary number of extra fields (to make functions more reusable and less coupled to their initial context, e.g. they should be able to be moved up/down in a component hierarchy without major changes to their parameter lists). Counter-inspired by Elm. But Records are useful for _enumerating what's possible_, and when used in pattern-matching the type system could warn you when you are forgetting to account for all fields, and show you where you need to update the code. This is esp. useful when refactoring, and esp. when working in a team. To achieve this benefit without resorting to Records and PLOP, the type system should _warn you_ of the (pattern-matching) places you _could_ want to update to handle all the Record's new fields, but you shouldn't be _required_ to update them, if you don't want to. This way you, and the code, can stay flexible (and functions would be more reusable), but you'd also receive the needed guidance.
  - No `unless` or other counter-intuitive-prone operators. Counter-inspired by Ruby. See also the rationale for disallowing `<expression> if <condition>` as it also applies to `<expression> unless <condition>`.
  - No abstract mathematical jargon. Counter-inspired by Haskell. As it impedes onboardig, and induces a [mindset of theorizing](https://blog.plover.com/prog/haskell/what-goes-wrong-2.html) and [premature abstraction/generalization](https://blog.plover.com/2018/09/03/#what-goes-wrong) that impedes rapid development. Should be accessible for as wide a community as possible, with as little foreknowledge as possible. Inspired by [Quorum](https://quorumlanguage.com/). Also apply [some pragmatic constraints to conventions from functional programming](https://youtu.be/1AZA1zoP-II?t=2053) ways of writing code. In the interest of legibility and onboarding. FP conventions are not considered paramount (e.g. [currying](https://youtu.be/1AZA1zoP-II?t=2053), [point-free style](https://youtu.be/1AZA1zoP-II?t=2182) and [fold](https://youtu.be/1AZA1zoP-II?t=2242)), so they might not be supported, but their utility should be considered on a case-by-case basis. Inspired by Don Syme of F#.
  - Do not presume contextual knowledge. In UX this is known as "No modes!". Code should be able to be read A to B without having been educated/preloaded with any foreknowledge (like 'in this context, you have these things implicitly available'). Counter-inspired by class inheritance and Ruby magic, and JavaScript's [runtime bound](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this) `this` keyword and associated [scoping problems](https://kentcdodds.com/blog/classes-complexity-and-functional-programming). Turns out too much dynamism (runtime contextualisation) can be harmful. Counter-inspired by JavaScript: _"In JS, `this` is one truly awful part. `this` is a dynamically scoped variable that takes on values depending on how the current function was invoked."_ -- [sinelaw](https://github.com/sinelaw/infernu).
  - Should facilitate and nudge programming in the language towards code with low [Cognitive Complexity](https://www.sonarsource.com/docs/CognitiveComplexity.pdf) score.
  - **Dynamic Verbosity**: Should be able to show more/less of syntax terms in the code (length of variable names could be auto-shortened). Beginners will want more self-documenting code. Whereas experts typically desire terser code, so they can focus on the problem domain without clutter from the language (e.g. mathematics). _"By relieving the brain of all unnecessary work, a good notation sets it free to concentrate on more advanced problems, and in effect increases the mental power of the race."_ -- A.N. Whitehead (cited in [Notation as a Tool of Thought](https://www.eecg.utoronto.ca/~jzhu/csc326/readings/iverson.pdf)). A programmer will typically gradually go from beginner to expert on a code-base, even his own. See: content-addressable code. Content-addressable code would afford dynamic verbosity, which is important because: _"A language should be designed in terms of an abstract syntax and it should have perhaps, several forms of concrete syntax: one which is easy to write and maybe quite abbreviated; another which is good to look at and maybe quite fancy... and another, which is easy to make computers manipulate... all should be based on the same abstract syntax... the abstract syntax is what the theoreticians will use and one or more of the concrete syntaxes is what the practitioners will use."_ -- [John McCarthy, creator of Lisp](https://www.infoq.com/interviews/Steele-Interviews-John-McCarthy/). Content-addressable code is also important for Dynamic Verbosity because of [Stroustrup's Rule](https://www.thefeedbackloop.xyz/stroustrups-rule-and-layering-over-time/): _"For new features, people insist on LOUD explicit syntax. For established features, people want terse notation."_ -- Bjarne Stroustrup.
    - **Dynamic code-arrangement**: code should be able to be rearranged in order of start-to-finish/low-to-high-level or finish-to-start/high-to-low-level, because each is beneficial at various points when writing/reading code. Today, code is fixed how it is written. Typically in either an imperative way, displaying steps chronologically from start-to-finish, akin to chaining e.g. `data.func1.func2.func3`, or in a functional way: from outside-in, e.g.: `func3(func2(func1(data)))`, but when reading to understand the order of execution you have to read from the innermost to the outermost expression. This is problematic, at various times, and has arguably [made functional programming less accessible](https://probablydance.com/2016/02/27/functional-programming-is-not-popular-because-it-is-weird/) to newcomers. But both ways of reading are desirable, at different times: At one time you just care about viewing the overall result/conclusion (e.g. `func3` and what it returns), and potentially working your way backwards/inwards a little bit. Maybe you start with an end goal in mind (name of a function), and then drill down to a more and more concrete implementation. But at another time you care about going the other way around: seeing how it is executed from start to the finishing result/conclusion (think: piping). This duality of thinking/reading mirrors how we approach reading in other domains. This feature could be enabled by content-addressable code, since the arrangement of code itself could be made more malleable and dynamic. See: content-addressable code.

* Not indentation based / whitespace should not be significant (counter-inspired by Python), since it is brittle: copy/paste bugs when the source and destination are indented differently, variable renaming resulting in bugs ([and more](https://yinwang0.wordpress.com/2011/05/08/layout/)). Sharing code online or by email can also [fail](https://www.ruby-forum.com/t/why-not-adopt-python-style-indentation-for-ruby/104458) when indentation is made meaningful, due to various editors treating indentation differently, some even stripping it out entirely (which would make code interpretation ambiguous). Whitespace should not implicitly determine the meaning of the program, rather: explicit meaning should determine indentation (which enables auto-formatting). It should go without saying that invisible characters (whitespace; space, tabs) should not affect the meaning or interpretation of a program (who would like to debug something they can't see?). Inspired by [Pyret](https://www.pyret.org/index.html). With explicit closing tags, the IDE can then help to re-indent code appropriately (since seemingly improper indentation doesn't potenntially carry semantic meaning). But the language should also **not require semicolons**. Inspired by Ruby, and semi-colon-free JS. Even though newline characters could be deemed to be significant whitespace, and subject to the aforementioned problems, it should only be a problem if the language is based around statements, not expressions (like intended).
  - BUT: Might consider allowing (though never requiring) indentation-based syntax, if the language has a standard style and formatter, and if the readability and ergonomics turn out to be vastly superior at scale, with the particular language syntax. In that case, tabs [should be forbidden](https://www.ruby-forum.com/t/why-not-adopt-python-style-indentation-for-ruby/104458/5) in favor of simple whitespace (IDE's can easily turn tabs into whitespace characters anyway). 

* Fast feedback to the programmer is second top priority. Inspired by TypeScript hints, [QuokkaJS](https://quokkajs.com/) (!), Webpack Hot Reload, and Expo Live Reload.
  - REPL / interactive shell. Can be done even if compiled, by having an interpreter on top of a VM to the compiler.

* **Refactorability / change-ability.**
  - Similar-looking and non-interacting code-lines should be able to change place without breaking anything. Counter-inspired by not able to add comma to last line in JSON, not being able to reorder/extract from comma-separated multi-line variable declarations in JS, and also counter-inspired by the contextualised expression terminators in Erlang.
  - Consistent syntax, optimized for code refactoring: "The language syntax facilitates code reuse by making it easy to move code from local block → local function → global function". Inspired by [Jai](https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md#brief-description).
  - **[Backward- and forward-compatible](https://youtu.be/A3AdN7U24iU?t=2029)**. Should be able to not worry about (or make poor future tradeoffs due to) backward-compatibility. ([Counter-inspired by ECMAScript](https://maggiepint.com/2017/04/11/fixing-javascript-date-web-compatibility-and-reality/) and C++). To make the language optimally and freely evolvable, and worriless to upgrade. [Backward-compatibility](https://en.wikipedia.org/wiki/Backward_compatibility) and [Forwards-compatibility](https://en.wikipedia.org/wiki/Forward_compatibility): Code in a one language version should be transformable (in a legible way) to another version (both ways; backward and forward). In the case of lossy changes, the old version should be stored (so it is revertible), and in the case of a "gainy" changes then the compiler should notify the programmer where in the code it is now missing explicit information (based identifying locations in the code where the old language constructs are used). There should also be solutions to either: have simple CLI tools to **automatically refactor old code to new language versions**, to always stay optimally **adaptable**, without having breaking changes. Maybe using some form of **built-in self-to-self transpilation**. Will likely need to be able to treat code-as-data. Might need compile-time macros. Or a solution could be to: with every breaking language revision, include an incremental language adapter, which would allow upgrading whilst ensuring backward compatibility. Could be solved with [Mechanical Source Transformation](https://go.dev/blog/gofmt), enabled by gofmt, so developers can use [gofix](https://go.dev/blog/introducing-gofix) to automatically rewrite programs that use old APIs to use newer ones. Which is crucial in **managing breaking changes**. A breaking (aka. widely deviating) change, should in effect, not actually break anything (that current languages and systems do, is considered a "pretty costly" design flaw). _"Successful long-lived open systems owe their success to building decades-long micro-communities around extensions/plugins"_, and to enable that requires great care for backwards-compatibility, as Steve Yegge [pointed out](https://steve-yegge.medium.com/dear-google-cloud-your-deprecation-policy-is-killing-you-ee7525dc05dc). But tool based upgrades, as mentioned, is better than keeping old APIs around forever. This philosophy is also applied by Carbon (C++ successor language). See 11:43 @ https://youtu.be/omrY53kbVoA
  - [Content-addressable code](https://youtu.be/gCWtkvDQ2ZI?t=170): names of functions are simply a uniquely identifiable hash of their contents. The name (and the type) is only materialized in a single place, and stored alongside the AST in the codebase. Avoids renaming leading to breaking third-parties, and avoids defensively supporting and deprecating several versions of functions. Avoids codebase-wide text-manipulation, eliminates builds and dependency conflicts, robustly supports dynamic code deployment. Code would also need to be stored immutably and append-only for this to work. All inspired by [Unison](https://www.unisonweb.org/).
  - Optional configuration, but providing sane and conventional defaults so you can get started quickly and without worry. (Not rely solely on [convention over configuration](https://en.wikipedia.org/wiki/Convention_over_configuration) (CoC), due to potentially too much implicitness/magic. Counter-inspired by Ruby on Rails.) "if you apply [CoC] dogmatically you end up with an awful lot of convention that you have to keep in your head. It's always a question of balance; Hard Coding vs. Configuring vs. Convention, and it's not easy to hit the optimum (which depends on the circumstances)." as [Peer Reynders reminds us](https://dev.to/peerreynders/comment/1j4c4).
  - The language should be "open to extension" by any in the community, without permission. So that it can evolve and converge to a consensus, based on real-world experience and feedback. This is mirrored in the important talk [Growing a Language, by Guy Steele](https://youtu.be/_ahvzDzKdB0?t=1330), and the point on [crucial evolvability](https://www.youtube.com/watch?v=_ahvzDzKdB0). But the culture of the language community should _not_ encourage bending the language in unintended ways just for the sake of it, as staying close to the overarching general-purpose language (GPL) makes knowledge transfer/usage generally applicable across domains (being able to move between projects within the same language should _in general_ be made easy), and afford a more cohesive ecosystem. Counter-inspired by [DSL](https://en.wikipedia.org/wiki/Domain-specific_language)'s (see: avoid DSL's).

* Modularity. Module system which is sensible. Counter-inspired by the NodeJS controversy. Code-splittable and [tree-shakeable](https://blog.cleancoder.com/uncle-bob/2018/04/13/FPvsOO.html). Inspired by Rollup. [Function-level dead code elimination](https://elm-lang.org/news/small-assets-without-the-headache), inspired by Elm. This is possible in Elm because functions there cannot be redefined or removed at runtime. This could potentially conflict with the envisioned Hot Upgrade feature inspired by Clojure (see: Interactive). This problem could perhaps be removed by disallowing modification/overloading of functions and data types in the standard library (or any 3rd party library). Alternatively: it should be possible to specify what parts of the application should be tied down and optimized (the client code), and which part should, at the potential expense of larger assets, be Hot Upgradeable (the server code).
  - Standard library should even be tree-shakeable. Inspired by [Zig](https://ziglang.org/learn/why_zig_rust_d_cpp/#first-class-support-for-no-standard-library).
  - **Predictability**: _**Making dynamic/runtime things static/compile-time enables predictability and optimisations**_ (such as tree-shaking). Inspired by ESM and counter-inspired by CJS in JavaScript (see [How does it work](https://www.codingame.com/playgrounds/7463/tree-shaking-in-javascript-with-rollup) on tree-shaking). 

* **Quick to get started and produce something.** Inspired by JS. Counter-inspired by JS tooling.
  - Not too unfamiliar (to a large group of programmers, and to what they teach in universities). "Familiarity and a smooth upgrade path is a really big deal." [source](https://youtu.be/QyJZzq0v7Z4?t=1997)

* Sensible, friendly, and directly helpful error messages. Inspired by Elm.

* **[Data First](https://www.javierchavarri.com/data-first-and-data-last-a-comparison/) Functional Programming (DFFP)**. Based on the solid theoretical foundation of **[Lambda calculus](https://learnxinyminutes.com/docs/lambda-calculus/)**. Should mimic the style of object-orientation, but is simply structs and functions under-the-hood. (Also: functional programming patterns over procedural code.) Because it is human to see and visualize the world ([as well as computing](https://cacm.acm.org/blogs/blog-cacm/248985-dijkstra-was-wrong-about-radical-novelty-metaphors-in-cs-education/fulltext)) in terms of objects and verbs, and to use verbs to signify the [causal relations between objects](https://www.researchgate.net/publication/330791815_Identifying_Embodied_Metaphors_for_Computing_Education). Focusing to heavily on only one of the paradigms (OOP or FP) can typically lead to anti-patterns (God classes/objects, Factory objects, and Singletons, in OOP), or program structures far removed from the business domain model which also has linguistically unintuitive syntax, as in FP (c.f. [FP is not popular because it is backwards](https://probablydance.com/2016/02/27/functional-programming-is-not-popular-because-it-is-weird/)). This is since only 12% of natural languages start with the verb, either Verb-Subject-Object (VSO) or Verb-Object-Subject (VOS), [subject-verb-object (wiki)](https://en.wikipedia.org/wiki/Subject–verb–object)), as FP tends to do, e.g. `verb(subject object)` or `verb(object)` or `(verb object)`. But 88% of natural languages start with something concrete, the Subject/Object (and the Object of one sentence is typically the Subject of the next sentence; similar to call chains). So [Subject-Verb-Object](https://en.wikipedia.org/wiki/Subject–verb–object) (SVO) should be preferred. The programming language could account for this, for instance like: `subject.verb(object)` or `subject.verb(subject.verb(object)).verb` or `subject.verb.verb` or `subject.verb(object).verb(object)` etc. (see 'syntax matters' on 'homoiconicity'). Because it enables the programmer to cognitively carry forward (dare I say iteratively mutate) a mental model, step by step (without relying on short or long term memory, which should be freed for higher level concerns than mere parsing). Inspired by method chaining and [Fluent API](https://en.wikipedia.org/wiki/Fluent_interface), but without its [associated problems](https://youtu.be/q_WgVR9xtBw?t=541)  (mutation/impurity, big classes, and functions coupled with those, so they would be hard to reuse across classes, or relocate across modules), since the Fluent API would be solved with a simple transform to Lisp/Clojure-style FP underneath. I think the SVO alignment is one significant but under-appreciated reason for OOP's success (since it affords [syntonicity](https://t.co/u0EFh15eg7), both of the body and ego kind). That, together with enabling a stepwise/imperative construction of programs (as Imperative programming styles capitalize on), makes for a more intuitive approach for beginners, which is vitally important for onboarding & growth. "Objects and methods" could be merely syntax sugar for structs and functions (see: [interchangeability of method-style and procedure-call-style](https://youtu.be/QyJZzq0v7Z4?t=1343), or the [pipe first operator](https://rescript-lang.org/docs/manual/v8.0.0/pipe) in ReScript, which also illustrates _emulating object-oriented programming_), if one leaves out troublesome inheritance (which might be good, since composition > inheritance). Inspired by Golang. The quote "Data, not behavior, is the more crucial part of programming." [is attributed](https://news.ycombinator.com/item?id=21562007) to [Linus Torvalds and Fred Brooks](https://medium.com/webdevops/data-structures-548cbea9c520). If data is the focus-point, the language should mirror that. Interestingly, in addition to the more intuitive API, data-first also [affords](https://www.javierchavarri.com/data-first-and-data-last-a-comparison/) better IDE integration, simpler compiler errors, and more accurate type inference. Inspired by ReScript.
 - Functional programming patterns like `.map`, `.filter`, over procedural code like `for-loops` etc., since the latter would encourage mutating state, and we want immutability.
 - [Tree-shakeable code](https://medium.com/@Rich_Harris/tree-shaking-versus-dead-code-elimination-d3765df85c80) (esp. useful for client-server webapps). So it should need a source code dependency between the calling code and the called function. Which makes the language more FP than OOP, according to one [definition of FP vs. OOP](https://blog.cleancoder.com/uncle-bob/2018/04/13/FPvsOO.html). In general, shifting concerns from runtime to compile-time is considered a good thing, as it makes the language more predictable, optimizable, and affords helpful coding tools. Having consequences of code changes appear at runtime is a bad thing (see: [The Fragile Base Class problem of OOP](https://en.wikipedia.org/wiki/Fragile_base_class)).
  - [Referentially transparent expressions](https://medium.com/@olxc/referential-transparency-93352c2dd713). Which means variables cannot be reassigned, so a name will always refer to the same value (see principle: "Things that are different should look different"). Inspired by Haskell. Counter-inspired by Ruby: _"Of course, functional programming is possible in Ruby, but it's not the natural style. You often end up with many side effects, partly because it's the same syntax for value declaration and variable mutation."_ [according to Laurent Le-Brun](http://www.fpish.net/topic/None/58676#comment-68530). Referential transparency should enable [a high degree of modularization](https://sookocheff.com/post/fp/why-functional-programming/) but _could_ also lead to easy automatic parallelization and memoization. 
  - [Formally verifiable](https://youtu.be/yiiDFRs62lQ?t=1290) / provable. Nice-to-have, not must-have.
  - [Automatic TCO (tail-call optimization)](https://stackoverflow.com/a/310980/380607). To keep the processing lean, and avoid potential stack overflow, by avoiding allocating new stack frames for recursive function calls. Counter-inspired by [Clojure / JVM](https://stackoverflow.com/q/10212928/380607). Inspired by [Scheme and ML-languages](https://en.wikipedia.org/wiki/Tail_call#Description), and [Lua](https://www.lua.org/manual/5.3/manual.html#3.4.10). TCO should align well with the desire to have a language where the programmer can have and mutate a mental model to carry forward, without having to rely on remembering and returning to previously remembered values.

* **Aggressively Parallelizable**: Parallelization made natural. [Aided by pure functions](https://en.wikipedia.org/wiki/Purely_functional_programming#Parallel_computing). The language should nudge programmers and make it easy/natural to use parallelism, through language constructs (like [executing several sequential lines simultaneously](https://youtu.be/XlvfHOrF26M?t=109)). To avoid common [_overly_ sequential thinking](https://news.ycombinator.com/item?id=28213940), which can lead to suboptimal performance (due to not parallelizing work). But humans think sequentially. So we ought to pay heed to [Dijkstra's wisdom](http://www.dcs.gla.ac.uk/~pat/cpM/jchoco/nqueens/Goto-Harmful-Dijkstra.pdf) that since: _"our intellectual powers to visualize processes evolving in time are relatively poorly developed, we should shorten the conceptual gap between the static program and the dynamic process, by spreading out the process in text space"_. In simpler terms: enabling the programmer to _trace the flow of execution_ by simply reading the code. As elsewhere mentioned: execution order should follow the reading order, . Another important reason the language should steer the programmer to aggressively utilize parallelization, is due to [Amdahl's Law](https://en.wikipedia.org/wiki/Amdahl%27s_law), which states that, when parallelizing, the limiting factor will be the  serialized portion of the program. Notably the queueing delay, due to contention over shared resources, like CPU time. So whatever part of the program which is not parallelized, will eventually, under high enough load, turn into a bottleneck. The language construct nudging developers to parallelization could be inspired by [Verilog's fork/join](https://en.wikipedia.org/wiki/Verilog#Fork/join) construct, or the very similar [Nurseries](https://vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful/), which are an alternative to `go` statements (since `go` statements don't afford local reasoning, automatic error propagation and reliable resource cleanup, though some may be achieved in a [WaitGroup](https://pkg.go.dev/sync#WaitGroup)). But as opposed to the [fork/join example](https://en.wikipedia.org/wiki/Verilog#Fork/join), the language should enforce a deterministic order upon joining, which should simply be guaranteed by the sequential top-down order of the lines in the fork/join code block (a novel idea, to my knowledge, which would need to be experimented with thoroughly... more thoughts in [this issue](https://github.com/carp-lang/Carp/issues/1149#issuecomment-1021187461)). NB: Need to research if on today's hardware, automatic parallelization could in fact be a potential pessimization in practice instead of an optimization, as Richard Feldman pointed out. In any case, we do not envision making every function call parallelized, but to make simple, contained constructs (like nurseries, fork/join), that the programmer can use to signify separable pieces of the problem/algorithm. The runtime should then parallelize those portions aggressively.
  - Alternatively: Take inspiration from [Chapel](https://chapel-lang.org/docs/examples/hellos/hello4-datapar-dist.html), by providing core primitives to control parallelization directly. But preferably through declarative means and not through such imperative control structures as for-loops, which [Chapel uses](https://chapel-lang.org/docs/examples/hellos/hello4-datapar-dist.html).
  - Alternatively: Take [inspiration from Golang's elimination of the sync/async distinction](https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/) and allow programming everything in a sequential manner, but do a degree of parallelism under the hood (so concurrency, in practise). The sync/async barrier elimination, however, doesn't necessarily nudge programmers towards using parallelization (spinning off new threads) within the context of a program (thread). That style might conflict, or it might be synergistic with the goal of nudging programmers towards making more use of parallelization. 
  - **Syntax enabled parallelization**. Inspired by [Verilog](https://en.wikipedia.org/wiki/Verilog#Fork/join) and [Chapel](https://chapel-lang.org/docs/examples/hellos/hello4-datapar-dist.html). Ideally, the language runtime should be able to use parallelization to handle multiple independent processes (like client/server requests; goroutines for concurrency), but also _automatically distribute a single program across multiple CPU cores (facilitated implicitly by the language constructs/structure, without special imperative directives like thread/go)_ when those cores are idle. To do that, the language should [not attempt to automatically make _specifically sequential_ code parallel](https://web.archive.org/web/20150226021702/http://joearms.github.io/2013/03/28/solving-the-wrong-problem.html), since such [automatic parallelization](https://en.wikipedia.org/wiki/Automatic_parallelization) requires complex program analysis based on parameters not available at compile-time. Instead, the language should nudge towards constructs that afford natural use of multi-threading instead of single-threading (cf. principle that a language should afford _scalable modes of thinking_). But without compromising readability/reasonability, which is the top priority. The programmer should be concerned with, and simply **describe independent sets of causal/logical connections**, and the language runtime should automatically take care of as much parallelization as possible/needed. Inspired by [Haskell](https://www.oreilly.com/library/view/parallel-and-concurrent/9781449335939/pt01.html).
  - [Safe parallelization](https://youtu.be/iSmkqocn0oQ?t=182). Inspired by [Haskell](https://www.oreilly.com/library/view/parallel-and-concurrent/9781449335939/pt01.html).

* Compiled, interpreted and/or incrementally compiled (for dev mode). Inspired by [Dart](https://twitter.com/mayurdhurpate/status/1205190414510116864?s=20).
 - Fast compilation. Inspired by ReScript. Fast compilation speed is more important than high-level language features. Using high-level language features like Polymorphism can even severely de-optimize an otherwise fast program (["Clean Code", Horrible Performance](https://youtu.be/tD5NrevFtbU?t=728)). So such features should be possible to restrict (or be disallowed entirely in favor of simpler approaches, [e.g.](https://youtu.be/tD5NrevFtbU?t=728): using if or switch statements, or some form of explicit branching, instead of polymorphism.), to gain faster compilation speed. Inspired by [Molly Rocket](https://youtu.be/tD5NrevFtbU?t=728) in that video, and [Cheng Lou](https://youtu.be/mVVNJKv9esE?t=914) behind the fast ReScript compiler. Configurable language (think strict mode). But readability and reason-ability should be prioritized over compilation speed. Conserving developer mind cycles are more important than conserving CPU cycles. As long as compilation doesn't become a significant local development burden. So incremental compilation is important. Longer CI/CD build times are acceptable. Also: _"Compile time is important, but it’s ok to sacrifice it to reduce design time, debug time and runtime. Machine time is much cheaper than human time, and once you automate a task, a machine runs it more efficiently and reliably. And runtime gets multiplied by the number of devices that run it and the number of times it is run."_ -- [natewind](https://github.com/natewind/articles/blob/master/2021-06-26-A-Dream-of-the-Perfect-Programming-Language.md)
 - Interpreted / incrementally compiled during local development: So developer can write quick scripts and get fast feedback. Sacrifices some runtime speed in local development for compile-speed. Except it also needs quick startup/load time.
 - Compiled: For production. Sacrifices compile-speed for runtime speed. Compiles to a binary. Inspired by [Deno](https://youtu.be/SYkzk_j3yb0?t=1334).
 - [Small core language](https://youtu.be/yiiDFRs62lQ?t=1167): Compiled down to a small instructions set, which can be used/targeted as a starting point to generate code for other programming languages (i.e. generate JS).
 - [Portability](https://youtu.be/yiiDFRs62lQ?t=1245): Be able to target and run on multiple computer architectures.
 - [Easy to build from source](https://youtu.be/Gv2I7qTux7g?t=190). Inspired by Zig and Golang.


* **Mutable API**, and **opportunistic in-place mutation**, but data structures are automatically made **immutable when shared**. Inspired by [Roc](https://youtu.be/vzfy4EKwG_Y?t=1380). Immutable/[persistent data structures](https://en.m.wikipedia.org/wiki/Persistent_data_structure) (like [Lean-HAMT](https://bendyworks.com/blog/leveling-clojures-hash-maps)) and structural sharing, to allow incremental update, while also avoiding duplication of data. Inspired by Clojure.
  - [In-place mutation](https://docs.rs/im/13.0.0/im/#in-place-mutation), where data structures only become immutable when they're shared (presumes keeping track of borrowing / reference counting). Inspired by Rust, [Roc](https://youtu.be/vzfy4EKwG_Y?t=1380), and Clojure's [transients](https://clojure.org/reference/transients). Immutability gives the benefit of facilitating concurrency and avoid race-conditions. As a bonus you could get time-series and thus time-travel for data. 
  - Mutable API: The desirability of a mutable API (mutating objects instead of always having to pass in functions) is inspired by the JS libraries [Immer](https://immerjs.github.io/immer/) and [Valtio](https://codesandbox.io/s/zustand-valtio-jotai-counters-my6np?file=/src/ValtioCounter.tsx:181-205). But for algorithms, instead of using the mutable API in an imperative style, it should allow keeping to a functional style, possibly with something akin to Clojure's [transients](https://clojure.org/reference/transients). Alternatively: A mutable context (block scope) could be mandated for mutations (similar to [Immer](https://dev.to/fkrasnowski/comment/1c706)), which could also afford resource cleanup (if we want to avoid having a GC). Inspired by Rust.
  - Deep immutability: Cloning/Copying a data structure should not simply copy references below the first level, or if the data structure contains certain data structures. Because it is unintuitive/unexpected: a copy should be a full copy (at least as far as the programmer is concerned; it can use structural sharing under-the-hood). Counter-inspired by JS/TS. Alternatively: Instead of using Immutability to defeat Shared Mutable State, restrict the split-brain duplicity of keeping onto a reference to some data while also sharing a reference to it, like [Rust](https://doc.rust-lang.org/book/ch04-01-what-is-ownership.html#memory-and-allocation) does: by simply disallowing local references to data after it has been shared (aka. "moving" data).

* **Very constrained.** Since _"constraints liberate, liberties constrain"_, as [Bjarnason said](https://www.youtube.com/watch?v=GqmsQeSzMdw). Inspired by Golang's minimalism, [Austral](https://github.com/austral/austral)'s anti-features, and Elm's guardrails. For learnability and maintainability. Since [discipline doesn't scale](https://www.sicpers.info/2020/10/discipline-doesnt-scale/) ([obligatory xkcd](https://xkcd.com/292/): with too much power, and the wrong nudges, all it takes is a moment of laziness/crunch-time to corrupt a strong foundation), and a complex language affords [nerd-sniping](https://xkcd.com/356/) kinds of [puzzles](https://news.ycombinator.com/item?id=17905267), and [bikeshedding and idiomatic analysis-paralysis](https://news.ycombinator.com/item?id=17905222). Counter-inspired by Haskell. The virtue of functional programming is that it [subtracts features that are too-powerful/footguns](https://youtu.be/6YbK8o9rZfI?t=3315) ([compared to OOP](https://youtu.be/1AZA1zoP-II?t=2345)), namely: mutation & side-effects. The language designers should take care of and standardize all the idiomacy (natural modes of expression in the language). _"Inside every big ugly language there is a small beautiful language trying to come out."_ -- [sinelaw](https://github.com/sinelaw/infernu). The language should assume the developer is an _unexperienced, [lazy](https://youtu.be/Gv2I7qTux7g?t=1337), (immediately) forgetful, and habitual_ creature. As long as software development is done by mere humans. This assumption sets the bar (the worst case), and is a good principle for DX, as well as UX. The constrained nature of the language should allow for quick learning and proficiency. Complexity should lie in the system and domain, not the language. When the language restricts what _can_ be done, it's easier to understand what _was_ done (a smaller space of possibilities reduces ambiguity and increases predictability, which gives speed for everyone, at a small initial learning cost). The language should avoid [Pit of Despair programming](https://ericlippert.com/2007/08/14/c-and-the-pit-of-despair/), and leave the programmer in the Pit of Success: where its rules encourage you to write correct code in the first place. Inspired by [Eric Lippert](https://ericlippert.com/2007/08/14/c-and-the-pit-of-despair/) (of C#), but also by Rust. 
  - Few keywords and operators: **I don’t want to talk to / instruct the compiler. I want the compiler to understand how I write my program. Even if that limits the ways in which I can write my program.** Counter-inspired by [F#](https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/symbol-and-operator-reference/), C# and Java. Inspired by [Clojure](https://www.tutorialspoint.com/clojure/clojure_operators.htm)'s extreme frugality with syntax (macros aside). Since every keyword and operator has to be implemented by the language, and potentially has to be learned by the reader. I'd rather want just functions with self-explaining and easily distinguishable names. (Inspired by Clojure, but also counter-inspired by Clojure's [cons](https://clojuredocs.org/clojure.core/cons) and [conj](https://clojuredocs.org/clojure.core/conj).) Even if the names may be longer to write. If it prevents a documentation lookup and reduces the size of the [meta-language](https://youtu.be/18F5v1diO_A?t=204), then it's worth typing a few extra characters (instead of `cons` maybe name it `construct` or even `build`). Code is read 10x more than it's written. You could argue learning a new keyword is a one time front loading cost that is amortized over the number of times it's later encountered (and saves writing and reading time by being terse). But a language should not be reserved for the few who are "in the know" (e.g. a [sociolect](https://en.wikipedia.org/wiki/Sociolect)), but be as accessible to everyone as possible. Also, even if certain keywords are encountered seldomly, if there are a multitude of them, every reader is bound to have to reach for the docs for _some_ new keyword frequently enough, when reading code/projects written by others. A programmer's memory is better spent elsewhere.
  - Declarative over imperative: The syntax of programming languages are based on the notion that you give instructions to some language runtime, which then carry out those instructions. Which means that the language then becomes closely coupled to its runtime. But what if you turned the language inside-out? So that the language does not envelop its runtime, but is sufficiently abstracted so that it can be enveloped in any kind of runtime? Inspired by [XState](https://xstate.js.org/). That way people could implement various runtimes that have various sorts of behaviors when it comes to executing the program code. The runtimes may be tailored for different environments: local cpu-first, or distributed network-first, for example. Since some times synchronous operations are more performant, but other times async is unavoidable. Which means that the language syntax should not distinguish between sync/async operations, but leave the decision, of HOW the program is run, up to the runtime (where the responsibility should naturally be located: the runtime should decide the run time). Inspired by Golang's [elimination of the distinction between sync and async code](https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/). All this ties back to the aforementioned notion that **Programming needs to get away from the notion that the programmer is giving instructions to the machine.** _«Progress is possible only if we train ourselves to think about programs without thinking of them as pieces of executable code.»_ -- Edsger Dijkstra. (But doesn't it all come down to imperative machine instructions in the end? Yes, but the declarative foundation of the language could either be made in an imperative language like C, or there might exist a way to model even fundamental machine operations in terms of a declarative language, so the declarative language could bootstrap itself and be declarative all the way down...)
  - Names: No _alias names_ for keywords in the language or for functions in the standard library (except for as documentation reference to other languages). Inspired by [Python](https://www.python.org/dev/peps/pep-0020/) ("explicit over implicit", "one way over multiple ways"). Counter-inspired by [Perl](http://www.wall.org/~larry/pm.html) (postmodern plurality) and _aliasing_ in the [Ramda](https://github.com/ramda/ramda/issues/297) library. _All things tend toward disorder, as programmers it is our job to Fight Entropy._ The language should favor one consistent vocabulary, since it increases predictability and reduces variability. Even at the cost of expressiveness (the language should afford just enough expressiveness for the domain, see: configurable language, community grown). Names should not mimic any other programming language per se, but attempt to cater to complete beginners, because [notation has a large impact on novices](https://quorumlanguage.com/evidence.html), a principle inspired by [Quorum](https://quorumlanguage.com/). There should be a VS Code plugin that allows people coming from various languages to type function names as they know them and the editor will translate on the fly. E.g. typing in `array.filter` gets turned into `array.keep` in the code.
 - Guardrails: "_`<insert your favorite programming paradigm here>` works extremely well if used correctly."_ as [Willy Schott said](https://medium.com/@willy.schott/one-can-say-the-same-about-fp-ca7b3944a32b). The ideal programming language should both **work extremely well even when used incorrectly** (which all powerful tools will be), but first and foremost **be extremely hard to use incorrectly**. Inspired by Rust and Elm.
 - Not overly terse. Counter-inspired by C. Maybe give compiler warnings if the programmer writes names with less than about 4 characters. **Reading >>> writing**, since time spent reading is well over 10x time spent writing (inspired by [Robert C. Martin](https://www.goodreads.com/quotes/835238-indeed-the-ratio-of-time-spent-reading-versus-writing-is)), and writing can be alleviated with auto-complete, [text macro expansions](https://www.trankynam.com/atext/), and [snippets](https://code.visualstudio.com/docs/editor/userdefinedsnippets), in the IDE.
 - No runtime reflection. Counter-inspired by meta-programming and runtime type inspection in Ruby.
 - Not overly verbose. Counter-inspired by XML and Java. Maybe compiler warnings if the programmer writes names with more than about 20 characters.
 - [The Rule of Least Power] (https://www.w3.org/2001/tag/doc/leastPower.html) (by WC3), suggest a language should be the least powerful language still suited for its purpose. To minimise its complexity and surface-area. For better reuse, but more importantly: to make programs, data, and (I will include) _data flows_, easier to analyse and predict. Inspired by [FSM](https://en.wikipedia.org/wiki/Finite-state_machine) & [XState](https://xstate.js.org/). It needs, however, to be just powerful enough to be generally useful (and [not limited to a DSL](https://youtu.be/mVVNJKv9esE?t=1046)). Possibly Turing-complete. Given these considerations, a Lisp-style language comes to mind. But there's reasons Lisp never became hugely popular. My guess: readability. So while it could be a Lisp-language (or compile to one), it should read better than one.
 - _Removing variability in the syntax makes it more targetable for tooling and static analysis._ This further benefits the ecosystem.
 - It should be small, but extensible by using simple primitives (see: community grown, configurable language).  Pragmatically, it should use LLVM to compile to binary. Inspired by [Roc](https://youtu.be/vzfy4EKwG_Y?t=250). The language should probably be built using [OCaml](https://qr.ae/pGz7Uh) (since it affords pragmatic sound static typing), [Rust](https://news.ycombinator.com/item?id=24224837) or [Zig](https://ziglang.org/) (since they afford safety and speed), [Racket]([Racket](https://felleisen.org/matthias/manifesto/sec_pl-pl.html)) (since it is a Lisp geared towards creating languages) or [maybe](https://qr.ae/pGz7Og) Haskell (since it is good for working with [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree)'s. LLVM has bindings to these languages, and they are typically hailed as suitable for creating other languages. [Unison](https://www.unisonweb.org/docs/tour) could be a candidate, too, since it is Haskell-like and supports content-addressable code, but it is too early days for it yet. Available programmers (i.e. community size) in these languages should be considered (see: self-hosting). Should do more with less. Inspired by Lisp. Since predictability is good for humans reading, and for machines interpreting, and if it's predictable to machines, humans also benefit. **Important**: _"As one adds features to a language, it ramps up the complexity of the interpreter. The complexity of an analyzer rises in tandem."_ - [Matt Might, on static analysis](http://matt.might.net/articles/intro-static-analysis/)
  - **Code-Formatter**, like [gofmt](https://go.dev/blog/gofmt), inspired by Golang. A tool to auto-format code into a standard. Since standardisation creates readability and faster onboarding of new developers. It also enables mechanical source transformation, which is crucial for language evolvability. Beautiful formatting is important. But **Consistency & Determinism > Beauty**. Since even "a bad deterministic formatter is better than a non-deterministic formatter", [inspired](https://youtu.be/CTTTip7Kjao?t=11127) by Dart. Language should have a default standardized formatter, so code from a newbie and a pro looks similar, and jumping from project to project is easier and faster.
  - [Type 2 bootstrapped](https://lispcast.com/two-kinds-of-bootstrapping/), using a suitable base language that affords a small core of necessary abstractions to our language, with which the rest of the language can be built.
  - Self-hosting: In the future, the language should _maybe_ be made [self-hosting](https://github.com/nagydani/seedling/blob/master/RATIONALE.md#self-hosting), meaning it's compiler would be built in its own language. For portability and language independence. But it's more important that the language is built initially (using LLVM) to facilitate the targeted usecases (webapp + systems dev.), rather than being [implicitly optimized for writing a compiler](https://dev.to/madhadron/comment/8n52). Also: building a compiler in the language could potentially mean dealing with so many low-level concerns that the restricted and high-level nature of the language will be compromised. But then again, the language should ideally be suitable for systems development, and writing a fast compiler for itself is a good test case for that... Another important side-effect by self-hosting is that when the language is written in itself, the community is more empowered to expand the language, and not rely on others to do it for them (in another language, which they might not know themselves). This is important for a community-grown language to avoid [democracy turning into bikeshedding to death](https://news.ycombinator.com/item?id=30419531). The impetus is placed with the builders (not the vocal onlookers), and self-hosting empowers people to take matters into their own hands. Users become builders. The important part is to simplify merging of different directions, so that the language can converge. The language being about composing independent primitive abstractions should make this merging easier, since it is fewer intertwined features to decomplect and figure out how will interact. (see: community grown)
  - See: Escape hatches.

* Containability and explicitness. Inspired by **pure functions**. Perhaps the language should even restrict a function's scope only to what's sent in through its parameters. So no one can reference [hidden inputs](http://blog.jenkster.com/2015/12/what-is-functional-programming.html) (i.e. side-causes). Thus enforcing more predictable functions, where it is always apparent where it is used: what the function takes in and what it returns. So to achieve partial application of functions (i.e. useful closures), without addressing the outer scope implicitly, could be to supply variables from the outer scope as explicit default/preset/front-loaded parameters (e.g. in pseudo-JS: `let state; function(a, b:state) {...}`). This both makes the input and the closure more explicit, and "explicit is better than implicit" (inspired by [Python's principles](https://www.python.org/dev/peps/pep-0020/)). That way, input coming from closures (usually considered side-causes) would be declared in the function signature, so you don't have to dive into the (potentially long) function body to discover them. With the added benefit that a function could always be customized by the caller by overriding the enclosed values given as inputs by default. But importantly, the supplied variables should not be able to be shared with other functions (aka. global variables), because that would create the dreaded [shared mutable state](https://youtu.be/PNx9WqQ9QeA?t=90) which would introduce side-effects. If we should allow stateful functions at all, then we (at least here) favor functions being able to mutate (local, but persistent) state, rather than allow functions being able to share state with each other (e.g. via global variables). But we do prefer functions that always return the same result even when called repeatedly (i.e. idempotent, but [also](https://stackoverflow.com/a/4801291/380607) without side-effects i.e. being a pure function).
  - Memoization, automatically, but measured and only applied dynamically when runtime finds it beneficial. Aided by pure functions. The programmer shouldn't have to think about [memoization](https://en.wikipedia.org/wiki/Memoization) when programming, but should be able to tune the degree of memoization (since it is a space/time tradeoff) through general configuration, for advanced cases not optimal from the default. Run time optimisations such as these are not critical features, but certainly nice to have, and should be considered in the language design in those cases where it can affect the implementation of the language runtime. Memoization of math might not always be worth it ([06:43 @ Andrew Kelley on Data-oriented design](https://media.handmade-seattle.com/practical-data-oriented-design/)) so the adaptive runtime should measure math calculations and decide whether or not to memoize them in main memory (RAM), or just recompute the calculations because the CPU and it's cache are so fast and accessing RAM would be slower. These are hardware concerns that are subject to change as hardware progresses, and such concerns should thus not be encoded in the language syntax, but transparently taken care of by the language's runtime environment. See: adaptive runtime.
  - Explicit imports, so tree-shaking (to remove unused code) can be done. Inspired by JS. Also, so that it is clear where imported functions come from. Counter-inspired by [Golang](https://github.com/mjarkk/go-graphql/blob/e0fd37d29c6deba5ae5e059a562e765dfe608863/examples/fiber/main.go).

* Pattern matching. Inspired by [Elixir](https://elixir-lang.org/getting-started/pattern-matching.html), [Rust](https://doc.rust-lang.org/book/ch18-03-pattern-syntax.html) and [ReScript](https://rescript-lang.org/docs/manual/latest/pattern-matching-destructuring). The expression-oriented nature of the language should make this natural, without extra/fancy syntax. Pattern matching could preferably [replace if/else](https://kyleshevlin.com/pattern-matching) conditional logic, perform totality checking to ensure you've covered every possible condition, and even enable conditional branching based on type.

* Not file boundary dependent. Can be split into files, but execution shouldn't be dependent on file boundaries. So the programmer is free to keep code tightly together. Inspired by SolidJS.

* Niceties. Inspired by [Bagel](https://www.brandons.me/blog/the-bagel-language).
  - "Only single-quotes can be used for strings, and all strings are template strings and can be multiline ('Hello, ${firstName}!')"
  - No triple-equals; double-equals will work the way triple-equals does in JS.
  - Range operator for creating iterators of numbers (5..10, 0..arr.length, etc).


* No magic / hidden control. Control-flow should be easy to trace, because it makes it easy to understand and debug. Less magic. Counter-inspired by Ruby on Rails. Inspired by Elixir [Phoenix routing / endpoint plugs](https://dockyard.com/blog/2015/11/18/phoenix-is-not-rails). Testing isolated parts is made possible by explicitness. Explicit is better than implicit. Inspired by [Python's principle](https://www.python.org/dev/peps/pep-0020/). Explicitness makes testing isolated parts of the system possible. So Explicit > Implicit, almost always. Because explicitness typically reduces ambiguity and increases predictability. Although you can go overboard with it too, like in programming langauges for enterprise development, where everything tends to become over-specified. Furthermore, implicitness is preferred when one may intuitively and robustly determine the convention through the context, and might as well have an implicit sane default. E.g. `self.` references to access class variables inside the class methods is represent [noise](https://stackoverflow.com/q/68461184/380607), when it could be done as an implicit default. This is counter-inspired by Python, and inspired by Ruby. However, using `self` and `this` are considered [an anti-pattern](https://kentcdodds.com/blog/classes-complexity-and-functional-programming) in general.
   - Libraries over frameworks, as a [strongly recommended](http://tomasp.net/blog/2015/library-frameworks/) community convention (since a language cannot prevent the creation of frameworks, afaik). Inspired by Elixir, where its [Phoenix](https://dockyard.com/blog/2015/11/18/phoenix-is-not-rails) framework is a notable exception to the rule. Frameworks typically utilize [inversion of control](https://en.wikipedia.org/wiki/Inversion_of_control) ("don't call us, we'll call you"), and ultimately serve to take away control from the programmer. That creates Stack Traces which are really hard to debug, because they reference the framework and not your own code, [esp. problematic with concurrency](https://youtu.be/PNx9WqQ9QeA?t=646). And when yielding control to various (micro-) frameworks, compatibility becomes a specific issue. The programmer shouldn't ever have to ask: "Is this library/framework compatible with this other one?".  Counter-inspired by [JS Fatigue](https://medium.com/@ericclemmons/javascript-fatigue-48d4011b6fc4#.prcj59904). Nor have to ask "Where is the execution path of this program?". Counter-inspired by the magic of Ruby on Rails. When the control is always returned to the programmer (no IoC), he/she may likely mix and match more as pleased, without up-front worrying about compatibility (leading to analysis paralysis).
   - Meta-programming: No first-class macros (runtime), since it is a too powerful footgun. But should have compile-time macros. Inspired by Clojure. So that the language can be extended by the community, and so that legacy code could be updated to latest language version by processing the code with macros to transform the syntax.
   - **Expressions over statements**. The calling code should always get something back ([Is. 55:11](https://biblehub.com/isaiah/55-11.htm)). Because the result should be able to be further manipulated (chained, for instance). Inspired by Clojure [and Haskell](https://blog.jle.im/entry/first-class-statements.html). Counter-inspired by JavaScript. [Statements suck](https://youtu.be/q3Ies_XTo_s?t=327), as even the inventor of JavaScript, [Brendan Eich admits](https://bugzilla.mozilla.org/show_bug.cgi?id=513379#c21). A goal should be to eliminate the subjective/anthropocentric bias that afflicts programming (especially the Imperative kind), because: _It is not you, the programmer, which should be calling code, but code should be calling code. Code should not terminate in the void, as if it's you the programmer who is at every step acting on the machine. It should be the machine acting on itself. Which it actually is. So this is a matter of fact. But it should also be a matter of our language. So our programming language matches the fact. As programmers we should **model/describe causal interactions between entities**, not simply encode our own interactions with the machine._

* Simple primitives, that compose well, so that you are able to make powerful abstractions. Inspired by [SolidJS](https://www.solidjs.com/), [Jotai](https://jotai.org/) and [Radix UI](https://github.com/radix-ui/primitives/blob/main/philosophy.md). So, simple primitives instead of directly supplying powerful abstractions that you have to customize for various use cases, or wait for someone else to release an update for. Covered in the principle of [Composition over Configuration](https://maecapozzi.com/composition-vs-configuration/) (not to be confused with Convention over Configuration).  _Maybe_ [homoiconicity](https://wiki.c2.com/?HomoiconicLanguages)... since it would make writing the compiler easier, and making the language more readily available to evolve in the community on its own (permissionless). Inspired by Lisp and Clojure's Rich Hickey.
  - But this would allow meta-programming, and the associated complexity..?
  - The language should maybe also not be so powerful that programs become entirely composed by very high-level domain-specific abstractions, since it encourages esotericity and sociolects, but most importantly: code indirection when reading/browsing. Coding should not feel like designing an AST, so should try to encourage keeping the code flattened (by piping perhaps?) and as down-to-earth as possible. Could maybe be alleviated by an IDE plugin which would allow temporary automatic code inlining (editable previews).

* **Reversible debugging / time-travel debugging (TTD)**. “Reverse debugging is the ability of a debugger to stop after a failure in a program has been observed and go back into the history of the execution to uncover the reason for the failure.” [Jakob Engblom](https://undo.io/resources/reverse-debugging-time-travel-debugging-brief-hist/). Inspired by [Elm](https://www.youtube.com/watch?v=Agu6jipKfYw). Re: Accounting for human limitations and affording the most natural way of thinking: _"The problem you are trying to fix is at the end of a trail of breadcrumbs in the program’s execution history. You know the endpoint but you need to find where the beginning is, so working backward is the logical approach."_ [source](https://undo.io/resources/reverse-debugging-time-travel-debugging-brief-hist/). Should at least have this. Could be enabled by, but not necessarily need:
  - Reversible / invertible control flow: "A reversible programming language produces code that can be stopped at any point, reversed to any point and executed again. Every state change can be undone." [source](https://wiki.c2.com/?ReversibleProgrammingLanguage). Maybe. Might not be feasible, or desirable, when it comes down to it. Might be aided by immutability, and persistent data structures (if they are extended with history-traversal / operation logging features, in addition to structural sharing).

* **Transpiler, configurable**, so it could translate between all language dialects and variations. So that the language could evolve in multiple directions, and consolidate later, without harm. The  concern here is that for this to work the core language/AST may have to be the lowest common denominator to work across all those dialects, limiting how good any of the dialects could be (?).
  - [Homoiconicity](https://wiki.c2.com/?HomoiconicLanguages) could perhaps give affordance to such interlinguality. Inspired by Racket.

* Eager evaluation by default ([strict](https://en.wikipedia.org/wiki/Evaluation_strategy#Strict_evaluation), [call-by-value](https://bambielli.com/til/2016-07-24-CBV-vs-CBN/)). Since it is more straightforward to reason about in most cases, simpler to analyze/monitor/debug, and spreads memory consumption out more in time, than [lazy evaluation](https://en.wikipedia.org/wiki/Lazy_evaluation) (aka. [call-by-need](https://en.wikipedia.org/wiki/Evaluation_strategy#Call_by_need), aka. memoized [call-by-name](https://bambielli.com/til/2016-07-24-CBV-vs-CBN/)) which would pile up work and in worst case could [overflow memory at an unexpected time](https://prog21.dadgum.com/40.html) (in any case, the programmer shouldn't have to worry about evaluation strategies, including [space usage performance and evaluation stack usage](http://pchiusano.blogspot.com/2011/12/future-of-programming.html)). But it should use the generally more effective (do-less-work) lazy evaluation approach when currying functions, or chaining methods, unless intermediate error-handling or similar requires value realization (and even here, transducers could potentially alleviate unnecessary value realization). Inspired by Lazy.js. But this is an optimisation that could wait. Concurrent operations across threads/processes should [not be lazy](https://softwareengineering.stackexchange.com/a/124502/104312). You'd want to start exercising that machine as soon as possible. Counter-inspired by Haskell. Although it must be said: I am eager to be convinced that [lazy is better](http://www.cse.chalmers.se/~rjmh/Papers/whyfp.pdf) and that [space leakage](https://stackoverflow.com/a/28868806/380607) and the [bookkeeping overhead](https://softwareengineering.stackexchange.com/a/286063/104312) can be minimized). But in general, **the programmer shouldn't need to worry about _when_ the machine executes some piece of code**. Why wouldn't it be possible for a compiler to figure out at compile-time how and where functions are referenced, and choose eager or lazy evaluation depending on which is more suitable? For sequentially [chaining of operations on data structures](https://danieltao.com/lazy.js/), it could be lazy, and for [other operations](https://stackoverflow.com/q/28868636/380607) (potentiallly further apart in the program, with potentially memory intensive operations in between..) it could choose to be eager (get the work done, so the memory can be free'd asap). Or?


* **Async: blocking/sync interface, but non-blocking I/O**. Inspired by Golang, and to lesser extent JS / Node.js too. Should not have to litter code with async/await repeatedly (see: [what color is your function?](https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/) and [the problem with function annotations](http://pchiusano.blogspot.com/2009/05/optional-laziness-doesnt-quite-cut-it.html), and [async everything](http://joeduffyblog.com/2015/11/19/asynchronous-everything/)). Could be solved with [Async Transparency](https://hyperscript.org/docs/#async), inspired by Hyperscript. But hiding the async nature with synchronous seeming abstractions could create a dangerous model-code gap with a potential impedance-mismatch and cause for design errors and bugs ([inspired by Simon Brown](https://youtu.be/5OjqD-ow8GE?t=2768))... So the language should make some abstractions around async simple (like goroutines in Golang). But also inspired by declarative and easily statically analysable async contexts, made with JSX, like Suspense (async if-statement), in React and SolidJS. 
  - Alternatively: Async everything? The feature [referential transparency](https://en.wikipedia.org/wiki/Referential_transparency), obtained if the language enforces Pure Functions (i.e. no side-effects), could potentially [open up an avenue](https://stackoverflow.com/a/18499847/380607) for making everything async by default (and letting the compiler insert `await` instructions where it figures out functions are not I/O bound and thus can be optimized direct/synchronous CPU execution instead, without the overhead of asynchronicity).
  - **Ease of reasonability is first priority**. Inspired by F# ([Is your language reasonable?](https://fsharpforfunandprofit.com/posts/is-your-language-unreasonable/) by Scott Wlaschin). I believe it is best afforded by **simple and clear abstractions** (without model/code impedance mismatch, as made important by failures of ORM's and distributed contexts). The choice of sync interface here as opposed to async, is similar to how the wish for [lazy evaluation](https://en.wikipedia.org/wiki/Lazy_evaluation) by default was discarded for eager evaluation by default. One [argument by Ryan Dahl of Node.js](https://mappingthejourney.com/single-post/2017/08/31/episode-8-interview-with-ryan-dahl-creator-of-nodejs/) is that sync by default with explicit async (he mentiones goroutines in Go) is a nicer programming model than async everything (like in Node). Because it's easier to think through what the program is doing in one sequential control flow, than jumping into other function calls like in Node.js (if you are using async callbacks). See the "fragments your logic" point below. Reasonability is a top priority, so we cannot make a compromise here.
  - Async: Unbounded [Buffered Channels](https://golangr.com/channel-buffering/), which simply puts messages onto the queue/buffer of the channel (see also "Machines" concept under the "Scalable" feature). Inspired by Golang and [Clojure](https://clojure.org/news/2013/06/28/clojure-clore-async-channels). So that the sender can continue working without having to wait for the receiver to synchronize for sending the message (thus freeing CPU time at the expense of some memory). The channel buffer should ideally be unbounded, as it is hard to predict in advance an accurate buffer limit (and reaching the limit will also mean the end of concurrent operations). So the channel should not block the sender when it's writing to it, but it should block the reader when it's reading from an empty channel (until the channel receives a value). Inspired by [Alexey Soshin](https://qr.ae/pGdyji), and inspired by BlockingQueue in Java. Counter-inspired by Golang and [Clojure](https://clojure.org/news/2013/06/28/clojure-clore-async-channels). Maybe there should be some confluence of CSP and Actor model, since [each works best at different abstraction levels](https://news.ycombinator.com/item?id=16177983), and we ideally want [loosely coupled and flexible](https://news.ycombinator.com/item?id=25849806) mechanisms which are equivalent to backpressure (inspired by samuell from HN). Ideally, a receiver shouldn't need to [use backpressure](https://magne.medium.com/sorry-for-being-presumptuous-the-suggestion-was-well-intended-i-do-think-it-was-correct-though-240e47c0880f) to signal a desired reduction in messages, but simply control how fast it is reading from the buffered channel, since it should be in control of it's consumption anyway. The language should provide abstractions so that the user doesn't have to worry about these things, and then choose the appropriate model under-the-hood depending if it's running on one machine or distributed (see: 'Adaptive runtime'). This idea of 'abstracting away the network' should not be adopted lightly. Since programmers might make mistakes when important distinctions are hidden (i.e. using convenient Ruby chaining with the Rails ORM, can quickly lead to inefficiencies like excessive queries). We also have a principle _"Make similar things look similar, and different things look different"_. So unless the abstraction actually abstracts away all important differences, _and_ the location (it's local/distributed nature) of the called service is apparent from the usage context (by conventions in naming or otherwise), such abstractions can be dangerous and should be avoided in favor of explicit primitives instead.
  - Good means of async control: Being able to cancel tasks/jobs, set timeouts, and easily be able to wait for a task to finish. Channels should be able to contain Tasks that return a Result (which may contain an error), and are cancellable.
    - [Rich Hickey has some good arguments against async by default](https://youtu.be/yJxFPoxqzWE?t=1831) (when implemented with callbacks as in JS), namely that it:
      - fragments your logic (spread out into handlers), instead of keeping it together. Programmer has to deal with multiple contexts at once (complicated), instead of one overarching context (simple).
      - callback handlers perform some action once in the future, but the state they are operating on may have mutated in the meanwhile. So it may give a false confidence in being able to get back to the state as it were when the callback was made. We want to avoid the dreaded [Shared Mutable State](https://youtu.be/PNx9WqQ9QeA?t=90). Which may be solved with only allowing immutable constructs (like Clojure).
    - On the other hand, having sync by default, and *async through [Channels](https://tour.golang.org/concurrency/2)*:
      - gives the control back immediately (in line with functional composition) instead of functions that effectively evoke side-effects on the real world on the other end (as callback handlers do). In line with our principle: Always give control back to the programmer.
      - channels are generalized pieces of code that can handle many connections (pub/sub).
      - channels afford safe concurrency (thread handling), whilst with callback handlers (unless used in an event-loop system such as JS) the programmer has to ensure safe concurrency (which we [don't want](https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/)).
     - channels afford choice on when to handle an event, whereas with a callback it gets called whenever it gets called (event-loop). Channels work in line with our principle: Always give control back to the programmer.
  - All of the above have implications for reasonability. Needs to be investigated further... Golang's way of handling async seems to be [the current gold standard](https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/), touted by many bright people, since _"Golang has eliminated the distinction between synchronous and asynchronous code"_ (by letting the programmer code everything in a sync fashion, but doing async I/O under the hood). Golang's principle of _"Don't communicate by sharing memory; share memory by communicating."_ avoids the dreaded [Shared Mutable State](https://youtu.be/PNx9WqQ9QeA?t=90) and affords itself better to ensure **simple, safe, and scalable modes of thinking** (our core principle): It's hard to think of something, if it has changed the next time you think about it (thus: immutability). Or if thinking about it changes it (manifesting in code the cognitive equivalent of [Heisenbug](https://en.wikipedia.org/wiki/Heisenbug)'s): Programmers need to be able to reason about a program's state without simultaneously modifying that state ([inspired by CQRS](https://en.wikipedia.org/wiki/Command%E2%80%93query_separation#Connection_with_design_by_contract)).
  - Another, but more radical idea: **The programmer shouldn't have to think about _when_ or _where_ the code will run**. It should be managed by the language runtime, based on the specified platform. If the program is a local program for one machine then it could be specified to run the work _synchronously_. If run over multiple machines, it could be specified to use async by default, to delegate work. But then if results don't arrive within time (from a remote machine/CPU-core), it could chose to perform the work itself, but lazily when the result is needed. So there should be some built-in semi-lazy evaluation measure based on CPU monitoring. Also, for the work it decides to do itself, the runtime should decide when to perform it: if the CPU-cores are idle, then it should eagerly execute the work, but if not then it should postpone just enough work so that the CPUs are adequately exercised. Currently, in languages without this nuanced model, the programmer has to make an either-or distinction based on a generalized heuristic of whether or not async or lazy makes sense, and apply it in a fixed fashion. But these assumptions do not necessarily hold for operational scenarios. Ideally, the programmer shouldn't have to think about such operational, low-level matters.

* **Concurrency. For Multi-Core _and_ Distributed.** using Channels like in Golang/[CSP](https://en.wikipedia.org/wiki/Communicating_sequential_processes), but asynchronous ones (see: Buffered Channels). The important point is to produce readable stack traces that exclude framework code, like CSP tends to give, since concurrency then is vastly [easier to debug](https://youtu.be/PNx9WqQ9QeA?t=770). Inspired by Golang and [CSP](https://en.wikipedia.org/wiki/Communicating_sequential_processes). Async is also important for the distributed part. Alternatively: For multi-core just use regular Channels like CSP, since it is proven, and for distributed just use the goroutines which are async.
  - Async: Concurrency should integrate well with the async feature of the language (see: Buffered Channels). Default should be to ship tasks off to be completed elsewhere (other thread/process/worker/server), while continuing own work in the meanwhile (fire & forget). Inspired by JS. But without fragmenting the logic into dispersed callback handlers throughout the codebase which are run at unknown points in time (as Hickey points out under the 'Buffered Channels' point elsewhere in this article. Counter inspired by JS).
  - Probably not implemented as an Actor Model. Since [Actors statefulness is complex](https://news.ycombinator.com/item?id=21561966). Also, since events going all over the place in a non-stateful app, is harder to reason about than stricter promise-based operations (using callbacks under-the-hood). Counter-inspired by [StimulusJS](https://news.ycombinator.com/item?id=25310766). Inspired by ReactJS.
  - Concurrency vs. Parallelism should be up to the runtime, not something the programmer should have to worry about. If the runtime has multiple cores, then parallelize the tasks onto those cores. If the runtime only has one core to work with, then interleave the execution of the tasks concurrently on that single core.

* **Scalable**: From single core to multiple core CPUs, and from one to a distributed set of machines. Without needing refactors. This is called [Location Transparency](https://www.reactivemanifesto.org/glossary#Location-Transparency), and _"Embracing this fact means that there is no conceptual difference between scaling vertically on multicore or horizontally on the cluster"_. Inspired by Alan Kay's vision of computing, and the purpose of the [Actor Model](https://www.brianstorti.com/the-actor-model/), utilized in Erlang/Elixir and [Pony's actors (w/ async functions)](https://tutorial.ponylang.io/types/actors.html). But rather than using state-driven Actors, I'd rather want it implemented with stateless "Machines", which  simply  gives stateless functions a call queue each. Inspired by [Smalltalk](https://blog.metaobject.com/2019/11/what-alan-kay-got-wrong-about-objects.html), but stateless. They call each other by sending Messages (containing the parameters) to the other function's call queue, take into consideration error-handling, and the [unreliability of distributed computing](https://en.wikipedia.org/wiki/Fallacies_of_distributed_computing). (The caller chooses if their call should be sync/blocking or async/non-blocking, since sync/async aka. blocking/non-blocking, is not a feature of the called function, but the call itself. _[Async is not an adjective but an adverbial](https://twitter.com/magnemg/status/1498758939411984390?s=20&t=22EsOqyL0E4KjTIczit4Zw)!_ [Counter-inspired](https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/) by [JS](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Asynchronous/Async_await), and inspired by the `go` keyword of Golang on function invocation/callsite.) We name such functions "Machines". Each of them are in fact a mini-computer, or a [computer-within-the-computer](https://blog.metaobject.com/2019/11/what-alan-kay-got-wrong-about-objects.html), if you will, but without inherent state (which ought to be stored and managed by a DB or in-memory DB). Such Machines should be able to be moved to distributed systems without rewriting the code. Inspired by Alan Kay and Actor Model systems (Akka), and  languages where actors are first-class citizens, like in [Pony](https://tutorial.ponylang.io/types/actors.html). A single Machine could work as a minimal microservice, or better yet, a Cloud Function, but likely you'd want multiple endpoints which expose a Machine each.
  - **No global variables**: Because [global variables are a bad practise](https://www.baeldung.com/cs/global-variables), and they don't translate well to a distributed system setting, so scaling up a code-base from single machine to multi-machine when using global variables can't be done without a rewrite. Instead, a function can call another function by simply sending a message. Inspired by Smalltalk. See aforementioned "Machine" concept. Messages can be passed through chains of function calls by piping and/or [`...rest` parameters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters).
  - No [variable shadowing](https://en.wikipedia.org/wiki/Variable_shadowing) _within_ functions, but insides of a function may shadow the outside. Inspired by [C#](https://ericlippert.com/2007/08/14/c-and-the-pit-of-despair/). Since variable shadowing is [a reason](https://forum.rescript-lang.org/t/let-keyword-needed/2899/6) to have keywords such as `let`, then _not_ allowing variable shadowing could afford the opportunity to avoid having such keywords as `let` or `const`, for minimalism (since all values should be immutable anyway). So functions should allow [shadowing external variables](https://github.com/jashkenas/coffeescript/issues/2697#issuecomment-13279409) to the function, since it ensures the writer/reader of the function doesn't need to know about, or be constrained by, potential name collisions with external/global variables (see: function independence). In general, the language should restrict global variables to module namespaces. When global variables are used, they should be accessed locally by calling a global function. Inspired by [Python](https://gist.github.com/iankronquist/99db09745d4df46b5d8b933f5bd80c3c#file-2_scope-md)'s use of the `global` keyword. Or, globals should be accessed directly using a `@@` prefix to their name, like Ruby does for static variables. But in all: There shouldn't be various shadowing rules for various kinds of scope, but one simple shadowing rule for functions (and functions should be the general scope of choice).
  - Ideally, for performance, when code is compiled to be run on a single machine, the compiler should be able to be optimise away the Mailboxes, so that Machines can be turned into (simpler and faster) synchronously executed functions.
  - Facilitate and nudge developers's towards creating "Functional Core, Imperative Shell" architectures (inspired by [Bernhardt at 31:56 in his Boundaries talk](https://www.destroyallsoftware.com/talks/boundaries)), to preserve the purity of functions as far as possible, while also **containing side-effects**:
      - **Configurable language**: [Platform config](https://youtu.be/cpQwtwVKAfU?t=976) that encapsulate all I/O primitives, which introduces a separation between trusting a particular platform and trusting the language. Inspired by [Roc](https://youtu.be/cpQwtwVKAfU?t=1034). Could even make certain features of the language only available on certain platforms, i.e. Browser platform doesn't have access to low level memory management. So that the language can be as restrictive as possible for the environment, ensuring that code is written idiomatically for the target platform / environment, since a restricted language has value because for a given platform the programmer would encounter less diversity in the language and thus have less to learn. This strikes a balance between on one hand providing sharp knives as global tools programmers can apply anywhere (i.e. potential footguns, leading to [The Pit of Despair](https://ericlippert.com/2007/08/14/c-and-the-pit-of-despair/) like in C++), and on the other hand avoiding being so restrictive that programmers can't talk/write/think about what they want/need to for their given environment. The language itself should be [massively configurable](https://youtu.be/Bs44qdAX5yo?t=1420): **It is not reasonable to assume that the language designers will have accounted for all possible usecases** (various memory management strategies etc.). So the language primitives/keywords should be able to be given different underlying effects (e.g. [stack vs. heap allocation](https://ziglang.org/learn/why_zig_rust_d_cpp/#no-hidden-allocations)) based on which platform or use-case is specified (without having to be explicit about every such effect in every environment). But the effects should be inconsequential for the reasonability of the code. Meaning that they should be at the bare-metal performance level, not at the level where operators are overloaded to do something different, cf. our principle that _things that are different (i.e. have different effects at the language level the programmer is operating at) should look different_. The platform config will depend on which implementation makes most sense for that platform (or use-case?) (i.e. browser webapp vs. systems development, vs. game development, potentially). [The language should be configurable by libraries](https://youtu.be/Bs44qdAX5yo?t=1420), that will define how it works, and can extend the core to platforms where the programmer needs to think about specific matters to that platform. Inspired by Clojure. **The same program specification should be able to have different runtime characteristics on different platforms**, depending on the platform configuration. This could be enabled by the programming language concerning itself with modeling causal relationships, instead of [place-oriented-programming](https://github.com/matthiasn/talk-transcripts/blob/master/Hickey_Rich/ValueOfValues.md).
      - **Encapsulated I/O**, so functions can avoid having side-effects. Inspired by Haskell. **Alternative #1:** [Algebraic Effects](https://overreacted.io/algebraic-effects-for-the-rest-of-us/) for I/O, so that side-effects can be contained in a given context. Algebraic Effects are also a powerful general concept that [could](https://news.ycombinator.com/item?id=14781900) help with concurrecy, async/await, generators, backtracking, etc. Inspired by [OCaml](https://www.janestreet.com/tech-talks/effective-programming/). **Alternative #2:** use [an IO action of an IO type](https://blog.jle.im/entry/io-monad-considered-harmful) (inaccurately named "IO Monad" at 30:44 in the [Boundaries talk](https://www.destroyallsoftware.com/talks/boundaries)), transparently (without actually having to [deal with the concept of a Monad](https://www.google.com/search?q=what+is+a+monad+meme&client=firefox-b-e&source=lnms&tbm=isch&sa=X&ved=2ahUKEwjdu9i0ocXyAhWZS_EDHdiqDZcQ_AUoAXoECAEQAw&biw=1512&bih=833)). Where you effectively [construct a sequence of I/O operations to be executed later](https://stackoverflow.com/a/48413048/380607). Inspired by [Haskells separation between pure functional code and code that produces external effects](https://youtu.be/iSmkqocn0oQ?t=184) (cf. "functional core, imperative shell" concept (at 31:56 in the [Boundaries talk](https://www.destroyallsoftware.com/talks/boundaries)) which was inspired by Haskell). Something like this is needed because the Mailbox is stateful (it is constructive/destructive, like a queue), and I/O messaging would be a side-effect. The Machine/Mailbox is inspired by the Actor Model from Erlang. Ideally, since all I/O is wrapped, it should be able to turn on/off the execution of IO actions, based on setting some initial config. This could be useful for testing. You could even do a sample run to collect data, which you could snapshot to use as mock data for test runs. **Alternative #3:** Potentially by syntactic rules: A function should _either return a value, or don't return anything_ (i.e. be simply a void procedure). And a procedure can never be placed within a function. NB: Could lead to [the colored functions problem](https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/). **Alternative #4:** Use [Uniqueness Type](http://lambda-the-ultimate.org/node/2708), which allows mutability and pass-by-value while also preserving the crucial **[referential transparency](https://sookocheff.com/post/fp/why-functional-programming/)** (since side-effects are ok in a pure language as long as variables are never used more than once). Inspired by [Clean](https://en.wikipedia.org/wiki/Clean_(programming_language)) and [Idris](https://www.idris-lang.org/). Possibly use [Simplified Uniqueness Typing](https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.142.5413&rep=rep1&type=pdf), inspired by [Morrow](https://www.openhub.net/p/12489). **Alternative #5**: Simply be able to turn on/off side-effects like external output operations. If all output operations are done through an IO module in the standard library, it could afford a simple "off" switch, to be able to do testing. That would prevent side-effects from acting on the outside world during testing. The challenge is [side-causes](http://blog.jenkster.com/2015/12/what-is-functional-programming.html) (aka. hidden inputs), however. The language could have the IO module require a default/fallback parameter to be set for external input operations. `IO.readFromFile(fileName, "Default file content fallback.")`. Which would be used during testing (the benefit being that the mocks would already be present). Another problem with side-effects have to do with ecosystem (especially interop with other languages): If you use a 3rd party package, how do you know it won't leak data to a 3rd party server during runtime? This ought to be solved by a sandboxed runtime environment (inspired by Deno), where it should automatically log any attempts  at IO access not explicitly made through your own application code (using the language's IO module). Inspired and counter-inspired by [Elm](https://guide.elm-lang.org/interop/limits.html).

* Reactive. Inspired by [Functional Reactive Programming, and Elm](https://www.youtube.com/watch?v=Agu6jipKfYw), and [The Reactive Manifesto](https://www.reactivemanifesto.org/). Though the latter is geared at distributed systems, it could also be a model for local computation (rf. Actor model, and [Akka](https://akka.io/)). The programming language should make default and implicit the features of reactivity and streaming, as opposed to preloading and batch processing. (Reactive Streaming Data: Asynchronous non-blocking stream processing with backpressure.)

* No single-threaded event loop that can block the main thread. Counter-inspired by JS.

* [Transducers](https://medium.com/javascript-scene/transducers-efficient-data-processing-pipelines-in-javascript-7985330fe73d), under-the-hood, to compose and collate/reduce transformation functions (chains of map, filter etc. turn into a single function, [visualised here](https://web.archive.org/web/20190316032907/https://medium.com/@roman01la/understanding-transducers-in-javascript-3500d3bd9624)). Chaining function calls should use language-supported transducers implicitly. Maybe one could get [transducers for free](https://youtu.be/XkIoGmWkEpM?t=963) through use of [multiple return values](https://youtu.be/XkIoGmWkEpM?t=963), as inspired by Qi (a flow-oriented DSL for Racket, the Lisp-like language). The language should at least not require a special `compose` syntax.

* Gradually typed, as types can add boilerplate, create [unnecessary friction](https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md#the-philosophy-of-jai), obstruct a programmer's [tinkering](https://github.com/staltz/ama/issues/49) [flow-state](https://en.wikipedia.org/wiki/Flow_(psychology)), and create noise in the code. Counter-inspired by TypeScript, and inspired by Elm and [Jai](https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md). As many types as possible should be inferred. Inspired by TypeScript but even more inspired by OCaml and ReScript.
  - No runtime type errors. Inspired by Elm (and Haskell). See 'Error Handling & Non-Nullability'.
  - Union Types: Types should be associative/commutative/composable/symmetric (i.e. `A|B` should equal `B|A`), inspired by Dotty/Scala3, and the ['Maybe Not' talk by Rich Hickey](https://youtu.be/YR5WdGrpoug?t=623).
  - Types should be enforced statically at program exit boundaries (so external libraries or outgoing I/O are ensured existing typings).
  - [Structural subtyping](https://www.typescriptlang.org/docs/handbook/type-compatibility.html) (inspired by TypeScript, OCaml), instead of nominally typed (counter-inspired by [Java](https://www.youtube.com/watch?v=aSEQfqNYNAc) and [Haskell](https://lexi-lambda.github.io/blog/2020/01/19/no-dynamic-type-systems-are-not-inherently-more-open/#footnote-ref-2-1)). Since it is the closest you'll get to duck-typing within a statically typed language. But it should also have support for nominal types at the few cases where that might be beneficial (i.e. opaque types, not possible with only structural subtyping). Inspired by [ReScript](https://www.greyblake.com/blog/from-typescript-to-rescript/), and counter-inspired by TypeScript.
  - [Strongly typed](https://rescript-lang.org/docs/manual/latest/type) (checked at compile time), not weakly typed, since implicit type coercion (at runtime) can be unpredictable, and variables that can potentially change their type at runtime is [madness](https://www.destroyallsoftware.com/talks/wat). Inspired by TypeScript and ReScript. Counter-inspired by JavaScript. [No runtime/ad-hoc polymorphism](https://baturin.org/blog/introduction-to-ocaml-part-4-higher-order-functions-parametric-polymorphism-and-algebraic-data-types/) (aka. dynamic dispatch), so function/operator overloading would not be possible (e.g. + can't be used both for summing ints and joining strings, so you'd have to use ++ or similar), but we'd gain the more important ability to fully infer static types for programs, without having to write type annotations, and compiling could get really really fast. Inspired by OCaml. Counter-inspired by Clojure, Java, Ruby.
  - [Generics / Type parameters / Parametric polymorphism](https://rescript-lang.org/docs/manual/latest/type#type-parameter-aka-generic). Inspired by ReScript and OCaml. Counter-inspired by how C++ and Java [handles generics](https://research.swtch.com/generic). Basically, to make generics sane, coherent, and pragmatic, without nudging developers into going too much overboard with generic abstractions (like [generics induced function coloring](https://news.ycombinator.com/item?id=29735509)). So maybe some kind of limitations to generics, like Rust. Since I'd [prefer a little duplication](https://sandimetz.com/blog/2016/1/20/the-wrong-abstraction) instead of a complex abstraction. Due to reason-ability, time to onboard new developers to a project, and the roughly 10x more time programmers spend reading than writing code, as [the saying](https://www.goodreads.com/quotes/835238-indeed-the-ratio-of-time-spent-reading-versus-writing-is) goes.
  - Type inference, sound and [fully decidable](https://3fx.ch/typing-is-hard.html#decidability) and with 100% coverage. Inspired by OCaml and [Roc](https://youtu.be/6qzWm_eoUXM?t=762). To not have to declare types everywhere. For increased readability and convenience (though not essential, cf. popularity of Rust). But local type inference inside the body of functions are what's most important (inspired by Scala), since functions input/output types should always be declared, for documentation purposes. But they could probably be generated after the prototyping phase / exploratory coding is done and you want to ossify the code. In that case, they should not be inline (like in TS), but next to the function definition (like in Elm).
  - Pragmatic type bindings for external libraries: should allow you to write type bindings that mirror how you will use the library in your own project, instead of getting stuck at generalizing potentially complex types. Inspired by [ReScript](https://forum.rescript-lang.org/t/possible-to-import-typescript-packages-into-reason/989/5).
  - [Typed Holes / Meta Variables](https://jfdm.github.io/post/2020-07-09-Programming-with-holes.html). Inspired by Idris. Since it "allows computing with incomplete programs", and "allow us to inspect the local typing context from where the hole was placed. This allows us to see what information is directly available when looking to fill the hole". I.e. the compiler provides hints about its attempt to infer the type of the missing value (aka. hole). As opposed to either requiring that a program is fully typed, it can afford a [Live programming environment](https://www.youtube.com/watch?v=q58NFuUr0GU) that give feedback to the programmer while editing about how it would be executed.
  - No type classes or highly abstract type level programming. Attempt to keep data and functions separate, as far as is both possible and pragmatic. Inspired by [Don Syme’s philosophy for F#]( https://github.com/fsharp/fslang-suggestions/issues/243#issuecomment-916079347).

* **Composable.** Favour composition over inheritance. Inspired by Robert C. Martin, Martin Fowler, and [JSX in React](https://reactjs.org/docs/composition-vs-inheritance.html). Composability entails it should be easy to write code that is _declarative_, _isolated_ and _order-independent_. See "strongly typed".
  - [Immutability enables composability](https://youtu.be/6YbK8o9rZfI?t=3563), because it enables order-independence through managed effects.

* Memory safe, ergonomic, and fast. should be safely and implicitly handled by the language, without a runtime GC.
 - [No Garbage-Collector](https://youtu.be/Gv2I7qTux7g?t=123) (GC), but also no garbage. Deterministic Object lifetimes, and Ownership tracking (affinity type system). Inspired by Rust and [Carp](https://github.com/carp-lang/Carp). Alternatively, the language could take [inspiration](https://evincarofautumn.blogspot.com/2012/02/why-concatenative-programming-matters.html) from [concatenative programming languages](https://en.wikipedia.org/wiki/Concatenative_programming_language#Properties) which doesn't generate garbage by design, has [other desirable properties](https://www.youtube.com/watch?v=_IgqJr8jG8M), and uses the stack heavily. Inspired by [Kitten](http://kittenlang.org). Garbage is a symptom of memorizing, which is tedious for the programmer, as well as the compiler, as well as the runtime. Garbage comes when you have to clean up something you memorized (something you allocated memory for, but somehow stopped using further on). Concatenative programming is closely related to FP through [continuation-passing style](https://en.wikipedia.org/wiki/Continuation-passing_style) (CPS) and [tail-call optimization](https://stackoverflow.com/a/310980/380607) (TCO). The language/compiler should [utilize CPS](https://www.defmacro.org/2006/06/19/fp.html) where possible, so as to reduce/optimize usage of the stack. It should be able to [store a continuation](https://www.defmacro.org/2006/06/19/fp.html) (equivalent to persisting the stack to RAM/Disk) so that stateless programs (like a web server) could be restarted near a point of interruption/error (when the client makes the request again), to simulate statefulness. Inspired by Scheme. 
 - Memory-management & safety. Automatic Reference Counting. Inspired by [Roc](https://youtu.be/vzfy4EKwG_Y?t=355). Maybe a Borrow Checker, for memory-safety. Inspired by Rust. But ideally, [Ownership and Borrowing](https://blog.logrocket.com/introducing-the-rust-borrow-checker/) should be implicit by the programming language, so the programmer wouldn't have to think about low-level concerns such as memory management (e.g. what goes on [the stack vs. the heap](https://doc.rust-lang.org/book/ch04-01-what-is-ownership.html#the-stack-and-the-heap)) or various kinds of references. To avoid conceptual overhead of manual memory management (as with explicit borrowing semantics), the language should perhaps use or take inspiration from [Koka's Perceus Optimized Reference Counting](https://koka-lang.github.io/koka/doc/book.html#why-perceus). Koka apparently allows even more [precise reference counting (see sect: 2.2)](https://www.microsoft.com/en-us/research/publication/perceus-garbage-free-reference-counting-with-reuse/) than Rust.
  - Platform user can config memory management strategy. Inspired by [Roc](https://youtu.be/cpQwtwVKAfU?t=1574). It should for example enable choosing [Arena-allocation](https://youtu.be/cpQwtwVKAfU?t=1436) strategy for HTTP request-response cycles, which would be optimal there. This type of performance enhancing platform config ties back into the point of a configurable language.
  - [Levers](https://twitter.com/kentcdodds/status/1529583302713085952?s=20&t=OdKfFC0x_Tq4JwcFOq3AaQ) which give developers options for various kinds of tradeoffs. Inspired by [Remix](https://remix.run/blog/remix-and-the-edge#enter-remix). Ideally, if at all possible: an **opt-in Garbage Collector (GC)**. Maybe enabled through a modular/plugin-oriented runtime. So the language would be [easy to make a web API](https://macwright.com/2021/01/15/rust.html) in, since: _"Rust makes you think about dimensions of your code that matter tremendously for systems programming. It makes you think about how memory is shared or copied. It makes you think about real but unlikely corner cases and make sure that they’re handled. It helps you write code that’s incredibly efficient in every possible way. These are all valid concerns. But for most web applications, they’re not the most important concerns."_ -- [Tom MacWright](https://macwright.com/2021/01/15/rust.html).

* Secure from the start. Secure runtime. Inspired by Deno. Safety has to be a built-in design-goal from the start, it cannot be added on later. As evidenced by the justification of existence of Deno (Node was unsafe), and Rust (C++ was unsafe). Also, see: memory safe.

* **Powerful primitives over batteries-included**: Few, but powerful and composable, core primitives. Based on very few fundamental concepts to learn. Inspired by Lisp. Prefer uniformity and consistency. Counter-inspired by JavaScript's only half-way interchangeable expressions and statements. Without feature uniformity then programmers will learn, use and prefer slightly different subsets of the language, but that leads to extensive knowledge being required to read others' code ([Farooq et al., 2014](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0088941)). NB! But beware [Tesler's Law of conservation of complexity](https://humanist.co/blog/law-of-conservation-of-complexity/): less complex primitives would mean more complex programs (and more complexity for the programmer to write and read), since the irreducible complexity has to be accounted for somewhere. The overall goal is to eliminate [accidental complexity](https://en.wikipedia.org/wiki/No_Silver_Bullet#Summary), by a curated set of powerful abstractions.
  - But avoid [DSL](https://en.wikipedia.org/wiki/Domain-specific_language)'s, since Domain-Specific Languages typically become mini-languages in their own right. Such languages are akin to dialects/sociolects that hinder generalised understanding and learnability (adds knowledge debt). Counter-inspired by Ruby and Lisp ([Lisp being too powerful](https://wiki.c2.com/?LispIsTooPowerful since [Lisp shepherds you into building your own language/DSL](https://news.ycombinator.com/item?id=22700512)). It might be true that _“Domain-Specific Languages are the ultimate abstractions.”_, as Paul Hudak put it in 1998. But they are only ultimate _within some particular domain_. Because [DSL's are not general and are underpowered](https://youtu.be/mVVNJKv9esE?t=1046), precisely because they are domain-specific (they sacrifice general expressivity over expressivity in one specific domain). But how do you know that you know your domain? That you have perfectly captured your domain in your DSL, and don't need to rework the DSL entirely, to account for some new understanding? Most [domains are moving targets](https://youtu.be/mVVNJKv9esE?t=1137), to some degree. Generalized languages seem a better way to go, even though they might entail slightly more work within a domain, than a DSL. (A sharp knife is in general preferable to kitchen-appliances for every single use case.) Some cross-domain terms (keywords like `function`, `if`, `return`, etc.) are usually helpful for onboarding programmers, since they afford familiar _knobs_ on which to hang the other unfamiliar code. Even if you don't understand the domain (or its plethora of abstractions), you would at least understand _something_. From where you could build your further understanding.
  - Small focused core, with powerful composable primitives, that lends itself well to abstraction. Language extensible by library authors. Strong convention and encouragement for abstractions based on generalizable [JTBD](https://jtbd.info/2-what-is-jobs-to-be-done-jtbd-796b82081cca) naming, instead of business/domain-specific DSL's (reasoning above).
  - Modular composition, configurable. Inspired by [Rollup plugins](https://rollupjs.org/guide/en/#plugins-overview).
  - [A language for library authors](https://youtu.be/ltCgzYcpFUI?t=1317). Inspired by the success of C++. The language should be able to **evolve by community convention, not by centralised specification**: the language itself should be extensible with libraries (would probably need to have some limited metaprogramming facility in the form of compile-time macros... good idea?). See: community grown, configurable language.
  - **Fast branching and merging**: What would be important is to facilitate fast and simple language _merging_, due to all the branching that would appear (for the aforementioned reasons; library-driven). Inspired by Git ([fast branching and merging was the big idea behind much of Git's success](https://qr.ae/pG3XE8)). So the community can easily find back together after a split/branch (if their ideas and goals come back in alignment, and they have converged to an agrement on the features again). See also: "forward- and backward-compatibility".

* Be [general purpose enough](https://github.com/nagydani/seedling/blob/master/RATIONALE.md) to at least write scripts and CLIs, but also web servers/clients.

* Ergonomic to type. Prefer text over special characters like curly brackets (they are hard to tell apart from parentheses in JS). No littering of parentheses. Inspired by Ruby. Counter-inspired by JavaScript, Lisp, and JSON.

* No super-powerful tools which may hurt you or others in the long run. Counter-inspired by meta-programming in Ruby.

* Crash-safe. Can crash at any time and resume computation at exact same spot when restarted. Inspired by Erlang.

* Piping, or some form of it. But always top-to-bottom or left-to-right. Inspired by Bash, and functional programming with pipes (Elixir, BuckleScript, and [ts-belt](https://mobily.github.io/ts-belt/)). [Data-first instead of data-last](https://www.javierchavarri.com/data-first-and-data-last-a-comparison/).

* No Exceptions. Inspired by Golang. But Recoverable and Unrecoverable errors. Inspired by Rust. (Definitely [no checked exceptions](http://literatejava.com/exceptions/checked-exceptions-javas-biggest-mistake/), as it breaks encapsulation by imposing behavior on the callee (the callee should only have to handle the function's specified result). Counter-inspired by Java).
  - Result data type, for error handling and validation. Inspired by Result from Rust and F#, and [Either from Haskell] (https://blog.thomasheartman.com/posts/haskells-maybe-and-either-types) and Elm, although it should not be called Either, as [Either is a confusing misnomer](https://youtu.be/YR5WdGrpoug?t=623).

* Error handling & Non-Nullability: Goal is to eliminate [timid coding patterns](https://youtu.be/T8J0j2xJFgQ?t=151) like null checks everywhere. Counter-inspired by Golang. No implicit `null` or `nil` value. Meaning no runtime null errors (typically occurring far removed from their point of inception). Inspired by Elm and Rust. Ideally without having to explicitly declare `Maybe` aka. `Option` types (inspired by Hickey's [Maybe Not](https://youtu.be/YR5WdGrpoug?t=623)). Could either automatically represent nilable variables as a union between the type and nil, so that the compiler can do null reference checks at compile-time. Inspired by [Crystal](https://crystal-lang.org/). Or, _automatically but statically_ infer and create/augment a function's return type to a [nullable reference type](https://docs.microsoft.com/en-us/dotnet/csharp/nullable-references) indicated by a `?` after the typename, whenever there is an unhandled condition that could result in a null value. Or _automatically_ create a `NullObject` (see: [NullObject pattern](https://youtu.be/OMPfEXIlTVE?t=904)) of the function's declared return type. Maybe even better: [let every type declare and handle their own empty state](https://twitter.com/magnemg/status/1417517013321273345?s=20). If all types are [defined in terms of Monoids](https://twitter.com/magnemg/status/1429914312211054602?s=20), then **_null_ could be replaced by the identity value (of each Monoid)**, so that combinations within that type never fail, and never alter the result. NB: would make it hard to express something which was supposed to be there but which is missing, like a missing point on a graph curve, instead of plotting a definite 0. So would need careful consideration to choose this approach. But in all: “Non-nullability is the sort of thing you want baked into a type system from day one, not something you want to retrofit 12 years later” -- [Eric Lippert](https://web.archive.org/web/20161022020746/http://blog.coverity.com/2013/11/20/c-non-nullable-reference-types/#.WArKAMHP0ak) of C#.
  - Function indepencence: When a function [becomes](https://blog.jonstodle.com/in-which-i-claim-rich-hickey-is-wrong/) [more capable](https://medium.com/@thejameskyle/type-systems-covariance-contravariance-bivariance-and-invariance-explained-35f43d1110f8) (by widening its allowed input, e.g. `string` to `Option<string>`, or tightening its returned result, e.g. `Option<string>` to `string`) it shouldn't [break callers](https://www.reddit.com/r/haskell/comments/a1ofh2/maybe_not_rich_hickey/eawpz30/) (which then could result in cascading refactors, cf.: [what color is your function?](https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/)). A way to solve this would be if the language could automatically perform casting of such arguments/results, and have a type system that could account for that. Inspired by Flow, and counter-inspired by TS. Furthermore, the return type from functions using I/O (like `IOMonad` in Haskell), should always be augmented/inferred from static analysis.
 - *Variant Types* for error-handling using return values (like `Result<Type, Error>`, inspired by Rust), instead of special syntax. [Counter-inspired by Golang](https://qr.ae/pGPMUk).
 - So that [you have less avenues to explore when debugging](https://overreacted.io/the-bug-o-notation/) and [fewer branches to check when programming](https://lispcast.com/why-are-corner-cases-the-devil-%f0%9f%98%88/), so you can write [Confident Code](https://www.youtube.com/watch?v=T8J0j2xJFgQ) focused on the happy-path.
  - No possibility of failing silently during runtime (due to syntax errors). Counter-inspired by JS.

* Compilation should be able to target some popular language & ecosystem, like **transpile to JavaScript or [compile to WASM](https://dev.to/taybenlor/web-assembly-should-be-a-default-binary-target-44m6)**, or potentially even the JVM, to get cross-platform interoperability. But not any target for any cost, if it would put unwieldy constraints on the language design. WASM seems like the best candidate.
  - Transpilation to another language should output human-readable code. So that it can be used for debugging. Counter-inspired by ClojureScript. Inspired by ReScript. The transpiled output code should also be able to be mapped/transpiled back to the original language, ideally by simple visual inspection, alternatively by tooling. So that communication with community members of the target language (e.g. JavaScript) is made easier, and debugging help in the target language can be applied back to the code in the original language.
  - [Escape hatches](https://youtu.be/EnPodoPzimE?t=612): The language should have escape hatches that facilitate integration with other ecosystems, to aid in rapid adoption. This could compromise the strictness and guarantees of the language, but it should be possible for those who want to take on that risk/burden. (The language runtime should give proper warnings about loss of safety guarantees, in case someone unwittingly uses third party dependencies that cause it). For them, the language's guarantees will only be as reliable as the guarantees of the older languages  the language interoperates with (see 'Bindings for types' below, and also later 'Typed Holes'). Escape hatches enable "making the easy jobs easy without making the hard jobs impossible", as Larry Wall of Perl [said](https://qr.ae/pGQB5i). **In general, the language philosophy should lean towards uniformity and consistency with a small cohesive vocabulary.** For those (10% of) tasks that potentially doesn't fit well within the constraints of the language, we ideally don't want to bolt on features and impurities to the language (making it more powerful at the expense of making the language more complex, harder to learn, more footguns, less uniform/consistent). Counter-inspired by Rust. Ideally, such features should be afforded by good interop with third-party libraries written in more suitable languages.
  - Library compatibility tool. So you can input a list of your stack of libraries, and it will tell if and where they are incompatible. Counter-inspired by [JS Fatigue](https://medium.com/@ericclemmons/javascript-fatigue-48d4011b6fc4#.prcj59904).
  - Bindings for types. There should be either official bindings towards the most popular libraries/frameworks in other languages. But even better, it should be some way to automatically generate bindings. Or even better, for interop with each langauge: an official adapter that automatically translates all primitive types to default safe types in the language (for simpler transparent use).

* Small standard library. To have some common ground of consolidation, and to provide the basic and most common utils. So usage will be fairly standard, and coming into a new codebase not feel too foreign. But [not too big standard library](https://mkdev.me/en/posts/how-to-choose-a-programming-language), since it would be connected to language updates, which are slower, and community competition is better for adaptability over the long run.
  - The minimal standard library should be designed and decided by one leader with good insight into what users need, and a strong appreciation for consistency. To avoid endless bikeshedding. This is the only place where the language should have a benevolent leader for a limited time.
  - **Community grown** / off-hands-leadership: No [BDFL](https://en.wikipedia.org/wiki/Benevolent_dictator_for_life), since it impedes evolution & diversity. _"When a langauge accepts bottom-up adaptations (from the users) it will handle new topics and new problems more efficiently than when it need to wait for top-down approval of such adaptations."_ (from [Will ugly languages always bury pretty ones?](https://statmodeling.stat.columbia.edu/2007/09/27/i_was_correspon/)). The language designer should more be an arbitrator in discussions the community can lean on regarding what should be the default convention. The designer(s) and stewards of the language should also be nice (so the community will be welcoming and thus flourish). Inspired by Ruby's ["Matz is nice, so we are nice"](https://learn.co/lessons/matz-readme). Even though none of this is strictly a language "feature", it is nonetheless of _major_ impact to a language and its development, so it deserves a mention. Furthermore, that **all people should have actual ownership of the development of the language**, is vital for contributions and growth. The language might not grow exactly where the designer intends, but a centralizing authority (like a BDFL) may [just as well](https://lispcast.com/cognitect-clojure/) be [stifling growth](https://lukeplant.me.uk/blog/posts/why-im-leaving-elm/#leadership-style) (and [causing pain](https://www.reddit.com/r/elm/comments/81bo14/do_we_need_to_move_away_from_elm/)), as it purports to lead it. Counter-inspired by Elm. Yes, wild growth might lead to some weeds (bad dialects/libraries), but leadership through conventions and good defaults could alleviate potential analysis paralysis and decision fatigue experienced by language users. Counter-inspired by [JS fatigue](https://auth0.com/blog/how-to-manage-javascript-fatigue/). Ultimately, the power and impetus should reside with [The Man in The Arena](https://www.goodreads.com/quotes/7-it-is-not-the-critic-who-counts-not-the-man), and that man/woman should always be able to be you. **The language standard / mainstream should upstream/incorporate changes** found to be popular in the wild (amongst all the various dialects/customizations), and at the same time ensure they are incorporated well (coherently and consistently). This is opposed to initial/top-down design by committee, which often lacks vision and coherence, and pragmatic connection with the real world.
    - Free experimentation on branches that can be upstreamed: It is hard to predict the effect of novel language features, especially before they've been tried in the wild for some time. Languages evolving by centralized committee tend to evolve slowly, as for each new feature they have to come to a consensus, and predict and test its use. Whereas in extensible languages anyone in the community may modify it without permission, and test it on their own. This is much faster, and dialects can be tried in parallel. Then they could be upstreamed back into to the mainstream language dialect. This could be a sweet-spot.
    - How could the language be **very constrained** while at the same time be **community grown**?  The language core should be very constrained around composition of a few core primitives (self-hosting), but it could be modified or built upon by others. So that it could evolve in multiple avenues of exploration, and gain from the competition. Where it would be up to the community to decide whether they want to use the constrained version(s) (suitable for large scale complex environments), which I prefer, or the bring-your-own syntax version(s) (suitable for small scale playful experimentation and research) which would inevitably appear. Inspirations here would be Lisp, Clojure and Racket.

What would be important is to facilitate simple language _merging_, due to all the divergence that would appear. Inspired by Git. So the community could easily find back together after a split (if their ideas and goals come back in alignment, and they have converged to an agrement on the features again). 

* Single package directory: Some sort of singular reference to a library package information service. So the community can organise around one common point, instead of scattering. Inspired by NPM. But doesn't necessarily need to be centralised package download/storage, the storage/download could be decentralised. But would need to be safe. Cert signing?

* Runtime environment: Be able to run on some existing popular cross-platform runtime (like WASM, or maybe the JVM?). Inspired by Clojure. And/Or have a very minimal programming language runtime (without a GC). Inspired by Rust. But the runtime should in any case handle the scheduling of goroutines, inspired by Golang.

* **Ecosystem: Interoperable** with one or more existing programming language ecosystems. To import or reuse libraries. Without too much ceremony. So the ecosystem doesn't have to start from scratch. Counter-inspired by [Elm](https://guide.elm-lang.org/interop/limits.html). _Smooth interoperability with existing ecosystems and other systems, minimising glue code, is one of the largest underestimated features of a language, in terms of enabling its success_. Inspired by [C](https://www.scattered-thoughts.net/writing/against-sql/#non-porous). While a fully integrated system [can be very nice](https://youtu.be/nSrucNcwlA8?t=1114), it inevitably risks being disrupted by a thousand small cuts (i.e. are made irrelevant to a project because other tools/services outperform them on one or two critical features, or needs interop). Counter-inspired by Ruby on Rails, [Lambdera](https://youtu.be/nSrucNcwlA8?t=1114), [Elm](https://gist.github.com/Rich-Harris/0f910048478c2a6505d1c32185b61934) and [Dart](https://youtu.be/dFHj1d9FG8M?t=911). The world is heterogenous, and no single system yet has been able to solve all relevant problems for all people. Many have tried to [own the world](https://gist.github.com/Rich-Harris/0f910048478c2a6505d1c32185b61934), like Smalltalk, Imba, Darklang, etc., but this can be an impediment to mass adoption. A language as a small focused tool which lives well in a heterogenous environment is the way to go.
  - C ABI: Compatible with the [C language Application Binary Interface (ABI)](https://youtu.be/Gv2I7qTux7g?t=175). So code in the language is usable from other languages. Inspired by Zig. Since compiling to WASM is desirable, [WASM's C ABI](https://github.com/WebAssembly/tool-conventions/blob/main/BasicCABI.md) could probably be used, instead of a separate implementation towards the C ABI.
  - "[WebAssembly](https://webassembly.org/) [WASM] describes a memory-safe, sandboxed execution environment" where [WASM's security guarantees](https://webassembly.org/docs/security/) eliminates "dangerous features from its execution semantics, while maintaining compatibility with programs written for C/C++." NB: But WASM's restrictions _might_ conflict with runtime dynamism and the desired live REPL feature (inspired by Lisp/Clojure)...? "Since compiled code is immutable and not observable at runtime, WebAssembly programs are protected from control flow hijacking [code injection] attacks."

* Editor integration: Should afford simple integration into editors/IDEs like VS Code. Typically via the Language Server Protocol ([LSP](https://microsoft.github.io/language-server-protocol/)). Inspired by [Rust](https://youtu.be/A3AdN7U24iU?t=3102). Syntax highlighting, a [language server](https://code.visualstudio.com/api/language-extensions/language-server-extension-guide) (for autocomplete, error-checking (diagnostics), jump-to-definition etc.), via the [Language Server Protocol (LSP)](https://microsoft.github.io/language-server-protocol/).
  - Interactive: facilitates an IDE-plugin (VS Code) that shows the contents of data structures while coding. Enable REPL'ing into a live system. Inspired by Clojure. But with some security, so that a rouge/unwitting programmer can't destroy the system / state. Counter-inspired by [Smalltalk](https://wiki.c2.com/?WhyIsSmalltalkDead). Some form of Hot Reload / Hot Upgrades at runtime, even though the language is statically typed. Perhaps by requiring that the swapped in functions must take in and return the same types as the previous version (i.e. enforced interface). Inspired by [Facebook's usage of Haskell](https://elixirforum.com/t/hot-reloading-and-static-types/18962). NB: Might conflict with compiling to WASM, since WASM gives a restricted environment. See section on WASM environment.
  - "Comments should be separate from code, joined at IDE or joined via manual tooling. This would allow comments to span multiple lines/function and files. IDE could also alert when breaking changes are made. Pairs well with the Content-addressable code wish." Inspired by [supermancho @ HN](https://news.ycombinator.com/user?id=Supermancho). You could also show/hide comments, and click on a particular piece of code or variable to see the comments for that. Without having to visually map references on a comment line to the actual variable, which is also prone to documentation drifting out of sync with the code it is documenting. With comments tied to content-addressable code, then when deleting/updating the code you also delete/update the comment. Renamings would be transparent and automatic, but when the code changes structurally the IDE could warn that the corresponding comment/doc needs to be updated.
  - The expansion of function definitions inline, on demand. "Take the definition, splice it into the call site, rename local variables to match the caller", as [JonChesterfield @ HN](https://news.ycombinator.com/user?id=JonChesterfield) said. So you don't have to jump around different files, which may get you to lose your state of programming flow. Content/code should even be editable then and there, and simply stored back to the files where they reside. Inspired by [supermancho @ HN](https://news.ycombinator.com/item?id=29730594) Lisp IDE's, and TailwindCSS. Content/code (and navigating it) should be free'd from file boundaries (see also: content-addressable code). Inspired by Git.

* Well-documented. Documentation on language syntax should be accessible from the editor/IDE, via. the LSP.
  - [Docs should be versioned](https://youtu.be/dFHj1d9FG8M?t=715), so that docs for old versions never disappear, either from the web or from the IDE integration. Inspired by ReScript, and counter-inspired by Emotion (CSS-in-JS).

* No `@decorators`. Counter-inspired by Angular and NestJS. Decorators feel like “magic” that make the runtime control-flow unobvious. I don’t like macro-expansions, either. **I don’t want to talk to / instruct the compiler. I want the compiler to understand how I write my program. Even if that limits the ways in which I can write my program.** Rather than allowing a wide range of styles, and then having to decorate certain styles ad-hoc, to disambiguate them. I don’t like the aesthetics of decorators either.

* Well-tested.

* Open-source, team: Developed as open-source from the start, of course. By more than 1 hero programmer (see: [bus factor](https://en.wikipedia.org/wiki/Bus_factor)). Preferably 4-5 people working in tandem.
  - [Big decisions via public RFC's](https://youtu.be/A3AdN7U24iU?t=2500) (Request For Comments).

* (For future reference/reading: Some more lists of potentially important features, by: [Animats](https://news.ycombinator.com/item?id=29731425), [ModernMech](https://news.ycombinator.com/item?id=30489515), [Don Syme of F#](https://youtu.be/1AZA1zoP-II?t=2722), [Bagel's niceties](https://www.brandons.me/blog/the-bagel-language#misc-niceties), others?)

* All the while, the language should avoid the [fate of the Vasa](https://www.youtube.com/watch?v=ltCgzYcpFUI).😂 Which means a feature creep resistant _core language_. (I am aware the irony of this feature list, but read on...) So the feature set should be designed and decided upon as early as possible (when the degrees of freedom in the design space is as wide as possible), with a holistic view. Boring > clever. Designed to reach a 80% [sweet spot of most important features](https://youtu.be/ltCgzYcpFUI?t=2244), [foregoing the most exotic and esoteric features](https://www.progsbase.com/featuredpost/language-features-vs-usefulness-and-understandability/), and foregoing the ability to solve edge-cases (such should be relegated to interoperability with other more specialized programming languages). Since 80% of the work and complexity would come from the last 20% ([The Pareto Principle](https://www.investopedia.com/terms/1/80-20-rule.asp)). This might include foregoing some of the more esoteric or novel features (see the summary for those).

## Goal: Reduce complexity for app developers, by abstraction and wise platform defaults.

This ties back to the principle that:

* A language determines **WHAT** you can & have to think about, but also **HOW** you have to think about it.

And the desired features that the language should be:

* Designed for fast onboarding of complete beginners (as opposed to catering to a specific language community who already have the [curse of expertise](https://en.wikipedia.org/wiki/Curse_of_knowledge)).

* Very high level. Abstract as much of the details as possible. Abstraction means to "draw away" the concrete nature of things, so that their commonalities remain.

* Have a small [Meta-Language](https://youtu.be/18F5v1diO_A?t=204). For onboarding with low overhead. Counter-inspired by [BuckleScript](https://rescript-lang.org/blog/bucklescript-is-rebranding#community-situation).

* Simple, with a well thought out vocabulary. Inspired by Clojure (except `cons` and `conj`, which are too similar-looking).

* [Serializable](https://en.wikipedia.org/wiki/Serialization): A program (with its functions!) should itself be able to easily be turned into a format that can be stored (to file, memory, buffer, DB) and transmitted over a network (to potentially be reconstructed or analyzed later), and then potentially run/re-run. Should support serializing the state of its data structures, as well. Even if they contain functions. Counter-inspired by [JS](https://github.com/tannerlinsley/react-query/discussions/988#discussioncomment-2348946). Inspired by Clojure (see section: ‘Interactive’, on hot updates).

Most languages presume the app developer will deal with a lot of relatively low level concerns, to get pretty obvious benefits we _should_ be able to take for granted (e.g. concurrency and parallelism). The sentiment ["I don't know, I don't wanna know"](https://youtu.be/LKtk3HCgTa8?t=3017), as Rich Hickey put it, applies to this. However, it does not mean hostility towards learning, but a certain amount of healthy scepticism: if you have to document something to a large degree, have you really simplified it enough? (see: [meta-language](https://youtu.be/18F5v1diO_A?t=204)) _"Everything should be made as simple as possible, but not simpler."_, accordig to [Occam, Sessions, and Einstein](https://quoteinvestigator.com/2011/05/13/einstein-simple/). [Too much documentation](https://rescript-lang.org/blog/bucklescript-is-rebranding#community-situation) (i.e. meta-language) is a code smell, since code should be self-documenting. A language's complexity consist of it's syntax and semantics, but also its [meta-language](https://youtu.be/18F5v1diO_A?t=204) (which should be minimised). A language should not burden the speaker/thinker with unnecessary complexity, as that cognitive effort is better spent on the task at hand: the domain is often complex enough in itself! We [shouldn't invent problems to solve](https://news.ycombinator.com/item?id=17905267), even if the solutions could be beautiful.

Here is the start of a non-exhaustive list of what the application developer should have to be concerned with, i.e. what the language should afford as syntax and semantics when I'm coding (which does not exclude how the language libraries/runtime implements it under-the-hood):

|What I want to think about:|I [don't want to know](https://youtu.be/LKtk3HCgTa8?t=3017) or think about:|
|:-----|:-----|
|Splitting up the problem/data into [separate pieces](https://en.wikipedia.org/wiki/Data_parallelism#Data_parallelism_vs._task_parallelism).| Concurrency vs. Parallelism, goroutines, threads, Fibers, Actors, Channels, processes, CPU cores, Microservices, Distributed system topology, Mutexes, Locking, ...|
|Function composition.|Monads, Monoids, Class structure, Contextual  precoditions, Inheritance rules, Type / Category Theory, ...|
|Choosing appropriate algorithms and data structures.|Immutability, Mutable vs. immutable references, Pointers, State management, Data-flow architecture, Complex types, type inference/conversion, ...|
|Expressing what should go together, co-location of code.|Pointers, Memory management, Stack vs. Heap allocation, Fundamental security measures, Sandboxing, Scopes, Closures, ...|
|How to organize code to communicate the ideas better to the reader, how to conform to conventions.|Performance, [Syntax/keywords](https://youtu.be/1AZA1zoP-II?t=2722), [Esoteric operators](https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/symbol-and-operator-reference/), ...|
|WHAT should be done, and to a limited extent also HOW it should be done|WHEN it should be done (sync vs. async, eager vs. lazy). WHERE it should be done (runtime environment-concerns, but also if the work should be done on another CPU-core or another machine) ...|
|The User Experience (UX) and the actual problem domain!|Anything that detracts my thoughts from the UX and the actual problem domain. (everything above in this column)|
|...|...|

**You should simply be able to describe to the machine what the problem looks like, how it could be divided up, and how (the algorithm) to solve it.** Then the machine (i.e. language runtime)  should decide *when* and *where* it wants to solve it (based on it's hardware/environmental constraints): whether it means to single- or multi-thread parts of the work, or, in case the local resources are/become strained, if it should distribute the work over multiple machines (depending on the measured latency of their inter-network connection). So the language should have an **adaptive runtime**, but in lieu of that, it should at least have a platform-configurable compiler, that could make some generally and universally applied decisions based on configuration of specific platform constraints. 

I want a _capable_ tool, so I can write _lean_ programs. Lean, as in: not loaded with what _ought to be_ low-level concerns. Actually, I'd prefer the language to afford a set of powerful primitives, and the capabilities (i.e. more powerful abstractions) could just as well be in libraries  than embedded in the language runtime/platform. As long as I don't have to seek out and configure all of those myself (re: [JS Fatigue](https://medium.com/@ericclemmons/javascript-fatigue-48d4011b6fc4#.prcj59904)), but could import a curated set of sane conventional defaults.

## The End

One or more of these requirements might be conflicting / mutually exclusive. Maybe. But maybe not?

One can always dream.

This is a list of my preferences. Some would probably be quite controversial. Like my aversion to certain features which a lot of other people like (e.g. meta-programming). I might just not be familiar enough with them to have developed an appreciation for them.

I will try to keep this list updated if and when I change my mind on any point, which I am open to doing. I have already changed my mind from negative to positive on generics and pattern-matching.

**What features would your dream programming language have (or don't have)?**