Dragonfly - a web framework for newLISP

A web framework in newLISP
xytroxon
Posts: 296
Joined: Tue Nov 06, 2007 3:59 pm
Contact:

Post by xytroxon »

Is BSD The New GPL?

Note: Zed Shaw is the former Ruby language programming guru, now Python language advocate... Zed does not mince words over his opinionated views on programming, and does not suffer fools (or Rubists ;) lightly... That said, he is usually right... And now prefering GPL over BSD for his new works... But most people nowdays, that don't want to suffer the pains of trying to figure out (let alone try to strictly follow), either license's rules, just throw up their hands and use the MIT license, as the least painful license for simple works they wish to share... Of course that p*sses the GPL's Richard Stallman off to no end ;p)

http://en.wikipedia.org/wiki/BSD_licenses

http://en.wikipedia.org/wiki/GNU_General_Public_License

http://en.wikipedia.org/wiki/MIT_License
"Many computers can print only capital letters, so we shall not use lowercase letters."
-- Let's Talk Lisp (c) 1976

hilti
Posts: 140
Joined: Sun Apr 19, 2009 10:09 pm
Location: Hannover, Germany
Contact:

Post by hilti »

xytroxon wrote: But most people nowdays, that don't want to suffer the pains of trying to figure out (let alone try to strictly follow), either license's rules, just throw up their hands and use the MIT license, as the least painful license for simple works they wish to share...
That's why I use the MIT License.

What are the benefits when I use the GPL License for Dragonfly - are there any?
--()o Dragonfly web framework for newLISP
http://dragonfly.apptruck.de

TedWalther
Posts: 608
Joined: Mon Feb 05, 2007 1:04 am
Location: Abbotsford, BC
Contact:

Post by TedWalther »

cormullion wrote:just out of interest, what's the difference between the suggested licences?
I think the modern two-clause BSD license is shortest and easiest to understand.

xytroxon
Posts: 296
Joined: Tue Nov 06, 2007 3:59 pm
Contact:

Post by xytroxon »

Here's an article, that for several possible advantages, such as for profit use, suggests the Apache License:
Does GPL still matter?
Jagielski claims that Apache's licensing terms are written to be comprehensible to people with no legal training. "It's very, very easy to read and understand, so it's a less risky license for external companies to use," he says.
http://en.wikipedia.org/wiki/Apache_License
... as of July 2009, over 5000 non-ASF projects located at SourceForge.net are available under the terms of the Apache License.
The Apache Software Foundation and the Free Software Foundation (FSF) agree that the Apache License 2.0 is a free software licence, compatible with version 3 of the GNU General Public License (GPL).

However, the Free Software Foundation considers all versions of the Apache License (as of 2007) to be incompatible with the previous GPL versions 1 and 2.
-- xytroxon
"Many computers can print only capital letters, so we shall not use lowercase letters."
-- Let's Talk Lisp (c) 1976

hilti
Posts: 140
Joined: Sun Apr 19, 2009 10:09 pm
Location: Hannover, Germany
Contact:

Post by hilti »

... counting 37 downloads at Google Code :-)

I'm just wondering if anybody else uses Dragonfly for his projects? One project beside my own website is here: http://daycaster.org

Cheers
Hilti (working on version 0.20)
--()o Dragonfly web framework for newLISP
http://dragonfly.apptruck.de

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Post by cormullion »

i do! http://unbalanced-parentheses.nfshost.com/

I think it's great. I've found Dragonfly easy to use and reliable. The only problem is that when a new version is released it's quite hard to work out which files to install, which to modify, and which to ignore. Perhaps that's a difficult architecture to design...

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »


Kirill
Posts: 90
Joined: Wed Oct 31, 2007 1:21 pm

Post by Kirill »

hilti wrote:... counting 37 downloads at Google Code :-)

I'm just wondering if anybody else uses Dragonfly for his projects? One project beside my own website is here: http://daycaster.org

Cheers
Hilti (working on version 0.20)
Not yet, but I consider dragonfly (to try it out) for a PSI server.

hilti
Posts: 140
Joined: Sun Apr 19, 2009 10:09 pm
Location: Hannover, Germany
Contact:

Post by hilti »

Kirill wrote:
Not yet, but I consider dragonfly (to try it out) for a PSI server.
Hi Kirill

what is a PSI server? Never heard of it.
--()o Dragonfly web framework for newLISP
http://dragonfly.apptruck.de

hilti
Posts: 140
Joined: Sun Apr 19, 2009 10:09 pm
Location: Hannover, Germany
Contact:

Post by hilti »

That's just me, Lutz ;-)
--()o Dragonfly web framework for newLISP
http://dragonfly.apptruck.de

Kirill
Posts: 90
Joined: Wed Oct 31, 2007 1:21 pm

Post by Kirill »

hilti wrote: Hi Kirill

what is a PSI server? Never heard of it.
PSI stands for Public Subject Identifier (in the Topic Maps world that is). A PSI is an URI that servers two purposes: as a unique identifier for a subject and as a URL which can be entered into a browser to provide the end-user a description of what the subject refers to.

psi.ontopedia.net is a PSI server.

-- Kirill

joejoe
Posts: 173
Joined: Thu Jun 25, 2009 5:09 pm
Location: Denver, USA

Re: dragonfly web framework license

Post by joejoe »

joejoe wrote:hi hilti - looks like really cool code you've released.

im curious to know why you chose the mit license instead of the license that newlisp uses, the gpl? any chance you might consider the gpl for future releases?

thanks in any case! - :0)
i either misread or youve updated the license to gplv3 (like nL) !! :D

thanks for this, hilti! im downloading right now!

hilti
Posts: 140
Joined: Sun Apr 19, 2009 10:09 pm
Location: Hannover, Germany
Contact:

Post by hilti »

That's right. I've updated the license to GPL (v3), because I didn't see any difference (for my intention) between MIT License or GPL.

I just want the Dragonfly to be open source and free available.

Cheers!
Hilti
--()o Dragonfly web framework for newLISP
http://dragonfly.apptruck.de

hilti
Posts: 140
Joined: Sun Apr 19, 2009 10:09 pm
Location: Hannover, Germany
Contact:

Post by hilti »

Dragonfly version 0.20 is ready for download!

The major changes

* changed license from MIT to GNU (GPL v3)
* updated web.lsp to version 0.3.1 beta
* updated nldb.lsp (draft of 2009-09-11 20:42:48)
* added the file "dragonfly.js" which includes some small javascripts which support the Dragonfly framework (AJAX, iPhone, Dragonfly Guide Menu)
* added the first AJAX function to Dragonfly: ajax-updater (check out the twitter demo)
* added a Dragonfly guide (it can be opened with /dragonfly_welcome/index)

There will be a Dragonfly User Guide in near future. Have a look a the draft: http://dragonfly.nfshost.com

The Dragonfly ajax functions in action:
http://dragonfly.nfshost.com/dragonfly_ajax/index

Download it here
http://code.google.com/p/dragonfly-newl ... loads/list

Have fun!
Hilti
--()o Dragonfly web framework for newLISP
http://dragonfly.apptruck.de

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Post by cormullion »

Cool! Will upgrade soon...

joejoe
Posts: 173
Joined: Thu Jun 25, 2009 5:09 pm
Location: Denver, USA

thanks for the user guide

Post by joejoe »

the user guide really helped me get up and running in less than a minute. thanks!

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Re: Dragonfly - a web framework for newLISP

Post by cormullion »

Is your new version 0.50 available to non-Mercurial users yes?

(I gather Mercurial is another thing like git or subversion...?)

itistoday
Posts: 429
Joined: Sun Dec 02, 2007 5:10 pm
Contact:

Re: Dragonfly - a web framework for newLISP

Post by itistoday »

cormullion wrote:Is your new version 0.50 available to non-Mercurial users yes?

(I gather Mercurial is another thing like git or subversion...?)
It will be ready sometime this month, but there's still some work to be done before we make a release.

Mercurial is a DVCS like git (SVN is not a DVCS), it's pretty simple to use, just takes a little reading and then you'll get the hang of it.

Short instructions:

To grab a copy from the repo:

Code: Select all

$ hg clone https://dragonfly-newlisp.googlecode.com/hg/ dragonfly-newlisp
To update your copy (I would do this once a day):

Code: Select all

$ cd dragonfly-newlisp
$ hg pull -uf
If you're not committing code, that's really all you'll need to do anyway. :-)

To run the example-site, read the README and the INSTALL documents.
Get your Objective newLISP groove on.

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Re: Dragonfly - a web framework for newLISP

Post by cormullion »

thanks... I managed to obtain a copy (thanks!)

I'm now trying to copy my content over to the new framework. It's not going too badly, but there are a lot of changes from the version I'm using!

Edit:

OK, I haven't figured it out yet. These are the kind of URIs I want to handle:

http://unbalanced-parentheses.nfshost.com/syntaxmatters
http://unbalanced-parentheses.nfshost.c ... eerswanted
http://unbalanced-parentheses.nfshost.c ... e-glypher/ -> directory containing index.cgi
http://unbalanced-parentheses.nfshost.com/downloads -> directory

I used to test the selector:

Code: Select all

