quantified-uncertainty / squiggle

An estimation language
https://squiggle-language.com
MIT License
152 stars 23 forks source link

@location tag #3011

Closed OAGr closed 9 months ago

OAGr commented 9 months ago

One key consideration is if we can auto-add @location on decorators. If we can, then I think this should be named @location, as I don't expect it to be frequently used. If we can't, then I think we should name it @loc.

There's a significant issue with this PR, as I had to make a new ValueTagsWrapper class to handle some functions on ValueTags, due to an issue of circular dependencies. Curious if you have preffered ways of doing this. I also considered having BaseValue rely on an abstract class version of ValueTags, but that seemed like too much.

Tests are failing because the new toString format is different. If this PR is approved, I'll fix these.

changeset-bot[bot] commented 9 months ago

🦋 Changeset detected

Latest commit: e1ee728c2b4d005f6225fad58a8363cf9da9e2d5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages | Name | Type | | ----------------------------------- | ----- | | @quri/squiggle-lang | Patch | | @quri/squiggle-components | Patch | | @quri/prettier-plugin-squiggle | Patch | | @quri/versioned-squiggle-components | Patch | | vscode-squiggle | Patch | | @quri/squiggle-textmate-grammar | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

vercel[bot] commented 9 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
quri-hub ✅ Ready (Inspect) Visit Preview Jan 31, 2024 8:44pm
squiggle-components ✅ Ready (Inspect) Visit Preview Jan 31, 2024 8:44pm
squiggle-website ✅ Ready (Inspect) Visit Preview Jan 31, 2024 8:44pm
1 Ignored Deployment | Name | Status | Preview | Updated (UTC) | | :--- | :----- | :------ | :------ | | **quri-ui** | ⬜️ Ignored ([Inspect](https://vercel.com/quantified-uncertainty/quri-ui/3jYqEt536GaXkDQFKgV33RcSsHeA)) | [Visit Preview](https://quri-ui-git-with-location-quantified-uncertainty.vercel.app) | Jan 31, 2024 8:44pm |
OAGr commented 9 months ago

After this goes in, we should change exportData to also be a type.

berekuk commented 9 months ago

After this goes in, we should change exportData to also be a type.

Later we might have to change it back to being a VDict, or a custom struct Value. I understand that using a type gives us type safety, though. Depends mostly on how soon we get custom structs, and how compile-time-safe they're going to be (will stdlib custom structs be shaped with TypeScript generics to map to TS object shapes? seems doable but difficult to predict).