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 Apple unveils all-new MacBook Air, supercharged by the new M2 chip
I'm still using a 2017 MacBook Pro, though I have an M1 Mac Mini. I had 2 second-hand 27" iMacs too, from 2011 and 2013.

I gave the 2011 one away, because I couldn't upgrade it anymore, but it is still used for audio/video editing.

The 2013 one has some issues with its hard-drive and I'm planning to upgrade it to an SSD. It's still a pretty capable machine, though I would probably put Linux on it, since the macOS upgrades for that are discontinued too.

The display panels are "just" 2K in them, but still super sharp, though a bit dusty inside... They are better than most cheaper external monitors I saw ppl using for everyday work...

I think a decade of runtime for Macs is not that uncommon. 2 decades would be even better, but I wouldn't call it a "vicious upgrade cycle"...

I mean, I'm still on an iPhone Xs Max and before that I had an iPhone 7 Pro and I have no intention of upgrading, despite the back-glass being cracked on it. and not because I can't afford it, but because I won't really utilize the extra power of the latest versions.

onetom··on Apple unveils all-new MacBook Air, supercharged by the new M2 chip
I completely agree with "not a huge upgrade", but calling it "diminishing returns" is way too extreme.
onetom··on Apple unveils all-new MacBook Air, supercharged by the new M2 chip
here are some real-world numbers for starting a Clojure process:

1. 2017 3.1GHz Quad i7 clj -M -e 1 1.73s user 0.12s system 232% cpu 0.795 total

2. 2020 M1 Mac Mini clj -M -e 1 0.65s user 0.05s system 157% cpu 0.445 total

and I'm getting a very similar time-ratio, when I'm running our test suite for example. I find these speeds extremely satisfying already!

onetom··on Apple unveils all-new MacBook Air, supercharged by the new M2 chip
I would call 1.8% a diminishing return :)

18% is pretty decent, IMHO, for their bottom-most spec, especially given the RAM limit is being extended to 24GB, while the power consumption is still brutally good (18hrs video playback) and the screen is also a bit more spacious at 13.6"...

and it's not like they don't have faster CPUs. it's just the cheapest you can get and even that is getting faster!

tbh, im using an M1 Mac Mini since last December and it's sooo freaking fast and smooth, that I'm not even really motivated to upgrade at all, if it wouldn't be for the extra memory. though the 16GB is surprisingly sufficient too, if i have run browser tab suspender extensions and close my unused electron apps (notion, logseq, slack), while coding (in Clojure, using IntelliJ and Emacs).

onetom··on Git Fork: A fast and friendly Git client for Windows and Mac
My choice is the VCS client in JetBrains IDEs, like IntelliJ, WebStorm, PyCharm etc.

IntelliJ Community Edition is even free and open-source, so for Java coding it's perfect, but pretty good for Clojure, Python, PHP too.

The JetBrains IDEs are cross-platform, including Linux and cross architecture, including ARM, because the JVM/JDK is cross-arch.

The sticking point for me is how well it deals with the 3-way resolution of merge conflicts.

It also has a magic-wand icon, which seems to resolve 95% of conflicts automatically and correctly, presumably doing something based on common ancestor commits.

BUT what makes both this 3-way merge interface AND the commit interface really great, is the ability to edit in-place, with all your custom keybindings, syntax highlighting, linting and code intelligence tools!

You can auto-complete code, look up docs or the source code of function definitions, even in JAR files, without leaving the context of the commit dialog. If you need to do something more involved, like refactoring or jump to definition, u can always get to the source code with F4 from the commit dialog or from within any commit context.

You don't know what are you missing out on, until you experience it! It's a significant reduction in mental overhead, imho.

Now the cost of all this convenience is that you need to download hundreds of megabytes and IntelliJ CE has a substantial startup time and memory consumption, since it indexes your code. It also sprinkles your repo with projects files under a .idea folder.

I will check out Fork regardless, because it's good to know what's out there and what are the different set of tradeoffs it choose. Then I can choose and/or recommend it for different situations.

It's the same reason I'm learning vc.el and magit too. If you need to do some git surgery over high-latency SSH, then it's hard to beat Emacs with TRAMP...

onetom··on Blogchain
press the back button longer, until you get a popup, then u can jump 2 steps back in the history at once.

but of course it sucks, that a single press in not enough...

onetom··on Blogchain
me neither... unless, u press the back button long and select the 2nd previous address from the popup ;)
onetom··on Meld for Macs
How do you evaluate diff tools, like this?

Is there some common repository of merge conflicts, which one can use to gauge how well a certain tool fares?

