Mainmatter · @mainmatter
56 followers · 146 posts · Server fosstodon.org

Learn how will improve ’s backend development in @algo_luca’s talk at @rustlab_conf!

Check out the event here and join Luca in Florence on November 19-21: rustlab.it/

#pavex #rustlang #upcomingconferences

Last updated 2 years ago

Luca Palmieri · @algo_luca
1795 followers · 394 posts · Server hachyderm.io

@botahamec @benwis it's a commit from , a new Rust web framework I have been working on.

See lpalmieri.com/posts/a-taste-of for more details!

#pavex

Last updated 2 years ago

Luca Palmieri · @algo_luca
1776 followers · 390 posts · Server hachyderm.io

Borrow checking was one of my nightmares for .

The framework must generate _valid_ code, which implies that pavex itself needs to be aware of the borrow checker.

After a few days of head scratching, it's working!
There are a few edge cases left, but the core works πŸš€

#pavex #rust

Last updated 2 years ago

Luca Palmieri · @algo_luca
1766 followers · 379 posts · Server hachyderm.io

This is related to β€”I need to build the packages in the current workspace in a specific order, making sure to execute the code generation step _before_ trying to compile the generated code or any other crate that depends on it.

I could introduce a `cargo` subcommand (e.g. `cargo pavex build`), but it'd be cool to make it transparent.

#pavex

Last updated 2 years ago

Luca Palmieri · @algo_luca
1762 followers · 377 posts · Server hachyderm.io

It looks like the next step for is becoming more aware of the borrow checker.

In particular:

1. emit code that passes the borrow checker where possible;
2. emit errors when it's impossible;
3. provide a "clone where needed" strategy for when you don't care.

A bit scared of tackling 1. and 2., it could be a significant time sink.

#pavex

Last updated 2 years ago

Luca Palmieri · @algo_luca
1762 followers · 377 posts · Server hachyderm.io

The API for nesting in
is now more or less settled.
What's left? Dealing with all the ambiguous situations that arise!

An example:
- the top-level blueprint defines a constructor for a singleton type, u64.
- the nested blueprint overwrites it.

What should happen?

This is ambiguous!
The nested route expects a certain constructor to be used.
The parent route expects another one to be used.

But the type is supposed to be a singleton, we can't create it twice!

#pavex #rust

Last updated 2 years ago

Luca Palmieri · @algo_luca
1739 followers · 371 posts · Server hachyderm.io

Six weeks have passed, it's time for another update on , the new web framework I've been working on.

I've focused on the router in March: trying to nail a good API and, most importantly, great error messages.
It's looking quite promising!

lpalmieri.com/posts/pavex-prog

#pavex #rust

Last updated 2 years ago

Luca Palmieri · @algo_luca
1732 followers · 369 posts · Server hachyderm.io

Introducing the concept of scopes to a codebase later in the game is always a messy business.

The implicit assumption that everyone can see everything has a way to percolate *everywhere*.

Why are we here?
needs to check at compile-time if your path extractor makes sense (i.e. does each field map to a route parameter?), which implies a way to go from a component to the relevant route.

E.g. RouteParams<HomeParams> => /home/:home_id

#pavex

Last updated 2 years ago

Luca Palmieri · @algo_luca
1698 followers · 356 posts · Server hachyderm.io

How difficult is it going to be to support trivial specialization in ? I'm about to find out πŸ”₯

The idea being: you can register a generic constructor for a type (e.g. `Json<T>`) and provide a more specific one (e.g. `Json<u64>`) that will take precedence.

This is supposed to work exclusively in simplest case - i.e. your "more specific" constructor cannot have any unassigned generic type parameter.

#pavex

Last updated 3 years ago

Luca Palmieri · @algo_luca
1694 followers · 345 posts · Server hachyderm.io

Quite happy with how the route conflict error is shaping up in !

I have to do some work on sub-diagnostics (i.e. how to show multiple code snippets in a single error), but that's more of a general tech debt thing.

#pavex

Last updated 3 years ago

Luca Palmieri · @algo_luca
1678 followers · 338 posts · Server hachyderm.io

Kicking off a new experiment: monthly progress reports for .

The first alpha is months out, so I want to try to keep the project on people's mind in the meantime.

The first report is _almost_ ready to go. I managed to do the tough part, writing the introduction πŸ‘€

#pavex

Last updated 3 years ago

Luca Palmieri · @algo_luca
1677 followers · 333 posts · Server hachyderm.io

The work on continues, slowly but surely.
I'll probably whip together a progress report in the next week or so.

In the meantime, crossed a new milestone: the reflection engine can now handle all "common" response types!

#pavex #rust

Last updated 3 years ago

Hayden Stainsby · @hds
43 followers · 162 posts · Server hachyderm.io

@dragnucs this is a bit of a blind guess, but perhaps look up by @algo_luca, from what I understand it’s going in that direction.

#pavex

Last updated 3 years ago