Hacker Newsnew | past | comments | ask | show | jobs | submit | egze's commentslogin

I actually prefer Mac only apps. It usually means the experience is way more polished.


Unless you don’t own a Mac.


Or even worse, you own a Mac (say, through work), but aren't entirely in the Apple ecosystem and don't want to relearn everything and fight muscle memory every time you switch devices.


Remap the keys.


I have (but or course Apple make it hard to do so you need third party software). But that doesn't help with special mac only software that has it's own style, like Arc or Zed.


Most people who say “all editors have vim keybindings just use that” miss the fact that bindings or not, a lot of vim’s functionality is just not available on other editors.


And that Vim is more than its keybindings, despite the often repeated jokes. Tabs, window splits, search and countless other details may work very differently, and usually not completely with the keyboard.


Exactly. If all you needed to move off vim were keybindings, then I submit that you weren’t really using vim at all.


Even more so then. Simplify, simplify, simplify!


Mac-only apps come with additional security benefits on Windows and Linux too: there's no safer software than the software you cannot run.


compared to their non-mac versions?


I think they mean compared to cross-platform apps that feel equally weird on every system.

There’s some talk in the Mac world about “Mac-assed Mac apps”. I use BBEdit as my main editor because it feels right. The default shortcuts are like every other Mac app. You can use standard Mac tools like AppleScript to automate it. It uses the same fonts, widgets, and menu systems as everything else. It’s made for that environment and it shows in a million ways.

VSCode is a marvel of engineering and I love that it exists. It also feels uncanny-valley “off” on my Mac in ways that make my brain itch, so I don’t use it. Same with Obsidian: it’s a brilliant app, but it bugs me. It’s not bad in any way, it’s just not the right choice for me.


Just to make it clear: you don't have to write stateful apps, just because you can. It's still possible to have the more traditional stateless model like Rails.

If you do write a stateful app, and run it in k8s, you can have state handover to a newly created pod. It works pretty well.


Well, let’s assume we are talking about a webshop. Every user is represented as an actor, a cart might be a state. So cart as a state should be stored somewhere else, let’s say redis. And every single read/write operation would be a network hop. What are the benefits of using actor model then ?

As for state handover between pods - what are the keywords to look for ?


What you describe sounds more like Orleans grains. Erlang's lightweight processes serve a different purpose than actors or objects, they're really about fault tolerance.

A typical Phoenix app spawns one process for every HTTP request, websocket channel, or DB connection, for example. All these things have a lifetime shorter or equal to the pod's.

The VM gives guarantees and tools to ensure one of these process crashing will not affect the others, unless you want it to. For instance, if a request crashes, its memory will be reclaimed, open files will be closed, DB connections will be re-opened, the exit reason will be logged, error metrics incremented, etc. This is possible with no defensive programming like try/catch and so on, because the processes are isolated. For example they don't share memory, so it's always safe to deallocate something if its owner process died.

This gives a two-layer safety net that allows for very reliable apps, where the VM protects you against bugs in your own code, and Kubernetes protects you against bugs in Erlang, or really catastrophic failures. There's a good blog post on this: http://blog.plataformatec.com.br/2019/10/kubernetes-and-the-...


What i had in mind is some kind of gen_fsm or gen_statemachine.

For stateless applications it is pretty obvious how supervision trees can improve the reliability. Essentially the only ‘state’ there is request itself. Worst case scenario client would just retry.

But with some state involved it becomes not as simple.

Essentially the answer to my question probably would be like : “you should store the state in the external system, and design your system in such a way that stored state is always consistent. In case of failure supervisor will respawn the process and it will recreate what it needs from the saved state”


You may find these interesting...

- "The Onion Layer Theory" https://learnyousomeerlang.com/building-applications-with-ot...

- "On Erlang, State and Crashes" http://jlouisramblings.blogspot.com/2010/11/on-erlang-state-...

- "Why Restarting Works" https://ferd.ca/the-zen-of-erlang.html (search for "Heisenbug")

> you should store the state in the external system

Disk works too, but if you're multi-node this means you now have a distributed database embedded in your system, which may or may not be your goal :)

RabbitMQ does this, they developed a library for "persistent, fault-tolerant and replicated state machines" based on Raft: https://github.com/rabbitmq/ra.


Ahh great. “On Erlang, State and Crashes” is exactly answering my question.

As for disks - in good old times when servers were pets, not cattle that was a good idea. But now when the servers are as ephemeral as actors, we need to approach it differently, hence my original question.

Sidenote - i have a strange relationship with Erlang. I first learned it in 2006, liked the idea and was hoping it will eat the world as scale increases. I even contacted Joe Armstrong in hope to translate his thesis. Zero Erlang books in the world at the time. Then i did some load tests using Tsung in 2012. Then i used akka.net in 2018. But till this day i never had a chance to properly use in production.


> you should store the state in the external system

It's an old talk, but this one has a strategy for robustly persisting state across ephemeral containers. The example here is running a multiplayer game server while doing code updates etc. using Horde and CRDTs

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


Agreed, sounds like Orleans. See https://github.com/erleans/erleans :)

Also for general writing on erlang and k8s: https://adoptingerlang.org/docs/production/ -- I try to explain why the two work at different levels so complement each other.



Thank you, i was not aware of the Horde package. Definitely worth looking.

I was also thinking what should happen in case of ‘electricity disappears’ scenario, but came to a conclusion that it is good old ‘save the state you care about’


The Horde README links to a really good talk that nicely demonstrates the library. Worth a watch!


You're not forced to make your user an actor just do it the "regular" way.


Quite a lot of condemning, demanding and calling for actions from the western society. Yet, not once was the word "war" mentioned. Not once were the actions of the Russian government and Putin condemned.

How about you - Roskomsvoboda focus your energy on stopping the war, so Ukrainians can also enjoy the benefits of new technologies?


Are you aware that there is a law (published a few days ago) and people living in Russia can be sentenced to 15 years in prison for calling it war?



Using it and it works quite well. No issues so far.


Same. Very lightweight, does its job.


Just want to say - thanks Chris! LiveView is the most innovative web technology I've seen in the last 5-10 years, and it is an absolute joy to use.


Agreed. I haven't been this excited and motivated by any technology since I got into rails 10 years ago. It's been a great cure for the jadedness I've been feeling about our field in the past couple of years.


"Since I got into rails 10 years ago..." -- this is my line! Cheers!


Also there are always FSB agents sitting in Kaspersky office. Let that sink in.


You could use CRDT for more complex games which are not turn based.

https://moosecode.nl/blog/how_deltacrdt_can_help_write_distr...


Maybe not that advanced for your needs, but I made this drawing app for my son when he was little.

https://babydraw.byteflip.de


My work flags your site as Pornographic for some reason.


For me all of that counts. Even a bug report is a contribution.


Especially a well written and researched bug report. Many typical users lack the skill to do that, and a software developer would have an ample amount of it.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: