Incremental Parsing in Go
31–40 of 78 posts
Re: Incremental Parsing in Go
#32Earlier quoted context omitted.
I don’t know, not implementing generics when it was pretty obviously needed was a huge oversight, so I’m not sure. Also, the reason for compiler bootstrapping is more of a “beauty thing”, then practicality. It would definitely be faster in a low-level language, but I doubt it would matter as an end user.
You aren't sure if Ken Thompson knows what he's doing?
EDIT: I meant to write that I think very highly of him as an architect/developer.
Re: Incremental Parsing in Go
#33Earlier quoted context omitted.
> not implementing generics when it was pretty obviously needed was a huge oversight I get the desire for generics. I do a lot of C# and have used generics for a very many years. Yet I've been writing Go for around 6 or 7 years and other than in the beginning (when I was new to it) I haven't found myself missing them at all. In other words, for many people the lack of generics comes across as an oversight. For others…
Well, it is not a blanket statement, it’s just the generic truth (pun not intended) based on decades of evolution of programming languages and a relatively expensive mistake for Java, which would have been a perfect opportunity to learn from. Sure, it is seldom missed as an end user, but as a library user it is essential. That’s why map and the like had to be hard coded into the language, and why concurrent versions…
A bit contradictory, really, but that's just semantics I suppose.
More importantly even if you could say 99% of devs agree (and you can't because they don't) that still doesn't make it an oversight.
If they'd neglected to add generics because it wasn't considered, that's an oversight. If it was neglected because in the opinion of the creators of the language it wasn't needed for the purposes they created it for, that isn't an oversight but a thought-through engineering decision.
Of course you're free to disagree with that decision, but an oversight it was not.
Re: Incremental Parsing in Go
#34Earlier quoted context omitted.
Well, it is not a blanket statement, it’s just the generic truth (pun not intended) based on decades of evolution of programming languages and a relatively expensive mistake for Java, which would have been a perfect opportunity to learn from. Sure, it is seldom missed as an end user, but as a library user it is essential. That’s why map and the like had to be hard coded into the language, and why concurrent versions…
> Well, it is not a blanket statement, it’s just the generic truth A bit contradictory, really, but that's just semantics I suppose. More importantly even if you could say 99% of devs agree (and you can't because they don't) that still doesn't make it an oversight . If they'd neglected to add generics because it wasn't considered , that's an oversight. If it was neglected because in the opinion of the creators of the…
Re: Incremental Parsing in Go
#35Earlier quoted context omitted.
This is kind of a test of how nuanced your understanding of programming languages can be. Rust with a bit of effort put into optimization will be faster than Go with a bit of effort put into optimization, it is true. However, you need to double-check your intuition for how big and how consequential the delta is, because I'd guesstimate it as roughly a factor of two, possibly a touch less. It is true that Rust does a…
Not sure if rust vs go would be the best example here. Rust vs Java would be a better one — go has a very primitive GC in comparison, and java does optimize hot loops to a higher degree, so a naive code base would be very hard to beat in a lower level language.
Java tends to win for really naive programs where the author didn’t bother caring about performance or allocations at all, but if any care was put into it at all Go usually wins in my experience.
The trope that Go’s GC is primitive in comparison to Javas is not really accurate. You can’t consider a language’s GC in isolation.
Java’s GC and JIT are extremely complex because the language semantics are terrible for performance by default. The “everything is an object” model made sense when the language was designed and main memory access times were roughly equal to a CPU cycles, but that’s no longer true by a factor 100 to 200 now.
Go’s GC makes different trade offs (low latency, extremely high concurrency, tight integration with the runtime and scheduler) because the language semantics are much more sympathetic to modern hardware (“true” structs, automatic escape analysis, etc), so it can.
Re: Incremental Parsing in Go
#36Earlier quoted context omitted.
> Well, it is not a blanket statement, it’s just the generic truth A bit contradictory, really, but that's just semantics I suppose. More importantly even if you could say 99% of devs agree (and you can't because they don't) that still doesn't make it an oversight . If they'd neglected to add generics because it wasn't considered , that's an oversight. If it was neglected because in the opinion of the creators of the…
Fair enough, I may not have used the correct word, but it is still a typical “told you” situation, both during development, after go’s initial appearance and ever since until it finally was decided that it should be indeed implemented.
Whilst I haven't missed it in Go myself, enough other people say they do that its inclusion was inevitable. Which means it probably should have gone in sooner.
Re: Incremental Parsing in Go
#37Earlier quoted context omitted.
This is kind of a test of how nuanced your understanding of programming languages can be. Rust with a bit of effort put into optimization will be faster than Go with a bit of effort put into optimization, it is true. However, you need to double-check your intuition for how big and how consequential the delta is, because I'd guesstimate it as roughly a factor of two, possibly a touch less. It is true that Rust does a…
Not sure if rust vs go would be the best example here. Rust vs Java would be a better one — go has a very primitive GC in comparison, and java does optimize hot loops to a higher degree, so a naive code base would be very hard to beat in a lower level language.
Re: Incremental Parsing in Go
#38For example:
#_ (defn foo
[x y]
(println x y))
This is equivalent to commenting the three lines. Things become even harder when you learn that these thing "swallow" the next form and can be used anywhere: (let [a #_ b 43] #_ #_ hello (H N) (print a))
The code above is equivalent to the following: (let [a 43] (print a))
All the rest is comments.The hard/interesting bit is that to tokenize you must construct a syntax tree in order to correctly parse the next form, but in order to construct a syntax tree you first need to tokenize the code.
Re: Incremental Parsing in Go
#39Earlier quoted context omitted.
Not sure if rust vs go would be the best example here. Rust vs Java would be a better one — go has a very primitive GC in comparison, and java does optimize hot loops to a higher degree, so a naive code base would be very hard to beat in a lower level language.
I do a lot of “high throughput” stuff at work in both Go and Java, and the Go stuff is usually faster by default. Java tends to win for really naive programs where the author didn’t bother caring about performance or allocations at all, but if any care was put into it at all Go usually wins in my experience. The trope that Go’s GC is primitive in comparison to Javas is not really accurate. You can’t consider a langua…
Re: Incremental Parsing in Go
#40Earlier quoted context omitted.
> Well, it is not a blanket statement, it’s just the generic truth A bit contradictory, really, but that's just semantics I suppose. More importantly even if you could say 99% of devs agree (and you can't because they don't) that still doesn't make it an oversight . If they'd neglected to add generics because it wasn't considered , that's an oversight. If it was neglected because in the opinion of the creators of the…
Fair enough, I may not have used the correct word, but it is still a typical “told you” situation, both during development, after go’s initial appearance and ever since until it finally was decided that it should be indeed implemented.
After several years and attempts at a good enough proposal, Ian Lance Taylor put one out that was able to cross the finish line, and now we have generics.