ben
2017-9-22 16:03:27

@notjack did you try with-intercepted-logging ? Here’s an example: https://github.com/bennn/rosette-contract/blob/master/private/util/log.rkt#L75


samth
2017-9-22 16:24:02

That repo looks interesting, @ben


ben
2017-9-22 16:32:05

Maybe someday. The idea was to do contract-stronger? with Rosette, but it only works now for datatypes Rosette can compile to SMT.


leif
2017-9-22 18:20:05

@mflatt Is there any way to add a 0 width field to a c-struct?


leif
2017-9-22 18:20:42

Or is there any sort of public version compute-offsets I can use?


leif
2017-9-22 18:21:12

(Because define-cstruct explodes in size and I want to generate stuff dynamically)


mflatt
2017-9-22 18:26:47

I don’t think you can have a 0-sized field in a cstruct.


mflatt
2017-9-22 18:27:42

Exporting something like compute-offsets would be fine. That function is not using anything private, anyway (so, in a pinch, you could just copy it)


leif
2017-9-22 18:31:48

Fair. I ask because I want to dynamically create about 10 or so sets of 4–5 structs or so of ~100 fields.


leif
2017-9-22 18:31:59

(Because if I statically create them I get a zo file of 100 MB)


leif
2017-9-22 18:32:07

But I still want one getter/setter for each field in the set.


mflatt
2017-9-22 18:35:28

@cowbs Did the raco exe ++exf -S ++exf <path> ... idea solve your problem?


cowbs
2017-9-22 18:40:13

No, I get unknown switch: -S when I run the generated .exe


cowbs
2017-9-22 18:42:19

I was trying with ++exf "-S <path>", so I just tried with separate ++exf args, but it gave the same error


filippocosta.italy
2017-9-22 18:52:59

@filippocosta.italy has joined the channel


mflatt
2017-9-22 19:13:19

@cowbs It looks like --exf -- is required, first, to remove the -- that prevents Racket from consuming extra flags as its own. So, you probably need something like raco exe --collects-path <path> --exf -- ++exf -S ++exf /tmp/other x.rkt ++exf --


jeapostrophe
2017-9-22 19:21:01

We are starting the Inside Racket Seminar shortly — https://www.youtube.com/watch?v=3xFWcNarb3Q


el
2017-9-22 19:28:31

@el has joined the channel


zenspider
2017-9-22 19:45:17

audio keeps dropping but the video keeps going so I don’t think it is my tubes


ben
2017-9-22 19:47:52

uhoh audio + video just dropped for me


ben
2017-9-22 19:48:17

hm, just had to refresh


zenspider
2017-9-22 19:50:08

good to know. I’ll try refreshing next time


samth
2017-9-22 19:51:53

everything good here


zenspider
2017-9-22 20:03:29

yeah… it’s been pretty stable


zenspider
2017-9-22 20:05:30

damn… tau-double-arrow-slash-lambda-bang… how do you type all of that? an APL keyboard?


ben
2017-9-22 20:06:03

something like \tauC-\ in DrRacket


ben
2017-9-22 20:06:15

where C-\ is "control-"


zenspider
2017-9-22 20:06:27

I need to work with greg to get all these expansions into racket-mode


ben
2017-9-22 20:06:54

I think you could just change input mode to TeX


zenspider
2017-9-22 20:07:15

oh! looks like it might all be done… I need to learn how to activate it then


ben
2017-9-22 20:07:16

or, I used to re-use agda mode


samth
2017-9-22 20:07:35

@lexi.lambda is correct about Typed Racket, btw



zenspider
2017-9-22 20:13:14

I don’t know agda…


ben
2017-9-22 20:15:08

doesn’t matter, it’s just for the shortcuts, like, \- instead of \rightarrow


leif
2017-9-22 20:28:21

@lexi.lambda You know what other compiler can loop? :wink:


leif
2017-9-22 20:34:59

@ben Do I need to bring you a :pizza: ?


leif
2017-9-22 20:39:13

@ben Eep, I only have one :heart: though…. I guess I could give you a kidney?


leif
2017-9-22 20:44:25

Okay @ben, here: :kidney:


ben
2017-9-22 21:08:28

ben
2017-9-22 21:08:34

raco sloc


lexi.lambda
2017-9-22 21:18:59

@leif I don’t even get it :disappointed:


leif
2017-9-22 21:46:27

@lexi.lambda Ah, no worries. It was a bad attempt at a bad joke. At one point you were talking about the hacket (or haskell) compiler diverging. And I was making a bad joke that the Racket compiler is very easy to make diverge, at least if you include the macro expander. :slightly_smiling_face:


leif
2017-9-22 21:46:41

(Which in this case I am.)


leif
2017-9-22 21:46:49

So ya, bad joke, sorry. :disappointed:


lexi.lambda
2017-9-22 21:46:56

ah, yes. I ended up mentioning that, I think. :)


leif
2017-9-22 21:47:07

