Live data from Hacker News

Go and Assembly

doxsey.net

111–120 of 127 posts

Re: Go and Assembly

#111
post #85
post #79

Earlier quoted context omitted.

How do you handle that with any other language? There is no shortage of redis libs for any language.

If we look at CPAN http://search.cpan.org/search?query=redis&mode=all , there are a few things right in the search results. We have version numbers, release dates, and a review score. All of those give you a chance at finding a half decent library. The first result was updated a week or 2 ago and has 4 significant digits in the version number. None of it's a guarantee but it's a place to get started.

It doesn't seem to be a place to get started for Go though. I just did a search for "golang redis" and it showed me a single perl redis lib?

I like the idea of the reviews and ratings though. Normally I would put almost no value in a rating system but we need to somehow separate the good from the bad without having to dive in and look at and profile code from 20 diff libs on a daily basis.

Re: Go and Assembly

#112
post #75

This font renders odd in IceWeasel 10.0.12 , all occurrences of the letter 'e' have their left side 'cut off' so they stand out and are very difficult to read. Chromium Version 22.0.1229.94 Debian 7.0 (161065) works fine.

Same on Mozilla's official Firefox 19 (beta channel). Raising the font size (Ctrl +) makes the issue go away.

Re: Go and Assembly

#113
post #65
post #15

Earlier quoted context omitted.

Java, Python, Ruby, Lua, Haskell. All names which the programming language is one of the last things a search engine would normally associate, but by sheer number of hits you end up finding stuff. When they were invented these names weren't good either. The discussion about Go's name is indeed useless.

Every single one of those is used way less often and in way fewer contexts than "go." If I hear about this cool new language called Ruby and search for "Ruby Sieve of Eratosthenes," it is highly unlikely there's an article about implementing the Sieve of Eratosthenes in another language that just happens to contain the word "ruby." Conversely, the word "go" is depressingly likely to appear in articles relevant to you…

I just searched "Ruby Sieve of Eratosthenes" and "go Sieve of Eratosthenes". The language ruby was the focus of the first four results, and after that some were ruby-specific and some were just Sieve with a mention of ruby somewhere.

Exactly the same applied for Go. The first four were Go-specific, and the remainder were a mix of Go-specific and pages about the Sieve with "go" somewhere on the page.

Also, as others have said, one immediately comes across references to golang everywhere.

Re: Go and Assembly

#114
post #58
post #24

Earlier quoted context omitted.

According to golang FAQ, the origin of the name is that, “Ogle” would be a good name for a Go debugger. [1] I just came up the idea: why didn't they name the language "Goo", and leave "Gle" to the debugger? It would be more common for people to refer to the language itself than to its debugger. [1] http://golang.org/doc/faq#What_is_the_origin_of_the_name

I think you should consider the possibility that the FAQ is joking. Also, if you're suggesting "gle" as a debugger name, you're missing the joke. "ogle" is a verb meaning, approximately, "to look at", so it's a good name for a debugger. "gle" is not. (Except that "ogle" is not actually a good name for a corporate-sponsored debugger, because "ogle" has sexual connotations. Which is why you should assume that this is a…

I didn't know that! Thanks :-)

Re: Go and Assembly

#115
post #65

Earlier quoted context omitted.

Every single one of those is used way less often and in way fewer contexts than "go." If I hear about this cool new language called Ruby and search for "Ruby Sieve of Eratosthenes," it is highly unlikely there's an article about implementing the Sieve of Eratosthenes in another language that just happens to contain the word "ruby." Conversely, the word "go" is depressingly likely to appear in articles relevant to you…

I just searched "Ruby Sieve of Eratosthenes" and "go Sieve of Eratosthenes". The language ruby was the focus of the first four results, and after that some were ruby-specific and some were just Sieve with a mention of ruby somewhere. Exactly the same applied for Go. The first four were Go-specific, and the remainder were a mix of Go-specific and pages about the Sieve with "go" somewhere on the page. Also, as others h…

I feel like you must have stopped reading my comment before the last paragraph, where I point out Google has learned to deal with this as Go has gained popularity and now it's not so much of a problem in practice.

Re: Go and Assembly

#116
post #80
post #78

This assembler is awful. I thought that AT&T had a monopoly on ghastly assembly language syntax -- but this article causes me to question that assumption: MOVL BX,autotmp_0000+-4(SP) ; from the article -- terrible! MOV EBX,[ESP+autotmp_0000-4] ; Intel -- comprehensible! This assembler has an imaginary register called FP. WTF is up with the center dot? A programming language should not require Unicode to write -- espe…

How does it require unicode?

