Replies: 12 comments 1 reply
-
It's a compiled language so it should be possible to use it for front end frameworks like yew (written in rust). Since theoretically in the future you would be able to compile it to webassembly |
Beta Was this translation helpful? Give feedback.
-
I don't know, but just as Mojo language is meant to be a superset of Python, and Python is in a sense a scripting language, I would think it should be possible for Modular to isolate a subset of Mojo which could be supported by browsers in the same way as Javascript is, either embedded in HTML or called from HTML, which I would suggest calling Browser Mojo, although of course the decision would not be mine. As for running all of it in a browser, I would think that should require some permissions beyond what the browser itself would be likely to have and therefore likely beyond what the browser itself could grant. Definitely worthy of some discussion though and it seems that's what this space exists for... so I would encourage anyone else reading what's in this thread so far to add some of their own thoughts to it. |
Beta Was this translation helpful? Give feedback.
-
I see many advantages if Mojo can be compiled into
Python ecosystem has some tools like that: PyScript but Python was announced mostly as a server-side language, so it's very hard to change that mindset. Opposed Clojure/ClojureScript by Rich Hickey has this philosophy and the community supports it, so you can find many projects built around this combination of stacks together. We should not lose web and JavaScript developers, their community is no less than Python. |
Beta Was this translation helpful? Give feedback.
-
#78 asking for similar support. |
Beta Was this translation helpful? Give feedback.
-
Maybe we should have a canonical version of this and leave it open, WDYT @goldiegadde ? |
Beta Was this translation helpful? Give feedback.
-
PyScript is working very well in the browser. Especially with Vue3 as the UI component. Python projects tend to do more computational work than javascript on the client side. |
Beta Was this translation helpful? Give feedback.
-
As Mojo will be compiled to native hardware instructions, and there are security issues with browser environments, most likely the best target is wasm some time in future. |
Beta Was this translation helpful? Give feedback.
-
WASM is getting Garbage Collection. Actually, two separate sets of memory:
Considering the fact that Mojo does Python (which is memory managed) and manual memory management, WASM seems like a perfect compile target. |
Beta Was this translation helpful? Give feedback.
-
I'm no expert on MLIR but I assume someone could write Mojo MLIR primitives mapping to wasm at some point. |
Beta Was this translation helpful? Give feedback.
-
There is also another solution like source-to-source S2S compilers/transcompilers/translators: Topics: Some examples:
|
Beta Was this translation helpful? Give feedback.
-
Yeah, the Mojo stack is perfectly set up to do this. It doesn't use garbage collection, supports very small installed binaries, etc. It'll be great, we just need to make a big more progress :) |
Beta Was this translation helpful? Give feedback.
-
Yeah, the Mojo stack is perfectly set up to do this. It doesn't use garbage collection, supports very small installed binaries, etc. It'll be great, we just need to make a big more progress :) |
Beta Was this translation helpful? Give feedback.
-
Will mojo also work with web libraries like Jango, Flask or FastAPI? Will the 500x speed also be applicable when it runs in the browser? It would be awesome to just recomiple existing flask code and have it run 500x faster.
Beta Was this translation helpful? Give feedback.
All reactions