The Artima Developer Community
Sponsored Link

Weblogs Forum
Put a Flex UI On Your Application

37 replies on 3 pages. Most recent reply: Oct 31, 2009 9:15 AM by Ryan Mills

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 37 replies on 3 pages [ « | 1 2 3 | » ]
Swaroop C H

Posts: 10
Nickname: g2swaroop
Registered: Jan, 2004

Re: Put a Flex UI On Your Application Posted: Jun 21, 2007 10:38 PM
Reply to this message Reply
Advertisement
> Since it's so easy to build GUIs for Python apps with
> Flex, how about providing an example with screenshot?

Well, how about going a step further and have a video? :-)

http://www.adobe.com/devnet/flex/articles/eckel_video.html

("Video tutorial: Creating a Flex application using the TurboGears framework")

Raoul Duke

Posts: 127
Nickname: raoulduke
Registered: Apr, 2006

Re: Put a Flex UI On Your Application Posted: Jun 22, 2007 4:33 PM
Reply to this message Reply
@Achilleas

Since I've seen your posts here and elsewhere, I assume you actually have something possibly interesting and thought-provoking to say, rather than only saying "UGH!!!". Is it "everything should be in one language"? Do you think Katahdin http://lambda-the-ultimate.org/node/2303 is going to be anything like what you dream of?



[P.S.: when will Artima afford to a) get threaded forums and b) support hyperlinks the way everything else does? :-]

Achilleas Margaritis

Posts: 674
Nickname: achilleas
Registered: Feb, 2005

Re: Put a Flex UI On Your Application Posted: Jun 25, 2007 5:04 AM
Reply to this message Reply
> @Achilleas
>
> Since I've seen your posts here and elsewhere, I assume
> you actually have something possibly interesting and
> thought-provoking to say, rather than only saying
> "UGH!!!". Is it "everything should be in one language"? Do
> you think Katahdin
> http://lambda-the-ultimate.org/node/2303 is going to be
> anything like what you dream of?
>
>
>
> [P.S.: when will Artima afford to a) get threaded forums
> and b) support hyperlinks the way everything else does? :-]

I apologize, but I wasn't in the mood of writing a big technically oriented response about how unattractive and backwards the described solution seems to me.

People don't get the whole picture of programming, that's for sure. We keep re-inventing the same wheel over and over. And that's irritating, to the point of making me posting 'UGH' instead of something meaningful.

I do not think Katahdin is the solution...too many cooks spoil the soup, i.e. too many DSLs makes us think about the DSL instead of the problem at hand. I would prefer a lean and mean programming language with as few constructs as possible, instead of the behemoths we have today.

Raoul Duke

Posts: 127
Nickname: raoulduke
Registered: Apr, 2006

Re: Put a Flex UI On Your Application Posted: Jun 25, 2007 1:10 PM
Reply to this message Reply
> I would prefer a
> lean and mean programming language with as few constructs
> as possible, instead of the behemoths we have today.

If you were to imagine taking 6 months off to write it, what would it look like? What would you implement it in? Can you show some pseudocode for how it would handle SQL, UI, performance optimizations, Web fu, etc.?

