Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could you compare this to thing/geom? #6

Open
kxygk opened this issue Jul 10, 2021 · 5 comments
Open

Could you compare this to thing/geom? #6

kxygk opened this issue Jul 10, 2021 · 5 comments

Comments

@kxygk
Copy link

kxygk commented Jul 10, 2021

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
Copy link
Owner

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:

  • thing/geom is huge and thus a potential (admittedly subjective) no-go for some people. In fact, I'll admit that as I was first learning Clojure, I found thing/geom and turned away from it due to the shear volume of namespaces. In short: it didn't feel accessible to me. svg-clj is much smaller in scope and so may be a 'quick and easy' tool for some situations.
  • This library is absolutely a project for fun/learning on my end. But, I do feel quite strongly that there is enough utility here to be valuable to at least a few people.

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
Copy link
Author

kxygk commented Jul 11, 2021

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:

  • a serializer to go hiccup->SVG/XML
  • some "utility" stuff.. colors/transforms/etc
  • basics "shape" functions that take params and return hiccup

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

  • even lower level stuff that's used by SVG and other namespaces: ex matrix/vector/color
  • higher level stuff that usually leverages SVG: ex: I mostly use geom-viz, this make declarative plots, and it will use the SVG namespace to generate those

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
Copy link
Author

kxygk commented Jul 15, 2021

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
Copy link
Owner

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
Copy link
Author

kxygk commented Jul 17, 2021

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants