HNHacker News
TopNewBestAskShowJobs

onetom

255 karma · joined October 26, 2009

[ my public key: https://keybase.io/onetom; my proof: https://keybase.io/onetom/sigs/uy9zkyX7ZPfhmaA2RIGTwrDaU0M4zUFBXYVe_UUq4ME ]
submissionscomments
onetom··on Time to Upgrade Your Monitor
ah, and one solution to the font sharpness issue is to use bitmap fonts, indeed. I haven't found good ones though which are available at 16px or above sizes, which are necessary for 2K or 4K displays. Also they are typically quite wide and don't have narrow options.

I found an interesting middle ground though. The old AmigaOS Topaz font as TTF :D http://www.geekometry.com/2013/11/amiga-topaz-truetype-font-...

Joking aside, the narrower variants of the Input font looks pretty good with anti-aliasing: https://input.fontbureau.com/preview/

onetom··on Time to Upgrade Your Monitor
I also found that the 16:10 is a better ratio, than 16:9, when working with code.

I wish there would be more 1920x1200 or 2560x1600 displays...

Lacking those options at reasonable prices leaves me with the option of using rotated 2K monitors, though 27" ones are uncomfortably tall and 24-25" ones are a little too high in pixel density.

Huawei's Matebook's 3K (3000x2000) display with its 3:2 (1.5) ratio at almost 14" size is an amazing sweet spot though. I wish they would have it in 28" size for desktop use :)

In the end I'm working on 27" 2K and 5K iMacs for about a decade now and I see it as a good compromise, despite the aspect ratio, but I quite like my 30" HP ZR30w with its 2560x1200 resolution. Unfortunately its backlight is getting old and uneven :(

onetom··on Time to Upgrade Your Monitor
That's likely a firmware bug in the monitor. It probably reports some ridiculously small resolution during its boot process and macOS queries it that time and rearranges the windows accordingly. macOS could implement workarounds of course, but probably it just follows the process whatever the display id protocol prescribes...
onetom··on Show HN: My daughter and I made a site to explore the photos from the ISS
it's an international space station though...
onetom··on Collapse OS – Why Forth?
I'm surprised that no one has mentioned https://flashforth.com/

There is no intriguing backstory for it, like for CollapseOS, but it's a ~6 kiloword, practical 4th environment for Microchip PIC microcontrollers, which are a lot simpler than Z80, btw... The source code is trivial to understand too. My father is still using it daily to replace/substitute Caterpillar machine electronics or build custom instruments for biological research projects.

We started with Mary(Forth) back then, when the first, very constrained PIC models came out, with 8 deep stack and ~200 bytes of RAM. Later we used the https://rfc1149.net/devel/picforth.html compiler for those, which doesn't provide an interactive environment.

I made a MIDI "flute" with that for example, which was fabricated from sawing out a row of keys from a keyboard and used a pen house as a blow pipe and a bent razor with a photo-gate as the blow-pressure detector...

There are more minimal Forth OSes, which might be more accessible than a Z80-based one.

I would think those are more convenient for learning, how can you have video, keyboard and disk IO, an interactive REPL and compiler in less than 10KB

I remember, I played a lot with https://wiki.c2.com/?EnthForth

But if you really want to see something mind-bending, then you should study Moore's ColorForth! I found it completely unusable, BUT I've learnt immense amount of stuff from it: https://colorforth.github.io/

There are more usable variants of it, btw. Also worth looking into Low Fat computing: http://www.ultratechnology.com/lowfat.htm I think it's still relevant today.

onetom··on Collapse OS – Why Forth?
DELETE statement... That's far too obvious. With every UPDATE statement you are forgetting the past, yet it's still the goto DB paradigm! It's okay to constantly lose information apparently...

And it's not like we don't have alternatives. There is Datomic of course, but also juxt/crux and DataHike.

onetom··on A History of Clojure [pdf]
Or you can also use the transient/volatile versions of data structures and functions, but I wouldn't know where to learn about these in depth. I've seen them being mentioned briefly in some official docs on clojure.org and seen them in implementations of basic functions, like `reduce` and whatnot, but I'm still not very confident using them... Also, I had no need for more performance than what I get with the immutable data structures.
onetom··on A History of Clojure [pdf]
I have to concur that it's not easy to gather what's idiomatic and why.

