noknok has asked for the wisdom of the Perl Monks concerning the following question:

Dear Perl Monks,

I am in trouble. As a non-believer, I probably shouldn't seek shelter in your monastery. But you monks are wise and you listen. So please, forgive me.

I am running a long-term research project in logic and I am busy building a library of methods and algorithms to solve a couple of complex problems. To keep things intelligible for both the user and myself, I translated all that into managable modules of a concrete language. I have chosen Standard ML (SML), because I really think and talk functional, and its interface design (made of "signatures", "structures" and "functors") suits my needs and the challenges of large projects in general.
Furthermore, I intend to make these modules easily usable via web applications and HTML formulas. The user should be enabled to input some problem in a simple syntax, and a solution should be provided online, computed on the server side, so that there is no need to install anything. I realized a similar approach years ago by means of a Java applet. But I find Java not a suitable language for the overall project and too far off my own way of thinking.
I studied PHP to implement the GUI side of my project, but I had to realize, that the host provider of my homepage disabled the PHP "system" function, which would bridge the gap between HTML/PHP and the SML executables. I heard about CGI scripts and started to study Perl. Somehow, I did fall in love with the ugly camel, especially for its universal power and its ability to explain two marvels from a new perspective: GNU/Linux and the internet. Although I don't believe in Perl as a natural language for me, I really enjoy learning it and I intent to continue studying.
However, now that I understand enough CGI and Perl to implement the things I need, my host provider tells me, that they wouldn't implement the necessary SML compiler/interpreter for me and that I don't have access to the shell to do all that myself.
I am desperate.

Is there in the jungle of host providers a good and suitable one for me, at all?
Or, would it be possible for me to run my own server, although I only have a DSL connection without a permanent IP?
Or, is there a monk in this monastery with an own machine, some 25 MB or so to spare and who is unholy enough to take some money for the efforts?
Or, is it possible to realize my idea any other way?

Thank you for your patience.

Replies are listed 'Best First'.
Re: The meaning of life, Perl and SML
by Util (Priest) on Nov 25, 2008 at 01:45 UTC

    You should be able to run it on your own server (Linux or Mac); your DSL connection will only be a factor if your application ever reaches high traffic.

    1. Get a "Free Dynamic DNS" account from DynDNS.com (who have been big-time Perl supporter, BTW), and configure your server to update your account whenever it detects a change in its IP address.
    2. Install and configure Apache. You should not need ModPerl for low-traffic development; CGI will do fine.
    3. Get a simple "Hello World" CGI Perl program running, that you can run via your web browser.
    4. Extend the "Hello World" program to exchange some of its data with a simple SML program via system, qx, or some other IPC method.
    5. Keep modifying the "Hello World" Perl/SML pair of programs, until you reach your research Nirvana.
      1. Come back here with any *specific* problems you have with the Perl parts of the development
        (See I know what I mean. Why don't you? and How (Not) To Ask A Question when the time comes.)
    6. Come back and tell us all about your success!

      Dear Util,

      I just added you to the list of my seven favorite utilities. Thank you!

      Almut pointed me to the VPS options, I consider to do that and I am busy studying the details and comparing the offers.
      But running my own server at home is something I regularly think about every now and then, too. When the first "Mac mini" came out, I purchased one, hoping I could use it as a permanent, silent and economical web machine. But the promised built-in server never worked for me.
      I installed the Xampp suite from apachefriends.org and the I didn't explore CGI and SML on it yet, but HTML and PHP documents work fine under http://localhost. But when I try to reach it from outside, I receive an error message. There must be some mistake in my thinking about the mechanics, maybe you can give me a hint:
      Well, suppose Xampp is running fine and http://localhost works locally, i.e. in the mac mini browser itself. I go to whatismyip.com and see that my current IP is say 77.250.13.83. I don't have a permanent IP, but that one should be my IP as long as I am online, right? But when I take my laptop and type http://77.250.13.83 into the firefox, it returns an error message. The one it just gave me was: The server under 77.250.13.83 takes too long to post an answer. I guess, this also has to do with the setup of my home environment. The ADSL line from the (tv-cable) modem goes into a wireless router, one line from there enters the mac mini and my laptop is connected wireless.

      Sorry Util, of course you are not my personal utility and you shouldn't feel obliged. Thank you again for your kind reply.
        When you go to whatismyip.com it will give you the IP of your ADSL connection, not your computers. You will get the same address for both your laptop and your mini if you try that. To see a computer's local ip you will have to look in your Control Panel, or type ifconfig in a command line terminal (the command is ifconfig on Mac/Linux and ipconfig in Windows). Then you will have the local network address for your computer. Sorry if I'm just telling you stuff you already know, but I wanted to make sure.

        You will need to configure the firewall on your router to allow http access from outside connections. Use NAT (network address translation) to put HTTP traffic (port 80) through to the local address of your mac mini. You should set it up so that the mini is always assigned the same IP address, it should be under DHCP settings on your router configuration. Once you configure the firewall properly you may be able to use the 77.250.13.83 address to reach your mini's website even from within your network, but I can't remember the exact router option that is needed to do that kind of thing. I think it may just be called loopback.

        I can't remember what the default firewall options were on my own mac (I'm now running Ubuntu on it anyway), but you should also try to access the mini from your laptop while connected to the same network to make sure that the mini is allowing HTTP connections through its own firewall. There are options to allow different kinds of networking through the Mac's firewall in the Control Panel, you should have a look at them.

        Make sure to read the Terms of Service for your provider. Few of them, if any, allow users to run websites from their home machines/connections. If they don't, you could probably do it ethically if your bandwidth was going to be low or the usage was chiefly personal but if your account got suspended you might be out a lot of time and effort and have to start over with a new provider or a VPS.

        These guys are in the US but I had a very good 2-year experience with them on a VPS account: JohnCompanies. If I needed one again, I'd go back to them in a second.

