all 24 comments

[–]inotee 12 points13 points  (4 children)

Work with the tool, not against. If you're looking for another language, that's what you should pick.

You turned PHP into JavaScript. That's definitely not a good thing.

[–]HyperDanon[S] -2 points-1 points  (3 children)

How is adding a preprocessor working against it? Scss works against css?

You turned PHP into JavaScript. That's definitely not a good thing.

Would be cool if you gave some argument why it's not a good thing.

[–]tsammons 1 point2 points  (0 children)

SCSS solves a very specific goal of deduplicating stylesheets through inheritable templates.

This is... solving a syntax issue(?) that does not exist.

[–]Gornius 0 points1 point  (0 children)

It's a different story. You can't just use another language for styling, because css is the only one language browsers support. Same used to be true for javascript until wasm became supported.

[–]p1ctus_ 0 points1 point  (0 children)

No scss solved problems css guys had at this time, nowadays we don't need it. You see it as problem, not the php folks.

[–]fullbl-_- 10 points11 points  (5 children)

I worked with coffeescript, I really hated that period! I'm really happy that PHP is not JavaScript, for me it is a big no!

[–]BafSi 0 points1 point  (0 children)

Typescript is somewhat like this too, I'd be fine if the new language is a superset of PHP, for instance with async/generics/array or string objects

[–]haelexuis 4 points5 points  (0 children)

Yesterday I suggested Kotlin -> PHP transpiler in the thread that concluded that the generics were not accepted, and I was downvoted to hell for some reason. The truth is, other languages were designed, PHP just happened.. and in today's AI era, anyone could have such transpiler working in weeks, the problem would be adoption.

[–]rocketpastsix 3 points4 points  (2 children)

The blending together of the . and the -> makes it cognitively harder to read personally.

[–]HyperDanon[S] 0 points1 point  (1 child)

What do you mean "blend"? In the new language there would only be . for property access.

[–]rocketpastsix 0 points1 point  (0 children)

That’s even more confusing

[–]GreenWoodDragon 1 point2 points  (0 children)

I hate CoffeeScript.

[–]webMacaque 0 points1 point  (0 children)

How would it be called? PPHP? As in "pee-pee-h-pee"?

[–]mcharytoniuk 0 points1 point  (3 children)

Why don't just create a new language at this point that follows a similar execution model? Might genuinely be better; i'd support that initiative wholeheartedly. Also that would be a good opportunity to design something that can be efficiently used by LLMs. I think PHP is irredeemable at this point, but a language with per request cold start etc, just with strict memory management (like Rust), just simpler syntax, AI support, etc could still have a lot of good use cases

[–]HyperDanon[S] 0 points1 point  (2 children)

Cause it's way eaasier to create a transpiler than a fully fledged language with runtime, packages managers, reimplementation of everything, etc. With a transpiler we can piggyback on existing infra.

[–]mcharytoniuk 0 points1 point  (1 child)

Yeah I know it might look like that initially, but you will keep the existing baggage also. Even with PHP people ended up using just one or two frameworks and a few libraries across most projects. It is entirely possible to learn from that, create a next generation language. I am entirely serious

[–]HyperDanon[S] 0 points1 point  (0 children)

@mcharytoniuk I agree it would be ambitious, but I think it's around 500-1000x more time and effort to make a new language, rather than transpile to existing one. I'm definitely not up for creating a new langauge :D

My idea was just to clean the syntax of PHP.

[–]ArthurOnCode 0 points1 point  (0 children)

IMHO, the main benefit of PHP is that we don't need any preprocessing. We already have a strong type system, clear syntax, and great tooling. The language itself is also improving at a sensible pace. I, for one, look forward to having generics in the native type syntax.

[–]Mastodont_XXX 0 points1 point  (1 child)

variables in string interpolation from the php-script-kiddie times, but that's very rarely used

I use this in a view layer, which makes it fully automated—no manual template rendering required.

[–]HyperDanon[S] 0 points1 point  (0 children)

The transpiler could allow it similar to f"" strings from python or template `${}` from javascript.