synth
2019-7-2 07:25:18

Hey, is there a scheduling/cron library for recurring tasks in Racket? I can’t find anything except for “deferred” which supports one-off tasks only


synth
2019-7-2 12:26:53

okay nevermind, cron-like behaviour can be achieved by pre-scheduling deferred calls a bit… :slightly_smiling_face:


samth
2019-7-2 15:03:26

@pocmatos I think your issue with linklets is based on a confusion between the --linklets flag (create a bunch of linklets for a single file) and the -x flag (extract a file and all its dependencies into a single linklet)


pocmatos
2019-7-2 15:09:28

@samth ah! That’s probably it. I saw --expand as well but the --linklets flag was the one which sounded more like what I wanted. Thanks, I will give that a go!


samth
2019-7-2 15:10:33

The --linklets flag is (I think) mostly for understand what the expander does; the -x flag is useful for actually running the resulting program in specialized cases (as seen with bootstrapping the expander itself)


pocmatos
2019-7-2 15:33:40

@samth with -x, full command line: racket bootstrap-run.rkt -x -s -t /home/pmatos/Projects/redjacket/examples/factorial-input.rkt it seems to be actually running my file:


pocmatos
2019-7-2 15:34:01
...
compile: /home/pmatos/Projects/redjacket/examples/factorial.rkt
Enter a number:

pocmatos
2019-7-2 15:34:37

ok, [("-e" "--expand") "Expand instead of running"


pocmatos
2019-7-2 15:34:45

maybe expand is the solution…


pocmatos
2019-7-2 15:35:42

shame, this as expected only actually does syntax expansion instead of generating the linklets.


samth
2019-7-2 15:38:36

yes, I think it does run the file; I’m not sure why


samth
2019-7-2 15:38:57

the usual solution is the obvious one of not having top-level expressions that do things


pocmatos
2019-7-2 17:15:26

humm, that’s not good news. :disappointed:


samth
2019-7-2 17:22:00

@pocmatos what exactly do you plan to do with the linklet after extracting it?


samth
2019-7-2 17:22:15

most of the time, you can just take the exports and call one of them


pocmatos
2019-7-2 17:22:30

I want to parse it for analysis.


pocmatos
2019-7-2 17:22:39

what do you mean, take the exports?


samth
2019-7-2 17:24:09

if the linklet exports things, you can get those values and then call them


pocmatos
2019-7-2 17:26:30

the linklet in this case is just a program, it exports nothing. Still, if I change my example so that instead of having expression at top-level, I just have a submodule main like so: #lang racket/base (require "factorial.rkt") (module+ main (let loop () (printf "Enter a number: ") (define n (read)) (cond [(exact-positive-integer? n) (printf "~a! = ~a~n" n (factorial n))] [else (printf "Invalid value~n") (loop)])))


pocmatos
2019-7-2 17:26:37

This is what I get from:


pocmatos
2019-7-2 17:26:46

racket bootstrap-run.rkt -x -s -t /home/pmatos/Projects/redjacket/examples/factorial-input.rkt


pocmatos
2019-7-2 17:27:06
compile: /home/pmatos/Projects/redjacket/examples/factorial.rkt
Getting #<path:/home/pmatos/Projects/redjacket/examples/factorial-input.rkt> at 0
linklet-directory->hash: contract violation
  expected: linklet-directory?
  given: #7.3.0.12expDmainconfigure-runtimeR;?lmainp�X��configure-runtime�!1#7.3.0.12expB#hasheq((0 . #s((source-linklet linklet 0) (linklet ((.get-syntax-liter...
  context...:
   /home/pmatos/Projects/LT-racket/racket/collects/racket/private/check.rkt:82:9: linklet-directory->hash
   /home/pmatos/Projects/LT-racket/racket/src/expander/extract/module.rkt:21:0: get-compiled-module8
   /home/pmatos/Projects/LT-racket/racket/src/expander/extract/get-linklet.rkt:23:2: get-linklets!
   /home/pmatos/Projects/LT-racket/racket/src/expander/extract/main.rkt:28:0: extract25
   "/home/pmatos/Projects/LT-racket/racket/src/expander/run.rkt": [running body]
   temp37_0
   for-loop
   run-module-instance!125
   for-loop
   [repeats 1 more time]
   run-module-instance!125
   perform-require!78

pocmatos
2019-7-2 17:27:14

will probably open an issue for this one.


mflatt
2019-7-2 18:42:06

Looks like -x needs a cache directory specified by -c to work right. Also, you’ll need -o to get any output.


eeide
2019-7-2 20:43:11

Does your work combine Racket and low-level systems programming? Consider submitting a short paper about your work to the PLOS ’19 workshop! —

Call for Papers: PLOS ’19: 10th Workshop on Programming Languages and Operating Systems http://plos-workshop.org/2019/

Sponsored by ACM SIGOPS / In conjunction with SOSP Paper submission deadline: August 9, 2019 Workshop: October 27, 2019

Historically, operating system development and programming language development went hand-in-hand. Today, although the systems community at large retains an iron grip on C, many people continue to explore novel approaches to OS construction based on new programming language ideas.

This workshop will bring together researchers and developers from the programming language and operating system domains to discuss recent work at the intersection of these fields. It will be a platform for discussing new visions, challenges, experiences, problems, and solutions arising from the application of advanced programming and software engineering concepts to operating systems construction, and vice versa.

Please visit the website for more info: http://plos-workshop.org/2019/