parinfer

shaunlebron 2017-10-24T00:46:01.000170Z

it goes beyond programming syntax though

shaunlebron 2017-10-24T00:47:26.000063Z

even when ALGOL and LISP were first created, the former was considered natural from the outset

shaunlebron 2017-10-24T00:47:50.000008Z

they called it and others like it “algebraic notations”

shaunlebron 2017-10-24T00:48:28.000109Z

because it followed normal conventions from mathematical notation that had been around for some ~400 years

shaunlebron 2017-10-24T00:51:24.000095Z

polish notation was created to remove parens around 1920.

(1+2)*3 => * + 1 2 3

shaunlebron 2017-10-24T00:52:46.000167Z

and around the same time, lambda calculus used prefix notation for function application, but parens were often omitted by assuming left-association:

((M N) P) => M N P

shaunlebron 2017-10-24T01:05:42.000220Z

I’d be willing to say that familiarity with algol syntax is not a prerequisite for disliking parentheses clutter in lisp

shaunlebron 2017-10-24T01:08:05.000180Z

the feeling of “clutter” is a function of both layout and count, and saying that there are less parens in Clojure than other langs is ignoring the other half of the problem

shaunlebron 2017-10-24T01:17:41.000058Z

I think it represents an interesting conflict of two cultural memes: 1) “free will”—you can and should be able to look past these parens that you will get used to, and 2) “empathetic designer”—it’s my fault as the designer that the path of least resistance led you away

cfleming 2017-10-24T01:18:37.000108Z

It’s also untrue IIRC, for non-trivial blocks of code. e.g. fn(1 + 2) vs (fn (+ 1 2))

cfleming 2017-10-24T01:19:14.000114Z

I actually saw a study somewhere which I can’t find now where they counted parens/delimiters across different codebases, lisps did end up with significantly more.

cfleming 2017-10-24T01:20:12.000110Z

But right, just shouting down people who are suffering with it is unlikely to do any good.

👍 1
dominicm 2017-10-24T08:01:12.000161Z

I wonder if M-expr were: 1) has less perceived paren clutter 2) not adopted/built because the syntax improvement was not that significant.

cfleming 2017-10-24T08:03:21.000145Z

I actually do think that parens are overblown, but prefix notation is still difficult for me sometimes. (/ (+ 1 2) (* 3 6)) is just harder to scan than the infix equivalent.

cfleming 2017-10-24T08:03:58.000283Z

Likewise comparisons, in something like (< width 10) I always have to mentally shift the < to ensure I’m comparing in the right direction.

cfleming 2017-10-24T08:04:39.000234Z

Parens were only a problem briefly, and prefix isn’t terrible (and has its own advantages), but it’s still not natural to me.

dominicm 2017-10-24T08:06:06.000162Z

Comparison operators are a struggle for me. Partially because the only thing I can remember is "the crocodile eats the bigger one", meaning I have no idea which is which.

😂 1
cfleming 2017-10-24T08:06:21.000124Z

Hahaha

cfleming 2017-10-24T08:06:52.000350Z

So true

wilkerlucio 2017-10-24T11:54:21.000345Z

@shaunlebron you asked me to share here once I got it out, so here it is, today I'm releasing OgE, OgE is a graph explorer for Om.next query syntax, the editor uses parinfer to help the user to write their query fast 🙂

wilkerlucio 2017-10-24T11:54:25.000183Z

OgE can be found at: https://github.com/wilkerlucio/oge

shaunlebron 2017-10-24T16:12:12.000416Z

@wilkerlucio cool, looks nice, thanks for sharing

shaunlebron 2017-10-24T16:12:36.000465Z

i like how you setup the dependencies here: https://github.com/wilkerlucio/oge/blob/9c974be973cc629dfa0351187616e76497d4dff9/src/deps.cljs

shaunlebron 2017-10-24T16:13:52.000448Z

I was helping timothy pratley setup parinfer on a cljs project yesterday

shaunlebron 2017-10-24T16:14:14.000519Z

and i had trouble figuring out how to setup these transitive dependencies between foreign libs

shaunlebron 2017-10-24T16:15:41.000605Z

it’s all very weird

shaunlebron 2017-10-24T16:16:31.000072Z

i ended up just creating cljsjs packages

shaunlebron 2017-10-24T16:18:04.000498Z

i suppose I could add a :requires key for parinfer-codemirror to point to cljsjs/parinfer and cljsjs/parinfer-codemirror to have the compiler throw an error if they can’t be found

shaunlebron 2017-10-24T16:19:09.000012Z

i still dislike that parinfer and codemirror have to be referenced as global vars when included as foreign-libs by the cljs compiler

wilkerlucio 2017-10-24T17:04:02.000252Z

@shaunlebron the deps was more a need then a feature, hehe, I needed that because OgE is supposed to be used as a library too, I didn't wanted to shared because I'm afraid of naming munging on adv compilation (also, there is currently a bug, I can't add externs there, if I do I break the compilation, antonio monteiro said there is no current way around it, so I believe him), in my case I'm calling those using goog.obj helpers to avoid the advanced compilation issues

wilkerlucio 2017-10-24T17:04:26.000707Z

but would be nice if we could just import, does the cljsjs packages that you created have the externs for it?

shaunlebron 2017-10-24T17:04:44.000432Z

externs are there yeah

shaunlebron 2017-10-24T17:05:05.000056Z

but really, i use cljs-oops to avoid externs now

shaunlebron 2017-10-24T17:05:26.000587Z

essentially a simpler way to do what you’re already doing with goog.obj

wilkerlucio 2017-10-24T17:05:30.000308Z

nice, I might give it a try to the cljsjs packages, and I think you should add the :requires, since they are a real requirement there (and helps on the load ordering)

wilkerlucio 2017-10-24T17:06:01.000510Z

yeah, I saw cljs-oops, I just think goog.obj works well enough, trying to reduce deps

shaunlebron 2017-10-24T17:06:02.000401Z

ah, i missed that it helps with load ordering, makes sense

shaunlebron 2017-10-24T17:06:28.000223Z

that’s the only downside—that it’s not a part of core, but it never will be

wilkerlucio 2017-10-24T17:06:56.000360Z

true