Can we move away from scripting engines at some point. They are big black boxes that you throw characters into and then "things" happen that you have no control over.
* What if I don't want the security?
* What if I want more security?
* What if I want actual pointers?
* What if I want to do one of a million things that don't fall into the original assumptions about what a Go interpreter would do?
Compiler-as-a-service is the future. A high quality parse tree, with a built-in interpreter or possibly JITter. Refactoring tools and tons of other cool things can be built instead of the same old black box.
If it's just going to be another plain-old interpreter, it would be best to instead focus on integrating V8 because a Go interpreter would bring far less to the table (notably interpreters are typically slow and one of the big benefits of Go is that it can be fast).
I am not sure I completely get what a compiler-as-a-service really is. could you expand please?
(wrt JITing, yes, we considered it and it's on our radar. we know some version of it worked at some point, at least at the proof-of-concept level: https://github.com/nelhage/gojit)
thanks for your input!
A less Microsoft-centric project would be Clang. Clang is quite accessible and despite that it's not as loosely coupled as Roslyn (e.g. I don't think you can refactor using it), you can still solve some real problems with it (such as autocomplete and static analysis).
Basically, CAAS is the front-end equivalent of LLVM. You turn the whole compiler into a very tidy API: following from that it should be significantly simpler to create something such as the interpreter that you are aiming for.
[1]: http://www.infoworld.com/article/2621132/microsoft-net/micro...
I tried using V8 from Go, but it turned out to be a performance-disaster mainly because the garbage collection strategy of Go requires objects in Go to be movable, hence all interactions between Go and V8 have to go through a lookup-table.
Lisp. You want Lisp.
2) Golang depends on code generation for a lot of it's features. Executing generated code immediately could be helpful.
3) Very quickly execute small tests - one of my favorite python and java/eclipse features that I find somewhat lacking in Go and very much lacking in C++ development : Unit tests that execute before you've fully processed the fact that you pressed the test button in the IDE.
4) Security isolation of parts of programs would be useful
5) Same with various other isolation principles - memory usage, cpu usage, ...
6) I've always thought that Go's best feature is that it's pretty good at compiling different processes into one binary that then work pretty independently. But as I've been making bigger programs I find this less and less true.
Truth is, we need a programming language that is an operating system. Sort of like Erlang, but euhm, somewhat more usable. Go isn't that language. A language where you can start up a thread with $megabytes memory available, $cpu cpu allocation, kill if it goes over it for more than 2-3 seconds and restart after waiting 500ms. Something like that. It needs to be a language where you can really do separation-of-concerns - optimization if compiled into the same binary - minimal code changes to move a specific service to a version running on a different machine.
my plan for this new go interpreter proposal, is to be able to use for scientific exploratory work (like we do with IPython right now when in a python-based ecosystem or CLing when in C++ land).
That's horrifying.
• You already know it.
• You want to use Go libraries.
• You want to extend a Go codebase at runtime, without integrating another language like Lua.
Weirder possibilities:
• You want to be able to use it as the basis for a Go "live image" system, where you can hot-reload modules on editor-save by re-parsing their source.
• You want to try building a Go version of Ruby's Pry (http://pryrepl.org)
• You want to enable your Go program to do stupid things involving generating strings of Go code and eval()ing them.
• You want to take some first steps toward some utopian dream of pushing live Goroutines over the network as frozen state + closure source, similar to what could be achieved on Mosix or the Erlang VM.
There's not much difference between downloading and parsing several hundred kb of JSON and downloading and running a script. I mean, there is, but the iOS store peeps don't need to know ;)
For reference, I run a website analyzing service that crawls websites every week or so and reports errors, mainly broken links. As all the document sources are available at TCP level it would be trivial to extend it with custom error reporting.
Tangential question: Is it documented anywhere how many simultaneous users a Google Doc can have?
After some discussion with a friend, we decide that a golang interpreter would be the best solution though. It could allow you to use channels to communicate between the interpreted and compiled sides of the app. Spawning goroutines on either side would also be handy.
However, that was yet one more project on my list of side projects that I haven't gotten to... So it is nice to see some interest in this idea.
[1] https://github.com/motemen/gore
[2] https://github.com/sbinet/notes-and-todos/blob/master/README...
$ gore
gore version 0.2.5 :help for help
gore> var i = 41
gore> f := func() { i++; fmt.Printf("universe=%d\n", i) }
(func())(0x4012b0)
gore> f()
universe=42
gore> f()
universe=42
universe=43
when Go was released back in 2009 there has been a string of such REPLs, which don't match "my" definition of a REPL, at least, not the one I want to be able to use for exploratory work (the kind you get from a python or IPython prompt)again, that's my personal bias. that said, GoRe is a nice project (gocode-completion, especially, is nice)
nothing's wrong with that except that you accumulate side-effects:
gorepl> f := func() { launchMissiles(); fmt.Printf(">>> missiles launched\n") }
gorepl> f()
>>> missiles launched
gorepl> var a = 2
>>> missiles launched
gorepl> fmt.Printf("oops!\n")
>>> missiles launched
oops!
that's not the kind of REPL I want, and that's not what "my" REPL does (https://github.com/sbinet/igo) nor the one built on top of LLVM (llgoi: http://llvm.org/viewvc/llvm-project/llgo/trunk/cmd/llgoi/)There was originally a proposal for a fairly promising plugin architecture for 1.5 - it didn't make the cut, in the end, but there might be some PoC bits out there if anyone's interested.