mkouhei / gosh Goto Github PK
View Code? Open in Web Editor NEWinteractive shell for Golang
License: GNU General Public License v3.0
interactive shell for Golang
License: GNU General Public License v3.0
Supports executing go run with sudo.
For example, ICMP echo request needs the privilege.
$ $GOPATH/bin/gosh
>>> i := 1
>>> fmt.Println("hello")
>>>
Gosh suports as follows currently.
>>> func main() {
>>> for i := 0; i< 10; i++ {
>>> fmt.Println(i)
>>> }
>>> }
0
1
2
3
4
5
6
7
8
9
But omit mode does not support this.
>>> for i := 0; i< 10; i++ {
[error] /tmp/gosh-598639397/gosh_tmp.go:4:1: expected operand, found '}'
[error] # command-line-arguments
./gosh_tmp.go:4: syntax error: unexpected }, expecting semicolon or newline
>>> fmt.Println(i)
[error] /tmp/gosh-598639397/gosh_tmp.go:5:1: expected operand, found '}'
[error] # command-line-arguments
./gosh_tmp.go:5: syntax error: unexpected }, expecting {
>>> }
$ cat /tmp/gosh-598639397/gosh_tmp.go
package main
func main() {
for i := 0
fmt.Println(i)
}
Making this app avalible on the Windows Platform
I want to add a binary to Gentoo package manager.
Want to support commands history as like iPython's %hist command.
To appear the prompt, we have to enter the "Enter" again, to appear the prompt.
$ $GOPATH/bin/gosh
>>> i := 10
>>> i += 100
>>> fmt.Println(i)
111
>>>
When typing something, and you continue typing, then realise you want to change something, you can't press the left arrow key to go back and edit it. Instead, you have to copy paste up until the bit you want to fix, then fix, and copy paste the rest
Currently , it is not possible to type of re-declaration.
Add user documents with Sphinx and read the docs.
Currently, implementing the parser FIFO, in this method,
it is difficult to solve the problem of issue #12.
The copying to the general implementation of AST , changing the FILO manner .
>>> func test() {
>>> fmt.Println(1)
>>> }
>>> test()
1
>>> func main() {
>>> test()
>>> }
1
>>> test()
1
1
>>> func main() {}
1
1
expecting func declaration only, but function executing immeadiately.
>>> func main() {}
>>> func test() {
>>> fmt.Println(1)
>>> }
1
>>>
$ gosh -version
version:
I have a situation where I want to skip RPC server connection overhead in an edit-compile-run cycle by doing it once and interactively use an API for experimentation. I also want user-configurable hooks that can convert from arbitrary strings to the type that a particular interface requires dynamically
....giving this problem, having a command-line shell after I've initialized a couple object would be quite useful.
At the moment, I think one problem preventing embedding gosh is that it doesn't expose any of the top-level functions that I could import and use into my own main. Is that correct?
For example ^r is search commands history.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.