Zen of Language Design - LeFreq/Singularity GitHub Wiki

In the end, python may not be good enough for our perfected operating system. The syntax is a little noisy and juvenile (don't get me wrong; python is great, but we're aiming for perfection), like using english words instead of tokens.

First of all, distinguish between engineering and architecture. Engineering focuses on hardware parsimony, while architecture focuses on constructs or structures for conceptualizing the problem. Both come together to make the perfect language.

Next, compare to human language. You don't need to invent a new language because you learned new things and want to express new things. However, sometimes you need precision for engineering things down at the root level. In English this is math or predicate calculus. But this is too much work for general communications, where we share enough knowledge to communicate with higher-level ideas. In computers, the CPU instruction set forms the basis of this low-level communications.

Consider the issue about an architecture's prime language: that there is every one perfect language to which all languages "experiments" will yearn or converge on a given architecture, absent a few cosmetic differences.

Then, know that keywords are to stand for these architectural tools, while symbols should be used for the engineering hardware. This is to match the aesthetic of the true nerd: concise and precise. A distinct type is an architectural tool at the user level, although an engineering element, so these need special-cased (as perhaps all boundary cases), like having their own keyword ("type" in C). So what keywords have been misused in languages?

  • if: should you use words for this? No, use ternary symbols for if/then/else and switch/case for larger groups beyond ~2.
  • maybe arbitrary higher-level groupings keyword "group", capable of taking 1-4 parameters: function, module, package, application. These should be anonymized and have constructs for adding arbitrary levels of grouping code. But, you don't group these for execution order, you do it for conceptual and architectural order.
So besides assignment, basic math operators, looping construct, and a conditional, which gives us any computable function (Turing machine, or about FORTRAN level), we can go further and make a universal Turing machine by adding named functions (getting us to something like C). After this is encapsulation (OOP and Python or C++) and then peer-to-peer based, message-passing models (Prime and PositionOS). Pass this, no one's imagined, but the visualization will allow rapid experimentation and navigating the search space for interesting new directions quickly.

XXSo, taking a cue from the Forth programming language, we're going to start with the simplest programming language possible and add our more advanced constructs (like named routines) on top of it.

definition:

  routine1
  routine2
  success/fail

washer:

  wash,
  spin,
  rinse,
  spin.

The purpose of the computer language is to put the chatoic motions of getting things done for humans in a structured format that can be iunderstood, modified, and managed by others. Those motions take the form of a graph, thile the structure of comptuer programs is to transform that complexity into a tree, and executable as a list (or sequentially) — prunable, observable for enjoyment of others, growable towards newer and higher aims

A good computer program is like a good seedf: compact information that has distilled the complexity of the organism into a portable, transporrtable, whole.

Containers, 133 000

NEWPROCEDURE(para1, para2):

   WHILE((n=0, i=1)  (n<100 i>10)  n++) ITEM1(para1)?  
    ITEM2(para2)?  

SUCCESS / FAILURE.

CONDITION? >>“true” / >>“false”

 >> “output string to console”

<< node.personalname(“interned string to store data past reboots”)

ITEM1:

cake:

  a1,
  a2 
  b1,
  b2,
  b3.

so items in a r NOTE: concurrent items may be better treated as sequential rather than be blocked by the random processes of other scheduling.

ordered vs. dont-care-ordering for syntax: uses commas for ordered and spaces for don’t-care-ordering?

Strings of items separated by only symbols are called expressions. NO: If those items have spaces around them, they are considered idempotent and commands. 100 means print “words” 100 times.XXX

A supervisor (control from above) must manage all concurrent processing. It cannot happen well from below, without forming unexpected blocks and arbitrarily-long delays.

A numeric literal surrounded by spaces (like 42) is considered a repeat, so that 100 DOHICKEY repeats DOHICKEY 100 times. A character (word-sized) is considered a special considered as a condition check or part of a string A string literal is considered an output respnose (no print function necessary) (what about expressions)

ITEM1 without the parameters and without a colon, runs the item. With parameter ITEM with parameters, creates the item?

to run an object is as simple as typing the NAME and hitting return. just like a complete sentence an object should have both VERBS and NOUNS. Commands are reserved for the interpreter environmentl.


I'm putting this here until I remember where else I put these maxims.
  • If a function has more than 4 parameters, you're doing it wrong. Unless you making a compiler. In which case, the number is 5.
  • If your code is using double indirects, fine. But if you're doing triple indirects, you're breaking the system and your idea of the problem is wrong.
  • If your code isn't using sound architecture, you'll be using up to 2n-1/100 more code than necessary. Learn about the GOOP.
  • If your code exists in isolation, you've lost your chance at immortality. Join the PositionOS project (aka Singularity) and be saved.
  • Singularity will teach you how to build the tree. You are responsible for making the leaves of the tree.
  • Your language should use keywords and names only for architectural structure (including variable names on the latter, but of course: functions, objects, modules, files). The ambiguity of looping shows that it is possibly the wrong architecture. This also means most containers, like functions, should have a name, describing it`s purpose.
⚠️ **GitHub.com Fallback** ⚠️