HNHacker News
TopNewBestAskShowJobs

rml

237 karma · joined July 21, 2007

submissionscomments
rml··on How I am deeply integrating Emacs
This is a very good feature/workflow based intro

As the years go by one realizes that even these “features” like Org, Dired, etc are just illusions in some sense. They’re just Elisp code someone else wrote and put a name on. You can take or leave them or write your own code that changes/advises/customizes them.

It’s all up to you. You don’t need a blessed “plugin” architecture, some PM at IntelliJ’s permission etc

At some point one realizes the “visual shell” nature of Emacs. Every single piece of text on screen can be programmed to “mean something” (see also: “recognizers” from human interface research) and have actions taken on it either by the editor itself, or external processes / scripts you call with a command. If it’s common enough, make a key binding. It’s your house, do what you want

Depending on how you set up your environment, you may never have to look at text again that you do not have this level of power over. You are no longer at the mercy of “application developers”

I’ve been using it since 2005. Guess how many of 2005’s popular editors even still exist

My recommendation to anyone trying to actually learn is start with the full vanilla config, weird default keybindings, etc, go through the built in tutorials, and only add things to your config that you write and understand yourself. Understand it in its own terms. The plethora of packages, etc have “cool features” but impede learning by adding mountains of complex dependencies that are opaque to the beginner and cause confusion IMO

rml··on I used standard Emacs extension-points to extend org-mode
If you want to learn how Org mode works, start by reading outline.el

then read Dominik's outline-magic.el

then see how far you can get with your own customizations on top of that to augment, e.g. plain markdown text

you may find you're doing well at that point and don't need to deal with the 100k+ line beast that is Org, nor its transitive dependencies

at that point you will really understand (that part of) Emacs, and will no longer see Org as "a discrete thing", but just "some code someone else wrote" that you can take or leave

rml··on Amish men live longer
see also:

https://pmc.ncbi.nlm.nih.gov/articles/PMC1695733/

rml··on New Mexico is first state in US to offer universal child care
In the book 'Double Entry' the author explains that the guy who created GDP was actually in favor of having family caregiving and household activities accounted for in GDP. If that had happened, different world
rml··on The sisters “paradox” – counter-intuitive probability
For something this small we can enumerate all the cases (this is a Scheme version of the Mathematica `Tuples` function)

    > (list-tuples '(B G) 2)
    ((B B) (B G) (G B) (G G))
3 cases have at least one girl

of those 3 cases, 1/3 are both girls

rml··on Paradise Lost
This kind of writing is what I browse the internet for.
rml··on Windsurf employee #2: I was given a payout of only 1% what my shares where worth
The classic article on this topic is https://steveblank.com/2019/04/10/startup-stock-options-why-...

Nothing has substantially improved since the article was written. With “forever private” companies it’s only gotten worse.

rml··on Dispatches from the farm upstate
FWIW the stuff about dealing with the Feds only applies out west AFAICT

There’s lots of rural land in the northeast where you can basically just go to your small town hall and get whatever done without much hassle. Or just don’t tell anyone and nobody cares (if it’s actually rural enough)

Also in the northeast many areas are depopulating due to folks aging out, so there is land available (as long as you avoid the popular NYC and BOS-adjacent areas)

Fair warning you will need to accept that other people may not share all of your “correct” opinions but they will probably still be kind enough to help you IRL with a flat tire or digging your truck out etc :-)

rml··on Internet Archive forced to remove 500k books after publishers' court win
> And even when IA temporarily stopped limiting the number of loans to provide emergency access to books during the pandemic—which could be considered a proxy for publishers' fear that IA's lending could pose a greater threat if it became much more widespread—IA's expert "found no evidence of market harm."

