Live data from Hacker News

Show HN: Go-git – low-level and extensible Git client library in Go

github.com

51–60 of 60 posts

Re: Show HN: Go-git – low-level and extensible Git client library in Go

#51
post #8

Earlier quoted context omitted.

Go's lexical scoping and first class function/method's owe a lot to JS for leading the way IMHO. That said, it's "object" system is almost the complete reverse. JS is methods with data, Go is data with methods. It's an interesting contrast.

> Go's lexical scoping and first class function/method's owe a lot to JS for leading the way IMHO. I don't think this comment deserves the downvotes. JS deserves a lot of credit for doing scoping right in 1995, at a time when most popular languages (i.e. not Lisp or ML) were doing it wrong. (A notable exception was Perl 5, which did scoping right in 1994.) Thanks to JS, a lot of working programmers who would never be…

What languages without lexical scope are you thinking of?

Aside from literally only (pre-Common and Emacs) Lisp, I can't think of any language without lexical scope (outside some constructs etc).

[edit:] Or are you thinking of "only a single global namespace"? Even that exists only in otherwise highly restricted scripting languages, I think? ("Everything global" is technically lexical, but I see why you wouldn't want to call it that.)

Re: Show HN: Go-git – low-level and extensible Git client library in Go

#52
post #51

Earlier quoted context omitted.

> Go's lexical scoping and first class function/method's owe a lot to JS for leading the way IMHO. I don't think this comment deserves the downvotes. JS deserves a lot of credit for doing scoping right in 1995, at a time when most popular languages (i.e. not Lisp or ML) were doing it wrong. (A notable exception was Perl 5, which did scoping right in 1994.) Thanks to JS, a lot of working programmers who would never be…

What languages without lexical scope are you thinking of? Aside from literally only (pre-Common and Emacs) Lisp, I can't think of any language without lexical scope (outside some constructs etc). [edit:] Or are you thinking of "only a single global namespace"? Even that exists only in otherwise highly restricted scripting languages, I think? ("Everything global" is technically lexical, but I see why you wouldn't want…

Tcl, PHP, any language without closures.

Re: Show HN: Go-git – low-level and extensible Git client library in Go

#53
post #8
post #5

Golang is the new JavaScript: everything that can be rewritten with it will be :)

Go's lexical scoping and first class function/method's owe a lot to JS for leading the way IMHO. That said, it's "object" system is almost the complete reverse. JS is methods with data, Go is data with methods. It's an interesting contrast.

>> first class function/method's owe a lot to JS for leading the way

Javascript's lambdas were inspired by Scheme which has been around since the 70s.

"Remember, I was recruited to 'do Scheme', which felt like bait and switch in light of the Java deal brewing by the time I joined Netscape. My interest in languages such as Self informed a subversive agenda re: the dumbed down mission to make 'Java's kid brother', to have objects without classes. Likewise with first-class functions, which were inspired by Scheme but quite different in JS, especially JS 1.0." - Eich (on HN)

Re: Show HN: Go-git – low-level and extensible Git client library in Go

#54
post #51

Earlier quoted context omitted.

What languages without lexical scope are you thinking of? Aside from literally only (pre-Common and Emacs) Lisp, I can't think of any language without lexical scope (outside some constructs etc). [edit:] Or are you thinking of "only a single global namespace"? Even that exists only in otherwise highly restricted scripting languages, I think? ("Everything global" is technically lexical, but I see why you wouldn't want…

Tcl, PHP, any language without closures.

How does PHP have dynamic scope? It's been ages since I touched it, but if I remember right...

Global is just a flat namespace. Functions have their own, separate flat namespace each. I tried the following in a REPL:

function two() { echo $a; }

function one() { $a = 1; two(); }

one();

as the standard dynamic scope example, and I get an "undefined variable" error. Did that use to be dynamic? (I wouldn't be surprised, though, especially given PHP's implementation history...)

There is an explicit "static" modifier that looks dynamic, but I couldn't get it to run that way. It seems to just retain state in recursive calls of the same function, or something?

[edit:] (And PHP doesn't predate Javascript, but regardless, "no first-class functions" isn't "no lexical scope".)

Re: Show HN: Go-git – low-level and extensible Git client library in Go

#55
post #8

Earlier quoted context omitted.

Go's lexical scoping and first class function/method's owe a lot to JS for leading the way IMHO. That said, it's "object" system is almost the complete reverse. JS is methods with data, Go is data with methods. It's an interesting contrast.

> Go's lexical scoping and first class function/method's owe a lot to JS for leading the way IMHO. I don't think this comment deserves the downvotes. JS deserves a lot of credit for doing scoping right in 1995, at a time when most popular languages (i.e. not Lisp or ML) were doing it wrong. (A notable exception was Perl 5, which did scoping right in 1994.) Thanks to JS, a lot of working programmers who would never be…

I argued for the design of and wrote the implementation for Go's lexical scoping and first class functions, and I can tell you they were in no way influenced by Javascript.

Scheme, Lisp, ML: yes. I'd written sizable programs in each of those, I'd worked on rewriting a programming languages course textbook with a professor in college, and I'd studied On Lisp. One of the initial test cases was Paul Graham's accumulator generator: https://github.com/golang/go/blob/0f4f2a6/test/closure.go

Javascript: no. At that time (Feb 2009) I doubt I even knew Javascript had lexically-scoped closures. I know I didn't buy 'Javascript: The Good Parts' until March 2010. Even today I don't think the fact that Javascript got closures right is particularly remarkable, except that, as Crockford demonstrates, that fact serves as the fundamental saving grace that enables forgiveness of many other problems.

Re: Show HN: Go-git – low-level and extensible Git client library in Go

#56
I once had a cold-call recruiter tell me Go was worthless. I asked the recruiter to never call me again and hung up.

People whom are both disrespectful and unable to see where their hockey puck sports analogies will be later on have marginal utility and are likely liabilities... don't get involved with those sorts.

Re: Show HN: Go-git – low-level and extensible Git client library in Go

#57
post #55

Earlier quoted context omitted.

> Go's lexical scoping and first class function/method's owe a lot to JS for leading the way IMHO. I don't think this comment deserves the downvotes. JS deserves a lot of credit for doing scoping right in 1995, at a time when most popular languages (i.e. not Lisp or ML) were doing it wrong. (A notable exception was Perl 5, which did scoping right in 1994.) Thanks to JS, a lot of working programmers who would never be…

I argued for the design of and wrote the implementation for Go's lexical scoping and first class functions, and I can tell you they were in no way influenced by Javascript. Scheme, Lisp, ML: yes. I'd written sizable programs in each of those, I'd worked on rewriting a programming languages course textbook with a professor in college, and I'd studied On Lisp. One of the initial test cases was Paul Graham's accumulator…

I wasn't suggesting that JS directly influenced you. Rather my point was that JS was of the most important languages that brought lexical scoping and closures to the masses. By the time Go came around, it was considered a bog-standard feature, because of languages like JS (and others) that popularized it. That meant that programmers could more easily pick up Go.

Re: Show HN: Go-git – low-level and extensible Git client library in Go

#58
post #54

Earlier quoted context omitted.

Tcl, PHP, any language without closures.

How does PHP have dynamic scope? It's been ages since I touched it, but if I remember right... Global is just a flat namespace. Functions have their own, separate flat namespace each. I tried the following in a REPL: function two() { echo $a; } function one() { $a = 1; two(); } one(); as the standard dynamic scope example, and I get an "undefined variable" error. Did that use to be dynamic? (I wouldn't be surprised,…

Yeah, I shouldn't have used the term "dynamic scope" there. PHP has dynamic environments that can be mutated at runtime, which languages like JS don't (well, outside of direct eval).

Re: Show HN: Go-git – low-level and extensible Git client library in Go

#59
What are the chances someone could use this to build a tool to provide structured output for git commands.

SVN had the --xml flag for pretty much every command, allowing for 100% parseable output, with git ( in particular git log) there is no 100% solution - the best you can do is use --pretty=format and create delimiters you hope aren't used in the commit message (or author names/emails, etc) itself.

The output doesn't have to be XML. JSON or even escaped CSV would be fine.

Re: Show HN: Go-git – low-level and extensible Git client library in Go

#60
post #55

Earlier quoted context omitted.

> Go's lexical scoping and first class function/method's owe a lot to JS for leading the way IMHO. I don't think this comment deserves the downvotes. JS deserves a lot of credit for doing scoping right in 1995, at a time when most popular languages (i.e. not Lisp or ML) were doing it wrong. (A notable exception was Perl 5, which did scoping right in 1994.) Thanks to JS, a lot of working programmers who would never be…

I argued for the design of and wrote the implementation for Go's lexical scoping and first class functions, and I can tell you they were in no way influenced by Javascript. Scheme, Lisp, ML: yes. I'd written sizable programs in each of those, I'd worked on rewriting a programming languages course textbook with a professor in college, and I'd studied On Lisp. One of the initial test cases was Paul Graham's accumulator…

Even if JS was not in the back of your mind, you have to admit that the design of "LISP in Cs clothing" (to quote Crockford) turned out nearly identical - certainly much closer than to Scheme, LISP or ML. And JS did it much earlier than Go. My point was that it owed developer comfort with the design to JavaScript, and not necessarily direct design influence.
Post reply on HN