So, the main use case of this is for writing Electron apps, the biggest benefit of Electron is having cross-platform apps, using swift code in your Electron app that's only work on macOS gonna defeat of propose of an Electron app.
NodeSwift: Bridge Node.js and Swift
11–20 of 26 posts
Re: NodeSwift: Bridge Node.js and Swift
#12So, the main use case of this is for writing Electron apps, the biggest benefit of Electron is having cross-platform apps, using swift code in your Electron app that's only work on macOS gonna defeat of propose of an Electron app.
Re: NodeSwift: Bridge Node.js and Swift
#13So, the main use case of this is for writing Electron apps, the biggest benefit of Electron is having cross-platform apps, using swift code in your Electron app that's only work on macOS gonna defeat of propose of an Electron app.
Swift code can run on Windows and Linux too
Re: NodeSwift: Bridge Node.js and Swift
#14So, the main use case of this is for writing Electron apps, the biggest benefit of Electron is having cross-platform apps, using swift code in your Electron app that's only work on macOS gonna defeat of propose of an Electron app.
> Cross-platform: NodeSwift works not only on macOS, but also on Linux, Windows, and even iOS!
Now I'm curious about the iOS bit. Is that intended for React Native?
Re: NodeSwift: Bridge Node.js and Swift
#15Re: NodeSwift: Bridge Node.js and Swift
#16Oh my, yes! We have some legacy microservices written in Swift/Vapor (while our main stack is NestJS) and instead of rewriting them to TypeScript, we can use this. Cool!
Re: NodeSwift: Bridge Node.js and Swift
#17Earlier quoted context omitted.
Swift code can run on Windows and Linux too
Sorry, I didn't know that, I thought swift is only for Apple platforms.
Re: NodeSwift: Bridge Node.js and Swift
#18Re: NodeSwift: Bridge Node.js and Swift
#19Wait, so you compile a swift executable that’s callable from js? How would one distribute this client side in browser? I’m not smart enough to understand this. I love swift, vapor and node individually, I don’t get it together
NodeJS has had FFI for over a decade that allows you to call functions in .dylib/.a/.dll on Mac/Linux/Windows. I've used it extensively to link with libraries provided by USB device manufacturers to avoid direct USB interfacing.
See:
https://www.npmjs.com/package/ffi
This let's you call Node from inside Swift.