[racket-users] Re: Complete Word (Ctrl+/)

2018-11-05 Thread Gregor Kopp
@Glenn Hoetker:

First, create a file with rkt ending with the following content:

#lang s-exp framework/keybinding-lang
(text:get-completions/manuals false)
(keybinding "c:TAB" (λ (editor event) (send editor auto-complete))) ; i 
changed this to control+tab, its more convenient for me.
(keybinding "c:l" (λ (editor event) (send editor insert "λ")))

then, in Dr. Racket in the Menu: Edit -> Keybindings you can add this file.

@Robby Findler:
Thank you!
(text:get-completions/manuals false)
in my keymap file did it.
Now it takes a little bit longer to start (those 2-3 seconds), but that is 
expected by me.

Thank you very very much!


Am Mittwoch, 12. September 2018 10:11:12 UTC+2 schrieb Gregor Kopp:
>
> Hi!
> I like DrRacket very much, because it's hassle-free.
> I like fast startup times, that's why I disabled all tools in the 
> preferences, because at the moment I don't use them.
> Further more, it's easier for me to map "Complete Word" to the tabulator 
> key. I do not use the emacs keybindings.
> I have in the preferences, tab "Editing", subtab "General Editing" "Enable 
> keybindings in menus" checked. It's more convenient for me.
>
> For that purpose I did a custom keybinding which I successfully enabled in 
> DrRacket:
>
> #lang s-exp framework/keybinding-lang
> (keybinding "TAB" (λ (editor event) (send editor auto-complete)))
> (keybinding "c:l" (λ (editor event) (send editor insert "λ")))
>
> That all works very well, DrRacket starts very fast, and editing is also 
> fast enough. The λ is also very helpful for me because I don't have an 
> english keyboard.
> There is only one thing I would like to change:
>
> If I invoke the auto-complete method, the first time I'm using it it takes 
> some time (2-3 seconds maybe?) until the complete suggestions are 
> appearing. After the first time using it its fast enough.
> I think it's loading on demand.
>
> Finally my question: Is there any way to tell DrRacket to load that 
> required data on startup?
>
> I know, why bother about it, but 2 seconds are 2 seconds.
>
> Thank you for your suggestions.
>

-- 
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] Creating truly unique instances of structure types?

2018-11-05 Thread Ryan Culpepper

On 11/5/18 5:26 PM, Alexis King wrote:

To my knowledge, there are two main techniques for creating unique values in 
Racket: `gensym` and structure type generativity. The former seems to be 
bulletproof — a value created with `gensym` will never be `equal?` to anything 
except itself – but the latter isn’t. Using reflective operations, it’s 
possible to circumvent the encapsulation afforded by the module system.

To provide an example, `racket/contract` exports a value called 
`the-unsupplied-arg`, which is created using the usual structure type 
generativity trick:

(define-struct the-unsupplied-arg ())
(define the-unsupplied-arg (make-the-unsupplied-arg))
(provide the-unsupplied-arg)

The constructor is not exported, and this value is intended to be unique. 
However, if we can arrange for the contract library to be loaded on our terms, 
we can thwart this encapsulation by supplying it with a weaker inspector:

#lang racket/base

(define the-unsupplied-arg
  (parameterize ([current-inspector (make-inspector)])
(dynamic-require 'racket/contract 'the-unsupplied-arg)))

(define-values [info skipped?] (struct-info the-unsupplied-arg))

(define another-unsupplied-arg ((struct-type-make-constructor info)))

(equal? the-unsupplied-arg another-unsupplied-arg) ; => #t
(eq? the-unsupplied-arg another-unsupplied-arg); => #f

Perhaps this isn’t the end of the world, as after all, we can’t do anything 
especially nefarious with this value, and we wouldn’t be able to do it in the 
first place if we didn’t have complete control of the inspector hierarchy. 
Still, it seems a little unsatisfying.

So, my question: is there any way to create a structure type for which there 
can truly ever only be one instance? If not, is there a fundamental reason why 
not?


