samth
2018-5-8 12:24:13

@lexi.lambda the drawback of exporting keyword functions from the expander is that then the expander code needs to have the full kw infrastructure compiled in


samth
2018-5-8 12:25:34

I can’t remember if the current status eliminates it all, but it should be possible currently


samth
2018-5-8 13:49:12

@ben I think the struct-predicate optimization generates (-> any/c any/c) contracts when it should generate (-> any/c any) contracts


samth
2018-5-8 13:50:26

yes, this program shows the problem: #lang typed/racket (: f : Any -> Boolean) (define (f x) (string? x)) (provide f)


lexi.lambda
2018-5-8 15:12:16

@samth re: expander keyword functions, I agree that the performance of the expander is critical, so I’d be okay with having to do the racket/base wrapping if it’s really necessary. I just think it would be an awkward limitation if all of the functions in the syntax local zoo were restricted from every using keyword arguments.


samth
2018-5-8 15:29:48

@lexi.lambda I agree that kw arguments are useful, which is why the wrapping is sensible — it’s already done for lots of functions like call-with-input-file


lexi.lambda
2018-5-8 15:30:31

yes, that’s all I really meant by “it would be useful in general to be able to export functions with keywords from the expander layer”, but in retrospect, I don’t think that was the best phrasing


leif
2018-5-8 17:54:33

@ryanc Poke?


ben
2018-5-8 19:40:50

is it possible to set environment variables for the package server builds? I want to see some log events, so I want to set PLTSTDERR


pavpanchekha
2018-5-8 22:23:57

Is there any way to handle VM out of memory conditions in Racket?


pavpanchekha
2018-5-8 22:24:25

I sometimes hit these for big computations, and I’d like to “catch” the error and terminate that computation, instead of terminating the whole program.


pavpanchekha
2018-5-8 22:24:42

Or should I do everything inside custodians with memory limits?


greg
2018-5-9 00:13:21

@pavpanchekha Maybe someone will have better advice for you later, but: I think yes I’d try using custodian-limit-memory. Do note the caveats in the docs. The limit is checked only when a GC is done. You may exceed the limit; the limit might need to be much less than actual available memory. https://docs.racket-lang.org/reference/custodians.html#%28def._%28%28quote._~23~25kernel%29._custodian-limit-memory%29%29


greg
2018-5-9 00:14:33

Also FYI racket/sandbox provides call-with-limits and with-limits. The memory limit aspect of these is implemented using custodian-limit-memory. But, they might be simpler one-liner wrappers you could try first.


greg
2018-5-9 00:17:17

(As a mitigation for the memory limit being checked only during GC, I suppose you could try calling collect-garbage manually at “suitable intervals”, but that’s a bit hacky and idk if it would actually help much.)