Xah Programing Blog Archive 2021-05
new.
My First Non-Live Money. Thank You.
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\
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
WolframLang in 3 different interfaces. Notebook, WolframScript, emacs xah wolfram mode.
programing language syntax linearization
2021-09-11
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.
(3+4)*2
lojban the logical language
very interesting
new or update:
Why I Hate the C Language. 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?
- if a is a symbol, then it's same as
Pattern[a, b]
. - if a is a pattern, then it's same as
Optional[a, b]
.
“symbol” means basically letter sequence. “pattern” means basically particular sequence of letters or punctuation chars.
example:
a:b Pattern[a,b] a_:b Optional[Pattern[a,Blank[]],b] _:b Optional[Blank[],b]
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
History of Programing Culture. Watcher Auto Run, Ruby, Javascript, Nodejs, Rvm, Npm, Deno
fantastic. git in PowerShell across network
PowerShell vs WolframLang
Xah Talk Show 2021-10-15 grep/sed find/replace in WolframLang elisp golang python perl PowerShell
dd = Array[i,{2,2,2}] MatrixForm@dd Map[f, dd,{1}] Map[f, dd,{2}] Map[f, dd,{3}] Map[f, dd,{4}] Map[f, dd,{-1}] Map[f, dd,{-2}]
lots updates PowerShell Tutorial
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.
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:
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 dotnet object behind it. So, lots conversion between text stream and object, and property and methods. Adding the syntax to call dotnet methods, it adds another entirely different syntax to do things. And the dotnet 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 dotnet. The dotnet is unavoidable anyway, because many its things doesn't have a powershell equivalent.
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.
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
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,
a-b
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:
(a-b)
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/
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
- File Aliases Considered Harmful
- Windows Vista VirtualStore Problem
- Linux Dot File Problems: .svn .htaccess .DS_Store etc
- Perl: Validate Local Links
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.
- Perl Scripts For Removing Mac Resource Fork, .DS_Store, Thumbs.db etc
- Perl: Report Files Resource Fork
- Perl: Delete Image File Resource Fork
- Perl: Delete Macos9 Icon File
- Perl: Check Bad Filename
- Perl: delete_DS_Store
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
c:/Users/xah/git/xahscripts/file_util/
Xah Github Punch Card
updated
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.
In-place Algorithm for Reversing a List in Perl, Python, Lisp, Mathematica
Logo Design in Software Industry
major update
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 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.)
Unix Pipe as Functional Language
minor update
Should Array Index Start at 0 or 1?
minor update
major update. Python Tutorial by Example reformatted the function documentation of most pages
browsers are spyware
- https://digdeeper.neocities.org/ghost/browsers.html
- https://wiki.techxodus.org/en/Internet_Browsers
Chrome browser, image are blurred
strange, in Chrome browser (and Microsoft Edge and Brave), image are blurred.
open the above image in Firefox to see the difference.
Clojure Sigils (Magic Characters)
formatting update.
new page and updates and some just reposts.
posted a comment on youtube https://www.youtube.com/post/UgxwvtdABUf1SJTJjYx4AaABCQ go there and comment, related to things about my livestream