9 ms·
I haven't done any php development in maybe 10 years but this landing page almost got me to spin up a hello world. I like the elephant frankenstein character -
by harrisonjackson 2y ago
I haven't done any php development in maybe 10 years but this landing page almost got me to spin up a hello world.
I like the elephant frankenstein character - goofy and ugly/cute. Design, color scheme, copy, and animations are clean :chefkiss:
The value prop is well highlighted - at least for someone that's been out of php dev for a while. This seems like a nice way to bootstrap something small. Getting started code snippet makes it seem quick and easy.
- zer00eyz 2y agoI moved from PHP to Golang a bit over a decade ago... Because binary deploys are the bees knees. I dont want 8 containers isolating a bunch of bad software or worse messed up dependency's (looking at you python, maybe some ruby and node code as well). Because rather than releasing installable software you packaged up "works for me" and shipped it to the world. I might play with this out of nostalgia but not so sure that I want these sorts of things in my production environment any more.
- hipadev23 2y agowhy would it be 8 (or any N>1) containers for a php/node/python/ruby app?
- gertop 2y agoPython is pretty messy to deploy without a container. Sure you can (and should!) use a virtual env, but by that point using docker isn't much more efforts. Rails and Node and PHP have at least the decency to have the project's dependencies contained inside the project's own directory by default.
- hipadev23 2y agonah not questioning containers. questioning why he wrote 8 (obviously exaggerated) and why it’s not 1.
- deergomoo 2y agoNginx/Apache/Caddy + php-fpm + something like MySQL if your database lives on the same server as your application. PHP in its default form isn’t a persistent process[0], so you will typically have a web server accepting the requests and forwarding them onto PHP to generate a response. 0: it actually usually is these days for performance reasons, with a pool of processes that are reused. But the mental model is one short-lived process per request
- hipadev23 2y agoand if the Go dev needs a database, or a cache, or an actual fully-featured HTTP daemon processing the requests? I’m just confused about their focus on “single binary” when applications in those languages tend to be a single-container plus the same supporting services their single binary is going to need too.
- gnz11 2y agoThat’s the default of the package managers (i.e. composer, npm, etc) not the language. Setting up a virtual env for Python is a one liner. Hardly messy. I’d argue that deploying a Python web app with mod_wsgi or gunicorn isn’t any more difficult than deploying a PHP web app with PHP-FPM. If anything I’ve seen far more misconfigured PHP-FPM setups than gunicorn setups.
- slim 2y agodid you miss this part in Frankenphp website ? :) Build standalone, self-executable and dependencies-free binaries for your PHP web applications, and command-line tools.
- francislavoie 2y agoThis is PHP running inside a Go server, btw. Compiled with CGO. One binary, one process.
- zer00eyz 2y agoWow the PHP is going to magically get into the binary? /s Yes I could build this with c-go + the PHP and statically link everything (and there might need to be a bit of prayer involved...) ... or I could just write GO and accomplish all the same things with fewer steps. That knotted up mess is why containers are popular.
- francislavoie 2y agoWell, FrankenPHP avoids that prayer, cause it's already done for you lmao But obviously the point of using PHP is for its ecosystem, frameworks etc. Go is still missing a lot of that, the Go community has a weird aversion to frameworks.
- zer00eyz 2y agoI wrote PHP from version 3 to version 6... I remember PHP before it had "frameworks"... PHP ate perl because the battery's were included, you didn't need CPAN, and it had an amazing manual... Python (pip), Ruby (gems) and Node (NPM) all looked much more attractive because they had rich library's at their core and symphony wasnt really useful yet. Yet Go eschews a lot of the same package management issues those other languages have. And a lot of go devs look at the standard library the same way early PHP devs looked at it "I dont need a lot more than this". It's not that go devs are framework adverse we only want what we need and nothing more. In a language that favors composition frameworks quickly become "baggage". It's kind of interesting to watch someone come from a language with a strong package ecosystem and watch them build their first go project. They tend to cruise GitHub and throw EVERYTHING in the cart. It takes them 3-4 days of working with all that before they are complaining up a storm! You hand that same dev SQLC, Validator, and point them at middle ware and the standard lib and ask them for API's and they come back 2 days later grinning ear to ear. Go, done well, is brutalism. Blocky, functional concrete buildings have an amazing charm to them... Go is blocky, its utilitarian, its expressive... You dont write cute code in go, you dont try to make go magical, you want clear easy to read and understand code... Your more likely to come back and add features long before you have to address the performance of go.
- conradfr 2y agoThis is the one good thing non-Go web developers are jealous about Go.
- BartjeD 2y ago.Net and rust and many other languages also support binary deploy. You raise the impression this is a unique property of 'go', how come? You guys have go tunnel vision because you work with it?
- withinboredom 2y agoGo started it. Or at least, popularized the static build, single binary docker files. Naturally, you’ve been able to do this since forever with many languages like C/C++ etc.
- pjmlp 2y agoAmong people that have used nothing besides scripting languages.
- jchw 2y agoTo be honest, it was and is pretty rare to see C/C++/etc. self-contained static binaries on Linux. Glibc doesn't even properly support static linking, and musl does not have 1:1 parity with glibc, so it's challenging to even give a "single binary" for C/C++ programs on Linux, less in the past before musl and during musl's infancy. The more popular thing to do on Linux is something more like AppImages where you bundle a bunch of stuff into a single self-executing file, and that ultimately still is a dynamic binary depending on system libraries (and therefore can't be e.g. plopped in an empty Docker container.) (And yes, Windows and macOS, and probably most of the BSDs, don't really suffer too badly from this issue, since dynamically linking to system libraries/libc is not a problem. Still, not needing libc remains a big advantage for Go since it is possible to cross-compile self-contained Go binaries to any platform Go can target from any other platform; this is challenging to do with C/C++, especially for targets like macOS.) Even if you do get past the code though, there's the assets. For C/C++, bundling static assets into an executable is oddly challenging. There's been a bunch of different bin2c-type programs over the years, yet somehow not really many "standard" approaches to doing it, and many of them suffer from bad performance (especially approaches that go to a source file instead of an object file). Just now, finally, in the past couple years, there is #embed in C... for embedding a resource file. Meanwhile, Go has had several good options in the ecosystem for embedding entire directory trees and using them inside of VFS layers for ages, and since Go 1.16 (2021) it has support for that as part of the toolchain. Go didn't invent the concept of making a single self-contained executable, it did however push the status quo quite far. I contend that I have the experience to make this claim. P.S.: To be clear, I'm definitely not saying you literally can't, and I am aware of Cosmpolitan libc and APE, which are pretty cool. Of course, with effort, you absolutely can make static binaries using C/C++. I just recently did this with a C++ and Rust program using musl; it's tricky, especially since many build setups don't really support these kinds of deviations, but it's possible. One major problem I have with this is that I don't really feel very confident in the stability of the resulting binaries; if something calls dlopen with static musl, it will crash, and behavior of certain things like DNS resolution also changes in ways that may break some programs. The reason why Go's contributions matter is that for basically as long as I can remember, the way to do this in Go is to install the toolchain and run `go build`, any host platform, any target platform, and it's well-supported by virtually everything because it is the default behavior. (And if anything, Zig is closer to bringing this to C than any of the C/C++ toolchains...)
- pjerem 2y agoI’m a total noob in Go but is there something that approaches completeness of the good old monolithic frameworks ? I’m in a pause in my career and I’m having a great time working on a "side" project in Django currently. Everything just works and makes sense, I just have to write business code and it gives me a nice app. I’d be happy to try Go for fun and because deploying Python/Diango is a mess (at least without docker) but my project isn’t API first, it’s deliberately a traditional server side rendered app. Every Go frameworks I stumbled upon looked like they were made to serve APIs and In the case of a 1 man team, it defeats the purpose of easy deployment since you will anyway need to code and deploy a full blown frontend (and front end fatigue is a big reason why my career is currently in pause).
- zer00eyz 2y agoGO + HTMX + standard templates... or some folks swear by templ On the API side (not what you wanted, but good looking) is sqlc + validator Between all of those you have everything you want for a website. Week 1 go is going to be a lot slower than Django or Rails. You're going to have a bit of bootstrapping to do for your project. By the end of the first month you will be a week or two behind but performance parity will be the same (you should have roughly the same feature cadence). A good framework brings a lot to the table. With go you have to "solve" for that yourself. "How do I log a request" would be one of those first questions... the answer is "the standard logger is pretty good" and "Middleware is awesome". It's a question that has a simple, short, very common answer. One that works for web apps or CLI apps or ... It takes a bit but you end up embracing the idea that less is better
- tracker1 2y agoWas going to say the same... Similarly .Net (razor views) + HTMX is pretty nice as well. There's YouTube content for both, on the .Net side, there's some JetBrains extensions to make the HTMX experience relatively seamless.
- JodieBenitez 2y ago> I’m a total noob in Go but is there something that approaches completeness of the good old monolithic frameworks ? Some of them try, but it's really hard to beat 20 years of development, real-life use cases, third party tools and docs, etc. > deploying Python/Diango is a mess (at least without docker) Install your django app in a venv, serve it with gunicorn behind apache/nginx... done. No docker required. > Every Go frameworks I stumbled upon looked like they were made to serve APIs Indeed, that's pretty much what Go was made for. And it's also the current trend. > my project isn’t API first, it’s deliberately a traditional server side rendered app Stick with Django then, because it remains an excellent choice for such apps. And these apps remain an excellent solution to a vast array of problems. > front end fatigue is a big reason why my career is currently in pause I'd argue you don't have to follow this trend to be useful. Actually, something like Django+Unpoly or HTMX probably covers 99% of the use cases with very low frontend development.
- sam0x17 2y agoPHP had the unique fun of when an attacker was able to write files to the server they could literally write new PHP files and get them to execute. I miss that worry somehow
- ivanhoe 2y agoYou can do that or something similarly bad in pretty much any language if you have write access to where the files are. That's really a server misconfiguration problem, not php problem. Huge misfortune of php is that because of the timing and huge popularity in relatively early days of web it got to be permanently associated with amateurs doing stupid shit. I was part of that early era, so trust me that php4 as bad as it was, was still fantastic compared to writing CGI scripts in C, or running mod_perl that you had to restart every time you edit some file.
- tracker1 2y agof-that... read-only containers for the win.
- cess11 2y agoRight, so CGI is quite old by now, which is basically this: a binary in a directory and a proxy that throws packets at it. It has its pros and cons. In some cases it's actually quite nice to have a platform like Wildfly or the BEAM, or you knew so little about the future load peaks that you started with cheap shared hosting and hence PHP so when you outgrow it FastCGI and nginx is a much better option than a great rewrite to Golang. Building in the languages and on the platforms you already know will always be much faster and more convenient than betting on someone else's 'bees knees'.
- thomasfromcdnjs 2y agoYeah it has to be one of the best landing pages I have ever seen. Fun and instantly understood.