(if (= "" Dragonfly:selector) 
and provide a default page if I didn't find the string I wanted. What's the mechanism for doing this?

hilti
Posts: 140
Joined: Sun Apr 19, 2009 10:09 pm
Location: Hannover, Germany
Contact:

Re: Dragonfly - a web framework for newLISP

Post by hilti »

Hi Cormullion!

Just a short help to Your "downloads" problem: You could use a static route to it described on this page in the User Guide: http://www.rundragonfly.com/dragonfly_routes

Put this into your view

Code: Select all

<% (link_to "Downloads" "downloads") %>
About the selector:
I've to test some things out, but maybe you can create your own route described here
http://www.rundragonfly.com/dragonfly_create_routes

Hope this helps!
Hilti
--()o Dragonfly web framework for newLISP
http://dragonfly.apptruck.de

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Re: Dragonfly - a web framework for newLISP

Post by cormullion »

Thanks for the help! I'm not sure I really know what a route is.

In the last version, I had code in the 'view' that took action depending on the selector:

Code: Select all

<div id="right">    
    <% (Dragonfly:load-database "blog.nldb") %>
    
    <% (if (= "" Dragonfly:selector) 
           (set 'query (nldb:select-rows 'nldb:stories true true 'nldb:story-date >))
           (set 'query (nldb:select-rows 'nldb:stories '(= nldb:story-id Dragonfly:selector)))) %>
    
    <% (unless query (set 'query (nldb:select-rows 'nldb:stories '(= nldb:story-id "aboutthissite")))) %> 

    <% (set 'story (first query)) %>
    <% (println {<h1>} (story 2) {</h1>}) %>
    <% (println {<small>} (story 0) {</small>}) %>
    <% (println (last story)) %>

</div>
Do I put this code in a .lsp file in 'plugins-active' (the static route you're talking about)? I would have thought it belonged in the view.

Forgive the stupid questions - I'm trying to catch you up but you're going too fast for me.:)

itistoday
Posts: 429
Joined: Sun Dec 02, 2007 5:10 pm
Contact:

Re: Dragonfly - a web framework for newLISP

Post by itistoday »

cormullion, I've updated the dragonfly_routes page with some more detail, read through it carefully, it should explain what they are and how they work. Also, take a look at the page on creating templates (also in the guide).

As of this post it's not up on rundragonfly.com, so view the example-site in your web browser locally using newlisp as the server (again, see the INSTALL and README files if you don't know how to do this). Before doing that though you'll need to pull the latest changes as I showed above first.
Get your Objective newLISP groove on.

itistoday
Posts: 429
Joined: Sun Dec 02, 2007 5:10 pm
Contact:

Re: Dragonfly - a web framework for newLISP

Post by itistoday »

cormullion wrote:In the last version, I had code in the 'view' that took action depending on the selector:

Code: Select all

<% (if (= "" Dragonfly:selector)
BTW, Dragonfly:selector has been removed. Views no longer have selectors or actions, if you want something like that either make a resource (see the guide on the RESTful route) or use GET/POST parameters with your views instead, or create your own route. If you need help, check the docs, they probably have the answer to your question, but if they don't let us know!
Get your Objective newLISP groove on.

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Re: Dragonfly - a web framework for newLISP

Post by cormullion »

Thanks guys, Dragonfly is looking pretty impressive now. I've been reading the docs again. You've done a nice job.

Here's my problem. I already have the URLs I want (see above). I don't think I can use "RESTful routes" because the first value in these (the resource) has to be the name of the context whereas in my URLs I want it to be the name of the ID (the specific object in the collection). I don't want to create static routes because I don't want to create a page for each ID.

I suppose I'll have to use .htaccess to rewrite the incoming URL to insert a 'resource' identifier before the ID, and then use the 'action' to store the ID and pass it on to the .lsp resource. And then I can just go 'print' to output HTML? But then what happened to the template...

itistoday
Posts: 429
Joined: Sun Dec 02, 2007 5:10 pm
Contact:

Re: Dragonfly - a web framework for newLISP

Post by itistoday »

cormullion wrote:I don't want to create static routes because I don't want to create a page for each ID.
I looked at your URLs again (I hadn't really read your original post) and it seems like creating a page for each of those is the solution you're looking for, otherwise you're not really using Dragonfly to your advantage and end up rewriting a lot of the stuff that it handles efficiently and cleanly for you. You also end up with a massive single file that has a huge if/else block in it...

I'd consider splitting all of your pages into separate files the way the example-site does, but if you don't want to do that then just disable both of the default handlers in config.lsp and create your own route (as described in the guide). Your route would simply grab the first part of the request URL, set the DF:selector, and display your main file. Or you could even check the $GET parameters, i.e.: (if (nil? ($GET "downloads/foo")) ...)

Documentation on all of that ($GET, how to display files, etc.) is in the Core API (linking to my copy since rundragonfly.com currently isn't updated):

http://www.taoeffect.com/dragonfly-newl ... gonfly_api
Get your Objective newLISP groove on.

Locked