62 karma · joined June 18, 2017
When gogrep becomes more usable as a library, it would be easier to write such Go programs easier.
As for the alternative formats, I experimented with JSON, TOML and some custom format that is even terser. It wasn't an easy choice, but I'm pretty comfortable with the result. That being said, there could be a several input formats in the future.
I believe Daniel Martí plans to make gogrep usable as a library, so it will be possible to write such Go programs in the future.
* Custom linting rules without re-compilation.
* Diagnostics are written in a declarative way.
* Quickfix action support.
* Powerful match filtering features, like expression type pattern matching.
Uses gogrep for AST pattern matching.
Possible implementation (about 20 lines of code): https://github.com/Quasilyte/goism/issues/57
Not sure if "defadvice" around "byte-compile-form" is acceptable for all users.
1. Use a plugin system (ecaml)
2. Transcompile to a target language (gosim and emscripten-like platforms)
3. Embed another VM inside Emacs and call its eval
There are many differences between these approaches and I am not sure one of them is objectively better as a general solution.
For the end users, all of these approaches can deliver good level of integration (they require different sets of tricks to achieve that).
Some S-expressions with `cl-return' can be rewritten to avoid the need of it (by the optimizer); not sure it covers 100% of the cases though.
Emacs has really good support for it which continues to improve over time.
But.. I love more than one language (and more than one Lisp for sure). Will you try to persuade me that I am wrong in that regard?
Mapconcat is already used inside runtime implementation: https://github.com/Quasilyte/goism/blob/master/src/emacs/rt/... (Print and Println functions).
Name mangling scheme preserves fully qualified package path. All goism sources live inside GOPATH (1), so nothing stops us from implementing a jump to Go definition.
For given `goism-foo/bar.baz` Emacs symbol, Go definition can be found in `GOPATH/src/foo/bar/` package. Exact location can be found by using existing Go tools (simple grep-like solution can work, too).
(1) It can change in future; see https://news.ycombinator.com/item?id=13368846 and even more relevant: https://github.com/golang/go/issues/17271
There can be a backend that generates Emacs Lisp code. Not necessary optimized or idiomatic, but it could be a good starting point for rewriting.
But in general, I agree with you.
I found some optimizations that are not implemented inside Emacs lapcode optimizer. If I will port them to byte-opt everyone win, right (if they pass Emacs team review, of course)?
Easier to debug, simpler to trust (for the end user) and not that hard to generate.
The problem is that it is harder to implement some features of Go in terms of Emacs Lisp without going down to the virtual machine level. Best examples are arbitrary return statements (can be emulated by throw/catch) and goto.
Also, some of my projects that become bigger than 1000 LoC could benefit from static typing and (subjectively) better tooling.
By the way, I think extending Emacs in Racket would be great; just do not have an idea on how to implement that integration smoothly.