Giter Site home page Giter Site logo

Comments (17)

amasad avatar amasad commented on September 24, 2024

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.

max99x avatar max99x commented on September 24, 2024

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.

amasad avatar amasad commented on September 24, 2024

Understood. But they're going to probably come back and tell you input doesn't work etc.

from empythoned.

max99x avatar max99x commented on September 24, 2024

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.

amasad avatar amasad commented on September 24, 2024

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.

max99x avatar max99x commented on September 24, 2024

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.

amasad avatar amasad commented on September 24, 2024

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.

max99x avatar max99x commented on September 24, 2024

A simple acceptable solution would be to add a waitForEvent() function to workers.

from empythoned.

amasad avatar amasad commented on September 24, 2024

Agreed. But in concept it would be some kind of fiber or coroutine.

from empythoned.

max99x avatar max99x commented on September 24, 2024

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.

amasad avatar amasad commented on September 24, 2024

Yes that is true.

from empythoned.

germanjoey avatar germanjoey commented on September 24, 2024

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.

germanjoey avatar germanjoey commented on September 24, 2024

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.

germanjoey avatar germanjoey commented on September 24, 2024

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.

max99x avatar max99x commented on September 24, 2024

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.

max99x avatar max99x commented on September 24, 2024

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.

amasad avatar amasad commented on September 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.