« first day (1922 days earlier)      last day (1570 days later) » 

7:01 AM
@Shepmaster Oh no !
 
 
5 hours later…
12:09 PM
@Stargateur except for one of bbqsrc's comments, the whole conversation was pretty reasonable really
 
@edwardw he overreact because of the past
 
Ah, no wonder
 
 
2 hours later…
 
6 hours later…
8:31 PM
Tremble in fear, ye mortals:
fn sandbox_api<Req, Resp, F, Ctx, SbReq, SbResp, FutSbResp>(path: &'static str, f: F, ctx: Ctx) -> impl Filter<Extract = (warp::reply::Json,), Error = warp::Rejection> + Clone
where
    Req: DeserializeOwned + Send,
    Resp: Serialize,
    SbReq: TryFrom<Req, Error = Error> + Send + Sync,
    Resp: From<SbResp>,
    F: Fn(AsyncSandbox, SbReq) -> FutSbResp,
    F: Copy + Clone + Send + Sync,
    FutSbResp: std::future::Future<Output = sandbox::Result<SbResp>> + Send + Sync,
    Ctx: snafu::IntoError<Error, Source = sandbox::Error> + Copy + Clone + Send + Sync,
 
This doesn't pass the linter
 
@Shepmaster I really doubt this REALLY need that much generic
 
Used like this:
    let execute = sandbox_api::<ExecuteRequest, ExecuteResponse, _, _, _, _, _>("execute", AsyncSandbox::execute, Execution);
    let compile = sandbox_api::<CompileRequest, CompileResponse, _, _, _, _, _>("compile", AsyncSandbox::compile, Compilation);
    let format = sandbox_api::<FormatRequest, FormatResponse, _, _, _, _, _>("format", AsyncSandbox::format, Formatting);
    let clippy = sandbox_api::<ClippyRequest, ClippyResponse, _, _, _, _, _>("clippy", AsyncSandbox::clippy, Linting);
    let miri = sandbox_api::<MiriRequest, MiriResponse, _, _, _, _, _>("miri", AsyncSandbox::miri, Int
 
You'll need the _^5^ notation
 
@DenysSéguret clippy is fine with it ;-) Maybe you mean the DenysSéguretLinter
yes, those _ are annoying
 
8:36 PM
@Shepmaster I mean the linter I'll write rather than pasting it into my code
 
I honestly thought about adding a macro to hide the _
 
(TBH I didn't find any reason yet of why it should be bad)
 
Here's the body of the generic function:
    warp::path(path)
        .and(body::json())
        .and_then(move |req: Req| async move {
            async {
                let sandbox = AsyncSandbox::new().await.context(SandboxCreation)?;
                let req = req.try_into()?;

                f(sandbox, req)
                    .await
                    .map(Resp::from)
                    .context(ctx)
            }
                .await
                .map(|r| warp::reply::json(&r))
                .map_err(warp::reject::custom)
 
Such a declaration is painful to read. Too many generics are like too many arguments, you need to count to know what you're passing. The fish thing doesn't work well in such a case
 
Is there somewhere a list of companies based on a project written in Rust (for example TikV)?
 
8:42 PM
@FrenchBoiethios I don't understand what you ask for
 
@DenysSéguret Teams write a product in Rust, and then create a company based on it: for example, pingcap.com/en who sell their TTiDB product
Is there a list of these?
 
I would be interested by such a list too
 
@FrenchBoiethios How specific do you mean? Can the company create the Rust code after the company is formed? Can they have non-Rust projects? etc.
 
8:58 PM
@Shepmaster Nope, a company created after an open-source Rust project shows it's promising, and only based on it.
 
9:08 PM
@FrenchBoiethios you might have your list then :-)
 
@Shepmaster How?
 
9:26 PM
@FrenchBoiethios that may be the only company
 
@Shepmaster I'm pretty sure that it's not. But they may be a few of them :P
 
There doesn't appear to be a good way to obtain a raw pointer to a value of a generic T: ?Sized
Obviously a cast: &T as *const T isn't sound if T:?Sized, but I feel like there could be an AsPtr trait or something
I've had to use a &String :/
I am missing something obvious?
 
10:01 PM
@PeterHall Isn't it?
It's not FFI-safe but AFAIK it's not unsound in general
 
It's not even allowed by the compiler
Because &T could be a fat pointer
Oh wait, that's not quite right
I'm trying to cast to a usize, which isn't allowed
 
oh, I see
 
And actually that's easily circumvented
by going: *const S as *const u8 as usize
or somethiing
I had forgotten that raw pointers can also be fat
 
hmm
I am confused, but I suppose that's normal :)
 
yes, don't worry - I just needed a rubber duck I think :)
 
10:21 PM
quack, quack.
 

« first day (1922 days earlier)      last day (1570 days later) »