Xah Programing Blog

Syntactic obsession, imperative despisal, unicode love ♥, hacker hate.

Blog Archive

WolframLang ParaPlot 2022-05-13 6qSt
WolframLang ParaPlot 2022-05-13 6qSt
WolframLang ParaPlot 2022-05-13 R7Xb
WolframLang ParaPlot 2022-05-13 R7Xb
WolframLang ParaPlot 2022-05-13 MxM4
WolframLang ParaPlot 2022-05-13 MxM4

Xah Wolfram Language Tutorials

more updates

the incredible windows crap. when u empty trash, then u alt+f4 to close window, this mysterious fuck popus up.

windows empty trash 2022-05-06
windows empty trash 2022-05-06

Clojure Sigils Meaning


writing issue, true/false vs boolean

now i wonder, in my lang tutorials, those pages on boolean true/false, should i change the title from true/false to boolean.

true false 4hDg
true false 4hDg

Mabye Boolean (true/false). My normal style is to use true/false. Because that's intuitive, and actual, actual in the sense that lang actually have true/false as keywords, and is what programers deals with. But been thinking to change, or add boolean in addition. Because, now i have search box. When in search, boolean tends to be what people would search. E.g. Trying to find the page on powershell boolean, or python boolean, or wolfram lang, etc. Xah self analysis monolog: ok, this is interesting. When just a tutorial, true/false is more intuitive and proper. Because beginners have no idea what is boolean. And also for the above said reasons, true/false is more intuitive, actual. While the word boolean, is more for those who already knew the general structure of comp lang's layout and control and statement/expression/var/function etc. Now, in a search context, boolean is more proper. Because in a search context, it is generally expected, u have the knowledge of knowing the keyword for what u r searching. At least somewhat. Because for certain topics, if u don't know the "keyword" to search, u may not find it. Ok. The decision is to add both. Eg boolean (true/false) to the title.


major update

me on hackernews. thanks guys. https://news.ycombinator.com/item?id=30976337 (local copy hacker_news_xah_code_2022-04-10.txt )

added a topic box:

let me explain. Xah Master!

functional programing is rather advanced concept, many coders of 5+ year still struggle to understand. Also, as dion says, there's nuances and context. It is not a exact mathematical concept. But let me try!

suppose you have

x = 3
define f() { return x+1}
print(f()) #this calls f
# result is 4

now, this is C C++ bash and most others. (by the way, they are called imperative style/lang or procedural. again, not exact concept, and don't worry about them.)

the problem is, the function depends on the variable x outside of it. That means, if you move the function to other place, or change some code outside the f definition, its behavior changes.

now, here's a functional programing style to do the same:

define f(x) { return x+1}
print(f(3)) #this calls f
# result is 4

this way, the function now is a independent unit. you can move it to different position, or to different file, and it behaves the same.

this is the essence, of “functional programing”. Here, the “function”, take the math sense of function. It takes in a value, return a value. doesn't matter where function is called, or whatever outside of it is changed, it behaves the same. (since in math, it's abstract. function is a general abstract concept, not tied to a position, or a file location.)

art of git commit log



syntax highlight js


duckduckgo censor gabriel weinberg 2022-03-10
duckduckgo censor gabriel weinberg 2022-03-10

should i have a single blog, or merge the multiple? e.g. merge js blog, emacs blog, to programing blog, merge arts, music, writing, blogs to a generic non-tech blog?

updated or new.

much update, for phone.

and other updates

linus on unix line truncation 2020 8VqN2
linus on unix line truncation 2020 8VqN2

lol. after all these years. 3 decades. linus torvalds, finally realized the unix line truncation is the worst faak.

From	Linus Torvalds
Date	Fri, 29 May 2020 12:19:02 -0700
Subject	Re: clean up kernel_{read,write} & friends v2

On Fri, May 29, 2020 at 6:08 AM David Laight <David.Laight@aculab.com> wrote:
> A wide monitor is for looking at lots of files.

Not necessarily.

Excessive line breaks are BAD. They cause real and every-day problems.

They cause problems for things like "grep" both in the patterns and in
the output, since grep (and a lot of other very basic unix utilities)
is fundamentally line-based.

So the fact is, many of us have long long since skipped the whole
"80-column terminal" model, for the same reason that we have many more
lines than 25 lines visible at a time.

