Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » Is there a simple CGI library developed with U++?
Is there a simple CGI library developed with U++? [message #23592] Mon, 02 November 2009 20:48 Go to next message
forlano is currently offline  forlano
Messages: 1182
Registered: March 2006
Location: Italy
Senior Contributor
Rolling Eyes

Luigi
Re: Is there a simple CGI library developed with U++? [message #23597 is a reply to message #23592] Tue, 03 November 2009 15:07 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 693
Registered: December 2005
Location: Budapest, Hungary
Contributor
There are a lot of HTTP parsing functions in the Web package, so it shouldn't be too hard to create a CGI app, I think.
Re: Is there a simple CGI library developed with U++? [message #23622 is a reply to message #23592] Fri, 06 November 2009 06:17 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
I personally do it in a simple way:

Htmls content =
	HtmlHeader("Header", AsCss(css), ~style)
	    /  html;
	    
cout << HttpContentType(HttpTextHtml()) << "\r\n" << content;


Though, it would be better to have something similar to web frameworks below.

http://www.webtoolkit.eu/wt
http://art-blog.no-ip.info/wikipp/en/page/main


Regards,
Novo
Re: Is there a simple CGI library developed with U++? [message #23625 is a reply to message #23622] Sat, 07 November 2009 07:00 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I would like to go that way.

Mirek
Re: Is there a simple CGI library developed with U++? [message #23627 is a reply to message #23622] Sat, 07 November 2009 12:32 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 693
Registered: December 2005
Location: Budapest, Hungary
Contributor
The idea behind this Wt is very good, I think.
The only problem with it is the extensive usage of the new operator and the internal management of the widgets.
Re: Is there a simple CGI library developed with U++? [message #23635 is a reply to message #23627] Mon, 09 November 2009 02:39 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
zsolt wrote on Sat, 07 November 2009 06:32

The idea behind this Wt is very good, I think.
The only problem with it is the extensive usage of the new operator and the internal management of the widgets.


Upp can help get rid of all these new operators. It already has a quite simple and efficient set of classes to generate HTML. Adding support for JavaScript (and, probably, for ActionScript) would help develop better looking web-sites.

That should be done in a simple way. Smile


Regards,
Novo
Re: Is there a simple CGI library developed with U++? [message #23674 is a reply to message #23627] Thu, 12 November 2009 11:31 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1182
Registered: March 2006
Location: Italy
Senior Contributor
zsolt wrote on Sat, 07 November 2009 12:32

The idea behind this Wt is very good, I think.
The only problem with it is the extensive usage of the new operator and the internal management of the widgets.


I agree. I had a look at it and it seems able to do everything. The "new" operator that appear everywhere is really annoying and to me, used to U++ style, looks very stupid. I am not an expert and wonder why all other GUI like so much the "new" operator and which adavantages it offer if any and at which cost.

Now a silly question: that library (o others) born with a "new", is it possible in principle with a simply wrapper to let disappear that operator or is it necessary to rewrite it from scratch?

Luigi
Re: Is there a simple CGI library developed with U++? [message #23676 is a reply to message #23674] Thu, 12 November 2009 14:54 Go to previous messageGo to next message
andrei_natanael is currently offline  andrei_natanael
Messages: 262
Registered: January 2009
Experienced Member
forlano wrote on Thu, 12 November 2009 12:31

The "new" operator that appear everywhere is really annoying and to me, used to U++ style, looks very stupid. I am not an expert and wonder why all other GUI like so much the "new" operator and which adavantages it offer if any and at which cost.


The new operator introduce "lag" in your application because memory allocation takes time and also increase the memory footprint because it need "extra" pointers. If you compare two applications with and without new operator usage you'll see that. The only benefit is the small size of executable and of course when you don't know at compile time the size of the object you have to keep in memory. Well there is one more, you may store the implementation of class in a library and hold in executable only a pointer to it.

Andrei
Re: Is there a simple CGI library developed with U++? [message #23684 is a reply to message #23674] Fri, 13 November 2009 13:40 Go to previous message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
forlano wrote on Thu, 12 November 2009 11:31

Now a silly question: that library (o others) born with a "new", is it possible in principle with a simply wrapper to let disappear that operator or is it necessary to rewrite it from scratch?

Luigi


You can maybe wrap the library so you will not SEE those news, but they have to remain there unless you rewrite the actual library.

The U++ way is to hide new by either using stack space of function or NTL containers (which hide the new for programmer inside them). So by using U++ you are not that much getting rid of dynamic memory allocation, as you make it just to hide in the source, so you don't have to bother with it. And you do less mistakes.

There's no good reason to see difference in performance between U++ program and well written C++ with new (except U++ using it's own memory heap manager with more optimal new function). There can be some performance gains when you do use static memory allocated at start of program, but that's rarely worth the hassle, only for some special applications.

As always, the memory is not filled up/allocated/freed by some magic, it's done by *your* code. So *you* should know how much memory and for what you need, when you need it, and then, when you know this, you can decide what's the most optimal way to allocate it. Usually GUI applications done in U++ (the widgets are allocated on function heap and NTL containers used for lists) are close to optimal and you don't need anything else. And it's easier to write for developer, than C++ with properly used new/delete, although the final application would be as good as U++ one. Easier to develop = cheaper. Smile
Previous Topic: Example Hello World Client/Server Broken?
Next Topic: request: Socket working example
Goto Forum:
  


Current Time: Fri Mar 29 16:05:49 CET 2024

Total time taken to generate the page: 0.01423 seconds