onetom··on Meld for Macs
Can you edit the merge result in-place though? I can't live without that feature. After you experience the convenience of that, jumping elsewhere to adjust the merged code feels such a hassle...
onetom··on Meld for Macs
Any experience with vdiff? https://github.com/justbur/emacs-vdiff How does it fare compared to ediff?
onetom··on Meld for Macs
In my experience, ppl who are using command-line git or magit in Emacs are tying a knot on their genitals with trying to merge branches way more often than ppl using IntelliJ.

I wouldn't know how to explain what does the magic wand do, but it seems a huge waste of time NOT having it in other merge solutions. I can't remember a case where it the magic wand was causing a semantic error and I'm using it for 7-8 years by now. Mostly in Clojure code though.

onetom··on I'm all-in on server-side SQLite
because you can move faster and explore you problem domain cheaper and validate your solution earlier. then, if you "struck gold" and happened to arrive to some product market fit, then even if you would need to rewrite big chunks of your solution, to swap out your persistence layer, you have a solid specification to follow, which is your sqlite-based implementation!

such a rewrite is a lot more predictable endeavor, then building the initial solution, that it's a great problem to have :)

meanwhile, your UI don't have to change and a lot of your other glue code or business-logic code don't have to change either, IF you haven't hardcoded direct calls to SQLite everywhere in your program :)

eg. I used HoneySQL with great success! My queries are safely assembled from Clojure data structures and I had a single function, which I used to format them to the desired SQL dialect H2DB/SQLite/MySQL/Postgres, execute them and parse the results back into Clojure data structures and even take care of lazily paginating through long result sets, without burdening the consumer of the data with such details.

https://github.com/seancorfield/honeysql

onetom··on I'm all-in on server-side SQLite
+1 for SQLite! I've used it from Clojure, via HoneySQL, so no ORM, no danger of SQL injection. It was really wonderful!

https://github.com/seancorfield/honeysql

I used it to quickly iterate on the development of migration SQL scripts for a MySQL DB, which was running in production on RDS.

I might have switched to H2 DB later, because that was more compatible with MariaDB, but I could use the same Clojure code, representing the SQL queries, because HoneySQL can emit different syntaxes. Heck, we are even using it to generate queries for the SQL-variant provided by the QuickBooks HTTP API! :)

https://www.hugsql.org/ it's pretty good too, btw! it's just a bit too much magic for me personally :)

Also, you should really look into JetBrains database tooling, like the one in IntelliJ Ultimate or their standalone DataGrip product! It's freaking amazing, compared to other tools I tried. If you are an Emacs person, then I think even with some inferior shells to the command-line interfaces of the various SQL system, you can go very far a lot more conveniently, than thru some ORMs.

Either way, one secret to developing SQL queries comfortably is to utilize some more modern features, like the WITH clause, to provide test data to your queries: https://www.sqlite.org/lang_with.html

You can use it to just type up some static data, but you can also compute test data dynamically and even randomly!

Other little-known feature is the RETURNING clause for INSERT/UPDATE/DELETE: https://www.sqlite.org/lang_returning.html

It can highly simplify your host-code, which embeds SQL, because you don't have to introduce UUID keys everywhere, just so you can generate them without coordination.

onetom··on Unix command line conventions over time
btw, Rebol solved the mixing of options and filenames by introducing a syntax for file references; u prefix them with a percent sign, eg.:

%/c/plug-in/video.r

%//sound/goldfinger.mp3

%"/c/program files/qualcomm/eudora mail/out.mbx"

%c:/docs/file.txt

%\some\cool\movie.mpg <= understood backslashes too, so it worked in DOS/Windows too!

%cool%20movie%20clip.mpg

Source: http://www.rebol.com/docs/core23/rebolcore-12.html#section-2...

then you could mix them with `:get-words` and `set-words:`. Rebol also had an interesting take on options - with and without arguments -; it called them refinements and you would just stack them with slashes onto the "command". the refinement arguments were added to the end of the parameter list though, so it was not exactly obvious which argument belonged to which refinement, but in practice it worked quite nice, surprisingly:

str: "test"

insert/dup/part str "this one" 4 5

print str

=> this this this this test

and reversing /dup and /part:

str: "test"

insert/part/dup str "this one" 4 5

print str

=> thisthisthisthisthistest

Source: http://www.rebol.com/docs/core23/rebolcore-9.html#section-2....

onetom··on Unix command line conventions over time
I understand, that the double-dash was a logical step from a single-dash. My problem is, what we ended up with, is really not great. It's a typical case of the slowly boiled frog...

