Giter VIP home page Giter VIP logo

Comments (5)

ncw avatar ncw commented on June 12, 2024

My plan is to implement a "go" modules with some low level support for go facilities

  • go routines
  • channels
  • mutex
  • select (maybe)

This could then be used to make some higher level constructs eg the threading library.

My plan is to make a new interpreter for each goroutine so they can run together without locking. I'm not sure that is exactly the level at which the PEP you linked works but it might be!

Each goroutine would be able to access its own things without locking but accessing shared things would need locking.

I have a plan for how to implement the "go" module somewhere... It involves making some new "special functions" in the interpreter

gpython/vm/eval.go

Lines 1582 to 1591 in fff175c

// As py.Call but takes an intepreter Frame object
//
// Used to implement some interpreter magic like locals(), globals() etc
func callInternal(fn py.Object, args py.Tuple, kwargs py.StringDict, f *py.Frame) (py.Object, error) {
if method, ok := fn.(*py.Method); ok {
switch x := method.Internal(); x {
case py.InternalMethodNone:
case py.InternalMethodGlobals:
return f.Globals, nil
case py.InternalMethodLocals:

from gpython.

corona10 avatar corona10 commented on June 12, 2024

@ncw If we implement this feature based on goroutine, I think this feature can be unique to gpython. I like this issue.

from gpython.

PythonLinks avatar PythonLinks commented on June 12, 2024

from gpython.

drew-512 avatar drew-512 commented on June 12, 2024

suggest close issue -- addressed w/ #158

from gpython.

sbinet avatar sbinet commented on June 12, 2024

fixed w/ #158.

from gpython.

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.