News for hackers. Stuff that matters.
Re:Why I Don't Like Golang (2016) by amedvednikov on Wednesday June 12, 2019 @08:59PM (#20170947)
I created a new language [0] that is very similar to Go, but it fixes many things people often complain about, including all of the points in this article (except #2, but I don't think it's a drawback, really).

It got lots of attention in a couple of months since the public release, and I often hear people say that they feel like this is "Go done right".

It'll be open sourced by June 20.

[0]: https://vlang.io

Re:Why I Don't Like Golang (2016) by Aeolun on Wednesday June 12, 2019 @09:14PM (#20171024)
This looks interesting. I might give it a go.
Re:Why I Don't Like Golang (2016) by jsjolen on Thursday June 13, 2019 @07:53AM (#20173853)
If the size of a struct is changed through hot-code reloading then how does the runtime react?
Re:Why I Don't Like Golang (2016) by amedvednikov on Thursday June 13, 2019 @01:51PM (#20177134)
Only function bodies can changed.

I don't think it's possible to modify structs on the fly.

Maybe it is, I need to think about it/do research.

Re:Why I Don't Like Golang (2016) by jsjolen on Thursday June 13, 2019 @03:51PM (#20178043)
Don't worry, it pretty much isn't possible to do so without semantics which will basically make your program "drift" during run-time away from what a newly compiled program would do.

EDIT: Assuming inlining and call-by-value struct is a possibility.

Re:Why I Don't Like Golang (2016) by baby on Wednesday June 12, 2019 @11:34PM (#20171603)
Options :) But generics :(

I'm really hopping that Golang finds a way to either not add generics, or add them in contrained ways. Your example code for generics are very hard to read for example.

Rust somehow tackles that with associated types, but since generics are still allowed it's not great imo.

Re:Why I Don't Like Golang (2016) by amedvednikov on Thursday June 13, 2019 @07:28AM (#20173688)
Always interested in feedback, thanks.

Why do you find them unreadable, because of the angle brackets?

I've considered using

  struct Repo ⟨T⟩ {
    db DB
  }
Instead of

  struct Repo <T> {
    db DB
  }
The conversion would be done automatically by vfmt.
Re:Why I Don't Like Golang (2016) by baby on Thursday June 13, 2019 @12:21PM (#20176342)
Because they are too general.

The ultimate test is to read someone else's code and try to figure out what is the actual struct being used in place. You will see that you often have to jump through many many files in order to get a sense of what is actually used in place. This problem becomes even harder when people start nesting generics.

Take a look at associated types in Rust. I think it is a better way to do generics because it forces you to specify the type early. It also prevents nested types that are hard to read like <T<A, Cat<B>>> (and this is nothing)

Re:Why I Don't Like Golang (2016) by amedvednikov on Thursday June 13, 2019 @01:49PM (#20177115)
I see, thanks. Right now V supports generics with only one type T anyway :)
Re:Why I Don't Like Golang (2016) by AH2mdte8kPnJS on Wednesday June 12, 2019 @09:45PM (#20171179)
This looks really cool!