Live data from Hacker News

A Rust-TypeScript integration

github.com

21–30 of 52 posts

Re: A Rust-TypeScript integration

#21
post #8

Earlier quoted context omitted.

As someone who lightly dabbles in React my interpretation of that comment is “what’s not to like? It solves at least some of the problems React itself introduced!”

Is the state management problem unique to React? Do you not need to manage state in other libraries, like Angular or Vue or Solid?

Cant speak for Vue or Solid, but in Angular this has never been a big issue like it is in react. There is state of course but it is not something you have to actively think about all the time. State is kept as properties in classes, directly on your component or (when it needs to be shared) in services that can be injected. Angualar change detection will update the view when needed. You can argue about the performance of this, but in my experience it is easier on the developer.

Re: A Rust-TypeScript integration

#22
post #8

Earlier quoted context omitted.

As someone who lightly dabbles in React my interpretation of that comment is “what’s not to like? It solves at least some of the problems React itself introduced!”

Is the state management problem unique to React? Do you not need to manage state in other libraries, like Angular or Vue or Solid?

I've written a fair few Solid apps. I've never felt the need to reach for 3rd party tools to help manage state. In my experience, solid's built-in signals (& resources) are enough on their own for simple apps. And when I need something more complex, you can build on top of them if you know what you're doing.

If anyone is curious, here's an interactive, editable tutorial teaching how solidjs signals work. If you haven't seen solid before, its similar to react but components don't re-run whenever their state changes:

https://www.solidjs.com/tutorial/introduction_signals?solved

Am I missing out on some whiz bang magic that the react ecosystem has invented? Is it substantially better than what solid provides out of the box?

Re: A Rust-TypeScript integration

#23
post #18

Why do you need a separate back-end in Rust? Nothing beats Next.js + React server components for me.

> Why do you need a separate back-end in Rust? Such a generic question, with probably hundreds of possible answers, it really depends on the context. From the top of my mind, whatever library/program you wanna use only being available in $Language comes to mind as something you encounter at least once in your career as a programmer.

> From the top of my mind, whatever library/program you wanna use only being available in $Language comes to mind as something you encounter at least once in your career as a programmer.

That wouldn't be a reason to also write your CRUD backend in that language. You would just make it a separate service written in that language.

Re: A Rust-TypeScript integration

#25
post #22

Earlier quoted context omitted.

Is the state management problem unique to React? Do you not need to manage state in other libraries, like Angular or Vue or Solid?

I've written a fair few Solid apps. I've never felt the need to reach for 3rd party tools to help manage state. In my experience, solid's built-in signals (& resources) are enough on their own for simple apps. And when I need something more complex, you can build on top of them if you know what you're doing. If anyone is curious, here's an interactive, editable tutorial teaching how solidjs signals work. If you haven…

I agree that Solid signals and resources are robust, but they are still very similar to React's useState and useEffect, and you are basically suggesting to implement your own state management library. Regardless, with React server components, there is no need to manage state on the client at all.

Re: A Rust-TypeScript integration

#26
post #21

Earlier quoted context omitted.

Is the state management problem unique to React? Do you not need to manage state in other libraries, like Angular or Vue or Solid?

Cant speak for Vue or Solid, but in Angular this has never been a big issue like it is in react. There is state of course but it is not something you have to actively think about all the time. State is kept as properties in classes, directly on your component or (when it needs to be shared) in services that can be injected. Angualar change detection will update the view when needed. You can argue about the performanc…

Angular has NgRx, which is, AFAIK, the same as RTK.

Re: A Rust-TypeScript integration

#27
post #18

Earlier quoted context omitted.

> Why do you need a separate back-end in Rust? Such a generic question, with probably hundreds of possible answers, it really depends on the context. From the top of my mind, whatever library/program you wanna use only being available in $Language comes to mind as something you encounter at least once in your career as a programmer.

> From the top of my mind, whatever library/program you wanna use only being available in $Language comes to mind as something you encounter at least once in your career as a programmer. That wouldn't be a reason to also write your CRUD backend in that language. You would just make it a separate service written in that language.

I rather include a WASM Component that uses $library and pass data within the program, than setting up an entire service doing the same thing, but now with web transport complexity.

Re: A Rust-TypeScript integration

#28
post #21

Earlier quoted context omitted.

Cant speak for Vue or Solid, but in Angular this has never been a big issue like it is in react. There is state of course but it is not something you have to actively think about all the time. State is kept as properties in classes, directly on your component or (when it needs to be shared) in services that can be injected. Angualar change detection will update the view when needed. You can argue about the performanc…

Angular has NgRx, which is, AFAIK, the same as RTK.

As my previous comment suggests, I don't see why people feel like this is needed. It does seem to be used though.

Re: A Rust-TypeScript integration

#29
What I don't understand here: Is the sveltekit app built into an SPA or static site? Or is it running on e.g. node as a second backend that communicates with the rust backend over HTTP? If so, doesn't that quite increase the overhead?

Re: A Rust-TypeScript integration

#30
I have a project that has a python backend and react typescript frontend. Both are typed. How do you all handle resolving types between two systems like that. Ideally I'd like to be able to write types in typescript, and write python types, then verify that the types are compatible (not identical). I frequently frontend side features that add new keys to dicts, and fill in python support later.
Post reply on HN