rc and es is an good example of what improvements can be achieved, if we challenge historical decisions and get rid of the not so great ones.

The "; " prompt was just a historical side-note, because I saw someone asking about it the other day on twitter: https://twitter.com/thingskatedid/status/1316081075043463170...

By the quoting rules, I meant, that if you have a variable (eg v='a b') with a value containing whitespace, when you reference it ($v), then you don't have to worry about quoting it in any way, because the space in its value won't cause any problems.

onetom··on Unix command line conventions over time
It's interesting, that no one questioned the use of double dash itself.

It looks especially silly, when long options are used to encode some mini programming language (DSL), like in imagemagick and ffmpeg, or when they are used to represent some associative data, like in case of the AWS CLI.

If -- would be a : AFTER the option name, it would look like Objective C named arguments or set-words in REBOL and Red.

If -- would be a : BEFORE the option name, it would look like keywords in Lisps.

As a side-note, shells got quite evolved, actually, but the momentum of the mediocre bash-line prevailed, sadly.

I urge people to learn about es, the Extensible Shell: https://wryun.github.io/es-shell/

Its ancestor, the Plan 9 rc (which I think stands for Run Command) and it used "; " as a prompt, so u could combine multiple commands easier, by copy-pasting whole lines, instead of fiddling with the exclusion of the varying length prompt.

Both of these shells have a lot better string quoting rules than bash, so they play nicer with filenames containing special characters.

They also follow the unix philosophy closer, by not necessarily providing line editing capabilities, which can be added by running them thru eg. rlwrap or not really needed, when running them from Emacs or Plan 9's acme environment.

I would also highlight, that es is just 163KB, while bash is 1.3MB, yet it provides a magnitudes more powerful, dynamic, garbage collected, functional programming language!

onetom··on Unix command line conventions over time
I had a similar experience, when ppl didn't know that codec comes from coder-decoder... It happened, when I called a Clojure namespace x.y.codec, with encode and decode functions in them. I've also noticed how some of my colleagues hasn't realized, that the Rust serde library is short for serialize-deserialize.
onetom··on Take the pain out of Git conflict resolution: use diff3 (2017)
The 3-way diff in JetBrains products, like IntelliJ, are the best, IMHO, because it helps you edit the resolved result, while updating both left and right diffs.

Their diff tool also has a magic-wand icon, which resolves trivial conflicts automatically. I still wonder why git doesn't do that by default... It's such a pain to resolve conflicts without that feature.

Also, you get syntax highlighting, structural editing, help, definition quick-lookup and similar IDE features available, while working on the resolved version of the code, which is syntactically correct usually, because there are no explicit, textual conflict markers in the resolved text.

onetom··on Show HN: Berkeley Mono Typeface
7 is similar to the italic 1, I guess. but also, the hand written version of 7 was taught to us, in Hungary, in the 1980s, with a small horizontal cross-line on the slanted stem of the 7. we quickly abandoned that small detail when writing, because we never saw that on printed material, though in writing 1 & 7 can be similar
onetom··on Git in one image
this statement surpises me, because `git pull --rebase` is practically my most frequently used operation, besides commit, push and changing branches.

intellij even comes with the concept of update, which is either a `pull` or a `pull --rebase`

it asks u once which of those should be the default behaviour, then all i do is cmd-t to updaTe (aka git pull --rebase) my current branch, then push my commits, after a potential 3-way merge, which intellij has the easiest-to-learn interface for, imho.

onetom··on FD 100
I also struggled with this for awhile... Can't remember how have I figured it out at the end. I was programming in Forth before, so I even tried BYE :)
onetom··on Localstack – Local AWS Emulator
Or put the API definitions into some database (sqlite, datascript + nodejs or babashka or nbb), then you can decide what http library or mocked http solution would you like to use, eg https://github.com/oliyh/martian

Most of the code is just a thin veneer over that information...

onetom··on A plain text note-taking system for problem solving
In the more distant past, when we didn't have a lot of "markup formats", "plain text format" just meant the opposite of "binary format", where "plain" was just emphasising its human readability. But I wrote my first BASIC program around the age of 7, in 1984 and the first and shortly after learnt Forth on a ZX Spectrum. So that's my perspective.

We wrote programs, which controlled a Roland DG DXY-880. That also used a plain text programing language.

I was not speaking a lot of English at that time, so mirror translating back from Hungarian, we said, "textual format" or "plain, textual format" ("síma, szöveges formátum"), to contrast its simplicity with binary formats.