Ah, oh well.


leif
2017-9-22 21:47:19

I guess I was too busy trying to be snarky. Sorry. :wink:


lexi.lambda
2017-9-22 21:47:29

haha, it’s fine


leif
2017-9-22 21:47:31

Good talk though


leif
2017-9-22 21:47:38

or code walk…


leif
2017-9-22 21:47:40

or hybrid.


lexi.lambda
2017-9-22 21:47:46

thank you! it’s really dense.


samth
2017-9-22 21:47:51

very nice job, @lexi.lambda


lexi.lambda
2017-9-22 21:48:08

thanks! it was fun to do. :)


lexi.lambda
2017-9-22 21:48:36

it gave me a good motivation to clean up parts of the codebase in the past few weeks, too, since it was even worse a month ago, if you can believe it. :wink:


leif
2017-9-22 21:49:13

Meh….check out the video codebase….or don’t. :wink:


leif
2017-9-22 21:49:21

(You may end up blind like me if you do…)


leif
2017-9-22 21:49:27

Still, it was pretty cool.


lexi.lambda
2017-9-22 21:50:20

it makes me wonder if I should back out the wild τs⇔/λ! names, haha


lexi.lambda
2017-9-22 21:50:52

I did not put that much thought into them when I wrote them, and they have sort of… multiplied over time.


lexi.lambda
2017-9-22 21:51:16

there used to be just τ⇒! and τ⇐!, but then one thing led to another…


leif
2017-9-22 21:53:36

ya….


leif
2017-9-22 21:53:52

This is why I try to avoid having ..too… many greek symbols in my code.


leif
2017-9-22 21:54:29

They are really good….up until you realize that you have variables that are 5 or 6 or 7 of them concatenated together and have no idea what they’re trying to say…


leif
2017-9-22 21:54:59

Although honestly τs⇔/λ! makes sense to me.



leif
2017-9-22 21:55:41

I would just cringe at having to type that. I mean, I’m sure I can set up a keyboard layout for it, but there really isn’t a standard one I’m aware of, and typing in the latex codes (or unicode codes), seems painful…


ben
2017-9-22 21:55:47

Λων´ιδας Γ κ´ιµπας provided invaluable assistance with the Paxon dialect.


leif
2017-9-22 21:55:55

Oh god


leif
2017-9-22 21:55:56

lol


lexi.lambda
2017-9-22 21:56:41

you end up building the muscle memory for \tau, \Rightarr, and \Leftarr, and they are definitely concise and readable when you know the mnemonics.


leif
2017-9-22 21:57:13

Oh, I agree.


lexi.lambda
2017-9-22 21:57:28

(τ means “type”, τs means multiple types, means infer, means check, and means “with bindings”)


leif
2017-9-22 21:58:21

I’ve done that. But even with the muscle memory, a variable names \taus\\Rightarr! is kind of long…


leif
2017-9-22 21:58:53

although I guess its not any longer than define-syntax


lexi.lambda
2017-9-22 21:59:05

yeah. though not longer than the equivalent, which would be infer+check-types/bindings. but that’s more readable.


lexi.lambda
2017-9-22 21:59:33

(well, in that case it just would be infer-type!, I guess)


leif
2017-9-22 22:00:12

Maybe. Readabilities (as far as I can tell), is context sensitive.


leif
2017-9-22 22:00:20

Readability*


leif
2017-9-22 22:00:40

So given that you are living in this code and I’m not, I must defer to you here. :slightly_smiling_face:


lexi.lambda
2017-9-22 22:01:21

I like the short names—I think they’re very cute—but I think it might be better to get rid of them if I want more people to contribute.


lexi.lambda
2017-9-22 22:01:32

I don’t want to end up with something like Control.Lens.Operators



notjack
2017-9-22 22:54:01

@lexi.lambda maybe macro-added tooltips would work?


notjack
2017-9-22 22:55:26

So mousing over the symbolic names would “translate” them to their much more wordy counterparts


lexi.lambda
2017-9-22 22:55:57

that’s a fun idea… though I don’t know that everyone uses DrRacket, and it’d be pretty cryptic.


notjack
2017-9-22 23:01:01

I think racket-mode understands tooltips


lexi.lambda
2017-9-22 23:04:36

@ben: given the relevant topic… I’m very interested in talking to you, @alexknauth, and @stchang about some type-related things at RacketCon this year.


lexi.lambda
2017-9-22 23:05:37

I haven’t really been following the Turnstile development since I stopped using it… but I peeked at it a little while ago and it looked like you’ve been improving it.


lexi.lambda
2017-9-22 23:06:15

though I’m not entirely sure who’s working on what at this point.


ben
2017-9-22 23:10:38

Steven, Alex, and Milo Turner are the “current” devs. I think Steven + Alex have been doing a Typed Rosette, and Milo’s been doing linear + affine types.


lexi.lambda
2017-9-22 23:11:33

have I met Milo? I don’t immediately recognize the name.


