Comments (17)
Because of some browser changes the interpreter needs to be loaded in a Web Worker. Which is done in repl.it and jsrepl.
The interpreter is pretty stable thats why it hasn't been updated and the example is simply outdated.
I also strongly suggest using https://github.com/replit/jsrepl where all that is taken care of.
@max99x could you update the example? or remove it and point to jsrepl?
from empythoned.
I don't want to point people to jsrepl, since it's a much more complex system. I'll try to update the example to use a worker, without making it too complex.
from empythoned.
Understood. But they're going to probably come back and tell you input doesn't work etc.
from empythoned.
Have I mentioned I hate browsers? Digging into the reason for the change that caused all this upheaval I discovered that it was just an attempt to "discourage" people from using sync XHRs, and the reason they applied it only to custom types is because it wouldn't break old apps that don't use custom XHR types that way. /facepalm
from empythoned.
Is it in standard? or just an agreement between browser vendors to bully people to do what they think is right?
but in all honesty they've pushed me to put in the effort to solve the input issue in workers and load all languages in web workers which is just awesome.
from empythoned.
Looks like they added it to a standard (diff of the change). And while I admire your input hacks, they are still ridiculously convoluted ways of doing something that in a sane world would be possible using a much simpler approach.
from empythoned.
I think the problem is a natural problem to have. Trying to block in a single-threaded environment while expecting some other operation to take place (UI) sounds insane. The only possible solution that doesn't break the web browser paradigm is something you also once mentioned. Which is access to the event stack (or call stack could work). which i think while great would bring its own world of problems and security issues.
from empythoned.
A simple acceptable solution would be to add a waitForEvent() function to workers.
from empythoned.
Agreed. But in concept it would be some kind of fiber or coroutine.
from empythoned.
It would be a thread. Exactly what it currently is. No need to complicate things with coroutines, when the two contexts are separate (since each thread has an independent call stack and top level scope).
from empythoned.
Yes that is true.
from empythoned.
Thanks, I'll try out jsrepl then. Does it need to be built from source, or can I use the testbench right away?
from empythoned.
Oh, unless of course you're going to update the empythoned example - Python's the only language I need here. Again, thanks for all the help!
from empythoned.
Hey, just wanted to ping again to see if you had a chance to redo that example. I tried jsrepl out, is very cool, but seems to require nodejs because of the coffeescript. That would be a lot of trouble for me to include in my eventual distro, so I'd still much prefer to go with the seemingly-standalone empythoned here. Anyways, thanks again for the help!
from empythoned.
Disabled array buffer requests in the prebuilt script. Quick hack that may break binary file access, but should allow you to use it for basic tasks.
from empythoned.
It worked fine without the extra step, but if you went and did it anyway, might as well revert my change. I'm surprised the worker was so little code though. That's nice. But what's the deal with ;(function () {
?
from empythoned.
I did revert the changes. Its just a habit. Sometimes when starting with (function
and concatenating with another file or moving the code somewhere missing a semicolon at the end it will error out. It looks stupid but it happened to me more than once so its a thing now. hah
from empythoned.
Related Issues (20)
- Create gh-pages HOT 2
- Using the Python xlrd library
- How to use this project with other libraries ? HOT 8
- Unable to use `urllib`
- Incorrect results from hashlib functions
- Can't build empythoned HOT 5
- math.log10 fails: Internal error: ReferenceError: _llvm_log10_f64 is not defined
- incorrect result for division of number larger than 32 bits HOT 1
- How to do read and save file to the server?
- Incorrect results for three-argument pow HOT 1
- Is there any way to complete HTTP requests inside python script HOT 2
- import antigravity fails!
- how do i ionstall?
- Hangs iOS Safari.
- Closure Compiler Advanced Opts HOT 3
- DOM access HOT 22
- repl.it broken on dev FF/Chrome due to sync XHR change on Windows HOT 8
- time.sleep doesn't work HOT 2
- /dev/null doesn't exist
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from empythoned.