Xah Programing Blog

Syntactic obsession, imperative despisal, unicode ♥, hacker hate

Xah Programing Blog Archive

#golang slice append problem. very subtle.

golang append problem 2019-06-17 q8yss
golang append problem 2019-06-17 q8yss

Golang: Slice

why reference is harmful

with more experience of golang, i find that it's not as high level as perl python ruby lisp bash. kinda middle, between those and C. golang code is some 1.3 times longer than python. Dealing with “references vs copy” is more pronounced.

the concept of “reference”, is truly the worst concept in programing. It is the number 1 source of bugs. I got stung by it in golang since yester. 4 hours spent so far. unable yet to describe what's going on clearly.

things like references, int, float, double, etc, is what i call software engineering side effect; underneath mumble jumble. typically, the gaggle of industrial programers are excited by these. Thus, the current fad of rust.

the problem of references shows up most when you deal things like “slice”/assignment of array/list (or nested) and trying to modify it. Result is one bag of transparent spaghetti.

one obvious way to fix the reference confusion, is to make it always explicit. so, instead of var x = [3,4,5], make it x = ref([3,4,5]). something like that.

This is the reference problem of #golang:

var aa = sliceX[:n]
var bb = append(aa, 3)
// sliceX is now modified, it has 3 at pos n. wtf!

to fix the code, one has to start to make copy of things. to fix this in low level langs, am thinking, make ALL ref explicit? so that programer always know which is a copy or not. i understand ref is necessary in low level langs, but the implicit confusion is what i object to.

why i love golang


Urbit, Decentralized Server Platform

i wonder how Curtis Yarvin a.k.a. Mencius Moldbug is doing.

i never understood what curtis yarvin is saying. he likes to play with writing with holier than thou tone, but am not sure any understand. i think only yhose who studied political history for few years. also, he's got a thing against Noam Chomsky. what gives?

Curtis Yarvin left urbit https://urbit.org/posts/a-founders-farewell/

intro to urbit https://urbit.org/primer/

“we created urbit to leave internet behind”

the official urbit intro is confusing, even to experienced programmers. wikipedia intro is better https://en.wikipedia.org/wiki/Urbit

Urbit is a decentralized personal server platform. Each person (a programer), runs it on his own machine. This system, replaces centralized cloud servers such as amazon, google. But also, replaces all web apps such as facebook, twitter, slack, etc, whole internet.

Urbit is a decentralized OS, written from scratch since 2002. The OS is called Arvo, written in new functional langs Noon and Nock. Address space based on Ethereum blockchain. Communication is encrypted p2p using UDP.

blogs as history, and nature of dead links

Google Chrome, SPDY Protocol, Browser War II

when you write blogs, you leave a trail of history. This is year 2010. Sometimes, even you forgot what you were talking about.

looking back 10 years ago, Google's tens of sites singing html5/webgl/webworker etc are now dead link. i used to hate dead urls. But now, i realize it's a necessary fact of life. Links living forever (say just 10 years), is not just an ideology, but impossible.

vast majority of websites, serves a commercial purpose. (e.g demo of html5, tutorial of tech now 10 years old, etc.) When that purpose is gone, or the company gone, link becomes dead, and necessarily so.

programing video goes dinosaur

looking back at some videos from 2012, 2013 etc, JavaScript tech talk. lol. millions of programing related videos must've gone dinosaur. this is new. before, only programing text or books, go dinosaur.

new version control system. written in rust https://pijul.org/

unicode box art 2019-06-12 nv9rm
unicode box art 2019-06-12 nv9rm

Unicode Box Art ░ ▒ ▓

git history 2019-06-12 q9cy5
the rise of git, year 2012.

Unicode Phoenician 𐤈

package manager for Microsoft Windows, scoop, chocolatey

seems there are lots new package managers for Microsoft Windows

new nav box

unicode search pot 2019-06-02 4p82h
unicode search pot 2019-06-02 4p82h

Unicode Search ∑ ♥ 😄

some testimonial for my stuff. I need to put them somewhere. put it here for now.

screenshot 2019-01-04 c0e4a

Just need to say. I love @xah_lee website. Choc full of useful info of useful information.

2017-04-23 https://twitter.com/fleontrotsky/status/856217970913271809

A lot of content here: http://xahlee.info/index.html Very impressive! By @xah_lee

2017-04-19 https://twitter.com/leifbattermann/status/854592033452945409

Yep. I'm Nigerian programmer living in Nigeria. I really enjoy your articles on ergonomics, emacs, programming languages etc

2017-04-20 https://twitter.com/SegunOlulana/status/855047691692199936

unicode lambda is named lamda, no b

unicode lambda lamda 2019-06-01 vpvwz
unicode lambda lamda 2019-06-01 vpvwz

interesting that in unicode, lambda is named lamda. However, there is a char named lambda: ƛ LATIN SMALL LETTER LAMBDA WITH STROKE

see Unicode: Greek Alphabet α β γ

here's interesting things about lambda

greek lambda 2019-06-02 398fk
greek lambda 2019-06-02 398fk

apparently, it's pronunced with b in ancient times.

pronunciation as [laːbdaː] (λάβδα) in Classical Greek times. In Modern Greek the name of the letter, Λάμδα, is pronounced [lamða].

also note, its relation with Latin letter L and Phoenician letter Lamd 𐤋 and the Cyrillic letter El Л л

phoenician 2019-06-02 sc7t3
phoenician 2019-06-02 sc7t3

copy a directory sans .git

this sucks major. there is still no command to copy a dir sans .git. unix cp command can't do neither.

added insult is that golang no have copy dir builtin.

Microsoft Ceases JavaScript Tutorial and Reference

apparently Microsoft no longer have a text version of their JavaScript tutorial and reference. It existed for 15+ years. Now defunct. Their reference link now point to mozilla. http://msdn.microsoft.com/en-us/library/hbxc2t98.aspx

Examples of Quality Documentation in Computing Industry

video chat site

this site https://meet.jit.si/ , allows you to video chat with friends, also can stream to YouTube. very easy to use.

todo possibly fix ocaml

