What programming languages does Electron support?


#1

Question: what languages does Electron support? For example if I had PHP scripts would they run in electron? I have looked many places and not been able to find a list of supported languages…


Can electron be run in Windows
#2

HTML, CSS (and anything that can be transpiled into CSS), JavaScript and anything that can be transpiled into JavaScript.

No, they wouldn’t.


#3

You can use any language you like with electron, if a PHP binary is in the same folder as electron, or PHP is installed system wide, this will call a PHP script, and log the result.

If you are going to go down this path, stick to only using it for the specific things that you need to do in PHP, keeping the bulk of the application Javascript, it’s not a nice solution.

var callPhp = function() { exec('php', ['test.php', 'param'], function(err, data) { if(err) { console.log(err); } console.log(data.toString()); });


#4

HTML, CSS (and anything that can be transpiled into CSS), JavaScript and anything that can be transpiled into JavaScript.

– Correct

No, they wouldn’t.

– Not with Electron out of the box, but actually referring to your above answer, PHP can transpile into Javascript. The simplest solution I’ve found for this, which is how I build my Electron applications by the way, is to use … https://github.com/asmblah/uniter/ I’m planning to write up a blog on it, but its reasonably simple. I’ll update this with a link to a repository with working PHP code. Building Uniter into your Electron project will probably take about 10 or 20 minutes, then you can add as many PHP files as you want, they will be executed in Browser, just like your Javascript would, and all of your JS objects will be available.


#5

@Metroidaron The answer I appear to have replied to @leedohm with was actually meant for you, since you’re the poster :slight_smile: . Thanks


#6

I did a thorough comparison here:
what is the best web framework to use? bootstrap? angular? angularjs? reactjs?


#7

Electron has no opinion about this. It has full Node access, so the most functional frameworks are the ones that can make use of Node, but other than that it’s all about personal opinion.


#8

You can # use php in electron, get a clone and enjoy php.