Live data from Hacker News

Re: Moving from PHP to Go and Back Again

blog.breakthru.solutions

81–90 of 281 posts

Re: Re: Moving from PHP to Go and Back Again

#81
post #53
post #36

Earlier quoted context omitted.

Java has been used as the implementation language for games, high performance servers, message queuing systems, operating systems, and operating embedded devices for goodness sake. It doesn't get much more "systems-y" than that. Go is surely at least as suitable for these uses. I think the other commenter is correct: it seems like a semantics argument, and a rather pointless one at that.

You cannot really write an operating system without manual memory management. That's why Go is not a systems programming language. It does not diminish Go advantages: I would personally prefer it as an application programming language to Java.

Completely false, there are several research OSes with kernel level GC.

I suggest reading Project Oberon source code, it’s freely available.

Re: Re: Moving from PHP to Go and Back Again

#82
post #48

I have been writing Go, Node.js and PHP for quite a while now. I don't think golang is overhyped; nor it's a silver bullet. There are systems like Kubernetes, etcd, and so on that are implemented in Golang and they work really well. I think problem is people trying to use Golang for EVERYTHING ! There are so many things I would disagree with in the article; but I won't disagree with the fact that if you want language…

If you look for an oop or fp language you are also out of luck. You are only happy if you look for a better C which most people aren't.

Re: Re: Moving from PHP to Go and Back Again

#83
post #68
post #54

Earlier quoted context omitted.

By that definition every language has a runtime (yes, including C with crt0.o). Something has to set up the stack, enter the main() function etc. So how do you differentiate a systems language runtime? One that is bundled with the OS? Or is thin enough by some arbitrary measure?

In Go you cannot fully control the runtime as a programmer- Go's GC is a complicated periodically run program with sometimes surprising behavior. crt0.o is a very simple set of startup routines with a fixed and predictable behavior. It is typically run only once ("0" in the name is for startup), and has only a couple of assembly instructions.

C runtime does much more than that, depending how floating point is supported, language extensions for constructors on execution start, threading runtime introduced in C11.

Re: Re: Moving from PHP to Go and Back Again

#84
post #80
post #4

I don't know why the author bothered to even respond to that Medium article. The Medium article starts with that Go shines as a systems programming language. He lost me right there: how can a language with a garbage collector and a runtime be called a "systems programming language"?

Since Xerox PARC, UK Royal Navy, DEC, HP Labs, ETHZ, Microsoft Research have implemented full stack OSes in GC enabled systems programming languages. At ETHZ Oberon workstations were used during a couple of years by several users across the department. Most of those attempts failed due to losing the political and financial wars of bringing them into the wider market, not because of lack of features.

very interesting. I would have thought that any practical kernel written in a language with a GC would either have unpredictable slowdowns or be exceedingly complex.

Re: Re: Moving from PHP to Go and Back Again

#85
post #76
post #46

Earlier quoted context omitted.

A slightly different perspective. For the end user Go apps are by far the easiest to setup and use. Usually it's just a single binary to download. That is a huge advantage that can't be beat. Other languages usually need a large number of dependencies, with Ruby and Node, often an entire build environment, with plenty of potential for dependency hell and hours wasted. Some may advocate containers at this point, but i…

All compiled languages support static linking, nothing special about Go.

At least historically speaking, this wasn’t true. And the fact that it’s true today for Java and C# is an anomaly, since for most of the history of those languages native compilation was either third party, second-class with missing features, or both. Look at GCJ or Excelsior (commercial).

Or look at Python, which is also compiled. Or Ruby, or JavaScript, TypeScript, Dart…

Re: Re: Moving from PHP to Go and Back Again

#86
post #51

> These are hard issues to solve with PHP, so hard that Facebook hand crafted a SPECIALIZED VIRTUAL FREAKIN’ MACHINE to deal with the performance issues inherent in PHP. Does that really seem like an “easy” solution? It is worth noting that this was pre-PHP7. Post-PHP7 the out of the box performance is similar or better to what Facebook did with the HHVM.

Also, very few projects will ever end up at the scale (user base/metrics) that Facebook had. 99% of all PHP software will be fine with a quadcore server with 4GB RAM, running a LAMP stack. This can be scaled as needed (eg moving off mysql, adding a reverse proxy, real load balancing).

I've always been really skeptical of those language performance comparisons which refer to PHP.

As stated above PHP7 has similar performance when compared to HHVM which was made by Facebook. Additionally PHP has an amazing performance debugger by FB called xhprof.

PHP performance could always be increased hugely by making sure is cache buckets have enough memory (opcode cache, realpath_cache_size).

Secondly with any web framework your app will most likely be limited by IO (database, file lookups, networking) before it becomes limited by actual code execution performance.

If anyone's ever worked on a project where the performance problem was the language and not IO I'd be really interested in hearing about it, but in my career of making websites I've never ran into this problem yet.

Re: Re: Moving from PHP to Go and Back Again

#87
post #84
post #80

Earlier quoted context omitted.

Since Xerox PARC, UK Royal Navy, DEC, HP Labs, ETHZ, Microsoft Research have implemented full stack OSes in GC enabled systems programming languages. At ETHZ Oberon workstations were used during a couple of years by several users across the department. Most of those attempts failed due to losing the political and financial wars of bringing them into the wider market, not because of lack of features.

very interesting. I would have thought that any practical kernel written in a language with a GC would either have unpredictable slowdowns or be exceedingly complex.

Blue Bottle OS, the last Oberon OS iteration done with Active Oberon had a video player as part of the standard set of applications.

Just because there is a GC doesn’t mean it is the only way to allocate memory.

Re: Re: Moving from PHP to Go and Back Again

#88
post #3

Everyone I know who uses Go complains about it. Every day you write Go code you will come across some piece of code that would be shorter with templates in C++ or using , or you could do it more simply in Python, or if you were really clever it would be a single line of Haskell. And yet we keep writing Go. By comparison, I'm a bit put off by the Rust community's evangelism, but that might just be my personal experien…

> And yet we keep writing Go. Remember that Go is still a niche language, and the majority of programmers will never write a single line of Go. There is a nice trend around Go nowadays, but most people are still writing PHP, Python or Java and Go isn't going to replace any of those.

One could equally remember that Java was a niche language in 2000 used by a few dot-com startups, and even today it has not replaced C++, COBOL, or Fortran.

Languages don’t get replaced, people just don’t use them as often for new projects.

Re: Re: Moving from PHP to Go and Back Again

#89
post #76
post #46

Earlier quoted context omitted.

A slightly different perspective. For the end user Go apps are by far the easiest to setup and use. Usually it's just a single binary to download. That is a huge advantage that can't be beat. Other languages usually need a large number of dependencies, with Ruby and Node, often an entire build environment, with plenty of potential for dependency hell and hours wasted. Some may advocate containers at this point, but i…

All compiled languages support static linking, nothing special about Go.

This is not always true. Static linking with other language doesn't always have similar experience with Go. One of these is the compilation speed. With other languages you'll still have time to get a coffee break before its done.:)

Re: Re: Moving from PHP to Go and Back Again

#90
post #76

Earlier quoted context omitted.

All compiled languages support static linking, nothing special about Go.

At least historically speaking, this wasn’t true. And the fact that it’s true today for Java and C# is an anomaly, since for most of the history of those languages native compilation was either third party, second-class with missing features, or both. Look at GCJ or Excelsior (commercial). Or look at Python, which is also compiled. Or Ruby, or JavaScript, TypeScript, Dart…

Language and implementation is not the same thing.

Does not matter where the implementation comes from, if it is free or commercial, what matters is that it exists.

Post reply on HN