HNHacker News
TopNewBestAskShowJobs

phforms

641 karma · joined April 29, 2022

submissionscomments
phforms··on Emacs Lisp Elements
My Emacs wouldn’t be the same without Prots modus themes[1], which I found to be a great foundation to build my own theme on top of. I am grateful for all the work he did for the Emacs community.

I also enjoy watching his videos where he talks about various philosophical topics from a very clear, pragmatic and down-to-earth perspective. My impression is that he is a really kind and humble person and that he lives by his philosophical insights, without bragging about his lifestyle or judging about how other people live their lifes.

[1]: https://protesilaos.com/emacs/modus-themes

phforms··on Gemini 2.5 Pro vs. Claude 3.7 Sonnet: Coding Comparison
I like using LLMs more as coding assistents than have them write the actual code. When I am thinking through problems of code organization, API design, naming things, performance optimization, etc., I found that Claude 3.7 often gives me great suggestions, points me in the right direction and helps me to weigh up pros and cons of different approaches.

Sometimes I have it write functions that are very boilerplate to save time, but I mostly like to use it as a tool to think through problems, among other tools like writing in a notebook or drawing diagrams. I enjoy programming too much that I’d want an AI to do it all for me (it also helps that I don’t do it as a job though).

phforms··on Parinfer: Simpler Lisp Editing
I’ve been considering Parinfer, but my issue was that it is a bit unpredictable where parens end up and I have to be careful to not mess up my code structure. Maybe I should give it another try for a longer time period.

My favourite structural editing tool for about a year now is symex[1], which is an Emacs package (and unfortunately not that well known compared to paredit, lispy, etc.). It takes some getting used to at first but after a while you only move around and think in terms of s-expressions, you don’t even see parentheses anymore. It really feels like you are a squirrel climbing trees (hence the image on the repo, I guess). I just hope the dev(s) will be able to get rid of the heavy dependencies on other packages soon.

[1]: https://github.com/drym-org/symex.el/

phforms··on Show HN: Tetris in a PDF
Apparently, it is set to false by default in Zen Browser. In my Firefox it was still true.
phforms··on Siyuan: Privacy-first, self-hosted personal knowledge management software
I believe convenience and actually wanting to give something back to the creators would have many people pay for pro features, since it’s actually “Pay once, use for life”, which is a rare and welcome sight in this subscription-flooded world. And it still leaves people with low income the option to (legally?) circumvent payment. Not sure how sustainable this is as a business model, but I think it’s pretty nice compared to being forced into continuous payment.
phforms··on Siyuan: Privacy-first, self-hosted personal knowledge management software
It seems like they borrowed heavily from Notion, Obsidian and RemNote, as far as I can tell (wouldn’t call it a knock-off though, since there are sooo many apps in this space that you don’t really know who came up with what anymore). But the app doesn’t feel janky to me at first glance, it definitely feels more responsive than Notion and less “slippy” than RemNote. Although it is quite noisy with all the tooltips popping up immediately.

My first impression is that they really wanted to include everything (even RemNote-like spaced-repetition flashcards, Notion-like Databases and of course there has to be AI too) and it seems like they did a pretty decent job at that. I also appreciate that there are so many export options, even for Org-Mode (preserving internal links, images, code-blocks, etc.).

I like that it provides a solid, feature-rich alternative to all the cloud-first, closed-source apps in this space. But it may be too distracting/overwhelming for my use-cases with all the advanced layout capabilities and features though. Tana is a similar all-in-one solution that is really well done (and more innovative than this one), but I always seem to gravitate toward more focussed apps.

phforms··on Org Mode Syntax Cheat Sheet (2017)
Good idea to update the radio targets along with the wrapping. Also, I didn’t know `insert-pair` exists, could have saved me some typing. :)
phforms··on Org Mode Syntax Cheat Sheet (2017)
To quickly link to bullet points, just use [[*My bullet point]] (if you omit the *, it may still work but Org also finds non-heading elements like table names with the same text).

