This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-02-02
Channels
- # admin-announcements (33)
- # announcements (2)
- # beginners (75)
- # boot (340)
- # braid-chat (6)
- # cider (30)
- # cljsrn (44)
- # clojars (19)
- # clojure (169)
- # clojure-austin (12)
- # clojure-czech (1)
- # clojure-japan (6)
- # clojure-miami (1)
- # clojure-poland (7)
- # clojure-russia (83)
- # clojurebridge (4)
- # clojurescript (166)
- # community-development (55)
- # component (2)
- # core-async (39)
- # core-matrix (3)
- # cursive (32)
- # data-science (3)
- # datavis (3)
- # datomic (58)
- # dirac (28)
- # emacs (4)
- # events (7)
- # hoplon (254)
- # immutant (29)
- # jobs (2)
- # jobs-discuss (4)
- # ldnclj (35)
- # lein-figwheel (3)
- # mount (202)
- # off-topic (9)
- # om (123)
- # onyx (22)
- # parinfer (112)
- # proton (11)
- # re-frame (6)
- # reagent (43)
- # ring (3)
- # spacemacs (2)
great
I have very little experience with the JVM ecosystem and haven't used a statically typed language in over 10 years
so I ran into some rough spots
but it passes all of the parinfer.js tests
that's a good sign
I'm curious to know how fast it is compared to the JS and Python versions; have no idea how to benchmark something like that on the JVM
What's the next language that needs a Parinfer implementation? Lua? #justkidding #butnotreally
Do you need any CLJS stickers @cfleming ?
I've been thinking about my workflow a bit and I wonder if indent
and dedent
functions would be useful in indent-mode because moving things with space is slow and using 2-stop tabs is imprecise. Basically, ask where are the tab stops that cause structural changes? |(|let [|attrs {|:style {|:color "green"}])
Is parinfer in a better place to move the line around these stops (or expose the tab stop info) than editors themselves?
I think it's a bit different than what https://github.com/shaunlebron/parinfer/issues/21 was getting at
@chrisoakman: Ok, cool, I’ll take a look. Criterium is the state of the art for JVM benchmarking, I’ll take a look at that too if you don’t get there first.
@chrisoakman: I’m good for stickers thanks, I’m not really a sticker kind of guy - my laptop is still pristine!
wonderful
I'm very open to PRs and changes to that repo from someone with more experience on the JVM than me
Ok, cool. I think it makes sense to use nulls rather than your sentinel value, since nulls are first-class in the Kotlin type system, and you lose that support if you use some other value.
I started off doing that
and just couldn't get it to compile
I don't know what I'm doing in a statically typed language
Sentinels normally make more sense if you might be dereferencing these objects and you can provide a sensible default behaviour.
I also wasn't sure whether to use Objects or HashMaps for everything
in JS and Python it was obvious to use JS Objects and Python Dicts
Ok, I’ll take a look - generally in my (painful) experience, it’s a matter of ensuring you use Type? where you might think you need just Type.
I don't understand how people get anything done in languages that don't have literal data types 😉
I think you want data classes (https://kotlinlang.org/docs/reference/data-classes.html)
yeah - I read about that
Since if you use null rather than your sentinel you can get rid of most of your init blocks (again, I think, just from a quick scan of the code)
the MutableResult gets mutated all over the place, everything else is essentially immutable upon creation
yes - that is the case
there is basically no logic in any class; it's all in the functions
not sure if you're looking at parinfer.js side-by-side
awesome
definitely take a look at parinfer.js if you haven't already
Yeah, I’ll look at them side by side, and I’ve spent a bunch of time reading the JS version and the algorithm doc.
it wasn't the worst thing I've ever used 😉
looking forward to anything you do on this
I did the tests in Clojure 1) for comfort and 2) to make sure it was usable outside of Kotlin-world
just "lein run" in that folder
(I assume you have Leiningen installed)
and the testing "framework" could be much more complete
I literally slapped it together in a few minutes
I might have to do that in Cursive, I have a bunch of tests in strings which really sucks.
yeah - Shaun is very thorough
I think he got that idea from the .cljsdoc files we were using
basically: when you need a really simple data structure, but don't want to limit yourself to .json or .edn whitespace / string rules
Right, I investigated using EDN or something, but it doesn’t add much over strings when you need to look at indentation in the results.
like this: https://github.com/cljsinfo/cljs-api-docs/blob/master/cljsdoc/cljs.core/assoc.cljsdoc
we "invented" that format
and I think it inspired what he did for the Parinfer tests
You have to be careful not to add too much "structure" to it else you're just re-inventing .edn
but in/out tests are a good case I think
I think the .cljsdoc file or simple markdown would work great for that
that's where he's parsing the .md files
so glad you're looking into this
I thought if I did the grunt work to get all the test cases passing it might make it much easier to integrate
great; let me know
I’ll have to modify the result to work in Cursive but having the starting point will help a lot.
yeah - I know you've mentioned that
that's one of the things I'm curious about - how fast is this?
because in JS it's super fast
ok, ok
I’ll compare it to a version with a JFlex lexer too, be interesting to see the comparison
looking forward to it
@chrisoakman: How are you currently creating the parinfer jar? Just with a command line invocation?
the one in the README
also when debugging I had a main function and would run inside of Intellij
I have no idea if that's the optimal way to make a jar or not?
it's just what I was able to get working
Ok. I’m just restructuring to build parinfer itself with Gradle so it will generate a proper artifact.
awesome
double awesome
I knew I was not doing things as cleanly as possible (JVM inexperience)
once I got it working I said "ok - that's it! repeat those steps"
It might be easier to add me as a contributor to the project rather than use pull requests, this is going to be a fairly large patch.
it's amazing how much "tribal knowledge" is baked into different development ecosystems
yeah; sure thing
should be done