Live data from Hacker News

Show HN: Lockless Ringbuffer Built with Go Generics

github.com

21–23 of 23 posts

Re: Show HN: Lockless Ringbuffer Built with Go Generics

#21

Earlier quoted context omitted.

I certainly am, yes. Spent about 12 years in the wrong career and then realised my love for programming (after a lifelong love of computers. Not sure how I missed that...) I started with Python (and Kivy). Then went on to Go (which felt like a revelation over Python. For me, anyway). Along with that came JS, HTML, CSS and React. Because of Go, I had become prejudiced against interpreted, dynamically typed languages.…

Boy your progress sounds super similar to mine. Though with swapped order on JS and Go. Mine was primarily Python->JS->Go->Rust. I've been a Rust fanatic for maybe ~2 years now. It was a natural progression for me, and i quite enjoyed it. I also love Rust, the stdlib (and supporting crates) gave me a UX quite similar to Go's batteries-included stdlib.

How did you find learning Rust? You hear a lot about how steep the learning curve is.

How suitable is it for web backends?

I am just dying to get started with it.

Re: Show HN: Lockless Ringbuffer Built with Go Generics

#22

Earlier quoted context omitted.

if you have not known what a ring buffer is, may I suspect you to be a developer who taught yourself?

I certainly am, yes. Spent about 12 years in the wrong career and then realised my love for programming (after a lifelong love of computers. Not sure how I missed that...) I started with Python (and Kivy). Then went on to Go (which felt like a revelation over Python. For me, anyway). Along with that came JS, HTML, CSS and React. Because of Go, I had become prejudiced against interpreted, dynamically typed languages.…

If React doesn’t click for you, try out Svelte! You can do the interactive tutorial in one sitting[0]. It’s a breath of fresh air, incredibly productive, and countless React developers express intense feelings of joy and relief when describing their transition. Many people report that React feels outdated, convoluted and unintuitive in comparison.

[0] https://svelte.dev/tutorial

Re: Show HN: Lockless Ringbuffer Built with Go Generics

#23

Earlier quoted context omitted.

Boy your progress sounds super similar to mine. Though with swapped order on JS and Go. Mine was primarily Python->JS->Go->Rust. I've been a Rust fanatic for maybe ~2 years now. It was a natural progression for me, and i quite enjoyed it. I also love Rust, the stdlib (and supporting crates) gave me a UX quite similar to Go's batteries-included stdlib.

How did you find learning Rust? You hear a lot about how steep the learning curve is. How suitable is it for web backends? I am just dying to get started with it.

Not bad, or bad, depending on how you learn it, what you try to do, etc.

In my experience, you can write Rust a lot like you write Go. A little more learning perhaps, because Go will do things "automagically", but you can reference count just like you would in Go/Python and it makes your code _far, far_ simpler. You also can use Rust's "interfaces" (`dyn Foo`) which behave a lot like Go's interfaces of `Foo { }`.

You waste a bit of memory, but who cares when you're coming from Go or Python. You aren't trying to write the most efficient program ever (usually).

As far as web backends, it's what we use it for at my shop. The only rough part there is framework maturity. The best novice framework (imo) is Rocket, though it's not quite mature. The "best" framework is probably Actix, but it's a bit more complex for newcomers.

So yea, my advice is to be careful to learn only what you think you need to know. Don't bite off everything at once. Generics is the same story, learn the basics of what a generic is, how to use it, etc, and then rarely use it. You didn't have them in Go, right? Write Rust like Go.

Learning a pinch of everything is useful though so that when a complex annoying thing occurs you have some idea how to handle it or where your knowledge is deficient. Also embracing Rust communities like /r/learnrust/ is useful too. Very friendly.

Hope this helps :)

Post reply on HN