You could use a chaperone to prohibit `struct-info`:

  (define the-unsupplied-arg
(chaperone-struct (make-the-unsupplied-arg)
  struct:unsupplied-arg
  struct-info (lambda _ (error "not allowed"

Ryan

--
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] Racket PPA for Ubuntu updated for v7.1

2018-11-05 Thread Asumu Takikawa
Hi folks,

The Racket PPA is now updated for v7.1 (since about 5 days ago but I didn't
have time to test it until today):

  https://launchpad.net/~plt/+archive/ubuntu/racket

Should be available on xenial, trusty, bionic, and cosmic.

Please report any issues to 

  https://github.com/takikawa/racket-ppa

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.


[racket-users] Creating truly unique instances of structure types?

2018-11-05 Thread Alexis King
To my knowledge, there are two main techniques for creating unique values in 
Racket: `gensym` and structure type generativity. The former seems to be 
bulletproof — a value created with `gensym` will never be `equal?` to anything 
except itself – but the latter isn’t. Using reflective operations, it’s 
possible to circumvent the encapsulation afforded by the module system.

To provide an example, `racket/contract` exports a value called 
`the-unsupplied-arg`, which is created using the usual structure type 
generativity trick:

(define-struct the-unsupplied-arg ())
(define the-unsupplied-arg (make-the-unsupplied-arg))
(provide the-unsupplied-arg)

The constructor is not exported, and this value is intended to be unique. 
However, if we can arrange for the contract library to be loaded on our terms, 
we can thwart this encapsulation by supplying it with a weaker inspector:

#lang racket/base

(define the-unsupplied-arg
  (parameterize ([current-inspector (make-inspector)])
(dynamic-require 'racket/contract 'the-unsupplied-arg)))

(define-values [info skipped?] (struct-info the-unsupplied-arg))

(define another-unsupplied-arg ((struct-type-make-constructor info)))

(equal? the-unsupplied-arg another-unsupplied-arg) ; => #t
(eq? the-unsupplied-arg another-unsupplied-arg); => #f

Perhaps this isn’t the end of the world, as after all, we can’t do anything 
especially nefarious with this value, and we wouldn’t be able to do it in the 
first place if we didn’t have complete control of the inspector hierarchy. 
Still, it seems a little unsatisfying.

So, my question: is there any way to create a structure type for which there 
can truly ever only be one instance? If not, is there a fundamental reason why 
not?

Alexis

-- 
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] RacketCon 2018 videos

2018-11-05 Thread Eric Haney
Hello,

I noticed that Youtube has a few streams of the recent RacketCon event. I 
can get the gist of what the speakers are saying, but they are hard to 
follow in detail. Any word if higher quality uploads are available for the 
talks?

I don't know who to thank for all of the previous years' recordings, but I 
have learned a great deal from them and I appreciate them very much. Thanks!

-- 
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] Subproceses in Windows

2018-11-05 Thread Sean Kemplay
Thanks George, that explains it perfectly.

On Monday, November 5, 2018 at 5:11:04 PM UTC, gneuner2 wrote:
>
>
>
> On 11/5/2018 11:49 AM, Sean Kemplay wrote:
>
> Hi All,
>
> I am trying to open windoes explorer from Racket using the following -
>
> (system* "cmd" "start" "explorer.exe")
>
> However it is not working and #f is being returned. This works fine from 
> Go and even VBScript!
>
> Anyone know what I am missing?
>
> Kind regards,
> Sean
>
>
>
> On Windows the path isn't searched (for whatever reason).  You need to do 
> something like:
>
> (let [
>   (path (find-executable-path "explorer.exe"))
>  ]
>   (system* path)
>   )
>
>
> George
>

-- 
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] Places and many cores? (File descriptor limit?)

2018-11-05 Thread Matt Jadud
On Mon, Nov 5, 2018 at 11:49 AM George Neuner  wrote:

>
> Don't throw it away too quickly.
>
> With a nod to process/thread scheduling: unless you muck with
> process/thread groups, by default Linux tries to gang schedule all the
> (ready) threads of a process to run simultaneously.
>
> Rather than creating large numbers of processes each having 1 place, you
> might want to consider creating fewer processes that have several places
> each  [essentially a gang of thread pools].  If the places typically do
> significant amounts of work, leveraging the gang behavior of the scheduler
> *might* increase overall performance of the application as a whole.
> [Particularly if the machine is not dedicated to your computing, and if the
> admins are not actively preventing you from exploiting this.  YMMV.]
>

Fortunately, at the moment, the machine is mine to play with, so I'm not
about to run into contention with other users.

I had structured the whole application in a CSP-ish way, largely using
channels to manage my synchronization. Therefore, the new abstraction isn't
too large a step.

I'm going to think about how to structure this a bit more at this point. As
you suggest, there's more than one way to do it, and as long as I'm doing
some cleanup/restructuring, I might as well be sensible about it.

