From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Panicz Maciej Godek Newsgroups: gmane.lisp.guile.user,gmane.lisp.guile.devel Subject: Re: Request for feedback on SRFI-126 Date: Mon, 28 Sep 2015 22:02:42 +0200 Message-ID: References: <87zj08t5w1.fsf@T420.taylan> <87vbavtyfz.fsf@T420.taylan> <87mvw7t100.fsf@T420.taylan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e010d82601ed1340520d42ea6 X-Trace: ger.gmane.org 1443489344 7955 80.91.229.3 (29 Sep 2015 01:15:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Sep 2015 01:15:44 +0000 (UTC) Cc: "guile-user@gnu.org" , guile-devel To: =?UTF-8?B?VGF5bGFuIFVscmljaCBCYXnEsXJsxLEvS2FtbWVy?= Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Sep 29 03:15:36 2015 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZgjW2-0007Al-RG for guile-user@m.gmane.org; Tue, 29 Sep 2015 03:15:35 +0200 Original-Received: from localhost ([::1]:43565 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgjW2-00026Z-6E for guile-user@m.gmane.org; Mon, 28 Sep 2015 21:15:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgedK-0005OX-Jm for guile-user@gnu.org; Mon, 28 Sep 2015 16:02:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZgedH-0001H2-R1 for guile-user@gnu.org; Mon, 28 Sep 2015 16:02:46 -0400 Original-Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]:37499) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgedH-0001Gr-Eb; Mon, 28 Sep 2015 16:02:43 -0400 Original-Received: by wicfx3 with SMTP id fx3so116816039wic.0; Mon, 28 Sep 2015 13:02:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=/wr9bcrUUJZ0TxHYJOwF6h/nNQg8h1+Vra0zfikXOTw=; b=JIOcRDwjDvKsbk5NpbF+SWJ6aJ1YF+2H6I/kKCiWvoGHycHppoCPQh2Us32/hyhNty AxTTy/Qhi1OBT4hST8Hd8NKH2BQCBcCRO1eSvXQPxMExNO3dmrVEgZYLQ2mYcez5bmbb wKVN6SERQLllmADaML/t8wLSH5ZGGivT+DvuTKnwyUrGnrQZeN2Mwa7Oj10GlPTDQVj4 zR34umK3CLmbHFe7f7Ne6vqrfIheqOVcwbNYQBiMmO4of0JZywitRMh4h+abTsDZwmGI 9vW3ARIV51h9Wazu7oq7M017pnif5uCRU7E6QgiTO6mRs9gO7TTBZ2RNB5DsitgxeyD/ gv3g== X-Received: by 10.194.110.37 with SMTP id hx5mr24210184wjb.149.1443470562478; Mon, 28 Sep 2015 13:02:42 -0700 (PDT) Original-Received: by 10.194.34.35 with HTTP; Mon, 28 Sep 2015 13:02:42 -0700 (PDT) In-Reply-To: <87mvw7t100.fsf@T420.taylan> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::236 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:12052 gmane.lisp.guile.devel:17872 Archived-At: --089e010d82601ed1340520d42ea6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2015-09-28 10:13 GMT+02:00 Taylan Ulrich Bay=C4=B1rl=C4=B1/Kammer < taylanbayirli@gmail.com>: > Panicz Maciej Godek writes: > > > > Maybe you should explain why there are so many implementations of > > Scheme in the first place? (That isn't the case for Python, Java or > > Perl) > > Because it's too easy to make a standards-compliant implementation > because the standards ask for too little from compliant implementations. > And/or other reasons; don't really know your intent with the question. > Because Scheme is constructed by removing unnecesary features, rather than by adding them. > [...] > > > > That's the Grand Dream, but I don't even think it's *that* far > > away: > > > > Had I such a "Grand Dream", I'd go with Python, because they already > > have that. > > Python still lacks many of Scheme's greatest features. :-) > The MIT course 6.01 that replaces SICP introduces a language Spy, which is a mixture of Python and Scheme. Might be worth checking out, although I don't really think so. Anyway, if anyone's interested, it can be found here= : http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-01= sc-introduction-to-electrical-engineering-and-computer-science-i-spring-201= 1/Syllabus/MIT6_01SCS11_notes.pdf (page 89) > > > Scheme has very different traits, and very different purpose. The > > position of Python stems from its particular notion of elegance, which > > -- although isn't as extreme as Scheme's -- is easier to grasp to the > > masses. This especially regards syntax. Python has a very intuitive > > syntax for its basic notions (including dictionaries). Lisp has "all > > those hairy parentheses", which apparently very few people can > > appreciate, although they help to work with the code greatly, allowing > > to see beyond language's limitations. > > S-expression syntax, allowing things like Paredit, is one of Scheme's > many virtues over other languages. So I would like to use Scheme, not > Python. Currently I can't. (I can use Guile, but it still misses some > "batteries.") > > > I find it daunting that it took us 106 whopping SRFIs to reach a > > *basic* socket API! Scheme could have been taking over the world > > by now. : -) > > > > Not sure what you mean by "taking over the world". That there will be > > many people using it? There won't. That there will be important > > systems based on it? Don't think so. > > Why not? > Because no one does them. > Scheme's power to change the world doesn't stem from standardized > > APIs, but (hopefully) from SICP and the way it affects thinking about > > computer systems. > > Why even bother with something like Guile if the only worth of Scheme > were pedagogical? > No. I never said it's the only worth. I find Guile very practical and convinient tool, despite its flaws. > > And as amazing as it would be if that huge pool of libraries > > existed specifically as Guile modules, I'm not sure if it's > > realistic. > > > > Somehow I can't get amazed with that vision. > > The best thing that Scheme does for programming is that it promotes > > writing software that can be read, and not only executed. What you > > claim to be essential here seems to be a rather minor detail from that > > point of view. > > Libraries *are* software. Currently people *don't* write any of that > "software that can be read" except in small groups. > Small groups are a good start, I guess. > Python lacks many of Scheme's greatest features. > > > > The advantage of which rarely manifests in everyday practice, > > especially if you're not used to working with s-expressions (most > > programmers I know haven't got a clue what those are). > > I recommend that you read this: > > http://norvig.com/python-lisp.html > > I'm wondering more and more why you use Scheme if you think it has no > advantages over Python. > I don't think so, and I never said that. Python has some inherent limitations that Scheme manages to avoid, because it isn't over-specified. I gave that link because it comes from one of the greatest Lisp advocates -- and yet he claims that "Some just couldn't get used to Lisp syntax in the limited amount of class time they had to devote to it", and also "Although some people have initial resistance to the [Python's indentation as block structure]/(Lisp parentheses), most come to [like]/(deeply appreciate) them." Even within the Scheme community there appear voices complaining on the Lisp syntax, like SRFI-105, SRFI-110 or SRFI-119. > If I can't *rely* on the constant-time factor, that's useless. If > > it's reliable, then you specified something effectively equivalent > > to a hash table API. > > > > Sure. The only difference is the cognitive overhead. If you could use > > plain "cons" for constructing hash tables and vectors, that would be a > > big win, because you would remove another weakness and restriction > > that makes this additional feature of yours necessary. > > How can one implement such a miracle cons that constructs a list, > vector, or hash table depending on the programmer's wishes? > > This is a very good question, if taken seriously. (And I really wish I knew the answer) > Maybe you're thinking of something like PHP's arrays, which are somehow > vectors and hash tables at the same time. It's pretty terrible... > It is troublesome, especially combined with PHP's dynamic typing. However, if the optimization could happen through static analysis, that would be a different story. > Scheme does no such muddying of what should be distinct abstract data > types, thankfully. > Well, I don't think that there should be such thing as data types. I'd rather say that there are concepts that programmers wish express (and those rarely are data structures). Hash tables are just an optimization technique for the concept of key-value association that is most accurately expressed using assoc lists. (The problem with assoc lists, however, is their access time) > > > Which "said fundamental features" do you mean? > > > > Hash tables, weak references, sockets, threading, regular > > expressions, record type subtyping, procedural macros, delimited > > continuations, etc. > > > > Hash tables, weak references and threading are just implementation > > details that a programmer usually shouldn't care about. Delimited > > continuations are an academic curiosity, and sockets and regexps are > > just a specific domain (I'm sure you could easily find plenty of > > others; anyway, they are by no means fundamental) > > "Hash tables" are understood to be a data type providing amortized > constant-time key-value lookup. They are nothing more than a mere optimization technique. > Time complexity is part of program semantics, not implementation. There are two papers that seem particularly worthwhile in the context of this discussion. The first one presents the Darlington-Burstall transformation system: http://www.diku.dk/OLD/undervisning/2003e/235/Burstall-1977-TransSystem.pdf The second is the Kent Dybvig's PHD dissertation, in particular chapter 5: http://www.cs.indiana.edu/~dyb/papers/3imp.pdf > Sockets are fundamental because you can't implement them as a library. Sockets are just procedures with side-effects, from the point of view of the semantics of the language. > Regexps > might actually be possible to implement as a portable library, though it > will probably be pretty slow. > On slow implementations of Scheme, perhaps. But on fast implementations they could be, well, pretty fast. These things could not possibly be any more fundamental. > > > You can surely implement threads using call/cc, or even delimited > > continuations. > > No, you can't. Your program will run on one core. > > How can you tell? > > You can implement hash tables and weak references (and > > anything you please) using vectors. > > No, you can't. Hashing requires implementation support. I'm not sure what you mean. Hash table is essentially a vector plus a function that converts data to an integer. Or am I getting something wrong? > It's an actual problem if a Guile user can't use any Scheme > > library that wasn't written with Guile in mind. At the *very* very > > least, the user will need to add define-module boilerplate; in > > practice she or he will probably need to do a lot more. > > > > Somehow to me it has never been a problem. > > What has been the actual problem is the multiplicity of ways that > > things can be expressed in any Scheme implementation (like the fact > > that Scheme provides both lists and vectors as collections, and that > > some implementations also provide multi-dimensional arrays) > > I suspect that the things you use programming languages for differ > greatly from what most programmers use them for. > > Maybe you're right, but that doesn't concern me very much. > I don't feel very motivated to continue this discussion since we seem to > see things way too differently. As you like it. I shall allow myself to drop discussion only if the topics of my interest get depleted, though. --089e010d82601ed1340520d42ea6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
2015= -09-28 10:13 GMT+02:00 Taylan Ulrich Bay=C4=B1rl=C4=B1/Kammer <tayla= nbayirli@gmail.com>:
Pan= icz Maciej Godek <godek.maciek= @gmail.com> writes:
>
> Maybe you should explain why there are so many implementations of
> Scheme in the first place? (That isn't the case for Python, Java o= r
> Perl)

Because it's too easy to make a standards-compliant implementati= on
because the standards ask for too little from compliant implementations. And/or other reasons; don't really know your intent with the question.<= br>

Because Scheme is constructed by removi= ng unnecesary features, rather than by adding them.

>=C2=A0 =C2=A0 =C2=A0[...]
>
>=C2=A0 =C2=A0 =C2=A0That's the Grand Dream, but I don't even th= ink it's *that* far
>=C2=A0 =C2=A0 =C2=A0away:
>
> Had I such a "Grand Dream", I'd go with Python, because = they already
> have that.

Python still lacks many of Scheme's greatest features. :-)

The MIT course 6.01 that replaces SICP intro= duces a language Spy, which is a mixture of Python and Scheme. Might be wor= th checking out, although I don't really think so. Anyway, if anyone= 9;s interested, it can be found here:
(pag= e 89)
=C2=A0

> Scheme has very different traits, and very different purpose. The
> position of Python stems from its particular notion of elegance, which=
> -- although isn't as extreme as Scheme's -- is easier to grasp= to the
> masses. This especially regards syntax. Python has a very intuitive > syntax for its basic notions (including dictionaries). Lisp has "= all
> those hairy parentheses", which apparently very few people can > appreciate, although they help to work with the code greatly, allowing=
> to see beyond language's limitations.

S-expression syntax, allowing things like Paredit, is one of Scheme&= #39;s
many virtues over other languages.=C2=A0 So I would like to use Scheme, not=
Python.=C2=A0 Currently I can't.=C2=A0 (I can use Guile, but it still m= isses some
"batteries.")

>=C2=A0 =C2=A0 =C2=A0I find it daunting that it took us 106 whopping SRF= Is to reach a
>=C2=A0 =C2=A0 =C2=A0*basic* socket API! Scheme could have been taking o= ver the world
>=C2=A0 =C2=A0 =C2=A0by now. : -)
>
> Not sure what you mean by "taking over the world". That ther= e will be
> many people using it? There won't. That there will be important > systems based on it? Don't think so.

Why not?

Because no one does the= m.

> Scheme's power to change the world doesn't stem from standardi= zed
> APIs, but (hopefully) from SICP and the way it affects thinking about<= br> > computer systems.

Why even bother with something like Guile if the only worth of Schem= e
were pedagogical?

No. I never said it&#= 39;s the only worth.
I find Guile very practical and convinient t= ool, despite its flaws.
=C2=A0
>=C2=A0 =C2=A0 =C2=A0And as amazing as it would be if that huge pool of = libraries
>=C2=A0 =C2=A0 =C2=A0existed specifically as Guile modules, I'm not = sure if it's
>=C2=A0 =C2=A0 =C2=A0realistic.
>
> Somehow I can't get amazed with that vision.
> The best thing that Scheme does for programming is that it promotes > writing software that can be read, and not only executed. What you
> claim to be essential here seems to be a rather minor detail from that=
> point of view.

Libraries *are* software.=C2=A0 Currently people *don't* write a= ny of that
"software that can be read" except in small groups.

Small groups are a good start, I guess.
>=C2=A0 =C2=A0 =C2=A0Python lacks many of Scheme's greatest features= .
>
> The advantage of which rarely manifests in everyday practice,
> especially if you're not used to working with s-expressions (most<= br> > programmers I know haven't got a clue what those are).
> I recommend that you read this:
> http://norvig.com/python-lisp.html

I'm wondering more and more why you use Scheme if you think it h= as no
advantages over Python.

