Live data from Hacker News

How to write X in both Python 3 and JavaScript

sayazamurai.github.io

31–40 of 84 posts

Re: How to write X in both Python 3 and JavaScript

#33

How to write using X in both languages: Python: https://github.com/python-xlib/python-xlib Node.js: https://github.com/sidorares/node-x11

A couple more native X11 client implementations:

Common Lisp: https://github.com/sharplispers/clx

Go: https://github.com/BurntSushi/xgb

Any others?

(Looking for implementations of the X11 protocol in $LANGUAGE, not bindings to the C Xlib)

Re: How to write X in both Python 3 and JavaScript

#34

Creator here! Let me know if you have any suggestions.

Thanks for the site! Do you have thoughts on removing all the print/console.logs calls on every line? It feels like there's a lot of visual noise there, that can still be met with the comments showing state/output.

Re: How to write X in both Python 3 and JavaScript

#39

A weird reference imo. Perhaps useful to build as a learning experience but I wouldn't expect who needs if/else included in a cheat sheet to be ready to learn to languages.

The value is in finding what is the most idiomatic way to do something in either language. For example if you're coming from Python and you're used to sum() it is useful to check this reference for the most idiomatic way to do it in JavaScript before doing it by hand with anonymous functions and reduce or looping through the list (as is the case unfortunately).

Agreed. The value isn’t in it being a tutorial, it’s in it being a quick overview of a language’s idioms as they apply to common tasks.

Re: How to write X in both Python 3 and JavaScript

#40
post #13

As someone who is often switching languages, I find these sorts of cheatsheets useful. I know all the syntax in them but I'll be damned if I can ever remember which language uses which until I've settled back in to things.

Me too. On any given day, I can be using any of a half dozen languages (C#, powershell, javascript, bash, perl, python, c++, java - our codebase is all over the place). It gets hard to keep the syntax straight on all of them.
Post reply on HN