Live data from Hacker News

Moving from Go to PHP Again

dannyvankooten.com

351–360 of 371 posts

Re: Moving from Go to PHP Again

#352
post #345

Earlier quoted context omitted.

O'caml and Haskell are extremely niche in the web server world, and are not especially faster than go. C# is not blazingly fast either. They all seem to be in the same ballpark.

They are all faster than Go in case you haven't been paying attention.

I've been paying a lot of attention and, in my experience (but also according to the highly biased benchmark game), C#/Java/OCaml/Haskell/Go are in the same league, i.e usually 3-10 times slower than C/C++/Ada/Rust/D, and 3-10 times faster than "scripting" languages like Python/PHP/Ruby/Perl.

With (in my experience) go being a little faster than java and haskell, and o'caml being slightly faster than anyone, but nothing significative enough for me to expect an article titled "my Java webapp was too slow so I rewrote it in O'Caml" anytime soon.

Benchmarking is very relative, though. I'd be glad to read evidence showing go is significantly slower than any of those in some domain.

Re: Moving from Go to PHP Again

#353
post #345

Earlier quoted context omitted.

They are all faster than Go in case you haven't been paying attention.

I've been paying a lot of attention and, in my experience (but also according to the highly biased benchmark game), C#/Java/OCaml/Haskell/Go are in the same league, i.e usually 3-10 times slower than C/C++/Ada/Rust/D, and 3-10 times faster than "scripting" languages like Python/PHP/Ruby/Perl. With (in my experience) go being a little faster than java and haskell, and o'caml being slightly faster than anyone, but noth…

Techempower is where real benchmarks live, the highly biased benchmark game examples aren't all using the latest features or even best algorithms.

Re: Moving from Go to PHP Again

#354

Um... “Just for fun, I compared apples and oranges again by benchmarking the login page (which doesn't hit any database) for both application versions using Siege. The Symfony application (PHP 7.3, OPcache enabled, optimized autoloader) handles about 1470 req/s. The Go application (compiled using Go v1.11) averages about 18600 req/s.”

why would I need 18600 req/s ? If you're at that scale then probably symfony isn't for you.

Everyone does: it’s like having a good offense: you don’t need to think about defense if you’re constantly scoring goals. A lot of issues can be hidden by being really good at serving content and taking requests quickly.

Re: Moving from Go to PHP Again

#355
post #2

For the kinds of applications people tend to build in PHP, PHP is probably a better choice than Go. I'd still do Django or Rails before PHP, but Go just isn't designed to make serverside-rendered database-backed websites especially pleasant to write.

> For the kinds of applications people tend to build in PHP, PHP is probably a better choice than Go.

Facebook goes into this category then, I presume?

Re: Moving from Go to PHP Again

#356
post #181

Earlier quoted context omitted.

You are 100% right about that. I've nearly tried almost all PHP frameworks, quite extensively I may add and at the end of the day I found that the less framework I use the better and faster my dev is. Now I just use packages from composer as needed and never ever use them anymore. For me Laravel was a nightmare to use with Vue. Both template engines (blade, vue) use moustache tags so everything has to be declared ins…

Interesting. Coding without a framework is rare these days. I would like to hear more about how you do the basic infrastructure stuff usually provided by a framework: Routing Templating DB abstraction

Composer was a game changer. Instead of a monolithic framework you just compose your app with the dependencies it needs.

    composer require guzzlehttp/guzzle
Now you have GuzzleHttp available to your app. This way you include only what is needed.

Re: Moving from Go to PHP Again

#357

Earlier quoted context omitted.

Those mistakes aren't easy to spot or easy to fix. It's about giving code sunlight so that action at a distance and other kinds of magic don't hide errors making them harder to find, get in your way of fixing them, making reproducibility a mess and confirmation simply guesswork. Its the restrictive design trend of crippling languages which needlessly prevents the sunlight effect from happening along with "information…

You are speaking to the inmates writing the asylum. Give it up. This is the 4chan of the enlightened.

The amateur-to-expert ratio of any topic is directly proportional to its popularity. It's why popular things are polluted with well-intentioned bogus information.

Re: Moving from Go to PHP Again

#358
post #353

Earlier quoted context omitted.

I've been paying a lot of attention and, in my experience (but also according to the highly biased benchmark game), C#/Java/OCaml/Haskell/Go are in the same league, i.e usually 3-10 times slower than C/C++/Ada/Rust/D, and 3-10 times faster than "scripting" languages like Python/PHP/Ruby/Perl. With (in my experience) go being a little faster than java and haskell, and o'caml being slightly faster than anyone, but noth…

Techempower is where real benchmarks live, the highly biased benchmark game examples aren't all using the latest features or even best algorithms.

Thanks a lot, didn't know techempower. Go seems to behave pretty well in these benchmarks, though.

Re: Moving from Go to PHP Again

#359
post #199
post #174

Earlier quoted context omitted.

I talked with a few people who wrote Go servers and while they loved almost everything about the language and ecosystem, they hates the missing generics so much, they still switched to other languages later. Writing code-generators for everything wasn't fun.

I don't miss generics in Go and I have used generics in C++ a good deal. I think the whole generics argument against Go is largely parroted by people who may not even know what generics even are. C doesn't have Generics either. It's doing OK.

Any language that doesn't have generics, including C and Go, have to work around that limitation. In C, people get around this by using void* (equivalent to using interface{} in Go) or code generation via macros.

I'd flip what you said and say that most of the people arguing against generics in Go don't have much or any experience with them. Which makes sense because a large number of users came from dynamically typed languages.

Re: Moving from Go to PHP Again

#360

Earlier quoted context omitted.

> Do you still upload your code via FTP directly to the web server? It's pretty rare that this is even an option, since no one in their right mind would set up an FTP server with access to anything important. SFTP? I don't see why not. No need to make things more complex than is necessary. I don't remember any particular problems with code caching when I did PHP development, though maybe you use a different caching t…

>> SFTP? I don't see why not. No need to make things more complex than is necessary. You are trying to argue definitions (SFTP vs FTP when FTP just means “any file transfer protocol”) instead of arguing that uploading any amount of files by any protocol that are immediately picked up by the interpreter introduces nondeterministic behaviour of the website where the users accessing your website only see a subset of the…

Who says you have to upload your code directly to the deployment directory? Upload files, switch symlink. Done. You are talking about a deployment technique that has nothing to do with PHP.
Post reply on HN