This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-20
Channels
- # announcements (1)
- # asami (6)
- # babashka (21)
- # beginners (19)
- # calva (44)
- # circleci (3)
- # clj-http (3)
- # clj-kondo (44)
- # clojure (24)
- # clojure-australia (1)
- # clojure-czech (1)
- # clojure-europe (50)
- # clojure-france (5)
- # clojure-germany (1)
- # clojure-nl (2)
- # clojure-spec (8)
- # clojure-uk (8)
- # clojurescript (161)
- # datomic (4)
- # fulcro (7)
- # graalvm (8)
- # heroku (4)
- # lambdaisland (4)
- # lein-figwheel (5)
- # lsp (48)
- # malli (21)
- # meander (15)
- # off-topic (35)
- # polylith (2)
- # re-frame (21)
- # react (22)
- # reagent (13)
- # reitit (6)
- # remote-jobs (1)
- # reveal (3)
- # ring (3)
- # shadow-cljs (37)
- # testing (2)
- # tools-deps (10)
- # vim (18)
- # vrac (1)
- # xtdb (17)
Random tidbit: Crash was written in a lisp: https://all-things-andy-gavin.com/2011/03/12/making-crash-bandicoot-gool-part-9/
is there an good diagramming tool format that's both understood by an intuitive graph editor GUI and easy to parse into a graph in code?
dia and yed look promising, but I'm not finding the resources for my particular use case in either
maybe I can bite the bullet and use yed's graphml
Graphviz
Graphviz is good for generating text by hand, or from a program, to describe a graph with optional node and edge labels, and control a lot about its presentation. I don't recall if there is a good way to turn that into something that you can further easily edit by hand with a GUI program, unless you just want to "paint on top of it"
right, I want a graph I can walk or even edit and re-export
right now I'm messing with clojure.xml and graphml export, it's got some ugliness but looks like it will work
but if there's something simple I'd love to hear about it
concretely, I have a DSL for a design task where using a graph editor would be intuitive and save me a bunch of work
so I want to be able to load up a graph from the gui into clojure
I half recall that there might be some output format that Graphviz can produce that can be read and edited in a GUI program, perhaps xfig?
Yeah, if you do dot -Tfig foo.dot > foo.fig
, that foo.fig
file can be read and edited via xfig
. I haven't used this much, but it is possible.
The resulting file is a text file in xfig-specific format, and not designed to be restricted to graph data structures, nor to be able to extract the graph structure from it. It is a visual rectangle/line/text-with-positions kind of file format.
yeah - I figured out how to get vanilla clojure data out of the graphml, and the lowest effort way to get precisely what I need is going to be editing in yed, and loading into clojure via data.xml - thanks
I haven't seen yed before. Looks interesting. Looking at web site I would guess it is commercial product that costs money to buy a license? Not obvious from a couple of mins of browsing their site, to me.
how fun/horrible would it be to use a macro that took in an ASCII graph diagram and emitted code
haha - ascii art image recognition sounds like a fun toy task
the rules are definitely simpler than they would be for photos...
doesn't emacs have something like this in its stdlib?
but I wanted intuitive so that's emacs ruled out 👿
(define (same? a b)
#2dcond
╔═════════════╦═══════════════════════╦═════════════╗
║ ║ (pair? a) ║ (number? a) ║
╠═════════════╬═══════════════════════╬═════════════╣
║ (pair? b) ║ (and (same? (car a) ║ #f ║
║ ║ (car b)) ║ ║
║ ║ (same? (cdr a) ║ ║
║ ║ (cdr b))) ║ ║
╠═════════════╬═══════════════════════╬═════════════╣
║ (number? b) ║ #f ║ (= a b) ║
╚═════════════╩═══════════════════════╩═════════════╝)
yeah. can't imagine what it's like to actually use it in real life but it is quite a beautiful proof of concept
I won't flood with more examples but this is quite pretty
(define (subtype? a b)
#2dmatch
╔══════════╦══════════╦═══════╦══════════╗
║ a b ║ 'Integer ║ 'Real ║ 'Complex ║
╠══════════╬══════════╩═══════╩══════════╣
║ 'Integer ║ #t ║
╠══════════╬══════════╗ ║
║ 'Real ║ ║ ║
╠══════════╣ ╚═══════╗ ║
║ 'Complex ║ #f ║ ║
╚══════════╩══════════════════╩══════════╝)
I was thinking about this in the context of drawing a literal signal graph when using some reactive dataflow lib