Applied Web Heresies example in Io

View: New views
18 Messages — Rating Filter:   Alert me  

Applied Web Heresies example in Io

by Chris Double :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

A while back Avi Bryant (Seaside web framework author) did a talk on
his approach to building a Seaside like web framework. Phil Windley
did a write-up about it with some Ruby examples:

http://www.windley.com/archives/2007/03/applied_web_heresies_etech_2007.shtml

As a way of getting back into the swing of Io coding I took a stab at
translating it to Io. It uses the Volcano addon for web serving (and
in turn Sockets). Stick the following in a file and run it and visit
http://localhost:8090 in your web browser.

Feedback on style appreciated! I split objects up into traits holding
the methods, and the object that holds the data. I got this from Self
which I've been playing with recently. Looking around I guess this
isn't idiomatic in Io code?

------------------------------8<-------------------------
RegistryTraits := Object clone do(
  register := method(item,
    items append(item)
    (items size - 1) asString
  )

  find := method(key,
    items at(key asNumber)
  )
)

Registry := RegistryTraits clone do(
  init := method(
    items ::= List clone
  )
)

CanvasTraits := Object clone do(
  heading := method(str,
    result appendSeq("<h1>" .. str .. "</h1>")
    self
  )

  paragraph := method(str,
    result appendSeq("<p>" .. str .. "</p>")
    self
  )

  space := method(str,
    result appendSeq(" ")
    self
  )

  link := method(
    name := call sender doMessage(call message argAt(0))
    code := call message argAt(1)
    id := callbacks register(list(call sender, code))
    result appendSeq("<a href='?",id,"'>",name,"</a>")
    self
  )
)

Canvas := CanvasTraits clone do(
  init := method(
    result ::= Sequence clone
    callbacks ::= nil
  )
)

CounterTraits := Object clone do(
  renderOn := method(html,
    html heading("Hello World: " .. count)
    html paragraph("Some text!")
    html link("--", count = count - 1)
    html space
    html link("++", count = count + 1)
  )
)

Counter := CounterTraits clone do(
  init := method(
    count ::= 0
  )
)

MultiCounterTraits := Object clone do(
  renderOn := method(html,
    counters foreach(v, v renderOn(html))
  )
)

MultiCounter := MultiCounterTraits clone do(
  init := method(
    counters ::= list(Counter clone, Counter clone, Counter clone)
  )
)

Session := Object clone do(
  init := method(
    callbacks ::= Registry clone
    root ::= MultiCounter clone
  )

  handle := method(request, response,
    request getParameters foreach(k, v,
      callback := callbacks find(k)
      if (callback, callback first doMessage(callback second))
    )

    html := Canvas clone
    html callbacks = callbacks
    root renderOn(html)
    response setBody(html result)
  )
)

server := HttpServer clone do(
  setPort(8090)

  sessions := Registry clone

  renderResponse := method(request, response,
    session := nil
    cookie := request cookies at("ioweb")
    if (cookie != nil, session = sessions find(cookie))
    if (session == nil,
      session = Session clone
      response setCookie("ioweb", sessions register(session))
    )

    session handle(request, response)
  )
)

server start
------------------------------8<-------------------------

Chris.
--
http://www.bluishcoder.co.nz

Re: Applied Web Heresies example in Io

by bblochl2-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

--- In iolanguage@..., Chris Double <chris.double@...> wrote:

>
> A while back Avi Bryant (Seaside web framework author) did a talk on
> his approach to building a Seaside like web framework. Phil Windley
> did a write-up about it with some Ruby examples:
>
> http://www.windley.com/archives/2007/03/applied_web_heresies_etech_2007.shtml
>
> As a way of getting back into the swing of Io coding I took a stab at
> translating it to Io. It uses the Volcano addon for web serving (and
> in turn Sockets). Stick the following in a file and run it and visit
> http://localhost:8090 in your web browser.
>
> Feedback on style appreciated! I split objects up into traits holding
> the methods, and the object that holds the data. I got this from Self
> which I've been playing with recently. Looking around I guess this
> isn't idiomatic in Io code?
>
> ------------------------------8<-------------------------
> RegistryTraits := Object clone do(
>   register := method(item,
>     items append(item)
>     (items size - 1) asString
>   )
>
>   find := method(key,
>     items at(key asNumber)
>   )
> )
>
> Registry := RegistryTraits clone do(
>   init := method(
>     items ::= List clone
>   )
> )
>
> CanvasTraits := Object clone do(
>   heading := method(str,
>     result appendSeq("<h1>" .. str .. "</h1>")
>     self
>   )
>
>   paragraph := method(str,
>     result appendSeq("<p>" .. str .. "</p>")
>     self
>   )
>
>   space := method(str,
>     result appendSeq(" ")
>     self
>   )
>
>   link := method(
>     name := call sender doMessage(call message argAt(0))
>     code := call message argAt(1)
>     id := callbacks register(list(call sender, code))
>     result appendSeq("<a href='?",id,"'>",name,"</a>")
>     self
>   )
> )
>
> Canvas := CanvasTraits clone do(
>   init := method(
>     result ::= Sequence clone
>     callbacks ::= nil
>   )
> )
>
> CounterTraits := Object clone do(
>   renderOn := method(html,
>     html heading("Hello World: " .. count)
>     html paragraph("Some text!")
>     html link("--", count = count - 1)
>     html space
>     html link("++", count = count + 1)
>   )
> )
>
> Counter := CounterTraits clone do(
>   init := method(
>     count ::= 0
>   )
> )
>
> MultiCounterTraits := Object clone do(
>   renderOn := method(html,
>     counters foreach(v, v renderOn(html))
>   )
> )
>
> MultiCounter := MultiCounterTraits clone do(
>   init := method(
>     counters ::= list(Counter clone, Counter clone, Counter clone)
>   )
> )
>
> Session := Object clone do(
>   init := method(
>     callbacks ::= Registry clone
>     root ::= MultiCounter clone
>   )
>
>   handle := method(request, response,
>     request getParameters foreach(k, v,
>       callback := callbacks find(k)
>       if (callback, callback first doMessage(callback second))
>     )
>
>     html := Canvas clone
>     html callbacks = callbacks
>     root renderOn(html)
>     response setBody(html result)
>   )
> )
>
> server := HttpServer clone do(
>   setPort(8090)
>
>   sessions := Registry clone
>
>   renderResponse := method(request, response,
>     session := nil
>     cookie := request cookies at("ioweb")
>     if (cookie != nil, session = sessions find(cookie))
>     if (session == nil,
>       session = Session clone
>       response setCookie("ioweb", sessions register(session))
>     )
>
>     session handle(request, response)
>   )
> )
>
> server start
> ------------------------------8<-------------------------
>
> Chris.
> --
> http://www.bluishcoder.co.nz
>
I tried with Io 20090105 and get :

  Exception: Failed to load Addon Socket - it appears that the addon exists but was not compiled. You might try running 'make Socket' in the Io source folder.
  ---------
  Object Server                        HttpServer.io 1
  Addon load                           AddonLoader.io 116
  AddonLoader loadAddonNamed           Z_Importer.io 40
  AddonImporter import                 Z_Importer.io 53
  List detect                          Z_Importer.io 53
  true and                             Z_Importer.io 53
  Object HttpServer                    Volcano.io 99
  Importer import                      Z_Importer.io 66

Applying "make Socket" wont help!

Regards BB


Re: Re: Applied Web Heresies example in Io

by Andreas Schipplock-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi,
when you build Io watch out for errors...it doesn't necessarily stop
on an error (which are related to addons) :). The solution is to
re-compile Io with socket support and again...watch out for error
messages on make.

Cheers,
Andreas.

On Tue, Jul 14, 2009 at 4:16 PM, bblochl2<bblochl2@...> wrote:

