Live data from Hacker News

Go and Assembly

doxsey.net

81–90 of 127 posts

Re: Go and Assembly

#81

And herein lies the problem with Go. Seriously, try searching for articles about Go on HN. People always say "well the name isn't a problem, because you just search for it with "golang" instead!" but no one writes golang unless they're pointing out how to search for it . If I was trying to get back to this article a month from now and I searched for "go", would I find it? Probably not, unless I remembered the article…

C and R used to be hard to search for, but these days Google search does brilliantly given a bit of context. If Go is hard to search for now, be sure it will get better. I do wish they had chosen a different name, but I realise it matters less and less.

Honestly R is still a pain in the ass to search for, much more-so than Go currently is. This might be a fluke of my personalized google search results though.

Re: Go and Assembly

#82
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.

Re: Go and Assembly

#83
Here's how to do inline assembler in D:

    int *_memset32(int *p, int value, size_t count) {
      asm {
        mov     EDI,p           ;
        mov     EAX,value       ;
        mov     ECX,count       ;
        mov     EDX,EDI         ;
        rep                     ;
        stosd                   ;
        mov     EAX,EDX         ;
      }
    }
The compiler adds the function prolog/epilog for you, as well as any save/restore for used registers.

Re: Go and Assembly

#84
post #16

Except for his bullet about compiler speed, which might be faster than GHC, all of his bullets apply to GHC Haskell too.

> all of his bullets apply to GHC Haskell too

No chance. Using the `go` tool to install packages is at least an order of magnitude less annoying than using `cabal`.

Re: Go and Assembly

#85
post #79

Earlier quoted context omitted.

It's a good start but it needs many more features to be considered usable. For example, I just did a search for "redis" and about 30 libs came up. Half of them don't even have a description. How can I know which one to pick at a glance? Asking me to evaluate and profile 30 different libs for just a single task is unreasonable. Also this page isn't even on Google's first page for when you search for something. I didn'…

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.

Re: Go and Assembly

#86
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.

The review score thing is nice, is there anything like that in packaging systems for other languages?

Usually I just check the commit activity on github if I want to see which Go libraries are actively developed.

Re: Go and Assembly

#87
post #56

Now this is an impressive argument. Particularly the first section about the tool chain (and the assembly part is really cool too). I have been holding back because I don't like the lack of exceptions. But it occurred to me that C doesn't have anything like exceptions either, and even though that lack causes some serious irritation, the C language as a total package overcomes it and is really powerful. I don't know i…

I think the only thing missing is a REPL as part of the tool chain. ipython and scala shell are so useful, especially when you're learning or just testing things out.

Agreed. The way I tend to use the repl in clojure is just to code up a script in vim and then %Eval the whole thing. Editor plugins for Go could compile-and-run, and know stuff like the working directory and the gopath, which could get you a bit closer without having to build a real REPL.

Re: Go and Assembly

#88
post #20

Does Go only support that crazy Plan 9 (amd64) assembler syntax that nobody uses anywhere?

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.

Re: Go and Assembly

#89
post #49

Earlier quoted context omitted.

I think the real value of panic/recover over try/catch is the vastly improved idiomatic usage. Only to be used in exceptional cases, and never to cross package boundaries. I just find that so much more pleasant.

Hmmm, interesting. The "defer" approach is a different spin on things. But yes, panic/recover does look like it would address my concerns. I never did like exceptions across package boundaries much, but inside a cohesive module I want to use them instead of a bunch of code that checks return values for error codes.

Although, another post above says it's not idiomatic, so I guess working with go means accepting the lack of an exception mechanism.

Re: Go and Assembly

#90
post #71
post #57

Earlier quoted context omitted.

"Many search engines"? How many search engines do you use? And which of them ignore or error on 2-letter words? I just tried this on the only four search engines I can even think of that seemed like they MIGHT matter: google, bing, ddg, and stackoverflow's site-specific. All four obviously respected the two-letter word "go" (although for my searches only Google and SO returned results I found useful).

Most message board software, for a site. Search engine doesn't just mean web search engine.

First of all, the best way to site-search is to use Google. Seriously, why are you hurting yourself?

Second of all, I can't understand the situation where this would come up. Obviously in normal circumstances it doesn't even come up.

* You wanna search all forums at once? Use Google (or DDG, or the shitty one).

* There's a Go-specific forum? So obviously you don't need to specify Go in the search.

* The forum isn't about Go? Then why are you searching there?

So for your complaint to make sense, you need to have a particular forum you want to limit your searches to, AND you don't want to use Google with site:stupidforum.com, AND the forum covers multiple programming languages, AND the forum doesn't have a tagging system to tag go-lang posts (like basically every programming forum does), AND it has this problem I've never heard of where it rejects 2-letter words?

I'm really trying to avoid just saying "bullshit", but I think you're bullshitting us. Name one such forum.

Again, as I asked in the grandparent comment, name one search engine where you, or anyone you know personally, has had this problem.

Post reply on HN