(I'm honestly curious - I think if you started sketching out the idea, it would be very interesting, at least to some folks.)

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: Put a Flex UI On Your Application Posted: Jun 25, 2007 3:06 PM
Reply to this message Reply
> > I would prefer a
> > lean and mean programming language with as few
> constructs
> > as possible, instead of the behemoths we have today.
>
> If you were to imagine taking 6 months off to write it,
> what would it look like? What would you implement it in?
> Can you show some pseudocode for how it would handle SQL,
> UI, performance optimizations, Web fu, etc.?
>
> (I'm honestly curious - I think if you started sketching
> out the idea, it would be very interesting, at least to
> some folks.)

Me too. My crystal ball is in the shop.

David Golds

Posts: 1
Nickname: dgolds
Registered: Jun, 2007

Re: Put a Flex UI On Your Application Posted: Jun 25, 2007 8:37 PM
Reply to this message Reply
The online game development tool http://mygamebuilder.com is built this way - flex front end, XML-RPC backend written using Ruby On Rails.

It also uses Amazon S3 but hat's another topic...

Kay Schluehr

Posts: 302
Nickname: schluehk
Registered: Jan, 2005

Re: Put a Flex UI On Your Application Posted: Jun 25, 2007 10:32 PM
Reply to this message Reply
> (I'm honestly curious - I think if you started sketching
> out the idea, it would be very interesting, at least to
> some folks.)

Not sure why Achilleas should do that? As it seems today everyone and his dog rants about software while some leads of OSS projects start to complain about lesser contribution. Talk is cheap and sexy while producers and maintainers of software are confronted with frustrated individuals who behave like consumers and know everything better.

Achilleas Margaritis

Posts: 674
Nickname: achilleas
Registered: Feb, 2005

Re: Put a Flex UI On Your Application Posted: Jun 26, 2007 2:56 AM
Reply to this message Reply
> > I would prefer a
> > lean and mean programming language with as few
> constructs
> > as possible, instead of the behemoths we have today.
>
> If you were to imagine taking 6 months off to write it,
> what would it look like? What would you implement it in?
> Can you show some pseudocode for how it would handle SQL,
> UI, performance optimizations, Web fu, etc.?
>
> (I'm honestly curious - I think if you started sketching
> out the idea, it would be very interesting, at least to
> some folks.)

UI (a login window):


function loginWindow username password = (Window
text = "Login"
layout = (Grid 2 3)
children = [
(Label text="username:" alignment=RIGHT)
(TextBox model=username)
(Label text="password:" alignment=RIGHT)
(TextBox model=password echo='*')
(Button text="login" click={(close true)})
(Button text="cancel" click={(close false)})
]
)
let username = ""
let password = ""
let login = (do (loginWindow username password))


Any UI can be easily built by using functions laid out in hierarchical fashion.

SQL (a simple customers, products, sales schema):


let db = (Database "//localhost:1433/;username=sa" [
customers = (table [
id = (column AUTOINCREMENT)
firstName = (column (VARCHAR 50))
lastName = (column (VARCHAR 50))
])
products = (table [
id = (column AUTOINCREMENT)
name = (column (VARCHAR 50))
price = (column MONEY)
])
sales = (table [
id = (column AUTOINCREMENT)
customerId = (foreignKey customers.id)
productId = (foreignKey products.id)
date = (column DATETIME)
])
]
)


The above code does the following things:

1) it creates the DB schema at compile time.
2) it creates the structure 'db', which contains members 'customers', 'products' and 'sales', again, at compile time; each member of the above contains the necessary member for each column.

Here is a query:


let todaysSales = (select fields=[db.customers db.products] where=( db.sales.customersId == db.customers.id and db.sales.productId == db.products.id and
db.sales.date == (getTodaysDate)))
(forEach sale todaysSales {(print sale)})


The above code does the following things:

1) 'select' is a macro which accepts a tuple of columns and creates a function that, when evaluated at run-time, it will create an SQL string and submit it to the database. It also defines a struct with relevant fields, locally defined, which is the result of the query.

2) the struct members that are columns have overloaded operators so as that the boolean expression '==' creates an expression tree which, when evaluated, creates an SQL where expression.

3) when the code runs, the function behind 'select' creates a string from its parameters, and returns a list of records which have members named after the field names of the database.

The language syntax is very clean and easy:

1) parentheses mean 'evaluate function with optional parameters'.
2) square brackets mean 'tuples of values'.
3) curly brackets mean 'a lazily evaluated block of code'.
4) 'let' declares a variable in the local scope.
5) 'function' declares a function in the local scope.

Hierarchical schemas can be easily expressed. The above covers HTML, XML, DB schemas etc.

A macro mechanism which evaluates the code at compile time allows the developer to create the necessary infrastructure at compile time.

In fact, source code is nothing more than a set of macros evaluated at compile time, which create the program to run at run time.

