Show HN: Transcrypt – Fast, small Python 3.5 to JavaScript transpiler
transcrypt.org
transcrypt.org
As a side note: I found your extra whitespace before function arguments to be very strange. I haven't seen this type of spacing before. Is there a reason why you do this?
I personally use and encourage the use of the "pep8" python tool (link below) to validate my codestyle as I find it makes working with other developers easier (this extra whitespace is pointed out as an error).
pep8 tool: https://pypi.python.org/pypi/pep8
E.g.: https://github.com/JdeH/Transcrypt/blob/master/Transcrypt/mo...
There are spaces before subscript operators, before `.method()` calls, and between `def name` and `(param1, param2)`.
In regards to: > if you use JS libs they won't follow PEP 8 either. > And that's probably something to accept, as, however > big the Python world, one cannot ignore the JS world.
I totally agree. I spend about half of my time writing JS and half in Python and I definitely don't try to enforce PEP8 guidelines onto JS code, simply because it's a Python style guide, not a JS guide. I would try to follow a largely accepted code style of the JS community if I was made aware of one, but there only seems to be a large collection of non-official guides, so just I try to adjust my code style to what seems to be common among all of the "nice"/readable code around the web, or, if I'm working in a large existing code base, the style that is followed in that codebase, unless there's reason good not to.
I guess my general approach is that I prefer to style the code I write based upon the language (sometimes, for example, this requires placing open braces in different positions), and I find this actually helps my mind to switch between languages as they have their own look-and-feel to them.
Thanks for reading, and thanks for writing a very interesting library!
Stop reinventing the wheel everytime something you want is missing from a lib. Try to contribute to said lib first.
Otherwise, this adds noise, wastes ressources and splits point of focus in the FOSS community.
I understand the appeal of writting your own baby, I understand the ego part too.
But remember this is a projet you then have to maintain and document. People will ask about their problems with it on stackoverflow, they will type "X vs Y vs Z" on Google.
Creting a new project has consequences.
Having a lightweight syntax around the semantics of managed platforms will be a win here for any syntax language targeting JS, LuaJIT, BEAM, JVM, CLR, LLVM.
I also like how you've kept the output as close to the original Python code as possible. The generated scaffolding code looks neat and easy to read too.
In Transcrypt's case, the commitment probably isn't that big, since the JS source is pretty readable (and so I can just migrate to that relatively easily if I want to), but it's still a bit of a hack.
That said, it looks like a great project, and I'll definitely give it a try and hopefully use it more widely.
I try to stay away from JS to the extent I am able due to the complexity.
- A bad debugging experience (no segfaults on null, local variables are numbers instead of strings or objects, function pointer calls are super confusing)
- Much more difficult to interoperate with external JavaScript libraries
- Massive code bloat (you have to reinvent everything like arrays, strings, maps, regexes, memory management, etc. instead of just using the browser's built-in implementations)
At the moment, the site is too easy to navigate, the text too easy to read. Maybe use more images, big images, a 2mb+ background gif would be good. Oh, I forgot external scripts, throw some of those in, my laptop fan isn't whirring so it is underused.
yes, what a terrible website, please "improve" it
:-\