3 ms·
(v): I was think about this being the final solution of my reusable code problem. I can't even describe how bright my eyes became: modularizing all my code and
by fiatjaf 13y ago
(v):
I was think about this being the final solution of my reusable code problem. I can't even describe how bright my eyes became: modularizing all my code and saving everything at somewhere in the internet (not in any of the three computers I use alternately), reusing quickly and easily.
So I thought: why not doing this with my Python micro-code-features too? If this is possible with javascript, why not with Python? (In fact, you -- and RequireJS -- use eval, don't you?) Tell me, you who are far more experienced than me: is there any problem with trying to make a lit-inspired Python module repository?
- williamcotton 13y agoI'm not familiar enough with Python to be able to make a reliable statement on the matter. However, I would imagine that it would work fine for any language that has: 1.) The ability to eval strings as code. 2.) The ability to serialize functions or methods to strings. 3.) The ability to get and post to a web service. As far as I can tell Python has all of these features. Now, for a really far out idea... there is possibly a way to take functions or methods from one language and convert them to functions or methods in another language in a similar way to how C++ and other languages are compiled to JS, on top of LLVM and Emscripten. That way, instead of having competing module repositories for each language, code can be freely shared between not only different machines but different execution environments. I'm sure there are many caveats as I haven't explored this idea thoroughly.