
In which Racket is 16x (or maybe 149x) faster than it was in 2004: https://gist.github.com/samth/2f0996c80ef7e81f8e0aaba32fd7aaf1

I think that is worthy of a Racket News submission @pocmatos

I did that already

Thanks for the ping on this… Just preparing today’s issue!

I was curious to confirm where the improvements happened for this program. The JIT in v350 (measured with v352 on Linux i386, release 2006) was responsible for 2.3x improvement, and then flonum unboxing in 4.2.4 (measured with v4.2.5, released 2010) was the remaining 8x improvement. That version is also able to deal with the modern implementation with the same improvement, but not the futures version. The futures version worked with improvement by v5.3 (released 2012) and probably earlier.

so 4.2.4 performs the same as 8.0 for you?

Close, at least. I didn’t measure precisely. For one thing, I was comparing old 32-bit runs to new 64-bit runs.

striking that 10 years of compiler change and the switch to CS didn’t change it much

True, but this benchmark is about unboxed floating-point arithmetic. The pattern would be different for different kinds of programs.

@a73cram5ay has joined the channel

Experienced Slack user but relatively new to Racket and newbie on this workspace:
What’s the protocol for asking a question? Just post it here? Thanks …

dont think there is one, just fire away here!

Cool.
I’m trying to this:
(load file)
where file is the fully-qualified path to a file that I’ve confirmed exists (with file-exists?), and I’m getting this:
equality.spec.rkt:1:6: #%top-interaction: unbound identifier;
When I open the file in DrRacket and Run it, it works just fine. The file looks like this:
#lang racket
... some requires ...
... some top-level forms (function calls), no definitions ...
When I run it in DrRacket, the forms just execute as I expect, but I can’t load this file. I want to accomplish the same thing programmatically, i.e., run this file.
What am I missing? Thanks!

Use dynamic-require
to load a module dynamically.
The reason load
fails is that it evaluates (usually individual expressions) in the current namespace, and the default namespace is empty.

@temurson047 has joined the channel

@biogoog has joined the channel

Bingo! Many thanks.
On a related note (perhaps), when you press the Run button in DrRacket, what operation is it performing on the file that is open/active?

That’s a dynamic-require
combined with module->namespace
to get a namespace for eval
ing interactive expressions.

I love the line: > I brought up monads above, so it’s a good idea to talk a little about them since they are the pure-functional way of gaining effects. Having written a Ph. D. thesis about them, I think I have some idea about them. :)

:thumbsup:

@jbclements do you mean to pick https://github.com/racket/racket/commit/a5b14d74b7f75e2386dd845413d2ac81c89e6c80 to the release branch as well?

how would I make a struct from a list of values ?

e.g (list 1 2) -> (point 1 2)
?

(apply point (list 1 2))

Just in case I’m duplicating work - I’ve got an implementation for TOTP/HOTP as defined by the IETF RFC’s https://github.com/yilinwei/racket-otp; does this already exist somewhere?

Otherwise I’ll add docs etc…

I don’t know of one

That’s very useful to me for something I happen to be doing, thanks!

i keep forgetting about apply lol…

made a neat thing (define into-average
(reducer-zip / into-sum into-count))
> (transduce (list 1 2 3 4 5) #:into into-average)
3

is that one pass or two?

Single pass