├── .babelrc ├── .gitattributes ├── .gitignore ├── CHANGELOG.md ├── CONTRIBUTING.md ├── GOAL.md ├── LICENSE ├── README.md ├── Screenshots ├── Screenshot.png ├── Screenshot2.png ├── Screenshot3.png └── Screenshot4.png ├── TODO.md ├── latest ├── 06b79b8f8677e6333512a61ec7caa63f.eot ├── 1.51c25ac0adacae5e02ff.worker.js ├── 137778879005023b427be30df1f57d83.ttf ├── 1a77fe6d9f399212fcfcfde790ce66b2.ttf ├── 4.js ├── 4cfc570109e603356ee7586978c46852.eot ├── 5.js ├── 51c25ac0adacae5e02ff.worker.js ├── 5c4876bef50a7df9d8ac48af75ecf11c.woff2 ├── 5c6aa3e267f5554fd7cf15557b7e44aa.eot ├── 6.js ├── 7c8fa37007189c6e9a50125e5ca64cff.eot ├── 8027cf95961ca238debdd2352284e532.woff ├── 8c574ce84d5db50582b71f028e3c08b4.woff2 ├── 9e710fd112b1d07cf5277175c2dec679.woff ├── aba400cf60d151ff7b3da7c862cbde2d.woff ├── af2692f72b79d5935fe511236e05dbc8.woff ├── app.js ├── b339297726b01d858501.worker.js ├── bfec314a4943882a8e81f066004b74f3.woff2 ├── e0fea666fb73e683da8982050f509f81.woff2 ├── e613bf534959b8c52533e77ea0cee44e.ttf ├── ea734aec73e961c5814b1b403c9b90c6.ttf ├── editor.worker.js ├── hotReload.js ├── icons-24a6ef8280df161e3d389800fa2107ae │ ├── .cache │ ├── android-chrome-144x144.png │ ├── android-chrome-192x192.png │ ├── android-chrome-256x256.png │ ├── android-chrome-36x36.png │ ├── android-chrome-384x384.png │ ├── android-chrome-48x48.png │ ├── android-chrome-512x512.png │ ├── android-chrome-72x72.png │ ├── android-chrome-96x96.png │ ├── apple-touch-icon-114x114.png │ ├── apple-touch-icon-120x120.png │ ├── apple-touch-icon-144x144.png │ ├── apple-touch-icon-152x152.png │ ├── apple-touch-icon-167x167.png │ ├── apple-touch-icon-180x180.png │ ├── apple-touch-icon-57x57.png │ ├── apple-touch-icon-60x60.png │ ├── apple-touch-icon-72x72.png │ ├── apple-touch-icon-76x76.png │ ├── apple-touch-icon-precomposed.png │ ├── apple-touch-icon.png │ ├── apple-touch-startup-image-1182x2208.png │ ├── apple-touch-startup-image-1242x2148.png │ ├── apple-touch-startup-image-1496x2048.png │ ├── apple-touch-startup-image-1536x2008.png │ ├── apple-touch-startup-image-320x460.png │ ├── apple-touch-startup-image-640x1096.png │ ├── apple-touch-startup-image-640x920.png │ ├── apple-touch-startup-image-748x1024.png │ ├── apple-touch-startup-image-750x1294.png │ ├── apple-touch-startup-image-768x1004.png │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── favicon.ico │ ├── firefox_app_128x128.png │ ├── firefox_app_512x512.png │ ├── firefox_app_60x60.png │ ├── manifest.json │ └── manifest.webapp ├── index.html └── json.worker.js ├── package.json ├── quote.png ├── src ├── __tests__ │ └── 0-tensor_literals │ │ └── index.js ├── components │ ├── Board │ │ ├── Code │ │ │ ├── index.js │ │ │ └── style.sass │ │ ├── Error │ │ │ ├── index.js │ │ │ └── style.sass │ │ ├── Function │ │ │ ├── index.js │ │ │ └── style.sass │ │ ├── Markdown │ │ │ ├── index.js │ │ │ └── style.sass │ │ ├── Object │ │ │ ├── index.js │ │ │ └── style.sass │ │ ├── ObjectProperty │ │ │ └── index.js │ │ ├── Observable │ │ │ ├── index.js │ │ │ └── style.sass │ │ ├── Promise │ │ │ ├── index.js │ │ │ └── style.sass │ │ ├── PropertyWrapper │ │ │ ├── index.js │ │ │ └── style.sass │ │ ├── Scalar │ │ │ ├── index.js │ │ │ └── style.sass │ │ ├── Tensor │ │ │ ├── CanvasTensor │ │ │ │ ├── index.js │ │ │ │ └── style.sass │ │ │ ├── Stats │ │ │ │ ├── index.js │ │ │ │ └── style.sass │ │ │ ├── SvgTensor │ │ │ │ ├── index.js │ │ │ │ └── style.sass │ │ │ ├── index.js │ │ │ └── style.sass │ │ ├── Unknown │ │ │ ├── index.js │ │ │ └── style.sass │ │ ├── index.js │ │ └── style.sass │ ├── Dataset │ │ ├── data │ │ │ ├── t10k-images-idx3-ubyte.bin │ │ │ └── t10k-labels-idx1-ubyte.bin │ │ └── index.js │ ├── Editor │ │ ├── index.js │ │ └── style.sass │ ├── Evaluator │ │ └── index.js │ ├── Interpreter │ │ ├── index.js │ │ ├── modules │ │ │ ├── ActivationFunctions │ │ │ │ └── index.js │ │ │ ├── Arithmetics │ │ │ │ ├── Clip │ │ │ │ │ ├── doc.md │ │ │ │ │ └── index.js │ │ │ │ └── index.js │ │ │ ├── Documentation │ │ │ │ ├── doc.md │ │ │ │ └── index.js │ │ │ ├── Generators │ │ │ │ ├── Eye │ │ │ │ │ ├── doc.md │ │ │ │ │ └── index.js │ │ │ │ ├── LinearSpace │ │ │ │ │ ├── doc.md │ │ │ │ │ └── index.js │ │ │ │ ├── Ones │ │ │ │ │ ├── doc.md │ │ │ │ │ └── index.js │ │ │ │ ├── Zeros │ │ │ │ │ ├── doc.md │ │ │ │ │ └── index.js │ │ │ │ └── index.js │ │ │ ├── Meta │ │ │ │ ├── Expand │ │ │ │ │ ├── doc.md │ │ │ │ │ └── index.js │ │ │ │ ├── Rank │ │ │ │ │ ├── doc.md │ │ │ │ │ └── index.js │ │ │ │ ├── Reshape │ │ │ │ │ ├── doc.md │ │ │ │ │ └── index.js │ │ │ │ ├── Reverse │ │ │ │ │ ├── doc.md │ │ │ │ │ └── index.js │ │ │ │ ├── Shape │ │ │ │ │ ├── doc.md │ │ │ │ │ └── index.js │ │ │ │ ├── Size │ │ │ │ │ ├── doc.md │ │ │ │ │ └── index.js │ │ │ │ ├── Transpose │ │ │ │ │ ├── doc.md │ │ │ │ │ └── index.js │ │ │ │ └── index.js │ │ │ ├── Mouse.js │ │ │ ├── Random │ │ │ │ ├── Normal │ │ │ │ │ ├── doc.md │ │ │ │ │ └── index.js │ │ │ │ ├── Uniform │ │ │ │ │ ├── doc.md │ │ │ │ │ └── index.js │ │ │ │ └── index.js │ │ │ ├── Reducers │ │ │ │ ├── Max │ │ │ │ │ ├── doc.md │ │ │ │ │ └── index.js │ │ │ │ ├── Mean │ │ │ │ │ ├── doc.md │ │ │ │ │ └── index.js │ │ │ │ ├── Min │ │ │ │ │ ├── doc.md │ │ │ │ │ └── index.js │ │ │ │ ├── Product │ │ │ │ │ ├── doc.md │ │ │ │ │ └── index.js │ │ │ │ ├── Sum │ │ │ │ │ ├── doc.md │ │ │ │ │ └── index.js │ │ │ │ └── index.js │ │ │ ├── TensorOperators │ │ │ │ └── index.js │ │ │ └── Trigonometry │ │ │ │ └── index.js │ │ ├── rootEnvironment.js │ │ └── symbols.js │ ├── Interpreter_OLD │ │ ├── index.js │ │ ├── operators.js │ │ ├── runtimeEnvironment.js │ │ ├── symbols.js │ │ └── utils.js │ ├── MonacoEditor │ │ └── index.js │ ├── Panel │ │ ├── index.js │ │ └── style.sass │ ├── Parser │ │ ├── grammar.ohm │ │ ├── index.js │ │ └── semantics.js │ ├── Spinner │ │ ├── index.js │ │ └── style.sass │ └── Studio │ │ ├── hello-world.l1 │ │ ├── index.js │ │ ├── style.sass │ │ └── test.worker.js ├── favicon.png ├── gallery │ ├── README.md │ ├── future │ │ ├── functional_object.l1 │ │ └── interactive_tensors.l1 │ └── old │ │ ├── 0_helloWorld.l1 │ │ ├── 10_simple_model.js │ │ ├── 13_edge_detection_pipeline.l1 │ │ ├── 14_edge_detection_compressed.l1 │ │ ├── 18_average_digit.l1 │ │ ├── 19_nth_order_gradient.l1 │ │ ├── 20_maxPool_translation.l1 │ │ ├── 22_polynomial_regression.l1 │ │ ├── 23_regress_tensor.l1 │ │ ├── 23_sine_exp.l1 │ │ ├── 24_RankDown.l1 │ │ ├── 24_cascade.l1 │ │ ├── 27_coffee.l1 │ │ ├── 5_tile_design.l1 │ │ ├── 6_random_test.l1 │ │ ├── 7_edge_detection.l1 │ │ └── 9_higher-order_fns.l1 ├── index.html ├── index.js └── test.js ├── webpack.config.js └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "development": { 4 | "presets": [ 5 | ["@babel/env", { 6 | "targets": { 7 | "browsers": [ 8 | ">1%", 9 | "not ie 11", 10 | "not op_mini all" 11 | ] 12 | }, 13 | "modules": false, 14 | "useBuiltIns": "entry" 15 | }], 16 | "@babel/react" 17 | ], 18 | "plugins": [ 19 | ["@babel/plugin-proposal-unicode-property-regex", { 20 | "useUnicodeFlag": false 21 | }], 22 | ["@babel/plugin-transform-runtime", { 23 | "polyfill": false, 24 | "regenerator": true 25 | }], 26 | ["@babel/plugin-proposal-class-properties"], 27 | ["@babel/plugin-syntax-dynamic-import"] 28 | ] 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | *.log -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## August 2018 4 | 5 | ### Tensor visualization 6 | * tensors with a small number of elements display also individual values 7 | 8 | ### Language 9 | * unary `+` as the Sum operator 10 | * unary `*` as the Product operator 11 | * multiline strings are dedented by default (as in Swift) 12 | 13 | ### API 14 | * [Clip](https://mlajtos.github.io/L1/latest/#OjpDbGlw), [Sum](https://mlajtos.github.io/L1/latest/#OjpTdW0=), [Transpose](https://mlajtos.github.io/L1/latest/#OjpUcmFuc3Bvc2U=), [Product](https://mlajtos.github.io/L1/latest/#OjpQcm9kdWN0), [Reverse](https://mlajtos.github.io/L1/latest/#OjpSZXZlcnNl), [Expand](https://mlajtos.github.io/L1/latest/#OjpFeHBhbmQ=) 15 | 16 | ### Documentation 17 | * [Examples](https://github.com/mlajtos/L1/tree/master/src/gallery) are back! 18 | * code snippets are easily runnable 19 | * wrote about [goals of L1](GOAL.md) 20 | 21 | ### Playground 22 | * shareable hyperlinks (Ctrl+S, Cmd-S) -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Pull requests are welcome. 4 | 5 | ## Setup 6 | 7 | 1. ```git clone https://github.com/mlajtos/L1.git``` 8 | 1. ```cd L1``` 9 | 1. ```yarn``` 10 | 11 | ## Development 12 | 13 | 1. ```yarn run dev``` 14 | 1. http://localhost:7171 15 | 16 | ## Build 17 | 18 | 1. ```yarn run build``` 19 | 1. ```yarn run serve``` 20 | 1. http://localhost:7171 21 | 22 | Directory `L1/dist` contains built project. -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Milan Lajtoš 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # L1: Tensor Studio 2 | [L1: Tensor Studio](https://mlajtos.github.io/L1/latest/) is a live-programming environment for differentiable linear algebra. The playground for tensors. 3 | 4 | [![Screenshot](Screenshots/Screenshot4.png)](https://mlajtos.github.io/L1/latest/) 5 | 6 |

Live Demo | Documentation | Examples

7 | 8 | ## About 9 | 10 | L1 is a playground for differentiable linear algebra, heavily used in Machine Learning. It frees your mind from accidental complexities of programming, and lets you focus your attention on the underlying math to further strengthen your intuition. 11 | 12 | ### Goal 13 | 14 | Become the standard tool for prototyping new Machine Learning ideas. [More...](GOAL.md) 15 | 16 | ### Features 17 | * designed for rapid learning and prototyping 18 | * helpful live visualization 19 | * elegant pure functional language 20 | * eager execution 21 | * auto-broadcast for tensor operations 22 | * fast GPU-accelerated computation 23 | * awesome built-in documentation 24 | * syntax-highlighting and code-completion 25 | 26 | ### Changelog 27 | 28 | * [August 2018](CHANGELOG.md#august-2018) 29 | 30 | ### What's comming? 31 | * variable tensors and optimization 32 | * richer set of operators 33 | * pre-trained models 34 | * loading data, I/O 35 | * [etc.](https://github.com/mlajtos/L1/blob/master/TODO.md) 36 | 37 | ### Issues 38 | * None of the mobile browsers are supported 39 | * Firefox is rather slow and has unpredictable behavior – [#3](https://github.com/mlajtos/L1/issues/3) 40 | * please use Chrome for best experience 41 | * Edge looks visually off, but works OK 42 | 43 | ### Contribution 44 | 45 | Any form of help and feedback is welcome – including [PRs](CONTRIBUTING.md), [reporting bugs](https://github.com/mlajtos/L1/issues/new), [suggesting ideas](https://github.com/mlajtos/L1/issues/new), [shooting down existing ideas](TODO.md), [creating new examples](https://github.com/mlajtos/L1/tree/master/src/gallery), promotion, testing, etc. 46 | 47 | This project is under [MIT license](LICENSE). 48 | 49 | --- 50 | 51 | ## Thank you 52 | 53 | Big thank you to these great projects and awesome people behind them: 54 | - [TensorFlow.js](https://github.com/tensorflow/tfjs) 55 | - [Ohm](https://github.com/harc/ohm) 56 | - [Monaco Editor](https://github.com/Microsoft/monaco-editor) 57 | - [FiraCode](https://github.com/tonsky/FiraCode) 58 | - [React](https://github.com/facebook/react) 59 | - [RxJS](https://github.com/Reactive-Extensions/RxJS) 60 | - etc. 61 | 62 | This thing is stealing great ideas from: 63 | - [APL family](https://en.wikipedia.org/wiki/APL_(programming_language)) – A, [J](https://en.wikipedia.org/wiki/J_(programming_language)), K, Q 64 | - [LISP family](https://en.wikipedia.org/wiki/Lisp_(programming_language)) – ClojureScript 65 | - [ECMAScript](https://en.wikipedia.org/wiki/JavaScript) 66 | - [QML](https://en.m.wikipedia.org/wiki/QML) 67 | - [JSON](https://www.json.org/) 68 | - [Jsonnet](https://jsonnet.org/) 69 | – [Ren](https://pointillistic.com/ren/) 70 | - [Haskell](https://en.wikipedia.org/wiki/Haskell_(programming_language)) 71 | - [Smalltalk](https://en.wikipedia.org/wiki/Smalltalk) 72 | - [Moniel](https://github.com/mlajtos/moniel) – prototype of L1 73 | - [Douglas Crockford](https://www.youtube.com/watch?v=NPB34lDZj3E) 74 | - [Bret Victor](https://vimeo.com/36579366) 75 | - etc. 76 | -------------------------------------------------------------------------------- /Screenshots/Screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mlajtos/L1/b5b848d81a789c373a15634f09ba2ad0eaaa9f65/Screenshots/Screenshot.png -------------------------------------------------------------------------------- /Screenshots/Screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mlajtos/L1/b5b848d81a789c373a15634f09ba2ad0eaaa9f65/Screenshots/Screenshot2.png -------------------------------------------------------------------------------- /Screenshots/Screenshot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mlajtos/L1/b5b848d81a789c373a15634f09ba2ad0eaaa9f65/Screenshots/Screenshot3.png -------------------------------------------------------------------------------- /Screenshots/Screenshot4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mlajtos/L1/b5b848d81a789c373a15634f09ba2ad0eaaa9f65/Screenshots/Screenshot4.png -------------------------------------------------------------------------------- /TODO.md: -------------------------------------------------------------------------------- 1 | # TODO 2 | 3 | ## Demos 4 | 5 | 1. Tile design – gallery/5_tile_design.l1 6 | * needed functions: 7 | 1. Tile 8 | 1. GetDigit 9 | 1. Other 10 | * Iota 11 | * RankUp, RankDown 12 | * ArgMin, ArgMax 13 | * StochasticGradientDescent 14 | * Gradient 15 | * Flow 16 | 17 | ## Language 18 | * Operators for tensor 19 | * equal = == 20 | * not equal != 21 | * less than < 22 | * more than > 23 | * less than or equal <= 24 | * more than or equal >= 25 | 26 | ## Wholeness 27 | 28 | 1. Prelude 29 | * because many things can be written in L1 30 | 1. Traditional visualizations 31 | * Plots 32 | * What is the best plotting library? 33 | * should be able to continuously redraw itself with new data 34 | * What does TensorBoard use? 35 | * line, bar, scatter, ..? 36 | * `BarChart [0 1 2 3 4 5]` 37 | * `LineChart [0 1 2 3 4 5]` 38 | * `ScatterPlot [0 0, 1 1, 2 2, 3 3]` or `[0 1 2 3, 0 1 2 3]` 39 | * `BarChart [0 1 2, 3 4 5]` 40 | * `Chart { ... }` 41 | 1. Router 42 | * Must be hierarchical 43 | * I don't know what that means right now. 44 | * Can target part of the "notebook"? 45 | * kind of relevant – import from other notebooks 46 | * `:: #L1.#myNotebook.#rev111.functionOfInterest` 47 | * `#L1` object will do the loading (maybe different name?) 48 | * "rev" as from "revision" is unique version of the notebook 49 | * content-hashes would be awesome, but ugly 50 | * automatic numbering? 51 | * user-defined version? 52 | 1. How to directly compare two tensors? 53 | * `a: Zeros [10], b: Ones [10] 54 | 1. How to visualize high-rank tensors? 55 | * 1D, 2D slices? 56 | 57 | ## UX 58 | 59 | 1. When there is a error, selection is not visible 60 | * clashes with more than one error on the line 61 | * grouping errors by line? 62 | 1. Code completion provider which takes rootEnvironment as the source 63 | 1. History 64 | * what must be preserved (in state obj): 65 | * scrollOffset in board 66 | * scrollOffset in editor 67 | * cursor position in editor 68 | 1. working links in Markdown 69 | 1. Broken visual cue for scrolling the board 70 | 1. Correspondence between code and visualization 71 | * Focus 72 | * What part of visualization was generated by which part of the code? 73 | * What code generates which part of the visualization? 74 | * mockup would help and can be a good start 75 | 76 | 77 | ## Crazy 78 | 79 | 1. silent assignment folded by default? 80 | 1. Markdown for error messages 81 | 1. KaTeX for Markdown 82 | * would be super-convenient 83 | 1. Name resolution 84 | * Capitalized names could be resolved from root 85 | * or non-overideable through #meta 86 | * Capitalized names could be resolved by abbreviations (as in Moniel) 87 | 1. Tensors should be callable – indexing 88 | * `a: [1 2 3], c: a[0] ; c = 1 :D` 89 | * this way the second tensor is an address to the first one 90 | * `source: [1 2, 3 4], indices: [0 0, 1 1], result: source(indices) ; result = [1 4]` 91 | * this is the real shit! 92 | * (and `@` can stay for matmul, yay!) 93 | 1. `#render` (because of that "Can I create AI in HTML?" meme) 94 | ```L1 95 | ; mu: { 96 | ; #render: props => ( 97 | ;
98 | ; {props.name} 99 | ; {props.surname} 100 | ;
101 | ; ) 102 | ; } 103 | mu: { 104 | #state: { 105 | name: "John" 106 | surname: "Doe" 107 | } 108 | #render: props => ( 109 | { 110 | tag: "div" 111 | content: { 112 | child1: { 113 | tag: "span" 114 | content: props.name 115 | } 116 | child2: { 117 | tag: "span" 118 | content: props.surname 119 | } 120 | } 121 | } 122 | ) 123 | #call: a => #render #state 124 | } 125 | 126 | hu: mu! 127 | 128 | 129 | ``` 130 | 131 | ## Random 132 | * ::Self should be ::RTFM 133 | * allow ! and () as a lambda argument? 134 | * :: with expression 135 | * eliminates cognitive friction 136 | * empty string as a key 137 | * (as a shorthand for #valueOf or #return?) 138 | * user cannot use it before naming it – good 139 | * is forced to have only one non-named prop – good 140 | 141 | ## Bugs 142 | * rendering an is leaking because Monaco does not notify DOMNode removal 143 | * report issue in Monaco GitHub? 144 | 145 | # Open questions 146 | 147 | ## How to mutate an existing object? 148 | 149 | 1. Is it even necessary? 150 | 1. Should it be allowed? 151 | 1. When is it a good idea? 152 | 153 | What about this? 154 | 155 | ```L1 156 | Counter: { 157 | i: 0 158 | increaseBy: x => { 159 | i: i + x 160 | increaseBy: x => { ; can't just ::increaseBy because of the wrong closure 161 | i: i + x 162 | } 163 | } 164 | } 165 | 166 | Counter: Counter.increaseBy 7 167 | Counter: Counter.increaseBy 2 168 | Counter: Counter.increaseBy 1 ; does not scale 169 | 170 | ; also, if Counter is shared, it won't work 171 | ``` 172 | 173 | ### State object 174 | One route may be having an explicit state object inside the normal object. State object could be mutated. However, there also needs to be a way to access parent/super/prototype object somehow... 175 | 176 | ```L1 177 | Counter: { 178 | #state: { 179 | i: 0 180 | } 181 | increaseBy: x => { 182 | #state.i: #state.i + x 183 | } 184 | } 185 | 186 | mu1: Counter.increaseBy 3 187 | mu2: Counter.increaseBy 3 188 | ``` 189 | 190 | Another approach: 191 | 192 | ```L1 193 | Counter: { 194 | #state: { 195 | i: 0 196 | ; internal fn 197 | ; #call: newState => () 198 | } 199 | increaseBy: x => #state { 200 | i: #state.i + x 201 | } 202 | } 203 | 204 | mu1: Counter.increaseBy 3 205 | mu2: Counter.increaseBy 3 206 | :: Counter.#state.i 207 | ``` 208 | 209 | So far, there should be a way to modify super/proto object. But then L1 cease to be pure. Object should not be changed directly from outside by force. But it should be able to change itself when asked nicely. 210 | 211 | ```L1 212 | a: { 213 | b: 22 214 | } 215 | ; a.b: 23 216 | a: a.#mutate { 217 | b: 23 218 | } 219 | 220 | ; looks really awful 221 | ``` 222 | 223 | # Links 224 | * [Haskell syntax](https://www.haskell.org/onlinereport/exps.html) 225 | * [Iterations in PEG](http://www.dalnefre.com/wp/2011/05/parsing-expression-grammars-part-4/) 226 | * [Continuations by example](http://matt.might.net/articles/programming-with-continuations--exceptions-backtracking-search-threads-generators-coroutines/) 227 | * [CPS in JS by example](http://matt.might.net/articles/by-example-continuation-passing-style/) 228 | * [EinSum](https://rockt.github.io/2018/04/30/einsum#fn.2) 229 | * [Firebase Cloud Fns](https://www.youtube.com/watch?v=prlK_QL_qOA) 230 | * [Something New](https://github.com/d-cook/SomethingNew) 231 | * [RxJS for mere mortal](https://stackoverflow.com/a/45227115) 232 | * [RxJS with React](https://medium.freecodecamp.org/how-to-build-a-github-search-in-react-with-rxjs-6-and-recompose-e9c6cc727e7f) 233 | * [hm](https://www.wired.com/2008/04/ff-wozniak/) 234 | * [geokit](https://rsnous.com/posts/notes-from-dynamicland-geokit/) 235 | * [Bohm](https://blogs.scientificamerican.com/cross-check/david-bohm-quantum-mechanics-and-enlightenment/) 236 | * [Kay](https://www.fastcompany.com/40435064/what-alan-kay-thinks-about-the-iphone-and-technology-now) 237 | * [Change detection](https://source.wustl.edu/2018/07/changedetection/) 238 | * [Notation](https://github.com/hypotext/notation) 239 | * [HCI](https://www.interaction-design.org/literature/book/the-encyclopedia-of-human-computer-interaction-2nd-ed) 240 | * [Mu](https://www.quantamagazine.org/to-remember-the-brain-must-actively-forget-20180724/) 241 | * [Mu2](https://blogs.scientificamerican.com/observations/brain-gain-a-person-can-instantly-blossom-into-a-savant-and-no-one-knows-why/) 242 | * [Mu3](https://qz.com/1116991/a-biologist-believes-that-trees-speak-a-language-we-can-learn/) 243 | -------------------------------------------------------------------------------- /latest/06b79b8f8677e6333512a61ec7caa63f.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mlajtos/L1/b5b848d81a789c373a15634f09ba2ad0eaaa9f65/latest/06b79b8f8677e6333512a61ec7caa63f.eot -------------------------------------------------------------------------------- /latest/1.51c25ac0adacae5e02ff.worker.js: -------------------------------------------------------------------------------- 1 | this.webpackChunk([1],{5:function(n,o){function e(n){var o=new Error("Cannot find module '"+n+"'");throw o.code="MODULE_NOT_FOUND",o}e.keys=function(){return[]},e.resolve=e,n.exports=e,e.id=5}}); -------------------------------------------------------------------------------- /latest/137778879005023b427be30df1f57d83.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mlajtos/L1/b5b848d81a789c373a15634f09ba2ad0eaaa9f65/latest/137778879005023b427be30df1f57d83.ttf -------------------------------------------------------------------------------- /latest/1a77fe6d9f399212fcfcfde790ce66b2.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mlajtos/L1/b5b848d81a789c373a15634f09ba2ad0eaaa9f65/latest/1a77fe6d9f399212fcfcfde790ce66b2.ttf -------------------------------------------------------------------------------- /latest/4.js: -------------------------------------------------------------------------------- 1 | (this.webpackJsonp=this.webpackJsonp||[]).push([[4],{539:function(n,o){function e(n){var o=new Error("Cannot find module '"+n+"'");throw o.code="MODULE_NOT_FOUND",o}e.keys=function(){return[]},e.resolve=e,n.exports=e,e.id=539}}]); -------------------------------------------------------------------------------- /latest/4cfc570109e603356ee7586978c46852.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mlajtos/L1/b5b848d81a789c373a15634f09ba2ad0eaaa9f65/latest/4cfc570109e603356ee7586978c46852.eot -------------------------------------------------------------------------------- /latest/5.js: -------------------------------------------------------------------------------- 1 | (this.webpackJsonp=this.webpackJsonp||[]).push([[5],{540:function(e,t,n){"use strict";n.r(t),n.d(t,"conf",function(){return o}),n.d(t,"language",function(){return c});var s="attribute.name.html";var o={comments:{blockComment:["\x3c!--","--\x3e"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">",notIn:["string"]}],surroundingPairs:[{open:"(",close:")"},{open:"[",close:"]"},{open:"`",close:"`"}],folding:{markers:{start:new RegExp("^\\s*\x3c!--\\s*#?region\\b.*--\x3e"),end:new RegExp("^\\s*\x3c!--\\s*#?endregion\\b.*--\x3e")}}},c={defaultToken:"",tokenPostfix:".md",control:/[\\`*_\[\]{}()#+\-\.!]/,noncontrol:/[^\\`*_\[\]{}()#+\-\.!]/,escapes:/\\(?:@control)/,jsescapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,empty:["area","base","basefont","br","col","frame","hr","img","input","isindex","link","meta","param"],tokenizer:{root:[[/^(\s{0,3})(#+)((?:[^\\#]|@escapes)+)((?:#+)?)/,["white","keyword","keyword","keyword"]],[/^\s*(=+|\-+)\s*$/,"keyword"],[/^\s*((\*[ ]?)+)\s*$/,"meta.separator"],[/^\s*>+/,"comment"],[/^\s*([\*\-+:]|\d+\.)\s/,"keyword"],[/^(\t|[ ]{4})[^ ].*$/,"string"],[/^\s*~~~\s*((?:\w|[\/\-#])+)?\s*$/,{token:"string",next:"@codeblock"}],[/^\s*```\s*((?:\w|[\/\-#])+)\s*$/,{token:"string",next:"@codeblockgh",nextEmbedded:"$1"}],[/^\s*```\s*$/,{token:"string",next:"@codeblock"}],{include:"@linecontent"}],codeblock:[[/^\s*~~~\s*$/,{token:"string",next:"@pop"}],[/^\s*```\s*$/,{token:"string",next:"@pop"}],[/.*$/,"variable.source"]],codeblockgh:[[/```\s*$/,{token:"variable.source",next:"@pop",nextEmbedded:"@pop"}],[/[^`]+/,"variable.source"]],linecontent:[[/&\w+;/,"string.escape"],[/@escapes/,"escape"],[/\b__([^\\_]|@escapes|_(?!_))+__\b/,"strong"],[/\*\*([^\\*]|@escapes|\*(?!\*))+\*\*/,"strong"],[/\b_[^_]+_\b/,"emphasis"],[/\*([^\\*]|@escapes)+\*/,"emphasis"],[/`([^\\`]|@escapes)+`/,"variable"],[/\{[^}]+\}/,"string.target"],[/(!?\[)((?:[^\]\\]|@escapes)*)(\]\([^\)]+\))/,["string.link","","string.link"]],[/(!?\[)((?:[^\]\\]|@escapes)*)(\])/,"string.link"],{include:"html"}],html:[[/<(\w+)\/>/,"tag"],[/<(\w+)/,{cases:{"@empty":{token:"tag",next:"@tag.$1"},"@default":{token:"tag",next:"@tag.$1"}}}],[/<\/(\w+)\s*>/,{token:"tag"}],[//,"comment","@pop"],[/