It took me watching the "transducers", "inside transducers" and "reducers" talks several times, before i realized that `into`, `transduce`, `eduction`, etc are the same family of functions, providing transducing contexts.

Despite that, I have no idea what are those issues in the critique above.

To me it smells like trying to do something forcefully, instead of stepping back and approaching the problem differently, in simpler ways.

Other way to avoid such issues is to formulate the problem clearly and ask it on a couple of forums, where more experienced Clojurists can answer it. This of course takes some time, sometimes hours, but it yields great results. I've received very insightful responses directly from authors of libraries on Github issues or Clojurians Slack and from Cognitect too about some advanced Datomic query technique.

I've noticed that some ppl, instead of asking for help, sweat out some convoluted, inconvenient way to solve a problem, then decide it's the only way to solve it in a specific language or with a library in question and they just keep copying that solution and teaching it to others too and constantly complain about it... It feels to me that OP might be in a similar situation to some extent.

onetom··on A History of Clojure [pdf]
> In absence of an official answer, ...

Wouldn't you consider this and official answer?: https://github.com/clojure/tools.deps.alpha#rationale

onetom··on A History of Clojure [pdf]
My bet would be that you are working with the Linux version of Emacs. That's indeed a lot less problematic and more performant too. Under macOS and Windows, the situation is not that rosy and since ppl want familiarity, they typically mix in something like Spacemacs, Doom Emacs, etc into the mixture. For a long time they would probably won't even hear about Prelude or if they do, they would not even assume that's a preset system for Emacs. I've seen this happening to a couple of ppl already just in the past 2-3 years.
onetom··on A History of Clojure [pdf]
aaand I guess that's what ppl mean by "ergonomics issues". Emacs is very stable, quite logical in some sense, but also hasn't kept up with the times and doesn't default to those typical keyboard shortcuts, which most newer editors almost all share... but this has been discussed countless times before on twitter, clojureverse.org etc...
onetom··on A History of Clojure [pdf]
I've also received countless hours of help from @alandipert, @micha and @jumblerg on the Clojurians slack about boot, Hoplon and Hoplon UI. Without them I couldn't have successfully built a 6 ppl Clojure team, who was consistently delivering working software!
onetom··on A History of Clojure [pdf]
When have you tried Clojure?

Startup time was also a deterrent for me initially, but that was ~7-8years. I annoyed the heck out of me. I was doing Rails back then and that was too much too.

Nowadays however the situation is a lot better.

For scripts, you definitely should check out https://github.com/borkdude/babashka !

Startup time still annoys me, but I've learnt an practiced development enough that I'm leaving my REPLs open for days on end.

I use very few simple tricks to speed things up a bit:

I work Clojure cli tools (`deps.edn`) instead of `lein`.

Run `(compile 'my.main.namespace)` occasionally, when I add some bigger library to my project as recommended here: https://clojure.org/guides/dev_startup_time

And I think that's it.

You can further reduce this overhead if you are just using the the Socket REPL, but I think the best support for that (which allows evaluation interruption for example) is the Chlorine plugin for the Atom editor. I usually just accept the overhead of nREPL though.

onetom··on A History of Clojure [pdf]
This sounds fishy to me too... Have you actually consulted anyone, with more Clojure experience, how to avoid the need for `(map vec <thing>)` all over the place? I would guess you were working with deeply nested data structures and you had to do deep updates, while strictly maintaining the vector data-type. That's indeed kinda sucky to do just using vanilla `clojure.core`, indeed, but then there is https://github.com/redplanetlabs/specter for that. Alternatively, instead of dealing with deep nesting, you should probably work with namespaced keys, which allow flattening your data and suddenly a lot of transformations become radically simpler and such a system is more extensible too...
onetom··on A History of Clojure [pdf]
Aaaand this works on arrays, but would you know how to make it work for files? You would need to do something like how the essay wrapped the `rdr` into a sequence, but it would still require (probably) the whole data to be present in the memory at once...

I think you would need something like this: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

but I found it quite mind-bending when I tried it once. Clojure's way of building something like this out of a `lazy-seq` call feels simpler to me...

onetom··on A History of Clojure [pdf]
I've actually tried that: https://github.com/enumatech/sprites/blob/master/lib/__tests...

reads quite like Clojure, but looks foreign to JavaScript programmers...

I even made extensions to Ramda, so you can thread a mixture of async and non-async code with it: https://github.com/enumatech/sprites/blob/master/lib/fp.js#L...

At the end the friction was just annoying and no one else really understood the greatness of this approach, since they didn't know Clojure...

onetom··on State of Emacs Lisp on Guile
I got the feeling that Atom might be a better analogy. For example, you can get a Spacemacs like environment if you use the Proton extension (https://discuss.atom.io/t/announce-proton-vim-focused-spacem...), which itself is written in ClojureScript, which is live-reloadable...
onetom··on iCab: Alternative Browser for macOS
This browser seems more customizable to me: https://next.atlas.engineer/

Based on iCab's homepage, it's unclear why would I want to use it really.

onetom··on Why we need a book about naming
I'm surprised no one has mentioned Kevlin Henneys talk on this topic, like this one: https://www.youtube.com/watch?v=CzJ94TMPcD8

This topic comes up in his other talks too, like "Clean coders hate..." or "7 ineffective coding habits..."

He has really good examples, a witty style; a pleasure to listen to.

onetom··on SoftICE
Ancient!? shiiiit, im old ;-D how about AFD/SFD then? https://vulms.vu.edu.pk/Courses/CS401/Downloads/AFD_Tutorial...
onetom··on Ask HN: What is key to good technical documentation?
I can highly recommend http://plantuml.com/ because it has support for other types of diagrams too, not just sequence diagrams.

It's open source and also cross platform, since it's written in Java.

It has command-line interface too and integrates with most popular IDEs.

You can host your own rendering server too and just reference your diagrams as URLs (https://github.com/plantuml/plantuml-server).

There is a 3rd party, independent rendering server integrated with a web editor. I recommend that if you want to quickly test PlantUML:

https://www.planttext.com/

onetom··on Give Firefox a chance
I had ~1GB swapped out on 32GB 3.4GHz quad i7 machine. 5GB was taken up by ~8 tabs in FF. I noticed it because IntelliJ and Android Studio started to be suspiciously laggy. I mean laggier than usual :) After stopping FF, the IDEs went back to normal. Processor usage was negligible when I was not touching the system, so it wasn't caused by some runaway js code on some webpage.
onetom··on Give Firefox a chance
I don't think that's an excuse. As mentioned in other posts, there is an Add-on for vertical tabs: https://addons.mozilla.org/en-US/firefox/addon/tree-style-ta...

It can't hide the horizontal tabs though because of the strict rules imposed on FF extensions, so you have to hack around it yourself as described here: https://github.com/piroor/treestyletab/wiki/Code-snippets-fo...

onetom··on Give Firefox a chance
I switched about a year ago and I was also pleasantly surprised, UNITL I've realized that it's eating up several GIGABYTES!!! of memory, even when I just have a handful of tabs open. What's worst, it doesn't releases all the memory when I just close the tabs! When I restart FF and cycle thru the tabs to make sure they are loaded, it uses a lot less but still in the GB range.

I compared the same set of tabs in Chrome and it consumes about half or 2/3rd of the memory. (Tested under macOS only) While I work on machines with 16GB & 32GB, I find it unreasonable to waste so much memory usage on the browser windows. I'm looking into alternatives. I think most pages would be better viewed by just extracting the text content and the links, like Reader View mode...

I've checked out pretty much all active projects on https://en.wikipedia.org/wiki/Comparison_of_lightweight_web_... and https://qutebrowser.org/ seems to be the most usable one which consumes even less memory than Chrome, while still supporting JavaScript and video playback. Or maybe I shall switch back to Opera/Brave/Chromium? I've tried so many...

I'm already used to keep closing tabs manually which I don't need, like web.whatsapp or gmail and the like. I even came across the Tab Wrangler extension, which automatically cleans my tabs up. I can highly recommend it to conserve memory!

So other than the memory usage issue, I'm satisfied with the current FF. It's web developer console is almost as good as Chrome's. It supports Ctrl-Tab jumping to the MRU (Most Recently Used) tab. Has built-in reader view. The Multi-touch Zoom add-on even brings "zooming by 2 finger pinching" capability to FF, which is almost as good as the auto-zoom by 2 finger tap.

onetom··on Show HN: I wrote a maze traversal program in Clojure
First of all, thanks for sharing; it's a very educational piece of code!

I have some generic coding advice though. With slightly better names you can get rid of a lot of the comments. There is a lot of repetition in the code. If you factor that out, you will have even less need for comments. I highly recommend watching some Kevlin Henney talks on such topics, for example https://youtu.be/ZsHMHukIlJY?t=487 (but he has even better talks recently)

The input of the program should be supplied in a more format more natural to humans and let the computer do the transformation into whatever data structure it's comfortable with. So I would propose a simple, multi-line text as an input:

    xxxxxx
    0x000x
    x*0x0x
    xxxx00
    00000x
    xxxx0x
Then the code would look like this:

    (ns maze.solver
        (:require [clojure.string :as str]))

    (def maze-filename "maze.txt")

    (defn parse [maze-str]
     (->> maze-str
          str/trim 
          str/split-lines
          (mapv (partial into []))))

    (def maze (-> maze-filename slurp parse))
You can also just hardwire a maze during development into the source file, since Clojure supports multiline strings:

    (def maze (parse "
    xxxxxx
    0x000x
    x*0x0x
    xxxx00
    00000x
    xxxx0x
    "))
The result of `parse` function will contain character data types instead of 1 character long strings. I think in this case it's actually more readable and more concise too:

    [[\x \x \x \x \x \x]
     [\0 \x \0 \0 \0 \x]
     [\x \* \0 \x \0 \x]
     [\x \x \x \x \0 \0]
     [\0 \0 \0 \0 \0 \x]
     [\x \x \x \x \0 \x]]
Next `println` actually accepts multiple arguments and concatenates them with a space, after stringifying them, so you can drop the extra `(str ...)` wrapping around them.

Then again, the comment is superfluous. It's obvious that you are printing stuff. If you really want to tell what is it, just wrap it in a well-named function. Eg:

    (defn report [paths]
      (println "The maze has" (count paths) "paths.")
      (println "The shortest path in the maze is:" (count (first paths)) "steps long.")
      (println "The path is" (first paths))
      (println "The longest path in the maze is:" (count (last paths)) "steps long.")
      (println "The path is" (last paths)))
So you can just put `(report sorted-paths)` in your `-main`.
onetom··on Study: Two Monitors or One Ultrawide
What brand is your 30"? I bought a second hand HP ZR30w but it's quite old and its backlight is not even... https://support.hp.com/sk-en/document/c02159509

Other than that it's a sweet spot indeed. Maybe the only thing I miss is the sharpness of retina screens :)

When will someone finally make a ~28" 5210x3200 monitor? :)

onetom··on Study: Two Monitors or One Ultrawide
+1 for playing some music as a form of break. When I was younger I often practiced simple songs on a tin-whistle, recorder, kaval or flute. I liked the saxophone the most but that requires too much maintenance, hence it's a distraction.
onetom··on Study: Two Monitors or One Ultrawide
Most TVs have some weird effect where it just puts white dots in the middle of the strokes of a charater glyph. However, I've seen several Samsung TVs which doesn't suffer from this phenomena and can be used as proper monitors.

For coding purposes I don't think color accuracy matters much, but I see why latency might annoy some people, though it doesn't bother me.

onetom··on Study: Two Monitors or One Ultrawide
You need extra functions in your window manager for moving between screens with multiple monitors. Depending on their placement the shortcuts might be non-intuitive. Different screen resolutions lead to unnatural movement of the mouse cursor between screens.

I've also found that such extra complexity impacts productivity negatively. It's an unnecessary distraction trying to communicate such complicated layouts.

onetom··on Study: Two Monitors or One Ultrawide
I'm just using a 27" 5K iMac, BUT sometimes I change its resolution from the default, virtually 2560x1440 one to the highest DPI, which I guess is the native 5120x2880 and I just pull it closer and/or lean closer to it.

I think for programming the 2560/1600 = 1920/1200 = 1.6 or the 3000/2000 = 1.5 ratio is a reasonable middle ground. Unfortunately it's not a common ratio among big but cheap monitors...

The extra head movement required to look into the corners of a 27" or even a 25" vertical monitor definitely puts a little strain on my neck compared to a 25" horizontal one, but with frequent posture changes and breaks, while a bit tiring, I don't feel it caused any permanent damage.

At least I hope it's not the reason why the middle of my upper back feels like falling apart any minute... Maybe that thai massage, when a lady was walking on my back for half an hour was a bit too much? :D

← PreviousPage 6 of 8Next →