[Ur] Standalone executable/binary runnable from command prompt

Adam Chlipala adamc at csail.mit.edu
Sun May 3 09:44:05 EDT 2015


I don't see why you'd want to use such a gross interface as printf(). :P

As has already been pointed out, you can compile with the flag 
'-protocol static' to get an executable that expects to be called on the 
command line with a URL as an argument; then it prints the HTTP response.

We'd need to hear more about your use case to give better advice. Be 
forewarned that Ur/Web really is a domain-specific language for web 
applications, and it is not going to be pleasant to use to build other 
kinds of programs.

On 05/03/2015 09:13 AM, Artella Coding wrote:
> Hi, would it be possible to use the C printf using the FFI? If so is 
> there a demo using the foreign function interface? Thanks
>
> On Sun, May 3, 2015 at 1:48 PM, Sergey Mironov <grrwlf at gmail.com 
> <mailto:grrwlf at gmail.com>> wrote:
>
>     Hi. Ur/Web compiler can create standalone executables, but it doesn't
>     provide things many other languages provide. In particular, the Basis
>     library doesn't support stdin/stdout nor the file system access
>     functions.
>     Instead, you can create  an executable containing built-in web server
>     which knows how to serve page named 'main' displaying 'hello world'.
>     After  running your application (by calling it from the command line),
>     you will be able to access the page with 'curl'.
>
>     Regards,
>     Sergey
>
>     2015-05-03 14:21 GMT+03:00 Artella Coding
>     <artella.coding at googlemail.com
>     <mailto:artella.coding at googlemail.com>>:
>     > Hi,
>     >
>     > Is it possible for me to create a standalone "Hello world"
>     executable/binary
>     > in linux which I can run in the command prompt (i.e. without
>     having to deal
>     > with the browser)?
>     >
>     > Thanks
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.impredicative.com/pipermail/ur/attachments/20150503/2d6a200b/attachment-0001.html>


More information about the Ur mailing list