[racket-users] Racket in a web page (via Whalesong)
Hi, Does anyone use Whalesong to script web pages? As far as I understand the Racket design, Whalesong is enough to bootstrap full Racket in a JS environment. It's a great opportunity. I would like very much to have an interactive lisp development where I can develop both server side and client side code, and to share code between client and server. I wish to connect to a web page JS environment interactively (like from SLIME I use for with Common Lisp) and control and modify my program without reloading the page. Javascript console in browsers is a substitution, but a poor-man's one, and it's only Javascript; it would be grate to have it for lisp. People are now inventing WebAssembly to simplify porting programmign languages to javascript. ClojureScript was just recently made self hosted. But Whalesong exists for years. Why no-one uses it? Is it not enough to bootstrap a Racket compiler? -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] Overriding sexp highlighting in drracket
On 2015-09-06 20:41:18 -0500, Robby Findler wrote: > Some suggestions about the method you linked to: > > - Don't create the brush inside on-paint (use the brush-list or stick > it in a field). > > - Don't assume that the width of "a" is the same as the other widths > (it isn't in common racket code, as the λ character tends to not be in > most people's fixed width font so substitution happens). Use > get-character. Thanks for the suggestions Robby (I hacked together the linked on-paint code). Also thanks Martin for looking into this. I hadn't had much luck fixing the highlighting myself. Cheers, Asumu -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] Overriding sexp highlighting in drracket
As far as I can tell, to get the highlighting to start in the position after (so to highlight "[x (foo bar)]" when the insertion point is before that quoted "]"), then you'd need to change the method I pointed you to. I guess it would make sense to add an overridable method that returns #f or a position and whose default value was: (define/public (match-paren-position) (define st (get-start-position)) (and (= st (get-end-position)) st)) then to bind "here" to calling that method and change the "when" to just check the result isn't #f and then to have VIM mode override it to, in the right cases, add 1 to the result. Some suggestions about the method you linked to: - Don't create the brush inside on-paint (use the brush-list or stick it in a field). - Don't assume that the width of "a" is the same as the other widths (it isn't in common racket code, as the λ character tends to not be in most people's fixed width font so substitution happens). Use get-character. Robby On Sun, Sep 6, 2015 at 8:28 PM, Martin DeMello wrote: > With some difficulty, as far as I can make out :) The code overrides > on-paint and draws its own cursor. The insertion point does not appear to be > changed; the cursor display is just changed from a line between char@pos and > char@pos+1 to a box covering char@pos+1 > > https://github.com/takikawa/drracket-vim-tool/blob/master/private/text.rkt#L213 > > On Sun, Sep 6, 2015 at 6:08 PM, Robby Findler > wrote: >> >> The highlighting you're interested in changing is the (by default) >> grey highlighting that moves around when you change the insertion >> point (when you use the arrow keys, say), right? >> >> If so, I think the code you're looking for is the match-parens private >> method in framework/private/color. You can see where it binds the >> variable "here" and you probably wish it were (+ here 1) in some >> cases, I guess? >> >> But the editor classes have the notion of insertion point wired pretty >> deeply into them, and that insertion point always sits between two >> characters. How does the vim mode change this behavior so that there >> is highlighting on a character instead of between them? >> >> Robby >> >> >> >> On Sun, Sep 6, 2015 at 7:20 PM, Martin DeMello >> wrote: >> > Let's say I have the following: >> > >> > (let ([x (foo bar)] ... ) >> > >> > In the regular drracket editor, when I move the cursor between the ) and >> > ] >> > it highlights (foo bar). In the vim emulator, the cursor has been >> > replaced >> > by a block that highlights a character, rather than a line just before >> > it. >> > So the same cursor position would display a box over the ] rather than a >> > line between ) and ], and therefore backward-sexp needs to match the [ >> > rather than the (. >> > >> > There is the following code in the vim editor to handle explicitly >> > hitting >> > %: >> > >> > ;; implements the behavior of "%" and friends in vim >> > (define/private (do-matching-paren action) >> > (define pos-box (box 0)) >> > (get-position pos-box) >> > (define pos (unbox pos-box)) >> > (define char (get-character pos)) >> > (match char >> > [(or #\) #\] #\}) >> >(action 'backward (get-backward-sexp (add1 pos)) >> > (add1 pos))] >> > >> > and I was trying to do the same for highlighting the sexp when the >> > cursor is >> > over the closing ), but I can't figure it out. >> > >> > martin >> > >> > On Sun, Sep 6, 2015 at 5:00 PM, Robby Findler >> > >> > wrote: >> >> >> >> I am not quite following what you want to do. Can you give an example >> >> interaction? >> >> >> >> Robby >> >> >> >> On Sunday, September 6, 2015, Martin DeMello >> >> wrote: >> >>> >> >>> I'm trying to override the automatic backward-sexp highlighting in >> >>> drracket to highlight the sexp based on the ) after the cursor rather >> >>> than >> >>> before it [https://github.com/takikawa/drracket-vim-tool/issues/13]. >> >>> Is this >> >>> possible? I tried overriding flash-backward-sexp but it didn't seem to >> >>> have >> >>> any effect. >> >>> >> >>> martin >> >>> >> >>> -- >> >>> You received this message because you are subscribed to the Google >> >>> Groups >> >>> "Racket Users" group. >> >>> To unsubscribe from this group and stop receiving emails from it, send >> >>> an >> >>> email to racket-users+unsubscr...@googlegroups.com. >> >>> For more options, visit https://groups.google.com/d/optout. >> >> >> >> -- >> >> You received this message because you are subscribed to the Google >> >> Groups >> >> "Racket Users" group. >> >> To unsubscribe from this group and stop receiving emails from it, send >> >> an >> >> email to racket-users+unsubscr...@googlegroups.com. >> >> For more options, visit https://groups.google.com/d/optout. >> > >> > > > -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, sen
Re: [racket-users] Overriding sexp highlighting in drracket
With some difficulty, as far as I can make out :) The code overrides on-paint and draws its own cursor. The insertion point does not appear to be changed; the cursor display is just changed from a line between char@pos and char@pos+1 to a box covering char@pos+1 https://github.com/takikawa/drracket-vim-tool/blob/master/private/text.rkt#L213 On Sun, Sep 6, 2015 at 6:08 PM, Robby Findler wrote: > The highlighting you're interested in changing is the (by default) > grey highlighting that moves around when you change the insertion > point (when you use the arrow keys, say), right? > > If so, I think the code you're looking for is the match-parens private > method in framework/private/color. You can see where it binds the > variable "here" and you probably wish it were (+ here 1) in some > cases, I guess? > > But the editor classes have the notion of insertion point wired pretty > deeply into them, and that insertion point always sits between two > characters. How does the vim mode change this behavior so that there > is highlighting on a character instead of between them? > > Robby > > > > On Sun, Sep 6, 2015 at 7:20 PM, Martin DeMello > wrote: > > Let's say I have the following: > > > > (let ([x (foo bar)] ... ) > > > > In the regular drracket editor, when I move the cursor between the ) and > ] > > it highlights (foo bar). In the vim emulator, the cursor has been > replaced > > by a block that highlights a character, rather than a line just before > it. > > So the same cursor position would display a box over the ] rather than a > > line between ) and ], and therefore backward-sexp needs to match the [ > > rather than the (. > > > > There is the following code in the vim editor to handle explicitly > hitting > > %: > > > > ;; implements the behavior of "%" and friends in vim > > (define/private (do-matching-paren action) > > (define pos-box (box 0)) > > (get-position pos-box) > > (define pos (unbox pos-box)) > > (define char (get-character pos)) > > (match char > > [(or #\) #\] #\}) > >(action 'backward (get-backward-sexp (add1 pos)) > > (add1 pos))] > > > > and I was trying to do the same for highlighting the sexp when the > cursor is > > over the closing ), but I can't figure it out. > > > > martin > > > > On Sun, Sep 6, 2015 at 5:00 PM, Robby Findler < > ro...@eecs.northwestern.edu> > > wrote: > >> > >> I am not quite following what you want to do. Can you give an example > >> interaction? > >> > >> Robby > >> > >> On Sunday, September 6, 2015, Martin DeMello > >> wrote: > >>> > >>> I'm trying to override the automatic backward-sexp highlighting in > >>> drracket to highlight the sexp based on the ) after the cursor rather > than > >>> before it [https://github.com/takikawa/drracket-vim-tool/issues/13]. > Is this > >>> possible? I tried overriding flash-backward-sexp but it didn't seem to > have > >>> any effect. > >>> > >>> martin > >>> > >>> -- > >>> You received this message because you are subscribed to the Google > Groups > >>> "Racket Users" group. > >>> To unsubscribe from this group and stop receiving emails from it, send > an > >>> email to racket-users+unsubscr...@googlegroups.com. > >>> For more options, visit https://groups.google.com/d/optout. > >> > >> -- > >> You received this message because you are subscribed to the Google > Groups > >> "Racket Users" group. > >> To unsubscribe from this group and stop receiving emails from it, send > an > >> email to racket-users+unsubscr...@googlegroups.com. > >> For more options, visit https://groups.google.com/d/optout. > > > > > -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] Overriding sexp highlighting in drracket
The highlighting you're interested in changing is the (by default) grey highlighting that moves around when you change the insertion point (when you use the arrow keys, say), right? If so, I think the code you're looking for is the match-parens private method in framework/private/color. You can see where it binds the variable "here" and you probably wish it were (+ here 1) in some cases, I guess? But the editor classes have the notion of insertion point wired pretty deeply into them, and that insertion point always sits between two characters. How does the vim mode change this behavior so that there is highlighting on a character instead of between them? Robby On Sun, Sep 6, 2015 at 7:20 PM, Martin DeMello wrote: > Let's say I have the following: > > (let ([x (foo bar)] ... ) > > In the regular drracket editor, when I move the cursor between the ) and ] > it highlights (foo bar). In the vim emulator, the cursor has been replaced > by a block that highlights a character, rather than a line just before it. > So the same cursor position would display a box over the ] rather than a > line between ) and ], and therefore backward-sexp needs to match the [ > rather than the (. > > There is the following code in the vim editor to handle explicitly hitting > %: > > ;; implements the behavior of "%" and friends in vim > (define/private (do-matching-paren action) > (define pos-box (box 0)) > (get-position pos-box) > (define pos (unbox pos-box)) > (define char (get-character pos)) > (match char > [(or #\) #\] #\}) >(action 'backward (get-backward-sexp (add1 pos)) > (add1 pos))] > > and I was trying to do the same for highlighting the sexp when the cursor is > over the closing ), but I can't figure it out. > > martin > > On Sun, Sep 6, 2015 at 5:00 PM, Robby Findler > wrote: >> >> I am not quite following what you want to do. Can you give an example >> interaction? >> >> Robby >> >> On Sunday, September 6, 2015, Martin DeMello >> wrote: >>> >>> I'm trying to override the automatic backward-sexp highlighting in >>> drracket to highlight the sexp based on the ) after the cursor rather than >>> before it [https://github.com/takikawa/drracket-vim-tool/issues/13]. Is this >>> possible? I tried overriding flash-backward-sexp but it didn't seem to have >>> any effect. >>> >>> martin >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Racket Users" group. >>> To unsubscribe from this group and stop receiving emails from it, send an >>> email to racket-users+unsubscr...@googlegroups.com. >>> For more options, visit https://groups.google.com/d/optout. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Racket Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to racket-users+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. > > -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] Overriding sexp highlighting in drracket
Let's say I have the following: (let ([x (foo bar)] ... ) In the regular drracket editor, when I move the cursor between the ) and ] it highlights (foo bar). In the vim emulator, the cursor has been replaced by a block that highlights a character, rather than a line just before it. So the same cursor position would display a box over the ] rather than a line between ) and ], and therefore backward-sexp needs to match the [ rather than the (. There is the following code in the vim editor to handle explicitly hitting %: ;; implements the behavior of "%" and friends in vim (define/private (do-matching-paren action) (define pos-box (box 0)) (get-position pos-box) (define pos (unbox pos-box)) (define char (get-character pos)) (match char [(or #\) #\] #\}) (action 'backward (get-backward-sexp (add1 pos)) (add1 pos))] and I was trying to do the same for highlighting the sexp when the cursor is over the closing ), but I can't figure it out. martin On Sun, Sep 6, 2015 at 5:00 PM, Robby Findler wrote: > I am not quite following what you want to do. Can you give an example > interaction? > > Robby > > On Sunday, September 6, 2015, Martin DeMello > wrote: > >> I'm trying to override the automatic backward-sexp highlighting in >> drracket to highlight the sexp based on the ) after the cursor rather than >> before it [https://github.com/takikawa/drracket-vim-tool/issues/13]. Is >> this possible? I tried overriding flash-backward-sexp but it didn't seem to >> have any effect. >> >> martin >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Racket Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to racket-users+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. >> > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] Overriding sexp highlighting in drracket
I am not quite following what you want to do. Can you give an example interaction? Robby On Sunday, September 6, 2015, Martin DeMello wrote: > I'm trying to override the automatic backward-sexp highlighting in > drracket to highlight the sexp based on the ) after the cursor rather than > before it [https://github.com/takikawa/drracket-vim-tool/issues/13]. Is > this possible? I tried overriding flash-backward-sexp but it didn't seem to > have any effect. > > martin > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com > > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] Overriding sexp highlighting in drracket
I'm trying to override the automatic backward-sexp highlighting in drracket to highlight the sexp based on the ) after the cursor rather than before it [https://github.com/takikawa/drracket-vim-tool/issues/13]. Is this possible? I tried overriding flash-backward-sexp but it didn't seem to have any effect. martin -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] [handin-client] `raco pkg install $URL` vs `raco setup -A $localPath`: getting lost with Racket packages
The package system knows the currently installed checksum. There's not currently a simple function to look up the checksum for a given package name, but you could use (require pkg/lib) (define (get-pkg-checksum pkg-name) (define info (for/or ([scope (in-list (get-all-pkg-scopes))]) (hash-ref (installed-pkg-table #:scope scope) pkg-name #f))) (and info (pkg-info-checksum info))) At Mon, 7 Sep 2015 00:15:35 +0200, Paolo Giarrusso wrote: > Thanks a lot! > It sounds... amazingly simpler. It even supports branches! > Even readding support for auto-update sounds easy, to prevent human errors > by students. (It's certainly less work than I spent working around the > current system). I might even integrate this in the docs. > > The "hard part" is just > `(git-checkout "github.com" "mflatt/uu-cs5510" #:dest-dir #f #:ref master)` > to get the topmost commit hash... if I can store that locally*, I have an > update check :-D, and the package system API does the rest. > > *With my current knowledge, I'd (ab)use preferences for doing that without > writing around the system, but I'm open to better ways. > > Cheers, > Paolo > > On 6 September 2015 at 23:31, Matthew Flatt wrote: > > > An easier way is: > > > > * Create a Git repo (e.g., at GitHub) for your handin client. It's a > >good idea to name the repo something specific to your class, as > >opposed to just "handin". > > > >For example, the one for my class is > > > > https://github.com/mflatt/uu-cs5510.git > > > > * Optionally, register a short name for that package at > >pkgs.racket-lang.org. > > > >For example, I have registered "uu-cs5510" to point to the above > >URL. (Actually, I used the older "git://..." form, but the new form > >should work fine.) > > > > * Install and update via the "Install Package..." menu item in > >DrRacket. > > > >Since I've registered "uu-cs5510" as a package name at > >pkgs.racket-lang.org", students just install or update the > >"uu-cs5510" package. They could just as well paste the above URL > >into the dialog, though. > > > > If I need to update the package, I can just push changes to the repo, > > and students can get the new version using the same menu item in > > DrRacket to update their installations. No further automation tools are > > needed. > > > > Avoid `raco setup -A`. That approach has all the problems you describe > > and more, and it's much better to just use the package system. > > > > At Sun, 6 Sep 2015 13:42:28 -0700 (PDT), Paolo Giarrusso wrote: > > > Hi all, > > > my research group is going to teach using How to Design Programs (2nd > > ed.), and > > > I'm currently automating deployment of the handin-client with > > auto-update. > > > Since the handin-client (and the auto-updater) was written for the old > > "package > > > management system" (Planet), I'm having some trouble — the procedure seem > > > hackier than desirable, in part because I've not mastered Racket package > > > management yet, in part because it's less error-tolerant than I wish. > > (I'll > > > admit, things will be probably fine for students, just not for me). > > > > > > I believe a couple of things could be bugs (especially n. 3), but I'll > > just > > > tell my story and let you judge. (In the end, it finally seems to be > > working). > > > > > > Meanwhile, if there's enough interest, I could put some effort into > > sharing the > > > setup (beyond https://github.com/plt/handin/issues/19). > > > > > > 1. IIUC, since the autoupdater works with PLT files, students will have > > to > > > paste the plugin URL > > > ( > > > http://ps.informatik.uni-tuebingen.de/teaching/ws15/info1/handinplugin/utue-inf > > > o1-ws15.plt) into "Install .plt file". IIUC, that's equivalent to > > `racket setup > > > -A`, but the latter doesn't seem to accept URLs. Do I really have to > > download > > > the files beforehand to install them from the command line? > > > > > > Moreover, I haven't found a clean way to uninstall those packages from > > > `(find-user-collects-dir)`. > > > > > > Finally, we've discovered that if the files are renamed the wrong way > > after > > > downloading (say, to `utue-info1-ws15 (2).plt`), installation goes wrong > > — > > > which seems very fragile. For students, we're giving instructions to > > paste the > > > URL to work this around. > > > > > > 2. I discovered that `raco pkg install` seemed to accept URLs to PLT > > files, if > > > I produce sha1 checksums (but SHA1 is deprecated?!?). That seemed > > wonderful, > > > but lead to unacceptable problems. > > > So I could just type: > > > > > > $ raco pkg install $(for i in '' -local -staging; do echo > > > > > > http://ps.informatik.uni-tuebingen.de/teaching/ws15/info1/handinplugin/utue-info > > > 1-ws15$i.plt; done) > > > > > > and later remove everything with `raco pkg`. However, files end up in > > > `(find-user-pkgs-dir)`, and that's very bad, because `raco setup -A` can > > > install the sam
Re: [racket-users] [handin-client] `raco pkg install $URL` vs `raco setup -A $localPath`: getting lost with Racket packages
Thanks a lot! It sounds... amazingly simpler. It even supports branches! Even readding support for auto-update sounds easy, to prevent human errors by students. (It's certainly less work than I spent working around the current system). I might even integrate this in the docs. The "hard part" is just `(git-checkout "github.com" "mflatt/uu-cs5510" #:dest-dir #f #:ref master)` to get the topmost commit hash... if I can store that locally*, I have an update check :-D, and the package system API does the rest. *With my current knowledge, I'd (ab)use preferences for doing that without writing around the system, but I'm open to better ways. Cheers, Paolo On 6 September 2015 at 23:31, Matthew Flatt wrote: > An easier way is: > > * Create a Git repo (e.g., at GitHub) for your handin client. It's a >good idea to name the repo something specific to your class, as >opposed to just "handin". > >For example, the one for my class is > > https://github.com/mflatt/uu-cs5510.git > > * Optionally, register a short name for that package at >pkgs.racket-lang.org. > >For example, I have registered "uu-cs5510" to point to the above >URL. (Actually, I used the older "git://..." form, but the new form >should work fine.) > > * Install and update via the "Install Package..." menu item in >DrRacket. > >Since I've registered "uu-cs5510" as a package name at >pkgs.racket-lang.org", students just install or update the >"uu-cs5510" package. They could just as well paste the above URL >into the dialog, though. > > If I need to update the package, I can just push changes to the repo, > and students can get the new version using the same menu item in > DrRacket to update their installations. No further automation tools are > needed. > > Avoid `raco setup -A`. That approach has all the problems you describe > and more, and it's much better to just use the package system. > > At Sun, 6 Sep 2015 13:42:28 -0700 (PDT), Paolo Giarrusso wrote: > > Hi all, > > my research group is going to teach using How to Design Programs (2nd > ed.), and > > I'm currently automating deployment of the handin-client with > auto-update. > > Since the handin-client (and the auto-updater) was written for the old > "package > > management system" (Planet), I'm having some trouble — the procedure seem > > hackier than desirable, in part because I've not mastered Racket package > > management yet, in part because it's less error-tolerant than I wish. > (I'll > > admit, things will be probably fine for students, just not for me). > > > > I believe a couple of things could be bugs (especially n. 3), but I'll > just > > tell my story and let you judge. (In the end, it finally seems to be > working). > > > > Meanwhile, if there's enough interest, I could put some effort into > sharing the > > setup (beyond https://github.com/plt/handin/issues/19). > > > > 1. IIUC, since the autoupdater works with PLT files, students will have > to > > paste the plugin URL > > ( > http://ps.informatik.uni-tuebingen.de/teaching/ws15/info1/handinplugin/utue-inf > > o1-ws15.plt) into "Install .plt file". IIUC, that's equivalent to > `racket setup > > -A`, but the latter doesn't seem to accept URLs. Do I really have to > download > > the files beforehand to install them from the command line? > > > > Moreover, I haven't found a clean way to uninstall those packages from > > `(find-user-collects-dir)`. > > > > Finally, we've discovered that if the files are renamed the wrong way > after > > downloading (say, to `utue-info1-ws15 (2).plt`), installation goes wrong > — > > which seems very fragile. For students, we're giving instructions to > paste the > > URL to work this around. > > > > 2. I discovered that `raco pkg install` seemed to accept URLs to PLT > files, if > > I produce sha1 checksums (but SHA1 is deprecated?!?). That seemed > wonderful, > > but lead to unacceptable problems. > > So I could just type: > > > > $ raco pkg install $(for i in '' -local -staging; do echo > > > http://ps.informatik.uni-tuebingen.de/teaching/ws15/info1/handinplugin/utue-info > > 1-ws15$i.plt; done) > > > > and later remove everything with `raco pkg`. However, files end up in > > `(find-user-pkgs-dir)`, and that's very bad, because `raco setup -A` can > > install the same package also in `(find-user-collects-dir)` — in > particular, > > that's what happens as soon as you do an auto-update (`raco pkg` refuses > > instead to do that, after `raco setup` was run). Afterwards, DrRacket > seems to > > try loading the plugin twice, resulting in: > > > > ``` > > Error invoking tool > > > # > 15>;"client-gui.rkt" > > > > preferences:set-default: preferences default already set for > > 'handin:utue-info1-ws15:submit:username > > context...: > > > > > /Users/pgiarrusso/Library/Racket/6.2.1/pkgs/utue-info1-ws15/utue-info1-ws15/clie > > nt-gui.rkt: [running body] > >/Applications/Racket > > v6.2.1/share/pkgs/drracket/drracket/private/tools.rkt:283:4 > >
[racket-users] Re: Official Docker images for Racket
On 09/06/2015 10:33 PM, Jack Firth wrote: On Sunday, September 6, 2015 at 10:56:16 AM UTC-7, Juan Francisco Cantero Hurtado wrote: On 09/06/2015 01:05 PM, Jack Firth wrote: Alpine provides a glibc package, could I just swap out for that instead? No, they don't provide glibc: https://pkgs.alpinelinux.org/packages?name=glibc&repo=all&arch=all Probably you're thinking in the "glib" package which is not a libc :) This thread https://github.com/gliderlabs/docker-alpine/issues/11 mentions an available glibc implementation for the image, but it's not part of the official package repository. Will experiment with this and see if it works. They use a stupid and horrible hack. If you want to create an official docker image, please run away from unnecessary hacks. Apparently, the docker users like minimalist linux distros. I've been searching small distros with glibc and there are few options. You could give a try to Void Linux or Arch Linux. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] [handin-client] `raco pkg install $URL` vs `raco setup -A $localPath`: getting lost with Racket packages
An easier way is: * Create a Git repo (e.g., at GitHub) for your handin client. It's a good idea to name the repo something specific to your class, as opposed to just "handin". For example, the one for my class is https://github.com/mflatt/uu-cs5510.git * Optionally, register a short name for that package at pkgs.racket-lang.org. For example, I have registered "uu-cs5510" to point to the above URL. (Actually, I used the older "git://..." form, but the new form should work fine.) * Install and update via the "Install Package..." menu item in DrRacket. Since I've registered "uu-cs5510" as a package name at pkgs.racket-lang.org", students just install or update the "uu-cs5510" package. They could just as well paste the above URL into the dialog, though. If I need to update the package, I can just push changes to the repo, and students can get the new version using the same menu item in DrRacket to update their installations. No further automation tools are needed. Avoid `raco setup -A`. That approach has all the problems you describe and more, and it's much better to just use the package system. At Sun, 6 Sep 2015 13:42:28 -0700 (PDT), Paolo Giarrusso wrote: > Hi all, > my research group is going to teach using How to Design Programs (2nd ed.), > and > I'm currently automating deployment of the handin-client with auto-update. > Since the handin-client (and the auto-updater) was written for the old > "package > management system" (Planet), I'm having some trouble — the procedure seem > hackier than desirable, in part because I've not mastered Racket package > management yet, in part because it's less error-tolerant than I wish. (I'll > admit, things will be probably fine for students, just not for me). > > I believe a couple of things could be bugs (especially n. 3), but I'll just > tell my story and let you judge. (In the end, it finally seems to be working). > > Meanwhile, if there's enough interest, I could put some effort into sharing > the > setup (beyond https://github.com/plt/handin/issues/19). > > 1. IIUC, since the autoupdater works with PLT files, students will have to > paste the plugin URL > (http://ps.informatik.uni-tuebingen.de/teaching/ws15/info1/handinplugin/utue-inf > o1-ws15.plt) into "Install .plt file". IIUC, that's equivalent to `racket > setup > -A`, but the latter doesn't seem to accept URLs. Do I really have to download > the files beforehand to install them from the command line? > > Moreover, I haven't found a clean way to uninstall those packages from > `(find-user-collects-dir)`. > > Finally, we've discovered that if the files are renamed the wrong way after > downloading (say, to `utue-info1-ws15 (2).plt`), installation goes wrong — > which seems very fragile. For students, we're giving instructions to paste > the > URL to work this around. > > 2. I discovered that `raco pkg install` seemed to accept URLs to PLT files, > if > I produce sha1 checksums (but SHA1 is deprecated?!?). That seemed wonderful, > but lead to unacceptable problems. > So I could just type: > > $ raco pkg install $(for i in '' -local -staging; do echo > http://ps.informatik.uni-tuebingen.de/teaching/ws15/info1/handinplugin/utue-info > 1-ws15$i.plt; done) > > and later remove everything with `raco pkg`. However, files end up in > `(find-user-pkgs-dir)`, and that's very bad, because `raco setup -A` can > install the same package also in `(find-user-collects-dir)` — in particular, > that's what happens as soon as you do an auto-update (`raco pkg` refuses > instead to do that, after `raco setup` was run). Afterwards, DrRacket seems > to > try loading the plugin twice, resulting in: > > ``` > Error invoking tool > # 15>;"client-gui.rkt" > > preferences:set-default: preferences default already set for > 'handin:utue-info1-ws15:submit:username > context...: > > /Users/pgiarrusso/Library/Racket/6.2.1/pkgs/utue-info1-ws15/utue-info1-ws15/clie > nt-gui.rkt: [running body] >/Applications/Racket > v6.2.1/share/pkgs/drracket/drracket/private/tools.rkt:283:4 >loop >/Applications/Racket > v6.2.1/share/pkgs/drracket/drracket/private/tools.rkt:71:0: > load/invoke-all-tools >/Applications/Racket v6.2.1/share/pkgs/drracket/drracket/tool-lib.rkt: > [running body] >/Applications/Racket > v6.2.1/share/pkgs/drracket/drracket/private/drracket-normal.rkt: [running > body] >/Applications/Racket v6.2.1/share/pkgs/drracket/drracket/drracket.rkt: > [running body] > ``` > > 3. Earlier I was trying to automate `raco pack --collect --at-plt ++setup` > using setup/pack, testing the result using `raco planet structure` and > getting > contract violations. > Then I got the same contract violations using `raco planet structure` on a > valid .plt file. > Finally, I verified that `raco planet structure` understands the result of > `raco planet create`, but not necessarily the result of `raco pack`. People > o
[racket-users] DrRacket runs on SteamOS beta
The official DrRacket build for Debian installs and runs easily on SteamOS beta: http://www.neilvandyke.org/temporary/steamos-drracket-gears.png There is an appeal to being able to develop OpenGL or GTK programs directly on your living room media/gaming appliance, in DrRacket. Valve is being much-much friendlier to random little programmers than a PS4 or Xbox One would be. (I haven't tried the Steam-specific libraries and tools. And I don't know how successful SteamOS will be commercially.) https://en.wikipedia.org/wiki/SteamOS http://store.steampowered.com/steamos/buildyourown Neil V. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] [handin-client] `raco pkg install $URL` vs `raco setup -A $localPath`: getting lost with Racket packages
Hi all, my research group is going to teach using How to Design Programs (2nd ed.), and I'm currently automating deployment of the handin-client with auto-update. Since the handin-client (and the auto-updater) was written for the old "package management system" (Planet), I'm having some trouble — the procedure seem hackier than desirable, in part because I've not mastered Racket package management yet, in part because it's less error-tolerant than I wish. (I'll admit, things will be probably fine for students, just not for me). I believe a couple of things could be bugs (especially n. 3), but I'll just tell my story and let you judge. (In the end, it finally seems to be working). Meanwhile, if there's enough interest, I could put some effort into sharing the setup (beyond https://github.com/plt/handin/issues/19). 1. IIUC, since the autoupdater works with PLT files, students will have to paste the plugin URL (http://ps.informatik.uni-tuebingen.de/teaching/ws15/info1/handinplugin/utue-info1-ws15.plt) into "Install .plt file". IIUC, that's equivalent to `racket setup -A`, but the latter doesn't seem to accept URLs. Do I really have to download the files beforehand to install them from the command line? Moreover, I haven't found a clean way to uninstall those packages from `(find-user-collects-dir)`. Finally, we've discovered that if the files are renamed the wrong way after downloading (say, to `utue-info1-ws15 (2).plt`), installation goes wrong — which seems very fragile. For students, we're giving instructions to paste the URL to work this around. 2. I discovered that `raco pkg install` seemed to accept URLs to PLT files, if I produce sha1 checksums (but SHA1 is deprecated?!?). That seemed wonderful, but lead to unacceptable problems. So I could just type: $ raco pkg install $(for i in '' -local -staging; do echo http://ps.informatik.uni-tuebingen.de/teaching/ws15/info1/handinplugin/utue-info1-ws15$i.plt; done) and later remove everything with `raco pkg`. However, files end up in `(find-user-pkgs-dir)`, and that's very bad, because `raco setup -A` can install the same package also in `(find-user-collects-dir)` — in particular, that's what happens as soon as you do an auto-update (`raco pkg` refuses instead to do that, after `raco setup` was run). Afterwards, DrRacket seems to try loading the plugin twice, resulting in: ``` Error invoking tool #;"client-gui.rkt" preferences:set-default: preferences default already set for 'handin:utue-info1-ws15:submit:username context...: /Users/pgiarrusso/Library/Racket/6.2.1/pkgs/utue-info1-ws15/utue-info1-ws15/client-gui.rkt: [running body] /Applications/Racket v6.2.1/share/pkgs/drracket/drracket/private/tools.rkt:283:4 loop /Applications/Racket v6.2.1/share/pkgs/drracket/drracket/private/tools.rkt:71:0: load/invoke-all-tools /Applications/Racket v6.2.1/share/pkgs/drracket/drracket/tool-lib.rkt: [running body] /Applications/Racket v6.2.1/share/pkgs/drracket/drracket/private/drracket-normal.rkt: [running body] /Applications/Racket v6.2.1/share/pkgs/drracket/drracket/drracket.rkt: [running body] ``` 3. Earlier I was trying to automate `raco pack --collect --at-plt ++setup` using setup/pack, testing the result using `raco planet structure` and getting contract violations. Then I got the same contract violations using `raco planet structure` on a valid .plt file. Finally, I verified that `raco planet structure` understands the result of `raco planet create`, but not necessarily the result of `raco pack`. People on IRC suggested mentioning this here. What do you think? Cheers, Paolo -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] PR accepted but didn't wind up on master?
Yes, that is correct. Vincent On Sun, 06 Sep 2015 12:36:46 -0500, 'John Clements' via Racket Users wrote: > > A few days ago, I made a pull request (#1030) against plt/racket. Jay > McCarthy approved it… but now I don’t see it on master. I’m guessing… that > these commits need to be made to git.racket-lang.org instead, and then they > get force-pushed to the github account. Is this correct? If so, I’ll just > take these approved commits and rebase them and push them myself. > > Thanks! > > John > > > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] Re: Official Docker images for Racket
On Sunday, September 6, 2015 at 10:56:16 AM UTC-7, Juan Francisco Cantero Hurtado wrote: > On 09/06/2015 01:05 PM, Jack Firth wrote: > > Alpine provides a glibc package, could I just swap out for that instead? > > No, they don't provide glibc: > https://pkgs.alpinelinux.org/packages?name=glibc&repo=all&arch=all > > Probably you're thinking in the "glib" package which is not a libc :) This thread https://github.com/gliderlabs/docker-alpine/issues/11 mentions an available glibc implementation for the image, but it's not part of the official package repository. Will experiment with this and see if it works. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] Re: Official Docker images for Racket
On 09/06/2015 01:05 PM, Jack Firth wrote: On Saturday, September 5, 2015 at 2:54:42 PM UTC-7, Juan Francisco Cantero Hurtado wrote: On 09/04/2015 10:32 PM, Jack Firth wrote: Virtualbox -> Linux -> Docker -> Alpine ^ Which Linux distro? I'm asking because the usual Racket errors in distros with grsecurity are pretty easy to workaround. These errors affect to every JIT, not only to Racket. If you're running a non-grsecurity kernel in the host OS, then the problems are probably related to musl. It would require to patch the Racket interpreter. From what I can gather, it's using a modified TinyCore linux through the boot2docker driver https://github.com/boot2docker/boot2docker/blob/master/doc/FAQ.md#what-is-the-boot2docker-distribution-based-on I've created a patch to workaround the errors related to musl. It doesn't fix every bug, only enough to finish the build. Racket still fails in some tests. Git HEAD: http://juanfra.info/bl/15/racket-head-alpine-vanilla-musl.patch Racket 6.2.1 Minimal: http://juanfra.info/bl/15/racket-621min-alpine-vanilla-musl.patch I've not sent a pull request because musl doesn't use a C define which permits to recognize the library, so the detection of the library would be a mess. My recommendation is to use a different Linux distro with glibc, i.e. forget Alpine. Alpine provides a glibc package, could I just swap out for that instead? No, they don't provide glibc: https://pkgs.alpinelinux.org/packages?name=glibc&repo=all&arch=all Probably you're thinking in the "glib" package which is not a libc :) -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] PR accepted but didn't wind up on master?
A few days ago, I made a pull request (#1030) against plt/racket. Jay McCarthy approved it… but now I don’t see it on master. I’m guessing… that these commits need to be made to git.racket-lang.org instead, and then they get force-pushed to the github account. Is this correct? If so, I’ll just take these approved commits and rebase them and push them myself. Thanks! John -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] Re: Official Docker images for Racket
On Saturday, September 5, 2015 at 2:54:42 PM UTC-7, Juan Francisco Cantero Hurtado wrote: > On 09/04/2015 10:32 PM, Jack Firth wrote: > >> > >> Virtualbox -> Linux -> Docker -> Alpine > >> ^ > >> > >> Which Linux distro? > >> > >> I'm asking because the usual Racket errors in distros with grsecurity > >> are pretty easy to workaround. These errors affect to every JIT, not > >> only to Racket. > >> > >> If you're running a non-grsecurity kernel in the host OS, then the > >> problems are probably related to musl. It would require to patch the > >> Racket interpreter. > > > > From what I can gather, it's using a modified TinyCore linux through the > > boot2docker driver > > https://github.com/boot2docker/boot2docker/blob/master/doc/FAQ.md#what-is-the-boot2docker-distribution-based-on > > I've created a patch to workaround the errors related to musl. It > doesn't fix every bug, only enough to finish the build. Racket still > fails in some tests. > > Git HEAD: > http://juanfra.info/bl/15/racket-head-alpine-vanilla-musl.patch > > Racket 6.2.1 Minimal: > http://juanfra.info/bl/15/racket-621min-alpine-vanilla-musl.patch > > I've not sent a pull request because musl doesn't use a C define which > permits to recognize the library, so the detection of the library would > be a mess. My recommendation is to use a different Linux distro with > glibc, i.e. forget Alpine. Alpine provides a glibc package, could I just swap out for that instead? -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] Re: help on coding finite state automata
Dear All, thanks for all your help, im writing the code to generate a population of fsm, playing a repeated game and the population evolves over time. (no mutation yet). here on my github just fyi: https://github.com/ayaderaghul/sample-fsm Btw, the blogger suggests that because the automaton only needs to know the current-state, if the population scales big, we just need to separate the current-state as a single atom outside the machine itself (for better performance). I hope this may helps make the thread more complete. On 4 September 2015 at 20:50, wrote: > On Friday, September 4, 2015 at 9:31:36 AM UTC-4, Michael Myers wrote: > > You might want to take a look at https://github.com/mromyers/automata > > specifically, > https://github.com/mromyers/automata/blob/master/examples.rkt > > and https://github.com/mromyers/automata/blob/master/machines.rkt > > > > I more or less just use the definition that was in my textbook: you > provide > > a transition function, and the DFA or NFA just uses stream-fold to get > the > > extended transition. I used a bunch of generics stuff to try to > generalize > > everything past the point of practicality, but it's still reasonably > > fast. > > > > It's not documented, but use (in-machine? M seq) to check for acceptance, > > (extended-transition M start seq) for final state(s). > > > > There's also a minimization function and nfa->dfa conversion in there, > but > > they're a bit fragile, so use at your own risk. > > Sorry for the duplicate, this was sent yesterday, and only arived just now. > > -- > You received this message because you are subscribed to a topic in the > Google Groups "Racket Users" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/racket-users/4o1goSwrLHA/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > racket-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- *Nguyen Linh Chi* -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.