DSchroer / dslcad

DSLCad is a programming language & interpreter for building 3D models.
https://dslcad.com
GNU Lesser General Public License v2.1
470 stars 14 forks source link

Shared library support #21

Open DSchroer opened 1 year ago

DSchroer commented 1 year ago

Right now DSLCAD can call local scripts using ./path/to/file(). This is a simple enough option but does not work if we want to efficiently share libraries.

I am looking for a simple solution & syntax for how we can implemented shared libraries with the following properties:

  1. Allow people to publish libs
  2. Libs can reference other libs
  3. All data of which libs are in use should be in the source.
gedw99 commented 1 year ago

this is really interesting.

these are plugins that people can write and use with dslcad ?

DSchroer commented 1 year ago

Here is the general idea. Lets assume you are an expert in gears. So you build this cool dslcad script for making gears. It works like this:

./gear(pitch=...);

Now lets say I have a project and I want to use gears. There needs to be a way for us to share scripts so that my part can use your gear script. Which in turn I might want to share. So now we have:

./doms_robot(); 
   // using ./gear(...); 

So we end up with these nested parts. I would like to have something where I can say:

use url_to_gear_library as gears;

gears/gear(pitch=...);

And now we can all share the parts we are building.

DSchroer commented 8 months ago

I have added the ability to load other file types or "resources" into the script. Right now its got stl and ini file support. The idea being that scripts and resources are treated equally. Then I add text rendering fonts will also be resources.

With that the ability to pack and distribute bundles as a shared library is still an open question.