>
>
> --- In iolanguage@..., Chris Double <chris.double@...> wrote:
>>
>> A while back Avi Bryant (Seaside web framework author) did a talk on
>> his approach to building a Seaside like web framework. Phil Windley
>> did a write-up about it with some Ruby examples:
>>
>>
>> http://www.windley.com/archives/2007/03/applied_web_heresies_etech_2007.shtml
>>
>> As a way of getting back into the swing of Io coding I took a stab at
>> translating it to Io. It uses the Volcano addon for web serving (and
>> in turn Sockets). Stick the following in a file and run it and visit
>> http://localhost:8090 in your web browser.
>>
>> Feedback on style appreciated! I split objects up into traits holding
>> the methods, and the object that holds the data. I got this from Self
>> which I've been playing with recently. Looking around I guess this
>> isn't idiomatic in Io code?
>>
>> ------------------------------8<-------------------------
>> RegistryTraits := Object clone do(
>> register := method(item,
>> items append(item)
>> (items size - 1) asString
>> )
>>
>> find := method(key,
>> items at(key asNumber)
>> )
>> )
>>
>> Registry := RegistryTraits clone do(
>> init := method(
>> items ::= List clone
>> )
>> )
>>
>> CanvasTraits := Object clone do(
>> heading := method(str,
>> result appendSeq("<h1>" .. str .. "</h1>")
>> self
>> )
>>
>> paragraph := method(str,
>> result appendSeq("<p>" .. str .. "</p>")
>> self
>> )
>>
>> space := method(str,
>> result appendSeq(" ")
>> self
>> )
>>
>> link := method(
>> name := call sender doMessage(call message argAt(0))
>> code := call message argAt(1)
>> id := callbacks register(list(call sender, code))
>> result appendSeq("<a href='?",id,"'>",name,"</a>")
>> self
>> )
>> )
>>
>> Canvas := CanvasTraits clone do(
>> init := method(
>> result ::= Sequence clone
>> callbacks ::= nil
>> )
>> )
>>
>> CounterTraits := Object clone do(
>> renderOn := method(html,
>> html heading("Hello World: " .. count)
>> html paragraph("Some text!")
>> html link("--", count = count - 1)
>> html space
>> html link("++", count = count + 1)
>> )
>> )
>>
>> Counter := CounterTraits clone do(
>> init := method(
>> count ::= 0
>> )
>> )
>>
>> MultiCounterTraits := Object clone do(
>> renderOn := method(html,
>> counters foreach(v, v renderOn(html))
>> )
>> )
>>
>> MultiCounter := MultiCounterTraits clone do(
>> init := method(
>> counters ::= list(Counter clone, Counter clone, Counter clone)
>> )
>> )
>>
>> Session := Object clone do(
>> init := method(
>> callbacks ::= Registry clone
>> root ::= MultiCounter clone
>> )
>>
>> handle := method(request, response,
>> request getParameters foreach(k, v,
>> callback := callbacks find(k)
>> if (callback, callback first doMessage(callback second))
>> )
>>
>> html := Canvas clone
>> html callbacks = callbacks
>> root renderOn(html)
>> response setBody(html result)
>> )
>> )
>>
>> server := HttpServer clone do(
>> setPort(8090)
>>
>> sessions := Registry clone
>>
>> renderResponse := method(request, response,
>> session := nil
>> cookie := request cookies at("ioweb")
>> if (cookie != nil, session = sessions find(cookie))
>> if (session == nil,
>> session = Session clone
>> response setCookie("ioweb", sessions register(session))
>> )
>>
>> session handle(request, response)
>> )
>> )
>>
>> server start
>> ------------------------------8<-------------------------
>>
>> Chris.
>> --
>> http://www.bluishcoder.co.nz
>>
> I tried with Io 20090105 and get :
>
> Exception: Failed to load Addon Socket - it appears that the addon exists
> but was not compiled. You might try running 'make Socket' in the Io source
> folder.
> ---------
> Object Server HttpServer.io 1
> Addon load AddonLoader.io 116
> AddonLoader loadAddonNamed Z_Importer.io 40
> AddonImporter import Z_Importer.io 53
> List detect Z_Importer.io 53
> true and Z_Importer.io 53
> Object HttpServer Volcano.io 99
> Importer import Z_Importer.io 66
>
> Applying "make Socket" wont help!
>
> Regards BB
>
>



--
Kind regards,
Andreas Schipplock.

Re: Re: Applied Web Heresies example in Io

by Samuel A. Falvo II :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Jul 14, 2009 at 7:16 AM, bblochl2<bblochl2@...> wrote:

> --- In iolanguage@..., Chris Double <chris.double@...> wrote:
>>
>> A while back Avi Bryant (Seaside web framework author) did a talk on
>> his approach to building a Seaside like web framework. Phil Windley
>> did a write-up about it with some Ruby examples:
>> . . .
>>     session handle(request, response)
>>   )
>> )
>>
>> server start
>> ------------------------------8<-------------------------
>>
>> Chris.
>> --
>> http://www.bluishcoder.co.nz

Just a friendly reminder -- not everyone uses or chooses to configure
their mail client to fold quotes.  When replying, can you please focus
your quotes on only that which is relevant?

Most mail clients will let you select a range of text prior to
selecting reply, and will quote only that selection.  VERY useful for
keeping mail sizes down.  Thanks.

And, now, on with my own question...

> Applying "make Socket" wont help!

Can you be more specific?  What error message do you get?  How did you
apply "make Socket"?  Thanks.

--
Samuel A. Falvo II

Re: Re: Applied Web Heresies example in Io

by Rich Collins :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

missing libevent is a common cause of Socket build errors.

On Jul 14, 2009, at 7:23 AM, Samuel A. Falvo II wrote:

>
>
> On Tue, Jul 14, 2009 at 7:16 AM, bblochl2<bblochl2@...> wrote:
> > --- In iolanguage@..., Chris Double <chris.double@...>  
> wrote:
> >>
> >> A while back Avi Bryant (Seaside web framework author) did a talk  
> on
> >> his approach to building a Seaside like web framework. Phil Windley
> >> did a write-up about it with some Ruby examples:
> >> . . .
> >>     session handle(request, response)
> >>   )
> >> )
> >>
> >> server start
> >> ------------------------------8<-------------------------
> >>
> >> Chris.
> >> --
> >> http://www.bluishcoder.co.nz
>
> Just a friendly reminder -- not everyone uses or chooses to configure
> their mail client to fold quotes. When replying, can you please focus
> your quotes on only that which is relevant?
>
> Most mail clients will let you select a range of text prior to
> selecting reply, and will quote only that selection. VERY useful for
> keeping mail sizes down. Thanks.
>
> And, now, on with my own question...
>
> > Applying "make Socket" wont help!
>
> Can you be more specific? What error message do you get? How did you
> apply "make Socket"? Thanks.
>
> --
> Samuel A. Falvo II
>
>


Re: Applied Web Heresies example in Io

by bblochl2-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

--- In iolanguage@..., "Samuel A. Falvo II" <sam.falvo@...> wrote:
> Just a friendly reminder -- not everyone uses or chooses to configure
> their mail client to fold quotes.  When replying, can you please focus
> your quotes on only that which is relevant?
>
> Most mail clients will let you select a range of text prior to
> selecting reply, and will quote only that selection.  VERY useful for
> keeping mail sizes down.  Thanks.
>
Sorry for my naughty mail! I vow obedience!

> And, now, on with my own question...
>
> > Applying "make Socket" wont help!
>
> Can you be more specific?  What error message do you get?  How did you
> apply "make Socket"?  Thanks.
>
> --
> Samuel A. Falvo II
>
"'Make Socket" started in the Io installation directory produces about one and half a page of error messages and warnings on the debian Linux branch, starting with:

~/Io$ make Socket
./_build/binaries/io_static build.io -a Socket
--- Socket --------------------------------------------------------------------
build.io: Entering directory `addons/Socket'
cp source/*.h _build/headers
cc -Os -g -Wall -pipe -fno-strict-aliasing -DSANE_POPEN -DIOBINDINGS   -I../../libs/garbagecollector/_build/headers -I../../libs/basekit/_build/headers -I../../libs/coroutine/_build/headers -I../../libs/iovm/_build/headers -I/usr/local/include -I/usr/include -I/usr/include/libxml2 -I/usr/include/freetype2 -I/usr/include/python2.6 -I/usr/include/cairo -I. -fPIC -c -o _build/objs/IoEventManager.o source/IoEventManager.c
In Datei, eingefügt von source/IoEventManager.h:13,
                 von source/IoEventManager.c:9:
source/IoEvent.h:17:19: Fehler: event.h: No such file or directory
In Datei, eingefügt von source/IoEventManager.c:9:
source/IoEventManager.h:16:20: Fehler: evhttp.h: No such file or directory
... etc.....
Most of concerning the IoEventManager.c, IoEvent.h, IoEvent.c, IoEvConnection.c, IoEvRequest.c.
It eneds with the lines:
cc  -shared  -o _build/dll/libIoSocket.so _build/objs/*.o -L/usr/local/lib -L/usr/lib -levent -L../../_build/dll -liovmall
/usr/bin/ld: cannot find -levent
collect2: ld gab 1 als Ende-Status zurück
build.io: Leaving directory `addons/Socket'

