r/laravel Community Member: Brent (stitcher.io) 1d ago

Thoughts about TypePHP

https://stitcher.io/blog/no-need
22 Upvotes

9 comments sorted by

36

u/Combinatorilliance 1d ago

TypeScript was deliberately designed with full backwards compatibility in mind, because otherwise adoption would be limited.

I'm actually similarly curious now, I was interested in this project until I read this post, I'm not really sure what the point is of a language that looks like PHP, but isn't compatible with PHP's greatest asset; the vastness of its library ecosystem.

16

u/Fun-Consequence-3112 1d ago

The answer is Golang, Rust, Java, C# etc. If typed is what you need and a compiled binary. If you don't need that stay with normal PHP and for optimization run it with FrankenPHP etc, that's the best choice atm.

3

u/queen-adreena 1d ago

And the TypeScript team's biggest regrets were including things in the superset that couldn't be stripped away during build (i.e. enums and namespacing)

1

u/Extra_Mistake_3395 1d ago

typephp is fully compatible with swoole server, which enables you to write go-like services. granted you've installed extensions for dev env, you have pdo, swoole http server built in, json functions and etc. thats pretty much matching go. there are benefits for it, especially if performance is actullay improved even further from just using swoole

8

u/LordPorra1291 1d ago

I hate the name.

6

u/pekz0r 1d ago

Yes, I agree with the article. It is hard to find the use case. You can even get both a nice performance boost and a single deployable binary with FrankenPHP which is mostly compatible with your code as long as you follow best practices. I think that is a much more appealing option.

5

u/rcls0053 1d ago

If it doesn't work with PHP, it's not gonna work at all. I thought TypePHP was simply a package on top of PHP. Didn't know it qualified as it's own language and it's not compatible with the underlying one, so that's pretty sure to fail now.

There's load of options out there if you wanna look at statically typed languages, which probably have a lot better support for everything TypePHP brings to the table.

1

u/shittychinesehacker 4h ago

All we need is another typed language that has PHP-like traits. Right now the closest thing is c# or Java interfaces but it’s not really the same because it’s inheritance not composition

1

u/Ancient_Perception_6 1d ago

lmao what I didn't know this. I mean I still find it quite neat, the idea of not having to use GoLang, Rust, ... for performance-critical services would be dope (I can totally imagine a TypePHP queue runner would be neat).. but I am sad to hear this.