ben
2017-9-22 23:11:47

he wasn’t at racket-con last year


ben
2017-9-22 23:11:51

so I think no


lexi.lambda
2017-9-22 23:12:18

that would explain things then, yes.


ben
2017-9-22 23:12:22

was there anything in particular you wanted to ask about?


ben
2017-9-22 23:12:35

I think recent Turnstile might have performance improvements you can re-use


ben
2017-9-22 23:12:49

I’m not sure about other stuff


lexi.lambda
2017-9-22 23:13:31

I’m interested in a few different things. trying to come up with a better story for dictionary elaboration is a big one, but that’s not really turnstile-related.


lexi.lambda
2017-9-22 23:14:03

I’m also interested in talking to Stephen about laziness, since I get the sense he may have opinions about it ;)


lexi.lambda
2017-9-22 23:14:55

I’m curious what the performance improvements are. I remember looking at syntax-local-expand-expression at one point, but otherwise I’m unsure what they might be.


ben
2017-9-22 23:16:25

it might just be syntax-parse tuning, like using #:commit (like you have already)


lexi.lambda
2017-9-22 23:17:28

my bet is that syntax-local-expand-expression could give speedups, but I don’t think I can use it because of elaboration. :/


ben
2017-9-22 23:21:37

oh! I just rememberd. Servant!


ben
2017-9-22 23:22:31

that’s something I was thinking about doing too, but never started


lexi.lambda
2017-9-22 23:23:13

this is what the existing demo looks like in Hackett: #lang hackett (require hackett/demo/web-server) (data Greeting (greeting String)) (instance (->Body Greeting) [->body (λ [(greeting name)] {"Hello, " ++ name ++ "!"})]) (defserver run-server [GET "/" -> String => "Hello, world!"] [GET "greet" -> String -> Greeting => greeting]) (main (do (println "Running server on port 8080.") (run-server 8080)))


ben
2017-9-22 23:23:15

my idea was, have a DSL for web APIs, store these APIs in external files, and the macro expander can read the files & generate typed racket types


ben
2017-9-22 23:23:52

cool


lexi.lambda
2017-9-22 23:23:56

yeah, the ability to make “type providers” a feature of the macro system is a neat one.


notjack
2017-9-23 00:40:06

How can I get a list of submodules a module declares using only a module-path? value? The closest things I’ve found are module-compiled-submodules and syntax-local-submodules, but the former requires a compiled-module-expression? value and the latter only works for finding submodules of a module while that module is expanding.


mflatt
2017-9-23 00:58:39

@notjack get-module-code from syntax/modcode can help you load the code for a given module path. There’s not really a way to list the possible submodules without consulting the code (in compiled or source form).


notjack
2017-9-23 01:02:58

@mflatt can / should there be a way to do that?


mflatt
2017-9-23 01:04:30

There can’t be a very different way to do that, since submodules are sometimes loaded only on demand. There could be a way to read compiled source just enough to find out what the submodules are, without actually reading the implementations.


notjack
2017-9-23 01:08:18

@mflatt as far as I can tell, what submodules a module has is a static property of a fully expanded module and not a dynamic one, so I’m not sure I understand the barriers to implementing such a module->submodule-names function


notjack
2017-9-23 01:08:27

am I missing something?


notjack
2017-9-23 01:10:25

I’m okay with such a function requiring that a module be loaded to find out what its submodules are, even if some of those submodules are module forms that could be loaded without loading the enclosing module


notjack
2017-9-23 01:11:11

(use case is reflecting over all the modules in a package)


mflatt
2017-9-23 01:12:15

A module doesn’t currently keep a list of submodule paths separate from the submodules themselves. So, if the submodules are loaded separately, the module doesn’t remember them.


mflatt
2017-9-23 01:12:39

If you want to know what modules are in a package, though, don’t you want to be working with the module implementations, anyway?


notjack
2017-9-23 01:16:08

@mflatt I’m not sure I understand your question. What I want is to go from a package name, to a tree of collection directories, to a list of files in each of those collections representing modules, to a tree of all submodules in each of those file modules. What do you mean by “working with the module implementations”?


mflatt
2017-9-23 01:20:08

Since you have a filename for a module, then it seems like get-module-code is exactly what you want. You can use module-compiled-submodules on the result from get-module-code to traverse the tree of submodules.


notjack
2017-9-23 01:22:36

@mflatt ah, so you were referring to if I wanted to get submodules for some module without knowing anything at all about the module’s source code


notjack
2017-9-23 01:23:07

including where it’s located


notjack
2017-9-23 01:27:08

@mflatt I assume get-module-code returns a compiled-module-expression? value if it uses the default compile procedure?


mflatt
2017-9-23 01:27:21

Yes


notjack
2017-9-23 01:29:21

perfect, that ought to work just fine then


notjack
2017-9-23 01:29:25

thank you!


samth
2017-9-23 03:56:48

@leif your latest change broke the Travis build, which was evident on the PR