You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Racket Users
Hi,
I am slowly getting the hang of linklets and I am playing with them in
my spare free time.
As far as I understand the current way to obtain linklets is to use
bootstrap-run.rkt in racket/src/expander.
I wrote a simple interactive program split into two modules:
factorial-input.rkt:
#lang racket/base
(require "factorial.rkt")
(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)]))
factorial.rkt:
#lang racket/base
(provide factorial)
(define (factorial n)
(if (= n 1)
1
(* n (factorial (- n 1)))))
Now I would like to compile the whole thing into linklets, so I try from
today's master branch HEAD:
racket/src/expander $ racket bootstrap-run.rkt --linklets -s -o
factorial-input.ll.rkt -t
/home/pmatos/Projects/redjacket/examples/factorial-input.rkt
First thing that tripped me up was that the output went to the terminal
instead of the file factorial-input.ll.rkt.
However, the biggest concern I had was that even though one of the lines
in the terminal says:
compile: /home/pmatos/Projects/redjacket/examples/factorial.rkt
This linklet does not contain the definition of factorial. This is
probably my bad assumption but I thought I would get a linklet directory
with everything in the original application. Is there a current way to
do this?
Or the solution is to go manually through the requires in the original
source and run the linklet extraction for each of them?