completium / archetype-lang

MIT License
70 stars 9 forks source link

Namespaces? #325

Open evronm opened 2 years ago

evronm commented 2 years ago

Hi all,

I'm writing my first Archetype contract, and I immediately ran into what strikes me as a very strange error. Here is the code I'm trying to use:

asset all_tokens {
    owner: address;
    amount: nat;
}

asset voting_tokens {
    expires: date;
    tokens: partition<all_tokens>;
}

asset utility_tokens {
    foo:string;
    tokens: partition<all_tokens>;
}

And the error I get is: already bound: "tokens" .

Do assets really not have their own namespaces? I can't have two different assets with the same property name?

Please clarify. This kind of thing would be a complete deal killer for me if there was another blockchain out there with usable storage layer, but it seems Tezos is the only game in town, so I'll have to deal with it. Are there any plans to change this??

Thanks in advance.

rognierbenoit commented 2 years ago

Hi Mike, indeed there is currently this constraint on field names; we are working on releasing it (should be done by November).

If this is a deal killer, you may use one of the two other languages SmartPy or Ligo. We wouldn't like you to rage quit Tezos for that :) ...

evronm commented 2 years ago

That's great. I'll try to keep my asset use to a minimum until November. And no, there's no way I'm rage quitting. As I mentioned, Tezos is the only game in town for structured data storage on a blockchain. Instead, I'll keep an eye on development here. Thanks so much for the answer, and for building such a usable platform!

johannww commented 2 years ago

Just went through this problem today. It is indeed very important to be solved. Waiting on it.

evronm commented 2 years ago

Agreed. I've more or less paused development until this is fixed because I was creating a huge mess that I would then have to clean up. I hope it's still scheduled for November...

johannww commented 1 year ago

I temporarily switched to Ligo, even though I see Archetype as a more straightforward language to learn and code in. Ligo has some interesting test features and after two days of coding, you get used to it.