Many thanks,
Matt

-- 
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] Subproceses in Windows

2018-11-05 Thread George Neuner



On 11/5/2018 11:49 AM, Sean Kemplay wrote:

Hi All,

I am trying to open windoes explorer from Racket using the following -

(system* "cmd" "start" "explorer.exe")

However it is not working and #f is being returned. This works fine 
from Go and even VBScript!


Anyone know what I am missing?

Kind regards,
Sean



On Windows the path isn't searched (for whatever reason).  You need to 
do something like:


(let [
  (path (find-executable-path "explorer.exe"))
 ]
  (system* path)
  )


George

--
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] Subproceses in Windows

2018-11-05 Thread Sean Kemplay
Hi All,

I am trying to open windoes explorer from Racket using the following -

(system* "cmd" "start" "explorer.exe")

However it is not working and #f is being returned. This works fine from Go 
and even VBScript!

Anyone know what I am missing?

Kind regards,
Sean

-- 
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] Places and many cores? (File descriptor limit?)

2018-11-05 Thread George Neuner



On 11/5/2018 9:57 AM, Matt Jadud wrote:
On Sun, Nov 4, 2018 at 5:30 PM George Neuner > wrote:



One .zo per distributed place is just one descriptor per process. 
Again insignificant because you have 4K per process.

It's apparent that the code is leaking descriptors somewhere. 
Forcing GC may mitigate the problem, but it would be better if you
found the leak.


I've lied.


We'll assume instead that you were simply mistaken 


I am *not* using distributed places. I'm using *dynamic-place*, which 
clearly is why I'm running into limits.


Yes.  Big difference.


Unless anyone has alternative ideas, I'm going to restructure my code 
to use distributed places on the single machine, which will, I think, 
give me multicore parallelism and eliminate the file descriptor limit 
I'm running up against.


If your issue really was caused by too many code files (yours + 
Racket's) eating up descriptors, then yes, switching to distributed 
places should alleviate the problem.



Many thanks, again. I locked in my head I was using distributed 
places, and was blind to my own code. I've kept the test case I wrote, 
below, that let me see clearly what I was doing, as opposed to getting 
caught up in all the other things my code was engaged in. I'll leave 
it below for posterity's sake, but it doesn't serve a particular role 
at this point.


Don't throw it away too quickly.

With a nod to process/thread scheduling: unless you muck with 
process/thread groups, by default Linux tries to gang schedule all the 
(ready) threads of a process to run simultaneously.


Rather than creating large numbers of processes each having 1 place, you 
might want to consider creating fewer processes that have several places 
each  [essentially a gang of thread pools].  If the places typically do 
significant amounts of work, leveraging the gang behavior of the 
scheduler *might* increase overall performance of the application as a 
whole.  [Particularly if the machine is not dedicated to your computing, 
and if the admins are not actively preventing you from exploiting this.  
YMMV.]


George

--
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] Places and many cores? (File descriptor limit?)

2018-11-05 Thread Matt Jadud
Hi all,

First, thank you for the conversation around this.

On Sun, Nov 4, 2018 at 5:30 PM George Neuner  wrote:

>
> One .zo per distributed place is just one descriptor per process.  Again
> insignificant because you have 4K per process.
>
> It's apparent that the code is leaking descriptors somewhere.  Forcing GC
> may mitigate the problem, but it would be better if you found the leak.
>
>
I've lied. I am *not* using distributed places. I'm using *dynamic-place*,
which clearly is why I'm running into limits.

Unless anyone has alternative ideas, I'm going to restructure my code to
use distributed places on the single machine, which will, I think, give me
multicore parallelism and eliminate the file descriptor limit I'm running
up against.

Many thanks, again. I locked in my head I was using distributed places, and
was blind to my own code. I've kept the test case I wrote, below, that let
me see clearly what I was doing, as opposed to getting caught up in all the
other things my code was engaged in. I'll leave it below for posterity's
sake, but it doesn't serve a particular role at this point.

Cheers,
Matt

---

NOT QUITE RELEVANT ANYMORE...

I've written a small test case, and with Stefan's suggestion, dropped the
soft limit on descriptors to 100.

I can run my test case with 100 distributed places  when the soft limit is
1024 (and I end up with 708 descriptors in use when all of the distributed
places are idling), and it crashes immediately/very quickly when I drop
down to 100 descriptors.

[mjadud@phi subsetting]$ ulimit -n 100

