3 ms·
There's a [dead] comment that asks "Why?"... Obviously not every project needs a "why?", and this is a technically cool endeavour that stands on its own.. A f
by sbarre 9y ago
There's a [dead] comment that asks "Why?"...
Obviously not every project needs a "why?", and this is a technically cool endeavour that stands on its own..
A few ideas I can think of for "Why?":
* Static analysis of a codebase looking for bad practices or errors
* Feeding the structured output into code-gen for another language, to start a porting project
* //STEP MISSING//, Profit?
Anything else?
- vidarh 9y agoAs much as my first reaction was also "why?" writing a complex parser is a good exercise, and of course having a suitable parser is a pre-requisite for all kinds of tooling, be it analysis tools, or writing an alternative implementation of the language itself.
- Xylakant 9y agoAaron Patterson, the author of phuby (https://github.com/tenderlove/phuby https://github.com/tenderlove/phuby) once explained in a talk what's good about embedding a php interpreter in ruby. The gist, as I remember was: Technically speaking, it makes no sense. It will never become anything useful. But you can make it work, and you might learn something useful along the way. IIRC, he found a couple of very interesting (and useful) issues along the way. So the answer might just be "because I can and I want to". This is the talk, IIRC: "Yak shaving is best shaving" https://www.youtube.com/watch?v=nY_Pl2x7Fgs https://www.youtube.com/watch?v=nY_Pl2x7Fgs
- chamton 9y agoEmbedding an interpreter in another language can certainly be useful, but this is just a parser.
- Xylakant 9y agoSorry, but phuby is not useful, was never intended to be and even says so. It's a hilarious prank, if you ask me.
- tyingq 9y agoAn interpreter in a compiled language, though, has obvious run time benefits. Though this is just a parser.
- randomdata 9y agoA parser is a big step towards building that interpreter, however. Who knows what the long-term goals are or what remains closed source software.
- donatj 9y agoWe have a giant PHP codebase but are moving components to Go. I wonder if this has any potential to aid in machine translation.
- ivanhoe 9y agoor, why not, a first step to adding php-like macro language to your go service...
- alexandercrohde 9y agoI guess my question isn't so much "Why would anybody build this?" but "Why would you upvote this to the front-page?" Seems like part of a larger "I built X in Y" HN pattern.
- Shish2k 9y agoI have noticed that "I built X <in current popular language>" typically gets way more upvotes than "I built X"...
- deftnerd 9y agoPHP is often used because it's mature, reasonable secure these days, and has world-class encryption libraries. Lots of companies develop web applications in it.... But if you're developing a web application that you host and also want to offer a private version of for enterprise use, this is somewhat appealing because it's the first step of being able to package the PHP app within a Go binary that runs on a lot of platforms and not have to release your source code. Sure you could write it in Go from the start, but if you already have a bunch written or want to use less expensive developers, this might work out one day.