............end

There that problematic path to liovmall could be an issue again.

Sorry, I use german local, so the messages are german in part, as long as they come from the OS.

If you are interested in a complete list, please send me a mail with a destination to my yahoo account.

But even make will send some strange messages. i.e. there is the message:
Python is missing python2.6 library
But for shure I have installed python 2.6 and 3.0 as well! Really strange.

Regards BB

PS: I hope that the form meets your expectations this time. (BTW I do not use my personal mailserver, but the one from yahoo!)







Re: Re: Applied Web Heresies example in Io

by Chris Double :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Jul 15, 2009 at 7:26 AM, bblochl2<bblochl2@...> wrote:
> "'Make Socket" started in the Io installation directory produces about one
> and half a page of error messages and warnings on the debian Linux branch,
> starting with:

Have you tried installng the addon's dependancies? Something like:

su -c "sudo make aptget"

If your distro uses apt-get.

Chris.
--
http://www.bluishcoder.co.nz

Re: Applied Web Heresies example in Io

by bblochl2-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

--- In iolanguage@..., Chris Double <chris.double@...> wrote:

>
> On Wed, Jul 15, 2009 at 7:26 AM, bblochl2<bblochl2@...> wrote:
> > "'Make Socket" started in the Io installation directory produces about one
> > and half a page of error messages and warnings on the debian Linux branch,
> > starting with:
>
> Have you tried installng the addon's dependancies? Something like:
>
> su -c "sudo make aptget"
>
> If your distro uses apt-get.
>
> Chris.
> --
> http://www.bluishcoder.co.nz
>
Thanks. First of all, in trying "make Socket" there are mostly error messages from the compiler of the kind "dereferencing a pointer to a incomplete type" (I have to translate it from the german text I get.) Over all I get about 20 error messages from the compiler.

The additional remark, that there are some libs missing is just a trial of a possible explanation. But checking the error text again I am not shure, that missing libs are the source. Incomplete types do not correspondend to missing libs. Is`nt it? That might be due to an unclean type system in Io? (I know, Io does not have a type system in the usual form, than call the source for that "incomplete types" as you like.)

In building Io I will be informed that there are 32 libs missing, most of I am absolutely shure that the are installed (i.e. python, OpneGL .... etc) Seems to be some problem with the path for Io (with other progs that are working correctly).

Others are so exotic for debian and Suse, that I only found that on the net (i.e. Yajl ...) not in the repositories.

aptget or aptitude does not help. Due to that exotic progs - exotic for the average Linux - I argue that Io is mostly based on the Macintosh-Island? But I am shure that most of that libs are not necessary for normal use of Io and not for the Web Heresies example as well. I do not believe that  Web Heresies does really need half a dozen bindings to some exotic DBs. (One might find out the really missing libs after a clean compilation of the Web Heresies example.)

Well, the Web Heresies example was only an experiment, I gave some feedback.

After some time with experimentation with Io, due to chains of problems I would say: Never ever Io is comparable to Lua, beside the need for Objective C for compilation! Lua also has bugs that just will be defined away by the manual text (i.e. the length operator for tables. Its a masterpeiece of the manual to make that to a feature! Read it.) For Lua such masterpieces are still lacking, so one blunders unprepared over some strange things.

Regards BB





Re: Re: Applied Web Heresies example in Io

by Chris Double :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Jul 15, 2009 at 9:07 PM, bblochl2<bblochl2@...> wrote:
> Thanks. First of all, in trying "make Socket" there are mostly error
> messages from the compiler of the kind "dereferencing a pointer to a
> incomplete type" (I have to translate it from the german text I get.) Over
> all I get about 20 error messages from the compiler.

This is because it failed to load a header file and the types were not
defined. You need to install the library (the -dev version of the
library to get the headers) to compile it.

> In building Io I will be informed that there are 32 libs missing, most of I
> am absolutely shure that the are installed (i.e. python, OpneGL .... etc)
> Seems to be some problem with the path for Io (with other progs that are
> working correctly).

I don't build all the addons. I just build the ones I need as I need them.

> I am shure that most of that libs are not necessary for normal use of Io and
> not for the Web Heresies example as well.

You are correct. I'm on Linux and it runs fine using the Io VM with
the Sockets and Volcano addons which built without problems.

Chris.
--
http://www.bluishcoder.co.nz

Re: Applied Web Heresies example in Io

by bblochl2-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

--- In iolanguage@..., Chris Double <chris.double@...> wrote:
>
> On Wed, Jul 15, 2009 at 9:07 PM, bblochl2<bblochl2@...> wrote:
> > Over
> > all I get about 20 error messages from the compiler.
>
> This is because it failed to load a header file and the types were not
> defined. You need to install the library (the -dev version of the
> library to get the headers) to compile it.
>
evhttp.h is a header file needed from IoEvRequest.c. So should`nt that evhttp.h therefore be part of the Io distribution?
The header file evhttp.h is in no Linux repository present! I found it on the web with linenumbers. I copied that file to Io/_build/headers and tried make Socket again. I again get the error messages. A new file IoSocketInit.c will be made in the directory Io/addons/Socket/source.