This mechanism can be used for doing script jobs, without the need to either use XML or invent new tools and syntaxes. For example, java's ant is redundant, because the language can do anything at compile-time, and thus all that is required is writing the necessary program as a macro and compile it.

If anyone needs any other example, please feel free to request it.

Julien Castelain

Posts: 2
Nickname: julienc
Registered: Jun, 2007

Re: Put a Flex UI On Your Application Posted: Jun 26, 2007 12:33 PM
Reply to this message Reply
Great article, thanks. I also find flex really cool when it comes to UI's there's nothing as simple and sexy ... Now i just need to find the right back-end solution ;)

Raoul Duke

Posts: 127
Nickname: raoulduke
Registered: Apr, 2006

Re: Put a Flex UI On Your Application Posted: Jun 27, 2007 7:01 PM
Reply to this message Reply
> If anyone needs any other example, please feel free to
> request it.

Thanks for the brain-dump. It would be neat if you got this written up on a wiki somewhere, and had the idea knocked around for a while by folks. For example, I'm wondering if the comment that any gui can be done with hierarchical functions is really a) true b) the best way in all cases - but I haven't thought through it enough to disprove.

JP Moresmau

Posts: 1
Nickname: jpmoresmau
Registered: Nov, 2006

Re: Put a Flex UI On Your Application Posted: Jun 28, 2007 3:58 AM
Reply to this message Reply
Funny, I had a very similar approach but using a fully functional language (Haskell) for the back end. I just thought Flex is great for UIs, Haskell's not that good for UI for greate for the rest... See http://jpmoresmau.blogspot.com/2007/03/haskell-gui-in-flex.html

Achilleas Margaritis

Posts: 674
Nickname: achilleas
Registered: Feb, 2005

Re: Put a Flex UI On Your Application Posted: Jun 28, 2007 5:58 AM
Reply to this message Reply
> > If anyone needs any other example, please feel free to
> > request it.
>
> Thanks for the brain-dump. It would be neat if you got
> this written up on a wiki somewhere, and had the idea
> knocked around for a while by folks. For example, I'm
> wondering if the comment that any gui can be done with
> hierarchical functions is really a) true b) the best way
> in all cases - but I haven't thought through it enough to
> disprove.

I wish I had the time to do so, or even participate in/start an open source project...

Richard W

Posts: 1
Nickname: rwarrender
Registered: Jul, 2007

Re: Put a Flex UI On Your Application Posted: Jul 12, 2007 10:48 AM
Reply to this message Reply
Hiya,

I'm trying to follow along to the example but when I run the AIR app, I get the following message when I try to type anything in the text box...

Link to screenshot.

I am running Python 2.3.5 on my Mac with the latest AIR beta for Eclipse. Any help would be great.

Regards,
Richard

Raoul Duke

Posts: 127
Nickname: raoulduke
Registered: Apr, 2006

Re: Put a Flex UI On Your Application Posted: Jul 13, 2007 5:24 PM
Reply to this message Reply
> I wish I had the time to do so, or even participate
> in/start an open source project...

but you already did start it. here's maybe a place to continue or let others brain-storm: http://unifiedlanguage.wikispaces.com/

Florin Jurcovici

Posts: 66
Nickname: a0flj0
Registered: Feb, 2005

Re: Put a Flex UI On Your Application Posted: Jul 17, 2007 10:06 AM
Reply to this message Reply
> I do not think Katahdin is the solution...too many cooks
> spoil the soup, i.e. too many DSLs makes us think about
> the DSL instead of the problem at hand. I would prefer a
> lean and mean programming language with as few constructs
> as possible, instead of the behemoths we have today.

Are you sure the problem is in the languages? Java seems pretty simple as a language to me, IMO the problem is with its libraries.

Flat View: This topic has 37 replies on 3 pages [ « | 1  2  3 | » ]
Topic: Abstract Type Members versus Generic Type Parameters in Scala Previous Topic   Next Topic Topic: Myths About Indentation in Python

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use