POV-Ray : Newsgroups : povray.off-topic : Lanugage suggestions? Server Time
4 Sep 2024 17:23:31 EDT (-0400)
  Lanugage suggestions? (Message 1 to 9 of 9)  
From: Chambers
Subject: Lanugage suggestions?
Date: 29 Dec 2009 19:25:01
Message: <web.4b3a9d04b97586d69c750ce10@news.povray.org>
I'm looking at doing some CGI scripting, where I would be retrieving data from a
SQL database, running some imperative commands (preferably with support for
custom objects / classes, as that would make things tremendously easier) and
then sending results back to a separate database.

The only scripting experience I really have in web pages is with PHP and JS; PHP
seems more geared towards HTML output than anything else, and JS is client-side
(while I need the scripts to be run server side).

I'm looking at Ruby, but since this is something I don't have much experience
with, I'd like to know what others here recommend.  Any thoughts?

....Chambers


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Language suggestions?
Date: 29 Dec 2009 19:34:31
Message: <4b3aa017@news.povray.org>
Chambers wrote:
> I'm looking at doing some CGI scripting, where I would be retrieving data
> from a SQL database, running some imperative commands (preferably with
> support for custom objects / classes, as that would make things
> tremendously easier) and then sending results back to a separate database.
> 
> The only scripting experience I really have in web pages is with PHP and
> JS; PHP seems more geared towards HTML output than anything else, and JS
> is client-side (while I need the scripts to be run server side).

Why not PHP? I have written many non-HTML scripts in PHP, including an IRC 
bot or two (long-running daemons), and a script that scrapes a search page 
to find spam and sends the needed POSTs to delete it. Although, of course, 
neither of those two were run through a web server. "php deletespam.php"

And here's a script to resize JPEG images to half their size, also to be run 
from a console and not from a browser/webserver: http://codepad.org/miaXuEIM


Post a reply to this message

From: nemesis
Subject: Re: Lanugage suggestions?
Date: 29 Dec 2009 20:20:00
Message: <web.4b3aaa0634eca077412fad2f0@news.povray.org>
"Chambers" <bdc### [at] yahoocom> wrote:
> I'm looking at Ruby, but since this is something I don't have much experience
> with, I'd like to know what others here recommend.  Any thoughts?

I like ruby.  It feels like a mix of the very best of Perl, Smalltalk and Scheme
under one clean (almost python-clean) syntax.  It also got the powerful and easy
Rails web framework, but you might be just as well served by the builtin
facilities for http in the stdlib.

PHP is web scripting's powerhorse, but it's butt-ugly.


Post a reply to this message

From: Chambers
Subject: Re: Language suggestions?
Date: 29 Dec 2009 20:20:00
Message: <web.4b3aaa72dcf69e569c750ce10@news.povray.org>
Nicolas Alvarez <nic### [at] gmailcom> wrote:
> Why not PHP? I have written many non-HTML scripts in PHP, including an IRC
> bot or two (long-running daemons), and a script that scrapes a search page
> to find spam and sends the needed POSTs to delete it.

I wasn't aware that PHP had full class / object support; looking it up, I see
that I was mistaken.

I'll try working this out in PHP.

....Chambers


Post a reply to this message

From: Darren New
Subject: Re: Lanugage suggestions?
Date: 29 Dec 2009 20:25:42
Message: <4b3aac16$1@news.povray.org>
Chambers wrote:
> I'm looking at doing some CGI scripting, [ ... ] PHP
> seems more geared towards HTML output than anything else, 

What is the relationship between CGI and the behavior of your scripts? Or 
are you using CGI to mean something other than "common gateway interface"?

I.e., why do you want to avoid HTML in the context of serving web pages?

That said, PHP works just fine without running as CGI. Beware that you 
properly clean up anything that loops over records - it's not intuitive in 
PHP when it actually disposes stuff you've pulled from the database, so 
looping over a few million records will likely fail.

-- 
Darren New, San Diego CA, USA (PST)
   Human nature dictates that toothpaste tubes spend
   much longer being almost empty than almost full.


Post a reply to this message

From: Warp
Subject: Re: Lanugage suggestions?
Date: 30 Dec 2009 03:04:39
Message: <4b3b0997@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> That said, PHP works just fine without running as CGI.

  I think PHP works just fine running as CGI as well.

-- 
                                                          - Warp


Post a reply to this message

From: Darren New
Subject: Re: Lanugage suggestions?
Date: 30 Dec 2009 05:18:14
Message: <4b3b28e6$1@news.povray.org>
Warp wrote:
> Darren New <dne### [at] sanrrcom> wrote:
>> That said, PHP works just fine without running as CGI.
> 
>   I think PHP works just fine running as CGI as well.

Indeed, to the extent that one likes PHP at all. But writing CGI scripts and 
complaining that your language generates HTML output seems to imply there's 
a confusion somewhere, either in the speaker or the listener.

-- 
Darren New, San Diego CA, USA (PST)
   Human nature dictates that toothpaste tubes spend
   much longer being almost empty than almost full.


Post a reply to this message

From: Chambers
Subject: Re: Lanugage suggestions?
Date: 30 Dec 2009 17:35:00
Message: <web.4b3bd56a34eca0779c750ce10@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> Chambers wrote:
> > I'm looking at doing some CGI scripting, [ ... ] PHP
> > seems more geared towards HTML output than anything else,
>
> What is the relationship between CGI and the behavior of your scripts? Or
> are you using CGI to mean something other than "common gateway interface"?

Actually, I just need an app to be run by the server, at the request of certain
web pages.  The output could then be retrieved by other web pages.

CGI is merely an easy way to link the web pages and the apps that need to be
called.

> I.e., why do you want to avoid HTML in the context of serving web pages?

It's not that HTML itself is a problem; it's that the app I need to write would
do some rather heavy duty processing which I am more experienced with writing in
C based languages.

....Chambers


Post a reply to this message

From: Darren New
Subject: Re: Lanugage suggestions?
Date: 30 Dec 2009 18:21:10
Message: <4b3be066@news.povray.org>
Chambers wrote:
> Actually, I just need an app to be run by the server, at the request of certain
> web pages.  The output could then be retrieved by other web pages.

So you're going to need to spawn a new process to handle things anyway, or 
your web browser will time out. Hence, you can use any language you want to 
do the computations, and use PHP to spawn it trivially.

> It's not that HTML itself is a problem; it's that the app I need to write would
> do some rather heavy duty processing which I am more experienced with writing in
> C based languages.

OK. If your "heavy duty processing" takes more than a minute or so, you need 
to write a CGI page that will start it, and another that will let you know 
if it's done and return the results, and you'll have to coordinate it.

-- 
Darren New, San Diego CA, USA (PST)
   Human nature dictates that toothpaste tubes spend
   much longer being almost empty than almost full.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.