At least in frustration I tried to compile as root and as I got the error messages again. The file IoSocketInit.c this time is owned by root - no wonder. I tried make Socket just in frustration as a normal user again called make Socket and - oh wonder - got no error messages! But I get a message

./_build/binaries/io_static build.io -a Socket
--- Socket --------------------------------------------------------------------
build.io: Entering directory `addons/Socket'
cp source/*.h _build/headers

  Exception: unable to open file path 'addons/Socket/source/IoSocketInit.c'
  ---------
  open                                File.io 97
  File create                          AddonBuilder.io 351
  AddonBuilder generateInitFile        AddonBuilder.io 240
  AddonBuilder build                   Project.io 36
  Project buildAddon                   build.io 13


That is no wonder because the file is now owned by root and has root privileges - I never do compilation as root! So I eliminated that file and ask for advice. I tried that once again and found that reproducible. Can I just change the owner without danger? I think there is something wrong with make again. There was/is some trouble with make and the ovml library.

I think that make Socket problem is a case for the Io mentainers!

Reagrds BB




Re: Re: Applied Web Heresies example in Io

by Samuel A. Falvo II :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Jul 15, 2009 at 7:12 AM, bblochl2<bblochl2@...> wrote:
> evhttp.h is a header file needed from IoEvRequest.c. So should`nt that evhttp.h therefore be part of the Io distribution?

Nope -- evhttp.h is provided by a library which Io _uses_, but which
itself is a completely different package all-together.  It is provided
by the libevent library.

> The header file evhttp.h is in no Linux repository present! I found it on the

People are using Io with it, and pages such as these exist, so
libevent must exist somewhere on the Internet:

http://darpanetwork.blogspot.com/2009/06/installing-libevent-on-ubuntu.html

Remember that Debian and Ubuntu don't represent the entirety of all
that is Linux -- rather, they are specific distributions.  :-)

--
Samuel A. Falvo II

Re: Applied Web Heresies example in Io

by bblochl2-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

--- In iolanguage@..., "Samuel A. Falvo II" <sam.falvo@...> wrote:
>
> Nope -- evhttp.h is provided by a library which Io _uses_, but which
> itself is a completely different package all-together.  It is provided
> by the libevent library.
>
> --
> Samuel A. Falvo II
>
You are true! But there is not only one libevent file in the repository, but a couple of. (Some for a specific language.) Just to avoid more troble I installed all of them and removed evhttp.h from Io/_build/headers. (May be the libevent-dev is the really needed one, but I do not know.)

I did the experiment (sudo make Socket and make Socket afterwards) and I explicitely  reconfirm the results in the former described manner. The lib evhttp.h will this time again not be found.  I argue that I have been cheated by the misleading error messages, that happen again:
.....
Fehler: evhttp.h: No such file or directory
source/IoEvConnection.c: In Funktion »IoEvConnection_free«:
source/IoEvConnection.c:66: Warnung: Implizite Deklaration der Funktion »evhttp_connection_free«
source/IoEvConnection.c: In Funktion »IoEvConnection_setTimeout_«:
.... and so on

sudo make Socket and make Socket afterwards gives me again that described problem with "  Exception: unable to open file path 'addons/Socket/source/IoSocketInit.c'". The explanation is, that there is build the file IoSocketInit.c with a root ownership. I did not know from the beginning, but I know now.