Re: The meaning of life, Perl and SML
by almut (Canon) on Nov 25, 2008 at 00:32 UTC

    Don't know how much you can/want to afford, but the easiest way would probably be to rent a Virtual Private Server (VPS). As you'll have root access, you can install essentially anything you want. VPSs have gotten rather cheap these days. For example, where I live you can get one for around 10 Euros per month...

      Thank you, almut!
      I knew of the "dedicated server" mode for millionairs, but didn't know that this VPS is an option, too, nowadays. I live in Holland, and the last time I did a serious search, each host server I found here had a serious flaw, most of them were far too expensive. My current host is in Germany and in fact offers "managed servers", too, but way to expensive. There are two big providers in Germany and they both have offers around 10-20 euros/month, as you said. I will check the details. ... Thank you very much indeed! (It probably is a sign of disrespect to ask a monk - but do you know a nice provider here or anywhere else in this universe?)
        do you know a nice provider

        Personally I'm using a VPS (for about two years now) of one of the big providers in Germany, and I can say that all in all I'm very satisfied. (I can't say much about the quality of their support, though, in case you'd want a human being at the other end — I've so far never had the need.)  Performance-wise, even the smallest option would seem more than sufficient for what you're planning to realize...

Re: The meaning of life, Perl and SML
by herveus (Prior) on Nov 25, 2008 at 17:02 UTC
    Howdy!

    I've been using http://nearlyfreespeech.net for a while now and have been satisfied with the services and facilities. I don't know if they have SML tools available, but you may be able to stand them up in your space. The price is pretty good, too, but it is aimed at the geekier side of the market. Frankly, that was a positive point for me.

    yours,
    Michael
      Thank you, Michael!
      NearlyFreeSpeech.net seems to have a very nice philosophy and approach. But among the 12 CGI languages they support is no ML, although OCaml and Haskell come very close already.
      At the moment I am very excited about all these new possibilities that suddenly appear since my post yesterday. I'd fancy the total freedom of an own server to mess around, but I am afraid for the limitations of my hardware and knowledge. So I might actually make a deal with this virtual server thing.
      Thank you again, you have all been very helpful!
        Howdy!

        You can always ask NearlyFreeSpeech about adding ML to the language set.

        yours,
        Michael