[mjadud@phi subsetting]$ racket -um stress-queen.rkt

open-input-file: cannot open input file

  path:
/usr/netapp/faculty/mjadud/racket-src/racket/collects/racket/private/compiled/reading-param_rkt.zo

  system error: Too many open files; errno=24

The files I used for testing are in this Gist:

https://gist.github.com/jadudm/b165190677bf3c3eab2c07c278d61808

-- 
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: Complete Word (Ctrl+/)

2018-11-05 Thread Robby Findler
Maybe you can call this function:

http://docs.racket-lang.org/framework/Text.html?q=get-completions%2Fmanuals#%28def._%28%28lib._framework%2Fmain..rkt%29._text~3aget-completions%2Fmanuals%29%29

from the top-level of your keybindings file?

Robby

On Mon, Nov 5, 2018 at 3:11 AM Glenn Hoetker  wrote:
>
> I'm afraid I don't have a suggestion, but a question.  The code you provided 
> makes sense to me and duplicates something I'd like, but I'm unsure how to 
> enable it in DrRacket. May I ask how you did so?  Thank you.  Glen
>
> On Wednesday, September 12, 2018 at 6:11:12 PM UTC+10, Gregor Kopp wrote:
>>
>> Hi!
>> I like DrRacket very much, because it's hassle-free.
>> I like fast startup times, that's why I disabled all tools in the 
>> preferences, because at the moment I don't use them.
>> Further more, it's easier for me to map "Complete Word" to the tabulator 
>> key. I do not use the emacs keybindings.
>> I have in the preferences, tab "Editing", subtab "General Editing" "Enable 
>> keybindings in menus" checked. It's more convenient for me.
>>
>> For that purpose I did a custom keybinding which I successfully enabled in 
>> DrRacket:
>>
>> #lang s-exp framework/keybinding-lang
>> (keybinding "TAB" (λ (editor event) (send editor auto-complete)))
>> (keybinding "c:l" (λ (editor event) (send editor insert "λ")))
>>
>> That all works very well, DrRacket starts very fast, and editing is also 
>> fast enough. The λ is also very helpful for me because I don't have an 
>> english keyboard.
>> There is only one thing I would like to change:
>>
>> If I invoke the auto-complete method, the first time I'm using it it takes 
>> some time (2-3 seconds maybe?) until the complete suggestions are appearing. 
>> After the first time using it its fast enough.
>> I think it's loading on demand.
>>
>> Finally my question: Is there any way to tell DrRacket to load that required 
>> data on startup?
>>
>> I know, why bother about it, but 2 seconds are 2 seconds.
>>
>> Thank you for your suggestions.
>
> --
> 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: Complete Word (Ctrl+/)

2018-11-05 Thread Glenn Hoetker
I'm afraid I don't have a suggestion, but a question.  The code you 
provided makes sense to me and duplicates something I'd like, but I'm 
unsure how to enable it in DrRacket. May I ask how you did so?  Thank you. 
 Glen

On Wednesday, September 12, 2018 at 6:11:12 PM UTC+10, Gregor Kopp wrote:
>
> Hi!
> I like DrRacket very much, because it's hassle-free.
> I like fast startup times, that's why I disabled all tools in the 
> preferences, because at the moment I don't use them.
> Further more, it's easier for me to map "Complete Word" to the tabulator 
> key. I do not use the emacs keybindings.
> I have in the preferences, tab "Editing", subtab "General Editing" "Enable 
> keybindings in menus" checked. It's more convenient for me.
>
> For that purpose I did a custom keybinding which I successfully enabled in 
> DrRacket:
>
> #lang s-exp framework/keybinding-lang
> (keybinding "TAB" (λ (editor event) (send editor auto-complete)))
> (keybinding "c:l" (λ (editor event) (send editor insert "λ")))
>
> That all works very well, DrRacket starts very fast, and editing is also 
> fast enough. The λ is also very helpful for me because I don't have an 
> english keyboard.
> There is only one thing I would like to change:
>
> If I invoke the auto-complete method, the first time I'm using it it takes 
> some time (2-3 seconds maybe?) until the complete suggestions are 
> appearing. After the first time using it its fast enough.
> I think it's loading on demand.
>
> Finally my question: Is there any way to tell DrRacket to load that 
> required data on startup?
>
> I know, why bother about it, but 2 seconds are 2 seconds.
>
> Thank you for your suggestions.
>

-- 
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.