I repeat: There is something wrong with the make file or some Io sources and that is something for the Io mantainer.

I do not know the version of Io Chris Double uses. My version is Io 20090105. As a simple minded user I cannot imagine how Chris Double did set up the system without error? Anyway, I can reproduce this error at wish and explain it, but as a simple minded user I cant fix it.

Regards BB



 


Re: Applied Web Heresies example in Io

by bblochl2-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

--- In iolanguage@..., "Samuel A. Falvo II" <sam.falvo@...> wrote:
>
> Nope -- evhttp.h is provided by a library which Io _uses_, but which
> itself is a completely different package all-together.  It is provided
> by the libevent library.
>
> --
> Samuel A. Falvo II
>
You are true! But there is not only one libevent file in the repository, but a couple of. (Some for a specific language.) Just to avoid more troble I installed all of them and removed evhttp.h from Io/_build/headers. (May be the libevent-dev is the really needed one, but I do not know.)

I did the experiment (sudo make Socket and make Socket afterwards) and I explicitely  reconfirm the results in the former described manner. The lib evhttp.h will this time again not be found.  I argue that I have been cheated by the misleading error messages, that happen again:
.....
Fehler: evhttp.h: No such file or directory
source/IoEvConnection.c: In Funktion »IoEvConnection_free«:
source/IoEvConnection.c:66: Warnung: Implizite Deklaration der Funktion »evhttp_connection_free«
source/IoEvConnection.c: In Funktion »IoEvConnection_setTimeout_«:
.... and so on

sudo make Socket and make Socket afterwards gives me again that described problem with "  Exception: unable to open file path 'addons/Socket/source/IoSocketInit.c'". The explanation is, that there is build the file IoSocketInit.c with a root ownership. I did not know from the beginning, but I know now.

I repeat: There is something wrong with the make file or some Io sources and that is something for the Io mantainer.

I do not know the version of Io Chris Double uses. My version is Io 20090105. As a simple minded user I cannot imagine how Chris Double did set up the system without error? Anyway, I can reproduce this error at wish and explain it, but as a simple minded user I cant fix it.

Regards BB



 


Re: Re: Applied Web Heresies example in Io

by Steve Dekorte :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 2009-07-15, at 2:07 AM, bblochl2 wrote:
> Never ever Io is comparable to Lua, beside the need for Objective C  
> for compilation!

You seem to be confusing the addons with Io. As described in the  
programming guide and install notes, none of the addons (such as the  
one for the Objective-C binding) are required to compile and use Io  
and most of the addons are distinct and do not require each other to  
work.

If you type "make vm" the Io vm should build without difficulties on  
your platform.

Compiling the socket addon is like downloading and compiling Lua's  
socket package. The problem with Lua is it has no standard packages  
for such things so that you will find several incompatible ones which  
may no longer be supported or work with the current version of Lua and  
may or may not work with some given Lua socket code. Io addresses this  
problem by having standard libraries.

This means we have a number of addons which are platform specific (the  
Objective-C addon is specific to OSX) and which can't be expected to  
compile everywhere. Fortunately, they don't need to.

- Steve
 

Re: Applied Web Heresies example in Io

by bblochl2-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

--- In iolanguage@..., Steve Dekorte <steve@...> wrote:
>
>
> You seem to be confusing the addons with Io. As described in the  
> programming guide and install notes, none of the addons (such as the  
> one for the Objective-C binding) are required to compile and use Io  
>
> - Steve
>

I posted some problems with missing Objective-C  in a posting a couple of days ago in building Io vm. I had to install the Objective-C add on of gcc to build the Io vm. The make-file needs that because of an option set (necessary or not? I cant tell you.) True or false? I am willing to set up a new Linux system to check that again to verify, if you say "true"; you do not need that option in the actual state of the delivered Io tar file to build Io vm on Linux. (A new system, because to make shure that none of the many changes I did in my many experiments stays on the machine.) I have to say that I cannot exclude all doubt that I was a victim of my limited skills.

An extension of that question: Can you compile Io with a simple ANSI C compiler? Well, Io is really small and has interesting advantages. But does one have a working compiler for a really small target system? Usually one only gets an ANSI C compiler - if any.

