Load New Class in Standalone App

Hi Friends,

I’m making a standalone SC app, and I’d like to be able to:

  1. Start the App.
  2. Receive the encrypted source code for a new SC class from a web daemon (python or java or c++).
  3. Decrypt and compile this class to memory (not writing to disk).
    4a. Either Load the new class hot, which I don’t think is possible yet, or…
    4b. Store the compiled class in memory while the app/interpreter reboots, and load the compiled class during that process, or…
    4c. Just get the class loaded in any manner without writing the decrypted version to disk.

Hoping for either the obvious answer I don’t know about or haven’t thought of, OR any friendly suggestions about strategies I should consider.

Really, any info would be super helpful,
-Kevin Warren

Currently (throughout SC’s lifespan), class definitions are read from (unencrypted) disk files, and that’s the only source of class definitions. So 4a, 4b and 4c are all impossible.

I have a quark, ddwProto, which implements prototype-based programming in a way that can simulate the important features of object-oriented programming:

  • Class definition: Create a prototype.
  • Instantiation: Copy and initialize (prep) the prototype.
  • Inheritance: .clone a prototype and add or overwrite methods.

Unlike event/environment-based object prototyping, ~environmentVariable references are local to the Proto instance.

It does have some limitations. The prototype shouldn’t implement methods that are understood by the hardcoded Proto class or its subclass Object. It’s a bit slower than a standard class, but it works for most cases.

hjh

Thanks for the reply! I’ll look into your quark, that seems very promising.

Here’s another idea: can I build encryption in to the class compiler itself?
Like So:

  1. Save encrypted source code of class to disk.
  2. Save encryption keys for each class in a parallel location.
  3. Alter class compilation code to decrypt the source code of the class immediately before compilation.

Is this feasible?
But really I think your quark might work for what I need. Thanks again!

-Kevin

Is this something that might be feasible?

As it’s open source, nobody can stop you. You can alter the source code at will for private use.

But if you distribute a modified binary, terms of GPL apply. I think we’re on GPL3? So you would have to release your modifications too.

hjh

Oh, for sure! I love the whole open source abundance mindset, and I’ll be sure to share any modifications. I know the whole encryption thing might give another impression…

I’m building an NFT marketplace for SC compositions. It won’t be anywhere near unhackable (esp after publishing the source code… lol), but I’d like to limit the ease of wholesale copycatting of the compositions while demonstrating a proof of concept ( The ability to transmit vast amounts of sound across a public network… privately ).

I’ll post a link to the source code on this forum when it’s finished, modifications or no.

If you (or anyone else) would be interested in contributing to the project, please pm me!

Also… I guess my question was more along the lines of “Does this idea seem workable, and could you give me a hint as to where the relevant code lives?”

Thanks for all your help, I really appreciate it a lot!
-Kevin

Not sure if it’s ok to express a political opinion here; if this is out of place, then the admins can happily delete it.

AIUI, NFTs are a terrible, terrible idea that are contributing to environmental destruction without actually helping artists anyway. I feel like the idea of an NFT marketplace is something that the SC community should be opposed to.

2 Likes

I’ll also take no issue with it if mods remove this post on the grounds of it being off topic, and I make no pretense of speaking for “the community” or even of feeling that this community should be expected to have disciplined and coherent positions on this or any other issue.

Having said that, I simply wanted to add that I could not agree more with @jordanwhitede here and that the article linked above is imo valuable and important reading.

Thanks for your input, Jordan… you raise a great point!

I agree that Proof-of-Work blockchains are wasteful and unsustainable. That is one of the main reasons why I’ve chosen the Algorand blockchain to build on. Please check it out, it’s been live for around 4 years and has a SUPER welcoming and positive community supporting developers. Here’s an article addressing their carbon impact:

I’m interested in this claim from the article:

I’ve been working in digital spaces making artwork since well before cryptocurrency was around, and lack of scarcity is the only thing we’ve got.

Digital files don’t have that much going for them. They store monumentally less information than say, a piece of paper- which contains the artwork on it as well as inscribed histories of hand, pen, ink, pulp, forest- a dense connected materiality that unfolds forever. A digital file is a pauper in comparison. A file breaks down to requisite ones and zeros well before one can reach the atomic composition of the materials in a physical drawing.

Digital files also require power to access and maintain, and are incredibly unstable over time as new operating systems, plugins and standards render things unviewable- often within a decade. They are also vulnerable to bitrot and physical degradation of storage media- the stable shelf life of a CD-ROM, for instance, is less than 20 years.

What digital files and digital artists do have is duplicatability. There is no original file. When I make a copy of a text document, 3d model, or game and give it to you we both have the original. We’re both having a first-hand experience. We both are engaging with the work wholly as itself, not second-hand documentation.

This is it! This is the one thing! Digital artists have media that can proliferate over a network and be held by many people at once without cheapening or breaking the aura of a first-hand experience. It is the one true benefit to working in digital space.

I’m horrified to see this willingly traded for an opportunity to reproduce the worst parts of the existing physical art market, where “the original” is useful foremost as a rare thing- a unique thing- that, in its scarcity, is an asset.

I wonder what others think about this – for me it’s something I treasure about the SC community, not just the open source software itself but the free and open code sharing that takes place. Has anyone ever experienced compositional “copycatting” as a result of this? And/or would people be more inclined to release work as playable code if there were some encryption/ownership element?

Hey did you ever build That NFT marketplace?