Personally, I like to create custom ids for bullet points so that I can easily change the text in the bullet point later without breaking my links:

  * My bullet point
  :PROPERTIES:
  :CUSTOM_ID: foo
  :END:
This is easier with C-c C-x p (org-set-property).

Elsewhere, I can just write [[#foo]] to create a link to that bullet.

phforms··on Org Mode Syntax Cheat Sheet (2017)
I couldn’t find the command you mentioned “org-insert-radio-target-brackets” in my Emacs and it doesn’t appear to be in the manual[1] either. But of course it is very trivial to write, in case anyone else needs this:

  (defun org-insert-radio-target-brackets (start end)
    "Wraps a region with angular brackets to create a radio target."
    (interactive "r")
    (save-excursion
      (goto-char end)
      (insert ">>>")
      (goto-char start)
      (insert "<<<")))

  (keymap-set org-mode-map "C-c n r" #'org-insert-radio-target-brackets)

[1]: https://orgmode.org/manual/Radio-Targets.html
phforms··on A dictionary of single-letter variable names
Clojure developers also often make use of single-letter variable names, following conventions in `clojure.core`: https://guide.clojure.style/#idiomatic-names

My rule of thumb is to only use short names in the local scope of a function and have them follow conventions within the language community. Constrained like this, I see no harm in using them, since their meaning is clear within the context of their usage and there is usually no need to search for them. Of course, if the variable has a more specific meaning, I choose a more specific name.

phforms··on Show HN: Flyon UI – Tailwind Components Library
In case anyone finds this who is also interested: I just stumbled upon an implementation of shadcn/ui components with css modules that looks pretty solid: https://github.com/qwalker8408/shadcn-css/tree/main

Hopefully something like this will be made official - at least there is some discussion going on in the shadcn/ui repo: https://github.com/shadcn-ui/ui/discussions/2832

phforms··on Show HN: Flyon UI – Tailwind Components Library
I love the approach of shadcn and the fact that they use Radix primitives, which have a focus on accessibility. But I wish they would have a pure CSS option without tailwind style classes. It took me some time to translate the classes shadcn uses from tailwind to CSS (which sometimes require more research) and the variables for colors, sizes, etc. into the CSS-to-js system I use (which is stitches - yes, its deprecated, but still the best one I know).

Tailwind is nice for prototyping and simple projects, but often I find that it obscures things too much and when I need more control over the CSS it is too abstract and awkward to use.

phforms··on Ask HN: What's the best documentation site you've come across?
I second that. One of my favourite things to do when I’m bored is to flip through the INFO manuals and see what functionality of Emacs (or some of the often equally-well documented packages) I haven’t explored yet. It is so pleasent to navigate them from within Emacs once you get used to the info mode keybindings.

In general, I like how it is easy to access any kind of information about Emacs (keybindings, commands, variable values, active modes, text/face styles, etc.) from anywhere within Emacs through the C-h shortcuts or via “Help” in the menubar. Contrast that with what is usually offered as “Help” in most other applications and how hard it is to find just some basic piece of information.

phforms··on What you can get out of a high-quality font
Would also love to see v2 finally get released, since I'm a big fan of Berkeley Mono and would like more weights and widths to make my Emacs look nicer.

From their update in february[1] this year it seems like it is basically complete but personal things got in the way and maybe they struggle to set up the systems for custom builds, ecommerce, etc. to ship it. People are constantly asking for the release, so I think it will eventually arrive, but good things often take longer than expected. :)

[1]: https://x.com/usgraphics/status/1762128387483824160

phforms··on Home to Anything JavaFX Related
As an aside for Clojure users, there is a nice “declarative, functional and extensible” wrapper for JavaFX called cljfx[1] that has been around for some years now. When I tried it last time to prototype a desktop app, I found it really pleasent and simple to work with, it felt like a more modern way to build JavaFX GUIs.

[1]: https://github.com/cljfx/cljfx

phforms··on Discrete Mathematics – An Open Introduction, 4th edition
Without any solutions or even problems to begin with and without having a teacher by your side, I found that LLMs can be a good-enough learning assistant. Of course, you cannot rely on their answers and they sometimes lead you astray, but what works for me is to:

- throughout the text, use the LLM to ask questions, generate problems (I haven’t tried this yet, so it might not work very well) and give you hints on how to close the gaps in your understanding

- reduce a given problem to the simplest possible case and ask how to solve that (if you want to check if your solution seems plausible) or if it can give you hints on how to approach the problem (when you are stuck)

- vary the problem description to see if different approaches are suggested

- critically ask questions about the (steps to the) solution or any provided hints (does something seem odd or logically inconsistent?)

- other LLMs sometimes give you better answers (or contradict each other), so, if possible, try asking different LLMs the same questions

Having this “conversation” with the LLM where you need to critically check everything it says has the added benefit of being more actively engaged with the material as opposed to simply looking up the solution. It may be a huge waste of time if you’re not careful, but I think if you use it intelligently to guide your own thinking, it can be very helpful.

phforms··on Discrete Mathematics – An Open Introduction, 4th edition
As an autodidact without an “official” CS degree, discrete Mathematics seemed to me like a key area to open up more advanced topics and solve many practical problems in programming. And indeed it helped me on many such occasions (although I am still studying).

I really like the book “A Primer of Discrete Mathematics”[1] by Finkbeiner II and Lindstrom from 1987. It’s a bit old and unfortunately not free but still holds up pretty well and has many good exercises with selected answers.

I will absolutely check out this book though, looks like a more modern approach with interactive exercises and it even is completely free!

[1]: https://archive.org/details/isbn_0716718154

phforms··on Show HN: Wikipedia Browser a La Andy Matuschak's Evergreen Notes
I was trying out Arc and almost forgot about it, but now knowing about this feature changes everything, thanks for pointing it out! Very often I need to see two or more pages side by side and I just hate making a mess in my browser with multiple windows open. They just tend to get lost and I have to move them out of the way or close them one by one, it is just annoying.

You can even have more than two splits, which I did not expect. Also, holding the option/alt key when clicking on a link opens it in a new split which is super convenient.

phforms··on CSS Grid Areas
I think you can get away without learning grids, but flexbox is a must - given its convenience over the old “float-hacks” and its omnipresence in modern CSS.

Besides the already mentioned css-tricks articles, I recommend checking out the guide to flexbox from mdn[1] (in the side menu there is also one for grids) as well as the reference to “CSS flexible box layout”[2]. These helped me get a deeper understanding about the concepts behind flexbox and how the properties and their shorthands actually work.

[1]: https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layou...

[2]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_flexibl...

phforms··on Emacs: Contextual Interfaces in Casual Calc
I am also a big fan of hydras, but I use them more for workflow things like window movement, editing org tables or quicker navigation in org headings/trees and it complements my keybinding system in `meow`[1] (similar to Evil or the Kakoune/Helix text editing scheme).

[1]: https://github.com/meow-edit/meow

phforms··on Emacs: Contextual Interfaces in Casual Calc
Whenever I find myself learning about something where I know that I will not use it frequently enough to actually remember its keystrokes/commands/etc. I create a new “personal documentation” for it as an .org file (I have a central folder and a git repo for all of them). Here I’ll write all the information (like keybindings, details of commands, common procedures, concepts, etc.) down that is specific to my own use-cases and organize it in a way that makes sense to me.

It takes some time and effort and may seem redundant when there is good documentation out there already (as with most of Emacs). But still I find myself wasting a lot of time looking for that one piece of information in the docs where I forgot how to even search for it. Maybe it works so well for me because I kind-of enjoy the process of writing it (which many people might not). But I feel much less frustrated afterwards when I come back to some tool or language after years of not using it and find it really easy to remember what was important to me at the time and how to do X.

Tools like Casual Calc are great because they reduce the need to do that manual work of going through the docs and writing down what one want to remember in a (for them) more clear/concise/practical way. However, the way they select and organize knowledge/commands only reflect the common use cases, so there may still be a need to write stuff down.

As a more general helper, I really like to use Emacs Calc with `which-key`, which provides a similar interface to see what keybindings are available under a specific prefix-key. What also helps is if you press `h` and then search for a specific function (`h f`), key (`h k`), etc. or just type `x` to enter a function name directly (or by keyword using text-completion).

phforms··on How to build quickly
I suspect that the “crap applications” issue arises not necessarily due to the method being wrong, but more likely due to people disregarding step 4 in the article: “Finally, once completely done, go back and perfect”.

It may be because of tight deadlines, lazyness (it’s “good enough” so why bother?) or eagerness to jump to the next project (because it is more exciting or profitable than doing the hard work of getting the details right).

I guess there is also a personality type factor that plays into it, because many people seem to just care about the hard requirements and cannot be bothered about things like performance, accessibility, design consistency, simplicity, maintainability, good documentation, etc., at least as long as nobody complains about it.

phforms··on p5.js
Some more context: Ben Fry posted a thread on X in 10/2023[1] where he announced and explained his decision to resign from the Processing Foundation.

Seems like Processing got left out from expenses despite their large budget, running against their original reason to start the foundation: “I was soon shocked to learn that the Foundation spent nearly $800,000 last year. $0 of that went to Processing 4. This year, the proposed Foundation budget is around $1.2 million. But for Processing, there is budget for just two people: one developer, one community lead. You know what that sounds like? The reason we started a Foundation in the first place. Two people is not enough for any of the Processing software projects (i.e. anything that lives at a http://processing.org domain.)”

I wonder if most of the money went into p5 or the new website or whatever, but it made me a bit sad to see that the original Processing got left behind. It is what got me into programming and there are still lots of good reasons to choose it over p5. I can, however, understand if they prioritised p5 due to the rise of web apps and mobile devices, sharability, JS being everywhere and so on. Maybe it’s nostalgia, but it just doesn’t bring me as much joy as the original.

[1]: https://x.com/ben_fry/status/1709400641456501020

phforms··on Daylight Computer – New 60fps e-paper tablet
If I could afford it, I would buy this just to support the idea and invest in an industry that focusses more on reducing the “virtual noise” and creating computers that are more like natural tools/artefacts that blend in with our environments instead of separating us from them and from each other and distracting us from what we actually value in life. I hope you succeed on your mission!
phforms··on Try Clojure
I know a lot of people think that you write more parentheses in Lispy languages, but actually in most cases you just type them in a different order, e.g. instead of `foo(x, y)` to call a function, you type `(foo x y)` and you even save a comma.

Of course, there are constructs such as `let` and `cond` that are more parenthetically noisy (not so much in Clojure though), but on the flip side you don’t have to remember a lot of special syntax like in non-lisp languages.

Most Lisp-people also use structural editing tools like paredit[1], which make it really easy to write and edit s-expressions. I found that after some time I didn’t really think that much about parentheses anymore.

[1]: https://paredit.org

phforms··on Try Clojure
Reagent is nice and has been around for about a decade now, but I moved away from it towards very thin wrappers around React[1], because I felt like it was adding too much additional complexity on top of React, which is already quite complex on its own. I wanted a clearer view at what is going on and a simpler way to interop with native React components.

Although it seems to catch up with experimental support of React 18 now, Reagent has fallen behind the latest developments in React and may not benefit from all of its performance optimizations. It is still using class components instead of hooks and there have been concerns that the runtime conversion of Hiccup may drag down performance. I guess in most cases it is not really an issue or in any way noticable, so if you’re not doing any fancy stuff it should be fine. I may even come back to Reagent at some point, since I have to admit that I miss the UI-as-data model with Hiccup.

What I highly recommend, however, is using re-frame[2] for state management. It has also been around for a long time (2014, around the same time Reagent came along) and pioneered some popular ideas in that area. It may seem a bit overwhelming at first, but the docs provide a great introduction and I find the model very clear once you wrap your head around it. At the moment it depends on Reagent, but there are ways around that. [3]

[1]: see Helix (https://github.com/lilactown/helix) or UIx (https://github.com/pitch-io/uix)

[2]: https://day8.github.io/re-frame/

[3]: refx (https://github.com/ferdinand-beyer/refx) is an almost drop-in replacement without the Reagent dependency, but hasn’t been updated in a while. Alternatively, re-frame can be integrated with UIx/Helix by adding some interop code https://github.com/pitch-io/uix/blob/master/docs/interop-wit...

phforms··on The evolution of a Scheme programmer (2020)
I also came back to B&W because I’ve noticed that with structural editing I think more in terms of s-expressions than parentheses and distinguishing them isn’t that much of a problem anymore.
phforms··on Štar: an iteration construct for Common Lisp
TIL that there is a whole package for “Common Lisp Emulation”[1] in Emacs that adds functions and control structures from CL “to make Emacs Lisp programming significantly more convenient”. Never developed a package for Emacs myself, but I feel like this can be of great help if I ever wanted to.

I know that there are projects like Lem[2] that try to build some kind of editor (Emacs-like, I guess) on top of CL, which made me wonder if we would have a CL-based Emacs today if it would have been standardized by the time and if this would have been a better choice than creating a custom dialect.

[1]: https://www.gnu.org/software/emacs/manual/html_node/cl/ (C-h R "cl" in Emacs)

[2]: https://lem-project.github.io

phforms··on I rewired my brain to become fluent in math (2014)
This is interesting and reminds me of the idea of “thinking in action” where insights/understanding happens while interacting with the concrete subject matter in exploration, experimentation, etc., which seems to be exactly what the author described she was doing when learning Russian or physics equations.

I don’t think that from “dull” memorization and mindless practice alone (how it was often done in school) understanding at a deeper level somehow magically happens. What I do believe is that both (“smart”) memorization and explorative/playful interaction with the subject matter (turning it upside down, interrogating it, relating it in different ways, etc.) support each other, which, after some time, creates enough structure in ones neural pathways such that deeper insight can emerge from intuition.

When we try to learn math conceptually, we focus a lot on metaphorical or contextual understanding (“what is this like?”, “how does this apply to the real world?”, etc.), which may divert attention away from the actual subject matter, which is the symbols, formulas, equations, axioms, theorems, diagrams and so on. It is all one really needs to understand.

Sometimes I read texts where the author talks about mathematical ideas in a very vague and abstract language, mystifying and obscuring it or entangling it with other subjects. But then it turns out what they write makes no actual sense in the language of mathematics, which itself is very concrete and clear. Maybe they have fallen into the trap of thinking that they knew about the subject when all they have is a broad conceptual perspective without any grounding in the actual rules of the formal system.

phforms··on Beautifying Org Mode in Emacs (2018)
I actually don’t like the text that I am working on to look like a refined press article in a magazine, a beautifully typeset page from a book or a nice looking website. It is not a published text. It should look rough, unfinished, unrefined and functional (to me). When I write on a piece of paper, my handwriting looks ugly, irregular, misaligned and maybe there are some drops of ink splattered around, so I don’t want my editor to make me believe that my writing looks presentable.

For Org Mode, my main concern is that I want to quickly identify the structure of my documents and differentiate all the relevant parts visually. I like to keep font sizes and spacings small to fit as much text (= context) on my screen as possible. I also like using monospace fonts because it feels more like working on a draft (e.g. with a typewriter) to me and I can work more spatially with text (e.g. making little diagrams or figurative text arrangements) which would not be possible with proportional fonts.

When everything looks too good/refined, I get distracted by wanting to shape my text to make it fit in that perfect environment. Then there is no space for swift notes, unfinished drafts, rough edges and this becomes a problem, since I am already a compulsive perfectionist and like to waste a lot of time with irrelevant details. Of course, this is just my personal preference, so I am not saying that this is how it should be. Maybe I am just trying to understand why I like it better this way.

← PreviousPage 2 of 5Next →