(I was born and raised in Szeged though, so that could be just our regional dialect. How about you?)

onetom··on Apology
That's my experience too. I'm Hungarian and worked or collaborated with people from a handful of nations (Japan, Korea, Tamil Nadu (India), Mumbai (India), Ukraine, Russia, Portugal, Poland, Guandong (China), Hong Kong, USA, Brazil, Nepal, Pakistan, Switzerland, France, Austria, UK, Greece, Serbia, Montenegro, South Africa, Australia, Sri Lanka, Singapore, Thailand, Indonesia, Malaysia, Netherlands, Canada), in person, just over the past ~13 years. Before that, I was only exposed to Hungarian work culture for the first 30 years of my life, so that was my base-line.

Some of the differences in attitude towards work, co-workers and authority truly triggered rage in me. Then someone suggested that the reason for these differences are cultural, hence very deeply rooted and I can't expect to change them quickly or at all. For that reason, I should be the one who adapts, since now I understand the situation and I care to solve the problem.

I kinda agree with this assessment, but if I can put this effort in to even out cultural differences, so as the other party can, just have to make them aware of this discovery and try converge multiple times, since our goal is to work together.

There is a lot more to say, but that's how far I have the time to go now :)

onetom··on GitHub – nushell/nushell: A new type of shell
I understand that the industry largely does not acknowledge how big of a problem implicit dependencies are, but since the OP is clearly aware of some issues with implicit dependencies, I was just surprised why so content with these issues. It clearly hinders the adoption of upcoming technologies at least in the mind of the OP.

I'm not really an expert in the Nix expression language. Hasn't even finished reading the Nix pills, which is a very practical documentation, yet I could manage to extract a lot of benefit from that shell.nix template I've shared. I'm using Nix for 3+ years now. Because of this experience I do encourage others not to be afraid trying Nix. It gets better with every release.

Docker is a halfway solution and because of its memory and storage requirements it often strains the average development workstations and internet connections.

onetom··on GitHub – nushell/nushell: A new type of shell
use it as an interactive shell first, not for shell scripts.

also, why would any dependency of your projects at work be implicit? all dependencies should be captured somehow, the very least in some documentation.

at our company, we use shell.nix files to declare all of our dependencies, so everyone has the exact same software available on their development workstations.

it's not a completely trivial thing to do, but worth investing into it, to lower the chance of surprises, which will happen when you can afford them the least...

here is an example to get started:

``` with import (builtins.fetchTarball { name = "nixos-unstable-on-2021-05-16"; url = "https://releases.nixos.org/nixos/unstable/nixos-21.05pre2893... sha256 = "1kilrk0ipvldf4rrn6aq6v2bj2jfhbz33cjb9w9ngqmbmr2f94wd"; }) { };

let project-jdk = jdk11; clojure = callPackage ./deps/clojure { jdk11 = project-jdk; };

in mkShell rec { buildInputs = [ coreutils cacert direnv nixfmt curl jwt-cli fd python3 nodejs (yarn.override { nodejs = nodejs; }) project-jdk clojure yaml2json

    modd
    devd
    overmind
  ];

  shellHook = ''
    export LC_CTYPE="UTF-8" # so tar and rlwrap won't complain
  '';
} ```

it shows how u would use your custom package (for clojure in our case) and how would u pin there state of the whole package repository to a specific point in time.

in the past I've used es, the extensible shell (https://wryun.github.io/es-shell/), this way, without bothering my colleagues with teaching them about it. they just git pull, press enter in a shell within the hour repo and direnv will pull down any new dependencies.

onetom··on Squeezebox Keyboard
I remember when I was about 12years old maybe, I was dreaming about something like this, which would allow using 2 positions - up and down, compared to the almost straight base position - of our fingers for input. I was learning to play the recorder at that time; I think that's sparked my thought process.
onetom··on Organizing Clojure Code with Functional Core, Imperative Shell
Does anyone know an open source project, which showcases this approach? I would be interested in how the namespaces are organized.

On the topic of code organization, I have to mention that I'm aware of https://polylith.gitbook.io/polylith/ and looking into that already. Very promising, especially the ability to just have 1 REPL process and control everything from that.

onetom··on Baserow.io – Self-hosted Airtable alternative
It sounds like https://notion.so can do that too, besides being a real-time collaborative document editor, wiki, spreadsheet, etc etc
onetom··on The Pretty JSON Revolution
"pretty output" meaning the one called "Human Style" in the article, where multiple array elements or key-value pairs are compacted onto 1 line, IF they fit into the specified line length.
← PreviousPage 4 of 8Next →