And honestly, I don't want to see patches that make the kernel reading
experience worse for me and likely for the vast majority of people,
based on the argument that some odd people have small terminal

If you or Christoph have 80 character lines, you'll get possibly ugly
wrapped output. Tough. That's _your_ choice. Your hardware limitations
shouldn't be a pain for the rest of us.

Longer lines are fundamentally useful. My monitor is not only a lot
wider than it is tall, my fonts are universally narrower than they are
tall. Long lines are natural.

When I tile my terminal windows on my display, I can have 6 terminals
visible at one time, and that's because I have them three wide. And I
could still fit 80% of a fourth one side-by-side.

And guess what? That's with my default "100x50" terminal window (go to
your gnome terminal settings, you'll find that the 80x25 thing is just
an initial default that you can change), not with some 80x25 one. And
that's with a font that has anti-aliasing and isn't some pixelated

And most of my terminals actually end up being dragged wider and
taller than that. I checked, and my main one is 142x76 characters
right now, because it turns out that wider (and taller) terminals are
useful not just for source code.

Have you looked at "ps ax" output lately? Or used "top"? Or done "git
diff --stat" or any number of things where it turns out that 80x25 is
really really limiting, and is simply NO LONGER RELEVANT to most of

So no. I do not care about somebody with a 80x25 terminal window
getting line wrapping.

For exactly the same reason I find it completely irrelevant if
somebody says that their kernel compile takes 10 hours because they
are doing kernel development on a Raspberry PI with 4GB of RAM.

People with restrictive hardware shouldn't make it more inconvenient
for people who have better resources. Yes, we'll accommodate things to
within reasonable limits. But no, 80-column terminals in 2020 isn't
"reasonable" any more as far as I'm concerned. People commonly used
132-column terminals even back in the 80's, for chrissake, don't try
to make 80 columns some immovable standard.

If you choose to use a 80-column terminal, you can live with the line
wrapping. It's just that simple.

And longer lines are simply useful. Part of that is that we aren't
programming in the 80's any more, and our source code is fundamentally
wider as a result.

Yes, local iteration variables are still called 'i', because more
context just isn't helpful for some anonymous counter. Being concise
is still a good thing, and overly verbose names are not inherently

But still - it's entirely reasonable to have variable names that are
10-15 characters and it makes the code more legible. Writing things
out instead of using abbreviations etc.

And yes, we do use wide tabs, because that makes indentation something
you can visually see in the structure at a glance and on a
whole-function basis, rather than something you have to try to
visually "line up" things for or count spaces.

So we have lots of fairly fundamental issues that fairly easily make
for longer lines in many circumstances.

And yes, we do line breaks at some point. But there really isn't any
reason to make that point be 80 columns any more.


updated or new

Web Design: Serif or Sans-Serif?

Windows terminal ctrl d exit 2022-02-17 RtKT
windows killing the unix Ctrl+d exit habit, 40 years of ancient baggage. good thing. Windows terminal ctrl d exit

See also: Linux: Terminal Control Sequence Keys

time mag html source 2022-02-17 jzwH
time mag html source 2022-02-17 jzwH
freenode death irc 2022-02-15 N6XX
freenode death irc 2022-02-15 N6XX

great articles

the problem with nim

the problem with nim is that it's niche. I never looked into exactly because of that, and i probably will find it a great lang. But the thing is, for every nim user, there's ten thousand golang users. That is a very critical fact about programing lang, a social fact. For example, i'd highly recommend Scheme lisp otherwise. But scheme lisp stayed forever niche in past 20 years. Never gonna see the light of the day.

certain social factors of a lang can never change. And i think nim is gonna be forever niche, like Scheme Lisp.

golang on the other hand, has the big advantage, of invented by a well known coding god celeb of unix community fame, and from google, and massive backed by the biggest empire on earth, and already deployed massively in mission critical apps.

See also: Why I Love Golang

Apache Rewrites History: Why is it Named Apache?

working on these for past hours

xah html mode 2022-01-30
xah html mode 2022-01-30

Gah. Need a drink, or something. Super complex. Dealing with paths and url. The main problem is this:. Suppose u have a file full path. U want to press a button in ur fav editor, and it becomes a html link. Now, suppose ur domain is xahlee . Info, and the path is ~/web/xahlee_info/x.html. Now theres 2 choices result.

