Recent submissions

Comment · 3 years ago
This differs in Europe, where some NAA's view night flying as equivalent to IFR.
Comment · 4 years ago
Comment · 4 years ago
Nice thread. The comment about "full steam ahead with Rust" was nice.

Like you I've been on a basically identical search, but instead of coming up from Rust I've come down from dynamically typed languages on the backend. I just couldn't bear another run-time error that would have been easily prevented with Typescript.

I've come to the conclusion that the palette of ergonomic and statically typed languages for the backend is surprisingly quite sparse (when one includes the requirement of a relatively sizable community) if you don't include Java/Go.

Languages I personally crossed off:

* Java - Just much too verbose for my taste, too mutable, too nullable, and I don't find "Kingdom of Nouns" elegant to program in. (The JVM is quite magnificent though..)

* Golang - I get why people like it, and I have absolutely nothing against it. For me it's not expressive enough.

* Typescript - Pretty much 100% what you said. The language itself is wonderful, but it really shines when confined to the browser. The runtime differences between the Browser/Node cause all sorts of problems. Also compiled binaries are nice, which are out here.

I see why somebody might choose each of those languages, and be highly justified in doing so, but for me they didn't fit the bill.

That leaves:

* Scala - Only have very light experience. Really strong support for functional/immutable style programming, and checks all the boxes as another commenter pointed out. Community seems a bit complex at times. I haven't had time to really dive into it, but it's been on my mind.

* Rust - Seems like it nails a lot of things really well. Haven't ever touched it, so I can't give an educated appraisal of its merits. The only real obvious con is that it's "overkill" for systems dealing primarily with business logic, i.e. where GC isn't a big issue.

* Swift - Seems quite excellent, but I had written it off as unsuitable for general purpose stuff. Perhaps a premature take?

* Nim - The one on the list I have played around with the most. Seems to have a very powerful macro system which I have yet to take full advantage of. Feels like a statically-typed python, with a bent towards an imperative style over a more functional one. I am personally thrilled they went with the decision to make "func" a fist-class keyword, with special compiler significance. Still a bit niche however.

Comment · 4 years ago
We have similar experiences. I absolutely love Typescript. But I don’t like Node very much. So I keep TS in the browser.

I’ve been looking at Nim or Scala for the backend. It’s either that, or just dive into Rust.

It really seems if you don’t want to use Node, Java, or Go the available choices for a statically typed backend get quite slim.

Comment · 4 years ago
The technique that you have described on viewing the simple object combinations as "projections" is an excellent one; composability in your system emerges from efficiently selecting and combining these projections into the desired combination. At different points in your system you take just take different projections. Cross-cutting concerns are a breeze.

It actually all starts to feel like.... SQL! State is stored globally in a defined schema and queried as needed by the system.

But you can't do this if your compositions are preordained from on high by a rigid class hierarchy, the data is crystallized into the "blessed" projection and that's that. It's analogous to your SQL queries being constrained to solely static views. No JOIN. No GROUP BY. No WHERE.

Comment · 4 years ago
Agreed, very interesting things going on in the "edge" space. I personally think this is why HN is so jazzed about things like fly.io. Super low latency opens up a whole new category of applications, it's a "step function" change in that regard.
Comment · 4 years ago
Comment · 4 years ago
I haven't implemented this pattern (and I'm not convinced it is widespread or even exists in a cohesive form yet) but I've become quite bedazzled with the idea of "UI as pure function of state" a la React/Redux, but with state maintained in the backend database and transmitted to the client via websockets, instead of locally.

Assuming a real-time interactive application, the major components would look something like this:

- Backend service distributed geographically to facilitate low latency to clients, with a single writer node and many read replicas

- Backend data store is SQLite, and importantly runs as a process on the same VM as each of the service nodes, so that there is no need for any network roundtrip to query the database on a read operation

- Clients subscribe to the service and receive a single JSON object representing the UI state

- Database modifications trigger a websocket notification to all subscribed clients with the respective diffs to the state object

- On the client side, a library like React (my choice, but of course there are others) watches the state object and renders the UI accordingly. Client writes are routed to the writer node (Traditional caveats about RYOW apply), UI updates are optimistically applied

- Pure client side state (modals, etc.) is handled solely via the frontend

It's tangential to the architecture, but this obviously would be well suited for something like fly.io. I'm sure many of the Phoenix people are nodding their heads as this architecture bears a lot of resemblance to LiveView, which I am also interested in for its own merits.

I see this as essentially a marriage between React/Redux and LiveView; it essentially comes down to having a globally replicated SQLite DB serve as your Redux store, but "over the wire" and it's colocated with your API layer.

What's the motivation? For me, React/Redux with Redux Toolkit is pure bliss for any sort of UI development. Throw in Tailwindcss and you're really rockin'. The problems arise from the impedance mismatch between maintaining application state locally in a Redux store when the true source of truth is your DB, and all the network traffic/caching considerations/api logic that needs to come with that. (You've actually got a distributed system on your hands)

If you can keep the client focused on the UI, then the complexity mostly lives in the API service layer where writes are replicated to all the VMs. It wouldn't work for every style of app, but with a service like fly.io behind you this tradeoff starts to look very attractive.

(Aside: I think this is why a lot of HN'ers are so excited about fly.io. If I can distribute my application and achieve super low latency relatively simply that is a step-change and opens up so many avenues of experimentation for development)

If the application were a more traditional read-heavy website and didn't need real-time updates, I might rip out the websocket layer and replace it with something like Remix, which I see as sort of a "rendering layer" that sits between the client and the backend for React apps.

Anyway, it's an exciting time to be a web dev. I would be curious to hear if anyone else has pondered a setup like this.

EDIT: Formatting

Comment · 4 years ago
Okay, I think this and the sibling have tipped it. Sounds like Haskell is where I will land and the best place to start branching out. Appreciate you!
Comment · 4 years ago
I can’t say I’m too jazzed about Kotlin or Groovy, but Scala on the other hand sounds really brilliant!
Comment · 4 years ago
Insightful comment. In general I prefer tools that have a prescribed way of looking at the world and don’t try to be everything to everyone. That said, I feel a certain allure to the depth and “wizardry” that I’ve heard so much about in Scala, which doesn’t generally fit this mold.

So at the moment I really think I’m stuck between Scala, Haskell, or Elixir.

It’s tempting for people to simply say, “Learn all of them” but for practical reasons that’s not possible at the moment. So thanks a lot for your comment.

Comment · 4 years ago
Thanks a lot. The general hope of the question, was in that there may be people like me on HN who had a similar itch at around year 2-5 in their career.

In general, it's a low-risk decision, because it's only for personal enrichment. But time is precious at the moment and it would be quite a good bit of fun to hear from some people that simply ~love~ their language.

I know, I know.. questions like this can sometimes lack rigour and lead to a simple cheerleading fest, but I was hoping for a relatively lighthearted thread.

I am also convinced this is not an isolated feeling on my part, what I mean by that is, I'm sure this is a relatively common phenomenon among younger engineers who enjoy CS in and of itself, and I would be very interested in hearing what they have to say.

Thanks for the Zig recommendation!

Comment · 4 years ago
Edited.

And fair enough point. To use your analogy, this question is more of the "linguist" side.

If I were solely interesting in the "writer" side, I would be building distributed systems in Go.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton