From: Arne Babenhauserheide <arne_bab@web.de>
To: Marko Rauhamaa <marko@pacujo.net>
Cc: "guile-user@gnu.org" <guile-user@gnu.org>
Subject: Re: How to make GNU Guile more successful
Date: Tue, 14 Feb 2017 23:20:01 +0100 [thread overview]
Message-ID: <874lzw5sa6.fsf@web.de> (raw)
In-Reply-To: <87zihp48k4.fsf@elektro.pacujo.net>
[-- Attachment #1: Type: text/plain, Size: 6436 bytes --]
Marko Rauhamaa <marko@pacujo.net> writes:
> Arne Babenhauserheide <arne_bab@web.de>:
>
>> Marko Rauhamaa <marko@pacujo.net> writes:
>>> Then, there's GOOPS, which in my opinion is simply an unnatural way
>>> to go about object-oriented programming. It does violence both to
>>> ordinary OO way of thinking and classic Lisp idioms.
>>
>> GOOPS works pretty well for me where I use it (for dispatch by type).
>> Could you clarify your criticism: Do you think it is bad or is it just
>> different?
>
> GOOPS starts by defining slots. Slots are an objects internal business
> and should not be visible to the outside. Instead, objects should be
> black boxes that interact with methods. For example, the port interface
> is a nice, classic OO API. You don't know anything about the slots of a
> port.
>
> Furthermore, I think an extensive type system is un-Lisp-like. OO is not
> about things belonging to a type but objects interacting through
> methods. In fact, the concept of a "class" could be done away with.
>
>>> Continuations and multiple values are obstacles instead of enablers.
>>
>> I think multiple values are nice. But they are not well-integrated (I
>> have to import something to use them). Why do you think them enablers?
>
> Yes, the multiple values API is a problem in and of itself, but more
> generally, what does:
>
> (values a b c)
>
> give you on top of, say:
>
> (list a b c)
Practically it gives me (let-values (((a b c) (values 1 2 3))) a)
I could get the same by using match on a list, but then I have to use
match on a list instead of just assigning the values. let-values could
be designed to work with lists, though.
So conceptually I assume that the real difference is in implementation:
avoiding the construction of a list.
>> Why do you think that continuations are an obstacle (do you mean
>> general continuations or do you mean prompts)?
>
> Continuations prevent you from implementing Python's try/finally and
> emacs' (unwind-protect).
If I understand it correctly, this is only true, if there are resources
in use which do not get created in the try. I hit that problem when
implementing 'with':
https://bitbucket.org/ArneBab/wisp/src/3a654cfe6632af4b0002ce98c753c07c400aac55/examples/with.w#with.w-8
with (open-file "with.w" "r") as port
format #t "~a\n" (read port)
^ working Guile code which ensures that the port is closed after it is
no longer used. But it can break if a continuation is used. To fix
that, I’d have to add guards which save the state of the port when
code creates a continuation and reconstructs that state when the
continuation is used.
> On the other hand, I don't think any application developer would come to
> a point of thinking, "Hey, I know, I'll use a continuation!"
Error-handling is simply a specific case of that. In Python people use
exceptions for flow control, which can be efficient when the
non-exception case is much, much more common than the exception case
(because in the first case the overhead of that is almost zero).
>>> asyncio, type annotation,
>>
>> type annotations should provide nice ways to optimize for pypy and
>> other more optimizing Python implementations.
>
> You can't have it bothways. A dynamic language liberates you from
> shackles and boilerplate even if it destroys your performance. The
> moment you bring in the boilerplate, you are back to Java.
It’s optional boilerplate which you only add where you really need it.
>> Decorators are really cool to use:
>
> Have yet to find a need for one.
I used them quite a bit. The most efficient one was a caching decorator:
@cached
def fun(a):
# something expensive
return a
In Python 3.2 you can use the standard lru-cache for that:
https://docs.python.org/3/library/functools.html#functools.lru_cache
>>> dunder jungle,
>>
>> What’s that?
>
> <URL: https://docs.python.org/3/genindex-_.html>
Ah, yes :)
I think these are a good way to show that I as developer am venturing
into regions I should only enter when I am really, really sure I want
to, because they can cause problems I may not see right away.
Sadly this rule is broken with if __name__ == "__main__": ...
and for def __init__(self)
So I think it’s good to have that, but not good that programmers need to
use that during typical programming tasks.
>>> meta-object programming,
>>
>> That’s needed to make some things elegant. "Different 20%"-rule again.
>
> Again, I haven't yet found a need to deviate from the regular object
> semantics.
I saw some, like actually accessing and changing the bytecode at runtime
to add tracing commands.
>>> Unicode illusion. (Guile has fallen into that last trap as well,
>>> unfortunately.)
>>
>> I’m using Python and Guile for physics and math (to some degree), and
>> having good Unicode-support is great for that. What’s your practical
>> criticism here?
>
> In Linux, all pathnames, files, sockets, environment variables and
> command-line arguments are, or deal with, bytes. The bytes are often
> encoded with UTF-8, but a programming language cannot assume that, even
> if LOCALE promises otherwise.
>
> It would be better to leave Unicode out of Guile's system interface and
> have the application encode and decode explicitly where needed.
I’m not sure about that. Python3 requires explicit encode/decode, and
it’s a lot of hassle to port from Py2 to Py3 if your application does
lots of socket-operations. I have firsthand experience with that, and
the debugging is gruesome.
But it might have been much better if the program had been created with
Python3 from the start.
>>> There's one thing Python has over Guile, still: Python's system call
>>> support is outstanding. For example, I managed to implement a
>>> full-blown shell using Python. That was the first time I ever ran
>>> into terminal-related system calls, and Python had them all.
>>
>> Which ones are missing in Guile?
>
> For example tcgetattr(3). (Ok, not a system call.)
>
> Missing epoll(2) is inconvenient. Not being able to transfer an open
> file descriptor via sendmsg(2) is really bad.
Do you know whether there is a specific reason for that or whether these
could be added?
Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein
ohne es zu merken
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 800 bytes --]
next prev parent reply other threads:[~2017-02-14 22:20 UTC|newest]
Thread overview: 131+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-12 23:56 How to make GNU Guile more successful Amirouche
2017-02-13 0:21 ` Amirouche
2017-02-13 11:06 ` Arne Babenhauserheide
2017-02-13 12:14 ` Arne Babenhauserheide
2017-02-13 20:20 ` Amirouche
2017-02-13 23:08 ` Arne Babenhauserheide
2017-02-13 20:28 ` Panicz Maciej Godek
2017-02-13 20:42 ` Amirouche
2017-02-13 22:34 ` Marko Rauhamaa
2017-02-13 23:56 ` Arne Babenhauserheide
2017-02-14 0:18 ` David Kastrup
2017-02-14 22:21 ` Arne Babenhauserheide
2017-02-15 17:03 ` Christopher Allan Webber
2017-02-16 19:18 ` sirgazil
2017-02-16 20:26 ` Amirouche
2017-02-14 5:59 ` Marko Rauhamaa
2017-02-14 19:36 ` Linas Vepstas
2017-02-14 20:54 ` Marko Rauhamaa
2017-02-14 22:20 ` Arne Babenhauserheide [this message]
2017-02-13 22:54 ` Arne Babenhauserheide
2017-02-14 9:54 ` Panicz Maciej Godek
2017-02-14 21:35 ` Arne Babenhauserheide
2017-03-01 19:21 ` Amirouche
2017-03-10 20:23 ` Amirouche
2017-07-14 21:54 ` Linas Vepstas
2017-07-14 21:59 ` Marko Rauhamaa
2017-07-15 10:10 ` Jan Wedekind
2017-07-15 12:55 ` Nala Ginrut
2017-07-15 12:58 ` Nala Ginrut
2017-07-15 22:17 ` Jan Wedekind
2017-07-16 9:54 ` Nala Ginrut
2017-07-17 18:52 ` Arun Isaac
2017-07-18 11:22 ` Ernest Adrogué
2017-07-16 8:30 ` Freja Nordsiek
2017-07-16 9:18 ` Marko Rauhamaa
2017-07-16 10:11 ` Freja Nordsiek
2017-07-16 10:31 ` Marko Rauhamaa
2017-07-16 10:39 ` Freja Nordsiek
2017-07-16 10:45 ` Freja Nordsiek
2017-07-20 15:28 ` Guile bugs Ludovic Courtès
2017-07-20 16:22 ` Marko Rauhamaa
2017-07-20 18:26 ` Taylan Ulrich Bayırlı/Kammer
2017-07-20 18:35 ` Marko Rauhamaa
2017-07-20 20:41 ` Ludovic Courtès
2017-07-20 22:23 ` Marko Rauhamaa
2017-07-21 4:05 ` Mark H Weaver
2017-07-21 6:15 ` Marko Rauhamaa
2017-07-21 8:16 ` Chris Vine
2017-07-21 8:27 ` Marko Rauhamaa
2017-07-21 9:17 ` Mark H Weaver
2017-07-21 10:08 ` Marko Rauhamaa
2017-07-21 10:22 ` David Kastrup
2017-09-09 21:14 ` Linas Vepstas
2017-09-09 22:31 ` Marko Rauhamaa
2017-09-09 23:02 ` Linas Vepstas
2017-07-21 16:33 ` Taylan Ulrich Bayırlı/Kammer
2017-07-21 17:12 ` Marko Rauhamaa
2017-07-21 14:19 ` Matt Wette
2017-09-09 20:30 ` Linas Vepstas
2017-09-10 13:11 ` Ludovic Courtès
2017-09-10 19:56 ` Linas Vepstas
2017-09-11 7:26 ` Ludovic Courtès
2017-09-11 8:10 ` Marko Rauhamaa
2017-09-11 11:34 ` Ludovic Courtès
2017-09-14 17:54 ` Linas Vepstas
2017-09-15 7:56 ` Ludovic Courtès
2017-09-19 11:04 ` Linas Vepstas
2017-09-19 20:18 ` Chris Vine
2017-09-19 20:21 ` Chris Vine
2017-09-19 23:39 ` Nala Ginrut
-- strict thread matches above, loose matches on Subject: below --
2017-02-18 1:04 How to make GNU Guile more successful sirgazil
[not found] ` <6315ebf51aec83aaff1c7fbbec685c0b@openmailbox.org>
2017-02-18 15:29 ` sirgazil
2017-02-18 16:55 ` David Pirotte
2017-02-19 18:09 ` sirgazil
2017-02-20 1:00 ` David Pirotte
2017-02-20 6:05 Michael Vehrs
2017-02-20 20:41 ` Arne Babenhauserheide
2017-02-21 6:01 ` Michael Vehrs
2017-02-21 17:18 ` Arne Babenhauserheide
2017-02-21 18:19 ` Amirouche
2017-02-21 18:31 ` Mike Gran
2017-02-21 18:33 ` Amirouche
2017-02-21 18:41 ` Mike Gran
2017-02-21 18:15 ` Amirouche
2017-02-21 19:25 ` Arne Babenhauserheide
2017-03-01 19:25 ` Amirouche
2017-03-03 5:28 ` Nala Ginrut
2017-03-03 9:18 ` David Kastrup
2017-03-03 11:30 ` Nala Ginrut
2017-03-03 12:19 ` David Kastrup
2017-03-03 13:35 ` Nala Ginrut
2017-03-04 23:44 ` Arne Babenhauserheide
2017-03-05 2:05 ` Thomas Morley
2017-03-05 14:01 ` Thomas Morley
2017-03-05 14:09 ` David Kastrup
2017-03-05 14:13 ` Thomas Morley
2017-03-05 14:27 ` Thomas Morley
2017-03-03 17:21 ` Matt Wette
2017-03-03 19:09 ` Amirouche
2017-03-03 19:16 ` Amirouche
2017-03-03 19:24 ` Mike Gran
2017-03-03 20:10 ` Matt Wette
2017-03-03 20:09 ` Matt Wette
2017-02-22 5:51 ` Michael Vehrs
2017-03-04 23:41 Alejandro Sanchez
2017-03-05 0:23 ` Arne Babenhauserheide
2017-03-05 8:23 ` Thien-Thi Nguyen
2017-03-05 14:19 ` Arne Babenhauserheide
2017-03-05 3:09 ` Erik Edrosa
2017-03-05 11:57 ` Jan Wedekind
2017-03-07 3:29 ` Erik Edrosa
2017-03-05 14:27 ` Arne Babenhauserheide
2017-03-05 16:43 ` Nala Ginrut
2017-03-05 23:46 ` Alejandro Sanchez
2017-03-06 9:00 ` Arne Babenhauserheide
2017-03-06 1:31 ` Matt Wette
2017-03-07 4:07 ` Erik Edrosa
2017-03-05 9:40 ` David Kastrup
2017-03-10 2:08 Vítor De Araújo
2017-03-10 9:55 ` Arne Babenhauserheide
2017-03-10 10:03 ` Panicz Maciej Godek
2017-03-10 14:27 ` vbuaraujo
2017-03-10 15:08 ` Panicz Maciej Godek
2017-03-11 7:19 ` Thien-Thi Nguyen
2017-03-13 15:55 ` Nala Ginrut
2017-03-13 16:14 ` Panicz Maciej Godek
2017-03-10 20:17 ` Amirouche
2017-03-11 0:50 ` Vítor De Araújo
2017-03-11 3:02 ` Vítor De Araújo
2017-03-11 7:42 ` Thien-Thi Nguyen
2017-03-14 3:26 ` Christopher Allan Webber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874lzw5sa6.fsf@web.de \
--to=arne_bab@web.de \
--cc=guile-user@gnu.org \
--cc=marko@pacujo.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).