Sublime Forum

Use JavaScript instead of Python for plugins

#1

Python 2 or Python 3? Who cares. JavaScript is the right language.
It would boosts SublimeText plugins development.

0 Likes

#2

F*ck no.

0 Likes

#3

Don’t feed the trolls.

0 Likes

#4

@steida

Start porting PyV8 to Python 3.3 :smile:

0 Likes

#5

[quote=“castles_made_of_sand”]@steida

Start porting PyV8 to Python 3.3 :smile:[/quote]

I would say this would be the best option - I am looking to port my Sublime-Nodejs package over, and I would mostly like to script things with JavaScript - but there is no need to embed anything like NodeJS in Sublime Text when there is PyV8.

However I would love to see the API fully exposed to PyV8 so you have the full option to script in either Python or JS

0 Likes

#6

Lol. Javascript isn’t really that bad. It can actually be kind of fun. I find the browsers inconsistencies the worse part when working with JS. Take out the browsers, it is actually kind of fun…though I wish regex was better in JS.

With that said, it isn’t my scripting language of choice, but I like playing with it on occasions.

0 Likes

#7

Serge needs PyV8 to port Emmet to ST3: github.com/sergeche/emmet-sublime

I tried building it once a month or so back but it was beyond my skill/motivation level

You need C++ / boost::python / Python C API knowledge (porting changes from 2.x to 3.x)

boost::python supports python 3.3, but PyV8 also uses some raw C extension code

0 Likes

#8

Tried again before and this time managed to build PyV8 on Python3.3, though not all the tests are passing, so there’s work to be done

As well as Emmet, I had a javascript linter plugin using it, so I’m pretty interesting in getting it running.

0 Likes

#9

I think supporting JS for plugin dev would be awesome and there’d be huge community support.

Speaking very theoretically and with only the faintest familiarity with the plugin architecture of ST, I would guess it would be possible to write a plugin that bridged the ST plugin python API to JS effectively creating a plugin that allowed for JS plugin dev. It might not even be that much of a hack. :smile:
All take my answer off the air :smile:

0 Likes

#10

Pretty much. The PyV8 author himself is working on the Python 3.3 support now, so it’s just a matter of time.

0 Likes

#11

I also prefer to use JavaScript instead of Python, but the problem with JavaScript is it has no library besides few basic string/math/date functions. What would be even nicer IMO is if ST had C++ plugin/API support. This way anyone could create support for any language, it could ship with Python but users could add more using the example of the Python plugin which would be open sourced by the ST authors :smile:

0 Likes

#12

Just a headsup that Serge has some binaries here for PyV8: github.com/emmetio/pyv8-binaries

There’s binaries that work on ST3/Python3 etc

0 Likes