News for hackers. Stuff that matters.
Re:Polycompiler: Merge Python and JavaScript code into one f... by GeekFortyTwo on Wednesday May 07, 2025 @10:56AM (#43916576)
Ok, now write your code in a metalanguage(i believe fut might work), and now we can write once and run on two different engines.
Re:Polycompiler: Merge Python and JavaScript code into one f... by bitwize on Wednesday May 07, 2025 @11:55AM (#43917334)
Maybe we can convince Marc Feeley to write a backend for Gambit that targets this.
Re:Polycompiler: Merge Python and JavaScript code into one f... by belmarca on Wednesday May 07, 2025 @01:53PM (#43918707)
Hey, I'm writing this from Pr Feeley's lab :)

I understand your comment was tongue-in-cheek, but we certainly have an interest in cross-language interoperability! You can check out our work here:

- https://try.gambitscheme.org is Gambit compiled to JavaScript with the universal backend. Evaluate \alert("hello!") at the REPL to see the JS<->Scheme Syntactic FFI in action.

- https://codeboot.org is our own Python interpreter running in the browser. It has a Python<->JS FFI. Evaluate \alert("hello!") at the REPL to test it out. You can even import JS libraries using the standard Python syntax by replacing the identifier with a string: import "https://mycdn.com/mylibrary.js".

- https://github.com/gambit/python is a Gambit module that integrates Gambit with CPython, using the same syntactic FFI. You can import PyPI modules from Gambit.

References to conferences/papers describing these features can be found on my GH profile (https://github.com/belmarca). AMA if you wish!

Re:Polycompiler: Merge Python and JavaScript code into one f... by bitwize on Wednesday May 07, 2025 @03:07PM (#43919496)
It was more "ha ha only serious" than purely tongue-in-cheek. I'm familiar with Gambit's multi-backend targeting and have experimented with its JS backend. I consider it one of the quickest, and most comprehensive, ways to get "Scheme in the browser".
Re:Polycompiler: Merge Python and JavaScript code into one f... by belmarca on Thursday May 08, 2025 @09:25AM (#43925912)
BTW I'd love to hear your feedback if you have tried the above examples!