* minimalist guile
@ 2006-06-18 13:07 Mildred
2006-06-19 1:29 ` Jon Wilson
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Mildred @ 2006-06-18 13:07 UTC (permalink / raw)
Actually when I look all symbols defined by guile when a program
starts, I found there is too much functions defined.
> $ guile
> guile>
> Display all 1900 possibilities? (y or n)
Isn't that too much ?
I used to program in Lua where there is few basic functions loaded when
a program starts. I know what each function does, and I like it. Maybe
it is also because I am concerned about sandboxes and potentially
dangerous functions.
So, is there someway to limit this number but keep the possibility to
load others functions ?
Maybe i should use many undefines in my ~/.guile file. But this may
cause others problems if I use my programms without this initialisation
script. Any thoughts about that ?
I also like the object-oriented way to call functions/methods, that is
the functions are not defined globally but related to an object. For
example, I think about :
((myobject 'mymethod) parameters ...)
I prefer that to
(myclass-mymethod myobject parameters ...)
Mildred
--
Mildred <xmpp:mildred@jabber.fr> <http://mildred632.free.fr/>
Clef GPG : <hkp://pgp.mit.edu> ou <http://mildred632.free.fr/gpg_key>
Fingerprint : 197C A7E6 645B 4299 6D37 684B 6F9D A8D6 [9A7D 2E2B]
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: minimalist guile
2006-06-18 13:07 minimalist guile Mildred
@ 2006-06-19 1:29 ` Jon Wilson
2006-06-19 3:38 ` Per Bothner
2006-06-19 8:16 ` Ludovic Courtès
2006-06-19 9:36 ` Andy Wingo
2 siblings, 1 reply; 5+ messages in thread
From: Jon Wilson @ 2006-06-19 1:29 UTC (permalink / raw)
Cc: guile-user
Mildred wrote:
> I also like the object-oriented way to call functions/methods, that is
> the functions are not defined globally but related to an object. For
> example, I think about :
>
> ((myobject 'mymethod) parameters ...)
>
> I prefer that to
>
> (myclass-mymethod myobject parameters ...)
Most LISP systems today have some facility for doing OOP. Common Lisp has
the Common Lisp Object System, or CLOS, and guile has GOOPS.
In fact, IIRC, Common Lisp was the first language in which OOP was ever
implemented.
Regards,
Jon
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: minimalist guile
2006-06-19 1:29 ` Jon Wilson
@ 2006-06-19 3:38 ` Per Bothner
0 siblings, 0 replies; 5+ messages in thread
From: Per Bothner @ 2006-06-19 3:38 UTC (permalink / raw)
Cc: guile-user
Jon Wilson wrote:
> In fact, IIRC, Common Lisp was the first language in which OOP was ever
> implemented.
OOP predates Common Lisp by quite a bit. The first object-oriented
programming *language* is generally considered to be Simula67.
--
--Per Bothner
per@bothner.com http://per.bothner.com/
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: minimalist guile
2006-06-18 13:07 minimalist guile Mildred
2006-06-19 1:29 ` Jon Wilson
@ 2006-06-19 8:16 ` Ludovic Courtès
2006-06-19 9:36 ` Andy Wingo
2 siblings, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2006-06-19 8:16 UTC (permalink / raw)
Cc: guile-user
Hi,
Mildred <ml.mildred593@online.fr> writes:
> Actually when I look all symbols defined by guile when a program
> starts, I found there is too much functions defined.
>
>> $ guile
>> guile>
>> Display all 1900 possibilities? (y or n)
>
> Isn't that too much ?
Yes it is (IMO). Arguably, this may have a negative impact on startup
time (at least), plus it makes "sandboxing" harder (because by default,
you always get a whole lot of unwanted bindings).
However, I believe the main issue with spreading those functions over
several modules is compatibility: one cannot simply remove bindings that
have been available "by default" for years.
A solution to this might be to actually spread the functions into
several modules, and then have those modules autoloaded by the default
root module (thereby maintaining compatibility). This might improve
startup time, and it would make code confinement easier because one
could start from the empty module and then selectively import bindings
from these new finer-grain modules.
Thanks,
Ludovic.
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: minimalist guile
2006-06-18 13:07 minimalist guile Mildred
2006-06-19 1:29 ` Jon Wilson
2006-06-19 8:16 ` Ludovic Courtès
@ 2006-06-19 9:36 ` Andy Wingo
2 siblings, 0 replies; 5+ messages in thread
From: Andy Wingo @ 2006-06-19 9:36 UTC (permalink / raw)
Hi,
On Sun, 2006-06-18 at 15:07 +0200, Mildred wrote:
> > $ guile
> > guile>
> > Display all 1900 possibilities? (y or n)
>
> Isn't that too much ?
I think so too. A historical artifact that someone should clean up,
although the compatibility headaches will be many :)
> ((myobject 'mymethod) parameters ...)
>
> I prefer that to
>
> (myclass-mymethod myobject parameters ...)
The existence of generic functions should already be known to you. When
I first started programming this way it felt very awkward to me as well.
However if you think about it, what you have is a noun and a verb -- the
way the verb works depends on the noun (or nouns in this case) that it
operates on. Whether this mapping between verbs, nouns (objects), and
types is done by looking up a table on the generic function or on the
object does not change the semantics of the operation. The space of
available noun-verb combinations is restrained either way.
In fact, the operation-space "footprint" of a method of a generic
function is smaller, because it can specialize on all arguments.
Regards,
--
Andy Wingo
http://wingolog.org/
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-06-19 9:36 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-18 13:07 minimalist guile Mildred
2006-06-19 1:29 ` Jon Wilson
2006-06-19 3:38 ` Per Bothner
2006-06-19 8:16 ` Ludovic Courtès
2006-06-19 9:36 ` Andy Wingo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).