Fork me on GitHub
#hoplon
<
2016-04-26
>
l1sp3r09:04:07

wondered if i could punt a Hoplon design question to the group

l1sp3r09:04:01

I want to build a tree editor

l1sp3r09:04:34

the user can be editing any leaf of the tree, say building more of the tree

l1sp3r10:04:15

i’m wondering what the best way to approach this is

l1sp3r10:04:50

lets say the user inserts a branch, should i update the entire model and re-render the entire tree?

dm310:04:58

you're lucky simple_smile there's pretty much a zipper-based tree editor done by Micha and Alan: https://bitbucket.org/alandipert/thelarch/

l1sp3r10:04:40

thanks will give a read

dm310:04:34

are you thinking of an AST editor?

l1sp3r10:04:35

like your reading my mind

l1sp3r10:04:03

any prior art you know of?

dm310:04:48

well, you can look at Eclipse sources simple_smile

dm310:04:57

although that will just be confusing

l1sp3r10:04:15

thinking more hoplon based

dm310:04:35

are you looking for UX ideas?

dm310:04:47

or implementation?

l1sp3r10:04:51

implementation

l1sp3r10:04:03

know exactly what i want to build

dm310:04:04

I think the thing I pasted is closest to what you want already done in Hoplon

l1sp3r10:04:58

cool, dont want to re-invent any wheels

dm310:04:27

do you see users composing bigger scripts with that editor or just a single formula?

l1sp3r10:04:05

well functions

l1sp3r10:04:16

any expression really

l1sp3r10:04:26

and how big is an expression...

l1sp3r10:04:54

are you thinking performance?

l1sp3r10:04:26

idea is that can attach metadata to macros to give hints to layout

l1sp3r10:04:37

eg cond… pair per row

l1sp3r10:04:19

so type if space

l1sp3r10:04:33

and box appears for test then else

l1sp3r10:04:14

looks good

l1sp3r10:04:26

what i’m thinking would render like a standard langauge

l1sp3r10:04:43

at the end of the day, as programmers we’re building ASTs

l1sp3r10:04:54

question is whats the best way of doing that

l1sp3r10:04:06

answer may change per experience level of user

dm310:04:17

I've decided that allowing to just write code is most productive in my case

l1sp3r10:04:47

my users may not be programmers

l1sp3r10:04:01

its important to give as much guidance as possible for me

l1sp3r10:04:27

something that may help fill out the struture of the code would be helpful i think

l1sp3r10:04:32

well will be fun exercise if nothing else

l1sp3r10:04:36

is your language clojure/lisp?

dm310:04:28

doesn't really matter though

dm310:04:54

as your situation is different

l1sp3r10:04:27

if you had such a renderer avaliable open/source would you be tempted to use it?

dm310:04:14

I wouldn't

dm310:04:38

I have a couple of specific cases which allow to "program" visually

dm310:04:52

e.g. select +/-/* and input number

dm310:04:09

but anything more complicated - you just program

alandipert13:04:20

i've been really excited about, but have yet to work on, a touch-based editor for a concatenative lang

alandipert13:04:32

there's a scheme editor for iphone, but i find trees don't really work with touch

alandipert13:04:15

and i have gforth on my phone, but the keyboard is cumbersome... so i imagine an editor with a "word bank" that's like an autocomplete, and you drag words into the program area to append them

alandipert13:04:23

we made this thing awhile ago and gave up https://www.youtube.com/watch?v=__ERGJ5EzAc

alandipert13:04:30

anyway, definitely excited to see any progress in any direction on lisp editors that anyone makes simple_smile

l1sp3r14:04:52

using Hoplon as the implementation library, I wouldnt object to a critique of the design

micha16:04:57

ah, "parenthescope"

micha16:04:02

those were the days