62 karma · joined Jun 18, 2017 (9y ago) · 19 submissions
comment 6y ago · link · parent
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.
6.
Show HN: CodeQL-Like Analyzer for Go(github.com ↗)
39 points · by quasilyte · 6y ago · 5 comments
7.
Phpgrep: Syntax-aware grep for PHP code, written in Go(github.com ↗)
2 points · by quasilyte · 7y ago · discuss
comment 8y ago · link · parent
comment 9y ago · link · parent
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.
comment 9y ago · link · parent
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).
comment 9y ago · link · parent
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.
comment 9y ago · link · parent
Mapconcat is already used inside runtime implementation: https://github.com/Quasilyte/goism/blob/master/src/emacs/rt/... (Print and Println functions).
comment 9y ago · link · parent
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
comment 9y ago · link · parent
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)?
comment 9y ago · link · parent
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.
comment 9y ago · link · parent
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.