Xah Programing Blog

syntactic obsession, imperative despisal, hacker hate, unicode love ♥

what's an operator in computer language?

operator is not well defined in programing languages. Sometimes it's just part of syntax. e.g. the comma in JavaScript

in js, comma is an operator, but not the comman in array. here's the spec ECMAScript 2015 §ECMAScript Language: Expressions#sec-comma-operator

assignment =, such as x = 4, is also an operator. But it could just be said as syntax.

Similarly, the new in new Date(), and delete in delete obj.prop and typeof in typeof obj, and in in prop in obj, are all considered as operators in js spec.

JavaScript calls ternary expression (test ? true_expr : false_expr) as conditional operator. ECMAScript 2015 §ECMAScript Language: Expressions#sec-conditional-operator

however, the var in var x; is considered a statement. ECMAScript 2015 §ECMAScript Language: Statements and Declarations#sec-ecmascript-language-statements-and-declarations

there does not seem to be a absolute definition that qualify something to be operator or just syntax or “statement”.

〔➤see JavaScript: Operators

What's Function, What's Operator?

Linux: How to Convert gif to Video (webm, mp4)

Shell, REPL, vs Notebook and Emacs Environment Explained

on the rectification of programing language spec by formal language

0 it's time, for, Xah Edu Corner Extempore! Episode 20161205145300, on the rectification of programing language spec by formal language

1 i've read most of the js spec. let's take a look at this ECMAScript 2015 §Indexed Collections#sec-array.prototype.concat

2 you see js spec use algorithms as description. lots steps with abstract operations. To understand them, see ECMAScript 2015 §Abstract Operations#sec-abstract-operations

3 using algorithm to describe thing is hard to understand. like, read code, and you have to figure out what it's doing, and all side effects.

4 here's example of description by how to: gcd(a,b)=a, gcd(a,b)=gcd(b, mod(a,b)), mod(a,b)=a-b*floor(a/b). what's gcd?

5 example of description by what-is: gcd(a,b), returns the largest positive integer that divides the numbers without a remainder. a≠0 or b≠0.

6 the what-is form is much easier to understand than the how-to. because, reading doc IS to know what-is. like reading API vs implementation.

7 the what-is is math (including computer science), and how-to is programing.

8 the JavaScript spec takes the approach of how-to (It specify by step-by-step instruction in English). That's unfortunate.

9 using algorithm as a spec is unfortunate. but using English to do that is worse. js sec is verbosity multiplied by complexity.

10 No human can implement JavaScript by reading the spec alone. I surmise such result would be full of errors.

11 if we stick with algorithmic approach to spec, might it possible to replace the english by a program? say #haskell, #ocaml #coq?

12 if JavaScript spec is done via say formal proof system program, we might actually find all the loopholes in spec of English.

fundamental diff of math vs comp sci is “what is” vs “how to”

fundamental diff of math vs comp sci is “what is” vs “how to”, and it is theoretically impossible to translate one to the other.

even for simple algorithms, it's difficult to translate it as What IS. (cellular automatic is a hard example) 〔➤see Notes on A New Kind of Science

Math vs Programing, What-is vs How-to

linux speaker test. make sound, beep

# linux speaker test
speaker-test -t sine -f 440 -l 1 -p 1000

clojure vs golang

clojure's dependence on java kills it. use golang instead. simpler, equally powerful, 10 times more adoption, no java baggage, faster.

ironically, reason clojure is used in industry is mostly because it depends on java. it's the escape route of existing Java systems.

See also:

Programing Languages Sugar Syntax: Compiler Level vs User Level

python 3 vs JS ES6

python 3 and JavaScript ES6 has totally different fate. py3 is incompatible, few new feature, few adopts. JS ES6 is the opposite, Everyone's eager to use.

if you look at js es6 Grammar, it's extremely complex. I suppose C C++ java etc at the same level of complexity. ECMAScript 2015 §ECMAScript Language: Lexical Grammar#sec-ecmascript-language-lexical-grammar

using libraries increases engineering convenience, but software reliability for user may actually go down

JavaScript Grammar is Not Context-Free Grammar!

Unix Idiots Panel Index. ancient articles, new index.

Perl Idiocy Panel Index. ancient articles, new index.

Microsoft Hatred Panel Index. ancient articles, new index.

Linux: How to Install Font, List Fonts (minor update)

open source hypocrisy

if you are FSF/OpenSource advocate, but uses Mac, iPhone, or work for Google, Apple etc, you are really a hypocrite. matter of fact.

oop and code reuse

a decade ago, the idea that object encourages code reuse is everywhere. now, it's commonly accepted not really. Depends, or OOP decrease code reuse.

Fad in programing is hard to kill. Coding army ten thousand strong calls you a troll.

OOP's Jargons and Complexities

Voodoo of Software Engineering

Complexity and Tedium of Software Engineering

On Microsoft Hatred (ancient article, new navigation panel)

Should the Map Function Specify Order?

ban jargon “instance”

Jargons of Software Industry

hacker news yc website idiocy

the hacker news yc is truly idiotic. when in tablet, need a microscope to read. 1990s html, written in a born dead arc lisp.

HTML Style 1999: Hacker News

Unicode Cross ✙ ✞ ⛨ ♰ 🕈 ✠ 卍 (new page)

OCaml, Haskell, Syntax came from ISWIM

Been reading ISWIM, most idiotic technical writing. baroque, era dependent, complex grammar structure.

ML, ocaml, haskell syntax came from ISWIM. It is truly unfortunate. Particularly bad is the English “where” clause (like in SQL), and the “off side rule” (like python's indentation), which haskell adopted.

the paper was influential, but the idea of syntax algebra isn't there. So, by missing a aspect, it did long lasting damage. Like Knuth's TeX, or the C++.

for details, see

Open Source is Ceasing to be Cool By Dr Mark Tarver. @ http://www.marktarver.com/open.html

Mark Tarver is the creator of Shen lang.

Linux: How to Convert WEBP to JPG

RethinkDB Shutdown, or, how to make money with open source

https://rethinkdb.com/blog/rethinkdb-shutdown/

SageMath on RethinkDB shutdown. how to make money with open source… http://sagemath.blogspot.com/

i fear that some people will never be successful starting a company regardless of plan. You need 1 thing foremost: a greed mentality, advance yourself.

I interviewed with RethinkDB people about 2 years ago. Sad to seem them shutdown. Best wish to them.

Context Dependent Syntax, Lisp setf, Python a[i]=x

new lang, pyret

see bottom Proliferation of Computing Languages

#remove xfce stupid locker
sudo apt purge light-locker
#install classic xscreensaver
sudo apt install xscreensaver

http://xubuntu.org/news/screen-locking-in-xubuntu-14-04/

Etymology Execute — the most annoying word in tech writing. When you use it, you connote killing and truth-hiding.

Etymology of Execute

Syntax Soup Kaleidoscope Panel Index

new panel index. Collected essays about computer language's syntax.

Syntax Algebra (on its own page)

hum, new python book, Fluent Python

writing a compiler ain't no easy. So much to learn. Lots theory stuff, very different than common programing such as web dev.

yet, parser and compiler is one of the very first programing problem, and practically solved decades ago. You need it to create a language.

however, for vast majority of programers, you'll never need to learn or know anything about parser/compiler. Simply out of the picture.

LISP, What Does Symbolic Language Mean?

Why is DRM Not Working?

there are software that costs thousands. but it seems, always available on pirate bay. Can anyone explain this? is DRM tech not robust, or technically / inherently impossible, or what?

Am thinking Microsoft Windows, OS X, PhotoShop, Mathematica, AutoCAD. These are big companies, so that should rule out not doing DRM correctly.

can anyone explain the gist? any articles?

suppose i sell software X. I send to you, you install, it generates a id based on your machine. You send me id, i send you key.

In reply to Xah Lee
Gergely Nagy @algernoone
@xah_lee The id check can be patched out. Or the id generation cracked. Its likely automated, so mitm. Among other things.

In reply to Xah Lee
Gergely Nagy @algernoone
@xah_lee Also, if the id is generated after install, you can pirate, upload, etc the uninstalled installer bundle. And others can crack it.

https://twitter.com/algernoone/status/771618133949853696

the utility of in depth tutorial?

some tutorials, goes into excruciating detail. Such as the JavaScript Book by David Flanagan (rhino) but, i wonder the utility. For the 0.1% who need to know, you probably shouldn't. and the rest, you test it yourself is better than book.

when you need to know some painful detail of a lang not covered by basic tutorial, you are on the verge of abusing the lang. Question your need/approach.

well, in depth tutorial is actually still useful, because the spec may be hard to read or doesn't exist. And, for many things, it may be hard to test to find out.

e.g. what happens if you put arg in function syntax here and call it that way, etc.

English writing. I've been trying to get rid of e.g. for years, but just never found a way. “for example” is just annoyingly long.

The piracy paradox at Udemy By Troy Hunt. @ https://www.troyhunt.com/the-piracy-paradox-at-udemy/

basically:

hackers in the 1990s, are interested in literature, linguistics, nerd as walking encyclopedia. Today, i don't seem to see much.

Today's coder gone illiterate? or, perhaps social media and too much info made the real nerd hard to find?

Lisp Panel Index

selected collection of lisp essays.

doc by dummies, Technical writing at its worst

Revamped index. Collected criticism of computer lang docs.

Xah Python Tutorial Accolade

xah python tutorial praise 2016-08-22
Python: Learn Python in 1 Hour

MiniKanren relational language, name origin

MiniKanren relational language. The name “kan ren” came from Japanese 関连, which is Chinese, meaning “relations”. lol

html navigation panel implementation redone

redone navigation panel for all my sites.

2601 files changed.

and the following files created

  1. ./xahlee_info/comp/comp_lang_panel_index.html
  2. ./xahlee_info/comp/tech_panel_index.html
  3. ./xahlee_info/comp/doc_idiocies_panel_index.html
  4. ./xahlee_info/comp/unicode_panel_index.html
  5. ./xahlee_info/comp/jargon_panel_index.html
  6. ./xahlee_info/python/python3_panel_index.html
  7. ./xahlee_info/golang/golang_panel_index.html
  8. ./xahlee_info/Netiquette_dir/netiquette_anthro_panel_index.html
  9. ./xahlee_info/linux/computer_networking_panel_index.html
  10. ./xahlee_info/linux/linux_misc_panel_index.html
  11. ./xahlee_info/linux/git_panel_index.html
  12. ./xahlee_info/linux/linux_keybinding_panel_index.html
  13. ./xahlee_info/linux/linux_panel_index.html
  14. ./xahlee_info/java-a-day/java_panel_index.html
  15. ./xahlee_info/ocaml/ocaml_panel_index.html
  16. ./xahlee_info/UnixResource_dir/writ/netiquette_panel_index.html
  17. ./xahlee_info/UnixResource_dir/writ/anti_hacker_panel_index.html
  18. ./xahlee_info/perl/perl_panel_index.html
  19. ./xahlee_info/clojure/clojure_instaparse_panel_index.html
  20. ./xahlee_info/clojure/clojure_panel_index.html
  21. ./xahlee_info/SpecialPlaneCurves_dir/_curves_robert_yates/curves_yates_panel_index.html
  22. ./xahlee_info/SpecialPlaneCurves_dir/curves_panel_index.html
  23. ./xahlee_info/3d/povray_panel_index.html
  24. ./xahlee_info/js/html_panel_index.html
  25. ./xahlee_info/js/svg_panel_index.html
  26. ./xahlee_info/js/js_panel_index.html
  27. ./xahlee_info/js/dom_panel_index.html
  28. ./xahlee_info/js/css_panel_index.html
  29. ./xahlee_info/ruby/ruby_panel_index.html
  30. ./xahlee_info/perl-python/python_doc_panel_index.html
  31. ./xahlee_info/perl-python/python_panel_index.html
  32. ./xahlee_info/kbd/ergonomic_keyboards_panel_index.html
  33. ./xahlee_info/kbd/keyboard_design_panel_index.html
  34. ./xahlee_info/kbd/keyboard_layout_panel_index.html
  35. ./xahlee_info/kbd/keyboard_history_panel_index.html
  36. ./xahlee_info/kbd/mouse_panel_index.html
  37. ./xahlee_info/kbd/mac_keybinding_panel_index.html
  38. ./xahlee_info/kbd/keyboard_reviews_panel_index.html
  39. ./xahlee_info/kbd/trackball_panel_index.html
  40. ./xahlee_info/kbd/typing_rsi_panel_index.html
  41. ./xahlee_info/mswin/Windows_keybinding_panel_index.html
  42. ./xahlee_info/parser/parser_panel_index.html
  43. ./xahlee_info/powershell/powershell_panel_index.html
  44. ./xahlee_info/php/php_panel_index.html
  45. ./xahlee_org/sex/sex_panel_index.html
  46. ./ergoemacs_org/emacs/emacs_keys_panel_index.html
  47. ./ergoemacs_org/emacs/elisp_panel_index.html
  48. ./ergoemacs_org/emacs/elisp_command_examples_panel_index.html
  49. ./ergoemacs_org/emacs/emacs_modernization_panel_index.html
  50. ./ergoemacs_org/emacs/emacs_panel_index.html
  51. ./ergoemacs_org/emacs/elisp_script_examples_panel_index.html
  52. ./ergoemacs_org/misc/emacs_misc_panel_index.html
  53. ./xahmusic_org/piano/piano_panel_index.html
  54. ./xahmusic_org/music/chinese_songs_panel_index.html
  55. ./xahmusic_org/music/song_panel_index.html
  56. ./wordyenglish_com/arabian_nights/aladdin/aladdin_panel_index.html
  57. ./wordyenglish_com/arabian_nights/arabian_nights_panel_index.html
  58. ./wordyenglish_com/titus/titus_panel_index.html
  59. ./wordyenglish_com/flatland/flatland_panel_index.html
  60. ./wordyenglish_com/lit/lit_panel_index.html
  61. ./wordyenglish_com/lit/accent_panel_index.html
  62. ./wordyenglish_com/flatland_chinese/flatland_chinese_panel_index.html
  63. ./wordyenglish_com/monkey_king/monkey_king_panel_index.html
  64. ./wordyenglish_com/musing/writing_panel_index.html

For example, goto JavaScript in Depth and look at the side panel.

The change shouldn't be visible to user. It's implementation changed, for the side panel.

For those curious, here's the deal.

before, each page contains the whole static html side panel. That is, a list of links is duplicated in every file. The problem is, if you want to change the navigation bar, you have to change every file. You also have to make sure that every file's text is exactly the same. And, if one file happens to have a extra space, that causes problem in your find/replace script when you change the side panel.

now, the new implementation, the nav panel is a file by itself, and is embedded in each page as iframe.

The disadvantage using iframe is that each page now needs to make an extra http request. (but it's cached, good if the nav panel contains several images)

on the whole, i think with iframe is much better. The iframe solves a major issue about navigation panel i had, that is, it's not possible to keep the side panel code identical when articles are in different directories. (and the consequence of that is you cannot use find/replace anymore when you want to change side panel.)

here's a sampling, hope it's interesting.

after Shakespeare 〔➤see The Tragedy Of Titus Andronicus by Shakespeare〕 , Sir Richard Burton's arabian nights is the most fascinating literature and style i've read.

Read one: Story Of King Shahryar And His Brother, page 1

here's a story of The Arabian Nights, where girls fight to suck… The Arabian Nights: 70. ABU AL-ASWAD AND HIS SLAVE-GIRL

and this is the most wondrous scifi. finish in couple hrs, understand 4th dimension.

best short scifi. FLATLAND: A Romance of Many Dimensions

can finish in few hours. You'll understand 4th dimension. It's also a social philosophy, mock history, and a tragedy.

Weird Unicode Math Symbol: DIFFERENCE BETWEEN

Unicode Math Symbols ∑ ∞ ∫ π ∈ ℝ²

unicode symbol becomes pictograph, a problem

unicode left right arrow becomes pictograph problem
This is annoying. In android, ipad, twitter, LEFT RIGHT ARROW gets rendered as pictograph, but the LEFT RIGHT DOUBLE ARROW not. As of .

Unicode Arrows → ⇒ ⇄ ↑ ↩ ⤢ ↱ ↷ ↻

PS

wow, unicode “U+FE0E: VARIATION SELECTOR-15”. Add that char after another char to select the variation you want.

see https://twitter.com/FakeUnicode/status/766873680366280705

Microsoft release PowerShell on Linux and Open Source!

PowerShell on Linux and Open Source! By Microsoft. @ https://blogs.msdn.microsoft.com/powershell/2016/08/18/powershell-on-linux-and-open-source-2/

wow

for a quick tutorial, see PowerShell Tutorial

pure speculation, but i suspect, any math proof related work/software traditionally done with #ocaml or #haskell can be done with golang easily.

in other words, i don't think there's any critical or foundational stuff in OCaml related to theorem proving.

“Propositions as Types” by Philip Wadler

see also

Category Theory for the Working Hacker By Philip Wadler. @ https://www.infoq.com/presentations/category-theory-propositions-principle?utm_source=twitter&utm_medium=link&utm_campaign=calendar

why random number is critical in encryption?

yesterday i had a question answered that puzzled me for years. thanks to @johnkitchin @bren_fdez

Q: why random number is critical in encryption?

A: because symmetric cypher is used for payload, and the key is a random number.

understand Public-key Cryptography in 5 minutes Public-key Cryptography Tutorial; What's SSH, SSL, TLS, AES, SHA-1, MD5

learn Julia in y minutes. https://learnxinyminutes.com/docs/julia/

functional programers and Golang

i've heard a few functional programers in my circle criticize golang. I think it's more like “it's not my clan” type of thing

i've also heard a few functional programers in my circle loving rustlang. I think it's “i don't want golang to win cuz its from skynet”

golang is fantastic. It's spec The Go Programming Language Specification - The Go Programming Language is shorter than Scheme Lisp now.

the best golang tutorial is https://gobyexample.com/ by @mmcgrana , simple, concrete, by example, no more.

Composable Syntax

line diff and semantic diff

recently there's idea of semantic diff. not line diff. Note that, line diff originates from unix brain damage of line truncation.

actually, the very concept of diff should be ban'd, line or semantic. Am not sure the detail, but a haunch

when programers use math jargons

when programers talk about math, such as git directed acyclic graph, or haskell monad, or some http ideompotency, or lisp homoiconicity, they dunno which side is mouth, which side is ass.

see also Jargons of Software Industry

F Sharp's New Logo = Literally Bad Ass

ocaml haskell are not math language, julia is

am beginning to see, ocaml haskell isn't my thing. like C, they are still computer engineer's by-product, not mathematician's thing.

i want a lang that's Wolfram Language in design principle but efficient. A mathematician's lang. I think, Julia is my hope.

what's this math lang i speak of? it's a lang where concepts of computer engineering by-product does not surface in the lang. if so, it's explicit.

are there such lang? yes. APL, Matlab, Wolfram Language, Julia.

whatever relation of ocaml haskell has with math, is only a historical happenstance. As lisp is.

the major concepts of comp engineering by-product are: int float double long reference pointer. They should be ban'd.

one of the most garish by-product of computer engineering in languages is: main()!

you can judge if a computer language is stupid by whether it has the “main”. Surprise of surprise, haskell has it! no wonder.

Do KNOW, that the origin of ocaml is ML, which is from 1973. Ancient. haskell's concepts and demeanors, belongs to the same lineage.

see also A Class of Computer Languages: Math Languages

see also Is Math Important for Programers?

Agile is a cancer that we have to eliminate from the industry. — Erik Meijer

Erik Meijer on Xtreme Programing and Agile

What's Algebraic Data Types?

JuliaCon 2016 (Keynote) | Fortress Features and Lessons Learned | Guy Steele

What's Disjoint Union, Sum Type? (on its own page)

Seymour Papert died, 88. Inventor of non-paren lisp: Logo

Seymour Papert died, 88. Invented “logo”, probably first non-paren lisp. Logo pioneered “turtle graphics”, we see in Scratch and Processing languages today.

I never learned logo, but ~1992 read a lot story about it, fascinated. I was busy doing Mathematica, this Visual Dictionary of Special Plane Curves

particularly interesting about logo is that there's a 3 volumes book 〈Computer Science Logo Style〉 amazon by Brian Harvey, another lisp pillar.

Brian Harvey is another lisp pillar.

History of OCaml Syntax, and The Next 700 Programming Languages

OCaml Syntax Sucks (heavily expanded, on its own page.)

Xah Programing Blog Archive Index