Just another thing is that "make Socket" problem  - I agree, clear that is an add on. But the problem is just  one more in a chain of many. (A density I do not remember in other experiments, i. e. Lua.) I was fooled by one or more cheating Io files in that "make Socket" case. Io files cheated me! So I came to a wrong assumption of a missing ibrary, that was present on the system, but not found by Io. (Do not ask ME why.) I do not like to repeat all that, please read 11661 and 11662, where I delivered a problem description and again I say: It is absolutrely reproducible! So I cannot believe that its only me and my ignorance. I argue that the source (once more) is a misconception of a make file. (Let me remember the wrong path in the ovlib (or a name alike that) problem. Bear into mind, that any simple minded user like me may come to the verdict: bulls..t. That is not a good perspective for Io, at lest not one I would wish.

Io cheated me in that "make Socket" case and I needed some long time to become aware - well I am just a simple mimded computer user. I do not want to bash Io, But a bug or an error - or how ever might like to call that in pc words - can and should be described. And I would recommend to clear that problems, so that even simple minded user like me can seamless find success in Io. I would wish Io a smoother start for all simple minded users.

A compilation as root? Sorry, there all alarm clocks begin to ring. Beside, even the compilation as root does not work correctly and withot root not at all! Is that the Io image that possible users should get?


Regards BB








 



Re: Re: Applied Web Heresies example in Io

by Chris Double :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Jul 16, 2009 at 3:24 AM, bblochl2<bblochl2@...> wrote:
> I do not know the version of Io Chris Double uses. My version is Io
> 20090105. As a simple minded user I cannot imagine how Chris Double did set
> up the system without error? Anyway, I can reproduce this error at wish and
> explain it, but as a simple minded user I cant fix it.

I'm using the version from the git repository. Did you install
libevent-dev? It's a bit hard to tell from your email.

Don't run the build as root. You only need to do this when installing,
or when getting make to install the dependancies.

Did you run the 'make aptget'  command I mentioned in a previous
email, and as mentioned in the Io guide?

All I had to do to get Io working on my version of Linux (Arch Linux) was:

make vm
sudo make install

I don't have objective C installed.

To get the Socket addon working:

make Socket
sudo make install

To get Volcano addon working

make Volcano
sudo make install

Make sure you are using a clean version of the Io source code, from
the git repository or from the Io tarball, without any changes made by
you to 'fix' things.

Chris.
--
http://www.bluishcoder.co.nz

Re: Applied Web Heresies example in Io

by bblochl2-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



First, thanks for your detailed answer.

I can signal a positive result on a Suse 11.1 installation. Thanks for that Web Heresies example! Very nice, a really persuasive demonstration! Is there any license for applying the code anywhere?

--- In iolanguage@..., Chris Double <chris.double@...> wrote:
...
> Make sure you are using a clean version of the Io source code, from
> the git repository or from the Io tarball, without any changes made by
> you to 'fix' things.
>
> I'm using the version from the git repository.
...

What did I do? I downloaded Io once more from the Io page, untared and installed again. I have to remarke, that a complete make does not report that libiovmall.so any more! (In the past, a few weeks ago I had such an errror message on Suse as well. I could not stop experimenting again.)

Just a sideffect, that does not make a problem in building Io, is the message, that python2.6 libraries are missing - I have python2.6 installed - for shure. (That python2.6 message is only one example out of about half a dozen.) I take such inconsistency as bad omen for the condition of Io in some points.

I will try all that with debian once again. I think there is a debian bug interfering with the "make Socket". Is there an debian user in that group active? Is there a possibility to fix the origin of the trouble on debian lenny - given there is any - for a bug report to the debian developers?

Thanks again BB

PS: I will inform about the result of another trial on debian lenny.


Re: Applied Web Heresies example in Io

by bblochl2-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I promised to give a report concerning the problem with debian:

I wrote a testprogram for the libs event.h and evhttp.h and got some error messages on debian, not on Suse. I tested always on a 64 bit installation. The Suse test I also performed on a 64 bit version.

In the debian version of event.h and evhttp I found some dubious pointers. I contacted the developer with this question. I argue the source of the trouble is a mistake of the debian package manager, may be he packaged 32 bit versions to the 64 bit debian.

Excuse the noise, thanks for patience and your help!

Regards BB