<a href="http://xahlee.info/x.html">

or it can be

<a href="x.html">
<a href="./x.html">
<a href="../x.html">
<a href="../cat/x.html">

Immediately, several problems. Some is about user pref. E.g. Fully qualified url or relative path? And if relative path, relative to parent dir, or relative to web root dir? And there's the ./name.js issue. E.g. For js file link, if it is a js lib, it is required, to have dot slash in front.

Some of these issues, r user preference. So, u might now need a variable to specify that pref. E.g. Http or https? Prefer fully qualified url , or relative link? Relative to parent, or to web root dir? And do u want always begin with ./ or only for js lib link?

Now, suppose u have another domain, say, ergoemacs.org. Now, suppose, on a file in ergoemacs, u paste a path to a file in xahlee.info, and u want to make it a link. Now, obviously, the link cannot use relative path, since they r in diff domain. However, locally, on your local file system, relative links work just fine.

So, now, u have several problems. U need a way, to determine, if a path belongs to a given domain. And u need a function that determines, the path, and the dir the current file is in, are of the same domain. (If so, relative links works, else, need fully qualified url ).

Just the above, needs few days working out. And writing the above, aka the analysis of the problem, came from years of experience working with html.

The other issues are:.

Ok. That pretty much summarize the main issues. Not trivial.

CSS: font-size

screenshot 2022-01-20 233716 fGHp
screenshot 2022-01-20 233716 fGHp
screenshot 2022-01-21 123026 yKvf
screenshot 2022-01-21 123026 yKvf

Programing Language Design: Why You Need Operators

PowerShell: Set Dark Theme

ASCII Characters

PowerShell: Function Inline Doc

Chopper Drones has 4 Rotors, But Not Real Helicopters. Why?


Windows sounds are very annoying. Loud and harsh. Changing the system sound volume doesn't work in all apps. Best is to change the sound.

Windows 10 sound control panel 2021-12-07
Windows 10 sound control panel 2021-12-07

Microsoft Windows 10 default is:

My First Non-Live Money. Thank You.

xahlee youtube donation 2021-12-03
xahlee youtube donation 2021-12-03

Why Tiling Window Manager Sucks (xmonad, ratpoison, dwm, etc)

taskbar folder

c:/Users/xah/AppData/Roaming/Microsoft/Internet Explorer/Quick Launch/User Pinned/TaskBar/

but not all thing on taskbar can be found there. for example, the snip and sketch tool, can't be found.

start menu folder

C:\Users\xah\AppData\Roaming\Microsoft\Windows\Start Menu\

Wolfram live ceo xahlee 2021-11-10 pKfs
Wolfram live ceo xahlee 2021-11-10 pKfs

We probably have some videos from old Wolfram Technology Conferences about OOP - iirc we might have had someone give a talk this year

Wolfram ​but here's one I quickly found https://www.wolfram.com/broadcast/vid...

Wolfram ​YouTube: https://youtu.be/4Q6hOx63b08

Difference Between WolframLang, Mathematica, WolframEngine, WolframScript

xahlee chan 2021-11-07 KV72
xahlee chan 2021-11-07 KV72
xahlee chan 2021-11-07 cxHR
xahlee chan 2021-11-07 cxHR
windows 10 disk manager 2021-11-06
windows 10 disk manager 2021-11-06

WolframLang in 3 different interfaces. Notebook, WolframScript, emacs xah wolfram mode.

wolfram notebook 2021-11-04 k4mK
wolfram notebook 2021-11-04 k4mK
WolframScript 2021-11-04
WolframScript 2021-11-04
emacs xah wolfram mode 2021-11-04
emacs xah wolfram mode 2021-11-04

now, deleted 63 thousand links to wikipedia from my site

xahlee remove wikipedia links 2021-11-03
xahlee remove wikipedia links 2021-11-03

See also: http://xahlee.org/wikipedia_links.html

programing language syntax linearization