I feel that IA erred very badly in lifting the one-to-one correspondence that is at the heart of "controlled digital lending" (https://controlleddigitallending.org). It is frankly annoying that they did that, and then still purport to be doing CDL, even though the CDL website clearly states the 1:1 "owned-to-loaned" ratio is a key part of the CDL platform.

For the record I'm extremely pro CDL, but I feel the IA did not do any favors to the CDL movement with this boneheaded "activist" implementation of CDL

rml··on We've been put in the vibe space
I find this to be true in many areas of life, esp. in recent years. My perfect trail running shoe was made in 2006. My perfect car was made in 2008. Those products are no longer made, and the new ones are not "better", just "different". (Often worse tbh)

We get to buy the product someone is willing to make, not the product we want to buy. The product is often not "better" for the user, but for the company making it. And as a user you can just FEEL it dripping from every new thing. It's not appealing at all to me.

There must be an economics term that describes this. I've taken to calling it "supply side rules everything around me"

rml··on Tips on how to structure your home directory (2023)
I'm glad people keep writing these "how I set up my computer" articles because it's how I learned almost everything I know - thanks to the kindness of internet strangers.

anyway here's my idiosyncratic setup, would probably be terrible for anyone else:

everything goes in Dropbox (paid 2TB account)

my Dropbox subfolders are organized by broad filetype, e.g.

    ~/Dropbox/{Code,Documents,Videos,Downloads}
on a new computer I install Dropbox and create symlinks, e.g.

    /home/rml/.emacs   -> /home/rml/Dropbox/Code/personal/config/dot-emacs
    /home/rml/.Xinitrc -> /home/rml/Dropbox/Code/personal/config/Xinitrc
    /home/rml/Code     -> /home/rml/Dropbox/Code
    ... etc
Because I pretty much live in Emacs and manage files using `dired` I have lots of Elisp code and custom keybindings that take me to my most-used files and directories. For other "tier 2" things I either know where they are due to long habit (most stuff doesn't move or it's obvious which folder e.g. a PDF will be in) or I use a combination of `M-x locate` and `M-x grep` which works pretty well.

Re: concerns about "where apps store stuff" I mostly don't care because everything I care about is in Dropbox. If it's something I use a lot, its config is symlinked in wherever the app expects it to be - otherwise everything is a few `dired` commands away.

(On macOS `M-x locate` can be configured to use the builtin `mdfind` which works very well for finding things IME. I think it's what drives Spotlight.)

At some point I may set up 'recoll' and all that but so far I haven't needed it so I haven't paid the complexity tax of trying to configure that across Windows/macOS/Linux vs. good old locate/grep

FWIW because I limit myself to a "standard" set of apps (Emacs, browser, VLC, PDF/image viewer) the above setup works pretty much the same across Windows/macOS/Linux, so most of the time I don't have to care that much which system I'm typing into

rml··on Show HN: Purl – A Simple Tool for Text Processing
more examples (from https://softpanorama.org/Scripting/Perlorama/One-liners/tom_...)

    # add first and penultimate columns
    perl -lane 'print $F[0] + $F[-2]'

    # print just lines 15 to 17
    perl -ne 'print if 15 .. 17' *.pod

    # in-place edit of *.c files changing all foo to bar
    perl -p -i.bak -e 's/\bfoo\b/bar/g' *.c

    # command-line that prints the first 50 lines (cheaply)
    perl -pe 'exit if $. > 50' f1 f2 f3 ...

    # delete first 10 lines
    perl -i.old -ne 'print unless 1 .. 10' foo.txt

    # change all the isolated oldvar occurrences to newvar
    perl -i.old -pe 's{\boldvar\b}{newvar}g' *.[chy]

    # command-line that reverses the whole file by lines
    perl -e 'print reverse <>' file1 file2 file3 ....

    # find palindromes
    perl -lne 'print if $_ eq reverse' /usr/dict/words

    # command-line that reverse all the bytes in a file
    perl -0777e 'print scalar reverse <>' f1 f2 f3 ...

    # command-line that reverses the whole file by paragraphs
    perl -00 -e 'print reverse <>' file1 file2 file3 ....

    # increment all numbers found in these files
    perl i.tiny -pe 's/(\d+)/ 1 + $1 /ge' file1 file2 ....

    # command-line that shows each line with its characters backwards
    perl -nle 'print scalar reverse $_' file1 file2 file3 ....

    # delete all but lines between START and END
    perl -i.old -ne 'print unless /^START$/ .. /^END$/' foo.txt

    # binary edit (careful!)
    perl -i.bak -pe 's/Mozilla/Slopoke/g' /usr/local/bin/netscape

    # look for dup words
    perl -0777 -ne 'print "$.: doubled $_\n" while /\b(\w+)\b\s+\b\1\b/gi'

    # command-line that prints the last 50 lines (expensively)
    perl -e 'lines = <>; print @@lines[ $#lines .. $#lines-50' f1 f2 f3 ...
rml··on Close to the Machine: Technophilia and its discontents
Your comment makes me think you may enjoy the science fiction book 'A Canticle for Leibowitz' by Walter M. Miller (perhaps you already have :-})

It's set at a monastery in the desert post nuclear apocalypse, where scribes copy wiring diagrams and store artifacts like partially destroyed circuit boards without understanding what they are / how they work. And it builds from there.

rml··on Surprise computer science proof in combinatorics
automatic conversion to web page available at https://ar5iv.labs.arxiv.org/html/2302.07211

(more info about the conversions at https://ar5iv.labs.arxiv.org)

rml··on Ask HN: What sub $200 product improved your 2022
Thanks for this. 40s and starting to have pain in the big toe joint. Getting some better shoes and spacers as a result. Seriously, thank you!
rml··on Hush, a modern shell scripting language
Folks interested in this design space may enjoy reading about scsh (A Scheme Shell)

From the scsh paper (https://web.archive.org/web/20081010222846/http://www.scsh.n...):

> I have designed and implemented a Unix shell called scsh that is embedded inside Scheme. I had the following design goals and non-goals:

> The general systems architecture of Unix is cooperating computational agents that are realised as processes running in separate, protected address spaces, communicating via byte streams. The point of a shell language is to act as the glue to connect up these computational agents. That is the goal of scsh. I resisted the temptation to delve into other programming models. Perhaps cooperating lightweight threads communicating through shared memory is a better way to live, but it is not Unix. The goal here was not to come up with a better systems architecture, but simply to provide a better way to drive Unix. {Note Agenda}

> I wanted a programming language, not a command language, and I was unwilling to compromise the quality of the programming language to make it a better command language. I was not trying to replace use of the shell as an interactive command language. I was trying to provide a better alternative for writing shell scripts. So I did not focus on issues that might be important for a command language, such as job control, command history, or command-line editing. There are no write-only notational conveniences. I made no effort to hide the base Scheme syntax, even though an interactive user might find all the necessary parentheses irritating. (However, see section 12.)

> I wanted the result to fit naturally within Scheme. For example, this ruled out complex non-standard control-flow paradigms, such as awk's or sed's.

rml··on What have we lost? [video]
If you are into Lisp Machines, this talk on Symbolics by Kalman Reti (who worked there) is worth watching (1h):

https://www.youtube.com/watch?v=OBfB2MJw3qg

If you only have 15 minutes, he gives another demo here:

https://www.youtube.com/watch?v=o4-YnLpLgtk

He has another video where he does some actual hacking (smooth scrolling of sheet music for display while playing an instrument):

https://www.youtube.com/watch?v=sfgjL7EUHZ8

rml··on Remote work means anyone can take your job
It's not. It's a pretty typical smaller ("tier 2"?) city in the northeastern US, with several colleges and plenty of trees, parks, and museums. It's the seat of state government, and has quite a few really nice neighborhoods of old houses, as well as some classic brownstones, if you prefer that sort of thing. It's fairly diverse, and has good nightlife due to the large college-aged population (at least, it used to).

Unfortunately it is fashionable (among people who choose not to live in them) to talk about non "tier-1" cities as if they are "shitholes", but IMO the quality of life people experience is probably higher on average: less crowding, more open space, more housing, cleaner, less expensive.

rml··on Bringing GNU Emacs to native code [video]
I've had good luck on big (multi-GB) SQL dumps, which often have very long lines, with

https://github.com/m00natic/vlfi

rml··on Google’s AMP is a gilded cage
Wow, the pages on your site load so quickly they're finished rendering before I even start reading the article. Thanks for sharing this. Very cool.
rml··on iPhone, iPad and Mac sales are down, but Apple only cares about services now
Regarding the swollen battery, if it's a Lithium battery it sounds like it may be close to failing. If I were you I would stop using that laptop right away.

I learned during my time at an RC airplane co. that lithium batteries can be very dangerous: they will actually explode in some cases.

Anyway, a stranger's $0.02. Good luck!

rml··on Study: Students who take notes by hand outperform students who type
I taught at a school for students with dyslexia. Handwriting comprised a large part of their tutoring. We were told (paraphrasing from memory) that engaging the muscle groups in the arm during writing engaged more of the student's brain. Maybe something similar is going on during the pencil-on-paper note-taking process.
rml··on Common Lisp as a Scripting Language, 2015 Edition
An updated version by Roderic Morris can be installed as a library atop the latest version of Scheme 48. It's on github: https://github.com/scheme/scsh

I think it's 64-bit (?). Most of the time it hasn't mattered for me, at least when writing scripts.

You can also just build the "old" version (0.6.7) with the `-m32` GCC flag, and it works fine on 64-bit Linux and OS X. It's very stable in my experience, and works fine.

rml··on Common Lisp as a Scripting Language, 2015 Edition
IMHO the nicest Scheme for UNIX scripting is scsh. Its APIs are really well thought out and represent a lot of design work that hasn't ever been replicated by another Scheme (at least that I've seen).

Some good examples of scsh scripting (some by the author, Olin Shivers) can be found at

http://scsh.net/resources/scripts.html

The manual is also very good:

http://scsh.net/docu/html/man.html

rml··on Sassy – A portable assembler for x86 processors written in R5RS Scheme (2009)
This is used by the Larceny Scheme compiler, which recently had a release:

http://larcenists.org/download.html

And it's apparently generating some pretty fast code:

http://larcenists.org/benchmarksGenuineR7Linux.html

rml··on Geiser: Emacs modes that conspire to keep the Lisp Machine spirit alive
scsh hackers might enjoy using geiser-scsh:

https://github.com/rmloveland/geiser-scsh

rml··on Scsh – Scheme as a Unix shell
Emacs users who want to play around with scsh might like:

* Geiser integration that (mostly!) works: https://github.com/rmloveland/geiser-scsh

* The manual in Texinfo format: https://github.com/rmloveland/scsh-manual-texinfo

rml··on Scsh – Scheme as a Unix shell
There might be a better way, but this should work:

    (for-each (lambda (x)
            (run (ssh ,x uptime)))
          (run/strings (cat /etc/hosts)))
rml··on The next version of DuckDuckGo
I also use DDG as my primary, but I prefer the `lite` interface: https://duckduckgo.com/lite
rml··on The Ongoing Battle: NY vs. SF Tech Scene
I work at a large tech co. in NYC, and we don't really talk about being in competition with SF at all. Besides, many of the really big SF-based cos. have offices here anyway.
Page 1 of 3Next →