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

That repo looks interesting, @ben

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

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

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

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

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

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)

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

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

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

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

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

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

@filippocosta.italy has joined the channel

@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 --

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

@el has joined the channel

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

uhoh audio + video just dropped for me

hm, just had to refresh

good to know. I’ll try refreshing next time

everything good here

yeah… it’s been pretty stable

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

something like \tauC-\
in DrRacket

where C-\
is "control-"

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

I think you could just change input mode to TeX

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

or, I used to re-use agda mode

@lexi.lambda is correct about Typed Racket, btw


I don’t know agda…

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

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

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

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

Okay @ben, here: :kidney:


raco sloc

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

@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:

(Which in this case I am.)

So ya, bad joke, sorry. :disappointed:

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

Ah, oh well.

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

haha, it’s fine

Good talk though

or code walk…

or hybrid.

thank you! it’s really dense.

very nice job, @lexi.lambda

thanks! it was fun to do. :)

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:

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

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

Still, it was pretty cool.

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

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

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

ya….

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

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…

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


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…

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

Oh god

lol

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

Oh, I agree.

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

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

although I guess its not any longer than define-syntax

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

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

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

Readability*

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

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.

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


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

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

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

I think racket-mode
understands tooltips

@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.

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.

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

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.

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

he wasn’t at racket-con last year

so I think no

that would explain things then, yes.

was there anything in particular you wanted to ask about?

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

I’m not sure about other stuff

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.

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

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.

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

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

oh! I just rememberd. Servant!

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

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)))

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

cool

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

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.

@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).

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

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.

@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

am I missing something?

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

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

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.

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

@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”?

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.

@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

including where it’s located

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

Yes

perfect, that ought to work just fine then

thank you!

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