HNHacker News
TopNewBestAskShowJobs

hopia

254 karma · joined January 14, 2020

submissionscomments
hopia··on Actix – Actor Framework for Rust
Yeah actor model is a good fit for distributed concurrency. For single machine concurrency, let alone parallel computing it may not be the ideal choice.
hopia··on Apps I pay for as a bootstrapped business
DigitalOcean certainly is great, I'm using it too, but it's still far more work running your stuff there vs Heroku.
hopia··on Interview with Simon Peyton Jones (2018)
> Functional programming is about function composition. If you haven't picked up on this notion, than you haven't fully understood FP.

Maybe that's exactly why the likes of Elixir feel so much less functional than some other FP langs. You don't usually compose functions, merely use function application (|>).

hopia··on My productivity app for the past 12 years has been a single .txt file
Yes, that's a major part of the reason I wanted a tool like this for myself too. It's great to know it could be of use to others too!
hopia··on My productivity app for the past 12 years has been a single .txt file
Would seeing any kind of analysis benefit you or boost your motivation? Like something that would clearly show based on your own data that, say there is a strong correlation between feeling ill and drinking less than 4 cups of water throughout the day?

The reason I ask is because I'm building something like this. And not many people track their habits as systematically as you do.

hopia··on My productivity app for the past 12 years has been a single .txt file
How do you analyze the data afterwards? Or for what reason are you keeping such detailed records of your life of?
hopia··on My productivity app for the past 12 years has been a single .txt file
Any chance you could share this plugin?
hopia··on Ask HN: What are good solo developer blogs that you enjoy reading?
As for developers building projects, you might like: https://www.derrickreimer.com/
hopia··on Simple text editor has over 15k monthly users
What a lifehack!
hopia··on Why Discord is switching from Go to Rust
Thanks for the comprehensive reply!

I guess I better experiment more with mnesia before really using it for anything serious. Or find alternatives. We had Redis before but that experience turned out just awful so we got rid of it.

As for the community, I think Elixir is where it's at nowadays. There is, unsurprisingly, a very strong focus on webby stuff with Elixir, and a lot of the things you would build with it are just easy. Like a multi-machine chat server.

If I started to build a new distributed chat server today, Elixir would still be the easiest way to go, despite eventually likely not being the most performant solution out there. Discord likewise seems happy with their choice for this particular use case, only supplementing it with the likes of Rust for specific problems in their domain.

I mean you yourself built a lot of the Erlang's/BEAM's logic from the scratch on Go just to be able to use it there. I'm expecting I'd end up in a similar alley with Rust/Haskell/take your pick if I was attacking the problems where Elixir has all the facilities already set up and battle tested.

hopia··on A list of companies using Elm in production
Wow that's cool, components as first class citizens. The native control flow structures are also pretty innovative!
hopia··on A list of companies using Elm in production
By huge flat data model do you refer to the sum type which basically holds your app's state? I've always wondered how that state management approach scales when the codebase grows, never seen a good example of a large scale web app architected with Elm.
hopia··on Why Discord is switching from Go to Rust
Yeah the scale is what makes this problem a problem here. I've done exactly that "online" stuff per user process and it works fine on a small scale, even when it needs to be globally inferred. But I suspect it'd quickly become the bottleneck when scaling.

I had no idea mnesia was that fragile though, what gives? What kind of issues did you encounter with it? What do you use now to solve those issues with Erlang/Elixir?

Sure, we all know Erlang doesn't shine in computationally intensive workloads. Obviously, Rust was the right call here. But stateful distributed soft real-time concurrency, can you really say with a straight face that Rust comes with all the same features as BEAM out-of-the-box? Or any other modern platform for that matter. I've yet to see Erlang/Elixir beaten in that particular niche.

hopia··on Why Discord is switching from Go to Rust
We use Elixir too and ironically, Redis became our bottleneck as well. What a useless dependency it is when running on BEAM.
hopia··on Why Discord is switching from Go to Rust
Not to disagree with your analysis of the performance implications, but I don't think having all that data under a single or a few processes would be the right architectural pattern to handle this in Elixir.