programing language syntax linearization is desirable, because, think of lots nested parenthesis like lisp as bash. it actually exist, scsh. Nested syntax is unwieldy and unnatural. hard to work with if you don't have editor designed to work with it. python tries to get rid of it but the nesting becomes multiline with each line beginning by specifying that line's level of nesting, using space. This makes the nesting structure visually clear, but otherwise is worse without editor help. Ruby with begin/end for {} also is nested syntax, just with different glyphs. also worse for editing.

another example of problem of nesting is in human languages, both written or spoken. you don't encounter nesting more than 1 level deep.

there are two aspects, the nested syntax and the nested semantics.


lojban the logical language

very interesting

new or update:

Programing: Why I Hate C. expanded.

xtodo 2021-10-25 discovered a weird situation in WolframLang. something about “context dependent syntax”. WolframLang as far as i know is the lang that does not have context dependent syntax haven't figured out what yet.

when you have a:b

where a and b are arbitrary char sequence. What does it mean?

“symbol” means basically letter sequence. “pattern” means basically particular sequence of letters or punctuation chars.





so, this means, it's not really a “context dependent syntax”, in the sense that the semantics are different for the exact sequence of characters depending on neighboring characters.

which i am discussing in

HTML6, JSON SXML Simplified

Why I Love Powershell

History of Programing Culture. Watcher Auto Run, Ruby, Javascript, Nodejs, Rvm, Npm, Deno

Forkme on Github

fantastic. git in PowerShell across network

git in PowerShell across network 2021-10-17
git in PowerShell across network 2021-10-17

PowerShell vs WolframLang

XahTV 2021-10-15 grep/sed find/replace in WolframLang elisp golang python perl PowerShell

dd = Array[i,{2,2,2}]
Map[f, dd,{1}]
Map[f, dd,{2}]
Map[f, dd,{3}]
Map[f, dd,{4}]
Map[f, dd,{-1}]
Map[f, dd,{-2}]
WolframLang level spec 2021-10-14
WolframLang level spec 2021-10-14

xahlee remove github

lots updates PowerShell Tutorial

xahlee 4chan feelings 2021-10-05
xahlee 4chan feelings 2021-10-05
Microsoft Edge uninstall launch IE 2021-10-02
Microsoft Edge uninstall launch IE 2021-10-02

problem of Firefox and Vivaldi

mornnn. gonna move xaharts back to home. home coming. after 10 years of begging.

yester, spend some 3 hour studying vivaldi and firefox. they both have problems on Windows surface pro. both, does not support tablet touch ui well. but there's one particular problem with vivaldi. that is, if u have over a hundred tabs, layed out on the left pane, so that u have to scroll. when u touch and try to drag a tap, it'll like semi froze for 1 second. it's thinking u r trying to drag the tab, either reorder them or pop out to a new window, but, somehow the touch ui doesn't work well, so it behaves as if u started to drag but doesn't finish. vivaldi froze in semi hell. after few seconds, it suddenly do a big scroll of the tabs pane, or pops out several tabs into own window. . the touch interface is very tricky. it is not exactly translate or received by windows as some equivalent mouse operation. also, with a active pen, it's different too from touch. active pen more ends up as some mousing equivalent. but touch, sometimes does nothing. u have to activate the ms virtual touchpad to do something. for example, ublockorigin on firefox. u goto a site, click the extension icon, and suppose u want to click the js to toggle it. if u do touch screen, it simply cancels the ublock popup. so, no way to use touch to operate the ublockorigin popup. u have to turn on the os's virtual touchpad. also, both vivaldi and firefox do not support right swipe to go to previous page. note that, google chrome, brave, ms edge, do not have these problems. what a pain it is with open source. very interesting phenomenon. not supporting touch back swipe pretty much makes the browser unusable on tablet. also issue with both vivaldi and firefox on touch screen is that, sometimes, after a while, the touch has no effect at all. it just put 'focus' on whatever u touched, but no actual click. u have to restart vivaldi or firefox.

Xah Discord Artwork

But with JavaScript based, if you want xml correctness, namely, no unencoded & < > chars, you still have to encode them in html. This, detracts the major attraction of JavaScript based method, because it means, you still have to go thru a encode/decode process per each source code section. Much of the advantage of JavaScript based method is lost.

here's example of unreadable problem of html markup method:

syntax coloring problem 2021-09-26 Skcv
syntax coloring problem 2021-09-26 Skcv

WolframLang: Detect Zero Vector

Convert Indexes of Nested Array to Index of Flat List

Unicode Squared Characters

Powershell, even though well designed, but i think it's too elaborate. The syntax is fairly complex. The complexity came from 2 parts. One is the need to make the syntax not nested, so easy to type on terminal as single line code. Two is the .net object behind it. So, lots conversion between text stream and object, and property and methods. Adding the syntax to call .net methods, it adds another entirely different syntax to do things. And the .net method call is actually much more efficient. This makes the code not uniform, cuz u have to chose whether to use powershell idiom or call the dot net. The dot net is unavoidable anyway, because many its things doesn't have a powershell equivalent.

CPU Speed Benchmark, BogusMips in Perl

Tab vs Space in Source Code

Questionable design in Wolfram Language

Seems, in the past few years, Wolfram Language introduced lots of function or constructs or syntax, that am not sure is good. Too much needless redundancy. For example: The (x |-> x+1) notation for (#+1&). The arrow notation is certainly more clear, but there is already a most clear canonical form : Function[x,x+1]. In terms of typing convenience, the ampersand notation is more concise and easier to type. Also, the ampersand notation is less likely to have name collision.

kenkangxgwe WolframLang design 2021-08-05
from 康小广 @kenkangxgwe 2021-08-05

that's a good point. So, when a pure Function is nested, the ampersand notation will fail. (because that's when use of different variable names helps, unless we get into combinators, which is inapproriate because it becomes very complicated application of functions)

but still, when you have a nested pure function, it gets very confusing. It is almost never used.

another example: CoordinateBoundsArray. This can be trivially done with Table or Array

WolframLang syntax coloring semantic aware 2021-08-04
interesting. WolframLang semantic aware syntax coloring

comp lang syntax design thoughts extempore.

when designing the syntax of a language, there's a issue of token separator.

for example, look at this emacs lisp code:

(a-b x)

there, the dash char is connected with adjacent char. But, in python for example,


will mean

a - b

so, the concept here is token separation. Now, the simplest way is to have a designated char for this purpose, no exceptions. The most common char for separator is space. However, note some issues here. For example, in emacs lisp:


there, note there is no space between parenthesis and the char “a”. However, it's still considered separate tokens.

So, here, another rule is used to separate tokens. Namely, we classify chars into certain class, let's call it contiguous-class. When you have a sequence chars, and if they are all in contiguous-class, then, this sequence is one token.

common example of this contiguous-class of chars is the letters a to z and A to Z, and also underscore _. When it comes to dash, languages differ, as we can see in lisp vs python examples above.

so, so far, we have 2 ways to separate takens. One is by a designated char, such as space. Another is by defining a set of chars that we consider are contiguous. Note that, these 2 rules can be combined. In fact, in most langs, they are, such as in emacs lisp and python.

now, my interest is on this issue. Which is a better design?

a designated char is the most simple, elegant. Though, it may introduce inconvenience. For example, you can't write 1+2 anymore, you have to add space in between.

if we go with contiguous-char-class, by itself without any designated token separator, it's also quite simple and elegant. Though, there are a few issues.

First is that, usually you want to allow unicode chars such as greek letters, and also digits, in this class. e.g. you may want to have a var named x1, x2. Or, α, β. Or, even with chinese chars, and other math symbols such as ƒ1, ⅈ. Also, whether to include the dash is a issue. If you include the dash, but your lang doesn't have any other char for separator, then that means you can't write a-b to mean substraction, likewise nor a*b, a/b, and you can't have semicon adjacent to your var name, nor any punctuation. Also, common syntex of operators such as ++ -- :: ** can't be used because they are not contiguous-class, each will mean separate symbols.

that's it for now. will have to continue this later.

basically, the issue is to explore the syntax design of token separator, survey existing cases, analysis pro and con of designs, distill the rules, find the best…

incredible things related to ⏎↩ ⌤. aspects of: writing systems, computing, notation, input method, key label, unicode, nomenclature. lots history. why is it called carriage return? what carriage what return?

just realized, when “sharing” photo from google photo app android phone to discord app, it upload the original huge sized.

new book by Stephen Wolfram amazon. Most of it is on Wolfram's blog. https://www.wolfram.com/combinators/

