This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-03-02
Channels
- # aleph (6)
- # beginners (57)
- # boot (1)
- # cider (27)
- # clara (23)
- # cljs-dev (166)
- # clojure (287)
- # clojure-dev (23)
- # clojure-greece (1)
- # clojure-italy (2)
- # clojure-russia (13)
- # clojure-spec (34)
- # clojure-uk (36)
- # clojurescript (68)
- # core-async (63)
- # core-logic (1)
- # cursive (1)
- # data-science (1)
- # datomic (26)
- # duct (1)
- # emacs (10)
- # figwheel (8)
- # fulcro (2)
- # garden (16)
- # graphql (8)
- # hoplon (20)
- # jobs (2)
- # leiningen (10)
- # off-topic (16)
- # onyx (2)
- # portkey (5)
- # quil (1)
- # re-frame (63)
- # reagent (95)
- # reitit (6)
- # remote-jobs (1)
- # ring (6)
- # rum (1)
- # shadow-cljs (76)
- # spacemacs (26)
- # specter (11)
- # sql (7)
- # unrepl (68)
- # vim (2)
- # yada (2)
not tied to unrepl but to tooling in general: scavenging the Eclipse incremental Java Compiler and repurposing as either a standalone agent or a plain lib started in a repl session would be useful. clj
and such a lib/agent would be enough to do mixed projects
https://github.com/eclipse/eclipse.jdt.core/blob/master/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/IncrementalTests.java and https://github.com/eclipse/eclipse.jdt.core/blob/master/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuilderTests.java looks like interesting starting points
I wonder if anyone’s using Eclipse these days, apart from people in IBM and SAP. 🙂 When I started doing Java long time ago I was an Eclipse user myself, but when I swithed to IDEA I felt enlightened. Eclipse innovated very slowly and couldn’t get even basic things like git and maven integration, right, IDEA on the other hand felt like a speedtrain and always delivered tools to alleviate known pain points and leverage new trends in development.
But I guess you want to use the compiler only, not build something for Eclipse itself.
Back to unrepl. I have in mind of adding a very small unrepl.core
namespace which would not be shaded in blobs.
Why? as one can do (clojure.main/repl ...)
or even better (->> (read) eval prn (while true))
to upgrade their repl session I’d like to expose equivalent facilities.
the question is not really about the source file extension but, I guess, about cross-platform availability
Vim cannot have compound map keys. The you got a map with symbol keys? Then I get a magically tagged alist having very fun accessing the innards......
Vim has no symbols. And no vectors/list duality. So I get "foo" vs. {"edn/symbol": "foo"}. And ["foo"] vs. {"edn/list": ["foo"]}
One issue is that embedded actions are contextual: they are not tagged you have to understand the structure of the message to know what is an action and what is “just data”
well actions are not sprinkled everywhere (except elisions which are tagged) so it may be doable to have a post-processing of the edn to transform actions into something more palatable for vim
The actions are not really a problem in handling. They are from known sources. And are traversed for params. Not really a problem. The payload of events is the issue. Case: : prompt. But these are not sent back. So I can munge them.
[':prompt', {'edn/map': [[':file', 'unrepl-session'], [':line', 1], [':column', 1 ], [':offset', 0], [{'edn/symbol': 'clojure.core/warn-on-reflection'}, v:null], [{'edn/symbol': 'clojure.core/ns'}, {'edn/tag': 'unrepl/ns', 'edn/value': {'edn/ symbol': 'user'}}]]}]
for [ k, v ] in a:response[1]["edn/map"] if type(k) == v:t_dict \ && has_key(k, "edn/symbol") \ && k["edn/symbol"] == "clojure.core/ns" let a:this.namespace = v["edn/value"]["edn/symbol"] break endif endfor
I'll write a simplifier to apply in such cases, which translates for example list or symbols to vim lists and strings. The means, I cannot distinguish lists and vectors anymore. As well as symbols and strings.
Elisions can be special cased to be left alone. But I don't need their contents, since they act as a template only.
From what I get keywords are represented as “:kw” then keep on with this trend: “sym” and "\”str\”” etc
Actually I think latent parsing (no it’s not a thing I just made the term up) is a good idea.
Hmm... I'm not completely convinced. It may work with keywords, symbols and strings, because you can use the first character to discriminate the type.
There you can still use # for the dispatch in the string, but you cannot access to payload easily.
Dunno hopefully not. This maybe a question, how general purpose the parser should be. Also keeping strings as double quoted puts the escape burden on the user. Not nice.
Fluffing around with strings.... Don't want that. This should be handled by the system.
General purpose parser is somehow a sub project of its own. Parsley Clojure parser has been detrimental to CCW imo. However it has somehow succeeded on its own (because of an empty ecosystem niche)
It's also the other way: I can't just stick a string in. And that's almost always what I want to do. But then it would be considered a symbol. So I must wrap it in ". But now I also have to take care that things are escaped correctly. Bleh. :-(
But that might be an encoding issue. Maybe a prefix is better: :: keyword, ': symbol, s: string. And hope that there are no tagged literal as key. (#inst anyone?)
In the end it boils down to intended usage: Do I want a full blown parser/generator for EDN? Or is the need for vimpire more important/sufficient. Actually I need both. The first for the actions which have to be traversed for parameter replacement (so no opaque tagged literals!) and have to produce exact EDN. Then the latter for the tooling interaction, where ease of accessibility is key. But there I don't need sets or symbols. There I can live a simplified translation.
yeah you could also introduce you own serialization to encode as strings all kind of keys. However if you really want to be generic then: what when you get maps as keys? You would need to write a canonicalization algorithm for maps to be independent of the key order...
I disagree that you need a full blown parser to perform substitutions. It can be done at the string level (extra points for taking care to figure out that you are not in an escaped context (eg string))
framed like that it feels preposterous to say “me” but.. in the blob generation code, the regex-from-hell-that-blows-stupid-Java-regex-matching or the hand crafted state-machine that replaces it.
So now one can use unrepl.core/write
and unrepl.core/non-eliding-write
(total-write. full-write, write++?)
https://github.com/cgrand/seqexp/blob/master/README.md you and rich have a shared way of thinking @cgrand
Wow that is handy!