The article says that the data is basically "per-user", indicating that the active client connection process could be used to store the data. It already hosts other data related to the client (connection) anyway. I think updating and querying it globally would be the trouble in that case.

Another could be storing the data in mnesia, BEAM's internal mutable in-memory DB. Probably better, but still not ideal to solve this.

Anyway, you're right in that no matter how you'd try to solve this problem on pure Elixir you'd still be seeing some bottlenecks because BEAM just isn't very well suitable for this kind of problems, hence Rust.

But can you elaborate on what you mean by other platforms catching up with Elixir's inherent concurrency advantages? Which modern platforms give similar features?

hopia··on F# Pipeline Operator in JavaScript with Babel
Haskell already has the function application operator, It's simply & in Haskell.
hopia··on F# Pipeline Operator in JavaScript with Babel
import Data.Function (&)
hopia··on F# Pipeline Operator in JavaScript with Babel
And Elm & Purescript.
hopia··on F# Pipeline Operator in JavaScript with Babel
I always wondered why does it take such a long time to formalize this in Babel's specs. It seems something fairly unequivocally useful, but I guess its implementation has some major hurdles in JS.
hopia··on Monitoring the Erlang VM With AppSignal's Magic Dashboard
It's not, observer is still different.

AppSignal's monitoring shows useful metrics but does not allow examining the supervisor tree and other things possible with Observer and other OTP tooling. In some sense, it's not a live debugging tool but a monitoring dashboard.

hopia··on You’re better off using Exceptions
Erlang has a very different execution model compared to those other languages you mentioned. In fact, Erlang's culture in many ways encouraged to program less defensively than you would be expected to in other languages (ever heard of "let it crash"?).

That's because the whole expectation of exceptions/errors is built into the system unlike pretty much anywhere else.

hopia··on You’re better off using Exceptions
That does suck, does it commonly occur because of non-total functions in the libraries or what?
hopia··on You’re better off using Exceptions
Throwing exceptions may be the most concise, but handling them rarely is.

But most importantly, static type systems lose the ability to infer what's coming so these may turn out to be really pesky problems.

hopia··on New Finnish study confirms that BMW and Audi owners drive like idiots
I don't know where the original paper is either, but Finnish news cite a person called Jan-Erik Lönnqvist as the professor.
hopia··on TypeScript’s quirks: How inconsistencies make the language more complex
Fair enough, you're probably right, I have only used it in contexts where I build both sides of the application.
hopia··on TypeScript’s quirks: How inconsistencies make the language more complex
Aeson parsing seems straightforward to me, not sure it could be easier in any language. Serialization from your endpoint is automatic, based on your data types.

The real benefit of using a well typed language here is that you only need to parse the data once at this point, after that the type system makes sure the data is of correct format everywhere else in your codebase.

hopia··on TypeScript’s quirks: How inconsistencies make the language more complex
I agree but it's a big leap to lose Javascript interoperability to gain type soundness.

There are many such compile-to-js languages but none nearly as popular as Typescript is.

hopia··on TypeScript’s quirks: How inconsistencies make the language more complex
Personally I always found it annoying to manually add a common tag to every interface/type on TS just to have it work like an union type. But since TS doesn't leak types to runtime that's the only way.
hopia··on A Pythonista's Review of Haskell
Well data constructors are a part of algebraic data types which don't really exist in OOP. Unless you consider the class itself (or an interface) or its constructor as the algebraic data type constructor, and its properties/parameters as the values.

I'm not so sure fmap would make semantically as much sense in something like Java as it does in FP.

hopia··on Vmap in Haskell
This feels absurd indeed. Like half of the GHC extensions introduce only some trivial syntactical convenience whereas the other half each introduce practically a whole new language.

This list aligns more with the latter description.

← PreviousPage 4 of 8Next →