Live data from Hacker News

Hacking Go's runtime with generics

dolthub.com

1–10 of 113 posts

Re: Hacking Go's runtime with generics

#3
post #2

ELI5. How is maphash different from just using map? I am surely missing something. I thought the builtin map used hashing too?

The maphash package from the blog post provides routines that call into Go's runtime to hash arbitrary types.

The maphash package in the standard library (hash/maphash) provides routines that hash string and []byte.

The builtin map type is a hash table.

Re: Hacking Go's runtime with generics

#5
I do not understand the appeal of go.

> The proposal argues that Golang developers are forced to work around language when writing hash-based data structures like Tries or concurrent hash maps. Developers who want an efficient hash-based data structure have only the builtin map to choose from. When this issue was originally created in 2017, Golang didn't have generics

And then the author goes to tell us about how this is not a stable solution.

I get wanting to solve a problem, but at what point into fighting the language, to accomplish something simple, do you take a step back and just pick a better one?

Re: Hacking Go's runtime with generics

#6
post #5

I do not understand the appeal of go. > The proposal argues that Golang developers are forced to work around language when writing hash-based data structures like Tries or concurrent hash maps. Developers who want an efficient hash-based data structure have only the builtin map to choose from. When this issue was originally created in 2017, Golang didn't have generics And then the author goes to tell us about how thi…

> pick a better one?

Such as?

Re: Hacking Go's runtime with generics

#8
post #6
post #5

I do not understand the appeal of go. > The proposal argues that Golang developers are forced to work around language when writing hash-based data structures like Tries or concurrent hash maps. Developers who want an efficient hash-based data structure have only the builtin map to choose from. When this issue was originally created in 2017, Golang didn't have generics And then the author goes to tell us about how thi…

> pick a better one? Such as?

My choices would be:

- Elixir

- Rust

- Clojure

- Crystal

In that order.

Re: Hacking Go's runtime with generics

#9
post #6
post #5

I do not understand the appeal of go. > The proposal argues that Golang developers are forced to work around language when writing hash-based data structures like Tries or concurrent hash maps. Developers who want an efficient hash-based data structure have only the builtin map to choose from. When this issue was originally created in 2017, Golang didn't have generics And then the author goes to tell us about how thi…

> pick a better one? Such as?

I'm hoping Kotlin + GraalVM Native Image can fit the niche of golang.

Re: Hacking Go's runtime with generics

#10
post #5

I do not understand the appeal of go. > The proposal argues that Golang developers are forced to work around language when writing hash-based data structures like Tries or concurrent hash maps. Developers who want an efficient hash-based data structure have only the builtin map to choose from. When this issue was originally created in 2017, Golang didn't have generics And then the author goes to tell us about how thi…

I hate Go, but there is no solid alternative for what I do. Documentation quality. Compiler performance. Library support. Easy packaging. Easy language. Consistent cross platform tooling. Easy concurrency. Good for web apps and CLI tools. Reasonably refactorable.

Note I say easy and not good, or simple.

Rust, Haskell, JavaScript, all get caught up on some aspect or another for me.

Post reply on HN