Re: [Chicken-users] Choosing a programming language for a web project
On 9/29/07, Jean-Philippe Théberge <[EMAIL PROTECTED]> wrote: > I'm in the process of choosing a programming language. I am investigating > PHP5, Python, Ruby and, of course, Scheme. Is it a one-developer project? If not, will your colleagues be comfortable with Scheme? Are the libraries you require available in Chicken; and if not, are you willing to put in the time to develop them? If you're integrating with existing C libraries, will you be comfortable working with the FFI? The SSAX tools are excellent; Chicken's database support is pretty good; there are some nice eggs related to Web apps; and of course there are loads of general application-development eggs. Review the eggs list (http://call-with-current-continuation.org/eggs) if you haven't already; to see what is available, and what you must develop yourself. If you have a "do-it-yourself" mentality, I think you will find Chicken / Scheme very rewarding (as I certainly have). If you just want to get your project done quickly, it may not be the right choice, given the number of frameworks and libraries in Python and Ruby (and given the unknown nature of your application). Graham ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Choosing a programming language for a web project
> On 9/29/07, Jean-Philippe Théberge <[EMAIL PROTECTED]> wrote: >> I'm in the process of choosing a programming language. I am >> investigating >> PHP5, Python, Ruby and, of course, Scheme. > > Is it a one-developer project? If not, will your colleagues be > comfortable with Scheme? > This is a one-programmer project for the start, more will join later so yes, programmer recruitement is an issue that scheme is not really good at. Most of what is needed is available with chicken (mysql, tinyCLOS, ssax) I have benchmarked all thoses languages and chicken, even interpreted, is a clear winner. Python seem a good alternative but since the project start with me as the only programmer and I have no experience with it I am afraid that this could lead me to make mistake I will regret later when my knowledge of the language will be stronger. I could do it in PHP as I have a lot of experience with it. But I really dont like this language. I have a good knowledge of scheme but none with chicken. (I'm used to guile and Gauche). I dont know much about Ruby but browsing the documentation and doing the simple script for the benchmark did not give me a good feeling. So the question is: Is programmer recruitement that important and are good scheme programmer so rare? Does Chicken have strong concrete advantage over other languages beside my "I dont like it" and "I have a bad feeling about it" For the record, here's the benchmark result (average of 50 invocations of "time -f %U" on a script doing a simple but lenghty SQL query) "./php5.php":0.0378 "./chicken": 0.017 "./chicken.scm": 0.0202 "./gauche.scm": 0.193 "./python.py": 0.1224 "./ruby.rb": 0.0252 "./perl.pl": 0.1154 > Are the libraries you require available in Chicken; and if not, are > you willing to put in the time to develop them? If you're integrating > with existing C libraries, will you be comfortable working with the > FFI? > There is no existing C lib that I need to link to, but It seem that the possibility of writing in C for mission critical part of the project (and linking to them) can be done more easily with chicken than the other languages - but I havent tried it yet. > The SSAX tools are excellent; Chicken's database support is pretty > good; there are some nice eggs related to Web apps; and of course > there are loads of general application-development eggs. Review the > eggs list (http://call-with-current-continuation.org/eggs) if you > haven't already; to see what is available, and what you must develop > yourself. > Yes, SSAX is, to me, one of the greatest thing since the wheel. > If you have a "do-it-yourself" mentality, I think you will find > Chicken / Scheme very rewarding (as I certainly have). If you just > want to get your project done quickly, it may not be the right choice, > given the number of frameworks and libraries in Python and Ruby (and > given the unknown nature of your application). > I mostly have that "do it yourself" mentality, but I do appreciate good libraries also, especialy when I'm short of time. > Graham > Thanks Graham! -- Jean-Philippe Théberge Programmeur-Architecte http://www.BuddyPilots.com ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Choosing a programming language for a web project
On 9/29/07, Jean-Philippe Théberge <[EMAIL PROTECTED]> wrote: > So the question is: Is programmer recruitement that important and are good > scheme programmer so rare? Must the programmers be on-site? If so, what location? ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Choosing a programming language for a web project
> On 9/29/07, Jean-Philippe Théberge <[EMAIL PROTECTED]> wrote: > >> So the question is: Is programmer recruitement that important and are >> good >> scheme programmer so rare? > > Must the programmers be on-site? Not necessarily, this have to be decided. I think on-side programmer (or, at least, near enough to have meetings at least once a month) is preferable, but if I finally decide to use scheme and good on-site programmers are unavailable, off-site is an option. > If so, what location? Montreal, Canada. I've found something interesting about recruiting scheme programmers: http://theschemeway.blogspot.com/2007/07/recruiting-secret-weapon.html -- Jean-Philippe Théberge Programmeur-Architecte http://www.BuddyPilots.com ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Choosing a programming language for a web project
On Sat, Sep 29, 2007 at 12:17:14PM -0400, Jean-Philippe Th?berge wrote: > I have benchmarked all thoses languages and chicken, even interpreted, is > a clear winner. Cool! The ability to compile is a great benefit, too. Also consider the ease with which you can integrate parts in C if necessary. I imagine this is a lot harder with the other languages. > I could do it in PHP as I have a lot of experience with it. But I really > dont like this language. Yep, same here. But it's lightning fast. > I have a good knowledge of scheme but none with chicken. (I'm used to > guile and Gauche). That should not be a major problem. There's good documentation and a responsive and helpful community. > I dont know much about Ruby but browsing the documentation and doing the > simple script for the benchmark did not give me a good feeling. We use Ruby on Rails extensively at work, and I'm not happy with it. We're currently in the process of trying to solve a major performance issue and things are looking very grim. The overhead seems to be pretty evenly spread around in an inner loop, and after spending two days on it, I haven't been able to squeeze any noticable speed improvements out of it. The delay is not in the database, we've measured that all the queries take about 0.003 seconds. The request as a whole takes 7 seconds to complete. Hmm.. I think I now have some ammo to convince my boss not to use Ruby anymore :) It's a pretty well known secret in the Ruby community that the performance of MRI (Matz Ruby Implementation, the current Ruby interpreter) is absolute shit. Also, if you're looking into Rails, there are some pretty horrible problems in the framework and in general in the mindset of the Ruby community. Ruby itself also has problems as a language. At first, it looks beautiful, but as you dig in deeper, you end up with a truckload of warts you need to be mindful of in your daily programming. Many are syntax related, but there are lots of semantic problems as well (scoping works badly, protected/private is meaningless because it can be circumvented (and many libraries do so with abandon), blocks are not "really" first-class, etc etc) > So the question is: Is programmer recruitement that important and are good > scheme programmer so rare? Scheme programmers are pretty rare, but within the set of scheme programmers, good scheme are _not_ rare. Put differently, given any programmer, if he is a scheme programmer, the chances that he is a bad programmer are much less than they would be if he was, say, a Java programmer. This is because mediocre programmers often choose to learn languages solely because they will be able to get a job better if they know it, while people who learn or like scheme are more likely to know it because they wanted to learn a different language because it would make them a better programmer. This goes for any non-mainstream language. > I mostly have that "do it yourself" mentality, but I do appreciate good > libraries also, especialy when I'm short of time. Chicken has > 300 eggs and counting... The biggest problem currently with web programming is that there are some web things missing like a good db abstraction and a web framework in general, but work is underway.. :) Peter -- http://sjamaan.ath.cx -- "The process of preparing programs for a digital computer is especially attractive, not only because it can be economically and scientifically rewarding, but also because it can be an aesthetic experience much like composing poetry or music." -- Donald Knuth pgplsRyHPx5v7.pgp Description: PGP signature ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Choosing a programming language for a web project
On Sep 29, 2007, at 7:23 AM, Jean-Philippe Théberge wrote: Hi Chicken users! I will be the main developper for a new high-scale, database intensive web-based application. The nature of the project call for a object-orientated language with a good support for XML manipulation. So any inputs, advices or ideas from the chicken community are welcome. How important is Windows as a delivery platform? http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Choosing a programming language for a web project
On Sep 29, 2007, at 6:15 PM, Jean-Philippe Théberge wrote: Jean-Philippe Théberge scripsit: You essentially never need to do that, because Chicken compiles into C anyhow, so just write in Scheme and leave it at that. Speed is a great advantage of Chicken over the usual "scripting languages". There is also the 'crunch' Chicken compiler. It takes an R5RS subset related to numeric & character vector/scalar & does a tight job. A decent choice for some algorithms. Available as an "egg." I guess (but maybe I'm wrong) that in some case, code written directly in C will be better than the C generated by chicken. How is the readeability of the chicken generated C? The GNU C compiler can parse it just fine. But if you are not a C compiler, well, see http://galinha.ucpel.tche.br/chicken-compilation- process. Best Wishes, Kon BTW, I guess should have asked if Windows is a desired hosting platform. But it seems you answered anyway. -- ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Choosing a programming language for a web project
> Jean-Philippe Théberge scripsit: > >> There is no existing C lib that I need to link to, but It seem that the >> possibility of writing in C for mission critical part of the project >> (and >> linking to them) can be done more easily with chicken than the other >> languages - but I havent tried it yet. > > You essentially never need to do that, because Chicken compiles into C > anyhow, so just write in Scheme and leave it at that. Speed is a great > advantage of Chicken over the usual "scripting languages". > I guess (but maybe I'm wrong) that in some case, code written directly in C will be better than the C generated by chicken. How is the readeability of the chicken generated C? -- Jean-Philippe Théberge Programmeur-Architecte http://www.BuddyPilots.com > -- > The Imperials are decadent, 300 pound John Cowan <[EMAIL PROTECTED]> > free-range chickens (except they have http://www.ccil.org/~cowan > teeth, arms instead of wings, and > dinosaurlike tails).--Elyse Grasso > ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Choosing a programming language for a web project
> > On Sep 29, 2007, at 7:23 AM, Jean-Philippe Théberge wrote: > >> Hi Chicken users! >> >> I will be the main developper for a new high-scale, database intensive >> web-based application. The nature of the project call for a >> object-orientated language with a good support for XML manipulation. >> > >> So any inputs, advices or ideas from the chicken community are >> welcome. > > How important is Windows as a delivery platform? > Not at all as it is web-based (and hosted on a debian server). It is not impossible, at some point in the future, that client software will be developped but it will more than probably communicate to the server via http (something like SOAP I guess) and will not compute much on it's own. -- Jean-Philippe Théberge Programmeur-Architecte http://www.BuddyPilots.com >> > > ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Choosing a programming language for a web project
I have a small data point to add to this thread I just went though a similar process of evaluating what to do for web development. In my case I have a site I put together using Ruby/IOWA where I had run into some serious road blocks and was not making any progress. I then spent far too much time trying to rewrite the site in Ruby on Rails. Sitting there frustrated one day on vacation in Mexico I suddenly decided to take a leap of faith and I took a stab at using chicken + cgi to write a framework of sorts and started translating my site. That was the best thing I could have done. I'm now progressing rapidly in migrating my site away from Ruby/IOWA and performance under CGI is competitive with IOWA and much better than "out of the box" Rails. From working with Rails I got used to the MVC and DRY principles and used them in putting together my mini-framework. The core of the framework is compiled and the pages, models and controllers are interpreted. The one annoyance to this for which I do not have a satisfactory solution is that with chicken you cannot load files with new class definitions into a running compile executable (at least not with tiny-clos). I'm have experimented with aproximating objects using vanilla scheme which works ok but I have been supprised by how much I miss using inheritance. I may resort to compiling the models to .so files which I think would allow me to use tiny-clos but then I give up some of the "edit on the fly" nature of the scripted portion of the site. Anyhow, my purpose in writing this is that for me the decision to switch to chicken was wonderful. For my simple site chicken has everything I need as an egg. The various frameworks are attractive (maybe seductive?) but when push comes to shove getting down to the metal really seems to work. At least it has worked (so far) for me. I hope this helps. Matt -- On Saturday 29 September 2007 09:17:14 am Jean-Philippe Théberge wrote: > > > > On 9/29/07, Jean-Philippe Théberge <[EMAIL PROTECTED]> wrote: > >> I'm in the process of choosing a programming language. I am > >> investigating > >> PHP5, Python, Ruby and, of course, Scheme. > > > > Is it a one-developer project? If not, will your colleagues be > > comfortable with Scheme? > > This is a one-programmer project for the start, more will join later so > yes, programmer recruitement is an issue that scheme is not really good > at. > > Most of what is needed is available with chicken (mysql, tinyCLOS, ssax) > > I have benchmarked all thoses languages and chicken, even interpreted, is > a clear winner. > > Python seem a good alternative but since the project start with me as the > only programmer and I have no experience with it I am afraid that this > could lead me to make mistake I will regret later when my knowledge of > the language will be stronger. > > I could do it in PHP as I have a lot of experience with it. But I really > dont like this language. > > I have a good knowledge of scheme but none with chicken. (I'm used to > guile and Gauche). > > I dont know much about Ruby but browsing the documentation and doing the > simple script for the benchmark did not give me a good feeling. > > So the question is: Is programmer recruitement that important and are > good scheme programmer so rare? > > Does Chicken have strong concrete advantage over other languages beside > my "I dont like it" and "I have a bad feeling about it" > > For the record, here's the benchmark result (average of 50 invocations of > "time -f %U" on a script doing a simple but lenghty SQL query) > > "./php5.php":0.0378 > "./chicken": 0.017 > "./chicken.scm": 0.0202 > "./gauche.scm": 0.193 > "./python.py": 0.1224 > "./ruby.rb": 0.0252 > "./perl.pl": 0.1154 > > > Are the libraries you require available in Chicken; and if not, are > > you willing to put in the time to develop them? If you're integrating > > with existing C libraries, will you be comfortable working with the > > FFI? > > There is no existing C lib that I need to link to, but It seem that the > possibility of writing in C for mission critical part of the project (and > linking to them) can be done more easily with chicken than the other > languages - but I havent tried it yet. > > > The SSAX tools are excellent; Chicken's database support is pretty > > good; there are some nice eggs related to Web apps; and of course > > there are loads of general application-development eggs. Review the > > eggs list (http://call-with-current-continuation.org/eggs) if you > > haven't already; to see what is available, and what you must develop > > yourself. > > Yes, SSAX is, to me, one of the greatest thing since the wheel. > > > If you have a "do-it-yourself" mentality, I think you will find > > Chicken / Scheme very rewarding (as I certainly have). If you just > > want to get your project done quickly, it may not be the right choice, > > given the number of frameworks and libraries in Python and Ruby (and >
Re: [Chicken-users] Choosing a programming language for a web project
On 29-Sep-07, at 7:58 PM, Graham Fawcett wrote: On 9/29/07, Jean-Philippe Théberge <[EMAIL PROTECTED]> wrote: If so, what location? Montreal, Canada. Well, that changes everything. From what I hear, if you throw a stick along rue Sherbrooke, you'll hit at least two Schemers (and one anglo). ;-) Indeed there are a few companies using scheme here in Montreal. But it's always a challenge to propose it for a serious project in a company. The problem is usually not the boss but the coworkers. I've been using Chicken for 2 years for one of our NLP projects along with our C++ tools. It's used for some heavy computational work, binding some very big C++ libraries, running on lots 64b cpus on a grid, using 8G+ RAM, on very long calculations involving multi- gigabyte data, and all of this without the slightest problem. I must say in very impressed. (I'm still using v2.35 though) For me, the areas where I want to use scheme is where I have to do serious work on trees: NLP, compiling,etc. Web processing is also mostly about tree transformation. Macros, closures, tail recursion, quasiquotation, and the "match" library are powerfull tools that can be used for intelligent and elegant tree processing. Performance is quite acceptable. The numeric part are better done in C/C++, but then Chicken FFI is excellent, and that was one of the reasons why we first chose Chicken (the libraries where another one). One serious limitation of Chicken is that is can't be used within OS- level multithreading. One could argue that in most cases multiple processes are a better choice. But in my case, it prevented me from more using it more widley by embedding it in our main C++ environment which is multithreaded. And that's sad, because Chicken so easy to embed. One crucial aspect of the decision to chose a non-mainstream technology is the support and the dynamism of the community. And for Chicken, it's nothing short of amazing! Houman ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Choosing a programming language for a web project
Jean-Philippe Théberge scripsit: > There is no existing C lib that I need to link to, but It seem that the > possibility of writing in C for mission critical part of the project (and > linking to them) can be done more easily with chicken than the other > languages - but I havent tried it yet. You essentially never need to do that, because Chicken compiles into C anyhow, so just write in Scheme and leave it at that. Speed is a great advantage of Chicken over the usual "scripting languages". -- The Imperials are decadent, 300 pound John Cowan <[EMAIL PROTECTED]> free-range chickens (except they have http://www.ccil.org/~cowan teeth, arms instead of wings, and dinosaurlike tails).--Elyse Grasso ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Choosing a programming language for a web project
On 9/29/07, Jean-Philippe Théberge <[EMAIL PROTECTED]> wrote: > > > If so, what location? > Montreal, Canada. Well, that changes everything. From what I hear, if you throw a stick along rue Sherbrooke, you'll hit at least two Schemers (and one anglo). ;-) My advice is, don't trust us -- we're already brainwashed. ;-) Just give Chicken a try; develop a small version of your application, and get a feel for Chicken's differences from Gauche, and its suitability to your needs. If you get stuck, ask & we'll be happy to help. Your fellow Canadian, Graham ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Choosing a programming language for a web project
Jean-Philippe Théberge scripsit: > I guess (but maybe I'm wrong) that in some case, code written directly in > C will be better than the C generated by chicken. Floating-point code is not good, it's true, because Chicken boxes all floats, but Web development doesn't need much of that. Integer processing loses something by being in Chicken, but almost everything else is about as good in Chicken as in C, I'd say. > How is the readeability of the chicken generated C? I would say that you can eventually decipher it with practice, but it is certainly not meant for readability. Furthermore, each Scheme procedure is broken into many C procedures with arbitrary names. -- First known example of political correctness: John Cowan After Nurhachi had united all the other http://www.ccil.org/~cowan Jurchen tribes under the leadership of the [EMAIL PROTECTED] Manchus, his successor Abahai (1592-1643) issued an order that the name Jurchen should --S. Robert Ramsey, be banned, and from then on, they were all The Languages of China to be called Manchus. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Choosing a programming language for a web project
On Sat, Sep 29, 2007 at 06:56:46PM -0700, Matthew Welland wrote: > From working with Rails I got used to the MVC and DRY principles and used > them in putting together my mini-framework. Did you consider making it into an egg? Peter -- http://sjamaan.ath.cx -- "The process of preparing programs for a digital computer is especially attractive, not only because it can be economically and scientifically rewarding, but also because it can be an aesthetic experience much like composing poetry or music." -- Donald Knuth pgpR5oggZAKdR.pgp Description: PGP signature ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Choosing a programming language for a web project
On 10/1/07, Peter Bex <[EMAIL PROTECTED]> wrote: > On Sat, Sep 29, 2007 at 06:56:46PM -0700, Matthew Welland wrote: > > From working with Rails I got used to the MVC and DRY principles and used > > them in putting together my mini-framework. > > Did you consider making it into an egg? FWIW, Peter, I also have a mini-framework I've been meaning to eggify. I wonder how many of us have rolled their own? It would be nice to consider a WSGI-like layer for Chicken that would encourage decoupling between protocol implementations (HTTP, SCGI, CGI, etc.) and application frameworks. My framework borrows somewhat from the WSGI approach, though I only have an SCGI connector at this point. Perhaps it will be a sign of Chicken's maturity if it begins to suffer from the "too many Web frameworks problem" that Python encountered a few years ago. :-) Graham ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Choosing a programming language for a web project
On Monday 01 October 2007 01:07:39 am Peter Bex wrote: > On Sat, Sep 29, 2007 at 06:56:46PM -0700, Matthew Welland wrote: > > From working with Rails I got used to the MVC and DRY principles and > > used them in putting together my mini-framework. > > Did you consider making it into an egg? > > Peter I'd like to. Right now it is in too rough a shape for making into an egg. I'll make a tar available for any interested folks to look at within the next week or so. Matt -- ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Choosing a programming language for a web project
This is the kind of user experience that needs to be publicized. :) On 9/29/07, Houman Zolfaghari <[EMAIL PROTECTED]> wrote: > I've been using Chicken for 2 years for one of our NLP projects along > with our C++ tools. It's used for some heavy computational work, > binding some very big C++ libraries, running on lots 64b cpus on a > grid, using 8G+ RAM, on very long calculations involving multi- > gigabyte data, and all of this without the slightest problem. I must > say in very impressed. (I'm still using v2.35 though) ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Choosing a programming language for a web project
> FWIW, Peter, I also have a mini-framework I've been meaning to eggify. > I wonder how many of us have rolled their own? I too would like to see them. Even if not in an egg form. An example app would be good enough for me. Perhaps the classic Reddit clone? I've been looking at some Lisp frameworks that use that as an example: http://bc.tech.coop/blog/051221.html That page highlights KPAX as one example CL framework. An interesting approach in KPAX is use of object prevalence instead of a RDBMS or similar for data storage. Is anyone in the chicken world doing something similar? I've been thinking about porting the CL implementation KPAX uses over to chicken, but I wouldn't mind saving myself the effort. Cheers, -Mark (Apologies to Graham who is seeing this for the 2nd time. I didn't realize the list didn't munge my reply headers. Mea culpa) ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Choosing a programming language for a web project
In reply to an off-list message: > Perhaps it is just me (I don't know much about these protocols), but I do > not see the added value of yet another FastCGI/SCGI kind of interface. WSGI is not another FastCGI/SCGI: it's a boundary between a "front-end" protocol handler (such as an HTTP server, SCGI server, or a CGI environment) and the "back-end" application framework. From the framework's perspective, it provides an abstract model of what a request looks like, and how to submit a response. With something like WSGI, you could move your application from CGI to SCGI (for example) without any significant rewriting of your code. In my own mini-framework, my SCGI handler reads the request headers into an a-list. (In SCGI, request headers are represented by CGI-style environment variables.) The current input port is partially read by the SCGI handler (to get the headers), but the rest of the request is left for the "framework" to read. The framework is required to consume the remainder of the request. Response headers are represented by an (initially empty) a-list. The current-output-port is mapped to a string-port: collecting the output makes error-handling easier, and the buffering makes network communication more efficient. When the framework has finished writing the response, the SCGI handler consumes the response a-list, and the string-port's value, and sends it back to the Web server in SCGI format. So, in my WSGI-like interface for Chicken, a request/response pair is a 4-tuple, (incoming-request-headers, current-input-port, current-output-port, outgoing-response-headers). The application framework is represented by a single procedure that takes a 4-tuple as an argument, and returns no value. Upon an inbound request, the protocol side calls the procedure, and afterward it processes the outbound headers and output string-port. That, I think, is about as minimal as you can get, while still being "robust" and being flexible enough to accommodate many protocols and many app frameworks. Thoughts? Graham ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Choosing a programming language for a web project
On 10/1/07, Mark Fredrickson <[EMAIL PROTECTED]> wrote: > > FWIW, Peter, I also have a mini-framework I've been meaning to eggify. > > I wonder how many of us have rolled their own? > > I too would like to see them. Even if not in an egg form. An example > app would be good enough for me. Perhaps the classic Reddit clone? > I've been looking at some Lisp frameworks that use that as an example: That would be fun: a dozen Chicken reddits to drool over. > That page highlights KPAX as one example CL framework. An interesting > approach in KPAX is use of object prevalence instead of a RDBMS or > similar for data storage. Is anyone in the chicken world doing > something similar? I've been thinking about porting the CL > implementation KPAX uses over to chicken, but I wouldn't mind saving > myself the effort. Personally, I would not want my Web framework to place any constraints on my persistence strategy. I'm okay with object persistence for some projects -- not everything really suits an rdbms -- but it's a separate problem. If someone wants to grow an uber-framework that does constrain such things, I would hope it was built upon smaller, independently usable pieces. > (Apologies to Graham who is seeing this for the 2nd time. I didn't > realize the list didn't munge my reply headers. Mea culpa) Ditto for my response, Mark. :-) G ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Choosing a programming language for a web project
On 10/2/07, Graham Fawcett <[EMAIL PROTECTED]> wrote: > In reply to an off-list message: > > Perhaps it is just me (I don't know much about these protocols), but I do > > not see the added value of yet another FastCGI/SCGI kind of interface. > > WSGI is not another FastCGI/SCGI: it's a boundary between a > "front-end" protocol handler (such as an HTTP server, SCGI server, or > a CGI environment) and the "back-end" application framework. From the > framework's perspective, it provides an abstract model of what a > request looks like, and how to submit a response. With something like > WSGI, you could move your application from CGI to SCGI (for example) > without any significant rewriting of your code. I will just add a relevant link: http://wsgi.org/wsgi See also the WSGI 2.0 specification, where the minimal application is something like def app(environ): return '200 OK', [('Content-type', 'text/plain')], ['Hello world'] > In my own mini-framework, my SCGI handler reads the request headers > into an a-list. (In SCGI, request headers are represented by CGI-style > environment variables.) The current input port is partially read by > the SCGI handler (to get the headers), but the rest of the request is > left for the "framework" to read. The framework is required to consume > the remainder of the request. > > Response headers are represented by an (initially empty) a-list. The > current-output-port is mapped to a string-port: collecting the output > makes error-handling easier, and the buffering makes network > communication more efficient. When the framework has finished writing > the response, the SCGI handler consumes the response a-list, and the > string-port's value, and sends it back to the Web server in SCGI > format. > > So, in my WSGI-like interface for Chicken, a request/response pair is > a 4-tuple, (incoming-request-headers, current-input-port, > current-output-port, outgoing-response-headers). The application > framework is represented by a single procedure that takes a 4-tuple as > an argument, and returns no value. Upon an inbound request, the > protocol side calls the procedure, and afterward it processes the > outbound headers and output string-port. > > That, I think, is about as minimal as you can get, while still being > "robust" and being flexible enough to accommodate many protocols and > many app frameworks. > > Thoughts? I am not convinced by the current-output-port. In WSGI you return an iterator over strings (say a list) so that middleware can further process it. Post-processing the current-output-port looks more cumbersome. Just my 0.02c, Michele Simionato ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Choosing a programming language for a web project
On 10/2/07, Graham Fawcett <[EMAIL PROTECTED]> wrote: > > That, I think, is about as minimal as you can get, while still being > "robust" and being flexible enough to accommodate many protocols and > many app frameworks. > I think the power of personal mini-frameworks is greatly underappreciated. Truly elegant solutions emerge like this - it's once they are generalized to a common mediocrity and stuffed with features they become buggy, awkward to use and more and more useless. cheers, felix ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Choosing a programming language for a web project
On Tuesday 02 October 2007 12:11:09 am felix winkelmann wrote: > On 10/2/07, Graham Fawcett <[EMAIL PROTECTED]> wrote: > > That, I think, is about as minimal as you can get, while still being > > "robust" and being flexible enough to accommodate many protocols and > > many app frameworks. > > I think the power of personal mini-frameworks is greatly > underappreciated. Truly elegant solutions emerge like this - it's once > they are generalized to a common mediocrity and stuffed with features > they become buggy, awkward to use and more and more useless. This is exactly what I learned in my "Tour de Frameworks". I think it would be great if there was a range of *thin* frameworks available for Chicken that gave folks a variety of starting points to accomodate different needs and styles. I am no longer a believer in heavy weight "do it all" frameworks. Matt -- > cheers, > felix > > > ___ > Chicken-users mailing list > Chicken-users@nongnu.org > http://lists.nongnu.org/mailman/listinfo/chicken-users -- http://www.kiatoa.com, fight for a better world. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Choosing a programming language for a web project
Hi Michele, On 10/2/07, Michele Simionato <[EMAIL PROTECTED]> wrote: > I will just add a relevant link: > http://wsgi.org/wsgi > > See also the WSGI 2.0 specification, where the minimal application is > something > like > > def app(environ): > return '200 OK', [('Content-type', 'text/plain')], ['Hello world'] Thanks, that's clearer than my explanation. > > So, in my WSGI-like interface for Chicken, a request/response pair is > > a 4-tuple, (incoming-request-headers, current-input-port, > > current-output-port, outgoing-response-headers). The application > > framework is represented by a single procedure that takes a 4-tuple as > > an argument, and returns no value. Upon an inbound request, the > > protocol side calls the procedure, and afterward it processes the > > outbound headers and output string-port. > I am not convinced by the current-output-port. In WSGI you return an > iterator over strings (say a list) so that middleware can further process it. > Post-processing the current-output-port looks more cumbersome. That's fair, though perhaps it depends on what type of post-processing the middleware might do? In some cases, might processing the entire output as a whole string be more effective? I don't have real experience with WSGI middleware, so I can only speculate. A custom output-port could be used to provide iteration: writing a string to the port would invoke the continuation of the middleware, which would process (or queue) that piece, and then return to the application. From the application perspective, it would be transparent: just writing to the port generates the piecewise feed for the middleware. One can imagine the application and middleware components as a chain of generators, with the protocol-handler as the ultimate consumer. I suppose that's the WSGI style. Since my preferred approach (just print it!) could be modeled in your preferred one (iterator of strings), I am going to sit on the fence on this one! > Just my 0.02c, At least a dollar's worth. ;-) G ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Choosing a programming language for a web project
Am Montag, den 01.10.2007, 10:45 -0400 schrieb Graham Fawcett: > Perhaps it will be a sign of Chicken's maturity if it begins to suffer > from the "too many Web frameworks problem" that Python encountered a > few years ago. :-) Once in a while I have to speak up on that topic. All of you, who are interested in Scheme (web) application frameworks might want to have a look at www.askemos.org Usually I'm somewhat silent at this list, because Askemos is still tied rscheme, not chicken (because of some FFI code, no more; otherwise it's R5RS Scheme). Though we have set aside some human resources to complete the half done port to chicken in the medium future. So, why could askemos be interesting to you? Because it's a powerful Scheme programming framework even novices can use. In contrast to "normal" server side frameworks, Askemos replaces the server side with a P2P network, replicating computation in a intrusion resistant manner (up to a certain percentage of malicious nodes). This is meant to change the world - a bit: we have a german lawyers expertise on the web on how eletronic evidence based on these "multivalent" electronic signatures compares to traditional "monovalent" (plain old cryptographic) signatures in german civil lawsuits. It's changing the value from "if one side expresses doubt about the evidence value, then it has none since experts wittness will show how data could have been forged" to what the lawyer calls "visible evidence" (word by word translation of the german legal term, dunno about the correct english one), which means "if one side want to question the evidence value, *they* need to proof it wrong". Quite a difference for electronic business and I doubt any jurisdiction will be much different in that respect. I've been hearing doubt that this will ever work and how performance is going to be. Current state: each agent can do ~5 transactions per second (over SSL/WAN). Due to "network wether conditions" the actual value is somewhere between 3-10 transaction per second (and just 0.5 if no existing SSL connection can be reused). The development/test network is available at >94% over the past years (the figure includes a 4 week down time due to burn out syndrome at the wrong moment). Several programmers are building applications as their day job. (E.g., I've seen a Plone clone these days making fast progress.) Sure, you can run just a single application proxy as your whole network (thus making it an "traditional" application *server* instead of a P2P proxy). You'll loose the intrusion resistance that way and gain about a factor of 5 in speed. To get started 3 semesters of computer since and a little Scheme knowledge will easily get you going. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Choosing a programming language for a web project
On Tue, Oct 02, 2007 at 10:33:42AM +0200, Joerg F. Wittenberger wrote: > All of you, who are interested in Scheme (web) application frameworks > might want to have a look at www.askemos.org Actually, Askemos is one of the most interesting concepts I heard of in that field. A distributed encoded filesystem is just one of its many uses. A robust, quick working implementation (Chicken sounds fine), would be good for all parties. So, what can be done? Benedikt ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Choosing a programming language for a web project
Am Dienstag, den 02.10.2007, 23:42 +0200 schrieb Benedikt Rosenau: > On Tue, Oct 02, 2007 at 10:33:42AM +0200, Joerg F. Wittenberger wrote: > > > All of you, who are interested in Scheme (web) application frameworks > > might want to have a look at www.askemos.org > > Actually, Askemos is one of the most interesting concepts I > heard of in that field. A distributed encoded filesystem is > just one of its many uses. > > A robust, quick working implementation (Chicken sounds fine), > would be good for all parties. So, what can be done? >Benedikt State of development: Peter Hochgemuth <[EMAIL PROTECTED]> is currently working on making things easy to get started. He did debian packages and BSD ports for RScheme and Askemos these days. Expect them on the Askemos web site soon. I'll drop a note on this list (since I'm seeing some more interest). What can be done? (Sorry for the following topic jumping.) First note: RScheme's way is quite similar to chicken wrt. user level threads. The FFI is similar, though chicken is much more advanced in that respect. No show stoppers to be expected. Askemos has been developed in a very practical manner. It's basics run since years, with incremental improvements being made and rolled out into the working network, while other programmers where actively using it at the application level. So things always work, otherwise my phone rings right away. There's a lot of code from other projects being reused (and most often fixed along the way (sxpath and lalr come to mind; both fixed, but the fixes, even though reported upstream, did not yet make it into the source distributions). So, while it would be great to just use eggs, it's sometimes unlikely they will easily work. For other parts (SRFI's, TCP, DNS) it's a matter of getting the imports straight. (And don't try to get away with blocking calls, e.g., DNS for instance, it's going to kill it.) We wrote mysql, postgresql, sqlite3, pcre, libmagic, iconv, openssl, XML serialising and maybe even more FFI code for RScheme. I'd like to see at least mysql and postgresql transformed into cond-expand/compile time options. The others need to be rewritten for chicken (as I said, it's similar but nevertheless needs to be rewritten). The pattern is there, this is just a matter of boring man power. Most parts have been ported to Chicken before (long ago), there's a tarball at the web site, to be unpacked within the RScheme source tree. That chicken port used to deliver web pages before. But I seriously doubt it will still compile. Furthermore I recall exactly one spot, where a finalizer in RScheme style has been used and not yet moved into the RScheme specific code section. This is a none-issue, which needs to get solved too. The RScheme build is screwed and so is Askemos's. I believe Peter did a nice job in cleaning it up, but I'm afraid there's more to be done. For the most part, getting it to build will be the job of the day. (For simplicity Askemos compiles into a [huge] statically linked binary right now. This ought to be changed as well.) Nevertheless I'm not keen to abandon the RScheme compatibility until the Chicken version works reliably. No, not even then. The Askemos concept wants to be platform independent at all cost. [[[That is, if there's ever a vulnerability found in underlying systems (e.g., Linux, BSD, AIX, the compiler etc.), we accept the risk to loose exactly those machines, which use that stack, while other hosts running other stacks will continue to provide service. Therefore I'd like to have something like BSD+Chicken, Linux+Chicken, BSD+RScheme... Actually I'm sad, that I don't have a Haskell implementation of the Askemos/BALL code to back up our code - yet. (Well, Prof. Hans-Gert Gräbe; Univertity Leipzig expressed interest to put students behind just that one ;-) But I'm afraid that's going to take a huge while.]]] ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users