I don't thi= nk so, and I never said that. Python has some inherent limitations that Sch= eme manages to avoid, because it isn't over-specified.
I gave= that link because it comes from one of the greatest Lisp advocates -- and = yet he claims that "Some just couldn't get used to Lisp syntax in = the limited amount of class time they had to devote to it", and also &= quot;Although some people have initial resistance to the [Python's inde= ntation as block structure]/(Lisp parentheses), most come to [like]/(deeply= appreciate) them."

Even within the Scheme co= mmunity there appear voices complaining on the Lisp syntax, like SRFI-105, = SRFI-110 or SRFI-119.

>=C2=A0 =C2=A0 =C2=A0If I can't *rely* on the constant-time factor, = that's useless. If
>=C2=A0 =C2=A0 =C2=A0it's reliable, then you specified something eff= ectively equivalent
>=C2=A0 =C2=A0 =C2=A0to a hash table API.
>
> Sure. The only difference is the cognitive overhead. If you could use<= br> > plain "cons" for constructing hash tables and vectors, that = would be a
> big win, because you would remove another weakness and restriction
> that makes this additional feature of yours necessary.

How can one implement such a miracle cons that constructs a list, vector, or hash table depending on the programmer's wishes?


This is a very good question, if taken= seriously. (And I really wish I knew the answer)
=C2=A0
Maybe you're thinking of something like PHP's arrays, which are som= ehow
vectors and hash tables at the same time.=C2=A0 It's pretty terrible...=

It is troublesome, especially combined= with PHP's dynamic typing.
However, if the optimization coul= d happen through static analysis, that would be a different story.
=C2=A0
Scheme does no such muddying of what should be distinct abstract data
types, thankfully.

Well, I don't th= ink that there should be such thing as data types. I'd rather say that = there are concepts that programmers wish express (and those rarely are data= structures). Hash tables are just an optimization technique for the concep= t of key-value association that is most accurately expressed using assoc li= sts. (The problem with assoc lists, however, is their access time)
=C2=A0
>=C2=A0 =C2=A0 =C2=A0> Which "said fundamental features" do= you mean?
>
>=C2=A0 =C2=A0 =C2=A0Hash tables, weak references, sockets, threading, r= egular
>=C2=A0 =C2=A0 =C2=A0expressions, record type subtyping, procedural macr= os, delimited
>=C2=A0 =C2=A0 =C2=A0continuations, etc.
>
> Hash tables, weak references and threading are just implementation
> details that a programmer usually shouldn't care about. Delimited<= br> > continuations are an academic curiosity, and sockets and regexps are > just a specific domain (I'm sure you could easily find plenty of > others; anyway, they are by no means fundamental)

"Hash tables" are understood to be a data type providing a= mortized
constant-time key-value lookup.

They are no= thing more than a mere optimization technique.
=C2=A0
Time complexity is part of program=C2=A0semantics, not implement= ation.

There are two papers that seem parti= cularly worthwhile in the context of this discussion. The first one present= s the Darlington-Burstall transformation system:

=C2=A0
Sockets are=C2=A0fundamenta= l because you can't implement them as a library.=C2=A0

Sockets are just procedures with side-effects, from the po= int of view of the semantics of the language.
=C2=A0
Regexps
might actually be possible to implement as a portable library, though it will probably be pretty slow.

On slow i= mplementations of Scheme, perhaps. But on fast implementations they could b= e, well, pretty fast.

These things could not possibly be any more fundamental.

> You can surely implement threads using call/cc, or even delimited
> continuations.

No, you can't.=C2=A0 Your program will run on one core.


How can you te= ll?
=C2=A0
> You can implement hash tables and weak references (and
> anything you please) using vectors.

No, you can't.=C2=A0 Hashing requires implementation support.

I'm not sure what you mean. Hash table is= essentially a vector plus a function that converts data to an integer. Or = am I getting something wrong?

>=C2=A0 =C2=A0 =C2=A0It's an actual problem if a Guile user can'= t use any Scheme
>=C2=A0 =C2=A0 =C2=A0library that wasn't written with Guile in mind.= At the *very* very
>=C2=A0 =C2=A0 =C2=A0least, the user will need to add define-module boil= erplate; in
>=C2=A0 =C2=A0 =C2=A0practice she or he will probably need to do a lot m= ore.
>
> Somehow to me it has never been a problem.
> What has been the actual problem is the multiplicity of ways that
> things can be expressed in any Scheme implementation (like the fact > that Scheme provides both lists and vectors as collections, and that > some implementations also provide multi-dimensional arrays)

I suspect that the things you use programming languages for differ greatly from what most programmers use them for.


Maybe you're right, but that doesn= 't concern me very much.
=C2=A0
I don't feel very motivated to continue this discussion since we seem t= o
see things way too differently.

As you like= it. I shall allow myself to drop discussion only if the topics of my inter= est get depleted, though.
--089e010d82601ed1340520d42ea6--