Show HN: Pip Imports in Deno
github.com
github.com
I wonder if there's another programming language featuring a reptile. What's this "Lizard" language Duckduckgo's telling me about?
Its users are even called Ziguanas.
https://en.m.wikipedia.org/wiki/Cobra_(programming_language)
And pushing it a bit as "a language":
Anaconda
Reminds me of PythonMonkey, which provides really high level bindings to SpiderMonkey in Python. It ships as both a pip package and a standalone js runtime, the latter of which is very similar to this project!
https://github.com/Distributive-Network/PythonMonkey#pythonm...
https://github.com/metacall/core
List of supported languages here https://github.com/metacall/core/blob/develop/docs/README.md...
In the future, maybe webidl (or extensions of it) will bring interoperability between languages too. At the moment there is https://mozilla.github.io/uniffi-rs/ for interoperability between Rust and a number of languages (basically the ones mozilla needs: Swift, Kotlin, Javascript)
(Joke, but would be a cool prototype)
[0] https://docs.python.org/3/library/inspect.html
[1] https://platform.openai.com/docs/guides/gpt/function-calling
I have had success running sbert, faster-whisper and various other GPU accelerated packages.
Here, FFI is used to interface with the Python Interpreter C API. Argument for FFI against just executing shell commands is performance, efficiency, and that you can make calls from same process instead of spawning a subprocess. When doing [de]serialization over shell interface, a lot of things will be hit and miss. But for deno_python, type conversions are widely supported. You can even pass around objects by reference with zero copy, which would otherwise require copy over a shell interface.
But if you want to call some python functions with your TS input then you would need to serialize the TS input, pass it as an arg to the script, there deserialize it and then call the python function with the input. And if you wanted to call multiple python functions then your first arg to the python script would need to be the name of the function, only then the serialized data. Plus you would need to implement a switch case on the python side to execute the right function.
^i know this is probably arrogance out of naivete, just teasing out what exactly i dont know that i dont know about what FFI does.
Finally even if everything works, a command execution and parsing results is massively slower than a function call. So yeah, there's lots of restrictions on what you can practically do that way.
https://github.com/hmenyus/node-calls-python
Excited to compare to Deno. Thanks guys!
The you have two choices you rewrite your api into python or you call python from your js.