laurent.orseau
2021-1-24 12:49:11

Woah, that’s a very nice effort!



spdegabrielle
2021-1-24 16:54:47

“With the upcoming version 8.0 release, Racket on Chez Scheme (Racket CS) will become the default implementation of Racket.” Congratulations and thank you for the immense amount of work this has been. I can’t even comprehend it.


mflatt
2021-1-24 17:04:33

Thanks!


laurent.orseau
2021-1-24 17:20:14

“throwing out around 200k lines of C code to replace it with around 150k lines of Scheme and Racket code.” That’s not really news, but still, woah!


laurent.orseau
2021-1-24 17:27:02

Echoing Stephen, probably only few people ever write a project of 100k+ lines of code, so performing such a huge transformation while maintaining almost perfect backward compatibility is an amazing accomplishment that I can only applaud. Congrats Racket team!


laurent.orseau
2021-1-24 17:57:16

glad to see that compose is now so much faster!


laurent.orseau
2021-1-24 18:07:24

what’s the actual name of the first-s...t-loop test? (the slowest CS vs BC) Couldn’t find it by looking at the filenames


sorawee
2021-1-24 18:14:01

It’s first-some/prompt-loop, I believe



laurent.orseau
2021-1-24 18:15:41

How did you find it? Search in github returns not a single it for “first-some/prompt-loop”


laurent.orseau
2021-1-24 18:15:47

Also, thanks!


sorawee
2021-1-24 18:16:38

Regex in Emacs :slightly_smiling_face:


laurent.orseau
2021-1-24 18:16:55

of course :slightly_smiling_face:


laurent.orseau
2021-1-24 18:27:25

It’s pretty impressive that there’s only 1 benchmark where CS is slower by more than a factor 2


greg
2021-1-24 20:06:40

I was about to open an issue that, at least in e.g. Racket 7.8 CS, continuation-mark-set->context would return full paths until you do a raco make and then it would return .../ prefixed truncated paths. But I double-checked and it looks like this is fixed in 8.0.0.3. Nice!


greg
2021-1-24 20:10:01

I hate to put stickers on my laptop, and in these quarantine days, who even would see it? But I’m tempted to add a big “I :heart: COMPLETE PATHS” sticker as a result of working on things for Racket Mode. :wink:


apompa
2021-1-24 20:36:56

@apompa has joined the channel



soegaard2
2021-1-24 20:46:00

8.* that just looks wrong :slightly_smiling_face:


sorawee
2021-1-24 20:54:21

Thailand uses the Buddhist calendar. But I haven’t used it for so long that I got it off by two years. That is, I thought 2021 is still 2019.


soegaard2
2021-1-24 20:54:48

:slightly_smiling_face:


samth
2021-1-24 20:57:29

I noticed that the first email from Matthew about Chez is dated January 27, almost exactly 4 years ago


notjack
2021-1-25 02:04:53

it has been 0 days since I had an extremely confusing bug in a syntax-parse macro that was caused by writing #:with (id …) #'some-id


kellysmith12.21
2021-1-25 02:49:37

Is there a standard procedure or form for taking a sequence (or just a list) and splitting it into several sequences (or lists), using only one traversal?


capfredf
2021-1-25 02:52:13

group-by?


kellysmith12.21
2021-1-25 02:57:45

Hm, that might be what I’m looking for, though I’m not sure how I’d express what I’m doing.

What I’m trying to do is turn (listof (or/c A B C)) into (listof A), (listof B), (listof C).


greg
2021-1-25 03:17:44

If you’re using match to destructure the first thing into a list like '(a b c), you could use app to make each one be (listof a) as each one is matched. I think that counts as one traversal.


greg
2021-1-25 03:18:41

e.g. #lang racket/base (require racket/match racket/function) (match '(listof (or/c a b c)) [`(listof (or/c ,(app (λ (v) (list 'listof v)) xs) ...)) xs])


kellysmith12.21
2021-1-25 03:19:29

Oh, sorry, when I said (listof (or/c a b c)), I was talking about the type/contract of the sequence.


capfredf
2021-1-25 03:40:02

