Commit graph

947 commits

Author SHA1 Message Date
Niko Matsakis
5efda5c21d run cargo check --all in CI 2022-08-05 14:29:54 -04:00
Niko Matsakis
974725a27d re-export from salsa_2022_macros
d'oh, why didn't this fail CI?
2022-08-05 14:26:13 -04:00
bors[bot]
022641c04a
Merge #321
321: rename salsa-entity-mock to salsa-2022 r=nikomatsakis a=nikomatsakis

cc #305 

Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
2022-08-05 17:26:33 +00:00
Niko Matsakis
66f1f1c50c rename salsa-entity to salsa-2022 2022-08-05 13:20:14 -04:00
bors[bot]
3ba3dbb19b
Merge #308
308: Tracked proposal r=nikomatsakis a=nikomatsakis

I sketched out a variation of the entity API that I am calling tracked (this is a hat-tip to Ember's terminology, cc `@wycats).` It is the mostly the same ideas, but repackaged in a way that I think is more intuitive. This was inspired by writing the previous tutorial and thinking how things could be a bit cleaner.

To read the proposal, check out the "overview" page on the netlify preview. The tutorial and code have not been fully updated to match yet.

cc #305 

Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
2022-08-05 10:42:38 +00:00
Niko Matsakis
11fb9823cc remove blank line 2022-08-05 02:57:22 -04:00
Niko Matsakis
39c26b5ea6 update documentation to use new name, specify
override is a keyword, turns out
2022-08-05 02:53:40 -04:00
Niko Matsakis
4f234cfbb9 remove component and replace with specify option
You can now do `#[salsa::tracked(specify)]` and you will
get a method `some_fn::specify(...)` that can be used to
specify the value.
2022-08-05 02:51:13 -04:00
Niko Matsakis
1f1950c145 refactor error reporting, detect too few argments 2022-08-05 01:24:07 -04:00
Niko Matsakis
89f801276c another simple test 2022-08-05 00:41:00 -04:00
Niko Matsakis
627eddd428 add a test for tracked functions 2022-08-05 00:39:00 -04:00
Niko Matsakis
b4053ad76b rename references to memoized to tracked 2022-08-04 01:42:42 -04:00
Niko Matsakis
91a18114bc s/memoized/tracked-fn/ 2022-08-04 01:41:04 -04:00
Niko Matsakis
e222cce854 rework the tutorial with the new paradigm 2022-08-04 01:31:13 -04:00
Niko Matsakis
8f2f664e96 rename impl stuff from entity to tracked struct 2022-08-03 13:42:33 -04:00
Niko Matsakis
a96cb03a05 remove #[salsa::entity], and #[salsa::tracked] 2022-08-03 09:09:22 -04:00
Niko Matsakis
8ff4f5069e rename EntityLike to SalsaStruct 2022-08-03 08:53:27 -04:00
Niko Matsakis
e331f7102d mark some unused variables 2022-08-03 08:51:14 -04:00
Niko Matsakis
41f9ca6462 update tutorial with newer input structs in mind 2022-08-03 03:50:57 -04:00
Niko Matsakis
3a55d3072b remove DataItem now that we don't support enums
simpler.
2022-08-03 03:50:46 -04:00
Niko Matsakis
0880be0b79 remove support for interned enums
It's nicer to just define a struct with a data field.
2022-08-03 03:43:39 -04:00
Niko Matsakis
aefb85385e rewrite calc example to use a salsa::input 2022-08-03 00:41:36 -04:00
Niko Matsakis
7e3e77d611 fix various small bugs in #[salsa::input] 2022-08-03 00:41:22 -04:00
Niko Matsakis
f0156cca36 rename all_entity_fields to all_field_names 2022-08-03 00:32:27 -04:00
Niko Matsakis
783981dc16 add salsa::input items 2022-08-03 00:31:50 -04:00
Niko Matsakis
1c882bb598 fix missing format! calls in entity_like.rs 2022-08-03 00:31:26 -04:00
Niko Matsakis
196baab60d add InputIngredient
They are a very simple variant on entities
2022-08-03 00:30:52 -04:00
Niko Matsakis
d134e0a54b comment the fields on an interned ingredient 2022-08-03 00:05:37 -04:00
Niko Matsakis
3559ac2b21 remove trailing whitespace 2022-08-02 15:05:28 -04:00
Niko Matsakis
548beade54 extract configuration struct/impl code from entity
`#[salsa::input]` structs will need similar code
2022-08-02 10:56:27 -04:00
Niko Matsakis
f2649ee503 extract helper functions for validation 2022-08-02 14:22:45 +03:00
Niko Matsakis
db75a1a510 write up a new API proposal, tracked 2022-08-02 10:24:38 +03:00
Niko Matsakis
8e348f0bc8 clarify jars a bit, hopefully
Some folks were thinking that Jars were something
more complex than they are.
2022-08-02 07:57:23 +03:00
bors[bot]
6bd6f6ee0b
Merge #307
307: quick fix for components w/ optional jar r=nikomatsakis a=nikomatsakis

We need tests!

Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
2022-08-02 04:32:17 +00:00
Niko Matsakis
d0b7046245 quick fix for components w/ optional jar
We need tests!
2022-08-02 07:28:13 +03:00
bors[bot]
9eed580f51
Merge #304
304: entity-based salsa preview r=nikomatsakis a=nikomatsakis

This PR is a squashed and updated version of my entity branch. This API is, I believe, what will become the long awaited (by me, anyway) Salsa 1.0 release. It's a complete overhaul of the Salsa API and implementation that feels a lot cleaner to me.

The PR includes a tutorial and sample application (a compiler) that covers the major concepts. There is still more work needed to complete the tutorial and in particular to write up a bunch of tests (I had more tests but they were hacky so I deleted them). 

Right now, all the new stuff is in a pair of new crates, salsa-entity-mock and salsa-entity-macros, leaving the existing salsa intact. I would like to remove the old salsa but we have to reconcile the two and port over the tests.

There is still a fair bit of work to do before we can release this new version of Salsa, but I expect a lot of it can happen after this PR is merged. The list is on #305.

Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
2022-08-02 03:51:35 +00:00
Niko Matsakis
5aabd4014d add a caveat to avoid confusion 2022-08-02 06:37:12 +03:00
Niko Matsakis
e3769b5c31 remove trailing whitespace
this seems to be a rustfmt bug?
2022-08-01 13:54:21 +03:00
Niko Matsakis
985650523e entity-based salsa preview 2022-08-01 09:24:49 +03:00
bors[bot]
754eea8b5f
Merge #303
303: Bump parking_lot packages r=jonas-schievink a=eliascodes

This is motivated by recent changes to `parking_lot` affecting `wasm32-unknown-unknown` targets (see https://github.com/Amanieu/parking_lot/issues/269 if interested). My project depends on `parking_lot` via `salsa`, which is why I'm facing this issue.

TLDR is that `parking_lot` released a new version that provides a fix for the above. I'm hoping that version can be included in a future version of `salsa`.

For reference, here's the relevant part of the changelog: https://github.com/Amanieu/parking_lot/blob/HEAD/CHANGELOG.md#parking_lot-0120-parking_lot_core-090-lock_api-046-2022-01-28

I belive the only changes that might affect APIs used by `salsa` are in PRs https://github.com/Amanieu/parking_lot/pull/313 and https://github.com/Amanieu/parking_lot/pull/344/files, but I'm unfamiliar with the internals of either project so could easily be wrong.

I can build and test successfully locally with these bumps. Let me know if there's anything else I can do to help this over the line.


Co-authored-by: Elias Malik <elias0789@gmail.com>
2022-07-06 14:38:59 +00:00
Elias Malik
81b798470e bump parking_lot packages 2022-06-07 13:39:07 +01:00
bors[bot]
cf22135ec2
Merge #275
275: Expose the ability to remove the value from an input query, taking ownership of the value r=nikomatsakis a=1tgr



Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
2022-06-03 11:06:53 +00:00
Niko Matsakis
95812f09d0 cargo fmt 2022-06-03 07:01:27 -04:00
Niko Matsakis
f91923c189 switch to Option<StampedValue> for efficiency 2022-06-03 06:44:16 -04:00
Niko Matsakis
b7ac12758b update RFC 2022-06-03 06:28:23 -04:00
Niko Matsakis
1cc649b5e4 store an Option to fix tests 2022-06-03 06:24:50 -04:00
Niko Matsakis
26e099eb12 broken tests 2022-06-03 06:08:57 -04:00
Niko Matsakis
1f561023cd draft RFC 2022-06-03 06:08:52 -04:00
Niko Matsakis
1e3c2f22aa Expose the ability to remove the value from an input query, taking ownership of it
Co-authored-by: Tim Robinson <tim.g.robinson@gmail.com>
2022-06-03 05:52:00 -04:00
bors[bot]
887f24c06d
Merge #302
302: fix misleading type in salsa book example r=nikomatsakis a=LYF1999

fix misleading type in salsa book example

Co-authored-by: Yifei <lyfmagic99@gmail.com>
2022-05-31 13:17:55 +00:00