leafac
2017-4-10 15:22:22

I’m trying to write “info.rkt” for my project. Is there a way to list all its dependencies? Or, at least, to tell me if I’m missing any?


samth
2017-4-10 15:22:47

@leafac raco setup --check-pkg-deps


samth
2017-4-10 15:23:05

see all --fix-pkg-deps


samth
2017-4-10 15:23:31

note that running it on just your collection will do the right thing but it’s possible for it to miss dependencies


leafac
2017-4-10 15:23:54

Thank you :slightly_smiling_face:


unbalancedparentheses
2017-4-10 15:57:25

@unbalancedparentheses has joined the channel


unbalancedparentheses
2017-4-10 15:59:17

hi!


samth
2017-4-10 15:59:26

hi


samth
2017-4-10 15:59:40

@lexi.lambda coming back to your questions:


samth
2017-4-10 16:00:36
  1. yes, bidirectional checking and local argument synthesis are different things and can be separated. for example, you could just drop polymorphism entirely, and use bidirectionality to infer the type annotations on lambdas in some cases

samth
2017-4-10 16:03:58
  1. variable elimination is necessary so that you don’t end up with constraints referring to variables that aren’t in scope

samth
2017-4-10 16:04:17

and yes, it’s necessary even without subtyping


samth
2017-4-10 16:05:03

the key to understanding variable elimination is in the CG-Fun rule, where we prevent the generated constraints from referring to the bound variables in the individual function types


samth
2017-4-10 16:05:20

this is necessary because those variables don’t make sense to use outside of their scope


samth
2017-4-10 16:06:13
  1. the way constraint generation works is that it generates some constraints on variables that make S <: T

samth
2017-4-10 16:06:57

so that if we pick a substitution for those variables that meets those constraints, and apply that substitution to both S and T, producing S’ and T’, then S’ <: T’


samth
2017-4-10 16:07:46

the judgment V \|-_X S &lt;: T =&gt; C says that we generate constraints C to make S &lt;: T in that way


samth
2017-4-10 16:07:59

the Xs are the variables we want to know about


samth
2017-4-10 16:08:12

and the Vs are variables that should not be mentioned in the constraints


samth
2017-4-10 16:08:23

hope that helps


lexi.lambda
2017-4-10 16:57:05

@samth: That does help. I will probably try and work through a simple example on pen and paper when I have some time to try and better understand how it all works.


andreiformiga
2017-4-10 19:09:55

what’s the place for documentation bug reports (the guide, in this case)? the main racket repo at github?


samth
2017-4-10 19:11:27

@andreiformiga that’s the right place


asumu
2017-4-10 21:29:26

jerryj: I’m catching up rather late, but I wrote some blog post tutorials for the FFI a while back. Perhaps the blog format would be less overwhelming. Anyhow, any feedback appreciated and hope it helps. http://prl.ccs.neu.edu/blog/2016/06/27/tutorial-using-racket-s-ffi/


jerryj
2017-4-10 21:43:48

Hi asumu, thanks for reaching out to me. Actually, I happened to find part 1 of your tutorial, it was very helpful. I didn’t notice you had a part 2 and part 3, so i’ll check those out after I finish reading the “Inside: Racket C API” doc. I get the sense that I’ll need to know all those kinds of black magic to truley become self-sufficient in the ffi realm.


andreiformiga
2017-4-10 23:11:56

I realized sending a PR for a fix would be as much work as submitting an issue, but I’m not sure how to fix it.


andreiformiga
2017-4-10 23:12:12

hikazoh
2017-4-11 00:48:26

@hikazoh has joined the channel


lexi.lambda
2017-4-11 01:00:20

@samth: Looking over the paper again, I am still a little perplexed by what the constraint generation section is actually describing. It would appear that the various constraint generation rules only inspect types, not terms. Which type are these rules actually applied to? If the type of the argument is known, how is that incorporated into this process? Perhaps I’m overlooking something obvious, but some of the notation seems sort of opaque to me.


lexi.lambda
2017-4-11 01:03:28

I’m trying to apply this to a very simple example. Given an environment with const : All(X, Y) X → Y → X and an expression const True "hello", where True can be inferred to have type Bool and "hello" can be inferred to have type String, I’m trying to understand how this process produces X &lt;: Bool and Y &lt;: String.


samth
2017-4-11 02:01:06

@lexi.lambda so, the key rule is App-Inf-Alg


samth
2017-4-11 02:03:18

in the terms of that rule, f is All(X,Y) X, Y -&gt; X (I’m using multiple arg functions because the paper does), and the es are True and "hello" and thus the Ss are Bool and String


samth
2017-4-11 02:03:35

the Xs are X,Y


samth
2017-4-11 02:07:54

so then we make two calls to the constraint generation algorithm:


samth
2017-4-11 02:08:47
  1. \empty \|-_{X,Y} Bool &lt;: X =&gt; C1

samth
2017-4-11 02:09:07
  1. \empty \|-_{X,Y} String &lt;: Y =&gt; C2

samth
2017-4-11 02:09:33

that produces two constraints: Bool &lt;: X &lt;: Top and String &lt;: Y &lt;: Top


samth
2017-4-11 02:11:12

then we have to take the conjunction of those two constraints, and determine a minimal substitution for R


samth
2017-4-11 02:12:12

here R is just X, and so the minimal substitution is X \|-&gt; Bool (minimal in the sense that it produces the least type in the subtyping order)


samth
2017-4-11 02:12:42

then we apply that substitution to R, which gives Bool, and that the type of the whole application


lexi.lambda
2017-4-11 02:40:55

@samth: Aha, I see; I think I overlooked App-InfAlg. That all makes sense, though, thank you. I’ll probably have more questions later, but I’ll try and work through some other examples on my own.