

Last update was 7.0 release

Technically I run it, but I’m unsure there’s much point

I’m looking at using social media tools to automate updates to fb,Twitter, reddit, etc. because they turn up in search results and a presence that is stale might be worse than no presence at all. The point is to minimise the effort needed to get things like new packages, racket-announce & Racket News posted on relevant platforms. I’m also interested in directing people to racket-users.

also; who runs racket-announce ? https://lists.racket-lang.org/announce/archive/

last update was 7.2

You should tell @jbclements about that — probably he needs to send email there


Ok, finally did this. Here’s the most accessed parameters (with counts) for running a compiled empty module written in '#%kernel
: 4 ""parameter-cell name: current-logger
4 ""parameter-cell name: current-module-declare-name
4 ""parameter-cell name: load-on-demand-enabled
4 ""parameter-cell name: read-cdot
7 ""parameter-cell name: current-environment-variables
8 ""parameter-cell name: current-readtable
14 ""parameter-cell name: current-directory
17 ""parameter-cell name: current-custodian
17 ""parameter-cell name: current-namespace
22 ""parameter-cell name: print-graph
23 ""parameter-cell name: read-case-sensitive
28 ""parameter-cell name: current-code-inspector
38 ""parameter-cell name: port-count-lines-enabled
43 ""parameter-cell name: current-security-guard
57 ""parameter-cell name: current-module-name-resolver
71 ""parameter-cell name: current-locale
278 ""parameter-cell name: current-inspector

More interesting, perhaps, this is the results for racketcs -l racket/notexist
: 16 ""parameter-cell name: current-custodian
21 ""parameter-cell name: current-compiled-file-roots
21 ""parameter-cell name: use-compiled-file-paths
23 ""parameter-cell name: current-code-inspector
23 ""parameter-cell name: print-graph
23 ""parameter-cell name: read-case-sensitive
34 ""parameter-cell name: port-count-lines-enabled
54 ""parameter-cell name: current-module-name-resolver
278 ""parameter-cell name: current-inspector
316 ""parameter-cell name: current-directory
1007 ""parameter-cell name: current-security-guard
1261 ""parameter-cell name: current-locale

To put that in context, accessing current-locale
100,000 times in the Racket CS REPL now takes 5ms on my machine (same as traditional Racket). That’s down from 9–10ms in v7.4 CS.

Right, those parameter accesses are unlikely to directly be a big time sink, but I’m suspicious about why they’re called so often

Any time a string is converted to a path, then current-locale
is relevant. And any time a directory is listed or the existence of a file is tested, current-security-guard
will be used.

What are the largest racket codebases? Outside of stuff like racket itself and DrRacket

Interesting question.

We could download the 7,230 repos on github and “measure”

limiting it to >5kb repos gives me 248 repos

whalesong is pretty large

Does TypedRacket count?

Also Pycket?


Let’s say that stuff under the racket GitHub org doesn’t count but anything else does

mbp:metapict soegaard$ find . -type f -name "*.rkt" -print0 \| xargs -0 cat \| wc -l
18650

77023

wow Whalesong is pretty big

It contains large part of racket.

