adam-james-v / svg-clj

DSL for compiling SVG elements with Clojure(script)
MIT License
102 stars 2 forks source link

Could you compare this to thing/geom? #6

Open kxygk opened 3 years ago

kxygk commented 3 years ago

I noticed you do a comparison to dali. Could you do something similar with thing/geom?

The whole thing/geom collection of libraries is huge - It's a mammoth piece of work that's very Clojure-y and extensible. I'm curious why reinvent the wheel instead of extending that. (maybe just for fun, :) ) It looks very similar but I'm guessing that I'm missing some critical design difference that makes what you want to do incompatible or fundamentally different.

It also doesn't come with a rasterizer btw. Just hiccup->svg/xml. I've used SalamanderSVG successfully (was quicker than Batik) as well as rendering directly with JavaFX primitives

PS: Thanks for ob-babashka.el :). I'm gunna try to do something similar for Clojure and thing/geom

adam-james-v commented 3 years ago

Thanks for your great suggestion. I've heard of thing/geom but it just didn't cross my mind to add it as a comparison.

It's a fair question wondering why I've made this lilbrary instead of usign thing/geom. The first reason you actually mention:

Finally, I suspect there are some design differences that I would have to look into further and add to the readme.

Once again thanks for the suggestion, I really appreciate getting input from the community :)

Btw, glad you like ob-babashka.el. I'll keep my eyes open for work with thing/geom!

kxygk commented 3 years ago

Ah, yeah, I get how it looks overwhelming. I had the same impression at first. It's actually just a suite of mini-libraries that mostly work independently

If you look at the original master branch and its org literate stuff then it should be relatively easy to understand. Here is the SVG one: https://github.com/thi-ng/geom/blob/master/geom-svg/src/core.org

This can be used independent of the rest of the geom project and I think it's doing a lot of things similar to you. It's sorta just 3 parts:

The other namespaces in geom can be thought of in two ways:

So then when you want to extend the functionality you write your own mini-library in effect and you can leverage the existing ecosystem. Though.. frankly I've barely scratched the surface when it comes to that myself :) . I've only really just wrote my own hiccup-JavaFX serializer

If I get a babel mode working then I'll post a link/example here :))

kxygk commented 3 years ago

I never managed to make a babel mode. The ELisp wouldn't comply :)

But I did make a setup with ob-clojure. Maybe you'll find it useful

https://geokon-gh.github.io/literate-clojure.html

The last example kinda showcases thing/geom firing at all cylinders

Hope it's useful!

(there are also a lot of little details I couldn't work out - in the green Note sections.. feedback and tweaks much appreciated)

adam-james-v commented 3 years ago

Wow, thanks so much for sharing this :)

It'll be great to go through in more detail when I have the time (life's a tad busy at the moment, but hey, that's how things go).

I think with your example here I can put together a nice comparison! Again, really appreciate your input.

I'll run things on my machine soon and see if I can give any feedback :)

kxygk commented 3 years ago

Oh please take your time. And if you don't get around to it, don't worry. I was just working on this literate mode thing on my own and came across your lib and your ob gist. That's all. I was gunna make that write up anyway.

If you have any feedback of suggestions at some point that'd be great - but I didn't mean to give you any extra work :)