Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add src for random writings and UrT demos
- Loading branch information
Showing
12 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+505 KB
_src/urt-demos/2014-06-15_15-51-44_UTC7_-_PROURTPLAYER_-_TURNPIKE.dm_68
Binary file not shown.
Binary file added
BIN
+333 KB
_src/urt-demos/2014-06-18_16-45-16_UTC7_-_CCCCCCCCCCC_-_TURNPIKE.dm_68
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+134 KB
_src/urt-demos/2014-06-25_02-32-01_UTC7_-_DK_MARNIUCH_-_TURNPIKE.dm_68
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
--- | ||
layout: page | ||
title: Random Thoughts on My Wannahave System | ||
tags: [random, system] | ||
permalink: /writing/ideal-system/ | ||
last_updated: Wed, 05 Oct 2016 12:51:01 +0300 | ||
--- | ||
|
||
* Shell: Racket | ||
|
||
- Smart autocompletion: | ||
* Automatically trigger in-place, e.g. when there being at argument that | ||
takes file path, a popup automagically appears for users to choose the file path | ||
* Searchable | ||
|
||
- Pipelines. | ||
|
||
- Human-readable command names and syntax. | ||
|
||
- Arguments are either *subcommands* or *modifiers*. *Subcommands* and | ||
*modifiers* may take further arguments. | ||
|
||
Main arguments go first. Optional modifiers take keyword forms: | ||
|
||
Some commands in Racket style: | ||
|
||
```racket | ||
(list-dirs "./") | ||
(list-dirs "./" #:n-columns 1) | ||
(list-dirs "./" #:colorize #t) | ||
(copy {/tmp/file-a.rkt} {/tmp/file-b.rkt} {/tmp/new/}) | ||
(copy {/tmp/new} {/tmp/new.backup} #:mode 'backup) ; Recursively, keep permission, ... | ||
(copy (glob "/tmp/*") "/mnt/backup/tmp" #:recursive #t) | ||
``` | ||
|
||
Outer-most brackets maybe ignored. | ||
|
||
And how its settings look like: | ||
|
||
```racket | ||
(colorize-list-dirs #t) | ||
(colorize-everything #t) | ||
(alias 'copy (copy #:recursive #t)) | ||
``` | ||
|
||
Note the use of `{}` for raw string. | ||
|
||
--> Clear and human-readable, could be understood fairly easily. Be | ||
visually pleased is much more important than being stupidly short | ||
|
||
- Smart job management with task killer and all. | ||
|
||
* Main programming languages: | ||
- Compiled: Golang. | ||
- Interpreted: Racket and TypeScript | ||
|
||
* Inter-program communication: | ||
|
||
- There is a server that collects and dispatches messages: | ||
* Like DBus or Plan 9's plumber. | ||
|
||
- Each program implements the same IPC protocol. TODO: make a graphics. | ||
|
||
- Server types: Named pipe, or HTTP (lightweight?), or Unix domain socket? | ||
* Unix domain socket is better (more flexible) than named pipe? | ||
http://stackoverflow.com/questions/9475442/unix-domain-socket-vs-named-pipes | ||
- You can use them for more than two processes communicating (eg. a | ||
server process with potentially multiple client processes connecting); | ||
- They are bidirectional; | ||
- They support passing kernel-verified UID / GID credentials between processes; | ||
- They support passing file descriptors between processes; They support | ||
packet and sequenced packet modes. | ||
* Explanation of Unix domain socket and named pipe: | ||
http://unix.stackexchange.com/questions/75904/are-fifo-pipe-unix-domain-socket-the-same-thing-in-linux-kernel | ||
|
||
- Protocol: RESTful? | ||
|
||
- Message format: JSON or BSON or YAML? | ||
* JSON doesn't support binary data by default. | ||
* YAML has [anchor](http://www.yaml.org/spec/1.2/spec.html#id2765878), | ||
particular useful to define reletional structure: | ||
- Do I really need it? | ||
* YAML is a superset of JSON --> No reason to not use YAML if JSON is good | ||
* YAML supports binary data with base64 | ||
- A bit of overhead, but seem fine since it's mostly small and offline though | ||
|
||
* GUI programming: | ||
- Scriptable. | ||
- Declarative style. | ||
- GUI server allows all languages to construct widgets. |