On 11 August 2017 at 16:19, Chris Angelico <ros...@gmail.com> wrote: > On Sat, Aug 12, 2017 at 5:13 AM, Alberto Berti <albe...@metapensiero.it> > wrote: > > Chris> What do you do about all the places where the languages have > > Chris> significantly different semantics? For instance, a Python > integer can > > Chris> store more values than a Python float (which is broadly > compatible > > Chris> with a JS Number), but in JS, bitwise operations restrict the > value to > > Chris> 32-bit. > > > > As of now, I do nothing. As I said, the goal of the tool is not to > > shield you from JS, for this reason it's not meant for beginners (in > > both JS or Python). You always manipulate JS objects, but allows you to > > to be naive on all that plethora of JS idiosyncrasies (from a Python pow > > at least) that you have to think about when you frequently switch from > > python to js. > > > > Chris> Transpiling is an > > Chris> extremely dangerous thing to do a partial job of. > > > > Even breathing can be dangerous in some environments... > > Bridging two different concepts together is always a partial job... > > > > Again, the use case may seem minimal to you but I can assure that it > > helps on the day to day work with JS. > > Speaking as someone whose day job is teaching Python and JavaScript, I > don't like the idea of this kind of thing. You're bringing (some) > Python syntax, but sticking to JS semantics. That means your source > code looks like Python, but runs like JS. You can't afford to ever run > it through a Python interpreter (the semantics will be wrong). > > There's already plenty of confusion in the world. I don't want to add > more. It would be far better to base your language on JS syntax, since > it's using JS semantics; just add in a handful of Python features that > you really miss. > > Well,I hope you both had at least skimmed over "brython" - it started a couple years ago with somewhat the same "won't o full Python purpose" - but nowadays they have a very conformant implementation of Python3 that is transpiled client-side into working javascript.
(It does use some JS third party library to be able to implement Python integers, for example - but I think one can use a "pragma" like statement to use "native" numbers for performance) http://brython.info ChrisA > _______________________________________________ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ >
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/