.tuareg-font-lock-governing { color: #000000; font-weight: bold; }
.tuareg-font-lock-operator { color: #a52a2a; }
.tuareg-font-lock-constructor { color: #000000; background-color: #f0fff0; }
.tuareg-font-lock-module { color: #228b22; }

ASCII Characters ␀ ␣ ¶


latin to rune 2019-05-24 tzjnz
Unicode Rune ᛗ

unicode code bug and (original) jargon file

this unicode 🐛 , named bug, but seems to be displayed as caterpillar all across. i don't think most people picture “bug” as a caterpillar or worm.

jargon file bug 2019-05-22 872pf
entry for “bug”, from jargon file 1983 v1.5.0 Guy Steele


unicode math font 2019-05-20 xtq5p
Math Font ℤ ℚ ℝ ℂ

Why is Array Access Constant Time

Computer Languages Characters Frequency (added haskell)

github: abuse detected

if you search github with JavaScript off, you get abuse detected.

github abuse detection 2019-05-13 nn82f
github abuse detection 2019-05-13
Scott Meyers cpu caches cvn6x
Scott Meyers cpu caches
code::dive conference 2014 - Scott Meyers: Cpu Caches and Why You Care
NOKIA Technology Center Wrocław
Published on Jan 5, 2015

Programing Language and Its Machine

Google Chrome 59 (~2017-07)

chrome now has new dev features.

Press F12, then press Ctrl+Shift+p

And it'll show command menu.

Type “screenshot” to do a screenshot.

The file is saved in your download folder.

take screenshot in Firefox by command line

goto web dev console 【⌘ command ⌥ option k

:screenshot --fullpage filename

The file is saved in your download folder.

Firefox removed the Shift+F2 to get to a command line. Removed that feature entirely. Truly annoying. since ~2010, user interface changes unpredictably. The trend began with Google.

2019-04-12 Note, the Developer Toolbar (aka GLCI) feature has been removed around 2019-08. Now, to do a screenshot, use the triple dot showing in the url field.

to take a screenshot in Firefox, press 【Shift+F2

xah talk show 2019-05-10 mouse, spin wheel, linux, closure, perl, lisp.

Golang: Closure

java the trap

java 8 211 license 2019-05-08 g2s4b
java 8 211 license 2019-05-08 g2s4b

Java, the open source farce. From a trap, to rms embracement, to sold soul, to corp struggle.

java 8 211 license 2019-05-08 j8ypd
java 8 211 license 2019-05-08 j8ypd

Java, Sun Microsystems, the crimes of humanity. year 2002. Jargons of Software Industry

Microsoft linux

Microsoft linux 2019-05-08 srk2z
Microsoft linux 2019-05-08 srk2z

iterator generator abomination

the whole iterable iterator generator generator function in JavaScript is a abomination. In fact, these concepts, are abomination.

see JS: Iterable

Programing Elegance vs Simplicity

JavaScript String Problem

Official Java Tutorial on Interface, the Inanity

i wish i had documented how around y2k, at the height of object oriented programing (and OOP based database!), lots idiotic articles about how anything with a hierarchy is OOP.

Optional Function Parameters in Computer Language Docs (the idiocy thereof) (added a new example)

just noticed, unicode does not have the classic Soviet flag with Hammer and Sickle .

Unicode Flags 🏁

gonna be offline for 2 days.

brave browser just crashed for me for the first time. and i lost 10 old existing tabs. They are my todos, but now i don't know what they are.

maybe that's god's way of telling me, if you don't do now, it's never gonna be done. forget your old todos.

Google Do Evil (new item added)



todo to read http://slade.jnanam.net/

Golang: String, Byte Slice, Rune Slice (more update)

Russ Cox (a dev of golang) wrote a article “generics dilemma” in 2009 https://research.swtch.com/generic Does that fairly capture the situation? and, are there updates?

UTF8 History

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

linux. this article, gracing hackernews, reddit, 4chan again.

Golang: Function (updated)

Google Plus is officially closed down today

here's some old articles about it

with Google Plus gone, a chunk of web history is practically erased. here's a famous article by Steve Yegge, year 2011 Steve Yegge's Google Platforms Rant by the way, he quit Google

remove google plus links 2019-04-03 kxg3g
removed 679 links to Google Plus on my sites

Unicode Ethiopic

internet badges 2005 v49bh
internet badges 2005 v49bh

Golang: String (minor update)

The TeX Pestilence (Why TeX/LaTeX Sucks) video added.

i won't be adding xah talk show videos here. For additions, see Xah Talk Show

more python 3 update:

Python: Copy Nested List, Shallow/Deep Copy (updated to python 3)

Unicode Cyrillic Ж

Python: Compress/Decompress Gzip Files (updated to python 3)

more python updates

Python: Convert File Encoding (python 2 and 3)

Python: Count Word Frequency

more python 2 to 3 update. 70% complete.

[Open Source Doesn't Make Money Because It Isn't Designed To Make Money By Ian Bicking. At http://www.ianbicking.org/blog/2019/03/open-source-doesnt-make-money-by-design.html ]

What's Disjoint Union, Sum Type?

more python 2 to 3 updates:

Python: File Path Manipulation (updated to python 3)

Xah Talk Show

a new index page. starting to collect all the videos i've done.

converting my #python tutorial from 2 to 3. going well. 50% complete. here's one article. Python Understanding Sort Python: Sort

todo. old rant. dated 2006 or so. not sure where to put it yet.

Python's “sort” method's optional parameters: “key” and “reverse”

Most of the time, sorting is done for a list of atomic element such as [3,2,4]. This is simply done by myList.sort() without any argument. Other than simple list, sort is frequently used on matrixes (For example, [[2,6],[1,3],[5,4]]). For matrixes, almost always a particular column is used for the basis of ordering. For example, if we want to sort by second column, we do: li.sort(lambda x, y: cmp(x[1],y[1])). Since this is frequently used, Python provides a somewhat shorter syntax for it, by specifying the column used as the ordering “key”.

li.sort(key=lambda x:x[1] ) # is equivalent to the following
#li.sort(lambda x, y: cmp(x[1],y[1]))
print li; # prints [[1, 3], [5, 4], [2, 6]]

Because the Python compiler is not very refined, this specialized syntax is algorithmically a order of magnitude faster than the general form lambda x, y: cmp(x[1],y[1]).

That is to say, the programer must now learn 2 syntaxes for the ordering function, one general and one specialized, and he must choose the right one otherwise he will be penalized by a magnitude of slow down. This also means that, in order to make the right choice of the syntax, the programer must known in advance of the nature of the list to be sorted.

Another idiosyncratic provision is the optional “reverse” argument. This parameter is necessary when using the “key” parameter. Normally, when using the order comparison function lambda(x,y), the ascending/descending nature can be changed by simply switching the parameters x and y. But now a single key=lambda(x) can't provide that, thus another optional parameter “reverse” is provided.

The following are equivalent:

Of course, one can reverse a list by the reverse() method for lists. But li.sort(…).reverse() is algorithmically another order of magnitude slower since Python compiler is not smart.

The official doc on Python's sort method is at (bottom): http://python.org/doc/2.4/lib/typesseq-mutable.html

Don Hopkins has put up his famous article The X-Windows Disaster on his blog now. https://medium.com/@donhopkins/the-x-windows-disaster-128d398ebd47

todo. remove reference links in js pages, example: JS: Prototype and Inheritance

G H Hardy, a Mathematician's Apology is a old mathematician's rant. here's some info https://en.wikipedia.org/wiki/A_Mathematician's_Apology Hardy is a elite, pompous type of guy. (remind me my youth) He wrote the book when he felt he's done for. It reeks negativity, discouragement, and his pompousness.

The “Patterns Of Software” by Richard P Gabriel guy is a programer (lisp language) and entrepreneur of his rather failed company. It's also kinda a negative, apologetic, tale, and i find bad advertise and no insight. i wrote a review in 1998 http://xahlee.info/comp/bookReviewRichardGabriel.html

come to think of it, these 2 books i dislike for the same reason.

god, truly despise python. every time i work with python, lots of pain. Guido is such square that he always tried to be formal but result is very lousy.

and python doc is truly the worst. unreadable, unsearchable, it tries to be formal, but is pure shit.

TypeError: unsupported format string passed to list.__format__ fuck python

this is ok in python 2 print("{:s}".format([7, 8])) but in python 3 it's error. you need: print("{:}".format([7, 8])) fuck python

i'll have to do xah talk show on python and guido. Guido the character i can diss for 1 hour. He's a square, but not too bright. He like formality (eg PEP), but always come up with semi crass. He thinks his lang is easy, but compare to others it's complex, rigid, and inflexible.

the python 2 to 3 incompatible switch also reflects his personality. He thinks he's god of elegance and want to pursue perfection, that's why. and he's got this passive-aggressive personality. Polite, but between the lines in his writings, reeks haughtiness.

TypeError: unsupported format string passed to list.__format__ to understand the error, u have to know object method and its relation to function. Entire Python lang n doc is like this opaque. cuz the guy thinks he's building a tower. To him, it's clear, not anyone else.

The change actually happened with python 3.x This works in python 3.2.3 print("{:s}".format([7, 8])) but not in 3.7 Fuck #python

python builtin functions 2019-03-18 vyj67
python builtin functions 2019-03-18 vyj67

here's another python lang problem. It got this list of builtin functions. A hodgepodge of inconsistency with its object model. Note that lots langs has such problems, but Guido and gang, has an attitude problem. They tend to expressly insist it's all right.

python range doc 2019-03-18 wpqm4
python range doc 2019-03-18 wpqm4

i was looking why #python range(1,10,0.5) no work. Note the wording in the doc began with “Rather than being a function”. That's typical of Guido's writing. passive-aggressive. Always trying to color it, and with holy jargons. And note it shows 3 links. Which to click 1st?

brave browser has a new bug. when you open a new tab and type fast, the first letter you typed got wiped out.

xah blogger history 2019-03-16 h59tc
xah blogger history 2019-03-16 h59tc

blogger. history. how many dead links are there?

and by next month, there will be another billion link corpses, Google Plus.

the #python community is blowing up with things like jupiter spyder numpy scipy numba pandas etc things for machine learning/data science. is there similar for #ruby?

Python 2 and Python 3 Difference (updated)


todo. from Aaron Hall @aaronchall

Even in batteries-included-Python world, there are external libs you'll be expected to use. requests is one. others include:

Rule of thumb: If Anaconda gives it to you by default, trust it's worth coding with.

python anaconda

installing python anaconda. what a stupid name.

anaconda 2019-03-13 w7r7q
anaconda 2019-03-13

whopping 2.6 gigabytes.

i heard, from friends, this is good python distro. It includes everything. especially for machine learning, math packages, etc. seems good.

after you install anaconda, then you have /Users/xah/anaconda3/bin/python then you can just use that python. ignore everything else. lol this is for those of you dinosaurs like me.

Unicode Braille ⠮

sgi logo 2683m-s289x217
SGI Logo Visual Illusion

minor update.

Unicode Rune 2019-03-15 3qdbt
Unicode Rune ᛗ

Unicode Korean

Unicode Japanese の

unicode chinese 2019-03-05 7dyr3
Unicode Chinese 中文

new, on their own pages

Linux: Convert File Encoding with iconv (minor update)

screenshot 2019-03-03 xy6m6
Unicode Japanese
unicode linear b 2019-03-05 v8zbc
Unicode Linear B 𐂂

Designing Data-Intensive Applications

came across this book

[Designing Data-Intensive Applications: The Big Ideas Behind Reliable, Scalable, and Maintainable Systems By Martin Kleppmann. At Buy at amazon ]

Xah Programing Blog Archive

If you have a question, put $5 at patreon and message me.