I have no idea either. I've just recently become interested in
building new languages.
I've been thinking about the enforcement of only accessing vars
defined within the current thread, and I think I have a pretty simple
solution. If every Scope associated itself with the thread (either JVM
thread or some other lightweight thread concept) that creates it, then
the look up procedure could enforce that mutable variables can only be
seen by the thread that created them. This would effectively make the
mutable state invisible to any other thread. We would also need to do
something similar to prevent access to the var fields in Obj.
Dave
On Jun 16, 11:56 pm, Bob Nystrom <
munificent...@gmail.com> wrote:
> On Wed, Jun 15, 2011 at 10:24 AM, Dave Cleaver <
dsclea...@gmail.com> wrote:
> > Hah. I don't mind if my stuff gets invalidated. It might help at least
> > solidify concepts that are worth preserving when the interpreter changes.
>
> > When you talk about bytecode compilation do you mean compiling to the JVM
> > specifically?
>
> Possibly, but more likely to its own bytecode format. I'm no expert so I
> have no idea if that's a good idea or not. I just know that's a simple path
> to having more control over stack frames, which is important for things like
> tail call elimination. Smarter compiler people than I can likely come up
> with a more effective solution. :)
>
> - bob
>
>
>
>
>
>
>
>
>
> > Dave
>
> > On Jun 15, 2011, at 1:02 PM, Bob Nystrom <
munificent...@gmail.com> wrote:
>
> > I don't mind you working on it, but later work may invalidate what you do.
>
> > The current interpreter is a really basic AST walker that uses the Java
> > callstack as its own callstack. I want Magpie to have its own concept of
> > stack frames, which likely also means bytecode compilation. I want to do
> > that for a bunch of reasons:
>
> > 1. Easier to do tail call elimination.
> > 2. Makes it possible to have a restartable condition system.
> > 3. Should make it easier/faster to spawn new "threads".
>
> > The current implementation is closer to being a prototype while I banged on
> > the language semantics than what I'd consider a "real" implementation. Now
> > that it looks like the semantics have settled down a bit
> > (classes/multimethods/patterns/etc.) it will soon be time to start thinking
> > about what a more... professional? implementation would look like.
>
> > So you're welcome to work on concurrency in the meantime, but do so knowing
> > that your code may end up getting nuked at some point in the future. If
> > you're OK with that, by all means go for it. :)
>
> > - bob
>
> > On Wed, Jun 15, 2011 at 8:50 AM, Dave Cleaver < <
dsclea...@gmail.com>
> >> > > > > <
https://gist.github.com/1025344>
https://gist.github.com/1025344.
>
> >> > > > > - bob
>
> >> > > > > On Tue, Jun 14, 2011 at 9:47 AM, Dave Cleaver <
> >>
dsclea...@gmail.com>
> >> > > wrote:
>
> >> > > > >> There was a Go example that implemented the Sieve of Eratosthenes
> >> > > > >> using goroutines. I rewrote it with the async libraries to see
> >> how
> >> > > > >> easy it would be.
>
> >> > > > >> The Go implementation can be found athttp://
> >> > > <
http://golang.org/doc/progs/sieve.go>
golang.org/doc/progs/sieve.go
>
> >> > > > >> My magpie implementation is athttps://<
http://gist.github.com/1025282>
> >>
gist.github.com/1025282
>
> >> > > > >> Dave