From d0921e60defa20594a88bf0d8e1f1761c1954ff5 Mon Sep 17 00:00:00 2001 From: Maria Zaitseva Date: Thu, 12 Dec 2024 12:47:13 +0700 Subject: [PATCH] Lua --- .DS_Store | Bin 6148 -> 0 bytes .gitignore | 1 + index.html | 28 ++++++++--- lua.html | 134 +++++++++++++++++++++++++++++++++++++++++++++++++++++ style.css | 52 ++++++++++++++------- 5 files changed, 192 insertions(+), 23 deletions(-) delete mode 100644 .DS_Store create mode 100644 .gitignore create mode 100644 lua.html diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index f76a1eb1ce7e8fa845d6ea0d328eaebcf83d4825..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}&BV5S|sZG{l61CLA~MN@5{$AYK~87qCVTYLHsQ#?mDe&_Z z7b1~^Clh5R+5KkcXWRLb?sfn`w5L%WpaK9T9E5_D4MOIPt{od(KoqpcLlP>LpbBLA z6GAUqfEb1_h_bKmKY|Dz!&x>86BT06dpJtsY~pzzVy95t-E$n*DLZ$;lbQvS-ej7! zd*d5gT_OeHQtyRVaevmW9Gt0i(u>pnSSQ3$A46`h<1|vUwwk6hIny7Su zmSyxRj1^{p8DIvOf$d?yUIL}^_LR((G6T%O4;i5ILE<3vE#?OG(Seh00T7F5)`B|q z5|kq?`WAD8=s^)C715*$+hPclj&^C|e2ck3lMcc*AHqI)*}Mq-blhL+a1g#ho|yq= zV4VTmq*v(vKgUmIW0Sw0!YgKg8Te-mh+-$`w6Q3Aw|*;+?plfC9tR1<<)omXzV;J< i3pz)t+G+ffbd2*Y<_2jOvg>q2{t?iG@Wc%K0t27%MNDV_ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/index.html b/index.html index d46be52..14740c2 100644 --- a/index.html +++ b/index.html @@ -13,6 +13,8 @@

(welcome :to tail-call.github.io)

    +
  • + Номера телефонов экстренных служб | Wikipedia
  • You can too write a book | Parenthetically Speaking
  • @@ -26,14 +28,14 @@

    (welcome :to tail-call.github.io)

    \about{me}

    -My name is Maria. I'm a software developer and AI researcher. I'm an avid +My name is Maria. I'm a software developer and AI researcher. I'm an avid note taker and a digital gardening enthusiast.

    And this is my digital garden! I happen to own a lot of them. Recently I had an epiphany that I should try to keep some -amount of my notes in HTML format, for it shall swiftly outlive every other +amount of my notes in HTML format, for it shall swiftly outlive every other technology I use now.

    @@ -47,12 +49,12 @@

    \about{me}

    -But who will leave reality of cesspit for their dreams?
    +But who will leave reality of cesspit for their dreams?

    -Two letter commands were common in UNIX because they were easy to type, -and single letter commands were reserved for the user to define. + Two letter commands were common in UNIX + because they were easy to type, and single letter commands were reserved for the user to define. @@ -74,12 +76,16 @@

    \about{me}

    • Scriptable in Lua (not Elisp or Vimscript!) -
    • Lua is the best language +
    • Lua is the best language
    • I memorized Vim key bindings so well I can't use any other edytore animor
    • So many edits you want to make are a series of %s-s
    • Macros
    • I also love vifm a lot, which is a - two-pane directory editor with convenient (aka vi-like) key bindings, and + two-pane with convenient (aka vi-like) key bindings, and so my vifm and nvim shell out into one another a lot
    @@ -260,3 +266,11 @@

    my $academic_plan;

    Table 1. My academic plan.
    + +

    How to reference a URL?

    + +

    +Unlike books, which may be torn, lost, given to another person without you ever remembering about it, URLs die in a different way: they stop opening. Or entirely different content is being put instead of what the URL once contained. + +

    +Despite that, we still want to reference URLs like we reference our books, in a nice list at the end of the text. This almost works well with books because many instances of a book are typically printed. For a URL, it is common to be served by a VM on a cheap VPS server. diff --git a/lua.html b/lua.html new file mode 100644 index 0000000..23eaae5 --- /dev/null +++ b/lua.html @@ -0,0 +1,134 @@ + +Lua + + +

    Lua, the Programming Language

    + + + +
    + +

    +Have you noticed the moon is a bit like a parenthesis? + +

    +Things of amazing beauty were invented by humans: first it was Lisp, then it +was Forth, and then it was Lua - if there were other good languages, please +let me know + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    LanguageYear of ReleaseKeywords
    Lisp1960defun, cons, car, cdr, lambda, eval, cond
    Forth1970:, dup, drop, pick, roll
    Smalltalk1972new, yourself, super
    Scheme1975define, call/cc, set!, define-syntax
    Common Lisp1984defun, defmacro, defparameter, defclass, defpackage, loop
    Python1991def, class, nonlocal, async, yield, import
    Lua1993function, local
    +Table 1. Various languages. + +

    +The good thing about being a 1993 language is that you can be influenced by every other language that was released before that date. In Lua, I personally sense a great influence of every language mentioned in Table 1, and I like these influences + +

    +conf: __index, __add, __le, __mode -- __init__, __str__, __add__ + +

    +conf: _G -- globals() + +

    +They say there's a man in the moon - if you look closely enough into moon's +surface, you will see a face. In case of Lua, the face you see in the moon +is of Roberto Ierusalimski [Wikipedia]. When I say this, I always want to add "it's the +same guy who made D" but D was made by Andrei Aleksandresku [Wikipedia], an entirely +different person1 + +

    +1 No wonder I keep getting them confused, their last names both end with /sk[ui]$/ + +

    +One thing that comes to mind first when thinking about Lua is that it begins +indexing its arrays (aka tables) with 1 as opposed to 0, the starting index +of choice of 99% other programming languages. Both are nice choices, one is +more intuitive when thinking about high-level problems, the other is more +intuitive when dealing with things like memory or anything with an "offset". +A truly bad choice would be using -1 or 2 as base index + +

    +The reason behind this is that Lua was indeed designed to be used by +non-programmers, who needed a very simple language to automate their daily +computations. It's a small niche, and we don't usually target it anymore when +developing software. We kind of collectively assume that programming is the +job of a programmer, and now that we have a lot of programmers, why would +you code instead of them? + +

    +Another instance of this is that every assignment to a free variable introduces +a global binding, visible across all modules. If you're a novice programmer, +this is a win for you because you don't have to wonder why your variable +suddenly became nil, and if you're an experienced +developer, you probably care about lexical scoping and should by default make +every variable you use with local. You also need to be +careful not to assign to undeclared variables, but your IDE + +

    +Metatables are the continuation of theme "we're giving you one multi-purpose +tool instead of many single-purpose utilities" that table has begun. Metatables +are your meta-programming tool, and with meta-programming you may achieve object +oriented programming (OOP) and other good stuff. Lua doesn't have macros, but +metatables make it possible to introduce custom syntax to a degree. Personally +I recommend against going for the urge of rolling out Your Own Object System +because it's not a natural style for Lua: whatever you need an object system +for (inheritance, overriding behavior, polymorphism), there are other, more +straightforward ways to implement these. Lua isn't very like Smalltalk, it's +almost trying to be the opposite of Smalltalk while pursuing similar goals in +its design diff --git a/style.css b/style.css index 8817897..e3b0b80 100644 --- a/style.css +++ b/style.css @@ -1,18 +1,19 @@ :root { --foreground: #413a7f; + --background: rgb(239 236 255); } -html { - font-family: KaTeX_Main, Lucida Grande, Helvetica Neue, Helvetica, Arial, sans-serif; - background-color: rgb(239 236 255); -} -a { - color: #d7569c; -} +html { + font-family: + KaTeX_Main, + Lucida Grande, + Helvetica Neue, + Helvetica, + Arial, + sans-serif; -a:visited { - color: #413a7f; + background-color: var(--background); } body { @@ -27,7 +28,33 @@ body { max-width: 700px; } +@media (min-width: 700px) { + body { + margin-top: 1rem; + margin-left: 3rem; + margin-right: 3rem; + } +} + +a { + color: #d7569c; +} + +a:visited { + color: #413a7f; +} + +sup { + font-size: 50%; +} + +p:target { + background: var(--background); +} + .slide { + padding-top: 0.5rem; + padding-bottom: 0.5rem; margin-left: 1rem; margin-bottom: 2rem; border-left: solid 1px var(--foreground); @@ -35,10 +62,3 @@ body { max-width: 650px; } -@media (min-width: 700px) { - body { - margin-top: 1rem; - margin-left: 3rem; - margin-right: 3rem; - } -}