Warning: preg_grep(): Compilation failed: quantifier does not follow a repeatable item at offset 134 in /var/www/tg-me/post.php on line 75
Библиотека питониста | Python, Django, Flask | Telegram Webview: pyproglib/6488 -
Telegram Group & Telegram Channel
🔥 Фишка Groovy: JavaScript-скорость в Python-средах

Каждый разработчик сталкивается с дилеммой: хочется простоты Python и производительности JavaScript на клиенте.

Groovy — транслятор Python в JavaScript, который решает эту задачу:

Пишите функции на привычном Python-синтаксисе.
Запускайте их с JavaScript-скоростью на клиенте.
Ясные сообщения об ошибках, если код не может быть транспилирован.

Транспиляция Python-функций в JS:
from groovy import transpile

def sum_range(n: int):
total = 0
for i in range(n):
total = total + i
return total

js_code = transpile(sum_range)
print(js_code)


Выходной JavaScript-код:
function sum_range(n) {
let total = 0;
for (let i of Array.from({length: n}, (_, i) => i)) {
total = (total + i);
}
return total;
}


Кто пользуется такими трансляторами? 🙌
Ссылка на проект:
https://clc.to/9d1s3w

Библиотека питониста #буст
7😁2👍1



tg-me.com/pyproglib/6488
Create:
Last Update:

🔥 Фишка Groovy: JavaScript-скорость в Python-средах

Каждый разработчик сталкивается с дилеммой: хочется простоты Python и производительности JavaScript на клиенте.

Groovy — транслятор Python в JavaScript, который решает эту задачу:

Пишите функции на привычном Python-синтаксисе.
Запускайте их с JavaScript-скоростью на клиенте.
Ясные сообщения об ошибках, если код не может быть транспилирован.

Транспиляция Python-функций в JS:

from groovy import transpile

def sum_range(n: int):
total = 0
for i in range(n):
total = total + i
return total

js_code = transpile(sum_range)
print(js_code)


Выходной JavaScript-код:
function sum_range(n) {
let total = 0;
for (let i of Array.from({length: n}, (_, i) => i)) {
total = (total + i);
}
return total;
}


Кто пользуется такими трансляторами? 🙌
Ссылка на проект:
https://clc.to/9d1s3w

Библиотека питониста #буст

BY Библиотека питониста | Python, Django, Flask




Share with your friend now:
tg-me.com/pyproglib/6488

View MORE
Open in Telegram


Библиотека питониста | Python Django Flask Telegram | DID YOU KNOW?

Date: |

Start with a fresh view of investing strategy. The combination of risks and fads this quarter looks to be topping. That means the future is ready to move in.Likely, there will not be a wholesale shift. Company actions will aim to benefit from economic growth, inflationary pressures and a return of market-determined interest rates. In turn, all of that should drive the stock market and investment returns higher.

If riding a bucking bronco is your idea of fun, you’re going to love what the stock market has in store. Consider this past week’s ride a preview.The week’s action didn’t look like much, if you didn’t know better. The Dow Jones Industrial Average rose 213.12 points or 0.6%, while the S&P 500 advanced 0.5%, and the Nasdaq Composite ended little changed.

Библиотека питониста | Python Django Flask from us


Telegram Библиотека питониста | Python, Django, Flask
FROM USA