The article talks about making a label whose name begins with a middle dot.

Re: Go and Assembly

#117
post #78

This assembler is awful. I thought that AT&T had a monopoly on ghastly assembly language syntax -- but this article causes me to question that assumption: MOVL BX,autotmp_0000+-4(SP) ; from the article -- terrible! MOV EBX,[ESP+autotmp_0000-4] ; Intel -- comprehensible! This assembler has an imaginary register called FP. WTF is up with the center dot? A programming language should not require Unicode to write -- espe…

It's amusing that the first line is considered "terrible" but the latter is "comprehensible". For someone versed in modern languages they both look like gibberish.

Here's an explanation suitable for someone only familiar with high-level languages:

MOV x,y translates to the assignment operator "x = y" in a high level language [1].

Your program only has access to one giant array called "memory" [2] [3]. So MOV EAX,EBX means "EAX = EBX" in high-level terms; MOV EAX,[EBX] means "EAX = memory[EBX]" in high-level terms ("memory[EBX]" has the same meaning here as in C-family languages like C, Java, Javascript and Python). This choice of operator notation is intuitive, because it's very similar with the use of brackets in other popular languages.

The insane syntax uses parentheses instead of brackets. Which is confusing, since it's not related to the standard meaning of parentheses, grouping for order of operations or function call. So you would say "MOV EAX,(EBX)" in weird-syntax land.

But the insanity doesn't end there.

In the sane Intel syntax, if you want to load the value at memory location 148 + -4 + ESP into EBX, you can probably figure out how you would say it:

  MOV EBX,[148 + -4 + ESP]
The C/Java/JavaScript/Python translation is:

  EBX = memory[148 + -4 + ESP]
In weird-land, the syntax for this operation is:

  MOVL BX,148 + -4 (SP)
To me, it looks like this instruction says:

  Let t = 148
  Let u = The contents of memory pointed to by SP
  Let v = -4*u
  Let BX = t+v
Clearly, there are only two possible explanations for this: The person who came up with this syntax was drunk at the time, or the person who came up with this syntax was high at the time.

[1] In a HLL, "x = y" allows arbitrarily long expressions for x and y, but in assembly language only a few different forms of x and y are allowed. In a high-level language, in the expression "x = y", x needs to be an lvalue, while y can be a more general rvalue. "a = 5+6" is legal; "5+6 = a" is not. Both the left- and right-hand side can be arbitrarily long and complicated, for example the LHS could be "a.b.c.d.e.f.g.h" and the RHS could be "m+n+o+p+q+r+s+t", assuming the appropriate variables exist and have the appropriate types.

[2] Unless you use multiple segments. But you generally don't do that.

[3] Or paging. But you usually let the OS take care of that.

Re: Go and Assembly

#118
post #61

Earlier quoted context omitted.

The name "Go" is a problem, but the name "C" isn't? Silly.

Who said the name "C" isn't a problem?

I do indeed have the impression that anyone who would bring up Golang's name as a serious flaw would also believe that C's name has held it back as well.

Re: Go and Assembly

#119

Earlier quoted context omitted.

Who said the name "C" isn't a problem?

I do indeed have the impression that anyone who would bring up Golang's name as a serious flaw would also believe that C's name has held it back as well.

Well, you're a bit mistaken. There are a couple of reasons why this isn't the case:

1. C was already pretty much the programming language by the time the Web took off, so it had an inherent advantage in Googlability due to its popularity.

2. The letter C does not tend to be used by itself as often or as widely as the word "go," so even if C hadn't already had an unfair advantage, it would have less of a problem just on this basis. The odds that an arbitrary programming article unrelated to C will have "C" scattered about are not all that great. The odds that an arbitrary programming article unrelated to Go will use the word "go" are actually pretty decent. Put another way, "Go" is a more common word than "C," so it generates more noise.

I don't find this issue to be all that problematic anymore since the search engines seem to have learned that "go" in conjunction with programming terms indicates an interest in Go-centric material, but I did find it vexing when Go was younger and I was first trying to learn it.

Re: Go and Assembly

#120

Earlier quoted context omitted.

Well, since two of the original three developers (Pike and Thompson) were part of the Plan 9 team, it makes perfect sense that they based the compilers on the Plan 9 ones.

I see recent commits in Go's mercurial history to fix bugs on Plan 9. Is anyone at Google actually using Plan 9 to develop Go? Or is building for Plan 9 just a sanity test for maintaining cross platform code? Wikipedia says the last "stable" release of Plan 9 was in 2002, but there seem to be a number of recent forks.

Plan 9 is on a rolling release since 2002.
Post reply on HN