Xah Programing Blog Archive 2019-06

semi functional languages, JavaScript, golang, for loop problem

when coding in a semi functional language, eg JavaScript or golang, you have the problem of avoiding for loop but can't. In golang u just can't. In js it's more complicated. (1) map/forEach etc are loop by spec. (2) iterable don't have forEach method unless you convert to array.

See also: Programing Language: Syntactic and Semantic Difference of Map Function

question to xah 2019-06-28 k4fzk
question to xah 2019-06-28

LISP Infix Syntax Survey

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.

golang slice append problem. very subtle.

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

Golang: Slice

unicode look alike chars 2019-06-21 jx73y
unicode look alike chars 2019-06-21
unicode ocr 2019-06-19 66j2v
unicode ocr 2019-06-19

Unicode in Function Name and Operator

major update

math in JavaScript. doesn't taste good

math in js 2019-06-18 yrzsw
math in JavaScript. doesn't taste good.

this is when you need math langs, e.g. Julia, APL, Mathematica, Matlab. syntax matters.

screw programing langs that do not allow ⊕ in function names. e.g. JavaScript python golang java. those allow includes perl, ruby, emacs lisp, Mathematica.

fsf and open source has become a ideology weapon of big money corps, championed by google apple now Microsoft, with code of conduct. Each programmer is robbed into nothingness. only way to live is work for these corps.

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

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

Unicode Search ∑ ♥ 😄

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

mogakumono xahlee 2019-01-04 c0e4a
mogakumono xahlee 2019-01-04

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

2017-04-23 [ twitter fleontrotsky ] [ 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 [ twitter leifbattermann ] [ 2017-04-23 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 [ twitter SegunOlulana ] [ 2017-04-23 https://twitter.com/SegunOlulana/status/855047691692199936 ]

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.