xah YouTube 3k subs 2021-06-24
woot. 3k subs. minor giddiness conditioned n directed by google empire.

Convert Video from Different Formats

Meaning of Symbolic Pattern Matching Languages

The Mathematica Book Online

Wolfram Language Clones

Lots people asked me for this. I recommend just buy wolframlang, start with the free engine or script. Focus on mastering math/AI. Don't get dragged into opensource corp drama.

UNIX Tar Problem: File Length Truncation, Unicode Name Support

Technical Writing: Fruit Apple Banana vs X Y Z

some old essays. reviewed.

perl, officially dead for me

these perl scripts, was on my site, but sometimes during 2010, due to the newfangled github, every joe and their dog has a github account with code, i moved them to github. A mistake. NEVER follow fashion and fads or the corps. Now, i move them back on my website.

I think i finally, officially, will no longer code any perl. Perl, was my first industrial language. Coded it in a job for 4 years during the dot com days

See also: history of computing, year 1999. you can search what these people are doing now. Perl: Send Email Perl: Send Email


Windows: Delete Lockscreen Background Image

Moving Button UI Problem

PowerShell: Windows Registry

Xah Github Punch Card

Unicode Jargon “Code Point” and Notation U+03B1

Which Faakhead Invented Hello World?

hackers, pet worms of the establishment

2021-06-01 dear hackers: Ever watched the matrix, or star wars? where good guys fight the big bro? and ever seen opensorce fsf fanatics shrill against corps? am starting to think, such imagery is intentionally crafted by the establishment, tickles the good guy psychology, so u remain small n inconsequential.

Microsoft Windows Logo history

In-place Algorithm for Reversing a List in Perl, Python, Lisp, Mathematica

xahlee.info site traffic

Logo Design in Software Industry
major update

Why Does Struct Datatype Encroach Namespace?

Year 2009. Why I'm Switching from Mac to Windows
this answers those question about, which one should you use, Mac, linux, or windows

PowerShell: Backup Script Example

PowerShell Tutorial
worked a lot on it. starting to take shape.

computing history, 2010. interesting in revisting old articles is to see which link went dead, why, squatter, what happen to people, which stood test of time, how things changed etc.

working on PowerShell

2021-05-23 Gosh. Worked on PowerShell so much in past week. Feels like am now a semi-master of powershell. Lol. Well, comfortable in using it at least. In fact, i know more about it than bash now. Never studied bash. And my reason for digging into powershell, or a shell lang, is that i discovered, over 10 years, a realization, that shell lang actually is a lang designed for working with files. For example, many things that's 1 line of shell pipe, requires 5 to 10 lines of perl python, or 20 in elisp golang. And @Georrg helped in that realization few months ago. I've written a essay about this One Language to Rule Them All? Or, What Language to Use for Find Replace?. And the interesting question i want to explore is, can a general purpose scripting lang, such as perl python ruby, or even lowish level golang, be designed to have a shell-style language characteristics (with pipes etc), and yet lose no good properties. Am inclined to think yes. Primarily, the lang just need a generic postfix operator, and functional lang in nature. In fact, i'd think Wolfram Lang is already 90% it. Just need to change some syntax to avoid nesting. (but this is not a trivial problem. for example, dealing with matrix and trees.)

Windows: Registry Tutorial

Unix Pipe as Functional Language
minor update

Should Array Index Start at 0 or 1?
minor update

Python Sucks, Function vs Method

major update. Python by Example reformatted the function documentation of most pages

browsers are spyware

Chrome browser, image are blurred

strange, in Chrome browser (and Microsoft Edge and Brave), image are blurred.

chrome browser image blurred 2021-05-14
chrome browser image blurred 2021-05-14

open the above image in Firefox to see the difference.

Saga of Updating Nvidia Driver

Clojure Sigils Meaning
formatting update.

pepe go lang FSYcd
pepe go

Golang Tutorial

new page and updates and some just reposts.

google snippet why window manager suck 2021-05-07 X2ycK
google snippet why window manager suck 2021-05-07 Why Tiling Window Manager Sucks (xmonad, ratpoison, dwm, etc)

posted a comment on youtube https://www.youtube.com/post/UgxwvtdABUf1SJTJjYx4AaABCQ go there and comment, related to things about my livestream

Blog Archive