Live data from Hacker News

Re: Moving from PHP to Go and Back Again

blog.breakthru.solutions

91–100 of 281 posts

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

#91
post #89
post #76

Earlier quoted context omitted.

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.:)

Which other languages?

Turbo Pascal compilation speed, in MS-DOS, using 90’s hardware was already faster than Go.

There are lots of languages with modules support, with static linking and native compilation to choose from.

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

#92
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…

With say a java app thou you'd typically get a .zip with all your class path dependencies and a launcher in one bundle. This is not the case for ruby, js (node), python etc where the norm is to splatter dependencies across your file system. Its not quite static linking but closer

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

#93
post #9
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. What are the alternatives if you want something with type checking? Java? No, thanks. Haskel? Where are the libraries? C/C++? I guess Typescript is the only alternative

Kotlin, C#, Scala

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

#94
post #9

Earlier quoted context omitted.

> And yet we keep writing Go. What are the alternatives if you want something with type checking? Java? No, thanks. Haskel? Where are the libraries? C/C++? I guess Typescript is the only alternative

C#. Its pragmatic and now cross platform, has got OOPS and the functional features you need.

I like C# as a language but everytime you use it a puppy dies (MS exists)

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

#95
post #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.

Even then you can go wrong. I've learned that first hand while trying to write some lower level networking stuff in Go.

Also OOP in Go is perfectly fine.. it's just by composition only and without inheritance.

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

#97
post #7
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…

I use the quality of people's complaints in interviews all the time. I like it when they have a complaint but can see why the trade-off was made. I don't like it when they're obviously parroting HN group-think. I really don't like it when they have no complaints at all, but are able to recite the marketing happy-talk verbatim.

Often people are in all of those categories, they use what I see as marketing speech to talk about their own experiences. Those experiences might differ from mine so what I dismiss as parroting or marketing is later shown just to be difference in opinion.

I admire people who can spot such things effectively and steer discussions in an productive manner. I see now that this is not really about interviews anymore but just everyday discussions.

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

#98
post #86

Earlier quoted context omitted.

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…

Being skeptical is a good attitude. I'm very skeptical of this Eldorado that some posters see in PHP7. My experience is quite different.

> Additionally PHP has an amazing performance debugger by FB called xhprof.

xhprof is unmaintained for years. The official version does not compile with PHP7. Various forks exist, but the only stable fork has been rebranded and defaults to sending all the performance data to the branding company.

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

Always, really? The history of PHP opcode's caches is complex. Before PHP5.6 where Zend published their opcache+, I've seen the various solutions (APC and others) cause vicious bugs.

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

I've seen quite a few PHP applications that were CPU-bound, and that were far from Facebook's scale. For instance, the learning platform Moodle is popular with universities, but getting it to handle hundreds of concurrent users cannot be done on a plain quad-core server.

Another poster suggested load balancing as an obvious solution, but adding this is not that easy. E.g. Moodle has to track various files, including uploads. So once you add a load balancer and several PHP servers, you need to use a network mount for most of your files, which has a big impact on IO performance.

I'm not saying that other languages are better, because I can't compare the exact same large application in two languages, but PHP7 isn't an Eldorado.

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

#99
post #78
post #9

Earlier quoted context omitted.

> And yet we keep writing Go. What are the alternatives if you want something with type checking? Java? No, thanks. Haskel? Where are the libraries? C/C++? I guess Typescript is the only alternative

Java, C#, F#, C++, D, Rust, OCaml, Haskell, FreePascal, Ada, Swift, Nim look all pretty fine to me, and yes there are ways to compile Java and .NET languages to native code just like Go. As for libraries, what matters is if the desired use case is covered, not winning the App Store count.

[deleted]

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

#100
post #86

Earlier quoted context omitted.

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…

Depends on the use case. I've definitely worked with projects that required a ton of capacity, because the realtime search functionality was booting the full Symfony framework every time someone typed in a letter. To get rid of those performance problems, someone builds a fragile mess of PHP. In that case something like Go or Node.js is a much better fit to the problem.

But if you're building a big old MySQL CRUD app full of complicated business rules, PHP makes a lot more sense.

Post reply on HN