To add a tiny bit to Neil's excellent explanation, in case it wasn't clear:

You can run your th.rkt program simply by doing

  racket th.rkt


(That's probably all you need to know for now and for a small Racket program.)

You can make this start faster by byte-compiling th.rkt after you change it:

  raco make th.rkt

This places some files in a `compiled` subdir. Now `racket th.rkt`
doesn't need to byte-compile, and it will start faster. (For a large
program doing lots of macro expansion, the improvement will be
noticeable.)

If your project grows to multiple .rkt files, you may want to make it
into a "collection". That way you can type

  raco setup <collection-name>

and it will do a variety of tasks, including `raco make` all the .rkt files.

So:

1. You don't need to make an executable. `racket` can run and
byte-compile source files directly (it will JIT compile to native
code, too).

2. If the program "stabilizes" and you want to run it frequently, you
may want to `raco make` to do the byte-compilation part once so the
results can be reused and your program starts faster.



On Mon, Sep 28, 2015 at 8:54 AM, Neil Van Dyke <n...@neilvandyke.org> wrote:
>
> Sergey Yudin wrote on 09/28/2015 09:08 AM:
>>
>>
>> By the way threads works but still output exists
>> #<thread:...llo-world/th.rkt:3:8>
>> #<thread:...llo-world/th.rkt:8:8>
>> How to suppess it ?
>
>
> (void (thread ...))
>
> You're seeing those messages because DrRacket likes to report the values of
> top-level expressions as it evaluates them.  But it doesn't report anything
> when the value is the special void value. The `void` procedure always
> returns the void value, so you can use `void` to keep a thread value from
> being the value of a top level expression.
>
>>
>> What is the rigth way to deamonize/fork racket standalone executable ?
>
>
> I've done it a few different ways.  One way (on Unix-like) is to just run it
> in the background from the shell with `&`.  Redirect stdout and stderr to a
> log file, for `PLTSTDERR` and anything else that comes out.  You might also
> want to also use shell `nohup`.
>
> On Unix-like systems, you can make an init script to start and stop such
> daemons.
>
> I also like to run small numbers of daemons (but not a large fleet) under
> detached `screen` or `tmux` sessions, so I can go in manually to administer.
> This is more for small operations, prototypes, startup-type rapid cycling,
> etc.
>
> There's also the Rackonsole library, which might or might not be useful.
> http://www.neilvandyke.org/rackonsole/
>
>>
>> And one more question:
>> Looking at racket standalone executable in linux I can see the module has
>> scary command line
>> -bash
>>      └─ /usr/local/src/racket-hello-world/./main -X  -G
>> /usr/local/src/racket-hello-world/./etc -k 12656 2419661 2419902 -U --
>>         └─ /usr/local/src/racket-hello-world/./main -X  -G
>> /usr/local/src/racket-hello-world/./etc -k 12656 2419661 2419902 -U --
>> is it OK
>
>
> It looks plausible to me.  Note that you don't need to use `raco exe` if
> you're running the program on your own servers -- I think `raco exe` is to
> help polish Racket programs that will be deployed by other people, like if
> you shipped a Windows desktop app.
>
> If you don't like the scary-looking command line, there are Linux ways to
> change what Linux process lists display for the command. Daemons (e.g.,
> PostgreSQL, some email MTA) sometimes use this to report
> application-specific status info. I would save that bit of polish for last,
> after everything else is done.
>
> 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.

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

Reply via email to