36
sam9669
4y

I'm not a php dev but can this be done ?

Comments
  • 2
    Yes, but you can use any language, including C, as preprocessor for any language. Because all languages has a basic output, so they can generate the other language, which is just simple text.

    If it is useful and your preprocessor will be handy, I don't think so. Probably a text template engine is the better way to go.
  • 2
    Would be useful if you are generating client libraries from wsdls or something like that.
  • 1
    Zephir lang may be in your interest.
  • 0
    But whyy
  • 0
    Mora like a template engine than an preprocessor. In some situations this feature is very useful and one I like the most
  • 2
    My God.. 😰 I'll be sick! The benefits of using C is it's speed! The exact contrary of PHP! so just why!??!
  • 4
    @omomthings you wouldn't use PHP in place for a compiled C program. The idea here is to use PHP to generate the text files containing C syntax, instead of manually typing the C code yourself. After this "preprocessing" you would compile the code into a fast binary executable.

    One usecase could be to do a big unrolled loop with a PHP script instead of typing the same statement a gazillion times yourself.
  • 1
    Did anyone try accessing GTK libraries?
  • 1
    @siljamicke ohhh sorry my bad, I didn't pay attention at first! Yeah you're right..
Add Comment