@kellysmith12.21 (define li (list 'a 1 "3" 'b 2 "4")) (group-by (lambda (arg) (cond [(number? arg) 1] [(string? arg) 2] [(symbol? arg) 3] [else (error 'test "you are drunk ~a ~n" arg)])) li) # '((a b) (1 2) ("3" "4"))


kellysmith12.21
2021-1-25 03:41:06

@capfredf Ah, now I see. Thank-you!


capfredf
2021-1-25 03:46:54

@greg, a quick question about customizing indentation in Racket-mode. How can I make the indentation for typed lambda forms be the same as untyped ones? (lambda ([arg : Number]) : Number 10) ;;; (lambda (arg) 10)


greg
2021-1-25 03:50:03

Although I haven’t looked at that in N years, I recall adding cases for common Typed Racket forms like define and let. It’s possible that I just overlooked lambda. Let me check….


greg
2021-1-25 03:54:25

@capfredf Yes there’s just no attempt yet to handle that. I can take a look tomorrow.


capfredf
2021-1-25 03:55:19

Thank you!


greg
2021-1-25 04:00:57

@capfredf My brain isn’t in indentation-mode right now, but I’m not sure why lambda can’t just use the same indent as define. (I might just be forgetting edge cases.)

You could try that if you want. e.g. (put 'lambda 'racket-indent-line 'defun) as described here https://www.racket-mode.com/#racket_002dindent_002dline


greg
2021-1-25 04:01:50

Derp. No that doesn’t work. I will look at it tomorrow with a fresher brain.


capfredf
2021-1-25 04:16:58

you might want to look at for/fold if you know how many lists you want to produce statically. @kellysmith12.21


notjack
2021-1-25 04:42:28

In the process of developing resyntax and running it on old scheme-y code, I occasionally encounter uses of let that are… frustrating (let ([a (assq id (let ([a (assoc export-phase exports)]) (if a (cdr a) null)))]) Please. Other variable names exist. I’m begging you.


kellysmith12.21
2021-1-25 04:44:58

That entire snippet is rather obtuse.


notjack
2021-1-25 04:58:33

notjack
2021-1-25 06:32:28

behold! the first cleanup PR! https://github.com/racket/scribble/pull/289


sorawee
2021-1-25 06:33:20

Can we change caddddddddddr to stuff like first, second, … too? Note that you might need to require racket/list


notjack
2021-1-25 06:33:51

Unfortunately not safely, because I think cxxxxr and friends work on pairs but first, second, etc. need proper lists


sorawee
2021-1-25 06:33:59

yes


sorawee
2021-1-25 06:37:16

Wow, there’s (let ([queue (cdr queue)]) ...) left. Does resyntax analyze that it cannot convert this let?


sorawee
2021-1-25 06:39:17

Also, comment placement looks difficult to solve. What’s the policy?


sorawee
2021-1-25 06:41:40

Looking at:

;; abc (if … ;; def … ;; ghi …) being rewritten to:

(cond ;; abc [... ;; def ...] [else ;; ghi ...])


notjack
2021-1-25 06:44:40

Comment placement was manual, I did that myself after resyntax obliterated a bunch of comments.


notjack
2021-1-25 06:45:00

Resyntax does analyze let forms to leave behind those that can’t be turned into definitions.



sorawee
2021-1-25 06:49:37

I should have read your commit message. It answers a lot of my questions already…


notjack
2021-1-25 06:50:21

on the plus side it made me double check that I answered that in the commit message :p


kellysmith12.21
2021-1-25 07:47:49

Since first & al. require a proper list, perhaps instead there could be a rule to transform caddddr and friends into list-ref and list-tail, which only require a pair.


notjack
2021-1-25 07:52:41

What if instead there were rules to look for cases where it’s provable that they’re proper? For instance I see some of this: (list (car xs) (cadr xs) (list-ref xs 2) ...)


kellysmith12.21
2021-1-25 07:54:07

Wouldn’t proving that a list is proper require static contract verification?


notjack
2021-1-25 07:54:41

In the general case yes, but resyntax doesn’t need to deal with general cases. Just specific cases that occur commonly in real code.


kellysmith12.21
2021-1-25 07:56:08

If there are some common cases where it’s trivially proven that a list is proper, then I’d say go ahead and add handling for them.