# 2024-07-01 22:06:23

Classification by syntax

- ASM
- Braces -- C, Rust, Go, Zig, ...
 Unless you're into Lisps, MLs, or indents, your favorite
- programming language probably falls into this category.
- Indent-based
 - Python, Nim, Lisp + ParInfer / Wisp, CoffeeScript,
   Moon/Yuescript
- do/end -- Lua, Julia, VB, Ruby, Erlang(?), Vim9Script
- Lisps
 - Lambdatalk -- Lisp but braces?
- ML
 - Dhall (configuration)
- Prolog, etc
- Stack-based -- Forth, Cognate
- Rebol, Red
- Shell
 - That is, everything's a command call, unquoted strings,
   argument splitting, etc.
- Shell + C-like braces -- Awk, Nu, Perl
- Shell + do/end -- fish
- ML-like but also Lisp-like...? Bruijin

There are all kinds of syntax in these too realms so I'll group
them together by their use instead.
- Markup langauges
 - The ones we all know about
 - Manpage/typesetting
 - Honourable mention:
   - https://sr.ht/~vlmutolo/sona/
- "configuration"/key-value pairs -- Yaml, JSON, TOML, CSS, SCFG
- Templating

* On its own:
 - Nix -- Might classify syntax under ML, but oh well.
 - SQL
 - GraphQL -- technically it is similar to Rebol
 - jq?
 - Mathematica?
 - Visual blocks -- Scratch & clones

- Natural language
 - Shakespearean
 - Inform7
 - Plain english
   https://osmosianplainenglishprogramming.blog/
 - Joke languages such as Gen-Z's, News headlines,
   Aussie slangs, Shakespearean, Taxi
- Esoteric languages, Notably:
 - Piet (graphical)
- Golfing languages (single-character functions)

I also attempted to make YAML turing complete today, with no
implementation of the AST evaluator whatsoever.

Began to make an online playground (with Elm) for Cognate, and
tree-sitter-cognate.

Cognate: https://cognate-lang.github.io/learn.html

(Most notably, words starting with lowercase letters are treated
as inline comments.)

# 2024-07-02 15:08:14

Other ways of classification as a form of spotlight for certain
languages:

* Type system
- ML's
- https://git.sr.ht/~scarey/blithe/tree/master/item/examples/types.bl

* Non-english
- DreamBerd String interpolation
- https://rhumb-lang.org/docs/tutorial-syntax/true-false/

* Data structures
- Stack-based
- Array programming
- ...uh https://github.com/akalenuk/the_namingless_programming_language


Now about that cognate playground, today I realized I must ditch
Elm and just opt for vanilla JS because JS-interop in Elm is both
necessary (as WASM + Treesitter is used) and a pain. I made a
crude (yet working, apparently) prototype that's a single
index.html file plus some tree-sitter assets (JS and WASM). It
can currently run things like this:

  Print "Hello, World!" to output;
  Let my variable A be "var-a";
  Let another variable named B be uninitialized;
  ~~ Line comment
  Print A B 1 2 and finally a "3";

Which outputs:

  Hello, World!
  var-a [undefined B] 1 2 3

It walks the AST produced by tree-sitter-cognate, transpiles to
JavaScript, then runs the code as a module, finally extracting
the output.

For now, it is at:
https://github.com/hedyhli/cognate-playground/tree/main/test