pocmatos
2018-9-20 11:28:44

As a followup to this I opened issue 2278 because of a difference between dynamic-place behaviour when ran through racket and when embedded. https://github.com/racket/racket/issues/2278


pocmatos
2018-9-20 11:29:13

Do you know of a workaround for this? I am walking towards a deadline for a delivery and would be great if I can jump this hurdle.


mflatt
2018-9-20 12:59:09

I don’t support you’re building your own Racket build? In that case, you could hack around this limitation by making is_predefined_module_path in “place.c” always return 1.


mflatt
2018-9-20 13:00:24

Otherwise, the only idea I have is to shift everything to collection-based paths. That is, instead of using a file relative path in define-module-path-index, use a path that refers to the module through a collection name.


mflatt
2018-9-20 13:00:42

I might be able to look into the problems and potential improvements in another day or two.


philip.mcgrath
2018-9-20 16:21:07

Does anyone have experience with a (free-as-in-beer) CI for Racket packages that includes Windows builds? (e.g. AppVeyor, Azure Pipelines, maybe Bitbucket pipelines) I’ve used Travis a bit via @greg’s great template, but, especially since I am really not a Windows person, I would love to set up similar testing to check for Windows-specific issues.


samth
2018-9-20 16:26:52

@philip.mcgrath I wrote the AppVeyor code, so I can maybe answer questions about that


philip.mcgrath
2018-9-20 16:31:48

@samth Do you mean the one for Racket itself? I’ve seen that, and the fact that it is basically understandable gives me hope that this is in reach. The part I’m least sure of it that I believe https://github.com/racket/racket/blob/master/appveyor.yml compiles Racket from scratch, whereas I assume it would be better for a package to do something more like https://github.com/greghendershott/travis-racket/blob/master/install-racket.sh and install a pre-built Racket—but I’m not really clear how you would do that on Windows.


samth
2018-9-20 16:32:46

yes, that’s right, and I agree that you need to run the installer from the command line, and unfortunately I don’t have any more knowledge offhand of how to do that


yasserhussain1110
2018-9-20 17:01:39

@yasserhussain1110 has joined the channel


ryanc
2018-9-20 18:25:16

@samth @philip.mcgrath there are builds of “Minimal Racket” on Windows packaged as tarballs instead of installers; just unpack and run. They’re available for the release versions (click the “More Variants and Checksums” link) and from the Utah nightly builds.


pavpanchekha
2018-9-20 19:08:12

What are good ways to diagnose slow startup time for Racket projects? Herbie takes ~12s to start up on my machine, which seems far too slow.


pavpanchekha
2018-9-20 19:08:42

(Plus, in the REPL with xrepl, it sometimes seems to loop forever instead of loading a module at all, which ideally I’d also like to fix.)


samth
2018-9-20 19:23:33

@pavpanchekha Is that with everything pre-compiled to zo files?


pavpanchekha
2018-9-20 19:23:41

No, without pre-compilatino


pavpanchekha
2018-9-20 19:23:53

It is faster, of course, with pre-compilation, but still slow


samth
2018-9-20 19:24:01

Then I would just say “run raco make first”


pavpanchekha
2018-9-20 19:24:20

On a personal level, pre-compilation is a pain because it makes developing on multiple machines difficult (different Racket versions)


pavpanchekha
2018-9-20 19:24:34

So far I have preferred waiting out the startup time than pre-compiling


samth
2018-9-20 19:24:50

as in you have a shared home directory and multiple racket installs?


pavpanchekha
2018-9-20 19:24:55

Yes


pavpanchekha
2018-9-20 19:25:05

It also makes Geiser in Emacs unhappy for reasons I do not understand…


samth
2018-9-20 19:25:16

this may not seem like the most helpful answer, but I would just not do that


samth
2018-9-20 19:25:57

but in terms of profiling, here are two ideas:


samth
2018-9-20 19:26:22
  1. to profile macro expansion, do (profile (dynamic-require "herbie.rkt" #f))

pavpanchekha
2018-9-20 19:26:32

Good idea!


samth
2018-9-20 19:27:30
  1. to measure startup time after compilation you can do the same thing

samth
2018-9-20 19:27:49

but that won’t help that much if most of the time is spent actually loading code


samth
2018-9-20 19:28:07

in that case, I’d roughly add logging in each file so you see when it’s run


samth
2018-9-20 19:28:12

and at what timestamp


pavpanchekha
2018-9-20 19:28:19

(For reference, startup with compiled everything is ~10× faster)


pavpanchekha
2018-9-20 19:32:25

For #1, I do get a profile, is there anything in particular in it I should be looking for?


pavpanchekha
2018-9-20 19:32:48

I don’t see anything that I recognize as my code with more than 1% of runtime spent there…


lexi.lambda
2018-9-20 19:34:04

Re: a shared home directory with multiple Racket installs, if you set PLTCOMPILEDROOTS to compiled/@(version):, then Racket will store bytecode for different versions of Racket in separate directories, which allows them to coexist.


pavpanchekha
2018-9-20 19:34:23

Huh


lexi.lambda
2018-9-20 19:34:24

I’m not entirely clear why this isn’t the default.


pavpanchekha
2018-9-20 19:34:52

I suppose a slight tweak can also make those directories hidden


greg
2018-9-20 19:54:28

Oh wow I never knew that. Now I’m curious, may the value of PLTCOMPILEDROOTS be any valid at-expression, or just this special syntax? Are there other env vars like this?



greg
2018-9-20 20:00:11

Thanks! I did actually rtfm after I typed that. :slightly_smiling_face: I guess I was also jumping ahead to wondering if a little wrapper around getenv that handled at-expressions would be a clever or terrible idea for some things I’m doing.


samth
2018-9-20 20:06:44

@pavpanchekha can you paste the profile output?


pavpanchekha
2018-9-20 20:07:12

samth
2018-9-20 20:14:39

@pavpanchekha is that with or without precompilaiton?


pavpanchekha
2018-9-20 20:14:49

Without


samth
2018-9-20 20:23:07

that mostly just looks like general macro expansion


samth
2018-9-20 20:23:33

does herbie have any macros that take a long time or do a lot of work?


pavpanchekha
2018-9-20 20:24:09

We barely use macros, and I think all of ours are define-syntax-rule, so don’t do significant computation


samth
2018-9-20 20:25:44

ok so then it’s pretty surprising that it takes so long to compile


pavpanchekha
2018-9-20 20:26:08

@samth Inspired by your second suggestion, I’ve also made a little file that dynamic-requires every Herbie file, in dependency order, and records how long that takes. It seems to be pretty flat, though the racket and math/flonum libraries also take a significant time.


pavpanchekha
2018-9-20 20:26:56

If I pre-compile, then it’s only a few libraries that take time, the two above being the major ones


samth
2018-9-20 20:28:09

loading racket should be very fast


samth
2018-9-20 20:28:13

so that surprises me


pavpanchekha
2018-9-20 20:30:30

~400ms


pavpanchekha
2018-9-20 20:32:03

More precisely, executing the following:


pavpanchekha
2018-9-20 20:32:06

(define t (current-inexact-milliseconds))
(dynamic-require 'racket #f)
(display (number->string (- (current-inexact-milliseconds) t)))
(newline)

pavpanchekha
2018-9-20 20:32:37

Outputs a 200–400ms


samth
2018-9-20 20:33:21

so for me time r -l math/flonum -l racket -e 1 is consistently about 1.2 sec


pavpanchekha
2018-9-20 20:34:24

Yeah, that’s about right for me as well


pavpanchekha
2018-9-20 20:34:37

That explains the ~1.5s startup time with Herbie precompiled, then


samth
2018-9-20 20:43:04

do you need full racket, as compared to racket/base + some specific libraries?


pavpanchekha
2018-9-20 20:43:40

A few years back I did try to convert to racket/base, but I found that we use a pretty significant chunk of it


pavpanchekha
2018-9-20 20:51:57

I should also note that some of the more expensive libraries we use (like plot and web stuff) is hidden behind a lazy-require, so isn’t part of these numbers, but substantially slows down startup if invoked


shu--hung
2018-9-20 20:52:37

In scribble/base, is it safe to (require (only-in scribble/manual codeblock)?


abmclin
2018-9-20 20:56:04

@mflatt hi again, while I was developing the test cases for the above issue, I noticed other problems I thought I should bring to your attention, though I think best to email you instead. Ok to use your http://utah.edu\|utah.edu address or is there another email address you prefer me to use instead?


mflatt
2018-9-20 20:57:05

That’s the best address


abmclin
2018-9-20 20:58:32

ok


kykim
2018-9-20 23:00:32

@kykim has joined the channel


jacob.d.mitchell
2018-9-20 23:49:53

Racket could use more mentors and maintainers at http://exercism.io\|exercism.io. For anyone who isn’t familiar, Exercism has small programming exercises with a focus on incremental improvement through community feedback.

Since the newest version of the site recently launched there’s a core sequence of several exercises which, at least starting out, require feedback from a language-specific mentor to progress. I and perhaps many others are currently blocked on the core track. Efforts like this could help people ramp up with Racket more productively and reinforce idioms. If there are alternative ways for hobbyists to get this sort of feedback outside the classroom setting I’d love to hear about it. After using Racket more and hopefully getting feedback on my code I will consider becoming a mentor on Exercism.

Relevant links: - https://exercism.io/about - https://exercism.io/tracks/racket - http://mentoring.exercism.io - https://exercism.io/become-a-maintainer


greg
2018-9-21 01:11:36

@jacob.d.mitchell Is the relaunch related to Exercism becoming part of the “portfolio” of Thalumus? https://thalamus.ai/portfolio The other companies seem to be teaming up with “experts” to do “AI”. Exercism seems different… or is it?


jacob.d.mitchell
2018-9-21 01:23:15

Good question, @greg. This is the first I’ve heard of Thalamus.

Concrete motivations and design decisions for the new version of the site are described at https://exercism.io/about-v1-to-v2. It provides more context on the mentor situation as well. In v1 everyone could mentor on any exercises for which they already submitted a solution, but now they’re ensuring core track feedback comes from those who explicitly want to mentor.


jacob.d.mitchell
2018-9-21 01:37:31

The Racket exercise repo is at https://github.com/exercism/racket


notjack
2018-9-21 03:02:01

@pavpanchekha For speeding up compile times across multiple machines, you can configure raco pkg to download precompiled bytecode from the package build server so you don’t have to recompile packages you depend on, and you can skip installing build dependency packages entirely. See the --binary and --binary-lib flags to raco pkg install, as well as the Built-Package Catalog section of https://pkg-build.racket-lang.org/about.html


pavpanchekha
2018-9-21 03:10:02

Thanks, @notjack. By the way, will you be at RacketCon?


notjack
2018-9-21 03:10:19

yup!