What if we just count left [
(
{
?

what should put between xargs -0 cat
and wc -l
to filter anything but [({
?

some sort of sed rule?

https://github.com/AlDanial/cloc is pretty good at counting Racket code so you could use that.

for example:
$ cloc matchacha matchacha-tests [0/264]
179 text files.
179 unique files.
90 files ignored.
<http://github.com/AlDanial/cloc\|github.com/AlDanial/cloc> v 1.82 T=0.15 s (611.4 files/s, 88150.6 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Racket 89 1996 142 10694
-------------------------------------------------------------------------------
SUM: 89 1996 142 10694
-------------------------------------------------------------------------------

mbp:GitHub soegaard$ ~/tmp/cloc/cloc whalesong
1131 text files.
1074 unique files.
566 files ignored.
<http://github.com/AlDanial/cloc\|github.com/AlDanial/cloc> v 1.84 T=2.29 s (247.2 files/s, 88154.2 lines/s)
--------------------------------------------------------------------------------
Language files blank comment code
--------------------------------------------------------------------------------
JavaScript 84 20713 7489 92356
Racket 439 12526 5311 61127
XHTML 1 231 0 1191
HTML 30 97 10 752
Scheme 1 40 7 71
CSS 5 13 0 61
Bourne Again Shell 2 8 8 26
make 2 18 17 22
Markdown 1 5 0 22
Bourne Shell 1 8 1 22
C 1 3 0 16
--------------------------------------------------------------------------------
SUM: 567 33662 12843 155666
--------------------------------------------------------------------------------

honestly it’s fine with me if we don’t even bother to omit whitespace-only lines, it’s not like more precise line counting is going to make more than a factor-of–2-or–3 difference

average lines per file would be interesting to know too though

find . -type f -name "*.rkt" -print0 \| xargs -0 cat \| racket count-parens.rkt

count-parens.rkt
#lang racket/base
(for/sum ([line (in-lines)])
(length (regexp-match* #px"([[{(])" line)))


The last bit removes blank lines.

Oh I was counting all of the left brackets not just lines with code.

In Redex I’m having trouble defining a match-like term in a language. I want to be able to include terms like (match l ((null) 0) ((cons a d) (+ a (sum d))))
.

I’ve been using the pattern (match e ((c_!_ x_!_ ...) e) ...)
.

But I don’t know how to specify the uniqueness of constructors and variables. I want each c_!_
to be unique in the entire match term, but I only need the x_!_
es to be unique inside this specific clauses/row/case.


Hmm. The package gregor-lib depends on racket-doc. On purpose?

The info files contains (define deps '("base"
"data-lib"
"memoize"
"parser-tools-lib"
"tzinfo"
"cldr-core"
"cldr-bcp47"
"cldr-numbers-modern"
"cldr-dates-modern"
"cldr-localenames-modern"))
(define build-deps '("racket-doc" "scribble-lib"))

is there a way to get raco pkg install gregor-lib
to ignore the build-deps ?

@soegaard2 that sounds like a mistake

gregor-doc
should depend on those, but not gregor-lib
, I think

Phew.

I am working on getting my small web-tutorial up and running on a real server.

Maybe it is due to memoize.

It has (define deps (list "base"
"rackunit-lib"))
(define build-deps (list "scribble-lib"
"racket-doc"))

Maybe, but that shouldn’t require gregor-lib
to declare these as build deps, I don’t think. (Doesn’t change the fact that they are build deps.)

I might be doing this the wrong way (installing the packages on the web server). Should I build on my development machine instead?

I think it is because memoize
is a deps
for gregor-lib
(and thus the build-deps for memoize become deps
for gregor-lib
.

But I am not sure I am looking at it the right way.

I don’t know — but you can install packages with raco pkg install --binary

Ooh!

Actually, I think you want --binary-lib
to skip docs

It’s just that memoize isn’t split into lib and docs. So it must count as a lib. And since it depends on racket-doc and scribble, it suddenly blows up.

and racket-doc depends on drracket …

ouch

I suddenly realize I need to split MetaPict up.

I could probably pretty easily remove the dependency on memoize
but other dependencies are also not split.

It seems odd that racket-doc
would depend on drracket
.

The memoize stuff is in a single file: https://github.com/jbclements/memoize/blob/master/memoize/main.rkt

But I guess the Right Thing is to split memoize.

Sure, but you’ll get the same problem again with, e.g., tzinfo
.

Ah.

Unless all dependencies are split, you get the same problem.

So I need to look into building it on my own machine and then upload the already built code.

Does --binary-lib
really not work? The docs make it sound like it should, but I’ve never actually used it before.

Didn’t try it. I understood to work like this: Build everything as normal, then strip the build stuff.

Oh, you’re probably right. I was thinking that stuff was stripped prior to building, but that doesn’t seem likely.

I bet I am missing something.


Maybe I need to make a built
package.

@jeapostrophe Is there a way to get make-id-cookie
to make a “SameSite” cookie? https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-5.3.7

Is the split between PACKAGE, PACKAGE-lib, PACKAGE-doc, and PACKAGE-test documented?


Which incidentally also mentions the package-build service.

So I think I could use --binary-lib
as @jaz advocated with the --catalog
option like this: raco pkg install --binary-lib --catalog <https://pkg-build.racket-lang.org/server/built/catalog/> gregor

@soegaard2 yup you can combine --binary-lib
with --catalog
to install packages such that you download built bytecode / compiled files only and skip everything else, which lets you skip downloading and installing the build-deps of any package

This is one of the reasons I think we should stop splitting packages. Or at least, stop splitting them by default.

There’s usability challenges though. The fact that downloading bytecode from the package catalog is a thing that doesn’t happen by default, for example. And it only works if you have the same racket version as the catalog built them with, which is whatever the latest released Racket is. And if either of those things goes wrong it’s hard to tell or it breaks completely so your CI scripts become super fragile.

@notjack Good points.

@notjack AcrtivityLog2 is not small either: alexh@ALEX-S2 ~/Projects/ActivityLog2 (enhanced-fields)
$ perl ../cloc-1.82.pl .
363 text files.
361 unique files.
180 files ignored.
<http://github.com/AlDanial/cloc\|github.com/AlDanial/cloc> v 1.82 T=1.14 s (191.5 files/s, 56073.9 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Racket 155 7036 8962 41600
Markdown 18 560 0 1848
SQL 33 296 813 1357
JSON 2 0 0 571
Bourne Shell 4 45 40 208
YAML 2 56 60 156
PowerShell 2 25 19 80
awk 1 10 17 39
Lisp 1 0 0 25
-------------------------------------------------------------------------------
SUM: 218 8028 9911 45884
-------------------------------------------------------------------------------

@notjack @soegaard2 ~I don’t see that combination documented in any way.~

--catalog ‹catalog› — Uses ‹catalog› instead of of the currently configured package catalogs.

~Doesn’t even suggest that it will have different effects when combined with other options.~

Ah — ok, I see that this is actually a different package catalog than the default one, so it’s not the combination of arguments; it’s the fact that this non-default catalog provides built packages.

These do seem like reasons to keep splitting up packages.

Having any docs build-dep chain up to DrRacket seems to be some of the root badness though?

Seems like a good RFC for Racket2.

@jaz Exactly. Personally I think the default catalog should just provide this, at the very least on a best-effort basis. And there should be some way for me to get raco pkg to operate in the mode of “use the catalog’s bytecode / prerendered docs if they’re available, otherwise build it yourself and don’t complain”. That way this would operate much more like a transparent cache rather than this weird finicky alternate config that you have to lock yourself into in various ways.

These are definitely good reasons to keep splitting them up today, if you need to fix dependency graph problems in the short term. I don’t think they’re good reasons to split them up long term, or to prematurely split them up until an actual user of your package complains.

And yeah, every scribble user getting a transitive dep on DrRacket and a bajillion other things is probably something that everyone can agree is terrible.

@spdegabrielle Many thanks, totally mea culpa. My inclination at this point would be to pick this up again with the 7.5 release; I think that sending mail to the announce list at this point would just cause confusion.

Is there a email thread/issue on removing that dependency and what it would take?

I’ve been defensively splitting up packages that I’ve procrastinated publishing for a long time :disappointed:


I’m not clear on who is volunteering to change things, but in case it helps: The package system’s implementation is “racket/collects/pkg”, the pkg-build sever is implemented in the “pkg-build” package, and the distribution-build system is the “distro-build” package.

@notjack multisets in Rebellion don’t have a remove operation?

@mflatt nobody is yet, but it’s nice to have the option to turn my grumbling into actual action. Thanks for the info :simple_smile:

@samdphillips They don’t, but only because I haven’t needed one yet. Open an issue to remind me!

@samdphillips With for loops and reducers, usually I use collections in a way that doesn’t tend to benefit from add / remove / edit operations like that. Instead I end up building the collection with a reducer and afterwards I only query it. This is also usually a way more performant usage pattern for most data structures, including persistent ones.

That’s the only tracking issue for this kind of thing that I know of

I just decided to stop splitting them entirely

Currently no (except a hack, below). To support it, you would first need to add them to net/cookies/server
’s representation of cookies. I think I’d looked at this but wasn’t sure about moving forward while the standard is still a draft. If you need it now, you can use cookie->set-cookie-header
or cookie->string
and add the “SameSite” stuff to the string or bytes directly.


Save you some work :stuck_out_tongue:

@samth As I look at it further, I think the only reason Syntax-E
isn’t a subtype of Datum
is because of mutable boxes and vectors. But I think datum->syntax
given a Syntax-E
will always produce Syntax
, and the type of datum->syntax
could be extended to reflect that.

@samdphillips Thank you so much!

@soegaard2 You can pass in the SameSite option via the #:extension
kwarg.
An example: