Better HN
topnewbestaskshowjobs
Log inSign up

azazel75

79 karma · joined Jun 18, 2013 (13y ago) · 30 submissions

Submissions

comment 2y ago · link · parent

Some years ago with a friend we built a Lasersaur ( https://lasersaur.com ) from scratch. It is equipped with a 130 w CO2 laser. Amazing open source project. Unfortunately the guy that stays it abandoned the project, but there a ton of resources there

comment 2y ago · link · parent

The license kinda sucks though: ``` 3. USE RESTRICTIONS

Licensee is expressly forbidden from:

(a) Incorporating, modifying, or using the Software as part of any other product or service; ```

comment 7y ago · link · parent

"Before Ethernet was common, BNC coaxial cables were used on some NICs as well"

Yes, at that time Ethernet was coaxial as well, the 10Base2

comment 7y ago · link · parent

So we live in a society that isn't able to find the resources to teach someone how to read and get free... Instead that people can buy an Android phone and become a slave of the technology... what a shame

5.

New version (0.9) of JavaScripthon Python3-to-ES6 compiler is available(gitlab.com ↗)

1 points · by azazel75 · 8y ago · discuss

comment 9y ago · link · parent

That's like a Google tax, with the plus that you consciously agree to let it track you more than ever... wtf!

comment 10y ago · link · parent

I could assure you that even transcrypt cannot transpile Django.

It does multiple inheritance with a polyfill and overally is much more "fatter" than JavaScripthon.

But with JavaScripthon you can use any tool available in JS land to accomplish the same goal. Want to use Backbone's extend()? Use it.. want to use react's createClass() mixin?, the same

comment 10y ago · link · parent

It's in development, as many others software projects are, and is far from complete. The goal is to translate as much of core semantics as possible, but i doubt that all the core semantics will be translated. One for all is multi inheritance which is currently unsupported by current Javascript syntax. Even more, when you use an object such a list, it's really a JS Array that will be manipulated in the end, so you will have to use array.push() to add instead of python's list.append()

But Translating something like Django is out of scope for all the transpilers, it would mean also converting sql drivers and so on? Does this really make any sense? Maybe you have a look at emscripten https://github.com/kripken/emscripten/wiki

comment 10y ago · link · parent

It cannot be used to convert python frameworks to javascript, nor Django nor any other

comment 10y ago · link · parent

Good :-)

Do you have any link for this chrome detail about optimization?

str(x) conversion is missing... i'll will implement it asap

comment 10y ago · link · parent

The main reason is... context switching, also i'm a big fan of python's standard library, but I have yet to do any complete work just with it.

comment 10y ago · link · parent

1) it renders import and from...import statements to equivalent ES6 imports. If you use something like Webpack down the pipeline you can already mix ES6 imports and CommonJS requires. Also, BabelJS by default transpiles ES6 imports to CommonJS requires.

2) What do you mean exactly?

3) There's no direct from-python loader, but the compilation can be splitted in two steps with the BabelJS Webpack loader used for the latter

comment 10y ago · link · parent

I'm a big fan of RapydScript, unfortunately it requires nodejs and I would prefer not have to.. but hey, there is a space for everybody ;-)

comment 10y ago · link · parent

It's implementable really and it is half-implemented, have a look at the call conventions... additional keyword arguments can be specified without any problem

The problem is that there's no kwargs equivalent in js land.. and probably i don't want to wrap any call to make it possible.

comment 10y ago · link · parent

Yes, I drink it everyday

comment 10y ago · link · parent

Your post seems quite imprecise about Python's semantics...

comment 10y ago · link · parent

ops, sorry for that. Issues are enabled now ;-)

comment 10y ago · link · parent

For-of only works for iterable sources, it would not be a complete replacement of for...in, also it seems a bit slower that for...in as of now.. see https://kpdecker.github.io/six-speed/

comment 10y ago · link · parent

If jQuery is installed globally, without package management, just use:

from __globals__ import jQuery

....

jQuery('#an_id')...

comment 10y ago · link · parent

Javascripthon supports converting either a python source file or a python function object directly, but actually using the embedded js interpreter to do the transpilation takes some time due to BabelJS code bootstrap time.

Having a "HOT" interpreter with an execution context that is persistent and can be used to convert code to ES5 on the fly has been already implemented by duckpy creator and i plan to intergate it very soon.

See https://github.com/amol-/dukpy/issues/4

comment 10y ago · link · parent

Python lists are supported:

* as literals;

* in for loops;

Keyword arguments accumulator has no corresponding feature in the ES6 world, as far as I know....

comment 10y ago · link · parent

Have a look at the example! ;-)

comment 10y ago · link · parent

The former, it translates Python 3.5 syntax and some of the core semantics to ES6+ JavaScript and then BabelJS is used to transpile that ES6 JS to ES5. All this retaining a sourcemap that maps back to the original Python sources.

It does all without the need for nodejs (even if it can be used of course), it uses an embedded js interpreter.

24.

A Python-to-JavaScript Transpiler with BabelJS and SourceMaps(github.com ↗)

114 points · by azazel75 · 10y ago · 62 comments

comment 11y ago · link · parent

> the ecosystem is still running 2.7. I cant wait to switch to Py3.

Which one? Pyramid and SQLAlchemy work like a charm in Py3. Until you really name what your need is, that's just fud.

comment 11y ago · link · parent

We use ayncio and async/await coroutines of Python 3.5 on each of our packages.

I hope that PyPy will have a Py3.5 compatible interpreter someday, but CPython is good enough for now.