-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Did Truffle run on bck2brwsr? #55
Comments
Dne středa 5. října 2022 13:27:33 CEST, Shafqat Ullah napsal(a):
Hi @jtulach @JaroslavTulach
While browsing the codebase, it seems there are good bit of Truffle code or
test code. Was Truffle ever run on bck2brwsr or in browser?
If yes, is it possible in theory to run or port Truffle on either bck2brwsr
or other such technologies like TeaVM?
Hi.
I tried to generate JavaScript files by Bck2Brwsr VM and then run them with
Graal.js powered by Truffle. That worked, but nowdays it has a little reason to
exist when there is Espresso.
However you are asking the opposite question: can Bck2Brwsr execute a Truffle
language? And do it quickly?
Bck2Brwsr can do none of that. However that doesn't mean it cannot work. I saw
a prototype of "Native Image JavaScript backend" (while working in OracleLabs)
that could execute SimpleLanguage in the browser.
It wasn't running at full speed, but it did run. Moreover there is no reason
why it could run even fast - it is just a lot of work. Whether or not
OracleLabs decide to donate that work remains to be seen.
Best regards and thanks in you interest in Bck2Brwsr VM!
-jt
|
Thanks a lot for your reply! I have watched most of your YouTube talks and will watch the remaining ones soon. Really appreciate the work you've been doing over the years. Yes, my main question was whether Truffle can run on top of Bck2Brwsr. The goal is to run the Truffle langs and Espresso in browser. It appears to me that in theory, if we do a source-to-source transpilation or port of Truffle to JS, it might run on V8 itself. Essentially the same Truffle API but for V8 instead of JVM, which can then run all Truffle langs and even bytecode via Espresso. In this approach you don't need to use any limited JVM in the browser. Or if needed, Bck2Brwsr itself can be used as that limited JVM. Is that a potential approach? What is a better approach? |
There is a reimplementation of DEW with OracleLabs transpiler. Take a look at https://www.graalvm.org/22.2/reference-manual/embed-languages/ and press the "Fiddle" button:
You can use Bck2Brwsr and transpile Truffle into JavaScript (including some language) and run on V8. No problem with that. It is going to run.
The transpiled JavaScript is going to run, but it is not going to be partially evaluated - e.g. it is not going to be fast. Future versions of aot.js technology might do some partial evaluation, but certainly not Bck2Brwsr - that's too much work for a single man project. |
Hi @jtulach @JaroslavTulach
While browsing the codebase, it seems there are good bit of Truffle code or test code. Was Truffle ever run on bck2brwsr or in browser?
If yes, is it possible in theory to run or port Truffle on either bck2brwsr or other such technologies like TeaVM?
Thanks!
The text was updated successfully, but these errors were encountered: