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

Abstracting a scripting language's internal value types using Cello #119

Open
IngwiePhoenix opened this issue Feb 9, 2019 · 1 comment

Comments

@IngwiePhoenix
Copy link

Hello!

I found this project a few days ago, and at the same time, I was getting into the actual C API of a scripting language: Gravity.

Now, working with it's C-API is rather tedious. Whilst not being too complicated, working with values retrived and sent to and from the VM is not that easy. But when I saw Cello, I wondered if it would be possible to "port" Cello to use Gravity's value types instead.

But I have no idea where to start :) I did find the Tree class in src/Tree.c but could not find any of the other classes I would have to port - unfortunately... Basically, I only want to map these kinds of types, and need to know where their respective classes are, so I can modify them properly:

  • Numbers (integer, double)
  • Strings
  • Arrays (mixed)
  • Maps (I already saw that in Tree - but Table as well. What is the difference, aside from the used members? And where would one use the one or the other?)
  • Functions/Closures
  • Objects

Where are those specific parts defined and can I just go ahead and fork this repo and modify the classes' contents?

Also, Gravity has a GC already, so I don't want to have values made with/by/for Gravity to be garbage collected.

Thank you in advance! :)

@orangeduck
Copy link
Owner

Hi @IngwiePhoenix,

I would think this would be pretty difficult/impossible to just "port" in some way because Cello is really tied to it's own internals. However you may be able to use some of the ideas from Cello to build your own wrapper around the C api to make things a bit easier.

Thanks,

Dan

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