reply on: We need to build more services software on lightning \ stacker news ~bitcoin (2025)

10 sats \ 9 replies \ @nerd2ninja 5 May 2023 \ parent \

on: We need to build more services software on lightning

bitcoin

Lot of Bitcoin projects use Rust these days. You could try learning that.

1358 sats \ 7 replies \ @ek 5 May 2023

I have become a Go maxi.

After a long time working with Python and NodeJS software and after the initial weirdness (wtf are channels and goroutines and why should I care), it's feels really nice to work in a statically typed language (without generics however ...) again where concurrency support is built-in with goroutines and channels. It feels soooo much better to have a compiler do type checking for you (in a guaranteed way) even if that means you have to define your types first, so you are slower first. But I would trade runtime errors with compile-time errors any time.

Also, the build process spits out a single binary which can be run anywhere where golang is installed (afaik) and the ecosystem is not a complete mess like Python (looking at you, Python package managers) and NodeJS (npm vs. yarn, CJS vs ESM, Javascript vs TypeScript). I also like how imports work in Go. In Python, you run into this circular import issue pretty fast if you don't try to stay ahead of it.

I also tried to learn Rust but the syntax felt rough. When I tried out Golang, I didn't look back.

@theindranetworkprotocol also made me try out Go. If I remember correctly, he also mentioned here and there how awesome Go is.

reply

50 sats \ 0 replies \ @l0k18 5 May 2023

I like Go because Go lets me write code and then build the structure as I go. You gotta watch out for race conditions with maps and slices, make sure you isolate things using interfaces to avoid tight coupling, the pattern of passing closures is a good way to keep the code concise and single-responsibility.

The best thing about Go is you can just dive into it. The worst thing about go is that you can just dive into it. The drowning feeling you can get sometimes when you tinker with too many pieces at once inside a concurrent system... thank Linus for Git so I don't have to restart the whole thing from scratch!

reply

10 sats \ 2 replies \ @ass 7 May 2023

What IDE do you use? Mine just expired.

reply

10 sats \ 0 replies \ @nerd2ninja 7 May 2023

I know you didn't ask me, but I'm inserting my answer anyway lol

I don't use an IDE, but on rare occasion, I'll use cherrytree as a note taking app to organize thoughts

It seems to have some IDE like aspects in there if you choose to use it for programming as well.

reply

0 sats \ 0 replies \ @ek 7 May 2023

I use vscode because I work in multiple languages and I like how it's more a text editor than a full-blown IDE.

reply

0 sats \ 2 replies \ @ek 5 May 2023

Wait, Go seems to support Generics, lol: https://go.dev/blog/intro-generics

I think I confused Generics with function overloading. This is what Golang does not support. But I was able to deal with it. Was just unexpected but not that big of a deal in the end.

reply

150 sats \ 0 replies \ @k00b 5 May 2023

After coding in C/C++ for 5+ years, I loved golang (I was a go maxi for ~3 years).

But if you are trying to build software that solves problems not requiring statically typed and compiled code, you can produce solutions faster in more expressive languages eg js.

Coming from a golang background is one reason why I'm so excited about the Deno runtime ... It lets me use the most popular expressive programming language (js) with a golang-like package management system and can produce standalone binaries like golang. It's not ready for primetime yet, but it'll get there.

tbh if I could have my way, I'd prefer to program in a Lisp dialect ... it doesn't get more expressive than ad hoc DSLs.

reply

59 sats \ 0 replies \ @l0k18 5 May 2023

Go has interfaces. There's no need to complicate a language with more than one effective way to do things. You can mimic much of the behaviour of variants and generics with interfaces. And the interfaces available in Go since 1.18 are a pretty slim set and don't include any structured types. You can do signed/unsigned/float and you can do arrays (predefined size) but that's it, at least if I have grasped it correctly.

Easy way to remember if Go has a feature: is there a simpler way to do it? Ok, no. No map/reduce/filter or complex iterators, no generics, no objects, the slice and map are naked and barely cloaked pointer types that make for some racy fun with goroutines.

reply

0 sats \ 0 replies \ @At OP 6 May 2023

Thanks, will look into it.

reply

reply on: We need to build more services software on lightning \ stacker news ~bitcoin (2025)

References

Top Articles
Latest Posts
Recommended Articles
Article information

Author: Barbera Armstrong

Last Updated:

Views: 6077

Rating: 4.9 / 5 (59 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Barbera Armstrong

Birthday: 1992-09-12

Address: Suite 993 99852 Daugherty Causeway, Ritchiehaven, VT 49630

Phone: +5026838435397

Job: National Engineer

Hobby: Listening to music, Board games, Photography, Ice skating, LARPing, Kite flying, Rugby

Introduction: My name is Barbera Armstrong, I am a lovely, delightful, cooperative, funny, enchanting, vivacious, tender person who loves writing and wants to share my knowledge and understanding with you.