convert js to python microbit ?

484 views
Skip to first unread message

Asaf Amir

unread,
May 21, 2019, 5:28:06 PM5/21/19
to Blockly
how can i convert js to python microbit ?
Thanks 

Rachel Fenichel

unread,
May 22, 2019, 5:17:21 PM5/22/19
to Blockly
Please elaborate on what you are trying to do, where the problem is, and what you have tried so far to solve it.

Best,
Rachel

Asaf Amir

unread,
May 23, 2019, 12:49:45 AM5/23/19
to blo...@googlegroups.com
hi,
here for example i can see the code on block and on js - https://makecode.microbit.org/#editor
and here i can write python - https://python.microbit.org/v/1.1
is there any place that i can convert my js to python, like here that i can convert from block to js and from js to block ? 
Thanks Asaf


‫בתאריך יום ה׳, 23 במאי 2019 ב-0:17 מאת ‪'Rachel Fenichel' via Blockly‬‏ <‪blo...@googlegroups.com‬‏>:‬
--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/7ccea44b-f0c3-4b01-8962-bb2ca2fb8286%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Asaf Amir
cell    :052-2586973
email: asaf...@gmail.com
Site  : http://www.appschool.co.il

Confidential: This email is intended only for the person or entity to
which it is addressed. The information contained in this email may be
confidential and privileged. Any retransmission, review, dissemination or
other use of, or taking of any action in reliance upon, this information
by persons or entities other than the intended recipient is prohibited.
If you received this email in error, please let us know by reply and
destroy all copies of it. Thank you.

Coda Highland

unread,
May 23, 2019, 9:10:15 AM5/23/19
to blo...@googlegroups.com
In short... no, not really. Converting between programming languages essentially requires building a compiler. This includes converting from a text-based language like JS or Python to Blockly, and if you mess around with MakeCode's stuff long enough you'll see that it really doesn't do a very good job of converting JS into idiomatic Blockly -- it WORKS, to be sure, but the blocks end up being really ugly and not very much like what a human programmer would have produced.

That said, it's not COMPLETELY out of the question. I don't know of any existing Python-to-Blockly conversion tools, but a sufficiently ambitious developer could make one.

/s/ Adam

Léo Briand

unread,
Feb 7, 2020, 6:50:34 AM2/7/20
to Blockly
Hi!

As said before, you cannot easily translate JS to Micropython, but you can translate Blockly to Micropython.

There is Edublocks doing a pretty good job at converting Blockly to micro:bit Micropython https://app.edublocks.org/#Microbit
You can also use the solution we design at Vittascience https://en.vittascience.com/microbit/

Let me know what you think about all this!

About the reverse trad Python to blockly, I saw this one: https://think.cs.vt.edu/blockpy/blockpy/load

Best,
Léo

On Thursday, May 23, 2019 at 3:10:15 PM UTC+2, Coda Highland wrote:
In short... no, not really. Converting between programming languages essentially requires building a compiler. This includes converting from a text-based language like JS or Python to Blockly, and if you mess around with MakeCode's stuff long enough you'll see that it really doesn't do a very good job of converting JS into idiomatic Blockly -- it WORKS, to be sure, but the blocks end up being really ugly and not very much like what a human programmer would have produced.

That said, it's not COMPLETELY out of the question. I don't know of any existing Python-to-Blockly conversion tools, but a sufficiently ambitious developer could make one.

/s/ Adam

On Wed, May 22, 2019 at 11:49 PM Asaf Amir <asaf...@gmail.com> wrote:
hi,
here for example i can see the code on block and on js - https://makecode.microbit.org/#editor
and here i can write python - https://python.microbit.org/v/1.1
is there any place that i can convert my js to python, like here that i can convert from block to js and from js to block ? 
Thanks Asaf


‫בתאריך יום ה׳, 23 במאי 2019 ב-0:17 מאת ‪'Rachel Fenichel' via Blockly‬‏ <‪blo...@googlegroups.com‬‏>:‬
Please elaborate on what you are trying to do, where the problem is, and what you have tried so far to solve it.

Best,
Rachel

On Tuesday, May 21, 2019 at 2:28:06 PM UTC-7, Asaf Amir wrote:
how can i convert js to python microbit ?
Thanks 

--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blo...@googlegroups.com.


--
Asaf Amir
cell    :052-2586973
email: asaf...@gmail.com
Site  : http://www.appschool.co.il

Confidential: This email is intended only for the person or entity to
which it is addressed. The information contained in this email may be
confidential and privileged. Any retransmission, review, dissemination or
other use of, or taking of any action in reliance upon, this information
by persons or entities other than the intended recipient is prohibited.
If you received this email in error, please let us know by reply and
destroy all copies of it. Thank you.

--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blo...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages